@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.65 → 2.0.0-next.67

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.
Files changed (60) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +15992 -15907
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +138 -30
  4. package/dist/automation/automation-button/automation-button.css.js +9 -9
  5. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.d.ts +1 -0
  6. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.d.ts.map +1 -1
  7. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.js +9 -28
  8. package/dist/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.js.map +1 -1
  9. package/dist/components/accordion-card/accordion-card.css.js +1 -1
  10. package/dist/components/dropdown-button/dropdown-button.d.ts +11 -0
  11. package/dist/components/dropdown-button/dropdown-button.d.ts.map +1 -1
  12. package/dist/components/dropdown-button/dropdown-button.js +24 -2
  13. package/dist/components/dropdown-button/dropdown-button.js.map +1 -1
  14. package/dist/components/keyboard-numeric/keyboard-numeric.d.ts +1 -2
  15. package/dist/components/keyboard-numeric/keyboard-numeric.d.ts.map +1 -1
  16. package/dist/components/keyboard-numeric/keyboard-numeric.js +10 -15
  17. package/dist/components/keyboard-numeric/keyboard-numeric.js.map +1 -1
  18. package/dist/components/number-input-field/number-input-field.d.ts +9 -0
  19. package/dist/components/number-input-field/number-input-field.d.ts.map +1 -1
  20. package/dist/components/number-input-field/number-input-field.js +30 -1
  21. package/dist/components/number-input-field/number-input-field.js.map +1 -1
  22. package/dist/components/number-input-field/number-input-format.d.ts +9 -0
  23. package/dist/components/number-input-field/number-input-format.d.ts.map +1 -1
  24. package/dist/components/number-input-field/number-input-format.js +33 -2
  25. package/dist/components/number-input-field/number-input-format.js.map +1 -1
  26. package/dist/components/stepper-box/stepper-box.css.js +0 -6
  27. package/dist/components/stepper-box/stepper-box.css.js.map +1 -1
  28. package/dist/components/stepper-box/stepper-box.d.ts +3 -13
  29. package/dist/components/stepper-box/stepper-box.d.ts.map +1 -1
  30. package/dist/components/stepper-box/stepper-box.js.map +1 -1
  31. package/dist/components/toggle-button-group/toggle-button-group.d.ts +14 -0
  32. package/dist/components/toggle-button-group/toggle-button-group.d.ts.map +1 -1
  33. package/dist/components/toggle-button-group/toggle-button-group.js +25 -5
  34. package/dist/components/toggle-button-group/toggle-button-group.js.map +1 -1
  35. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.css.js +4 -0
  36. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.css.js.map +1 -1
  37. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts +1 -0
  38. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts.map +1 -1
  39. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.js +13 -1
  40. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.js.map +1 -1
  41. package/docs/GettingStarted.mdx +28 -12
  42. package/package.json +1 -1
  43. package/src/automation/automation-button/automation-button.css +9 -9
  44. package/src/automation/valve-analoge-two-way-icon/valve-analog-two-way-icon.ts +9 -28
  45. package/src/components/accordion-card/accordion-card.css +1 -1
  46. package/src/components/dropdown-button/dropdown-button.stories.ts +22 -0
  47. package/src/components/dropdown-button/dropdown-button.ts +33 -4
  48. package/src/components/keyboard-numeric/keyboard-numeric.ts +12 -18
  49. package/src/components/number-input-field/number-input-field.spec.ts +134 -0
  50. package/src/components/number-input-field/number-input-field.ts +47 -0
  51. package/src/components/number-input-field/number-input-format.spec.ts +62 -0
  52. package/src/components/number-input-field/number-input-format.ts +59 -2
  53. package/src/components/stepper-box/stepper-box.css +0 -6
  54. package/src/components/stepper-box/stepper-box.ts +3 -13
  55. package/src/components/toggle-button-group/toggle-button-group.ts +36 -5
  56. package/src/components/toggle-button-group/toggle-button.stories.ts +31 -0
  57. package/src/integration-systems/integration-fleet-button/integration-fleet-button.css +4 -0
  58. package/src/integration-systems/integration-fleet-button/integration-fleet-button.stories.ts +9 -0
  59. package/src/integration-systems/integration-fleet-button/integration-fleet-button.ts +10 -1
  60. package/src/navigation-instruments/readout/readout.stories.ts +0 -6
@@ -36,22 +36,15 @@ export enum ObcStepperBoxType {
36
36
  * - `up-down`: Uses up and down chevron icons for vertical adjustment.
37
37
  * - `left-right`: Uses left and right chevron icons for horizontal adjustment.
38
38
  * - **Value Display:**
39
- * - Optional unit label via the `unit` slot.
39
+ * - Optional unit label via the `unit` property.
40
40
  * - **Helper Text:**
41
41
  * - When `helperText` is set, displays additional helper or status text below the control.
42
42
  * - **Icon Buttons:**
43
43
  * - Both increment and decrement actions are triggered by icon buttons, with icons adapting to the selected type.
44
- * - **Customizable Layout:**
45
- * - Supports flexible content via the `unit` slot.
46
44
  *
47
45
  * ### Usage Guidelines
48
46
  * Use `obc-stepper-box` for scenarios where users need to adjust a value in discrete steps, such as quantity pickers, setting numeric parameters, or cycling through options. It is ideal when you want to prevent invalid input and provide a clear, touch-friendly interface for value changes.
49
47
  *
50
- * ### Slots
51
- * | Slot Name | Renders When... | Purpose |
52
- * |--------------- |--------------------------|-----------------------------------------|
53
- * | unit | If provided | Unit label (e.g., "km", "%"). |
54
- *
55
48
  * ### Events
56
49
  * - `down` – Fired when the decrement (left or down) button is clicked.
57
50
  * - `up` – Fired when the increment (right or up) button is clicked.
@@ -63,12 +56,9 @@ export enum ObcStepperBoxType {
63
56
  *
64
57
  * **Example:**
65
58
  * ```
66
- * <obc-stepper-box type="up-down" .value=${5} helperText="Set weight">
67
- * <div slot="unit">kg</div>
68
- * </obc-stepper-box>
59
+ * <obc-stepper-box type="up-down" value="5" unit="kg" helperText="Set weight"></obc-stepper-box>
69
60
  * ```
70
61
  *
71
- * @slot unit - Unit label (e.g., "km", "%")
72
62
  * @fires down {CustomEvent<{value: number}>} Fired when the decrement (left or down) button is clicked
73
63
  * @fires up {CustomEvent<{value: number}>} Fired when the increment (right or up) button is clicked
74
64
  * @fires input {CustomEvent<{value: string}>} Fired when the user types in the number input field
@@ -119,7 +109,7 @@ export class ObcStepperBox extends LitElement {
119
109
  @property({type: Number}) stepDown = 1;
120
110
 
121
111
  /**
122
- * Unit text displayed inside the field. Overridden by the `unit` slot if assigned.
112
+ * Unit text displayed inside the field.
123
113
  */
124
114
  @property({type: String}) unit = '';
125
115
 
@@ -47,6 +47,10 @@ export type ObcToggleButtonGroupValueChangeEvent = CustomEvent<{
47
47
  * - **External control mode:** When `externalControl` is true, the group emits selection events but does not
48
48
  * update its own `value` property, allowing parent components to manage state (useful for form libraries or
49
49
  * custom state management).
50
+ * - **Empty selection mode:** When `allowEmptySelection` is true, a `value` that does not match any enabled
51
+ * option leaves the group with no option selected, instead of defaulting to the first enabled option. Use
52
+ * this when a selection may legitimately be absent (e.g. unset, loading, or error states) so the UI does not
53
+ * imply a choice the user has not made.
50
54
  * - **Disabled state:** Setting `disabled` on the group disables all contained options at once. Individual
51
55
  * options can also be disabled independently while the group remains enabled.
52
56
  * - **Divider management:** Automatically shows visual dividers between options and hides the divider after
@@ -177,6 +181,17 @@ export class ObcToggleButtonGroup extends LitElement {
177
181
  */
178
182
  @property({type: Boolean}) externalControl = false;
179
183
 
184
+ /**
185
+ * If true, a `value` that does not match any enabled option leaves the group with no option selected
186
+ * instead of defaulting to the first enabled option.
187
+ *
188
+ * This also applies when the currently selected option becomes disabled: the group clears its selection
189
+ * rather than falling back to another option.
190
+ *
191
+ * Defaults to false (the first enabled option is selected when the value does not match).
192
+ */
193
+ @property({type: Boolean}) allowEmptySelection = false;
194
+
180
195
  /**
181
196
  * Disables the entire toggle button group and all contained options when true.
182
197
  *
@@ -233,8 +248,12 @@ export class ObcToggleButtonGroup extends LitElement {
233
248
  this.setNoDivider();
234
249
  return;
235
250
  }
236
- const fallback = this.getFirstSelectableOption();
237
- newValue = fallback?.value || '';
251
+ if (this.allowEmptySelection) {
252
+ newValue = '';
253
+ } else {
254
+ const fallback = this.getFirstSelectableOption();
255
+ newValue = fallback?.value || '';
256
+ }
238
257
  }
239
258
 
240
259
  this.value = newValue;
@@ -333,9 +352,13 @@ export class ObcToggleButtonGroup extends LitElement {
333
352
  });
334
353
 
335
354
  if (!this.value || !this.getOptionByValue(this.value)) {
336
- const firstSelectable = this.getFirstSelectableOption();
337
- if (firstSelectable) {
338
- this.updateSelection(firstSelectable.value, false);
355
+ if (this.allowEmptySelection) {
356
+ this.updateSelection('', false);
357
+ } else {
358
+ const firstSelectable = this.getFirstSelectableOption();
359
+ if (firstSelectable) {
360
+ this.updateSelection(firstSelectable.value, false);
361
+ }
339
362
  }
340
363
  } else {
341
364
  this.updateSelection(this.value, false);
@@ -349,6 +372,10 @@ export class ObcToggleButtonGroup extends LitElement {
349
372
  private handleOptionDisabledChange() {
350
373
  const currentOption = this.getOptionByValue(this.value);
351
374
  if (currentOption?.disabled && this.hasAnyEnabledOption()) {
375
+ if (this.allowEmptySelection) {
376
+ this.updateSelection('');
377
+ return;
378
+ }
352
379
  const firstSelectable = this.getFirstSelectableOption();
353
380
  if (firstSelectable) {
354
381
  this.updateSelection(firstSelectable.value);
@@ -412,6 +439,10 @@ export class ObcToggleButtonGroup extends LitElement {
412
439
 
413
440
  const currentOption = this.getOptionByValue(this.value);
414
441
  if (currentOption?.disabled && this.hasAnyEnabledOption()) {
442
+ if (this.allowEmptySelection) {
443
+ this.updateSelection('');
444
+ return;
445
+ }
415
446
  const firstSelectable = this.getFirstSelectableOption();
416
447
  if (firstSelectable) {
417
448
  this.updateSelection(firstSelectable.value);
@@ -52,6 +52,9 @@ const meta: Meta<typeof ObcToggleButtonGroup> = {
52
52
  large: {
53
53
  control: {type: 'boolean'},
54
54
  },
55
+ allowEmptySelection: {
56
+ control: {type: 'boolean'},
57
+ },
55
58
  },
56
59
  render: (args) =>
57
60
  html` <div
@@ -483,3 +486,31 @@ export const ExternalControlActivatedDemo: Story = {
483
486
  </div>
484
487
  `,
485
488
  };
489
+
490
+ export const EmptySelectionWhenUnmatched: Story = {
491
+ args: {
492
+ type: ObcToggleButtonOptionType.text,
493
+ variant: ObcToggleButtonOptionVariant.regular,
494
+ value: 'none',
495
+ allowEmptySelection: true,
496
+ },
497
+ render: (args) => html`
498
+ <div style="display: flex; flex-direction: column; gap: 16px;">
499
+ <p>
500
+ With <code>allowEmptySelection</code> enabled, a value that does not
501
+ match any option (here <code>"none"</code>) leaves the group with no
502
+ option selected instead of defaulting to the first option.
503
+ </p>
504
+ <obc-toggle-button-group
505
+ value="${args.value}"
506
+ variant="${args.variant}"
507
+ type="${args.type}"
508
+ .allowEmptySelection="${args.allowEmptySelection}"
509
+ >
510
+ <obc-toggle-button-option value="1">Option 1</obc-toggle-button-option>
511
+ <obc-toggle-button-option value="2">Option 2</obc-toggle-button-option>
512
+ <obc-toggle-button-option value="3">Option 3</obc-toggle-button-option>
513
+ </obc-toggle-button-group>
514
+ </div>
515
+ `,
516
+ };
@@ -138,6 +138,10 @@
138
138
  gap: 8px;
139
139
  align-self: stretch;
140
140
 
141
+ &:not(.show-alerts) {
142
+ display: none;
143
+ }
144
+
141
145
  .alert-icon {
142
146
  width: 24px;
143
147
  height: 24px;
@@ -17,6 +17,7 @@ const meta: Meta<typeof ObcIntegrationFleetButton> = {
17
17
  ],
18
18
  alertTopic: 'Navigation alert',
19
19
  alerts: {alarm: 1, warning: 5, caution: 2},
20
+ showAlerts: true,
20
21
  },
21
22
  parameters: {
22
23
  backgrounds: {
@@ -32,6 +33,7 @@ const meta: Meta<typeof ObcIntegrationFleetButton> = {
32
33
  .alertTopic=${args.alertTopic}
33
34
  .alerts=${args.alerts}
34
35
  .selected=${args.selected}
36
+ .showAlerts=${args.showAlerts}
35
37
  >
36
38
  <obi-placeholder slot="alert-topic-icon"></obi-placeholder>
37
39
  </obc-integration-fleet-button>
@@ -66,3 +68,10 @@ export const SelectedNoAlerts: Story = {
66
68
  alerts: {alarm: 0, warning: 0, caution: 0},
67
69
  },
68
70
  };
71
+
72
+ export const HideAlerts: Story = {
73
+ args: {
74
+ selected: false,
75
+ showAlerts: false,
76
+ },
77
+ };
@@ -2,6 +2,7 @@ import {LitElement, html, unsafeCSS} from 'lit';
2
2
  import {customElement} from '../../decorator.js';
3
3
  import compentStyle from './integration-fleet-button.css?inline';
4
4
  import {property} from 'lit/decorators.js';
5
+ import {classMap} from 'lit/directives/class-map.js';
5
6
  import {msg} from '@lit/localize';
6
7
  import '../../components/badge/badge.js';
7
8
 
@@ -24,6 +25,7 @@ export class ObcIntegrationFleetButton extends LitElement {
24
25
  warning: number;
25
26
  caution: number;
26
27
  } = {alarm: 0, warning: 0, caution: 0};
28
+ @property({type: Boolean}) showAlerts: boolean = false;
27
29
 
28
30
  override render() {
29
31
  const hasAlert =
@@ -47,7 +49,14 @@ export class ObcIntegrationFleetButton extends LitElement {
47
49
  </div>`
48
50
  )}
49
51
  </div>
50
- <div class="alerts ${hasAlert ? 'has-alert' : 'no-alert'}">
52
+ <div
53
+ class=${classMap({
54
+ alerts: true,
55
+ 'has-alert': hasAlert,
56
+ 'no-alert': !hasAlert,
57
+ 'show-alerts': this.showAlerts,
58
+ })}
59
+ >
51
60
  <div class="alert-icon ">
52
61
  <slot name="alert-topic-icon"></slot>
53
62
  </div>
@@ -19,12 +19,6 @@ import {
19
19
  ReadoutAdviceFormat,
20
20
  ReadoutAdviceState,
21
21
  } from '../readout-advice/readout-advice.js';
22
- import {AlertType} from '../../types.js';
23
- import {
24
- ObcAlertFrameMode,
25
- ObcAlertFrameThickness,
26
- ObcAlertFrameType,
27
- } from '../../components/alert-frame/alert-frame.js';
28
22
 
29
23
  const meta: Meta<ObcReadout> = {
30
24
  title: 'Instruments/Readout',