@viasat/beam-web-components 2.62.0 → 2.64.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 +592 -583
  29. package/local/wip/Form/Form.decorator.js +55 -54
  30. package/package.json +6 -6
  31. package/vscode.html-custom-data.json +134 -134
  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
@@ -36,11 +36,11 @@ export declare class BmForm extends LitElement {
36
36
  target: Optional<string>;
37
37
  enctype: Optional<string>;
38
38
  formMeta: Record<string, FieldMeta>;
39
- formRef: import('lit-html/directives/ref').Ref<HTMLFormElement>;
39
+ formRef: import('lit/directives/ref.js').Ref<HTMLFormElement>;
40
40
  private _actionFired;
41
41
  formContext: BmFormContext;
42
42
  willUpdate(changedProperties: Map<string, unknown>): void;
43
- render(): import('lit-html').TemplateResult<1>;
43
+ render(): import('lit').TemplateResult<1>;
44
44
  }
45
45
  declare global {
46
46
  interface HTMLElementTagNameMap {
@@ -41,7 +41,7 @@ export declare class FormField extends LitElement {
41
41
  protected setContextValue: () => void;
42
42
  protected setContextValidation: () => void;
43
43
  protected contextInitialsChanged: () => boolean;
44
- protected renderError: (error: Optional<string>, disabled: boolean) => typeof nothing | import('lit-html').TemplateResult<1>;
45
- protected renderValidationErrors: () => typeof nothing | import('lit-html').TemplateResult<1>;
44
+ protected renderError: (error: Optional<string>, disabled: boolean) => typeof nothing | import('lit').TemplateResult<1>;
45
+ protected renderValidationErrors: () => typeof nothing | import('lit').TemplateResult<1>;
46
46
  }
47
47
  //# sourceMappingURL=Form.decorator.d.ts.map
@@ -1,47 +1,48 @@
1
- var x = (a) => {
1
+ var V = (a) => {
2
2
  throw TypeError(a);
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), y = (a, r, t, e) => (C(a, r, "write to private field"), e ? e.call(a, t) : r.set(a, t), t);
6
- import { consume as V } from "@lit/context";
7
- import { LitElement as E, nothing as f, html as p } from "lit";
8
- import { property as h, state as k } from "lit/decorators.js";
9
- import { createRef as A } from "lit/directives/ref.js";
10
- import { b as F } from "../../chunks/tokens.CTW8Tt94.js";
11
- import { bmFormInitials as c, bmFormContext as I } from "./Form.context.js";
12
- import { createId as m } from "./Form.utils.js";
4
+ var y = (a, r, t) => r.has(a) || V("Cannot " + t);
5
+ var f = (a, r, t) => (y(a, r, "read from private field"), t ? t.call(a) : r.get(a)), b = (a, r, t) => r.has(a) ? V("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), m = (a, r, t, e) => (y(a, r, "write to private field"), e ? e.call(a, t) : r.set(a, t), t);
6
+ import { consume as E } from "@lit/context";
7
+ import { LitElement as k, nothing as v, html as x } from "lit";
8
+ import { property as d, state as A } from "lit/decorators.js";
9
+ import { createRef as F } from "lit/directives/ref.js";
10
+ import { b as I } from "../../chunks/tokens.CTW8Tt94.js";
11
+ import { bmFormInitials as u, bmFormContext as S } from "./Form.context.js";
12
+ import { createId as p } from "./Form.utils.js";
13
13
  import "../../chunks/HelperText.Cc_6DlKP.js";
14
- var S = Object.defineProperty, n = (a, r, t, e) => {
15
- for (var i = void 0, s = a.length - 1, d; s >= 0; s--)
16
- (d = a[s]) && (i = d(r, t, i) || i);
17
- return i && S(r, t, i), i;
18
- }, l;
19
- const b = class b extends E {
14
+ var R = Object.defineProperty, l = (a, r, t, e) => {
15
+ for (var i = void 0, s = a.length - 1, c; s >= 0; s--)
16
+ (c = a[s]) && (i = c(r, t, i) || i);
17
+ return i && R(r, t, i), i;
18
+ }, n, h;
19
+ const C = class C extends k {
20
20
  constructor() {
21
21
  super(...arguments);
22
- g(this, l);
23
- 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) => {
22
+ b(this, n);
23
+ b(this, h);
24
+ 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) => {
24
25
  this._validationErrors = t;
25
- }, this.validationErrorShown = () => this.validationErrors().some((t) => !!(t != null && t.length)), y(this, l, /* @__PURE__ */ new WeakMap()), this.submitFormByEnter = ({ key: t }) => {
26
+ }, this.validationErrorShown = () => this.validationErrors().some((t) => !!(t != null && t.length)), m(this, h, /* @__PURE__ */ new WeakMap()), this.submitFormByEnter = ({ key: t }) => {
26
27
  t === "Enter" && this.requestAssociatedSubmit();
27
28
  }, this.forwardLabelFocus = () => {
28
29
  const { value: t } = this.formFieldRef;
29
30
  t.focus();
30
31
  }, this.validateFieldOnBlur = (t) => {
31
- const { formBlurHandler: e } = this.formContext || c;
32
+ const { formBlurHandler: e } = this.formContext || u;
32
33
  e(t);
33
34
  }, this.validateFieldOnChange = (t) => {
34
- const { value: e } = t.target, { formChangeHandler: i } = this.formContext || c;
35
+ const { value: e } = t.target, { formChangeHandler: i } = this.formContext || u;
35
36
  i(t), this.setAssociatedValue(e);
36
37
  }, this.getContextValue = () => {
37
- const { initialValues: t } = this.formContext || c;
38
+ const { initialValues: t } = this.formContext || u;
38
39
  return (t == null ? void 0 : t[this.name]) || this.value;
39
40
  }, this.setContextValue = () => {
40
41
  const { value: t } = this.formFieldRef, { ctxValue: e, finalizeCallback: i = () => {
41
42
  } } = this.finalizeAssociatedCallback(this.getContextValue()), s = t;
42
43
  s.value !== e && (s.value = e), this.setAssociatedValue(e), i();
43
44
  }, this.setContextValidation = () => {
44
- const { value: t } = this.formFieldRef, { registerField: e } = this.formContext || c;
45
+ const { value: t } = this.formFieldRef, { registerField: e } = this.formContext || u;
45
46
  e({
46
47
  field: t,
47
48
  validators: this.validationRules,
@@ -49,16 +50,16 @@ const b = class b extends E {
49
50
  errorSetter: this.setValidationErrors
50
51
  });
51
52
  }, this.contextInitialsChanged = () => {
52
- const { initialValues: t } = this.formContext || c, e = t == null ? void 0 : t[this.name], i = e !== this.contextInitialValue;
53
+ const { initialValues: t } = this.formContext || u, e = t == null ? void 0 : t[this.name], i = e !== this.contextInitialValue;
53
54
  return i && (this.contextInitialValue = e), i;
54
- }, this.renderError = (t, e) => t ? p`
55
+ }, this.renderError = (t, e) => t ? x`
55
56
  <bm-helper-text
56
57
  text="${t}"
57
58
  id="${this.errorId}"
58
59
  appearance="negative"
59
60
  .disabled="${e}"
60
61
  ></bm-helper-text>
61
- ` : f, this.renderValidationErrors = () => this.validationErrorShown() ? p`
62
+ ` : v, this.renderValidationErrors = () => this.validationErrorShown() ? x`
62
63
  <div
63
64
  role="log"
64
65
  aria-live="polite"
@@ -67,20 +68,20 @@ const b = class b extends E {
67
68
  id="${this.validationErrorsId}"
68
69
  >
69
70
  ${this.validationErrors().map(
70
- (t) => t ? p`
71
+ (t) => t ? x`
71
72
  <bm-helper-text
72
73
  text="${t}"
73
74
  appearance="negative"
74
- style="display: block; margin-top: ${F};"
75
+ style="display: block; margin-top: ${I};"
75
76
  ></bm-helper-text>
76
- ` : f
77
+ ` : v
77
78
  )}
78
79
  </div>
79
- ` : f;
80
+ ` : v;
80
81
  }
81
82
  setAssociatedValue(t) {
82
83
  if (typeof t == "string") {
83
- if (this.value === t) return;
84
+ if (this.value === t && f(this, n)) return;
84
85
  this.value = t;
85
86
  }
86
87
  let e = null;
@@ -93,7 +94,7 @@ const b = class b extends E {
93
94
  t.forEach((s) => i.append(this.name, s.toString())), e = i;
94
95
  } else
95
96
  e = t;
96
- this.internals.form && this.internals.setFormValue(e);
97
+ m(this, n, !0), this.internals.form && this.internals.setFormValue(e);
97
98
  }
98
99
  requestAssociatedSubmit() {
99
100
  this.internals.form && this.internals.form.requestSubmit();
@@ -102,14 +103,14 @@ const b = class b extends E {
102
103
  super.connectedCallback(), this.addEventListener("bm-label-click", this.forwardLabelFocus);
103
104
  }
104
105
  ctxValueChanged(t, e) {
105
- const { value: i } = e, s = u(this, l).get(i), { initialValues: { [this.name]: d } = {} } = t, v = d !== s;
106
- return v && u(this, l).set(i, d), v;
106
+ const { value: i } = e, s = f(this, h).get(i), { initialValues: { [this.name]: c } = {} } = t, g = c !== s;
107
+ return g && f(this, h).set(i, c), g;
107
108
  }
108
109
  disconnectedCallback() {
109
110
  super.disconnectedCallback(), this.removeEventListener("bm-label-click", this.forwardLabelFocus);
110
111
  }
111
112
  formAssociatedCallback() {
112
- this.setAssociatedValue(this.value);
113
+ m(this, n, !1), this.setAssociatedValue(this.value);
113
114
  }
114
115
  formResetCallback() {
115
116
  this.setContextValue();
@@ -119,29 +120,29 @@ const b = class b extends E {
119
120
  } };
120
121
  }
121
122
  };
122
- l = new WeakMap(), b.formAssociated = !0;
123
- let o = b;
124
- n([
125
- h({ type: String })
123
+ n = new WeakMap(), h = new WeakMap(), C.formAssociated = !0;
124
+ let o = C;
125
+ l([
126
+ d({ type: String })
126
127
  ], o.prototype, "id");
127
- n([
128
- h({ type: String })
128
+ l([
129
+ d({ type: String, reflect: !0 })
129
130
  ], o.prototype, "name");
130
- n([
131
- h({ type: String })
131
+ l([
132
+ d({ type: String })
132
133
  ], o.prototype, "value");
133
- n([
134
- h({ type: Array })
134
+ l([
135
+ d({ type: Array })
135
136
  ], o.prototype, "validationRules");
136
- n([
137
- h({ type: String, attribute: "input-aria-label" })
137
+ l([
138
+ d({ type: String, attribute: "input-aria-label" })
138
139
  ], o.prototype, "inputAriaLabel");
139
- n([
140
- V({ context: I, subscribe: !0 }),
141
- h({ attribute: !1 })
140
+ l([
141
+ E({ context: S, subscribe: !0 }),
142
+ d({ attribute: !1 })
142
143
  ], o.prototype, "formContext");
143
- n([
144
- k()
144
+ l([
145
+ A()
145
146
  ], o.prototype, "_validationErrors");
146
147
  export {
147
148
  o as FormField
@@ -40,13 +40,13 @@ export declare class BmRadioButton extends LitElement {
40
40
  */
41
41
  onKeyDown?: (event: KeyboardEvent) => void;
42
42
  inputChoiceGroupContext: InputChoiceGroupContextProps;
43
- radioButtonRef: import('lit-html/directives/ref').Ref<HTMLInputElement>;
43
+ radioButtonRef: import('lit/directives/ref.js').Ref<HTMLInputElement>;
44
44
  focus(): void;
45
45
  private handleForwardedEvents;
46
46
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
47
47
  private _handleChange;
48
48
  private _handleKeyDown;
49
- render(): import('lit-html').TemplateResult<1>;
49
+ render(): import('lit').TemplateResult<1>;
50
50
  }
51
51
  declare global {
52
52
  interface HTMLElementTagNameMap {
@@ -47,12 +47,12 @@ export declare class BmSwitch extends LitElement {
47
47
  * The value attribute for the input element
48
48
  */
49
49
  value?: string;
50
- switchRef: import('lit-html/directives/ref').Ref<HTMLInputElement>;
50
+ switchRef: import('lit/directives/ref.js').Ref<HTMLInputElement>;
51
51
  updated(changedProperties: Map<string | number | symbol, unknown>): void;
52
52
  private handleForwardedEvents;
53
53
  private onChange;
54
54
  private _updateDisplayedSlot;
55
- render(): import('lit-html').TemplateResult<1>;
55
+ render(): import('lit').TemplateResult<1>;
56
56
  }
57
57
  declare global {
58
58
  interface HTMLElementTagNameMap {
@@ -74,7 +74,7 @@ export declare class BmTextArea extends FormField {
74
74
  */
75
75
  theme: Optional<ThemeTypes>;
76
76
  static styles: import('lit').CSSResult;
77
- formFieldCounterRef: import('lit-html/directives/ref').Ref<HTMLSpanElement>;
77
+ formFieldCounterRef: import('lit/directives/ref.js').Ref<HTMLSpanElement>;
78
78
  private _textAreaLabel;
79
79
  private _textAreaHelperText;
80
80
  updated(cP: Map<string, unknown>): void;