@vcmap/ui 6.3.4 → 6.3.5
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/README.md +0 -2
- package/config/dev.config.json +350 -0
- package/dist/assets/{cesium-4addfedc.js → cesium-54ed57c9.js} +4245 -4224
- package/dist/assets/cesium.js +1 -1
- package/dist/assets/{core-9a0bfa36.js → core-1f683027.js} +5978 -5930
- package/dist/assets/core-workers/panoramaImageWorker.js +1 -1
- package/dist/assets/core.js +1 -1
- package/dist/assets/{ol-fa01f948.js → ol-a164129d.js} +4989 -4969
- package/dist/assets/ol.js +1 -1
- package/dist/assets/{ui-aafcea7d.js → ui-d660ba07.js} +10761 -10171
- package/dist/assets/ui.js +1 -1
- package/dist/assets/vue.js +1 -1
- package/dist/assets/{vuetify-a5225009.js → vuetify-bc604361.js} +1 -1
- package/dist/assets/vuetify.js +1 -1
- package/package.json +8 -13
- package/plugins/package.json +1 -1
- package/src/legend/StyleLegendItem.vue +62 -14
- package/src/legend/StyleLegendItem.vue.d.ts +1 -0
- package/src/legend/legendHelper.d.ts +27 -2
- package/src/legend/legendHelper.js +65 -2
- /package/dist/assets/core-workers/{panoramaImageWorker.js-68ef13ef.js → panoramaImageWorker.js-a8275fd9.js} +0 -0
- /package/dist/assets/{ui-aafcea7d.css → ui-d660ba07.css} +0 -0
- /package/dist/assets/{vue-5cd50c79.js → vue-d940072f.js} +0 -0
- /package/dist/assets/{vuetify-a5225009.css → vuetify-bc604361.css} +0 -0
package/dist/assets/ui.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./ui-
|
|
1
|
+
export * from "./ui-d660ba07.js";
|
package/dist/assets/vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./vue-
|
|
1
|
+
export * from "./vue-d940072f.js";
|
|
@@ -10,7 +10,7 @@ function loadCss(href) {
|
|
|
10
10
|
elem.onerror = reject;
|
|
11
11
|
document.head.appendChild(elem);
|
|
12
12
|
});
|
|
13
|
-
} await loadCss('./assets/vuetify-
|
|
13
|
+
} await loadCss('./assets/vuetify-bc604361.css');import { watch as Q, onScopeDispose as Ze, effectScope as Zl, shallowRef as K, reactive as it, computed as b, watchEffect as Fe, toRefs as Yt, capitalize as Nn, unref as ot, Fragment as ie, isVNode as Rc, Comment as Nc, warn as ja, getCurrentInstance as Hc, ref as j, provide as De, inject as ye, defineComponent as zc, h as Gt, camelize as Ir, toRaw as Be, createVNode as r, mergeProps as O, onBeforeUnmount as Qe, readonly as Ql, onMounted as Ye, onDeactivated as _r, onActivated as Wc, nextTick as we, TransitionGroup as Jl, Transition as jt, isRef as Tn, toRef as $, onBeforeMount as ra, withDirectives as $e, resolveDirective as gt, vShow as Ct, onUpdated as jc, Text as Uc, resolveDynamicComponent as Yc, markRaw as Gc, Teleport as Kc, cloneVNode as qc, createTextVNode as Tt, onUnmounted as Tr, onBeforeUpdate as Xc, withModifiers as Tl, toDisplayString as Zc, vModelText as Qc, resolveComponent as Jc, render as Ar } from "./vue-d940072f.js";
|
|
14
14
|
function rt(e, n) {
|
|
15
15
|
let t;
|
|
16
16
|
function a() {
|
package/dist/assets/vuetify.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./vuetify-
|
|
1
|
+
export * from "./vuetify-bc604361.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vcmap/ui",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.5",
|
|
4
4
|
"author": "Virtual City Systems",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -20,10 +20,7 @@
|
|
|
20
20
|
"format": "prettier --write --list-different . && npm run lint:js -- --fix",
|
|
21
21
|
"prepack": "node build/build.js && node build/buildTypes.js",
|
|
22
22
|
"postinstall": "node build/postInstall.js",
|
|
23
|
-
"install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force"
|
|
24
|
-
"story:dev": "histoire dev",
|
|
25
|
-
"story:build": "histoire build",
|
|
26
|
-
"story:preview": "histoire preview"
|
|
23
|
+
"install-plugins": "cd plugins && npm i --omit peer --no-package-lock --force"
|
|
27
24
|
},
|
|
28
25
|
"repository": {
|
|
29
26
|
"type": "git",
|
|
@@ -58,7 +55,7 @@
|
|
|
58
55
|
},
|
|
59
56
|
"peerDependencies": {
|
|
60
57
|
"@vcmap-cesium/engine": "^11.0.5",
|
|
61
|
-
"@vcmap/core": "^6.3.
|
|
58
|
+
"@vcmap/core": "^6.3.4",
|
|
62
59
|
"ol": "^10.4.0",
|
|
63
60
|
"vue": "~3.4.38",
|
|
64
61
|
"vuetify": "~3.7.14"
|
|
@@ -68,13 +65,11 @@
|
|
|
68
65
|
"@zip.js/zip.js": "2.7.68"
|
|
69
66
|
},
|
|
70
67
|
"devDependencies": {
|
|
71
|
-
"@histoire/plugin-vue": "^0.17.17",
|
|
72
68
|
"@vcmap/rollup-plugin-vcs-ol": "^1.0.5",
|
|
73
69
|
"@vcsuite/eslint-config": "^4.0.0",
|
|
74
|
-
"@vitejs/plugin-vue": "^5.
|
|
75
|
-
"@vitest/coverage-v8": "^
|
|
70
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
71
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
76
72
|
"@vue/test-utils": "^2.4.6",
|
|
77
|
-
"histoire": "^0.17.17",
|
|
78
73
|
"jest-canvas-mock": "^2.5.2",
|
|
79
74
|
"jsdoc": "^4.0.3",
|
|
80
75
|
"jsdoc-plugin-intersection": "^1.0.4",
|
|
@@ -86,9 +81,9 @@
|
|
|
86
81
|
"sass": "^1.80.2",
|
|
87
82
|
"tar": "^7.4.3",
|
|
88
83
|
"typescript": "^5.4.5",
|
|
89
|
-
"vite": "^
|
|
90
|
-
"vite-plugin-vuetify": "
|
|
91
|
-
"vitest": "^
|
|
84
|
+
"vite": "^6.4.2",
|
|
85
|
+
"vite-plugin-vuetify": "~2.0.4",
|
|
86
|
+
"vitest": "^4.1.4",
|
|
92
87
|
"vue-tsc": "^2.1.6"
|
|
93
88
|
},
|
|
94
89
|
"stylelint": {
|
package/plugins/package.json
CHANGED
|
@@ -55,19 +55,51 @@
|
|
|
55
55
|
:stroke-miterlimit="row.stroke?.miterLimit"
|
|
56
56
|
:stroke-width="row.stroke?.width"
|
|
57
57
|
/>
|
|
58
|
-
<
|
|
59
|
-
v-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
58
|
+
<template v-else-if="row.type === StyleRowType.Fill">
|
|
59
|
+
<defs v-if="row.fill?.pattern">
|
|
60
|
+
<pattern
|
|
61
|
+
:id="`legend-fill-pattern-${idx}`"
|
|
62
|
+
x="0"
|
|
63
|
+
y="0"
|
|
64
|
+
:width="patterns[idx].size"
|
|
65
|
+
:height="patterns[idx].size"
|
|
66
|
+
patternUnits="userSpaceOnUse"
|
|
67
|
+
>
|
|
68
|
+
<rect
|
|
69
|
+
:width="patterns[idx].size"
|
|
70
|
+
:height="patterns[idx].size"
|
|
71
|
+
:fill="patterns[idx].bgColor"
|
|
72
|
+
/>
|
|
73
|
+
<line
|
|
74
|
+
v-for="(line, lineIdx) in patterns[idx].lines"
|
|
75
|
+
:key="lineIdx"
|
|
76
|
+
:x1="line.x1"
|
|
77
|
+
:y1="line.y1"
|
|
78
|
+
:x2="line.x2"
|
|
79
|
+
:y2="line.y2"
|
|
80
|
+
:stroke="patterns[idx].lineColor"
|
|
81
|
+
:stroke-width="patterns[idx].lineWidth"
|
|
82
|
+
stroke-linecap="square"
|
|
83
|
+
/>
|
|
84
|
+
</pattern>
|
|
85
|
+
</defs>
|
|
86
|
+
<rect
|
|
87
|
+
width="32"
|
|
88
|
+
height="24"
|
|
89
|
+
:stroke="getColor(row.stroke?.color)"
|
|
90
|
+
:stroke-linecap="row.stroke?.lineCap"
|
|
91
|
+
:stroke-linejoin="row.stroke?.lineJoin"
|
|
92
|
+
:stroke-dasharray="row.stroke?.lineDash"
|
|
93
|
+
:stroke-dashoffset="row.stroke?.lineDashOffset"
|
|
94
|
+
:stroke-miterlimit="row.stroke?.miterLimit"
|
|
95
|
+
:stroke-width="row.stroke?.width"
|
|
96
|
+
:fill="
|
|
97
|
+
row.fill?.pattern
|
|
98
|
+
? `url(#legend-fill-pattern-${idx})`
|
|
99
|
+
: getColor(row.fill?.color) || 'rgba(255,255,255,0)'
|
|
100
|
+
"
|
|
101
|
+
/>
|
|
102
|
+
</template>
|
|
71
103
|
<circle
|
|
72
104
|
v-else-if="row.type === StyleRowType.Circle"
|
|
73
105
|
cx="16"
|
|
@@ -110,7 +142,11 @@
|
|
|
110
142
|
VListItemTitle,
|
|
111
143
|
} from 'vuetify/components';
|
|
112
144
|
import { computed } from 'vue';
|
|
113
|
-
import {
|
|
145
|
+
import {
|
|
146
|
+
StyleRowType,
|
|
147
|
+
getImageSrcFromShape,
|
|
148
|
+
getPatternSvgData,
|
|
149
|
+
} from './legendHelper.js';
|
|
114
150
|
|
|
115
151
|
/**
|
|
116
152
|
* @description A component rendering vector styles as list using {@link https://vuetifyjs.com/en/api/v-list-row v-list-row}
|
|
@@ -150,6 +186,17 @@
|
|
|
150
186
|
}
|
|
151
187
|
return '';
|
|
152
188
|
}
|
|
189
|
+
|
|
190
|
+
const patterns = computed(() => {
|
|
191
|
+
const cache = {};
|
|
192
|
+
props.item.rows.forEach((row, idx) => {
|
|
193
|
+
if (row.fill?.pattern) {
|
|
194
|
+
cache[idx] = getPatternSvgData(row.fill);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return cache;
|
|
198
|
+
});
|
|
199
|
+
|
|
153
200
|
return {
|
|
154
201
|
StyleRowType,
|
|
155
202
|
getImageSrcFromShape,
|
|
@@ -160,6 +207,7 @@
|
|
|
160
207
|
return null;
|
|
161
208
|
},
|
|
162
209
|
determineInnerPadding,
|
|
210
|
+
patterns,
|
|
163
211
|
cols: computed(() => {
|
|
164
212
|
return props.item.colNr === 1 ? 12 : 6;
|
|
165
213
|
}),
|
|
@@ -15,6 +15,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
15
15
|
getImageSrcFromShape: typeof getImageSrcFromShape;
|
|
16
16
|
getColor(color: any): string | null;
|
|
17
17
|
determineInnerPadding: (index: number) => string;
|
|
18
|
+
patterns: import("vue").ComputedRef<{}>;
|
|
18
19
|
cols: import("vue").ComputedRef<6 | 12>;
|
|
19
20
|
}, any, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
21
|
item: {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
/**
|
|
31
31
|
* @typedef {StyleLegendRow & {
|
|
32
|
-
* fill: import("ol/style/Fill.js").Options,
|
|
32
|
+
* fill: import("ol/style/Fill.js").Options | import("@vcmap/core").VectorStyleItemFill,
|
|
33
33
|
* stroke?: import("ol/style/Stroke.js").Options
|
|
34
34
|
* }} FillLegendRow
|
|
35
35
|
*/
|
|
@@ -50,6 +50,18 @@
|
|
|
50
50
|
* @property {import("ol/style/Text.js").Options} text
|
|
51
51
|
* @property {string} [label='Text']
|
|
52
52
|
*/
|
|
53
|
+
/**
|
|
54
|
+
* @typedef {{ x1: number, y1: number, x2: number, y2: number }} PatternLine
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* @typedef {{ size: number, bgColor: string, lineColor: string, lineWidth: number, lines: PatternLine[] }} PatternSvgData
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Computes the SVG data needed to render an inline pattern for a legend row.
|
|
61
|
+
* @param {import("@vcmap/core").VectorStyleItemFill} fill
|
|
62
|
+
* @returns {PatternSvgData}
|
|
63
|
+
*/
|
|
64
|
+
export function getPatternSvgData(fill: import("@vcmap/core").VectorStyleItemFill): PatternSvgData;
|
|
53
65
|
/**
|
|
54
66
|
* @param {import("ol/style/Image.js").Options} image
|
|
55
67
|
* @returns {string}
|
|
@@ -141,7 +153,7 @@ export type StrokeLegendRow = StyleLegendRow & {
|
|
|
141
153
|
stroke: import("ol/style/Stroke.js").Options;
|
|
142
154
|
};
|
|
143
155
|
export type FillLegendRow = StyleLegendRow & {
|
|
144
|
-
fill: import("ol/style/Fill.js").Options;
|
|
156
|
+
fill: import("ol/style/Fill.js").Options | import("@vcmap/core").VectorStyleItemFill;
|
|
145
157
|
stroke?: import("ol/style/Stroke.js").Options;
|
|
146
158
|
};
|
|
147
159
|
export type CircleLegendRow = StyleLegendRow & {
|
|
@@ -157,6 +169,19 @@ export type TextLegendRow = StyleLegendRow & {
|
|
|
157
169
|
text: import("ol/style/Text.js").Options;
|
|
158
170
|
label?: string;
|
|
159
171
|
};
|
|
172
|
+
export type PatternLine = {
|
|
173
|
+
x1: number;
|
|
174
|
+
y1: number;
|
|
175
|
+
x2: number;
|
|
176
|
+
y2: number;
|
|
177
|
+
};
|
|
178
|
+
export type PatternSvgData = {
|
|
179
|
+
size: number;
|
|
180
|
+
bgColor: string;
|
|
181
|
+
lineColor: string;
|
|
182
|
+
lineWidth: number;
|
|
183
|
+
lines: PatternLine[];
|
|
184
|
+
};
|
|
160
185
|
export type LegendEntry = {
|
|
161
186
|
key: string;
|
|
162
187
|
/**
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
getShapeFromOptions,
|
|
3
|
+
PatternType,
|
|
4
|
+
parseColor,
|
|
5
|
+
getStringColor,
|
|
6
|
+
} from '@vcmap/core';
|
|
2
7
|
import { reactive } from 'vue';
|
|
3
8
|
|
|
4
9
|
/**
|
|
@@ -68,7 +73,7 @@ export const StyleRowType = {
|
|
|
68
73
|
|
|
69
74
|
/**
|
|
70
75
|
* @typedef {StyleLegendRow & {
|
|
71
|
-
* fill: import("ol/style/Fill.js").Options,
|
|
76
|
+
* fill: import("ol/style/Fill.js").Options | import("@vcmap/core").VectorStyleItemFill,
|
|
72
77
|
* stroke?: import("ol/style/Stroke.js").Options
|
|
73
78
|
* }} FillLegendRow
|
|
74
79
|
*/
|
|
@@ -94,6 +99,64 @@ export const StyleRowType = {
|
|
|
94
99
|
* @property {string} [label='Text']
|
|
95
100
|
*/
|
|
96
101
|
|
|
102
|
+
/**
|
|
103
|
+
* @typedef {{ x1: number, y1: number, x2: number, y2: number }} PatternLine
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @typedef {{ size: number, bgColor: string, lineColor: string, lineWidth: number, lines: PatternLine[] }} PatternSvgData
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Computes the SVG data needed to render an inline pattern for a legend row.
|
|
112
|
+
* @param {import("@vcmap/core").VectorStyleItemFill} fill
|
|
113
|
+
* @returns {PatternSvgData}
|
|
114
|
+
*/
|
|
115
|
+
export function getPatternSvgData(fill) {
|
|
116
|
+
const size = fill.pattern.size || 10;
|
|
117
|
+
const bgColor = getStringColor(parseColor(fill.color));
|
|
118
|
+
const lineColor = getStringColor(fill.pattern.color);
|
|
119
|
+
const lineWidth = fill.pattern.width;
|
|
120
|
+
|
|
121
|
+
/** @type {PatternLine[]} */
|
|
122
|
+
const lines = [];
|
|
123
|
+
|
|
124
|
+
function addLine(x1, y1, x2, y2) {
|
|
125
|
+
lines.push({ x1, y1, x2, y2 });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
switch (fill.pattern.type) {
|
|
129
|
+
case PatternType.NWSE:
|
|
130
|
+
addLine(size / 2, size, size, size / 2);
|
|
131
|
+
addLine(0, size / 2, size / 2, 0);
|
|
132
|
+
break;
|
|
133
|
+
case PatternType.SWNE:
|
|
134
|
+
addLine(size / 2, size, 0, size / 2);
|
|
135
|
+
addLine(size, size / 2, size / 2, 0);
|
|
136
|
+
break;
|
|
137
|
+
case PatternType.DIAGONALCROSS:
|
|
138
|
+
addLine(size / 2, size, size, size / 2);
|
|
139
|
+
addLine(0, size / 2, size / 2, 0);
|
|
140
|
+
addLine(size / 2, size, 0, size / 2);
|
|
141
|
+
addLine(size, size / 2, size / 2, 0);
|
|
142
|
+
break;
|
|
143
|
+
case PatternType.NS:
|
|
144
|
+
addLine(size / 2, 0, size / 2, size);
|
|
145
|
+
break;
|
|
146
|
+
case PatternType.WE:
|
|
147
|
+
addLine(0, size / 2, size, size / 2);
|
|
148
|
+
break;
|
|
149
|
+
case PatternType.CROSS:
|
|
150
|
+
addLine(size / 2, 0, size / 2, size);
|
|
151
|
+
addLine(0, size / 2, size, size / 2);
|
|
152
|
+
break;
|
|
153
|
+
default:
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return { size, bgColor, lineColor, lineWidth, lines };
|
|
158
|
+
}
|
|
159
|
+
|
|
97
160
|
/**
|
|
98
161
|
* @param {import("ol/style/Image.js").Options} image
|
|
99
162
|
* @returns {string}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|