@oicl/openbridge-webcomponents 2.0.0-next.124 → 2.0.0-next.125

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 (28) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +72 -15
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +19 -0
  4. package/dist/components/keyboard-full/keyboard-full.d.ts +5 -0
  5. package/dist/components/keyboard-full/keyboard-full.d.ts.map +1 -1
  6. package/dist/components/keyboard-full/keyboard-full.js +15 -8
  7. package/dist/components/keyboard-full/keyboard-full.js.map +1 -1
  8. package/dist/components/number-input-field/number-input-field.css.js +19 -0
  9. package/dist/components/number-input-field/number-input-field.css.js.map +1 -1
  10. package/dist/components/number-input-field/number-input-field.d.ts.map +1 -1
  11. package/dist/components/number-input-field/number-input-field.js +3 -0
  12. package/dist/components/number-input-field/number-input-field.js.map +1 -1
  13. package/dist/components/text-input-field/text-input-field.css.js +19 -0
  14. package/dist/components/text-input-field/text-input-field.css.js.map +1 -1
  15. package/dist/components/text-input-field/text-input-field.d.ts.map +1 -1
  16. package/dist/components/text-input-field/text-input-field.js +2 -1
  17. package/dist/components/text-input-field/text-input-field.js.map +1 -1
  18. package/dist/navigation-instruments/bearing-indicator/bearing-indicator.css.js +6 -2
  19. package/dist/navigation-instruments/bearing-indicator/bearing-indicator.css.js.map +1 -1
  20. package/dist/navigation-instruments/compass-indicator/compass-indicator.css.js +6 -2
  21. package/dist/navigation-instruments/compass-indicator/compass-indicator.css.js.map +1 -1
  22. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts.map +1 -1
  23. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js +1 -1
  24. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js.map +1 -1
  25. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts.map +1 -1
  26. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js +1 -1
  27. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js.map +1 -1
  28. package/package.json +1 -1
@@ -76568,6 +76568,21 @@ const componentStyle$_ = i$7`* {
76568
76568
  cursor: not-allowed;
76569
76569
  }
76570
76570
 
76571
+ /* A read-only field is still focusable and selectable, but it accepts no
76572
+ edits — so it must not advertise the hover/pressed affordances that
76573
+ \`@mixin style\` renders. Zeroing --obc-can-hover makes the mixin's hover
76574
+ colour-mix collapse back onto the enabled colours; the pressed state has
76575
+ no such switch and is restored explicitly. */
76576
+
76577
+ .wrapper.readonly {
76578
+ --obc-can-hover: 0;
76579
+ }
76580
+
76581
+ .wrapper.readonly:not(.disabled):active .input-field-container {
76582
+ border-color: var(--normal-enabled-border-color);
76583
+ background: var(--normal-enabled-background-color);
76584
+ }
76585
+
76571
76586
  .wrapper.helpertext,.wrapper.haslabel {
76572
76587
  flex-direction: column;
76573
76588
  align-items: flex-start;
@@ -76578,6 +76593,10 @@ const componentStyle$_ = i$7`* {
76578
76593
  background: var(--container-background-color);
76579
76594
  }
76580
76595
 
76596
+ .wrapper.readonly.empty:not(.disabled):active .input-field-container {
76597
+ background: var(--container-background-color);
76598
+ }
76599
+
76581
76600
  .wrapper.empty:not(.disabled):focus-within .input-field-container {
76582
76601
  background: var(--normal-enabled-background-color);
76583
76602
  }
@@ -77173,7 +77192,7 @@ let ObcTextInputField = class extends i$4 {
77173
77192
  }
77174
77193
  render() {
77175
77194
  const hasHelperOrError = Boolean(this.helperText) || Boolean(this.error && this.errorText);
77176
- const showClearButton = this.hasClearButton && this.value.length > 0 && !this.disabled;
77195
+ const showClearButton = this.hasClearButton && this.value.length > 0 && !this.disabled && !this.readonly;
77177
77196
  const isPasswordField = this.type === "password";
77178
77197
  const showPasswordToggle = isPasswordField && !this.disabled;
77179
77198
  const isClearButtonVisible = showClearButton && !showPasswordToggle;
@@ -77191,6 +77210,7 @@ let ObcTextInputField = class extends i$4 {
77191
77210
  [`size-${this.size}`]: true,
77192
77211
  error: this.error,
77193
77212
  disabled: this.disabled,
77213
+ readonly: this.readonly,
77194
77214
  empty: this.isEmpty,
77195
77215
  helpertext: hasHelperOrError,
77196
77216
  haslabel: Boolean(this.label),
@@ -92861,8 +92881,7 @@ let ObcKeyboardFull = class extends i$4 {
92861
92881
  this.preventFocusLoss = (e2) => {
92862
92882
  e2.preventDefault();
92863
92883
  };
92864
- this.onKeyPress = async (key) => {
92865
- const char = this.capsLock && this.mode === "abc" && !this.showNumberRow ? key.toUpperCase() : key.toLowerCase();
92884
+ this.onKeyPress = async (char) => {
92866
92885
  const inputElement = this.inputField?.shadowRoot?.querySelector(
92867
92886
  "input"
92868
92887
  );
@@ -92966,6 +92985,13 @@ let ObcKeyboardFull = class extends i$4 {
92966
92985
  this.dispatchValueChange();
92967
92986
  };
92968
92987
  }
92988
+ /**
92989
+ * The character a letter key both shows and inserts. CAPS applies wherever
92990
+ * the alphabetic layout is rendered, including the number-row variant.
92991
+ */
92992
+ letterKeyLabel(key) {
92993
+ return this.capsLock ? key.toUpperCase() : key.toLowerCase();
92994
+ }
92969
92995
  renderCursorNavigation() {
92970
92996
  return b`
92971
92997
  <div class="navigation-buttons-container">
@@ -93101,18 +93127,19 @@ let ObcKeyboardFull = class extends i$4 {
93101
93127
  ${index2 === 2 && row.length < 10 ? Array(10 - row.length).fill(0).map(
93102
93128
  () => b`<div class="key-button-placeholder"></div>`
93103
93129
  ) : A}
93104
- ${row.map(
93105
- (key) => b`
93130
+ ${row.map((key) => {
93131
+ const label = this.letterKeyLabel(key);
93132
+ return b`
93106
93133
  <obc-button
93107
93134
  class="key-button"
93108
93135
  variant="normal"
93109
93136
  @mousedown=${this.preventFocusLoss}
93110
- @click=${() => this.onKeyPress(key)}
93137
+ @click=${() => this.onKeyPress(label)}
93111
93138
  >
93112
- ${this.capsLock ? key.toUpperCase() : key.toLowerCase()}
93139
+ ${label}
93113
93140
  </obc-button>
93114
- `
93115
- )}
93141
+ `;
93142
+ })}
93116
93143
  </div>
93117
93144
  `
93118
93145
  )}
@@ -93840,6 +93867,21 @@ const componentStyle$H = i$7`* {
93840
93867
  cursor: not-allowed;
93841
93868
  }
93842
93869
 
93870
+ /* A read-only field is still focusable and selectable, but it accepts no
93871
+ edits — so it must not advertise the hover/pressed affordances that
93872
+ \`@mixin style\` renders. Zeroing --obc-can-hover makes the mixin's hover
93873
+ colour-mix collapse back onto the enabled colours; the pressed state has
93874
+ no such switch and is restored explicitly. */
93875
+
93876
+ .wrapper.readonly {
93877
+ --obc-can-hover: 0;
93878
+ }
93879
+
93880
+ .wrapper.readonly:not(.disabled):active .input-field-container {
93881
+ border-color: var(--normal-enabled-border-color);
93882
+ background: var(--normal-enabled-background-color);
93883
+ }
93884
+
93843
93885
  .wrapper.helpertext,.wrapper.haslabel {
93844
93886
  flex-direction: column;
93845
93887
  align-items: flex-start;
@@ -93850,6 +93892,10 @@ const componentStyle$H = i$7`* {
93850
93892
  background: var(--container-background-color);
93851
93893
  }
93852
93894
 
93895
+ .wrapper.readonly.empty:not(.disabled):active .input-field-container {
93896
+ background: var(--container-background-color);
93897
+ }
93898
+
93853
93899
  .wrapper.empty:not(.disabled):focus-within .input-field-container {
93854
93900
  background: var(--normal-enabled-background-color);
93855
93901
  }
@@ -94382,6 +94428,7 @@ let ObcNumberInputField = class extends i$4 {
94382
94428
  }
94383
94429
  onFocus() {
94384
94430
  this.hasFocus = true;
94431
+ if (this.readonly) return;
94385
94432
  const source = this.displayOverride || this.displayText;
94386
94433
  this.displayText = removeGroupingFromDisplay(
94387
94434
  source,
@@ -94391,6 +94438,7 @@ let ObcNumberInputField = class extends i$4 {
94391
94438
  }
94392
94439
  onBlur() {
94393
94440
  this.hasFocus = false;
94441
+ if (this.readonly) return;
94394
94442
  this.commitDisplay();
94395
94443
  if (!valuesEqual(this.value, this.lastCommittedValue)) {
94396
94444
  this.lastCommittedValue = this.value;
@@ -94563,6 +94611,7 @@ let ObcNumberInputField = class extends i$4 {
94563
94611
  [`size-${this.size}`]: true,
94564
94612
  error: this.error,
94565
94613
  disabled: this.disabled,
94614
+ readonly: this.readonly,
94566
94615
  empty: this.isEmpty,
94567
94616
  helpertext: hasHelperOrError,
94568
94617
  haslabel: Boolean(this.label),
@@ -211159,8 +211208,12 @@ ObcAzimuthThrusterLabeled = __decorateClass$S([
211159
211208
  customElement("obc-azimuth-thruster-labeled")
211160
211209
  ], ObcAzimuthThrusterLabeled);
211161
211210
  const compentStyle$b = i$7`* {
211162
- -webkit-tap-highlight-color: transparent
211163
- }`;
211211
+ -webkit-tap-highlight-color: transparent;
211212
+ }
211213
+ svg {
211214
+ display: block;
211215
+ }
211216
+ `;
211164
211217
  var __defProp$R = Object.defineProperty;
211165
211218
  var __getOwnPropDesc$R = Object.getOwnPropertyDescriptor;
211166
211219
  var __decorateClass$R = (decorators, target, key, kind) => {
@@ -212316,8 +212369,12 @@ ObcCompassFlat = __decorateClass$P([
212316
212369
  customElement("obc-compass-flat")
212317
212370
  ], ObcCompassFlat);
212318
212371
  const componentStyle$i = i$7`* {
212319
- -webkit-tap-highlight-color: transparent
212320
- }`;
212372
+ -webkit-tap-highlight-color: transparent;
212373
+ }
212374
+ svg {
212375
+ display: block;
212376
+ }
212377
+ `;
212321
212378
  var __defProp$O = Object.defineProperty;
212322
212379
  var __getOwnPropDesc$O = Object.getOwnPropertyDescriptor;
212323
212380
  var __decorateClass$O = (decorators, target, key, kind) => {
@@ -214899,7 +214956,7 @@ let ObcGaugeHorizontal = class extends SetpointMixin(i$4, {
214899
214956
  height=${this.fixedAspectRatio ? "100%" : `${viewBox.height}px`}
214900
214957
  viewBox="${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}"
214901
214958
  preserveAspectRatio="${preserveAspectRatio}"
214902
- style="--scale: ${this.fixedAspectRatio ? this._scale : 1};"
214959
+ style="--scale: ${this.fixedAspectRatio ? this._scale : 1}; display: block;"
214903
214960
  part="svg"
214904
214961
  >
214905
214962
  ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}
@@ -217578,7 +217635,7 @@ let ObcGaugeVertical = class extends SetpointMixin(i$4, {
217578
217635
  height=${this.fixedAspectRatio ? "100%" : `${this.height}px`}
217579
217636
  viewBox="${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}"
217580
217637
  preserveAspectRatio="${preserveAspectRatio}"
217581
- style="--scale: ${this.fixedAspectRatio ? this._scale : 1};"
217638
+ style="--scale: ${this.fixedAspectRatio ? this._scale : 1}; display: block;"
217582
217639
  part="svg"
217583
217640
  >
217584
217641
  ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}