@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,55 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
3
|
+
import { InputChoiceGroupContextProps } from '../../InputChoiceGroup/InputChoiceGroup.context';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-checkbox`
|
|
6
|
+
*/
|
|
7
|
+
export declare class BmCheckbox extends LitElement {
|
|
8
|
+
#private;
|
|
9
|
+
static styles: import('lit').CSSResult;
|
|
10
|
+
/**
|
|
11
|
+
* Specify the theme of the CloseButton. By default it inherits the theme from the parent
|
|
12
|
+
*/
|
|
13
|
+
theme?: ThemeTypes;
|
|
14
|
+
/**
|
|
15
|
+
* Specify the text for the label
|
|
16
|
+
*/
|
|
17
|
+
label?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the checkbox name
|
|
20
|
+
*/
|
|
21
|
+
name?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Specify the checkbox value
|
|
24
|
+
*/
|
|
25
|
+
value?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Specify error text and display error state of a Checkbox
|
|
28
|
+
*/
|
|
29
|
+
error?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Specify if Checkbox displays in a read-only state
|
|
32
|
+
*/
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Specify if Checkbox displays in an indeterminate state
|
|
36
|
+
*/
|
|
37
|
+
indeterminate?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Specify if Checkbox displays in disabled state
|
|
40
|
+
*/
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Specify if Checkbox is checked
|
|
44
|
+
*/
|
|
45
|
+
checked?: boolean;
|
|
46
|
+
inputChoiceGroupContext?: InputChoiceGroupContextProps;
|
|
47
|
+
clickHandler(event: Event): void;
|
|
48
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
'bm-checkbox': BmCheckbox;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { consume as k } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as y, LitElement as _, nothing as u, html as h } from "lit";
|
|
3
|
+
import { property as m } from "lit/decorators.js";
|
|
4
|
+
import w from "clsx";
|
|
5
|
+
import { g as z } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import { t as C } from "../../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { r as S } from "../../chunks/delegate.baxDQosr.js";
|
|
8
|
+
import { c as $ } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import { inputChoiceGroupContext as P } from "../../InputChoiceGroup/InputChoiceGroup.context.js";
|
|
10
|
+
const O = `:root,:host,.bm-light,.bm-dark .bm-inverse,[data-bm-theme~=bm-light]{--bm-comp-input-color-bg: var(--bm-sem-color-surface-01, #ffffff);--bm-comp-input-color-bg-disabled: var( --bm-sem-color-surface-highlight, rgba(159, 175, 188, .16) );--bm-comp-input-color-border: var(--bm-sem-color-border-strong, #8697a5);--bm-comp-input-color-border-error: var( --bm-sem-color-border-negative-strong, #cc2429 );--bm-comp-input-color-border-disabled: rgba(134, 151, 165, .4);--bm-comp-input-color-text: var(--bm-sem-color-text-primary, #141d24);--bm-comp-input-color-text-placeholder: var( --bm-sem-color-text-secondary, #576775 );--bm-comp-input-color-text-disabled: var( --bm-sem-color-text-disabled, rgba(87, 103, 117, .4) );--bm-comp-input-color-icon-disabled: var( --bm-sem-color-text-disabled, rgba(87, 103, 117, .4) );--bm-comp-input-color-icon: var(--bm-sem-color-icon-secondary, #576775);--bm-comp-input-color-icon-error: var( --bm-sem-color-icon-negative-strong, #cc2429 );--bm-comp-input-color-divider: var(--bm-sem-color-border-02, #d1dae0);--bm-comp-input-color-choice-checkbox-selected-bg: var( --bm-utility-color-accent-default, #00768f );--bm-comp-input-color-choice-checkbox-selected-icon: var( --bm-sem-color-icon-primary-inverse, #ffffff );--bm-comp-input-color-choice-checkbox-selected-bg-error: var( --bm-sem-color-surface-negative-strong, #cc2429 );--bm-comp-input-color-choice-checkbox-selected-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-input-color-choice-switch-selected-bg: var( --bm-utility-color-accent-default, #00768f );--bm-comp-input-color-choice-switch-selected-icon: var( --bm-sem-color-icon-primary-inverse, #ffffff );--bm-comp-input-color-choice-switch-selected-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-input-color-choice-radio-selected-bg: var( --bm-sem-color-surface-01, #ffffff );--bm-comp-input-color-choice-radio-selected-border: var( --bm-utility-color-accent-default, #00768f );--bm-comp-input-color-choice-radio-selected-inner-circle: var( --bm-utility-color-accent-default, #00768f );--bm-comp-input-color-choice-radio-selected-bg-error: var( --bm-sem-color-surface-01, #ffffff );--bm-comp-input-color-choice-radio-selected-border-error: var( --bm-sem-color-surface-negative-strong, #cc2429 );--bm-comp-input-color-choice-radio-selected-inner-circle-error: var( --bm-sem-color-surface-negative-strong, #cc2429 );--bm-comp-input-typo-default: var( --bm-sem-typo-compact-body-md, 400 1rem/1.25rem "Source Sans Pro" );--bm-comp-input-typo-character-count: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-input-typo-label-choice: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-input-space-field-x: var(--bm-sem-space-100, 1rem);--bm-comp-input-space-field-y: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-field-gap: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-inside: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-items-y: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-items-x: var(--bm-sem-space-100, 1rem);--bm-comp-input-space-choice-nudge: var( --bm-primitive-dimension-12, .125rem );--bm-comp-input-size-field-md-height: var(--bm-sem-size-height-md, 2.5rem);--bm-comp-input-size-field-width: var(--bm-primitive-dimension-1800, 18rem);--bm-comp-input-size-field-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-input-size-field-text-area-height: var( --bm-primitive-dimension-475, 4.75rem );--bm-comp-input-size-choice-checkbox: var(--bm-sem-size-icon-sm, 1rem);--bm-comp-input-size-choice-radio: var(--bm-sem-size-icon-sm, 1rem);--bm-comp-input-size-choice-radio-inside: var( --bm-primitive-dimension-50, .5rem );--bm-comp-input-size-choice-switch-height: var( --bm-sem-size-icon-md, 1.25rem );--bm-comp-input-size-choice-switch-width: var( --bm-primitive-dimension-250, 2.5rem );--bm-comp-input-size-choice-switch-knob: var( --bm-primitive-dimension-87, .875rem );--bm-comp-input-radius-field: var(--bm-sem-radius-input-md, .25rem);--bm-comp-input-radius-choice-checkbox: var( --bm-sem-radius-input-sm, .125rem );--bm-comp-input-radius-choice-radio: var( --bm-sem-radius-input-lg, 624.938rem );--bm-comp-input-radius-choice-switch: var( --bm-sem-radius-input-lg, 624.938rem );--bm-comp-input-border-width-field-default: var( --bm-sem-border-width-input, .063rem );--bm-comp-input-border-width-field-error: var( --bm-sem-border-width-lg, .125rem );--bm-comp-input-border-width-choice: var( --bm-sem-border-width-input, .063rem );--bm-comp-input-shadow-field: 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-input-color-bg: var(--bm-sem-color-surface-01, #202e39);--bm-comp-input-color-bg-disabled: var( --bm-sem-color-surface-highlight, rgba(134, 151, 165, .16) );--bm-comp-input-color-border: var(--bm-sem-color-border-strong, #9fafbc);--bm-comp-input-color-border-error: var( --bm-sem-color-border-negative-strong, #f67378 );--bm-comp-input-color-border-disabled: rgba(159, 175, 188, .4);--bm-comp-input-color-text: var(--bm-sem-color-text-primary, #ffffff);--bm-comp-input-color-text-placeholder: var( --bm-sem-color-text-secondary, #c3cdd5 );--bm-comp-input-color-text-disabled: var( --bm-sem-color-text-disabled, rgba(195, 205, 213, .4) );--bm-comp-input-color-icon-disabled: var( --bm-sem-color-text-disabled, rgba(195, 205, 213, .4) );--bm-comp-input-color-icon: var(--bm-sem-color-icon-secondary, #c3cdd5);--bm-comp-input-color-icon-error: var( --bm-sem-color-icon-negative-strong, #f67378 );--bm-comp-input-color-divider: var(--bm-sem-color-border-02, #465967);--bm-comp-input-color-choice-checkbox-selected-bg: var( --bm-utility-color-accent-default, #43bfd6 );--bm-comp-input-color-choice-checkbox-selected-icon: var( --bm-sem-color-icon-primary-inverse, #141d24 );--bm-comp-input-color-choice-checkbox-selected-bg-error: var( --bm-sem-color-surface-negative-strong, #f67378 );--bm-comp-input-color-choice-checkbox-selected-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-input-color-choice-switch-selected-bg: var( --bm-utility-color-accent-default, #43bfd6 );--bm-comp-input-color-choice-switch-selected-icon: var( --bm-sem-color-icon-primary-inverse, #141d24 );--bm-comp-input-color-choice-switch-selected-border: var( --bm-sem-color-none, #ffffff00 );--bm-comp-input-color-choice-radio-selected-bg: var( --bm-sem-color-surface-01, #202e39 );--bm-comp-input-color-choice-radio-selected-border: var( --bm-utility-color-accent-default, #43bfd6 );--bm-comp-input-color-choice-radio-selected-inner-circle: var( --bm-utility-color-accent-default, #43bfd6 );--bm-comp-input-color-choice-radio-selected-bg-error: var( --bm-sem-color-surface-01, #202e39 );--bm-comp-input-color-choice-radio-selected-border-error: var( --bm-sem-color-surface-negative-strong, #f67378 );--bm-comp-input-color-choice-radio-selected-inner-circle-error: var( --bm-sem-color-surface-negative-strong, #f67378 );--bm-comp-input-typo-default: var( --bm-sem-typo-compact-body-md, 400 1rem/1.25rem "Source Sans Pro" );--bm-comp-input-typo-character-count: var( --bm-sem-typo-body-sm, 400 .875rem/1.25rem "Source Sans Pro" );--bm-comp-input-typo-label-choice: var( --bm-sem-typo-body-md, 400 1rem/1.5rem "Source Sans Pro" );--bm-comp-input-space-field-x: var(--bm-sem-space-100, 1rem);--bm-comp-input-space-field-y: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-field-gap: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-inside: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-items-y: var(--bm-sem-space-50, .5rem);--bm-comp-input-space-choice-gap-items-x: var(--bm-sem-space-100, 1rem);--bm-comp-input-space-choice-nudge: var( --bm-primitive-dimension-12, .125rem );--bm-comp-input-size-field-md-height: var(--bm-sem-size-height-md, 2.5rem);--bm-comp-input-size-field-width: var(--bm-primitive-dimension-1800, 18rem);--bm-comp-input-size-field-icon: var(--bm-sem-size-icon-md, 1.25rem);--bm-comp-input-size-field-text-area-height: var( --bm-primitive-dimension-475, 4.75rem );--bm-comp-input-size-choice-checkbox: var(--bm-sem-size-icon-sm, 1rem);--bm-comp-input-size-choice-radio: var(--bm-sem-size-icon-sm, 1rem);--bm-comp-input-size-choice-radio-inside: var( --bm-primitive-dimension-50, .5rem );--bm-comp-input-size-choice-switch-height: var( --bm-sem-size-icon-md, 1.25rem );--bm-comp-input-size-choice-switch-width: var( --bm-primitive-dimension-250, 2.5rem );--bm-comp-input-size-choice-switch-knob: var( --bm-primitive-dimension-87, .875rem );--bm-comp-input-radius-field: var(--bm-sem-radius-input-md, .25rem);--bm-comp-input-radius-choice-checkbox: var( --bm-sem-radius-input-sm, .125rem );--bm-comp-input-radius-choice-radio: var( --bm-sem-radius-input-lg, 624.938rem );--bm-comp-input-radius-choice-switch: var( --bm-sem-radius-input-lg, 624.938rem );--bm-comp-input-border-width-field-default: var( --bm-sem-border-width-input, .063rem );--bm-comp-input-border-width-field-error: var( --bm-sem-border-width-lg, .125rem );--bm-comp-input-border-width-choice: var( --bm-sem-border-width-input, .063rem );--bm-comp-input-shadow-field: var( --bm-sem-shadow-none, 0 0 0 0 rgb(0, 0, 0, 0) )}.bm-checkbox{display:inline-flex}.bm-checkbox--read-only{--bm-input-choice-cursor: default;--bm-input-choice-label-cursor: default;--bm-input-choice-label-pointer-events: none}.bm-checkbox--disabled{--bm-input-choice-cursor: not-allowed;--bm-input-choice-label-cursor: not-allowed}.bm-checkbox__label{display:inherit;word-break:break-word;color:var(--bm-comp-input-color-text);font:var(--bm-comp-input-typo-default);gap:var(--bm-comp-input-space-choice-gap-inside);cursor:var(--bm-input-choice-label-cursor, pointer)}.bm-checkbox--with-label .bm-checkbox__label .bm-checkbox__input{margin:var(--bm-comp-input-space-choice-nudge) var(--bm-sem-space-0)}.bm-checkbox--error .bm-checkbox__label{color:var(--bm-comp-input-color-text)}.bm-checkbox--error .bm-checkbox__label .bm-checkbox__input{border-color:var(--bm-comp-input-color-border-error);background-color:var(--bm-comp-input-color-bg)}.bm-checkbox--error .bm-checkbox__label .bm-checkbox__input:checked{background-color:var(--bm-comp-input-color-choice-checkbox-selected-bg-error)}.bm-checkbox--read-only .bm-checkbox__label{color:var(--bm-comp-input-color-text)}.bm-checkbox--read-only .bm-checkbox__label .bm-checkbox__input{border-color:var(--bm-comp-input-color-border-disabled);background-color:var(--bm-comp-input-color-bg-disabled)}.bm-checkbox--read-only .bm-checkbox__label .bm-checkbox__input:checked{background-color:var(--bm-comp-input-color-icon)}.bm-checkbox--disabled .bm-checkbox__label{color:var(--bm-comp-input-color-text-disabled)}.bm-checkbox--disabled .bm-checkbox__label .bm-checkbox__input{border-color:var(--bm-comp-input-color-border-disabled);background-color:var(--bm-comp-input-color-bg-disabled)}.bm-checkbox--disabled .bm-checkbox__label .bm-checkbox__input:checked{background-color:var(--bm-comp-input-color-icon-disabled)}.bm-checkbox__label .bm-checkbox__input{appearance:none;-moz-appearance:none;-webkit-appearance:none;position:relative;margin:var(--bm-sem-space-0);flex-shrink:var(--bm-sem-space-0);width:var(--bm-comp-input-size-choice-checkbox);height:var(--bm-comp-input-size-choice-checkbox);background-color:var(--bm-comp-input-color-bg);cursor:var(--bm-input-choice-cursor, pointer);box-sizing:border-box;border-style:solid;border-color:var(--bm-comp-input-color-border);border-radius:var(--bm-comp-input-radius-choice-checkbox);border-width:var(--bm-comp-input-border-width-field-default)}.bm-checkbox__label .bm-checkbox__input:focus-visible{outline-offset:var(--bm-sem-size-focus-offset);outline:var(--bm-sem-border-width-focus) solid var(--bm-sem-color-border-focus)}.bm-checkbox__label .bm-checkbox__input:checked{background-color:var(--bm-comp-input-color-choice-checkbox-selected-bg);border-color:var(--bm-comp-input-color-choice-checkbox-selected-border)}.bm-checkbox__label .bm-checkbox__input:checked:after{-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.178 7.363.808 4.697 0 5.598l3.178 3.573L10 1.501 9.198.6l-6.02 6.763Z' fill='%23fff'/%3E%3C/svg%3E");-webkit-mask-size:cover;-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.178 7.363.808 4.697 0 5.598l3.178 3.573L10 1.501 9.198.6l-6.02 6.763Z' fill='%23fff'/%3E%3C/svg%3E");mask-size:cover;mask-position:center;mask-repeat:no-repeat;content:"";background-color:var(--bm-comp-input-color-choice-checkbox-selected-icon);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:calc(var(--bm-comp-input-size-choice-checkbox) * 5 / 8);height:calc(var(--bm-comp-input-size-choice-checkbox) * 5 / 8)}.bm-checkbox--indeterminate .bm-checkbox__input:checked:after{height:2px;width:50%;border-radius:var(--bm-comp-input-size-choice-checkbox);-webkit-mask-image:none;mask-image:none}`;
|
|
11
|
+
var E = Object.defineProperty, B = Object.getOwnPropertyDescriptor, f = (e) => {
|
|
12
|
+
throw TypeError(e);
|
|
13
|
+
}, i = (e, o, r, b) => {
|
|
14
|
+
for (var t = b > 1 ? void 0 : b ? B(o, r) : o, a = e.length - 1, p; a >= 0; a--)
|
|
15
|
+
(p = e[a]) && (t = (b ? p(o, r, t) : p(t)) || t);
|
|
16
|
+
return b && t && E(o, r, t), t;
|
|
17
|
+
}, L = (e, o, r) => o.has(e) || f("Cannot " + r), M = (e, o, r) => (L(e, o, "read from private field"), r ? r.call(e) : o.get(e)), D = (e, o, r) => o.has(e) ? f("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, r), n;
|
|
18
|
+
const { baseClassNamePrefix: G, subElementClassPrefix: v, classModifierPrefix: s } = z("checkbox");
|
|
19
|
+
let c = class extends _ {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments), this.readOnly = !1, this.indeterminate = !1, this.disabled = !1, this.checked = !1, D(this, n, () => this.label ? h`<span>${this.label}</span>` : u);
|
|
22
|
+
}
|
|
23
|
+
clickHandler(e) {
|
|
24
|
+
this.readOnly && (e.preventDefault(), e.stopPropagation());
|
|
25
|
+
}
|
|
26
|
+
render() {
|
|
27
|
+
const { ariaInvalid: e, ariaLabel: o } = this, r = !!e || !!this.error, {
|
|
28
|
+
required: b,
|
|
29
|
+
error: t,
|
|
30
|
+
readOnly: a,
|
|
31
|
+
disabled: p,
|
|
32
|
+
name: g
|
|
33
|
+
} = this.inputChoiceGroupContext || {}, l = this.disabled || p, d = this.readOnly || a, x = w(
|
|
34
|
+
G,
|
|
35
|
+
this.theme && C(this.theme),
|
|
36
|
+
(this.error || t) && `${s}error`,
|
|
37
|
+
this.label && `${s}with-label`,
|
|
38
|
+
l && `${s}disabled`,
|
|
39
|
+
d && `${s}read-only`,
|
|
40
|
+
this.indeterminate && `${s}indeterminate`
|
|
41
|
+
);
|
|
42
|
+
return h`
|
|
43
|
+
<div class="${x}">
|
|
44
|
+
<label tabindex="{-1}" class="${v}label">
|
|
45
|
+
<input
|
|
46
|
+
type="checkbox"
|
|
47
|
+
name=${g}
|
|
48
|
+
value=${this.value}
|
|
49
|
+
id=${this.id}
|
|
50
|
+
?checked=${this.checked}
|
|
51
|
+
?required=${b}
|
|
52
|
+
?disabled=${l}
|
|
53
|
+
?readOnly=${d}
|
|
54
|
+
class="${v}input"
|
|
55
|
+
@click=${this.clickHandler}
|
|
56
|
+
aria-label=${o}
|
|
57
|
+
aria-invalid=${r || u}
|
|
58
|
+
/>
|
|
59
|
+
${M(this, n).call(this)}
|
|
60
|
+
</label>
|
|
61
|
+
</div>
|
|
62
|
+
`;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
n = /* @__PURE__ */ new WeakMap();
|
|
66
|
+
S(c);
|
|
67
|
+
c.styles = y(O);
|
|
68
|
+
i([
|
|
69
|
+
m({ type: String })
|
|
70
|
+
], c.prototype, "theme", 2);
|
|
71
|
+
i([
|
|
72
|
+
m({ type: String })
|
|
73
|
+
], c.prototype, "label", 2);
|
|
74
|
+
i([
|
|
75
|
+
m({ type: String })
|
|
76
|
+
], c.prototype, "name", 2);
|
|
77
|
+
i([
|
|
78
|
+
m({ type: String })
|
|
79
|
+
], c.prototype, "value", 2);
|
|
80
|
+
i([
|
|
81
|
+
m({ type: Boolean })
|
|
82
|
+
], c.prototype, "error", 2);
|
|
83
|
+
i([
|
|
84
|
+
m({ type: Boolean })
|
|
85
|
+
], c.prototype, "readOnly", 2);
|
|
86
|
+
i([
|
|
87
|
+
m({ type: Boolean })
|
|
88
|
+
], c.prototype, "indeterminate", 2);
|
|
89
|
+
i([
|
|
90
|
+
m({ type: Boolean })
|
|
91
|
+
], c.prototype, "disabled", 2);
|
|
92
|
+
i([
|
|
93
|
+
m({ type: Boolean })
|
|
94
|
+
], c.prototype, "checked", 2);
|
|
95
|
+
i([
|
|
96
|
+
k({ context: P, subscribe: !0 }),
|
|
97
|
+
m({ attribute: !1 })
|
|
98
|
+
], c.prototype, "inputChoiceGroupContext", 2);
|
|
99
|
+
c = i([
|
|
100
|
+
$("bm-checkbox")
|
|
101
|
+
], c);
|
|
102
|
+
export {
|
|
103
|
+
c as BmCheckbox
|
|
104
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputChoiceGroup } from '../../../InputChoiceGroup/InputChoiceGroup';
|
|
2
|
+
export declare class BmCheckboxGroup extends InputChoiceGroup {
|
|
3
|
+
protected handleKeyDown(event: KeyboardEvent): void;
|
|
4
|
+
protected handleClick(event: MouseEvent): void;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'bm-checkbox-group': BmCheckboxGroup;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { r as i } from "../../../chunks/delegate.baxDQosr.js";
|
|
2
|
+
import { c as p } from "../../../chunks/register-custom-element.DHGKOhmA.js";
|
|
3
|
+
import { InputChoiceGroup as h } from "../../../InputChoiceGroup/InputChoiceGroup.js";
|
|
4
|
+
var u = Object.getOwnPropertyDescriptor, c = (e, a, l, n) => {
|
|
5
|
+
for (var r = n > 1 ? void 0 : n ? u(a, l) : a, t = e.length - 1, o; t >= 0; t--)
|
|
6
|
+
(o = e[t]) && (r = o(r) || r);
|
|
7
|
+
return r;
|
|
8
|
+
};
|
|
9
|
+
let s = class extends h {
|
|
10
|
+
handleKeyDown(e) {
|
|
11
|
+
this.readOnly || this.disabled || super.handleKeyDown(e);
|
|
12
|
+
}
|
|
13
|
+
handleClick(e) {
|
|
14
|
+
if (this.readOnly || this.disabled) {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
super.handleClick(e);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
i(s);
|
|
22
|
+
s = c([
|
|
23
|
+
p("bm-checkbox-group")
|
|
24
|
+
], s);
|
|
25
|
+
export {
|
|
26
|
+
s as BmCheckboxGroup
|
|
27
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { BmButton } from '../../Button/Button';
|
|
3
|
+
/**
|
|
4
|
+
* `bm-file-upload-button`
|
|
5
|
+
*
|
|
6
|
+
* @slot default - Specify text for the Button
|
|
7
|
+
*/
|
|
8
|
+
export declare class BmFileUploadButton extends BmButton {
|
|
9
|
+
static styles: import('lit').CSSResult[];
|
|
10
|
+
/**
|
|
11
|
+
* Specify if FileUpload is in error state
|
|
12
|
+
*/
|
|
13
|
+
error?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Specify the accepted file types
|
|
16
|
+
*/
|
|
17
|
+
accept?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Specify if multiple files can be uploaded
|
|
20
|
+
*/
|
|
21
|
+
multiple?: boolean;
|
|
22
|
+
private fileUploadContext?;
|
|
23
|
+
private fileInputRef;
|
|
24
|
+
private handleInputChange;
|
|
25
|
+
private openFileDialog;
|
|
26
|
+
constructor();
|
|
27
|
+
protected willUpdate(changedProperties: PropertyValues): void;
|
|
28
|
+
private renderBmButtonWithAdditionalClassName;
|
|
29
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
30
|
+
}
|
|
31
|
+
declare global {
|
|
32
|
+
interface HTMLElementTagNameMap {
|
|
33
|
+
'bm-file-upload-button': BmFileUploadButton;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=FileUpload.Button.d.ts.map
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { consume as c } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as d, html as h } from "lit";
|
|
3
|
+
import { property as n } from "lit/decorators.js";
|
|
4
|
+
import { createRef as u, ref as C } from "lit/directives/ref.js";
|
|
5
|
+
import { unsafeSVG as b } from "lit/directives/unsafe-svg.js";
|
|
6
|
+
import f from "clsx";
|
|
7
|
+
import { U as g } from "../../chunks/Upload.B9YEyp7b.js";
|
|
8
|
+
import { g as x } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
9
|
+
import { t as y } from "../../chunks/constants.jOWREYQE.js";
|
|
10
|
+
import { f as B } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
11
|
+
import { c as _ } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
12
|
+
import { BmButton as U } from "../../Button/Button.js";
|
|
13
|
+
import { fileUploadContext as v } from "./FileUploadContext.js";
|
|
14
|
+
var N = Object.defineProperty, O = Object.getOwnPropertyDescriptor, P = Object.getPrototypeOf, $ = Reflect.get, a = (e, t, s, l) => {
|
|
15
|
+
for (var o = l > 1 ? void 0 : l ? O(t, s) : t, r = e.length - 1, p; r >= 0; r--)
|
|
16
|
+
(p = e[r]) && (o = (l ? p(t, s, o) : p(o)) || o);
|
|
17
|
+
return l && o && N(t, s, o), o;
|
|
18
|
+
}, I = (e, t, s) => $(P(e), s, t);
|
|
19
|
+
const { baseClassNamePrefix: R, classModifierPrefix: m } = x("file-upload-button");
|
|
20
|
+
let i = class extends U {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(), this.fileUploadContext = {}, this.fileInputRef = u(), this.appearance = "neutral-subtle", this.kind = "outline", this.size = "md", this.iconOnly = !1, this.defaultIcons.iconBefore = b(g), this.addEventListener("click", () => this.openFileDialog());
|
|
23
|
+
}
|
|
24
|
+
handleInputChange(e) {
|
|
25
|
+
var t, s;
|
|
26
|
+
e.target.files && ((s = (t = this.fileUploadContext) == null ? void 0 : t.ctxAddFiles) == null || s.call(t, e.target.files));
|
|
27
|
+
}
|
|
28
|
+
openFileDialog() {
|
|
29
|
+
var e;
|
|
30
|
+
(e = this.fileInputRef.value) == null || e.click();
|
|
31
|
+
}
|
|
32
|
+
willUpdate(e) {
|
|
33
|
+
super.willUpdate(e), this.defaultLabel = this.multiple ? "Choose files" : "Choose file";
|
|
34
|
+
}
|
|
35
|
+
renderBmButtonWithAdditionalClassName(e) {
|
|
36
|
+
const t = this.className;
|
|
37
|
+
this.className = f(e, t);
|
|
38
|
+
const s = super.render();
|
|
39
|
+
return this.className = t, s;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const { ctxAccept: e, ctxMultiple: t } = this.fileUploadContext ?? {}, s = this.accept || e, l = this.multiple || t, o = f(
|
|
43
|
+
R,
|
|
44
|
+
this.theme && y(this.theme),
|
|
45
|
+
this.disabled && `${m}disabled`,
|
|
46
|
+
this.error && `${m}error`
|
|
47
|
+
), r = this.renderBmButtonWithAdditionalClassName(o);
|
|
48
|
+
return h`<input
|
|
49
|
+
${C(this.fileInputRef)}
|
|
50
|
+
hidden
|
|
51
|
+
type="file"
|
|
52
|
+
accept=${s}
|
|
53
|
+
?multiple=${l}
|
|
54
|
+
@change=${this.handleInputChange}
|
|
55
|
+
?disabled=${this.disabled}
|
|
56
|
+
/>${r}`;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
i.styles = [...I(i, i, "styles"), d(B)];
|
|
60
|
+
a([
|
|
61
|
+
n({ type: Boolean })
|
|
62
|
+
], i.prototype, "error", 2);
|
|
63
|
+
a([
|
|
64
|
+
n({ type: String })
|
|
65
|
+
], i.prototype, "accept", 2);
|
|
66
|
+
a([
|
|
67
|
+
n({ type: Boolean })
|
|
68
|
+
], i.prototype, "multiple", 2);
|
|
69
|
+
a([
|
|
70
|
+
c({ context: v, subscribe: !0 })
|
|
71
|
+
], i.prototype, "fileUploadContext", 2);
|
|
72
|
+
i = a([
|
|
73
|
+
_("bm-file-upload-button")
|
|
74
|
+
], i);
|
|
75
|
+
export {
|
|
76
|
+
i as BmFileUploadButton
|
|
77
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
3
|
+
/**
|
|
4
|
+
* `bm-file-upload-dropzone`
|
|
5
|
+
*
|
|
6
|
+
* @slot default - Specify text for the Dropzone
|
|
7
|
+
*/
|
|
8
|
+
export declare class BmFileUploadDropzone extends LitElement {
|
|
9
|
+
#private;
|
|
10
|
+
static styles: import('lit').CSSResult[];
|
|
11
|
+
/**
|
|
12
|
+
* Specify if FileUpload is in error state
|
|
13
|
+
*/
|
|
14
|
+
error?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Specify the theme of the FileUpload. By default it inherits the theme from the parent
|
|
17
|
+
*/
|
|
18
|
+
theme?: ThemeTypes;
|
|
19
|
+
/**
|
|
20
|
+
* Specify if the FileUpload is disabled
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Specify the accepted file types
|
|
25
|
+
*/
|
|
26
|
+
accept?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Specify the name of the FileUpload
|
|
29
|
+
*/
|
|
30
|
+
name?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Specify if multiple files can be uploaded
|
|
33
|
+
*/
|
|
34
|
+
multiple?: boolean;
|
|
35
|
+
private fileUploadContext?;
|
|
36
|
+
private isDragging;
|
|
37
|
+
private fileInputRef;
|
|
38
|
+
private handleInputChange;
|
|
39
|
+
private handleDropFiles;
|
|
40
|
+
private handleKeyDown;
|
|
41
|
+
private rootDivRef;
|
|
42
|
+
focus(): void;
|
|
43
|
+
private handleClick;
|
|
44
|
+
private handleDragStart;
|
|
45
|
+
private handleDragEnter;
|
|
46
|
+
private handleDragLeave;
|
|
47
|
+
private handleDragOver;
|
|
48
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
'bm-file-upload-dropzone': BmFileUploadDropzone;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=FileUpload.Dropzone.d.ts.map
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { consume as y } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as D, LitElement as v, nothing as $, html as x } from "lit";
|
|
3
|
+
import { property as p, state as C } from "lit/decorators.js";
|
|
4
|
+
import { createRef as u, ref as g } from "lit/directives/ref.js";
|
|
5
|
+
import { unsafeSVG as b } from "lit/directives/unsafe-svg.js";
|
|
6
|
+
import E from "clsx";
|
|
7
|
+
import { U as _ } from "../../chunks/Upload.B9YEyp7b.js";
|
|
8
|
+
import { g as R } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
9
|
+
import { t as S } from "../../chunks/constants.jOWREYQE.js";
|
|
10
|
+
import { f as I } from "../../chunks/fileUpload.module.kN6o64aL.js";
|
|
11
|
+
import { c as U } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
12
|
+
import { stateLayerStyles as w, stateLayerClassName as P } from "../../StateLayer/StateLayer.js";
|
|
13
|
+
import { fileUploadContext as k } from "./FileUploadContext.js";
|
|
14
|
+
import "../../Icon/Icon.js";
|
|
15
|
+
var T = Object.defineProperty, B = Object.getOwnPropertyDescriptor, m = (e) => {
|
|
16
|
+
throw TypeError(e);
|
|
17
|
+
}, o = (e, t, a, n) => {
|
|
18
|
+
for (var s = n > 1 ? void 0 : n ? B(t, a) : t, f = e.length - 1, d; f >= 0; f--)
|
|
19
|
+
(d = e[f]) && (s = (n ? d(t, a, s) : d(s)) || s);
|
|
20
|
+
return n && s && T(t, a, s), s;
|
|
21
|
+
}, 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)), L = (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;
|
|
22
|
+
const { baseClassNamePrefix: N, classModifierPrefix: c, subElementClassPrefix: h } = R("file-upload-dropzone");
|
|
23
|
+
let i = class extends v {
|
|
24
|
+
constructor() {
|
|
25
|
+
super(...arguments), this.disabled = !1, this.fileUploadContext = {}, this.isDragging = !1, this.fileInputRef = u(), L(this, r, () => {
|
|
26
|
+
var e;
|
|
27
|
+
return !!(this.disabled || (e = this.fileUploadContext) != null && e.ctxDisabled);
|
|
28
|
+
}), this.rootDivRef = u();
|
|
29
|
+
}
|
|
30
|
+
handleInputChange(e) {
|
|
31
|
+
var t, a;
|
|
32
|
+
e.target.files && ((a = (t = this.fileUploadContext) == null ? void 0 : t.ctxAddFiles) == null || a.call(t, e.target.files));
|
|
33
|
+
}
|
|
34
|
+
handleDropFiles(e) {
|
|
35
|
+
var a;
|
|
36
|
+
if (e.preventDefault(), e.stopPropagation(), this.isDragging = !1, l(this, r).call(this) || !this.fileInputRef.value)
|
|
37
|
+
return;
|
|
38
|
+
this.fileInputRef.value.value = "", this.fileInputRef.value.files = ((a = e.dataTransfer) == null ? void 0 : a.files) ?? null;
|
|
39
|
+
const t = new Event("change", {
|
|
40
|
+
bubbles: !0
|
|
41
|
+
});
|
|
42
|
+
this.fileInputRef.value.dispatchEvent(t);
|
|
43
|
+
}
|
|
44
|
+
handleKeyDown(e) {
|
|
45
|
+
var t;
|
|
46
|
+
l(this, r).call(this) || (e.key === "Enter" || e.key === " ") && (e.preventDefault(), (t = this.fileInputRef.value) == null || t.click());
|
|
47
|
+
}
|
|
48
|
+
focus() {
|
|
49
|
+
var e;
|
|
50
|
+
(e = this.rootDivRef.value) == null || e.focus();
|
|
51
|
+
}
|
|
52
|
+
handleClick(e) {
|
|
53
|
+
var t;
|
|
54
|
+
l(this, r).call(this) ? (e.preventDefault(), e.stopPropagation()) : (t = this.fileInputRef.value) == null || t.click();
|
|
55
|
+
}
|
|
56
|
+
handleDragStart(e) {
|
|
57
|
+
e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
58
|
+
}
|
|
59
|
+
handleDragEnter(e) {
|
|
60
|
+
this.isDragging = !0, e.dataTransfer && (e.dataTransfer.dropEffect = l(this, r).call(this) ? "none" : "copy");
|
|
61
|
+
}
|
|
62
|
+
handleDragLeave() {
|
|
63
|
+
this.isDragging && (this.isDragging = !1);
|
|
64
|
+
}
|
|
65
|
+
handleDragOver(e) {
|
|
66
|
+
e.preventDefault(), this.isDragging = !0, e.dataTransfer && (e.dataTransfer.dropEffect = l(this, r).call(this) ? "none" : "copy");
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
const { ctxAccept: e, ctxMultiple: t, ctxError: a } = this.fileUploadContext ?? {}, n = this.accept || e, s = this.multiple || t, f = E(
|
|
70
|
+
N,
|
|
71
|
+
this.theme && S(this.theme),
|
|
72
|
+
l(this, r).call(this) && `${c}disabled`,
|
|
73
|
+
(this.error ?? a) && `${c}error`,
|
|
74
|
+
this.isDragging && `${c}dragging`
|
|
75
|
+
);
|
|
76
|
+
return x`
|
|
77
|
+
<div
|
|
78
|
+
${g(this.rootDivRef)}
|
|
79
|
+
class=${f}
|
|
80
|
+
role="button"
|
|
81
|
+
?aria-disabled=${l(this, r).call(this)}
|
|
82
|
+
tabindex=${l(this, r).call(this) ? $ : 0}
|
|
83
|
+
@click=${this.handleClick}
|
|
84
|
+
@dragstart=${this.handleDragStart}
|
|
85
|
+
@dragenter=${this.handleDragEnter}
|
|
86
|
+
@dragleave=${this.handleDragLeave}
|
|
87
|
+
@dragover=${this.handleDragOver}
|
|
88
|
+
@drop=${this.handleDropFiles}
|
|
89
|
+
@keydown=${this.handleKeyDown}
|
|
90
|
+
>
|
|
91
|
+
<input
|
|
92
|
+
${g(this.fileInputRef)}
|
|
93
|
+
name=${this.name}
|
|
94
|
+
type="file"
|
|
95
|
+
hidden
|
|
96
|
+
accept=${n}
|
|
97
|
+
?multiple=${s}
|
|
98
|
+
@change="${this.handleInputChange}"
|
|
99
|
+
?disabled=${l(this, r).call(this)}
|
|
100
|
+
/>
|
|
101
|
+
<span
|
|
102
|
+
aria-hidden="true"
|
|
103
|
+
class=${`${P()} ${h}state-layer`}
|
|
104
|
+
></span>
|
|
105
|
+
<bm-icon class=${`${h}icon`}
|
|
106
|
+
>${b(_)}</bm-icon
|
|
107
|
+
>
|
|
108
|
+
<slot>
|
|
109
|
+
<span class=${`${h}text`}
|
|
110
|
+
>Drag and drop or
|
|
111
|
+
<span class=${`${h}link`}>click</span> to
|
|
112
|
+
upload</span
|
|
113
|
+
>
|
|
114
|
+
</slot>
|
|
115
|
+
</div>
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
r = /* @__PURE__ */ new WeakMap();
|
|
120
|
+
i.styles = [D(I), w];
|
|
121
|
+
o([
|
|
122
|
+
p({ type: Boolean })
|
|
123
|
+
], i.prototype, "error", 2);
|
|
124
|
+
o([
|
|
125
|
+
p({ type: String })
|
|
126
|
+
], i.prototype, "theme", 2);
|
|
127
|
+
o([
|
|
128
|
+
p({ type: Boolean })
|
|
129
|
+
], i.prototype, "disabled", 2);
|
|
130
|
+
o([
|
|
131
|
+
p({ type: String })
|
|
132
|
+
], i.prototype, "accept", 2);
|
|
133
|
+
o([
|
|
134
|
+
p({ type: String })
|
|
135
|
+
], i.prototype, "name", 2);
|
|
136
|
+
o([
|
|
137
|
+
p({ type: Boolean })
|
|
138
|
+
], i.prototype, "multiple", 2);
|
|
139
|
+
o([
|
|
140
|
+
y({ context: k, subscribe: !0 })
|
|
141
|
+
], i.prototype, "fileUploadContext", 2);
|
|
142
|
+
o([
|
|
143
|
+
C()
|
|
144
|
+
], i.prototype, "isDragging", 2);
|
|
145
|
+
i = o([
|
|
146
|
+
U("bm-file-upload-dropzone")
|
|
147
|
+
], i);
|
|
148
|
+
export {
|
|
149
|
+
i as BmFileUploadDropzone
|
|
150
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { FileUploadListItemState, FileUploadListSize } from '@viasat/beam-shared/components/fileUpload';
|
|
3
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
4
|
+
/**
|
|
5
|
+
* `bm-file-upload-list-item`
|
|
6
|
+
*
|
|
7
|
+
* @fires bm-dismiss - Dispatched when the dismiss button is clicked
|
|
8
|
+
*/
|
|
9
|
+
export declare class BmFileUploadListItem extends LitElement {
|
|
10
|
+
#private;
|
|
11
|
+
static styles: import('lit').CSSResult;
|
|
12
|
+
/**
|
|
13
|
+
* Specify error text and display error state of list item
|
|
14
|
+
*/
|
|
15
|
+
error?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The name of the uploaded file
|
|
18
|
+
*/
|
|
19
|
+
fileName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The size of the uploaded file
|
|
22
|
+
*/
|
|
23
|
+
fileSize?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specify the size of the item
|
|
26
|
+
* @default 'md'
|
|
27
|
+
*/
|
|
28
|
+
size?: FileUploadListSize;
|
|
29
|
+
/**
|
|
30
|
+
* Specify if the item displays a default thumbnail or a preview of the image being uploaded. Image only displays for size lg.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
thumbnail?: string | boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Specify the status of the file
|
|
36
|
+
* @default 'uploaded'
|
|
37
|
+
*/
|
|
38
|
+
state: FileUploadListItemState;
|
|
39
|
+
/**
|
|
40
|
+
* Specify the progress of the file upload
|
|
41
|
+
* @default 0
|
|
42
|
+
*/
|
|
43
|
+
progress?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Specify the theme of the FileUpload. By default it inherits the theme from the parent
|
|
46
|
+
*/
|
|
47
|
+
theme?: ThemeTypes;
|
|
48
|
+
/**
|
|
49
|
+
* Specify if the FileUpload is disabled
|
|
50
|
+
*/
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
private listContext?;
|
|
53
|
+
private tooltipRef;
|
|
54
|
+
private fileNameRef;
|
|
55
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
56
|
+
}
|
|
57
|
+
declare global {
|
|
58
|
+
interface HTMLElementTagNameMap {
|
|
59
|
+
'bm-file-upload-list-item': BmFileUploadListItem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=FileUpload.List.Item.d.ts.map
|