@oicl/openbridge-webcomponents-svelte 2.0.0-next.147 → 2.0.0-next.149

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.
@@ -22,6 +22,8 @@ import type {TransmitterButtonSize} from '@oicl/openbridge-webcomponents/dist/au
22
22
  /** Integer digits to reserve / hint (independent of `fractionDigits`). */
23
23
  maxDigits?: number;
24
24
  hintedZeros?: boolean;
25
+ /** Reserve a minus-sign column on every segment, filled by the real sign only while a value is negative, so the chip's width does not change across zero. */
26
+ hasSignSpacer?: boolean;
25
27
  size?: TransmitterButtonSize;
26
28
  hasIcon?: boolean;
27
29
  hasAdvice?: boolean;
@@ -15,6 +15,8 @@ export interface Props {
15
15
  /** Integer digits to reserve / hint (independent of `fractionDigits`). */
16
16
  maxDigits?: number;
17
17
  hintedZeros?: boolean;
18
+ /** Reserve a minus-sign column on every segment, filled by the real sign only while a value is negative, so the chip's width does not change across zero. */
19
+ hasSignSpacer?: boolean;
18
20
  size?: TransmitterButtonSize;
19
21
  hasIcon?: boolean;
20
22
  hasAdvice?: boolean;
@@ -17,6 +17,8 @@
17
17
  /** Integer digits to reserve / hint (independent of `fractionDigits`). */
18
18
  maxDigits?: number;
19
19
  hintedZeros?: boolean;
20
+ /** Reserve a minus-sign column on every segment, filled by the real sign only while a value is negative, so the width does not change across zero. */
21
+ hasSignSpacer?: boolean;
20
22
  hasIcon?: boolean;
21
23
  hasAdvice?: boolean;
22
24
  /** Advisory value shown in the leading advice segment when `hasAdvice`. */
@@ -12,6 +12,8 @@ export interface Props {
12
12
  /** Integer digits to reserve / hint (independent of `fractionDigits`). */
13
13
  maxDigits?: number;
14
14
  hintedZeros?: boolean;
15
+ /** Reserve a minus-sign column on every segment, filled by the real sign only while a value is negative, so the width does not change across zero. */
16
+ hasSignSpacer?: boolean;
15
17
  hasIcon?: boolean;
16
18
  hasAdvice?: boolean;
17
19
  /** Advisory value shown in the leading advice segment when `hasAdvice`. */
@@ -46,12 +46,18 @@ import type {AlertFrameConfig} from '@oicl/openbridge-webcomponents/dist/compone
46
46
  */
47
47
  maxDigits?: number;
48
48
  /**
49
- * Render muted leading zeros filling the integer part to `maxDigits`.
49
+ * Render muted leading zeros filling the integer part to `maxDigits`. A negative value keeps them all — the sign is prepended and never consumes a zero (`maxDigits` 3: `12.3` → `012.3`, `-12.3` → `-012.3`) — so a negative reading is one character wider than a positive one unless `hasSignSpacer` reserves the sign column. An unavailable value renders dashes across the whole reserved width (`‒‒‒.‒`) instead of the short placeholder.
50
50
  *
51
51
  * Available when `valueType==number`.
52
52
  */
53
53
  hintedZeros?: boolean;
54
- /** Explicit longest string to reserve width for (e.g. `"0000.0"`). */
54
+ /**
55
+ * Reserve a minus-sign column ahead of the digits: an invisible sign placeholder holds the column open while the value is non-negative and the real sign fills it when negative, so the width does not change across zero. Enable it on readouts whose value can go negative; all-positive readouts reserve nothing.
56
+ *
57
+ * Available when `valueType==number`.
58
+ */
59
+ hasSignSpacer?: boolean;
60
+ /** Explicit longest string to reserve width for (e.g. `"0000.0"`). Combined with the `maxDigits`-derived reserve by taking whichever is wider, so it can never reserve less than the formatted value needs. */
55
61
  spaceReserver?: string | undefined;
56
62
  /** Render `offText` instead of a number (e.g. equipment powered down). */
57
63
  off?: boolean;
@@ -38,12 +38,18 @@ export interface Props {
38
38
  */
39
39
  maxDigits?: number;
40
40
  /**
41
- * Render muted leading zeros filling the integer part to `maxDigits`.
41
+ * Render muted leading zeros filling the integer part to `maxDigits`. A negative value keeps them all — the sign is prepended and never consumes a zero (`maxDigits` 3: `12.3` → `012.3`, `-12.3` → `-012.3`) — so a negative reading is one character wider than a positive one unless `hasSignSpacer` reserves the sign column. An unavailable value renders dashes across the whole reserved width (`‒‒‒.‒`) instead of the short placeholder.
42
42
  *
43
43
  * Available when `valueType==number`.
44
44
  */
45
45
  hintedZeros?: boolean;
46
- /** Explicit longest string to reserve width for (e.g. `"0000.0"`). */
46
+ /**
47
+ * Reserve a minus-sign column ahead of the digits: an invisible sign placeholder holds the column open while the value is non-negative and the real sign fills it when negative, so the width does not change across zero. Enable it on readouts whose value can go negative; all-positive readouts reserve nothing.
48
+ *
49
+ * Available when `valueType==number`.
50
+ */
51
+ hasSignSpacer?: boolean;
52
+ /** Explicit longest string to reserve width for (e.g. `"0000.0"`). Combined with the `maxDigits`-derived reserve by taking whichever is wider, so it can never reserve less than the formatted value needs. */
47
53
  spaceReserver?: string | undefined;
48
54
  /** Render `offText` instead of a number (e.g. equipment powered down). */
49
55
  off?: boolean;
@@ -31,7 +31,9 @@ variant?: IconButtonVariant;
31
31
  /** If true, displays a label below the icon using the `label` slot. */
32
32
  hasLabel?: boolean;
33
33
  /** If false, and cornerLeft or cornerRight is true, the divider is not shown. */
34
- showDivider?: boolean
34
+ showDivider?: boolean;
35
+ /** Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. */
36
+ ariaLabel?: string | null
35
37
  }
36
38
  export interface Events {
37
39
  onClick?: (event: CustomEvent<unknown>) => void
@@ -27,6 +27,8 @@ export interface Props {
27
27
  hasLabel?: boolean;
28
28
  /** If false, and cornerLeft or cornerRight is true, the divider is not shown. */
29
29
  showDivider?: boolean;
30
+ /** Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. */
31
+ ariaLabel?: string | null;
30
32
  }
31
33
  export interface Events {
32
34
  onClick?: (event: CustomEvent<unknown>) => void;
@@ -51,14 +51,14 @@
51
51
  fleetButtonLabel?: string
52
52
  }
53
53
  export interface Events {
54
- onFleetButtonClick?: (event: CustomEvent<unknown>) => void;
55
- onLinkButtonClicked?: (event: CustomEvent<unknown>) => void;
56
- onAlertButtonClicked?: (event: CustomEvent<unknown>) => void;
57
- onNotificationButtonClicked?: (event: CustomEvent<unknown>) => void;
58
- onScreenButtonClicked?: (event: CustomEvent<unknown>) => void;
59
- onSystemButtonClicked?: (event: CustomEvent<unknown>) => void;
60
- onDimmingButtonClicked?: (event: CustomEvent<unknown>) => void;
61
- onUserButtonClicked?: (event: CustomEvent<unknown>) => void
54
+ onFleetButtonClick?: (event: CustomEvent) => void;
55
+ onLinkButtonClicked?: (event: CustomEvent) => void;
56
+ onAlertButtonClicked?: (event: CustomEvent) => void;
57
+ onNotificationButtonClicked?: (event: CustomEvent) => void;
58
+ onScreenButtonClicked?: (event: CustomEvent) => void;
59
+ onSystemButtonClicked?: (event: CustomEvent) => void;
60
+ onDimmingButtonClicked?: (event: CustomEvent) => void;
61
+ onUserButtonClicked?: (event: CustomEvent) => void
62
62
  }
63
63
  export interface Slots {
64
64
  clock?: Snippet;
@@ -45,14 +45,14 @@ export interface Props {
45
45
  fleetButtonLabel?: string;
46
46
  }
47
47
  export interface Events {
48
- onFleetButtonClick?: (event: CustomEvent<unknown>) => void;
49
- onLinkButtonClicked?: (event: CustomEvent<unknown>) => void;
50
- onAlertButtonClicked?: (event: CustomEvent<unknown>) => void;
51
- onNotificationButtonClicked?: (event: CustomEvent<unknown>) => void;
52
- onScreenButtonClicked?: (event: CustomEvent<unknown>) => void;
53
- onSystemButtonClicked?: (event: CustomEvent<unknown>) => void;
54
- onDimmingButtonClicked?: (event: CustomEvent<unknown>) => void;
55
- onUserButtonClicked?: (event: CustomEvent<unknown>) => void;
48
+ onFleetButtonClick?: (event: CustomEvent) => void;
49
+ onLinkButtonClicked?: (event: CustomEvent) => void;
50
+ onAlertButtonClicked?: (event: CustomEvent) => void;
51
+ onNotificationButtonClicked?: (event: CustomEvent) => void;
52
+ onScreenButtonClicked?: (event: CustomEvent) => void;
53
+ onSystemButtonClicked?: (event: CustomEvent) => void;
54
+ onDimmingButtonClicked?: (event: CustomEvent) => void;
55
+ onUserButtonClicked?: (event: CustomEvent) => void;
56
56
  }
57
57
  export interface Slots {
58
58
  clock?: Snippet;
@@ -9,27 +9,96 @@
9
9
  export interface Props {
10
10
  class?: string;
11
11
  style?: string;
12
+ /** Home button at the left end of the bar. */
12
13
  showHomeButton?: boolean;
14
+ /**
15
+ * Pressed styling for the home button.
16
+ *
17
+ * Available when `showHomeButton==true`.
18
+ */
13
19
  homeButtonActivated?: boolean;
20
+ /** Link button, between home and the selector. */
21
+ showLinkButton?: boolean;
22
+ /**
23
+ * Pressed styling for the link button.
24
+ *
25
+ * Available when `showLinkButton==true`.
26
+ */
27
+ linkButtonActivated?: boolean;
28
+ /** Renders the `clock` slot at the right end. */
14
29
  showClock?: boolean;
30
+ /** Alert button, first in the right-hand group. */
31
+ showAlertButton?: boolean;
32
+ /**
33
+ * Pressed styling for the alert button.
34
+ *
35
+ * Available when `showAlertButton==true`.
36
+ */
37
+ alertButtonActivated?: boolean;
38
+ /** Notification button, after the alert button. */
15
39
  showNotificationButton?: boolean;
40
+ /**
41
+ * Pressed styling; the count badge only appears in this state.
42
+ *
43
+ * Available when `showNotificationButton==true`.
44
+ */
16
45
  notificationButtonActivated?: boolean;
46
+ /**
47
+ * Number drawn in the count badge.
48
+ *
49
+ * Available when `showNotificationButton==true && showNotificationCount==true && notificationButtonActivated==true`.
50
+ */
17
51
  notificationCount?: number;
52
+ /**
53
+ * Draws the count badge on the notification button.
54
+ *
55
+ * Available when `showNotificationButton==true && notificationButtonActivated==true`.
56
+ */
18
57
  showNotificationCount?: boolean;
58
+ /** Screen button, after the notification button. */
59
+ showScreenButton?: boolean;
60
+ /**
61
+ * Pressed styling for the screen button.
62
+ *
63
+ * Available when `showScreenButton==true`.
64
+ */
65
+ screenButtonActivated?: boolean;
66
+ /** User button, last before the clock. */
19
67
  showUserButton?: boolean;
68
+ /**
69
+ * Pressed styling for the user button.
70
+ *
71
+ * Available when `showUserButton==true`.
72
+ */
20
73
  userButtonActivated?: boolean;
74
+ /** Dimming button, between system and user. */
21
75
  showDimmingButton?: boolean;
76
+ /**
77
+ * Pressed styling for the dimming button.
78
+ *
79
+ * Available when `showDimmingButton==true`.
80
+ */
22
81
  dimmingButtonActivated?: boolean;
82
+ /** System button, after the screen button. */
23
83
  showSystemButton?: boolean;
84
+ /**
85
+ * Pressed styling for the system button.
86
+ *
87
+ * Available when `showSystemButton==true`.
88
+ */
24
89
  systemButtonActivated?: boolean;
90
+ /** How many `status-icon-N`/`status-label-N` slot pairs are rendered. */
25
91
  nStatusFields?: number
26
92
  }
27
93
  export interface Events {
28
- onHomeButtonClicked?: (event: CustomEvent<unknown>) => void;
29
- onDimmingButtonClicked?: (event: CustomEvent<unknown>) => void;
30
- onNotificationButtonClicked?: (event: CustomEvent<unknown>) => void;
31
- onUserButtonClicked?: (event: CustomEvent<unknown>) => void;
32
- onSystemButtonClicked?: (event: CustomEvent<unknown>) => void
94
+ onHomeButtonClicked?: (event: CustomEvent) => void;
95
+ onLinkButtonClicked?: (event: CustomEvent) => void;
96
+ onAlertButtonClicked?: (event: CustomEvent) => void;
97
+ onDimmingButtonClicked?: (event: CustomEvent) => void;
98
+ onNotificationButtonClicked?: (event: CustomEvent) => void;
99
+ onScreenButtonClicked?: (event: CustomEvent) => void;
100
+ onUserButtonClicked?: (event: CustomEvent) => void;
101
+ onSystemButtonClicked?: (event: CustomEvent) => void
33
102
  }
34
103
  export interface Slots {
35
104
  vesselSelector?: Snippet;
@@ -41,14 +110,14 @@
41
110
  statusIcon3?: Snippet;
42
111
  clock?: Snippet
43
112
  }
44
- const {onHomeButtonClicked, onDimmingButtonClicked, onNotificationButtonClicked, onUserButtonClicked, onSystemButtonClicked, class: className, style, vesselSelector, statusLabel1, statusIcon1, statusLabel2, statusIcon2, statusLabel3, statusIcon3, clock, ...props} = $props<Props & Events & Slots>();
113
+ const {onHomeButtonClicked, onLinkButtonClicked, onAlertButtonClicked, onDimmingButtonClicked, onNotificationButtonClicked, onScreenButtonClicked, onUserButtonClicked, onSystemButtonClicked, class: className, style, vesselSelector, statusLabel1, statusIcon1, statusLabel2, statusIcon2, statusLabel3, statusIcon3, clock, ...props} = $props<Props & Events & Slots>();
45
114
 
46
115
  </script>
47
116
  <obc-integration-bar-dropdown
48
117
  use:setProperties={props}
49
118
  class={className}
50
119
  style={style}
51
- use:forwardEvents={{'home-button-clicked': onHomeButtonClicked, 'dimming-button-clicked': onDimmingButtonClicked, 'notification-button-clicked': onNotificationButtonClicked, 'user-button-clicked': onUserButtonClicked, 'system-button-clicked': onSystemButtonClicked}} >
120
+ use:forwardEvents={{'home-button-clicked': onHomeButtonClicked, 'link-button-clicked': onLinkButtonClicked, 'alert-button-clicked': onAlertButtonClicked, 'dimming-button-clicked': onDimmingButtonClicked, 'notification-button-clicked': onNotificationButtonClicked, 'screen-button-clicked': onScreenButtonClicked, 'user-button-clicked': onUserButtonClicked, 'system-button-clicked': onSystemButtonClicked}} >
52
121
 
53
122
  {#if vesselSelector}
54
123
  <div slot="vessel-selector">
@@ -3,27 +3,96 @@ import type { Snippet } from 'svelte';
3
3
  export interface Props {
4
4
  class?: string;
5
5
  style?: string;
6
+ /** Home button at the left end of the bar. */
6
7
  showHomeButton?: boolean;
8
+ /**
9
+ * Pressed styling for the home button.
10
+ *
11
+ * Available when `showHomeButton==true`.
12
+ */
7
13
  homeButtonActivated?: boolean;
14
+ /** Link button, between home and the selector. */
15
+ showLinkButton?: boolean;
16
+ /**
17
+ * Pressed styling for the link button.
18
+ *
19
+ * Available when `showLinkButton==true`.
20
+ */
21
+ linkButtonActivated?: boolean;
22
+ /** Renders the `clock` slot at the right end. */
8
23
  showClock?: boolean;
24
+ /** Alert button, first in the right-hand group. */
25
+ showAlertButton?: boolean;
26
+ /**
27
+ * Pressed styling for the alert button.
28
+ *
29
+ * Available when `showAlertButton==true`.
30
+ */
31
+ alertButtonActivated?: boolean;
32
+ /** Notification button, after the alert button. */
9
33
  showNotificationButton?: boolean;
34
+ /**
35
+ * Pressed styling; the count badge only appears in this state.
36
+ *
37
+ * Available when `showNotificationButton==true`.
38
+ */
10
39
  notificationButtonActivated?: boolean;
40
+ /**
41
+ * Number drawn in the count badge.
42
+ *
43
+ * Available when `showNotificationButton==true && showNotificationCount==true && notificationButtonActivated==true`.
44
+ */
11
45
  notificationCount?: number;
46
+ /**
47
+ * Draws the count badge on the notification button.
48
+ *
49
+ * Available when `showNotificationButton==true && notificationButtonActivated==true`.
50
+ */
12
51
  showNotificationCount?: boolean;
52
+ /** Screen button, after the notification button. */
53
+ showScreenButton?: boolean;
54
+ /**
55
+ * Pressed styling for the screen button.
56
+ *
57
+ * Available when `showScreenButton==true`.
58
+ */
59
+ screenButtonActivated?: boolean;
60
+ /** User button, last before the clock. */
13
61
  showUserButton?: boolean;
62
+ /**
63
+ * Pressed styling for the user button.
64
+ *
65
+ * Available when `showUserButton==true`.
66
+ */
14
67
  userButtonActivated?: boolean;
68
+ /** Dimming button, between system and user. */
15
69
  showDimmingButton?: boolean;
70
+ /**
71
+ * Pressed styling for the dimming button.
72
+ *
73
+ * Available when `showDimmingButton==true`.
74
+ */
16
75
  dimmingButtonActivated?: boolean;
76
+ /** System button, after the screen button. */
17
77
  showSystemButton?: boolean;
78
+ /**
79
+ * Pressed styling for the system button.
80
+ *
81
+ * Available when `showSystemButton==true`.
82
+ */
18
83
  systemButtonActivated?: boolean;
84
+ /** How many `status-icon-N`/`status-label-N` slot pairs are rendered. */
19
85
  nStatusFields?: number;
20
86
  }
21
87
  export interface Events {
22
- onHomeButtonClicked?: (event: CustomEvent<unknown>) => void;
23
- onDimmingButtonClicked?: (event: CustomEvent<unknown>) => void;
24
- onNotificationButtonClicked?: (event: CustomEvent<unknown>) => void;
25
- onUserButtonClicked?: (event: CustomEvent<unknown>) => void;
26
- onSystemButtonClicked?: (event: CustomEvent<unknown>) => void;
88
+ onHomeButtonClicked?: (event: CustomEvent) => void;
89
+ onLinkButtonClicked?: (event: CustomEvent) => void;
90
+ onAlertButtonClicked?: (event: CustomEvent) => void;
91
+ onDimmingButtonClicked?: (event: CustomEvent) => void;
92
+ onNotificationButtonClicked?: (event: CustomEvent) => void;
93
+ onScreenButtonClicked?: (event: CustomEvent) => void;
94
+ onUserButtonClicked?: (event: CustomEvent) => void;
95
+ onSystemButtonClicked?: (event: CustomEvent) => void;
27
96
  }
28
97
  export interface Slots {
29
98
  vesselSelector?: Snippet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oicl/openbridge-webcomponents-svelte",
3
- "version": "2.0.0-next.147",
3
+ "version": "2.0.0-next.149",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "dependencies": {
34
- "@oicl/openbridge-webcomponents": "^2.0.0-next.147"
34
+ "@oicl/openbridge-webcomponents": "^2.0.0-next.149"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "svelte": "^5.0.0"