@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,149 @@
|
|
|
1
|
+
import { c as $ } from "../../chunks/consume.Ce9k1-wN.js";
|
|
2
|
+
import { r as D, a as v, E as y, x } from "../../chunks/lit-element.CJtt9wj5.js";
|
|
3
|
+
import { n as p, c as C } from "../../chunks/register-custom-element.vod7zfGv.js";
|
|
4
|
+
import { r as b } from "../../chunks/state.CqiuSzAl.js";
|
|
5
|
+
import { e as g, n as u } from "../../chunks/ref.B7e1Hu4F.js";
|
|
6
|
+
import { o as E } from "../../chunks/unsafe-svg.HSGf1NCU.js";
|
|
7
|
+
import { c as _, g as R } from "../../chunks/classNames.C6fNrXWF.js";
|
|
8
|
+
import { U as I } from "../../chunks/Upload.B9YEyp7b.js";
|
|
9
|
+
import { t as U } from "../../chunks/constants.jOWREYQE.js";
|
|
10
|
+
import { f as w } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
11
|
+
import { stateLayerStyles as P, stateLayerClassName as k } from "../../StateLayer/StateLayer.js";
|
|
12
|
+
import { fileUploadContext as S } from "./FileUploadContext.js";
|
|
13
|
+
import "../../Icon/Icon.js";
|
|
14
|
+
var T = Object.defineProperty, B = Object.getOwnPropertyDescriptor, m = (e) => {
|
|
15
|
+
throw TypeError(e);
|
|
16
|
+
}, o = (e, t, a, n) => {
|
|
17
|
+
for (var i = n > 1 ? void 0 : n ? B(t, a) : t, h = e.length - 1, d; h >= 0; h--)
|
|
18
|
+
(d = e[h]) && (i = (n ? d(t, a, i) : d(i)) || i);
|
|
19
|
+
return n && i && T(t, a, i), i;
|
|
20
|
+
}, O = (e, t, a) => t.has(e) || m("Cannot " + a), l = (e, t, a) => (O(e, t, "read from private field"), a ? a.call(e) : t.get(e)), N = (e, t, a) => t.has(e) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), r;
|
|
21
|
+
const { baseClassNamePrefix: A, classModifierPrefix: c, subElementClassPrefix: f } = R("file-upload-dropzone");
|
|
22
|
+
let s = class extends v {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments), this.disabled = !1, this.fileUploadContext = {}, this.isDragging = !1, this.fileInputRef = g(), N(this, r, () => {
|
|
25
|
+
var e;
|
|
26
|
+
return !!(this.disabled || (e = this.fileUploadContext) != null && e.ctxDisabled);
|
|
27
|
+
}), this.rootDivRef = g();
|
|
28
|
+
}
|
|
29
|
+
handleInputChange(e) {
|
|
30
|
+
var t, a;
|
|
31
|
+
e.target.files && ((a = (t = this.fileUploadContext) == null ? void 0 : t.ctxAddFiles) == null || a.call(t, e.target.files));
|
|
32
|
+
}
|
|
33
|
+
handleDropFiles(e) {
|
|
34
|
+
var a;
|
|
35
|
+
if (e.preventDefault(), e.stopPropagation(), this.isDragging = !1, l(this, r).call(this) || !this.fileInputRef.value)
|
|
36
|
+
return;
|
|
37
|
+
this.fileInputRef.value.value = "", this.fileInputRef.value.files = ((a = e.dataTransfer) == null ? void 0 : a.files) ?? null;
|
|
38
|
+
const t = new Event("change", {
|
|
39
|
+
bubbles: !0
|
|
40
|
+
});
|
|
41
|
+
this.fileInputRef.value.dispatchEvent(t);
|
|
42
|
+
}
|
|
43
|
+
handleKeyDown(e) {
|
|
44
|
+
var t;
|
|
45
|
+
l(this, r).call(this) || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), (t = this.fileInputRef.value) == null || t.click());
|
|
46
|
+
}
|
|
47
|
+
focus() {
|
|
48
|
+
var e;
|
|
49
|
+
(e = this.rootDivRef.value) == null || e.focus();
|
|
50
|
+
}
|
|
51
|
+
handleClick(e) {
|
|
52
|
+
var t;
|
|
53
|
+
l(this, r).call(this) ? (e.preventDefault(), e.stopPropagation()) : (t = this.fileInputRef.value) == null || t.click();
|
|
54
|
+
}
|
|
55
|
+
handleDragStart(e) {
|
|
56
|
+
e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
57
|
+
}
|
|
58
|
+
handleDragEnter(e) {
|
|
59
|
+
this.isDragging = !0, e.dataTransfer && (e.dataTransfer.dropEffect = l(this, r).call(this) ? "none" : "copy");
|
|
60
|
+
}
|
|
61
|
+
handleDragLeave() {
|
|
62
|
+
this.isDragging && (this.isDragging = !1);
|
|
63
|
+
}
|
|
64
|
+
handleDragOver(e) {
|
|
65
|
+
e.preventDefault(), this.isDragging = !0, e.dataTransfer && (e.dataTransfer.dropEffect = l(this, r).call(this) ? "none" : "copy");
|
|
66
|
+
}
|
|
67
|
+
render() {
|
|
68
|
+
const { ctxAccept: e, ctxMultiple: t, ctxError: a } = this.fileUploadContext ?? {}, n = this.accept || e, i = this.multiple || t, h = _(
|
|
69
|
+
A,
|
|
70
|
+
this.theme && U(this.theme),
|
|
71
|
+
l(this, r).call(this) && `${c}disabled`,
|
|
72
|
+
(this.error ?? a) && `${c}error`,
|
|
73
|
+
this.isDragging && `${c}dragging`
|
|
74
|
+
);
|
|
75
|
+
return x`
|
|
76
|
+
<div
|
|
77
|
+
${u(this.rootDivRef)}
|
|
78
|
+
class=${h}
|
|
79
|
+
role="button"
|
|
80
|
+
?aria-disabled=${l(this, r).call(this)}
|
|
81
|
+
tabindex=${l(this, r).call(this) ? y : 0}
|
|
82
|
+
@click=${this.handleClick}
|
|
83
|
+
@dragstart=${this.handleDragStart}
|
|
84
|
+
@dragenter=${this.handleDragEnter}
|
|
85
|
+
@dragleave=${this.handleDragLeave}
|
|
86
|
+
@dragover=${this.handleDragOver}
|
|
87
|
+
@drop=${this.handleDropFiles}
|
|
88
|
+
@keydown=${this.handleKeyDown}
|
|
89
|
+
>
|
|
90
|
+
<input
|
|
91
|
+
${u(this.fileInputRef)}
|
|
92
|
+
name=${this.name}
|
|
93
|
+
type="file"
|
|
94
|
+
hidden
|
|
95
|
+
accept=${n}
|
|
96
|
+
?multiple=${i}
|
|
97
|
+
@change="${this.handleInputChange}"
|
|
98
|
+
?disabled=${l(this, r).call(this)}
|
|
99
|
+
/>
|
|
100
|
+
<span
|
|
101
|
+
aria-hidden="true"
|
|
102
|
+
class=${`${k()} ${f}state-layer`}
|
|
103
|
+
></span>
|
|
104
|
+
<bm-icon class=${`${f}icon`}
|
|
105
|
+
>${E(I)}</bm-icon
|
|
106
|
+
>
|
|
107
|
+
<slot>
|
|
108
|
+
<span class=${`${f}text`}
|
|
109
|
+
>Drag and drop or
|
|
110
|
+
<span class=${`${f}link`}>click</span> to
|
|
111
|
+
upload</span
|
|
112
|
+
>
|
|
113
|
+
</slot>
|
|
114
|
+
</div>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
r = /* @__PURE__ */ new WeakMap();
|
|
119
|
+
s.styles = [D(w), P];
|
|
120
|
+
o([
|
|
121
|
+
p({ type: Boolean })
|
|
122
|
+
], s.prototype, "error", 2);
|
|
123
|
+
o([
|
|
124
|
+
p({ type: String })
|
|
125
|
+
], s.prototype, "theme", 2);
|
|
126
|
+
o([
|
|
127
|
+
p({ type: Boolean })
|
|
128
|
+
], s.prototype, "disabled", 2);
|
|
129
|
+
o([
|
|
130
|
+
p({ type: String })
|
|
131
|
+
], s.prototype, "accept", 2);
|
|
132
|
+
o([
|
|
133
|
+
p({ type: String })
|
|
134
|
+
], s.prototype, "name", 2);
|
|
135
|
+
o([
|
|
136
|
+
p({ type: Boolean })
|
|
137
|
+
], s.prototype, "multiple", 2);
|
|
138
|
+
o([
|
|
139
|
+
$({ context: S, subscribe: !0 })
|
|
140
|
+
], s.prototype, "fileUploadContext", 2);
|
|
141
|
+
o([
|
|
142
|
+
b()
|
|
143
|
+
], s.prototype, "isDragging", 2);
|
|
144
|
+
s = o([
|
|
145
|
+
C("bm-file-upload-dropzone")
|
|
146
|
+
], s);
|
|
147
|
+
export {
|
|
148
|
+
s as BmFileUploadDropzone
|
|
149
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { c as B } from "../../chunks/consume.Ce9k1-wN.js";
|
|
2
|
+
import { r as T, a as M, x as r, E as u } from "../../chunks/lit-element.CJtt9wj5.js";
|
|
3
|
+
import { n as c, c as W } from "../../chunks/register-custom-element.vod7zfGv.js";
|
|
4
|
+
import { e as _, n as C } from "../../chunks/ref.B7e1Hu4F.js";
|
|
5
|
+
import { o as y } from "../../chunks/unsafe-svg.HSGf1NCU.js";
|
|
6
|
+
import { c as D, g as H } from "../../chunks/classNames.C6fNrXWF.js";
|
|
7
|
+
import { C as L, E as R } from "../../chunks/index.Bz1Jq4c2.js";
|
|
8
|
+
import { t as U, p as O } from "../../chunks/constants.jOWREYQE.js";
|
|
9
|
+
import { f as V } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
10
|
+
import { a as k, c as A } from "../../chunks/tokens.CTW8Tt94.js";
|
|
11
|
+
import { fileUploadListContext as Z } from "./FileUploadListContext.js";
|
|
12
|
+
import "../../Icon/Icon.js";
|
|
13
|
+
import "../../Tooltip/Tooltip.js";
|
|
14
|
+
import "../../CloseButton/CloseButton.js";
|
|
15
|
+
import "../../ProgressBar/ProgressBar.js";
|
|
16
|
+
const G = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
17
|
+
<g clip-path="url(#clip0_501_2445)">
|
|
18
|
+
<path
|
|
19
|
+
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"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
/>
|
|
22
|
+
</g>
|
|
23
|
+
<defs>
|
|
24
|
+
<clipPath id="clip0_501_2445">
|
|
25
|
+
<rect width="24" height="24" fill="none" />
|
|
26
|
+
</clipPath>
|
|
27
|
+
</defs>
|
|
28
|
+
</svg>
|
|
29
|
+
`;
|
|
30
|
+
var q = Object.defineProperty, J = Object.getOwnPropertyDescriptor, x = (t) => {
|
|
31
|
+
throw TypeError(t);
|
|
32
|
+
}, o = (t, e, s, m) => {
|
|
33
|
+
for (var n = m > 1 ? void 0 : m ? J(e, s) : e, $ = t.length - 1, v; $ >= 0; $--)
|
|
34
|
+
(v = t[$]) && (n = (m ? v(e, s, n) : v(n)) || n);
|
|
35
|
+
return m && n && q(e, s, n), n;
|
|
36
|
+
}, 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), p = (t, e, s) => (S(t, e, "access private method"), s), f, a, z, E, N, w, I, P, F, d;
|
|
37
|
+
const { baseClassNamePrefix: K, subElementClassPrefix: l, classModifierPrefix: b } = H("file-upload-list-item"), Q = {
|
|
38
|
+
error: { customIconColor: A, icon: R },
|
|
39
|
+
success: {
|
|
40
|
+
customIconColor: k,
|
|
41
|
+
icon: L
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
let i = class extends M {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments), g(this, a), this.error = "", this.size = "md", this.state = "uploaded", this.progress = 0, g(this, f, () => {
|
|
47
|
+
var t;
|
|
48
|
+
return !!(this.disabled || (t = this.listContext) != null && t.ctxDisabled);
|
|
49
|
+
}), this.tooltipRef = _(), this.fileNameRef = _(), g(this, d, () => {
|
|
50
|
+
var t;
|
|
51
|
+
return ((t = this.listContext) == null ? void 0 : t.ctxSize) ?? this.size ?? "md";
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
const { ctxThumbnail: t } = this.listContext ?? {}, e = t === !1 ? !1 : this.thumbnail ?? t ?? !1, s = D(
|
|
56
|
+
K,
|
|
57
|
+
this.theme && U(this.theme),
|
|
58
|
+
`${b}${h(this, d).call(this)}`,
|
|
59
|
+
`${b}${this.state}`,
|
|
60
|
+
h(this, f).call(this) && `${b}disabled`
|
|
61
|
+
);
|
|
62
|
+
return r`
|
|
63
|
+
<div class=${s}>
|
|
64
|
+
${p(this, a, z).call(this, e)}
|
|
65
|
+
<div class=${`${l}content`}>
|
|
66
|
+
<div class=${`${l}content-start`}>
|
|
67
|
+
${p(this, a, E).call(this)} ${p(this, a, N).call(this)} ${p(this, a, w).call(this)}
|
|
68
|
+
</div>
|
|
69
|
+
<div class=${`${l}content-end`}>
|
|
70
|
+
${p(this, a, I).call(this)} ${p(this, a, P).call(this)}
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
${p(this, a, F).call(this)}
|
|
74
|
+
</div>
|
|
75
|
+
`;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
79
|
+
a = /* @__PURE__ */ new WeakSet();
|
|
80
|
+
z = function(t) {
|
|
81
|
+
return t ? r`
|
|
82
|
+
<div class=${`${l}thumbnail`}>
|
|
83
|
+
${t === !0 ? r`<bm-icon
|
|
84
|
+
color="secondary"
|
|
85
|
+
icon="image"
|
|
86
|
+
size="${h(this, d).call(this) === "md" ? "sm" : "md"}"
|
|
87
|
+
>
|
|
88
|
+
${y(G)}
|
|
89
|
+
</bm-icon>` : r`<img src=${t} alt=${this.fileName} />`}
|
|
90
|
+
</div>
|
|
91
|
+
` : u;
|
|
92
|
+
};
|
|
93
|
+
E = function() {
|
|
94
|
+
return r`
|
|
95
|
+
<bm-tooltip @bm-toggle=${() => {
|
|
96
|
+
const e = this.fileNameRef.value, s = this.tooltipRef.value;
|
|
97
|
+
if (!e || !s)
|
|
98
|
+
return;
|
|
99
|
+
const { offsetWidth: m, scrollWidth: n } = e;
|
|
100
|
+
n <= m && (s.open = !1);
|
|
101
|
+
}} ${C(this.tooltipRef)}>
|
|
102
|
+
<span slot="text">${this.fileName}</span>
|
|
103
|
+
<span
|
|
104
|
+
slot="trigger"
|
|
105
|
+
class=${`${l}filename`}
|
|
106
|
+
${C(this.fileNameRef)}
|
|
107
|
+
>
|
|
108
|
+
${this.fileName}
|
|
109
|
+
</span>
|
|
110
|
+
</bm-tooltip>
|
|
111
|
+
`;
|
|
112
|
+
};
|
|
113
|
+
N = function() {
|
|
114
|
+
return r`<p class=${`${l}size`}>${this.fileSize}</p>`;
|
|
115
|
+
};
|
|
116
|
+
w = function() {
|
|
117
|
+
return !this.error || this.state !== "error" ? u : r` <bm-helper-text
|
|
118
|
+
hideIcon
|
|
119
|
+
appearance="negative"
|
|
120
|
+
size="sm"
|
|
121
|
+
class=${`${l}error`}
|
|
122
|
+
text=${this.error}
|
|
123
|
+
></bm-helper-text>`;
|
|
124
|
+
};
|
|
125
|
+
I = function() {
|
|
126
|
+
const t = Q[this.state];
|
|
127
|
+
return t ? r`<div class=${`${l}status`}>
|
|
128
|
+
<bm-icon customIconColor=${t.customIconColor} size="sm"
|
|
129
|
+
>${y(t.icon)}</bm-icon
|
|
130
|
+
>
|
|
131
|
+
</div>` : u;
|
|
132
|
+
};
|
|
133
|
+
P = function() {
|
|
134
|
+
const t = (e) => {
|
|
135
|
+
e.stopPropagation();
|
|
136
|
+
const s = new CustomEvent(`${O}dismiss`, {
|
|
137
|
+
bubbles: !0,
|
|
138
|
+
composed: !0
|
|
139
|
+
});
|
|
140
|
+
this.dispatchEvent(s);
|
|
141
|
+
};
|
|
142
|
+
return r`<bm-close-button
|
|
143
|
+
size="sm"
|
|
144
|
+
?disabled=${h(this, f).call(this)}
|
|
145
|
+
class=${`${l}remove`}
|
|
146
|
+
@click=${t}
|
|
147
|
+
></bm-button>`;
|
|
148
|
+
};
|
|
149
|
+
F = function() {
|
|
150
|
+
return this.state === "uploading" ? r`<bm-progress-bar
|
|
151
|
+
size="sm"
|
|
152
|
+
value=${this.progress}
|
|
153
|
+
state="active"
|
|
154
|
+
fullWidth
|
|
155
|
+
class=${`${l}progress-bar`}
|
|
156
|
+
progressbarAriaLabel="File upload progress"
|
|
157
|
+
></bm-progress-bar>` : u;
|
|
158
|
+
};
|
|
159
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
160
|
+
i.styles = T(V);
|
|
161
|
+
o([
|
|
162
|
+
c({ type: String })
|
|
163
|
+
], i.prototype, "error", 2);
|
|
164
|
+
o([
|
|
165
|
+
c({ type: String })
|
|
166
|
+
], i.prototype, "fileName", 2);
|
|
167
|
+
o([
|
|
168
|
+
c({ type: String })
|
|
169
|
+
], i.prototype, "fileSize", 2);
|
|
170
|
+
o([
|
|
171
|
+
c({ type: String })
|
|
172
|
+
], i.prototype, "size", 2);
|
|
173
|
+
o([
|
|
174
|
+
c({
|
|
175
|
+
type: String,
|
|
176
|
+
converter(t) {
|
|
177
|
+
return t === "true" || t === "" ? !0 : t === "false" ? !1 : t;
|
|
178
|
+
}
|
|
179
|
+
})
|
|
180
|
+
], i.prototype, "thumbnail", 2);
|
|
181
|
+
o([
|
|
182
|
+
c({ type: String })
|
|
183
|
+
], i.prototype, "state", 2);
|
|
184
|
+
o([
|
|
185
|
+
c({ type: Number })
|
|
186
|
+
], i.prototype, "progress", 2);
|
|
187
|
+
o([
|
|
188
|
+
c({ type: String })
|
|
189
|
+
], i.prototype, "theme", 2);
|
|
190
|
+
o([
|
|
191
|
+
c({ type: Boolean })
|
|
192
|
+
], i.prototype, "disabled", 2);
|
|
193
|
+
o([
|
|
194
|
+
B({ context: Z, subscribe: !0 })
|
|
195
|
+
], i.prototype, "listContext", 2);
|
|
196
|
+
i = o([
|
|
197
|
+
W("bm-file-upload-list-item")
|
|
198
|
+
], i);
|
|
199
|
+
export {
|
|
200
|
+
i as BmFileUploadListItem
|
|
201
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { e as f } from "../../chunks/provide.i2FlUkOu.js";
|
|
2
|
+
import { c as u } from "../../chunks/consume.Ce9k1-wN.js";
|
|
3
|
+
import { r as x, a as C, x as m } from "../../chunks/lit-element.CJtt9wj5.js";
|
|
4
|
+
import { n, c as b } from "../../chunks/register-custom-element.vod7zfGv.js";
|
|
5
|
+
import { c as g, g as v } from "../../chunks/classNames.C6fNrXWF.js";
|
|
6
|
+
import { t as y } from "../../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { f as _ } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
8
|
+
import { fileUploadContext as $ } from "./FileUploadContext.js";
|
|
9
|
+
import { fileUploadListContext as S } from "./FileUploadListContext.js";
|
|
10
|
+
import "./FileUpload.List.Item.js";
|
|
11
|
+
var U = Object.defineProperty, w = Object.getOwnPropertyDescriptor, h = (t) => {
|
|
12
|
+
throw TypeError(t);
|
|
13
|
+
}, a = (t, e, s, o) => {
|
|
14
|
+
for (var r = o > 1 ? void 0 : o ? w(e, s) : e, l = t.length - 1, p; l >= 0; l--)
|
|
15
|
+
(p = t[l]) && (r = (o ? p(e, s, r) : p(r)) || r);
|
|
16
|
+
return o && r && U(e, s, r), r;
|
|
17
|
+
}, 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;
|
|
18
|
+
const { baseClassNamePrefix: P, classModifierPrefix: c } = v("file-upload-list");
|
|
19
|
+
let i = class extends C {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), this.fileUploadContext = {}, N(this, d, () => {
|
|
22
|
+
var t;
|
|
23
|
+
return !!(this.disabled || (t = this.fileUploadContext) != null && t.ctxDisabled);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
willUpdate() {
|
|
27
|
+
this.listContext = {
|
|
28
|
+
ctxSize: this.size ?? "md",
|
|
29
|
+
ctxThumbnail: this.thumbnail,
|
|
30
|
+
ctxDisabled: E(this, d).call(this)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
internalRenderItem(t, e) {
|
|
34
|
+
return m`
|
|
35
|
+
<bm-file-upload-list-item
|
|
36
|
+
fileName=${t.fileName}
|
|
37
|
+
fileSize=${t.fileSize}
|
|
38
|
+
error=${t.error}
|
|
39
|
+
thumbnail=${t.thumbnail}
|
|
40
|
+
state=${t.state}
|
|
41
|
+
progress=${t.progress}
|
|
42
|
+
@bm-dismiss=${e}
|
|
43
|
+
></bm-file-upload-list-item>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
handleSlotChange(t) {
|
|
47
|
+
const s = t.target.assignedElements(), { ctxFileItems: o } = this.fileUploadContext ?? {};
|
|
48
|
+
o && (s.length > 0 && console.warn(
|
|
49
|
+
"Ignoring assigned elements in <bm-file-upload-list> when used inside a <bm-file-upload> component"
|
|
50
|
+
), s.forEach((r) => r.remove()));
|
|
51
|
+
}
|
|
52
|
+
render() {
|
|
53
|
+
const { ctxSize: t = "md", ctxDisabled: e } = this.listContext ?? {}, s = g(
|
|
54
|
+
P,
|
|
55
|
+
this.theme && y(this.theme),
|
|
56
|
+
`${c}${t || "md"}`,
|
|
57
|
+
e && `${c}disabled`
|
|
58
|
+
), { ctxFileItems: o, ctxDismissFile: r } = this.fileUploadContext ?? {};
|
|
59
|
+
return m`
|
|
60
|
+
<div class=${s}>
|
|
61
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
62
|
+
${o == null ? void 0 : o.map(
|
|
63
|
+
(l) => (this.renderItem ?? this.internalRenderItem)(
|
|
64
|
+
l,
|
|
65
|
+
() => r == null ? void 0 : r(l)
|
|
66
|
+
)
|
|
67
|
+
)}
|
|
68
|
+
</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
73
|
+
i.styles = x(_);
|
|
74
|
+
a([
|
|
75
|
+
n({
|
|
76
|
+
type: String,
|
|
77
|
+
converter(t) {
|
|
78
|
+
return t === "true" ? !0 : t === "false" ? !1 : t;
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
], i.prototype, "thumbnail", 2);
|
|
82
|
+
a([
|
|
83
|
+
n({ type: String })
|
|
84
|
+
], i.prototype, "size", 2);
|
|
85
|
+
a([
|
|
86
|
+
n({ type: String })
|
|
87
|
+
], i.prototype, "theme", 2);
|
|
88
|
+
a([
|
|
89
|
+
n({ type: Boolean })
|
|
90
|
+
], i.prototype, "disabled", 2);
|
|
91
|
+
a([
|
|
92
|
+
n({ type: Function })
|
|
93
|
+
], i.prototype, "renderItem", 2);
|
|
94
|
+
a([
|
|
95
|
+
f({ context: S })
|
|
96
|
+
], i.prototype, "listContext", 2);
|
|
97
|
+
a([
|
|
98
|
+
u({ context: $, subscribe: !0 })
|
|
99
|
+
], i.prototype, "fileUploadContext", 2);
|
|
100
|
+
i = a([
|
|
101
|
+
b("bm-file-upload-list")
|
|
102
|
+
], i);
|
|
103
|
+
export {
|
|
104
|
+
i as BmFileUploadList
|
|
105
|
+
};
|