scb-wc 0.1.96 → 0.1.97
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 +41 -22
- package/all.js +0 -5
- package/icons.json +178 -178
- package/index.js +88 -93
- package/mvc/components/all.js +0 -5
- package/mvc/components/scb-accordion/scb-accordion-item.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 +5 -5
- package/mvc/components/scb-dropdown/scb-dropdown.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-list/scb-list-item.js +2 -2
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-nav/scb-nav.js +2 -2
- package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
- package/mvc/components/scb-progress-stepper/scb-progress-step.js +2 -2
- package/mvc/components/scb-search/scb-search.js +1 -1
- 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-stepper/scb-step.js +1 -1
- package/mvc/components/scb-textfield/scb-textfield.js +141 -24
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/mvc/scb-logo.svg +20 -20
- package/mvc/scb.svg +13 -13
- package/mvc/vendor/lazy-focus-ring.js +2 -0
- package/mvc/vendor/lazy-ripple.js +2 -0
- 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-chevron/scb-chevron.js +0 -1
- package/scb-datepicker/scb-datepicker.js +0 -1
- package/scb-wc-public-entry/index.d.ts +97 -0
- package/scb-wc.bundle.js +262 -262
- package/scb-wc.d.ts +194 -204
- package/shared/scb-icon-svg.js +2 -5
- package/mvc/components/scb-datepicker/scb-datepicker.js +0 -118
- 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
- package/scb-components/index.d.ts +0 -102
- package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -41
- package/scb-components/shared/lazy-focus-ring.d.ts +0 -4
- package/scb-components/shared/lazy-ripple.d.ts +0 -9
- package/scb-components/shared/scb-icon-svg.d.ts +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["
|
|
2
|
-
import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js","../scb-checkbox/scb-checkbox.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateFieldGet2.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/md-focus-ring.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/delegate.js","../../vendor/form-associated.js","../../vendor/redispatch-event.js","../../vendor/ripple.js","../../vendor/validator.js","../../vendor/checkbox-validator.js","../scb-checkbox/scb-checkbox-group.js","../scb-switch/scb-switch.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as n,h as y,m as w,p as a,v as o,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as u}from"../../vendor/preload-helper.js";import{t as e}from"../../vendor/decorate.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(t,r,l){try{customElements.get(t)||s(t,r,l)}catch(c){var d=String(c||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var g,_;function f(){return g??(g=u(()=>import("../../vendor/lazy-focus-ring.js").then(p=>p.i),__vite__mapDeps([0,1,2]),import.meta.url)),g}function b(){return _??(_=u(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),_}var i=class extends y{constructor(...s){super(...s),this.type="text",this.href="",this.itemHref="",this.target="",this.disabled=!1,this.label="",this.supportingText="",this.overline="",this.leading=!1,this.leadingVariant="",this.leadingIcon="",this.avatarLabel="",this.avatarAlt="",this.avatarVariant="icon",this.avatarSrc="",this.imgHrefImage="",this.trailing=!1,this.trailingVariant="",this.trailingIcon="",this.trailingSwitchLabel="",this.trailingSwitchWidth="",this.trailingSwitchSelected=!1,this.density=0,this.noDivider=!1,this.__scbCheckboxLoaded=!1,this.__scbSwitchLoaded=!1,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__focusVisibleRaf=null,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__syncRipple=async()=>{const t=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".row"),l=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await b();await c(t,r,l,d)},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onFocusIn=()=>{this.__scheduleFocusVisibleSync()},this.__onFocusOut=()=>{this.__scheduleFocusVisibleSync()},this.__onPointerDown=()=>{this.toggleAttribute("data-focus-visible",!1)},this.__onLazyFocusRingKeydown=t=>{t.key==="Tab"&&f().then(({ensureFocusRingOnTab:r})=>r(t))},this.onRowClick=()=>{if(this.type==="link"&&!this.disabled&&(!this.__rippleLoaded||this.__pendingRippleEvent)&&(this.__pendingRippleClick=!0,this.__ensureRipple()),this.type==="link"&&(this.href||this.itemHref))return;const t=this.shadowRoot?.querySelector("scb-checkbox"),r=this.shadowRoot?.querySelector("scb-switch");if(t&&(t.checked=!t.checked),r){const l=!this.trailingSwitchSelected;r.selected=l,this.__setTrailingSwitchSelected(l,!0)}},this.__onTrailingSwitchChange=t=>{const r=t.detail?.selected,l=typeof r=="boolean"?r:t.currentTarget?.selected??!1;this.__setTrailingSwitchSelected(l,!0)},this.__onKeydown=t=>{if(!t.defaultPrevented&&(t.key==="Enter"||t.key===" ")){if(this.type==="link"){const r=this.shadowRoot?.querySelector("a[href]");if(r){t.preventDefault(),r.click();return}}t.preventDefault(),this.onRowClick()}}}static get styles(){return k`:host{display:block;border-bottom:var(--stroke-border, 1px) solid var(--md-sys-color-outline-variant);margin-bottom:calc(var(--stroke-border, 1px)*-1);outline:0;position:relative;color:var(--md-sys-color-on-surface);font-family:var(--brand-font)}:host([hidden]){display:none}:host([no-divider]){--stroke-border:0px}md-focus-ring{position:absolute;inset:0;pointer-events:none;display:none;border-radius:var(--scb-list-item-focus-ring-radius, var(--md-sys-shape-corner-small, 8px))}:host([data-focus-visible]) md-focus-ring{display:block}.row{display:flex;align-items:center;gap:var(--spacing-5, 16px);padding-block:var(--spacing-7, 24px);padding-inline:var(--spacing-5, 16px);border-radius:var(--radius-none, 0px);-webkit-tap-highlight-color:transparent;position:relative;overflow:hidden;cursor:default}:host([type="link"]) .row{cursor:pointer}:host([density="-2"]) .row,:host-context([data-density="-2"]) .row{padding-block:var(--spacing-5, 16px)}:host([density="-4"]) .row,:host-context([data-density="-4"]) .row{padding-block:var(--spacing-4, 12px)}md-ripple{border-radius:inherit;inset:0;position:absolute;pointer-events:none}.material-icon{display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.material-icon.scb-svg-icon{fill:currentColor;font:inherit}.leading{align-self:center;display:grid;place-items:center}.img{width:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));height:calc(var(--icon-size-extra-large, 36px) + var(--spacing-5, 16px));object-fit:contain;border-radius:var(--radius-s, 8px);filter:var(--scb-list-leading-image-filter, none)}.texts{display:grid;gap:var(--spacing-1, 2px);min-inline-size:0}.label,.overline,.supporting-text{font-family:var(--brand-font);font-size:var(--md-sys-typescale-label-medium-size);line-height:var(--md-sys-typescale-label-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-label-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.label,.supporting-text{font-size:var(--md-sys-typescale-title-large-size);line-height:var(--md-sys-typescale-title-large-line-height);font-weight:var(--weight-semibold);letter-spacing:var(--md-sys-typescale-title-large-tracking);color:var(--md-sys-color-on-surface)}.supporting-text{font-size:var(--md-sys-typescale-body-medium-size);line-height:var(--md-sys-typescale-body-medium-line-height);font-weight:var(--weight-regular);letter-spacing:var(--md-sys-typescale-body-medium-tracking);color:var(--md-sys-color-on-surface-variant)}.trailing{margin-left:auto;align-self:center;display:flex}.trailing.trailing-switch{justify-content:flex-end}.trailing scb-checkbox{margin-inline-end:var(--scb-list-trailing-checkbox-nudge)}:host([trailing-variant="checkbox"]) .row,:host([trailing-variant="switch"]) .row{cursor:pointer}:host([disabled]) .row{cursor:default}.link{text-decoration:none;color:inherit;display:flex;width:100%;gap:12px}`}async firstUpdated(){await this.__ensureDepsLoaded(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("focusout",this.__onFocusOut),this.addEventListener("pointerdown",this.__onPointerDown,!0),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.addEventListener("keydown",this.__onKeydown)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("focusout",this.__onFocusOut),this.removeEventListener("pointerdown",this.__onPointerDown,!0),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.removeEventListener("keydown",this.__onKeydown),this.__focusVisibleRaf!==null&&(cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=null),super.disconnectedCallback()}updated(s){super.updated(s),(s.has("leading")||s.has("leadingVariant")||s.has("trailing")||s.has("trailingVariant")||s.has("type")||s.has("target"))&&this.__ensureDepsLoaded()}async __ensureDepsLoaded(){this.trailing&&this.trailingVariant==="checkbox"&&!this.__scbCheckboxLoaded&&(await u(()=>import("../scb-checkbox/scb-checkbox.js"),__vite__mapDeps([4,5,6,7,8,9,1,10,11,12,13,14,15,16,17,18]),import.meta.url),this.__scbCheckboxLoaded=!0),this.trailing&&this.trailingVariant==="switch"&&!this.__scbSwitchLoaded&&(await u(()=>import("../scb-switch/scb-switch.js"),__vite__mapDeps([19,5,7,8,9,1,10,11,12,13,14,15,16,17]),import.meta.url),this.__scbSwitchLoaded=!0)}__ensureRipple(s){if(!(this.type!=="link"||this.disabled)){if(s&&(this.__pendingRippleEvent=s),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,b().then(({ensureRippleReady:t})=>t()).then(()=>{this.disabled||(this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple()))}))}}__scheduleFocusVisibleSync(){this.__focusVisibleRaf!==null&&cancelAnimationFrame(this.__focusVisibleRaf),this.__focusVisibleRaf=requestAnimationFrame(()=>{this.__focusVisibleRaf=null;const s=this.renderRoot instanceof ShadowRoot?this.renderRoot.activeElement:null,t=this.matches(":focus-visible")||s instanceof HTMLElement&&s.matches(":focus-visible");this.toggleAttribute("data-focus-visible",t),t&&this.__ensureFocusRing()})}__ensureFocusRing(){this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,f().then(({ensureFocusRingReady:s})=>s()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}__setTrailingSwitchSelected(s,t){this.trailingSwitchSelected=s,t&&this.dispatchEvent(new CustomEvent("trailing-switch-change",{detail:{selected:s},bubbles:!0,composed:!0}))}render(){const s=this.leading?(()=>{switch(this.leadingVariant){case"icon":return this.leadingIcon?o`<div class="leading"><span class="material-icon" aria-hidden="true">${this.leadingIcon}</span></div>`:n;case"avatar":return o`
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<scb-avatar
|
|
5
5
|
label=${this.avatarLabel}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/ripple.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/attachable-controller.js","../../vendor/vendor-lit.js","../../vendor/md-focus-ring.js","../../vendor/icon.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f as g,g as u,h as _,m as f,p as r,v as d,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as h}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import"
|
|
2
|
+
import{f as g,g as u,h as _,m as f,p as r,v as d,y as v}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as h}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,l){try{customElements.get(t)||e(t,i,l)}catch(p){var m=String(p||"");if(m.indexOf("already been used")===-1&&m.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var c,o,b={fromAttribute:a=>a==null?!1:!/^(false|0|off|no)$/i.test(a),toAttribute:a=>a?"":null},n=(c=class extends _{constructor(...e){super(...e),this.label="",this.selected=!1,this.noHighlightSelected=!1,this.leadingIcon="",this.itemHref="",this.hasChildren=!1,this.loading=!1,this.hasSlotContent=!1,this.expanded=!1,this.__submenuId=`sub-${Math.random().toString(36).slice(2)}`,this.__focusId=`f-${Math.random().toString(36).slice(2)}`,this._toggleExpand=t=>{t&&t.stopPropagation(),this.__isExpandable&&this.__setExpanded(!this.expanded)},this._onButtonClick=t=>{t.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=t=>{const i=Array.from(this.closest("scb-sub-menu, scb-menu")?.querySelectorAll("scb-menu-item")||[]),l=i.indexOf(this);switch(t.key){case"ArrowDown":t.preventDefault(),(i[l+1]||i[0]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break;case"ArrowUp":t.preventDefault(),(i[l-1]||i[i.length-1]).shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break;case"Home":t.preventDefault(),i[0].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break;case"End":t.preventDefault(),i[i.length-1].shadowRoot?.querySelector(".scb-menu-label-text")?.focus();break}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}get __isExpandable(){return this.hasSlotContent||this.hasChildren}async __ensureDepsLoaded(){o.__rippleLoaded||(await h(()=>import("../../vendor/ripple.js").then(e=>e.t),__vite__mapDeps([0,1,2,3,4]),import.meta.url),o.__rippleLoaded=!0),o.__focusRingLoaded||(await h(()=>import("../../vendor/md-focus-ring.js").then(e=>e.t),__vite__mapDeps([5,1,2,3,4]),import.meta.url),o.__focusRingLoaded=!0),this.leadingIcon&&!o.__iconLoaded&&(await h(()=>import("../../vendor/icon.js").then(e=>e.t),__vite__mapDeps([6,1,2,4]),import.meta.url),o.__iconLoaded=!0)}__syncHasSlotContentFromLightDom(){const e=Array.from(this.children);this.hasSlotContent=e.some(t=>t.tagName==="SCB-SUB-MENU")}connectedCallback(){super.connectedCallback(),this.__syncHasSlotContentFromLightDom()}_onSlotChange(e){const t=e.target.assignedElements({flatten:!0});this.hasSlotContent=t.some(i=>i.tagName==="SCB-SUB-MENU")}__setExpanded(e){if(!this.__isExpandable)return;this.expanded=e;const t={item:this,expanded:e,hasChildren:this.hasChildren,hasSlotContent:this.hasSlotContent,loading:this.loading,lazy:this.hasChildren&&!this.hasSlotContent};this.dispatchEvent(new CustomEvent("scb-menu-expand",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbmenuexpand",{bubbles:!0,composed:!0,detail:t}))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:this}})),this.dispatchEvent(new CustomEvent("scbmenuselect",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){await this.__ensureDepsLoaded(),this.__applyInert()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),(e.has("hasSlotContent")&&this.hasSlotContent||e.has("hasChildren")&&this.hasChildren||e.has("loading")&&this.loading)&&this.__ensureDepsLoaded(),(e.has("expanded")||e.has("hasChildren")||e.has("loading"))&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(this.loading?e.setAttribute("aria-busy","true"):e.removeAttribute("aria-busy"),this.expanded?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false")):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true")))}render(){const e=!!this.leadingIcon,t=!!this.itemHref,i=this.__isExpandable;return d`
|
|
3
3
|
<div class="scb-menu-item">
|
|
4
4
|
<div class="scb-menu-item-label" ?selected=${this.selected} ?no-highlight-selected=${this.noHighlightSelected}>
|
|
5
5
|
${t?d`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as g,h as y,m as k,p as n,v as h,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{f as g,h as y,m as k,p as n,v as h,y as x}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{t as S}from"../../vendor/lazy-focus-ring.js";import{t as o}from"../../vendor/decorate.js";import{t as f}from"../../vendor/scb-icon-svg.js";import"./scb-nav-item.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__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(c){var r=String(c||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var p,m={fromAttribute(d){return d===null?!1:d.toLowerCase()!=="false"}},a=(p=class extends y{constructor(...t){super(...t),this.__itemsEl=null,this.__resizeObserver=null,this.__resizeRaf=null,this.__canScrollLeft=!1,this.__canScrollRight=!1,this.label="",this.activeHref="",this.activateOnClick=!0,this.scrollShadow=!1,this.sticky=!1,this.stickyTop="0px",this.stickyZIndex=5,this.stickyBackground="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__autoAriaLabel=!1,this.__itemIdPrefix=`scb-nav-${Math.random().toString(36).slice(2)}`,this.__itemIdCounter=0,this.__onSlotChange=async()=>{await this.__decorateItems(),this.__applyActiveHref(),this.__scheduleScrollControlUpdate()},this.__scrollLeft=()=>{this.__scrollBy(-this.__getScrollStep())},this.__scrollRight=()=>{this.__scrollBy(this.__getScrollStep())},this.__onWheel=e=>{if(e.ctrlKey)return;const s=this.__itemsEl;if(!s)return;const i=s.scrollWidth-s.clientWidth;if(i<=1)return;const r=this.__normalizeWheelDelta(e);if(r===0)return;const c=Math.max(0,Math.min(i,s.scrollLeft+r));c!==s.scrollLeft&&(e.preventDefault(),s.scrollLeft=c,this.__updateScrollControls())},this.__onItemsScroll=()=>{this.__updateScrollControls()},this.__onClick=e=>{const s=e.composedPath().find(r=>r instanceof HTMLElement&&(r.tagName==="A"||r.tagName==="BUTTON"||r.tagName==="SCB-NAV-ITEM"));if(!s)return;const i=this.__getItemHref(s);this.dispatchEvent(new CustomEvent("scb-nav-select",{bubbles:!0,composed:!0,detail:{item:s,href:i}})),this.dispatchEvent(new CustomEvent("scbnavselect",{bubbles:!0,composed:!0,detail:{item:s,href:i}})),this.activateOnClick&&i&&(this.activeHref=i)}}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,i=this.mapSpacingToken(this.spacingLeft),r=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-nav-spacing-block-start",e):this.style.removeProperty("--scb-nav-spacing-block-start"),s?this.style.setProperty("--scb-nav-spacing-block-end",s):this.style.removeProperty("--scb-nav-spacing-block-end"),i?this.style.setProperty("--scb-nav-spacing-inline-start",i):this.style.removeProperty("--scb-nav-spacing-inline-start"),r?this.style.setProperty("--scb-nav-spacing-inline-end",r):this.style.removeProperty("--scb-nav-spacing-inline-end")}__syncStickyStyles(){if(!this.sticky){this.style.removeProperty("--_scb-nav-sticky-top"),this.style.removeProperty("--_scb-nav-sticky-z-index"),this.style.removeProperty("--_scb-nav-sticky-background");return}const t=(this.stickyTop||"").trim()||"0px";this.style.setProperty("--_scb-nav-sticky-top",t);const e=Number.isFinite(this.stickyZIndex)?this.stickyZIndex:5;this.style.setProperty("--_scb-nav-sticky-z-index",String(e));const s=(this.stickyBackground||"").trim();if(!s){this.style.removeProperty("--_scb-nav-sticky-background");return}const i=s.startsWith("--")?`var(${s})`:s;this.style.setProperty("--_scb-nav-sticky-background",i)}connectedCallback(){super.connectedCallback(),this.__removeLazyFocusRingListeners=S(this,this.renderRoot),this.hasAttribute("role")||this.setAttribute("role","navigation"),this.__syncStickyStyles(),this.__syncAriaLabel()}disconnectedCallback(){this.__removeLazyFocusRingListeners?.(),this.__removeLazyFocusRingListeners=void 0,this.__itemsEl?.removeEventListener("scroll",this.__onItemsScroll),this.__itemsEl=null,this.__resizeObserver?.disconnect(),this.__resizeObserver=null,this.__resizeRaf!==null&&(cancelAnimationFrame(this.__resizeRaf),this.__resizeRaf=null),super.disconnectedCallback()}async firstUpdated(){this.__itemsEl=this.renderRoot.querySelector(".scb-nav__items"),this.__itemsEl&&this.__itemsEl.addEventListener("scroll",this.__onItemsScroll,{passive:!0}),this.__resizeObserver=new ResizeObserver(()=>{this.__scheduleScrollControlUpdate()}),this.__resizeObserver.observe(this),this.__itemsEl&&this.__resizeObserver.observe(this.__itemsEl),await this.__decorateItems(),this.__applyActiveHref(),this.__applySpacing(),this.__scheduleScrollControlUpdate(),document.fonts?.ready?.then(()=>{this.isConnected&&this.__scheduleScrollControlUpdate()})}updated(t){t.has("label")&&this.__syncAriaLabel(),(t.has("sticky")||t.has("stickyTop")||t.has("stickyZIndex")||t.has("stickyBackground"))&&this.__syncStickyStyles(),t.has("activeHref")&&this.__applyActiveHref(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing()}__syncAriaLabel(){if(this.hasAttribute("aria-label")){this.__autoAriaLabel=!1;return}const t=(this.label||"").trim();if(!t){this.__autoAriaLabel&&(this.removeAttribute("aria-label"),this.__autoAriaLabel=!1);return}this.setAttribute("aria-label",t),this.__autoAriaLabel=!0}async __decorateItems(){const t=this.__getSlottedItems();if(t.some(e=>e.tagName==="A"||e.tagName==="BUTTON"||e.tagName==="SCB-NAV-ITEM"))for(const e of t){const s=e instanceof HTMLAnchorElement,i=e instanceof HTMLButtonElement,r=e.tagName==="SCB-NAV-ITEM";if(!s&&!i&&!r||(i&&!e.hasAttribute("type")&&e.setAttribute("type","button"),e.getAttribute("data-scb-nav-decorated")==="true"))continue;e.id||(this.__itemIdCounter+=1,e.id=`${this.__itemIdPrefix}-${this.__itemIdCounter}`);const c=b=>{const v=e.querySelector(b);if(v instanceof HTMLElement)return v;const u=document.createElement(b);return e.appendChild(u),u},_=c("md-ripple");_&&_.style.setProperty("--md-ripple-focus-opacity","0");const l=c("md-focus-ring");l&&(l.setAttribute("inward",""),l.setAttribute("for",e.id),l.style.position="absolute",l.style.inset="0",l.style.pointerEvents="none",l.style.borderRadius="24px"),e.setAttribute("data-scb-nav-decorated","true")}}__getSlottedItems(){const t=this.renderRoot.querySelector("slot");return t?t.assignedElements({flatten:!0}).filter(e=>e instanceof HTMLElement):[]}__getItemHref(t){return t instanceof HTMLAnchorElement?(t.getAttribute("href")||"").trim():t.tagName==="SCB-NAV-ITEM"?(t.getAttribute("href")||t.getAttribute("data-href")||t.href||t.dataHref||"").trim():(t.getAttribute("data-href")||"").trim()}__applyActiveHref(){const t=(this.activeHref||"").trim(),e=this.__getSlottedItems();for(const s of e){const i=s instanceof HTMLAnchorElement,r=s instanceof HTMLButtonElement,c=s.tagName==="SCB-NAV-ITEM";if(!i&&!r&&!c)continue;r&&!s.hasAttribute("type")&&s.setAttribute("type","button");const _=this.__getItemHref(s);t&&_===t?(s.setAttribute("aria-current","location"),s.setAttribute("data-scb-nav-managed","true"),s.setAttribute("data-active","true")):(s.getAttribute("data-scb-nav-managed")==="true"&&(s.removeAttribute("aria-current"),s.removeAttribute("data-scb-nav-managed")),s.removeAttribute("data-active"))}}__getScrollStep(){const t=this.__itemsEl;return t?Math.max(Math.round(t.clientWidth*.8),120):200}__scrollBy(t){this.__itemsEl?.scrollBy({left:t,behavior:"smooth"})}__normalizeWheelDelta(t){const e=this.__itemsEl,s=Math.abs(t.deltaX)>Math.abs(t.deltaY)?t.deltaX:t.deltaY;return e?t.deltaMode===WheelEvent.DOM_DELTA_LINE?s*16:t.deltaMode===WheelEvent.DOM_DELTA_PAGE?s*e.clientWidth:s:s}__scheduleScrollControlUpdate(){this.__resizeRaf===null&&(this.__resizeRaf=requestAnimationFrame(()=>{this.__resizeRaf=null,this.__updateScrollControls()}))}__updateScrollControls(){const t=this.__itemsEl;if(!t){this.__canScrollLeft=!1,this.__canScrollRight=!1,this.toggleAttribute("data-scroll-left",!1),this.toggleAttribute("data-scroll-right",!1);return}const e=t.scrollLeft>0,s=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this.__canScrollLeft=e,this.__canScrollRight=s,this.toggleAttribute("data-scroll-left",e),this.toggleAttribute("data-scroll-right",s)}render(){return h`
|
|
2
2
|
<div class="scb-nav">
|
|
3
3
|
${this.__canScrollLeft?h`
|
|
4
4
|
<button
|
|
@@ -36,4 +36,4 @@ import{f as g,h as y,m as k,p as n,v as h,y as x}from"../../vendor/vendor.js";im
|
|
|
36
36
|
var(--scb-nav-padding-block, var(--spacing-5, 16px))
|
|
37
37
|
);padding-inline:var(--scb-nav-sticky-padding-inline,
|
|
38
38
|
var(--scb-nav-padding-inline, var(--spacing-5, 16px))
|
|
39
|
-
)}.scb-nav__items{display:flex;flex:1 1 auto;align-items:center;gap:var(--scb-nav-gap, var(--spacing-3, 8px));min-inline-size:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;inline-size:100%;max-inline-size:100%;--_scb-nav-edge-fade-size:var(--scb-nav-edge-fade-size, 64px)}:host([data-scroll-left]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 100%)}:host([data-scroll-right]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%);mask-image:linear-gradient(to right,#000 0,#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%)}:host([data-scroll-left][data-scroll-right]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%)}.scb-nav__items::-webkit-scrollbar{display:none}::slotted(a),::slotted(button),::slotted(scb-nav-item){display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;padding-block:var(--scb-nav-item-padding-block, var(--spacing-3, 8px));padding-inline:var(--scb-nav-item-padding-inline, var(--spacing-5, 16px));border-radius:var(--scb-nav-item-radius, var(--radius-full, 1000px));background:0 0;color:var(--md-sys-color-on-surface);text-decoration:none;border:0;font-family:inherit;font-size:var(--md-sys-typescale-label-large-size);line-height:var(--md-sys-typescale-label-large-line-height);font-weight:var(--md-sys-typescale-label-large-weight);cursor:pointer;white-space:nowrap;user-select:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;outline:0;position:relative;overflow:hidden}::slotted(a:focus),::slotted(button:focus),::slotted(scb-nav-item:focus){outline:0}::slotted([data-active=true]),::slotted(a[aria-current]),::slotted(button[aria-current]),::slotted(scb-nav-item[aria-current]){background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);font-weight:600}.scb-nav__scroll-control{position:absolute;z-index:3;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--scb-icon-button-container-size, 40px);block-size:var(--scb-icon-button-container-size, 40px);padding:0;border:0;border-radius:var(--radius-full, 1000px);background:var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff)));color:var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be)));cursor:pointer;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-weight:var(--weight-semibold, 600);overflow:hidden;appearance:none;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.scb-nav__scroll-control::before{content:"";position:absolute;inset:0;border-radius:inherit;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.scb-nav__scroll-control:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.scb-nav__scroll-control:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.scb-nav__scroll-control:focus{outline:0}.scb-nav__scroll-control:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));outline-offset:var(--spacing-1, 2px)}.scb-nav__scroll-control-icon{position:relative;display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.scb-nav__scroll-control-icon.scb-svg-icon{fill:currentColor;font:inherit}.scb-nav__scroll-control--left{inset-inline-start:0}.scb-nav__scroll-control--right{inset-inline-end:2px}.scb-nav__scroll-shadow-left,.scb-nav__scroll-shadow-right{position:absolute;inset-block:0;z-index:2;inline-size:5px;pointer-events:none;background:0 0;box-shadow:none;transition:box-shadow .2s}.scb-nav__scroll-shadow-left{inset-inline-start:0}.scb-nav__scroll-shadow-right{inset-inline-end:0}:host([data-scroll-left]) .scb-nav__scroll-shadow-left{background:0 0;box-shadow:12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color))}:host([data-scroll-right]) .scb-nav__scroll-shadow-right{background:0 0;box-shadow:-12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),-4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color))}`,p);
|
|
39
|
+
)}.scb-nav__items{display:flex;flex:1 1 auto;align-items:center;gap:var(--scb-nav-gap, var(--spacing-3, 8px));min-inline-size:0;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;scrollbar-width:none;inline-size:100%;max-inline-size:100%;--_scb-nav-edge-fade-size:var(--scb-nav-edge-fade-size, 64px)}:host([data-scroll-left]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 100%)}:host([data-scroll-right]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,#000 0,#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%);mask-image:linear-gradient(to right,#000 0,#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%)}:host([data-scroll-left][data-scroll-right]) .scb-nav__items{-webkit-mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%);mask-image:linear-gradient(to right,transparent 0,#000 var(--_scb-nav-edge-fade-size),#000 calc(100% - var(--_scb-nav-edge-fade-size)),transparent 100%)}.scb-nav__items::-webkit-scrollbar{display:none}::slotted(a),::slotted(button),::slotted(scb-nav-item){display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;padding-block:var(--scb-nav-item-padding-block, var(--spacing-3, 8px));padding-inline:var(--scb-nav-item-padding-inline, var(--spacing-5, 16px));border-radius:var(--scb-nav-item-radius, var(--radius-full, 1000px));background:0 0;color:var(--md-sys-color-on-surface);text-decoration:none;border:0;font-family:inherit;font-size:var(--md-sys-typescale-label-large-size);line-height:var(--md-sys-typescale-label-large-line-height);font-weight:var(--md-sys-typescale-label-large-weight);cursor:pointer;white-space:nowrap;user-select:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;outline:0;position:relative;overflow:hidden}::slotted(a:focus),::slotted(button:focus),::slotted(scb-nav-item:focus){outline:0}::slotted([data-active=true]),::slotted(a[aria-current]),::slotted(button[aria-current]),::slotted(scb-nav-item[aria-current]){background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container);font-weight:600}.scb-nav__scroll-control{position:absolute;z-index:3;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--scb-icon-button-container-size, 40px);block-size:var(--scb-icon-button-container-size, 40px);padding:0;border:0;border-radius:var(--radius-full, 1000px);background:var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, var(--p-90, #d6f1ff)));color:var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, var(--p-30, #1e00be)));cursor:pointer;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-weight:var(--weight-semibold, 600);overflow:hidden;appearance:none;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.scb-nav__scroll-control::before{content:"";position:absolute;inset:0;border-radius:inherit;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.scb-nav__scroll-control:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.scb-nav__scroll-control:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.scb-nav__scroll-control:focus{outline:0}.scb-nav__scroll-control:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40, #1f44ff)));outline-offset:var(--spacing-1, 2px)}.scb-nav__scroll-control-icon{position:relative;display:inline-block;inline-size:var(--icon-size-medium, 24px);block-size:var(--icon-size-medium, 24px);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--icon-size-medium, 24px);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.scb-nav__scroll-control-icon.scb-svg-icon{fill:currentColor;font:inherit}.scb-nav__scroll-control--left{inset-inline-start:0}.scb-nav__scroll-control--right{inset-inline-end:2px}.scb-nav__scroll-shadow-left,.scb-nav__scroll-shadow-right{position:absolute;inset-block:0;z-index:2;inline-size:5px;pointer-events:none;background:0 0;box-shadow:none;transition:box-shadow .2s}.scb-nav__scroll-shadow-left{inset-inline-start:0}.scb-nav__scroll-shadow-right{inset-inline-end:0}:host([data-scroll-left]) .scb-nav__scroll-shadow-left{background:0 0;box-shadow:12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color))}:host([data-scroll-right]) .scb-nav__scroll-shadow-right{background:0 0;box-shadow:-12px 0 30px var(--scb-nav-scroll-shadow-color, var(--_scb-nav-scroll-shadow-color)),-4px 0 12px var(--scb-nav-scroll-shadow-soft-color, var(--_scb-nav-scroll-shadow-soft-color))}`,p);o([g()],a.prototype,"__canScrollLeft",void 0);o([g()],a.prototype,"__canScrollRight",void 0);o([n({type:String})],a.prototype,"label",void 0);o([n({type:String,attribute:"active-href"})],a.prototype,"activeHref",void 0);o([n({type:Boolean,attribute:"activate-on-click",converter:m})],a.prototype,"activateOnClick",void 0);o([n({type:Boolean,attribute:"scroll-shadow",converter:m})],a.prototype,"scrollShadow",void 0);o([n({type:Boolean,reflect:!0})],a.prototype,"sticky",void 0);o([n({type:String,attribute:"sticky-top"})],a.prototype,"stickyTop",void 0);o([n({type:Number,attribute:"sticky-z-index"})],a.prototype,"stickyZIndex",void 0);o([n({type:String,attribute:"sticky-background"})],a.prototype,"stickyBackground",void 0);o([n({type:String,reflect:!0})],a.prototype,"spacing",void 0);o([n({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);o([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);o([n({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);o([n({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=o([k("scb-nav")],a);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h,m as d,p as l,v as u,y as p}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{h,m as d,p as l,v as u,y as p}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as m}from"../../vendor/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import"../scb-divider/scb-divider.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,e,s){try{customElements.get(t)||i(t,e,s)}catch(b){var n=String(b||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var c,o=(c=class extends h{constructor(...i){super(...i),this.label="",this.hasSubMenu=!1,this.openLeft=!1,this.divider=!1,this.leadingIcon="",this.trailingIcon="",this.itemHref="",this.href="",this._observedSubMenu=null,this._syncSubMenuFlags=()=>{const t=this.nextElementSibling,e=!!(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"),s=!!(e&&t.hasAttribute("open-left"));e!==this.hasSubMenu&&(this.hasSubMenu=e),s!==this.openLeft&&(this.openLeft=s);const n=e?t:null;n!==this._observedSubMenu&&(this._subMenuAttrObserver?.disconnect(),this._subMenuAttrObserver=void 0,this._observedSubMenu=n,n&&(this._subMenuAttrObserver=new MutationObserver(()=>this._syncSubMenuFlags()),this._subMenuAttrObserver.observe(n,{attributes:!0,attributeFilter:["open-left"]})))},this.handleClick=t=>{this._effectiveHref?this._navigateToHref(t):this._toggleSubMenu()},this._onBlur=t=>{const e=this.closest("scb-options-sub-menu");if(e&&e.open){const s=t.relatedTarget;(!s||!e.contains(s))&&(e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0})))}},this._onFocus=()=>{const t=this.nextElementSibling;this.classList.contains("open-submenu")&&(t&&t.tagName==="SCB-OPTIONS-SUB-MENU"&&t.hasAttribute("open")||this.classList.remove("open-submenu"))},this._onKeyDown=t=>{if(t.key==="Enter"||t.key===" "){t.preventDefault(),this.handleClick(t);return}if(t.key==="ArrowDown"){t.preventDefault();let e=this.nextElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.nextElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowUp"){t.preventDefault();let e=this.previousElementSibling;for(;e&&e.tagName!=="SCB-OPTIONS-MENU-ITEM";)e=e.previousElementSibling;e&&e.shadowRoot?.querySelector("li")?.focus();return}if(t.key==="ArrowRight"){t.preventDefault();const e=this.nextElementSibling;e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&(e.hasAttribute("open")||(this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("show-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("showsubmenu",{bubbles:!0,composed:!0}))),setTimeout(()=>{const s=e.querySelector("scb-options-menu-item");s&&s.shadowRoot?.querySelector("li")?.focus()},0));return}if(t.key==="ArrowLeft"){t.preventDefault();const e=this.nextElementSibling;if(e&&e.tagName==="SCB-OPTIONS-SUB-MENU"&&e.hasAttribute("open")){this._toggleSubMenu(),e.dispatchEvent(new CustomEvent("hide-submenu",{bubbles:!0,composed:!0})),e.dispatchEvent(new CustomEvent("hidesubmenu",{bubbles:!0,composed:!0}));return}const s=this.closest("scb-options-sub-menu");if(s){const n=s.previousElementSibling;n&&n.tagName==="SCB-OPTIONS-MENU-ITEM"&&n.shadowRoot?.querySelector("li")?.focus()}return}}}get _effectiveHref(){return this.itemHref||this.href}connectedCallback(){super.connectedCallback(),this._syncSubMenuFlags(),this._subMenuChildObserver??(this._subMenuChildObserver=new MutationObserver(()=>this._syncSubMenuFlags())),this._subMenuChildObserver.disconnect();const i=this.parentElement;i&&this._subMenuChildObserver.observe(i,{childList:!0})}disconnectedCallback(){this._subMenuChildObserver?.disconnect(),this._subMenuAttrObserver?.disconnect(),this._subMenuChildObserver=void 0,this._subMenuAttrObserver=void 0,this._observedSubMenu=null,super.disconnectedCallback()}render(){return u`
|
|
2
2
|
${this.divider?u`<scb-divider></scb-divider>`:""}
|
|
3
3
|
<li @click=${this.handleClick} @keydown=${this._onKeyDown} @blur=${this._onBlur} @focus=${this._onFocus} @focusin=${m} role="menuitem" tabindex="0">
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as b,h as f,m as u,p as l,v as r,y as m}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{f as b,h as f,m as u,p as l,v as r,y as m}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{n as c}from"../../vendor/lazy-focus-ring.js";import{t as o}from"../../vendor/decorate.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,i,h){try{customElements.get(s)||t(s,i,h)}catch(d){var p=String(d||"");if(p.indexOf("already been used")===-1&&p.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var n,e=(n=class extends f{constructor(...t){super(...t),this.width="100%",this.active=!1,this.disabled=!1,this.href="",this.label="",this.position="top",this._stepId=`scb-step-${Math.random().toString(36).slice(2)}`}updated(t){super.updated?.(t),this.style.setProperty("--progress-step-width",this.width)}_onClick(){const t={width:this.width,label:this.label,active:this.active,disabled:this.disabled,href:this.href||void 0};this.dispatchEvent(new CustomEvent("step-click",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("stepclick",{detail:t,bubbles:!0,composed:!0}))}firstUpdated(t){super.firstUpdated?.(t),this._setupTooltipPositioning()}_setupTooltipPositioning(){new MutationObserver(()=>this._adjustTooltipPosition()).observe(this,{attributes:!0,childList:!0,subtree:!0}),window.addEventListener("resize",()=>this._adjustTooltipPosition())}_adjustTooltipPosition(){const t=this.renderRoot.querySelector(".tooltip");if(!t)return;t.style.left="50%",t.style.right="",t.style.transform="translateX(-50%)",t.classList.remove("tooltip-left","tooltip-right");const s=t.getBoundingClientRect(),i=8;s.right>window.innerWidth-i&&(t.style.left="auto",t.style.right=`${i}px`,t.style.transform="none",t.classList.add("tooltip-right")),s.left<i&&(t.style.left=`${i}px`,t.style.right="auto",t.style.transform="none",t.classList.add("tooltip-left"))}render(){return r`
|
|
2
2
|
${this.href&&!this.disabled?r`
|
|
3
3
|
<a
|
|
4
4
|
id=${this._stepId}
|
|
@@ -27,4 +27,4 @@ import{f as b,h as f,m as u,p as l,v as r,y as m}from"../../vendor/vendor.js";im
|
|
|
27
27
|
`}
|
|
28
28
|
${this.disabled?"":r`<md-focus-ring for="${this._stepId}"></md-focus-ring>`}
|
|
29
29
|
${this.label&&!this.disabled?r`<div class="tooltip ${this.position==="bottom"?"bottom":"top"}">${this.label}</div>`:""}
|
|
30
|
-
`}},
|
|
30
|
+
`}},n.styles=m`:host{display:block;width:var(--progress-step-width, 100%);height:100%;cursor:pointer;background:0 0;position:relative}.progress-step{width:100%;height:100%;background:0 0;position:relative;overflow:hidden;border-right:2px solid var(--md-sys-color-surface);outline:0;box-shadow:none;display:block}:host(.last-step) .progress-step{border-right:none!important}.progress-step:focus{outline:0;box-shadow:none}:host([active]) .progress-step{border-right:2px solid var(--md-sys-color-surface)}:host([disabled]){cursor:not-allowed}:host([disabled]) .progress-step{background:#e6e6e699;border-right:2px solid #e6e6e699}md-focus-ring{pointer-events:none;position:absolute;inset:0;opacity:0;border-radius:0;transition:opacity .15s;z-index:4}.progress-step:focus+md-focus-ring,.progress-step:focus-visible+md-focus-ring{opacity:1}.tooltip{visibility:hidden;opacity:0;position:absolute;left:50%;transform:translateX(-50%);z-index:10;max-width:220px;width:max-content;background:var(--md-sys-color-inverse-surface);border-radius:var(--md-sys-shape-corner-extra-small);padding:var(--spacing-2) var(--spacing-3);color:var(--md-sys-color-inverse-on-surface);font-family:var(--brand-font);font-size:var(--md-sys-typescale-body-small-size);font-style:normal;line-height:var(--md-sys-typescale-body-small-line-height);letter-spacing:var(--md-sys-typescale-body-small-tracking);white-space:normal;pointer-events:none;transition:opacity .2s,visibility .2s;text-align:center}.tooltip.top{top:calc(100% + 10px)}.tooltip.bottom{bottom:calc(100% + 10px)}.progress-step:focus~.tooltip,.progress-step:hover~.tooltip{visibility:visible;opacity:1}.tooltip::after{content:"";position:absolute;left:50%;transform:translateX(-50%);width:0;height:0;pointer-events:none;display:block}.tooltip.bottom::after,.tooltip.top::after{border-left:8px solid transparent;border-right:8px solid transparent}.tooltip.top::after{top:-6px;border-bottom:8px solid var(--md-sys-color-inverse-surface);border-top:none}.tooltip.bottom::after{bottom:-6px;border-top:8px solid var(--md-sys-color-inverse-surface);border-bottom:none}.tooltip.tooltip-left::after{left:2px;transform:none}.tooltip.tooltip-right::after{right:2px;left:auto;transform:none}`,n);o([l({type:String})],e.prototype,"width",void 0);o([l({type:Boolean,reflect:!0})],e.prototype,"active",void 0);o([l({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0);o([l({type:String,reflect:!0})],e.prototype,"href",void 0);o([l({type:String})],e.prototype,"label",void 0);o([l({type:String})],e.prototype,"position",void 0);o([b()],e.prototype,"_stepId",void 0);e=o([u("scb-progress-step")],e);export{e as ScbProgressStep};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/decorate.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../scb-list/scb-list-item.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f as x,g as v,h as S,m as w,p as o,v as h,y as A}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as k}from"../../vendor/preload-helper.js";import{
|
|
2
|
+
import{f as x,g as v,h as S,m as w,p as o,v as h,y as A}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as k}from"../../vendor/preload-helper.js";import{r as E}from"../../vendor/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.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,r){try{customElements.get(e)||t(e,s,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,I=0,n=(d=class extends S{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=k(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const t=(this.value??"").trim().length>0;!this._inputFocused||!t||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size="large",this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++I}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",this._kbShouldShowRing=!1,this._onGlobalKeydown=t=>{t.key==="Tab"&&(E(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._listScrollHandler=()=>{const t=this._getActiveItem();this._kbMode&&t&&this._positionOptionRing(t)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0),this._initialValue=this.value??"",this._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=t=>{this.reportValidity()||(t.preventDefault(),t.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const t=this._inputEl();t&&(t.value=this._initialValue),this._lastChangeValue=this._initialValue,this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y()},this._form.addEventListener("reset",this._formResetHandler,!0)),this._syncFormValue(),this._syncValidity()}disconnectedCallback(){const t=this._inputEl();t&&this._boundNativeKeydown&&t.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const t=this._inputEl();t&&(this._boundNativeKeydown=e=>this._handleKey(e),t.addEventListener("keydown",this._boundNativeKeydown,!0),t.disabled=this.disabled),this.applySpacing()}updated(t){if(super.updated(t),t.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),(t.has("value")||t.has("disabled"))&&this._syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required"))&&this._syncValidity(),t.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const e=this._inputEl();e&&(e.disabled=this.disabled)}(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}render(){const t=(this.value??"").trim().length>0,e=this._inputFocused&&t&&this._hasSuggestions&&this._listDepsLoaded;return h`
|
|
3
3
|
<div class="ripple-wrapper">
|
|
4
4
|
<md-icon class="leading">${t?"arrow_back":"search"}</md-icon>
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as m,m as p,p as n,v as s,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{h as m,m as p,p as n,v as s,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as h}from"../../vendor/lazy-focus-ring.js";import{t as o}from"../../vendor/decorate.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,c){try{customElements.get(t)||e(t,i,c)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var u,r=(u=class extends m{constructor(...e){super(...e),this.label="",this.value="",this.selected=!1,this.icon="",this.href="",this.disabled=!1,this.onHostKeydown=t=>{if(!this.href||this.isEffectivelyDisabled||t.code!=="Space"&&t.code!=="Enter"&&t.code!=="NumpadEnter")return;const i=this.shadowRoot?.querySelector("a[href]");i&&(t.preventDefault(),t.stopPropagation(),i.click())}}get isEffectivelyDisabled(){const e=this.parentElement?.hasAttribute?.("disabled");return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1?!0:e.nodeType===3?(e.textContent??"").trim()!=="":!1)}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",h)}render(){const e=this.isEffectivelyDisabled,t=!!this.icon,i=!!this.label||this.hasDefaultSlotContent,c=this.label?s`${this.label}`:s`<slot></slot>`,a=`segmented-item${t||this.selected?" has-icon":""}${i?"":" no-label"}`,d=s`
|
|
2
2
|
<md-ripple ?disabled="${e}"></md-ripple>
|
|
3
3
|
${this.selected?t&&i?s`<md-icon>check</md-icon>`:t?s`<md-icon>check</md-icon><md-icon>${this.icon}</md-icon>`:s`<md-icon>check</md-icon>`:t?s`<md-icon>${this.icon}</md-icon>`:""}
|
|
4
4
|
${i?s`<span>${c}</span>`:""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as b,m,p as o,v as i,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{h as b,m,p as o,v as i,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as d}from"../../vendor/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var s=typeof globalThis<"u"?globalThis:window;if(!s.__scb_ce_guard_installed__){s.__scb_ce_guard_installed__=!0;var c=customElements.define.bind(customElements);customElements.define=function(a,h,p){try{customElements.get(a)||c(a,h,p)}catch(r){var l=String(r||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var n,e=(n=class extends b{constructor(...c){super(...c),this.value="",this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label="",this.noHighlightSelected=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",d)}disconnectedCallback(){this.removeEventListener("focusin",d),super.disconnectedCallback()}render(){return i`
|
|
2
2
|
<div class="item ${this.checked?"checked":""}" ?aria-disabled=${this.disabled}>
|
|
3
3
|
<md-ripple></md-ripple>
|
|
4
4
|
${this.showCheckbox?i`<md-icon class="${this.checked?"checkbox-checked":""}" aria-hidden="true">${this.checked?"check_box":"check_box_outline_blank"}</md-icon>`:null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as p,h as u,m as b,p as l,v as d,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{
|
|
1
|
+
import{a as p,h as u,m as b,p as l,v as d,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{n as m}from"../../vendor/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";import"./scb-select-option.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,s,o){try{customElements.get(t)||e(t,s,o)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var c,i=(c=class extends u{constructor(){super(),this._optionsObserver=null,this._internals=null,this.focusedIndex=-1,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.required=!1,this.open=!1,this.label="",this.name="",this.placeholder="",this.supportingText="",this.withRadiobuttons=!1,this.noHighlightSelected=!1,this.size="large",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.zIndex=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._initialValues=[],this._customValidationMessage="",this._onDocumentClick=e=>{this.open&&(e.composedPath().includes(this)||this._setOpen(!1))},this._onSlotClick=e=>{const t=this.shadowRoot?.querySelector("slot");if(!t)return;const s=t.assignedElements({flatten:!0}).filter(r=>r.tagName.toLowerCase()==="scb-select-option"),o=e.composedPath(),n=s.find(r=>o.includes(r));n&&(this._selectOption(n),e.stopPropagation())},this._onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._toggleOpen())},this._onOptionKeyDown=e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault();const t=this.shadowRoot?.querySelector("slot");if(!t)return;const s=t.assignedElements({flatten:!0}).filter(r=>r.tagName.toLowerCase()==="scb-select-option"),o=e.composedPath(),n=s.find(r=>o.includes(r));n&&this._selectOption(n)}},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="extra-small"?this.setAttribute("data-density","-5"):this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentClick),this._optionsObserver=new MutationObserver(()=>{this.requestUpdate()}),this._optionsObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","value","disabled"]}),this._syncDensityForSize(),this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this._syncFormValue(),this._syncValidity(),this.requestUpdate()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0))}disconnectedCallback(){document.removeEventListener("mousedown",this._onDocumentClick),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._optionsObserver?.disconnect(),this._optionsObserver=null,super.disconnectedCallback()}_getMultiValues(){return Array.isArray(this.values)&&this.values.length>0?this.values:this.value?this.value.split(",").map(e=>e.trim()).filter(Boolean):[]}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,s=this._mapSpacingToken(this.spacingBottom)??e,o=this._mapSpacingToken(this.spacingLeft),n=this._mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-select-spacing-block-start",t):this.style.removeProperty("--scb-select-spacing-block-start"),s?this.style.setProperty("--scb-select-spacing-block-end",s):this.style.removeProperty("--scb-select-spacing-block-end"),o?this.style.setProperty("--scb-select-spacing-inline-start",o):this.style.removeProperty("--scb-select-spacing-inline-start"),n?this.style.setProperty("--scb-select-spacing-inline-end",n):this.style.removeProperty("--scb-select-spacing-inline-end")}_setOpen(e){this.open!==e&&(this.open=e,e?(this.focusedIndex=0,this.requestUpdate()):this.focusedIndex=-1)}_toggleOpen(){this.disabled||this._setOpen(!this.open)}_hasMoreThanFourOptions(){const e=this.shadowRoot?.querySelector("slot");if(!e)return!1;const t=e.assignedElements({flatten:!0}).filter(s=>s.tagName.toLowerCase()==="scb-select-option");return["extra-small","small","medium"].includes(this.size)?t.length>5:t.length>4}_selectOption(e){if(!e.disabled){if(this.variant==="multi-select"){const t=this._getMultiValues();t.indexOf(e.value)>-1?this.values=t.filter(s=>s!==e.value):this.values=[...t,e.value],this.value=this.values.join(","),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0}))}else this.variant==="single-select"&&this.withRadiobuttons?(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))):(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})));this._updateOptionsChecked(),this.requestUpdate()}}_getOptionLabel(e){return e.label||e.textContent?.trim()||""}_getSelectedLabel(){const e=this.shadowRoot?.querySelector("slot");if(!e)return"";const t=e.assignedElements({flatten:!0}).filter(s=>s.tagName.toLowerCase()==="scb-select-option");if(this.variant==="multi-select"){const s=this._getMultiValues(),o=t.filter(n=>s.includes(n.value));return o&&o.length>0?o.map(n=>this._getOptionLabel(n)).join(", "):""}else{const s=t.find(o=>o.value===this.value);return s?this._getOptionLabel(s):""}}firstUpdated(){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity(),this._applySpacing()}updated(e){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity(),e.has("size")&&this._syncDensityForSize(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this._applySpacing()}_syncFormValue(){if(this._internals){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant==="multi-select"){const e=this._getMultiValues();if(e.length===0){this._internals.setFormValue(null);return}const t=new FormData;e.forEach(s=>t.append(this.name,s)),this._internals.setFormValue(t);return}this._internals.setFormValue(this.value||null)}}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.variant==="multi-select"?this._getMultiValues().length>0:this.value)?"Välj ett alternativ.":""}_syncValidity(){if(!this._internals)return;const e=this.disabled?"":this._getValidationMessage(),t=this.shadowRoot?.querySelector(".selected-value");if(!e){this._internals.setValidity({}),this.removeAttribute("aria-invalid"),t&&t.setCustomValidity("");return}t&&t.setCustomValidity(e),this._internals.setValidity({valueMissing:!0},e,t??void 0),this.setAttribute("aria-invalid","true")}checkValidity(){return!this._getValidationMessage()}reportValidity(){return this._syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=e,this._syncValidity()}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}_updateOptionsChecked(){const e=this.shadowRoot?.querySelector("slot");e&&e.assignedElements({flatten:!0}).filter(t=>t.tagName.toLowerCase()==="scb-select-option").forEach(t=>{if(this.noHighlightSelected?t.setAttribute("no-highlight-selected",""):t.removeAttribute("no-highlight-selected"),this.variant==="multi-select"){const s=this._getMultiValues();t.showCheckbox=!0,t.checked=s.includes(t.value),t.showRadio=!1}else t.showCheckbox=!1,t.checked=this.value===t.value,this.withRadiobuttons&&(t.showRadio=!0)})}render(){return d`
|
|
2
2
|
${this.label?d`
|
|
3
3
|
<label
|
|
4
4
|
class="select-label ${this.supportingText?"":"select-label--without-supporting"}"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as p,m as h,p as a,v as s,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{
|
|
1
|
+
import{h as p,m as h,p as a,v as s,y as u}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n}from"../../vendor/lazy-focus-ring.js";import{t as i}from"../../vendor/decorate.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(l,m,b){try{customElements.get(l)||e(l,m,b)}catch(d){var c=String(d||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var r,t=(r=class extends p{constructor(...e){super(...e),this.label="",this.subLabel="",this.symbolVariant="number",this.number=0,this.active=!1,this.completed=!1,this.changeOnCompleted=!1,this.islast=!1,this.variant="horizontal",this.widthWeight=1,this.icon=""}updated(){!this.subLabel||this.subLabel.trim()===""?this.setAttribute("no-content",""):this.removeAttribute("no-content"),this.widthWeight>0?this.style.setProperty("--scb-step-width-weight",String(this.widthWeight)):this.style.removeProperty("--scb-step-width-weight")}handleKeyDown(e){e.key==="Enter"||e.key===" "?(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))):(e.key==="ArrowRight"||e.key==="ArrowLeft")&&(this.dispatchEvent(new CustomEvent("scb-stepper-keynav",{detail:{key:e.key},bubbles:!0,composed:!0})),e.preventDefault())}render(){const e=this.active?"step":void 0,l=this.label?`${this.label}${this.subLabel?": "+this.subLabel:""}`:void 0;switch(this.symbolVariant){case"icon":return s`
|
|
2
2
|
<div
|
|
3
3
|
class="scb-step-content"
|
|
4
4
|
tabindex="0"
|