@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,203 @@
|
|
|
1
|
+
import { consume as B } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as T, LitElement as L, html as r, nothing as u } from "lit";
|
|
3
|
+
import { property as p } from "lit/decorators.js";
|
|
4
|
+
import { createRef as _, ref as C } from "lit/directives/ref.js";
|
|
5
|
+
import { unsafeSVG as y } from "lit/directives/unsafe-svg.js";
|
|
6
|
+
import M from "clsx";
|
|
7
|
+
import { C as R, E as W } from "../../chunks/HelperText.CcVVOtA3.js";
|
|
8
|
+
import { g as D } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
9
|
+
import { t as H, p as U } from "../../chunks/constants.jOWREYQE.js";
|
|
10
|
+
import { f as O } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
11
|
+
import { a as V, c as k } from "../../chunks/tokens.CTW8Tt94.js";
|
|
12
|
+
import { c as A } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
13
|
+
import { fileUploadListContext as G } from "./FileUploadListContext.js";
|
|
14
|
+
import "../../Icon/Icon.js";
|
|
15
|
+
import "../../Tooltip/Tooltip.js";
|
|
16
|
+
import "../../CloseButton/CloseButton.js";
|
|
17
|
+
import "../../ProgressBar/ProgressBar.js";
|
|
18
|
+
const Z = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
|
+
<g clip-path="url(#clip0_501_2445)">
|
|
20
|
+
<path
|
|
21
|
+
d="M14 2H6C4.9 2 4.01 2.9 4.01 4L4 20C4 21.1 4.89 22 5.99 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z"
|
|
22
|
+
fill="currentColor"
|
|
23
|
+
/>
|
|
24
|
+
</g>
|
|
25
|
+
<defs>
|
|
26
|
+
<clipPath id="clip0_501_2445">
|
|
27
|
+
<rect width="24" height="24" fill="none" />
|
|
28
|
+
</clipPath>
|
|
29
|
+
</defs>
|
|
30
|
+
</svg>
|
|
31
|
+
`;
|
|
32
|
+
var q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, x = (t) => {
|
|
33
|
+
throw TypeError(t);
|
|
34
|
+
}, o = (t, e, s, m) => {
|
|
35
|
+
for (var l = m > 1 ? void 0 : m ? J(e, s) : e, $ = t.length - 1, v; $ >= 0; $--)
|
|
36
|
+
(v = t[$]) && (l = (m ? v(e, s, l) : v(l)) || l);
|
|
37
|
+
return m && l && q(e, s, l), l;
|
|
38
|
+
}, S = (t, e, s) => e.has(t) || x("Cannot " + s), h = (t, e, s) => (S(t, e, "read from private field"), s ? s.call(t) : e.get(t)), g = (t, e, s) => e.has(t) ? x("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), c = (t, e, s) => (S(t, e, "access private method"), s), f, a, z, E, N, w, I, P, F, d;
|
|
39
|
+
const { baseClassNamePrefix: K, subElementClassPrefix: n, classModifierPrefix: b } = D("file-upload-list-item"), Q = {
|
|
40
|
+
error: { customIconColor: k, icon: W },
|
|
41
|
+
success: {
|
|
42
|
+
customIconColor: V,
|
|
43
|
+
icon: R
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
let i = class extends L {
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments), g(this, a), this.error = "", this.size = "md", this.state = "uploaded", this.progress = 0, g(this, f, () => {
|
|
49
|
+
var t;
|
|
50
|
+
return !!(this.disabled || (t = this.listContext) != null && t.ctxDisabled);
|
|
51
|
+
}), this.tooltipRef = _(), this.fileNameRef = _(), g(this, d, () => {
|
|
52
|
+
var t;
|
|
53
|
+
return ((t = this.listContext) == null ? void 0 : t.ctxSize) ?? this.size ?? "md";
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
const { ctxThumbnail: t } = this.listContext ?? {}, e = t === !1 ? !1 : this.thumbnail ?? t ?? !1, s = M(
|
|
58
|
+
K,
|
|
59
|
+
this.theme && H(this.theme),
|
|
60
|
+
`${b}${h(this, d).call(this)}`,
|
|
61
|
+
`${b}${this.state}`,
|
|
62
|
+
h(this, f).call(this) && `${b}disabled`
|
|
63
|
+
);
|
|
64
|
+
return r`
|
|
65
|
+
<div class=${s}>
|
|
66
|
+
${c(this, a, z).call(this, e)}
|
|
67
|
+
<div class=${`${n}content`}>
|
|
68
|
+
<div class=${`${n}content-start`}>
|
|
69
|
+
${c(this, a, E).call(this)} ${c(this, a, N).call(this)} ${c(this, a, w).call(this)}
|
|
70
|
+
</div>
|
|
71
|
+
<div class=${`${n}content-end`}>
|
|
72
|
+
${c(this, a, I).call(this)} ${c(this, a, P).call(this)}
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
${c(this, a, F).call(this)}
|
|
76
|
+
</div>
|
|
77
|
+
`;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
81
|
+
a = /* @__PURE__ */ new WeakSet();
|
|
82
|
+
z = function(t) {
|
|
83
|
+
return t ? r`
|
|
84
|
+
<div class=${`${n}thumbnail`}>
|
|
85
|
+
${t === !0 ? r`<bm-icon
|
|
86
|
+
color="secondary"
|
|
87
|
+
icon="image"
|
|
88
|
+
size="${h(this, d).call(this) === "md" ? "sm" : "md"}"
|
|
89
|
+
>
|
|
90
|
+
${y(Z)}
|
|
91
|
+
</bm-icon>` : r`<img src=${t} alt=${this.fileName} />`}
|
|
92
|
+
</div>
|
|
93
|
+
` : u;
|
|
94
|
+
};
|
|
95
|
+
E = function() {
|
|
96
|
+
return r`
|
|
97
|
+
<bm-tooltip @bm-toggle=${() => {
|
|
98
|
+
const e = this.fileNameRef.value, s = this.tooltipRef.value;
|
|
99
|
+
if (!e || !s)
|
|
100
|
+
return;
|
|
101
|
+
const { offsetWidth: m, scrollWidth: l } = e;
|
|
102
|
+
l <= m && (s.open = !1);
|
|
103
|
+
}} ${C(this.tooltipRef)}>
|
|
104
|
+
<span slot="text">${this.fileName}</span>
|
|
105
|
+
<span
|
|
106
|
+
slot="trigger"
|
|
107
|
+
class=${`${n}filename`}
|
|
108
|
+
${C(this.fileNameRef)}
|
|
109
|
+
>
|
|
110
|
+
${this.fileName}
|
|
111
|
+
</span>
|
|
112
|
+
</bm-tooltip>
|
|
113
|
+
`;
|
|
114
|
+
};
|
|
115
|
+
N = function() {
|
|
116
|
+
return r`<p class=${`${n}size`}>${this.fileSize}</p>`;
|
|
117
|
+
};
|
|
118
|
+
w = function() {
|
|
119
|
+
return !this.error || this.state !== "error" ? u : r` <bm-helper-text
|
|
120
|
+
hideIcon
|
|
121
|
+
appearance="negative"
|
|
122
|
+
size="sm"
|
|
123
|
+
class=${`${n}error`}
|
|
124
|
+
text=${this.error}
|
|
125
|
+
></bm-helper-text>`;
|
|
126
|
+
};
|
|
127
|
+
I = function() {
|
|
128
|
+
const t = Q[this.state];
|
|
129
|
+
return t ? r`<div class=${`${n}status`}>
|
|
130
|
+
<bm-icon customIconColor=${t.customIconColor} size="sm"
|
|
131
|
+
>${y(t.icon)}</bm-icon
|
|
132
|
+
>
|
|
133
|
+
</div>` : u;
|
|
134
|
+
};
|
|
135
|
+
P = function() {
|
|
136
|
+
const t = (e) => {
|
|
137
|
+
e.stopPropagation();
|
|
138
|
+
const s = new CustomEvent(`${U}dismiss`, {
|
|
139
|
+
bubbles: !0,
|
|
140
|
+
composed: !0
|
|
141
|
+
});
|
|
142
|
+
this.dispatchEvent(s);
|
|
143
|
+
};
|
|
144
|
+
return r`<bm-close-button
|
|
145
|
+
size="sm"
|
|
146
|
+
?disabled=${h(this, f).call(this)}
|
|
147
|
+
class=${`${n}remove`}
|
|
148
|
+
@click=${t}
|
|
149
|
+
></bm-button>`;
|
|
150
|
+
};
|
|
151
|
+
F = function() {
|
|
152
|
+
return this.state === "uploading" ? r`<bm-progress-bar
|
|
153
|
+
size="sm"
|
|
154
|
+
value=${this.progress}
|
|
155
|
+
state="active"
|
|
156
|
+
fullWidth
|
|
157
|
+
class=${`${n}progress-bar`}
|
|
158
|
+
progressbarAriaLabel="File upload progress"
|
|
159
|
+
></bm-progress-bar>` : u;
|
|
160
|
+
};
|
|
161
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
162
|
+
i.styles = T(O);
|
|
163
|
+
o([
|
|
164
|
+
p({ type: String })
|
|
165
|
+
], i.prototype, "error", 2);
|
|
166
|
+
o([
|
|
167
|
+
p({ type: String })
|
|
168
|
+
], i.prototype, "fileName", 2);
|
|
169
|
+
o([
|
|
170
|
+
p({ type: String })
|
|
171
|
+
], i.prototype, "fileSize", 2);
|
|
172
|
+
o([
|
|
173
|
+
p({ type: String })
|
|
174
|
+
], i.prototype, "size", 2);
|
|
175
|
+
o([
|
|
176
|
+
p({
|
|
177
|
+
type: String,
|
|
178
|
+
converter(t) {
|
|
179
|
+
return t === "true" || t === "" ? !0 : t === "false" ? !1 : t;
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
], i.prototype, "thumbnail", 2);
|
|
183
|
+
o([
|
|
184
|
+
p({ type: String })
|
|
185
|
+
], i.prototype, "state", 2);
|
|
186
|
+
o([
|
|
187
|
+
p({ type: Number })
|
|
188
|
+
], i.prototype, "progress", 2);
|
|
189
|
+
o([
|
|
190
|
+
p({ type: String })
|
|
191
|
+
], i.prototype, "theme", 2);
|
|
192
|
+
o([
|
|
193
|
+
p({ type: Boolean })
|
|
194
|
+
], i.prototype, "disabled", 2);
|
|
195
|
+
o([
|
|
196
|
+
B({ context: G, subscribe: !0 })
|
|
197
|
+
], i.prototype, "listContext", 2);
|
|
198
|
+
i = o([
|
|
199
|
+
A("bm-file-upload-list-item")
|
|
200
|
+
], i);
|
|
201
|
+
export {
|
|
202
|
+
i as BmFileUploadListItem
|
|
203
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { FileItem, FileUploadListSize } from '@viasat/beam-shared/components/fileUpload';
|
|
3
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-file-upload-list`
|
|
6
|
+
*
|
|
7
|
+
* @slot default - Specify the list items
|
|
8
|
+
*/
|
|
9
|
+
export declare class BmFileUploadList extends LitElement {
|
|
10
|
+
#private;
|
|
11
|
+
static styles: import('lit').CSSResult;
|
|
12
|
+
/**
|
|
13
|
+
* Specify if the all items displays with a default thumbnail or a preview of the image being uploaded. Image only displays for size lg.
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
thumbnail?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Specify FileUpload List size
|
|
19
|
+
* @default 'md'
|
|
20
|
+
*/
|
|
21
|
+
size?: FileUploadListSize;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the theme of the FileUpload. By default it inherits the theme from the parent
|
|
24
|
+
*/
|
|
25
|
+
theme?: ThemeTypes;
|
|
26
|
+
/**
|
|
27
|
+
* Specify if the FileUpload is disabled
|
|
28
|
+
*/
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Specify a render function for the list item
|
|
32
|
+
*/
|
|
33
|
+
renderItem?: (fileItem: FileItem, dismissFile: () => void) => void;
|
|
34
|
+
private listContext?;
|
|
35
|
+
private fileUploadContext?;
|
|
36
|
+
willUpdate(): void;
|
|
37
|
+
private internalRenderItem;
|
|
38
|
+
private handleSlotChange;
|
|
39
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
40
|
+
}
|
|
41
|
+
declare global {
|
|
42
|
+
interface HTMLElementTagNameMap {
|
|
43
|
+
'bm-file-upload-list': BmFileUploadList;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=FileUpload.List.d.ts.map
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { provide as c, consume as u } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as x, LitElement as C, html as m } from "lit";
|
|
3
|
+
import { property as n } from "lit/decorators.js";
|
|
4
|
+
import v from "clsx";
|
|
5
|
+
import { g as b } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import { t as g } from "../../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { f as y } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
8
|
+
import { c as _ } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import { fileUploadContext as S } from "./FileUploadContext.js";
|
|
10
|
+
import { fileUploadListContext as $ } from "./FileUploadListContext.js";
|
|
11
|
+
import "./FileUpload.List.Item.js";
|
|
12
|
+
var U = Object.defineProperty, w = Object.getOwnPropertyDescriptor, h = (t) => {
|
|
13
|
+
throw TypeError(t);
|
|
14
|
+
}, a = (t, e, s, r) => {
|
|
15
|
+
for (var o = r > 1 ? void 0 : r ? w(e, s) : e, l = t.length - 1, p; l >= 0; l--)
|
|
16
|
+
(p = t[l]) && (o = (r ? p(e, s, o) : p(o)) || o);
|
|
17
|
+
return r && o && U(e, s, o), o;
|
|
18
|
+
}, z = (t, e, s) => e.has(t) || h("Cannot " + s), E = (t, e, s) => (z(t, e, "read from private field"), s ? s.call(t) : e.get(t)), N = (t, e, s) => e.has(t) ? h("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), d;
|
|
19
|
+
const { baseClassNamePrefix: P, classModifierPrefix: f } = b("file-upload-list");
|
|
20
|
+
let i = class extends C {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments), this.fileUploadContext = {}, N(this, d, () => {
|
|
23
|
+
var t;
|
|
24
|
+
return !!(this.disabled || (t = this.fileUploadContext) != null && t.ctxDisabled);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
willUpdate() {
|
|
28
|
+
this.listContext = {
|
|
29
|
+
ctxSize: this.size ?? "md",
|
|
30
|
+
ctxThumbnail: this.thumbnail,
|
|
31
|
+
ctxDisabled: E(this, d).call(this)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
internalRenderItem(t, e) {
|
|
35
|
+
return m`
|
|
36
|
+
<bm-file-upload-list-item
|
|
37
|
+
fileName=${t.fileName}
|
|
38
|
+
fileSize=${t.fileSize}
|
|
39
|
+
error=${t.error}
|
|
40
|
+
thumbnail=${t.thumbnail}
|
|
41
|
+
state=${t.state}
|
|
42
|
+
progress=${t.progress}
|
|
43
|
+
@bm-dismiss=${e}
|
|
44
|
+
></bm-file-upload-list-item>
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
handleSlotChange(t) {
|
|
48
|
+
const s = t.target.assignedElements(), { ctxFileItems: r } = this.fileUploadContext ?? {};
|
|
49
|
+
r && (s.length > 0 && console.warn(
|
|
50
|
+
"Ignoring assigned elements in <bm-file-upload-list> when used inside a <bm-file-upload> component"
|
|
51
|
+
), s.forEach((o) => o.remove()));
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const { ctxSize: t = "md", ctxDisabled: e } = this.listContext ?? {}, s = v(
|
|
55
|
+
P,
|
|
56
|
+
this.theme && g(this.theme),
|
|
57
|
+
`${f}${t || "md"}`,
|
|
58
|
+
e && `${f}disabled`
|
|
59
|
+
), { ctxFileItems: r, ctxDismissFile: o } = this.fileUploadContext ?? {};
|
|
60
|
+
return m`
|
|
61
|
+
<div class=${s}>
|
|
62
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
63
|
+
${r == null ? void 0 : r.map(
|
|
64
|
+
(l) => (this.renderItem ?? this.internalRenderItem)(
|
|
65
|
+
l,
|
|
66
|
+
() => o == null ? void 0 : o(l)
|
|
67
|
+
)
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
74
|
+
i.styles = x(y);
|
|
75
|
+
a([
|
|
76
|
+
n({
|
|
77
|
+
type: String,
|
|
78
|
+
converter(t) {
|
|
79
|
+
return t === "true" ? !0 : t === "false" ? !1 : t;
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
], i.prototype, "thumbnail", 2);
|
|
83
|
+
a([
|
|
84
|
+
n({ type: String })
|
|
85
|
+
], i.prototype, "size", 2);
|
|
86
|
+
a([
|
|
87
|
+
n({ type: String })
|
|
88
|
+
], i.prototype, "theme", 2);
|
|
89
|
+
a([
|
|
90
|
+
n({ type: Boolean })
|
|
91
|
+
], i.prototype, "disabled", 2);
|
|
92
|
+
a([
|
|
93
|
+
n({ type: Function })
|
|
94
|
+
], i.prototype, "renderItem", 2);
|
|
95
|
+
a([
|
|
96
|
+
c({ context: $ })
|
|
97
|
+
], i.prototype, "listContext", 2);
|
|
98
|
+
a([
|
|
99
|
+
u({ context: S, subscribe: !0 })
|
|
100
|
+
], i.prototype, "fileUploadContext", 2);
|
|
101
|
+
i = a([
|
|
102
|
+
_("bm-file-upload-list")
|
|
103
|
+
], i);
|
|
104
|
+
export {
|
|
105
|
+
i as BmFileUploadList
|
|
106
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { FileActions } from '@viasat/beam-shared/components/fileUpload';
|
|
2
|
+
import { FormValidator } from '@viasat/beam-shared/components/form';
|
|
3
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
4
|
+
import { BmFormContext } from '../Form/Form.context';
|
|
5
|
+
import { FormField } from '../Form/Form.decorator';
|
|
6
|
+
import { BmFileUploadButton } from './FileUpload.Button';
|
|
7
|
+
import { BmFileUploadDropzone } from './FileUpload.Dropzone';
|
|
8
|
+
export declare class BmFileUploadFileSelectedEvent extends CustomEvent<{
|
|
9
|
+
file: File;
|
|
10
|
+
actions: FileActions;
|
|
11
|
+
abortSignal: AbortSignal;
|
|
12
|
+
}> {
|
|
13
|
+
constructor(file: File, actions: FileActions, abortSignal: AbortSignal);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `bm-file-upload`
|
|
17
|
+
*
|
|
18
|
+
* @fires bm-selected - Dispatched when a file is uploaded. Preventing default on this event will make upload asynchronous
|
|
19
|
+
* @slot label - Specify Label for for FileUpload
|
|
20
|
+
* @slot helper-text - Specify HelperText for FileUpload
|
|
21
|
+
*/
|
|
22
|
+
export declare class BmFileUpload extends FormField {
|
|
23
|
+
#private;
|
|
24
|
+
static styles: import('lit').CSSResult;
|
|
25
|
+
/**
|
|
26
|
+
* Specify what types of files can be uploaded
|
|
27
|
+
*/
|
|
28
|
+
accept?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Specify error text and display error state of FileUpload
|
|
31
|
+
*/
|
|
32
|
+
error?: string | boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Specify if FileUpload is in disabled state
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Specify if more than one file can be can be uploaded
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Specify how many files can be uploaded
|
|
44
|
+
*/
|
|
45
|
+
fileLimit?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Specify the maximum file size that can be uploaded
|
|
48
|
+
*/
|
|
49
|
+
maxFileSize?: number;
|
|
50
|
+
/**
|
|
51
|
+
* Specify if FileUpload is a required input
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
required?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Specify if FileUpload is in read-only state
|
|
57
|
+
*/
|
|
58
|
+
readOnly?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Specify if FileUpload displays with an asterisk
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
hideRequiredMarker?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Specify form validation rules for FileUpload
|
|
66
|
+
*/
|
|
67
|
+
validationRules: Array<FormValidator>;
|
|
68
|
+
/**
|
|
69
|
+
* Specify if FileUpload is fluid
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
fluid?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Specify the width of FileUpload
|
|
75
|
+
*/
|
|
76
|
+
width?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Specify the theme of the FileUpload. By default it inherits the theme from the parent
|
|
79
|
+
*/
|
|
80
|
+
theme?: ThemeTypes;
|
|
81
|
+
formContext: BmFormContext;
|
|
82
|
+
private fileUploadContext;
|
|
83
|
+
pickerRef: import('lit-html/directives/ref').Ref<BmFileUploadButton | BmFileUploadDropzone>;
|
|
84
|
+
private _textFieldLabel;
|
|
85
|
+
private _textFieldHelperText;
|
|
86
|
+
private filesState;
|
|
87
|
+
willUpdate(): void;
|
|
88
|
+
firstUpdated(): void;
|
|
89
|
+
updated(changedProps: Map<string, unknown>): void;
|
|
90
|
+
formAssociatedCallback(): void;
|
|
91
|
+
formResetCallback(): void;
|
|
92
|
+
private _hasPickerSlot;
|
|
93
|
+
private _hasFilesListSlot;
|
|
94
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
95
|
+
}
|
|
96
|
+
declare global {
|
|
97
|
+
interface HTMLElementTagNameMap {
|
|
98
|
+
'bm-file-upload': BmFileUpload;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=FileUpload.d.ts.map
|