@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.96 → 2.0.0-next.98
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/bundle/openbridge-webcomponents.bundle.js +39 -124
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +343 -142
- package/dist/ar/poi/poi.d.ts +4 -2
- package/dist/ar/poi/poi.d.ts.map +1 -1
- package/dist/ar/poi/poi.js.map +1 -1
- package/dist/ar/poi-layer/poi-layer.d.ts +1 -0
- package/dist/ar/poi-layer/poi-layer.d.ts.map +1 -1
- package/dist/ar/poi-layer/poi-layer.js.map +1 -1
- package/dist/ar/poi-object/poi-object-aton.d.ts +1 -0
- package/dist/ar/poi-object/poi-object-aton.d.ts.map +1 -1
- package/dist/ar/poi-object/poi-object-aton.js.map +1 -1
- package/dist/automation/automation-badge/automation-badge.d.ts +2 -0
- package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
- package/dist/automation/automation-badge/automation-badge.js.map +1 -1
- package/dist/automation/automation-button/automation-button.d.ts +9 -0
- package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/automation-button.js.map +1 -1
- package/dist/automation/automation-input-modal/automation-input-modal.d.ts +4 -0
- package/dist/automation/automation-input-modal/automation-input-modal.d.ts.map +1 -1
- package/dist/automation/automation-input-modal/automation-input-modal.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.css.js +8 -87
- package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.d.ts +13 -33
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +12 -28
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/building-blocks/alert-list/alert-list.d.ts +4 -0
- package/dist/building-blocks/alert-list/alert-list.d.ts.map +1 -1
- package/dist/building-blocks/alert-list/alert-list.js.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +2 -0
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +2 -0
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
- package/dist/components/advice-floating-item/advice-floating-item.d.ts +2 -4
- package/dist/components/advice-floating-item/advice-floating-item.d.ts.map +1 -1
- package/dist/components/advice-floating-item/advice-floating-item.js.map +1 -1
- package/dist/components/advice-message-item/advice-message-item.d.ts +6 -19
- package/dist/components/advice-message-item/advice-message-item.d.ts.map +1 -1
- package/dist/components/advice-message-item/advice-message-item.js.map +1 -1
- package/dist/components/alert-floating-item/alert-floating-item.d.ts +12 -0
- package/dist/components/alert-floating-item/alert-floating-item.d.ts.map +1 -1
- package/dist/components/alert-floating-item/alert-floating-item.js.map +1 -1
- package/dist/components/alert-menu/alert-menu.d.ts +6 -20
- package/dist/components/alert-menu/alert-menu.d.ts.map +1 -1
- package/dist/components/alert-menu/alert-menu.js.map +1 -1
- package/dist/components/alert-menu-item/alert-menu-item.d.ts +4 -0
- package/dist/components/alert-menu-item/alert-menu-item.d.ts.map +1 -1
- package/dist/components/alert-menu-item/alert-menu-item.js.map +1 -1
- package/dist/components/chat-message/chat-message.d.ts +3 -0
- package/dist/components/chat-message/chat-message.d.ts.map +1 -1
- package/dist/components/chat-message/chat-message.js.map +1 -1
- package/dist/components/elevated-card-radio/elevated-card-radio.d.ts +2 -6
- package/dist/components/elevated-card-radio/elevated-card-radio.d.ts.map +1 -1
- package/dist/components/elevated-card-radio/elevated-card-radio.js.map +1 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.d.ts +6 -0
- package/dist/components/keyboard-numeric/keyboard-numeric.d.ts.map +1 -1
- package/dist/components/keyboard-numeric/keyboard-numeric.js.map +1 -1
- package/dist/components/notification-floating-item/notification-floating-item.d.ts +2 -4
- package/dist/components/notification-floating-item/notification-floating-item.d.ts.map +1 -1
- package/dist/components/notification-floating-item/notification-floating-item.js.map +1 -1
- package/dist/components/sequence-card/sequence-card.d.ts +9 -0
- package/dist/components/sequence-card/sequence-card.d.ts.map +1 -1
- package/dist/components/sequence-card/sequence-card.js.map +1 -1
- package/dist/components/sequence-item/sequence-item.d.ts +5 -0
- package/dist/components/sequence-item/sequence-item.d.ts.map +1 -1
- package/dist/components/sequence-item/sequence-item.js.map +1 -1
- package/dist/components/sequence-modal/sequence-modal.d.ts +4 -0
- package/dist/components/sequence-modal/sequence-modal.d.ts.map +1 -1
- package/dist/components/sequence-modal/sequence-modal.js.map +1 -1
- package/dist/components/sequence-step/sequence-step.d.ts.map +1 -1
- package/dist/components/sequence-step/sequence-step.js.map +1 -1
- package/dist/components/slider-double/slider-double.d.ts +4 -8
- package/dist/components/slider-double/slider-double.d.ts.map +1 -1
- package/dist/components/slider-double/slider-double.js.map +1 -1
- package/dist/components/status-indicator/status-indicator.d.ts +1 -0
- package/dist/components/status-indicator/status-indicator.d.ts.map +1 -1
- package/dist/components/status-indicator/status-indicator.js.map +1 -1
- package/dist/components/system-menu/system-menu.d.ts +2 -0
- package/dist/components/system-menu/system-menu.d.ts.map +1 -1
- package/dist/components/system-menu/system-menu.js.map +1 -1
- package/dist/components/table-header-item/table-header-item.d.ts +2 -0
- package/dist/components/table-header-item/table-header-item.d.ts.map +1 -1
- package/dist/components/table-header-item/table-header-item.js.map +1 -1
- package/dist/components/tag/tag.d.ts +1 -0
- package/dist/components/tag/tag.d.ts.map +1 -1
- package/dist/components/tag/tag.js.map +1 -1
- package/dist/components/toggletip/toggletip.d.ts +4 -4
- package/dist/components/toggletip/toggletip.js.map +1 -1
- package/dist/components/user-menu/user-menu.d.ts +1 -0
- package/dist/components/user-menu/user-menu.d.ts.map +1 -1
- package/dist/components/user-menu/user-menu.js.map +1 -1
- package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts +1 -0
- package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts.map +1 -1
- package/dist/integration-systems/integration-app-bar/integration-app-bar.js.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.d.ts +0 -1
- package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
- package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +9 -9
- package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts +1 -0
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts.map +1 -1
- package/dist/integration-systems/integration-fleet-button/integration-fleet-button.js.map +1 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.d.ts +1 -0
- package/dist/integration-systems/integration-tabs/integration-tabs.d.ts.map +1 -1
- package/dist/integration-systems/integration-tabs/integration-tabs.js.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +0 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.js +17 -7
- package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
- package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/watch.js +2 -2
- package/dist/navigation-instruments/watch/watch.js.map +1 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +0 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
- package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
- package/dist/pages/alert-detail-page/alert-detail-page.d.ts.map +1 -1
- package/dist/pages/alert-detail-page/alert-detail-page.js.map +1 -1
- package/package.json +3 -2
- package/script/check-slot-event-docs.ts +353 -0
- package/src/ar/poi/poi.ts +4 -2
- package/src/ar/poi-layer/poi-layer.ts +1 -0
- package/src/ar/poi-object/poi-object-aton.ts +1 -0
- package/src/automation/automation-badge/automation-badge.ts +2 -0
- package/src/automation/automation-button/automation-button.ts +9 -0
- package/src/automation/automation-input-modal/automation-input-modal.ts +4 -0
- package/src/automation/automation-tank/automation-tank.css +8 -64
- package/src/automation/automation-tank/automation-tank.stories.ts +41 -23
- package/src/automation/automation-tank/automation-tank.ts +25 -65
- package/src/building-blocks/alert-list/alert-list.ts +4 -0
- package/src/building-blocks/bar-horizontal/bar-horizontal.ts +2 -0
- package/src/building-blocks/bar-vertical/bar-vertical.ts +2 -0
- package/src/components/advice-floating-item/advice-floating-item.ts +2 -4
- package/src/components/advice-message-item/advice-message-item.ts +6 -19
- package/src/components/alert-floating-item/alert-floating-item.ts +12 -0
- package/src/components/alert-menu/alert-menu.ts +6 -20
- package/src/components/alert-menu-item/alert-menu-item.ts +4 -0
- package/src/components/chat-message/chat-message.ts +3 -0
- package/src/components/elevated-card-radio/elevated-card-radio.ts +2 -6
- package/src/components/keyboard-numeric/keyboard-numeric.ts +6 -0
- package/src/components/notification-floating-item/notification-floating-item.ts +2 -4
- package/src/components/sequence-card/sequence-card.ts +9 -0
- package/src/components/sequence-item/sequence-item.ts +5 -0
- package/src/components/sequence-modal/sequence-modal.ts +4 -0
- package/src/components/sequence-step/sequence-step.ts +3 -0
- package/src/components/slider-double/slider-double.ts +4 -8
- package/src/components/status-indicator/status-indicator.ts +1 -0
- package/src/components/system-menu/system-menu.ts +2 -0
- package/src/components/table-header-item/table-header-item.ts +2 -0
- package/src/components/tag/tag.ts +1 -0
- package/src/components/toggletip/toggletip.ts +4 -4
- package/src/components/user-menu/user-menu.ts +1 -0
- package/src/integration-systems/integration-app-bar/integration-app-bar.ts +1 -0
- package/src/integration-systems/integration-bar/integration-bar.ts +0 -1
- package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.ts +9 -9
- package/src/integration-systems/integration-fleet-button/integration-fleet-button.ts +1 -0
- package/src/integration-systems/integration-tabs/integration-tabs.ts +1 -0
- package/src/navigation-instruments/compass-sector/compass-sector.ts +0 -1
- package/src/navigation-instruments/watch/tickmark.spec.ts +99 -0
- package/src/navigation-instruments/watch/tickmark.ts +21 -8
- package/src/navigation-instruments/watch/watch.ts +7 -2
- package/src/navigation-instruments/wind-propulsion/wind-propulsion.ts +0 -1
- package/src/pages/alert-detail-page/alert-detail-page.ts +7 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import {describe, it, expect} from 'vitest';
|
|
2
|
+
import type {SVGTemplateResult} from 'lit';
|
|
3
|
+
import {tickmark, TickmarkType, TickmarkStyle} from './tickmark.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Collect every numeric interpolated value from a `tickmark()` result without
|
|
7
|
+
* rendering it. `tickmark()` returns Lit `SVGTemplateResult`s (or an array of
|
|
8
|
+
* them); the interpolated `x`/`y`/coordinate values live on `.values`. This
|
|
9
|
+
* lets us assert the geometry is finite in a plain Node environment — no DOM.
|
|
10
|
+
*/
|
|
11
|
+
function numericValues(
|
|
12
|
+
result: SVGTemplateResult | SVGTemplateResult[]
|
|
13
|
+
): number[] {
|
|
14
|
+
const templates = Array.isArray(result) ? result : [result];
|
|
15
|
+
const numbers: number[] = [];
|
|
16
|
+
for (const template of templates) {
|
|
17
|
+
for (const value of template.values) {
|
|
18
|
+
if (typeof value === 'number') {
|
|
19
|
+
numbers.push(value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return numbers;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('tickmark label positioning', () => {
|
|
27
|
+
// On first paint the element is not laid out yet, so obc-watch computes a
|
|
28
|
+
// scale of 0. A `textOnly` tick still renders a <text>, and dividing by a
|
|
29
|
+
// zero scale used to yield x/y of ±Infinity — which the browser rejects with
|
|
30
|
+
// `<text> attribute x: Expected length, "-Infinity"` (issue #1032).
|
|
31
|
+
it('keeps the zero-value textOnly label finite when the scale is 0', () => {
|
|
32
|
+
const result = tickmark(-90, {
|
|
33
|
+
size: TickmarkType.textOnly,
|
|
34
|
+
style: TickmarkStyle.regular,
|
|
35
|
+
scale: 0,
|
|
36
|
+
text: '0',
|
|
37
|
+
inside: false,
|
|
38
|
+
textRadius: 184,
|
|
39
|
+
maxDigits: 1,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
for (const value of numericValues(result)) {
|
|
43
|
+
expect(Number.isFinite(value)).toBe(true);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('keeps labelled ticks finite for a zero scale (inside and outside)', () => {
|
|
48
|
+
for (const inside of [false, true]) {
|
|
49
|
+
const result = tickmark(45, {
|
|
50
|
+
size: TickmarkType.primary,
|
|
51
|
+
style: TickmarkStyle.regular,
|
|
52
|
+
scale: 0,
|
|
53
|
+
text: '50',
|
|
54
|
+
inside,
|
|
55
|
+
textRadius: 184,
|
|
56
|
+
maxDigits: 2,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
for (const value of numericValues(result)) {
|
|
60
|
+
expect(Number.isFinite(value)).toBe(true);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('keeps rotated labels finite for a zero scale', () => {
|
|
66
|
+
const result = tickmark(120, {
|
|
67
|
+
size: TickmarkType.primary,
|
|
68
|
+
style: TickmarkStyle.regular,
|
|
69
|
+
scale: 0,
|
|
70
|
+
text: '12',
|
|
71
|
+
inside: false,
|
|
72
|
+
textRadius: 184,
|
|
73
|
+
rotation: 120,
|
|
74
|
+
maxDigits: 2,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
for (const value of numericValues(result)) {
|
|
78
|
+
expect(Number.isFinite(value)).toBe(true);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('does not distort geometry for a valid scale', () => {
|
|
83
|
+
// A settled scale must be untouched: the outside zero tick at -90° sits on
|
|
84
|
+
// the negative-x axis, so its x is finite and negative and y is ~0.
|
|
85
|
+
const result = tickmark(-90, {
|
|
86
|
+
size: TickmarkType.textOnly,
|
|
87
|
+
style: TickmarkStyle.regular,
|
|
88
|
+
scale: 1,
|
|
89
|
+
text: '0',
|
|
90
|
+
inside: false,
|
|
91
|
+
textRadius: 184,
|
|
92
|
+
maxDigits: 1,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const numbers = numericValues(result);
|
|
96
|
+
expect(numbers.every(Number.isFinite)).toBe(true);
|
|
97
|
+
expect(numbers.some((n) => n < -100)).toBe(true);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -64,14 +64,15 @@ export function tickmark(
|
|
|
64
64
|
endLabelsMaxMin?: boolean;
|
|
65
65
|
}
|
|
66
66
|
): SVGTemplateResult | SVGTemplateResult[] {
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
// Before layout settles the caller can pass a scale of 0 (or a non-finite
|
|
68
|
+
// value). Label offsets are computed as `px / scale`, so a 0 scale would emit
|
|
69
|
+
// ±Infinity coordinates that the browser rejects. Fall back to a 1:1 scale
|
|
70
|
+
// until a real one is available (issue #1032).
|
|
71
|
+
const safeScale = Number.isFinite(scale) && scale > 0 ? scale : 1;
|
|
71
72
|
const rOff = radiusOffset;
|
|
72
73
|
let innerRadius: number;
|
|
73
74
|
let outerRadius: number;
|
|
74
|
-
textRadius = textRadius + (3 /
|
|
75
|
+
textRadius = textRadius + (3 / safeScale + 3) * (inside ? -1 : 1);
|
|
75
76
|
const rad = (angle * Math.PI) / 180;
|
|
76
77
|
if (size === TickmarkType.primary) {
|
|
77
78
|
innerRadius = 328 / 2 + rOff;
|
|
@@ -90,7 +91,13 @@ export function tickmark(
|
|
|
90
91
|
outerRadius = 336 / 2 + rOff;
|
|
91
92
|
} else {
|
|
92
93
|
return [
|
|
93
|
-
textSvg(text ?? '', {
|
|
94
|
+
textSvg(text ?? '', {
|
|
95
|
+
angle,
|
|
96
|
+
inside,
|
|
97
|
+
scale: safeScale,
|
|
98
|
+
textRadius,
|
|
99
|
+
endLabelsMaxMin,
|
|
100
|
+
}),
|
|
94
101
|
];
|
|
95
102
|
}
|
|
96
103
|
|
|
@@ -121,11 +128,17 @@ export function tickmark(
|
|
|
121
128
|
if (rotation === undefined) {
|
|
122
129
|
return [
|
|
123
130
|
tick,
|
|
124
|
-
textSvg(text, {
|
|
131
|
+
textSvg(text, {
|
|
132
|
+
angle,
|
|
133
|
+
inside,
|
|
134
|
+
scale: safeScale,
|
|
135
|
+
textRadius,
|
|
136
|
+
endLabelsMaxMin,
|
|
137
|
+
}),
|
|
125
138
|
];
|
|
126
139
|
} else {
|
|
127
140
|
const newRadius =
|
|
128
|
-
textRadius + ((4 /
|
|
141
|
+
textRadius + ((4 / safeScale + 5) * (inside ? -1 : 1) * maxDigits) / 2;
|
|
129
142
|
const textX = Math.sin(rad) * newRadius;
|
|
130
143
|
const textY = -Math.cos(rad) * newRadius;
|
|
131
144
|
return [
|
|
@@ -690,8 +690,13 @@ export class ObcWatch extends LitElement {
|
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
const scale = Math.min(clientWidth / width, clientHeight / height);
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
// On first paint the element and its parent can both still be zero-sized, so
|
|
694
|
+
// the scale is 0 (or non-finite). That value flows into `px / scale` label
|
|
695
|
+
// math and yields ±Infinity coordinates the browser rejects. Fall back to a
|
|
696
|
+
// 1:1 scale until a real size is available; the ResizeController re-renders
|
|
697
|
+
// with the true scale once the element is laid out (issue #1032).
|
|
698
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
699
|
+
return 1;
|
|
695
700
|
}
|
|
696
701
|
return scale;
|
|
697
702
|
}
|
|
@@ -30,6 +30,13 @@ export enum AlertDetailPageType {
|
|
|
30
30
|
|
|
31
31
|
@localized()
|
|
32
32
|
/**
|
|
33
|
+
* @slot note-label - Label for the note section, rendered when `hasNote` is true
|
|
34
|
+
* @slot note - Note content, rendered when `hasNote` is true
|
|
35
|
+
* @slot readout-graph-title - Title for the readout graph, rendered when `hasReadoutGraph` is true
|
|
36
|
+
* @slot readout-graph - Readout graph content, rendered when `hasReadoutGraph` is true
|
|
37
|
+
* @slot action - Action controls, rendered when `hasActions` is true
|
|
38
|
+
* @slot <detail>-label - Overrides the label of the `<detail>` field (e.g. `tagId-label`, `category-label`, `time-label`)
|
|
39
|
+
* @slot <detail>-value - Overrides the value of the `<detail>` field (e.g. `tagId-value`, `category-value`, `time-value`)
|
|
33
40
|
* @beta
|
|
34
41
|
*/
|
|
35
42
|
@customElement('obc-alert-detail-page')
|