@viasat/beam-web-components 2.0.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 +56 -0
- package/Accordion/Accordion.js +12 -0
- package/Accordion/AccordionGroup.context.d.ts +10 -0
- package/Accordion/AccordionGroup.context.js +8 -0
- package/Accordion/AccordionGroup.d.ts +33 -0
- package/Accordion/AccordionGroup.js +79 -0
- package/Accordion/index.d.ts +3 -0
- package/Accordion/index.js +6 -0
- package/Alert/Alert.d.ts +64 -0
- package/Alert/Alert.js +300 -0
- package/Alert/index.d.ts +2 -0
- package/Alert/index.js +4 -0
- package/Avatar/Avatar.d.ts +60 -0
- package/Avatar/Avatar.js +12 -0
- package/Avatar/AvatarGroup.context.d.ts +11 -0
- package/Avatar/AvatarGroup.context.js +8 -0
- package/Avatar/AvatarGroup.d.ts +43 -0
- package/Avatar/AvatarGroup.js +181 -0
- package/Avatar/index.d.ts +3 -0
- package/Avatar/index.js +6 -0
- package/Badge/Badge.d.ts +40 -0
- package/Badge/Badge.js +125 -0
- package/Badge/index.d.ts +2 -0
- package/Badge/index.js +4 -0
- package/BadgeDot/BadgeDot.d.ts +38 -0
- package/BadgeDot/BadgeDot.js +59 -0
- package/BadgeDot/index.d.ts +2 -0
- package/BadgeDot/index.js +4 -0
- package/Box/Box.d.ts +99 -0
- package/Box/Box.js +115 -0
- package/Box/index.d.ts +2 -0
- package/Box/index.js +4 -0
- package/Breadcrumbs/Breadcrumbs.context.d.ts +10 -0
- package/Breadcrumbs/Breadcrumbs.context.js +8 -0
- package/Breadcrumbs/Breadcrumbs.d.ts +38 -0
- package/Breadcrumbs/Breadcrumbs.js +115 -0
- package/Breadcrumbs/BreadcrumbsItem.d.ts +39 -0
- package/Breadcrumbs/BreadcrumbsItem.js +13 -0
- package/Breadcrumbs/index.d.ts +3 -0
- package/Breadcrumbs/index.js +6 -0
- package/Button/Button.d.ts +73 -0
- package/Button/Button.js +125 -0
- package/Button/index.d.ts +2 -0
- package/Button/index.js +4 -0
- package/CloseButton/CloseButton.d.ts +25 -0
- package/CloseButton/CloseButton.js +60 -0
- package/CloseButton/index.d.ts +2 -0
- package/CloseButton/index.js +4 -0
- package/Divider/Divider.d.ts +56 -0
- package/Divider/Divider.js +111 -0
- package/Divider/index.d.ts +2 -0
- package/Divider/index.js +4 -0
- package/EmptyState/EmptyState.d.ts +36 -0
- package/EmptyState/EmptyState.js +56 -0
- package/EmptyState/index.d.ts +2 -0
- package/EmptyState/index.js +4 -0
- package/HelperText/HelperText.d.ts +45 -0
- package/HelperText/HelperText.js +11 -0
- package/HelperText/index.d.ts +2 -0
- package/HelperText/index.js +4 -0
- package/Icon/Icon.d.ts +35 -0
- package/Icon/Icon.js +62 -0
- package/Icon/index.d.ts +2 -0
- package/Icon/index.js +4 -0
- package/InputChoiceGroup/InputChoiceGroup.context.d.ts +13 -0
- package/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
- package/InputChoiceGroup/InputChoiceGroup.d.ts +87 -0
- package/InputChoiceGroup/InputChoiceGroup.js +205 -0
- package/InputChoiceGroup/index.d.ts +2 -0
- package/InputChoiceGroup/index.js +4 -0
- package/Link/Link.d.ts +48 -0
- package/Link/Link.js +77 -0
- package/Link/index.d.ts +2 -0
- package/Link/index.js +4 -0
- package/List/List.context.d.ts +15 -0
- package/List/List.context.js +8 -0
- package/List/List.d.ts +43 -0
- package/List/List.js +101 -0
- package/List/ListItem.d.ts +23 -0
- package/List/ListItem.js +90 -0
- package/List/index.d.ts +3 -0
- package/List/index.js +6 -0
- package/ProgressBar/ProgressBar.d.ts +52 -0
- package/ProgressBar/ProgressBar.js +128 -0
- package/ProgressBar/index.d.ts +2 -0
- package/ProgressBar/index.js +4 -0
- package/README.md +360 -0
- package/SegmentedControl/SegmentedControl.context.d.ts +16 -0
- package/SegmentedControl/SegmentedControl.context.js +8 -0
- package/SegmentedControl/SegmentedControl.d.ts +41 -0
- package/SegmentedControl/SegmentedControl.js +103 -0
- package/SegmentedControl/SegmentedControlItem.d.ts +54 -0
- package/SegmentedControl/SegmentedControlItem.js +284 -0
- package/SegmentedControl/SegmentedControlList.d.ts +23 -0
- package/SegmentedControl/SegmentedControlList.js +61 -0
- package/SegmentedControl/SegmentedControlPanel.d.ts +21 -0
- package/SegmentedControl/SegmentedControlPanel.js +43 -0
- package/SegmentedControl/index.d.ts +5 -0
- package/SegmentedControl/index.js +10 -0
- package/Spinner/Spinner.d.ts +50 -0
- package/Spinner/Spinner.js +186 -0
- package/Spinner/index.d.ts +2 -0
- package/Spinner/index.js +4 -0
- package/StateLayer/StateLayer.d.ts +17 -0
- package/StateLayer/StateLayer.js +6 -0
- package/StateLayer/index.d.ts +2 -0
- package/StateLayer/index.js +5 -0
- package/Text/Text.d.ts +85 -0
- package/Text/Text.js +103 -0
- package/Text/index.d.ts +2 -0
- package/Text/index.js +4 -0
- package/Tooltip/Tooltip.d.ts +139 -0
- package/Tooltip/Tooltip.js +1827 -0
- package/Tooltip/index.d.ts +2 -0
- package/Tooltip/index.js +5 -0
- package/chunks/Accordion.DYD3XcAx.js +161 -0
- package/chunks/Avatar.C2rfzUGP.js +174 -0
- package/chunks/BreadcrumbsItem.4ZR6wbMz.js +121 -0
- package/chunks/CSSLookup.BdqZ5Li9.js +106 -0
- package/chunks/HelperText.CcVVOtA3.js +108 -0
- package/chunks/Upload.B9YEyp7b.js +12 -0
- package/chunks/WarningOutlined.DPfQnPPj.js +12 -0
- package/chunks/classNames.Cq_tbDRp.js +94 -0
- package/chunks/constants.jOWREYQE.js +30 -0
- package/chunks/delegate.baxDQosr.js +63 -0
- package/chunks/dom.C98AFbJh.js +22 -0
- package/chunks/fileUpload.module.kN6o64aL.js +4 -0
- package/chunks/globals.Bz4SVF2g.js +4 -0
- package/chunks/helpers.AwJwaZvv.js +53 -0
- package/chunks/list.module.CZRPBLzy.js +4 -0
- package/chunks/register-custom-element.DHGKOhmA.js +17 -0
- package/chunks/segmentedControl.module.BPXEWodj.js +4 -0
- package/chunks/tokens.CTW8Tt94.js +9 -0
- package/custom-elements.json +11341 -0
- package/local/Accordion/Accordion.js +12 -0
- package/local/Accordion/AccordionGroup.context.js +8 -0
- package/local/Accordion/AccordionGroup.js +78 -0
- package/local/Accordion/index.js +6 -0
- package/local/Alert/Alert.js +301 -0
- package/local/Alert/index.js +4 -0
- package/local/Avatar/Avatar.js +11 -0
- package/local/Avatar/AvatarGroup.context.js +8 -0
- package/local/Avatar/AvatarGroup.js +180 -0
- package/local/Avatar/index.js +6 -0
- package/local/Badge/Badge.js +123 -0
- package/local/Badge/index.js +4 -0
- package/local/BadgeDot/BadgeDot.js +57 -0
- package/local/BadgeDot/index.js +4 -0
- package/local/Box/Box.js +113 -0
- package/local/Box/index.js +4 -0
- package/local/Breadcrumbs/Breadcrumbs.context.js +8 -0
- package/local/Breadcrumbs/Breadcrumbs.js +113 -0
- package/local/Breadcrumbs/BreadcrumbsItem.js +13 -0
- package/local/Breadcrumbs/index.js +6 -0
- package/local/Button/Button.js +154 -0
- package/local/Button/index.js +4 -0
- package/local/CloseButton/CloseButton.js +58 -0
- package/local/CloseButton/index.js +4 -0
- package/local/Divider/Divider.js +111 -0
- package/local/Divider/index.js +4 -0
- package/local/EmptyState/EmptyState.js +54 -0
- package/local/EmptyState/index.js +4 -0
- package/local/HelperText/HelperText.js +9 -0
- package/local/HelperText/index.js +4 -0
- package/local/Icon/Icon.js +60 -0
- package/local/Icon/index.js +4 -0
- package/local/InputChoiceGroup/InputChoiceGroup.context.js +8 -0
- package/local/InputChoiceGroup/InputChoiceGroup.js +205 -0
- package/local/InputChoiceGroup/index.js +4 -0
- package/local/Link/Link.js +75 -0
- package/local/Link/index.js +4 -0
- package/local/List/List.context.js +8 -0
- package/local/List/List.js +101 -0
- package/local/List/ListItem.js +90 -0
- package/local/List/index.js +6 -0
- package/local/ProgressBar/ProgressBar.js +126 -0
- package/local/ProgressBar/index.js +4 -0
- package/local/SegmentedControl/SegmentedControl.context.js +8 -0
- package/local/SegmentedControl/SegmentedControl.js +103 -0
- package/local/SegmentedControl/SegmentedControlItem.js +284 -0
- package/local/SegmentedControl/SegmentedControlList.js +59 -0
- package/local/SegmentedControl/SegmentedControlPanel.js +41 -0
- package/local/SegmentedControl/index.js +10 -0
- package/local/Spinner/Spinner.js +185 -0
- package/local/Spinner/index.js +4 -0
- package/local/StateLayer/StateLayer.js +6 -0
- package/local/StateLayer/index.js +5 -0
- package/local/Text/Text.js +121 -0
- package/local/Text/index.js +4 -0
- package/local/Tooltip/Tooltip.js +1826 -0
- package/local/Tooltip/index.js +5 -0
- package/local/chunks/Accordion.PGU7OILE.js +161 -0
- package/local/chunks/Avatar.CvTOzaRT.js +172 -0
- package/local/chunks/BreadcrumbsItem.GM6sBp_o.js +121 -0
- package/local/chunks/CSSLookup.BdqZ5Li9.js +106 -0
- package/local/chunks/Upload.B9YEyp7b.js +12 -0
- package/local/chunks/WarningOutlined.DPfQnPPj.js +12 -0
- package/local/chunks/base.D76d76ww.js +9 -0
- package/local/chunks/classNames.C6fNrXWF.js +106 -0
- package/local/chunks/constants.jOWREYQE.js +30 -0
- package/local/chunks/consume.Ce9k1-wN.js +47 -0
- package/local/chunks/context-request-event.Bl9Vpkzl.js +13 -0
- package/local/chunks/create-context.DS1OG3vJ.js +11 -0
- package/local/chunks/delegate.baxDQosr.js +63 -0
- package/local/chunks/directive.kLG6oqUu.js +27 -0
- package/local/chunks/dom.C98AFbJh.js +22 -0
- package/local/chunks/fileUpload.module.kN6o64aL.js +4 -0
- package/local/chunks/globals.Bz4SVF2g.js +4 -0
- package/local/chunks/helpers.BWcXAteC.js +53 -0
- package/local/chunks/index.Bz1Jq4c2.js +106 -0
- package/local/chunks/list.module.CZRPBLzy.js +4 -0
- package/local/chunks/lit-element.CJtt9wj5.js +557 -0
- package/local/chunks/provide.i2FlUkOu.js +110 -0
- package/local/chunks/query-assigned-elements.Drkgpk9q.js +19 -0
- package/local/chunks/query-assigned-nodes.Dgvsf6BR.js +19 -0
- package/local/chunks/query.lbpOn5CD.js +20 -0
- package/local/chunks/ref.B7e1Hu4F.js +107 -0
- package/local/chunks/register-custom-element.vod7zfGv.js +51 -0
- package/local/chunks/segmentedControl.module.BPXEWodj.js +4 -0
- package/local/chunks/state.CqiuSzAl.js +12 -0
- package/local/chunks/tokens.CTW8Tt94.js +9 -0
- package/local/chunks/unsafe-html.BzhXEygn.js +27 -0
- package/local/chunks/unsafe-svg.HSGf1NCU.js +14 -0
- package/local/wip/Checkbox/Checkbox.js +102 -0
- package/local/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
- package/local/wip/Checkbox/index.js +6 -0
- package/local/wip/FileUpload/FileUpload.Button.js +75 -0
- package/local/wip/FileUpload/FileUpload.Dropzone.js +149 -0
- package/local/wip/FileUpload/FileUpload.List.Item.js +201 -0
- package/local/wip/FileUpload/FileUpload.List.js +105 -0
- package/local/wip/FileUpload/FileUpload.js +452 -0
- package/local/wip/FileUpload/FileUploadContext.js +8 -0
- package/local/wip/FileUpload/FileUploadListContext.js +8 -0
- package/local/wip/FileUpload/index.js +13 -0
- package/local/wip/Form/Form.context.js +20 -0
- package/local/wip/Form/Form.decorator.js +145 -0
- package/local/wip/Form/Form.js +288 -0
- package/local/wip/Form/Form.utils.js +8 -0
- package/local/wip/Form/index.js +7 -0
- package/local/wip/Label/Label.js +86 -0
- package/local/wip/Label/index.js +4 -0
- package/local/wip/NativeSelect/NativeSelect.js +162 -0
- package/local/wip/NativeSelect/index.js +4 -0
- package/local/wip/RadioButton/RadioButton.js +123 -0
- package/local/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
- package/local/wip/RadioButton/index.js +6 -0
- package/local/wip/Switch/Switch.js +153 -0
- package/local/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
- package/local/wip/Switch/index.js +6 -0
- package/local/wip/TextArea/TextArea.js +192 -0
- package/local/wip/TextArea/index.js +4 -0
- package/local/wip/TextField/TextField.js +169 -0
- package/local/wip/TextField/index.js +4 -0
- package/package.json +78 -0
- package/vscode.css-custom-data.json +6 -0
- package/vscode.html-custom-data.json +2704 -0
- package/wip/Checkbox/Checkbox.d.ts +55 -0
- package/wip/Checkbox/Checkbox.js +104 -0
- package/wip/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +11 -0
- package/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +27 -0
- package/wip/Checkbox/index.d.ts +3 -0
- package/wip/Checkbox/index.js +6 -0
- package/wip/FileUpload/FileUpload.Button.d.ts +36 -0
- package/wip/FileUpload/FileUpload.Button.js +77 -0
- package/wip/FileUpload/FileUpload.Dropzone.d.ts +55 -0
- package/wip/FileUpload/FileUpload.Dropzone.js +150 -0
- package/wip/FileUpload/FileUpload.List.Item.d.ts +62 -0
- package/wip/FileUpload/FileUpload.List.Item.js +203 -0
- package/wip/FileUpload/FileUpload.List.d.ts +46 -0
- package/wip/FileUpload/FileUpload.List.js +106 -0
- package/wip/FileUpload/FileUpload.d.ts +101 -0
- package/wip/FileUpload/FileUpload.js +451 -0
- package/wip/FileUpload/FileUploadContext.d.ts +5 -0
- package/wip/FileUpload/FileUploadContext.js +8 -0
- package/wip/FileUpload/FileUploadListContext.d.ts +5 -0
- package/wip/FileUpload/FileUploadListContext.js +8 -0
- package/wip/FileUpload/index.d.ts +6 -0
- package/wip/FileUpload/index.js +13 -0
- package/wip/Form/Form.context.d.ts +19 -0
- package/wip/Form/Form.context.js +20 -0
- package/wip/Form/Form.d.ts +50 -0
- package/wip/Form/Form.decorator.d.ts +47 -0
- package/wip/Form/Form.decorator.js +144 -0
- package/wip/Form/Form.js +288 -0
- package/wip/Form/Form.utils.d.ts +2 -0
- package/wip/Form/Form.utils.js +8 -0
- package/wip/Form/index.d.ts +3 -0
- package/wip/Form/index.js +7 -0
- package/wip/Label/Label.d.ts +43 -0
- package/wip/Label/Label.js +87 -0
- package/wip/Label/index.d.ts +2 -0
- package/wip/Label/index.js +4 -0
- package/wip/NativeSelect/NativeSelect.d.ts +69 -0
- package/wip/NativeSelect/NativeSelect.js +163 -0
- package/wip/NativeSelect/index.d.ts +2 -0
- package/wip/NativeSelect/index.js +4 -0
- package/wip/RadioButton/RadioButton.d.ts +56 -0
- package/wip/RadioButton/RadioButton.js +125 -0
- package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.d.ts +23 -0
- package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +96 -0
- package/wip/RadioButton/index.d.ts +3 -0
- package/wip/RadioButton/index.js +6 -0
- package/wip/Switch/Switch.d.ts +62 -0
- package/wip/Switch/Switch.js +155 -0
- package/wip/Switch/SwitchGroup/SwitchGroup.d.ts +15 -0
- package/wip/Switch/SwitchGroup/SwitchGroup.js +15 -0
- package/wip/Switch/index.d.ts +3 -0
- package/wip/Switch/index.js +6 -0
- package/wip/TextArea/TextArea.d.ts +89 -0
- package/wip/TextArea/TextArea.js +193 -0
- package/wip/TextArea/index.d.ts +2 -0
- package/wip/TextArea/index.js +4 -0
- package/wip/TextField/TextField.d.ts +70 -0
- package/wip/TextField/TextField.js +169 -0
- package/wip/TextField/index.d.ts +2 -0
- package/wip/TextField/index.js +4 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { consume as v } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as w, css as x, nothing as m, html as u, LitElement as _ } from "lit";
|
|
3
|
+
import { property as p, state as C, query as y } from "lit/decorators.js";
|
|
4
|
+
import b from "clsx";
|
|
5
|
+
import { c as O, g as T } from "../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import { a as E } from "../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { r as $ } from "../chunks/dom.C98AFbJh.js";
|
|
8
|
+
import { s as S } from "../chunks/segmentedControl.module.BPXEWodj.js";
|
|
9
|
+
import { c as A } from "../chunks/register-custom-element.DHGKOhmA.js";
|
|
10
|
+
import { a as I } from "../chunks/helpers.AwJwaZvv.js";
|
|
11
|
+
import "../Tooltip/Tooltip.js";
|
|
12
|
+
import { stateLayerStyles as D, stateLayerClassName as N } from "../StateLayer/StateLayer.js";
|
|
13
|
+
import { segmentedControlContext as k } from "./SegmentedControl.context.js";
|
|
14
|
+
const L = (t) => {
|
|
15
|
+
class e extends t {
|
|
16
|
+
getTooltipElement() {
|
|
17
|
+
var s;
|
|
18
|
+
return (s = this.shadowRoot) == null ? void 0 : s.querySelector("bm-tooltip");
|
|
19
|
+
}
|
|
20
|
+
handleTooltipFocus() {
|
|
21
|
+
const s = this.getTooltipElement(), o = this.hasAttribute("disabled");
|
|
22
|
+
s && !o && this.shouldShowTooltip() && s.setAttribute("open", "");
|
|
23
|
+
}
|
|
24
|
+
handleTooltipBlur() {
|
|
25
|
+
const s = this.getTooltipElement();
|
|
26
|
+
s && s.removeAttribute("open");
|
|
27
|
+
}
|
|
28
|
+
handleTooltipMouseEnter() {
|
|
29
|
+
const s = this.getTooltipElement(), o = this.hasAttribute("disabled");
|
|
30
|
+
s && !o && this.shouldShowTooltip() && s.setAttribute("open", "");
|
|
31
|
+
}
|
|
32
|
+
handleTooltipMouseLeave() {
|
|
33
|
+
const s = this.getTooltipElement();
|
|
34
|
+
s && s.removeAttribute("open");
|
|
35
|
+
}
|
|
36
|
+
updateTooltipForItem(s, o) {
|
|
37
|
+
var l;
|
|
38
|
+
if (!s || s.hasAttribute("disabled")) return;
|
|
39
|
+
const i = (l = s.shadowRoot) == null ? void 0 : l.querySelector("bm-tooltip");
|
|
40
|
+
i && (o ? i.setAttribute("open", "") : i.removeAttribute("open"));
|
|
41
|
+
}
|
|
42
|
+
shouldShowTooltip() {
|
|
43
|
+
return !this.hasAttribute("disabled");
|
|
44
|
+
}
|
|
45
|
+
getTooltipText() {
|
|
46
|
+
return this.getAttribute("aria-label") || "";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return e;
|
|
50
|
+
};
|
|
51
|
+
class R {
|
|
52
|
+
constructor(e, n) {
|
|
53
|
+
this._element = e, this._callback = n, this.setup();
|
|
54
|
+
}
|
|
55
|
+
setup() {
|
|
56
|
+
this._element && (this._debouncedCheckOverflow = O(() => {
|
|
57
|
+
if (this._element) {
|
|
58
|
+
const e = this._element.scrollWidth > this._element.clientWidth;
|
|
59
|
+
this._callback(e);
|
|
60
|
+
}
|
|
61
|
+
}, E), this._observer = new ResizeObserver(this._debouncedCheckOverflow), this._observer.observe(this._element), this._debouncedCheckOverflow());
|
|
62
|
+
}
|
|
63
|
+
disconnect() {
|
|
64
|
+
this._observer && this._observer.disconnect(), this._debouncedCheckOverflow && this._debouncedCheckOverflow.cancel();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
var V = Object.defineProperty, q = Object.getOwnPropertyDescriptor, c = (t, e, n, s) => {
|
|
68
|
+
for (var o = s > 1 ? void 0 : s ? q(e, n) : e, i = t.length - 1, l; i >= 0; i--)
|
|
69
|
+
(l = t[i]) && (o = (s ? l(e, n, o) : l(o)) || o);
|
|
70
|
+
return s && o && V(e, n, o), o;
|
|
71
|
+
};
|
|
72
|
+
const { subElementClassPrefix: P } = T("segmented-control"), r = `${P}item`;
|
|
73
|
+
let h = class extends L(_) {
|
|
74
|
+
constructor() {
|
|
75
|
+
super(...arguments), this.value = "", this.disabled = !1, this.isDisabled = () => {
|
|
76
|
+
var t;
|
|
77
|
+
return this.disabled || ((t = this.segmentedControlContext) == null ? void 0 : t.disabled) === !0;
|
|
78
|
+
}, this.hasDefaultSlotContent = () => Array.from(this.childNodes).some(
|
|
79
|
+
(t) => t.nodeType === Node.ELEMENT_NODE && !t.hasAttribute("slot")
|
|
80
|
+
), this.getDefaultSlotElement = () => Array.from(this.childNodes).find(
|
|
81
|
+
(t) => t.nodeType === Node.ELEMENT_NODE && !t.hasAttribute("slot")
|
|
82
|
+
), this.selected = !1, this.isContentOverflowing = !1, this.hasIcon = !1, this.hasContent = !1;
|
|
83
|
+
}
|
|
84
|
+
firstUpdated() {
|
|
85
|
+
this.setupOverflowObserver();
|
|
86
|
+
}
|
|
87
|
+
connectedCallback() {
|
|
88
|
+
var t, e;
|
|
89
|
+
super.connectedCallback(), (e = (t = this.segmentedControlContext) == null ? void 0 : t.register) == null || e.call(t, this);
|
|
90
|
+
}
|
|
91
|
+
disconnectedCallback() {
|
|
92
|
+
var t, e;
|
|
93
|
+
super.disconnectedCallback(), this.cleanupOverflowObserver(), (e = (t = this.segmentedControlContext) == null ? void 0 : t.unregister) == null || e.call(t, this);
|
|
94
|
+
}
|
|
95
|
+
willUpdate(t) {
|
|
96
|
+
var e, n, s;
|
|
97
|
+
if (t.has("segmentedControlContext")) {
|
|
98
|
+
const o = this.selected, i = ((e = this.segmentedControlContext) == null ? void 0 : e.selectedValue) === this.value;
|
|
99
|
+
this.selected = i, !o && i && ((n = this.segmentedControlContext) != null && n.selectedValue) && ((s = t.get("segmentedControlContext")) == null ? void 0 : s.selectedValue) !== void 0 && this.updateComplete.then(() => {
|
|
100
|
+
var a, d;
|
|
101
|
+
(d = (a = this.shadowRoot) == null ? void 0 : a.querySelector("button")) == null || d.focus();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Override only the methods that need custom behavior
|
|
106
|
+
shouldShowTooltip() {
|
|
107
|
+
const t = this.querySelector('[slot="icon"]') !== null, e = this.hasDefaultSlotContent();
|
|
108
|
+
return !this.isDisabled() && (t && !e || e && this.isContentOverflowing);
|
|
109
|
+
}
|
|
110
|
+
getTooltipText() {
|
|
111
|
+
const t = $(this, "aria-label"), e = this.getDefaultSlotElement();
|
|
112
|
+
return (e == null ? void 0 : e.textContent) || t || "";
|
|
113
|
+
}
|
|
114
|
+
handleKeyDown(t) {
|
|
115
|
+
var l;
|
|
116
|
+
const e = (l = this.segmentedControlContext) == null ? void 0 : l.registeredItems.map(
|
|
117
|
+
(a) => a.value
|
|
118
|
+
);
|
|
119
|
+
if (!e)
|
|
120
|
+
return;
|
|
121
|
+
const n = e.indexOf(this.value);
|
|
122
|
+
let s = this.value;
|
|
123
|
+
const o = I(this);
|
|
124
|
+
let i = t.key;
|
|
125
|
+
switch (o === "rtl" && (i === "ArrowLeft" ? i = "ArrowRight" : i === "ArrowRight" && (i = "ArrowLeft")), i) {
|
|
126
|
+
case "ArrowDown":
|
|
127
|
+
case "ArrowRight":
|
|
128
|
+
s = this.findNextEnabledItem(e, n, 1);
|
|
129
|
+
break;
|
|
130
|
+
case "ArrowUp":
|
|
131
|
+
case "ArrowLeft":
|
|
132
|
+
s = this.findNextEnabledItem(e, n, -1);
|
|
133
|
+
break;
|
|
134
|
+
case " ":
|
|
135
|
+
case "Enter":
|
|
136
|
+
this.isDisabled() || (this.dispatchItemSelectedEvent(this.value), t.preventDefault());
|
|
137
|
+
return;
|
|
138
|
+
default:
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
s !== this.value && (t.preventDefault(), this.focusItemWithValue(s));
|
|
142
|
+
}
|
|
143
|
+
focusItemWithValue(t) {
|
|
144
|
+
var n, s;
|
|
145
|
+
const e = (n = this.segmentedControlContext) == null ? void 0 : n.registeredItems.find(
|
|
146
|
+
(o) => o.value === t
|
|
147
|
+
);
|
|
148
|
+
if (e) {
|
|
149
|
+
const o = (s = e.shadowRoot) == null ? void 0 : s.querySelector("button");
|
|
150
|
+
o && o.focus();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
handleClick() {
|
|
154
|
+
!this.isDisabled() && this.segmentedControlContext && this.dispatchItemSelectedEvent(this.value);
|
|
155
|
+
}
|
|
156
|
+
setupOverflowObserver() {
|
|
157
|
+
this._contentRef && (this._overflowObserver = new R(
|
|
158
|
+
this._contentRef,
|
|
159
|
+
(t) => {
|
|
160
|
+
this.isContentOverflowing = t;
|
|
161
|
+
}
|
|
162
|
+
));
|
|
163
|
+
}
|
|
164
|
+
cleanupOverflowObserver() {
|
|
165
|
+
var t;
|
|
166
|
+
(t = this._overflowObserver) == null || t.disconnect();
|
|
167
|
+
}
|
|
168
|
+
findNextEnabledItem(t, e, n) {
|
|
169
|
+
var l;
|
|
170
|
+
const s = Array.from(((l = this.segmentedControlContext) == null ? void 0 : l.registeredItems) || []);
|
|
171
|
+
if (!s.length) return this.value;
|
|
172
|
+
const o = t.length;
|
|
173
|
+
let i = (e + n + o) % o;
|
|
174
|
+
for (; i !== e; ) {
|
|
175
|
+
const a = s.find((d) => d.value === t[i]);
|
|
176
|
+
if (a && !a.disabled)
|
|
177
|
+
return t[i];
|
|
178
|
+
i = (i + n + o) % o;
|
|
179
|
+
}
|
|
180
|
+
return this.value;
|
|
181
|
+
}
|
|
182
|
+
dispatchItemSelectedEvent(t) {
|
|
183
|
+
this.dispatchEvent(
|
|
184
|
+
new CustomEvent("bm-selected", {
|
|
185
|
+
detail: { value: t },
|
|
186
|
+
bubbles: !0,
|
|
187
|
+
composed: !0
|
|
188
|
+
})
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
getClassName() {
|
|
192
|
+
var f;
|
|
193
|
+
const { fluid: t, selectedValue: e, size: n = "md" } = this.segmentedControlContext || {}, s = this.isDisabled(), o = e === this.value, i = (((f = this.segmentedControlContext) == null ? void 0 : f.registeredItems) || []).map(
|
|
194
|
+
(g) => g.value
|
|
195
|
+
), l = i.indexOf(this.value), a = l === 0, d = i.length > 0 && l === i.length - 1;
|
|
196
|
+
return b(
|
|
197
|
+
r,
|
|
198
|
+
n && `${r}--${n}`,
|
|
199
|
+
s && `${r}--disabled`,
|
|
200
|
+
o && `${r}--selected`,
|
|
201
|
+
t && `${r}--fluid`,
|
|
202
|
+
a && `${r}--first`,
|
|
203
|
+
d && !a && `${r}--last`,
|
|
204
|
+
this.hasIcon && !this.hasContent && `${r}--iconOnly`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
render() {
|
|
208
|
+
const { selectedValue: t } = this.segmentedControlContext || {}, e = this.isDisabled(), n = t === this.value;
|
|
209
|
+
this.hasIcon = this.querySelector('[slot="icon"]') !== null, this.hasContent = this.hasDefaultSlotContent();
|
|
210
|
+
const s = this.getClassName(), o = b(
|
|
211
|
+
N(),
|
|
212
|
+
`${r}__state-layer`
|
|
213
|
+
);
|
|
214
|
+
return u`
|
|
215
|
+
<bm-tooltip
|
|
216
|
+
placement="top"
|
|
217
|
+
.disabled=${e || !this.shouldShowTooltip()}
|
|
218
|
+
.defaultOpen=${!1}
|
|
219
|
+
>
|
|
220
|
+
<span slot="text">${this.getTooltipText()}</span>
|
|
221
|
+
<button
|
|
222
|
+
slot="trigger"
|
|
223
|
+
class=${s}
|
|
224
|
+
data-floating-anchor
|
|
225
|
+
tabindex=${n ? "0" : "-1"}
|
|
226
|
+
aria-label=${this.getTooltipText()}
|
|
227
|
+
@keydown=${this.handleKeyDown}
|
|
228
|
+
@click=${this.handleClick}
|
|
229
|
+
>
|
|
230
|
+
<span class=${`${r}__content`}>
|
|
231
|
+
${this.hasIcon ? u`<span class=${`${r}__icon`}>
|
|
232
|
+
<slot name="icon"></slot>
|
|
233
|
+
</span>` : m}
|
|
234
|
+
${this.hasContent ? u`<span class="${r}__controlText">
|
|
235
|
+
<slot></slot>
|
|
236
|
+
</span>` : m}
|
|
237
|
+
</span>
|
|
238
|
+
${e ? m : u`<span id="stateLayer" class=${o}></span>`}
|
|
239
|
+
</button>
|
|
240
|
+
</bm-tooltip>
|
|
241
|
+
`;
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
h.styles = [
|
|
245
|
+
w(S),
|
|
246
|
+
D,
|
|
247
|
+
/**
|
|
248
|
+
* In order to ensure the overflow observer works with wrappers we need to
|
|
249
|
+
* mount these styles to the host element. This ensures we lock the width of
|
|
250
|
+
* the item to the content width.
|
|
251
|
+
*/
|
|
252
|
+
x`
|
|
253
|
+
:host {
|
|
254
|
+
flex-shrink: 1;
|
|
255
|
+
min-width: 0;
|
|
256
|
+
display: flex;
|
|
257
|
+
}
|
|
258
|
+
`
|
|
259
|
+
];
|
|
260
|
+
c([
|
|
261
|
+
p({ type: String })
|
|
262
|
+
], h.prototype, "value", 2);
|
|
263
|
+
c([
|
|
264
|
+
p({ type: Boolean })
|
|
265
|
+
], h.prototype, "disabled", 2);
|
|
266
|
+
c([
|
|
267
|
+
C()
|
|
268
|
+
], h.prototype, "selected", 2);
|
|
269
|
+
c([
|
|
270
|
+
C()
|
|
271
|
+
], h.prototype, "isContentOverflowing", 2);
|
|
272
|
+
c([
|
|
273
|
+
v({ context: k, subscribe: !0 }),
|
|
274
|
+
p({ attribute: !1 })
|
|
275
|
+
], h.prototype, "segmentedControlContext", 2);
|
|
276
|
+
c([
|
|
277
|
+
y(`.${r}__controlText`)
|
|
278
|
+
], h.prototype, "_contentRef", 2);
|
|
279
|
+
h = c([
|
|
280
|
+
A("bm-segmented-control-item")
|
|
281
|
+
], h);
|
|
282
|
+
export {
|
|
283
|
+
h as BmSegmentedControlItem
|
|
284
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SegmentedControlContext } from './SegmentedControl.context';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @fires bm-selected - Dispatched when an item is selected
|
|
6
|
+
*
|
|
7
|
+
* @slot default - Specify the items of the list
|
|
8
|
+
*/
|
|
9
|
+
export declare class BmSegmentedControlList extends LitElement {
|
|
10
|
+
static styles: import('lit').CSSResult;
|
|
11
|
+
segmentedControlContext: SegmentedControlContext | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Necessary for initializing the controlItems array and setting the initial selected value
|
|
14
|
+
*/
|
|
15
|
+
private _handleSlotChange;
|
|
16
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
'bm-segmented-control-list': BmSegmentedControlList;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=SegmentedControlList.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { consume as a } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as c, LitElement as C, html as p } from "lit";
|
|
3
|
+
import { property as f } from "lit/decorators.js";
|
|
4
|
+
import u from "clsx";
|
|
5
|
+
import { g } from "../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import "../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { s as h } from "../chunks/segmentedControl.module.BPXEWodj.js";
|
|
8
|
+
import { c as b } from "../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import { segmentedControlContext as v } from "./SegmentedControl.context.js";
|
|
10
|
+
var x = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, d = (s, t, o, n) => {
|
|
11
|
+
for (var e = n > 1 ? void 0 : n ? _(t, o) : t, l = s.length - 1, m; l >= 0; l--)
|
|
12
|
+
(m = s[l]) && (e = (n ? m(t, o, e) : m(e)) || e);
|
|
13
|
+
return n && e && x(t, o, e), e;
|
|
14
|
+
};
|
|
15
|
+
const { subElementClassPrefix: i } = g("segmented-control");
|
|
16
|
+
let r = class extends C {
|
|
17
|
+
/**
|
|
18
|
+
* Necessary for initializing the controlItems array and setting the initial selected value
|
|
19
|
+
*/
|
|
20
|
+
_handleSlotChange() {
|
|
21
|
+
var s;
|
|
22
|
+
if (this.segmentedControlContext && !((s = this.segmentedControlContext) != null && s.selectedValue)) {
|
|
23
|
+
const o = (this.segmentedControlContext.registeredItems || []).find(
|
|
24
|
+
(e) => {
|
|
25
|
+
var l;
|
|
26
|
+
return !e.disabled && !((l = this.segmentedControlContext) != null && l.disabled);
|
|
27
|
+
}
|
|
28
|
+
), n = (o == null ? void 0 : o.value) || "";
|
|
29
|
+
n && this.dispatchEvent(
|
|
30
|
+
new CustomEvent("bm-selected", {
|
|
31
|
+
detail: { value: n },
|
|
32
|
+
bubbles: !0,
|
|
33
|
+
composed: !0
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
var t;
|
|
40
|
+
const s = u(
|
|
41
|
+
`${i}list`,
|
|
42
|
+
((t = this.segmentedControlContext) == null ? void 0 : t.fluid) && `${i}list--fluid`
|
|
43
|
+
);
|
|
44
|
+
return p`
|
|
45
|
+
<div class=${s} part="list">
|
|
46
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
r.styles = c(h);
|
|
52
|
+
d([
|
|
53
|
+
a({ context: v, subscribe: !0 }),
|
|
54
|
+
f({ attribute: !1 })
|
|
55
|
+
], r.prototype, "segmentedControlContext", 2);
|
|
56
|
+
r = d([
|
|
57
|
+
b("bm-segmented-control-list")
|
|
58
|
+
], r);
|
|
59
|
+
export {
|
|
60
|
+
r as BmSegmentedControlList
|
|
61
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SegmentedControlContext } from './SegmentedControl.context';
|
|
3
|
+
/**
|
|
4
|
+
* @slot default - Specify the content of the panel
|
|
5
|
+
*/
|
|
6
|
+
export declare class BmSegmentedControlPanel extends LitElement {
|
|
7
|
+
static styles: import('lit').CSSResult;
|
|
8
|
+
/**
|
|
9
|
+
* Specify the value of the panel
|
|
10
|
+
* @default ''
|
|
11
|
+
*/
|
|
12
|
+
value: string;
|
|
13
|
+
segmentedControlContext: SegmentedControlContext | undefined;
|
|
14
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'bm-segmented-control-panel': BmSegmentedControlPanel;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=SegmentedControlPanel.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { consume as c } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as i, LitElement as u, html as f } from "lit";
|
|
3
|
+
import { property as p } from "lit/decorators.js";
|
|
4
|
+
import d from "clsx";
|
|
5
|
+
import { g as C } from "../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import "../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { s as g } from "../chunks/segmentedControl.module.BPXEWodj.js";
|
|
8
|
+
import { c as v } from "../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import { segmentedControlContext as b } from "./SegmentedControl.context.js";
|
|
10
|
+
var x = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (o, e, r, t) => {
|
|
11
|
+
for (var s = t > 1 ? void 0 : t ? _(e, r) : e, n = o.length - 1, m; n >= 0; n--)
|
|
12
|
+
(m = o[n]) && (s = (t ? m(e, r, s) : m(s)) || s);
|
|
13
|
+
return t && s && x(e, r, s), s;
|
|
14
|
+
};
|
|
15
|
+
const { subElementClassPrefix: y } = C("segmented-control");
|
|
16
|
+
let l = class extends u {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments), this.value = "";
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
var t;
|
|
22
|
+
const o = ((t = this.segmentedControlContext) == null ? void 0 : t.selectedValue) === this.value, e = `${y}panel`, r = d(e, o && `${e}--selected`);
|
|
23
|
+
return f`
|
|
24
|
+
<div class=${r} part="panel" aria-disabled=${!o}>
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</div>
|
|
27
|
+
`;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
l.styles = i(g);
|
|
31
|
+
a([
|
|
32
|
+
p({ type: String })
|
|
33
|
+
], l.prototype, "value", 2);
|
|
34
|
+
a([
|
|
35
|
+
c({ context: b, subscribe: !0 }),
|
|
36
|
+
p({ attribute: !1 })
|
|
37
|
+
], l.prototype, "segmentedControlContext", 2);
|
|
38
|
+
l = a([
|
|
39
|
+
v("bm-segmented-control-panel")
|
|
40
|
+
], l);
|
|
41
|
+
export {
|
|
42
|
+
l as BmSegmentedControlPanel
|
|
43
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BmSegmentedControl as t } from "./SegmentedControl.js";
|
|
2
|
+
import { BmSegmentedControlItem as r } from "./SegmentedControlItem.js";
|
|
3
|
+
import { BmSegmentedControlList as l } from "./SegmentedControlList.js";
|
|
4
|
+
import { BmSegmentedControlPanel as f } from "./SegmentedControlPanel.js";
|
|
5
|
+
export {
|
|
6
|
+
t as BmSegmentedControl,
|
|
7
|
+
r as BmSegmentedControlItem,
|
|
8
|
+
l as BmSegmentedControlList,
|
|
9
|
+
f as BmSegmentedControlPanel
|
|
10
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SpinnerSizes, SpinnerValues } from '@viasat/beam-shared/components/spinner';
|
|
3
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-spinner`
|
|
6
|
+
*
|
|
7
|
+
* @slot body - Specify the body text for Spinner. Falls back to `body` prop if not provided.
|
|
8
|
+
* @slot heading - Specify the heading text for Spinner. Falls back to `heading` prop if not provided.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BmSpinner extends LitElement {
|
|
11
|
+
#private;
|
|
12
|
+
static styles: import('lit').CSSResult;
|
|
13
|
+
/**
|
|
14
|
+
* Specify the size of the spinner
|
|
15
|
+
* @default 'md'
|
|
16
|
+
*/
|
|
17
|
+
size: SpinnerSizes;
|
|
18
|
+
/**
|
|
19
|
+
* Specify if a spinner is determinate by setting a value
|
|
20
|
+
*/
|
|
21
|
+
value?: SpinnerValues;
|
|
22
|
+
/**
|
|
23
|
+
* Specify if a percentage displays with the Spinner
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
showPercentage?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the heading text for Spinner (used if no heading slot is provided).
|
|
29
|
+
* @default undefined
|
|
30
|
+
*/
|
|
31
|
+
heading?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Specify the body text for Spinner (used if no body slot is provided).
|
|
34
|
+
* @default undefined
|
|
35
|
+
*/
|
|
36
|
+
body?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Specify the theme of the Spinner. By default it inherits the theme from the parent
|
|
39
|
+
*/
|
|
40
|
+
theme?: ThemeTypes;
|
|
41
|
+
private headingSlot;
|
|
42
|
+
private bodySlot;
|
|
43
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
44
|
+
}
|
|
45
|
+
declare global {
|
|
46
|
+
interface HTMLElementTagNameMap {
|
|
47
|
+
'bm-spinner': BmSpinner;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=Spinner.d.ts.map
|