scb-wc 0.1.231 → 0.1.232
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/README.md +16 -19
- package/all.js +0 -12
- package/index.js +85 -97
- package/mvc/components/all.js +0 -7
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/components/scb-accordion/scb-accordion.js +1 -1
- package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
- package/mvc/components/scb-button/scb-button.js +3 -3
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
- package/mvc/components/scb-card/scb-card.js +2 -2
- package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +1 -1
- package/mvc/components/scb-dialog/scb-dialog.js +1 -1
- package/mvc/components/scb-drawer/scb-drawer.js +3 -3
- package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
- package/mvc/components/scb-header/scb-header.js +2 -2
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
- package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
- package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
- package/mvc/components/scb-link/scb-link.js +1 -1
- package/mvc/components/scb-link-button/scb-link-button.js +1 -1
- package/mvc/components/scb-list/scb-list-item.js +6 -6
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
- package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
- package/mvc/components/scb-overlay/scb-overlay.js +3 -3
- package/mvc/components/scb-pagination/scb-pagination.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
- package/mvc/components/scb-search/scb-search.js +3 -3
- package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
- package/mvc/components/scb-select/scb-select-option.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
- package/mvc/components/scb-stepper/scb-step.js +1 -1
- package/mvc/components/scb-table/scb-table.js +1 -1
- package/mvc/components/scb-table-advanced/scb-table-advanced.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +176 -34
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
- package/mvc/{components/shared → vendor}/component-size-token.js +1 -1
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- package/mvc/{components/shared → vendor}/manual-popover.js +1 -1
- package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
- package/mvc/vendor/scb-icon-svg.js +11 -0
- package/package.json +2 -2
- package/scb-viz/scb-viz-series-differentiation-registry.js +7 -10
- package/scb-viz/scb-viz.js +43 -43
- package/scb-wc.bundle.js +287 -287
- package/scb-wc.d.ts +188 -212
- package/shared/scb-icon-svg.js +2 -5
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -143
- package/mvc/components/shared/lazy-focus-ring.js +0 -2
- package/mvc/components/shared/lazy-ripple.js +0 -2
- package/mvc/components/shared/scb-icon-svg.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as v,h as f,m as y,p,v as b,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{g as v,h as f,m as y,p,v as b,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as w}from"../../vendor/lazy-focus-ring.js";import{t as d}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";import"../scb-divider/scb-divider.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,i){try{customElements.get(e)||t(e,s,i)}catch(a){var o=String(a||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var m,g,c=(m=class extends f{constructor(...t){super(...t),this.expanded=!1,this.label="",this.supportingText="",this.current=!1,this.itemHref="#",this.noDivider=!1,this._unique=g._uid(),this._overflowVisibleTimer=null,this._slotHasContent=!1,this._trailingSlotHasContent=!1,this._onSlotChange=()=>{const e=this.renderRoot.querySelector("slot:not([name])"),s=!!e&&e.assignedElements({flatten:!0}).length>0;this._slotHasContent!==s&&(this._slotHasContent=s,this.requestUpdate()),!this._slotHasContent&&this.expanded&&(this.expanded=!1),this._applyInertByExpanded()},this._toggleAccordion=()=>{if(!this._slotHasContent)return;const e=!this.expanded;this.setExpanded(e)},this._onKeyDown=e=>{const s=this.closest("scb-toc"),i=Array.from(s?.querySelectorAll("scb-toc-item")||[]).map(n=>({host:n,label:n.renderRoot.querySelector(".toc-item-label")||null})).filter(n=>!!n.label),o=i.findIndex(n=>n.host===this);if(o<0)return;const a=e.currentTarget?.classList?.contains("toc-chevron-button")??!1;switch(e.key){case"Enter":case" ":if(!a)return;e.preventDefault(),this._toggleAccordion();break;case"ArrowDown":e.preventDefault(),o<i.length-1&&i[o+1].label.focus();break;case"ArrowUp":e.preventDefault(),o>0&&i[o-1].label.focus();break;case"Home":e.preventDefault(),i.length&&i[0].label.focus();break;case"End":e.preventDefault(),i.length&&i[i.length-1].label.focus();break}}}setExpanded(t){this.expanded!==t&&(this.expanded=t)}static _uid(){return globalThis.crypto?.randomUUID?.()??`${g._uidPrefix}-${++g._uidSeq}`}firstUpdated(){this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded()}updated(t){t.has("expanded")&&(this._applyInertByExpanded(),this._syncOverflowVisibilityByExpanded(),this.dispatchEvent(new CustomEvent("expanded-changed",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("expandedchanged",{detail:{expanded:this.expanded,label:this.label},bubbles:!0,composed:!0})))}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=w(this,this.renderRoot),this._slotHasContent=Array.from(this.children).some(t=>{const e=t.getAttribute("slot");return e===null||e===""}),this._trailingSlotHasContent=Array.from(this.children).some(t=>t.getAttribute("slot")==="trailing"),!this._slotHasContent&&this.expanded&&(this.expanded=!1)}disconnectedCallback(){this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,super.disconnectedCallback(),this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null)}_applyInertByExpanded(){const t=this.renderRoot.querySelector(".scb-toc-item-bottom");t&&(this.expanded?(t.removeAttribute("inert"),t.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(t.setAttribute("inert",""),t.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_syncOverflowVisibilityByExpanded(){if(this._overflowVisibleTimer!==null&&(window.clearTimeout(this._overflowVisibleTimer),this._overflowVisibleTimer=null),this.removeAttribute("data-expanded-settled"),!this.expanded)return;const t=this.renderRoot.querySelector(".scb-toc-item-bottom");if(!t){this.setAttribute("data-expanded-settled","");return}const e=this._getTransitionMs(t);if(e<=0){this.setAttribute("data-expanded-settled","");return}this._overflowVisibleTimer=window.setTimeout(()=>{this._overflowVisibleTimer=null,this.expanded&&this.setAttribute("data-expanded-settled","")},e)}_getTransitionMs(t){const e=getComputedStyle(t),s=e.transitionDuration.split(",").map(r=>r.trim()),i=e.transitionDelay.split(",").map(r=>r.trim()),o=r=>{const l=parseFloat(r);return Number.isFinite(l)?r.endsWith("ms")?l:r.endsWith("s")?l*1e3:l:0},a=Math.max(s.length,i.length);let n=0;for(let r=0;r<a;r+=1){const l=o(s[r]??s[s.length-1]??"0s"),h=o(i[r]??i[i.length-1]??"0s");n=Math.max(n,l+h)}return Math.ceil(n)}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const t=this.renderRoot.querySelector("slot:not([name])");if(!t)return[];const e=t.assignedElements({flatten:!0}),s=[],i=o=>{o instanceof HTMLElement&&o.matches("a,button,input,select,textarea,[tabindex]")&&s.push(o)};return e.forEach(o=>{i(o),o.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(a=>i(a))}),s}_removeTabIndexesIfNeeded(){this._supportsInert()||this._collectFocusableFromSlot().forEach(t=>{const e=t.getAttribute("tabindex");e!==null&&t.setAttribute("data-scb-prev-tabindex",e),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){this._supportsInert()||this._collectFocusableFromSlot().forEach(t=>{const e=t.getAttribute("data-scb-prev-tabindex");e!==null?(t.setAttribute("tabindex",e),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}render(){const t=`bottom-${this._unique}`,e=`toc-label-${this._unique}`,s=`toc-chevron-${this._unique}`,i=this.supportingText.trim().length>0;return b`
|
|
2
2
|
<div class="scb-toc-item">
|
|
3
3
|
<div class=${`scb-toc-item-top${i?"":" no-supporting-text"}`}>
|
|
4
4
|
<div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-button/scb-button.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/preload-helper.js","../../vendor/component-defaults.js","../../vendor/decorate.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{g as R,h as q,m as N,p,v,y as H}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as I}from"../../vendor/preload-helper.js";import{componentSizeToken as K}from"../shared/component-size-token.js";import{t as l}from"../../vendor/decorate.js";import{closeManualPopover as b,openManualPopover as V}from"../shared/manual-popover.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,s){try{customElements.get(i)||t(i,e,s)}catch(h){var c=String(h||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var x,X=0,T="data-scb-tooltip-managed-action-size",a=(x=class extends q{constructor(...t){super(...t),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this.maxWidth="300px",this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++X}`,this._buttonDepsLoaded=!1,this._listeningForPositionChanges=!1,this._listeningForDismiss=!1,this._onWindowReposition=()=>{if(!this.open)return;const i=this._getTooltipElement(),e=this._triggerEl;!i||!e||this._positionTooltip(i,e)},this._onDocumentKeyDown=i=>{i.key!=="Escape"||!this.open||(this._clickActive=!1,this._hoverActive=!1,this._setOpenState(!1))},this._onDocumentPointerDown=i=>{this.open&&(i.composedPath().includes(this)||(this._clickActive=!1,this._hoverActive=!1,this._setOpenState(!1)))},this._ensureButtonDepsIfNeeded=()=>{this._syncRichActionButtonSizes(),!this._buttonDepsLoaded&&this.querySelector('[slot="scb-tooltip-button"]')&&(this._buttonDepsLoaded=!0,I(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))},this._onTriggerMouseEnter=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerFocus=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerKeyDown=i=>{i.key==="Tab"&&(this._hoverActive=!1,this._clickActive=!1,this._setOpenState(!1),b(this._getTooltipElement()))},this._onTooltipMouseEnter=()=>{this._hasTooltipContent()&&(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||this._setOpenState(!1))},this._onTriggerClick=()=>{this._hasTooltipContent()&&(this._clickActive=!this._clickActive,this._clickActive?this._setOpenState(!0):this._hoverActive||this._setOpenState(!1))}}_syncRichActionButtonSizes(){const t=K(this,"--scb-tooltip-design-rich-action-button-size-medium",["small","medium","large"],"medium"),i=this.querySelectorAll(':scope > scb-button[slot="scb-tooltip-button"]');for(const e of i){const s=e.getAttribute(T);if(s!==null&&e.getAttribute("size")!==s){e.removeAttribute(T);continue}(!e.hasAttribute("size")||s!==null)&&(e.setAttribute("size",t),e.setAttribute(T,t))}}firstUpdated(){this._originalPosition=this.position,this._updateDelayCss(),this._updateMaxWidthCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this._ensureButtonDepsIfNeeded(),this.open&&this._syncOpenState()}updated(t){if(this._syncRichActionButtonSizes(),t.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("delay")&&this._updateDelayCss(),t.has("maxWidth")&&this._updateMaxWidthCss(),(t.has("supportingtext")||t.has("label")||t.has("variant"))&&(this._hasTooltipContent()||(this._hoverActive=!1,this._clickActive=!1,this.open=!1),this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("open")){if(this.open&&!this._hasTooltipContent()){this.open=!1;return}this._syncOpenState(),this._dispatchOpenChanged()}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),b(t)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._detachPositionListeners(),this._detachDismissListeners()}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_syncOpenState(){const t=this._getTooltipElement();t&&(this.open?this._showTooltip(t):this._hideTooltip(t))}_setOpenState(t){if(this.open===t){t&&this._syncOpenState();return}this.open=t}_hasTooltipContent(){const t=(this.supportingtext||"").trim();return this.variant==="rich"?!!((this.label||"").trim()||t):!!t}_updateDelayCss(){const t=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${t}s`)}_updateMaxWidthCss(){const t=(this.maxWidth||"").trim(),i=t.toLowerCase()==="none",e=i?"none":t||"300px";this.style.setProperty("--max-width",e),this.style.setProperty("--wrap",i?"nowrap":"normal")}_dispatchOpenChanged(){const t={open:this.open};this.dispatchEvent(new CustomEvent("open-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("openchanged",{detail:t,bubbles:!0,composed:!0}))}_findTriggerElement(){const t=this.querySelector("[scb-tooltip-anchor]:not([slot])");return t||(Array.from(this.children).find(i=>i.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const t=this._triggerEl;t&&(this._detachTriggerListeners(),t.removeAttribute("aria-describedby"));const i=this._findTriggerElement();this._triggerEl=i,i&&this._hasTooltipContent()&&(i.setAttribute("aria-describedby",this._tooltipId),i.addEventListener("keydown",this._onTriggerKeyDown),(this.trigger==="click"||this.trigger==="hover-click")&&i.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(i.addEventListener("mouseenter",this._onTriggerMouseEnter),i.addEventListener("mouseleave",this._onTriggerMouseLeave),i.addEventListener("focus",this._onTriggerFocus),i.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTooltipMouseEnter),t.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const t=this._triggerEl;t&&(t.removeEventListener("click",this._onTriggerClick),t.removeEventListener("keydown",this._onTriggerKeyDown),t.removeEventListener("mouseenter",this._onTriggerMouseEnter),t.removeEventListener("mouseleave",this._onTriggerMouseLeave),t.removeEventListener("focus",this._onTriggerFocus),t.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(t){if(!this._hasTooltipContent()){this.open=!1;return}this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const i=this._triggerEl;this._resetPosition(),t.classList.remove("hidden"),t.setAttribute("aria-hidden","false"),V(t,i),this._attachPositionListeners(),this._attachDismissListeners(),requestAnimationFrame(()=>{i&&this._positionTooltip(t,i),t.setAttribute("open","")})}_hideTooltip(t){t.removeAttribute("open"),t.setAttribute("aria-hidden","true"),this._detachPositionListeners(),this._detachDismissListeners(),this._scheduleHidden(t)}_attachPositionListeners(){this._listeningForPositionChanges||(this._listeningForPositionChanges=!0,window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}))}_detachPositionListeners(){this._listeningForPositionChanges&&(this._listeningForPositionChanges=!1,window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0))}_attachDismissListeners(){this._listeningForDismiss||(this._listeningForDismiss=!0,document.addEventListener("keydown",this._onDocumentKeyDown),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0))}_detachDismissListeners(){this._listeningForDismiss&&(this._listeningForDismiss=!1,document.removeEventListener("keydown",this._onDocumentKeyDown),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0))}_scheduleHidden(t){const i=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(i<=0){t.classList.add("hidden"),b(t);return}this._hideTimeout=window.setTimeout(()=>{t.classList.add("hidden"),b(t),this._hideTimeout=null},i)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(t,i){const e=i.getBoundingClientRect(),s=t.getBoundingClientRect(),c=(this.offset??0)+8,h=8,f=h,_=window.innerHeight-h,y=h,w=window.innerWidth-h,D=o=>o>=f&&o+s.height<=_,z=o=>o>=y&&o+s.width<=w,E=(o,r,n,u)=>{let d=0;o<n&&(d+=n-o);const C=o+r;return C>u&&(d+=C-u),d},O=o=>{let r=0,n=0;switch(o){case"top":r=e.top-s.height-c,n=e.left-(s.width-e.width)/2;break;case"bottom":r=e.bottom+c,n=e.left-(s.width-e.width)/2;break;case"left":n=e.left-s.width-c,r=e.top-(s.height-e.height)/2;break;case"right":n=e.right+c,r=e.top-(s.height-e.height)/2;break}const u=E(r,s.height,f,_),d=E(n,s.width,y,w);return{pos:o,top:r,left:n,fitsV:D(r),fitsH:z(n),totalOverflow:u+d}},k=this.position==="top"||this.position==="bottom",L=this.position,S=[L,this._getOppositePosition(L),k?"left":"top",k?"right":"bottom"].map(O);let g=S.find(o=>o.fitsV&&o.fitsH)??S.reduce((o,r)=>r.totalOverflow<o.totalOverflow?r:o);const A=(o,r,n)=>Math.min(Math.max(o,r),n),M=f,P=_-s.height,$=y,B=w-s.width,F=A(g.top,M,P),W=A(g.left,$,B);t.style.top=`${F}px`,t.style.left=`${W}px`,this.position!==g.pos&&(this.position=g.pos)}_getOppositePosition(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement(),this.open&&this._syncOpenState()}render(){const t=this._hasTooltipContent(),i=this.arrow?v`<svg
|
|
2
|
+
import{g as R,h as q,m as N,p,v,y as H}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as I}from"../../vendor/preload-helper.js";import{t as K}from"../../vendor/component-size-token.js";import{t as l}from"../../vendor/decorate.js";import{a as V,t as b}from"../../vendor/manual-popover.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,s){try{customElements.get(i)||t(i,e,s)}catch(h){var c=String(h||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw h}}}}catch{}})();var x,X=0,T="data-scb-tooltip-managed-action-size",a=(x=class extends q{constructor(...t){super(...t),this.variant="plain",this.arrow=null,this.supportingtext="",this.label="",this.trigger="hover",this.position="top",this.open=!1,this.delay=.25,this.offset=0,this.maxWidth="300px",this._hoverActive=!1,this._clickActive=!1,this._hideTimeout=null,this._triggerEl=null,this._originalPosition="top",this._tooltipId=`scb-tooltip-${++X}`,this._buttonDepsLoaded=!1,this._listeningForPositionChanges=!1,this._listeningForDismiss=!1,this._onWindowReposition=()=>{if(!this.open)return;const i=this._getTooltipElement(),e=this._triggerEl;!i||!e||this._positionTooltip(i,e)},this._onDocumentKeyDown=i=>{i.key!=="Escape"||!this.open||(this._clickActive=!1,this._hoverActive=!1,this._setOpenState(!1))},this._onDocumentPointerDown=i=>{this.open&&(i.composedPath().includes(this)||(this._clickActive=!1,this._hoverActive=!1,this._setOpenState(!1)))},this._ensureButtonDepsIfNeeded=()=>{this._syncRichActionButtonSizes(),!this._buttonDepsLoaded&&this.querySelector('[slot="scb-tooltip-button"]')&&(this._buttonDepsLoaded=!0,I(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))},this._onTriggerMouseEnter=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerMouseLeave=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerFocus=()=>{this._hasTooltipContent()&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTriggerBlur=()=>{this._hoverActive=!1,this._clickActive||this._setOpenState(!1)},this._onTriggerKeyDown=i=>{i.key==="Tab"&&(this._hoverActive=!1,this._clickActive=!1,this._setOpenState(!1),b(this._getTooltipElement()))},this._onTooltipMouseEnter=()=>{this._hasTooltipContent()&&(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!0,this._setOpenState(!0))},this._onTooltipMouseLeave=()=>{(this.trigger==="hover"||this.trigger==="hover-click")&&(this._hoverActive=!1,this._clickActive||this._setOpenState(!1))},this._onTriggerClick=()=>{this._hasTooltipContent()&&(this._clickActive=!this._clickActive,this._clickActive?this._setOpenState(!0):this._hoverActive||this._setOpenState(!1))}}_syncRichActionButtonSizes(){const t=K(this,"--scb-tooltip-design-rich-action-button-size-medium",["small","medium","large"],"medium"),i=this.querySelectorAll(':scope > scb-button[slot="scb-tooltip-button"]');for(const e of i){const s=e.getAttribute(T);if(s!==null&&e.getAttribute("size")!==s){e.removeAttribute(T);continue}(!e.hasAttribute("size")||s!==null)&&(e.setAttribute("size",t),e.setAttribute(T,t))}}firstUpdated(){this._originalPosition=this.position,this._updateDelayCss(),this._updateMaxWidthCss(),this._updateTriggerElement(),this._updateTooltipHoverListeners(),this._ensureButtonDepsIfNeeded(),this.open&&this._syncOpenState()}updated(t){if(this._syncRichActionButtonSizes(),t.has("trigger")&&(this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("delay")&&this._updateDelayCss(),t.has("maxWidth")&&this._updateMaxWidthCss(),(t.has("supportingtext")||t.has("label")||t.has("variant"))&&(this._hasTooltipContent()||(this._hoverActive=!1,this._clickActive=!1,this.open=!1),this._updateTriggerElement(),this._updateTooltipHoverListeners()),t.has("open")){if(this.open&&!this._hasTooltipContent()){this.open=!1;return}this._syncOpenState(),this._dispatchOpenChanged()}}disconnectedCallback(){super.disconnectedCallback(),this._detachTriggerListeners();const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),b(t)),this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null),this._detachPositionListeners(),this._detachDismissListeners()}_getTooltipElement(){return this.renderRoot.querySelector(".scb-tooltip")}_syncOpenState(){const t=this._getTooltipElement();t&&(this.open?this._showTooltip(t):this._hideTooltip(t))}_setOpenState(t){if(this.open===t){t&&this._syncOpenState();return}this.open=t}_hasTooltipContent(){const t=(this.supportingtext||"").trim();return this.variant==="rich"?!!((this.label||"").trim()||t):!!t}_updateDelayCss(){const t=Number.isFinite(this.delay)?this.delay:.25;this.style.setProperty("--delay",`${t}s`)}_updateMaxWidthCss(){const t=(this.maxWidth||"").trim(),i=t.toLowerCase()==="none",e=i?"none":t||"300px";this.style.setProperty("--max-width",e),this.style.setProperty("--wrap",i?"nowrap":"normal")}_dispatchOpenChanged(){const t={open:this.open};this.dispatchEvent(new CustomEvent("open-changed",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("openchanged",{detail:t,bubbles:!0,composed:!0}))}_findTriggerElement(){const t=this.querySelector("[scb-tooltip-anchor]:not([slot])");return t||(Array.from(this.children).find(i=>i.nodeType===Node.ELEMENT_NODE)??null)}_updateTriggerElement(){const t=this._triggerEl;t&&(this._detachTriggerListeners(),t.removeAttribute("aria-describedby"));const i=this._findTriggerElement();this._triggerEl=i,i&&this._hasTooltipContent()&&(i.setAttribute("aria-describedby",this._tooltipId),i.addEventListener("keydown",this._onTriggerKeyDown),(this.trigger==="click"||this.trigger==="hover-click")&&i.addEventListener("click",this._onTriggerClick),(this.trigger==="hover"||this.trigger==="hover-click")&&(i.addEventListener("mouseenter",this._onTriggerMouseEnter),i.addEventListener("mouseleave",this._onTriggerMouseLeave),i.addEventListener("focus",this._onTriggerFocus),i.addEventListener("blur",this._onTriggerBlur)))}_updateTooltipHoverListeners(){const t=this._getTooltipElement();t&&(t.removeEventListener("mouseenter",this._onTooltipMouseEnter),t.removeEventListener("mouseleave",this._onTooltipMouseLeave),(this.trigger==="hover"||this.trigger==="hover-click")&&(t.addEventListener("mouseenter",this._onTooltipMouseEnter),t.addEventListener("mouseleave",this._onTooltipMouseLeave)))}_detachTriggerListeners(){const t=this._triggerEl;t&&(t.removeEventListener("click",this._onTriggerClick),t.removeEventListener("keydown",this._onTriggerKeyDown),t.removeEventListener("mouseenter",this._onTriggerMouseEnter),t.removeEventListener("mouseleave",this._onTriggerMouseLeave),t.removeEventListener("focus",this._onTriggerFocus),t.removeEventListener("blur",this._onTriggerBlur))}_showTooltip(t){if(!this._hasTooltipContent()){this.open=!1;return}this._hideTimeout!==null&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=null);const i=this._triggerEl;this._resetPosition(),t.classList.remove("hidden"),t.setAttribute("aria-hidden","false"),V(t,i),this._attachPositionListeners(),this._attachDismissListeners(),requestAnimationFrame(()=>{i&&this._positionTooltip(t,i),t.setAttribute("open","")})}_hideTooltip(t){t.removeAttribute("open"),t.setAttribute("aria-hidden","true"),this._detachPositionListeners(),this._detachDismissListeners(),this._scheduleHidden(t)}_attachPositionListeners(){this._listeningForPositionChanges||(this._listeningForPositionChanges=!0,window.addEventListener("resize",this._onWindowReposition,{passive:!0}),window.addEventListener("scroll",this._onWindowReposition,{passive:!0,capture:!0}))}_detachPositionListeners(){this._listeningForPositionChanges&&(this._listeningForPositionChanges=!1,window.removeEventListener("resize",this._onWindowReposition),window.removeEventListener("scroll",this._onWindowReposition,!0))}_attachDismissListeners(){this._listeningForDismiss||(this._listeningForDismiss=!0,document.addEventListener("keydown",this._onDocumentKeyDown),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0))}_detachDismissListeners(){this._listeningForDismiss&&(this._listeningForDismiss=!1,document.removeEventListener("keydown",this._onDocumentKeyDown),document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0))}_scheduleHidden(t){const i=(Number.isFinite(this.delay)?this.delay:.25)*1e3;if(i<=0){t.classList.add("hidden"),b(t);return}this._hideTimeout=window.setTimeout(()=>{t.classList.add("hidden"),b(t),this._hideTimeout=null},i)}_resetPosition(){this.position=this._originalPosition}_positionTooltip(t,i){const e=i.getBoundingClientRect(),s=t.getBoundingClientRect(),c=(this.offset??0)+8,h=8,f=h,_=window.innerHeight-h,y=h,w=window.innerWidth-h,D=o=>o>=f&&o+s.height<=_,z=o=>o>=y&&o+s.width<=w,E=(o,r,n,u)=>{let d=0;o<n&&(d+=n-o);const C=o+r;return C>u&&(d+=C-u),d},O=o=>{let r=0,n=0;switch(o){case"top":r=e.top-s.height-c,n=e.left-(s.width-e.width)/2;break;case"bottom":r=e.bottom+c,n=e.left-(s.width-e.width)/2;break;case"left":n=e.left-s.width-c,r=e.top-(s.height-e.height)/2;break;case"right":n=e.right+c,r=e.top-(s.height-e.height)/2;break}const u=E(r,s.height,f,_),d=E(n,s.width,y,w);return{pos:o,top:r,left:n,fitsV:D(r),fitsH:z(n),totalOverflow:u+d}},k=this.position==="top"||this.position==="bottom",L=this.position,S=[L,this._getOppositePosition(L),k?"left":"top",k?"right":"bottom"].map(O);let g=S.find(o=>o.fitsV&&o.fitsH)??S.reduce((o,r)=>r.totalOverflow<o.totalOverflow?r:o);const A=(o,r,n)=>Math.min(Math.max(o,r),n),M=f,P=_-s.height,$=y,B=w-s.width,F=A(g.top,M,P),W=A(g.left,$,B);t.style.top=`${F}px`,t.style.left=`${W}px`,this.position!==g.pos&&(this.position=g.pos)}_getOppositePosition(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}}_onDefaultSlotChange(){this._updateTriggerElement(),this.open&&this._syncOpenState()}render(){const t=this._hasTooltipContent(),i=this.arrow?v`<svg
|
|
3
3
|
class="scb-tooltip-arrow"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
5
5
|
width="13"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(e,i,n){try{customElements.get(e)||o(e,i,n)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();function u(t,o,e,i){const n=getComputedStyle(t).getPropertyValue(o).trim();return e.includes(n)?n:i}export{u as
|
|
1
|
+
(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(e,i,n){try{customElements.get(e)||o(e,i,n)}catch(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();function u(t,o,e,i){const n=getComputedStyle(t).getPropertyValue(o).trim();return e.includes(n)?n:i}export{u as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./md-focus-ring.js","./rolldown-runtime.js","./vendor.js","./vendor-lit.js","./attachable-controller.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as f}from"./rolldown-runtime.js";import{t as _}from"./preload-helper.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var n=customElements.define.bind(customElements);customElements.define=function(s,t,d){try{customElements.get(s)||n(s,t,d)}catch(i){var r=String(i||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var v=f({addLazyFocusRingListeners:()=>l,ensureFocusRingOnFocusVisible:()=>c,ensureFocusRingOnTab:()=>u,ensureFocusRingReady:()=>o}),a,o=()=>{customElements.get("md-focus-ring")||(a??(a=_(()=>import("./md-focus-ring.js").then(e=>e.t).then(()=>{}),__vite__mapDeps([0,1,2,3,4]),import.meta.url)))},c=e=>{const n=e.composedPath()[0];n instanceof HTMLElement&&n.matches(":focus-visible")&&o()},u=e=>{e.key==="Tab"&&o()},l=(...e)=>{const n=c,s=u;for(const t of e)t.addEventListener("focusin",n),t.addEventListener("keydown",s);return()=>{for(const t of e)t.removeEventListener("focusin",n),t.removeEventListener("keydown",s)}};export{v as i,c as n,o as r,l as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ripple.js","./rolldown-runtime.js","./vendor.js","./vendor-lit.js","./attachable-controller.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as s}from"./preload-helper.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(t,n,d){try{customElements.get(t)||r(t,n,d)}catch(a){var o=String(a||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var i,l=()=>(i??(i=s(()=>import("./ripple.js").then(e=>e.t).then(()=>{}),__vite__mapDeps([0,1,2,3,4]),import.meta.url)),i),f=async(e,r,t,n=!1)=>{!e||!r||(e.control=r,r.matches(":hover")&&(e.hovered=!0),t?.type==="pointerenter"?e.handlePointerenter?.(t):t?.type==="pointerdown"&&await e.handlePointerdown?.(t),n&&e.handleClick?.())};export{l as ensureRippleReady,f as syncRippleToControl};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,e,s){try{customElements.get(r)||t(r,e,s)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var c=new WeakMap;function p(o){const t=(c.get(o)??0)+1;return c.set(o,t),t}function d(o){const t=getComputedStyle(o),r=n=>n.endsWith("ms")?Number.parseFloat(n):Number.parseFloat(n)*1e3,e=t.transitionDuration.split(",").map(n=>r(n.trim())),s=t.transitionDelay.split(",").map(n=>r(n.trim()));return e.reduce((n,i,a)=>{const f=s[a%s.length]??0;return Math.max(n,i+f)},0)}var l=["scb-datepicker","scb-dialog","scb-drawer","scb-dropdown","scb-options-menu","scb-options-sub-menu","scb-overlay","scb-search","scb-select","scb-tooltip"].join(",");function v(o,t,r="manual"){if(!o)return!1;p(o);const e=o;if(typeof e.showPopover!="function")return!1;if(o.setAttribute("popover",r),!o.matches(":popover-open"))try{e.showPopover(t?{source:t}:void 0)}catch{return!1}return o.matches(":popover-open")}function u(o){if(!o)return;p(o);const t=o;if(typeof t.hidePopover=="function"&&o.matches(":popover-open"))try{t.hidePopover()}catch{}o.removeAttribute("popover")}function m(o,t,r){if(!o)return;const e=p(o);requestAnimationFrame(async()=>{const s=r??o,n=d(s),i=s.getAnimations().filter(a=>a.playState!=="finished");i.length>0?await Promise.allSettled(i.map(a=>a.finished)):n>0&&await new Promise(a=>setTimeout(a,n)),c.get(o)===e&&(u(o),t?.())})}function h(o){return!!o?.matches(":popover-open")}function b(o){const t=r=>{for(const e of r.querySelectorAll("*"))e.shadowRoot&&t(e.shadowRoot),e.matches("[popover]")&&h(e)&&u(e),e.matches(l)&&"open"in e&&e.open&&(e.open=!1)};t(o)}export{
|
|
1
|
+
(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(r,e,s){try{customElements.get(r)||t(r,e,s)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var c=new WeakMap;function p(o){const t=(c.get(o)??0)+1;return c.set(o,t),t}function d(o){const t=getComputedStyle(o),r=n=>n.endsWith("ms")?Number.parseFloat(n):Number.parseFloat(n)*1e3,e=t.transitionDuration.split(",").map(n=>r(n.trim())),s=t.transitionDelay.split(",").map(n=>r(n.trim()));return e.reduce((n,i,a)=>{const f=s[a%s.length]??0;return Math.max(n,i+f)},0)}var l=["scb-datepicker","scb-dialog","scb-drawer","scb-dropdown","scb-options-menu","scb-options-sub-menu","scb-overlay","scb-search","scb-select","scb-tooltip"].join(",");function v(o,t,r="manual"){if(!o)return!1;p(o);const e=o;if(typeof e.showPopover!="function")return!1;if(o.setAttribute("popover",r),!o.matches(":popover-open"))try{e.showPopover(t?{source:t}:void 0)}catch{return!1}return o.matches(":popover-open")}function u(o){if(!o)return;p(o);const t=o;if(typeof t.hidePopover=="function"&&o.matches(":popover-open"))try{t.hidePopover()}catch{}o.removeAttribute("popover")}function m(o,t,r){if(!o)return;const e=p(o);requestAnimationFrame(async()=>{const s=r??o,n=d(s),i=s.getAnimations().filter(a=>a.playState!=="finished");i.length>0?await Promise.allSettled(i.map(a=>a.finished)):n>0&&await new Promise(a=>setTimeout(a,n)),c.get(o)===e&&(u(o),t?.())})}function h(o){return!!o?.matches(":popover-open")}function b(o){const t=r=>{for(const e of r.querySelectorAll("*"))e.shadowRoot&&t(e.shadowRoot),e.matches("[popover]")&&h(e)&&u(e),e.matches(l)&&"open"in e&&e.open&&(e.open=!1)};t(o)}export{v as a,h as i,m as n,b as r,u as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h,m as v,p as d,v as p,y as f}from"
|
|
1
|
+
import{h,m as v,p as d,v as p,y as f}from"./vendor.js";import"./vendor-lit.js";import{t as c}from"./decorate.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(o,a,l){try{customElements.get(o)||r(o,a,l)}catch(i){var s=String(i||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var n,t=(n=class extends h{constructor(...r){super(...r),this.open=!1}render(){return p`
|
|
2
2
|
<svg
|
|
3
3
|
class="chevron-icon"
|
|
4
4
|
viewBox="0 0 24 24"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{_ as l,g as o}from"./vendor.js";import"./vendor-lit.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var h=customElements.define.bind(customElements);customElements.define=function(e,t,v){try{customElements.get(e)||h(e,t,v)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c=new Map([["arrow_forward","M12 4l-1.41 1.41L15.17 10H4v2h11.17l-4.58 4.59L12 18l8-8-8-8Z"],["chevron_left","M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12l4.58-4.59Z"],["chevron_right","M8.59 16.59 10 18l6-6-6-6-1.41 1.41L13.17 12l-4.58 4.59Z"],["close","M18.3 5.71 16.89 4.3 12 9.17 7.11 4.3 5.7 5.71 10.59 10.6 5.7 15.49 7.11 16.9 12 12.01l4.89 4.89 1.41-1.41-4.89-4.89 4.89-4.89Z"],["menu","M3 6h18v2H3V6Zm0 5h18v2H3v-2Zm0 5h18v2H3v-2Z"],["open_in_new","M14 3h7v7h-2V6.41l-9.83 9.83-1.41-1.41L17.59 5H14V3ZM5 5h6v2H7v10h10v-4h2v6H5V5Z"],["payments","M3 6h18v12H3V6Zm2 2v8h14V8H5Zm7 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4ZM7 9h2v2H7V9Zm8 4h2v2h-2v-2Z"],["person_4","M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-8 8c0-3.31 3.58-6 8-6s8 2.69 8 6v1H4v-1Z"],["price_change","M12 2 3 6v6c0 5 3.84 9.74 9 10 5.16-.26 9-5 9-10V6l-9-4Zm1 15h-2v-2h2v2Zm0-4h-2V7h2v6Zm-7 6.5V15h2v2.6a9.1 9.1 0 0 1-2-3.1Zm12-1.9V15h2a9.1 9.1 0 0 1-2 3.1Z"],["search","M9.5 3a6.5 6.5 0 0 1 5.17 10.44l5.45 5.44-1.42 1.42-5.44-5.45A6.5 6.5 0 1 1 9.5 3Zm0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z"],["trending_up","M16 6h5v5h-2V9.41l-6.17 6.17-4-4L3.41 17 2 15.59l6.83-6.83 4 4L17.59 8H16V6Z"],["volume_up","M3 9v6h4l5 5V4L7 9H3Zm13.5 3a4.5 4.5 0 0 0-2.5-4.03v8.06A4.5 4.5 0 0 0 16.5 12Zm-2.5-8.7v2.06A7 7 0 0 1 18 12a7 7 0 0 1-4 6.64v2.06A9 9 0 0 0 20 12a9 9 0 0 0-6-8.7Z"],["work","M10 4h4a2 2 0 0 1 2 2v2h4a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h4V6a2 2 0 0 1 2-2Zm0 4h4V6h-4v2Zm-6 2v8h16v-8H4Zm6 3h4v2h-4v-2Z"]]);function m(a,h="material-icon",e){const t=(a||"").trim(),v=c.get(t);return v?l`
|
|
2
|
+
<svg
|
|
3
|
+
class=${`${h} scb-svg-icon`}
|
|
4
|
+
part=${e||o}
|
|
5
|
+
aria-hidden="true"
|
|
6
|
+
viewBox="0 0 24 24"
|
|
7
|
+
focusable="false"
|
|
8
|
+
>
|
|
9
|
+
<path d=${v}></path>
|
|
10
|
+
</svg>
|
|
11
|
+
`:o}export{m as t};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.232",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -450,5 +450,5 @@
|
|
|
450
450
|
"./scb-viz/*": null,
|
|
451
451
|
"./mvc/*": "./mvc/*"
|
|
452
452
|
},
|
|
453
|
-
"buildHash": "
|
|
453
|
+
"buildHash": "BA4B87143F6E8780C01F5D33C0FCA6D55B5DDC428194A5C325F356F39F1D3E73"
|
|
454
454
|
}
|
|
@@ -93,25 +93,22 @@ var e = (e, t, n = "1.25") => {
|
|
|
93
93
|
]
|
|
94
94
|
};
|
|
95
95
|
function i() {
|
|
96
|
-
return r;
|
|
97
|
-
}
|
|
98
|
-
function a() {
|
|
99
96
|
return r.patterns.map(({ kind: e }) => e);
|
|
100
97
|
}
|
|
101
|
-
function
|
|
98
|
+
function a(e) {
|
|
102
99
|
return r.patterns.find(({ kind: t }) => t === e) || r.patterns.find(({ kind: e }) => e === r.defaultPatternKind) || r.patterns[0];
|
|
103
100
|
}
|
|
104
|
-
function
|
|
105
|
-
let r =
|
|
101
|
+
function o(e, t, n) {
|
|
102
|
+
let r = a(n);
|
|
106
103
|
return r?.appendMarks(e, t), r?.kind || n;
|
|
107
104
|
}
|
|
108
|
-
function
|
|
109
|
-
let t = r.dashStyles, n = r.markerSymbols,
|
|
105
|
+
function s(e) {
|
|
106
|
+
let t = r.dashStyles, n = r.markerSymbols, a = i();
|
|
110
107
|
return {
|
|
111
108
|
dashStyle: t[e % t.length],
|
|
112
109
|
markerSymbol: n[e % n.length],
|
|
113
|
-
patternKind:
|
|
110
|
+
patternKind: a[e % a.length]
|
|
114
111
|
};
|
|
115
112
|
}
|
|
116
113
|
//#endregion
|
|
117
|
-
export {
|
|
114
|
+
export { o as appendScbVizSeriesDifferentiationPatternMarks, a as getScbVizSeriesDifferentiationPatternDefinition, i as getScbVizSeriesDifferentiationPatternKinds, s as getScbVizSeriesDifferentiationVariant, r as scbVizSeriesDifferentiationRegistry };
|
package/scb-viz/scb-viz.js
CHANGED
|
@@ -9,10 +9,10 @@ import "../scb-horizontal-scroller/scb-horizontal-scroller.js";
|
|
|
9
9
|
import "../scb-segmented-button/scb-segmented-item.js";
|
|
10
10
|
import "../scb-segmented-button/scb-segmented-button.js";
|
|
11
11
|
import "../scb-table/scb-table.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
12
|
+
import { getScbVizSeriesDifferentiationPatternKinds as t } from "./scb-viz-series-differentiation-registry.js";
|
|
13
|
+
import { clearScbVizSeriesDifferentiationColorClass as n, clearScbVizSeriesDifferentiationMetadata as r, ensureScbVizStyledModeSeriesPattern as i, getScbVizGroupedSeriesDifferentiationVariant as a, getScbVizHighchartsColorClassName as o, getScbVizHighchartsSvgRoot as s, getScbVizLegendSeriesDifferentiationTargets as c, getScbVizSeriesDifferentiationVariantByIndex as l, isScbVizGroupedSeriesDifferentiationChart as u, isScbVizHighchartsStyledMode as d, setScbVizSeriesDifferentiationColorClass as f, setScbVizSeriesDifferentiationMetadata as p, shouldShowScbVizSeriesDifferentiationAction as m, usesScbVizGroupedPointDifferentiation as h } from "./scb-viz-series-differentiation-runtime.js";
|
|
14
|
+
import { buildScbVizExportFileName as g, createScbVizCsvBlob as _, createScbVizRasterBlobFromElement as v, createScbVizRasterDataUrlFromElement as y, downloadScbVizBlob as b, getScbVizCurrentFullscreenElement as x, isScbVizFullscreenSupported as S, openScbVizPrintFrame as C, runWithScbVizForcedPrintLightMode as w, toggleScbVizFullscreen as T } from "./scb-viz-actions-runtime.js";
|
|
15
|
+
import { buildScbVizPrintDocumentHtml as E, buildScbVizPrintableFooterHtml as D, buildScbVizPrintableTableHtml as O } from "./scb-viz-print-runtime.js";
|
|
16
16
|
import { buildScbVizResolvedTableView as k, createScbVizCsvRows as A, inferScbVizTableAlignments as j, normalizeScbVizRenderableCell as M, readScbVizTableDataFromSlot as N } from "./scb-viz-table-runtime.js";
|
|
17
17
|
import { LitElement as P, css as F, html as I } from "lit";
|
|
18
18
|
import { customElement as L, property as R, state as z } from "lit/decorators.js";
|
|
@@ -1152,16 +1152,16 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1152
1152
|
].includes(n) ? "line" : ["area", "areaspline"].includes(n) ? "area" : ["column", "bar"].includes(n) ? this._isGroupedSeriesDifferentiationChart(e, t) ? "grouped-fill" : "fill" : ["pie", "variablepie"].includes(n) ? "point-fill" : null;
|
|
1153
1153
|
}
|
|
1154
1154
|
_getSeriesDifferentiationVariantByIndex(e) {
|
|
1155
|
-
return
|
|
1155
|
+
return l(e);
|
|
1156
1156
|
}
|
|
1157
1157
|
_isGroupedSeriesDifferentiationChart(e, t) {
|
|
1158
|
-
return
|
|
1158
|
+
return u(e, t);
|
|
1159
1159
|
}
|
|
1160
1160
|
_usesGroupedPointDifferentiation(e) {
|
|
1161
|
-
return
|
|
1161
|
+
return h(e);
|
|
1162
1162
|
}
|
|
1163
1163
|
_getGroupedSeriesDifferentiationVariant(e, t, n) {
|
|
1164
|
-
let r =
|
|
1164
|
+
let r = a(e, t, n);
|
|
1165
1165
|
return {
|
|
1166
1166
|
...r,
|
|
1167
1167
|
variantIndex: typeof r.variantIndex == "number" ? r.variantIndex : n
|
|
@@ -1193,7 +1193,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1193
1193
|
});
|
|
1194
1194
|
}
|
|
1195
1195
|
_shouldShowSeriesDifferentiationAction() {
|
|
1196
|
-
return
|
|
1196
|
+
return m({
|
|
1197
1197
|
chart: this._getCurrentHighchartsChart(),
|
|
1198
1198
|
getCurrentPrintableView: () => this._getCurrentPrintableView(),
|
|
1199
1199
|
getSeriesDifferentiationGroup: (e, t) => this._getSeriesDifferentiationGroup(e, t),
|
|
@@ -1212,45 +1212,45 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1212
1212
|
return { marker: a && Object.keys(a).length > 0 ? a : t && Object.keys(t).length > 0 ? t : { enabled: !1 } };
|
|
1213
1213
|
}
|
|
1214
1214
|
_isHighchartsStyledMode(e) {
|
|
1215
|
-
return
|
|
1215
|
+
return d(e);
|
|
1216
1216
|
}
|
|
1217
1217
|
_getHighchartsSvgRoot(e) {
|
|
1218
|
-
return
|
|
1218
|
+
return s(e);
|
|
1219
1219
|
}
|
|
1220
1220
|
_getHighchartsColorClassName(e, t) {
|
|
1221
|
-
return
|
|
1221
|
+
return o(e, t);
|
|
1222
1222
|
}
|
|
1223
1223
|
_setSeriesDifferentiationMetadata(e, t) {
|
|
1224
|
-
|
|
1224
|
+
p(e, t);
|
|
1225
1225
|
}
|
|
1226
1226
|
_clearSeriesDifferentiationMetadata(e) {
|
|
1227
|
-
|
|
1227
|
+
r(e);
|
|
1228
1228
|
}
|
|
1229
1229
|
_setSeriesDifferentiationColorClass(e, t) {
|
|
1230
|
-
|
|
1230
|
+
f(e, t);
|
|
1231
1231
|
}
|
|
1232
1232
|
_clearSeriesDifferentiationColorClass(e) {
|
|
1233
|
-
|
|
1233
|
+
n(e);
|
|
1234
1234
|
}
|
|
1235
1235
|
_getLegendSeriesDifferentiationTargets(e) {
|
|
1236
|
-
return
|
|
1236
|
+
return c(e);
|
|
1237
1237
|
}
|
|
1238
1238
|
_ensureStyledModeSeriesPattern(e, t, n) {
|
|
1239
|
-
|
|
1239
|
+
i(e, t, n);
|
|
1240
1240
|
}
|
|
1241
1241
|
_applyStyledModeSeriesDifferentiation(e) {
|
|
1242
|
-
let
|
|
1243
|
-
if (!
|
|
1244
|
-
|
|
1245
|
-
let
|
|
1246
|
-
e.series?.forEach((t,
|
|
1242
|
+
let n = this._getHighchartsSvgRoot(e);
|
|
1243
|
+
if (!n) return;
|
|
1244
|
+
n.classList.add("scb-viz-series-differentiation-enabled");
|
|
1245
|
+
let r = t(), i = this._getSeriesDifferentiationSnapshotStore(e);
|
|
1246
|
+
e.series?.forEach((t, n) => {
|
|
1247
1247
|
let a = this._getSeriesDifferentiationGroup(t, e);
|
|
1248
1248
|
if (!a) return;
|
|
1249
|
-
let o = String(t?.index ??
|
|
1250
|
-
|
|
1251
|
-
let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e,
|
|
1252
|
-
variantIndex:
|
|
1253
|
-
...this._getSeriesDifferentiationVariantByIndex(
|
|
1249
|
+
let o = String(t?.index ?? n);
|
|
1250
|
+
i.has(o) || i.set(o, this._captureSeriesDifferentiationSnapshot(t));
|
|
1251
|
+
let s = a === "grouped-fill" && this._usesGroupedPointDifferentiation(t), c = a === "grouped-fill" ? this._getGroupedSeriesDifferentiationVariant(t, e, n) : {
|
|
1252
|
+
variantIndex: n,
|
|
1253
|
+
...this._getSeriesDifferentiationVariantByIndex(n)
|
|
1254
1254
|
}, { dashStyle: l, markerSymbol: u, patternKind: d } = c, f = this._getHighchartsColorClassName(t?.graph ?? t?.area ?? t?.group, c.variantIndex), p = this._getLegendSeriesDifferentiationTargets(t);
|
|
1255
1255
|
this._setSeriesDifferentiationMetadata(t?.graph, {
|
|
1256
1256
|
role: "graph",
|
|
@@ -1274,8 +1274,8 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1274
1274
|
role: "fill",
|
|
1275
1275
|
patternKind: d
|
|
1276
1276
|
}), this._setSeriesDifferentiationColorClass(e?.graphic, f);
|
|
1277
|
-
}), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t,
|
|
1278
|
-
let i = n
|
|
1277
|
+
}), this._ensureStyledModeSeriesPattern(e, f, d))), a === "point-fill" && t.points?.forEach((t, n) => {
|
|
1278
|
+
let i = r[n % r.length], a = this._getHighchartsColorClassName(t?.graphic ?? t?.legendSymbol ?? t?.legendItem?.symbol ?? t?.legendItem?.group, n), o = this._getLegendSeriesDifferentiationTargets(t);
|
|
1279
1279
|
this._setSeriesDifferentiationMetadata(t?.graphic, {
|
|
1280
1280
|
role: "fill",
|
|
1281
1281
|
patternKind: i
|
|
@@ -1352,7 +1352,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1352
1352
|
return n.has(r) ? r : t;
|
|
1353
1353
|
}
|
|
1354
1354
|
_buildExportFileName(e) {
|
|
1355
|
-
return
|
|
1355
|
+
return g({
|
|
1356
1356
|
lang: this.lang,
|
|
1357
1357
|
title: this.title
|
|
1358
1358
|
}, e);
|
|
@@ -1361,17 +1361,17 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1361
1361
|
return this;
|
|
1362
1362
|
}
|
|
1363
1363
|
_getCurrentFullscreenElement() {
|
|
1364
|
-
return
|
|
1364
|
+
return x();
|
|
1365
1365
|
}
|
|
1366
1366
|
_isFullscreenSupported() {
|
|
1367
|
-
return
|
|
1367
|
+
return S(this._getFullscreenTarget());
|
|
1368
1368
|
}
|
|
1369
1369
|
_syncFullscreenState() {
|
|
1370
1370
|
let e = this._getCurrentFullscreenElement() === this._getFullscreenTarget();
|
|
1371
1371
|
this._isFullscreen = e, this.toggleAttribute("data-scb-viz-fullscreen", e), this.#c(), this.#r();
|
|
1372
1372
|
}
|
|
1373
1373
|
async _toggleFullscreen() {
|
|
1374
|
-
await
|
|
1374
|
+
await T(this._getFullscreenTarget());
|
|
1375
1375
|
}
|
|
1376
1376
|
_renderActionsMenu() {
|
|
1377
1377
|
let e = this._getCurrentPrintableView(), t = this._canExportRaster(), n = this._canExportCsv(), r = t && (e === "diagram" || e === "image"), i = n && e === "table", a = this._shouldShowSeriesDifferentiationAction(), o = `${this._instanceId}-actions-menu`;
|
|
@@ -1749,17 +1749,17 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1749
1749
|
async #m(e) {
|
|
1750
1750
|
let t = this._getExportableVisualElement();
|
|
1751
1751
|
if (!t) return;
|
|
1752
|
-
let n = await
|
|
1753
|
-
n &&
|
|
1752
|
+
let n = await v(t, this._getExportSurfaceTarget(), e);
|
|
1753
|
+
n && b(n, this._buildExportFileName(e === "jpeg" ? "jpg" : "png"));
|
|
1754
1754
|
}
|
|
1755
1755
|
_getCurrentPrintableView() {
|
|
1756
1756
|
return this.variant === "Table" ? "table" : this.variant === "Image" ? "image" : this.selectedChip === "Table" ? "table" : "diagram";
|
|
1757
1757
|
}
|
|
1758
1758
|
#h(e) {
|
|
1759
|
-
return
|
|
1759
|
+
return O(this._getResolvedTableView(e), (e) => this._escapeHtml(e), { getEmptyHeaderLabel: (e) => this._getEmptyTableHeaderLabel(e) });
|
|
1760
1760
|
}
|
|
1761
1761
|
#g() {
|
|
1762
|
-
return
|
|
1762
|
+
return D({
|
|
1763
1763
|
comment: this.comment,
|
|
1764
1764
|
commentLabel: this.commentLabel,
|
|
1765
1765
|
description: this.description,
|
|
@@ -1776,7 +1776,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
#_(e) {
|
|
1779
|
-
return
|
|
1779
|
+
return E({
|
|
1780
1780
|
contentHtml: e,
|
|
1781
1781
|
escapeHtml: (e) => this._escapeHtml(e),
|
|
1782
1782
|
footerHtml: this.#g(),
|
|
@@ -1786,7 +1786,7 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1786
1786
|
});
|
|
1787
1787
|
}
|
|
1788
1788
|
async #v() {
|
|
1789
|
-
await
|
|
1789
|
+
await w(this, async () => {
|
|
1790
1790
|
let e = this._getCurrentPrintableView(), t = "";
|
|
1791
1791
|
if (e === "table") {
|
|
1792
1792
|
let e = this._getResolvedTableData();
|
|
@@ -1799,16 +1799,16 @@ var H = /* @__PURE__ */ new Set([
|
|
|
1799
1799
|
} else {
|
|
1800
1800
|
let e = this._getExportableVisualElement();
|
|
1801
1801
|
if (!e) return;
|
|
1802
|
-
let n = await
|
|
1802
|
+
let n = await y(e, this._getExportSurfaceTarget(), "png");
|
|
1803
1803
|
if (!n) return;
|
|
1804
1804
|
t = `<img class="viz-chart-image" src="${n}" alt="${this._escapeHtml(this._getImageAltText())}">`;
|
|
1805
1805
|
}
|
|
1806
|
-
await
|
|
1806
|
+
await C(this.#_(t));
|
|
1807
1807
|
});
|
|
1808
1808
|
}
|
|
1809
1809
|
#y() {
|
|
1810
1810
|
let e = this._getResolvedTableData();
|
|
1811
|
-
e?.rows?.length &&
|
|
1811
|
+
e?.rows?.length && b(_(A(e, (e) => this._normalizeRenderableCell(e)), this.lang), this._buildExportFileName("csv"));
|
|
1812
1812
|
}
|
|
1813
1813
|
#b() {
|
|
1814
1814
|
let e = this.#x(this.spacing), t = this.#x(this.spacingTop) ?? e, n = this.#x(this.spacingBottom) ?? e, r = this.#x(this.spacingLeft), i = this.#x(this.spacingRight);
|