@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,155 @@
|
|
|
1
|
+
import { consume as _ } from "@lit/context";
|
|
2
|
+
import { unsafeCSS as C, LitElement as z, html as n, nothing as w } from "lit";
|
|
3
|
+
import { property as a } from "lit/decorators.js";
|
|
4
|
+
import { createRef as S, ref as T } from "lit/directives/ref.js";
|
|
5
|
+
import $ from "clsx";
|
|
6
|
+
import { g as O, d as y } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
7
|
+
import { t as B } from "../../chunks/constants.jOWREYQE.js";
|
|
8
|
+
import { r as L } from "../../chunks/delegate.baxDQosr.js";
|
|
9
|
+
import { c as E } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
10
|
+
import { inputChoiceGroupContext as P } from "../../InputChoiceGroup/InputChoiceGroup.context.js";
|
|
11
|
+
const D = `: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-switch--read-only{--bm-input-choice-cursor: default;--bm-input-choice-label-cursor: default;--bm-input-choice-label-pointer-events: none}.bm-switch--disabled{--bm-input-choice-cursor: not-allowed;--bm-input-choice-label-cursor: not-allowed}.bm-switch__label{display:flex;position:relative;width:fit-content;align-items:start;gap:var(--bm-comp-input-space-choice-gap-inside);min-width:var(--bm-comp-input-size-choice-switch-width);min-height:var(--bm-comp-input-size-choice-switch-height);font:var(--bm-comp-input-typo-default);color:var(--bm-comp-input-color-text);cursor:var(--bm-input-choice-label-cursor, pointer);pointer-events:var(--bm-input-choice-label-pointer-events, auto)}.bm-switch input{-webkit-appearance:none;-moz-appearance:none;appearance:none;--webkit-appearance: none;--moz-appearance: none;position:relative;display:inline-block;flex-shrink:0;width:var(--bm-comp-input-size-choice-switch-width);height:var(--bm-comp-input-size-choice-switch-height);margin:var(--bm-sem-space-0);cursor:var(--bm-input-choice-cursor, pointer)}.bm-switch input+.bm-switch__switchBackground{position:absolute;box-sizing:border-box;width:var(--bm-comp-input-size-choice-switch-width);height:var(--bm-comp-input-size-choice-switch-height);border:var(--bm-comp-input-border-width-choice) solid var(--bm-comp-input-color-border);border-radius:var(--bm-comp-input-radius-choice-switch);background-color:var(--bm-comp-input-color-bg);transition:background-color .2s ease-in-out,box-shadow .2s ease-in}.bm-switch input+.bm-switch__switchBackground:before,.bm-switch input+.bm-switch__switchBackground:after{content:"";position:absolute;height:var(--bm-sem-size-icon-xs);width:var(--bm-sem-size-icon-xs);top:50%;transform:translateY(-50%)}.bm-switch input+.bm-switch__switchBackground:before{display:none;mask:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 16.1698L4.83 11.9998L3.41 13.4098L9 18.9998L21 6.99984L19.59 5.58984L9 16.1698Z' fill='currentColor'/%3E%3C/svg%3E");left:.3125rem;background-color:var(--bm-comp-input-color-icon)}.bm-switch input+.bm-switch__switchBackground:after{display:block;mask:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z' fill='currentColor'/%3E%3C/svg%3E");right:.3125rem;background-color:var(--bm-comp-input-color-icon)}.bm-switch input:after{z-index:1;position:absolute;box-sizing:border-box;content:"";width:var(--bm-comp-input-size-choice-switch-knob);height:var(--bm-comp-input-size-choice-switch-knob);top:50%;transform:translate(0) translateY(-50%);left:.1875rem;background-color:var(--bm-comp-input-color-icon);border-radius:var(--bm-sem-radius-round);transition:left .2s ease-in-out}.bm-switch input:checked+.bm-switch__switchBackground{background-color:var(--bm-comp-input-color-choice-switch-selected-bg);border-color:var(--bm-comp-input-color-choice-switch-selected-border)}.bm-switch input:checked+.bm-switch__switchBackground:before{display:block;background-color:var(--bm-comp-input-color-choice-switch-selected-icon)}.bm-switch input:checked+.bm-switch__switchBackground:after{display:none;background-color:var(--bm-comp-input-color-choice-switch-selected-bg)}.bm-switch input:checked:after{background-color:var(--bm-comp-input-color-choice-switch-selected-icon);left:calc(var(--bm-comp-input-size-choice-switch-width) - (.1875rem + var(--bm-comp-input-size-choice-switch-knob)))}.bm-switch input:focus-visible{outline:none}.bm-switch input:focus-visible+.bm-switch__switchBackground{outline-offset:var(--bm-sem-size-focus-offset);outline:var(--bm-sem-border-width-focus) solid var(--bm-sem-color-border-focus)}.bm-switch--read-only .bm-switch__label span{color:var(--bm-comp-input-color-text)}.bm-switch--read-only input:read-only+.bm-switch__switchBackground{background-color:var(--bm-comp-input-color-bg-disabled);border-color:var(--bm-comp-input-color-border-disabled)}.bm-switch--read-only input:read-only+.bm-switch__switchBackground:after,.bm-switch--read-only input:read-only+.bm-switch__switchBackground:before{background-color:var(--bm-comp-input-color-icon)}.bm-switch--read-only input:read-only:after{background-color:var(--bm-comp-input-color-icon)}.bm-switch--disabled .bm-switch__label span{color:var(--bm-comp-input-color-text-disabled)}.bm-switch--disabled input:disabled+.bm-switch__switchBackground{background-color:var(--bm-comp-input-color-bg-disabled);border-color:var(--bm-comp-input-color-border-disabled)}.bm-switch--disabled input:disabled+.bm-switch__switchBackground:after,.bm-switch--disabled input:disabled+.bm-switch__switchBackground:before{background-color:var(--bm-comp-input-color-icon-disabled)}.bm-switch--disabled input:disabled:after{background-color:var(--bm-comp-input-color-icon-disabled)}.bm-switch--before .bm-switch__label{flex-direction:row-reverse}.bm-switch--after .bm-switch__label{flex-direction:row}`;
|
|
12
|
+
var R = Object.defineProperty, M = Object.getOwnPropertyDescriptor, k = (e) => {
|
|
13
|
+
throw TypeError(e);
|
|
14
|
+
}, m = (e, o, i, c) => {
|
|
15
|
+
for (var t = c > 1 ? void 0 : c ? M(o, i) : o, s = e.length - 1, p; s >= 0; s--)
|
|
16
|
+
(p = e[s]) && (t = (c ? p(o, i, t) : p(t)) || t);
|
|
17
|
+
return c && t && R(o, i, t), t;
|
|
18
|
+
}, G = (e, o, i) => o.has(e) || k("Cannot " + i), l = (e, o, i) => (G(e, o, "read from private field"), i ? i.call(e) : o.get(e)), d = (e, o, i) => o.has(e) ? k("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(e) : o.set(e, i), u, f, v;
|
|
19
|
+
const { baseClassNamePrefix: N, subElementClassPrefix: x, classModifierPrefix: h } = O("switch");
|
|
20
|
+
let r = class extends z {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments), this.onText = void 0, this._hasOnTextSlotContent = !1, this.offText = void 0, this._hasOffTextSlotContent = !1, this.theme = void 0, this.textPosition = "after", this.readOnly = !1, this.disabled = !1, this.checked = !1, this.switchRef = S(), d(this, u, () => n` <span class=${`${x}switchBackground`}></span> `), d(this, f, () => {
|
|
23
|
+
var g;
|
|
24
|
+
const e = ((g = this.switchRef.value) == null ? void 0 : g.checked) || this.checked;
|
|
25
|
+
this._updateDisplayedSlot(e);
|
|
26
|
+
const o = this._hasOnTextSlotContent ? w : this.onText || this.offText, i = this._hasOffTextSlotContent ? w : this.offText || this.onText, c = (b) => {
|
|
27
|
+
this._hasOnTextSlotContent = y(b), this._updateDisplayedSlot(e);
|
|
28
|
+
}, t = (b) => {
|
|
29
|
+
this._hasOffTextSlotContent = y(b), this._updateDisplayedSlot(e);
|
|
30
|
+
}, s = n`
|
|
31
|
+
<slot name="onText" id="onText" @slotchange=${c}>${o}</slot>
|
|
32
|
+
`, p = n`<slot
|
|
33
|
+
name="offText"
|
|
34
|
+
id="offText"
|
|
35
|
+
@slotchange=${t}
|
|
36
|
+
>${i}</slot
|
|
37
|
+
> `;
|
|
38
|
+
return n`<span> ${p} ${s} </span>`;
|
|
39
|
+
}), d(this, v, () => {
|
|
40
|
+
const { ariaLabel: e } = this, {
|
|
41
|
+
readOnly: o,
|
|
42
|
+
disabled: i,
|
|
43
|
+
name: c
|
|
44
|
+
} = this.inputChoiceGroupContext || {}, t = this.disabled || i, s = this.readOnly || o;
|
|
45
|
+
return n`<input
|
|
46
|
+
role="switch"
|
|
47
|
+
type="checkbox"
|
|
48
|
+
name=${c}
|
|
49
|
+
id=${this.id}
|
|
50
|
+
?value=${this.value}
|
|
51
|
+
?readOnly=${s}
|
|
52
|
+
?disabled=${t}
|
|
53
|
+
.checked=${this.checked}
|
|
54
|
+
.aria-checked=${this.checked}
|
|
55
|
+
.aria-disabled=${t}
|
|
56
|
+
.aria-readonly=${s}
|
|
57
|
+
aria-label=${e}
|
|
58
|
+
@click=${this.onChange}
|
|
59
|
+
${T(this.switchRef)}
|
|
60
|
+
/>`;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
updated(e) {
|
|
64
|
+
e.has("checked") && this.requestUpdate();
|
|
65
|
+
}
|
|
66
|
+
handleForwardedEvents(e) {
|
|
67
|
+
e.target === this.switchRef.value && (e.preventDefault(), e.stopPropagation());
|
|
68
|
+
}
|
|
69
|
+
onChange(e) {
|
|
70
|
+
var i;
|
|
71
|
+
if (this.readOnly || (i = this.inputChoiceGroupContext) != null && i.readOnly) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const o = e.target;
|
|
76
|
+
this.checked = o.checked, this._updateDisplayedSlot(o.checked);
|
|
77
|
+
}
|
|
78
|
+
_updateDisplayedSlot(e) {
|
|
79
|
+
var c, t;
|
|
80
|
+
const o = (c = this == null ? void 0 : this.shadowRoot) == null ? void 0 : c.getElementById("onText"), i = (t = this == null ? void 0 : this.shadowRoot) == null ? void 0 : t.getElementById("offText");
|
|
81
|
+
if (!(!o || !i)) {
|
|
82
|
+
if (e) {
|
|
83
|
+
if (!this._hasOnTextSlotContent && this._hasOffTextSlotContent) {
|
|
84
|
+
i.style.display = "contents";
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
o.style.display = "contents", i.style.display = "none";
|
|
88
|
+
}
|
|
89
|
+
if (!e) {
|
|
90
|
+
if (!this._hasOffTextSlotContent && this._hasOnTextSlotContent) {
|
|
91
|
+
o.style.display = "contents";
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
i.style.display = "contents", o.style.display = "none";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
render() {
|
|
99
|
+
const { readOnly: e, disabled: o } = this.inputChoiceGroupContext || {}, i = this.disabled || o, c = this.readOnly || e, t = $(
|
|
100
|
+
N,
|
|
101
|
+
this.theme && B(this.theme),
|
|
102
|
+
this.textPosition && `${h}${this.textPosition}`,
|
|
103
|
+
i && `${h}disabled`,
|
|
104
|
+
c && `${h}read-only`
|
|
105
|
+
);
|
|
106
|
+
return n`
|
|
107
|
+
<div class=${t}>
|
|
108
|
+
<label
|
|
109
|
+
tabindex="-1"
|
|
110
|
+
class=${`${x}label`}
|
|
111
|
+
@blur=${this.handleForwardedEvents}
|
|
112
|
+
@focus=${this.handleForwardedEvents}
|
|
113
|
+
>
|
|
114
|
+
${l(this, v).call(this)} ${l(this, u).call(this)} ${l(this, f).call(this)}
|
|
115
|
+
</label>
|
|
116
|
+
</div>
|
|
117
|
+
`;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
u = /* @__PURE__ */ new WeakMap();
|
|
121
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
123
|
+
r.styles = C(D);
|
|
124
|
+
L(r);
|
|
125
|
+
m([
|
|
126
|
+
_({ context: P, subscribe: !0 }),
|
|
127
|
+
a({ attribute: !1 })
|
|
128
|
+
], r.prototype, "inputChoiceGroupContext", 2);
|
|
129
|
+
m([
|
|
130
|
+
a({ type: String })
|
|
131
|
+
], r.prototype, "onText", 2);
|
|
132
|
+
m([
|
|
133
|
+
a({ type: String })
|
|
134
|
+
], r.prototype, "offText", 2);
|
|
135
|
+
m([
|
|
136
|
+
a({ type: String })
|
|
137
|
+
], r.prototype, "textPosition", 2);
|
|
138
|
+
m([
|
|
139
|
+
a({ type: Boolean })
|
|
140
|
+
], r.prototype, "readOnly", 2);
|
|
141
|
+
m([
|
|
142
|
+
a({ type: Boolean })
|
|
143
|
+
], r.prototype, "disabled", 2);
|
|
144
|
+
m([
|
|
145
|
+
a({ type: Boolean })
|
|
146
|
+
], r.prototype, "checked", 2);
|
|
147
|
+
m([
|
|
148
|
+
a({ type: String })
|
|
149
|
+
], r.prototype, "value", 2);
|
|
150
|
+
r = m([
|
|
151
|
+
E("bm-switch")
|
|
152
|
+
], r);
|
|
153
|
+
export {
|
|
154
|
+
r as BmSwitch
|
|
155
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputChoiceGroup } from '../../../InputChoiceGroup/InputChoiceGroup';
|
|
2
|
+
/**
|
|
3
|
+
* `bm-switch-group`
|
|
4
|
+
*
|
|
5
|
+
* @slot label - Slot for the label of the SwitchGroup
|
|
6
|
+
* @slot helperText - Slot for the helper text of the SwitchGroup
|
|
7
|
+
*/
|
|
8
|
+
export declare class BmSwitchGroup extends InputChoiceGroup {
|
|
9
|
+
}
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'bm-switch-group': BmSwitchGroup;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SwitchGroup.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { c as u } from "../../../chunks/register-custom-element.DHGKOhmA.js";
|
|
2
|
+
import { InputChoiceGroup as l } from "../../../InputChoiceGroup/InputChoiceGroup.js";
|
|
3
|
+
var n = Object.getOwnPropertyDescriptor, a = (t, o, m, p) => {
|
|
4
|
+
for (var r = p > 1 ? void 0 : p ? n(o, m) : o, e = t.length - 1, s; e >= 0; e--)
|
|
5
|
+
(s = t[e]) && (r = s(r) || r);
|
|
6
|
+
return r;
|
|
7
|
+
};
|
|
8
|
+
let c = class extends l {
|
|
9
|
+
};
|
|
10
|
+
c = a([
|
|
11
|
+
u("bm-switch-group")
|
|
12
|
+
], c);
|
|
13
|
+
export {
|
|
14
|
+
c as BmSwitchGroup
|
|
15
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
2
|
+
import { Optional } from '@viasat/beam-shared/utils/types';
|
|
3
|
+
import { NullableTemplate, FinalizeAssociatedResult } from '../../../utils/mixins/types';
|
|
4
|
+
import { FormField } from '../Form/Form.decorator';
|
|
5
|
+
/**
|
|
6
|
+
* @summary `bm-text-area`
|
|
7
|
+
*
|
|
8
|
+
* @slot label - Specify the label for TextArea
|
|
9
|
+
* @slot helper-text - Specify the helper text for TextArea
|
|
10
|
+
*/
|
|
11
|
+
export declare class BmTextArea extends FormField {
|
|
12
|
+
#private;
|
|
13
|
+
/**
|
|
14
|
+
* Specify the height of TextArea
|
|
15
|
+
*/
|
|
16
|
+
rows: Optional<number>;
|
|
17
|
+
/**
|
|
18
|
+
* Specify the width of TextArea
|
|
19
|
+
*/
|
|
20
|
+
cols: Optional<number>;
|
|
21
|
+
/**
|
|
22
|
+
* Specify placeholder text for TextArea
|
|
23
|
+
*/
|
|
24
|
+
placeholder: Optional<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Specify if TextArea is a required input
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
required: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Specify if the TextArea displays with an asterisk
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
hideRequiredMarker: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Specify error text and display error state of a TextArea
|
|
37
|
+
*/
|
|
38
|
+
error: Optional<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Specify if TextArea displays in a read-only state
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
readOnly: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Specify if TextArea displays in a disabled state
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
disabled: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Specify if TextArea is fluid
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
fluid: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Specify the width of TextArea
|
|
56
|
+
*/
|
|
57
|
+
width: Optional<string>;
|
|
58
|
+
/**
|
|
59
|
+
* Specify if TextArea can be manually resized
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
hideResize: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Specify the maximum character count for the TextArea
|
|
65
|
+
*/
|
|
66
|
+
maxCount: Optional<number>;
|
|
67
|
+
/**
|
|
68
|
+
* Specify if the TextArea automatically resizes to fit the text
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
autoResize: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Specify the theme of the TextArea. By default it inherits the theme from the parent
|
|
74
|
+
*/
|
|
75
|
+
theme: Optional<ThemeTypes>;
|
|
76
|
+
static styles: import('lit').CSSResult;
|
|
77
|
+
formFieldCounterRef: import('lit-html/directives/ref').Ref<HTMLSpanElement>;
|
|
78
|
+
private _textAreaLabel;
|
|
79
|
+
private _textAreaHelperText;
|
|
80
|
+
updated(cP: Map<string, unknown>): void;
|
|
81
|
+
finalizeAssociatedCallback(value: string): FinalizeAssociatedResult;
|
|
82
|
+
render(): NullableTemplate;
|
|
83
|
+
}
|
|
84
|
+
declare global {
|
|
85
|
+
interface HTMLElementTagNameMap {
|
|
86
|
+
'bm-text-area': BmTextArea;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=TextArea.d.ts.map
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { unsafeCSS as R, html as _, nothing as D } from "lit";
|
|
2
|
+
import { property as m, queryAssignedElements as k } from "lit/decorators.js";
|
|
3
|
+
import { createRef as L, ref as N } from "lit/directives/ref.js";
|
|
4
|
+
import I from "clsx";
|
|
5
|
+
import { p as d, a as C, g as W } from "../../chunks/classNames.Cq_tbDRp.js";
|
|
6
|
+
import { t as V } from "../../chunks/constants.jOWREYQE.js";
|
|
7
|
+
import { r as G } from "../../chunks/delegate.baxDQosr.js";
|
|
8
|
+
import { c as B } from "../../chunks/register-custom-element.DHGKOhmA.js";
|
|
9
|
+
import { FormField as H } from "../Form/Form.decorator.js";
|
|
10
|
+
const j = /* @__PURE__ */ new WeakMap();
|
|
11
|
+
async function Z(e) {
|
|
12
|
+
const r = e.offsetHeight, t = e.clientHeight, s = r - t;
|
|
13
|
+
e.style.overflow = "hidden", e.scrollHeight === t && (e.style.height = "0");
|
|
14
|
+
const c = e.scrollHeight;
|
|
15
|
+
e.style.height = `${c + s}px`;
|
|
16
|
+
}
|
|
17
|
+
const A = (e, r) => {
|
|
18
|
+
const t = j.get(e);
|
|
19
|
+
if (j.set(e, r), !r) {
|
|
20
|
+
t && (e.style.height = "unset", e.style.overflow = "visible");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
Z(e);
|
|
24
|
+
}, 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-text-area{--bm-label-cursor: pointer;max-width:var(--bm-comp-input-size-field-width);--bm-label-space-bottom: var(--bm-comp-label-space-bottom);--bm-helper-text-space-top: var(--bm-comp-helper-text-space-top)}.bm-text-area--disabled{--bm-label-cursor: not-allowed;--bm-label-pointer-events: auto;--bm-text-field-cursor: not-allowed;--bm-text-field-input-cursor: not-allowed}.bm-text-area--error .bm-text-area__header .bm-text-area__counter{color:var(--bm-comp-input-color-text-placeholder)}.bm-text-area--error .bm-text-area__field .bm-text-area__input{color:var(--bm-comp-input-color-text);border-color:var(--bm-comp-input-color-border-error);background-color:var(--bm-comp-input-color-bg);outline-offset:calc(0px - var(--bm-comp-input-border-width-field-error));outline:var(--bm-comp-input-border-width-field-error) solid var(--bm-comp-input-color-border-error)}.bm-text-area--error .bm-text-area__field .bm-text-area__input::placeholder{color:var(--bm-comp-input-color-text-placeholder)}.bm-text-area--read-only .bm-text-area__header .bm-text-area__counter{color:var(--bm-comp-input-color-text-placeholder)}.bm-text-area--read-only .bm-text-area__field .bm-text-area__input{color:var(--bm-comp-input-color-text);border-color:var(--bm-comp-input-color-border-disabled);background-color:var(--bm-comp-input-color-bg-disabled)}.bm-text-area--read-only .bm-text-area__field .bm-text-area__input::placeholder{color:var(--bm-comp-input-color-text-placeholder)}.bm-text-area--disabled .bm-text-area__header .bm-text-area__counter{color:var(--bm-comp-input-color-text-disabled)}.bm-text-area--disabled .bm-text-area__field .bm-text-area__input{color:var(--bm-comp-input-color-text-disabled);border-color:var(--bm-comp-input-color-border-disabled);background-color:var(--bm-comp-input-color-bg-disabled)}.bm-text-area--disabled .bm-text-area__field .bm-text-area__input::placeholder{color:var(--bm-comp-input-color-text-disabled)}.bm-text-area--fluid{max-width:100%}@-moz-document url-prefix(){.bm-text-area__field:after{display:none}}.bm-text-area--hide-resize .bm-text-area__field:after{display:none}.bm-text-area--hide-resize .bm-text-area__field .bm-text-area__input{resize:none}.bm-text-area--cols-width{max-width:fit-content}.bm-text-area--cols-width .bm-text-area__field .bm-text-area__input{width:auto}.bm-text-area__header{display:flex;gap:var(--bm-sem-space-50)}.bm-text-area__header .bm-text-area__counter{margin-block-end:auto;margin-inline-start:auto;font:var(--bm-comp-input-typo-character-count);color:var(--bm-comp-input-color-text-placeholder);padding-block-end:var(--bm-comp-label-space-bottom)}.bm-text-area__field{position:relative;cursor:var(--bm-text-field-cursor, default)}.bm-text-area__field:dir(rtl){--bm-resize-icon-flip: -1}.bm-text-area__field:after{content:"";position:absolute;pointer-events:none;width:var(--bm-sem-space-125);height:var(--bm-sem-space-125);-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSJub25lIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzY0NjIyXzQ4MzUzKSI+CjxwYXRoIGQ9Ik0xOC4zMzMzIDE4LjMzMzNIMTYuNjY2N1YxNi42NjY3SDE4LjMzMzNWMTguMzMzM1pNMTguMzMzMyAxNUgxNi42NjY3VjEzLjMzMzNIMTguMzMzM1YxNVpNMTUgMTguMzMzM0gxMy4zMzMzVjE2LjY2NjdIMTVWMTguMzMzM1pNMTUgMTVIMTMuMzMzM1YxMy4zMzMzSDE1VjE1Wk0xMS42NjY3IDE4LjMzMzNIMTBWMTYuNjY2N0gxMS42NjY3VjE4LjMzMzNaTTE4LjMzMzMgMTEuNjY2N0gxNi42NjY3VjEwSDE4LjMzMzNWMTEuNjY2N3oiIGZpbGw9IiM0NjU5NjciLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF82NDYyMl80ODM1MyI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4=);-webkit-mask-size:cover;-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSJub25lIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzY0NjIyXzQ4MzUzKSI+CjxwYXRoIGQ9Ik0xOC4zMzMzIDE4LjMzMzNIMTYuNjY2N1YxNi42NjY3SDE4LjMzMzNWMTguMzMzM1pNMTguMzMzMyAxNUgxNi42NjY3VjEzLjMzMzNIMTguMzMzM1YxNVpNMTUgMTguMzMzM0gxMy4zMzMzVjE2LjY2NjdIMTVWMTguMzMzM1pNMTUgMTVIMTMuMzMzM1YxMy4zMzMzSDE1VjE1Wk0xMS42NjY3IDE4LjMzMzNIMTBWMTYuNjY2N0gxMS42NjY3VjE4LjMzMzNaTTE4LjMzMzMgMTEuNjY2N0gxNi42NjY3VjEwSDE4LjMzMzNWMTEuNjY2N3oiIGZpbGw9IiM0NjU5NjciLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF82NDYyMl80ODM1MyI+CjxyZWN0IHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0id2hpdGUiLz4KPC9jbGlwUGF0aD4KPC9kZWZzPgo8L3N2Zz4=);mask-size:cover;mask-position:center;mask-repeat:no-repeat;inset-block-end:var(--bm-sem-space-12);inset-inline-end:var(--bm-sem-space-12);transform:scaleX(var(--bm-resize-icon-flip, 1));background-color:var(--bm-sem-color-icon-secondary)}.bm-text-area__field .bm-text-area__input{width:100%;display:block;resize:vertical;box-sizing:border-box;border-style:solid;border-color:var(--bm-comp-input-color-border);border-radius:var(--bm-comp-input-radius-field);border-width:var(--bm-comp-input-border-width-field-default);color:var(--bm-comp-input-color-text);font:var(--bm-comp-input-typo-default);cursor:var(--bm-text-field-input-cursor, text);box-shadow:var(--bm-comp-input-shadow-field);background-color:var(--bm-comp-input-color-bg);min-height:var(--bm-comp-input-size-field-text-area-height);padding:var(--bm-comp-input-space-field-y) var(--bm-comp-input-space-field-x);transform:translate3d(var(--bm-sem-space-0),var(--bm-sem-space-0),var(--bm-sem-space-0))}.bm-text-area__field .bm-text-area__input::-webkit-resizer{display:none}.bm-text-area__field .bm-text-area__input::placeholder{color:var(--bm-comp-input-color-text-placeholder)}.bm-text-area__field .bm-text-area__input:focus{outline-offset:calc(0px - var(--bm-sem-size-focus-offset));outline:var(--bm-sem-border-width-focus) solid var(--bm-sem-color-border-focus)}';
|
|
25
|
+
var q = Object.defineProperty, U = Object.getOwnPropertyDescriptor, S = (e) => {
|
|
26
|
+
throw TypeError(e);
|
|
27
|
+
}, a = (e, r, t, s) => {
|
|
28
|
+
for (var c = s > 1 ? void 0 : s ? U(r, t) : r, b = e.length - 1, u; b >= 0; b--)
|
|
29
|
+
(u = e[b]) && (c = (s ? u(r, t, c) : u(c)) || c);
|
|
30
|
+
return s && c && q(r, t, c), c;
|
|
31
|
+
}, X = (e, r, t) => r.has(e) || S("Cannot " + t), o = (e, r, t) => (X(e, r, "read from private field"), t ? t.call(e) : r.get(e)), l = (e, r, t) => r.has(e) ? S("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, t), p, h, M, f, z, v, x, y, w;
|
|
32
|
+
const { baseClassNamePrefix: F, subElementClassPrefix: g, classModifierPrefix: n } = W("text-area");
|
|
33
|
+
let i = class extends H {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments), this.required = !1, this.hideRequiredMarker = !1, this.readOnly = !1, this.disabled = !1, this.fluid = !1, this.hideResize = !1, this.autoResize = !1, this.formFieldCounterRef = L(), l(this, p, () => {
|
|
36
|
+
var e;
|
|
37
|
+
return !!(this.disabled || (e = this.formContext) != null && e.disabled);
|
|
38
|
+
}), l(this, h, () => {
|
|
39
|
+
var e;
|
|
40
|
+
return !!(this.readOnly || (e = this.formContext) != null && e.readOnly);
|
|
41
|
+
}), l(this, M, () => {
|
|
42
|
+
var e;
|
|
43
|
+
return !!(this.required || (e = this.formContext) != null && e.required);
|
|
44
|
+
}), l(this, f, () => !!this.autoResize), l(this, z, () => o(this, f).call(this) || !!this.hideResize), l(this, v, () => {
|
|
45
|
+
const { value: e } = this.formFieldCounterRef;
|
|
46
|
+
if (!e) return;
|
|
47
|
+
const { value: r } = this.formFieldRef, {
|
|
48
|
+
value: { length: t }
|
|
49
|
+
} = r;
|
|
50
|
+
e.textContent = `${t}`;
|
|
51
|
+
}), l(this, x, () => {
|
|
52
|
+
const { value: e } = this.formFieldRef;
|
|
53
|
+
A(e, o(this, f).call(this));
|
|
54
|
+
}), l(this, y, (e) => {
|
|
55
|
+
o(this, v).call(this), o(this, x).call(this), this.validateFieldOnChange(e);
|
|
56
|
+
}), l(this, w, (e) => e ? _`
|
|
57
|
+
<div class="${g}counter">
|
|
58
|
+
<span ${N(this.formFieldCounterRef)}></span>/<span>${e}</span>
|
|
59
|
+
</div>
|
|
60
|
+
` : D);
|
|
61
|
+
}
|
|
62
|
+
updated(e) {
|
|
63
|
+
const [r] = this._textAreaLabel, [t] = this._textAreaHelperText, { decorate: s } = C(r), { decorate: c } = C(t), b = d(e, ["value"]), u = d(e, ["maxCount"]), T = d(e, ["autoResize"]), Y = d(e, ["validationRules"]), E = d(e, ["formContext", "disabled"]), $ = d(e, [
|
|
64
|
+
"formContext",
|
|
65
|
+
"required",
|
|
66
|
+
"hideRequiredMarker"
|
|
67
|
+
]), P = d(e, ["formContext"]) && this.contextInitialsChanged();
|
|
68
|
+
(b || P) && this.setContextValue(), E && (s({ disabled: o(this, p).call(this) }), c({ disabled: o(this, p).call(this) })), u && o(this, v).call(this), T && o(this, x).call(this), Y && this.setContextValidation(), $ && s({ required: o(this, M).call(this) && !this.hideRequiredMarker });
|
|
69
|
+
}
|
|
70
|
+
finalizeAssociatedCallback(e) {
|
|
71
|
+
return {
|
|
72
|
+
ctxValue: e.slice(0, this.maxCount),
|
|
73
|
+
finalizeCallback: () => {
|
|
74
|
+
o(this, v).call(this), o(this, x).call(this);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
const { ariaInvalid: e } = this, { length: r } = this.validationErrors(), t = typeof this.error == "string" || !!r, s = I(
|
|
80
|
+
this.helperTextId,
|
|
81
|
+
this.error && this.errorId,
|
|
82
|
+
this.validationErrorShown() && this.validationErrorsId
|
|
83
|
+
), c = I(
|
|
84
|
+
F,
|
|
85
|
+
t && `${n}error`,
|
|
86
|
+
this.theme && V(this.theme),
|
|
87
|
+
this.fluid && `${n}fluid`,
|
|
88
|
+
this.cols && `${n}cols-width`,
|
|
89
|
+
o(this, p).call(this) && `${n}disabled`,
|
|
90
|
+
o(this, h).call(this) && `${n}read-only`,
|
|
91
|
+
o(this, z).call(this) && `${n}hide-resize`,
|
|
92
|
+
o(this, f).call(this) && `${n}auto-resize`
|
|
93
|
+
);
|
|
94
|
+
return _`
|
|
95
|
+
<div class="${c}" style="max-width: ${this.width}">
|
|
96
|
+
<div class="${g}header">
|
|
97
|
+
<slot name="label" id="${this.labelId}"></slot>
|
|
98
|
+
${o(this, w).call(this, this.maxCount)}
|
|
99
|
+
</div>
|
|
100
|
+
<div class="${g}field">
|
|
101
|
+
<textarea
|
|
102
|
+
id="${this.id}"
|
|
103
|
+
name="${this.name}"
|
|
104
|
+
rows="${this.rows}"
|
|
105
|
+
cols="${this.cols}"
|
|
106
|
+
${N(this.formFieldRef)}
|
|
107
|
+
maxlength="${this.maxCount}"
|
|
108
|
+
@input="${o(this, y)}"
|
|
109
|
+
?required="${o(this, M).call(this)}"
|
|
110
|
+
?readonly="${o(this, h).call(this)}"
|
|
111
|
+
?disabled="${o(this, p).call(this)}"
|
|
112
|
+
placeholder="${this.placeholder}"
|
|
113
|
+
aria-labelledby="${this.labelId}"
|
|
114
|
+
aria-label="${this.inputAriaLabel}"
|
|
115
|
+
@blur="${this.validateFieldOnBlur}"
|
|
116
|
+
aria-describedby="${s}"
|
|
117
|
+
class="${g}input"
|
|
118
|
+
aria-invalid="${e || t}"
|
|
119
|
+
aria-disabled="${o(this, p).call(this) || o(this, h).call(this)}"
|
|
120
|
+
></textarea>
|
|
121
|
+
</div>
|
|
122
|
+
<slot name="helper-text" id="${this.helperTextId}"></slot>
|
|
123
|
+
${this.renderError(this.error, o(this, p).call(this))}
|
|
124
|
+
${this.renderValidationErrors()}
|
|
125
|
+
</div>
|
|
126
|
+
`;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
p = /* @__PURE__ */ new WeakMap();
|
|
130
|
+
h = /* @__PURE__ */ new WeakMap();
|
|
131
|
+
M = /* @__PURE__ */ new WeakMap();
|
|
132
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
133
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
134
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
135
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
136
|
+
y = /* @__PURE__ */ new WeakMap();
|
|
137
|
+
w = /* @__PURE__ */ new WeakMap();
|
|
138
|
+
G(i);
|
|
139
|
+
i.styles = R(O);
|
|
140
|
+
a([
|
|
141
|
+
m({ type: Number })
|
|
142
|
+
], i.prototype, "rows", 2);
|
|
143
|
+
a([
|
|
144
|
+
m({ type: Number })
|
|
145
|
+
], i.prototype, "cols", 2);
|
|
146
|
+
a([
|
|
147
|
+
m({ type: String })
|
|
148
|
+
], i.prototype, "placeholder", 2);
|
|
149
|
+
a([
|
|
150
|
+
m({ type: Boolean })
|
|
151
|
+
], i.prototype, "required", 2);
|
|
152
|
+
a([
|
|
153
|
+
m({ type: Boolean })
|
|
154
|
+
], i.prototype, "hideRequiredMarker", 2);
|
|
155
|
+
a([
|
|
156
|
+
m({ type: String })
|
|
157
|
+
], i.prototype, "error", 2);
|
|
158
|
+
a([
|
|
159
|
+
m({ type: Boolean })
|
|
160
|
+
], i.prototype, "readOnly", 2);
|
|
161
|
+
a([
|
|
162
|
+
m({ type: Boolean })
|
|
163
|
+
], i.prototype, "disabled", 2);
|
|
164
|
+
a([
|
|
165
|
+
m({ type: Boolean })
|
|
166
|
+
], i.prototype, "fluid", 2);
|
|
167
|
+
a([
|
|
168
|
+
m({ type: String })
|
|
169
|
+
], i.prototype, "width", 2);
|
|
170
|
+
a([
|
|
171
|
+
m({ type: Boolean })
|
|
172
|
+
], i.prototype, "hideResize", 2);
|
|
173
|
+
a([
|
|
174
|
+
m({ type: Number })
|
|
175
|
+
], i.prototype, "maxCount", 2);
|
|
176
|
+
a([
|
|
177
|
+
m({ type: Boolean })
|
|
178
|
+
], i.prototype, "autoResize", 2);
|
|
179
|
+
a([
|
|
180
|
+
m({ type: String })
|
|
181
|
+
], i.prototype, "theme", 2);
|
|
182
|
+
a([
|
|
183
|
+
k({ slot: "label" })
|
|
184
|
+
], i.prototype, "_textAreaLabel", 2);
|
|
185
|
+
a([
|
|
186
|
+
k({ slot: "helper-text" })
|
|
187
|
+
], i.prototype, "_textAreaHelperText", 2);
|
|
188
|
+
i = a([
|
|
189
|
+
B("bm-text-area")
|
|
190
|
+
], i);
|
|
191
|
+
export {
|
|
192
|
+
i as BmTextArea
|
|
193
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ThemeTypes } from '@viasat/beam-shared/utils/constants';
|
|
2
|
+
import { Optional } from '@viasat/beam-shared/utils/types';
|
|
3
|
+
import { NullableTemplate } from '../../../utils/mixins/types';
|
|
4
|
+
import { FormField } from '../Form/Form.decorator';
|
|
5
|
+
/**
|
|
6
|
+
* @summary `bm-text-field`
|
|
7
|
+
*
|
|
8
|
+
* @slot label - Specify the label for TextField
|
|
9
|
+
* @slot helper-text - Specify the helper text for TextField
|
|
10
|
+
* @slot content-after - Specify content to display after input
|
|
11
|
+
* @slot content-before - Specify content to display before input
|
|
12
|
+
*/
|
|
13
|
+
export declare class BmTextField extends FormField {
|
|
14
|
+
#private;
|
|
15
|
+
/**
|
|
16
|
+
* Specify placeholder text for TextField
|
|
17
|
+
*/
|
|
18
|
+
placeholder: Optional<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Specify if TextField is a required input
|
|
21
|
+
*/
|
|
22
|
+
required: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Specify if the TextField displays with an asterisk
|
|
25
|
+
*/
|
|
26
|
+
hideRequiredMarker: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Specify error text and display error state of a TextField
|
|
29
|
+
*/
|
|
30
|
+
error: Optional<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Specify if TextField displays in a read-only state
|
|
33
|
+
*/
|
|
34
|
+
readOnly: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Specify if TextField displays in a disabled state
|
|
37
|
+
*/
|
|
38
|
+
disabled: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Specify if TextField is fluid
|
|
41
|
+
*/
|
|
42
|
+
fluid: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Specify the width of TextField
|
|
45
|
+
*/
|
|
46
|
+
width: Optional<string>;
|
|
47
|
+
/**
|
|
48
|
+
* Specify if overflow displays ellipsis
|
|
49
|
+
*/
|
|
50
|
+
ellipse: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Specify the theme of the TextField. By default it inherits the theme from the parent
|
|
53
|
+
*/
|
|
54
|
+
theme: Optional<ThemeTypes>;
|
|
55
|
+
type: string;
|
|
56
|
+
inputMode: string;
|
|
57
|
+
static styles: import('lit').CSSResult;
|
|
58
|
+
private _textFieldLabel;
|
|
59
|
+
private _textFieldHelperText;
|
|
60
|
+
private _hasContentBeforeSlot;
|
|
61
|
+
private _hasContentAfterSlot;
|
|
62
|
+
updated(cP: Map<string, unknown>): void;
|
|
63
|
+
render(): NullableTemplate;
|
|
64
|
+
}
|
|
65
|
+
declare global {
|
|
66
|
+
interface HTMLElementTagNameMap {
|
|
67
|
+
'bm-text-field': BmTextField;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=TextField.d.ts.map
|