@oicl/openbridge-webcomponents 2.0.0-next.86 → 2.0.0-next.88

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.
@@ -212819,48 +212819,74 @@ const componentStyle$9 = i$7`* {
212819
212819
  height: 100%;
212820
212820
  }
212821
212821
 
212822
- /* Host takes each sector's crop aspect (see \`sectorClips\`): 270/90 square, 180
212823
- wide so the dial is the same size at any width.
212824
-
212825
- \`width\`/\`height: auto\` + \`max-width\`/\`max-height: 100%\` makes the host the
212826
- largest box of the sector's aspect ratio that fits inside *both* the
212827
- available width and height. Using \`height: auto\` alone only honours the
212828
- width, so in a short, wide (e.g. flex) container the square would grow as
212829
- tall as it is wide and overflow — see issue #992. */
212830
-
212831
- :host([sector="270"]),
212832
- :host([sector="90-left"]),
212833
- :host([sector="90-right"]) {
212822
+ .gauge-radial-root {
212823
+ /* Readout vertical placement per layout (% of the cropped box), tuned to the
212824
+ watch geometry — re-check if the ring radii or the 448 box change. Which
212825
+ layout uses which is in renderReadouts(). */
212826
+ --readout-meta-top: 72%;
212827
+ --readout-meta-top-needle: 63%;
212828
+ --readout-meta-top-180: 60%;
212829
+
212830
+ position: relative;
212831
+
212832
+ /* The dial is the largest box of its sector's aspect ratio that fits inside
212833
+ *both* the available width and height of the (full-size) host. \`width: auto\`
212834
+ stretches the block to the host width, then \`aspect-ratio\` + \`max-height\`
212835
+ transfer the constraint back, shrinking it to fit a short host too — see
212836
+ issue #992. The host always fills its container, so the gauge can be
212837
+ positioned within the leftover space via the alignment classes below. */
212834
212838
  width: auto;
212835
212839
  height: auto;
212836
212840
  max-width: 100%;
212837
212841
  max-height: 100%;
212838
212842
  aspect-ratio: 1;
212839
- }
212840
212843
 
212841
- /* 448 / 251 = the 180° crop's aspect (448 wide × 448·(1 44%) tall); keep in
212842
- sync with \`sectorClips\` bottom=44 in gauge-radial.ts. */
212844
+ /* Defaults (centered both ways); overridden by the halign-* / valign-*
212845
+ classes. Horizontal alignment uses auto margins (which reference the host
212846
+ width); vertical alignment uses a relative \`top\` offset (which references
212847
+ the definite host height) plus a self-sized \`translateY\`. */
212848
+ margin-left: auto;
212849
+ margin-right: auto;
212850
+ top: 50%;
212851
+ transform: translateY(-50%);
212843
212852
 
212844
- :host([sector="180"]) {
212845
- width: auto;
212846
- height: auto;
212847
- max-width: 100%;
212848
- max-height: 100%;
212849
- aspect-ratio: 448 / 251;
212853
+ /* 448 / 251 = the 180° crop's aspect (448 wide × 448·(1 − 44%) tall); keep in
212854
+ sync with \`sectorClips\` bottom=44 in gauge-radial.ts. */
212850
212855
  }
212851
212856
 
212852
- .gauge-radial-root {
212853
- /* Readout vertical placement per layout (% of the cropped host), tuned to the
212854
- watch geometry — re-check if the ring radii or the 448 box change. Which
212855
- layout uses which is in renderReadouts(). */
212856
- --readout-meta-top: 72%;
212857
- --readout-meta-top-needle: 63%;
212858
- --readout-meta-top-180: 60%;
212857
+ .gauge-radial-root.sector-180 {
212858
+ aspect-ratio: 448 / 251;
212859
+ }
212859
212860
 
212860
- position: relative;
212861
- width: 100%;
212862
- height: 100%;
212863
- }
212861
+ .gauge-radial-root.halign-left {
212862
+ margin-left: 0;
212863
+ margin-right: auto;
212864
+ }
212865
+
212866
+ .gauge-radial-root.halign-center {
212867
+ margin-left: auto;
212868
+ margin-right: auto;
212869
+ }
212870
+
212871
+ .gauge-radial-root.halign-right {
212872
+ margin-left: auto;
212873
+ margin-right: 0;
212874
+ }
212875
+
212876
+ .gauge-radial-root.valign-top {
212877
+ top: 0;
212878
+ transform: translateY(0);
212879
+ }
212880
+
212881
+ .gauge-radial-root.valign-center {
212882
+ top: 50%;
212883
+ transform: translateY(-50%);
212884
+ }
212885
+
212886
+ .gauge-radial-root.valign-bottom {
212887
+ top: 100%;
212888
+ transform: translateY(-100%);
212889
+ }
212864
212890
 
212865
212891
  .gauge-radial-root .gauge-readout-value {
212866
212892
  position: absolute;
@@ -212941,6 +212967,8 @@ let ObcGaugeRadial = class extends SetpointMixin(i$4) {
212941
212967
  this.tickmarkStyle = TickmarkStyle$1.regular;
212942
212968
  this.advices = [];
212943
212969
  this.sector = "270";
212970
+ this.horizontalAlignment = "center";
212971
+ this.verticalAlignment = "center";
212944
212972
  this.hasReadout = false;
212945
212973
  this.label = "";
212946
212974
  this.unit = "";
@@ -213056,8 +213084,9 @@ let ObcGaugeRadial = class extends SetpointMixin(i$4) {
213056
213084
  "type-needle": this.type === "needle",
213057
213085
  "sector-180": this.sector === "180",
213058
213086
  "sector-90-left": this.sector === "90-left",
213059
- "sector-90-right": this.sector === "90-right"
213060
- /* deg90Right */
213087
+ "sector-90-right": this.sector === "90-right",
213088
+ [`halign-${this.horizontalAlignment}`]: true,
213089
+ [`valign-${this.verticalAlignment}`]: true
213061
213090
  })}
213062
213091
  >
213063
213092
  <obc-instrument-radial
@@ -213139,6 +213168,12 @@ __decorateClass$x([
213139
213168
  __decorateClass$x([
213140
213169
  n$3({ type: String, reflect: true })
213141
213170
  ], ObcGaugeRadial.prototype, "sector", 2);
213171
+ __decorateClass$x([
213172
+ n$3({ type: String })
213173
+ ], ObcGaugeRadial.prototype, "horizontalAlignment", 2);
213174
+ __decorateClass$x([
213175
+ n$3({ type: String })
213176
+ ], ObcGaugeRadial.prototype, "verticalAlignment", 2);
213142
213177
  __decorateClass$x([
213143
213178
  n$3({ type: Boolean })
213144
213179
  ], ObcGaugeRadial.prototype, "hasReadout", 2);