dap-design-system 0.57.6 → 0.57.7

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.
@@ -44,6 +44,8 @@ export default class DapDSRadioGroup extends GenericFormElement {
44
44
  optionalLabel: string;
45
45
  private _previousValue?;
46
46
  static readonly styles: import('lit').CSSResult;
47
+ /** A radio value may be `false` or `0`, so emptiness is not the same as falsiness. */
48
+ private get hasValue();
47
49
  willUpdate(changedProperties: Map<string, unknown>): void;
48
50
  updated(changedProperties: Map<string, unknown>): void;
49
51
  attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
@@ -13841,6 +13841,10 @@ let so = class extends pe {
13841
13841
  constructor() {
13842
13842
  super(...arguments), this.tooltipPlacement = "bottom", this.optionalLabel = "";
13843
13843
  }
13844
+ /** A radio value may be `false` or `0`, so emptiness is not the same as falsiness. */
13845
+ get hasValue() {
13846
+ return this.value !== void 0 && this.value !== null && this.value !== "";
13847
+ }
13844
13848
  willUpdate(t) {
13845
13849
  super.willUpdate(t), t.has("value") && (this._previousValue = t.get("value"));
13846
13850
  }
@@ -13862,7 +13866,7 @@ let so = class extends pe {
13862
13866
  const t = this.getAllRadios();
13863
13867
  if (t.forEach((e, i) => {
13864
13868
  e.checked = e.value === this.value, e.size = this.size, e.posInSet = i + 1, e.setSize = t.length, this.name && (e.name = this.name), e.focusable = e.checked;
13865
- }), !this.value) {
13869
+ }), !this.hasValue) {
13866
13870
  const e = t.find((i) => !i.disabled);
13867
13871
  e && (e.focusable = !0);
13868
13872
  }
@@ -13875,7 +13879,7 @@ let so = class extends pe {
13875
13879
  t.map((e, i) => R(this, null, function* () {
13876
13880
  yield e.updateComplete, e.checked = e.value === this.value, e.size = this.size, e.posInSet = i + 1, e.setSize = t.length, this.name && (e.name = this.name), e.focusable = e.checked;
13877
13881
  }))
13878
- ), !this.value) {
13882
+ ), !this.hasValue) {
13879
13883
  const e = t.find((i) => !i.disabled);
13880
13884
  e && t.forEach((i) => {
13881
13885
  i.focusable = i === e;
@@ -13914,12 +13918,12 @@ let so = class extends pe {
13914
13918
  return " ";
13915
13919
  }
13916
13920
  checkValidity() {
13917
- return !this.required || !!(this.required && this.value);
13921
+ return !this.required || this.hasValue;
13918
13922
  }
13919
13923
  get validity() {
13920
13924
  return q(x({}, this.internals.validity), {
13921
13925
  valid: this.checkValidity(),
13922
- valueMissing: this.required && !this.value
13926
+ valueMissing: this.required && !this.hasValue
13923
13927
  });
13924
13928
  }
13925
13929
  reportValidity() {
@@ -17657,7 +17661,8 @@ let Pt = class extends Xa {
17657
17661
  try {
17658
17662
  this.emit("dds-change", {
17659
17663
  checked: t,
17660
- value: e || "",
17664
+ // `?? ''` not `|| ''` — a radio may legitimately carry `false` or `0`
17665
+ value: e != null ? e : "",
17661
17666
  disabled: i,
17662
17667
  readonly: this.readonly,
17663
17668
  type: "radio"
@@ -21657,7 +21662,7 @@ export {
21657
21662
  Na as Y,
21658
21663
  Vo as Z,
21659
21664
  ie as _,
21660
- Ut as a,
21665
+ Be as a,
21661
21666
  Ar as a0,
21662
21667
  zt as a1,
21663
21668
  Lr as a2,
@@ -21703,24 +21708,24 @@ export {
21703
21708
  po as ax,
21704
21709
  me as ay,
21705
21710
  Pr as az,
21706
- Po as b,
21707
- to as c,
21708
- Be as d,
21709
- eo as e,
21710
- He as f,
21711
- vi as g,
21711
+ Ut as b,
21712
+ eo as c,
21713
+ He as d,
21714
+ vi as e,
21715
+ to as f,
21716
+ Po as g,
21712
21717
  ii as h,
21713
21718
  Ot as i,
21714
21719
  qt as j,
21715
21720
  Mt as k,
21716
21721
  Xt as l,
21717
- Ia as m,
21718
- $r as n,
21719
- Ei as o,
21720
- Sr as p,
21721
- Mo as q,
21722
- ve as r,
21723
- jt as s,
21722
+ jt as m,
21723
+ Ia as n,
21724
+ $r as o,
21725
+ Ei as p,
21726
+ Sr as q,
21727
+ Mo as r,
21728
+ ve as s,
21724
21729
  Ce as t,
21725
21730
  Pi as u,
21726
21731
  De as v,
@@ -21729,4 +21734,4 @@ export {
21729
21734
  Qt as y,
21730
21735
  wi as z
21731
21736
  };
21732
- //# sourceMappingURL=components-C0QWDkMH.js.map
21737
+ //# sourceMappingURL=components-CMBmObyM.js.map