scb-wc-test 0.1.154 → 0.1.156
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/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
- package/mvc/components/scb-calendar/scb-calendar.js +1 -1
- package/mvc/components/scb-card/scb-card.js +4 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +1 -1
- package/mvc/components/scb-dialog/scb-dialog.js +1 -1
- package/mvc/components/scb-drawer/scb-drawer-item.js +2 -2
- package/mvc/components/scb-drawer/scb-drawer.js +3 -4
- package/mvc/components/scb-dropdown/scb-dropdown.js +76 -38
- package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
- package/mvc/components/scb-header/scb-header-tab.js +2 -2
- package/mvc/components/scb-header/scb-header.js +162 -60
- package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +1 -1
- package/mvc/components/scb-icon-button/scb-icon-button.js +7 -3
- package/mvc/components/scb-link/scb-link.js +1 -1
- package/mvc/components/scb-notification-card/scb-notification-card.js +2 -2
- package/mvc/components/scb-pagination/scb-pagination.js +1 -1
- package/mvc/components/scb-snackbar/scb-snackbar.js +2 -2
- package/mvc/components/scb-textfield/scb-textfield.js +1 -1
- package/mvc/components/scb-tooltip/scb-tooltip.js +6 -6
- package/mvc/components/scb-viz/scb-viz.js +1 -1
- package/mvc/vendor/vendor.js +23 -19
- package/package.json +2 -2
- package/scb-card/scb-card.js +3 -0
- package/scb-drawer/scb-drawer.js +19 -20
- package/scb-dropdown/scb-dropdown.d.ts +5 -0
- package/scb-dropdown/scb-dropdown.js +166 -90
- package/scb-header/scb-header-tab.d.ts +1 -1
- package/scb-header/scb-header-tab.js +20 -20
- package/scb-header/scb-header.d.ts +11 -3
- package/scb-header/scb-header.js +428 -246
- package/scb-icon-button/scb-icon-button.js +25 -18
- package/scb-tooltip/scb-tooltip.js +22 -21
- package/scb-wc-test.bundle.js +737 -587
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,t,i){try{customElements.get(a)||s(a,t,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,s,a,t)=>{for(var i=t>1?void 0:t?f(s,a):s,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(t?o(s,a,i):o(i))||i);return t&&i&&g(s,a,i),i};let l=class extends c{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(t=>{t.tagName==="SCB-AVATAR"&&t.setAttribute("size","small")})}updated(e){e.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),e.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),e.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),e.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0}))}render(){switch(this.type){case"small-flexible":return r`
|
|
1
|
+
import{a as h,n as d,i as c,x as r,t as m}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-avatar/scb-avatar.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-list/scb-list-item.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,t,i){try{customElements.get(a)||s(a,t,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p=(e,s,a,t)=>{for(var i=t>1?void 0:t?f(s,a):s,n=e.length-1,o;n>=0;n--)(o=e[n])&&(i=(t?o(s,a,i):o(i))||i);return t&&i&&g(s,a,i),i};let l=class extends c{constructor(){super(...arguments),this.title="",this.type="default",this.position="default",this.searchSupportingText=""}handleAvatarSlotChange(e){e.target.assignedElements({flatten:!0}).forEach(t=>{t.tagName==="SCB-AVATAR"&&t.setAttribute("size","small")})}updated(e){e.has("title")&&this.dispatchEvent(new CustomEvent("title-changed",{detail:{title:this.title},bubbles:!0,composed:!0})),e.has("position")&&this.dispatchEvent(new CustomEvent("position-changed",{detail:{position:this.position},bubbles:!0,composed:!0})),e.has("type")&&this.dispatchEvent(new CustomEvent("type-changed",{detail:{type:this.type},bubbles:!0,composed:!0})),e.has("searchSupportingText")&&this.dispatchEvent(new CustomEvent("search-supporting-text-changed",{detail:{searchSupportingText:this.searchSupportingText},bubbles:!0,composed:!0}))}render(){switch(this.type){case"small-flexible":return r`
|
|
2
2
|
<header class="small-flexible ${this.position=="bottom"?"position-bottom":this.position=="top"?"position-top":""}" role="banner" aria-label="Small app bar">
|
|
3
3
|
<div class="leading">
|
|
4
4
|
<slot name="leading"></slot>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as j,n as $,i as q,x as v,t as P}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-button/scb-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-radio-button/scb-radio-group.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,d){try{customElements.get(s)||e(s,r,d)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var H=Object.defineProperty,L=Object.getOwnPropertyDescriptor,k=(t,e,s,r)=>{for(var d=r>1?void 0:r?L(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(d=(r?c(e,s,d):c(d))||d);return r&&d&&H(e,s,d),d};let D=class extends q{constructor(){super(...arguments),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),r=this.shadowRoot?.activeElement,d=r&&s.includes(r)?r:document.activeElement,a=s.indexOf(d);if(a===-1)return;let c=a;const p=this.disableWeekend?5:7;switch(t.key){case"ArrowRight":c=a+1<s.length?a+1:a;break;case"ArrowLeft":c=a-1>=0?a-1:a;break;case"ArrowDown":c=a+p<s.length?a+p:a;break;case"ArrowUp":c=a-p>=0?a-p:a;break;default:return}c!==a&&(t.preventDefault(),s[c].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback();const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}updated(t){if(super.updated?.(t),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const r=this._current.getFullYear(),d=this._current.getMonth()+1;(r!==e||d!==s)&&(this._current=new Date(e,s-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}})),this.requestUpdate())}}}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:t.date}})),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._restoreDayFocus,{once:!0}));const s=r=>{r.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",s,{once:!0})})}_closePopup(){const t=this.shadowRoot?.querySelector("scb-dialog");t&&t.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,r=e%4,d=e%7,a=(19*s+24)%30,c=(2*r+4*d+6*a+5)%7;let p=22+a+c,T=0;p==57&&(p-=7),p==56&&a==28&&c==6&&s>10&&(p-=7),p>31?(p-=31,T=4):T=3;const _=new Date(e,T-1,p);return this._easterDateCalculated["Ar"+t]=_,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,r=t.getDate(),d=t.getFullYear(),a=this._easterDay(d),c=this.lang==="en",p=[["Nyårsdagen","New Year's Day",s===1&&r===1],["Trettondedag jul","Epiphany",s===1&&r===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&d<2005],["Första maj","May Day",s===5&&r===1],["Nationaldagen","National Day",s===6&&r===6&&d>=2005],["Midsommarafton","Midsummer's Eve",s===6&&r>=19&&r<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&r>=20&&r<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&r===24],["Juldagen","Christmas Day",s===12&&r===25],["Annandag jul","Boxing Day",s===12&&r===26],["Alla helgons dag","All Saints' Day",s===10&&r>=31&&t.getDay()===6||s===11&&r<=6&&t.getDay()===6]];for(const T of p){const[_,N,A]=T;if(A)return c?N:_}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),r=this._firstDayOfWeek(t,e),d=this._today,a=this.lang==="en",c=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let p=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(p=p.slice(0,5));const T=Array.from(this.querySelectorAll("scb-calendar-event")),_=new Map;for(const n of T){const l=n.getAttribute("start-date")||"",y=n.getAttribute("end-date")||"";if(l&&y){const o=new Date(l),m=new Date(y);for(let u=new Date(o);u<=m;u.setDate(u.getDate()+1)){const f=u.toISOString().split("T")[0],x=_.get(f)||[];x.push({title:n.title,description:n.description,start:l,end:y}),_.set(f,x)}}else if(l&&n.title){const o=l.split("T")[0],m=_.get(o)||[];m.push({title:n.title,description:n.description,start:l}),_.set(o,m)}}const N=[];let A=1;for(let n=0;n<6;n++){const l=[],y=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let o=A;for(let m=0;m<y.length;m++){const u=y[m];if(n===0&&u<r){if(!this.disableWeekend||u<5){const f=e===0?11:e-1,x=e===0?t-1:t,S=this._daysInMonth(x,f)-(r-u-1);l.push(v`
|
|
1
|
+
import{a as j,n as $,i as q,x as v,t as P}from"../../vendor/vendor.js";import"./scb-calendar-event.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-radio-button/scb-radio-group.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../scb-list/scb-list-item.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,d){try{customElements.get(s)||e(s,r,d)}catch(c){var a=String(c||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var H=Object.defineProperty,L=Object.getOwnPropertyDescriptor,k=(t,e,s,r)=>{for(var d=r>1?void 0:r?L(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(d=(r?c(e,s,d):c(d))||d);return r&&d&&H(e,s,d),d};let D=class extends q{constructor(){super(...arguments),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const s=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day.has-event")??[]),r=this.shadowRoot?.activeElement,d=r&&s.includes(r)?r:document.activeElement,a=s.indexOf(d);if(a===-1)return;let c=a;const p=this.disableWeekend?5:7;switch(t.key){case"ArrowRight":c=a+1<s.length?a+1:a;break;case"ArrowLeft":c=a-1>=0?a-1:a;break;case"ArrowDown":c=a+p<s.length?a+p:a;break;case"ArrowUp":c=a-p>=0?a-p:a;break;default:return}c!==a&&(t.preventDefault(),s[c].focus())},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._popupEvent=null,this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}connectedCallback(){super.connectedCallback();const t=Number(this.displayYear),e=Number(this.displayMonth);!Number.isNaN(t)&&!Number.isNaN(e)&&e>=1&&e<=12&&(this._current=new Date(t,e-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}updated(t){if(super.updated?.(t),!this._syncingDisplay&&(t.has("displayYear")||t.has("displayMonth"))){const e=Number(this.displayYear),s=Number(this.displayMonth);if(!Number.isNaN(e)&&!Number.isNaN(s)&&s>=1&&s<=12){const r=this._current.getFullYear(),d=this._current.getMonth()+1;(r!==e||d!==s)&&(this._current=new Date(e,s-1,1),this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}})),this.requestUpdate())}}}_syncDisplayFromCurrent(t=!0){const e=this._current.getFullYear(),s=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=e,this.displayMonth=s}finally{this._syncingDisplay=!1}t&&this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:{displayYear:e,displayMonth:s}}))}_daysInMonth(t,e){return new Date(t,e+1,0).getDate()}_firstDayOfWeek(t,e){const s=new Date(t,e,1).getDay();return s===0?6:s-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(t){this._popupEvent=t,this.selectedDate=t.date,this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:{selectedDate:t.date}})),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const e=this.shadowRoot?.querySelector("scb-dialog");e&&(document.activeElement&&(e.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.open=!0})}),e.addEventListener("close",this._restoreDayFocus,{once:!0}));const s=r=>{r.target?.closest(".event-popup")||this._closePopup()};window.addEventListener("mousedown",s,{once:!0})})}_closePopup(){const t=this.shadowRoot?.querySelector("scb-dialog");t&&t.removeAttribute("open"),this._popupEvent=null,this.requestUpdate()}_addDays(t,e){const s=new Date(t.valueOf());return s.setDate(s.getDate()+e),s}_easterDay(t){if(typeof this._easterDateCalculated["Ar"+t]<"u")return new Date(this._easterDateCalculated["Ar"+t]);let e=t;e<100&&(e=e+1900),e<1950&&(e=e+100);const s=e%19,r=e%4,d=e%7,a=(19*s+24)%30,c=(2*r+4*d+6*a+5)%7;let p=22+a+c,T=0;p==57&&(p-=7),p==56&&a==28&&c==6&&s>10&&(p-=7),p>31?(p-=31,T=4):T=3;const _=new Date(e,T-1,p);return this._easterDateCalculated["Ar"+t]=_,new Date(this._easterDateCalculated["Ar"+t])}_swedishHolidayName(t){const e=t.getMonth();if(e===1||e===6||e===7||e===8)return null;const s=t.getMonth()+1,r=t.getDate(),d=t.getFullYear(),a=this._easterDay(d),c=this.lang==="en",p=[["Nyårsdagen","New Year's Day",s===1&&r===1],["Trettondedag jul","Epiphany",s===1&&r===6],["Långfredag","Good Friday",+t==+this._addDays(a,-2)],["Påskdagen","Easter Sunday",+t==+a],["Annandag påsk","Easter Monday",+t==+this._addDays(a,1)],["Kristi himmelsfärdsdag","Ascension Day",+t==+this._addDays(a,39)],["Pingstdagen","Pentecost",+t==+this._addDays(a,50)&&d<2005],["Första maj","May Day",s===5&&r===1],["Nationaldagen","National Day",s===6&&r===6&&d>=2005],["Midsommarafton","Midsummer's Eve",s===6&&r>=19&&r<=25&&t.getDay()===5],["Midsommardagen","Midsummer's Day",s===6&&r>=20&&r<=26&&t.getDay()===6],["Julafton","Christmas Eve",s===12&&r===24],["Juldagen","Christmas Day",s===12&&r===25],["Annandag jul","Boxing Day",s===12&&r===26],["Alla helgons dag","All Saints' Day",s===10&&r>=31&&t.getDay()===6||s===11&&r<=6&&t.getDay()===6]];for(const T of p){const[_,N,A]=T;if(A)return c?N:_}return null}render(){const t=this._current.getFullYear(),e=this._current.getMonth(),s=this._daysInMonth(t,e),r=this._firstDayOfWeek(t,e),d=this._today,a=this.lang==="en",c=a?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let p=a?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(p=p.slice(0,5));const T=Array.from(this.querySelectorAll("scb-calendar-event")),_=new Map;for(const n of T){const l=n.getAttribute("start-date")||"",y=n.getAttribute("end-date")||"";if(l&&y){const o=new Date(l),m=new Date(y);for(let u=new Date(o);u<=m;u.setDate(u.getDate()+1)){const f=u.toISOString().split("T")[0],x=_.get(f)||[];x.push({title:n.title,description:n.description,start:l,end:y}),_.set(f,x)}}else if(l&&n.title){const o=l.split("T")[0],m=_.get(o)||[];m.push({title:n.title,description:n.description,start:l}),_.set(o,m)}}const N=[];let A=1;for(let n=0;n<6;n++){const l=[],y=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let o=A;for(let m=0;m<y.length;m++){const u=y[m];if(n===0&&u<r){if(!this.disableWeekend||u<5){const f=e===0?11:e-1,x=e===0?t-1:t,S=this._daysInMonth(x,f)-(r-u-1);l.push(v`
|
|
2
2
|
<div class="calendar-day calendar-day--other">
|
|
3
3
|
<span class="calendar-day-number">${S}</span>
|
|
4
4
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x as s,t as _}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-list/scb-list-item.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(o,n,c){try{customElements.get(o)||t(o,n,c)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var z=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=i=>{throw TypeError(i)},a=(i,t,o,n)=>{for(var c=n>1?void 0:n?w(t,o):t,d=i.length-1,l;d>=0;d--)(l=i[d])&&(c=(n?l(t,o,c):l(c))||c);return n&&c&&z(t,o,c),c},S=(i,t,o)=>t.has(i)||x("Cannot "+o),T=(i,t,o)=>t.has(i)?x("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,o),y=(i,t,o)=>(S(i,t,"access private method"),o),b,g;let e=class extends k{constructor(){super(...arguments),T(this,b),this.type="",this.variant="",this.direction="",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.comments=0,this.commentsHref="",this.likesText="",this.likes=0,this.hasLiked=!1,this.likesInteractive=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.__onImgLoad=i=>{const t=i.currentTarget.closest(".media");t&&t.classList.add("is-loaded")},this.__onKeyDown=i=>{(i.key==="Enter"||i.key===" ")&&this.cardHref&&(i.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=i=>{this.cardHref&&(i.target.closest("a")||window.open(this.cardHref,"_self"))}}__calcAspectWH(i){const t=(i||"").trim();if(!t)return{w:640,h:360};const o=t.includes("/")?t.split("/"):t.includes(":")?t.split(":"):t.includes("x")?t.split("x"):null;if(o&&o.length===2){const c=Number(o[0]),d=Number(o[1]);if(c>0&&d>0)return{w:c,h:d}}const n=Number(t);return isFinite(n)&&n>0?{w:1e3,h:Math.round(1e3/n)}:{w:640,h:360}}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return s`
|
|
2
|
+
import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x as s,t as _}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-list/scb-list.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"../scb-avatar/scb-avatar.js";import"../scb-list/scb-list-item.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var i=typeof globalThis<"u"?globalThis:window;if(!i.__scb_ce_guard_installed__){i.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(o,n,c){try{customElements.get(o)||t(o,n,c)}catch(l){var d=String(l||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var z=Object.defineProperty,w=Object.getOwnPropertyDescriptor,x=i=>{throw TypeError(i)},a=(i,t,o,n)=>{for(var c=n>1?void 0:n?w(t,o):t,d=i.length-1,l;d>=0;d--)(l=i[d])&&(c=(n?l(t,o,c):l(c))||c);return n&&c&&z(t,o,c),c},S=(i,t,o)=>t.has(i)||x("Cannot "+o),T=(i,t,o)=>t.has(i)?x("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,o),y=(i,t,o)=>(S(i,t,"access private method"),o),b,g;let e=class extends k{constructor(){super(...arguments),T(this,b),this.type="",this.variant="",this.direction="",this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.title="",this.subtitle="",this.supportingText="",this.commentsText="",this.comments=0,this.commentsHref="",this.likesText="",this.likes=0,this.hasLiked=!1,this.likesInteractive=!1,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing="",this.spacingTop="",this.spacingBottom="",this.__onImgLoad=i=>{const t=i.currentTarget.closest(".media");t&&t.classList.add("is-loaded")},this.__onKeyDown=i=>{(i.key==="Enter"||i.key===" ")&&this.cardHref&&(i.preventDefault(),window.open(this.cardHref,"_self"))},this.__handleHrefNavigation=i=>{this.cardHref&&(i.target.closest("a")||window.open(this.cardHref,"_self"))}}__calcAspectWH(i){const t=(i||"").trim();if(!t)return{w:640,h:360};const o=t.includes("/")?t.split("/"):t.includes(":")?t.split(":"):t.includes("x")?t.split("x"):null;if(o&&o.length===2){const c=Number(o[0]),d=Number(o[1]);if(c>0&&d>0)return{w:c,h:d}}const n=Number(t);return isFinite(n)&&n>0?{w:1e3,h:Math.round(1e3/n)}:{w:640,h:360}}__mediaTemplate(){if((this.mediaType||"").toLowerCase()==="avatar")return s`
|
|
3
3
|
<div class="media">
|
|
4
4
|
<slot name="media">
|
|
5
5
|
<scb-avatar variant="icon" label="${this.title}" icon-name="person"></scb-avatar>
|
|
@@ -147,6 +147,9 @@ import{_ as f}from"../../vendor/preload-helper.js";import{a as $,n as r,i as k,x
|
|
|
147
147
|
margin-block-start: var(--scb-card-spacing-block-start, 0);
|
|
148
148
|
margin-block-end: var(--scb-card-spacing-block-end, 0);
|
|
149
149
|
}
|
|
150
|
+
:host:not(:defined){
|
|
151
|
+
min-height: 190px;
|
|
152
|
+
}
|
|
150
153
|
.scb-card.no-hover,
|
|
151
154
|
.scb-card.no-hover:hover,
|
|
152
155
|
.scb-card.no-hover:active {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m,r as p,n as u,i as w,x as d,t as _}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../scb-divider/scb-divider.js";import"../../vendor/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 t=customElements.define.bind(customElements);customElements.define=function(s,a,n){try{customElements.get(s)||t(s,a,n)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,h=(e,t,s,a)=>{for(var n=a>1?void 0:a?b(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(a?o(t,s,n):o(n))||n);return a&&n&&v(t,s,n),n};let c=class extends w{constructor(){super(...arguments),this._currentDate=new Date,this._selectedDate=null,this._showMonthDropdown=!1,this._showYearDropdown=!1,this.variant="date",this.lang="sv",this.selectedValue="",this.open=!0,this._selectedHour=0,this._selectedMinute=0,this._monthNames=[this.lang=="sv"?"Januari":"January",this.lang=="sv"?"Februari":"February",this.lang=="sv"?"Mars":"March",(this.lang=="sv","April"),this.lang=="sv"?"Maj":"May",this.lang=="sv"?"Juni":"June",this.lang=="sv"?"Juli":"July",this.lang=="sv"?"Augusti":"August",(this.lang=="sv","September"),this.lang=="sv"?"Oktober":"October",(this.lang=="sv","November"),(this.lang=="sv","December")],this._outsideClickHandler=e=>{this.open&&(e.composedPath().includes(this)||this._close())},this._prevMonth=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===0?this._currentDate=new Date(e-1,11,1):this._currentDate=new Date(e,t-1,1)},this._prevYear=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e-1,t,1)},this._nextMonth=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===11?this._currentDate=new Date(e+1,0,1):this._currentDate=new Date(e,t+1,1)},this._nextYear=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e+1,t,1)},this._onTimeChange=e=>{const t=e.target.value,[s,a]=t.split(":"),n=parseInt(s,10),r=parseInt(a,10);this._selectedHour=isNaN(n)?0:Math.max(0,Math.min(23,n)),this._selectedMinute=isNaN(r)?0:Math.max(0,Math.min(59,r)),this._fireDateTimeChange()},this._close=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("datepicker-closed",{bubbles:!0,composed:!0}))}}updated(e){if(super.updated(e),this.open?window.addEventListener("mousedown",this._outsideClickHandler):window.removeEventListener("mousedown",this._outsideClickHandler),e.has("selectedValue")&&this.selectedValue){const t=new Date(this.selectedValue);isNaN(t.getTime())||(this._selectedDate=t,this._currentDate=new Date(t.getFullYear(),t.getMonth(),1),this.variant==="datetime-local"&&(this._selectedHour=t.getHours(),this._selectedMinute=t.getMinutes()))}}render(){if(!this.open)return d``;const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth(),s=new Date,a=this._getMonthDays(e,t),n=Array.from({length:101},(o,i)=>s.getFullYear()-50+i),r=this.variant==="datetime-local"&&!this._showMonthDropdown&&!this._showYearDropdown;return d`
|
|
1
|
+
import{a as m,r as p,n as u,i as w,x as d,t as _}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";import"../scb-divider/scb-divider.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,a,n){try{customElements.get(s)||t(s,a,n)}catch(o){var r=String(o||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var v=Object.defineProperty,b=Object.getOwnPropertyDescriptor,h=(e,t,s,a)=>{for(var n=a>1?void 0:a?b(t,s):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(a?o(t,s,n):o(n))||n);return a&&n&&v(t,s,n),n};let c=class extends w{constructor(){super(...arguments),this._currentDate=new Date,this._selectedDate=null,this._showMonthDropdown=!1,this._showYearDropdown=!1,this.variant="date",this.lang="sv",this.selectedValue="",this.open=!0,this._selectedHour=0,this._selectedMinute=0,this._monthNames=[this.lang=="sv"?"Januari":"January",this.lang=="sv"?"Februari":"February",this.lang=="sv"?"Mars":"March",(this.lang=="sv","April"),this.lang=="sv"?"Maj":"May",this.lang=="sv"?"Juni":"June",this.lang=="sv"?"Juli":"July",this.lang=="sv"?"Augusti":"August",(this.lang=="sv","September"),this.lang=="sv"?"Oktober":"October",(this.lang=="sv","November"),(this.lang=="sv","December")],this._outsideClickHandler=e=>{this.open&&(e.composedPath().includes(this)||this._close())},this._prevMonth=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===0?this._currentDate=new Date(e-1,11,1):this._currentDate=new Date(e,t-1,1)},this._prevYear=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e-1,t,1)},this._nextMonth=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();t===11?this._currentDate=new Date(e+1,0,1):this._currentDate=new Date(e,t+1,1)},this._nextYear=()=>{const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth();this._currentDate=new Date(e+1,t,1)},this._onTimeChange=e=>{const t=e.target.value,[s,a]=t.split(":"),n=parseInt(s,10),r=parseInt(a,10);this._selectedHour=isNaN(n)?0:Math.max(0,Math.min(23,n)),this._selectedMinute=isNaN(r)?0:Math.max(0,Math.min(59,r)),this._fireDateTimeChange()},this._close=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("datepicker-closed",{bubbles:!0,composed:!0}))}}updated(e){if(super.updated(e),this.open?window.addEventListener("mousedown",this._outsideClickHandler):window.removeEventListener("mousedown",this._outsideClickHandler),e.has("selectedValue")&&this.selectedValue){const t=new Date(this.selectedValue);isNaN(t.getTime())||(this._selectedDate=t,this._currentDate=new Date(t.getFullYear(),t.getMonth(),1),this.variant==="datetime-local"&&(this._selectedHour=t.getHours(),this._selectedMinute=t.getMinutes()))}}render(){if(!this.open)return d``;const e=this._currentDate.getFullYear(),t=this._currentDate.getMonth(),s=new Date,a=this._getMonthDays(e,t),n=Array.from({length:101},(o,i)=>s.getFullYear()-50+i),r=this.variant==="datetime-local"&&!this._showMonthDropdown&&!this._showYearDropdown;return d`
|
|
2
2
|
<div class="datepicker-popup popup">
|
|
3
3
|
<div class="header">
|
|
4
4
|
<div class="month-selector ${this._showMonthDropdown?"open":""} ${this._showYearDropdown?"disable":""}">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u,n as s,i as h,E as p,x as a,t as m}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-group.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(o,c,r){try{customElements.get(o)||e(o,c,r)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(t,e,o,c)=>{for(var r=c>1?void 0:c?f(e,o):e,l=t.length-1,d;l>=0;l--)(d=t[l])&&(r=(c?d(e,o,r):d(r))||r);return c&&r&&b(e,o,r),r};let i=class extends h{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{this.shadowRoot?.querySelector("form")?.reset(),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(e=>{const o=e.tagName;o==="SCB-TEXTFIELD"&&(e.value=""),o==="SCB-CHECKBOX"&&(e.checked=!1),o==="SCB-RADIO-BUTTON"&&(e.checked=!1),o==="SCB-SWITCH"&&(e.selected=!1),o==="SCB-CHIP"&&(e.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{this.shadowRoot?.querySelector("form")?.requestSubmit(),this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!e.length)return;const o=e[0],c=e[e.length-1];t.shiftKey&&document.activeElement===o?(c.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===c&&(o.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}updated(t){if(t.has("open")){const e=t.get("open");this.__updateTriggersExpanded(),this.open&&!e?this.updateComplete.then(()=>{const o=this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');o?o.focus():this.shadowRoot?.querySelector(".container")?.focus()}):!this.open&&e&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement;e.style.overflow=t?"hidden":""}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}__slotIsEmpty(){const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const e=this.variant==="form"||this.variant==="floating";return a`
|
|
1
|
+
import{a as u,n as s,i as h,E as p,x as a,t as m}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";import"../../vendor/vendor-material.js";import"../../vendor/preload-helper.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-datepicker/scb-datepicker.js";import"../scb-divider/scb-divider.js";import"../scb-checkbox/scb-checkbox-group.js";import"../scb-radio-button/scb-radio-group.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(o,c,r){try{customElements.get(o)||e(o,c,r)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,n=(t,e,o,c)=>{for(var r=c>1?void 0:c?f(e,o):e,l=t.length-1,d;l>=0;l--)(d=t[l])&&(r=(c?d(e,o,r):d(r))||r);return c&&r&&b(e,o,r),r};let i=class extends h{constructor(){super(...arguments),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.formId="",this.formAction="",this.formMethod="",this.__lastTriggerEl=null,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{this.open&&t.key==="Escape"&&(this.__fire("esc"),this.__setOpen(!1))},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{this.shadowRoot?.querySelector("form")?.reset(),(this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})??[]).forEach(e=>{const o=e.tagName;o==="SCB-TEXTFIELD"&&(e.value=""),o==="SCB-CHECKBOX"&&(e.checked=!1),o==="SCB-RADIO-BUTTON"&&(e.checked=!1),o==="SCB-SWITCH"&&(e.selected=!1),o==="SCB-CHIP"&&(e.selected=!1)}),this.__fire("reset")},this.__onSubmit=()=>{this.shadowRoot?.querySelector("form")?.requestSubmit(),this.__fire("submit"),this.__setOpen(!1)},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab")return;const e=Array.from(this.shadowRoot.querySelectorAll('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled"));if(!e.length)return;const o=e[0],c=e[e.length-1];t.shiftKey&&document.activeElement===o?(c.focus(),t.preventDefault()):!t.shiftKey&&document.activeElement===c&&(o.focus(),t.preventDefault())}}__getActionFromEvent(t){if(!this.id)return null;for(const e of t.composedPath())if(e instanceof Element){if(e.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=e,"toggle";if(e.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=e,"toggle"}return null}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.addEventListener("keydown",this.__onKeydownTrap)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.removeEventListener("keydown",this.__onKeydownTrap),super.disconnectedCallback()}updated(t){if(t.has("open")){const e=t.get("open");this.__updateTriggersExpanded(),this.open&&!e?this.updateComplete.then(()=>{const o=this.shadowRoot?.querySelector('button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])');o?o.focus():this.shadowRoot?.querySelector(".container")?.focus()}):!this.open&&e&&this.__lastTriggerEl?.focus?.(),this.__toggleScrollLock(this.open)}}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__toggleScrollLock(t){if(this.inSb)return;const e=document.documentElement;e.style.overflow=t?"hidden":""}__setOpen(t){this.open=t,this.__fire(t?"open":"close")}__fire(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0,composed:!0}))}__slotIsEmpty(){const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).length===0:!0}renderHeader(t){const e=this.variant==="form"||this.variant==="floating";return a`
|
|
2
2
|
<div class="header">
|
|
3
3
|
<div class="title">
|
|
4
4
|
${this.icon?a`<md-icon class="dialog-icon">${this.icon}</md-icon>`:p}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as u}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i as m,E as p,x as c,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,a,n){try{customElements.get(i)||t(i,a,n)}catch(d){var o=String(d||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,i,a)=>{for(var n=a>1?void 0:a?g(t,i):t,o=e.length-1,d;o>=0;o--)(d=e[o])&&(n=(a?d(t,i,n):d(n))||n);return a&&n&&f(t,i,n),n};let r=class extends m{constructor(){super(...arguments),this.label="",this.selected=!1,this.leadingIcon="",this.itemHref="",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=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const t=Array.from(this.parentElement?.querySelectorAll("scb-drawer-item")||[]),i=t.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(t[i+1]||t[0]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(t[i-1]||t[t.length-1]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"Home":{e.preventDefault(),t[0].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"End":{e.preventDefault(),t[t.length-1].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){r.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),r.__rippleLoaded=!0),r.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),r.__focusRingLoaded=!0),this.leadingIcon&&!r.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),r.__iconLoaded=!0),this.hasSlotContent&&!r.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,0]),import.meta.url),r.__iconButtonLoaded=!0)}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(a=>a.tagName==="SCB-SUB-DRAWER")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-drawer-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-drawer-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){const e=this.renderRoot.querySelector("slot");if(e){const t=e.assignedElements({flatten:!0});this.hasSlotContent=t.length>0&&t.every(i=>i.tagName==="SCB-SUB-DRAWER")}await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(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.hasSlotContent;return c`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js","../scb-icon-button/scb-icon-button.js","../../vendor/preload-helper.js","../scb-tooltip/scb-tooltip.js","../scb-button/scb-button.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as u}from"../../vendor/preload-helper.js";import{a as b,n as l,r as h,i as m,E as p,x as c,t as _}from"../../vendor/vendor.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,a,n){try{customElements.get(i)||t(i,a,n)}catch(d){var o=String(d||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,s=(e,t,i,a)=>{for(var n=a>1?void 0:a?g(t,i):t,o=e.length-1,d;o>=0;o--)(d=e[o])&&(n=(a?d(t,i,n):d(n))||n);return a&&n&&f(t,i,n),n};let r=class extends m{constructor(){super(...arguments),this.label="",this.selected=!1,this.leadingIcon="",this.itemHref="",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=e=>{e&&e.stopPropagation(),this.hasSlotContent&&this.__setExpanded(!this.expanded)},this._onButtonClick=e=>{e.stopPropagation(),this._dispatchSelect(),this._toggleExpand()},this._onLinkClick=()=>{this._dispatchSelect()},this._onKeyDown=e=>{const t=Array.from(this.parentElement?.querySelectorAll("scb-drawer-item")||[]),i=t.indexOf(this);switch(e.key){case"ArrowDown":{e.preventDefault(),(t[i+1]||t[0]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"ArrowUp":{e.preventDefault(),(t[i-1]||t[t.length-1]).shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"Home":{e.preventDefault(),t[0].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}case"End":{e.preventDefault(),t[t.length-1].shadowRoot?.querySelector(".scb-drawer-label-text")?.focus();break}}}}get __submenuEl(){return this.renderRoot.querySelector(`#${this.__submenuId}`)}async __ensureDepsLoaded(){r.__rippleLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.r),__vite__mapDeps([0,1]),import.meta.url),r.__rippleLoaded=!0),r.__focusRingLoaded||(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.m),__vite__mapDeps([0,1]),import.meta.url),r.__focusRingLoaded=!0),this.leadingIcon&&!r.__iconLoaded&&(await u(()=>import("../../vendor/vendor-material.js").then(e=>e.i),__vite__mapDeps([0,1]),import.meta.url),r.__iconLoaded=!0),this.hasSlotContent&&!r.__iconButtonLoaded&&(await u(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([2,3,1,4,5,0]),import.meta.url),r.__iconButtonLoaded=!0)}_onSlotChange(e){const i=e.target.assignedElements({flatten:!0});this.hasSlotContent=i.length>0&&i.every(a=>a.tagName==="SCB-SUB-DRAWER")}__setExpanded(e){this.hasSlotContent&&(this.expanded=e,this.dispatchEvent(new CustomEvent("scb-drawer-expand",{bubbles:!0,composed:!0,detail:{item:this,expanded:e}})))}_dispatchSelect(){this.dispatchEvent(new CustomEvent("scb-drawer-select",{bubbles:!0,composed:!0,detail:{item:this}}))}async firstUpdated(){const e=this.renderRoot.querySelector("slot");if(e){const t=e.assignedElements({flatten:!0});this.hasSlotContent=t.length>0&&t.every(i=>i.tagName==="SCB-SUB-DRAWER")}await this.__ensureDepsLoaded()}updated(e){e.has("leadingIcon")&&this.leadingIcon&&this.__ensureDepsLoaded(),e.has("hasSlotContent")&&this.hasSlotContent&&this.__ensureDepsLoaded(),e.has("expanded")&&this.__applyInert()}__applyInert(){const e=this.__submenuEl;e&&(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.hasSlotContent;return c`
|
|
3
3
|
<div class="scb-drawer-item">
|
|
4
4
|
<div class="scb-drawer-item-label" ?selected=${this.selected}>
|
|
5
5
|
${t?c`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./scb-drawer-item.js","../../vendor/preload-helper.js","../../vendor/vendor.js","./scb-drawer-section.js","../scb-divider/scb-divider.js","./scb-sub-drawer.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as d}from"../../vendor/preload-helper.js";import{a as
|
|
2
|
+
import{_ as d}from"../../vendor/preload-helper.js";import{a as f,n,i as p,E as _,x as u,t as h}from"../../vendor/vendor.js";import"../scb-divider/scb-divider.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(o,a,s){try{customElements.get(o)||r(o,a,s)}catch(c){var i=String(c||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,l=(t,r,o,a)=>{for(var s=a>1?void 0:a?y(r,o):r,i=t.length-1,c;i>=0;i--)(c=t[i])&&(s=(a?c(r,o,s):c(s))||s);return a&&s&&v(r,o,s),s};let e=class extends p{constructor(){super(...arguments),this.label="",this.subLabel="",this.floating=!1,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.__lastTriggerEl=null,this._onGlobalSelect=t=>{const r=t;this.querySelectorAll("scb-drawer-item").forEach(a=>a.selected=!1),this.contains(r.detail.item)&&(r.detail.item.selected=!0)},this.__onDocumentClick=t=>{const r=this.__getActionFromEvent(t);if(r){r==="open"&&this.__setOpen(!0),r==="close"&&this.__setOpen(!1),r==="toggle"&&this.__setOpen(!this.open),t.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(t.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=t=>{if(this.open){if(t.key==="Escape"){this.__setOpen(!1);return}if(this.overlay&&t.key==="Tab"){const r=this.__getFocusable();if(r.length===0)return;const o=r[0],a=r[r.length-1],s=this.renderRoot,i=s.activeElement||document.activeElement;t.shiftKey?(i===o||!s.contains(i))&&(t.preventDefault(),a.focus()):(i===a||!s.contains(i))&&(t.preventDefault(),o.focus())}}}}static async __ensureParts(){e.__partsReady||(e.__partsLoading||(e.__partsLoading=Promise.all([d(()=>import("./scb-drawer-item.js"),__vite__mapDeps([0,1,2]),import.meta.url),d(()=>import("./scb-drawer-section.js"),__vite__mapDeps([3,2,4]),import.meta.url),d(()=>import("./scb-sub-drawer.js"),__vite__mapDeps([5,2]),import.meta.url)]).then(()=>{e.__partsReady=!0})),await e.__partsLoading)}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const t=document.createElement("style");t.id="scb-drawer-overlay-styles",t.textContent=`
|
|
3
3
|
.scb-drawer-global-overlay {
|
|
4
4
|
position: fixed;
|
|
5
5
|
inset: 0;
|
|
@@ -38,12 +38,12 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n,i as f,E as _
|
|
|
38
38
|
`}connectedCallback(){super.connectedCallback(),window.addEventListener("scb-drawer-select",this._onGlobalSelect),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){window.removeEventListener("scb-drawer-select",this._onGlobalSelect),document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(e.__hideOverlay(this),this.lockScroll&&e.__lockScrollDisable()),super.disconnectedCallback()}__getActionFromEvent(t){if(!this.id)return null;const r=t.composedPath();for(const o of r)if(o instanceof Element){if(o.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=o,"open";if(o.getAttribute("data-drawer-close")===this.id)return this.__lastTriggerEl=o,"close";if(o.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=o,"toggle";if(o.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=o,"toggle"}return null}__getFocusable(){const t=this.renderRoot;return Array.from(t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(r=>!r.hasAttribute("disabled")&&r.tabIndex>=0)}__setOpen(t){this.open=t}updated(t){if(t.has("open")){const r=!!t.get("open");this.__applyOpenSideEffects(r,this.open)}t.has("right")&&this.right&&this.left&&(this.left=!1),t.has("left")&&this.left&&this.right&&(this.right=!1)}__applyOpenSideEffects(t,r){r&&!t?(this.floating&&this.overlay&&(e.__showOverlay(this),this.lockScroll&&e.__lockScrollEnable()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),e.__ensureParts(),this.__updateTriggersExpanded(),this.updateComplete.then(()=>{this.__getFocusable()[0]?.focus?.()}),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0}))):!r&&t&&(this.floating&&this.overlay&&(e.__hideOverlay(this),this.lockScroll&&e.__lockScrollDisable()),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.__updateTriggersExpanded(),this.__lastTriggerEl?.focus?.(),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})))}__updateTriggersExpanded(){if(!this.id)return;document.querySelectorAll(`[aria-controls="${this.id}"],
|
|
39
39
|
[data-drawer-open="${this.id}"],
|
|
40
40
|
[data-drawer-close="${this.id}"],
|
|
41
|
-
[data-drawer-toggle="${this.id}"]`).forEach(r=>{r.hasAttribute("aria-controls")&&r.setAttribute("aria-expanded",String(this.open))})}};e.__overlayEl=null;e.__overlayStack=[];e.__lockedCount=0;e.__prevDocOverflow=null;e.__prevBodyOverflow=null;e.__partsReady=!1;e.__partsLoading=null;e.styles=
|
|
41
|
+
[data-drawer-toggle="${this.id}"]`).forEach(r=>{r.hasAttribute("aria-controls")&&r.setAttribute("aria-expanded",String(this.open))})}};e.__overlayEl=null;e.__overlayStack=[];e.__lockedCount=0;e.__prevDocOverflow=null;e.__prevBodyOverflow=null;e.__partsReady=!1;e.__partsLoading=null;e.styles=f`
|
|
42
42
|
:host {
|
|
43
43
|
display: block;
|
|
44
44
|
color: var(--md-sys-color-on-surface);
|
|
45
45
|
padding: var(--spacing-4, 12px);
|
|
46
|
-
background: var(--md-sys-color-surface-container
|
|
46
|
+
background: var(--md-sys-color-surface-container);
|
|
47
47
|
font-family: var(--brand-font);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -142,7 +142,6 @@ import{_ as d}from"../../vendor/preload-helper.js";import{a as p,n,i as f,E as _
|
|
|
142
142
|
|
|
143
143
|
scb-divider {
|
|
144
144
|
margin-block: var(--spacing-2, 4px);
|
|
145
|
-
margin-inline: var(--spacing-4, 12px);
|
|
146
145
|
}
|
|
147
146
|
|
|
148
147
|
.panel {
|
|
@@ -1,12 +1,33 @@
|
|
|
1
|
-
import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../../vendor/vendor-material.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var l=String(d||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,g=Object.getOwnPropertyDescriptor,o=(e,t,n,s)=>{for(var i=s>1?void 0:s?g(t,n):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends f{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(a=>a.trim()),s=t.transitionDelay.split(",").map(a=>a.trim()),i=a=>{const h=parseFloat(a);return Number.isFinite(h)?a.endsWith("ms")?h:a.endsWith("s")?h*1e3:h:0},l=Math.max(n.length,s.length);let d=0;for(let a=0;a<l;a+=1){const h=i(n[a]??n[n.length-1]??"0s"),c=i(s[a]??s[s.length-1]??"0s");d=Math.max(d,h+c)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(l=>s(l))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}_applyChevronState(){const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const t=this._triggerEl?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl;return b`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import{a as f,n as p,e as c,i as _,E as m,x as u,t as g}from"../../vendor/vendor.js";import"../../vendor/vendor-material.js";import"../scb-button/scb-button.js";import"../scb-menu/scb-menu.js";import"../scb-menu/scb-menu-item.js";import"../scb-divider/scb-divider.js";import"../scb-menu/scb-sub-menu.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(n,s,i){try{customElements.get(n)||t(n,s,i)}catch(d){var a=String(d||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,o=(e,t,n,s)=>{for(var i=s>1?void 0:s?v(t,n):t,a=e.length-1,d;a>=0;a--)(d=e[a])&&(i=(s?d(t,n,i):d(i))||i);return s&&i&&y(t,n,i),i};let r=class extends _{constructor(){super(...arguments),this.label="Dropdown",this.variant="filled",this.open=!1,this.disabled=!1,this.menuGap="3",this.width=null,this.minWidth=null,this.maxWidth=null,this.dataIndex=null,this.ariaCurrent=null,this._slottedMenuEl=null,this._openSettledTimer=null,this._menuCloseTimer=null,this._panelResizeObserver=null,this._panelHeightSyncRaf=null,this._onDocumentClickBound=e=>{if(!this.open)return;const t=e.composedPath(),n=t.find(s=>s instanceof HTMLElement&&s.tagName.toLowerCase()==="scb-dropdown");if(n&&n!==this){this.open=!1;return}t.includes(this)||(this.open=!1)},this._onDocumentKeydownBound=e=>{this.open&&e.key==="Escape"&&(this.open=!1)},this._onDrawerSelectBound=e=>{if(!this.open)return;const n=e.detail?.item;if(!n||!!n.querySelector("scb-sub-drawer"))return;const i=n.getAttribute("item-href")?.trim()??"",a=n.getAttribute("href")?.trim()??"";(i!==""||a!=="")&&this._dispatchTabActivate(),this.open=!1},this._onSlottedMenuOpen=()=>{this.open||(this.open=!0)},this._onSlottedMenuClose=()=>{this.open&&(this.open=!1)},this._onSlotChange=()=>{this._syncSlottedMenu(),this._applyPanelSizing(),this._applyInertByOpen(),this.requestUpdate()},this._onTriggerClick=e=>{this.hasAttribute("as-tab")||e.stopPropagation(),!this.disabled&&(this.open=!this.open)}}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._onDocumentClickBound,!0),document.addEventListener("keydown",this._onDocumentKeydownBound),this.addEventListener("scb-drawer-select",this._onDrawerSelectBound)}disconnectedCallback(){document.removeEventListener("click",this._onDocumentClickBound,!0),document.removeEventListener("keydown",this._onDocumentKeydownBound),this.removeEventListener("scb-drawer-select",this._onDrawerSelectBound),this._detachSlottedMenuListeners(),this._panelResizeObserver&&(this._panelResizeObserver.disconnect(),this._panelResizeObserver=null),this._panelHeightSyncRaf!==null&&(window.cancelAnimationFrame(this._panelHeightSyncRaf),this._panelHeightSyncRaf=null),this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),super.disconnectedCallback()}firstUpdated(e){super.firstUpdated(e),this._syncSlottedMenu(),this._applyPanelVars(),this._applyPanelSizing(),this._applyChevronState(),this._applyInertByOpen(),this._setupPanelResizeObserver(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen()}updated(e){super.updated(e),e.has("menuGap")&&this._applyPanelVars(),(e.has("width")||e.has("minWidth")||e.has("maxWidth"))&&this._applyPanelSizing(),e.has("open")&&(this.open||this._closeAllSubMenus(),this._syncSlottedMenuOpen(),this._applyChevronState(),this._applyInertByOpen(),this._syncPanelMaxHeightByOpen(),this._syncOverflowVisibilityByOpen())}_applyPanelVars(){if(this.menuGap==null||String(this.menuGap).trim()===""){this.style.removeProperty("--scb-dropdown-panel-gap");return}this.style.setProperty("--scb-dropdown-panel-gap",this._mapSpacingToken(this.menuGap))}_applyPanelSizing(){const e=this.renderRoot.querySelector(".panel-surface");e&&(this.width&&String(this.width).trim()!==""?e.style.inlineSize=this.width:e.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?e.style.minInlineSize=this.minWidth:e.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?e.style.maxInlineSize=this.maxWidth:e.style.removeProperty("max-inline-size")),this._slottedMenuEl&&(this.width&&String(this.width).trim()!==""?this._slottedMenuEl.style.inlineSize=this.width:this._slottedMenuEl.style.removeProperty("inline-size"),this.minWidth&&String(this.minWidth).trim()!==""?this._slottedMenuEl.style.minInlineSize=this.minWidth:this._slottedMenuEl.style.removeProperty("min-inline-size"),this.maxWidth&&String(this.maxWidth).trim()!==""?this._slottedMenuEl.style.maxInlineSize=this.maxWidth:this._slottedMenuEl.style.removeProperty("max-inline-size")),this._schedulePanelHeightSync()}_setupPanelResizeObserver(){if(this._panelResizeObserver||typeof ResizeObserver>"u")return;const e=this._panelInnerEl;e&&(this._panelResizeObserver=new ResizeObserver(()=>{this._schedulePanelHeightSync()}),this._panelResizeObserver.observe(e))}_schedulePanelHeightSync(){this._panelHeightSyncRaf===null&&(this._panelHeightSyncRaf=window.requestAnimationFrame(()=>{this._panelHeightSyncRaf=null,this._syncPanelMaxHeightByOpen()}))}_syncPanelMaxHeightByOpen(){const e=this._panelSurfaceEl;if(!e)return;if(this._slottedMenuEl){e.style.removeProperty("--scb-dropdown-panel-current-max-height");return}if(!this.open){e.style.setProperty("--scb-dropdown-panel-current-max-height","0px");return}const t=this._panelInnerEl;if(!t)return;const n=`${Math.ceil(t.scrollHeight)}px`;e.style.getPropertyValue("--scb-dropdown-panel-current-max-height").trim()!==n&&e.style.setProperty("--scb-dropdown-panel-current-max-height",n)}_mapSpacingToken(e){const t=String(e).trim();return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}_syncSlottedMenu(){const t=(this._slotEl?.assignedElements({flatten:!0})??[]).find(n=>n.tagName.toLowerCase()==="scb-menu");if(t===this._slottedMenuEl){this._syncSlottedMenuOpen();return}this._detachSlottedMenuListeners(),this._slottedMenuEl=t??null,this._slottedMenuEl&&(this._slottedMenuEl.addEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.addEventListener("close",this._onSlottedMenuClose),this._syncSlottedMenuOpen())}_detachSlottedMenuListeners(){this._slottedMenuEl&&(this._slottedMenuEl.removeEventListener("open",this._onSlottedMenuOpen),this._slottedMenuEl.removeEventListener("close",this._onSlottedMenuClose))}_syncSlottedMenuOpen(){if(!this._slottedMenuEl)return;if(this._menuCloseTimer!==null&&(window.clearTimeout(this._menuCloseTimer),this._menuCloseTimer=null),this.open){this._slottedMenuEl.open=!0;return}const e=this._getPanelTransitionMs();if(e<=0){this._slottedMenuEl.open=!1;return}this._menuCloseTimer=window.setTimeout(()=>{this._menuCloseTimer=null,!this.open&&this._slottedMenuEl&&(this._slottedMenuEl.open=!1)},e)}_syncOverflowVisibilityByOpen(){if(this._openSettledTimer!==null&&(window.clearTimeout(this._openSettledTimer),this._openSettledTimer=null),this.removeAttribute("data-open-settled"),!this.open)return;const e=this.renderRoot.querySelector(".panel-surface");if(!e){this.setAttribute("data-open-settled","");return}const t=this._getTransitionMs(e);if(t<=0){this.setAttribute("data-open-settled","");return}this._openSettledTimer=window.setTimeout(()=>{this._openSettledTimer=null,this.open&&this.setAttribute("data-open-settled","")},t)}_getPanelTransitionMs(){const e=this.renderRoot.querySelector(".panel-surface");return e?this._getTransitionMs(e):0}_getTransitionMs(e){const t=getComputedStyle(e),n=t.transitionDuration.split(",").map(l=>l.trim()),s=t.transitionDelay.split(",").map(l=>l.trim()),i=l=>{const h=parseFloat(l);return Number.isFinite(h)?l.endsWith("ms")?h:l.endsWith("s")?h*1e3:h:0},a=Math.max(n.length,s.length);let d=0;for(let l=0;l<a;l+=1){const h=i(n[l]??n[n.length-1]??"0s"),b=i(s[l]??s[s.length-1]??"0s");d=Math.max(d,h+b)}return Math.ceil(d)}_applyInertByOpen(){const e=this.renderRoot.querySelector(".panel");e&&(this.open?(e.removeAttribute("inert"),e.setAttribute("aria-hidden","false"),this._restoreTabIndexesIfNeeded()):(e.setAttribute("inert",""),e.setAttribute("aria-hidden","true"),this._removeTabIndexesIfNeeded()))}_supportsInert(){return"inert"in HTMLElement.prototype}_collectFocusableFromSlot(){const e=this._slotEl;if(!e)return[];const t=e.assignedElements({flatten:!0}),n=[],s=i=>{i instanceof HTMLElement&&i.matches("a,button,input,select,textarea,[tabindex]")&&n.push(i)};return t.forEach(i=>{s(i),i.querySelectorAll?.("a,button,input,select,textarea,[tabindex]").forEach(a=>s(a))}),n}_removeTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("tabindex");n!==null&&t.setAttribute("data-scb-prev-tabindex",n),t.setAttribute("tabindex","-1")})}_restoreTabIndexesIfNeeded(){if(this._supportsInert())return;this._collectFocusableFromSlot().forEach(t=>{const n=t.getAttribute("data-scb-prev-tabindex");n!==null?(t.setAttribute("tabindex",n),t.removeAttribute("data-scb-prev-tabindex")):t.removeAttribute("tabindex")})}_closeAllSubMenus(){const e=this.querySelectorAll("scb-sub-menu");for(const t of e)t.removeAttribute("open")}focus(e){const t=this._triggerEl;if(t?.focus){t.focus(e);return}super.focus(e)}_dispatchTabActivate(){this.hasAttribute("as-tab")&&this.dispatchEvent(new CustomEvent("scb-dropdown-tab-activate",{bubbles:!0,composed:!0,detail:{dataIndex:this.dataIndex}}))}_applyChevronState(){if(this.hasAttribute("as-tab"))return;const e=this._getChevronIconEl();e&&(e.style.transition="transform var(--motion-duration-medium, 200ms) var(--motion-easing-standard, ease)",e.style.transformOrigin="center",e.style.transform=this.open?"rotate(180deg)":"rotate(0deg)")}_getChevronIconEl(){const e=this._triggerEl;if(e?.tagName?.toLowerCase?.()!=="scb-button")return null;const t=e?.shadowRoot;return t?t.querySelector('md-icon[slot="icon"]')??t.querySelector("md-icon"):null}render(){const e=!!this._slottedMenuEl,t=this.hasAttribute("as-tab"),n=this.dataIndex,i=this.ariaCurrent==="page"?"page":m,a=t?u`
|
|
2
|
+
<div class="tab-wrap">
|
|
3
|
+
<button
|
|
4
|
+
type="button"
|
|
5
|
+
class="tab-link"
|
|
6
|
+
data-scb-dropdown-trigger
|
|
7
|
+
?disabled=${this.disabled}
|
|
8
|
+
aria-haspopup="menu"
|
|
9
|
+
aria-expanded=${String(this.open)}
|
|
10
|
+
data-index=${n??m}
|
|
11
|
+
aria-current=${i}
|
|
12
|
+
@click=${this._onTriggerClick}
|
|
13
|
+
>
|
|
14
|
+
${this.label}
|
|
15
|
+
<md-icon class="chevron" aria-hidden="true">keyboard_arrow_down</md-icon>
|
|
16
|
+
</button>
|
|
17
|
+
<md-focus-ring></md-focus-ring>
|
|
18
|
+
</div>
|
|
19
|
+
`:u`
|
|
20
|
+
<scb-button
|
|
21
|
+
data-scb-dropdown-trigger
|
|
22
|
+
label=${this.label}
|
|
23
|
+
variant=${this.variant}
|
|
24
|
+
icon="keyboard_arrow_down"
|
|
25
|
+
?trailing-icon=${!0}
|
|
26
|
+
?disabled=${this.disabled}
|
|
27
|
+
@click=${this._onTriggerClick}
|
|
28
|
+
></scb-button>
|
|
29
|
+
`;return u`
|
|
30
|
+
${a}
|
|
10
31
|
|
|
11
32
|
<div
|
|
12
33
|
class="panel ${e?"has-menu":""}"
|
|
@@ -19,7 +40,7 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
19
40
|
</div>
|
|
20
41
|
</div>
|
|
21
42
|
</div>
|
|
22
|
-
`}};r.styles=
|
|
43
|
+
`}};r.styles=f`
|
|
23
44
|
:host {
|
|
24
45
|
display: inline-block;
|
|
25
46
|
position: relative;
|
|
@@ -54,10 +75,10 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
54
75
|
.panel-surface {
|
|
55
76
|
width: 100%;
|
|
56
77
|
max-width: var(--scb-dropdown-panel-max-width, 600px);
|
|
57
|
-
background: var(--md-sys-color-surface
|
|
78
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
58
79
|
box-shadow: var(--elevation-2, 0px 2px 10px rgba(0, 0, 0, 0.12));
|
|
59
|
-
padding-right: var(--spacing-
|
|
60
|
-
padding-left: var(--spacing-
|
|
80
|
+
padding-right: var(--spacing-2, 4px);
|
|
81
|
+
padding-left: var(--spacing-2, 4px);
|
|
61
82
|
opacity: 0;
|
|
62
83
|
max-height: var(--scb-dropdown-panel-current-max-height, 0px);
|
|
63
84
|
transition:
|
|
@@ -66,33 +87,56 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
66
87
|
overflow: hidden;
|
|
67
88
|
}
|
|
68
89
|
|
|
69
|
-
|
|
70
|
-
display:
|
|
90
|
+
:host([as-tab]) {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: stretch;
|
|
71
93
|
}
|
|
72
94
|
|
|
73
|
-
:host([as-tab]) .tab-
|
|
95
|
+
:host([as-tab]) .tab-wrap {
|
|
74
96
|
position: relative;
|
|
75
|
-
display:
|
|
97
|
+
display: inline-flex;
|
|
98
|
+
align-items: stretch;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([as-tab]) .tab-wrap md-focus-ring {
|
|
102
|
+
position: absolute;
|
|
103
|
+
inset-block: var(--spacing-1, 2px);
|
|
104
|
+
inset-inline: var(--spacing-neg-2, -4px);
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
display: none;
|
|
107
|
+
border-radius: 5px;
|
|
76
108
|
}
|
|
77
109
|
|
|
78
110
|
:host([as-tab]) .tab-link {
|
|
79
111
|
position: relative;
|
|
80
|
-
border: none;
|
|
81
|
-
background: transparent;
|
|
82
|
-
padding: var(--spacing-5, 16px) var(--spacing-5, 16px);
|
|
83
|
-
border-radius: var(--md-sys-shape-corner-extra-small)
|
|
84
|
-
var(--md-sys-shape-corner-extra-small) 0 0;
|
|
85
|
-
font-size: var(--md-sys-typescale-title-medium-size);
|
|
86
|
-
line-height: var(--md-sys-typescale-title-medium-line-height);
|
|
87
|
-
font-weight: var(--md-sys-typescale-title-medium-weight);
|
|
88
|
-
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
|
|
89
|
-
color: var(--md-sys-color-on-surface);
|
|
90
|
-
cursor: pointer;
|
|
91
112
|
display: inline-flex;
|
|
92
113
|
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
padding-block: var(--spacing-4, 12px);
|
|
116
|
+
padding: 0;
|
|
117
|
+
border: none;
|
|
118
|
+
background: none;
|
|
119
|
+
text-decoration: none;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
font-family: var(
|
|
122
|
+
--md-sys-typescale-title-small-font,
|
|
123
|
+
var(--brand-font, Inter)
|
|
124
|
+
);
|
|
125
|
+
font-size: var(--md-sys-typescale-title-small-size, 1rem);
|
|
126
|
+
line-height: var(--md-sys-typescale-title-small-line-height, 1.5rem);
|
|
127
|
+
font-weight: var(--md-sys-typescale-title-small-weight, 500);
|
|
128
|
+
letter-spacing: var(--md-sys-typescale-title-small-tracking, 0);
|
|
129
|
+
color: var(--md-sys-color-on-surface);
|
|
130
|
+
white-space: nowrap;
|
|
131
|
+
border-radius: 0;
|
|
132
|
+
outline: none;
|
|
93
133
|
gap: var(--spacing-3, 8px);
|
|
94
134
|
}
|
|
95
135
|
|
|
136
|
+
:host([as-tab]) .tab-link[aria-current='page'] {
|
|
137
|
+
color: var(--md-sys-color-primary);
|
|
138
|
+
}
|
|
139
|
+
|
|
96
140
|
:host([as-tab]) .tab-link::after {
|
|
97
141
|
content: '';
|
|
98
142
|
position: absolute;
|
|
@@ -108,20 +152,13 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
108
152
|
background-color: var(--md-sys-color-primary);
|
|
109
153
|
}
|
|
110
154
|
|
|
111
|
-
:host([as-tab]) md-focus-ring {
|
|
112
|
-
position: absolute;
|
|
113
|
-
inset: -4px;
|
|
114
|
-
border-radius: var(--md-sys-shape-corner-extra-small)
|
|
115
|
-
var(--md-sys-shape-corner-extra-small) 0 0;
|
|
116
|
-
display: none;
|
|
117
|
-
pointer-events: none;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
155
|
:host([as-tab]) .tab-link:focus-visible + md-focus-ring {
|
|
121
156
|
display: block;
|
|
122
157
|
}
|
|
123
158
|
|
|
124
159
|
:host([as-tab]) md-icon.chevron {
|
|
160
|
+
font-size: var(--icon-size-small, 20px);
|
|
161
|
+
line-height: 1;
|
|
125
162
|
transition:
|
|
126
163
|
transform var(--motion-duration-medium, 200ms)
|
|
127
164
|
var(--motion-easing-standard, ease);
|
|
@@ -172,6 +209,7 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
172
209
|
|
|
173
210
|
::slotted(scb-drawer) {
|
|
174
211
|
padding: 0;
|
|
212
|
+
background: var(--md-sys-color-surface-container-lowest);
|
|
175
213
|
}
|
|
176
214
|
|
|
177
215
|
::slotted(scb-checkbox) {
|
|
@@ -189,4 +227,4 @@ import{a as m,n as p,e as u,i as f,x as b,t as _}from"../../vendor/vendor.js";im
|
|
|
189
227
|
transition: none;
|
|
190
228
|
}
|
|
191
229
|
}
|
|
192
|
-
`;o([p({type:String})],r.prototype,"label",2);o([p({type:String})],r.prototype,"variant",2);o([p({type:Boolean,reflect:!0})],r.prototype,"open",2);o([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2);o([p({type:String,attribute:"menu-gap"})],r.prototype,"menuGap",2);o([p({type:String})],r.prototype,"width",2);o([p({type:String,attribute:"min-width"})],r.prototype,"minWidth",2);o([p({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);o([
|
|
230
|
+
`;o([p({type:String})],r.prototype,"label",2);o([p({type:String})],r.prototype,"variant",2);o([p({type:Boolean,reflect:!0})],r.prototype,"open",2);o([p({type:Boolean,reflect:!0})],r.prototype,"disabled",2);o([p({type:String,attribute:"menu-gap"})],r.prototype,"menuGap",2);o([p({type:String})],r.prototype,"width",2);o([p({type:String,attribute:"min-width"})],r.prototype,"minWidth",2);o([p({type:String,attribute:"max-width"})],r.prototype,"maxWidth",2);o([p({type:String,attribute:"data-index"})],r.prototype,"dataIndex",2);o([p({type:String,attribute:"aria-current"})],r.prototype,"ariaCurrent",2);o([c("[data-scb-dropdown-trigger]")],r.prototype,"_triggerEl",2);o([c("slot")],r.prototype,"_slotEl",2);o([c(".panel-surface")],r.prototype,"_panelSurfaceEl",2);o([c(".panel-inner")],r.prototype,"_panelInnerEl",2);r=o([g("scb-dropdown")],r);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/vendor-material.js","../../vendor/vendor.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as b}from"../../vendor/preload-helper.js";import{a as f,n as a,i as m,x as d,t as _}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-fact-card-content.js";import"../scb-link/scb-link.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(s,r,o){try{customElements.get(s)||i(s,r,o)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,g=t=>{throw TypeError(t)},n=(t,i,s,r)=>{for(var o=r>1?void 0:r?y(i,s):i,c=t.length-1,l;c>=0;c--)(l=t[c])&&(o=(r?l(i,s,o):l(o))||o);return r&&o&&v(i,s,o),o},x=(t,i,s)=>i.has(t)||g("Cannot "+s),z=(t,i,s)=>i.has(t)?g("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),u=(t,i,s)=>(x(t,i,"access private method"),s),p,h;let e=class extends m{constructor(){super(...arguments),z(this,p),this.__onCloseClick=t=>{t.stopPropagation(),this.__setOpen(!1)},this.variant="filled",this.title="",this.subtitle="",this.supportingText="",this.icon="",this.showCloseButton=!1,this.open=!0,this.__lastTriggerEl=null,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing="",this.spacingTop="",this.spacingBottom=""}static __handleDocClick(t){const i=t.composedPath();for(const s of i){if(!(s instanceof Element))continue;const r=s.getAttribute("data-fact-card-toggle")||s.getAttribute("aria-controls");if(!r)continue;const o=e.__instances.get(r);if(!o){e.__instances.delete(r);continue}o.__lastTriggerEl=s,o.__setOpen(!o.open),t.stopPropagation();break}}static __ensureDocListener(){e.__docListenerAttached||(document.addEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!0)}static __maybeRemoveDocListener(){e.__docListenerAttached&&e.__instances.size===0&&(document.removeEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!1)}connectedCallback(){super.connectedCallback(),this.id&&e.__instances.set(this.id,this),e.__ensureDocListener()}disconnectedCallback(){this.id&&e.__instances.delete(this.id),e.__maybeRemoveDocListener(),super.disconnectedCallback()}updated(t){t.has("open")&&this.__updateTriggersExpanded(),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&u(this,p,h).call(this)}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__setOpen(t){const i=this.open;this.open=t,t&&!i?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):!t&&i&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}render(){if(!this.open)return d``;const t=this.variant==="outlined"?"outlined":"filled",i=!!this.icon;return d`
|
|
2
|
+
import{_ as b}from"../../vendor/preload-helper.js";import{a as f,n as a,i as m,x as d,t as _}from"../../vendor/vendor.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-fact-card-content.js";import"../scb-link/scb-link.js";import"../scb-tooltip/scb-tooltip.js";import"../scb-button/scb-button.js";import"../../vendor/vendor-material.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(s,r,o){try{customElements.get(s)||i(s,r,o)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,g=t=>{throw TypeError(t)},n=(t,i,s,r)=>{for(var o=r>1?void 0:r?y(i,s):i,c=t.length-1,l;c>=0;c--)(l=t[c])&&(o=(r?l(i,s,o):l(o))||o);return r&&o&&v(i,s,o),o},x=(t,i,s)=>i.has(t)||g("Cannot "+s),z=(t,i,s)=>i.has(t)?g("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,s),u=(t,i,s)=>(x(t,i,"access private method"),s),p,h;let e=class extends m{constructor(){super(...arguments),z(this,p),this.__onCloseClick=t=>{t.stopPropagation(),this.__setOpen(!1)},this.variant="filled",this.title="",this.subtitle="",this.supportingText="",this.icon="",this.showCloseButton=!1,this.open=!0,this.__lastTriggerEl=null,this.sizing="stretch",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing="",this.spacingTop="",this.spacingBottom=""}static __handleDocClick(t){const i=t.composedPath();for(const s of i){if(!(s instanceof Element))continue;const r=s.getAttribute("data-fact-card-toggle")||s.getAttribute("aria-controls");if(!r)continue;const o=e.__instances.get(r);if(!o){e.__instances.delete(r);continue}o.__lastTriggerEl=s,o.__setOpen(!o.open),t.stopPropagation();break}}static __ensureDocListener(){e.__docListenerAttached||(document.addEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!0)}static __maybeRemoveDocListener(){e.__docListenerAttached&&e.__instances.size===0&&(document.removeEventListener("click",e.__handleDocClick,!0),e.__docListenerAttached=!1)}connectedCallback(){super.connectedCallback(),this.id&&e.__instances.set(this.id,this),e.__ensureDocListener()}disconnectedCallback(){this.id&&e.__instances.delete(this.id),e.__maybeRemoveDocListener(),super.disconnectedCallback()}updated(t){t.has("open")&&this.__updateTriggersExpanded(),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom"))&&u(this,p,h).call(this)}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__setOpen(t){const i=this.open;this.open=t,t&&!i?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):!t&&i&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}render(){if(!this.open)return d``;const t=this.variant==="outlined"?"outlined":"filled",i=!!this.icon;return d`
|
|
3
3
|
<div class="outer ${i?"has-icon":""}">
|
|
4
4
|
${i?d`<div class="icon-wrapper ${t}"><md-icon>${this.icon}</md-icon></div>`:""}
|
|
5
5
|
<div class="scb-fact-card ${t} ${this.showCloseButton?"has-close":""}">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as c,n as
|
|
1
|
+
import{a as c,n as d,i as p,x as _,t as f}from"../../vendor/vendor.js";(function(){try{var a=typeof globalThis<"u"?globalThis:window;if(!a.__scb_ce_guard_installed__){a.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(t,s,e){try{customElements.get(t)||r(t,s,e)}catch(i){var n=String(i||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var u=Object.defineProperty,b=Object.getOwnPropertyDescriptor,l=(a,r,t,s)=>{for(var e=s>1?void 0:s?b(r,t):r,n=a.length-1,i;n>=0;n--)(i=a[n])&&(e=(s?i(r,t,e):i(e))||e);return s&&e&&u(r,t,e),e};let o=class extends p{constructor(){super(...arguments),this.label="",this.href="",this.drawerId=""}render(){return _`<slot></slot>`}};o.styles=c`
|
|
2
2
|
:host {
|
|
3
3
|
display: none !important;
|
|
4
4
|
}
|
|
5
|
-
`;l([
|
|
5
|
+
`;l([d({type:String})],o.prototype,"label",2);l([d({type:String})],o.prototype,"href",2);l([d({type:String,attribute:"drawer-id"})],o.prototype,"drawerId",2);o=l([f("scb-header-tab")],o);
|