@oicl/openbridge-webcomponents 0.0.15-dev-20241203183951 → 0.0.15-dev-20241203184948
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/__snapshots__/building-blocks-poi-line--primary.png +0 -0
- package/__snapshots__/button-poi-target-button--primary.png +0 -0
- package/__snapshots__/navigation-instruments-poi-target--primary.png +0 -0
- package/custom-elements.json +76 -43
- package/dist/components/poi-target-button/poi-target-button.css.js +65 -77
- package/dist/components/poi-target-button/poi-target-button.css.js.map +1 -1
- package/dist/components/poi-target-button/poi-target-button.d.ts +2 -1
- package/dist/components/poi-target-button/poi-target-button.d.ts.map +1 -1
- package/dist/components/poi-target-button/poi-target-button.js +7 -4
- package/dist/components/poi-target-button/poi-target-button.js.map +1 -1
- package/dist/navigation-instruments/poi-graphic-line/poi-config.d.ts +14 -11
- package/dist/navigation-instruments/poi-graphic-line/poi-config.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-graphic-line/poi-config.js +18 -42
- package/dist/navigation-instruments/poi-graphic-line/poi-config.js.map +1 -1
- package/dist/navigation-instruments/poi-graphic-line/poi-graphic-line.d.ts +9 -3
- package/dist/navigation-instruments/poi-graphic-line/poi-graphic-line.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-graphic-line/poi-graphic-line.js +147 -42
- package/dist/navigation-instruments/poi-graphic-line/poi-graphic-line.js.map +1 -1
- package/dist/navigation-instruments/poi-line/poi-line.css.js +8 -7
- package/dist/navigation-instruments/poi-line/poi-line.css.js.map +1 -1
- package/dist/navigation-instruments/poi-line/poi-line.d.ts +1 -1
- package/dist/navigation-instruments/poi-line/poi-line.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-line/poi-line.js +28 -10
- package/dist/navigation-instruments/poi-line/poi-line.js.map +1 -1
- package/dist/navigation-instruments/poi-line/pointerDot.d.ts +7 -1
- package/dist/navigation-instruments/poi-line/pointerDot.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-line/pointerDot.js +96 -99
- package/dist/navigation-instruments/poi-line/pointerDot.js.map +1 -1
- package/dist/navigation-instruments/poi-target/arrow.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-target/arrow.js +1 -0
- package/dist/navigation-instruments/poi-target/arrow.js.map +1 -1
- package/dist/navigation-instruments/poi-target/poi-target.css.js +9 -11
- package/dist/navigation-instruments/poi-target/poi-target.css.js.map +1 -1
- package/dist/navigation-instruments/poi-target/poi-target.d.ts +4 -0
- package/dist/navigation-instruments/poi-target/poi-target.d.ts.map +1 -1
- package/dist/navigation-instruments/poi-target/poi-target.js +21 -20
- package/dist/navigation-instruments/poi-target/poi-target.js.map +1 -1
- package/package.json +1 -1
- package/src/components/poi-target-button/poi-target-button.css +20 -10
- package/src/components/poi-target-button/poi-target-button.stories.ts +6 -0
- package/src/components/poi-target-button/poi-target-button.ts +7 -2
- package/src/navigation-instruments/poi-graphic-line/poi-config.ts +24 -27
- package/src/navigation-instruments/poi-graphic-line/poi-graphic-line.stories.ts +3 -4
- package/src/navigation-instruments/poi-graphic-line/poi-graphic-line.ts +145 -38
- package/src/navigation-instruments/poi-line/poi-line.css +8 -7
- package/src/navigation-instruments/poi-line/poi-line.stories.ts +5 -5
- package/src/navigation-instruments/poi-line/poi-line.ts +29 -8
- package/src/navigation-instruments/poi-line/pointerDot.ts +115 -99
- package/src/navigation-instruments/poi-target/arrow.ts +1 -0
- package/src/navigation-instruments/poi-target/poi-target.css +9 -13
- package/src/navigation-instruments/poi-target/poi-target.stories.ts +5 -5
- package/src/navigation-instruments/poi-target/poi-target.ts +31 -23
@@ -5,7 +5,7 @@ import {POIStyle} from './poi-config';
|
|
5
5
|
|
6
6
|
const meta: Meta<typeof ObcPoiGraphicLine> = {
|
7
7
|
title: 'Building blocks/POI Graphic Line',
|
8
|
-
tags: ['autodocs'
|
8
|
+
tags: ['autodocs'],
|
9
9
|
component: 'obc-poi-graphic-line',
|
10
10
|
argTypes: {
|
11
11
|
lineStyle: {
|
@@ -15,13 +15,12 @@ const meta: Meta<typeof ObcPoiGraphicLine> = {
|
|
15
15
|
},
|
16
16
|
},
|
17
17
|
|
18
|
-
|
18
|
+
lineHeight: {control: {type: 'range', min: 32, max: 192, step: 2}},
|
19
19
|
},
|
20
20
|
args: {
|
21
|
-
|
21
|
+
lineHeight: 96,
|
22
22
|
lineStyle: POIStyle.Enhanced,
|
23
23
|
},
|
24
|
-
decorators: [],
|
25
24
|
} satisfies Meta<ObcPoiGraphicLine>;
|
26
25
|
|
27
26
|
export default meta;
|
@@ -1,67 +1,67 @@
|
|
1
1
|
import {LitElement, html, unsafeCSS} from 'lit';
|
2
2
|
import {customElement, property} from 'lit/decorators.js';
|
3
|
-
import {
|
3
|
+
import {POILineParams, POIStyle, POI_LINE_CONFIG} from './poi-config';
|
4
4
|
import componentStyle from './poi-graphic-line.css?inline';
|
5
5
|
|
6
|
-
function getLineColors(style: POIStyle): POIStyleConfig {
|
7
|
-
const colors = POI_STYLES[style];
|
8
|
-
if (!colors) {
|
9
|
-
throw new Error(`Style: ${style} not supported`);
|
10
|
-
}
|
11
|
-
return colors;
|
12
|
-
}
|
13
|
-
|
14
6
|
@customElement('obc-poi-graphic-line')
|
15
7
|
export class ObcPoiGraphicLine extends LitElement {
|
16
|
-
@property({type: Number})
|
8
|
+
@property({type: Number}) lineHeight: number = 96;
|
9
|
+
@property({type: Number}) width: number = 4;
|
10
|
+
@property({type: Number}) lineStart: number = 1;
|
17
11
|
@property({type: String}) lineStyle: POIStyle = POIStyle.Enhanced;
|
18
|
-
@property({type: String}) lineState: POIState = POIState.solid;
|
19
12
|
|
20
13
|
override render() {
|
21
|
-
const
|
22
|
-
const
|
14
|
+
const style = POI_LINE_CONFIG[this.lineStyle];
|
15
|
+
const filterDimensions = style.filterDimensions;
|
16
|
+
const path = `M${this.width / 2} ${this.lineStart}L${this.width / 2} ${this.lineHeight + this.lineStart}`;
|
23
17
|
|
24
|
-
return html
|
25
|
-
<svg
|
18
|
+
return html`
|
19
|
+
<svg
|
20
|
+
width="${this.width}"
|
21
|
+
height="${this.lineHeight + style.lineEnd}"
|
22
|
+
viewBox="0 0 ${this.width} ${this.lineHeight + style.lineEnd}"
|
23
|
+
fill="none"
|
24
|
+
vector-effect="non-scaling-stroke"
|
25
|
+
>
|
26
26
|
<mask
|
27
|
-
id="
|
27
|
+
id="poi_graphic_line_mask"
|
28
28
|
style="mask-type:alpha"
|
29
29
|
maskUnits="userSpaceOnUse"
|
30
|
-
x="
|
31
|
-
y="
|
30
|
+
x="${this.width / 2 - 2}"
|
31
|
+
y="-1"
|
32
32
|
width="4"
|
33
|
-
height="${this.
|
33
|
+
height="${this.lineHeight + 4}"
|
34
34
|
>
|
35
35
|
<path
|
36
36
|
d="${path}"
|
37
|
-
stroke="url(#
|
37
|
+
stroke="url(#poi_graphic_line_linear_gradient)"
|
38
38
|
stroke-width="4"
|
39
39
|
stroke-linecap="round"
|
40
40
|
/>
|
41
41
|
</mask>
|
42
|
-
<g mask="url(#
|
43
|
-
<g filter="url(#
|
42
|
+
<g mask="url(#poi_graphic_line_mask)">
|
43
|
+
<g filter="url(#poi_graphic_line_filter)">
|
44
44
|
<path
|
45
45
|
d=${path}
|
46
|
-
stroke="${
|
47
|
-
stroke-width="
|
46
|
+
stroke="${style.outlineColor}"
|
47
|
+
stroke-width="${style.outlineWidth}"
|
48
48
|
stroke-linecap="round"
|
49
49
|
/>
|
50
50
|
</g>
|
51
51
|
<path
|
52
52
|
d=${path}
|
53
|
-
stroke="${
|
54
|
-
stroke-width="
|
53
|
+
stroke="${style.lineColor}"
|
54
|
+
stroke-width="${style.lineWidth}"
|
55
55
|
stroke-linecap="round"
|
56
56
|
/>
|
57
57
|
</g>
|
58
58
|
<defs>
|
59
59
|
<filter
|
60
|
-
id="
|
61
|
-
x="
|
62
|
-
y="
|
63
|
-
width="
|
64
|
-
height="${this.
|
60
|
+
id="poi_graphic_line_filter"
|
61
|
+
x="${filterDimensions.x}"
|
62
|
+
y="${filterDimensions.y}"
|
63
|
+
width="${filterDimensions.width}"
|
64
|
+
height="${this.lineHeight + filterDimensions.width}"
|
65
65
|
filterUnits="userSpaceOnUse"
|
66
66
|
color-interpolation-filters="sRGB"
|
67
67
|
>
|
@@ -76,7 +76,7 @@ export class ObcPoiGraphicLine extends LitElement {
|
|
76
76
|
<feGaussianBlur stdDeviation="0.5" />
|
77
77
|
<feColorMatrix
|
78
78
|
type="matrix"
|
79
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
79
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${style.shadowAlpha} 0"
|
80
80
|
/>
|
81
81
|
<feBlend
|
82
82
|
mode="normal"
|
@@ -91,11 +91,11 @@ export class ObcPoiGraphicLine extends LitElement {
|
|
91
91
|
/>
|
92
92
|
</filter>
|
93
93
|
<linearGradient
|
94
|
-
id="
|
95
|
-
x1="2.5"
|
96
|
-
y1="
|
97
|
-
x2="2.5"
|
98
|
-
y2="${this.
|
94
|
+
id="poi_graphic_line_linear_gradient"
|
95
|
+
x1="${this.width / 2 + 0.5}"
|
96
|
+
y1="${this.lineStart}"
|
97
|
+
x2="${this.width / 2 + 0.5}"
|
98
|
+
y2="${this.lineHeight + this.lineStart}"
|
99
99
|
gradientUnits="userSpaceOnUse"
|
100
100
|
>
|
101
101
|
<stop stop-color="#C2C2C2" />
|
@@ -103,12 +103,119 @@ export class ObcPoiGraphicLine extends LitElement {
|
|
103
103
|
</linearGradient>
|
104
104
|
</defs>
|
105
105
|
</svg>
|
106
|
-
|
106
|
+
`;
|
107
107
|
}
|
108
108
|
|
109
109
|
static override styles = unsafeCSS(componentStyle);
|
110
110
|
}
|
111
111
|
|
112
|
+
export function graphicLine({
|
113
|
+
style,
|
114
|
+
lineHeight,
|
115
|
+
totalHeight,
|
116
|
+
}: {
|
117
|
+
style: POILineParams;
|
118
|
+
lineHeight: number;
|
119
|
+
totalHeight: number;
|
120
|
+
}) {
|
121
|
+
const lineStart = 1;
|
122
|
+
const lineEnd = lineStart + lineHeight;
|
123
|
+
|
124
|
+
const width = style.width;
|
125
|
+
const filterDimensions = style.filterDimensions;
|
126
|
+
const path = `M${width / 2} ${lineStart}L${width / 2} ${lineEnd}`;
|
127
|
+
|
128
|
+
return html`
|
129
|
+
<svg
|
130
|
+
width="${width}"
|
131
|
+
height="${totalHeight}"
|
132
|
+
viewBox="0 0 ${width} ${totalHeight}"
|
133
|
+
fill="none"
|
134
|
+
vector-effect="non-scaling-stroke"
|
135
|
+
>
|
136
|
+
<mask
|
137
|
+
id="poi_graphic_line_mask"
|
138
|
+
style="mask-type:alpha"
|
139
|
+
maskUnits="userSpaceOnUse"
|
140
|
+
x="${width / 2 - 2}"
|
141
|
+
y="-1"
|
142
|
+
width="4"
|
143
|
+
height="${lineHeight + 4}"
|
144
|
+
>
|
145
|
+
<path
|
146
|
+
d="${path}"
|
147
|
+
stroke="url(#poi_graphic_line_linear_gradient)"
|
148
|
+
stroke-width="4"
|
149
|
+
stroke-linecap="round"
|
150
|
+
/>
|
151
|
+
</mask>
|
152
|
+
<g mask="url(#poi_graphic_line_mask)">
|
153
|
+
<g filter="url(#poi_graphic_line_filter)">
|
154
|
+
<path
|
155
|
+
d=${path}
|
156
|
+
stroke="${style.outlineColor}"
|
157
|
+
stroke-width="${style.outlineWidth}"
|
158
|
+
stroke-linecap="round"
|
159
|
+
/>
|
160
|
+
</g>
|
161
|
+
<path
|
162
|
+
d=${path}
|
163
|
+
stroke="${style.lineColor}"
|
164
|
+
stroke-width="${style.lineWidth}"
|
165
|
+
stroke-linecap="round"
|
166
|
+
/>
|
167
|
+
</g>
|
168
|
+
<defs>
|
169
|
+
<filter
|
170
|
+
id="poi_graphic_line_filter"
|
171
|
+
x="${filterDimensions.x + width / 2 - 2}"
|
172
|
+
y="${filterDimensions.y}"
|
173
|
+
width="${filterDimensions.width}"
|
174
|
+
height="${lineHeight + filterDimensions.width}"
|
175
|
+
filterUnits="userSpaceOnUse"
|
176
|
+
color-interpolation-filters="sRGB"
|
177
|
+
>
|
178
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
179
|
+
<feColorMatrix
|
180
|
+
in="SourceAlpha"
|
181
|
+
type="matrix"
|
182
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
183
|
+
result="hardAlpha"
|
184
|
+
/>
|
185
|
+
<feOffset dy="1" />
|
186
|
+
<feGaussianBlur stdDeviation="0.5" />
|
187
|
+
<feColorMatrix
|
188
|
+
type="matrix"
|
189
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${style.shadowAlpha} 0"
|
190
|
+
/>
|
191
|
+
<feBlend
|
192
|
+
mode="normal"
|
193
|
+
in2="BackgroundImageFix"
|
194
|
+
result="effect1_dropShadow_903_40238"
|
195
|
+
/>
|
196
|
+
<feBlend
|
197
|
+
mode="normal"
|
198
|
+
in="SourceGraphic"
|
199
|
+
in2="effect1_dropShadow_903_40238"
|
200
|
+
result="shape"
|
201
|
+
/>
|
202
|
+
</filter>
|
203
|
+
<linearGradient
|
204
|
+
id="poi_graphic_line_linear_gradient"
|
205
|
+
x1="${width / 2 + 0.5}"
|
206
|
+
y1="${lineStart}"
|
207
|
+
x2="${width / 2 + 0.5}"
|
208
|
+
y2="${lineEnd}"
|
209
|
+
gradientUnits="userSpaceOnUse"
|
210
|
+
>
|
211
|
+
<stop stop-color="#C2C2C2" />
|
212
|
+
<stop offset="0.989583" stop-color="#C2C2C2" stop-opacity="0" />
|
213
|
+
</linearGradient>
|
214
|
+
</defs>
|
215
|
+
</svg>
|
216
|
+
`;
|
217
|
+
}
|
218
|
+
|
112
219
|
declare global {
|
113
220
|
interface HTMLElementTagNameMap {
|
114
221
|
'obc-poi-graphic-line': ObcPoiGraphicLine;
|
@@ -5,18 +5,18 @@ import {POIStyle} from '../poi-graphic-line/poi-config';
|
|
5
5
|
|
6
6
|
const meta: Meta<typeof ObcPoiLine> = {
|
7
7
|
title: 'Building blocks/POI Line',
|
8
|
-
tags: ['autodocs'
|
8
|
+
tags: ['autodocs'],
|
9
9
|
component: 'obc-poi-line',
|
10
10
|
argTypes: {
|
11
|
-
|
11
|
+
poiStyle: {
|
12
12
|
options: [POIStyle.Normal, POIStyle.Enhanced],
|
13
13
|
control: {type: 'select'},
|
14
14
|
},
|
15
|
-
height: {control: {type: 'range', min: 32, max:
|
15
|
+
height: {control: {type: 'range', min: 32, max: 200, step: 1}},
|
16
16
|
},
|
17
17
|
args: {
|
18
|
-
|
19
|
-
height:
|
18
|
+
poiStyle: POIStyle.Enhanced,
|
19
|
+
height: 96,
|
20
20
|
},
|
21
21
|
} satisfies Meta<ObcPoiLine>;
|
22
22
|
|
@@ -3,21 +3,42 @@ import {customElement, property} from 'lit/decorators.js';
|
|
3
3
|
import compentStyle from './poi-line.css?inline';
|
4
4
|
import '../poi-graphic-line/poi-graphic-line';
|
5
5
|
import {renderPointerDot} from './pointerDot';
|
6
|
-
import {POIStyle} from '../poi-graphic-line/poi-config';
|
6
|
+
import {POI_LINE_CONFIG, POIStyle} from '../poi-graphic-line/poi-config';
|
7
|
+
import {graphicLine} from '../poi-graphic-line/poi-graphic-line';
|
7
8
|
|
8
9
|
@customElement('obc-poi-line')
|
9
10
|
export class ObcPoiLine extends LitElement {
|
10
11
|
@property({type: Number}) height: number = 96;
|
11
|
-
@property({type: String})
|
12
|
+
@property({type: String}) poiStyle: POIStyle = POIStyle.Normal;
|
12
13
|
|
13
14
|
override render() {
|
15
|
+
const style = POI_LINE_CONFIG[this.poiStyle];
|
16
|
+
let lineHeight = this.height - 4;
|
17
|
+
let centerX = 2;
|
18
|
+
let centerYOffset = 1;
|
19
|
+
if (this.poiStyle === POIStyle.Normal) {
|
20
|
+
lineHeight = this.height - 3;
|
21
|
+
centerYOffset = 2;
|
22
|
+
centerX = 1;
|
23
|
+
}
|
24
|
+
|
25
|
+
const totalHeight = lineHeight + style.width + style.dotStart;
|
26
|
+
|
14
27
|
return html`
|
15
|
-
<div
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
${renderPointerDot({
|
28
|
+
<div
|
29
|
+
class="container"
|
30
|
+
style="height: ${totalHeight}px; width: ${style.width}px;"
|
31
|
+
>
|
32
|
+
${graphicLine({style, lineHeight, totalHeight})}
|
33
|
+
${renderPointerDot({
|
34
|
+
lineStyle: this.poiStyle,
|
35
|
+
centerX: centerX,
|
36
|
+
centerY: lineHeight + centerYOffset,
|
37
|
+
width: style.width,
|
38
|
+
vbHeight: totalHeight,
|
39
|
+
lineColor: style.lineColor,
|
40
|
+
outlineColor: style.outlineColor,
|
41
|
+
})}
|
21
42
|
</div>
|
22
43
|
`;
|
23
44
|
}
|
@@ -1,102 +1,118 @@
|
|
1
|
-
import {html} from 'lit';
|
1
|
+
import {html, svg} from 'lit';
|
2
2
|
import {POIStyle} from '../poi-graphic-line/poi-config';
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
4
|
+
function createCircle({
|
5
|
+
x,
|
6
|
+
y,
|
7
|
+
width,
|
8
|
+
height,
|
9
|
+
rx,
|
10
|
+
stroke,
|
11
|
+
}: {
|
12
|
+
x: number;
|
13
|
+
y: number;
|
14
|
+
width: number;
|
15
|
+
height: number;
|
16
|
+
rx: number;
|
17
|
+
stroke: string;
|
18
|
+
}) {
|
19
|
+
return svg`<rect x="${x}" y="${y}" width="${width}" height="${height}" rx="${rx}" stroke="${stroke}">`;
|
20
|
+
}
|
21
|
+
|
22
|
+
export function renderPointerDot({
|
23
|
+
lineStyle,
|
24
|
+
centerX,
|
25
|
+
centerY,
|
26
|
+
width,
|
27
|
+
vbHeight,
|
28
|
+
lineColor,
|
29
|
+
outlineColor,
|
30
|
+
}: {
|
31
|
+
lineStyle: POIStyle;
|
32
|
+
centerX: number;
|
33
|
+
centerY: number;
|
34
|
+
width: number;
|
35
|
+
vbHeight: number;
|
36
|
+
lineColor: string;
|
37
|
+
outlineColor: string;
|
38
|
+
}) {
|
39
|
+
let innerCircle = svg`<rect
|
40
|
+
x="${centerX}"
|
41
|
+
y="${centerY}"
|
42
|
+
width="4"
|
43
|
+
height="4"
|
44
|
+
rx="2"
|
45
|
+
fill="${lineColor}"
|
46
|
+
/>`;
|
47
|
+
|
48
|
+
let outerCircle = null;
|
49
|
+
let filterY = centerY;
|
50
|
+
|
51
|
+
if (lineStyle !== POIStyle.Normal) {
|
52
|
+
outerCircle = createCircle({
|
53
|
+
x: centerX - 0.5,
|
54
|
+
y: centerY - 0.5,
|
55
|
+
width: 5,
|
56
|
+
height: 5,
|
57
|
+
rx: 2.5,
|
58
|
+
stroke: outlineColor,
|
59
|
+
});
|
60
|
+
filterY = centerY - 1;
|
61
|
+
} else {
|
62
|
+
innerCircle = svg`<rect
|
63
|
+
x="${centerX}"
|
64
|
+
y="${centerY}"
|
65
|
+
width="2"
|
66
|
+
height="2"
|
67
|
+
rx="1"
|
68
|
+
fill="${lineColor}"
|
69
|
+
/>`;
|
70
|
+
}
|
71
|
+
|
72
|
+
return html`<svg
|
73
|
+
width=${width}
|
74
|
+
height="${vbHeight}"
|
75
|
+
viewBox="0 0 ${width} ${vbHeight}"
|
76
|
+
fill="none"
|
77
|
+
xmlns="http://www.w3.org/2000/svg"
|
78
|
+
vector-effect="non-scaling-stroke"
|
79
|
+
>
|
80
|
+
<g filter="url(#pointerDotFilter)">${innerCircle} ${outerCircle}</g>
|
81
|
+
<defs>
|
82
|
+
<filter
|
83
|
+
id="pointerDotFilter"
|
84
|
+
x="${0}"
|
85
|
+
y="${filterY}"
|
86
|
+
width="${width}"
|
87
|
+
height="${width}"
|
88
|
+
filterUnits="userSpaceOnUse"
|
89
|
+
color-interpolation-filters="sRGB"
|
90
|
+
>
|
91
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix" />
|
92
|
+
<feColorMatrix
|
93
|
+
in="SourceAlpha"
|
94
|
+
type="matrix"
|
95
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
96
|
+
result="hardAlpha"
|
97
|
+
/>
|
98
|
+
<feOffset dy="1" />
|
99
|
+
<feGaussianBlur stdDeviation="0.5" />
|
100
|
+
<feColorMatrix
|
101
|
+
type="matrix"
|
102
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
|
103
|
+
/>
|
104
|
+
<feBlend
|
105
|
+
mode="normal"
|
106
|
+
in2="BackgroundImageFix"
|
107
|
+
result="pointerDotDropShadow"
|
108
|
+
/>
|
109
|
+
<feBlend
|
110
|
+
mode="normal"
|
111
|
+
in="SourceGraphic"
|
112
|
+
in2="pointerDotDropShadow"
|
113
|
+
result="shape"
|
114
|
+
/>
|
115
|
+
</filter>
|
116
|
+
</defs>
|
117
|
+
</svg>`;
|
102
118
|
}
|
@@ -16,6 +16,7 @@ export function pointerArrow(pointerType: Pointer, value: string) {
|
|
16
16
|
viewBox="0 0 16 16"
|
17
17
|
fill="none"
|
18
18
|
xmlns="http://www.w3.org/2000/svg"
|
19
|
+
vector-effect="non-scaling-stroke"
|
19
20
|
>
|
20
21
|
<g filter="url(#filter0_d_903_44142)">
|
21
22
|
<path d=${path} fill="${fill}" stroke="var(--border-silhouette-color)" />
|
@@ -1,22 +1,18 @@
|
|
1
|
-
.
|
1
|
+
.container {
|
2
2
|
padding: 0;
|
3
3
|
background: transparent;
|
4
4
|
appearance: none;
|
5
|
-
width:
|
5
|
+
width: 200px;
|
6
6
|
height: auto;
|
7
7
|
border: none;
|
8
8
|
display: flex;
|
9
|
+
flex-direction: row;
|
10
|
+
}
|
11
|
+
|
12
|
+
.wrapper {
|
13
|
+
position: relative;
|
14
|
+
display: flex;
|
9
15
|
flex-direction: column;
|
10
16
|
align-items: center;
|
11
|
-
|
12
|
-
|
13
|
-
&.type-arrow-left {
|
14
|
-
width: 56px;
|
15
|
-
flex-direction: row-reverse;
|
16
|
-
}
|
17
|
-
|
18
|
-
&.type-arrow-right {
|
19
|
-
width: 56px;
|
20
|
-
flex-direction: row;
|
21
|
-
}
|
17
|
+
width: 48px;
|
22
18
|
}
|
@@ -1,21 +1,21 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
|
-
import {ObcPoiTarget, Pointer} from './poi-target';
|
2
|
+
import {ObcPoiTarget, Pointer, TargetValue} from './poi-target';
|
3
3
|
import './poi-target';
|
4
4
|
|
5
5
|
const meta: Meta<typeof ObcPoiTarget> = {
|
6
6
|
title: 'Navigation Instruments/POI Target',
|
7
|
-
tags: ['autodocs'
|
7
|
+
tags: ['autodocs'],
|
8
8
|
component: 'obc-poi-target',
|
9
9
|
args: {
|
10
|
-
height:
|
11
|
-
value:
|
10
|
+
height: 192,
|
11
|
+
value: TargetValue.checked,
|
12
12
|
pointerType: Pointer.Line,
|
13
13
|
relativeDirection: 0,
|
14
14
|
},
|
15
15
|
argTypes: {
|
16
16
|
height: {control: {type: 'range', min: 32, max: 243, step: 1}},
|
17
17
|
value: {
|
18
|
-
options: [
|
18
|
+
options: [TargetValue.enabled, TargetValue.checked],
|
19
19
|
control: {type: 'select'},
|
20
20
|
},
|
21
21
|
pointerType: {
|