@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.76 → 2.0.0-next.78

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 (37) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +56 -24
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/dist/automation/analog-valve/analog-valve.d.ts.map +1 -1
  4. package/dist/automation/analog-valve/analog-valve.js +1 -1
  5. package/dist/automation/analog-valve/analog-valve.js.map +1 -1
  6. package/dist/automation/automation-button/abstract-automation-button-motorized.d.ts.map +1 -1
  7. package/dist/automation/automation-button/abstract-automation-button-motorized.js +1 -1
  8. package/dist/automation/automation-button/abstract-automation-button-motorized.js.map +1 -1
  9. package/dist/automation/automation-button/automation-button.d.ts +2 -1
  10. package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
  11. package/dist/automation/automation-button/automation-button.js +1 -0
  12. package/dist/automation/automation-button/automation-button.js.map +1 -1
  13. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts +1 -1
  14. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.d.ts.map +1 -1
  15. package/dist/components/automation-button-readout-stack/automation-button-readout-stack.js.map +1 -1
  16. package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js +13 -1
  17. package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js.map +1 -1
  18. package/dist/navigation-instruments/indicator-graph/indicator-graph.css.js +34 -20
  19. package/dist/navigation-instruments/indicator-graph/indicator-graph.css.js.map +1 -1
  20. package/dist/navigation-instruments/indicator-graph/indicator-graph.d.ts.map +1 -1
  21. package/dist/navigation-instruments/indicator-graph/indicator-graph.js +2 -1
  22. package/dist/navigation-instruments/indicator-graph/indicator-graph.js.map +1 -1
  23. package/dist/navigation-instruments/watch/watch.css.js +4 -0
  24. package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
  25. package/package.json +1 -1
  26. package/src/automation/analog-valve/analog-valve.stories.ts +17 -1
  27. package/src/automation/analog-valve/analog-valve.ts +4 -1
  28. package/src/automation/automation-button/abstract-automation-button-motorized.ts +4 -1
  29. package/src/automation/automation-button/automation-button.ts +1 -0
  30. package/src/components/automation-button-readout-stack/automation-button-readout-stack.ts +1 -1
  31. package/src/navigation-instruments/gauge-radial/gauge-radial.css +13 -1
  32. package/src/navigation-instruments/gauge-radial/gauge-radial.stories.ts +18 -0
  33. package/src/navigation-instruments/indicator-graph/indicator-graph.css +34 -20
  34. package/src/navigation-instruments/indicator-graph/indicator-graph.ts +2 -1
  35. package/src/navigation-instruments/watch/watch.css +4 -0
  36. package/src/navigation-instruments/watch/watch.stories.ts +161 -171
  37. package/src/storybook-util.ts +1 -1
@@ -42,7 +42,10 @@ export class ObcAbstractAutomationButtonMotorized extends ObcAbstractAutomationB
42
42
  nDigits: this.speedMaxDigits,
43
43
  unit: this.speedUnit,
44
44
  direction: this.labelDirection,
45
- icon: 'chevron',
45
+ icon:
46
+ this.labelDirection === AutomationButtonLabelDirection.none
47
+ ? 'none'
48
+ : 'chevron',
46
49
  },
47
50
  ];
48
51
  } else if (!this.on) {
@@ -69,6 +69,7 @@ export enum AutomationButtonLabelDirection {
69
69
  down = 'down',
70
70
  left = 'left',
71
71
  right = 'right',
72
+ none = 'none',
72
73
  }
73
74
 
74
75
  /**
@@ -31,7 +31,7 @@ export interface AutomationButtonReadoutStackValue {
31
31
  value: number;
32
32
  nDigits: number;
33
33
  unit: string;
34
- direction: 'up' | 'down' | 'left' | 'right';
34
+ direction: 'up' | 'down' | 'left' | 'right' | 'none';
35
35
  icon: 'none' | 'arrow' | 'chevron';
36
36
  }
37
37
 
@@ -5,18 +5,30 @@
5
5
  }
6
6
 
7
7
  /* Host takes each sector's crop aspect (see `sectorClips`): 270/90 square, 180
8
- wide — so the dial is the same size at any width. */
8
+ wide — so the dial is the same size at any width.
9
+
10
+ `width`/`height: auto` + `max-width`/`max-height: 100%` makes the host the
11
+ largest box of the sector's aspect ratio that fits inside *both* the
12
+ available width and height. Using `height: auto` alone only honours the
13
+ width, so in a short, wide (e.g. flex) container the square would grow as
14
+ tall as it is wide and overflow — see issue #992. */
9
15
  :host([sector="270"]),
10
16
  :host([sector="90-left"]),
11
17
  :host([sector="90-right"]) {
18
+ width: auto;
12
19
  height: auto;
20
+ max-width: 100%;
21
+ max-height: 100%;
13
22
  aspect-ratio: 1;
14
23
  }
15
24
 
16
25
  /* 448 / 251 = the 180° crop's aspect (448 wide × 448·(1 − 44%) tall); keep in
17
26
  sync with `sectorClips` bottom=44 in gauge-radial.ts. */
18
27
  :host([sector="180"]) {
28
+ width: auto;
19
29
  height: auto;
30
+ max-width: 100%;
31
+ max-height: 100%;
20
32
  aspect-ratio: 448 / 251;
21
33
  }
22
34
 
@@ -241,6 +241,24 @@ export const Sector90RightWithReadout: Story = {
241
241
  },
242
242
  };
243
243
 
244
+ export const ShortWideContainer: Story = {
245
+ args: {
246
+ ...sectorStoryArgs,
247
+ sector: GaugeRadialSector.deg270,
248
+ width: 600,
249
+ height: 160,
250
+ },
251
+ };
252
+
253
+ export const ShortWideContainer180: Story = {
254
+ args: {
255
+ ...sectorStoryArgs,
256
+ sector: GaugeRadialSector.deg180,
257
+ width: 600,
258
+ height: 120,
259
+ },
260
+ };
261
+
244
262
  const readoutStoryArgs = {
245
263
  value: 123,
246
264
  minValue: 0,
@@ -1,10 +1,36 @@
1
1
  .chart-container {
2
2
  width: 100%;
3
3
  height: 100%;
4
+ box-sizing: border-box;
4
5
  display: flex;
5
6
  align-items: center;
6
7
  justify-content: center;
7
8
  position: relative;
9
+
10
+ padding-bottom: 0.5px;
11
+
12
+ --dot-width: 6px;
13
+ --dot-radius: calc(var(--dot-width) / 2);
14
+
15
+ &.medium {
16
+ --dot-width: 8px;
17
+ }
18
+
19
+ &.large {
20
+ --dot-width: 10px;
21
+ }
22
+ }
23
+
24
+ .u-over {
25
+ position: absolute;
26
+ }
27
+
28
+ #chart {
29
+ position: absolute;
30
+ width: calc(100% - var(--dot-radius));
31
+ left: 0;
32
+ top: var(--dot-radius);
33
+ bottom: var(--dot-radius);
8
34
  }
9
35
 
10
36
  canvas {
@@ -16,11 +42,12 @@ canvas {
16
42
  }
17
43
 
18
44
  #dot {
45
+ box-sizing: border-box;
19
46
  position: absolute;
20
- width: 4px;
21
- height: 4px;
22
- right: -3px;
23
- bottom: -3px;
47
+ width: var(--dot-width);
48
+ height: var(--dot-width);
49
+ right: 0;
50
+ bottom: 0;
24
51
  border-radius: 50%;
25
52
  background: var(--element-neutral-color);
26
53
  border: 1px solid var(--border-silhouette-color);
@@ -31,25 +58,12 @@ canvas {
31
58
  background: var(--element-neutral-enhanced-color);
32
59
  }
33
60
 
34
- .medium #dot {
35
- width: 6px;
36
- height: 6px;
37
- right: -4px;
38
- bottom: -4px;
39
- }
40
-
41
- .large #dot {
42
- width: 8px;
43
- height: 8px;
44
- right: -5px;
45
- bottom: -5px;
46
- }
47
-
48
61
  #zero-line {
49
62
  position: absolute;
50
- width: 100%;
63
+ left: 0;
64
+ right: var(--dot-radius);
51
65
  height: 1px;
52
- bottom: -0.5px;
66
+ bottom: calc(var(--dot-radius) - 0.5px);
53
67
  background: var(--element-disabled-color);
54
68
  border-radius: 2px;
55
69
  }
@@ -36,7 +36,7 @@ export class ObcIndicatorGraph extends LitElement {
36
36
  @property({type: Object})
37
37
  layout: ObcIndicatorGraphLayout = {};
38
38
 
39
- @query('.chart-container')
39
+ @query('#chart')
40
40
  private chart!: HTMLDivElement;
41
41
 
42
42
  @state()
@@ -202,6 +202,7 @@ export class ObcIndicatorGraph extends LitElement {
202
202
  class="chart-container ${this._effectivePriority} ${this
203
203
  ._effectiveSize}"
204
204
  >
205
+ <div id="chart"></div>
205
206
  <div
206
207
  id="zero-line"
207
208
  style="transform: translateY(${-(this.zeroLineY ?? 0)}px);
@@ -2,6 +2,10 @@
2
2
  box-sizing: border-box;
3
3
  }
4
4
 
5
+ :host {
6
+ overflow: hidden;
7
+ }
8
+
5
9
  .label {
6
10
  @mixin font-body;
7
11
  font-size: calc(12px / var(--scale, 1));
@@ -461,6 +461,7 @@ export const MultiCut: Story = {
461
461
 
462
462
  export const TickmarksTest: Story = {
463
463
  args: {
464
+ width: 480,
464
465
  tickmarks: [
465
466
  // every 15 degrees
466
467
  ...Array.from({length: 24}, (_, i) => ({
@@ -510,6 +511,7 @@ export const TickmarksTest: Story = {
510
511
 
511
512
  export const TickmarksInsideTest: Story = {
512
513
  args: {
514
+ width: 480,
513
515
  tickmarks: [
514
516
  // every 15 degrees
515
517
  ...Array.from({length: 24}, (_, i) => ({
@@ -577,6 +579,7 @@ export const TickmarksInsideTest: Story = {
577
579
 
578
580
  export const TickmarksTestRotation: Story = {
579
581
  args: {
582
+ width: 480,
580
583
  tickmarks: [
581
584
  // every 15 degrees
582
585
  ...Array.from({length: 24}, (_, i) => ({
@@ -650,6 +653,7 @@ export const TickmarksTestRotation: Story = {
650
653
 
651
654
  export const TickmarksTestInsideRotation: Story = {
652
655
  args: {
656
+ width: 480,
653
657
  tickmarks: [
654
658
  // every 15 degrees
655
659
  ...Array.from({length: 24}, (_, i) => ({
@@ -732,188 +736,174 @@ export const TickmarksTestInsideRotation: Story = {
732
736
  * gauge-vertical/horizontal components, but for radial (watch-based) instruments.
733
737
  */
734
738
  export const StateComparison: Story = {
739
+ args: {
740
+ width: 600,
741
+ },
735
742
  render: () => html`
736
- <div style="display: flex; flex-direction: column; gap: 24px;">
743
+ <div
744
+ style="display: grid; grid-template-columns: 80px repeat(2, 1fr); gap: 16px; align-items: center; justify-items: center;"
745
+ >
737
746
  <!-- Header row -->
738
- <div
739
- style="display: grid; grid-template-columns: 80px repeat(2, 1fr); gap: 16px; align-items: center;"
740
- >
741
- <div></div>
742
- <div
743
- style="text-align: center; font-weight: bold; font-size: 12px; color: #ccc;"
744
- >
745
- regular
746
- </div>
747
- <div
748
- style="text-align: center; font-weight: bold; font-size: 12px; color: #ccc;"
749
- >
750
- enhanced
751
- </div>
747
+ <div></div>
748
+ <div style="font-weight: bold; font-size: 12px; color: #ccc;">
749
+ regular
750
+ </div>
751
+ <div style="font-weight: bold; font-size: 12px; color: #ccc;">
752
+ enhanced
752
753
  </div>
753
754
 
754
755
  <!-- active row -->
755
- <div
756
- style="display: grid; grid-template-columns: 80px repeat(2, 1fr); gap: 16px; align-items: center;"
757
- >
758
- <div style="font-size: 12px; color: #888;">active</div>
759
- <div style="width: 160px; height: 160px;">
760
- <obc-watch
761
- .state=${InstrumentState.active}
762
- .priority=${Priority.regular}
763
- .angleSetpoint=${45}
764
- .atAngleSetpoint=${false}
765
- .watchCircleType=${WatchCircleType.double}
766
- .areas=${[
767
- {
768
- startAngle: -90,
769
- endAngle: 90,
770
- roundInsideCut: true,
771
- roundOutsideCut: true,
772
- },
773
- ]}
774
- .barAreas=${[
775
- {
776
- startAngle: 0,
777
- endAngle: 30,
778
- fillColor: 'var(--instrument-regular-tertiary-color)',
779
- },
780
- ]}
781
- ></obc-watch>
782
- </div>
783
- <div style="width: 160px; height: 160px;">
784
- <obc-watch
785
- .state=${InstrumentState.active}
786
- .priority=${Priority.enhanced}
787
- .angleSetpoint=${45}
788
- .atAngleSetpoint=${false}
789
- .watchCircleType=${WatchCircleType.double}
790
- .areas=${[
791
- {
792
- startAngle: -90,
793
- endAngle: 90,
794
- roundInsideCut: true,
795
- roundOutsideCut: true,
796
- },
797
- ]}
798
- .barAreas=${[
799
- {
800
- startAngle: 0,
801
- endAngle: 30,
802
- fillColor: 'var(--instrument-enhanced-tertiary-color)',
803
- },
804
- ]}
805
- ></obc-watch>
806
- </div>
756
+
757
+ <div style="font-size: 12px; color: #888;">active</div>
758
+ <div style="width: 160px; height: 160px;">
759
+ <obc-watch
760
+ .state=${InstrumentState.active}
761
+ .priority=${Priority.regular}
762
+ .angleSetpoint=${45}
763
+ .atAngleSetpoint=${false}
764
+ .watchCircleType=${WatchCircleType.double}
765
+ .areas=${[
766
+ {
767
+ startAngle: -90,
768
+ endAngle: 90,
769
+ roundInsideCut: true,
770
+ roundOutsideCut: true,
771
+ },
772
+ ]}
773
+ .barAreas=${[
774
+ {
775
+ startAngle: 0,
776
+ endAngle: 30,
777
+ fillColor: 'var(--instrument-regular-tertiary-color)',
778
+ },
779
+ ]}
780
+ ></obc-watch>
781
+ </div>
782
+ <div style="width: 160px; height: 160px;">
783
+ <obc-watch
784
+ .state=${InstrumentState.active}
785
+ .priority=${Priority.enhanced}
786
+ .angleSetpoint=${45}
787
+ .atAngleSetpoint=${false}
788
+ .watchCircleType=${WatchCircleType.double}
789
+ .areas=${[
790
+ {
791
+ startAngle: -90,
792
+ endAngle: 90,
793
+ roundInsideCut: true,
794
+ roundOutsideCut: true,
795
+ },
796
+ ]}
797
+ .barAreas=${[
798
+ {
799
+ startAngle: 0,
800
+ endAngle: 30,
801
+ fillColor: 'var(--instrument-enhanced-tertiary-color)',
802
+ },
803
+ ]}
804
+ ></obc-watch>
807
805
  </div>
808
806
 
809
807
  <!-- loading row -->
810
- <div
811
- style="display: grid; grid-template-columns: 80px repeat(2, 1fr); gap: 16px; align-items: center;"
812
- >
813
- <div style="font-size: 12px; color: #888;">loading</div>
814
- <div style="width: 160px; height: 160px;">
815
- <obc-watch
816
- .state=${InstrumentState.loading}
817
- .priority=${Priority.regular}
818
- .angleSetpoint=${45}
819
- .atAngleSetpoint=${false}
820
- .watchCircleType=${WatchCircleType.double}
821
- .areas=${[
822
- {
823
- startAngle: -90,
824
- endAngle: 90,
825
- roundInsideCut: true,
826
- roundOutsideCut: true,
827
- },
828
- ]}
829
- .barAreas=${[
830
- {
831
- startAngle: 0,
832
- endAngle: 30,
833
- fillColor: 'var(--instrument-frame-tertiary-color)',
834
- },
835
- ]}
836
- ></obc-watch>
837
- </div>
838
- <div style="width: 160px; height: 160px;">
839
- <obc-watch
840
- .state=${InstrumentState.loading}
841
- .priority=${Priority.enhanced}
842
- .angleSetpoint=${45}
843
- .atAngleSetpoint=${false}
844
- .watchCircleType=${WatchCircleType.double}
845
- .areas=${[
846
- {
847
- startAngle: -90,
848
- endAngle: 90,
849
- roundInsideCut: true,
850
- roundOutsideCut: true,
851
- },
852
- ]}
853
- .barAreas=${[
854
- {
855
- startAngle: 0,
856
- endAngle: 30,
857
- fillColor: 'var(--instrument-frame-tertiary-color)',
858
- },
859
- ]}
860
- ></obc-watch>
861
- </div>
808
+ <div style="font-size: 12px; color: #888;">loading</div>
809
+ <div style="width: 160px; height: 160px;">
810
+ <obc-watch
811
+ .state=${InstrumentState.loading}
812
+ .priority=${Priority.regular}
813
+ .angleSetpoint=${45}
814
+ .atAngleSetpoint=${false}
815
+ .watchCircleType=${WatchCircleType.double}
816
+ .areas=${[
817
+ {
818
+ startAngle: -90,
819
+ endAngle: 90,
820
+ roundInsideCut: true,
821
+ roundOutsideCut: true,
822
+ },
823
+ ]}
824
+ .barAreas=${[
825
+ {
826
+ startAngle: 0,
827
+ endAngle: 30,
828
+ fillColor: 'var(--instrument-frame-tertiary-color)',
829
+ },
830
+ ]}
831
+ ></obc-watch>
832
+ </div>
833
+ <div style="width: 160px; height: 160px;">
834
+ <obc-watch
835
+ .state=${InstrumentState.loading}
836
+ .priority=${Priority.enhanced}
837
+ .angleSetpoint=${45}
838
+ .atAngleSetpoint=${false}
839
+ .watchCircleType=${WatchCircleType.double}
840
+ .areas=${[
841
+ {
842
+ startAngle: -90,
843
+ endAngle: 90,
844
+ roundInsideCut: true,
845
+ roundOutsideCut: true,
846
+ },
847
+ ]}
848
+ .barAreas=${[
849
+ {
850
+ startAngle: 0,
851
+ endAngle: 30,
852
+ fillColor: 'var(--instrument-frame-tertiary-color)',
853
+ },
854
+ ]}
855
+ ></obc-watch>
862
856
  </div>
863
857
 
864
858
  <!-- off row -->
865
- <div
866
- style="display: grid; grid-template-columns: 80px repeat(2, 1fr); gap: 16px; align-items: center;"
867
- >
868
- <div style="font-size: 12px; color: #888;">off</div>
869
- <div style="width: 160px; height: 160px;">
870
- <obc-watch
871
- .state=${InstrumentState.off}
872
- .priority=${Priority.regular}
873
- .angleSetpoint=${45}
874
- .atAngleSetpoint=${false}
875
- .watchCircleType=${WatchCircleType.double}
876
- .areas=${[
877
- {
878
- startAngle: -90,
879
- endAngle: 90,
880
- roundInsideCut: true,
881
- roundOutsideCut: true,
882
- },
883
- ]}
884
- .barAreas=${[
885
- {
886
- startAngle: 0,
887
- endAngle: 30,
888
- fillColor: 'var(--instrument-frame-tertiary-color)',
889
- },
890
- ]}
891
- ></obc-watch>
892
- </div>
893
- <div style="width: 160px; height: 160px;">
894
- <obc-watch
895
- .state=${InstrumentState.off}
896
- .priority=${Priority.enhanced}
897
- .angleSetpoint=${45}
898
- .atAngleSetpoint=${false}
899
- .watchCircleType=${WatchCircleType.double}
900
- .areas=${[
901
- {
902
- startAngle: -90,
903
- endAngle: 90,
904
- roundInsideCut: true,
905
- roundOutsideCut: true,
906
- },
907
- ]}
908
- .barAreas=${[
909
- {
910
- startAngle: 0,
911
- endAngle: 30,
912
- fillColor: 'var(--instrument-frame-tertiary-color)',
913
- },
914
- ]}
915
- ></obc-watch>
916
- </div>
859
+ <div style="font-size: 12px; color: #888;">off</div>
860
+ <div style="width: 160px; height: 160px;">
861
+ <obc-watch
862
+ .state=${InstrumentState.off}
863
+ .priority=${Priority.regular}
864
+ .angleSetpoint=${45}
865
+ .atAngleSetpoint=${false}
866
+ .watchCircleType=${WatchCircleType.double}
867
+ .areas=${[
868
+ {
869
+ startAngle: -90,
870
+ endAngle: 90,
871
+ roundInsideCut: true,
872
+ roundOutsideCut: true,
873
+ },
874
+ ]}
875
+ .barAreas=${[
876
+ {
877
+ startAngle: 0,
878
+ endAngle: 30,
879
+ fillColor: 'var(--instrument-frame-tertiary-color)',
880
+ },
881
+ ]}
882
+ ></obc-watch>
883
+ </div>
884
+ <div style="width: 160px; height: 160px;">
885
+ <obc-watch
886
+ .state=${InstrumentState.off}
887
+ .priority=${Priority.enhanced}
888
+ .angleSetpoint=${45}
889
+ .atAngleSetpoint=${false}
890
+ .watchCircleType=${WatchCircleType.double}
891
+ .areas=${[
892
+ {
893
+ startAngle: -90,
894
+ endAngle: 90,
895
+ roundInsideCut: true,
896
+ roundOutsideCut: true,
897
+ },
898
+ ]}
899
+ .barAreas=${[
900
+ {
901
+ startAngle: 0,
902
+ endAngle: 30,
903
+ fillColor: 'var(--instrument-frame-tertiary-color)',
904
+ },
905
+ ]}
906
+ ></obc-watch>
917
907
  </div>
918
908
  </div>
919
909
  `,
@@ -102,7 +102,7 @@ export function widthDecorator(
102
102
  const height = context.args.height ?? width;
103
103
  return html` <div
104
104
  class="wrapper"
105
- style="width: ${width}px; height: ${height}px"
105
+ style="width: ${width}px; height: ${height}px; overflow: auto;"
106
106
  >
107
107
  ${story()}
108
108
  </div>`;