@carbon/web-components 2.11.0-rc.0 → 2.11.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/dist/16-486ace1a.js +4 -4
- package/dist/16-51a594ce.js +4 -4
- package/dist/16-656090c0.js +4 -4
- package/dist/16-71872213.js +4 -4
- package/dist/16-730a41a2.js +4 -4
- package/dist/16-83a1cd89.js +4 -4
- package/dist/16-b73c677b.js +4 -4
- package/dist/16-d1c73001.js +4 -4
- package/dist/20-d069d8da.js +4 -4
- package/dist/accordion.min.js +17 -11
- package/dist/ai-skeleton.min.js +4 -4
- package/dist/breadcrumb.min.js +4 -4
- package/dist/button-21c75bab.js +4 -4
- package/dist/button-set-69863a24.js +4 -4
- package/dist/button-skeleton-1abc1fd8.js +4 -4
- package/dist/button.min.js +4 -4
- package/dist/carbon-element-4ca9803f.js +4 -4
- package/dist/chat-button.min.js +7 -7
- package/dist/checkbox-d0a3a79f.js +4 -4
- package/dist/checkbox.min.js +4 -4
- package/dist/class-map-5edb95da.js +4 -4
- package/dist/code-snippet.min.js +5 -5
- package/dist/collection-helpers-4e32fe16.js +4 -4
- package/dist/combo-box.min.js +4 -4
- package/dist/content-switcher-item-5b8dd42f.js +4 -4
- package/dist/content-switcher.min.js +4 -4
- package/dist/{copy-button-0cfa83bd.js → copy-button-d673538b.js} +7 -7
- package/dist/copy-button.min.js +5 -5
- package/dist/data-table.min.js +22 -22
- package/dist/date-picker.min.js +5 -5
- package/dist/defineProperty-e448b551.js +4 -4
- package/dist/directive-e2d48b9c.js +4 -4
- package/dist/dropdown-item-91b3dc95.js +4 -4
- package/dist/dropdown.min.js +4 -4
- package/dist/file-uploader.min.js +12 -12
- package/dist/floating-menu-46199beb.js +4 -4
- package/dist/floating-menu.min.js +4 -4
- package/dist/focus-e70d1cbe.js +4 -4
- package/dist/form-group.min.js +5 -5
- package/dist/form.min.js +4 -4
- package/dist/get-52a048b1.js +4 -4
- package/dist/host-listener-b6a3d690.js +4 -4
- package/dist/{icon-button-37322eeb.js → icon-button-09275c70.js} +6 -6
- package/dist/icon-button.min.js +5 -5
- package/dist/if-defined-2e09d22b.js +4 -4
- package/dist/if-non-empty-20ce3c96.js +4 -4
- package/dist/inline-loading.min.js +4 -4
- package/dist/{layer-0633200a.js → layer-5f257c4a.js} +5 -5
- package/dist/layer.min.js +5 -5
- package/dist/link-dc6f9b4e.js +4 -4
- package/dist/link.min.js +4 -4
- package/dist/list.min.js +4 -4
- package/dist/loading-2604f4ad.js +4 -4
- package/dist/loading-icon-85b7e502.js +4 -4
- package/dist/loading.min.js +4 -4
- package/dist/modal-label-d53c98de.js +4 -4
- package/dist/modal.min.js +4 -4
- package/dist/multi-select.min.js +4 -4
- package/dist/notification.min.js +13 -13
- package/dist/number-input.min.js +5 -5
- package/dist/objectSpread2-46e4de7a.js +4 -4
- package/dist/on-6c264d49.js +4 -4
- package/dist/overflow-menu.min.js +5 -5
- package/dist/pagination.min.js +4 -4
- package/dist/{popover-content-11101167.js → popover-content-08cf10b0.js} +6 -6
- package/dist/popover-controller-cc6ccb74.js +4 -4
- package/dist/popover.min.js +5 -5
- package/dist/progress-bar.min.js +6 -6
- package/dist/progress-indicator.min.js +4 -4
- package/dist/query-5f833318.js +4 -4
- package/dist/query-assigned-elements-73bd2544.js +4 -4
- package/dist/radio-button.min.js +4 -4
- package/dist/radio-group-manager-de7f9ab3.js +4 -4
- package/dist/{search-1b5a2d87.js → search-23232b04.js} +5 -5
- package/dist/search.min.js +5 -5
- package/dist/select-item-4ebf72a0.js +4 -4
- package/dist/select.min.js +17 -17
- package/dist/settings-97cd1c3a.js +4 -4
- package/dist/shared-enums-c6fe8c39.js +4 -4
- package/dist/side-panel.min.js +5 -5
- package/dist/skeleton-icon-bfc7d5c8.js +4 -4
- package/dist/skeleton-icon.min.js +4 -4
- package/dist/skeleton-placeholder-403f26a3.js +4 -4
- package/dist/skeleton-placeholder.min.js +4 -4
- package/dist/skeleton-text-9d02604f.js +4 -4
- package/dist/skeleton-text.min.js +4 -4
- package/dist/skip-to-content.min.js +4 -4
- package/dist/slider.min.js +4 -4
- package/dist/slug.min.js +5 -5
- package/dist/spread-d515f3f1.js +4 -4
- package/dist/stack.min.js +6 -6
- package/dist/state-ddd29b9d.js +4 -4
- package/dist/structured-list.min.js +4 -4
- package/dist/tabs.min.js +4 -4
- package/dist/tag.min.js +4 -4
- package/dist/tearsheet.min.js +5 -5
- package/dist/{text-input-672028f4.js → text-input-ead65188.js} +6 -6
- package/dist/text-input.min.js +6 -6
- package/dist/textarea.min.js +9 -9
- package/dist/tile.min.js +4 -4
- package/dist/toggle-tip.min.js +5 -5
- package/dist/toggle.min.js +4 -4
- package/dist/{toggletip-b1b58c28.js → toggletip-f95c53b0.js} +7 -7
- package/dist/{tooltip-content-51c6ffbc.js → tooltip-content-d784ae2b.js} +5 -5
- package/dist/tooltip.min.js +5 -5
- package/dist/ui-shell.min.js +18 -18
- package/dist/validity-d86ffa4f.js +4 -4
- package/es/components/chat-button/chat-button.js +2 -1
- package/es/components/chat-button/chat-button.js.map +1 -1
- package/es/components/copy/copy.d.ts +1 -1
- package/es/components/copy/copy.js +3 -2
- package/es/components/copy/copy.js.map +1 -1
- package/es/components/copy-button/copy-button.d.ts +1 -1
- package/es/components/copy-button/copy-button.js +3 -2
- package/es/components/copy-button/copy-button.js.map +1 -1
- package/es/components/data-table/table-skeleton.d.ts +1 -1
- package/es/components/data-table/table-skeleton.js +3 -2
- package/es/components/data-table/table-skeleton.js.map +1 -1
- package/es/components/file-uploader/demo-file-uploader.d.ts +1 -1
- package/es/components/file-uploader/demo-file-uploader.js +3 -2
- package/es/components/file-uploader/demo-file-uploader.js.map +1 -1
- package/es/components/file-uploader/file-uploader-button.d.ts +1 -1
- package/es/components/file-uploader/file-uploader-button.js +3 -2
- package/es/components/file-uploader/file-uploader-button.js.map +1 -1
- package/es/components/form-group/form-group.d.ts +1 -1
- package/es/components/form-group/form-group.js +3 -2
- package/es/components/form-group/form-group.js.map +1 -1
- package/es/components/icon-button/icon-button.js +2 -1
- package/es/components/icon-button/icon-button.js.map +1 -1
- package/es/components/layer/layer.d.ts +1 -1
- package/es/components/layer/layer.js +3 -2
- package/es/components/layer/layer.js.map +1 -1
- package/es/components/notification/actionable-notification.js +4 -3
- package/es/components/notification/actionable-notification.js.map +1 -1
- package/es/components/popover/popover-content.js +2 -1
- package/es/components/popover/popover-content.js.map +1 -1
- package/es/components/popover/popover.js +2 -1
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/progress-bar/progress-bar.d.ts +1 -1
- package/es/components/progress-bar/progress-bar.js +3 -2
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/select/select-skeleton.d.ts +1 -1
- package/es/components/select/select-skeleton.js +3 -2
- package/es/components/select/select-skeleton.js.map +1 -1
- package/es/components/stack/stack.d.ts +1 -1
- package/es/components/stack/stack.js +3 -2
- package/es/components/stack/stack.js.map +1 -1
- package/es/components/text-input/text-input-skeleton.d.ts +1 -1
- package/es/components/text-input/text-input-skeleton.js +3 -2
- package/es/components/text-input/text-input-skeleton.js.map +1 -1
- package/es/components/text-input/text-input.js +2 -1
- package/es/components/text-input/text-input.js.map +1 -1
- package/es/components/toggle-tip/toggletip.js +2 -1
- package/es/components/toggle-tip/toggletip.js.map +1 -1
- package/es/components/ui-shell/header-global-action.d.ts +1 -1
- package/es/components/ui-shell/header-global-action.js +3 -2
- package/es/components/ui-shell/header-global-action.js.map +1 -1
- package/es/components/ui-shell/header-panel.d.ts +1 -1
- package/es/components/ui-shell/header-panel.js +3 -2
- package/es/components/ui-shell/header-panel.js.map +1 -1
- package/es/components/ui-shell/header-side-nav-items.d.ts +1 -1
- package/es/components/ui-shell/header-side-nav-items.js +3 -2
- package/es/components/ui-shell/header-side-nav-items.js.map +1 -1
- package/es/components/ui-shell/switcher-item.d.ts +1 -1
- package/es/components/ui-shell/switcher-item.js +3 -2
- package/es/components/ui-shell/switcher-item.js.map +1 -1
- package/es/components/ui-shell/switcher.d.ts +1 -1
- package/es/components/ui-shell/switcher.js +3 -2
- package/es/components/ui-shell/switcher.js.map +1 -1
- package/package.json +2 -2
- package/dist/custom-element-975be15f.js +0 -78
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","names":["html","property","customElement","prefix","CDSButton","ICON_BUTTON_SIZE","ICON_BUTTON_TOOLTIP_ALIGNMENT","styles","CDSIconButton","_decorate","_initialize","_CDSButton","constructor","args","F","d","kind","decorators","reflect","type","String","key","value","Boolean","attribute","Number","updated","changedProperties","_this$shadowRoot","_this$querySelector","_this$shadowRoot2","shadowRoot","querySelector","classList","add","tooltipContent","textContent","setAttribute","_renderTooltipContent","_t","_","render","align","autoalign","closeOnActivation","defaultOpen","enterDelayMs","leaveDelayMs","_t2","_get","_getPrototypeOf","prototype","call","static"],"sources":["components/icon-button/icon-button.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html } from 'lit';\nimport { property
|
|
1
|
+
{"version":3,"file":"icon-button.js","names":["html","property","carbonElement","customElement","prefix","CDSButton","ICON_BUTTON_SIZE","ICON_BUTTON_TOOLTIP_ALIGNMENT","styles","CDSIconButton","_decorate","_initialize","_CDSButton","constructor","args","F","d","kind","decorators","reflect","type","String","key","value","Boolean","attribute","Number","updated","changedProperties","_this$shadowRoot","_this$querySelector","_this$shadowRoot2","shadowRoot","querySelector","classList","add","tooltipContent","textContent","setAttribute","_renderTooltipContent","_t","_","render","align","autoalign","closeOnActivation","defaultOpen","enterDelayMs","leaveDelayMs","_t2","_get","_getPrototypeOf","prototype","call","static"],"sources":["components/icon-button/icon-button.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport '../tooltip/index';\nimport '../button/index';\nimport CDSButton from '../button/button';\nimport { ICON_BUTTON_SIZE, ICON_BUTTON_TOOLTIP_ALIGNMENT } from './defs';\nimport styles from './icon-button.scss';\n\nexport { ICON_BUTTON_SIZE, ICON_BUTTON_TOOLTIP_ALIGNMENT };\n\n/**\n * Icon Button\n *\n */\n@customElement(`${prefix}-icon-button`)\nclass CDSIconButton extends CDSButton {\n /**\n * Specify how the trigger should align with the tooltip\n */\n @property({ reflect: true, type: String })\n align = 'top';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Determines whether the tooltip should close when inner content is activated (click, Enter or Space)\n */\n @property({ attribute: 'close-on-activation', reflect: true, type: Boolean })\n closeOnActivation = true;\n\n /**\n * Specify whether the tooltip should be open when it first renders\n */\n @property({ reflect: true, type: Boolean })\n defaultOpen = false;\n\n /**\n * Specify the duration in milliseconds to delay before displaying the tooltip\n */\n @property({ attribute: 'enter-delay-ms', type: Number })\n enterDelayMs = 100;\n\n /**\n * Specify the duration in milliseconds to delay before hiding the tooltip\n */\n @property({ attribute: 'leave-delay-ms', type: Number })\n leaveDelayMs = 300;\n\n /**\n * Specify the size of the Button. Defaults to `md`.\n */\n @property({ reflect: true })\n size = 'md';\n\n updated(changedProperties) {\n if (changedProperties) {\n this.shadowRoot\n ?.querySelector(`${prefix}-tooltip`)\n ?.shadowRoot?.querySelector(`.${prefix}--tooltip`)\n ?.classList.add(`${prefix}--icon-tooltip`);\n\n const tooltipContent = this.querySelector(\n '[slot=tooltip-content]'\n )?.textContent;\n this.shadowRoot\n ?.querySelector(`${prefix}-tooltip`)\n ?.querySelector(`button`)\n ?.setAttribute('aria-label', String(tooltipContent));\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n protected _renderTooltipContent() {\n return html`\n <cds-tooltip-content>\n <slot name=\"tooltip-content\"></slot>\n </cds-tooltip-content>\n `;\n }\n\n render() {\n const {\n align,\n autoalign,\n closeOnActivation,\n defaultOpen,\n enterDelayMs,\n leaveDelayMs,\n } = this;\n return html`\n <cds-tooltip\n ?autoalign=${autoalign}\n align=${align}\n ?defaultOpen=${defaultOpen}\n close-on-activation=\"${closeOnActivation}\"\n enter-delay-ms=${enterDelayMs}\n leave-delay-ms=${leaveDelayMs}>\n ${super.render()} ${this._renderTooltipContent()}\n </cds-tooltip>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSIconButton;\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAQ,KAAK;AAC1B,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAO,kBAAkB;AACzB,OAAO,iBAAiB;AACxB,OAAOC,SAAS,MAAM,kBAAkB;AACxC,SAASC,gBAAgB,EAAEC,6BAA6B,QAAQ,QAAQ;AACxE,OAAOC,MAAM,MAAM,wBAAoB;AAEvC,SAASF,gBAAgB,EAAEC,6BAA6B;;AAExD;AACA;AACA;AACA;AAHA,IAKME,aAAa,GAAAC,SAAA,EADlBP,aAAa,CAAC,GAAGC,MAAM,cAAc,CAAC,aAAAO,WAAA,EAAAC,UAAA;EAAvC,MACMH,aAAa,SAAAG,UAAA,CAAmB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA4FtC;EAAC;IAAAI,CAAA,EA5FKN,aAAa;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIhBjB,QAAQ,CAAC;QAAEkB,OAAO,EAAE,IAAI;QAAEC,IAAI,EAAEC;MAAO,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAClC,KAAK;MAAA;IAA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R,OAAOhD,IAAI,CAAAiD,GAAA,KAAAA,GAAA,GAAAR,CAAA;AACf;AACA,qBAFe;AACf,gBADe;AACf,uBADe;AACf,+BADe;AACf,yBADe;AACf,yBADe;AACf,UADe;AACf;AACA,KAFe,GAEMG,SAAS,EACdD,KAAK,EACEG,WAAW,EACHD,iBAAiB,EACvBE,YAAY,EACZC,YAAY,EAAAE,IAAA,CAAAC,eAAA,CArF/B1C,aAAa,CAAA2C,SAAA,mBAAAC,IAAA,QAsFS,IAAI,CAACd,qBAAqB,CAAC,CAAC;MAGtD;IAAC;MAAAtB,IAAA;MAAAqC,MAAA;MAAAhC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GA3FIH,SAAS;AA8FrC,eAAeI,aAAa","ignoreList":[]}
|
|
@@ -4,14 +4,15 @@ let _ = t => t,
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
*
|
|
7
|
-
* Copyright IBM Corp. 2019,
|
|
7
|
+
* Copyright IBM Corp. 2019, 2024
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { LitElement, html } from 'lit';
|
|
14
|
-
import { property
|
|
14
|
+
import { property } from 'lit/decorators.js';
|
|
15
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
15
16
|
import { prefix } from '../../globals/settings';
|
|
16
17
|
import styles from "././layer.css.js";
|
|
17
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer.js","names":["LitElement","html","property","customElement","prefix","styles","CDSLayer","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Number","reflect","key","value","updated","layers","querySelectorAll","selectorLayer","forEach","item","setAttribute","level","toString","dispatchEvent","CustomEvent","eventUseLayer","bubbles","cancelable","composed","detail","layer","render","_t","_","static"],"sources":["components/layer/layer.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019,
|
|
1
|
+
{"version":3,"file":"layer.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","CDSLayer","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Number","reflect","key","value","updated","layers","querySelectorAll","selectorLayer","forEach","item","setAttribute","level","toString","dispatchEvent","CustomEvent","eventUseLayer","bubbles","cancelable","composed","detail","layer","render","_t","_","static"],"sources":["components/layer/layer.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './layer.scss';\n\n/**\n * Basic layer\n *\n * @element cds-layer\n * @fires cds-use-layer\n * The name of the custom event fired when the \"use layer\" action occurs.\n * @slot children - The elements contained within the component.\n */\n@customElement(`${prefix}-layer`)\nclass CDSLayer extends LitElement {\n /**\n * Specify the layer level and override any existing levels based on hierarchy\n */\n @property({ type: Number, reflect: true })\n level = 0;\n\n @property()\n layers;\n\n updated() {\n if (!this.layers) {\n this.layers = this.querySelectorAll(\n (this.constructor as typeof CDSLayer).selectorLayer\n );\n }\n\n this.layers.forEach((item) => {\n (item as HTMLElement).setAttribute(\n 'level',\n ((this.level + 1) % 3).toString()\n );\n });\n\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof CDSLayer).eventUseLayer, {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n layer: this,\n level: this.level,\n },\n })\n );\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * A selector that selects a layer component.\n */\n static get selectorLayer() {\n return `${prefix}-layer`;\n }\n\n /**\n * A selector that selects a layer component.\n */\n static get eventUseLayer() {\n return `${prefix}-use-layer`;\n }\n\n static styles = sty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,CAAC,IAAI,CAAC,EAAEC,QAAQ,CAAC,CAClC,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,CAACC,aAAa,CAChB,IAAIC,WAAW,CAAE,IAAI,CAACrB,WAAW,CAAqBsB,aAAa,EAAE;UACnEC,OAAO,EAAE,IAAI;UACbC,UAAU,EAAE,IAAI;UAChBC,QAAQ,EAAE,IAAI;UACdC,MAAM,EAAE;YACNC,KAAK,EAAE,IAAI;YACXT,KAAK,EAAE,IAAI,CAACA;UACd;QACF,CAAC,CACH,CAAC;MACH;IAAC;MAAAd,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAkB,OAAA,EAAS;QACP,OAAOtC,IAAI,CAAAuC,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;;MAEA;AACF;AACA;IAFE;MAAA1B,IAAA;MAAA2B,MAAA;MAAAtB,GAAA;MAAAC,KAAA,EAGA,SAAAI,cAAA,EAA2B;QACzB,OAAO,GAAGpB,MAAM,QAAQ;MAC1B;;MAEA;AACF;AACA;IAFE;MAAAU,IAAA;MAAA2B,MAAA;MAAAtB,GAAA;MAAAC,KAAA,EAGA,SAAAY,cAAA,EAA2B;QACzB,OAAO,GAAG5B,MAAM,YAAY;MAC9B;IAAC;MAAAU,IAAA;MAAA2B,MAAA;MAAAtB,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAvDDN,UAAU;AA0DjC,eAAeO,QAAQ","ignoreList":[]}
|
|
@@ -8,14 +8,14 @@ let _ = t => t,
|
|
|
8
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
*
|
|
11
|
-
* Copyright IBM Corp. 2019,
|
|
11
|
+
* Copyright IBM Corp. 2019, 2024
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/ /**
|
|
16
16
|
* @license
|
|
17
17
|
*
|
|
18
|
-
* Copyright IBM Corp. 2019,
|
|
18
|
+
* Copyright IBM Corp. 2019, 2024
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -27,8 +27,9 @@ import InformationSquareFilled20 from "../../icons/information--square--filled/2
|
|
|
27
27
|
import WarningFilled20 from "../../icons/warning--filled/20";
|
|
28
28
|
import WarningAltFilled20 from "../../icons/warning--alt--filled/20";
|
|
29
29
|
import { html, svg } from 'lit';
|
|
30
|
-
import { property
|
|
30
|
+
import { property } from 'lit/decorators.js';
|
|
31
31
|
import { prefix } from '../../globals/settings';
|
|
32
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
32
33
|
import { NOTIFICATION_TYPE, NOTIFICATION_KIND } from './defs';
|
|
33
34
|
import CDSInlineNotification from './inline-notification';
|
|
34
35
|
import styles from "././actionable-notification.css.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actionable-notification.js","names":["CheckmarkFilled20","ErrorFilled20","InformationFilled20","InformationSquareFilled20","WarningFilled20","WarningAltFilled20","html","svg","property","customElement","prefix","NOTIFICATION_TYPE","NOTIFICATION_KIND","CDSInlineNotification","styles","HostListener","HostListenerMixin","iconsForKinds","SUCCESS","INFO","INFO_SQUARE","WARNING","WARNING_ALT","ERROR","CDSActionableNotification","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","ACTIONABLE","decorators","type","Boolean","reflect","String","attribute","event","closeOnEscape","open","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","_renderIcon","statusIconDescription","inline","icon","undefined","class","children","_t","_","_renderText","subtitle","title","_type","_t2","updated","changedProperties","button","querySelector","selectorActionButton","has","lowContrast","removeAttribute","hideCloseButton","hasFocus","focus","render","_t3","_renderButton","static"],"sources":["components/notification/actionable-notification.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport CheckmarkFilled20 from '@carbon/icons/lib/checkmark--filled/20';\nimport ErrorFilled20 from '@carbon/icons/lib/error--filled/20';\nimport InformationFilled20 from '@carbon/icons/lib/information--filled/20';\nimport InformationSquareFilled20 from '@carbon/icons/lib/information--square--filled/20';\nimport WarningFilled20 from '@carbon/icons/lib/warning--filled/20';\nimport WarningAltFilled20 from '@carbon/icons/lib/warning--alt--filled/20';\nimport { html, svg } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { NOTIFICATION_TYPE, NOTIFICATION_KIND } from './defs';\nimport CDSInlineNotification from './inline-notification';\nimport styles from './actionable-notification.scss';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\n\n/**\n * The default icons, keyed by notification kind.\n */\nconst iconsForKinds = {\n [NOTIFICATION_KIND.SUCCESS]: CheckmarkFilled20,\n [NOTIFICATION_KIND.INFO]: InformationFilled20,\n [NOTIFICATION_KIND.INFO_SQUARE]: InformationSquareFilled20,\n [NOTIFICATION_KIND.WARNING]: WarningFilled20,\n [NOTIFICATION_KIND.WARNING_ALT]: WarningAltFilled20,\n [NOTIFICATION_KIND.ERROR]: ErrorFilled20,\n};\n\n/**\n * Actionable notification.\n *\n * @element cds-actionable-notification\n * @slot subtitle - The subtitle.\n * @slot title - The title.\n * @fires cds-notification-beingclosed\n * The custom event fired before this notification is being closed upon a user gesture.\n * Cancellation of this event stops the user-initiated action of closing this notification.\n * @fires cds-notification-closed - The custom event fired after this notification is closed upon a user gesture.\n */\n@customElement(`${prefix}-actionable-notification`)\nclass CDSActionableNotification extends HostListenerMixin(\n CDSInlineNotification\n) {\n protected _type = NOTIFICATION_TYPE.ACTIONABLE;\n\n /**\n * Inline notification type.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Pass in the action button label that will be rendered within the ActionableNotification.\n */\n @property({ type: String, reflect: true, attribute: 'action-button-label' })\n actionButtonLabel = '';\n\n /**\n * Specify if pressing the escape key should close notifications\n */\n @property({ type: Boolean, reflect: true, attribute: 'close-on-escape' })\n closeOnEscape = true;\n\n /**\n * Specify if focus should be moved to the component when the notification contains actions\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-focus' })\n hasFocus = true;\n\n /**\n * Handles `keydown` event on this event.\n * Escape will close the notification if `closeOnEscape` is true\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = async (event: KeyboardEvent) => {\n const { key } = event;\n if (this.closeOnEscape && key === 'Escape') {\n this.open = false;\n }\n };\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'alertdialog');\n }\n super.connectedCallback();\n }\n\n protected _renderIcon() {\n const { statusIconDescription, kind, inline } = this;\n const { [kind]: icon } = iconsForKinds;\n return !icon\n ? undefined\n : icon({\n class: `${prefix}--${inline ? 'inline' : 'toast'}-notification__icon`,\n children: !statusIconDescription\n ? undefined\n : svg`<title>${statusIconDescription}</title>`,\n });\n }\n\n protected _renderText() {\n const { subtitle, title, _type: type } = this;\n return html`\n <div class=\"${prefix}--${type}-notification__text-wrapper\">\n <div class=\"${prefix}--${type}-notification__content\">\n <div class=\"${prefix}--${type}-notification__title\">\n ${title}<slot name=\"title\"></slot>\n </div>\n <div class=\"${prefix}--${type}-notification__subtitle\">\n ${subtitle}<slot name=\"subtitle\"></slot>\n </div>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The caption.\n */\n @property()\n caption = '';\n\n updated(changedProperties) {\n super.updated(changedProperties);\n const button = this.querySelector(\n (this.constructor as typeof CDSActionableNotification)\n .selectorActionButton\n );\n if (changedProperties.has('inline')) {\n button?.setAttribute('kind', this.inline ? 'ghost' : 'tertiary');\n }\n if (changedProperties.has('lowContrast')) {\n if (this.lowContrast) {\n button?.setAttribute('low-contrast', 'true');\n } else {\n button?.removeAttribute('low-contrast');\n }\n }\n if (changedProperties.has('hideCloseButton')) {\n if (this.hideCloseButton) {\n button?.setAttribute('hide-close-button', 'true');\n } else {\n button?.removeAttribute('hide-close-button');\n }\n }\n if (changedProperties.has('hasFocus')) {\n if (this.hasFocus) {\n this.focus();\n }\n }\n }\n\n render() {\n const { _type: type } = this;\n return html`\n <div class=\"${prefix}--${type}-notification__details\">\n ${this._renderIcon()} ${this._renderText()}\n </div>\n <slot name=\"action\"></slot>\n ${this._renderButton()}\n `;\n }\n\n /**\n * A selector that will return the action button element\n */\n static get selectorActionButton() {\n return `${prefix}-actionable-notification-button`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSActionableNotification;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,iBAAiB,MAAM,kCAAwC;AACtE,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,mBAAmB,MAAM,oCAA0C;AAC1E,OAAOC,yBAAyB,MAAM,4CAAkD;AACxF,OAAOC,eAAe,MAAM,gCAAsC;AAClE,OAAOC,kBAAkB,MAAM,qCAA2C;AAC1E,SAASC,IAAI,EAAEC,GAAG,QAAQ,KAAK;AAC/B,SAASC,QAAQ,EAAEC,aAAa,QAAQ,mBAAmB;AAC3D,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,QAAQ;AAC7D,OAAOC,qBAAqB,MAAM,uBAAuB;AACzD,OAAOC,MAAM,MAAM,oCAAgC;AACnD,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,iBAAiB,MAAM,oCAAoC;;AAElE;AACA;AACA;AACA,MAAMC,aAAa,GAAG;EACpB,CAACL,iBAAiB,CAACM,OAAO,GAAGlB,iBAAiB;EAC9C,CAACY,iBAAiB,CAACO,IAAI,GAAGjB,mBAAmB;EAC7C,CAAC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qBACF,CAAC;AAsID,eAAeW,yBAAyB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"actionable-notification.js","names":["CheckmarkFilled20","ErrorFilled20","InformationFilled20","InformationSquareFilled20","WarningFilled20","WarningAltFilled20","html","svg","property","prefix","carbonElement","customElement","NOTIFICATION_TYPE","NOTIFICATION_KIND","CDSInlineNotification","styles","HostListener","HostListenerMixin","iconsForKinds","SUCCESS","INFO","INFO_SQUARE","WARNING","WARNING_ALT","ERROR","CDSActionableNotification","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","ACTIONABLE","decorators","type","Boolean","reflect","String","attribute","event","closeOnEscape","open","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","_renderIcon","statusIconDescription","inline","icon","undefined","class","children","_t","_","_renderText","subtitle","title","_type","_t2","updated","changedProperties","button","querySelector","selectorActionButton","has","lowContrast","removeAttribute","hideCloseButton","hasFocus","focus","render","_t3","_renderButton","static"],"sources":["components/notification/actionable-notification.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport CheckmarkFilled20 from '@carbon/icons/lib/checkmark--filled/20';\nimport ErrorFilled20 from '@carbon/icons/lib/error--filled/20';\nimport InformationFilled20 from '@carbon/icons/lib/information--filled/20';\nimport InformationSquareFilled20 from '@carbon/icons/lib/information--square--filled/20';\nimport WarningFilled20 from '@carbon/icons/lib/warning--filled/20';\nimport WarningAltFilled20 from '@carbon/icons/lib/warning--alt--filled/20';\nimport { html, svg } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { NOTIFICATION_TYPE, NOTIFICATION_KIND } from './defs';\nimport CDSInlineNotification from './inline-notification';\nimport styles from './actionable-notification.scss';\nimport HostListener from '../../globals/decorators/host-listener';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\n\n/**\n * The default icons, keyed by notification kind.\n */\nconst iconsForKinds = {\n [NOTIFICATION_KIND.SUCCESS]: CheckmarkFilled20,\n [NOTIFICATION_KIND.INFO]: InformationFilled20,\n [NOTIFICATION_KIND.INFO_SQUARE]: InformationSquareFilled20,\n [NOTIFICATION_KIND.WARNING]: WarningFilled20,\n [NOTIFICATION_KIND.WARNING_ALT]: WarningAltFilled20,\n [NOTIFICATION_KIND.ERROR]: ErrorFilled20,\n};\n\n/**\n * Actionable notification.\n *\n * @element cds-actionable-notification\n * @slot subtitle - The subtitle.\n * @slot title - The title.\n * @fires cds-notification-beingclosed\n * The custom event fired before this notification is being closed upon a user gesture.\n * Cancellation of this event stops the user-initiated action of closing this notification.\n * @fires cds-notification-closed - The custom event fired after this notification is closed upon a user gesture.\n */\n@customElement(`${prefix}-actionable-notification`)\nclass CDSActionableNotification extends HostListenerMixin(\n CDSInlineNotification\n) {\n protected _type = NOTIFICATION_TYPE.ACTIONABLE;\n\n /**\n * Inline notification type.\n */\n @property({ type: Boolean, reflect: true })\n inline = false;\n\n /**\n * Pass in the action button label that will be rendered within the ActionableNotification.\n */\n @property({ type: String, reflect: true, attribute: 'action-button-label' })\n actionButtonLabel = '';\n\n /**\n * Specify if pressing the escape key should close notifications\n */\n @property({ type: Boolean, reflect: true, attribute: 'close-on-escape' })\n closeOnEscape = true;\n\n /**\n * Specify if focus should be moved to the component when the notification contains actions\n */\n @property({ type: Boolean, reflect: true, attribute: 'has-focus' })\n hasFocus = true;\n\n /**\n * Handles `keydown` event on this event.\n * Escape will close the notification if `closeOnEscape` is true\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = async (event: KeyboardEvent) => {\n const { key } = event;\n if (this.closeOnEscape && key === 'Escape') {\n this.open = false;\n }\n };\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'alertdialog');\n }\n super.connectedCallback();\n }\n\n protected _renderIcon() {\n const { statusIconDescription, kind, inline } = this;\n const { [kind]: icon } = iconsForKinds;\n return !icon\n ? undefined\n : icon({\n class: `${prefix}--${inline ? 'inline' : 'toast'}-notification__icon`,\n children: !statusIconDescription\n ? undefined\n : svg`<title>${statusIconDescription}</title>`,\n });\n }\n\n protected _renderText() {\n const { subtitle, title, _type: type } = this;\n return html`\n <div class=\"${prefix}--${type}-notification__text-wrapper\">\n <div class=\"${prefix}--${type}-notification__content\">\n <div class=\"${prefix}--${type}-notification__title\">\n ${title}<slot name=\"title\"></slot>\n </div>\n <div class=\"${prefix}--${type}-notification__subtitle\">\n ${subtitle}<slot name=\"subtitle\"></slot>\n </div>\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The caption.\n */\n @property()\n caption = '';\n\n updated(changedProperties) {\n super.updated(changedProperties);\n const button = this.querySelector(\n (this.constructor as typeof CDSActionableNotification)\n .selectorActionButton\n );\n if (changedProperties.has('inline')) {\n button?.setAttribute('kind', this.inline ? 'ghost' : 'tertiary');\n }\n if (changedProperties.has('lowContrast')) {\n if (this.lowContrast) {\n button?.setAttribute('low-contrast', 'true');\n } else {\n button?.removeAttribute('low-contrast');\n }\n }\n if (changedProperties.has('hideCloseButton')) {\n if (this.hideCloseButton) {\n button?.setAttribute('hide-close-button', 'true');\n } else {\n button?.removeAttribute('hide-close-button');\n }\n }\n if (changedProperties.has('hasFocus')) {\n if (this.hasFocus) {\n this.focus();\n }\n }\n }\n\n render() {\n const { _type: type } = this;\n return html`\n <div class=\"${prefix}--${type}-notification__details\">\n ${this._renderIcon()} ${this._renderText()}\n </div>\n <slot name=\"action\"></slot>\n ${this._renderButton()}\n `;\n }\n\n /**\n * A selector that will return the action button element\n */\n static get selectorActionButton() {\n return `${prefix}-actionable-notification-button`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSActionableNotification;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,EAAE;UACrC,IAAI,IAAI,CAACI,QAAQ,EAAE;YACjB,IAAI,CAACC,KAAK,CAAC,CAAC;UACd;QACF;MACF;IAAC;MAAA5C,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAED,SAAA2C,OAAA,EAAS;QACP,MAAM;UAAEb,KAAK,EAAE3B;QAAK,CAAC,GAAG,IAAI;QAC5B,OAAOhC,IAAI,CAAAyE,GAAA,KAAAA,GAAA,GAAAlB,CAAA;AACf,oBADe;AACf,UADe;AACf;AACA;AACA,QAHe;AACf,KADe,GACKpD,MAAM,EAAK6B,IAAI,EACzB,IAAI,CAACe,WAAW,CAAC,CAAC,EAAI,IAAI,CAACS,WAAW,CAAC,CAAC,EAG1C,IAAI,CAACkB,aAAa,CAAC,CAAC;MAE1B;;MAEA;AACF;AACA;IAFE;MAAA/C,IAAA;MAAAgD,MAAA;MAAA/C,GAAA;MAAAC,KAAA,EAGA,SAAAoC,qBAAA,EAAkC;QAChC,OAAO,GAAG9D,MAAM,iCAAiC;MACnD;IAAC;MAAAwB,IAAA;MAAAgD,MAAA;MAAA/C,GAAA;MAAAC,MAAA;QAAA,OAEepB,MAAM;MAAA;IAAA;EAAA;AAAA,GArIgBE,iBAAiB,CACvDH,qBACF,CAAC;AAsID,eAAeW,yBAAyB","ignoreList":[]}
|
|
@@ -12,7 +12,8 @@ let _ = t => t,
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { LitElement, html } from 'lit';
|
|
15
|
-
import { property
|
|
15
|
+
import { property } from 'lit/decorators.js';
|
|
16
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
16
17
|
import { prefix } from '../../globals/settings';
|
|
17
18
|
import styles from "././popover.css.js";
|
|
18
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-content.js","names":["LitElement","html","property","customElement","prefix","styles","CDSPopoverContent","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","reflect","type","String","key","value","Boolean","render","autoalign","_t","_","_t2","static"],"sources":["components/popover/popover-content.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property
|
|
1
|
+
{"version":3,"file":"popover-content.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","CDSPopoverContent","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","reflect","type","String","key","value","Boolean","render","autoalign","_t","_","_t2","static"],"sources":["components/popover/popover-content.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './popover.scss';\n\n/**\n * Popover.\n *\n * @element cds-popover\n */\n@customElement(`${prefix}-popover-content`)\nclass CDSPopoverContent extends LitElement {\n /**\n * Specify the popover alignment\n */\n @property({ reflect: true, type: String })\n align = '';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Specify whether a caret should be rendered\n */\n @property({ type: Boolean, reflect: true })\n caret;\n\n /**\n * Specify whether a dropShadow should be rendered\n */\n @property({ type: Boolean, reflect: true })\n dropShadow = true;\n\n /**\n * Specify whether the component is currently open or closed\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Render the component using the tab tip variant\n */\n @property({ type: Boolean, reflect: true })\n tabTip = false;\n\n /**\n * The shadow slot this popover content should be in.\n */\n @property({ reflect: true })\n slot = 'content';\n\n render() {\n if (this.autoalign) {\n return html`\n <span class=\"${prefix}--popover-content\">\n <slot> </slot>\n <span class=\"${prefix}--popover-caret\"></span>\n </span>\n `;\n } else {\n return html`\n <span class=\"${prefix}--popover-content\">\n <slot> </slot>\n </span>\n <span class=\"${prefix}--popover-caret\"></span>\n `;\n }\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSPopoverContent;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,oBAAgB;;AAEnC;AACA;AACA;AACA;AACA,GAJA;AACA;AACA;AACA;AACA;AAJA,IAMMC,iBAAiB,GAAAC,SAAA,EADtBJ,aAAa,CAAC,GAAGC,MAAM,kBAAkB,CAAC,aAAAI,WAAA,EAAAC,WAAA;EAA3C,MACMH,iBAAiB,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8D3C;EAAC;IAAAI,CAAA,EA9DKN,iBAAiB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIpBd,QAAQ,CAAC;QAAEe,OAAO,EAAE,IAAI;QAAEC,IAAI,EAAEC;MAAO,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAClC,EAAE;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAKTd,QAAQ,CAAC;QAAEgB,IAAI,EAAEI,OAAO;QAAEL,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAG,GAAA;MAAAC,MAAA;QAAA,OAC/B,KAAK;MAAA;IAAA;MAAAN,IAAA;MAAAC,UAAA,GAKhBd,QAAQ,CAAC;QAAEgB,IAAI,EAAEI,OAAO;QAAEL,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAG,GAAA;MAAAC,KAAA;IAAA;MAAAN,IAAA;MAAAC,U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AAA;IAAA;EAAA;AAAA,GA7DQN,UAAU;AAgE1C,eAAeO,iBAAiB","ignoreList":[]}
|
|
@@ -12,7 +12,8 @@ let _ = t => t,
|
|
|
12
12
|
|
|
13
13
|
import { classMap } from 'lit/directives/class-map.js';
|
|
14
14
|
import { LitElement, html } from 'lit';
|
|
15
|
-
import { property,
|
|
15
|
+
import { property, query } from 'lit/decorators.js';
|
|
16
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
16
17
|
import { prefix } from '../../globals/settings';
|
|
17
18
|
import styles from "././popover.css.js";
|
|
18
19
|
import PopoverController from '../../globals/controllers/popover-controller';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["classMap","LitElement","html","property","customElement","query","prefix","styles","PopoverController","CDSPopover","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","decorators","reflect","type","String","Boolean","_handleSlotChange","target","tabTip","component","assignedNodes","filter","node","nodeType","Node","TEXT_NODE","textContent","trim","classList","add","requestUpdate","updated","changedProperties","selectorPopoverContent","forEach","name","has","querySelector","autoalign","open","_content$shadowRoot","_content$shadowRoot2","button","_triggerSlotNode","assignedElements","content","_contentSlotNode","tooltip","shadowRoot","selectorPopoverContentClass","arrowElement","selectorPopoverCaret","_this$popoverControll","popoverController","setPlacement","trigger","caret","undefined","flip","alignment","align","render","dropShadow","highContrast","handleSlotChange","classes","_t","_","static"],"sources":["components/popover/popover.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property, customElement, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport styles from './popover.scss';\nimport CDSPopoverContent from './popover-content';\nimport PopoverController from '../../globals/controllers/popover-controller';\n\n/**\n * Popover.\n *\n * @element cds-popover\n */\n@customElement(`${prefix}-popover`)\nclass CDSPopover extends LitElement {\n /**\n * Create popover controller instance\n */\n private popoverController = new PopoverController(this);\n\n /**\n * The `<slot>` element in the shadow DOM.\n */\n @query('slot')\n private _triggerSlotNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element in the shadow DOM.\n */\n @query('slot[name=\"content\"]')\n private _contentSlotNode!: HTMLSlotElement;\n\n /**\n * Specify direction of alignment\n */\n @property({ reflect: true, type: String })\n align = '';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Specify whether a caret should be rendered\n */\n @property({ type: Boolean, reflect: true })\n caret = true;\n\n /**\n * Specify whether a dropShadow should be rendered\n */\n @property({ type: Boolean, reflect: true })\n dropShadow = true;\n\n /**\n * Render the component using the high-contrast variant\n */\n @property({ type: Boolean, reflect: true })\n highContrast = false;\n\n /**\n * Specify whether the component is currently open or closed\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Render the component using the tab tip variant\n */\n @property({ type: Boolean, reflect: true })\n tabTip = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n if (this.tabTip) {\n const component = (target as HTMLSlotElement)\n .assignedNodes()\n .filter(\n (node) =>\n node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n (component[0] as HTMLElement).classList.add(\n `${prefix}--popover--tab-tip__button`\n );\n }\n this.requestUpdate();\n }\n\n updated(changedProperties) {\n const { selectorPopoverContent } = this.constructor as typeof CDSPopover;\n ['open', 'align', 'autoalign', 'caret', 'dropShadow', 'tabTip'].forEach(\n (name) => {\n if (changedProperties.has(name)) {\n const { [name as keyof CDSPopover]: value } = this;\n if (this.querySelector(selectorPopoverContent) as CDSPopoverContent) {\n (this.querySelector(selectorPopoverContent) as CDSPopoverContent)[\n name\n ] = value;\n }\n }\n }\n );\n\n if (this.autoalign && this.open) {\n // auto align functionality with @floating-ui/dom library\n const button = this._triggerSlotNode.assignedElements()[0];\n const content = this._contentSlotNode.assignedElements()[0];\n\n const tooltip = content?.shadowRoot?.querySelector(\n CDSPopover.selectorPopoverContentClass\n );\n const arrowElement = content?.shadowRoot?.querySelector(\n CDSPopover.selectorPopoverCaret\n );\n\n if (button && tooltip) {\n this.popoverController?.setPlacement({\n trigger: button as HTMLElement,\n target: tooltip as HTMLElement,\n arrowElement:\n this.caret && arrowElement\n ? (arrowElement as HTMLElement)\n : undefined,\n caret: this.caret,\n flip: true,\n alignment: this.align,\n });\n }\n }\n }\n\n render() {\n const {\n dropShadow,\n highContrast,\n open,\n tabTip,\n _handleSlotChange: handleSlotChange,\n } = this;\n if (tabTip) {\n this.caret = tabTip ? false : true;\n }\n this.align = this.align ? this.align : tabTip ? 'bottom-left' : 'bottom';\n\n const classes = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: this.caret,\n [`${prefix}--popover--drop-shadow`]: dropShadow,\n [`${prefix}--popover--high-contrast`]: highContrast,\n [`${prefix}--popover--open`]: open,\n [`${prefix}--popover--${this.align}`]: true,\n [`${prefix}--popover--tab-tip`]: tabTip,\n });\n return html`\n <span class=\"${classes}\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"content\"><slot>\n </span>\n `;\n }\n\n /**\n * A selector that will return popover content element within\n * CDSPopoverContent's shadowRoot.\n */\n static get selectorPopoverContentClass() {\n return `.${prefix}--popover-content`;\n }\n\n /**\n * A selector that will return popover caret element within\n * CDSPopoverContent's shadowRoot.\n */\n static get selectorPopoverCaret() {\n return `.${prefix}--popover-caret`;\n }\n\n /**\n * A selector that will return the CDSPopoverContent.\n */\n static get selectorPopoverContent() {\n return `${prefix}-popover-content`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSPopover;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,UAAU,EA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C,CAAC,GAAG/D,MAAM,oBAAoB,GAAGqB;QACnC,CAAC,CAAC;QACF,OAAOzB,IAAI,CAAAyE,EAAA,KAAAA,EAAA,GAAAC,CAAA;AACf,mBADe;AACf,2BADe;AACf;AACA;AACA,KAHe,GACIF,OAAO,EACCD,gBAAgB;MAIzC;;MAEA;AACF;AACA;AACA;IAHE;MAAAxD,IAAA;MAAA4D,MAAA;MAAA3D,GAAA;MAAAC,KAAA,EAIA,SAAAuC,4BAAA,EAAyC;QACvC,OAAO,IAAIpD,MAAM,mBAAmB;MACtC;;MAEA;AACF;AACA;AACA;IAHE;MAAAW,IAAA;MAAA4D,MAAA;MAAA3D,GAAA;MAAAC,KAAA,EAIA,SAAAyC,qBAAA,EAAkC;QAChC,OAAO,IAAItD,MAAM,iBAAiB;MACpC;;MAEA;AACF;AACA;IAFE;MAAAW,IAAA;MAAA4D,MAAA;MAAA3D,GAAA;MAAAC,KAAA,EAGA,SAAAuB,uBAAA,EAAoC;QAClC,OAAO,GAAGpC,MAAM,kBAAkB;MACpC;IAAC;MAAAW,IAAA;MAAA4D,MAAA;MAAA3D,GAAA;MAAAC,MAAA;QAAA,OAEeZ,MAAM;MAAA;IAAA;EAAA;AAAA,GA9KCN,UAAU;AAiLnC,eAAeQ,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"popover.js","names":["classMap","LitElement","html","property","query","carbonElement","customElement","prefix","styles","PopoverController","CDSPopover","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","decorators","reflect","type","String","Boolean","_handleSlotChange","target","tabTip","component","assignedNodes","filter","node","nodeType","Node","TEXT_NODE","textContent","trim","classList","add","requestUpdate","updated","changedProperties","selectorPopoverContent","forEach","name","has","querySelector","autoalign","open","_content$shadowRoot","_content$shadowRoot2","button","_triggerSlotNode","assignedElements","content","_contentSlotNode","tooltip","shadowRoot","selectorPopoverContentClass","arrowElement","selectorPopoverCaret","_this$popoverControll","popoverController","setPlacement","trigger","caret","undefined","flip","alignment","align","render","dropShadow","highContrast","handleSlotChange","classes","_t","_","static"],"sources":["components/popover/popover.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './popover.scss';\nimport CDSPopoverContent from './popover-content';\nimport PopoverController from '../../globals/controllers/popover-controller';\n\n/**\n * Popover.\n *\n * @element cds-popover\n */\n@customElement(`${prefix}-popover`)\nclass CDSPopover extends LitElement {\n /**\n * Create popover controller instance\n */\n private popoverController = new PopoverController(this);\n\n /**\n * The `<slot>` element in the shadow DOM.\n */\n @query('slot')\n private _triggerSlotNode!: HTMLSlotElement;\n\n /**\n * The `<slot>` element in the shadow DOM.\n */\n @query('slot[name=\"content\"]')\n private _contentSlotNode!: HTMLSlotElement;\n\n /**\n * Specify direction of alignment\n */\n @property({ reflect: true, type: String })\n align = '';\n\n /**\n * Specify whether a auto align functionality should be applied\n */\n @property({ type: Boolean, reflect: true })\n autoalign = false;\n\n /**\n * Specify whether a caret should be rendered\n */\n @property({ type: Boolean, reflect: true })\n caret = true;\n\n /**\n * Specify whether a dropShadow should be rendered\n */\n @property({ type: Boolean, reflect: true })\n dropShadow = true;\n\n /**\n * Render the component using the high-contrast variant\n */\n @property({ type: Boolean, reflect: true })\n highContrast = false;\n\n /**\n * Specify whether the component is currently open or closed\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Render the component using the tab tip variant\n */\n @property({ type: Boolean, reflect: true })\n tabTip = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n if (this.tabTip) {\n const component = (target as HTMLSlotElement)\n .assignedNodes()\n .filter(\n (node) =>\n node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n (component[0] as HTMLElement).classList.add(\n `${prefix}--popover--tab-tip__button`\n );\n }\n this.requestUpdate();\n }\n\n updated(changedProperties) {\n const { selectorPopoverContent } = this.constructor as typeof CDSPopover;\n ['open', 'align', 'autoalign', 'caret', 'dropShadow', 'tabTip'].forEach(\n (name) => {\n if (changedProperties.has(name)) {\n const { [name as keyof CDSPopover]: value } = this;\n if (this.querySelector(selectorPopoverContent) as CDSPopoverContent) {\n (this.querySelector(selectorPopoverContent) as CDSPopoverContent)[\n name\n ] = value;\n }\n }\n }\n );\n\n if (this.autoalign && this.open) {\n // auto align functionality with @floating-ui/dom library\n const button = this._triggerSlotNode.assignedElements()[0];\n const content = this._contentSlotNode.assignedElements()[0];\n\n const tooltip = content?.shadowRoot?.querySelector(\n CDSPopover.selectorPopoverContentClass\n );\n const arrowElement = content?.shadowRoot?.querySelector(\n CDSPopover.selectorPopoverCaret\n );\n\n if (button && tooltip) {\n this.popoverController?.setPlacement({\n trigger: button as HTMLElement,\n target: tooltip as HTMLElement,\n arrowElement:\n this.caret && arrowElement\n ? (arrowElement as HTMLElement)\n : undefined,\n caret: this.caret,\n flip: true,\n alignment: this.align,\n });\n }\n }\n }\n\n render() {\n const {\n dropShadow,\n highContrast,\n open,\n tabTip,\n _handleSlotChange: handleSlotChange,\n } = this;\n if (tabTip) {\n this.caret = tabTip ? false : true;\n }\n this.align = this.align ? this.align : tabTip ? 'bottom-left' : 'bottom';\n\n const classes = classMap({\n [`${prefix}--popover-container`]: true,\n [`${prefix}--popover--caret`]: this.caret,\n [`${prefix}--popover--drop-shadow`]: dropShadow,\n [`${prefix}--popover--high-contrast`]: highContrast,\n [`${prefix}--popover--open`]: open,\n [`${prefix}--popover--${this.align}`]: true,\n [`${prefix}--popover--tab-tip`]: tabTip,\n });\n return html`\n <span class=\"${classes}\">\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <slot name=\"content\"><slot>\n </span>\n `;\n }\n\n /**\n * A selector that will return popover content element within\n * CDSPopoverContent's shadowRoot.\n */\n static get selectorPopoverContentClass() {\n return `.${prefix}--popover-content`;\n }\n\n /**\n * A selector that will return popover caret element within\n * CDSPopoverContent's shadowRoot.\n */\n static get selectorPopoverCaret() {\n return `.${prefix}--popover-caret`;\n }\n\n /**\n * A selector that will return the CDSPopoverContent.\n */\n static get selectorPopoverContent() {\n return `${prefix}-popover-content`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSPopover;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,6BAA6B;AACtD,SAASC,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,EAAEC,KAAK,QAAQ,mBAAmB;AACnD,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,oBAAgB;AAEnC,OAAOC,iBAAiB,MAAM,8CAA8C;;AAE5E;AACA;AACA;AACA;AACA;AAJA,IAMMC,UAAU,GAAAC,SAAA,EADfL,aAAa,CAAC,GAAGC,MAAM,UAAU,CAAC,aAAAK,WAAA,EAAAC,WAAA;EAAnC,MACMH,UAAU,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA+KpC;EAAC;IAAAI,CAAA,EA/KKN,UAAU;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAIc,IAAIX,iBAAiB,CAAC,IAAI,CAAC;MAAA;IAAA;MAAAS,IAAA;MAAAG,UAAA,GAKtDjB,KAAK,CAAC,MAAM,CAAC;MAAAe,GAAA;MAAAC,KAAA;IAAA;MAAAF,IAAA;MAAAG,UAAA,GAMbjB,KAAK,CAAC,sBAAsB,CAAC;MAAAe,GAAA;MAAAC,KAAA;IAAA;MAAAF,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iLnC,eAAeS,UAAU","ignoreList":[]}
|
|
@@ -5,14 +5,15 @@ let _ = t => t,
|
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
*
|
|
8
|
-
* Copyright IBM Corp. 2019,
|
|
8
|
+
* Copyright IBM Corp. 2019, 2024
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { LitElement, html } from 'lit';
|
|
15
|
-
import { property
|
|
15
|
+
import { property } from 'lit/decorators.js';
|
|
16
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
16
17
|
import { classMap } from 'lit/directives/class-map.js';
|
|
17
18
|
import ErrorFilled16 from "../../icons/error--filled/16";
|
|
18
19
|
import CheckmarkFilled16 from "../../icons/checkmark--filled/16";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress-bar.js","names":["LitElement","html","property","customElement","classMap","ErrorFilled16","CheckmarkFilled16","PROGRESS_BAR_SIZE","PROGRESS_BAR_STATUS","PROGRESS_BAR_TYPE","prefix","styles","CDSProgressBar","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","String","attribute","reflect","key","value","Boolean","Number","BIG","ACTIVE","DEFAULT","_cappedValue","max","status","cappedValue","ERROR","FINISHED","updated","changedProperties","has","percentage","bar","shadowRoot","querySelector","style","transform","render","helperText","hideLabel","label","size","isFinished","isError","indeterminate","undefined","statusIcon","class","wrapperClasses","labelClasses","_t","_","_t2","static"],"sources":["components/progress-bar/progress-bar.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property, customElement } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport {\n PROGRESS_BAR_SIZE,\n PROGRESS_BAR_STATUS,\n PROGRESS_BAR_TYPE,\n} from './defs';\nimport { prefix } from '../../globals/settings';\nimport styles from './progress-bar.scss';\n\nexport { PROGRESS_BAR_SIZE, PROGRESS_BAR_STATUS, PROGRESS_BAR_TYPE };\n\n/**\n * Progress bar.\n *\n * @element cds-progress-bar\n */\n@customElement(`${prefix}-progress-bar`)\nclass CDSProgressBar extends LitElement {\n /**\n * The current progress as a textual representation.\n */\n @property({ type: String, attribute: 'helper-text', reflect: true })\n helperText;\n\n /**\n * Whether the label should be visually hidden.\n */\n @property({ type: Boolean, attribute: 'hide-label', reflect: true })\n hideLabel;\n\n /**\n * A label describing the progress bar.\n */\n @property({ type: String })\n label;\n\n /**\n * The maximum value.\n */\n @property({ type: Number, reflect: true })\n max = 100;\n\n /**\n * Specify the size of the ProgressBar.\n */\n @property({ type: String, reflect: true })\n size = PROGRESS_BAR_SIZE.BIG;\n\n /**\n * Specify the status.\n */\n @property({ type: String, reflect: true })\n status = PROGRESS_BAR_STATUS.ACTIVE;\n\n /**\n * Defines the alignment variant of the progress bar.\n */\n @property({ type: String, reflect: true })\n type = PROGRESS_BAR_TYPE.DEFAULT;\n\n /**\n * The current value.\n */\n @property({ type: Number, reflect: true })\n value;\n\n protected get _cappedValue() {\n const { value, max, status } = this;\n\n let cappedValue = value;\n if (cappedValue > max) {\n cappedValue = max;\n }\n if (cappedValue < 0) {\n cappedValue = 0;\n }\n if (status === PROGRESS_BAR_STATUS.ERROR) {\n cappedValue = 0;\n } else if (status === PROGRESS_BAR_STATUS.FINISHED) {\n cappedValue = max;\n }\n\n return cappedValue;\n }\n\n updated(changedProperties) {\n if (\n changedProperties.has('value') ||\n changedProperties.has('max') ||\n changedProperties.has('status')\n ) {\n const { _cappedValue: cappedValue, max, status } = this;\n\n const percentage: number = cappedValue / max;\n\n const bar = this.shadowRoot!.querySelector(\n `.${prefix}--progress-bar__bar`\n ) as HTMLElement;\n\n if (\n status != PROGRESS_BAR_STATUS.ERROR &&\n status != PROGRESS_BAR_STATUS.FINISHED\n ) {\n bar.style.transform = `scaleX(${percentage})`;\n } else {\n bar.style.transform = 'none';\n }\n }\n }\n\n render() {\n const {\n _cappedValue: cappedValue,\n helperText,\n hideLabel,\n label,\n max,\n size,\n status,\n type,\n value,\n } = this;\n\n const isFinished = status === PROGRESS_BAR_STATUS.FINISHED;\n const isError = status === PROGRESS_BAR_STATUS.ERROR;\n\n const indeterminate =\n !isFinished && !isError && (value === null || value === undefined);\n\n let statusIcon = null;\n\n if (isError) {\n statusIcon = ErrorFilled16({\n class: `${prefix}--progress-bar__status-icon`,\n });\n } else if (isFinished) {\n statusIcon = CheckmarkFilled16({\n class: `${prefix}--progress-bar__status-icon`,\n });\n }\n\n const wrapperClasses = classMap({\n [`${prefix}--progress-bar`]: true,\n [`${prefix}--progress-bar--${size}`]: true,\n [`${prefix}--progress-bar--${type}`]: true,\n [`${prefix}--progress-bar--indeterminate`]: indeterminate,\n [`${prefix}--progress-bar--finished`]: isFinished,\n [`${prefix}--progress-bar--error`]: isError,\n });\n\n const labelClasses = classMap({\n [`${prefix}--progress-bar__label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n\n return html` <div class=\"${wrapperClasses}\">\n <div class=\"${labelClasses}\">\n <span class=\"${prefix}--progress-bar__label-text\">${label}</span>\n ${statusIcon}\n </div>\n <div\n class=\"${prefix}--progress-bar__track\"\n role=\"progressbar\"\n aria-busy=\"${!isFinished}\"\n aria-invalid=\"${isError}\"\n aria-valuemin=\"${!indeterminate ? 0 : null}\"\n aria-valuemax=\"${!indeterminate ? max : null}\"\n aria-valuenow=\"${!indeterminate ? cappedValue : null}\">\n <div class=\"${prefix}--progress-bar__bar\"></div>\n </div>\n ${helperText\n ? html`<div class=\"${prefix}--progress-bar__helper-text\">\n ${helperText}\n <div class=\"${prefix}--visually-hidden\" aria-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He;AACf;AACA,qBAFe;AACf,wBADe;AACf,yBADe;AACf,yBADe;AACf,yBADe;AACf,sBADe;AACf;AACA,QAFe;AACf,WADe,GAAgBH,cAAc,EACzBC,YAAY,EACTlD,MAAM,EAA+ByC,KAAK,EACvDM,UAAU,EAGH/C,MAAM,EAEF,CAAC2C,UAAU,EACRC,OAAO,EACN,CAACC,aAAa,GAAG,CAAC,GAAG,IAAI,EACzB,CAACA,aAAa,GAAGrB,GAAG,GAAG,IAAI,EAC3B,CAACqB,aAAa,GAAGnB,WAAW,GAAG,IAAI,EACtC1B,MAAM,EAEpBuC,UAAU,GACRhD,IAAI,CAAA8D,GAAA,KAAAA,GAAA,GAAAD,CAAA;AACd,cADc;AACd,0BADc;AACd,gBADc;AACd;AACA,iBAFc,GAAepD,MAAM,EACrBuC,UAAU,EACEvC,MAAM,EAChB2C,UAAU,GAAG,MAAM,GAAG,SAAS,IAGrC,IAAI;MAEZ;IAAC;MAAAjC,IAAA;MAAA4C,MAAA;MAAAtC,GAAA;MAAAC,MAAA;QAAA,OAEehB,MAAM;MAAA;IAAA;EAAA;AAAA,GApKKX,UAAU;AAuKvC,eAAeY,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"progress-bar.js","names":["LitElement","html","property","carbonElement","customElement","classMap","ErrorFilled16","CheckmarkFilled16","PROGRESS_BAR_SIZE","PROGRESS_BAR_STATUS","PROGRESS_BAR_TYPE","prefix","styles","CDSProgressBar","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","String","attribute","reflect","key","value","Boolean","Number","BIG","ACTIVE","DEFAULT","_cappedValue","max","status","cappedValue","ERROR","FINISHED","updated","changedProperties","has","percentage","bar","shadowRoot","querySelector","style","transform","render","helperText","hideLabel","label","size","isFinished","isError","indeterminate","undefined","statusIcon","class","wrapperClasses","labelClasses","_t","_","_t2","static"],"sources":["components/progress-bar/progress-bar.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { classMap } from 'lit/directives/class-map.js';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport {\n PROGRESS_BAR_SIZE,\n PROGRESS_BAR_STATUS,\n PROGRESS_BAR_TYPE,\n} from './defs';\nimport { prefix } from '../../globals/settings';\nimport styles from './progress-bar.scss';\n\nexport { PROGRESS_BAR_SIZE, PROGRESS_BAR_STATUS, PROGRESS_BAR_TYPE };\n\n/**\n * Progress bar.\n *\n * @element cds-progress-bar\n */\n@customElement(`${prefix}-progress-bar`)\nclass CDSProgressBar extends LitElement {\n /**\n * The current progress as a textual representation.\n */\n @property({ type: String, attribute: 'helper-text', reflect: true })\n helperText;\n\n /**\n * Whether the label should be visually hidden.\n */\n @property({ type: Boolean, attribute: 'hide-label', reflect: true })\n hideLabel;\n\n /**\n * A label describing the progress bar.\n */\n @property({ type: String })\n label;\n\n /**\n * The maximum value.\n */\n @property({ type: Number, reflect: true })\n max = 100;\n\n /**\n * Specify the size of the ProgressBar.\n */\n @property({ type: String, reflect: true })\n size = PROGRESS_BAR_SIZE.BIG;\n\n /**\n * Specify the status.\n */\n @property({ type: String, reflect: true })\n status = PROGRESS_BAR_STATUS.ACTIVE;\n\n /**\n * Defines the alignment variant of the progress bar.\n */\n @property({ type: String, reflect: true })\n type = PROGRESS_BAR_TYPE.DEFAULT;\n\n /**\n * The current value.\n */\n @property({ type: Number, reflect: true })\n value;\n\n protected get _cappedValue() {\n const { value, max, status } = this;\n\n let cappedValue = value;\n if (cappedValue > max) {\n cappedValue = max;\n }\n if (cappedValue < 0) {\n cappedValue = 0;\n }\n if (status === PROGRESS_BAR_STATUS.ERROR) {\n cappedValue = 0;\n } else if (status === PROGRESS_BAR_STATUS.FINISHED) {\n cappedValue = max;\n }\n\n return cappedValue;\n }\n\n updated(changedProperties) {\n if (\n changedProperties.has('value') ||\n changedProperties.has('max') ||\n changedProperties.has('status')\n ) {\n const { _cappedValue: cappedValue, max, status } = this;\n\n const percentage: number = cappedValue / max;\n\n const bar = this.shadowRoot!.querySelector(\n `.${prefix}--progress-bar__bar`\n ) as HTMLElement;\n\n if (\n status != PROGRESS_BAR_STATUS.ERROR &&\n status != PROGRESS_BAR_STATUS.FINISHED\n ) {\n bar.style.transform = `scaleX(${percentage})`;\n } else {\n bar.style.transform = 'none';\n }\n }\n }\n\n render() {\n const {\n _cappedValue: cappedValue,\n helperText,\n hideLabel,\n label,\n max,\n size,\n status,\n type,\n value,\n } = this;\n\n const isFinished = status === PROGRESS_BAR_STATUS.FINISHED;\n const isError = status === PROGRESS_BAR_STATUS.ERROR;\n\n const indeterminate =\n !isFinished && !isError && (value === null || value === undefined);\n\n let statusIcon = null;\n\n if (isError) {\n statusIcon = ErrorFilled16({\n class: `${prefix}--progress-bar__status-icon`,\n });\n } else if (isFinished) {\n statusIcon = CheckmarkFilled16({\n class: `${prefix}--progress-bar__status-icon`,\n });\n }\n\n const wrapperClasses = classMap({\n [`${prefix}--progress-bar`]: true,\n [`${prefix}--progress-bar--${size}`]: true,\n [`${prefix}--progress-bar--${type}`]: true,\n [`${prefix}--progress-bar--indeterminate`]: indeterminate,\n [`${prefix}--progress-bar--finished`]: isFinished,\n [`${prefix}--progress-bar--error`]: isError,\n });\n\n const labelClasses = classMap({\n [`${prefix}--progress-bar__label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n\n return html` <div class=\"${wrapperClasses}\">\n <div class=\"${labelClasses}\">\n <span class=\"${prefix}--progress-bar__label-text\">${label}</span>\n ${statusIcon}\n </div>\n <div\n class=\"${prefix}--progress-bar__track\"\n role=\"progressbar\"\n aria-busy=\"${!isFinished}\"\n aria-invalid=\"${isError}\"\n aria-valuemin=\"${!indeterminate ? 0 : null}\"\n aria-valuemax=\"${!indeterminate ? max : null}\"\n aria-valuenow=\"${!indeterminate ? cappedValue : null}\">\n <div class=\"${prefix}--progress-bar__bar\"></div>\n </div>\n ${helperText\n ? html`<div class=\"${prefix}--progress-bar__helper-text\">\n ${helperText}\n <div class=\"${prefix}--visually-hidden\" aria-live=\"polite\">\n ${isFinished ? 'Done' : 'Loading'}\n </div>\n </div>`\n : null}\n </div>`;\n }\n\n static styles = styles;\n}\n\nexport default CDSProgressBar;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,QAAQ,QAAQ,6BAA6B;AACtD,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,iBAAiB,MAAM,kCAAwC;AACtE,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,QACZ,QAAQ;AACf,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,yBAAqB;AAExC,SAASJ,iBAAiB,EAAEC,mBAAmB,EAAEC,iBAAiB;;AAElE;AACA;AACA;AACA;AACA;AAJA,IAMMG,cAAc,GAAAC,SAAA,EADnBV,aAAa,CAAC,GAAGO,MAAM,eAAe,CAAC,aAAAI,WAAA,EAAAC,WAAA;EAAxC,MACMH,cAAc,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAqKxC;EAAC;IAAAI,CAAA,EArKKN,cAAc;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIjBpB,QAAQ,CAAC;QAAEqB,IAAI,EAAEC,MAAM;QAAEC,SAAS,EAAE,aAAa;QAAEC,OAAO,EAAE;MAAK,CAAC,CAAC;MAAAC,GAAA;MAAAC,KAAA;IA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AQ,CAAC;UAC5B,CAAC,GAAGM,MAAM,uBAAuB,GAAG,IAAI;UACxC,CAAC,GAAGA,MAAM,mBAAmB,GAAGwC;QAClC,CAAC,CAAC;QAEF,OAAOlD,IAAI,CAAA6D,EAAA,KAAAA,EAAA,GAAAC,CAAA;AACf,oBADe;AACf,uBADe;AACf,UADe;AACf;AACA;AACA,iBAHe;AACf;AACA,qBAFe;AACf,wBADe;AACf,yBADe;AACf,yBADe;AACf,yBADe;AACf,sBADe;AACf;AACA,QAFe;AACf,WADe,GAAgBH,cAAc,EACzBC,YAAY,EACTlD,MAAM,EAA+ByC,KAAK,EACvDM,UAAU,EAGH/C,MAAM,EAEF,CAAC2C,UAAU,EACRC,OAAO,EACN,CAACC,aAAa,GAAG,CAAC,GAAG,IAAI,EACzB,CAACA,aAAa,GAAGrB,GAAG,GAAG,IAAI,EAC3B,CAACqB,aAAa,GAAGnB,WAAW,GAAG,IAAI,EACtC1B,MAAM,EAEpBuC,UAAU,GACRjD,IAAI,CAAA+D,GAAA,KAAAA,GAAA,GAAAD,CAAA;AACd,cADc;AACd,0BADc;AACd,gBADc;AACd;AACA,iBAFc,GAAepD,MAAM,EACrBuC,UAAU,EACEvC,MAAM,EAChB2C,UAAU,GAAG,MAAM,GAAG,SAAS,IAGrC,IAAI;MAEZ;IAAC;MAAAjC,IAAA;MAAA4C,MAAA;MAAAtC,GAAA;MAAAC,MAAA;QAAA,OAEehB,MAAM;MAAA;IAAA;EAAA;AAAA,GApKKZ,UAAU;AAuKvC,eAAea,cAAc","ignoreList":[]}
|
|
@@ -5,14 +5,15 @@ let _ = t => t,
|
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
*
|
|
8
|
-
* Copyright IBM Corp. 2019,
|
|
8
|
+
* Copyright IBM Corp. 2019, 2024
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { LitElement, html } from 'lit';
|
|
15
|
-
import { property
|
|
15
|
+
import { property } from 'lit/decorators.js';
|
|
16
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
16
17
|
import { prefix } from '../../globals/settings';
|
|
17
18
|
import styles from "././select.css.js";
|
|
18
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-skeleton.js","names":["LitElement","html","property","customElement","prefix","styles","CDSSelectSkeleton","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","render","hideLabel","_t","_","_t2","static"],"sources":["components/select/select-skeleton.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019,
|
|
1
|
+
{"version":3,"file":"select-skeleton.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","CDSSelectSkeleton","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","render","hideLabel","_t","_","_t2","static"],"sources":["components/select/select-skeleton.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './select.scss';\n\n/**\n * Skeleton of number input.\n */\n@customElement(`${prefix}-select-skeleton`)\nclass CDSSelectSkeleton extends LitElement {\n /**\n * `true` if the label should be hidden. Corresponds to the attribute with the same name.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n render() {\n const { hideLabel } = this;\n return html`\n ${!hideLabel &&\n html` <span class=\"${prefix}--label ${prefix}--skeleton\"></span> `}\n <div class=\"${prefix}--select ${prefix}--skeleton\"></div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSSelectSkeleton;\n"],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eAAeO,iBAAiB","ignoreList":[]}
|
|
@@ -4,14 +4,15 @@ let _ = t => t,
|
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
*
|
|
7
|
-
* Copyright IBM Corp. 2023
|
|
7
|
+
* Copyright IBM Corp. 2023, 2024
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { LitElement, html } from 'lit';
|
|
14
|
-
import {
|
|
14
|
+
import { property } from 'lit/decorators.js';
|
|
15
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
15
16
|
import { prefix } from '../../globals/settings';
|
|
16
17
|
import styles from "././stack.css.js";
|
|
17
18
|
import { STACK_ORIENTATION, SPACING_STEPS } from './defs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","names":["LitElement","html","
|
|
1
|
+
{"version":3,"file":"stack.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","STACK_ORIENTATION","SPACING_STEPS","CDSStack","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","String","reflect","key","value","VERTICAL","Boolean","attribute","updated","changedProperties","has","useCustomGapValue","style","setProperty","gap","_this$shadowRoot","_this$shadowRoot2","oldGapValue","get","shadowRoot","querySelector","classList","remove","add","render","_t","_","static"],"sources":["components/stack/stack.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2023, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './stack.scss';\nimport { STACK_ORIENTATION, SPACING_STEPS } from './defs';\n\nexport { STACK_ORIENTATION, SPACING_STEPS };\n\n/**\n * The Stack component is a useful layout utility in a component-based model.\n * This allows components to not use margin and instead delegate the\n * responsibility of positioning and layout to parent components.\n *\n * In the case of the Stack component, it uses the spacing scale from the\n * Design Language in order to determine how much space there should be between\n * items rendered by the Stack component. It also supports a custom `gap` prop\n * which will allow a user to provide a custom value for the gap of the layout.\n *\n * This component supports both horizontal and vertical orientations.\n *\n * @element cds-stack\n */\n@customElement(`${prefix}-stack`)\nclass CDSStack extends LitElement {\n /**\n * Specify the orientation of them items in the Stack\n */\n @property({ type: String, reflect: true })\n orientation = STACK_ORIENTATION.VERTICAL;\n\n /**\n * Provide either a custom value or a step from the spacing scale to be used\n * as the gap in the layout\n */\n @property({ type: SPACING_STEPS || String, reflect: true })\n gap;\n\n /**\n * Turn on when passing in custom value to 'gap' attribute (ie. gap=\"2rem\")\n */\n @property({ type: Boolean, attribute: 'use-custom-gap-value' })\n useCustomGapValue = false;\n\n updated(changedProperties) {\n if (changedProperties.has('gap')) {\n if (this.useCustomGapValue) {\n this.style.setProperty(`--${prefix}-stack-gap`, `${this.gap}`);\n } else {\n const oldGapValue = changedProperties.get('gap');\n this.shadowRoot\n ?.querySelector('div')\n ?.classList.remove(`${prefix}--stack-scale-${oldGapValue}`);\n this.shadowRoot\n ?.querySelector('div')\n ?.classList.add(`${prefix}--stack-scale-${this.gap}`);\n }\n }\n }\n\n render() {\n return html`<div><slot></slot></div>`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default CDSStack;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,OAAOC,MAAM,MAAM,kBAAc;AACjC,SAASC,iBAAiB,EAAEC,aAAa,QAAQ,QAAQ;AAEzD,SAASD,iBAAiB,EAAEC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AC,gBAAA,EAAAC,iBAAA;YACL,MAAMC,WAAW,GAAGR,iBAAiB,CAACS,GAAG,CAAC,KAAK,CAAC;YAChD,CAAAH,gBAAA,OAAI,CAACI,UAAU,cAAAJ,gBAAA,gBAAAA,gBAAA,GAAfA,gBAAA,CACIK,aAAa,CAAC,KAAK,CAAC,cAAAL,gBAAA,eADxBA,gBAAA,CAEIM,SAAS,CAACC,MAAM,CAAC,GAAGpC,MAAM,iBAAiB+B,WAAW,EAAE,CAAC;YAC7D,CAAAD,iBAAA,OAAI,CAACG,UAAU,cAAAH,iBAAA,gBAAAA,iBAAA,GAAfA,iBAAA,CACII,aAAa,CAAC,KAAK,CAAC,cAAAJ,iBAAA,eADxBA,iBAAA,CAEIK,SAAS,CAACE,GAAG,CAAC,GAAGrC,MAAM,iBAAiB,IAAI,CAAC4B,GAAG,EAAE,CAAC;UACzD;QACF;MACF;IAAC;MAAAhB,IAAA;MAAAK,GAAA;MAAAC,KAAA,EAED,SAAAoB,OAAA,EAAS;QACP,OAAO1C,IAAI,CAAA2C,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAA5B,IAAA;MAAA6B,MAAA;MAAAxB,GAAA;MAAAC,MAAA;QAAA,OAEejB,MAAM;MAAA;IAAA;EAAA;AAAA,GAxCDN,UAAU;AA2CjC,eAAeS,QAAQ","ignoreList":[]}
|
|
@@ -5,14 +5,15 @@ let _ = t => t,
|
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
*
|
|
8
|
-
* Copyright IBM Corp. 2019,
|
|
8
|
+
* Copyright IBM Corp. 2019, 2024
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { LitElement, html } from 'lit';
|
|
15
|
-
import { property
|
|
15
|
+
import { property } from 'lit/decorators.js';
|
|
16
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
16
17
|
import { prefix } from '../../globals/settings';
|
|
17
18
|
import styles from "././text-input.css.js";
|
|
18
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-input-skeleton.js","names":["LitElement","html","property","customElement","prefix","styles","CDSTextInputSkeleton","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","render","hideLabel","_t","_","_t2","static"],"sources":["components/text-input/text-input-skeleton.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019,
|
|
1
|
+
{"version":3,"file":"text-input-skeleton.js","names":["LitElement","html","property","carbonElement","customElement","prefix","styles","CDSTextInputSkeleton","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","type","Boolean","reflect","attribute","key","value","render","hideLabel","_t","_","_t2","static"],"sources":["components/text-input/text-input-skeleton.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { prefix } from '../../globals/settings';\nimport styles from './text-input.scss';\n\n/**\n * Skeleton of number input.\n */\n@customElement(`${prefix}-text-input-skeleton`)\nclass CDSTextInputSkeleton extends LitElement {\n /**\n * Specify whether the label should be hidden, or not\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n render() {\n const { hideLabel } = this;\n return html`\n ${!hideLabel &&\n html` <span class=\"${prefix}--label ${prefix}--skeleton\"></span> `}\n <div class=\"${prefix}--text-input ${prefix}--skeleton\"></div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default CDSTextInputSkeleton;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,EAAEC,IAAI,QAAQ,KAAK;AACtC,S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21
|
import { LitElement, html } from 'lit';
|
|
22
|
-
import { property,
|
|
22
|
+
import { property, query } from 'lit/decorators.js';
|
|
23
|
+
import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
|
|
23
24
|
import { classMap } from 'lit/directives/class-map.js';
|
|
24
25
|
import { prefix } from '../../globals/settings';
|
|
25
26
|
import View16 from "../../icons/view/16";
|