p-a2ddecc3.entry.js 12 KB

123456
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.97
  5. */
  6. import{r as i,c as t,h as a,F as e,g as n}from"./p-91755387.js";import{g as c,a as r,t as o}from"./p-96bf42e5.js";import{H as l,c as s}from"./p-25482df1.js";import{c as d,d as m}from"./p-a2f5420b.js";import{c as p}from"./p-8dc9be64.js";import"./p-af9e6e54.js";import"./p-d5bfadd8.js";const h=class{constructor(a){i(this,a),this.calciteTipDismiss=t(this,"calciteTipDismiss",6),this.dismissed=!1,this.nonDismissible=!1,this.selected=!1,this.hideTip=()=>{this.dismissed=!0,this.calciteTipDismiss.emit()}}connectedCallback(){d(this)}disconnectedCallback(){m(this)}renderHeader(){var i;const{heading:t,headingLevel:e,el:n}=this,c=null===(i=n.closest("calcite-tip-manager"))||void 0===i?void 0:i.headingLevel,r=c?s(c+1):null;return t?a("header",{class:"header"},a(l,{class:"heading",level:e||r||3},t)):null}renderDismissButton(){const{nonDismissible:i,hideTip:t,intlClose:e}=this;return i?null:a("calcite-action",{class:"close",icon:"x",onClick:t,scale:"l",text:e||"Close"})}renderImageFrame(){const{el:i}=this;return c(i,"thumbnail")?a("div",{class:"image-frame",key:"thumbnail"},a("slot",{name:"thumbnail"})):null}renderInfoNode(){return a("div",{class:"info"},a("slot",null))}renderContent(){return a("div",{class:"content"},this.renderImageFrame(),this.renderInfoNode())}render(){return a(e,null,a("article",{class:"container"},this.renderHeader(),this.renderContent()),this.renderDismissButton())}get el(){return n(this)}};h.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;margin:1rem;box-sizing:border-box;display:flex;flex-direction:row;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-2);background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}:host *{box-sizing:border-box}.container{inline-size:100%;padding:1rem}:host([dismissed]),:host([dismissed]) .container{display:none}:host([selected]) .container{margin:0px;border-style:none;padding:0px}.header{margin:0px;display:flex;align-content:space-between;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{flex:1 1 auto;padding:0.5rem}.header{margin-block-end:0.5rem}.header .heading{padding:0px;font-size:var(--calcite-font-size-0);line-height:1.25rem;color:var(--calcite-ui-text-1)}.container[hidden]{display:none}.content{display:flex}.info{padding-block:0px;padding-inline:1rem;inline-size:70%}.info:only-child{inline-size:100%;padding-inline:0px}::slotted(p){margin-block-start:0px}::slotted(a){outline-color:transparent;color:var(--calcite-ui-brand)}::slotted(a:focus){outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.image-frame{inline-size:25%}.image-frame img{max-inline-size:100%}::slotted(img){max-inline-size:100%}";const g=class{constructor(t){i(this,t)}render(){return a("slot",null)}};g.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{box-sizing:border-box;display:block;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}::slotted(calcite-tip){margin:0px;border-style:none}:host-context(calcite-tip-manager){margin-block:0.75rem}:host-context(calcite-tip-manager) ::slotted(calcite-tip){padding:1rem}";const f=class{constructor(a){i(this,a),this.calciteTipManagerToggle=t(this,"calciteTipManagerToggle",6),this.calciteTipManagerClose=t(this,"calciteTipManagerClose",6),this.closed=!1,this.mutationObserver=p("mutation",(()=>this.setUpTips())),this.hideTipManager=()=>{this.closed=!0,this.calciteTipManagerToggle.emit(),this.calciteTipManagerClose.emit()},this.previousClicked=()=>{this.previousTip()},this.nextClicked=()=>{this.nextTip()},this.tipManagerKeyDownHandler=i=>{if(i.target===this.container)switch(i.key){case"ArrowRight":i.preventDefault(),this.nextTip();break;case"ArrowLeft":i.preventDefault(),this.previousTip();break;case"Home":i.preventDefault(),this.selectedIndex=0;break;case"End":i.preventDefault(),this.selectedIndex=this.total-1}},this.storeContainerRef=i=>{this.container=i}}closedChangeHandler(){this.direction=null,this.calciteTipManagerToggle.emit()}selectedChangeHandler(){this.showSelectedTip(),this.updateGroupTitle()}connectedCallback(){var i;this.setUpTips(),null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0})}disconnectedCallback(){var i;null===(i=this.mutationObserver)||void 0===i||i.disconnect()}async nextTip(){this.direction="advancing",this.selectedIndex=(this.selectedIndex+1+this.total)%this.total}async previousTip(){this.direction="retreating",this.selectedIndex=(this.selectedIndex-1+this.total)%this.total}setUpTips(){const i=Array.from(this.el.querySelectorAll("calcite-tip"));if(this.total=i.length,0===this.total)return;const t=this.el.querySelector("calcite-tip[selected]");this.tips=i,this.selectedIndex=t?i.indexOf(t):0,i.forEach((i=>{i.nonDismissible=!0})),this.showSelectedTip(),this.updateGroupTitle()}showSelectedTip(){this.tips.forEach(((i,t)=>{const a=this.selectedIndex===t;i.selected=a,i.hidden=!a}))}updateGroupTitle(){const i=this.tips[this.selectedIndex].closest("calcite-tip-group");this.groupTitle=(null==i?void 0:i.groupTitle)||this.intlDefaultTitle||"Tips"}renderPagination(){const i=r(this.el),{selectedIndex:t,tips:e,total:n,intlNext:c,intlPrevious:o,intlPaginationLabel:l}=this,s=c||"Next",d=l||"Tip";return e.length>1?a("footer",{class:"pagination"},a("calcite-action",{class:"page-previous",icon:"ltr"===i?"chevron-left":"chevron-right",onClick:this.previousClicked,scale:"m",text:o||"Previous"}),a("span",{class:"page-position"},`${d} ${t+1}/${n}`),a("calcite-action",{class:"page-next",icon:"ltr"===i?"chevron-right":"chevron-left",onClick:this.nextClicked,scale:"m",text:s})):null}render(){const{closed:i,direction:t,headingLevel:e,groupTitle:n,selectedIndex:c,intlClose:r,total:s}=this,d=r||"Close";return 0===s?null:a("section",{"aria-hidden":o(i),class:"container",hidden:i,onKeyDown:this.tipManagerKeyDownHandler,ref:this.storeContainerRef,tabIndex:0},a("header",{class:"header"},a(l,{class:"heading",level:e||2},n),a("calcite-action",{class:"close",onClick:this.hideTipManager,scale:"m",text:d},a("calcite-icon",{icon:"x",scale:"m"}))),a("div",{class:{"tip-container":!0,"tip-container--advancing":!i&&"advancing"===t,"tip-container--retreating":!i&&"retreating"===t},key:c,tabIndex:0},a("slot",null)),this.renderPagination())}get el(){return n(this)}static get watchers(){return{closed:["closedChangeHandler"],selectedIndex:["selectedChangeHandler"]}}};f.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity: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;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{box-sizing:border-box;display:block;background-color:var(--calcite-ui-foreground-1);font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2);--calcite-tip-manager-height:19vh}:host *{box-sizing:border-box}:host([closed]){display:none}.header{margin:0px;display:flex;align-content:space-between;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{flex:1 1 auto;padding:0.5rem}.header{border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);padding-block:0px;padding-inline-end:0px;padding-inline-start:1rem}.header .heading{padding:0px;font-size:var(--calcite-font-size-1);line-height:1.5rem;font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-1)}.container{position:relative;overflow:hidden;outline-color:transparent;min-block-size:150px}.container:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.tip-container{margin-block-start:1px;display:flex;align-items:flex-start;justify-content:center;overflow:auto;outline-color:transparent;animation-name:none;animation-duration:var(--calcite-animation-timing);block-size:var(--calcite-tip-manager-height)}.tip-container:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}::slotted(calcite-tip){border-style:none;padding:0.75rem;max-inline-size:var(--calcite-tip-max-width)}.tip-container--advancing{animation-name:tip-advance}.tip-container--retreating{animation-name:tip-retreat}.pagination{display:flex;align-items:center;justify-content:center;padding-inline:0px;padding-block:0.75rem 0.5rem}.page-position{margin-block:0px;margin-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}@keyframes tip-advance{0%{opacity:0;transform:translate3d(50px, 0, 0) scale(0.99)}100%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}}@keyframes tip-retreat{0%{opacity:0;transform:translate3d(-50px, 0, 0) scale(0.99)}100%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}}";export{h as calcite_tip,g as calcite_tip_group,f as calcite_tip_manager}