@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,12 @@
|
|
|
1
|
+
import "../chunks/consume.Ce9k1-wN.js";
|
|
2
|
+
import "../chunks/lit-element.CJtt9wj5.js";
|
|
3
|
+
import "../chunks/register-custom-element.vod7zfGv.js";
|
|
4
|
+
import "../chunks/state.CqiuSzAl.js";
|
|
5
|
+
import "../chunks/query-assigned-nodes.Dgvsf6BR.js";
|
|
6
|
+
import "../chunks/unsafe-svg.HSGf1NCU.js";
|
|
7
|
+
import "../chunks/classNames.C6fNrXWF.js";
|
|
8
|
+
import { B as e } from "../chunks/Accordion.PGU7OILE.js";
|
|
9
|
+
import "./AccordionGroup.context.js";
|
|
10
|
+
export {
|
|
11
|
+
e as BmAccordion
|
|
12
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { a as u } from "../chunks/Accordion.PGU7OILE.js";
|
|
2
|
+
import { e as v } from "../chunks/provide.i2FlUkOu.js";
|
|
3
|
+
import { r as _, i as C, a as x, x as y } from "../chunks/lit-element.CJtt9wj5.js";
|
|
4
|
+
import { n as f, c as E } from "../chunks/register-custom-element.vod7zfGv.js";
|
|
5
|
+
import { r as w } from "../chunks/state.CqiuSzAl.js";
|
|
6
|
+
import { c as A, g as z } from "../chunks/classNames.C6fNrXWF.js";
|
|
7
|
+
import { AccordionGroupCtx as O } from "./AccordionGroup.context.js";
|
|
8
|
+
var G = Object.defineProperty, P = Object.getOwnPropertyDescriptor, m = (e) => {
|
|
9
|
+
throw TypeError(e);
|
|
10
|
+
}, c = (e, t, r, i) => {
|
|
11
|
+
for (var s = i > 1 ? void 0 : i ? P(t, r) : t, p = e.length - 1, l; p >= 0; p--)
|
|
12
|
+
(l = e[p]) && (s = (i ? l(t, r, s) : l(s)) || s);
|
|
13
|
+
return i && s && G(t, r, s), s;
|
|
14
|
+
}, k = (e, t, r) => t.has(e) || m("Cannot " + r), a = (e, t, r) => (k(e, t, "read from private field"), r ? r.call(e) : t.get(e)), d = (e, t, r) => t.has(e) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), n, h, g;
|
|
15
|
+
const { baseClassNamePrefix: M } = z("accordion");
|
|
16
|
+
let o = class extends x {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments), this.size = "md", this.singleExpand = !1, d(this, n, /* @__PURE__ */ new Set()), this.groupCtx = {
|
|
19
|
+
register: (e) => a(this, h).call(this, e),
|
|
20
|
+
unregister: (e) => a(this, g).call(this, e),
|
|
21
|
+
size: this.size
|
|
22
|
+
}, d(this, h, (e) => {
|
|
23
|
+
a(this, n).add(e), this.requestUpdate();
|
|
24
|
+
}), d(this, g, (e) => {
|
|
25
|
+
a(this, n).delete(e), this.requestUpdate();
|
|
26
|
+
}), this.handleAccordionToggle = (e) => {
|
|
27
|
+
const { accordion: t, isOpen: r } = e.detail;
|
|
28
|
+
this.singleExpand && r && Array.from(a(this, n)).forEach((s) => {
|
|
29
|
+
s !== t && (s.open === void 0 ? (s._isOpen = !1, s.requestUpdate()) : s.open = !1);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
super.connectedCallback(), this.addEventListener("bm-toggle", this.handleAccordionToggle);
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
this.removeEventListener(
|
|
38
|
+
"bm-toggle",
|
|
39
|
+
this.handleAccordionToggle
|
|
40
|
+
), super.disconnectedCallback();
|
|
41
|
+
}
|
|
42
|
+
willUpdate(e) {
|
|
43
|
+
e.has("size") && (this.groupCtx = {
|
|
44
|
+
...this.groupCtx,
|
|
45
|
+
size: this.size
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
const e = A(M);
|
|
50
|
+
return y`
|
|
51
|
+
<div class=${e}>
|
|
52
|
+
<slot></slot>
|
|
53
|
+
</div>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
n = /* @__PURE__ */ new WeakMap();
|
|
58
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
59
|
+
g = /* @__PURE__ */ new WeakMap();
|
|
60
|
+
o.styles = C`
|
|
61
|
+
${_(u)}
|
|
62
|
+
`;
|
|
63
|
+
c([
|
|
64
|
+
f({ type: String })
|
|
65
|
+
], o.prototype, "size", 2);
|
|
66
|
+
c([
|
|
67
|
+
f({ type: Boolean })
|
|
68
|
+
], o.prototype, "singleExpand", 2);
|
|
69
|
+
c([
|
|
70
|
+
v({ context: O }),
|
|
71
|
+
w()
|
|
72
|
+
], o.prototype, "groupCtx", 2);
|
|
73
|
+
o = c([
|
|
74
|
+
E("bm-accordion-group")
|
|
75
|
+
], o);
|
|
76
|
+
export {
|
|
77
|
+
o as BmAccordionGroup
|
|
78
|
+
};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { r as J, a as Q, E as m, x as d } from "../chunks/lit-element.CJtt9wj5.js";
|
|
2
|
+
import { n as l, c as X } from "../chunks/register-custom-element.vod7zfGv.js";
|
|
3
|
+
import { r as Y } from "../chunks/state.CqiuSzAl.js";
|
|
4
|
+
import { e as $ } from "../chunks/query.lbpOn5CD.js";
|
|
5
|
+
import { n as E } from "../chunks/query-assigned-nodes.Dgvsf6BR.js";
|
|
6
|
+
import { o as j } from "../chunks/unsafe-svg.HSGf1NCU.js";
|
|
7
|
+
import { n as f, c as u, g as ee, l as oe, b as re, j as ae } from "../chunks/classNames.C6fNrXWF.js";
|
|
8
|
+
import { W as te } from "../chunks/WarningOutlined.DPfQnPPj.js";
|
|
9
|
+
import { t as ie, a as se } from "../chunks/constants.jOWREYQE.js";
|
|
10
|
+
import { c as me } from "../chunks/CSSLookup.BdqZ5Li9.js";
|
|
11
|
+
import { r as ne } from "../chunks/delegate.baxDQosr.js";
|
|
12
|
+
import "../CloseButton/CloseButton.js";
|
|
13
|
+
const le = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<path
|
|
15
|
+
fill-rule="evenodd"
|
|
16
|
+
clip-rule="evenodd"
|
|
17
|
+
d="M16.59 7.58L10 14.17L6.41 10.59L5 12L10 17L18 9L16.59 7.58ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z"
|
|
18
|
+
fill="currentColor"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
`, N = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
22
|
+
<path
|
|
23
|
+
fill-rule="evenodd"
|
|
24
|
+
clip-rule="evenodd"
|
|
25
|
+
d="M11 17H13V11H11V17ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM11 9H13V7H11V9Z"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
`, ce = (e) => me(e === "sm" ? 2.625 : 3.125), _ = {
|
|
30
|
+
positive: "Success",
|
|
31
|
+
warning: "Warning",
|
|
32
|
+
negative: "Error",
|
|
33
|
+
infoPrimary: "Information",
|
|
34
|
+
infoSecondary: "Information"
|
|
35
|
+
}, pe = "Dismiss Alert", be = ':root,:host,.bm-light,.bm-dark .bm-inverse,[data-bm-theme~=bm-light]{--bm-comp-alert-color-positive-bg: var( --bm-sem-color-surface-positive, #daf7cf );--bm-comp-alert-color-positive-icon: var( --bm-sem-color-icon-positive-strong, #187c36 );--bm-comp-alert-color-positive-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-positive-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-positive-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-warning-bg: var( --bm-sem-color-surface-warning, #ffe4c9 );--bm-comp-alert-color-warning-icon: var( --bm-sem-color-icon-warning-strong, #ac4902 );--bm-comp-alert-color-warning-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-warning-body: var(--bm-sem-color-text-primary, #141d24);--bm-comp-alert-color-warning-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-negative-bg: var( --bm-sem-color-surface-negative, #fee6e7 );--bm-comp-alert-color-negative-icon: var( --bm-sem-color-icon-negative-strong, #cc2429 );--bm-comp-alert-color-negative-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-negative-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-negative-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-info-primary-bg: var( --bm-sem-color-surface-info-primary, #ccf0ff );--bm-comp-alert-color-info-primary-icon: var( --bm-sem-color-icon-info-primary-strong, #006ead );--bm-comp-alert-color-info-primary-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-primary-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-primary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-color-info-secondary-bg: var( --bm-sem-color-surface-info-secondary, #dfe7ec );--bm-comp-alert-color-info-secondary-icon: var( --bm-sem-color-icon-info-secondary-strong, #465967 );--bm-comp-alert-color-info-secondary-heading: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-secondary-body: var( --bm-sem-color-text-primary, #141d24 );--bm-comp-alert-color-info-secondary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-space-x: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-y: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-sm-y: var(--bm-sem-space-75, .75rem);--bm-comp-alert-space-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-space-text-gap: var(--bm-sem-space-12, .125rem);--bm-comp-alert-space-actions-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-radius-in-page: var(--bm-sem-radius-md, .5rem);--bm-comp-alert-radius-full-width: var(--bm-sem-radius-none);--bm-comp-alert-border-width: var(--bm-sem-border-width-none, 0);--bm-comp-alert-size-sm-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-alert-size-md-icon: var(--bm-sem-size-icon-lg, 1.5rem);--bm-comp-alert-typo-sm-heading: var( --bm-sem-typo-heading-xs, 700 1rem/1.25rem "Uni Neue" );--bm-comp-alert-typo-sm-body: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-alert-typo-md-heading: var( --bm-sem-typo-heading-sm, 700 1.125rem/1.5rem "Uni Neue" );--bm-comp-alert-typo-md-body: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-alert-shadow: var(--bm-sem-shadow-none, 0 0 0 0 rgb(0, 0, 0, 0))}:host,.bm-dark,.bm-light .bm-inverse,[data-bm-theme~=bm-dark]{--bm-comp-alert-color-positive-bg: var( --bm-sem-color-surface-positive, #02310e );--bm-comp-alert-color-positive-icon: var( --bm-sem-color-icon-positive-strong, #b3eb9e );--bm-comp-alert-color-positive-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-positive-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-positive-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-warning-bg: var( --bm-sem-color-surface-warning, #3e1a00 );--bm-comp-alert-color-warning-icon: var( --bm-sem-color-icon-warning-strong, #ffd4a8 );--bm-comp-alert-color-warning-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-warning-body: var(--bm-sem-color-text-primary, #ffffff);--bm-comp-alert-color-warning-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-negative-bg: var( --bm-sem-color-surface-negative, #520f11 );--bm-comp-alert-color-negative-icon: var( --bm-sem-color-icon-negative-strong, #f67378 );--bm-comp-alert-color-negative-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-negative-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-negative-border: var(--bm-sem-color-none, #ffffff00);--bm-comp-alert-color-info-primary-bg: var( --bm-sem-color-surface-info-primary, #002f57 );--bm-comp-alert-color-info-primary-icon: var( --bm-sem-color-icon-info-primary-strong, #9be1ff );--bm-comp-alert-color-info-primary-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-primary-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-primary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-color-info-secondary-bg: var( --bm-sem-color-surface-info-secondary, #202e39 );--bm-comp-alert-color-info-secondary-icon: var( --bm-sem-color-icon-info-secondary-strong, #c3cdd5 );--bm-comp-alert-color-info-secondary-heading: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-secondary-body: var( --bm-sem-color-text-primary, #ffffff );--bm-comp-alert-color-info-secondary-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-alert-space-x: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-y: var(--bm-sem-space-100, 1rem);--bm-comp-alert-space-sm-y: var(--bm-sem-space-75, .75rem);--bm-comp-alert-space-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-space-text-gap: var(--bm-sem-space-12, .125rem);--bm-comp-alert-space-actions-gap: var(--bm-sem-space-50, .5rem);--bm-comp-alert-radius-in-page: var(--bm-sem-radius-md, .5rem);--bm-comp-alert-radius-full-width: var(--bm-sem-radius-none);--bm-comp-alert-border-width: var(--bm-sem-border-width-none, 0);--bm-comp-alert-size-sm-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-alert-size-md-icon: var(--bm-sem-size-icon-lg, 1.5rem);--bm-comp-alert-typo-sm-heading: var( --bm-sem-typo-heading-xs, 700 1rem/1.25rem "Uni Neue" );--bm-comp-alert-typo-sm-body: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-alert-typo-md-heading: var( --bm-sem-typo-heading-sm, 700 1.125rem/1.5rem "Uni Neue" );--bm-comp-alert-typo-md-body: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-alert-shadow: var(--bm-sem-shadow-none, 0 0 0 0 rgb(0, 0, 0, 0))}.bm-alert{display:flex;align-items:center;word-break:break-word;gap:var(--bm-comp-alert-space-gap);padding:var(--bm-comp-alert-space-sm-y) var(--bm-comp-alert-space-x);box-shadow:var(--bm-comp-alert-shadow);border-width:var(--bm-comp-alert-border-width);border-style:solid;border-radius:var(--bm-comp-alert-radius-in-page)}.bm-alert__content__wrapper{flex:1 0 0;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:var(--bm-comp-alert-space-gap)}.bm-alert .bm-alert__content{display:flex;flex-direction:column;gap:var(--bm-comp-alert-space-text-gap);font:var(--bm-comp-alert-typo-sm-body)}.bm-alert .bm-alert__content__heading{font:var(--bm-comp-alert-typo-sm-heading)}.bm-alert__actions{display:flex;gap:var(--bm-comp-alert-space-actions-gap)}.bm-alert .bm-alert__icon,.bm-alert .bm-alert__icon svg{display:flex;align-self:center;align-items:center;min-width:var(--bm-comp-alert-size-sm-icon);min-height:var(--bm-comp-alert-size-sm-icon)}.bm-alert .bm-alert__icon--wrapping,.bm-alert .bm-alert__icon svg--wrapping{align-self:flex-start}.bm-alert__close-button{display:flex;align-self:center}.bm-alert__close-button--wrapping{align-self:baseline}.bm-alert--full-width{border-radius:var(--bm-comp-alert-radius-full-width)}.bm-alert--md{padding:var(--bm-comp-alert-space-y) var(--bm-comp-alert-space-x)}.bm-alert--md .bm-alert__content{font:var(--bm-comp-alert-typo-md-body)}.bm-alert--md .bm-alert__content__heading{font:var(--bm-comp-alert-typo-md-heading)}.bm-alert--md .bm-alert__icon,.bm-alert--md .bm-alert__icon svg{min-width:var(--bm-comp-alert-size-md-icon);min-height:var(--bm-comp-alert-size-md-icon)}.bm-alert--positive{background-color:var(--bm-comp-alert-color-positive-bg);border-color:var(--bm-comp-alert-color-positive-border)}.bm-alert--positive .bm-alert__icon,.bm-alert--positive .bm-alert__icon svg{color:var(--bm-comp-alert-color-positive-icon)}.bm-alert--positive .bm-alert__content{color:var(--bm-comp-alert-color-positive-body)}.bm-alert--warning{background-color:var(--bm-comp-alert-color-warning-bg);border-color:var(--bm-comp-alert-color-warning-border)}.bm-alert--warning .bm-alert__icon,.bm-alert--warning .bm-alert__icon svg{color:var(--bm-comp-alert-color-warning-icon)}.bm-alert--warning .bm-alert__content{color:var(--bm-comp-alert-color-warning-body)}.bm-alert--negative{background-color:var(--bm-comp-alert-color-negative-bg);border-color:var(--bm-comp-alert-color-negative-border)}.bm-alert--negative .bm-alert__icon,.bm-alert--negative .bm-alert__icon svg{color:var(--bm-comp-alert-color-negative-icon)}.bm-alert--negative .bm-alert__content{color:var(--bm-comp-alert-color-negative-body)}.bm-alert--infoPrimary{background-color:var(--bm-comp-alert-color-info-primary-bg);border-color:var(--bm-comp-alert-color-info-primary-border)}.bm-alert--infoPrimary .bm-alert__icon,.bm-alert--infoPrimary .bm-alert__icon svg{color:var(--bm-comp-alert-color-info-primary-icon)}.bm-alert--infoPrimary .bm-alert__content{color:var(--bm-comp-alert-color-info-primary-body)}.bm-alert--infoSecondary{background-color:var(--bm-comp-alert-color-info-secondary-bg);border-color:var(--bm-comp-alert-color-info-secondary-border)}.bm-alert--infoSecondary .bm-alert__icon,.bm-alert--infoSecondary .bm-alert__icon svg{color:var(--bm-comp-alert-color-info-secondary-icon)}.bm-alert--infoSecondary .bm-alert__content{color:var(--bm-comp-alert-color-info-secondary-body)}.bm-alert[dir=rtl]{flex-direction:row-reverse}.bm-alert--no-box{display:contents}';
|
|
36
|
+
var de = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, G = (e) => {
|
|
37
|
+
throw TypeError(e);
|
|
38
|
+
}, i = (e, o, a, n) => {
|
|
39
|
+
for (var c = n > 1 ? void 0 : n ? fe(o, a) : o, g = e.length - 1, y; g >= 0; g--)
|
|
40
|
+
(y = e[g]) && (c = (n ? y(o, a, c) : y(c)) || c);
|
|
41
|
+
return n && c && de(o, a, c), c;
|
|
42
|
+
}, T = (e, o, a) => o.has(e) || G("Cannot " + a), r = (e, o, a) => (T(e, o, "read from private field"), a ? a.call(e) : o.get(e)), s = (e, o, a) => o.has(e) ? G("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, a), H = (e, o, a, n) => (T(e, o, "write to private field"), o.set(e, a), a), B, x, C, b, M, A, R, h, v, z, P, S, O, L, F, U, D;
|
|
43
|
+
const { baseClassNamePrefix: he, subElementClassPrefix: p, classModifierPrefix: w } = ee("alert");
|
|
44
|
+
let t = class extends Q {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(), this.size = "sm", this.fullWidth = !1, this.appearance = "infoPrimary", this.hidden = !1, this.hideIcon = !1, this.dismissible = !1, this.disableAutoFocus = !1, this.disableCloseOnEscape = !1, this._isContentWrapping = !1, s(this, B, document.activeElement), s(this, x, () => !!this.heading || this.hasHeadingSlot), s(this, C, () => !!this.body || this.hasBodySlot), s(this, b, () => this.requestUpdate()), s(this, M, () => {
|
|
47
|
+
var e;
|
|
48
|
+
this.dispatchEvent(
|
|
49
|
+
new CustomEvent("bm-dismiss", {
|
|
50
|
+
detail: { message: "bm-alert dismissed" },
|
|
51
|
+
bubbles: !0,
|
|
52
|
+
composed: !0
|
|
53
|
+
})
|
|
54
|
+
), this.hidden = !0, (e = r(this, B)) == null || e.focus();
|
|
55
|
+
}), s(this, A, (e) => {
|
|
56
|
+
e.key === "Escape" && this.dismissible && !this.disableCloseOnEscape && r(this, M).call(this);
|
|
57
|
+
}), s(this, R, () => {
|
|
58
|
+
var e;
|
|
59
|
+
if (!this.disableAutoFocus) {
|
|
60
|
+
if (this.hasActionSlot && !this.hidden) {
|
|
61
|
+
const o = this._actionSlotWrapperRef.assignedNodes({
|
|
62
|
+
flatten: !0
|
|
63
|
+
})[0], a = oe(
|
|
64
|
+
o
|
|
65
|
+
);
|
|
66
|
+
a == null || a.focus();
|
|
67
|
+
} else if (this.dismissible && !this.hasActionSlot && !this.hidden) {
|
|
68
|
+
const o = (e = this._closeButtonRef.shadowRoot) == null ? void 0 : e.querySelector("button");
|
|
69
|
+
o == null || o.focus();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}), s(this, h), s(this, v), s(this, z, () => {
|
|
73
|
+
const e = this._contentRef;
|
|
74
|
+
e && (H(this, v, re(() => {
|
|
75
|
+
const o = e.offsetHeight, a = ce(this.size);
|
|
76
|
+
this._isContentWrapping = o > a;
|
|
77
|
+
}, se)), H(this, h, new ResizeObserver(r(this, v))), r(this, h).observe(e), r(this, v).call(this));
|
|
78
|
+
}), s(this, P, () => {
|
|
79
|
+
var e;
|
|
80
|
+
r(this, h) && r(this, h).disconnect(), (e = r(this, v)) == null || e.cancel();
|
|
81
|
+
}), s(this, S, () => {
|
|
82
|
+
const e = r(this, x).call(this), o = r(this, C).call(this), a = this.hasActionSlot, n = this.dismissible, { role: c } = this, g = c === "alertdialog", y = !!(!this.disableAutoFocus && (a || n)), Z = g || y, K = Z ? "alertdialog" : c, V = e ? "heading" : m, k = o ? "body" : m;
|
|
83
|
+
let W = m;
|
|
84
|
+
const I = Z || n;
|
|
85
|
+
I && e ? W = V : I && o && (W = k);
|
|
86
|
+
let q = m;
|
|
87
|
+
return I && o && W !== k && (q = k), { role: K, ariaLabelledBy: W, ariaDescribedBy: q, headingId: V, bodyId: k };
|
|
88
|
+
}), s(this, O, () => {
|
|
89
|
+
if (this.hideIcon) return m;
|
|
90
|
+
const { icon: e, label: o } = {
|
|
91
|
+
infoPrimary: { icon: N, label: _.infoPrimary },
|
|
92
|
+
infoSecondary: { icon: N, label: _.infoSecondary },
|
|
93
|
+
negative: { icon: N, label: _.negative },
|
|
94
|
+
positive: { icon: le, label: _.positive },
|
|
95
|
+
warning: { icon: te, label: _.warning }
|
|
96
|
+
}[this.appearance], a = ae(e, { role: "img", "aria-label": o });
|
|
97
|
+
return d`
|
|
98
|
+
<span
|
|
99
|
+
class=${u(
|
|
100
|
+
`${p}icon`,
|
|
101
|
+
(this._isContentWrapping || r(this, x).call(this) && r(this, C).call(this)) && `${p}icon--wrapping`
|
|
102
|
+
)}
|
|
103
|
+
>
|
|
104
|
+
<slot name="icon" @slotchange=${r(this, b)}></slot>
|
|
105
|
+
${this.hasIconSlot ? m : j(a)}
|
|
106
|
+
</span>
|
|
107
|
+
`;
|
|
108
|
+
}), s(this, L, () => {
|
|
109
|
+
const e = r(this, x).call(this), o = `${p}content__heading`, { headingId: a } = r(this, S).call(this);
|
|
110
|
+
return d`
|
|
111
|
+
<span
|
|
112
|
+
id=${e ? a : m}
|
|
113
|
+
class=${u(
|
|
114
|
+
o,
|
|
115
|
+
!e && `${w}no-box`
|
|
116
|
+
)}
|
|
117
|
+
>
|
|
118
|
+
<slot name="heading" @slotchange=${r(this, b)}></slot>
|
|
119
|
+
${this.hasHeadingSlot ? m : this.heading ?? m}
|
|
120
|
+
</hasBodySlot>
|
|
121
|
+
`;
|
|
122
|
+
}), s(this, F, () => {
|
|
123
|
+
const e = r(this, C).call(this), { bodyId: o } = r(this, S).call(this);
|
|
124
|
+
return d`
|
|
125
|
+
<span
|
|
126
|
+
id=${e ? o : m}
|
|
127
|
+
class=${u(!e && `${w}no-box`)}
|
|
128
|
+
>
|
|
129
|
+
<slot name="body" @slotchange=${r(this, b)}></slot>
|
|
130
|
+
${this.hasBodySlot ? m : this.body ?? m}
|
|
131
|
+
</span>
|
|
132
|
+
`;
|
|
133
|
+
}), s(this, U, () => d`
|
|
134
|
+
<div class="${p}actions" ?hidden=${!this.hasActionSlot}>
|
|
135
|
+
<slot
|
|
136
|
+
id="actions-slot-wrapper"
|
|
137
|
+
name="actions"
|
|
138
|
+
@slotchange=${r(this, b)}
|
|
139
|
+
></slot>
|
|
140
|
+
</div>
|
|
141
|
+
`), s(this, D, () => this.dismissible ? d`<span
|
|
142
|
+
class=${u(
|
|
143
|
+
`${p}close-button`,
|
|
144
|
+
this._isContentWrapping && `${p}close-button--wrapping`
|
|
145
|
+
)}
|
|
146
|
+
>
|
|
147
|
+
<bm-close-button
|
|
148
|
+
size=${this.size}
|
|
149
|
+
@click=${r(this, M)}
|
|
150
|
+
style="display: flex;"
|
|
151
|
+
id="close-button"
|
|
152
|
+
aria-label=${pe}
|
|
153
|
+
></bm-close-button>
|
|
154
|
+
</span>` : m);
|
|
155
|
+
}
|
|
156
|
+
get hasHeadingSlot() {
|
|
157
|
+
return f(this.headingNodes);
|
|
158
|
+
}
|
|
159
|
+
get hasBodySlot() {
|
|
160
|
+
return f(this.bodyNodes);
|
|
161
|
+
}
|
|
162
|
+
get hasIconSlot() {
|
|
163
|
+
return f(this.iconNodes);
|
|
164
|
+
}
|
|
165
|
+
get hasActionSlot() {
|
|
166
|
+
return f(this.actionsNodes);
|
|
167
|
+
}
|
|
168
|
+
// ---------- Lifecycle ----------
|
|
169
|
+
connectedCallback() {
|
|
170
|
+
super.connectedCallback(), this.addEventListener("keydown", r(this, A)), H(this, B, document.activeElement);
|
|
171
|
+
}
|
|
172
|
+
disconnectedCallback() {
|
|
173
|
+
super.disconnectedCallback(), r(this, P).call(this), this.removeEventListener("keydown", r(this, A));
|
|
174
|
+
}
|
|
175
|
+
firstUpdated() {
|
|
176
|
+
r(this, z).call(this), queueMicrotask(() => {
|
|
177
|
+
var o, a;
|
|
178
|
+
(f((o = this.headingSlot) == null ? void 0 : o.assignedNodes({ flatten: !0 })) || f((a = this.bodySlot) == null ? void 0 : a.assignedNodes({ flatten: !0 }))) && r(this, b).call(this);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
updated(e) {
|
|
182
|
+
r(this, R).call(this), e.has("size") && (r(this, P).call(this), r(this, z).call(this));
|
|
183
|
+
}
|
|
184
|
+
// ---------- Main render ----------
|
|
185
|
+
render() {
|
|
186
|
+
if (this.hidden) return m;
|
|
187
|
+
const { role: e, ariaLabelledBy: o, ariaDescribedBy: a } = r(this, S).call(this), n = u(
|
|
188
|
+
he,
|
|
189
|
+
this.fullWidth && `${w}full-width`,
|
|
190
|
+
this.size && `${w}${this.size}`,
|
|
191
|
+
this.theme && ie(this.theme),
|
|
192
|
+
this.appearance && `${w}${this.appearance}`
|
|
193
|
+
);
|
|
194
|
+
return d`
|
|
195
|
+
<div
|
|
196
|
+
role=${e}
|
|
197
|
+
class=${n}
|
|
198
|
+
aria-labelledby=${o}
|
|
199
|
+
aria-describedby=${a}
|
|
200
|
+
aria-modal="false"
|
|
201
|
+
>
|
|
202
|
+
${r(this, O).call(this)}
|
|
203
|
+
<div id="content" class="${p}content__wrapper">
|
|
204
|
+
<div class="${p}content">
|
|
205
|
+
${r(this, L).call(this)} ${r(this, F).call(this)}
|
|
206
|
+
</div>
|
|
207
|
+
${r(this, U).call(this)}
|
|
208
|
+
</div>
|
|
209
|
+
${r(this, D).call(this)}
|
|
210
|
+
</div>
|
|
211
|
+
`;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
B = /* @__PURE__ */ new WeakMap();
|
|
215
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
216
|
+
C = /* @__PURE__ */ new WeakMap();
|
|
217
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
218
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
219
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
220
|
+
R = /* @__PURE__ */ new WeakMap();
|
|
221
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
222
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
223
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
224
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
225
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
226
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
227
|
+
L = /* @__PURE__ */ new WeakMap();
|
|
228
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
229
|
+
U = /* @__PURE__ */ new WeakMap();
|
|
230
|
+
D = /* @__PURE__ */ new WeakMap();
|
|
231
|
+
ne(t);
|
|
232
|
+
t.styles = J(be);
|
|
233
|
+
i([
|
|
234
|
+
l()
|
|
235
|
+
], t.prototype, "heading", 2);
|
|
236
|
+
i([
|
|
237
|
+
l()
|
|
238
|
+
], t.prototype, "body", 2);
|
|
239
|
+
i([
|
|
240
|
+
l({ type: String })
|
|
241
|
+
], t.prototype, "size", 2);
|
|
242
|
+
i([
|
|
243
|
+
l({ type: Boolean })
|
|
244
|
+
], t.prototype, "fullWidth", 2);
|
|
245
|
+
i([
|
|
246
|
+
l({ type: String })
|
|
247
|
+
], t.prototype, "theme", 2);
|
|
248
|
+
i([
|
|
249
|
+
l({ type: String })
|
|
250
|
+
], t.prototype, "appearance", 2);
|
|
251
|
+
i([
|
|
252
|
+
l({ type: Boolean })
|
|
253
|
+
], t.prototype, "hidden", 2);
|
|
254
|
+
i([
|
|
255
|
+
l({ type: Boolean })
|
|
256
|
+
], t.prototype, "hideIcon", 2);
|
|
257
|
+
i([
|
|
258
|
+
l({ type: Boolean })
|
|
259
|
+
], t.prototype, "dismissible", 2);
|
|
260
|
+
i([
|
|
261
|
+
l({ type: Boolean })
|
|
262
|
+
], t.prototype, "disableAutoFocus", 2);
|
|
263
|
+
i([
|
|
264
|
+
l({ type: Boolean })
|
|
265
|
+
], t.prototype, "disableCloseOnEscape", 2);
|
|
266
|
+
i([
|
|
267
|
+
E({ slot: "heading", flatten: !0 })
|
|
268
|
+
], t.prototype, "headingNodes", 2);
|
|
269
|
+
i([
|
|
270
|
+
E({ slot: "body", flatten: !0 })
|
|
271
|
+
], t.prototype, "bodyNodes", 2);
|
|
272
|
+
i([
|
|
273
|
+
E({ slot: "icon", flatten: !0 })
|
|
274
|
+
], t.prototype, "iconNodes", 2);
|
|
275
|
+
i([
|
|
276
|
+
E({ slot: "actions", flatten: !0 })
|
|
277
|
+
], t.prototype, "actionsNodes", 2);
|
|
278
|
+
i([
|
|
279
|
+
$('slot[name="heading"]')
|
|
280
|
+
], t.prototype, "headingSlot", 2);
|
|
281
|
+
i([
|
|
282
|
+
$('slot[name="body"]')
|
|
283
|
+
], t.prototype, "bodySlot", 2);
|
|
284
|
+
i([
|
|
285
|
+
Y()
|
|
286
|
+
], t.prototype, "_isContentWrapping", 2);
|
|
287
|
+
i([
|
|
288
|
+
$("#content")
|
|
289
|
+
], t.prototype, "_contentRef", 2);
|
|
290
|
+
i([
|
|
291
|
+
$("#actions-slot-wrapper")
|
|
292
|
+
], t.prototype, "_actionSlotWrapperRef", 2);
|
|
293
|
+
i([
|
|
294
|
+
$("#close-button")
|
|
295
|
+
], t.prototype, "_closeButtonRef", 2);
|
|
296
|
+
t = i([
|
|
297
|
+
X("bm-alert")
|
|
298
|
+
], t);
|
|
299
|
+
export {
|
|
300
|
+
t as BmAlert
|
|
301
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunks/consume.Ce9k1-wN.js";
|
|
2
|
+
import "../chunks/lit-element.CJtt9wj5.js";
|
|
3
|
+
import "../chunks/register-custom-element.vod7zfGv.js";
|
|
4
|
+
import "../chunks/unsafe-svg.HSGf1NCU.js";
|
|
5
|
+
import "../chunks/classNames.C6fNrXWF.js";
|
|
6
|
+
import { B as f } from "../chunks/Avatar.CvTOzaRT.js";
|
|
7
|
+
import "../StateLayer/StateLayer.js";
|
|
8
|
+
import "./AvatarGroup.context.js";
|
|
9
|
+
export {
|
|
10
|
+
f as BmAvatar
|
|
11
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { a as E, c as q, b as B, g as D, d as F, e as g, f as L } from "../chunks/Avatar.CvTOzaRT.js";
|
|
2
|
+
import { e as T } from "../chunks/provide.i2FlUkOu.js";
|
|
3
|
+
import { r as U, a as G, E as I, x as b } from "../chunks/lit-element.CJtt9wj5.js";
|
|
4
|
+
import { n as C, c as H } from "../chunks/register-custom-element.vod7zfGv.js";
|
|
5
|
+
import { c as V } from "../chunks/classNames.C6fNrXWF.js";
|
|
6
|
+
import "../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { c as J, r as R, f as K } from "../chunks/dom.C98AFbJh.js";
|
|
8
|
+
import { c as Q } from "../chunks/CSSLookup.BdqZ5Li9.js";
|
|
9
|
+
import { AvatarGroupCtx as X } from "./AvatarGroup.context.js";
|
|
10
|
+
const Y = (t) => {
|
|
11
|
+
let e = null;
|
|
12
|
+
const s = () => {
|
|
13
|
+
e === null && (e = requestAnimationFrame(() => {
|
|
14
|
+
e = null, t();
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
return s.cancel = () => {
|
|
18
|
+
e !== null && (cancelAnimationFrame(e), e = null);
|
|
19
|
+
}, s;
|
|
20
|
+
}, Z = (t, e, s = !1) => e <= 0 ? 0 : Math.max(
|
|
21
|
+
0,
|
|
22
|
+
Math.floor(t / e) + (s ? 1 : 0)
|
|
23
|
+
);
|
|
24
|
+
var j = Object.defineProperty, tt = Object.getOwnPropertyDescriptor, P = (t) => {
|
|
25
|
+
throw TypeError(t);
|
|
26
|
+
}, p = (t, e, s, i) => {
|
|
27
|
+
for (var n = i > 1 ? void 0 : i ? tt(e, s) : e, o = t.length - 1, l; o >= 0; o--)
|
|
28
|
+
(l = t[o]) && (n = (i ? l(e, s, n) : l(n)) || n);
|
|
29
|
+
return i && n && j(e, s, n), n;
|
|
30
|
+
}, N = (t, e, s) => e.has(t) || P("Cannot " + s), a = (t, e, s) => (N(t, e, "read from private field"), s ? s.call(t) : e.get(t)), r = (t, e, s) => e.has(t) ? P("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), u = (t, e, s, i) => (N(t, e, "write to private field"), e.set(t, s), s), d, f, v, m, _, c, x, k, z, $, A, M, W, y, O, S;
|
|
31
|
+
let h = class extends G {
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments), this.wrapping = !1, this.maxCount = 5, this.size = "md", this.layout = "stacked", r(this, d, this.maxCount), r(this, f), r(this, v, /* @__PURE__ */ new Set()), r(this, m, /* @__PURE__ */ new WeakMap()), r(this, _), r(this, c), this.groupCtx = {
|
|
34
|
+
register: (t) => a(this, k).call(this, t),
|
|
35
|
+
unregister: (t) => a(this, z).call(this, t),
|
|
36
|
+
size: this.size
|
|
37
|
+
}, r(this, x, () => {
|
|
38
|
+
var t;
|
|
39
|
+
return (t = this.shadowRoot) == null ? void 0 : t.querySelector(".avatar-group-content");
|
|
40
|
+
}), r(this, k, (t) => {
|
|
41
|
+
const e = t.getRootNode();
|
|
42
|
+
e instanceof ShadowRoot && e.host === this || (a(this, v).add(t), a(this, y).call(this, t), this.requestUpdate());
|
|
43
|
+
}), r(this, z, (t) => {
|
|
44
|
+
const e = t.getRootNode();
|
|
45
|
+
e instanceof ShadowRoot && e.host === this || (a(this, v).delete(t), this.requestUpdate());
|
|
46
|
+
}), r(this, $, () => {
|
|
47
|
+
if (this.wrapping) return !1;
|
|
48
|
+
const t = a(this, x).call(this);
|
|
49
|
+
if (!t) return !1;
|
|
50
|
+
const e = t.clientWidth, s = a(this, A).call(this, e), i = Math.min(s, this.maxCount), n = i !== a(this, d);
|
|
51
|
+
return u(this, d, i), n;
|
|
52
|
+
}), r(this, A, (t) => {
|
|
53
|
+
const e = Q(
|
|
54
|
+
B[this.size] - D(this.size, this.layout || "stacked")
|
|
55
|
+
), s = F(this.size, this.layout || "stacked"), i = e + s;
|
|
56
|
+
return Z(t, i, !0);
|
|
57
|
+
}), r(this, M, () => Array.from(a(this, v)).sort(J)), r(this, W, () => {
|
|
58
|
+
if (this.wrapping) {
|
|
59
|
+
const o = a(this, M).call(this);
|
|
60
|
+
return {
|
|
61
|
+
avatars: o,
|
|
62
|
+
countWhenOverflow: o.length,
|
|
63
|
+
overflowCount: 0,
|
|
64
|
+
isOverflowing: !1,
|
|
65
|
+
overflowingNames: ""
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const t = a(this, M).call(this), e = Math.max(0, a(this, d) - 1), s = Math.max(0, t.length - e), i = s > 1, n = t.slice(e).map((o) => R(o, "name") || R(o, "alt")).filter((o) => !!o).join(", ");
|
|
69
|
+
return {
|
|
70
|
+
avatars: t,
|
|
71
|
+
countWhenOverflow: e,
|
|
72
|
+
overflowCount: s,
|
|
73
|
+
isOverflowing: i,
|
|
74
|
+
overflowingNames: n
|
|
75
|
+
};
|
|
76
|
+
}), r(this, y, (t) => {
|
|
77
|
+
const e = a(this, m).get(t);
|
|
78
|
+
if (e && e.isConnected) return e;
|
|
79
|
+
const s = K(t, this, a(this, _));
|
|
80
|
+
return a(this, m).set(t, s), s;
|
|
81
|
+
}), r(this, O, () => {
|
|
82
|
+
const { avatars: t, countWhenOverflow: e, isOverflowing: s } = a(this, W).call(this);
|
|
83
|
+
t.forEach((i, n) => {
|
|
84
|
+
const o = s && n >= e, l = i.hasAttribute("hidden"), w = a(this, y).call(this, i);
|
|
85
|
+
o && !l ? (i.setAttribute("hidden", "true"), w !== i && w.setAttribute("hidden", "true")) : !o && l && (i.removeAttribute("hidden"), w !== i && w.removeAttribute("hidden"));
|
|
86
|
+
});
|
|
87
|
+
}), r(this, S, () => V(
|
|
88
|
+
L,
|
|
89
|
+
`${g}${this.size || "md"}`,
|
|
90
|
+
`${g}circle`,
|
|
91
|
+
`${g}${this.layout || "stacked"}-${this.size || "md"}`,
|
|
92
|
+
this.wrapping && `${g}wrapping`
|
|
93
|
+
));
|
|
94
|
+
}
|
|
95
|
+
willUpdate(t) {
|
|
96
|
+
var e;
|
|
97
|
+
t.has("size") && (this.groupCtx = { ...this.groupCtx, size: this.size }), (t.has("size") || t.has("maxCount") || t.has("wrapping") || t.has("layout")) && ((e = a(this, c)) == null || e.call(this));
|
|
98
|
+
}
|
|
99
|
+
firstUpdated() {
|
|
100
|
+
var s;
|
|
101
|
+
u(this, c, Y(() => {
|
|
102
|
+
u(this, m, /* @__PURE__ */ new WeakMap()), a(this, $).call(this) && this.requestUpdate();
|
|
103
|
+
}));
|
|
104
|
+
const t = a(this, x).call(this);
|
|
105
|
+
t && (u(this, f, new ResizeObserver(() => {
|
|
106
|
+
var i;
|
|
107
|
+
return (i = a(this, c)) == null ? void 0 : i.call(this);
|
|
108
|
+
})), a(this, f).observe(t));
|
|
109
|
+
const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector("slot");
|
|
110
|
+
e && (u(this, _, e), e.addEventListener("slotchange", () => {
|
|
111
|
+
var i;
|
|
112
|
+
return (i = a(this, c)) == null ? void 0 : i.call(this);
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
updated() {
|
|
116
|
+
a(this, O).call(this);
|
|
117
|
+
}
|
|
118
|
+
disconnectedCallback() {
|
|
119
|
+
var t;
|
|
120
|
+
super.disconnectedCallback(), (t = a(this, f)) == null || t.disconnect();
|
|
121
|
+
}
|
|
122
|
+
render() {
|
|
123
|
+
const { isOverflowing: t, overflowCount: e, overflowingNames: s } = a(this, W).call(this);
|
|
124
|
+
return b`
|
|
125
|
+
<div class="avatar-group-content ${a(this, S).call(this)}">
|
|
126
|
+
<slot></slot>
|
|
127
|
+
${t ? b` <bm-tooltip>
|
|
128
|
+
<bm-avatar
|
|
129
|
+
slot="trigger"
|
|
130
|
+
?isFocusable=${!0}
|
|
131
|
+
name="+${e}"
|
|
132
|
+
shape="circle"
|
|
133
|
+
size=${this.size}
|
|
134
|
+
withBorder=${!0}
|
|
135
|
+
class=${`${q}overflow`}
|
|
136
|
+
></bm-avatar>
|
|
137
|
+
<div slot="text">${s}</div>
|
|
138
|
+
</bm-tooltip>` : I}
|
|
139
|
+
</div>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
144
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
145
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
146
|
+
m = /* @__PURE__ */ new WeakMap();
|
|
147
|
+
_ = /* @__PURE__ */ new WeakMap();
|
|
148
|
+
c = /* @__PURE__ */ new WeakMap();
|
|
149
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
150
|
+
k = /* @__PURE__ */ new WeakMap();
|
|
151
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
152
|
+
$ = /* @__PURE__ */ new WeakMap();
|
|
153
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
154
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
155
|
+
W = /* @__PURE__ */ new WeakMap();
|
|
156
|
+
y = /* @__PURE__ */ new WeakMap();
|
|
157
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
158
|
+
S = /* @__PURE__ */ new WeakMap();
|
|
159
|
+
h.styles = [U(E)];
|
|
160
|
+
p([
|
|
161
|
+
C({ type: Boolean })
|
|
162
|
+
], h.prototype, "wrapping", 2);
|
|
163
|
+
p([
|
|
164
|
+
C({ type: Number, reflect: !0 })
|
|
165
|
+
], h.prototype, "maxCount", 2);
|
|
166
|
+
p([
|
|
167
|
+
C({ type: String })
|
|
168
|
+
], h.prototype, "size", 2);
|
|
169
|
+
p([
|
|
170
|
+
C({ type: String })
|
|
171
|
+
], h.prototype, "layout", 2);
|
|
172
|
+
p([
|
|
173
|
+
T({ context: X })
|
|
174
|
+
], h.prototype, "groupCtx", 2);
|
|
175
|
+
h = p([
|
|
176
|
+
H("bm-avatar-group")
|
|
177
|
+
], h);
|
|
178
|
+
export {
|
|
179
|
+
h as BmAvatarGroup
|
|
180
|
+
};
|