@viasat/beam-web-components 2.63.0 → 2.65.0

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 (43) hide show
  1. package/Accordion/Accordion.d.ts +1 -1
  2. package/Accordion/AccordionGroup.d.ts +1 -1
  3. package/Alert/Alert.d.ts +1 -1
  4. package/Avatar/Avatar.d.ts +1 -1
  5. package/Avatar/AvatarGroup.d.ts +1 -1
  6. package/Badge/Badge.d.ts +1 -1
  7. package/BadgeDot/BadgeDot.d.ts +1 -1
  8. package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  9. package/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
  10. package/Button/Button.d.ts +1 -1
  11. package/CloseButton/CloseButton.d.ts +1 -1
  12. package/EmptyState/EmptyState.d.ts +1 -1
  13. package/HelperText/HelperText.d.ts +1 -1
  14. package/Icon/Icon.d.ts +1 -1
  15. package/InputChoiceGroup/InputChoiceGroup.d.ts +1 -1
  16. package/Label/Label.d.ts +1 -1
  17. package/Link/Link.d.ts +1 -1
  18. package/List/List.d.ts +1 -1
  19. package/List/ListItem.d.ts +1 -1
  20. package/ProgressBar/ProgressBar.d.ts +1 -1
  21. package/SegmentedControl/SegmentedControl.d.ts +1 -1
  22. package/SegmentedControl/SegmentedControlItem.d.ts +1 -1
  23. package/SegmentedControl/SegmentedControlList.d.ts +1 -1
  24. package/SegmentedControl/SegmentedControlPanel.d.ts +1 -1
  25. package/Spinner/Spinner.d.ts +1 -1
  26. package/Text/Text.d.ts +1 -1
  27. package/Tooltip/Tooltip.d.ts +2 -2
  28. package/custom-elements.json +2796 -2787
  29. package/local/wip/Form/Form.decorator.js +55 -54
  30. package/package.json +6 -6
  31. package/vscode.html-custom-data.json +224 -224
  32. package/wip/Checkbox/Checkbox.d.ts +1 -1
  33. package/wip/FileUpload/FileUpload.Button.d.ts +1 -1
  34. package/wip/FileUpload/FileUpload.Dropzone.d.ts +1 -1
  35. package/wip/FileUpload/FileUpload.List.Item.d.ts +1 -1
  36. package/wip/FileUpload/FileUpload.List.d.ts +1 -1
  37. package/wip/FileUpload/FileUpload.d.ts +2 -2
  38. package/wip/Form/Form.d.ts +2 -2
  39. package/wip/Form/Form.decorator.d.ts +2 -2
  40. package/wip/Form/Form.decorator.js +53 -52
  41. package/wip/RadioButton/RadioButton.d.ts +2 -2
  42. package/wip/Switch/Switch.d.ts +2 -2
  43. package/wip/TextArea/TextArea.d.ts +1 -1
@@ -1,48 +1,49 @@
1
- var x = (a) => {
2
- throw TypeError(a);
1
+ var V = (r) => {
2
+ throw TypeError(r);
3
3
  };
4
- var C = (a, r, t) => r.has(a) || x("Cannot " + t);
5
- var u = (a, r, t) => (C(a, r, "read from private field"), t ? t.call(a) : r.get(a)), g = (a, r, t) => r.has(a) ? x("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), V = (a, r, t, e) => (C(a, r, "write to private field"), e ? e.call(a, t) : r.set(a, t), t);
6
- import { c as y } from "../../chunks/consume.Ce9k1-wN.js";
7
- import { a as E, E as f, x as p } from "../../chunks/lit-element.CJtt9wj5.js";
8
- import { n as h } from "../../chunks/register-custom-element.AOEv8hcs.js";
9
- import { r as k } from "../../chunks/state.Dr3yBpId.js";
10
- import { e as A } from "../../chunks/ref.B7e1Hu4F.js";
11
- import { b as F } from "../../chunks/tokens.CTW8Tt94.js";
12
- import { bmFormInitials as c, bmFormContext as I } from "./Form.context.js";
13
- import { createId as m } from "./Form.utils.js";
4
+ var y = (r, a, t) => a.has(r) || V("Cannot " + t);
5
+ var f = (r, a, t) => (y(r, a, "read from private field"), t ? t.call(r) : a.get(r)), b = (r, a, t) => a.has(r) ? V("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(r) : a.set(r, t), m = (r, a, t, e) => (y(r, a, "write to private field"), e ? e.call(r, t) : a.set(r, t), t);
6
+ import { c as E } from "../../chunks/consume.Ce9k1-wN.js";
7
+ import { a as k, E as v, x } from "../../chunks/lit-element.CJtt9wj5.js";
8
+ import { n as d } from "../../chunks/register-custom-element.AOEv8hcs.js";
9
+ import { r as A } from "../../chunks/state.Dr3yBpId.js";
10
+ import { e as F } from "../../chunks/ref.B7e1Hu4F.js";
11
+ import { b as I } from "../../chunks/tokens.CTW8Tt94.js";
12
+ import { bmFormInitials as u, bmFormContext as S } from "./Form.context.js";
13
+ import { createId as p } from "./Form.utils.js";
14
14
  import "../../chunks/index.BoeGm2HZ.js";
15
- var S = Object.defineProperty, n = (a, r, t, e) => {
16
- for (var i = void 0, s = a.length - 1, d; s >= 0; s--)
17
- (d = a[s]) && (i = d(r, t, i) || i);
18
- return i && S(r, t, i), i;
19
- }, l;
20
- const b = class b extends E {
15
+ var R = Object.defineProperty, l = (r, a, t, e) => {
16
+ for (var i = void 0, s = r.length - 1, c; s >= 0; s--)
17
+ (c = r[s]) && (i = c(a, t, i) || i);
18
+ return i && R(a, t, i), i;
19
+ }, n, h;
20
+ const C = class C extends k {
21
21
  constructor() {
22
22
  super(...arguments);
23
- g(this, l);
24
- this.labelId = m(), this.errorId = m(), this.helperTextId = m(), this.validationErrorsId = m(), this.internals = this.attachInternals(), this.formFieldRef = A(), this.id = "", this.name = "", this.value = "", this.validationRules = [], this._validationErrors = [], this.validationErrors = () => this._validationErrors, this.setValidationErrors = (t) => {
23
+ b(this, n);
24
+ b(this, h);
25
+ this.labelId = p(), this.errorId = p(), this.helperTextId = p(), this.validationErrorsId = p(), this.internals = this.attachInternals(), this.formFieldRef = F(), this.id = "", this.name = "", this.value = "", this.validationRules = [], this._validationErrors = [], this.validationErrors = () => this._validationErrors, m(this, n, !1), this.setValidationErrors = (t) => {
25
26
  this._validationErrors = t;
26
- }, this.validationErrorShown = () => this.validationErrors().some((t) => !!(t != null && t.length)), V(this, l, /* @__PURE__ */ new WeakMap()), this.submitFormByEnter = ({ key: t }) => {
27
+ }, this.validationErrorShown = () => this.validationErrors().some((t) => !!(t != null && t.length)), m(this, h, /* @__PURE__ */ new WeakMap()), this.submitFormByEnter = ({ key: t }) => {
27
28
  t === "Enter" && this.requestAssociatedSubmit();
28
29
  }, this.forwardLabelFocus = () => {
29
30
  const { value: t } = this.formFieldRef;
30
31
  t.focus();
31
32
  }, this.validateFieldOnBlur = (t) => {
32
- const { formBlurHandler: e } = this.formContext || c;
33
+ const { formBlurHandler: e } = this.formContext || u;
33
34
  e(t);
34
35
  }, this.validateFieldOnChange = (t) => {
35
- const { value: e } = t.target, { formChangeHandler: i } = this.formContext || c;
36
+ const { value: e } = t.target, { formChangeHandler: i } = this.formContext || u;
36
37
  i(t), this.setAssociatedValue(e);
37
38
  }, this.getContextValue = () => {
38
- const { initialValues: t } = this.formContext || c;
39
+ const { initialValues: t } = this.formContext || u;
39
40
  return (t == null ? void 0 : t[this.name]) || this.value;
40
41
  }, this.setContextValue = () => {
41
42
  const { value: t } = this.formFieldRef, { ctxValue: e, finalizeCallback: i = () => {
42
43
  } } = this.finalizeAssociatedCallback(this.getContextValue()), s = t;
43
44
  s.value !== e && (s.value = e), this.setAssociatedValue(e), i();
44
45
  }, this.setContextValidation = () => {
45
- const { value: t } = this.formFieldRef, { registerField: e } = this.formContext || c;
46
+ const { value: t } = this.formFieldRef, { registerField: e } = this.formContext || u;
46
47
  e({
47
48
  field: t,
48
49
  validators: this.validationRules,
@@ -50,16 +51,16 @@ const b = class b extends E {
50
51
  errorSetter: this.setValidationErrors
51
52
  });
52
53
  }, this.contextInitialsChanged = () => {
53
- const { initialValues: t } = this.formContext || c, e = t == null ? void 0 : t[this.name], i = e !== this.contextInitialValue;
54
+ const { initialValues: t } = this.formContext || u, e = t == null ? void 0 : t[this.name], i = e !== this.contextInitialValue;
54
55
  return i && (this.contextInitialValue = e), i;
55
- }, this.renderError = (t, e) => t ? p`
56
+ }, this.renderError = (t, e) => t ? x`
56
57
  <bm-helper-text
57
58
  text="${t}"
58
59
  id="${this.errorId}"
59
60
  appearance="negative"
60
61
  .disabled="${e}"
61
62
  ></bm-helper-text>
62
- ` : f, this.renderValidationErrors = () => this.validationErrorShown() ? p`
63
+ ` : v, this.renderValidationErrors = () => this.validationErrorShown() ? x`
63
64
  <div
64
65
  role="log"
65
66
  aria-live="polite"
@@ -68,20 +69,20 @@ const b = class b extends E {
68
69
  id="${this.validationErrorsId}"
69
70
  >
70
71
  ${this.validationErrors().map(
71
- (t) => t ? p`
72
+ (t) => t ? x`
72
73
  <bm-helper-text
73
74
  text="${t}"
74
75
  appearance="negative"
75
- style="display: block; margin-top: ${F};"
76
+ style="display: block; margin-top: ${I};"
76
77
  ></bm-helper-text>
77
- ` : f
78
+ ` : v
78
79
  )}
79
80
  </div>
80
- ` : f;
81
+ ` : v;
81
82
  }
82
83
  setAssociatedValue(t) {
83
84
  if (typeof t == "string") {
84
- if (this.value === t) return;
85
+ if (this.value === t && f(this, n)) return;
85
86
  this.value = t;
86
87
  }
87
88
  let e = null;
@@ -94,7 +95,7 @@ const b = class b extends E {
94
95
  t.forEach((s) => i.append(this.name, s.toString())), e = i;
95
96
  } else
96
97
  e = t;
97
- this.internals.form && this.internals.setFormValue(e);
98
+ m(this, n, !0), this.internals.form && this.internals.setFormValue(e);
98
99
  }
99
100
  requestAssociatedSubmit() {
100
101
  this.internals.form && this.internals.form.requestSubmit();
@@ -103,14 +104,14 @@ const b = class b extends E {
103
104
  super.connectedCallback(), this.addEventListener("bm-label-click", this.forwardLabelFocus);
104
105
  }
105
106
  ctxValueChanged(t, e) {
106
- const { value: i } = e, s = u(this, l).get(i), { initialValues: { [this.name]: d } = {} } = t, v = d !== s;
107
- return v && u(this, l).set(i, d), v;
107
+ const { value: i } = e, s = f(this, h).get(i), { initialValues: { [this.name]: c } = {} } = t, g = c !== s;
108
+ return g && f(this, h).set(i, c), g;
108
109
  }
109
110
  disconnectedCallback() {
110
111
  super.disconnectedCallback(), this.removeEventListener("bm-label-click", this.forwardLabelFocus);
111
112
  }
112
113
  formAssociatedCallback() {
113
- this.setAssociatedValue(this.value);
114
+ m(this, n, !1), this.setAssociatedValue(this.value);
114
115
  }
115
116
  formResetCallback() {
116
117
  this.setContextValue();
@@ -120,29 +121,29 @@ const b = class b extends E {
120
121
  } };
121
122
  }
122
123
  };
123
- l = new WeakMap(), b.formAssociated = !0;
124
- let o = b;
125
- n([
126
- h({ type: String })
124
+ n = new WeakMap(), h = new WeakMap(), C.formAssociated = !0;
125
+ let o = C;
126
+ l([
127
+ d({ type: String })
127
128
  ], o.prototype, "id");
128
- n([
129
- h({ type: String })
129
+ l([
130
+ d({ type: String, reflect: !0 })
130
131
  ], o.prototype, "name");
131
- n([
132
- h({ type: String })
132
+ l([
133
+ d({ type: String })
133
134
  ], o.prototype, "value");
134
- n([
135
- h({ type: Array })
135
+ l([
136
+ d({ type: Array })
136
137
  ], o.prototype, "validationRules");
137
- n([
138
- h({ type: String, attribute: "input-aria-label" })
138
+ l([
139
+ d({ type: String, attribute: "input-aria-label" })
139
140
  ], o.prototype, "inputAriaLabel");
140
- n([
141
- y({ context: I, subscribe: !0 }),
142
- h({ attribute: !1 })
141
+ l([
142
+ E({ context: S, subscribe: !0 }),
143
+ d({ attribute: !1 })
143
144
  ], o.prototype, "formContext");
144
- n([
145
- k()
145
+ l([
146
+ A()
146
147
  ], o.prototype, "_validationErrors");
147
148
  export {
148
149
  o as FormField
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-web-components",
3
- "version": "2.63.0",
3
+ "version": "2.65.0",
4
4
  "description": "Framework-agnostic web components for the Beam Design System built with Lit, compatible with Angular, Vue, Svelte, and vanilla JavaScript",
5
5
  "license": "MIT",
6
6
  "author": "Viasat",
@@ -64,11 +64,11 @@
64
64
  "access": "public"
65
65
  },
66
66
  "dependencies": {
67
- "@viasat/beam-fonts": "2.63.0",
68
- "@viasat/beam-shared": "2.63.0",
69
- "@viasat/beam-styles": "2.63.0",
70
- "@viasat/beam-tokens": "2.63.0",
71
- "@viasat/beam-icons": "2.63.0",
67
+ "@viasat/beam-fonts": "2.65.0",
68
+ "@viasat/beam-shared": "2.65.0",
69
+ "@viasat/beam-styles": "2.65.0",
70
+ "@viasat/beam-tokens": "2.65.0",
71
+ "@viasat/beam-icons": "2.65.0",
72
72
  "clsx": "^1.2.1",
73
73
  "lit": "^3.1.0",
74
74
  "@lit/context": "^1.1.1",