@momentum-design/components 0.104.8 → 0.104.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +1 -2
- package/dist/browser/index.js.map +2 -2
- package/dist/components/popover/popover.component.d.ts +4 -4
- package/dist/components/popover/popover.component.js +4 -4
- package/dist/components/popover/popover.constants.d.ts +1 -1
- package/dist/components/popover/popover.constants.js +1 -1
- package/dist/components/select/select.component.js +0 -1
- package/dist/custom-elements.json +1215 -1215
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.js +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
@@ -2080,7 +2080,7 @@
|
|
2080
2080
|
background: ${this.isBackdropInvisible?"transparent":"var(--mds-color-theme-common-overlays-secondary-normal)"};
|
2081
2081
|
z-index: ${this.zIndex-1};
|
2082
2082
|
}
|
2083
|
-
`,h.appendChild(m);let N=document.getElementById(this.backdropAppendTo)||this.parentElement;N==null||N.appendChild(h),this.backdropElement=h}removeBackdrop(){this.backdropElement&&(this.backdropElement.remove(),this.backdropElement=null)}keepElementAboveBackdrop(a){a&&(this.elementOriginalStyle={zIndex:a.style.zIndex,position:a.style.position},a.style.zIndex=`${this.zIndex}`,["fixed","absolute"].includes(window.getComputedStyle(a).position)||(a.style.position="relative"))}moveElementBackAfterBackdropRemoval(a){!a||!this.elementOriginalStyle||(a.style.zIndex=this.elementOriginalStyle.zIndex,a.style.position=this.elementOriginalStyle.position,this.elementOriginalStyle=void 0)}}return i};var as=class{static get stackArray(){return Array.from(this.stack)}static addKeydownListener(i){this.currentKeydownListener=i,document.addEventListener("keydown",i)}static removeKeydownListener(){this.currentKeydownListener&&document.removeEventListener("keydown",this.currentKeydownListener)}static activate(i){this.stackArray.forEach(t=>{t!==i&&t.setIsFocusTrapActivated(!1)}),this.stack.add(i),this.removeKeydownListener(),this.addKeydownListener(i.handleTabKeydown.bind(i))}static deactivate(i){if(this.stack.has(i)&&(this.stack.delete(i),this.removeKeydownListener(),this.stack.size>0)){let t=this.stackArray.pop();t&&(t.setIsFocusTrapActivated(!0),this.addKeydownListener(t.handleTabKeydown.bind(t)))}}};as.stack=new Set,as.currentKeydownListener=null;var al=l=>{class i extends l{constructor(){super(...arguments);this.shouldFocusTrapWrap=!0;this.focusTrapIndex=-1;this.focusableElements=[];this.isFocusTrapActivated=!1}setIsFocusTrapActivated(a){this.isFocusTrapActivated=a}activateFocusTrap(){this.setIsFocusTrapActivated(!0),as.activate(this)}deactivateFocusTrap(){this.setIsFocusTrapActivated(!1),as.deactivate(this),this.focusTrapIndex=-1}hasNoClientRects(a){return a.getClientRects().length===0}hasZeroDimensions(a){let{width:h,height:m}=a.getBoundingClientRect(),{offsetWidth:T,offsetHeight:N}=a;return T+N+m+h===0}isNotVisible(a){return this.hasZeroDimensions(a)||this.hasNoClientRects(a)}hasHiddenStyle(a){let{display:h,opacity:m,visibility:T}=a.style;return h==="none"||m==="0"||T==="hidden"||T==="collapse"}hasComputedHidden(a){let h=getComputedStyle(a);return h.visibility==="hidden"||h.height==="0"||h.display==="none"}isHidden(a){return a.hasAttribute("hidden")||a.getAttribute("aria-hidden")==="true"||this.hasHiddenStyle(a)||this.isNotVisible(a)||this.hasComputedHidden(a)}isDisabled(a){return a.disabled}isNotTabbable(a){return a.getAttribute("tabindex")==="-1"}isInteractiveElement(a){return!!(new Set(["BUTTON","DETAILS","EMBED","IFRAME","SELECT","TEXTAREA"]).has(a.tagName)||a instanceof HTMLAnchorElement&&a.hasAttribute("href")||a instanceof HTMLInputElement&&a.type!=="hidden"||(a instanceof HTMLAudioElement||a instanceof HTMLVideoElement)&&a.hasAttribute("controls")||(a instanceof HTMLImageElement||a instanceof HTMLObjectElement)&&a.hasAttribute("usemap")||a.hasAttribute("tabindex")&&a.tabIndex>-1)}isFocusable(a){return this.isHidden(a)||this.isNotTabbable(a)||this.isDisabled(a)?!1:this.isInteractiveElement(a)}findFocusable(a,h=new Set){a instanceof HTMLElement&&this.isFocusable(a)&&h.add(a);let m=[];return a.children.length?m=Array.from(a.children):a instanceof HTMLElement&&a.shadowRoot&&(m=Array.from(a.shadowRoot.children)),m.forEach(T=>{let N=T;this.isFocusable(N)&&h.add(N),N.shadowRoot?this.findFocusable(N.shadowRoot,h):N.tagName==="SLOT"?N.assignedElements({flatten:!0}).forEach(q=>{q instanceof HTMLElement&&this.findFocusable(q,h)}):this.findFocusable(N,h)}),[...h]}setFocusableElements(){this.shadowRoot&&(this.focusableElements=this.findFocusable(this.shadowRoot,new Set))}setInitialFocus(a=0){this.setFocusableElements(),!(this.focusableElements.length===0||!this.focusTrap)&&this.focusableElements[a]&&(this.focusTrapIndex=a,this.focusableElements[a].focus({preventScroll:!0}))}calculateNextIndex(a,h){let{length:m}=this.focusableElements;if(a===-1)return h>0?0:m-1;let T=a+h;return this.shouldFocusTrapWrap?(T<0&&(T=m-1),T>=m&&(T=0)):(T<0&&(T=0),T>=m&&(T=m-1)),T}getDeepActiveElement(){var h;let a=document.activeElement||document.body;for(;a instanceof HTMLElement&&((h=a.shadowRoot)!=null&&h.activeElement);)a=a.shadowRoot.activeElement;return a||document.body}findElement(a){return this.focusableElements.findIndex(h=>this.isEqualFocusNode(a,h))}isEqualFocusNode(a,h){return a.nodeType>=0?h.isEqualNode(a)&&h===a:!1}trapFocus(a){if(this.setFocusableElements(),this.focusableElements.length===0)return;let h=this.getDeepActiveElement(),m=this.findElement(h);a.shiftKey?this.focusTrapIndex=this.calculateNextIndex(m,-1):this.focusTrapIndex=this.calculateNextIndex(m,1);let N=this.focusableElements[this.focusTrapIndex];N.tagName!=="IFRAME"&&N&&(a.preventDefault(),N.focus())}handleTabKeydown(a){this.isFocusTrapActivated&&a.key==="Tab"&&this.trapFocus(a)}}return p([f({type:Boolean,reflect:!0,attribute:"should-focus-trap-wrap"})],i.prototype,"shouldFocusTrapWrap",2),i};var nl=l=>{class i extends l{constructor(){super(...arguments);this.isPreventScrollActive=!1;this.previousDocumentBodyStyleOverflow=""}activatePreventScroll(){this.preventScroll&&!this.isPreventScrollActive&&(this.isPreventScrollActive=!0,this.previousDocumentBodyStyleOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}deactivatePreventScroll(){this.isPreventScrollActive&&(this.isPreventScrollActive=!1,document.body.style.overflow=this.previousDocumentBodyStyleOverflow)}}return i};var Eu=Y.constructTagName("popover"),Ht={LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end"},ao={CLICK:"click",MOUSEENTER:"mouseenter",FOCUSIN:"focusin",MANUAL:"manual"},no={TONAL:"tonal",CONTRAST:"contrast"},kt={PLACEMENT:Ht.BOTTOM,TRIGGER:ao.CLICK,COLOR:no.TONAL,OFFSET:4,BOUNDARY:"clippingAncestors",BOUNDARY_ROOT:"viewport",BOUNDARY_PADDING:0,VISIBLE:!1,ARROW:!1,CLOSE_BUTTON:!1,FOCUS_TRAP:!1,INTERACTIVE:!1,PREVENT_SCROLL:!1,HIDE_ON_ESCAPE:!1,HIDE_ON_BLUR:!1,HIDE_ON_CLICK_OUTSIDE:!1,FOCUS_BACK:!1,BACKDROP:!1,FLIP:!0,SIZE:!1,DELAY:"0,0",ROLE:"dialog",Z_INDEX:1e3,DISABLE_ARIA_EXPANDED:!1,DISABLE_ARIA_HAS_POPUP:!1,PROPAGATE_EVENT_ON_ESCAPE:!1,KEEP_CONNECTED_TOOLTIP_CLOSED:!0,STRATEGY:"absolute",IS_BACKDROP_INVISIBLE:!
|
2083
|
+
`,h.appendChild(m);let N=document.getElementById(this.backdropAppendTo)||this.parentElement;N==null||N.appendChild(h),this.backdropElement=h}removeBackdrop(){this.backdropElement&&(this.backdropElement.remove(),this.backdropElement=null)}keepElementAboveBackdrop(a){a&&(this.elementOriginalStyle={zIndex:a.style.zIndex,position:a.style.position},a.style.zIndex=`${this.zIndex}`,["fixed","absolute"].includes(window.getComputedStyle(a).position)||(a.style.position="relative"))}moveElementBackAfterBackdropRemoval(a){!a||!this.elementOriginalStyle||(a.style.zIndex=this.elementOriginalStyle.zIndex,a.style.position=this.elementOriginalStyle.position,this.elementOriginalStyle=void 0)}}return i};var as=class{static get stackArray(){return Array.from(this.stack)}static addKeydownListener(i){this.currentKeydownListener=i,document.addEventListener("keydown",i)}static removeKeydownListener(){this.currentKeydownListener&&document.removeEventListener("keydown",this.currentKeydownListener)}static activate(i){this.stackArray.forEach(t=>{t!==i&&t.setIsFocusTrapActivated(!1)}),this.stack.add(i),this.removeKeydownListener(),this.addKeydownListener(i.handleTabKeydown.bind(i))}static deactivate(i){if(this.stack.has(i)&&(this.stack.delete(i),this.removeKeydownListener(),this.stack.size>0)){let t=this.stackArray.pop();t&&(t.setIsFocusTrapActivated(!0),this.addKeydownListener(t.handleTabKeydown.bind(t)))}}};as.stack=new Set,as.currentKeydownListener=null;var al=l=>{class i extends l{constructor(){super(...arguments);this.shouldFocusTrapWrap=!0;this.focusTrapIndex=-1;this.focusableElements=[];this.isFocusTrapActivated=!1}setIsFocusTrapActivated(a){this.isFocusTrapActivated=a}activateFocusTrap(){this.setIsFocusTrapActivated(!0),as.activate(this)}deactivateFocusTrap(){this.setIsFocusTrapActivated(!1),as.deactivate(this),this.focusTrapIndex=-1}hasNoClientRects(a){return a.getClientRects().length===0}hasZeroDimensions(a){let{width:h,height:m}=a.getBoundingClientRect(),{offsetWidth:T,offsetHeight:N}=a;return T+N+m+h===0}isNotVisible(a){return this.hasZeroDimensions(a)||this.hasNoClientRects(a)}hasHiddenStyle(a){let{display:h,opacity:m,visibility:T}=a.style;return h==="none"||m==="0"||T==="hidden"||T==="collapse"}hasComputedHidden(a){let h=getComputedStyle(a);return h.visibility==="hidden"||h.height==="0"||h.display==="none"}isHidden(a){return a.hasAttribute("hidden")||a.getAttribute("aria-hidden")==="true"||this.hasHiddenStyle(a)||this.isNotVisible(a)||this.hasComputedHidden(a)}isDisabled(a){return a.disabled}isNotTabbable(a){return a.getAttribute("tabindex")==="-1"}isInteractiveElement(a){return!!(new Set(["BUTTON","DETAILS","EMBED","IFRAME","SELECT","TEXTAREA"]).has(a.tagName)||a instanceof HTMLAnchorElement&&a.hasAttribute("href")||a instanceof HTMLInputElement&&a.type!=="hidden"||(a instanceof HTMLAudioElement||a instanceof HTMLVideoElement)&&a.hasAttribute("controls")||(a instanceof HTMLImageElement||a instanceof HTMLObjectElement)&&a.hasAttribute("usemap")||a.hasAttribute("tabindex")&&a.tabIndex>-1)}isFocusable(a){return this.isHidden(a)||this.isNotTabbable(a)||this.isDisabled(a)?!1:this.isInteractiveElement(a)}findFocusable(a,h=new Set){a instanceof HTMLElement&&this.isFocusable(a)&&h.add(a);let m=[];return a.children.length?m=Array.from(a.children):a instanceof HTMLElement&&a.shadowRoot&&(m=Array.from(a.shadowRoot.children)),m.forEach(T=>{let N=T;this.isFocusable(N)&&h.add(N),N.shadowRoot?this.findFocusable(N.shadowRoot,h):N.tagName==="SLOT"?N.assignedElements({flatten:!0}).forEach(q=>{q instanceof HTMLElement&&this.findFocusable(q,h)}):this.findFocusable(N,h)}),[...h]}setFocusableElements(){this.shadowRoot&&(this.focusableElements=this.findFocusable(this.shadowRoot,new Set))}setInitialFocus(a=0){this.setFocusableElements(),!(this.focusableElements.length===0||!this.focusTrap)&&this.focusableElements[a]&&(this.focusTrapIndex=a,this.focusableElements[a].focus({preventScroll:!0}))}calculateNextIndex(a,h){let{length:m}=this.focusableElements;if(a===-1)return h>0?0:m-1;let T=a+h;return this.shouldFocusTrapWrap?(T<0&&(T=m-1),T>=m&&(T=0)):(T<0&&(T=0),T>=m&&(T=m-1)),T}getDeepActiveElement(){var h;let a=document.activeElement||document.body;for(;a instanceof HTMLElement&&((h=a.shadowRoot)!=null&&h.activeElement);)a=a.shadowRoot.activeElement;return a||document.body}findElement(a){return this.focusableElements.findIndex(h=>this.isEqualFocusNode(a,h))}isEqualFocusNode(a,h){return a.nodeType>=0?h.isEqualNode(a)&&h===a:!1}trapFocus(a){if(this.setFocusableElements(),this.focusableElements.length===0)return;let h=this.getDeepActiveElement(),m=this.findElement(h);a.shiftKey?this.focusTrapIndex=this.calculateNextIndex(m,-1):this.focusTrapIndex=this.calculateNextIndex(m,1);let N=this.focusableElements[this.focusTrapIndex];N.tagName!=="IFRAME"&&N&&(a.preventDefault(),N.focus())}handleTabKeydown(a){this.isFocusTrapActivated&&a.key==="Tab"&&this.trapFocus(a)}}return p([f({type:Boolean,reflect:!0,attribute:"should-focus-trap-wrap"})],i.prototype,"shouldFocusTrapWrap",2),i};var nl=l=>{class i extends l{constructor(){super(...arguments);this.isPreventScrollActive=!1;this.previousDocumentBodyStyleOverflow=""}activatePreventScroll(){this.preventScroll&&!this.isPreventScrollActive&&(this.isPreventScrollActive=!0,this.previousDocumentBodyStyleOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}deactivatePreventScroll(){this.isPreventScrollActive&&(this.isPreventScrollActive=!1,document.body.style.overflow=this.previousDocumentBodyStyleOverflow)}}return i};var Eu=Y.constructTagName("popover"),Ht={LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end"},ao={CLICK:"click",MOUSEENTER:"mouseenter",FOCUSIN:"focusin",MANUAL:"manual"},no={TONAL:"tonal",CONTRAST:"contrast"},kt={PLACEMENT:Ht.BOTTOM,TRIGGER:ao.CLICK,COLOR:no.TONAL,OFFSET:4,BOUNDARY:"clippingAncestors",BOUNDARY_ROOT:"viewport",BOUNDARY_PADDING:0,VISIBLE:!1,ARROW:!1,CLOSE_BUTTON:!1,FOCUS_TRAP:!1,INTERACTIVE:!1,PREVENT_SCROLL:!1,HIDE_ON_ESCAPE:!1,HIDE_ON_BLUR:!1,HIDE_ON_CLICK_OUTSIDE:!1,FOCUS_BACK:!1,BACKDROP:!1,FLIP:!0,SIZE:!1,DELAY:"0,0",ROLE:"dialog",Z_INDEX:1e3,DISABLE_ARIA_EXPANDED:!1,DISABLE_ARIA_HAS_POPUP:!1,PROPAGATE_EVENT_ON_ESCAPE:!1,KEEP_CONNECTED_TOOLTIP_CLOSED:!0,STRATEGY:"absolute",IS_BACKDROP_INVISIBLE:!0};var ti=class{static dispatchPopoverEvent(i,t){t.dispatchEvent(new CustomEvent(i,{detail:{show:t.visible},composed:!0,bubbles:!0}))}static onShowPopover(i){this.dispatchPopoverEvent("shown",i)}static onHidePopover(i){this.dispatchPopoverEvent("hidden",i)}static onCreatedPopover(i){this.dispatchPopoverEvent("created",i)}static onDestroyedPopover(i){this.dispatchPopoverEvent("destroyed",i)}static onEscapeKeyPressed(i){this.dispatchPopoverEvent("closebyescape",i)}static onClickOutside(i){this.dispatchPopoverEvent("closebyoutsideclick",i)}};var jc=class{constructor(){this.stack=[]}push(i){this.stack.push(i)}pop(){return this.stack.pop()}peek(){return this.stack[this.stack.length-1]}remove(i){this.stack=this.stack.filter(t=>t!==i)}has(i){return this.stack.includes(i)}clear(){this.stack=[]}},Te=new jc;var Yy=G`
|
2084
2084
|
:host {
|
2085
2085
|
--mdc-popover-arrow-border-radius: 0.1875rem;
|
2086
2086
|
--mdc-popover-arrow-border: 0.0625rem solid var(--mds-color-theme-outline-secondary-normal);
|
@@ -4769,7 +4769,6 @@
|
|
4769
4769
|
role=""
|
4770
4770
|
backdrop
|
4771
4771
|
backdrop-append-to="${ot(this.backdropAppendTo)}"
|
4772
|
-
is-backdrop-invisible
|
4773
4772
|
hide-on-outside-click
|
4774
4773
|
hide-on-escape
|
4775
4774
|
focus-back-to-trigger
|