wcs-core 7.4.1 → 7.5.1
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/bundle/p-30d83d3d.js +2 -0
- package/bundle/p-581fc0fc.js +2 -0
- package/bundle/p-581fc0fc.js.map +1 -0
- package/bundle/{p-8bfdf6f6.js → p-9c2aa87a.js} +2 -2
- package/bundle/{p-6bc981dd.js → p-cdc6f6c2.js} +5 -5
- package/bundle/p-cdc6f6c2.js.map +1 -0
- package/bundle/wcs-accordion.js +1 -1
- package/bundle/wcs-accordion.js.map +1 -1
- package/bundle/wcs-alert-drawer.js +1 -1
- package/bundle/wcs-alert.js +1 -1
- package/bundle/wcs-breadcrumb.js +1 -1
- package/bundle/wcs-button.js +1 -1
- package/bundle/wcs-counter.js +1 -1
- package/bundle/wcs-dropdown.js +1 -1
- package/bundle/wcs-editable-field.js +1 -1
- package/bundle/wcs-grid-pagination.js +1 -1
- package/bundle/wcs-grid.js +1 -1
- package/bundle/wcs-horizontal-stepper.js +1 -1
- package/bundle/wcs-label.js +1 -1
- package/bundle/wcs-modal.js +1 -1
- package/composite-elements/{p-a14aec19.js → p-2a51c239.js} +2 -2
- package/composite-elements/{p-6dd2b564.js → p-51517fda.js} +2 -2
- package/composite-elements/p-51517fda.js.map +1 -0
- package/composite-elements/p-79ad61e4.js +2 -0
- package/composite-elements/p-79ad61e4.js.map +1 -0
- package/composite-elements/{p-fe1f9cc5.js → p-bc4c736d.js} +2 -2
- package/{bundle/p-38e45350.js.map → composite-elements/p-bc4c736d.js.map} +1 -1
- package/composite-elements/wcs-accordion.js +1 -1
- package/composite-elements/wcs-accordion.js.map +1 -1
- package/composite-elements/wcs-alert-drawer.js +1 -1
- package/composite-elements/wcs-alert.js +1 -1
- package/composite-elements/wcs-breadcrumb.js +1 -1
- package/composite-elements/wcs-button.js +1 -1
- package/composite-elements/wcs-counter.js +1 -1
- package/composite-elements/wcs-dropdown.js +1 -1
- package/composite-elements/wcs-editable-field.js +1 -1
- package/composite-elements/wcs-grid-pagination.js +1 -1
- package/composite-elements/wcs-grid.js +1 -1
- package/composite-elements/wcs-horizontal-stepper.js +1 -1
- package/composite-elements/wcs-label.js +1 -1
- package/composite-elements/wcs-modal.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/wcs-accordion.cjs.entry.js +3 -2
- package/dist/cjs/wcs-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-button_2.cjs.entry.js +5 -12
- package/dist/cjs/wcs-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs-error_3.cjs.entry.js +1 -1
- package/dist/cjs/wcs-error_3.cjs.entry.js.map +1 -1
- package/dist/cjs/wcs.cjs.js +1 -1
- package/dist/collection/components/accordion/accordion.e2e.playwright.js +398 -234
- package/dist/collection/components/accordion/accordion.e2e.playwright.js.map +1 -1
- package/dist/collection/components/accordion/accordion.js +21 -2
- package/dist/collection/components/accordion/accordion.js.map +1 -1
- package/dist/collection/components/button/button.js +5 -12
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/label/label.css +0 -1
- package/dist/collection/components/label/label.e2e.playwright.js +42 -0
- package/dist/collection/components/label/label.e2e.playwright.js.map +1 -0
- package/dist/collection/utils/playwright/test.js +6 -0
- package/dist/collection/utils/playwright/test.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/wcs-accordion.entry.js +3 -2
- package/dist/esm/wcs-accordion.entry.js.map +1 -1
- package/dist/esm/wcs-button_2.entry.js +5 -12
- package/dist/esm/wcs-button_2.entry.js.map +1 -1
- package/dist/esm/wcs-error_3.entry.js +1 -1
- package/dist/esm/wcs-error_3.entry.js.map +1 -1
- package/dist/esm/wcs.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +5 -0
- package/dist/types/components/button/button.d.ts +1 -2
- package/dist/types/components/label/label.e2e.playwright.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/wcs/{p-9b76b8e6.entry.js → p-22620c69.entry.js} +2 -2
- package/dist/wcs/{p-9b76b8e6.entry.js.map → p-22620c69.entry.js.map} +1 -1
- package/dist/wcs/{p-204f2722.entry.js → p-450942b1.entry.js} +7 -7
- package/dist/wcs/p-450942b1.entry.js.map +1 -0
- package/dist/wcs/p-a07381f2.entry.js +2 -0
- package/dist/wcs/p-a07381f2.entry.js.map +1 -0
- package/dist/wcs/wcs.esm.js +1 -1
- package/dist/wcs/wcs.esm.js.map +1 -1
- package/package.json +1 -1
- package/bundle/p-38e45350.js +0 -2
- package/bundle/p-6bc981dd.js.map +0 -1
- package/bundle/p-fc9ba34d.js +0 -2
- package/bundle/p-fc9ba34d.js.map +0 -1
- package/composite-elements/p-0c306f8c.js +0 -2
- package/composite-elements/p-0c306f8c.js.map +0 -1
- package/composite-elements/p-6dd2b564.js.map +0 -1
- package/dist/wcs/p-204f2722.entry.js.map +0 -1
- package/dist/wcs/p-5d598d35.entry.js +0 -2
- package/dist/wcs/p-5d598d35.entry.js.map +0 -1
- /package/{composite-elements/p-fe1f9cc5.js.map → bundle/p-30d83d3d.js.map} +0 -0
- /package/bundle/{p-8bfdf6f6.js.map → p-9c2aa87a.js.map} +0 -0
- /package/composite-elements/{p-a14aec19.js.map → p-2a51c239.js.map} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as a,d as t,h as i,c as s}from"./p-2bef72c7.js";import{h as n}from"./p-d3404c52.js";import{i as r,a as c,s as o}from"./p-2e9b9605.js";import{d as g}from"./p-cdc6f6c2.js";import{d as p}from"./p-44a3b0b9.js";import{y as d}from"./p-763371a0.js";import{d as l}from"./p-2751ddc1.js";import{d as f}from"./p-c8b73e93.js";const h=(e,a)=>{switch(e){case"next":return a?"Dernière page":"Page suivante";case"previous":default:return a?"Première page":"Page précédente"}};const b=({active:e,order:a,double:t=false})=>n("wcs-button",{mode:"clear",shape:"square",size:"s",disabled:!e,title:h(a,t)},n("svg",{style:{cursor:"pointer"},"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"20",viewBox:"0 0 24 20"},n("style",{type:"text/css"},`\n .arrow-group {\n transform-origin: 50% 51%;\n transition: transform 175ms ease-in-out;\n }\n .arrow {\n transition: fill 175ms ease-in-out;\n fill: var(--wcs-grid-pagination-arrow-color-inactive, var(--wcs-button-color));\n }\n .second-arrow {\n transform: translateY(-8px);\n }\n .next {\n transform: rotate(90deg);\n }\n .previous {\n transform: rotate(-90deg);\n }\n .active {\n fill: var(--wcs-grid-pagination-arrow-color-active, var(--wcs-button-color));\n }\n `),n("g",{fill:"none",class:a+" arrow-group"},n("path",{class:(e?"active":"")+" arrow",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),n("path",{d:"M0 0h24v24H0z",fill:"none"})),t?n("g",{fill:"none",class:a+" arrow-group"},n("path",{class:(e?"active":"")+" arrow second-arrow",d:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),n("path",{d:"M0 0h24v24H0z",fill:"none"})):""));const m=":host{display:block;margin-top:var(--wcs-grid-pagination-margin-top);--wcs-grid-pagination-color:var(--wcs-semantic-color-text-primary);--wcs-grid-pagination-font-size:var(--wcs-semantic-font-size-label-2);--wcs-grid-pagination-font-weight:var(--wcs-semantic-font-weight-medium);--wcs-grid-pagination-gap:var(--wcs-semantic-spacing-base);--wcs-grid-pagination-page-size-gap:var(--wcs-semantic-spacing-base);--wcs-grid-pagination-counter-gap:var(--wcs-semantic-spacing-small);--wcs-grid-pagination-margin-top:var(--wcs-semantic-spacing-large);--wcs-grid-pagination-arrow-color-inactive:unset;--wcs-grid-pagination-arrow-color-active:unset;}.container{display:grid;gap:var(--wcs-grid-pagination-gap);grid-template-columns:auto auto auto;justify-content:space-between;align-items:center;color:var(--wcs-grid-pagination-color);font-size:var(--wcs-grid-pagination-font-size);font-weight:var(--wcs-grid-pagination-font-weight)}.available-page-sizes{width:auto}.page-management,.page-size,.items-count{display:flex;align-items:center}.page-size{gap:var(--wcs-grid-pagination-page-size-gap)}.page-management{margin:0;padding:0;list-style-type:none}.pagination-arrow{display:flex}.pagination-counter{padding:0 var(--wcs-grid-pagination-counter-gap)}.pagination-counter span{white-space:nowrap}wcs-select.available-page-sizes{--wcs-select-control-height:var(--wcs-semantic-size-s)}";const u=m;const w=["tabindex","title"];const v=e(class e extends a{constructor(){super();this.__registerHost();this.__attachShadow();this.wcsGridPaginationChange=t(this,"wcsGridPaginationChange",7);this.inheritedAttributes={};this.availablePageSizes=[10,20,50];this.currentPage=e.INDEX_FIRST_PAGE;this.pageSize=this.availablePageSizes[0];this.itemsCount=0;this.pageCount=1}componentWillLoad(){this.inheritedAttributes=Object.assign(Object.assign({},r(this.el)),c(this.el,w))}async setAriaAttribute(e,a){o(this.nativeNav,e,a)}getWcsGrid(){return this.el.parentElement.tagName==="WCS-GRID"?this.el.parentElement:undefined}lastPage(){this.currentPage=this.pageCount-1;this.emitPaginationChange();this.focusFirstGridCell()}nextPage(){if(this.canGoToNextPage()){this.currentPage++;this.emitPaginationChange();this.focusFirstGridCell()}}canGoToNextPage(){return this.currentPage+1<this.pageCount}previousPage(){if(this.canGoToPreviousPage()){this.currentPage--;this.emitPaginationChange();this.focusFirstGridCell()}}canGoToPreviousPage(){return this.currentPage>0}firstPage(){this.currentPage=0;this.emitPaginationChange();this.focusFirstGridCell()}onChangePageSize(e){this.pageSize=e.detail.value;if(this.currentPage+1>this.pageSize){this.currentPage=0}this.emitPaginationChange();this.focusFirstGridCell()}focusFirstGridCell(){const e=this.getWcsGrid();if(e){requestAnimationFrame((()=>{this.el.blur();e.focusFirstCell()}))}}emitPaginationChange(){this.wcsGridPaginationChange.emit({pagination:{currentPage:this.currentPage,pageSize:this.pageSize,itemsCount:this.itemsCount,pageCount:this.pageCount}})}render(){return i(s,{key:"a51e533835607f4e0b712fe26680704a71f76cd6",slot:"grid-pagination"},i("div",{key:"8ff4ebf10c9e134a8e2fe5d577860a8d6dc9c863",class:"container"},i("div",{key:"a4c6ce48c71fb017dfecdb3f1e8bdc59894e1cbd",class:"page-size"},i("wcs-select",{key:"ae08e610f92bc8084806b25b0b5d7fa95db079ee",placeholder:"Eléments par page",class:"available-page-sizes","aria-labelledby":"elements-per-page-number elements-per-page-text",value:this.pageSize,onWcsChange:this.onChangePageSize.bind(this)},this.availablePageSizes.map((e=>i("wcs-select-option",{value:e},e)))),i("span",{key:"282fd594fa817e9f2535c7403b5e1d66e4a7d030",id:"elements-per-page-number",hidden:true},this.pageSize),i("span",{key:"00ee37d7e5156aa17b234fdf6eec956228064094",id:"elements-per-page-text"},"éléments par page")),i("div",{key:"2ae95e32fc77cafebf0a38eb2746c62d0bd3a537",class:"items-count"},i("span",{key:"5861d6bbf937867579181842dc93ba33290cdfe9"},this.itemsCount," éléments")),i("nav",Object.assign({key:"7d847f316fb18ec7bdc08f7c055115a7391bb25e","aria-label":"pagination",ref:e=>this.nativeNav=e},this.inheritedAttributes),i("ul",{key:"d58fdfcd0a663071a6c94b72acf339a2efd57b5d",class:"page-management"},i("li",{key:"d18366653d52b0e481bfc8bb0d001d72aa5b3b36",class:"pagination-arrow",onClick:this.firstPage.bind(this)},i(b,{key:"ce33b84750ac08bfc50e91378f79ce62c11c9750",active:this.canGoToPreviousPage(),order:"previous",double:true})),i("li",{key:"fb8adcbe91d40dd5d5dd741ec2c69299d971a1ee",class:"pagination-arrow",onClick:this.previousPage.bind(this)},i(b,{key:"b5f8b2804909a64e73e4d26a1faea483a10d2137",active:this.canGoToPreviousPage(),order:"previous"})),i("li",{key:"22742254c3c37ecf900eba29d1605a0420ff11e2",class:"pagination-counter"},i("span",{key:"1f9385fffd93e2eb97d8199b0d7e459e58e01285","aria-label":`Page ${this.currentPage+1} sur ${this.pageCount}`,"aria-current":"page"},this.currentPage+1," / ",this.pageCount)),i("li",{key:"3a408b5b27a1ff8ba7dc52b6027506100e371d49",class:"pagination-arrow",onClick:this.nextPage.bind(this)},i(b,{key:"54e0d638e0645fd46b8a96a99509c8a3dafc842b",active:this.canGoToNextPage(),order:"next"})),i("li",{key:"e91b2f2eeadfeea3ef68fa83c3c3e9fa30c3c17f",class:"pagination-arrow",onClick:this.lastPage.bind(this)},i(b,{key:"14834c2f39a7f1076dfe2660aa2c651d1c52f40e",active:this.canGoToNextPage(),order:"next",double:true}))))))}get el(){return this}static get style(){return u}},[1,"wcs-grid-pagination",{availablePageSizes:[16],currentPage:[1026,"current-page"],pageSize:[2,"page-size"],itemsCount:[2,"items-count"],pageCount:[2,"page-count"],setAriaAttribute:[64]}]);v.INDEX_FIRST_PAGE=0;function y(){if(typeof customElements==="undefined"){return}const e=["wcs-grid-pagination","wcs-button","wcs-checkbox","wcs-select","wcs-select-option","wcs-spinner"];e.forEach((e=>{switch(e){case"wcs-grid-pagination":if(!customElements.get(e)){customElements.define(e,v)}break;case"wcs-button":if(!customElements.get(e)){g()}break;case"wcs-checkbox":if(!customElements.get(e)){p()}break;case"wcs-select":if(!customElements.get(e)){d()}break;case"wcs-select-option":if(!customElements.get(e)){l()}break;case"wcs-spinner":if(!customElements.get(e)){f()}break}}))}export{v as G,y as d};
|
|
2
|
+
//# sourceMappingURL=p-30d83d3d.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e,H as t,h as s,c}from"./p-2bef72c7.js";import{i as a,a as l,s as r}from"./p-2e9b9605.js";const i=':host{--wcs-label-font-weight:var(--wcs-semantic-font-weight-book);--wcs-label-color:var(--wcs-semantic-color-text-primary);--wcs-label-required-marker-color:var(--wcs-semantic-color-text-critical);--wcs-label-gap:var(--wcs-semantic-spacing-small);font-weight:var(--wcs-label-font-weight)}:host([required])>label::after{font-weight:var(--wcs-label-font-weight);color:var(--wcs-label-required-marker-color);content:" *"}label{display:inline-flex;align-items:center;gap:var(--wcs-label-gap);color:var(--wcs-label-color);font-weight:var(--wcs-label-font-weight)}';const o=i;const n=["title"];const b=e(class e extends t{constructor(){super();this.__registerHost();this.__attachShadow();this.inheritedAttributes={};this.required=false}componentWillLoad(){this.inheritedAttributes=Object.assign(Object.assign({},a(this.el)),l(this.el,n))}async setAriaAttribute(e,t){r(this.nativeLabel,e,t)}render(){return s(c,{key:"62f8ca37637cc792483f24476dbbd63ff3c077e5",slot:"label"},s("label",Object.assign({key:"3cef9a517d57652b75af3157d2c96a34693b258f",ref:e=>this.nativeLabel=e},this.inheritedAttributes),s("slot",{key:"a614b379b45ac3d4cc1d58c45d39b64c0312c1d7"})))}get el(){return this}static get style(){return o}},[1,"wcs-label",{required:[516],setAriaAttribute:[64]}]);function f(){if(typeof customElements==="undefined"){return}const e=["wcs-label"];e.forEach((e=>{switch(e){case"wcs-label":if(!customElements.get(e)){customElements.define(e,b)}break}}))}export{b as L,f as d};
|
|
2
|
+
//# sourceMappingURL=p-581fc0fc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["labelCss","WcsLabelStyle0","LABEL_INHERITED_ATTRS","Label","proxyCustomElement","H","this","inheritedAttributes","componentWillLoad","Object","assign","inheritAriaAttributes","el","inheritAttributes","setAriaAttribute","attr","value","setOrRemoveAttribute","nativeLabel","render","h","Host","key","slot","ref"],"sources":["src/components/label/label.scss?tag=wcs-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":[":host {\n --wcs-label-font-weight: var(--wcs-semantic-font-weight-book);\n --wcs-label-color: var(--wcs-semantic-color-text-primary);\n --wcs-label-required-marker-color: var(--wcs-semantic-color-text-critical);\n\n --wcs-label-gap: var(--wcs-semantic-spacing-small);\n\n font-weight: var(--wcs-label-font-weight);\n}\n\n:host([required]) > label::after {\n font-weight: var(--wcs-label-font-weight);\n color: var(--wcs-label-required-marker-color);\n content: ' *';\n}\n\nlabel {\n display: inline-flex;\n align-items: center;\n gap: var(--wcs-label-gap);\n \n color: var(--wcs-label-color);\n font-weight: var(--wcs-label-font-weight);\n}\n","import { Component, ComponentInterface, h, Host, Method, Prop, Element } from '@stencil/core';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\nimport { inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from \"../../utils/helpers\";\n\nconst LABEL_INHERITED_ATTRS = ['title'];\n\n/**\n * The `wcs-label` should always be wrapped in a `wcs-form-field`.\n * It is used to caption a form control component.\n *\n * ## Accessibility guidelines 💡\n * - Use concise name for the label. If you want to describe more your form control, add a `wcs-hint`\n * - Use the required flag only as an indication to inform users that the form control is required\n * \n * @cssprop --wcs-label-color - Color of the text\n * @cssprop --wcs-label-font-weight - Font weight of the text\n * \n * @cssprop --wcs-label-required-marker-color - Color of the required marker\n * \n * @cssprop --wcs-label-gap - Gap between text and required marker\n */\n@Component({\n tag: 'wcs-label',\n styleUrl: 'label.scss',\n shadow: true,\n})\nexport class Label implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeLabel?: HTMLLabelElement;\n private inheritedAttributes: { [k: string]: any } = {};\n \n /**\n * If `true`, marks the label with a red star.\n * Automatically added if the wrapped component inside the `wcs-form-field` already has the `required` attribute. \n */\n @Prop({ reflect: true }) required: boolean = false;\n\n componentWillLoad() {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, LABEL_INHERITED_ATTRS),\n };\n }\n\n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeLabel, attr, value);\n }\n\n render() {\n return (\n <Host slot=\"label\">\n <label ref={(el) => this.nativeLabel = el} {...this.inheritedAttributes}>\n <slot />\n </label>\n </Host>\n );\n }\n}\n"],"mappings":"sGAAA,MAAMA,EAAW,kjBACjB,MAAAC,EAAeD,ECGf,MAAME,EAAwB,CAAC,S,MAsBlBC,EAAKC,EAAA,MAAAD,UAAAE,E,kEAGNC,KAAAC,oBAA4C,G,cAMP,K,CAE7C,iBAAAC,GACIF,KAAKC,oBAAmBE,OAAAC,OAAAD,OAAAC,OAAA,GACjBC,EAAsBL,KAAKM,KAC3BC,EAAkBP,KAAKM,GAAIV,G,CAKtC,sBAAMY,CAAiBC,EAAyBC,GAC5CC,EAAqBX,KAAKY,YAAaH,EAAMC,E,CAGjD,MAAAG,GACI,OACIC,EAACC,EAAI,CAAAC,IAAA,2CAACC,KAAK,SACPH,EAAA,QAAAX,OAAAC,OAAA,CAAAY,IAAA,2CAAOE,IAAMZ,GAAON,KAAKY,YAAcN,GAAQN,KAAKC,qBAChDa,EAAA,QAAAE,IAAA,8C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as r,H as e,d as s,h as t,c as a}from"./p-2bef72c7.js";import{d as c}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as r,H as e,d as s,h as t,c as a}from"./p-2bef72c7.js";import{d as c}from"./p-cdc6f6c2.js";import{d as o}from"./p-98bd8a96.js";import{d as i}from"./p-c8b73e93.js";const n="@keyframes progress-bar-slide{0%{width:0}100%{width:100%}}:host{--wcs-alert-background-color:var(--wcs-semantic-color-background-surface-accent-lighter);--wcs-alert-icon-background-color:var(--wcs-semantic-color-background-surface-brand-default);--wcs-alert-title-color:var(--wcs-semantic-color-text-primary);--wcs-alert-subtitle-color:var(--wcs-semantic-color-text-secondary);--wcs-alert-dismiss-button-color:var(--wcs-semantic-color-foreground-inverse);--wcs-alert-title-font-weight:var(--wcs-semantic-font-weight-heavy);--wcs-alert-subtitle-font-weight:var(--wcs-semantic-font-weight-roman);--wcs-alert-title-font-size:var(--wcs-semantic-font-size-base);--wcs-alert-subtitle-font-size:var(--wcs-semantic-font-size-caption-2);--wcs-alert-border-width:var(--wcs-semantic-border-width-default);--wcs-alert-border-color:var(--wcs-semantic-color-border-primary);--wcs-alert-border-radius:var(--wcs-semantic-border-radius-base);--wcs-alert-padding:var(--wcs-semantic-spacing-base-150);--wcs-alert-gap:var(--wcs-semantic-spacing-base-150);--wcs-alert-min-width:100%;--wcs-alert-progress-bar-height:0.25rem;--wcs-alert-progress-bar-background-color:var(--wcs-alert-icon-background-color);--wcs-alert-internal-progress-bar-animation-duration:5s;box-sizing:border-box;background-color:var(--wcs-alert-background-color);border-radius:var(--wcs-alert-border-radius);padding:var(--wcs-alert-padding);width:100%;min-width:var(--wcs-alert-min-width);position:relative;display:flex;align-items:center;justify-content:space-between;gap:var(--wcs-alert-gap);border:solid var(--wcs-alert-border-width) var(--wcs-alert-border-color);overflow:hidden}:host .content{display:flex;flex-direction:column}:host .announcement-icon{color:var(--wcs-alert-icon-background-color)}:host ::slotted([slot=title]){color:var(--wcs-alert-title-color);font-size:var(--wcs-alert-title-font-size);font-weight:var(--wcs-alert-title-font-weight)}:host ::slotted([slot=subtitle]){font-weight:var(--wcs-alert-subtitle-font-weight);color:var(--wcs-alert-subtitle-color);font-size:var(--wcs-alert-subtitle-font-size)}:host .progress-bar{bottom:0;left:0;width:100%;height:var(--wcs-alert-progress-bar-height);position:absolute}:host .progress-bar-track{background-color:var(--wcs-alert-progress-bar-background-color);height:100%;animation:progress-bar-slide var(--wcs-alert-internal-progress-bar-animation-duration) linear;border-bottom-left-radius:var(--wcs-alert-border-radius);border-bottom-right-radius:var(--wcs-alert-border-radius);border-top-right-radius:var(--wcs-alert-border-radius)}:host([intent=success]){--wcs-alert-border-color:var(--wcs-semantic-color-border-success);--wcs-alert-background-color:var(--wcs-semantic-color-background-surface-success-lighter);--wcs-alert-icon-background-color:var(--wcs-semantic-color-background-surface-success-default)}:host([intent=information]){--wcs-alert-border-color:var(--wcs-semantic-color-border-information);--wcs-alert-background-color:var(--wcs-semantic-color-background-surface-information-lighter);--wcs-alert-icon-background-color:var(--wcs-semantic-color-background-surface-information-default)}:host([intent=warning]){--wcs-alert-border-color:var(--wcs-semantic-color-border-warning);--wcs-alert-background-color:var(--wcs-semantic-color-background-surface-warning-lighter);--wcs-alert-icon-background-color:var(--wcs-semantic-color-background-surface-warning-default)}:host([intent=error]){--wcs-alert-border-color:var(--wcs-semantic-color-border-critical);--wcs-alert-background-color:var(--wcs-semantic-color-background-surface-critical-lightest);--wcs-alert-icon-background-color:var(--wcs-semantic-color-background-surface-critical-default)}:host>*{box-sizing:border-box}.icon-content-container{display:flex;gap:var(--wcs-alert-gap);align-items:center}.close-button wcs-mat-icon{color:var(--wcs-alert-dismiss-button-color)}.hidden{display:none}";const l=n;const d=r(class r extends e{constructor(){super();this.__registerHost();this.__attachShadow();this.wcsAlertDismiss=s(this,"wcsAlertDismiss",7);this.isTimedOut=false;this.isMouseHover=false;this.timeoutId=undefined;this.show=true;this.intent="success";this.timeout=5e3;this.showProgressBar=false}mouseOverHandler(){this.mouseHover(true)}mouseOutHandler(){this.mouseHover(false)}mouseHover(r){this.isMouseHover=r;if(this.isTimedOut&&!this.isMouseHover){this.close()}}async componentWillLoad(){await this.showAlertAndRunTimeout()}async componentDidLoad(){var r;(r=this.annoucementIconHtmlElement)===null||r===void 0?void 0:r.setAriaAttribute("aria-hidden","false");if(this.showProgressBar){this.el.style.setProperty("--wcs-alert-internal-progress-bar-animation-duration",this.timeout/1e3+"s")}else{this.el.style.setProperty("--wcs-alert-internal-progress-bar-animation-duration","0s")}}async showAlertAndRunTimeout(){if(this.timeout===0)return;this.show=true;this.timeoutId=setTimeout((()=>{if(!this.isMouseHover){this.close()}this.isTimedOut=true}),this.timeout)}onCloseButtonClick(r){this.close()}close(){this.show=false;this.wcsAlertDismiss.emit()}getMaterialIcon(){switch(this.intent){case"success":return"check_circle";case"information":return"info";case"error":return"error";case"warning":return"warning"}}getAriaLabel(){switch(this.intent){case"success":return"Succès";case"information":return"Information";case"error":return"Erreur";case"warning":return"Attention"}}disconnectedCallback(){clearTimeout(this.timeoutId)}render(){return t(a,{key:"82c9f5879eae7adef41c921ef34b2b9d891c0d6b"},t("div",{key:"b46424dfb6b620b62767b6bb8048827f83d116a7",class:"icon-content-container"},t("wcs-mat-icon",{key:"ff3a0bc91a73e275936bbe8f77c904f397296551",class:"announcement-icon",ref:r=>this.annoucementIconHtmlElement=r,icon:this.getMaterialIcon(),"aria-label":this.getAriaLabel(),role:"img","aria-hidden":false}),t("div",{key:"ea866940416ddaf5eaf73cec83f30c71b01c41d8",class:"content"},t("slot",{key:"d14c321ebdb78b646bb4fc19e613dbd2cc61ed31",name:"title"}),t("slot",{key:"569d6556ea823f82e1d6164ac20361e27c85b592",name:"subtitle"}))),t("wcs-button",{key:"f13afc31116b7b6fe04e0186128d0288725ace98",shape:"round",size:"s",mode:"clear",class:"close-button wcs-dark","aria-label":"Fermer cette notification",onClick:r=>this.onCloseButtonClick(r)},t("wcs-mat-icon",{key:"02557c896159ec1a7fdab853a07f7c79c17dd5d7",icon:"close"})),t("div",{key:"9e90e95009da575ca693e5ba4e92b3916ad4ee6f",class:"progress-bar"+(!this.showProgressBar?" hidden":"")},t("div",{key:"c8858551592bb0b1622e2ee19c67a662f31ce068",class:"progress-bar-track"})))}get el(){return this}static get style(){return l}},[1,"wcs-alert",{show:[1540],intent:[513],timeout:[2],showProgressBar:[4,"show-progress-bar"]},[[1,"mouseover","mouseOverHandler"],[1,"mouseout","mouseOutHandler"]]]);function b(){if(typeof customElements==="undefined"){return}const r=["wcs-alert","wcs-button","wcs-mat-icon","wcs-spinner"];r.forEach((r=>{switch(r){case"wcs-alert":if(!customElements.get(r)){customElements.define(r,d)}break;case"wcs-button":if(!customElements.get(r)){c()}break;case"wcs-mat-icon":if(!customElements.get(r)){o()}break;case"wcs-spinner":if(!customElements.get(r)){i()}break}}))}export{d as A,b as d};
|
|
2
|
+
//# sourceMappingURL=p-9c2aa87a.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as t,H as e,h as r}from"./p-2bef72c7.js";import{w as n,i,a as o,s}from"./p-2e9b9605.js";import{d as a}from"./p-c8b73e93.js";var c;function u(t,e){if(e===void 0){e=false}var r=t.CSS;var n=c;if(typeof c==="boolean"&&!e){return c}var i=r&&typeof r.supports==="function";if(!i){return false}var o=r.supports("--css-vars","yes");var s=r.supports("(--css-vars: yes)")&&r.supports("color","#00000000");n=o||s;if(!e){c=n}return n}function d(t,e,r){if(!t){return{x:0,y:0}}var n=e.x,i=e.y;var o=n+r.left;var s=i+r.top;var a;var c;if(t.type==="touchstart"){var u=t;a=u.changedTouches[0].pageX-o;c=u.changedTouches[0].pageY-s}else{var d=t;a=d.pageX-o;c=d.pageY-s}return{x:a,y:c}}var l=function(t,e){l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return l(t,e)};function f(t,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");l(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var p=function(){p=Object.assign||function t(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e};return p.apply(this,arguments)};function
|
|
1
|
+
import{p as t,H as e,h as r}from"./p-2bef72c7.js";import{w as n,i,a as o,s}from"./p-2e9b9605.js";import{d as a}from"./p-c8b73e93.js";var c;function u(t,e){if(e===void 0){e=false}var r=t.CSS;var n=c;if(typeof c==="boolean"&&!e){return c}var i=r&&typeof r.supports==="function";if(!i){return false}var o=r.supports("--css-vars","yes");var s=r.supports("(--css-vars: yes)")&&r.supports("color","#00000000");n=o||s;if(!e){c=n}return n}function d(t,e,r){if(!t){return{x:0,y:0}}var n=e.x,i=e.y;var o=n+r.left;var s=i+r.top;var a;var c;if(t.type==="touchstart"){var u=t;a=u.changedTouches[0].pageX-o;c=u.changedTouches[0].pageY-s}else{var d=t;a=d.pageX-o;c=d.pageY-s}return{x:a,y:c}}var l=function(t,e){l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return l(t,e)};function f(t,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");l(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var p=function(){p=Object.assign||function t(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e};return p.apply(this,arguments)};function b(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&n>=t.length)t=void 0;return{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(t,e){var r=typeof Symbol==="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{while((e===void 0||e-- >0)&&!(i=n.next()).done)o.push(i.value)}catch(t){s={error:t}}finally{try{if(i&&!i.done&&(r=n["return"]))r.call(n)}finally{if(s)throw s.error}}return o}function m(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++){if(o||!(n in e)){if(!o)o=Array.prototype.slice.call(e,0,n);o[n]=e[n]}}return t.concat(o||Array.prototype.slice.call(e))}
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2016 Google Inc.
|
|
@@ -42,7 +42,7 @@ import{p as t,H as e,h as r}from"./p-2bef72c7.js";import{w as n,i,a as o,s}from"
|
|
|
42
42
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
43
43
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
44
44
|
* THE SOFTWARE.
|
|
45
|
-
*/var v=function(){function t(t,e){var r=[];for(var n=2;n<arguments.length;n++){r[n-2]=arguments[n]}this.root=t;this.initialize.apply(this,m([],
|
|
45
|
+
*/var v=function(){function t(t,e){var r=[];for(var n=2;n<arguments.length;n++){r[n-2]=arguments[n]}this.root=t;this.initialize.apply(this,m([],h(r)));this.foundation=e===undefined?this.getDefaultFoundation():e;this.foundation.init();this.initialSyncWithDOM()}t.attachTo=function(e){return new t(e,new w({}))};t.prototype.initialize=function(){var t=[];for(var e=0;e<arguments.length;e++){t[e]=arguments[e]}};t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured "+"foundation class")};t.prototype.initialSyncWithDOM=function(){};t.prototype.destroy=function(){this.foundation.destroy()};t.prototype.listen=function(t,e,r){this.root.addEventListener(t,e,r)};t.prototype.unlisten=function(t,e,r){this.root.removeEventListener(t,e,r)};t.prototype.emit=function(t,e,r){if(r===void 0){r=false}var n;if(typeof CustomEvent==="function"){n=new CustomEvent(t,{bubbles:r,detail:e})}else{n=document.createEvent("CustomEvent");n.initCustomEvent(t,r,false,e)}this.root.dispatchEvent(n)};return t}();
|
|
46
46
|
/**
|
|
47
47
|
* @license
|
|
48
48
|
* Copyright 2019 Google Inc.
|
|
@@ -130,7 +130,7 @@ import{p as t,H as e,h as r}from"./p-2bef72c7.js";import{w as n,i,a as o,s}from"
|
|
|
130
130
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
131
131
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
132
132
|
* THE SOFTWARE.
|
|
133
|
-
*/var T=["touchstart","pointerdown","mousedown","keydown"];var O=["touchend","pointerup","mouseup","contextmenu"];var E=[];var _=function(t){f(e,t);function e(r){var n=t.call(this,p(p({},e.defaultAdapter),r))||this;n.activationAnimationHasEnded=false;n.activationTimer=0;n.fgDeactivationRemovalTimer=0;n.fgScale="0";n.frame={width:0,height:0};n.initialSize=0;n.layoutFrame=0;n.maxRadius=0;n.unboundedCoords={left:0,top:0};n.activationState=n.defaultActivationState();n.activationTimerCallback=function(){n.activationAnimationHasEnded=true;n.runDeactivationUXLogicIfReady()};n.activateHandler=function(t){n.activateImpl(t)};n.deactivateHandler=function(){n.deactivateImpl()};n.focusHandler=function(){n.handleFocus()};n.blurHandler=function(){n.handleBlur()};n.resizeHandler=function(){n.layout()};return n}Object.defineProperty(e,"cssClasses",{get:function(){return z},enumerable:false,configurable:true});Object.defineProperty(e,"strings",{get:function(){return A},enumerable:false,configurable:true});Object.defineProperty(e,"numbers",{get:function(){return x},enumerable:false,configurable:true});Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){return undefined},browserSupportsCssVars:function(){return true},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return true},deregisterDocumentInteractionHandler:function(){return undefined},deregisterInteractionHandler:function(){return undefined},deregisterResizeHandler:function(){return undefined},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return true},isSurfaceDisabled:function(){return true},isUnbounded:function(){return true},registerDocumentInteractionHandler:function(){return undefined},registerInteractionHandler:function(){return undefined},registerResizeHandler:function(){return undefined},removeClass:function(){return undefined},updateCssVariable:function(){return undefined}}},enumerable:false,configurable:true});e.prototype.init=function(){var t=this;var r=this.supportsPressRipple();this.registerRootHandlers(r);if(r){var n=e.cssClasses,i=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(i);if(t.adapter.isUnbounded()){t.adapter.addClass(o);t.layoutInternal()}}))}};e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){if(this.activationTimer){clearTimeout(this.activationTimer);this.activationTimer=0;this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)}if(this.fgDeactivationRemovalTimer){clearTimeout(this.fgDeactivationRemovalTimer);this.fgDeactivationRemovalTimer=0;this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION)}var r=e.cssClasses,n=r.ROOT,i=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(n);t.adapter.removeClass(i);t.removeCssVars()}))}this.deregisterRootHandlers();this.deregisterDeactivationHandlers()};e.prototype.activate=function(t){this.activateImpl(t)};e.prototype.deactivate=function(){this.deactivateImpl()};e.prototype.layout=function(){var t=this;if(this.layoutFrame){cancelAnimationFrame(this.layoutFrame)}this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal();t.layoutFrame=0}))};e.prototype.setUnbounded=function(t){var r=e.cssClasses.UNBOUNDED;if(t){this.adapter.addClass(r)}else{this.adapter.removeClass(r)}};e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))};e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))};e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()};e.prototype.defaultActivationState=function(){return{activationEvent:undefined,hasDeactivationUXRun:false,isActivated:false,isProgrammatic:false,wasActivatedByPointer:false,wasElementMadeActive:false}};e.prototype.registerRootHandlers=function(t){var e,r;if(t){try{for(var n=h(T),i=n.next();!i.done;i=n.next()){var o=i.value;this.adapter.registerInteractionHandler(o,this.activateHandler)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}if(this.adapter.isUnbounded()){this.adapter.registerResizeHandler(this.resizeHandler)}}this.adapter.registerInteractionHandler("focus",this.focusHandler);this.adapter.registerInteractionHandler("blur",this.blurHandler)};e.prototype.registerDeactivationHandlers=function(t){var e,r;if(t.type==="keydown"){this.adapter.registerInteractionHandler("keyup",this.deactivateHandler)}else{try{for(var n=h(O),i=n.next();!i.done;i=n.next()){var o=i.value;this.adapter.registerDocumentInteractionHandler(o,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}}};e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var r=h(T),n=r.next();!n.done;n=r.next()){var i=n.value;this.adapter.deregisterInteractionHandler(i,this.activateHandler)}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler);this.adapter.deregisterInteractionHandler("blur",this.blurHandler);if(this.adapter.isUnbounded()){this.adapter.deregisterResizeHandler(this.resizeHandler)}};e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var r=h(O),n=r.next();!n.done;n=r.next()){var i=n.value;this.adapter.deregisterDocumentInteractionHandler(i,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}};e.prototype.removeCssVars=function(){var t=this;var r=e.strings;var n=Object.keys(r);n.forEach((function(e){if(e.indexOf("VAR_")===0){t.adapter.updateCssVariable(r[e],null)}}))};e.prototype.activateImpl=function(t){var e=this;if(this.adapter.isSurfaceDisabled()){return}var r=this.activationState;if(r.isActivated){return}var n=this.previousActivationEvent;var i=n&&t!==undefined&&n.type!==t.type;if(i){return}r.isActivated=true;r.isProgrammatic=t===undefined;r.activationEvent=t;r.wasActivatedByPointer=r.isProgrammatic?false:t!==undefined&&(t.type==="mousedown"||t.type==="touchstart"||t.type==="pointerdown");var o=t!==undefined&&E.length>0&&E.some((function(t){return e.adapter.containsEventTarget(t)}));if(o){this.resetActivationState();return}if(t!==undefined){E.push(t.target);this.registerDeactivationHandlers(t)}r.wasElementMadeActive=this.checkElementMadeActive(t);if(r.wasElementMadeActive){this.animateActivation()}requestAnimationFrame((function(){E=[];if(!r.wasElementMadeActive&&t!==undefined&&(t.key===" "||t.keyCode===32)){r.wasElementMadeActive=e.checkElementMadeActive(t);if(r.wasElementMadeActive){e.animateActivation()}}if(!r.wasElementMadeActive){e.activationState=e.defaultActivationState()}}))};e.prototype.checkElementMadeActive=function(t){return t!==undefined&&t.type==="keydown"?this.adapter.isSurfaceActive():true};e.prototype.animateActivation=function(){var t=this;var r=e.strings,n=r.VAR_FG_TRANSLATE_START,i=r.VAR_FG_TRANSLATE_END;var o=e.cssClasses,s=o.FG_DEACTIVATION,a=o.FG_ACTIVATION;var c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var u="";var d="";if(!this.adapter.isUnbounded()){var l=this.getFgTranslationCoordinates(),f=l.startPoint,p=l.endPoint;u=f.x+"px, "+f.y+"px";d=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(n,u);this.adapter.updateCssVariable(i,d);clearTimeout(this.activationTimer);clearTimeout(this.fgDeactivationRemovalTimer);this.rmBoundedActivationClasses();this.adapter.removeClass(s);this.adapter.computeBoundingRect();this.adapter.addClass(a);this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),c)};e.prototype.getFgTranslationCoordinates=function(){var t=this.activationState,e=t.activationEvent,r=t.wasActivatedByPointer;var n;if(r){n=d(e,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect())}else{n={x:this.frame.width/2,y:this.frame.height/2}}n={x:n.x-this.initialSize/2,y:n.y-this.initialSize/2};var i={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:n,endPoint:i}};e.prototype.runDeactivationUXLogicIfReady=function(){var t=this;var r=e.cssClasses.FG_DEACTIVATION;var n=this.activationState,i=n.hasDeactivationUXRun,o=n.isActivated;var s=i||!o;if(s&&this.activationAnimationHasEnded){this.rmBoundedActivationClasses();this.adapter.addClass(r);this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(r)}),x.FG_DEACTIVATION_MS)}};e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t);this.activationAnimationHasEnded=false;this.adapter.computeBoundingRect()};e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent;this.activationState=this.defaultActivationState();setTimeout((function(){return t.previousActivationEvent=undefined}),e.numbers.TAP_DELAY_MS)};e.prototype.deactivateImpl=function(){var t=this;var e=this.activationState;if(!e.isActivated){return}var r=p({},e);if(e.isProgrammatic){requestAnimationFrame((function(){t.animateDeactivation(r)}));this.resetActivationState()}else{this.deregisterDeactivationHandlers();requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=true;t.animateDeactivation(r);t.resetActivationState()}))}};e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,r=t.wasElementMadeActive;if(e||r){this.runDeactivationUXLogicIfReady()}};e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var r=Math.max(this.frame.height,this.frame.width);var n=function(){var r=Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2));return r+e.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?r:n();var i=Math.floor(r*e.numbers.INITIAL_ORIGIN_SCALE);if(this.adapter.isUnbounded()&&i%2!==0){this.initialSize=i-1}else{this.initialSize=i}this.fgScale=""+this.maxRadius/this.initialSize;this.updateLayoutCssVars()};e.prototype.updateLayoutCssVars=function(){var t=e.strings,r=t.VAR_FG_SIZE,n=t.VAR_LEFT,i=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter.updateCssVariable(r,this.initialSize+"px");this.adapter.updateCssVariable(o,this.fgScale);if(this.adapter.isUnbounded()){this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)};this.adapter.updateCssVariable(n,this.unboundedCoords.left+"px");this.adapter.updateCssVariable(i,this.unboundedCoords.top+"px")}};return e}(w);
|
|
133
|
+
*/var T=["touchstart","pointerdown","mousedown","keydown"];var O=["touchend","pointerup","mouseup","contextmenu"];var E=[];var _=function(t){f(e,t);function e(r){var n=t.call(this,p(p({},e.defaultAdapter),r))||this;n.activationAnimationHasEnded=false;n.activationTimer=0;n.fgDeactivationRemovalTimer=0;n.fgScale="0";n.frame={width:0,height:0};n.initialSize=0;n.layoutFrame=0;n.maxRadius=0;n.unboundedCoords={left:0,top:0};n.activationState=n.defaultActivationState();n.activationTimerCallback=function(){n.activationAnimationHasEnded=true;n.runDeactivationUXLogicIfReady()};n.activateHandler=function(t){n.activateImpl(t)};n.deactivateHandler=function(){n.deactivateImpl()};n.focusHandler=function(){n.handleFocus()};n.blurHandler=function(){n.handleBlur()};n.resizeHandler=function(){n.layout()};return n}Object.defineProperty(e,"cssClasses",{get:function(){return z},enumerable:false,configurable:true});Object.defineProperty(e,"strings",{get:function(){return A},enumerable:false,configurable:true});Object.defineProperty(e,"numbers",{get:function(){return x},enumerable:false,configurable:true});Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){return undefined},browserSupportsCssVars:function(){return true},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return true},deregisterDocumentInteractionHandler:function(){return undefined},deregisterInteractionHandler:function(){return undefined},deregisterResizeHandler:function(){return undefined},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return true},isSurfaceDisabled:function(){return true},isUnbounded:function(){return true},registerDocumentInteractionHandler:function(){return undefined},registerInteractionHandler:function(){return undefined},registerResizeHandler:function(){return undefined},removeClass:function(){return undefined},updateCssVariable:function(){return undefined}}},enumerable:false,configurable:true});e.prototype.init=function(){var t=this;var r=this.supportsPressRipple();this.registerRootHandlers(r);if(r){var n=e.cssClasses,i=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(i);if(t.adapter.isUnbounded()){t.adapter.addClass(o);t.layoutInternal()}}))}};e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){if(this.activationTimer){clearTimeout(this.activationTimer);this.activationTimer=0;this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)}if(this.fgDeactivationRemovalTimer){clearTimeout(this.fgDeactivationRemovalTimer);this.fgDeactivationRemovalTimer=0;this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION)}var r=e.cssClasses,n=r.ROOT,i=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(n);t.adapter.removeClass(i);t.removeCssVars()}))}this.deregisterRootHandlers();this.deregisterDeactivationHandlers()};e.prototype.activate=function(t){this.activateImpl(t)};e.prototype.deactivate=function(){this.deactivateImpl()};e.prototype.layout=function(){var t=this;if(this.layoutFrame){cancelAnimationFrame(this.layoutFrame)}this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal();t.layoutFrame=0}))};e.prototype.setUnbounded=function(t){var r=e.cssClasses.UNBOUNDED;if(t){this.adapter.addClass(r)}else{this.adapter.removeClass(r)}};e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))};e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))};e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()};e.prototype.defaultActivationState=function(){return{activationEvent:undefined,hasDeactivationUXRun:false,isActivated:false,isProgrammatic:false,wasActivatedByPointer:false,wasElementMadeActive:false}};e.prototype.registerRootHandlers=function(t){var e,r;if(t){try{for(var n=b(T),i=n.next();!i.done;i=n.next()){var o=i.value;this.adapter.registerInteractionHandler(o,this.activateHandler)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}if(this.adapter.isUnbounded()){this.adapter.registerResizeHandler(this.resizeHandler)}}this.adapter.registerInteractionHandler("focus",this.focusHandler);this.adapter.registerInteractionHandler("blur",this.blurHandler)};e.prototype.registerDeactivationHandlers=function(t){var e,r;if(t.type==="keydown"){this.adapter.registerInteractionHandler("keyup",this.deactivateHandler)}else{try{for(var n=b(O),i=n.next();!i.done;i=n.next()){var o=i.value;this.adapter.registerDocumentInteractionHandler(o,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{if(i&&!i.done&&(r=n.return))r.call(n)}finally{if(e)throw e.error}}}};e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var r=b(T),n=r.next();!n.done;n=r.next()){var i=n.value;this.adapter.deregisterInteractionHandler(i,this.activateHandler)}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler);this.adapter.deregisterInteractionHandler("blur",this.blurHandler);if(this.adapter.isUnbounded()){this.adapter.deregisterResizeHandler(this.resizeHandler)}};e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var r=b(O),n=r.next();!n.done;n=r.next()){var i=n.value;this.adapter.deregisterDocumentInteractionHandler(i,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{if(n&&!n.done&&(e=r.return))e.call(r)}finally{if(t)throw t.error}}};e.prototype.removeCssVars=function(){var t=this;var r=e.strings;var n=Object.keys(r);n.forEach((function(e){if(e.indexOf("VAR_")===0){t.adapter.updateCssVariable(r[e],null)}}))};e.prototype.activateImpl=function(t){var e=this;if(this.adapter.isSurfaceDisabled()){return}var r=this.activationState;if(r.isActivated){return}var n=this.previousActivationEvent;var i=n&&t!==undefined&&n.type!==t.type;if(i){return}r.isActivated=true;r.isProgrammatic=t===undefined;r.activationEvent=t;r.wasActivatedByPointer=r.isProgrammatic?false:t!==undefined&&(t.type==="mousedown"||t.type==="touchstart"||t.type==="pointerdown");var o=t!==undefined&&E.length>0&&E.some((function(t){return e.adapter.containsEventTarget(t)}));if(o){this.resetActivationState();return}if(t!==undefined){E.push(t.target);this.registerDeactivationHandlers(t)}r.wasElementMadeActive=this.checkElementMadeActive(t);if(r.wasElementMadeActive){this.animateActivation()}requestAnimationFrame((function(){E=[];if(!r.wasElementMadeActive&&t!==undefined&&(t.key===" "||t.keyCode===32)){r.wasElementMadeActive=e.checkElementMadeActive(t);if(r.wasElementMadeActive){e.animateActivation()}}if(!r.wasElementMadeActive){e.activationState=e.defaultActivationState()}}))};e.prototype.checkElementMadeActive=function(t){return t!==undefined&&t.type==="keydown"?this.adapter.isSurfaceActive():true};e.prototype.animateActivation=function(){var t=this;var r=e.strings,n=r.VAR_FG_TRANSLATE_START,i=r.VAR_FG_TRANSLATE_END;var o=e.cssClasses,s=o.FG_DEACTIVATION,a=o.FG_ACTIVATION;var c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var u="";var d="";if(!this.adapter.isUnbounded()){var l=this.getFgTranslationCoordinates(),f=l.startPoint,p=l.endPoint;u=f.x+"px, "+f.y+"px";d=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(n,u);this.adapter.updateCssVariable(i,d);clearTimeout(this.activationTimer);clearTimeout(this.fgDeactivationRemovalTimer);this.rmBoundedActivationClasses();this.adapter.removeClass(s);this.adapter.computeBoundingRect();this.adapter.addClass(a);this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),c)};e.prototype.getFgTranslationCoordinates=function(){var t=this.activationState,e=t.activationEvent,r=t.wasActivatedByPointer;var n;if(r){n=d(e,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect())}else{n={x:this.frame.width/2,y:this.frame.height/2}}n={x:n.x-this.initialSize/2,y:n.y-this.initialSize/2};var i={x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2};return{startPoint:n,endPoint:i}};e.prototype.runDeactivationUXLogicIfReady=function(){var t=this;var r=e.cssClasses.FG_DEACTIVATION;var n=this.activationState,i=n.hasDeactivationUXRun,o=n.isActivated;var s=i||!o;if(s&&this.activationAnimationHasEnded){this.rmBoundedActivationClasses();this.adapter.addClass(r);this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(r)}),x.FG_DEACTIVATION_MS)}};e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t);this.activationAnimationHasEnded=false;this.adapter.computeBoundingRect()};e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent;this.activationState=this.defaultActivationState();setTimeout((function(){return t.previousActivationEvent=undefined}),e.numbers.TAP_DELAY_MS)};e.prototype.deactivateImpl=function(){var t=this;var e=this.activationState;if(!e.isActivated){return}var r=p({},e);if(e.isProgrammatic){requestAnimationFrame((function(){t.animateDeactivation(r)}));this.resetActivationState()}else{this.deregisterDeactivationHandlers();requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=true;t.animateDeactivation(r);t.resetActivationState()}))}};e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,r=t.wasElementMadeActive;if(e||r){this.runDeactivationUXLogicIfReady()}};e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var r=Math.max(this.frame.height,this.frame.width);var n=function(){var r=Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2));return r+e.numbers.PADDING};this.maxRadius=this.adapter.isUnbounded()?r:n();var i=Math.floor(r*e.numbers.INITIAL_ORIGIN_SCALE);if(this.adapter.isUnbounded()&&i%2!==0){this.initialSize=i-1}else{this.initialSize=i}this.fgScale=""+this.maxRadius/this.initialSize;this.updateLayoutCssVars()};e.prototype.updateLayoutCssVars=function(){var t=e.strings,r=t.VAR_FG_SIZE,n=t.VAR_LEFT,i=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter.updateCssVariable(r,this.initialSize+"px");this.adapter.updateCssVariable(o,this.fgScale);if(this.adapter.isUnbounded()){this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)};this.adapter.updateCssVariable(n,this.unboundedCoords.left+"px");this.adapter.updateCssVariable(i,this.unboundedCoords.top+"px")}};return e}(w);
|
|
134
134
|
/**
|
|
135
135
|
* @license
|
|
136
136
|
* Copyright 2016 Google Inc.
|
|
@@ -152,5 +152,5 @@ import{p as t,H as e,h as r}from"./p-2bef72c7.js";import{w as n,i,a as o,s}from"
|
|
|
152
152
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
153
153
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
154
154
|
* THE SOFTWARE.
|
|
155
|
-
*/var C=function(t){f(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.disabled=false;return e}e.attachTo=function(t,r){if(r===void 0){r={isUnbounded:undefined}}var n=new e(t);if(r.isUnbounded!==undefined){n.unbounded=r.isUnbounded}return n};e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return u(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,g())},deregisterInteractionHandler:function(e,r){return t.root.removeEventListener(e,r,g())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return k(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,g())},registerInteractionHandler:function(e,r){return t.root.addEventListener(e,r,g())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,r){return t.root.style.setProperty(e,r)}}};Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t);this.setUnbounded()},enumerable:false,configurable:true});e.prototype.activate=function(){this.foundation.activate()};e.prototype.deactivate=function(){this.foundation.deactivate()};e.prototype.layout=function(){this.foundation.layout()};e.prototype.getDefaultFoundation=function(){return new _(e.createAdapter(this))};e.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset};e.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))};return e}(v);const I='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}:host{display:inline-block;--wcs-button-color:var(--wcs-button-plain-color-default);--wcs-button-plain-color-default:var(--wcs-semantic-color-foreground-action-primary-default);--wcs-button-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-button-stroked-color-default:var(--wcs-semantic-color-foreground-action-secondary-default);--wcs-button-clear-color-default:var(--wcs-semantic-color-foreground-action-tertiary-default);--wcs-button-focus-outline-color:var(--wcs-semantic-color-border-focus-base);--wcs-button-focus-outline-border-width:var(--wcs-semantic-border-width-large);--wcs-button-background-color:var(--wcs-button-plain-background-color-default);--wcs-button-plain-background-color-default:var(--wcs-semantic-color-background-action-primary-default);--wcs-button-plain-background-color-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-button-stroked-background-color-default:var(--wcs-semantic-color-background-action-secondary-default);--wcs-button-stroked-background-color-disabled:var(--wcs-semantic-color-background-action-secondary-disabled);--wcs-button-clear-background-color-default:var(--wcs-semantic-color-background-action-tertiary-default);--wcs-button-clear-background-color-disabled:var(--wcs-semantic-color-background-action-tertiary-disabled);--wcs-button-ripple-color:var(--wcs-button-plain-ripple-color-default);--wcs-button-plain-ripple-color-default:var(--wcs-semantic-color-ripple-action-primary);--wcs-button-stroked-ripple-color-default:var(--wcs-semantic-color-ripple-action-secondary);--wcs-button-clear-ripple-color-default:var(--wcs-semantic-color-ripple-action-tertiary);--wcs-button-border-radius:var(--wcs-button-border-radius-default);--wcs-button-border-radius-default:var(--wcs-semantic-border-radius-base);--wcs-button-border-radius-rounded:var(--wcs-semantic-border-radius-full);--wcs-button-stroked-border-color:var(--wcs-button-stroked-border-color-default);--wcs-button-stroked-border-width:var(--wcs-semantic-border-width-default);--wcs-button-stroked-border-color-default:var(--wcs-semantic-color-border-action-secondary-default);--wcs-button-stroked-border-color-disabled:var(--wcs-semantic-color-border-action-secondary-disabled);--wcs-button-height-s:var(--wcs-semantic-size-s);--wcs-button-font-size-s:var(--wcs-semantic-font-size-label-2);--wcs-button-padding-size-s:calc(1.5 * var(--wcs-semantic-spacing-base));--wcs-button-height-m:var(--wcs-semantic-size-m);--wcs-button-font-size-m:var(--wcs-semantic-font-size-label-1);--wcs-button-padding-size-m:calc(2 * var(--wcs-semantic-spacing-base));--wcs-button-height-l:var(--wcs-semantic-size-l);--wcs-button-font-size-l:var(--wcs-semantic-font-size-label-1);--wcs-button-padding-size-l:calc(3 * var(--wcs-semantic-spacing-base));--wcs-button-font-weight:var(--wcs-semantic-font-weight-medium)}.wcs-inner-button:focus-visible{outline:var(--wcs-button-focus-outline-border-width) dashed var(--wcs-button-focus-outline-color);outline-offset:var(--wcs-semantic-spacing-small);border-radius:var(--wcs-button-border-radius)}:host([mode=clear]){--wcs-button-stroked-border-color:transparent}:host([mode=clear]) .wcs-inner-button{box-shadow:none}:host([mode=stroked]){--wcs-button-color:var(--wcs-button-stroked-color-default);--wcs-button-background-color:transparent}:host([mode=stroked]) .wcs-inner-button::before,:host([mode=stroked]) .wcs-inner-button::after{--wcs-button-ripple-color:var(--wcs-button-stroked-ripple-color-default)}:host([mode=clear]){--wcs-button-color:var(--wcs-button-clear-color-default);--wcs-button-background-color:transparent}:host([mode=clear]) .wcs-inner-button::before,:host([mode=clear]) .wcs-inner-button::after{--wcs-button-ripple-color:var(--wcs-button-clear-ripple-color-default)}:host([size=l]){--wcs-button-padding:0 var(--wcs-button-padding-size-l);--wcs-button-height:var(--wcs-button-height-l);--wcs-button-min-width:var(--wcs-button-height-l);--wcs-button-font-size:var(--wcs-button-font-size-l)}:host([size=l]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=l]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-l))}:host,:host([size=m]){--wcs-button-padding:0 var(--wcs-button-padding-size-m);--wcs-button-height:var(--wcs-button-height-m);--wcs-button-min-width:var(--wcs-button-height-m);--wcs-button-font-size:var(--wcs-button-font-size-m)}:host:host([shape=round]) ::slotted(wcs-mat-icon),:host:host([shape=square]) ::slotted(wcs-mat-icon),:host([size=m]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=m]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-m))}:host([size=s]){--wcs-button-padding:0 var(--wcs-button-padding-size-s);--wcs-button-height:var(--wcs-button-height-s);--wcs-button-min-width:var(--wcs-button-height-s);--wcs-button-font-size:var(--wcs-button-font-size-s)}:host([size=s]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=s]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-s))}:host([shape=round]){--wcs-button-border-radius:var(--wcs-button-border-radius-rounded)}:host([shape=square]){--wcs-button-padding:0}:host([shape=normal]) .wcs-inner-button{min-width:var(--wcs-button-min-width, unset);min-height:var(--wcs-button-height, unset)}:host([mode=stroked]) .wcs-inner-button{box-shadow:inset 0 0 0 var(--wcs-button-stroked-border-width) var(--wcs-button-stroked-border-color)}:host([loading]){position:relative}:host([loading]) .wcs-inner-button>*:not(wcs-spinner){visibility:hidden;opacity:0}:host([loading]) wcs-spinner{--wcs-spinner-dashed-background-circle:var(--wcs-button-color);--wcs-spinner-rotating-circle-color:var(--wcs-button-color);height:calc(var(--wcs-button-height) / 2);width:calc(var(--wcs-button-min-width) / 2);position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}:host([disabled]),:host([loading]){cursor:not-allowed}:host([disabled]) .wcs-inner-button,:host([loading]) .wcs-inner-button{opacity:1;cursor:default;pointer-events:none}:host([disabled]){--wcs-button-color:var(--wcs-button-color-disabled);--wcs-button-background-color:var(--wcs-button-plain-background-color-disabled)}:host([mode=stroked][disabled]){--wcs-button-stroked-border-color:var(--wcs-button-stroked-border-color-disabled);--wcs-button-background-color:var(--wcs-button-stroked-background-color-disabled)}:host([mode=clear][disabled]){--wcs-button-background-color:var(--wcs-button-clear-background-color-disabled)}.wcs-inner-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;--mdc-ripple-focus-opacity:0;display:flex;align-items:center;justify-content:center;width:100%;font-family:var(--wcs-font-sans-serif);background-color:var(--wcs-button-background-color);color:var(--wcs-button-color);padding:var(--wcs-button-padding);border-radius:var(--wcs-button-border-radius);border:none;overflow:hidden;outline:0;text-transform:none;margin:0;cursor:pointer;font-weight:var(--wcs-button-font-weight);text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;font-size:var(--wcs-button-font-size);line-height:1.5;height:var(--wcs-button-height);min-width:var(--wcs-button-min-width);transition:color 175ms ease-in-out, background-color 175ms ease-in-out}.wcs-inner-button::before,.wcs-inner-button::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.wcs-inner-button::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.wcs-inner-button::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.wcs-inner-button.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.wcs-inner-button.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.wcs-inner-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.wcs-inner-button.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.wcs-inner-button.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.wcs-inner-button::before,.wcs-inner-button::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.wcs-inner-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.wcs-inner-button:hover::before,.wcs-inner-button.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}.wcs-inner-button.mdc-ripple-upgraded--background-focused::before,.wcs-inner-button:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.wcs-inner-button:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.wcs-inner-button:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-inner-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-inner-button::before,.wcs-inner-button::after{background-color:white;background-color:var(--mdc-ripple-color, white)}.wcs-inner-button::before,.wcs-inner-button::after{background-color:var(--wcs-button-ripple-color)}a{text-decoration:none;box-sizing:border-box}button::-moz-focus-inner,a::-moz-focus-inner{border:0}';const R=I;const j=["tabindex","title"];const S=t(class t extends e{constructor(){super();this.__registerHost();this.__attachShadow();this.inheritedAttributes={};this.type="button";this.href=undefined;this.target=undefined;this.disabled=false;this.ripple=true;this.size="m";this.shape="normal";this.mode="plain";this.loading=false}onClick(t){if(this.disabled||this.loading){t.stopImmediatePropagation()}if(this.type!=="button"&&n(this.el)){const e=this.el.closest("form");if(e){t.preventDefault();const r=window.document.createElement("button");r.type=this.type;r.style.display="none";e.appendChild(r);r.click();r.remove()}}}componentWillLoad(){this.inheritedAttributes=Object.assign(Object.assign({},i(this.el)),o(this.el,j))}componentDidLoad(){this.mdcRipple=new C(this.el.shadowRoot.querySelector(".wcs-inner-button"))}async setAriaAttribute(t,e){s(this.nativeButton,t,e)}enabledRippleEffect(){this.mdcRipple.disabled=false}disabledRippleEffect(){this.mdcRipple.disabled=true}getTagName(){return this.href!==undefined?"a":"button"}onRippleChange(){if(this.ripple){this.enabledRippleEffect()}else{this.disabledRippleEffect()}}render(){const t=this.getTagName();const e=this.href!==undefined?{href:this.href,role:"button",target:this.target}:{type:this.type};return r(t,Object.assign({key:"0405add37ee45734819cae0f9e91507e979d1c9a"},e,{class:"wcs-inner-button",disabled:this.disabled||this.loading,ref:t=>this.nativeButton=t},this.inheritedAttributes),this.loading&&r("wcs-spinner",{key:"03debd8eb23a9db035b92c1e9f51e9fe44a6996b"}),r("slot",{key:"c36416630b0987bd6ef750bfc7ef211c084dd942"}))}static get delegatesFocus(){return true}get el(){return this}static get watchers(){return{ripple:["onRippleChange"]}}static get style(){return R}},[17,"wcs-button",{type:[1025],href:[1],target:[1],disabled:[516],ripple:[4],size:[513],shape:[513],mode:[513],loading:[1540],setAriaAttribute:[64]},[[0,"click","onClick"]],{ripple:["onRippleChange"]}]);function F(){if(typeof customElements==="undefined"){return}const t=["wcs-button","wcs-spinner"];t.forEach((t=>{switch(t){case"wcs-button":if(!customElements.get(t)){customElements.define(t,S)}break;case"wcs-spinner":if(!customElements.get(t)){a()}break}}))}export{S as B,F as d};
|
|
156
|
-
//# sourceMappingURL=p-
|
|
155
|
+
*/var C=function(t){f(e,t);function e(){var e=t!==null&&t.apply(this,arguments)||this;e.disabled=false;return e}e.attachTo=function(t,r){if(r===void 0){r={isUnbounded:undefined}}var n=new e(t);if(r.isUnbounded!==undefined){n.unbounded=r.isUnbounded}return n};e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return u(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,g())},deregisterInteractionHandler:function(e,r){return t.root.removeEventListener(e,r,g())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return k(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,g())},registerInteractionHandler:function(e,r){return t.root.addEventListener(e,r,g())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,r){return t.root.style.setProperty(e,r)}}};Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t);this.setUnbounded()},enumerable:false,configurable:true});e.prototype.activate=function(){this.foundation.activate()};e.prototype.deactivate=function(){this.foundation.deactivate()};e.prototype.layout=function(){this.foundation.layout()};e.prototype.getDefaultFoundation=function(){return new _(e.createAdapter(this))};e.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset};e.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))};return e}(v);const I='@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}:host{display:inline-block;--wcs-button-color:var(--wcs-button-plain-color-default);--wcs-button-plain-color-default:var(--wcs-semantic-color-foreground-action-primary-default);--wcs-button-color-disabled:var(--wcs-semantic-color-text-disabled);--wcs-button-stroked-color-default:var(--wcs-semantic-color-foreground-action-secondary-default);--wcs-button-clear-color-default:var(--wcs-semantic-color-foreground-action-tertiary-default);--wcs-button-focus-outline-color:var(--wcs-semantic-color-border-focus-base);--wcs-button-focus-outline-border-width:var(--wcs-semantic-border-width-large);--wcs-button-background-color:var(--wcs-button-plain-background-color-default);--wcs-button-plain-background-color-default:var(--wcs-semantic-color-background-action-primary-default);--wcs-button-plain-background-color-disabled:var(--wcs-semantic-color-background-action-primary-disabled);--wcs-button-stroked-background-color-default:var(--wcs-semantic-color-background-action-secondary-default);--wcs-button-stroked-background-color-disabled:var(--wcs-semantic-color-background-action-secondary-disabled);--wcs-button-clear-background-color-default:var(--wcs-semantic-color-background-action-tertiary-default);--wcs-button-clear-background-color-disabled:var(--wcs-semantic-color-background-action-tertiary-disabled);--wcs-button-ripple-color:var(--wcs-button-plain-ripple-color-default);--wcs-button-plain-ripple-color-default:var(--wcs-semantic-color-ripple-action-primary);--wcs-button-stroked-ripple-color-default:var(--wcs-semantic-color-ripple-action-secondary);--wcs-button-clear-ripple-color-default:var(--wcs-semantic-color-ripple-action-tertiary);--wcs-button-border-radius:var(--wcs-button-border-radius-default);--wcs-button-border-radius-default:var(--wcs-semantic-border-radius-base);--wcs-button-border-radius-rounded:var(--wcs-semantic-border-radius-full);--wcs-button-stroked-border-color:var(--wcs-button-stroked-border-color-default);--wcs-button-stroked-border-width:var(--wcs-semantic-border-width-default);--wcs-button-stroked-border-color-default:var(--wcs-semantic-color-border-action-secondary-default);--wcs-button-stroked-border-color-disabled:var(--wcs-semantic-color-border-action-secondary-disabled);--wcs-button-height-s:var(--wcs-semantic-size-s);--wcs-button-font-size-s:var(--wcs-semantic-font-size-label-2);--wcs-button-padding-size-s:calc(1.5 * var(--wcs-semantic-spacing-base));--wcs-button-height-m:var(--wcs-semantic-size-m);--wcs-button-font-size-m:var(--wcs-semantic-font-size-label-1);--wcs-button-padding-size-m:calc(2 * var(--wcs-semantic-spacing-base));--wcs-button-height-l:var(--wcs-semantic-size-l);--wcs-button-font-size-l:var(--wcs-semantic-font-size-label-1);--wcs-button-padding-size-l:calc(3 * var(--wcs-semantic-spacing-base));--wcs-button-font-weight:var(--wcs-semantic-font-weight-medium)}.wcs-inner-button:focus-visible{outline:var(--wcs-button-focus-outline-border-width) dashed var(--wcs-button-focus-outline-color);outline-offset:var(--wcs-semantic-spacing-small);border-radius:var(--wcs-button-border-radius)}:host([mode=clear]){--wcs-button-stroked-border-color:transparent}:host([mode=clear]) .wcs-inner-button{box-shadow:none}:host([mode=stroked]){--wcs-button-color:var(--wcs-button-stroked-color-default);--wcs-button-background-color:transparent}:host([mode=stroked]) .wcs-inner-button::before,:host([mode=stroked]) .wcs-inner-button::after{--wcs-button-ripple-color:var(--wcs-button-stroked-ripple-color-default)}:host([mode=clear]){--wcs-button-color:var(--wcs-button-clear-color-default);--wcs-button-background-color:transparent}:host([mode=clear]) .wcs-inner-button::before,:host([mode=clear]) .wcs-inner-button::after{--wcs-button-ripple-color:var(--wcs-button-clear-ripple-color-default)}:host([size=l]){--wcs-button-padding:0 var(--wcs-button-padding-size-l);--wcs-button-height:var(--wcs-button-height-l);--wcs-button-min-width:var(--wcs-button-height-l);--wcs-button-font-size:var(--wcs-button-font-size-l)}:host([size=l]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=l]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-l))}:host,:host([size=m]){--wcs-button-padding:0 var(--wcs-button-padding-size-m);--wcs-button-height:var(--wcs-button-height-m);--wcs-button-min-width:var(--wcs-button-height-m);--wcs-button-font-size:var(--wcs-button-font-size-m)}:host:host([shape=round]) ::slotted(wcs-mat-icon),:host:host([shape=square]) ::slotted(wcs-mat-icon),:host([size=m]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=m]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-m))}:host([size=s]){--wcs-button-padding:0 var(--wcs-button-padding-size-s);--wcs-button-height:var(--wcs-button-height-s);--wcs-button-min-width:var(--wcs-button-height-s);--wcs-button-font-size:var(--wcs-button-font-size-s)}:host([size=s]):host([shape=round]) ::slotted(wcs-mat-icon),:host([size=s]):host([shape=square]) ::slotted(wcs-mat-icon){margin:calc(-1 * var(--wcs-button-padding-size-s))}:host([shape=round]){--wcs-button-border-radius:var(--wcs-button-border-radius-rounded)}:host([shape=square]){--wcs-button-padding:0}:host([shape=normal]) .wcs-inner-button{min-width:var(--wcs-button-min-width, unset);min-height:var(--wcs-button-height, unset)}:host([mode=stroked]) .wcs-inner-button{box-shadow:inset 0 0 0 var(--wcs-button-stroked-border-width) var(--wcs-button-stroked-border-color)}:host([loading]){position:relative}:host([loading]) .wcs-inner-button>*:not(wcs-spinner){visibility:hidden;opacity:0}:host([loading]) wcs-spinner{--wcs-spinner-dashed-background-circle:var(--wcs-button-color);--wcs-spinner-rotating-circle-color:var(--wcs-button-color);height:calc(var(--wcs-button-height) / 2);width:calc(var(--wcs-button-min-width) / 2);position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}:host([disabled]),:host([loading]){cursor:not-allowed}:host([disabled]) .wcs-inner-button,:host([loading]) .wcs-inner-button{opacity:1;cursor:default;pointer-events:none}:host([disabled]){--wcs-button-color:var(--wcs-button-color-disabled);--wcs-button-background-color:var(--wcs-button-plain-background-color-disabled)}:host([mode=stroked][disabled]){--wcs-button-stroked-border-color:var(--wcs-button-stroked-border-color-disabled);--wcs-button-background-color:var(--wcs-button-stroked-background-color-disabled)}:host([mode=clear][disabled]){--wcs-button-background-color:var(--wcs-button-clear-background-color-disabled)}.wcs-inner-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);will-change:transform, opacity;--mdc-ripple-focus-opacity:0;display:flex;align-items:center;justify-content:center;width:100%;font-family:var(--wcs-font-sans-serif);background-color:var(--wcs-button-background-color);color:var(--wcs-button-color);padding:var(--wcs-button-padding);border-radius:var(--wcs-button-border-radius);border:none;overflow:hidden;outline:0;text-transform:none;margin:0;cursor:pointer;font-weight:var(--wcs-button-font-weight);text-align:center;white-space:nowrap;vertical-align:middle;user-select:none;font-size:var(--wcs-button-font-size);line-height:1.5;height:var(--wcs-button-height);min-width:var(--wcs-button-min-width);transition:color 175ms ease-in-out, background-color 175ms ease-in-out}.wcs-inner-button::before,.wcs-inner-button::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.wcs-inner-button::before{transition:opacity 15ms linear, background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.wcs-inner-button::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.wcs-inner-button.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.wcs-inner-button.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.wcs-inner-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.wcs-inner-button.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards, mdc-ripple-fg-opacity-in 75ms forwards}.wcs-inner-button.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.wcs-inner-button::before,.wcs-inner-button::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.wcs-inner-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.wcs-inner-button:hover::before,.wcs-inner-button.mdc-ripple-surface--hover::before{opacity:0.1;opacity:var(--mdc-ripple-hover-opacity, 0.1)}.wcs-inner-button.mdc-ripple-upgraded--background-focused::before,.wcs-inner-button:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.wcs-inner-button:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.wcs-inner-button:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.3;opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-inner-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.3)}.wcs-inner-button::before,.wcs-inner-button::after{background-color:white;background-color:var(--mdc-ripple-color, white)}.wcs-inner-button::before,.wcs-inner-button::after{background-color:var(--wcs-button-ripple-color)}a{text-decoration:none;box-sizing:border-box}button::-moz-focus-inner,a::-moz-focus-inner{border:0}';const R=I;const S=["tabindex","title"];const j=t(class t extends e{constructor(){super();this.__registerHost();this.__attachShadow();this.inheritedAttributes={};this.type="button";this.href=undefined;this.target=undefined;this.disabled=false;this.ripple=true;this.size="m";this.shape="normal";this.mode="plain";this.loading=false}onClick(t){if(this.disabled||this.loading){t.stopImmediatePropagation()}if(this.type!=="button"&&n(this.el)){const e=this.el.closest("form");if(e){t.preventDefault();const r=window.document.createElement("button");r.type=this.type;r.style.display="none";e.appendChild(r);r.click();r.remove()}}}componentWillLoad(){this.inheritedAttributes=Object.assign(Object.assign({},i(this.el)),o(this.el,S))}componentDidLoad(){this.mdcRipple=new C(this.el.shadowRoot.querySelector(".wcs-inner-button"));this.updateRippleState()}async setAriaAttribute(t,e){s(this.nativeButton,t,e)}updateRippleState(){this.mdcRipple.disabled=!this.ripple}getTagName(){return this.href!==undefined?"a":"button"}onRippleChange(){this.updateRippleState()}render(){const t=this.getTagName();const e=this.href!==undefined?{href:this.href,role:"button",target:this.target}:{type:this.type};return r(t,Object.assign({key:"14f58b90f3d1b05b2709cbdb941621c827d462ec"},e,{class:"wcs-inner-button",disabled:this.disabled||this.loading,ref:t=>this.nativeButton=t},this.inheritedAttributes),this.loading&&r("wcs-spinner",{key:"58dbb8b462b5023c59e8bf728ba1d93aa0575cb4"}),r("slot",{key:"b6c394ac1c6a4ee5a9fd6bf10a268420843409d2"}))}static get delegatesFocus(){return true}get el(){return this}static get watchers(){return{ripple:["onRippleChange"]}}static get style(){return R}},[17,"wcs-button",{type:[1025],href:[1],target:[1],disabled:[516],ripple:[4],size:[513],shape:[513],mode:[513],loading:[1540],setAriaAttribute:[64]},[[0,"click","onClick"]],{ripple:["onRippleChange"]}]);function F(){if(typeof customElements==="undefined"){return}const t=["wcs-button","wcs-spinner"];t.forEach((t=>{switch(t){case"wcs-button":if(!customElements.get(t)){customElements.define(t,j)}break;case"wcs-spinner":if(!customElements.get(t)){a()}break}}))}export{j as B,F as d};
|
|
156
|
+
//# sourceMappingURL=p-cdc6f6c2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["supportsCssVariables_","supportsCssVariables","windowObj","forceRefresh","CSS","supportsCssVars","supportsFunctionPresent","supports","explicitlySupportsCssVars","weAreFeatureDetectingSafari10plus","getNormalizedEventCoords","evt","pageOffset","clientRect","x","y","documentX","left","documentY","top","normalizedX","normalizedY","type","touchEvent","changedTouches","pageX","pageY","mouseEvent","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","__extends","TypeError","String","__","this","constructor","create","__assign","assign","t","s","i","n","arguments","length","apply","__values","o","Symbol","iterator","m","next","value","done","__read","r","ar","e","push","error","__spreadArray","to","from","pack","l","slice","concat","MDCFoundation","adapter","defineProperty","get","enumerable","configurable","init","destroy","MDCComponent","root","foundation","args","_i","initialize","undefined","getDefaultFoundation","initialSyncWithDOM","attachTo","_args","Error","listen","evtType","handler","options","addEventListener","unlisten","removeEventListener","emit","evtData","shouldBubble","CustomEvent","bubbles","detail","document","createEvent","initCustomEvent","dispatchEvent","applyPassive","globalObj","window","supportsPassiveOption","passive","passiveSupported","err","matches","element","selector","nativeMatches","webkitMatchesSelector","msMatchesSelector","cssClasses","BG_FOCUSED","FG_ACTIVATION","FG_DEACTIVATION","ROOT","UNBOUNDED","strings","VAR_FG_SCALE","VAR_FG_SIZE","VAR_FG_TRANSLATE_END","VAR_FG_TRANSLATE_START","VAR_LEFT","VAR_TOP","numbers","DEACTIVATION_TIMEOUT_MS","FG_DEACTIVATION_MS","INITIAL_ORIGIN_SCALE","PADDING","TAP_DELAY_MS","ACTIVATION_EVENT_TYPES","POINTER_DEACTIVATION_EVENT_TYPES","activatedTargets","MDCRippleFoundation","_super","_this","defaultAdapter","activationAnimationHasEnded","activationTimer","fgDeactivationRemovalTimer","fgScale","frame","width","height","initialSize","layoutFrame","maxRadius","unboundedCoords","activationState","defaultActivationState","activationTimerCallback","runDeactivationUXLogicIfReady","activateHandler","activateImpl","deactivateHandler","deactivateImpl","focusHandler","handleFocus","blurHandler","handleBlur","resizeHandler","layout","addClass","browserSupportsCssVars","computeBoundingRect","right","bottom","containsEventTarget","deregisterDocumentInteractionHandler","deregisterInteractionHandler","deregisterResizeHandler","getWindowPageOffset","isSurfaceActive","isSurfaceDisabled","isUnbounded","registerDocumentInteractionHandler","registerInteractionHandler","registerResizeHandler","removeClass","updateCssVariable","supportsPressRipple","registerRootHandlers","_a","ROOT_1","UNBOUNDED_1","requestAnimationFrame","layoutInternal","clearTimeout","ROOT_2","UNBOUNDED_2","removeCssVars","deregisterRootHandlers","deregisterDeactivationHandlers","activate","deactivate","cancelAnimationFrame","setUnbounded","unbounded","activationEvent","hasDeactivationUXRun","isActivated","isProgrammatic","wasActivatedByPointer","wasElementMadeActive","e_1","ACTIVATION_EVENT_TYPES_1","ACTIVATION_EVENT_TYPES_1_1","e_1_1","return","registerDeactivationHandlers","e_2","POINTER_DEACTIVATION_EVENT_TYPES_1","POINTER_DEACTIVATION_EVENT_TYPES_1_1","e_2_1","e_3","ACTIVATION_EVENT_TYPES_2","ACTIVATION_EVENT_TYPES_2_1","e_3_1","e_4","POINTER_DEACTIVATION_EVENT_TYPES_2","POINTER_DEACTIVATION_EVENT_TYPES_2_1","e_4_1","rippleStrings","keys","forEach","key","indexOf","previousActivationEvent","isSameInteraction","hasActivatedChild","some","target","resetActivationState","checkElementMadeActive","animateActivation","keyCode","_b","translateStart","translateEnd","_c","getFgTranslationCoordinates","startPoint","endPoint","rmBoundedActivationClasses","setTimeout","activationHasEnded","state","animateDeactivation","maxDim","Math","max","getBoundedRadius","hypotenuse","sqrt","pow","floor","updateLayoutCssVars","round","MDCRipple","disabled","opts","ripple","createAdapter","instance","className","classList","add","util.supportsCssVariables","getBoundingClientRect","contains","documentElement","pageXOffset","pageYOffset","Boolean","remove","varName","style","setProperty","set","dataset","buttonCss","WcsButtonStyle0","BUTTON_INHERITED_ATTRS","Button","proxyCustomElement","H","inheritedAttributes","onClick","ev","loading","stopImmediatePropagation","hasShadowDom","el","form","closest","preventDefault","fakeButton","createElement","display","appendChild","click","componentWillLoad","inheritAriaAttributes","inheritAttributes","componentDidLoad","mdcRipple","shadowRoot","querySelector","updateRippleState","setAriaAttribute","attr","setOrRemoveAttribute","nativeButton","getTagName","href","onRippleChange","render","TagType","attrs","role","h","class","ref"],"sources":["node_modules/@material/ripple/util.js","node_modules/tslib/tslib.es6.js","node_modules/@material/base/foundation.js","node_modules/@material/base/component.js","node_modules/@material/dom/events.js","node_modules/@material/dom/ponyfill.js","node_modules/@material/ripple/constants.js","node_modules/@material/ripple/foundation.js","node_modules/@material/ripple/component.js","src/components/button/button.scss?tag=wcs-button&encapsulation=shadow","src/components/button/button.tsx"],"sourcesContent":["/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nvar supportsCssVariables_;\nexport function supportsCssVariables(windowObj, forceRefresh) {\n if (forceRefresh === void 0) { forceRefresh = false; }\n var CSS = windowObj.CSS;\n var supportsCssVars = supportsCssVariables_;\n if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n return supportsCssVariables_;\n }\n var supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n if (!supportsFunctionPresent) {\n return false;\n }\n var explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n // See: README section on Safari\n var weAreFeatureDetectingSafari10plus = (CSS.supports('(--css-vars: yes)') &&\n CSS.supports('color', '#00000000'));\n supportsCssVars =\n explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n if (!forceRefresh) {\n supportsCssVariables_ = supportsCssVars;\n }\n return supportsCssVars;\n}\nexport function getNormalizedEventCoords(evt, pageOffset, clientRect) {\n if (!evt) {\n return { x: 0, y: 0 };\n }\n var x = pageOffset.x, y = pageOffset.y;\n var documentX = x + clientRect.left;\n var documentY = y + clientRect.top;\n var normalizedX;\n var normalizedY;\n // Determine touch point relative to the ripple container.\n if (evt.type === 'touchstart') {\n var touchEvent = evt;\n normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n }\n else {\n var mouseEvent = evt;\n normalizedX = mouseEvent.pageX - documentX;\n normalizedY = mouseEvent.pageY - documentY;\n }\n return { x: normalizedX, y: normalizedY };\n}\n//# sourceMappingURL=util.js.map","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nvar MDCFoundation = /** @class */ (function () {\n function MDCFoundation(adapter) {\n if (adapter === void 0) { adapter = {}; }\n this.adapter = adapter;\n }\n Object.defineProperty(MDCFoundation, \"cssClasses\", {\n get: function () {\n // Classes extending MDCFoundation should implement this method to return an object which exports every\n // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCFoundation, \"strings\", {\n get: function () {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCFoundation, \"numbers\", {\n get: function () {\n // Classes extending MDCFoundation should implement this method to return an object which exports all\n // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}\n return {};\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCFoundation, \"defaultAdapter\", {\n get: function () {\n // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient\n // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter\n // validation.\n return {};\n },\n enumerable: false,\n configurable: true\n });\n MDCFoundation.prototype.init = function () {\n // Subclasses should override this method to perform initialization routines (registering events, etc.)\n };\n MDCFoundation.prototype.destroy = function () {\n // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)\n };\n return MDCFoundation;\n}());\nexport { MDCFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __read, __spreadArray } from \"tslib\";\nimport { MDCFoundation } from './foundation';\nvar MDCComponent = /** @class */ (function () {\n function MDCComponent(root, foundation) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n this.root = root;\n this.initialize.apply(this, __spreadArray([], __read(args)));\n // Note that we initialize foundation here and not within the constructor's\n // default param so that this.root is defined and can be used within the\n // foundation class.\n this.foundation =\n foundation === undefined ? this.getDefaultFoundation() : foundation;\n this.foundation.init();\n this.initialSyncWithDOM();\n }\n MDCComponent.attachTo = function (root) {\n // Subclasses which extend MDCBase should provide an attachTo() method that takes a root element and\n // returns an instantiated component with its root set to that element. Also note that in the cases of\n // subclasses, an explicit foundation class will not have to be passed in; it will simply be initialized\n // from getDefaultFoundation().\n return new MDCComponent(root, new MDCFoundation({}));\n };\n /* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */\n MDCComponent.prototype.initialize = function () {\n var _args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n _args[_i] = arguments[_i];\n }\n // Subclasses can override this to do any additional setup work that would be considered part of a\n // \"constructor\". Essentially, it is a hook into the parent constructor before the foundation is\n // initialized. Any additional arguments besides root and foundation will be passed in here.\n };\n MDCComponent.prototype.getDefaultFoundation = function () {\n // Subclasses must override this method to return a properly configured foundation class for the\n // component.\n throw new Error('Subclasses must override getDefaultFoundation to return a properly configured ' +\n 'foundation class');\n };\n MDCComponent.prototype.initialSyncWithDOM = function () {\n // Subclasses should override this method if they need to perform work to synchronize with a host DOM\n // object. An example of this would be a form control wrapper that needs to synchronize its internal state\n // to some property or attribute of the host DOM. Please note: this is *not* the place to perform DOM\n // reads/writes that would cause layout / paint, as this is called synchronously from within the constructor.\n };\n MDCComponent.prototype.destroy = function () {\n // Subclasses may implement this method to release any resources / deregister any listeners they have\n // attached. An example of this might be deregistering a resize event from the window object.\n this.foundation.destroy();\n };\n MDCComponent.prototype.listen = function (evtType, handler, options) {\n this.root.addEventListener(evtType, handler, options);\n };\n MDCComponent.prototype.unlisten = function (evtType, handler, options) {\n this.root.removeEventListener(evtType, handler, options);\n };\n /**\n * Fires a cross-browser-compatible custom event from the component root of the given type, with the given data.\n */\n MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) {\n if (shouldBubble === void 0) { shouldBubble = false; }\n var evt;\n if (typeof CustomEvent === 'function') {\n evt = new CustomEvent(evtType, {\n bubbles: shouldBubble,\n detail: evtData,\n });\n }\n else {\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n }\n this.root.dispatchEvent(evt);\n };\n return MDCComponent;\n}());\nexport { MDCComponent };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n//# sourceMappingURL=component.js.map","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj) {\n if (globalObj === void 0) { globalObj = window; }\n return supportsPassiveOption(globalObj) ?\n { passive: true } :\n false;\n}\nfunction supportsPassiveOption(globalObj) {\n if (globalObj === void 0) { globalObj = window; }\n // See\n // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n var passiveSupported = false;\n try {\n var options = {\n // This function will be called when the browser\n // attempts to access the passive property.\n get passive() {\n passiveSupported = true;\n return false;\n }\n };\n var handler = function () { };\n globalObj.document.addEventListener('test', handler, options);\n globalObj.document.removeEventListener('test', handler, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n return passiveSupported;\n}\n//# sourceMappingURL=events.js.map","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global prototype chain.\n * This makes ponyfills safer than traditional polyfills, especially for libraries like MDC.\n */\nexport function closest(element, selector) {\n if (element.closest) {\n return element.closest(selector);\n }\n var el = element;\n while (el) {\n if (matches(el, selector)) {\n return el;\n }\n el = el.parentElement;\n }\n return null;\n}\nexport function matches(element, selector) {\n var nativeMatches = element.matches\n || element.webkitMatchesSelector\n || element.msMatchesSelector;\n return nativeMatches.call(element, selector);\n}\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element) {\n // Check the offsetParent. If the element inherits display: none from any\n // parent, the offsetParent property will be null (see\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n // This check ensures we only clone the node when necessary.\n var htmlEl = element;\n if (htmlEl.offsetParent !== null) {\n return htmlEl.scrollWidth;\n }\n var clone = htmlEl.cloneNode(true);\n clone.style.setProperty('position', 'absolute');\n clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n document.documentElement.appendChild(clone);\n var scrollWidth = clone.scrollWidth;\n document.documentElement.removeChild(clone);\n return scrollWidth;\n}\n//# sourceMappingURL=ponyfill.js.map","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nexport var cssClasses = {\n // Ripple is a special case where the \"root\" component is really a \"mixin\" of sorts,\n // given that it's an 'upgrade' to an existing component. That being said it is the root\n // CSS class that all other CSS classes derive from.\n BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n ROOT: 'mdc-ripple-upgraded',\n UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\nexport var strings = {\n VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n VAR_FG_SIZE: '--mdc-ripple-fg-size',\n VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n VAR_LEFT: '--mdc-ripple-left',\n VAR_TOP: '--mdc-ripple-top',\n};\nexport var numbers = {\n DEACTIVATION_TIMEOUT_MS: 225,\n FG_DEACTIVATION_MS: 150,\n INITIAL_ORIGIN_SCALE: 0.6,\n PADDING: 10,\n TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices\n};\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends, __values } from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses, numbers, strings } from './constants';\nimport { getNormalizedEventCoords } from './util';\n// Activation events registered on the root element of each instance for activation\nvar ACTIVATION_EVENT_TYPES = [\n 'touchstart', 'pointerdown', 'mousedown', 'keydown',\n];\n// Deactivation events registered on documentElement when a pointer-related down event occurs\nvar POINTER_DEACTIVATION_EVENT_TYPES = [\n 'touchend', 'pointerup', 'mouseup', 'contextmenu',\n];\n// simultaneous nested activations\nvar activatedTargets = [];\nvar MDCRippleFoundation = /** @class */ (function (_super) {\n __extends(MDCRippleFoundation, _super);\n function MDCRippleFoundation(adapter) {\n var _this = _super.call(this, __assign(__assign({}, MDCRippleFoundation.defaultAdapter), adapter)) || this;\n _this.activationAnimationHasEnded = false;\n _this.activationTimer = 0;\n _this.fgDeactivationRemovalTimer = 0;\n _this.fgScale = '0';\n _this.frame = { width: 0, height: 0 };\n _this.initialSize = 0;\n _this.layoutFrame = 0;\n _this.maxRadius = 0;\n _this.unboundedCoords = { left: 0, top: 0 };\n _this.activationState = _this.defaultActivationState();\n _this.activationTimerCallback = function () {\n _this.activationAnimationHasEnded = true;\n _this.runDeactivationUXLogicIfReady();\n };\n _this.activateHandler = function (e) {\n _this.activateImpl(e);\n };\n _this.deactivateHandler = function () {\n _this.deactivateImpl();\n };\n _this.focusHandler = function () {\n _this.handleFocus();\n };\n _this.blurHandler = function () {\n _this.handleBlur();\n };\n _this.resizeHandler = function () {\n _this.layout();\n };\n return _this;\n }\n Object.defineProperty(MDCRippleFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCRippleFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCRippleFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCRippleFoundation, \"defaultAdapter\", {\n get: function () {\n return {\n addClass: function () { return undefined; },\n browserSupportsCssVars: function () { return true; },\n computeBoundingRect: function () {\n return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });\n },\n containsEventTarget: function () { return true; },\n deregisterDocumentInteractionHandler: function () { return undefined; },\n deregisterInteractionHandler: function () { return undefined; },\n deregisterResizeHandler: function () { return undefined; },\n getWindowPageOffset: function () { return ({ x: 0, y: 0 }); },\n isSurfaceActive: function () { return true; },\n isSurfaceDisabled: function () { return true; },\n isUnbounded: function () { return true; },\n registerDocumentInteractionHandler: function () { return undefined; },\n registerInteractionHandler: function () { return undefined; },\n registerResizeHandler: function () { return undefined; },\n removeClass: function () { return undefined; },\n updateCssVariable: function () { return undefined; },\n };\n },\n enumerable: false,\n configurable: true\n });\n MDCRippleFoundation.prototype.init = function () {\n var _this = this;\n var supportsPressRipple = this.supportsPressRipple();\n this.registerRootHandlers(supportsPressRipple);\n if (supportsPressRipple) {\n var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED;\n requestAnimationFrame(function () {\n _this.adapter.addClass(ROOT_1);\n if (_this.adapter.isUnbounded()) {\n _this.adapter.addClass(UNBOUNDED_1);\n // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple\n _this.layoutInternal();\n }\n });\n }\n };\n MDCRippleFoundation.prototype.destroy = function () {\n var _this = this;\n if (this.supportsPressRipple()) {\n if (this.activationTimer) {\n clearTimeout(this.activationTimer);\n this.activationTimer = 0;\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n }\n if (this.fgDeactivationRemovalTimer) {\n clearTimeout(this.fgDeactivationRemovalTimer);\n this.fgDeactivationRemovalTimer = 0;\n this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n }\n var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED;\n requestAnimationFrame(function () {\n _this.adapter.removeClass(ROOT_2);\n _this.adapter.removeClass(UNBOUNDED_2);\n _this.removeCssVars();\n });\n }\n this.deregisterRootHandlers();\n this.deregisterDeactivationHandlers();\n };\n /**\n * @param evt Optional event containing position information.\n */\n MDCRippleFoundation.prototype.activate = function (evt) {\n this.activateImpl(evt);\n };\n MDCRippleFoundation.prototype.deactivate = function () {\n this.deactivateImpl();\n };\n MDCRippleFoundation.prototype.layout = function () {\n var _this = this;\n if (this.layoutFrame) {\n cancelAnimationFrame(this.layoutFrame);\n }\n this.layoutFrame = requestAnimationFrame(function () {\n _this.layoutInternal();\n _this.layoutFrame = 0;\n });\n };\n MDCRippleFoundation.prototype.setUnbounded = function (unbounded) {\n var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;\n if (unbounded) {\n this.adapter.addClass(UNBOUNDED);\n }\n else {\n this.adapter.removeClass(UNBOUNDED);\n }\n };\n MDCRippleFoundation.prototype.handleFocus = function () {\n var _this = this;\n requestAnimationFrame(function () { return _this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); });\n };\n MDCRippleFoundation.prototype.handleBlur = function () {\n var _this = this;\n requestAnimationFrame(function () { return _this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); });\n };\n /**\n * We compute this property so that we are not querying information about the client\n * until the point in time where the foundation requests it. This prevents scenarios where\n * client-side feature-detection may happen too early, such as when components are rendered on the server\n * and then initialized at mount time on the client.\n */\n MDCRippleFoundation.prototype.supportsPressRipple = function () {\n return this.adapter.browserSupportsCssVars();\n };\n MDCRippleFoundation.prototype.defaultActivationState = function () {\n return {\n activationEvent: undefined,\n hasDeactivationUXRun: false,\n isActivated: false,\n isProgrammatic: false,\n wasActivatedByPointer: false,\n wasElementMadeActive: false,\n };\n };\n /**\n * supportsPressRipple Passed from init to save a redundant function call\n */\n MDCRippleFoundation.prototype.registerRootHandlers = function (supportsPressRipple) {\n var e_1, _a;\n if (supportsPressRipple) {\n try {\n for (var ACTIVATION_EVENT_TYPES_1 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next(); !ACTIVATION_EVENT_TYPES_1_1.done; ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next()) {\n var evtType = ACTIVATION_EVENT_TYPES_1_1.value;\n this.adapter.registerInteractionHandler(evtType, this.activateHandler);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (ACTIVATION_EVENT_TYPES_1_1 && !ACTIVATION_EVENT_TYPES_1_1.done && (_a = ACTIVATION_EVENT_TYPES_1.return)) _a.call(ACTIVATION_EVENT_TYPES_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (this.adapter.isUnbounded()) {\n this.adapter.registerResizeHandler(this.resizeHandler);\n }\n }\n this.adapter.registerInteractionHandler('focus', this.focusHandler);\n this.adapter.registerInteractionHandler('blur', this.blurHandler);\n };\n MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) {\n var e_2, _a;\n if (evt.type === 'keydown') {\n this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);\n }\n else {\n try {\n for (var POINTER_DEACTIVATION_EVENT_TYPES_1 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next(); !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done; POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next()) {\n var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;\n this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler);\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (POINTER_DEACTIVATION_EVENT_TYPES_1_1 && !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_1.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n };\n MDCRippleFoundation.prototype.deregisterRootHandlers = function () {\n var e_3, _a;\n try {\n for (var ACTIVATION_EVENT_TYPES_2 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next(); !ACTIVATION_EVENT_TYPES_2_1.done; ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next()) {\n var evtType = ACTIVATION_EVENT_TYPES_2_1.value;\n this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (ACTIVATION_EVENT_TYPES_2_1 && !ACTIVATION_EVENT_TYPES_2_1.done && (_a = ACTIVATION_EVENT_TYPES_2.return)) _a.call(ACTIVATION_EVENT_TYPES_2);\n }\n finally { if (e_3) throw e_3.error; }\n }\n this.adapter.deregisterInteractionHandler('focus', this.focusHandler);\n this.adapter.deregisterInteractionHandler('blur', this.blurHandler);\n if (this.adapter.isUnbounded()) {\n this.adapter.deregisterResizeHandler(this.resizeHandler);\n }\n };\n MDCRippleFoundation.prototype.deregisterDeactivationHandlers = function () {\n var e_4, _a;\n this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);\n try {\n for (var POINTER_DEACTIVATION_EVENT_TYPES_2 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next(); !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done; POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next()) {\n var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;\n this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (POINTER_DEACTIVATION_EVENT_TYPES_2_1 && !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_2.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_2);\n }\n finally { if (e_4) throw e_4.error; }\n }\n };\n MDCRippleFoundation.prototype.removeCssVars = function () {\n var _this = this;\n var rippleStrings = MDCRippleFoundation.strings;\n var keys = Object.keys(rippleStrings);\n keys.forEach(function (key) {\n if (key.indexOf('VAR_') === 0) {\n _this.adapter.updateCssVariable(rippleStrings[key], null);\n }\n });\n };\n MDCRippleFoundation.prototype.activateImpl = function (evt) {\n var _this = this;\n if (this.adapter.isSurfaceDisabled()) {\n return;\n }\n var activationState = this.activationState;\n if (activationState.isActivated) {\n return;\n }\n // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction\n var previousActivationEvent = this.previousActivationEvent;\n var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;\n if (isSameInteraction) {\n return;\n }\n activationState.isActivated = true;\n activationState.isProgrammatic = evt === undefined;\n activationState.activationEvent = evt;\n activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown');\n var hasActivatedChild = evt !== undefined &&\n activatedTargets.length > 0 &&\n activatedTargets.some(function (target) { return _this.adapter.containsEventTarget(target); });\n if (hasActivatedChild) {\n // Immediately reset activation state, while preserving logic that prevents touch follow-on events\n this.resetActivationState();\n return;\n }\n if (evt !== undefined) {\n activatedTargets.push(evt.target);\n this.registerDeactivationHandlers(evt);\n }\n activationState.wasElementMadeActive = this.checkElementMadeActive(evt);\n if (activationState.wasElementMadeActive) {\n this.animateActivation();\n }\n requestAnimationFrame(function () {\n // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples\n activatedTargets = [];\n if (!activationState.wasElementMadeActive\n && evt !== undefined\n && (evt.key === ' ' || evt.keyCode === 32)) {\n // If space was pressed, try again within an rAF call to detect :active, because different UAs report\n // active states inconsistently when they're called within event handling code:\n // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS\n // variable is set within a rAF callback for a submit button interaction (#2241).\n activationState.wasElementMadeActive = _this.checkElementMadeActive(evt);\n if (activationState.wasElementMadeActive) {\n _this.animateActivation();\n }\n }\n if (!activationState.wasElementMadeActive) {\n // Reset activation state immediately if element was not made active.\n _this.activationState = _this.defaultActivationState();\n }\n });\n };\n MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) {\n return (evt !== undefined && evt.type === 'keydown') ?\n this.adapter.isSurfaceActive() :\n true;\n };\n MDCRippleFoundation.prototype.animateActivation = function () {\n var _this = this;\n var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;\n var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION;\n var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;\n this.layoutInternal();\n var translateStart = '';\n var translateEnd = '';\n if (!this.adapter.isUnbounded()) {\n var _c = this.getFgTranslationCoordinates(), startPoint = _c.startPoint, endPoint = _c.endPoint;\n translateStart = startPoint.x + \"px, \" + startPoint.y + \"px\";\n translateEnd = endPoint.x + \"px, \" + endPoint.y + \"px\";\n }\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n // Cancel any ongoing activation/deactivation animations\n clearTimeout(this.activationTimer);\n clearTimeout(this.fgDeactivationRemovalTimer);\n this.rmBoundedActivationClasses();\n this.adapter.removeClass(FG_DEACTIVATION);\n // Force layout in order to re-trigger the animation.\n this.adapter.computeBoundingRect();\n this.adapter.addClass(FG_ACTIVATION);\n this.activationTimer = setTimeout(function () {\n _this.activationTimerCallback();\n }, DEACTIVATION_TIMEOUT_MS);\n };\n MDCRippleFoundation.prototype.getFgTranslationCoordinates = function () {\n var _a = this.activationState, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer;\n var startPoint;\n if (wasActivatedByPointer) {\n startPoint = getNormalizedEventCoords(activationEvent, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect());\n }\n else {\n startPoint = {\n x: this.frame.width / 2,\n y: this.frame.height / 2,\n };\n }\n // Center the element around the start point.\n startPoint = {\n x: startPoint.x - (this.initialSize / 2),\n y: startPoint.y - (this.initialSize / 2),\n };\n var endPoint = {\n x: (this.frame.width / 2) - (this.initialSize / 2),\n y: (this.frame.height / 2) - (this.initialSize / 2),\n };\n return { startPoint: startPoint, endPoint: endPoint };\n };\n MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady = function () {\n var _this = this;\n // This method is called both when a pointing device is released, and when the activation animation ends.\n // The deactivation animation should only run after both of those occur.\n var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;\n var _a = this.activationState, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated;\n var activationHasEnded = hasDeactivationUXRun || !isActivated;\n if (activationHasEnded && this.activationAnimationHasEnded) {\n this.rmBoundedActivationClasses();\n this.adapter.addClass(FG_DEACTIVATION);\n this.fgDeactivationRemovalTimer = setTimeout(function () {\n _this.adapter.removeClass(FG_DEACTIVATION);\n }, numbers.FG_DEACTIVATION_MS);\n }\n };\n MDCRippleFoundation.prototype.rmBoundedActivationClasses = function () {\n var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;\n this.adapter.removeClass(FG_ACTIVATION);\n this.activationAnimationHasEnded = false;\n this.adapter.computeBoundingRect();\n };\n MDCRippleFoundation.prototype.resetActivationState = function () {\n var _this = this;\n this.previousActivationEvent = this.activationState.activationEvent;\n this.activationState = this.defaultActivationState();\n // Touch devices may fire additional events for the same interaction within a short time.\n // Store the previous event until it's safe to assume that subsequent events are for new interactions.\n setTimeout(function () { return _this.previousActivationEvent = undefined; }, MDCRippleFoundation.numbers.TAP_DELAY_MS);\n };\n MDCRippleFoundation.prototype.deactivateImpl = function () {\n var _this = this;\n var activationState = this.activationState;\n // This can happen in scenarios such as when you have a keyup event that blurs the element.\n if (!activationState.isActivated) {\n return;\n }\n var state = __assign({}, activationState);\n if (activationState.isProgrammatic) {\n requestAnimationFrame(function () {\n _this.animateDeactivation(state);\n });\n this.resetActivationState();\n }\n else {\n this.deregisterDeactivationHandlers();\n requestAnimationFrame(function () {\n _this.activationState.hasDeactivationUXRun = true;\n _this.animateDeactivation(state);\n _this.resetActivationState();\n });\n }\n };\n MDCRippleFoundation.prototype.animateDeactivation = function (_a) {\n var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive;\n if (wasActivatedByPointer || wasElementMadeActive) {\n this.runDeactivationUXLogicIfReady();\n }\n };\n MDCRippleFoundation.prototype.layoutInternal = function () {\n var _this = this;\n this.frame = this.adapter.computeBoundingRect();\n var maxDim = Math.max(this.frame.height, this.frame.width);\n // Surface diameter is treated differently for unbounded vs. bounded ripples.\n // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately\n // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically\n // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter\n // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via\n // `overflow: hidden`.\n var getBoundedRadius = function () {\n var hypotenuse = Math.sqrt(Math.pow(_this.frame.width, 2) + Math.pow(_this.frame.height, 2));\n return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n };\n this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();\n // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform\n var initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n // Unbounded ripple size should always be even number to equally center align.\n if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {\n this.initialSize = initialSize - 1;\n }\n else {\n this.initialSize = initialSize;\n }\n this.fgScale = \"\" + this.maxRadius / this.initialSize;\n this.updateLayoutCssVars();\n };\n MDCRippleFoundation.prototype.updateLayoutCssVars = function () {\n var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE;\n this.adapter.updateCssVariable(VAR_FG_SIZE, this.initialSize + \"px\");\n this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);\n if (this.adapter.isUnbounded()) {\n this.unboundedCoords = {\n left: Math.round((this.frame.width / 2) - (this.initialSize / 2)),\n top: Math.round((this.frame.height / 2) - (this.initialSize / 2)),\n };\n this.adapter.updateCssVariable(VAR_LEFT, this.unboundedCoords.left + \"px\");\n this.adapter.updateCssVariable(VAR_TOP, this.unboundedCoords.top + \"px\");\n }\n };\n return MDCRippleFoundation;\n}(MDCFoundation));\nexport { MDCRippleFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n//# sourceMappingURL=foundation.js.map","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __extends } from \"tslib\";\nimport { MDCComponent } from '@material/base/component';\nimport { applyPassive } from '@material/dom/events';\nimport { matches } from '@material/dom/ponyfill';\nimport { MDCRippleFoundation } from './foundation';\nimport * as util from './util';\nvar MDCRipple = /** @class */ (function (_super) {\n __extends(MDCRipple, _super);\n function MDCRipple() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.disabled = false;\n return _this;\n }\n MDCRipple.attachTo = function (root, opts) {\n if (opts === void 0) { opts = {\n isUnbounded: undefined\n }; }\n var ripple = new MDCRipple(root);\n // Only override unbounded behavior if option is explicitly specified\n if (opts.isUnbounded !== undefined) {\n ripple.unbounded = opts.isUnbounded;\n }\n return ripple;\n };\n MDCRipple.createAdapter = function (instance) {\n return {\n addClass: function (className) { return instance.root.classList.add(className); },\n browserSupportsCssVars: function () { return util.supportsCssVariables(window); },\n computeBoundingRect: function () { return instance.root.getBoundingClientRect(); },\n containsEventTarget: function (target) { return instance.root.contains(target); },\n deregisterDocumentInteractionHandler: function (evtType, handler) {\n return document.documentElement.removeEventListener(evtType, handler, applyPassive());\n },\n deregisterInteractionHandler: function (evtType, handler) {\n return instance.root\n .removeEventListener(evtType, handler, applyPassive());\n },\n deregisterResizeHandler: function (handler) {\n return window.removeEventListener('resize', handler);\n },\n getWindowPageOffset: function () {\n return ({ x: window.pageXOffset, y: window.pageYOffset });\n },\n isSurfaceActive: function () { return matches(instance.root, ':active'); },\n isSurfaceDisabled: function () { return Boolean(instance.disabled); },\n isUnbounded: function () { return Boolean(instance.unbounded); },\n registerDocumentInteractionHandler: function (evtType, handler) {\n return document.documentElement.addEventListener(evtType, handler, applyPassive());\n },\n registerInteractionHandler: function (evtType, handler) {\n return instance.root\n .addEventListener(evtType, handler, applyPassive());\n },\n registerResizeHandler: function (handler) {\n return window.addEventListener('resize', handler);\n },\n removeClass: function (className) { return instance.root.classList.remove(className); },\n updateCssVariable: function (varName, value) {\n return instance.root.style.setProperty(varName, value);\n },\n };\n };\n Object.defineProperty(MDCRipple.prototype, \"unbounded\", {\n get: function () {\n return Boolean(this.isUnbounded);\n },\n set: function (unbounded) {\n this.isUnbounded = Boolean(unbounded);\n this.setUnbounded();\n },\n enumerable: false,\n configurable: true\n });\n MDCRipple.prototype.activate = function () {\n this.foundation.activate();\n };\n MDCRipple.prototype.deactivate = function () {\n this.foundation.deactivate();\n };\n MDCRipple.prototype.layout = function () {\n this.foundation.layout();\n };\n MDCRipple.prototype.getDefaultFoundation = function () {\n return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n };\n MDCRipple.prototype.initialSyncWithDOM = function () {\n var root = this.root;\n this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset;\n };\n /**\n * Closure Compiler throws an access control error when directly accessing a\n * protected or private property inside a getter/setter, like unbounded above.\n * By accessing the protected property inside a method, we solve that problem.\n * That's why this function exists.\n */\n MDCRipple.prototype.setUnbounded = function () {\n this.foundation.setUnbounded(Boolean(this.isUnbounded));\n };\n return MDCRipple;\n}(MDCComponent));\nexport { MDCRipple };\n//# sourceMappingURL=component.js.map","// TODO: get rid of this.\n@import '~@material/ripple/mdc-ripple';\n@import '../../style/focus-outline.scss';\n\n:host {\n display: inline-block;\n\n --wcs-button-color: var(--wcs-button-plain-color-default);\n --wcs-button-plain-color-default: var(--wcs-semantic-color-foreground-action-primary-default);\n --wcs-button-color-disabled: var(--wcs-semantic-color-text-disabled);\n --wcs-button-stroked-color-default: var(--wcs-semantic-color-foreground-action-secondary-default);\n --wcs-button-clear-color-default: var(--wcs-semantic-color-foreground-action-tertiary-default);\n\n --wcs-button-focus-outline-color: var(--wcs-semantic-color-border-focus-base);\n --wcs-button-focus-outline-border-width: var(--wcs-semantic-border-width-large);\n\n --wcs-button-background-color: var(--wcs-button-plain-background-color-default);\n --wcs-button-plain-background-color-default: var(--wcs-semantic-color-background-action-primary-default);\n --wcs-button-plain-background-color-disabled: var(--wcs-semantic-color-background-action-primary-disabled);\n --wcs-button-stroked-background-color-default: var(--wcs-semantic-color-background-action-secondary-default);\n --wcs-button-stroked-background-color-disabled: var(--wcs-semantic-color-background-action-secondary-disabled);\n --wcs-button-clear-background-color-default: var(--wcs-semantic-color-background-action-tertiary-default);\n --wcs-button-clear-background-color-disabled: var(--wcs-semantic-color-background-action-tertiary-disabled);\n\n --wcs-button-ripple-color: var(--wcs-button-plain-ripple-color-default);\n --wcs-button-plain-ripple-color-default: var(--wcs-semantic-color-ripple-action-primary);\n --wcs-button-stroked-ripple-color-default: var(--wcs-semantic-color-ripple-action-secondary);\n --wcs-button-clear-ripple-color-default: var(--wcs-semantic-color-ripple-action-tertiary);\n --wcs-button-border-radius: var(--wcs-button-border-radius-default);\n --wcs-button-border-radius-default: var(--wcs-semantic-border-radius-base);\n --wcs-button-border-radius-rounded: var(--wcs-semantic-border-radius-full);\n\n --wcs-button-stroked-border-color: var(--wcs-button-stroked-border-color-default);\n --wcs-button-stroked-border-width: var(--wcs-semantic-border-width-default);\n --wcs-button-stroked-border-color-default: var(--wcs-semantic-color-border-action-secondary-default);\n --wcs-button-stroked-border-color-disabled: var(--wcs-semantic-color-border-action-secondary-disabled);\n\n --wcs-button-height-s: var(--wcs-semantic-size-s);\n --wcs-button-font-size-s: var(--wcs-semantic-font-size-label-2);\n --wcs-button-padding-size-s: calc(1.5 * var(--wcs-semantic-spacing-base));\n\n --wcs-button-height-m: var(--wcs-semantic-size-m);\n --wcs-button-font-size-m: var(--wcs-semantic-font-size-label-1);\n --wcs-button-padding-size-m: calc(2 * var(--wcs-semantic-spacing-base));\n\n --wcs-button-height-l: var(--wcs-semantic-size-l);\n --wcs-button-font-size-l: var(--wcs-semantic-font-size-label-1);\n --wcs-button-padding-size-l: calc(3 * var(--wcs-semantic-spacing-base));\n\n --wcs-button-font-weight: var(--wcs-semantic-font-weight-medium);\n}\n\n\n.wcs-inner-button:focus-visible {\n @include focus-outline($outline-color: var(--wcs-button-focus-outline-color), $border-radius: var(--wcs-button-border-radius), $border-width: var(--wcs-button-focus-outline-border-width));\n}\n\n:host([mode=clear]) {\n --wcs-button-stroked-border-color: transparent;\n\n .wcs-inner-button {\n box-shadow: none;\n }\n}\n\n:host([mode=stroked]) {\n --wcs-button-color: var(--wcs-button-stroked-color-default);\n --wcs-button-background-color: transparent;\n\n .wcs-inner-button {\n &::before,\n &::after {\n --wcs-button-ripple-color: var(--wcs-button-stroked-ripple-color-default);\n }\n }\n}\n\n:host([mode=clear]) {\n --wcs-button-color: var(--wcs-button-clear-color-default);\n --wcs-button-background-color: transparent;\n\n .wcs-inner-button {\n &::before,\n &::after {\n --wcs-button-ripple-color: var(--wcs-button-clear-ripple-color-default);\n }\n }\n}\n\n:host([size=l]) {\n --wcs-button-padding: 0 var(--wcs-button-padding-size-l);\n --wcs-button-height: var(--wcs-button-height-l);\n --wcs-button-min-width: var(--wcs-button-height-l);\n --wcs-button-font-size: var(--wcs-button-font-size-l);\n\n &:host([shape=round]), &:host([shape=square]) {\n ::slotted(wcs-mat-icon) {\n margin: calc(-1 * var(--wcs-button-padding-size-l));\n }\n }\n}\n\n:host, :host([size=m]) { // Default\n --wcs-button-padding: 0 var(--wcs-button-padding-size-m);\n --wcs-button-height: var(--wcs-button-height-m);\n --wcs-button-min-width: var(--wcs-button-height-m);\n --wcs-button-font-size: var(--wcs-button-font-size-m);\n\n &:host([shape=round]), &:host([shape=square]) {\n ::slotted(wcs-mat-icon) {\n margin: calc(-1 * var(--wcs-button-padding-size-m));\n }\n }\n}\n\n:host([size=s]) {\n --wcs-button-padding: 0 var(--wcs-button-padding-size-s);\n --wcs-button-height: var(--wcs-button-height-s);\n --wcs-button-min-width: var(--wcs-button-height-s);\n --wcs-button-font-size: var(--wcs-button-font-size-s);\n\n &:host([shape=round]), &:host([shape=square]) {\n ::slotted(wcs-mat-icon) {\n margin: calc(-1 * var(--wcs-button-padding-size-s));\n }\n }\n}\n\n:host([shape=round]) {\n --wcs-button-border-radius: var(--wcs-button-border-radius-rounded);\n}\n\n:host([shape=square]) {\n --wcs-button-padding: 0;\n}\n\n:host([shape=normal]) {\n .wcs-inner-button {\n min-width: var(--wcs-button-min-width, unset);\n min-height: var(--wcs-button-height, unset);\n }\n}\n\n:host([mode=stroked]) {\n .wcs-inner-button {\n box-shadow: inset 0 0 0 var(--wcs-button-stroked-border-width) var(--wcs-button-stroked-border-color);\n }\n}\n\n:host([loading]) {\n position: relative;\n\n .wcs-inner-button > *:not(wcs-spinner) {\n visibility: hidden;\n opacity: 0;\n }\n\n wcs-spinner {\n --wcs-spinner-dashed-background-circle: var(--wcs-button-color);\n --wcs-spinner-rotating-circle-color: var(--wcs-button-color);\n height: calc(var(--wcs-button-height) / 2);\n width: calc(var(--wcs-button-min-width) / 2);\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n margin: auto;\n }\n}\n\n:host([disabled]), :host([loading]) {\n cursor: not-allowed;\n\n .wcs-inner-button {\n opacity: 1;\n cursor: default;\n pointer-events: none;\n }\n}\n\n\n\n:host([disabled]) {\n --wcs-button-color: var(--wcs-button-color-disabled);\n --wcs-button-background-color: var(--wcs-button-plain-background-color-disabled);\n}\n\n:host([mode=stroked][disabled]) {\n --wcs-button-stroked-border-color: var(--wcs-button-stroked-border-color-disabled);\n --wcs-button-background-color: var(--wcs-button-stroked-background-color-disabled);\n}\n\n:host([mode=clear][disabled]) {\n --wcs-button-background-color: var(--wcs-button-clear-background-color-disabled);\n}\n\n.wcs-inner-button {\n @include mdc-ripple-surface;\n @include mdc-ripple-radius-bounded;\n @include mdc-states-hover-opacity(.1);\n @include mdc-states-focus-opacity(.2);\n @include mdc-states-press-opacity(.3);\n @include mdc-states-base-color(white);\n --mdc-ripple-focus-opacity: 0;\n\n // This property is used to set the ripple color\n &::before,\n &::after {\n background-color: var(--wcs-button-ripple-color);\n }\n\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font-family: var(--wcs-font-sans-serif);\n background-color: var(--wcs-button-background-color);\n color: var(--wcs-button-color);\n padding: var(--wcs-button-padding);\n border-radius: var(--wcs-button-border-radius);\n border: none;\n overflow: hidden;\n outline: 0;\n text-transform: none;\n margin: 0;\n cursor: pointer;\n font-weight: var(--wcs-button-font-weight);\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n user-select: none;\n font-size: var(--wcs-button-font-size);\n line-height: 1.5;\n height: var(--wcs-button-height);\n min-width: var(--wcs-button-min-width);\n\n transition: color 175ms ease-in-out, background-color 175ms ease-in-out;\n}\n\na {\n text-decoration: none;\n box-sizing: border-box;\n}\n\n// Remove mozilla dotted outline on button and a\nbutton::-moz-focus-inner,\na::-moz-focus-inner {\n border: 0;\n}\n","import { Component, ComponentInterface, Element, h, Listen, Method, Prop, Watch } from '@stencil/core';\n\nimport { MDCRipple } from '@material/ripple';\n\nimport {\n WcsButtonMode,\n WcsButtonShape,\n WcsButtonSize,\n WcsButtonType\n} from './button-interface';\nimport { hasShadowDom, inheritAriaAttributes, inheritAttributes, setOrRemoveAttribute } from '../../utils/helpers';\nimport { AriaAttributeName, MutableAriaAttribute } from \"../../utils/mutable-aria-attribute\";\n\nconst BUTTON_INHERITED_ATTRS = ['tabindex', 'title'];\n\n/**\n * The button component is used to trigger an action. It can also be a link when specifying href.\n * \n * ## Accessibility guidelines 💡\n * > If your button doesn't contain text but only an image, you must set a relevant aria-label on the icon 👉 [see \"Square\" story below](#square)\n * \n * ## Click event\n *\n * The WCS button relies on the native click event to pass a user click to your app.\n * For now, it's not possible for us to prevent the click event to be fired when the button's disabled attribute is true.\n * This means you'll receive click events on a disabled wcs button.\n * If you're using the button with a library like Angular or React, they have internal mechanisms to prevent this behavior. Your callbacks will therefore not be called.\n * To fix this problem, we plan to provide a wcsClick event in addition to the native click for applications developed without frameworks.\n *\n * @cssprop --wcs-button-plain-color-default - Text/icon color of a plain button\n * @cssprop --wcs-button-stroked-color-default - text/icon color of a stroked button\n * @cssprop --wcs-button-clear-color-default - text/icon color of a clear button\n * \n * @cssprop --wcs-button-color-disabled - text/icon color disabled for mode plain, stroked, clear\n *\n * @cssprop --wcs-button-plain-background-color-default background color of a plain button\n * @cssprop --wcs-button-plain-background-color-disabled - disabled background color of a plain button\n * @cssprop --wcs-button-stroked-background-color-default background color of a stroked button\n * @cssprop --wcs-button-stroked-background-color-disabled - disabled background color of a stroked button\n * @cssprop --wcs-button-clear-background-color-default background color of a clear button\n * @cssprop --wcs-button-clear-background-color-disabled - disabled background color of a clear button\n * \n * @cssprop --wcs-button-plain-ripple-color-default - ripple background color of a plain button\n * @cssprop --wcs-button-stroked-ripple-color-default - ripple background color of a stroked button\n * @cssprop --wcs-button-clear-ripple-color-default - ripple background color of a clear button\n * @cssprop --wcs-button-border-radius-default - border radius for a default button\n * @cssprop --wcs-button-border-radius-rounded - border radius for a rounded button\n *\n * @cssprop --wcs-button-stroked-border-width - border width of a stroked button\n * @cssprop --wcs-button-stroked-border-color-default - default border color of a stroked button\n * @cssprop --wcs-button-stroked-border-color-disabled - disabled border color of a stroked button\n *\n * @cssprop --wcs-button-height-s - height for a size s button\n * @cssprop --wcs-button-font-size-s - font-size for a size s button\n * @cssprop --wcs-button-padding-size-s - padding for a size s button\n *\n * @cssprop --wcs-button-height-m - height for a size m button\n * @cssprop --wcs-button-font-size-m - font-size for a size m button\n * @cssprop --wcs-button-padding-size-m - padding for a size m button\n *\n * @cssprop --wcs-button-height-l - height for a size l button\n * @cssprop --wcs-button-font-size-l - font-size for a size l button\n * @cssprop --wcs-button-padding-size-l - padding for a size l button\n *\n * @cssprop --wcs-button-font-weight - font weight of a plain,stroked,clear button\n */\n@Component({\n tag: 'wcs-button',\n styleUrl: 'button.scss',\n shadow: {\n delegatesFocus: true\n }\n})\nexport class Button implements ComponentInterface, MutableAriaAttribute {\n @Element() private el!: HTMLElement;\n private nativeButton?: HTMLButtonElement | HTMLAnchorElement;\n private inheritedAttributes: { [k: string]: any } = {};\n\n /**\n * Specify the button type.\n */\n @Prop({ mutable: true }) type: WcsButtonType = 'button';\n\n /**\n * Set a URL to point to.<br/>\n * If specified use a `a` tag instead of `btn`.\n */\n @Prop() href?: string;\n\n /**\n * Specifies where to open the linked document when using href (see prop above)<br/>\n * Default '_self' will open the linked document in the same frame as it was clicked\n */\n @Prop() target?: '_blank' | '_self';\n\n /**\n * Specify whether the button is disabled or not.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Specify whether the button should have a ripple effect or not.\n */\n @Prop() ripple = true;\n private mdcRipple: MDCRipple;\n\n /**\n * Specify the size of the button.\n */\n @Prop({ reflect: true }) size: WcsButtonSize = 'm';\n\n /**\n * Specify the shape of the button.\n */\n @Prop({ reflect: true }) shape: WcsButtonShape = 'normal';\n\n /**\n * This attribute specify the appearance of the button.\n */\n @Prop({ reflect: true }) mode: WcsButtonMode = 'plain';\n\n /**\n * Flag to display spinner until the end of action\n */\n @Prop({ reflect: true, mutable: true }) loading: boolean = false;\n\n /**\n * Native event click is emit event if we decide to stop propagation of it\n * @param ev\n */\n @Listen('click') // TODO: define custom event click to be able to stop it's propagation when the custom button is disabled or is in loading state\n onClick(ev: Event) {\n if (this.disabled || this.loading) {\n ev.stopImmediatePropagation();\n }\n if (this.type !== 'button' && hasShadowDom(this.el)) {\n // this button wants to specifically submit a form\n // climb up the dom to see if we're in a <form>\n // and if so, then use JS to submit it\n const form = this.el.closest('form');\n if (form) {\n ev.preventDefault();\n\n const fakeButton = window.document.createElement('button');\n fakeButton.type = this.type;\n fakeButton.style.display = 'none';\n form.appendChild(fakeButton);\n fakeButton.click();\n fakeButton.remove();\n }\n }\n }\n\n componentWillLoad(): Promise<void> | void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.el),\n ...inheritAttributes(this.el, BUTTON_INHERITED_ATTRS),\n };\n }\n\n componentDidLoad() {\n this.mdcRipple = new MDCRipple(this.el.shadowRoot.querySelector('.wcs-inner-button'));\n this.updateRippleState();\n }\n \n @Method()\n async setAriaAttribute(attr: AriaAttributeName, value: string | null | undefined) {\n setOrRemoveAttribute(this.nativeButton, attr, value);\n }\n\n private updateRippleState() {\n this.mdcRipple.disabled = !this.ripple;\n }\n\n private getTagName() {\n return this.href !== undefined ? 'a' : 'button';\n }\n\n @Watch('ripple')\n onRippleChange() {\n this.updateRippleState();\n }\n\n render() {\n const TagType = this.getTagName();\n const attrs = this.href !== undefined\n ? { href: this.href, role: 'button', target: this.target }\n : { type: this.type };\n return (\n <TagType\n {...attrs}\n class=\"wcs-inner-button\"\n disabled = {this.disabled || this.loading}\n ref={(el: HTMLButtonElement | HTMLAnchorElement) => this.nativeButton = el}\n {...this.inheritedAttributes}\n >\n {\n this.loading && <wcs-spinner></wcs-spinner>\n }\n <slot/>\n </TagType>\n );\n }\n}\n"],"mappings":"qIAIA,IAAIA,EACG,SAASC,EAAqBC,EAAWC,GAC5C,GAAIA,SAAsB,EAAG,CAAEA,EAAe,KAAM,CACpD,IAAIC,EAAMF,EAAUE,IACpB,IAAIC,EAAkBL,EACtB,UAAWA,IAA0B,YAAcG,EAAc,CAC7D,OAAOH,CACf,CACI,IAAIM,EAA0BF,UAAcA,EAAIG,WAAa,WAC7D,IAAKD,EAAyB,CAC1B,OAAO,KACf,CACI,IAAIE,EAA4BJ,EAAIG,SAAS,aAAc,OAG3D,IAAIE,EAAqCL,EAAIG,SAAS,sBAClDH,EAAIG,SAAS,QAAS,aAC1BF,EACIG,GAA6BC,EACjC,IAAKN,EAAc,CACfH,EAAwBK,CAChC,CACI,OAAOA,CACX,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Q,oBAAmB9Q,OAAAgB,OAAAhB,OAAAgB,OAAA,GACjB8Q,EAAsBlR,KAAKwQ,KAC3BW,EAAkBnR,KAAKwQ,GAAIV,G,CAItC,gBAAAsB,GACIpR,KAAKqR,UAAY,IAAI/C,EAAUtO,KAAKwQ,GAAGc,WAAWC,cAAc,sBAChEvR,KAAKwR,mB,CAIT,sBAAMC,CAAiBC,EAAyBxQ,GAC5CyQ,EAAqB3R,KAAK4R,aAAcF,EAAMxQ,E,CAG1C,iBAAAsQ,GACJxR,KAAKqR,UAAU9C,UAAYvO,KAAKyO,M,CAG5B,UAAAoD,GACJ,OAAO7R,KAAK8R,OAAS/O,UAAY,IAAM,Q,CAI3C,cAAAgP,GACI/R,KAAKwR,mB,CAGT,MAAAQ,GACI,MAAMC,EAAUjS,KAAK6R,aACrB,MAAMK,EAAQlS,KAAK8R,OAAS/O,UACtB,CAAE+O,KAAM9R,KAAK8R,KAAMK,KAAM,SAAUxF,OAAQ3M,KAAK2M,QAChD,CAAEhO,KAAMqB,KAAKrB,MACnB,OACIyT,EAACH,EAAO7S,OAAAgB,OAAA,CAAAiM,IAAA,4CACA6F,EAAK,CACTG,MAAM,mBACN9D,SAAYvO,KAAKuO,UAAYvO,KAAKqQ,QAClCiC,IAAM9B,GAA8CxQ,KAAK4R,aAAepB,GACpExQ,KAAKkQ,qBAGLlQ,KAAKqQ,SAAW+B,EAAA,eAAA/F,IAAA,6CAEpB+F,EAAA,QAAA/F,IAAA,6C"}
|
package/bundle/wcs-accordion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,h as
|
|
1
|
+
import{p as t,H as e,h as i,c as n}from"./p-2bef72c7.js";const s=":host{--wcs-accordion-gap:var(--wcs-semantic-spacing-base);display:flex;flex-direction:column;gap:var(--wcs-accordion-gap)}";const a=s;const c=t(class t extends e{constructor(){super();this.__registerHost();this.__attachShadow();this.accordionPanels=[];this.hideActionText=true;this.highlight=false;this.groupContentWithHeader=false;this.multiExpandable=false}componentWillLoad(){this.accordionPanels=this.getAllAccordionPanelsFromHostElement();this.updateHideActiontextOnPanel();this.updateHighlightOnPanel();this.updateGroupContentWithHeader()}wcsOpenChangeHandler(t){t.stopImmediatePropagation();if(!this.multiExpandable&&t.detail){this.closeAllAccordionsExcept(t.target)}}updateHideActiontextOnPanel(){this.accordionPanels.forEach((t=>{t.hideActionText=this.hideActionText}))}updateHighlightOnPanel(){this.accordionPanels.forEach((t=>{t.highlight=this.highlight}))}updateGroupContentWithHeader(){this.accordionPanels.forEach((t=>{t.groupContentWithHeader=this.groupContentWithHeader}))}handleSlotChange(){this.accordionPanels=this.getAllAccordionPanelsFromHostElement()}render(){return i(n,{key:"3d4b5df74c659c9c7b0f29989fb1c100a893e2a2"},i("slot",{key:"6d6ce20faf1d9e2f93d11373eb97de0806167576",onSlotchange:this.handleSlotChange.bind(this)}))}getAllAccordionPanelsFromHostElement(){return Array.from(this.el.children).filter((t=>t.tagName==="WCS-ACCORDION-PANEL"))}closeAllAccordionsExcept(t){this.accordionPanels.filter((e=>e!==t)).forEach((t=>t.close()))}get el(){return this}static get watchers(){return{hideActionText:["updateHideActiontextOnPanel"],highlight:["updateHighlightOnPanel"],groupContentWithHeader:["updateGroupContentWithHeader"]}}static get style(){return a}},[1,"wcs-accordion",{hideActionText:[516,"hide-action-text"],highlight:[516],groupContentWithHeader:[516,"group-content-with-header"],multiExpandable:[4,"multi-expandable"]},[[0,"wcsOpenChange","wcsOpenChangeHandler"]],{hideActionText:["updateHideActiontextOnPanel"],highlight:["updateHighlightOnPanel"],groupContentWithHeader:["updateGroupContentWithHeader"]}]);function o(){if(typeof customElements==="undefined"){return}const t=["wcs-accordion"];t.forEach((t=>{switch(t){case"wcs-accordion":if(!customElements.get(t)){customElements.define(t,c)}break}}))}const h=c;const r=o;export{h as WcsAccordion,r as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=wcs-accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accordionCss","WcsAccordionStyle0","Accordion","proxyCustomElement","H","this","accordionPanels","componentWillLoad","getAllAccordionPanelsFromHostElement","updateHideActiontextOnPanel","updateHighlightOnPanel","updateGroupContentWithHeader","wcsOpenChangeHandler","event","stopImmediatePropagation","detail","closeAllAccordionsExcept","target","forEach","opt","hideActionText","highlight","groupContentWithHeader","handleSlotChange","render","h","Host","key","onSlotchange","bind","Array","from","el","children","filter","tagName","eventTarget","a","close"],"sources":["src/components/accordion/accordion.scss?tag=wcs-accordion&encapsulation=shadow","src/components/accordion/accordion.tsx"],"sourcesContent":[":host {\n --wcs-accordion-gap: var(--wcs-semantic-spacing-base);\n\n display: flex;\n flex-direction: column;\n gap: var(--wcs-accordion-gap);\n}\n","import { Component, Element, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\n/**\n * The accordion component is a vertical stack of interactive headings used to toggle the display of further information.\n * \n * @cssprop --wcs-accordion-gap - Gap between accordion panels\n */\n@Component({\n tag: 'wcs-accordion',\n styleUrl: 'accordion.scss',\n shadow: true\n})\nexport class Accordion {\n @Element() private el!: HTMLWcsAccordionElement;\n private accordionPanels: HTMLWcsAccordionPanelElement[] = [];\n\n /**\n * Specifies whether accordion-panel components should display the open/close text.\n * if false, it won't show the open/close text in all accordion-panel.\n */\n @Prop({reflect: true}) hideActionText: boolean = true;\n\n /**\n * Specifies whether accordion-panel components should highlight when open with primary color.\n * if true, the background color of the accordion-panel will be the primary color.\n * if false, the background color of the accordion-panel will be wcs-light.\n */\n @Prop({reflect: true}) highlight: boolean = false;\n\n /**\n * @deprecated **The content is now always grouped with the panel header**\n * \n * ~~Specifies whether accordion-panel components should group the content with header in one card~~\n * ~~if true, there will be only one card with the header and the content~~\n * ~~Nothing change when the panel is close~~\n */\n @Prop({reflect: true}) groupContentWithHeader: boolean = false;\n\n componentWillLoad(): Promise<void> | void {\n this.accordionPanels = this.getAllAccordionPanelsFromHostElement();\n\n this.updateHideActiontextOnPanel();\n this.updateHighlightOnPanel();\n this.updateGroupContentWithHeader();\n }\n\n @Listen('wcsOpenChange')\n wcsOpenChangeHandler(event: CustomEvent<boolean>) {\n event.stopImmediatePropagation();\n if (event.detail) {\n this.closeAllAccordionsExcept(event.target);\n }\n }\n\n @Watch('hideActionText')\n private updateHideActiontextOnPanel() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.hideActionText = this.hideActionText;\n })\n }\n\n @Watch('highlight')\n private updateHighlightOnPanel() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.highlight = this.highlight;\n })\n }\n @Watch('groupContentWithHeader')\n private updateGroupContentWithHeader() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.groupContentWithHeader = this.groupContentWithHeader;\n })\n }\n\n private handleSlotChange() {\n // Refresh the list of accordion panels to include dynamically added ones\n this.accordionPanels = this.getAllAccordionPanelsFromHostElement();\n }\n\n render() {\n return (\n <Host>\n <slot onSlotchange={this.handleSlotChange.bind(this)} />\n </Host>\n );\n }\n\n private getAllAccordionPanelsFromHostElement(): HTMLWcsAccordionPanelElement[] {\n return Array.from(this.el.children)\n .filter(el => el.tagName === 'WCS-ACCORDION-PANEL') as HTMLWcsAccordionPanelElement[];\n }\n\n /**\n * Close all accordion panels except the one that match the eventTarget reference\n */\n private closeAllAccordionsExcept(eventTarget: EventTarget): void {\n this.accordionPanels.filter(a => a !== eventTarget).forEach(a => a.close());\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAe,8HACrB,MAAAC,EAAeD,E,MCWFE,EAASC,EAAA,MAAAD,UAAAE,E,kEAEVC,KAAAC,gBAAkD,G,oBAMT,K,eAOL,M,4BASa,K,
|
|
1
|
+
{"version":3,"names":["accordionCss","WcsAccordionStyle0","Accordion","proxyCustomElement","H","this","accordionPanels","componentWillLoad","getAllAccordionPanelsFromHostElement","updateHideActiontextOnPanel","updateHighlightOnPanel","updateGroupContentWithHeader","wcsOpenChangeHandler","event","stopImmediatePropagation","multiExpandable","detail","closeAllAccordionsExcept","target","forEach","opt","hideActionText","highlight","groupContentWithHeader","handleSlotChange","render","h","Host","key","onSlotchange","bind","Array","from","el","children","filter","tagName","eventTarget","a","close"],"sources":["src/components/accordion/accordion.scss?tag=wcs-accordion&encapsulation=shadow","src/components/accordion/accordion.tsx"],"sourcesContent":[":host {\n --wcs-accordion-gap: var(--wcs-semantic-spacing-base);\n\n display: flex;\n flex-direction: column;\n gap: var(--wcs-accordion-gap);\n}\n","import { Component, Element, h, Host, Listen, Prop, Watch } from '@stencil/core';\n\n/**\n * The accordion component is a vertical stack of interactive headings used to toggle the display of further information.\n * \n * @cssprop --wcs-accordion-gap - Gap between accordion panels\n */\n@Component({\n tag: 'wcs-accordion',\n styleUrl: 'accordion.scss',\n shadow: true\n})\nexport class Accordion {\n @Element() private el!: HTMLWcsAccordionElement;\n private accordionPanels: HTMLWcsAccordionPanelElement[] = [];\n\n /**\n * Specifies whether accordion-panel components should display the open/close text.\n * if false, it won't show the open/close text in all accordion-panel.\n */\n @Prop({reflect: true}) hideActionText: boolean = true;\n\n /**\n * Specifies whether accordion-panel components should highlight when open with primary color.\n * if true, the background color of the accordion-panel will be the primary color.\n * if false, the background color of the accordion-panel will be wcs-light.\n */\n @Prop({reflect: true}) highlight: boolean = false;\n\n /**\n * @deprecated **The content is now always grouped with the panel header**\n * \n * ~~Specifies whether accordion-panel components should group the content with header in one card~~\n * ~~if true, there will be only one card with the header and the content~~\n * ~~Nothing change when the panel is close~~\n */\n @Prop({reflect: true}) groupContentWithHeader: boolean = false;\n\n /**\n * Specifies whether multiple wcs-accordion-panel can be expanded at the same time.\n * Default to false, meaning only one panel can be expanded at a time\n */\n @Prop() multiExpandable: boolean = false;\n\n componentWillLoad(): Promise<void> | void {\n this.accordionPanels = this.getAllAccordionPanelsFromHostElement();\n\n this.updateHideActiontextOnPanel();\n this.updateHighlightOnPanel();\n this.updateGroupContentWithHeader();\n }\n\n @Listen('wcsOpenChange')\n wcsOpenChangeHandler(event: CustomEvent<boolean>) {\n event.stopImmediatePropagation();\n if (!this.multiExpandable && event.detail) {\n this.closeAllAccordionsExcept(event.target);\n }\n }\n\n @Watch('hideActionText')\n private updateHideActiontextOnPanel() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.hideActionText = this.hideActionText;\n })\n }\n\n @Watch('highlight')\n private updateHighlightOnPanel() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.highlight = this.highlight;\n })\n }\n @Watch('groupContentWithHeader')\n private updateGroupContentWithHeader() {\n this.accordionPanels.forEach((opt: HTMLWcsAccordionPanelElement) => {\n opt.groupContentWithHeader = this.groupContentWithHeader;\n })\n }\n\n private handleSlotChange() {\n // Refresh the list of accordion panels to include dynamically added ones\n this.accordionPanels = this.getAllAccordionPanelsFromHostElement();\n }\n\n render() {\n return (\n <Host>\n <slot onSlotchange={this.handleSlotChange.bind(this)} />\n </Host>\n );\n }\n\n private getAllAccordionPanelsFromHostElement(): HTMLWcsAccordionPanelElement[] {\n return Array.from(this.el.children)\n .filter(el => el.tagName === 'WCS-ACCORDION-PANEL') as HTMLWcsAccordionPanelElement[];\n }\n\n /**\n * Close all accordion panels except the one that match the eventTarget reference\n */\n private closeAllAccordionsExcept(eventTarget: EventTarget): void {\n this.accordionPanels.filter(a => a !== eventTarget).forEach(a => a.close());\n }\n}\n"],"mappings":"yDAAA,MAAMA,EAAe,8HACrB,MAAAC,EAAeD,E,MCWFE,EAASC,EAAA,MAAAD,UAAAE,E,kEAEVC,KAAAC,gBAAkD,G,oBAMT,K,eAOL,M,4BASa,M,qBAMtB,K,CAEnC,iBAAAC,GACIF,KAAKC,gBAAkBD,KAAKG,uCAE5BH,KAAKI,8BACLJ,KAAKK,yBACLL,KAAKM,8B,CAIT,oBAAAC,CAAqBC,GACjBA,EAAMC,2BACN,IAAKT,KAAKU,iBAAmBF,EAAMG,OAAQ,CACvCX,KAAKY,yBAAyBJ,EAAMK,O,EAKpC,2BAAAT,GACJJ,KAAKC,gBAAgBa,SAASC,IAC1BA,EAAIC,eAAiBhB,KAAKgB,cAAc,G,CAKxC,sBAAAX,GACJL,KAAKC,gBAAgBa,SAASC,IAC1BA,EAAIE,UAAYjB,KAAKiB,SAAS,G,CAI9B,4BAAAX,GACJN,KAAKC,gBAAgBa,SAASC,IAC1BA,EAAIG,uBAAyBlB,KAAKkB,sBAAsB,G,CAIxD,gBAAAC,GAEJnB,KAAKC,gBAAkBD,KAAKG,sC,CAGhC,MAAAiB,GACI,OACIC,EAACC,EAAI,CAAAC,IAAA,4CACDF,EAAA,QAAAE,IAAA,2CAAMC,aAAcxB,KAAKmB,iBAAiBM,KAAKzB,Q,CAKnD,oCAAAG,GACJ,OAAOuB,MAAMC,KAAK3B,KAAK4B,GAAGC,UACrBC,QAAOF,GAAMA,EAAGG,UAAY,uB,CAM7B,wBAAAnB,CAAyBoB,GAC7BhC,KAAKC,gBAAgB6B,QAAOG,GAAKA,IAAMD,IAAalB,SAAQmB,GAAKA,EAAEC,S"}
|