123456 |
- /*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.82
- */
- import{r as t,c as e,h as i,F as a,g as n}from"./p-f74193a3.js";import{a as o,g as l,t as r}from"./p-f383e414.js";import{H as s}from"./p-d38ffb30.js";import{S as c}from"./p-89b2f38d.js";import{c as d,d as h}from"./p-7266932c.js";import{u as m}from"./p-ee9b4197.js";import{c as p}from"./p-e9e1dee1.js";import"./p-dc14a2a0.js";const f=class{constructor(i){t(this,i),this.calcitePanelDismiss=e(this,"calcitePanelDismiss",7),this.calcitePanelDismissedChange=e(this,"calcitePanelDismissedChange",7),this.calcitePanelScroll=e(this,"calcitePanelScroll",7),this.calcitePanelBackClick=e(this,"calcitePanelBackClick",7),this.dismissed=!1,this.disabled=!1,this.dismissible=!1,this.showBackButton=!1,this.loading=!1,this.menuOpen=!1,this.resizeObserver=p("resize",(()=>this.resizeHandler())),this.resizeHandler=()=>{const{panelScrollEl:t}=this;t&&"number"==typeof t.scrollHeight&&"number"==typeof t.offsetHeight&&(t.tabIndex=t.scrollHeight>t.offsetHeight?0:-1)},this.setContainerRef=t=>{this.containerEl=t},this.setDismissRef=t=>{this.dismissButtonEl=t},this.setBackRef=t=>{this.backButtonEl=t},this.panelKeyDownHandler=t=>{"Escape"===t.key&&this.dismiss()},this.dismiss=()=>{this.dismissed=!0,this.calcitePanelDismiss.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.backButtonClick=()=>{this.calcitePanelBackClick.emit()},this.setPanelScrollEl=t=>{var e,i;this.panelScrollEl=t,null===(e=this.resizeObserver)||void 0===e||e.disconnect(),t&&(null===(i=this.resizeObserver)||void 0===i||i.observe(t),this.resizeHandler())}}dismissedHandler(){this.calcitePanelDismissedChange.emit()}componentDidRender(){m(this)}connectedCallback(){d(this)}disconnectedCallback(){var t;h(this),null===(t=this.resizeObserver)||void 0===t||t.disconnect()}async setFocus(t){var e,i,a;"dismiss-button"!==t?"back-button"!==t?null===(a=this.containerEl)||void 0===a||a.focus():null===(i=this.backButtonEl)||void 0===i||i.setFocus():null===(e=this.dismissButtonEl)||void 0===e||e.setFocus()}async scrollContentTo(t){var e;null===(e=this.panelScrollEl)||void 0===e||e.scrollTo(t)}renderBackButton(){const{el:t}=this,e="rtl"===o(t),{showBackButton:a,intlBack:n,backButtonClick:l}=this,r=n||"Back";return a?i("calcite-action",{"aria-label":r,class:"back-button",icon:e?"chevron-right":"chevron-left",key:"back-button",onClick:l,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:r}):null}renderHeaderContent(){const{heading:t,headingLevel:e,summary:a}=this,n=t?i(s,{class:"heading",level:e||3},t):null,o=a?i("span",{class:"summary"},a):null;return n||o?i("div",{class:"header-content",key:"header-content"},n,o):null}renderHeaderSlottedContent(){return i("div",{class:"header-content",key:"slotted-header-content"},i("slot",{name:"header-content"}))}renderHeaderStartActions(){const{el:t}=this;return l(t,"header-actions-start")?i("div",{class:{"header-actions--start":!0,"header-actions":!0},key:"header-actions-start"},i("slot",{name:"header-actions-start"})):null}renderHeaderActionsEnd(){const{dismiss:t,dismissible:e,el:a,intlClose:n}=this,o=n||"Close",r=e?i("calcite-action",{"aria-label":o,icon:"x",onClick:t,ref:this.setDismissRef,text:o}):null,s=i("slot",{name:"header-actions-end"});return l(a,"header-actions-end")||r?i("div",{class:{"header-actions--end":!0,"header-actions":!0},key:"header-actions-end"},s,r):null}renderMenu(){const{el:t,intlOptions:e,menuOpen:a}=this;return l(t,"header-menu-actions")?i("calcite-action-menu",{flipPlacements:["top","bottom"],key:"menu",label:e||"Options",open:a,placement:"bottom-end"},i("calcite-action",{icon:"ellipsis",slot:c.trigger,text:e||"Options"}),i("slot",{name:"header-menu-actions"})):null}renderHeaderNode(){const{el:t,showBackButton:e}=this,a=this.renderBackButton(),n=l(t,"header-content")?this.renderHeaderSlottedContent():this.renderHeaderContent(),o=this.renderHeaderStartActions(),r=this.renderHeaderActionsEnd(),s=this.renderMenu();return o||n||r||s||e?i("header",{class:"header"},a,o,n,r,s):null}renderFooterNode(){const{el:t}=this,e=l(t,"footer"),a=l(t,"footer-actions");return e||a?i("footer",{class:"footer",key:"footer"},e?i("slot",{key:"footer-slot",name:"footer"}):null,a?i("slot",{key:"footer-actions-slot",name:"footer-actions"}):null):null}renderContent(){const{el:t}=this,e=l(t,"fab"),a=i("slot",{key:"default-slot"}),n="content-wrapper";return e?i("div",{class:{"content-wrapper":!0,"content-height":!0},key:n,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},i("section",{class:"content-container"},a),this.renderFab()):i("section",{class:{"content-wrapper":!0,"content-container":!0},key:n,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},a)}renderFab(){return i("div",{class:"fab-container"},i("slot",{name:"fab"}))}render(){const{dismissed:t,dismissible:e,loading:n,panelKeyDownHandler:o}=this,l=i("article",{"aria-busy":r(n),class:"container",hidden:e&&t,onKeyDown:o,ref:this.setContainerRef,tabIndex:e?0:-1},this.renderHeaderNode(),this.renderContent(),this.renderFooterNode());return i(a,null,n?i("calcite-scrim",{loading:n}):null,l)}get el(){return n(this)}static get watchers(){return{dismissed:["dismissedHandler"]}}};f.style="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:host{-webkit-box-sizing:border-box;box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:-ms-flexbox;display:flex;width:100%;-ms-flex:1 1 auto;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3);--calcite-panel-max-height:unset;--calcite-panel-width:100%;--calcite-panel-min-width:unset;--calcite-panel-max-width:unset}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:-ms-flexbox;display:flex;-ms-flex-line-pack:justify;align-content:space-between;-ms-flex-align:center;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{-ms-flex:1 1 auto;flex:1 1 auto;padding:0.5rem}h1.heading{font-size:var(--calcite-font-size-2);line-height:1.5rem}h2.heading{font-size:var(--calcite-font-size-1);line-height:1.5rem}h3.heading{font-size:var(--calcite-font-size-0);line-height:1.25rem}h4.heading,h5.heading{font-size:var(--calcite-font-size--1);line-height:1rem}.container{margin:0px;display:-ms-flexbox;display:flex;width:100%;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;max-height:var(--calcite-panel-max-height);width:var(--calcite-panel-width);max-width:var(--calcite-panel-max-width);min-width:var(--calcite-panel-min-width);-webkit-transition:max-height var(--calcite-animation-timing), width var(--calcite-animation-timing);transition:max-height var(--calcite-animation-timing), width var(--calcite-animation-timing)}:host([height-scale=s]){--calcite-panel-max-height:40vh}:host([height-scale=m]){--calcite-panel-max-height:60vh}:host([height-scale=l]){--calcite-panel-max-height:80vh}:host([width-scale=s]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 12vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 300px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 150px)}:host([width-scale=m]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 20vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 420px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 240px)}:host([width-scale=l]){--calcite-panel-width:calc(var(--calcite-panel-width-multiplier) * 45vw);--calcite-panel-max-width:calc(var(--calcite-panel-width-multiplier) * 680px);--calcite-panel-min-width:calc(var(--calcite-panel-width-multiplier) * 340px)}.container[hidden]{display:none}:host([loading]) .container,:host([disabled]) .container{position:relative}.header{border-bottom:1px solid;position:-webkit-sticky;position:sticky;top:0px;width:100%;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:start;justify-content:flex-start;background-color:var(--calcite-ui-foreground-1);border-bottom-color:var(--calcite-ui-border-3);-ms-flex:0 0 auto;flex:0 0 auto}.header-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;padding-left:0.75rem;padding-right:0.75rem;padding-top:0.875rem;padding-bottom:0.875rem;-webkit-margin-end:auto;margin-inline-end:auto}.header-content .heading,.header-content .summary{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-bottom:0px}.header-content .summary{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:stretch;align-items:stretch}.header-actions--end,.menu-container:only-child{-webkit-margin-start:auto;margin-inline-start:auto}.menu-button{position:relative;height:100%;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-item-align:stretch;align-self:stretch}.menu{min-width:10rem;-ms-flex-flow:column nowrap;flex-flow:column nowrap}.content-wrapper{overflow:auto}.content-height{height:100%}.content-container{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-ms-flex-align:stretch;align-items:stretch;background-color:var(--calcite-ui-background)}.footer{border-top:1px solid;position:-webkit-sticky;position:sticky;bottom:0px;display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);border-top-color:var(--calcite-ui-border-3);-ms-flex:0 0 auto;flex:0 0 auto;min-height:3rem;padding:0.5rem}.fab-container{position:-webkit-sticky;position:sticky;bottom:0px;left:0px;right:0px;margin-top:0px;margin-bottom:0px;margin-left:auto;margin-right:auto;display:block;padding:0.5rem;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content}";export{f as calcite_panel}
|