@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.
- package/Accordion/Accordion.d.ts +1 -1
- package/Accordion/AccordionGroup.d.ts +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/AvatarGroup.d.ts +1 -1
- package/Badge/Badge.d.ts +1 -1
- package/BadgeDot/BadgeDot.d.ts +1 -1
- package/Breadcrumbs/Breadcrumbs.d.ts +1 -1
- package/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/Button/Button.d.ts +1 -1
- package/CloseButton/CloseButton.d.ts +1 -1
- package/EmptyState/EmptyState.d.ts +1 -1
- package/HelperText/HelperText.d.ts +1 -1
- package/Icon/Icon.d.ts +1 -1
- package/InputChoiceGroup/InputChoiceGroup.d.ts +1 -1
- package/Label/Label.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/List/List.d.ts +1 -1
- package/List/ListItem.d.ts +1 -1
- package/ProgressBar/ProgressBar.d.ts +1 -1
- package/SegmentedControl/SegmentedControl.d.ts +1 -1
- package/SegmentedControl/SegmentedControlItem.d.ts +1 -1
- package/SegmentedControl/SegmentedControlList.d.ts +1 -1
- package/SegmentedControl/SegmentedControlPanel.d.ts +1 -1
- package/Spinner/Spinner.d.ts +1 -1
- package/Text/Text.d.ts +1 -1
- package/Tooltip/Tooltip.d.ts +2 -2
- package/custom-elements.json +592 -583
- package/local/wip/Form/Form.decorator.js +55 -54
- package/package.json +6 -6
- package/vscode.html-custom-data.json +134 -134
- package/wip/Checkbox/Checkbox.d.ts +1 -1
- package/wip/FileUpload/FileUpload.Button.d.ts +1 -1
- package/wip/FileUpload/FileUpload.Dropzone.d.ts +1 -1
- package/wip/FileUpload/FileUpload.List.Item.d.ts +1 -1
- package/wip/FileUpload/FileUpload.List.d.ts +1 -1
- package/wip/FileUpload/FileUpload.d.ts +2 -2
- package/wip/Form/Form.d.ts +2 -2
- package/wip/Form/Form.decorator.d.ts +2 -2
- package/wip/Form/Form.decorator.js +53 -52
- package/wip/RadioButton/RadioButton.d.ts +2 -2
- package/wip/Switch/Switch.d.ts +2 -2
- package/wip/TextArea/TextArea.d.ts +1 -1
package/wip/Form/Form.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
45
|
-
protected renderValidationErrors: () => typeof nothing | import('lit
|
|
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
|
|
1
|
+
var V = (a) => {
|
|
2
2
|
throw TypeError(a);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { consume as
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import { property as
|
|
9
|
-
import { createRef as
|
|
10
|
-
import { b as
|
|
11
|
-
import { bmFormInitials as
|
|
12
|
-
import { createId as
|
|
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
|
|
15
|
-
for (var i = void 0, s = a.length - 1,
|
|
16
|
-
(
|
|
17
|
-
return i &&
|
|
18
|
-
},
|
|
19
|
-
const
|
|
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
|
-
|
|
23
|
-
|
|
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)),
|
|
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 ||
|
|
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 ||
|
|
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 ||
|
|
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 ||
|
|
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 ||
|
|
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 ?
|
|
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
|
-
` :
|
|
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 ?
|
|
71
|
+
(t) => t ? x`
|
|
71
72
|
<bm-helper-text
|
|
72
73
|
text="${t}"
|
|
73
74
|
appearance="negative"
|
|
74
|
-
style="display: block; margin-top: ${
|
|
75
|
+
style="display: block; margin-top: ${I};"
|
|
75
76
|
></bm-helper-text>
|
|
76
|
-
` :
|
|
77
|
+
` : v
|
|
77
78
|
)}
|
|
78
79
|
</div>
|
|
79
|
-
` :
|
|
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 =
|
|
106
|
-
return
|
|
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
|
-
|
|
123
|
-
let o =
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
128
|
-
|
|
128
|
+
l([
|
|
129
|
+
d({ type: String, reflect: !0 })
|
|
129
130
|
], o.prototype, "name");
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
l([
|
|
132
|
+
d({ type: String })
|
|
132
133
|
], o.prototype, "value");
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
l([
|
|
135
|
+
d({ type: Array })
|
|
135
136
|
], o.prototype, "validationRules");
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
l([
|
|
138
|
+
d({ type: String, attribute: "input-aria-label" })
|
|
138
139
|
], o.prototype, "inputAriaLabel");
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
l([
|
|
141
|
+
E({ context: S, subscribe: !0 }),
|
|
142
|
+
d({ attribute: !1 })
|
|
142
143
|
], o.prototype, "formContext");
|
|
143
|
-
|
|
144
|
-
|
|
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
|
|
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
|
|
49
|
+
render(): import('lit').TemplateResult<1>;
|
|
50
50
|
}
|
|
51
51
|
declare global {
|
|
52
52
|
interface HTMLElementTagNameMap {
|
package/wip/Switch/Switch.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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;
|