-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp-b2bbc963.entry.js
5 lines (5 loc) · 13.7 KB
/
p-b2bbc963.entry.js
1
2
3
4
5
/*!
* Built by BASIS
* Copyright BASIS International Ltd.
*/
import{r as e,w as t,h as r,H as a,g as o}from"./p-0e3693b5.js";import{S as d}from"./p-6a502b3f.js";import{l as i}from"./p-f5397639.js";import"./p-21e654a9.js";import"./p-58156e74.js";import"./p-5119ef20.js";import"./p-ece60743.js";const h=class{constructor(t){e(this,t),this.scrollPosition="top",this.lastScrollTop=0,this.drawerPlacement="left",this.drawerOpened=!0,this.drawerPopover=!1,this.drawerOverlay=!0,this.drawerFooterVisible=!1,this.drawerHeaderVisible=!1,this.drawerBreakpoint="(max-width: 800px)",this.fitViewport=!1,this.dataHeaderHidden=!1,this.footerFixed=!0,this.footerOffscreen=!0,this.footerReveal=!1,this.headerShadow="scroll",this.dataFooterHidden=!1,this.headerFixed=!0,this.headerOffscreen=!0,this.headerReveal=!1,this.footerShadow="none"}onDrawerOverlayChanged(e){e?this.el.style.removeProperty("--dwc-backdrop-background"):this.el.style.setProperty("--dwc-backdrop-background","transparent")}onDrawerBreakpointChanged(e){this.msl&&this.msl.removeEventListener("change",this.handleDrawerPopoverMode),e.length&&(this.msl=window.matchMedia(e),this.msl.addEventListener("change",this.handleDrawerPopoverMode),this.handleDrawerPopoverMode())}onLayoutOptionsChanged(){this.headerFixed||(this.headerReveal===this.headerOffscreen&&(this.headerFixed=!0),!0===this.headerReveal&&!1===this.headerOffscreen&&(this.headerFixed=!0,this.headerOffscreen=this.headerReveal)),this.headerFixed&&this.headerReveal&&!this.headerOffscreen&&(this.headerOffscreen=this.headerReveal),this.footerFixed||(this.footerReveal===this.footerOffscreen&&(this.footerFixed=!0),!0===this.footerReveal&&!1===this.footerOffscreen&&(this.footerFixed=!0,this.footerOffscreen=this.footerReveal)),this.footerFixed&&this.footerReveal&&!this.footerOffscreen&&(this.footerOffscreen=this.footerReveal),this.handleResize()}connectedCallback(){var e;this.handleDrawerToggled=this.handleDrawerToggled.bind(this),this.handleDrawerPopoverMode=this.handleDrawerPopoverMode.bind(this),this.handleScroll=this.handleScroll.bind(this),null===(e=this.slotsObserver)||void 0===e||e.connect(),this.resizeObserver&&(this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.resizeObserver.observe(this.$header),this.resizeObserver.observe(this.$footer),this.resizeObserver.observe(this.$content))}disconnectedCallback(){var e,t;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(t=this.slotsObserver)||void 0===t||t.disconnect()}componentWillLoad(){this.onDrawerOverlayChanged(this.drawerOverlay),this.onDrawerBreakpointChanged(this.drawerBreakpoint),this.onLayoutOptionsChanged(),this.slotsObserver=new d(this.el,"header","footer")}componentDidLoad(){this.handleResize(),this.loaded=!0,requestAnimationFrame((()=>{this.el.style.setProperty("--_dwc-transition","var(--dwc-transition)")}))}handleResize(){const e=this.el.style;[this.$header,this.$footer].filter(Boolean).forEach(((t,r)=>{const a=t.getBoundingClientRect();e.setProperty(0===r?"--_dwc-app-layout-header-height":"--_dwc-app-layout-footer-height",`${a.height}px`)}))}handleScroll(){if(!this.loaded)return;const e=this.fitViewport?this.$content:document.documentElement,r=e.scrollTop,a=0===r,o=!a&&e.scrollHeight-e.clientHeight===r,d=r>=this.lastScrollTop&&r>0||o;t((()=>{this.scrollPosition=a?"top":o?"bottom":"middle",this.headerReveal&&this.$header&&(this.dataHeaderHidden=d),this.footerReveal&&this.$footer&&(this.dataFooterHidden=!d)})),this.lastScrollTop=r<=0?0:r}handleClick(e){var t;const r=e.target;r.closest("[data-drawer-toggle]")&&(e.preventDefault(),this.drawerOpened=!this.drawerOpened),r.closest("[data-drawer-open]")&&(e.preventDefault(),this.drawerOpened=!0),r.closest("[data-drawer-close]")&&(e.preventDefault(),this.drawerOpened=!1),r.closest("[data-drawer-breakpoint-close]")&&this.drawerPopover&&(null===(t=this.msl)||void 0===t?void 0:t.matches)&&(e.preventDefault(),this.drawerOpened=!1)}handleDrawerToggled(e){const t=e.target;t.opened!==this.drawerOpened&&(this.drawerOpened=t.opened)}handleDrawerPopoverMode(){this.msl.matches?(this.drawerWasOpened=this.drawerOpened,this.drawerWasPopover=this.drawerPopover,this.drawerOpened=!1,this.drawerPopover=!0):(void 0!==this.drawerWasOpened&&(this.drawerOpened=this.drawerWasOpened),void 0!==this.drawerWasPopover&&(this.drawerPopover=this.drawerWasPopover))}render(){const e="hidden"!==this.drawerPlacement,t=this.slotsObserver.hasContent("header"),o=this.slotsObserver.hasContent("footer");return r(a,{key:"637bc802b9a14a0a544bafdce5eadd10cb321f36"},e&&r("dwc-drawer",{key:"ba054bf9b4ba213259eba8dedd080cdfba8935a7",part:"drawer",class:{drawer:!0,"drawer--popover":this.drawerPopover,"drawer--headerOffscreen":this.headerOffscreen&&!this.footerOffscreen&&e,"drawer--footerOffscreen":this.footerOffscreen&&!this.headerOffscreen&&e,"drawer--offscreen":this.headerOffscreen&&this.footerOffscreen&&e},placement:this.drawerPlacement,opened:this.drawerOpened,contained:!this.drawerPopover,headerVisible:this.drawerHeaderVisible,footerVisible:this.drawerFooterVisible,"aria-hidden":this.drawerOpened&&"hidden"!==this.drawerPlacement?"false":"true","onDwc-drawer-opened":this.handleDrawerToggled,"onDwc-drawer-closed":this.handleDrawerToggled,exportparts:"control:drawer-control,header:drawer-header,body: drawer-body,footer:drawer-footer,header-actions:drawer-header-actions"},r("slot",{key:"1be53b88dc6ecf7af52ed9bdbdec54a827375ab2",name:"drawer"}),r("slot",{key:"e2f8f8fee4c14c2bdbcc6c898f942637ada73032",name:"drawer-title",slot:"title"}),r("slot",{key:"a35b8b10929317ebd15d96a1bc0871a3c26f1627",name:"drawer-header-actions",slot:"header-actions"}),r("slot",{key:"07799b0ad5ef71515e769517a5e621af97f1534c",name:"drawer-footer",slot:"footer"})),r("header",{key:"5d05d47ac6cfb3051e1b1d0b54556176e26b3983",ref:e=>this.$header=e,part:"header",class:{header:!0,"header--fixed":this.headerFixed,"header--absolute":!this.headerFixed,"header--reveal":this.headerReveal,"header--offscreen":this.headerOffscreen&&e,"header--drawerOpened":this.drawerOpened&&e,"header--drawerPopover":this.drawerPopover&&e,"header--drawerLeft":"left"===this.drawerPlacement,"header--drawerRight":"right"===this.drawerPlacement,"header--hidden":this.dataHeaderHidden,"header--scrollTop":"top"==this.scrollPosition,"header--shadowAlways":"always"===this.headerShadow,"header--shadowScroll":"scroll"===this.headerShadow,"header--shadowNone":"none"===this.headerShadow,"header--noContent":!t}},r("slot",{key:"3fe1293902937b3799762bb8010984831a85875b",name:"header"})),r("section",{key:"b21a5ce77cd72115d28c2e82f6287576bef37922",ref:e=>this.$content=e,part:"content",class:{content:!0,"content--fitViewport":this.fitViewport,"content--headerHidden":this.dataHeaderHidden,"content--footerHidden":this.dataFooterHidden},onScroll:this.handleScroll},r("slot",{key:"3c57c0b110f2f003817d1c423ea52ebce8be8bf9"})),r("footer",{key:"ab3aa6ca62e566ba1048c3411e495626f4b00a35",ref:e=>this.$footer=e,part:"footer",class:{footer:!0,"footer--fixed":this.footerFixed,"footer--absolute":!this.footerFixed,"footer--reveal":this.footerReveal,"footer--offscreen":this.footerOffscreen&&e,"footer--drawerOpened":this.drawerOpened&&e,"footer--drawerPopover":this.drawerPopover&&e,"footer--drawerLeft":"left"===this.drawerPlacement,"footer--drawerRight":"right"===this.drawerPlacement,"footer--hidden":this.dataFooterHidden,"footer--scrollBottom":"bottom"===this.scrollPosition,"footer--shadowAlways":"always"===this.footerShadow,"footer--shadowScroll":"scroll"===this.footerShadow,"footer--shadowNone":"none"===this.footerShadow,"footer--noContent":!o}},r("slot",{key:"e8a14c5703eea362ee41c1b8dea81a0849c04363",name:"footer"})))}get el(){return o(this)}static get watchers(){return{drawerOverlay:["onDrawerOverlayChanged"],drawerBreakpoint:["onDrawerBreakpointChanged"],drawerOpened:["onLayoutOptionsChanged"],drawerPopover:["onLayoutOptionsChanged"],drawerPlacement:["onLayoutOptionsChanged"],headerOffscreen:["onLayoutOptionsChanged"],headerFixed:["onLayoutOptionsChanged"],headerReveal:["onLayoutOptionsChanged"],footerOffscreen:["onLayoutOptionsChanged"],footerFixed:["onLayoutOptionsChanged"],footerReveal:["onLayoutOptionsChanged"]}}};(function(e,t,r,a){var o,d=arguments.length,i=d<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var h=e.length-1;h>=0;h--)(o=e[h])&&(i=(d<3?o(i):d>3?o(t,r,i):o(t,r))||i);d>3&&i&&Object.defineProperty(t,r,i)})([i.Throttle(100)],h.prototype,"handleScroll",null),h.style="@media (prefers-reduced-motion: reduce){*,::before,::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;background-attachment:initial !important;scroll-behavior:auto !important;transition-delay:0s !important;transition-duration:0s !important}}:host{box-sizing:border-box;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;position:relative;-webkit-tap-highlight-color:transparent;text-size-adjust:100%}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{--_dwc-transition:0;--_dwc-menubar-height:var(--dwc-menubar-height, 0px);--_dwc-drawer-width:var(--dwc-app-layout-drawer-width, var(--_dwc-app-layout-drawer-width, 16em));--_dwc-header-height:var(--dwc-app-layout-header-height, var(--_dwc-app-layout-header-height, 0));--_dwc-footer-height:var(--dwc-app-layout-footer-height, var(--_dwc-app-layout-footer-height, 0));--_dwc-vh:calc((var(--dwc-vh, 1vh) * 100) - var(--_dwc-menubar-height));--dwc-drawer-body-space:0;background-color:var(--dwc-surface-1);display:block;height:100%;overflow:hidden;padding-bottom:var(--_dwc-footer-height);padding-top:var(--_dwc-header-height);transition:padding var(--_dwc-transition);width:100%}:host>*{transform:translateZ(0)}:host([data-header-hidden]){padding-top:0}:host([data-footer-hidden]){padding-bottom:0}:host([drawer-opened]:not([drawer-opened=false])[drawer-placement=left]:not([drawer-popover])){padding-left:var(--_dwc-drawer-width)}:host([drawer-opened]:not([drawer-opened=false])[drawer-placement=right]:not([drawer-popover])){padding-right:var(--_dwc-drawer-width)}.header,.footer{background-color:var(--dwc-surface-3);position:absolute;width:100%;z-index:1}.header--fixed,.footer--fixed{position:fixed}.header{border-bottom:var(--dwc-border-width) solid var(--dwc-color-default);padding-top:var(--dwc-safe-area-inset-top, 0);top:var(--_dwc-menubar-height);transition:left var(--_dwc-transition), top var(--_dwc-transition), width var(--_dwc-transition)}.header--hidden{top:calc(var(--_dwc-menubar-height) + -1 * var(--dwc-app-layout-header-collapse-height, 100%))}.header--shadowAlways,.header--shadowScroll:not(.header--scrollTop){box-shadow:0 2px 4px 0 hsla(var(--dwc-shadow-color), 0.2)}.header--noContent{display:none}.footer{border-top:var(--dwc-border-width) solid var(--dwc-color-default);bottom:0;padding-bottom:var(--dwc-safe-area-inset-bottom, 0);top:auto;transition:left var(--_dwc-transition), bottom var(--_dwc-transition), width var(--_dwc-transition)}.footer--shadowAlways,.footer--shadowScroll:not(.footer--scrollBottom){box-shadow:0 -2px 4px 0 hsla(var(--dwc-shadow-color), 0.2)}.footer--hidden{bottom:calc(-1 * var(--dwc-app-layout-footer-collapse-height, 100%))}.footer--noContent{display:none}.header--drawerRight,.footer--drawerRight{left:0;right:auto}.header--drawerLeft,.footer--drawerLeft{left:auto;right:0}.header--offscreen.header--drawerOpened:not(.header--drawerPopover),.footer--offscreen.footer--drawerOpened:not(.footer--drawerPopover){width:calc(100% - var(--_dwc-drawer-width))}.drawer{--dwc-drawer-top:var(--_dwc-menubar-height);--dwc-drawer-size:var(--_dwc-drawer-width)}.drawer::part(control){height:calc(100% - var(--_dwc-menubar-height))}.drawer::part(close-button){display:none}.drawer::part(footer){text-align:left}.drawer:not(.drawer--popover){--dwc-drawer-bottom:var(--_dwc-footer-height);--dwc-drawer-top:calc(var(--_dwc-menubar-height) + var(--_dwc-header-height));--dwc-drawer-max-size:100%;height:100%;pointer-events:none}.drawer:not(.drawer--popover)::part(control){box-shadow:none;height:calc(100% - var(--_dwc-header-height) - var(--_dwc-footer-height) - var(--_dwc-menubar-height));pointer-events:auto}.drawer:not(.drawer--popover)::part(backdrop){display:none}.drawer[placement=left]:not(.drawer--popover){max-width:var(--_dwc-drawer-width, 90%);width:var(--_dwc-drawer-width, 16em)}.drawer--headerOffscreen:not(.drawer--popover){--dwc-drawer-top:0}.drawer--headerOffscreen:not(.drawer--popover)::part(control){height:calc(100% - var(--_dwc-footer-height) - var(--_dwc-menubar-height))}.drawer--footerOffscreen:not(.drawer--popover){--dwc-drawer-bottom:0}.drawer--footerOffscreen:not(.drawer--popover)::part(control){height:calc(100% - var(--_dwc-header-height) - var(--_dwc-menubar-height))}.drawer--offscreen:not(.drawer--popover){--dwc-drawer-top:var(--_dwc-menubar-height);--dwc-drawer-bottom:0}.drawer--offscreen:not(.drawer--popover)::part(control){height:calc(100% - var(--_dwc-menubar-height))}.content{--_dwc-content-height:100%;height:var(--_dwc-content-height);min-height:var(--dwc-safe-area-inset-bottom, var(--_dwc-content-height));-webkit-overflow-scrolling:touch;overscroll-behavior-y:none;padding-bottom:max(var(--dwc-space-m), var(--dwc-safe-area-inset-bottom));padding-left:max(var(--dwc-space-m), var(--dwc-safe-area-inset-left));padding-right:max(var(--dwc-space-m), var(--dwc-safe-area-inset-right));padding-top:max(var(--dwc-space-m), var(--dwc-safe-area-inset-top));scroll-behavior:smooth}.content--fitViewport{--_dwc-content-height:var(--_dwc-vh);overflow:auto}.content--fitViewport:not(.content--headerHidden){--_dwc-content-height:calc(var(--_dwc-vh) - var(--_dwc-header-height))}.content--fitViewport:not(.content--footerHidden){--_dwc-content-height:calc(var(--_dwc-vh) - var(--_dwc-footer-height))}.content--fitViewport:not(.content--headerHidden):not(.content--footerHidden){--_dwc-content-height:calc(var(--_dwc-vh) - var(--_dwc-header-height) - var(--_dwc-footer-height))}";export{h as dwc_app_layout}