@esri/calcite-components 1.0.0-next.424 → 1.0.0-next.425

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.
@@ -20,14 +20,6 @@ const Tab = class {
20
20
  this.active = false;
21
21
  /** @internal Parent tabs component scale value */
22
22
  this.scale = "m";
23
- //--------------------------------------------------------------------------
24
- //
25
- // Private State/Props
26
- //
27
- //--------------------------------------------------------------------------
28
- /**
29
- * @internal
30
- */
31
23
  this.guid = `calcite-tab-title-${guid()}`;
32
24
  }
33
25
  //--------------------------------------------------------------------------
@@ -39,12 +31,15 @@ const Tab = class {
39
31
  const id = this.el.id || this.guid;
40
32
  return (h(Host, { "aria-expanded": this.active.toString(), "aria-labelledby": this.labeledBy, id: id, role: "tabpanel" }, h("section", null, h("slot", null))));
41
33
  }
34
+ connectedCallback() {
35
+ this.parentTabsEl = this.el.closest("calcite-tabs");
36
+ }
42
37
  componentDidLoad() {
43
38
  this.calciteTabRegister.emit();
44
39
  }
45
40
  componentWillRender() {
46
41
  var _a;
47
- this.scale = (_a = this.el.closest("calcite-tabs")) === null || _a === void 0 ? void 0 : _a.scale;
42
+ this.scale = (_a = this.parentTabsEl) === null || _a === void 0 ? void 0 : _a.scale;
48
43
  }
49
44
  disconnectedCallback() {
50
45
  var _a;
@@ -59,10 +54,13 @@ const Tab = class {
59
54
  //
60
55
  //--------------------------------------------------------------------------
61
56
  tabChangeHandler(event) {
57
+ const targetTabsEl = event
58
+ .composedPath()
59
+ .find((el) => el.tagName === "CALCITE-TABS");
62
60
  // to allow `<calcite-tabs>` to be nested we need to make sure this
63
- // `calciteTabChange` event was actually fired from a title that is a
64
- // child of the `<calcite-tabs>` that is the a parent of this tab.
65
- if (!event.composedPath().includes(this.el.closest("calcite-tabs"))) {
61
+ // `calciteTabChange` event was actually fired from a within the same
62
+ // `<calcite-tabs>` that is the a parent of this tab.
63
+ if (targetTabsEl !== this.parentTabsEl) {
66
64
  return;
67
65
  }
68
66
  if (this.tab) {
@@ -149,6 +147,9 @@ const TabNav = class {
149
147
  // Lifecycle
150
148
  //
151
149
  //--------------------------------------------------------------------------
150
+ connectedCallback() {
151
+ this.parentTabsEl = this.el.closest("calcite-tabs");
152
+ }
152
153
  componentWillLoad() {
153
154
  const storageKey = `calcite-tab-nav-${this.storageId}`;
154
155
  if (localStorage && this.storageId && localStorage.getItem(storageKey)) {
@@ -160,11 +161,11 @@ const TabNav = class {
160
161
  }
161
162
  }
162
163
  componentWillRender() {
163
- var _a, _b, _c, _d;
164
- this.layout = (_a = this.el.closest("calcite-tabs")) === null || _a === void 0 ? void 0 : _a.layout;
165
- this.position = (_b = this.el.closest("calcite-tabs")) === null || _b === void 0 ? void 0 : _b.position;
166
- this.scale = (_c = this.el.closest("calcite-tabs")) === null || _c === void 0 ? void 0 : _c.scale;
167
- this.bordered = (_d = this.el.closest("calcite-tabs")) === null || _d === void 0 ? void 0 : _d.bordered;
164
+ const { parentTabsEl } = this;
165
+ this.layout = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.layout;
166
+ this.position = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.position;
167
+ this.scale = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.scale;
168
+ this.bordered = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.bordered;
168
169
  // fix issue with active tab-title not lining up with blue indicator
169
170
  if (this.selectedTabEl) {
170
171
  this.updateOffsetPosition();
@@ -305,9 +306,6 @@ const TabTitle = class {
305
306
  this.mutationObserver = createObserver("mutation", () => this.updateHasText());
306
307
  /** determine if there is slotted text for styling purposes */
307
308
  this.hasText = false;
308
- /**
309
- * @internal
310
- */
311
309
  this.guid = `calcite-tab-title-${guid()}`;
312
310
  }
313
311
  activeTabChanged() {
@@ -376,15 +374,19 @@ const TabTitle = class {
376
374
  //
377
375
  //--------------------------------------------------------------------------
378
376
  tabChangeHandler(event) {
379
- if (event.composedPath().includes(this.parentTabNavEl)) {
380
- if (this.tab) {
381
- this.active = this.tab === event.detail.tab;
382
- }
383
- else {
384
- this.getTabIndex().then((index) => {
385
- this.active = index === event.detail.tab;
386
- });
387
- }
377
+ const targetTabsEl = event
378
+ .composedPath()
379
+ .find((el) => el.tagName === "CALCITE-TABS");
380
+ if (targetTabsEl !== this.parentTabsEl) {
381
+ return;
382
+ }
383
+ if (this.tab) {
384
+ this.active = this.tab === event.detail.tab;
385
+ }
386
+ else {
387
+ this.getTabIndex().then((index) => {
388
+ this.active = index === event.detail.tab;
389
+ });
388
390
  }
389
391
  }
390
392
  onClick() {
@@ -500,14 +502,12 @@ const Tabs = class {
500
502
  //
501
503
  //--------------------------------------------------------------------------
502
504
  /**
503
- * @internal
504
505
  *
505
506
  * Stores an array of ids of `<calcite-tab-titles>`s to match up ARIA
506
507
  * attributes.
507
508
  */
508
509
  this.titles = [];
509
510
  /**
510
- * @internal
511
511
  *
512
512
  * Stores an array of ids of `<calcite-tab>`s to match up ARIA attributes.
513
513
  */
@@ -569,7 +569,6 @@ const Tabs = class {
569
569
  //
570
570
  //--------------------------------------------------------------------------
571
571
  /**
572
- * @internal
573
572
  *
574
573
  * Matches up elements from the internal `tabs` and `titles` to automatically
575
574
  * update the ARIA attributes and link `<calcite-tab>` and
@@ -2,4 +2,4 @@ var __awaiter=this&&this.__awaiter||function(t,e,i,a){function n(t){return t ins
2
2
  /*!
3
3
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
4
4
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
5
- */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,F as Fragment}from"./index-bd94948c.js";import{g as guid}from"./guid-196bd5ea.js";import{n as nodeListToArray,a as getElementDir,k as filterDirectChildren,d as getElementProp}from"./dom-e7fa77b9.js";import{c as createObserver}from"./observers-46118290.js";import{u as updateHostInteraction}from"./interactive-48b5cc0f.js";var tabCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([active]) section{display:block}:host{display:none;height:100%;width:100%}:host([active]){display:block;height:100%;width:100%;overflow:auto}section{display:none;height:100%;width:100%}:host([scale=s]){padding-top:0.25rem;padding-bottom:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}";var Tab=function(){function t(t){registerInstance(this,t);this.calciteTabRegister=createEvent(this,"calciteTabRegister",7);this.active=false;this.scale="m";this.guid="calcite-tab-title-".concat(guid())}t.prototype.render=function(){var t=this.el.id||this.guid;return h(Host,{"aria-expanded":this.active.toString(),"aria-labelledby":this.labeledBy,id:t,role:"tabpanel"},h("section",null,h("slot",null)))};t.prototype.componentDidLoad=function(){this.calciteTabRegister.emit()};t.prototype.componentWillRender=function(){var t;this.scale=(t=this.el.closest("calcite-tabs"))===null||t===void 0?void 0:t.scale};t.prototype.disconnectedCallback=function(){var t;(t=document.body)===null||t===void 0?void 0:t.dispatchEvent(new CustomEvent("calciteTabUnregister",{detail:this.el}))};t.prototype.tabChangeHandler=function(t){var e=this;if(!t.composedPath().includes(this.el.closest("calcite-tabs"))){return}if(this.tab){this.active=this.tab===t.detail.tab}else{this.getTabIndex().then((function(i){e.active=i===t.detail.tab}))}};t.prototype.getTabIndex=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,Array.prototype.indexOf.call(nodeListToArray(this.el.parentElement.children).filter((function(t){return t.matches("calcite-tab")})),this.el)]}))}))};t.prototype.updateAriaInfo=function(t,e){if(t===void 0){t=[]}if(e===void 0){e=[]}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.labeledBy=e[t.indexOf(this.el.id)]||null;return[2]}))}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Tab.style=tabCss;var tabNavCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:-ms-flexbox;display:flex}:host([scale=s]){min-height:1.5rem}:host([scale=m]){min-height:2rem}:host([scale=l]){min-height:2.75rem}.tab-nav{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:start;justify-content:flex-start;overflow:auto}:host([layout=center]) .tab-nav{-ms-flex-pack:center;justify-content:center}.tab-nav-active-indicator-container{position:absolute;left:0px;right:0px;bottom:0px;height:0.125rem;width:100%;overflow:hidden}.tab-nav-active-indicator{position:absolute;bottom:0px;display:block;height:0.125rem;background-color:var(--calcite-ui-brand);-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}:host([position=below]) .tab-nav-active-indicator{bottom:unset;top:0px}:host([position=below]) .tab-nav-active-indicator-container{bottom:unset;top:0px}:host([bordered]) .tab-nav-active-indicator-container{bottom:unset}:host([bordered][position=below]) .tab-nav-active-indicator-container{bottom:0;top:unset}";var TabNav=function(){function t(t){var e=this;registerInstance(this,t);this.calciteTabChange=createEvent(this,"calciteTabChange",7);this.scale="m";this.layout="inline";this.position="below";this.bordered=false;this.animationActiveDuration=.3;this.handleContainerScroll=function(){e.activeIndicatorEl.style.transitionDuration="0s";e.updateOffsetPosition()}}t.prototype.selectedTabChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(localStorage&&this.storageId&&this.selectedTab!==undefined&&this.selectedTab!==null){localStorage.setItem("calcite-tab-nav-".concat(this.storageId),JSON.stringify(this.selectedTab))}this.calciteTabChange.emit({tab:this.selectedTab});t=this;return[4,this.getTabTitleById(this.selectedTab)];case 1:t.selectedTabEl=e.sent();return[2]}}))}))};t.prototype.selectedTabElChanged=function(){this.updateOffsetPosition();this.updateActiveWidth();this.activeIndicatorEl.style.transitionDuration="".concat(this.animationActiveDuration,"s")};t.prototype.componentWillLoad=function(){var t="calcite-tab-nav-".concat(this.storageId);if(localStorage&&this.storageId&&localStorage.getItem(t)){var e=JSON.parse(localStorage.getItem(t));this.selectedTab=e;this.calciteTabChange.emit({tab:this.selectedTab})}};t.prototype.componentWillRender=function(){var t,e,i,a;this.layout=(t=this.el.closest("calcite-tabs"))===null||t===void 0?void 0:t.layout;this.position=(e=this.el.closest("calcite-tabs"))===null||e===void 0?void 0:e.position;this.scale=(i=this.el.closest("calcite-tabs"))===null||i===void 0?void 0:i.scale;this.bordered=(a=this.el.closest("calcite-tabs"))===null||a===void 0?void 0:a.bordered;if(this.selectedTabEl){this.updateOffsetPosition()}};t.prototype.componentDidRender=function(){var t=this;if(this.tabTitles.length&&this.tabTitles.every((function(t){return!t.active}))&&!this.selectedTab){this.tabTitles[0].getTabIdentifier().then((function(e){t.calciteTabChange.emit({tab:e})}))}};t.prototype.render=function(){var t=this;var e=getElementDir(this.el);var i="".concat(this.indicatorWidth,"px");var a="".concat(this.indicatorOffset,"px");var n=e!=="rtl"?{width:i,left:a}:{width:i,right:a};return h(Host,{role:"tablist"},h("div",{class:"tab-nav",onScroll:this.handleContainerScroll,ref:function(e){return t.tabNavEl=e}},h("div",{class:"tab-nav-active-indicator-container",ref:function(e){return t.activeIndicatorContainerEl=e}},h("div",{class:"tab-nav-active-indicator",ref:function(e){return t.activeIndicatorEl=e},style:n})),h("slot",null)))};t.prototype.resizeHandler=function(){this.activeIndicatorEl.style.transitionDuration="0s";this.updateActiveWidth();this.updateOffsetPosition()};t.prototype.focusPreviousTabHandler=function(t){var e=this.getIndexOfTabTitle(t.target,this.enabledTabTitles);var i=this.enabledTabTitles[e-1]||this.enabledTabTitles[this.enabledTabTitles.length-1];i.focus();t.stopPropagation();t.preventDefault()};t.prototype.focusNextTabHandler=function(t){var e=this.getIndexOfTabTitle(t.target,this.enabledTabTitles);var i=this.enabledTabTitles[e+1]||this.enabledTabTitles[0];i.focus();t.stopPropagation();t.preventDefault()};t.prototype.activateTabHandler=function(t){this.selectedTab=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(t.target);t.stopPropagation();t.preventDefault()};t.prototype.updateTabTitles=function(t){if(t.target.active){this.selectedTab=t.detail}};t.prototype.globalTabChangeHandler=function(t){if(this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTab!==t.detail.tab){this.selectedTab=t.detail.tab}};t.prototype.updateOffsetPosition=function(){var t,e,i,a,n;var r=getElementDir(this.el);var o=(t=this.activeIndicatorContainerEl)===null||t===void 0?void 0:t.offsetWidth;var s=(e=this.selectedTabEl)===null||e===void 0?void 0:e.offsetLeft;var c=(i=this.selectedTabEl)===null||i===void 0?void 0:i.offsetWidth;var l=o-(s+c);this.indicatorOffset=r!=="rtl"?s-((a=this.tabNavEl)===null||a===void 0?void 0:a.scrollLeft):l+((n=this.tabNavEl)===null||n===void 0?void 0:n.scrollLeft)};t.prototype.updateActiveWidth=function(){var t;this.indicatorWidth=(t=this.selectedTabEl)===null||t===void 0?void 0:t.offsetWidth};t.prototype.getIndexOfTabTitle=function(t,e){if(e===void 0){e=this.tabTitles}return e.indexOf(t)};t.prototype.getTabTitleById=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){return[2,Promise.all(this.tabTitles.map((function(t){return t.getTabIdentifier()}))).then((function(i){return e.tabTitles[i.indexOf(t)]}))]}))}))};Object.defineProperty(t.prototype,"tabTitles",{get:function(){return filterDirectChildren(this.el,"calcite-tab-title")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"enabledTabTitles",{get:function(){return filterDirectChildren(this.el,"calcite-tab-title:not([disabled])")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["selectedTabChanged"],selectedTabEl:["selectedTabElChanged"]}},enumerable:false,configurable:true});return t}();TabNav.style=tabNavCss;var tabTitleCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{margin-right:1.25rem;display:block;-ms-flex:0 1 auto;flex:0 1 auto;outline:2px solid transparent;outline-offset:2px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:1.25rem;margin-inline-end:1.25rem}:host([layout=center]){margin-top:0px;margin-bottom:0px;margin-left:1.25rem;margin-right:1.25rem;text-align:center;-ms-flex-preferred-size:12rem;flex-basis:12rem}:host([position=below]) a{border-bottom-width:0px;border-top-width:2px;border-top-color:transparent;border-top-style:solid}:host a{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}:host(:focus) a{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host(:active) a,:host(:focus) a,:host(:hover) a{border-color:var(--calcite-ui-border-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host([active]) a{border-color:transparent;color:var(--calcite-ui-text-1)}: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]) span,:host([disabled]) a{pointer-events:none;opacity:0.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){-webkit-margin-end:1rem;margin-inline-end:1rem}:host([scale=s]) a,:host([scale=s]) span{padding-top:0.25rem;padding-bottom:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) a,:host([scale=m]) span{padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){-webkit-margin-end:1.5rem;margin-inline-end:1.5rem}:host([scale=l]) a,:host([scale=l]) span{padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}a,span{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;width:100%;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-ms-flex-pack:center;justify-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom-width:2px;padding-left:0px;padding-right:0px;padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-3);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;border-bottom-color:transparent;border-bottom-style:solid}span{cursor:default}.calcite-tab-title--icon{position:relative;margin:0px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-item-align:center;align-self:center}.calcite-tab-title--icon svg{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}.container--has-text{padding:0.25rem}.container--has-text .calcite-tab-title--icon.icon-start{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}.container--has-text .calcite-tab-title--icon.icon-end{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-start][icon-end]) .calcite-tab-title--icon:first-child{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([bordered]){-webkit-margin-end:0;margin-inline-end:0}:host([bordered][active]){-webkit-box-shadow:inset 0px -2px var(--calcite-ui-foreground-1);box-shadow:inset 0px -2px var(--calcite-ui-foreground-1)}:host([bordered][active][position=below]){-webkit-box-shadow:inset 0 2px 0 var(--calcite-ui-foreground-1);box-shadow:inset 0 2px 0 var(--calcite-ui-foreground-1)}:host([bordered]:hover) a,:host([bordered]:focus) a,:host([bordered]:active) a{position:relative}:host([bordered]:hover) a{background-color:var(--calcite-button-transparent-hover);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}:host([bordered]) a{border-bottom-style:unset}:host([bordered][position=below]) a{border-top-style:unset}:host([active][bordered]) a{border-left:1px solid var(--calcite-ui-border-1);border-right:1px solid var(--calcite-ui-border-1)}:host([bordered]) a,:host([bordered]) span{padding-left:0.75rem;padding-right:0.75rem}:host([bordered][scale=s]) a,:host([bordered][scale=s]) span{padding-left:0.5rem;padding-right:0.5rem}:host([bordered][scale=l]) a,:host([bordered][scale=l]) span{padding-left:1rem;padding-right:1rem}";var TabTitle=function(){function t(t){var e=this;registerInstance(this,t);this.calciteTabsActivate=createEvent(this,"calciteTabsActivate",7);this.calciteTabsFocusNext=createEvent(this,"calciteTabsFocusNext",7);this.calciteTabsFocusPrevious=createEvent(this,"calciteTabsFocusPrevious",7);this.calciteTabTitleRegister=createEvent(this,"calciteTabTitleRegister",7);this.active=false;this.disabled=false;this.bordered=false;this.mutationObserver=createObserver("mutation",(function(){return e.updateHasText()}));this.hasText=false;this.guid="calcite-tab-title-".concat(guid())}t.prototype.activeTabChanged=function(){if(this.active){this.emitActiveTab()}};t.prototype.connectedCallback=function(){this.setupTextContentObserver();this.parentTabNavEl=this.el.closest("calcite-tab-nav");this.parentTabsEl=this.el.closest("calcite-tabs")};t.prototype.disconnectedCallback=function(){var t,e;(t=this.mutationObserver)===null||t===void 0?void 0:t.disconnect();(e=document.body)===null||e===void 0?void 0:e.dispatchEvent(new CustomEvent("calciteTabTitleUnregister",{detail:this.el}))};t.prototype.componentWillLoad=function(){{this.updateHasText()}if(this.tab&&this.active){this.emitActiveTab()}};t.prototype.componentWillRender=function(){if(this.parentTabsEl){this.layout=this.parentTabsEl.layout;this.position=this.parentTabsEl.position;this.scale=this.parentTabsEl.scale;this.bordered=this.parentTabsEl.bordered}if(!this.parentTabsEl&&this.parentTabNavEl){this.position=getElementProp(this.parentTabNavEl,"position",this.position);this.scale=getElementProp(this.parentTabNavEl,"scale",this.scale)}};t.prototype.render=function(){var t=this.el.id||this.guid;var e=this.bordered&&!this.disabled&&this.layout!=="center";var i=h("calcite-icon",{class:"calcite-tab-title--icon icon-start",flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:"s"});var a=h("calcite-icon",{class:"calcite-tab-title--icon icon-end",flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:"s"});return h(Host,{"aria-controls":this.controls,"aria-expanded":this.active.toString(),id:t,role:"tab"},h("a",{class:{container:true,"container--has-text":this.hasText},style:e&&{width:"".concat(this.parentTabNavEl.indicatorWidth,"px")}},this.iconStart?i:null,h("slot",null),this.iconEnd?a:null))};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:e=(t=this.calciteTabTitleRegister).emit;return[4,this.getTabIdentifier()];case 1:e.apply(t,[i.sent()]);return[2]}}))}))};t.prototype.componentDidRender=function(){updateHostInteraction(this,true)};t.prototype.tabChangeHandler=function(t){var e=this;if(t.composedPath().includes(this.parentTabNavEl)){if(this.tab){this.active=this.tab===t.detail.tab}else{this.getTabIndex().then((function(i){e.active=i===t.detail.tab}))}}};t.prototype.onClick=function(){this.emitActiveTab()};t.prototype.keyDownHandler=function(t){switch(t.key){case" ":case"Enter":this.emitActiveTab();t.preventDefault();break;case"ArrowRight":if(getElementDir(this.el)==="ltr"){this.calciteTabsFocusNext.emit()}else{this.calciteTabsFocusPrevious.emit()}break;case"ArrowLeft":if(getElementDir(this.el)==="ltr"){this.calciteTabsFocusPrevious.emit()}else{this.calciteTabsFocusNext.emit()}break}};t.prototype.getTabIndex=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-tab-title"),this.el)]}))}))};t.prototype.getTabIdentifier=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.tab?this.tab:this.getTabIndex()]}))}))};t.prototype.updateAriaInfo=function(t,e){if(t===void 0){t=[]}if(e===void 0){e=[]}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.controls=t[e.indexOf(this.el.id)]||null;return[2]}))}))};t.prototype.updateHasText=function(){this.hasText=this.el.textContent.trim().length>0};t.prototype.setupTextContentObserver=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.observe(this.el,{childList:true,subtree:true})};t.prototype.emitActiveTab=function(){if(!this.disabled){this.calciteTabsActivate.emit({tab:this.tab})}};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{active:["activeTabChanged"]}},enumerable:false,configurable:true});return t}();TabTitle.style=tabTitleCss;var SLOTS={tabNav:"tab-nav"};var tabsCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host([bordered]){-webkit-box-shadow:inset 0 1px 0 var(--calcite-ui-border-1);box-shadow:inset 0 1px 0 var(--calcite-ui-border-1);background-color:var(--calcite-ui-foreground-1)}:host([bordered]:not([position=below])) ::slotted(calcite-tab-nav){margin-bottom:-1px}:host([bordered][position=below]) ::slotted(calcite-tab-nav){margin-top:-1px}:host([bordered][position=below]){-webkit-box-shadow:inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1);box-shadow:inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1)}:host([bordered]) section{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1)}:host([bordered][scale=s]) section{padding:0.75rem}:host([bordered][scale=m]) section{padding:0.5rem}:host([bordered][scale=l]) section{padding:1rem}:host([position=below]){-ms-flex-direction:column-reverse;flex-direction:column-reverse}section{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;border-top-width:1px;border-top-color:var(--calcite-ui-border-1);overflow:hidden;border-top-style:solid}:host([position=below]) section{-ms-flex-direction:column-reverse;flex-direction:column-reverse;border-top-width:0px;border-bottom-width:1px;border-bottom-color:var(--calcite-ui-border-1)}:host([position=below]:not([bordered])) section{border-bottom-style:solid}";var Tabs=function(){function t(t){registerInstance(this,t);this.layout="inline";this.position="above";this.scale="m";this.bordered=false;this.titles=[];this.tabs=[]}t.prototype.connectedCallback=function(){if(this.layout==="center"){this.bordered=false}};t.prototype.render=function(){return h(Fragment,null,h("slot",{name:SLOTS.tabNav}),h("section",null,h("slot",null)))};t.prototype.calciteTabTitleRegister=function(t){this.titles=__spreadArray(__spreadArray([],this.titles,true),[t.target],false);this.registryHandler();t.stopPropagation()};t.prototype.calciteTabTitleUnregister=function(t){this.titles=this.titles.filter((function(e){return e!==t.detail}));this.registryHandler();t.stopPropagation()};t.prototype.calciteTabRegister=function(t){this.tabs=__spreadArray(__spreadArray([],this.tabs,true),[t.target],false);this.registryHandler();t.stopPropagation()};t.prototype.calciteTabUnregister=function(t){this.tabs=this.tabs.filter((function(e){return e!==t.detail}));this.registryHandler();t.stopPropagation()};t.prototype.registryHandler=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,a;var n=this;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.tabs.some((function(t){return t.tab}))||this.titles.some((function(t){return t.tab}))))return[3,1];t=this.tabs.sort((function(t,e){return t.tab.localeCompare(e.tab)})).map((function(t){return t.id}));e=this.titles.sort((function(t,e){return t.tab.localeCompare(e.tab)})).map((function(t){return t.id}));return[3,4];case 1:return[4,Promise.all(this.tabs.map((function(t){return t.getTabIndex()})))];case 2:i=r.sent();return[4,Promise.all(this.titles.map((function(t){return t.getTabIndex()})))];case 3:a=r.sent();t=i.reduce((function(t,e,i){t[e]=n.tabs[i].id;return t}),[]);e=a.reduce((function(t,e,i){t[e]=n.titles[i].id;return t}),[]);r.label=4;case 4:this.tabs.forEach((function(i){return i.updateAriaInfo(t,e)}));this.titles.forEach((function(i){return i.updateAriaInfo(t,e)}));return[2]}}))}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Tabs.style=tabsCss;export{Tab as calcite_tab,TabNav as calcite_tab_nav,TabTitle as calcite_tab_title,Tabs as calcite_tabs};
5
+ */import{r as registerInstance,c as createEvent,h,H as Host,g as getElement,F as Fragment}from"./index-bd94948c.js";import{g as guid}from"./guid-196bd5ea.js";import{n as nodeListToArray,a as getElementDir,k as filterDirectChildren,d as getElementProp}from"./dom-e7fa77b9.js";import{c as createObserver}from"./observers-46118290.js";import{u as updateHostInteraction}from"./interactive-48b5cc0f.js";var tabCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([active]) section{display:block}:host{display:none;height:100%;width:100%}:host([active]){display:block;height:100%;width:100%;overflow:auto}section{display:none;height:100%;width:100%}:host([scale=s]){padding-top:0.25rem;padding-bottom:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}";var Tab=function(){function t(t){registerInstance(this,t);this.calciteTabRegister=createEvent(this,"calciteTabRegister",7);this.active=false;this.scale="m";this.guid="calcite-tab-title-".concat(guid())}t.prototype.render=function(){var t=this.el.id||this.guid;return h(Host,{"aria-expanded":this.active.toString(),"aria-labelledby":this.labeledBy,id:t,role:"tabpanel"},h("section",null,h("slot",null)))};t.prototype.connectedCallback=function(){this.parentTabsEl=this.el.closest("calcite-tabs")};t.prototype.componentDidLoad=function(){this.calciteTabRegister.emit()};t.prototype.componentWillRender=function(){var t;this.scale=(t=this.parentTabsEl)===null||t===void 0?void 0:t.scale};t.prototype.disconnectedCallback=function(){var t;(t=document.body)===null||t===void 0?void 0:t.dispatchEvent(new CustomEvent("calciteTabUnregister",{detail:this.el}))};t.prototype.tabChangeHandler=function(t){var e=this;var i=t.composedPath().find((function(t){return t.tagName==="CALCITE-TABS"}));if(i!==this.parentTabsEl){return}if(this.tab){this.active=this.tab===t.detail.tab}else{this.getTabIndex().then((function(i){e.active=i===t.detail.tab}))}};t.prototype.getTabIndex=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,Array.prototype.indexOf.call(nodeListToArray(this.el.parentElement.children).filter((function(t){return t.matches("calcite-tab")})),this.el)]}))}))};t.prototype.updateAriaInfo=function(t,e){if(t===void 0){t=[]}if(e===void 0){e=[]}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.labeledBy=e[t.indexOf(this.el.id)]||null;return[2]}))}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Tab.style=tabCss;var tabNavCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{position:relative;display:-ms-flexbox;display:flex}:host([scale=s]){min-height:1.5rem}:host([scale=m]){min-height:2rem}:host([scale=l]){min-height:2.75rem}.tab-nav{display:-ms-flexbox;display:flex;width:100%;-ms-flex-pack:start;justify-content:flex-start;overflow:auto}:host([layout=center]) .tab-nav{-ms-flex-pack:center;justify-content:center}.tab-nav-active-indicator-container{position:absolute;left:0px;right:0px;bottom:0px;height:0.125rem;width:100%;overflow:hidden}.tab-nav-active-indicator{position:absolute;bottom:0px;display:block;height:0.125rem;background-color:var(--calcite-ui-brand);-webkit-transition-property:all;transition-property:all;-webkit-transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition-duration:150ms;transition-duration:150ms;-webkit-transition-timing-function:cubic-bezier(0, 0, 0.2, 1);transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}:host([position=below]) .tab-nav-active-indicator{bottom:unset;top:0px}:host([position=below]) .tab-nav-active-indicator-container{bottom:unset;top:0px}:host([bordered]) .tab-nav-active-indicator-container{bottom:unset}:host([bordered][position=below]) .tab-nav-active-indicator-container{bottom:0;top:unset}";var TabNav=function(){function t(t){var e=this;registerInstance(this,t);this.calciteTabChange=createEvent(this,"calciteTabChange",7);this.scale="m";this.layout="inline";this.position="below";this.bordered=false;this.animationActiveDuration=.3;this.handleContainerScroll=function(){e.activeIndicatorEl.style.transitionDuration="0s";e.updateOffsetPosition()}}t.prototype.selectedTabChanged=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(localStorage&&this.storageId&&this.selectedTab!==undefined&&this.selectedTab!==null){localStorage.setItem("calcite-tab-nav-".concat(this.storageId),JSON.stringify(this.selectedTab))}this.calciteTabChange.emit({tab:this.selectedTab});t=this;return[4,this.getTabTitleById(this.selectedTab)];case 1:t.selectedTabEl=e.sent();return[2]}}))}))};t.prototype.selectedTabElChanged=function(){this.updateOffsetPosition();this.updateActiveWidth();this.activeIndicatorEl.style.transitionDuration="".concat(this.animationActiveDuration,"s")};t.prototype.connectedCallback=function(){this.parentTabsEl=this.el.closest("calcite-tabs")};t.prototype.componentWillLoad=function(){var t="calcite-tab-nav-".concat(this.storageId);if(localStorage&&this.storageId&&localStorage.getItem(t)){var e=JSON.parse(localStorage.getItem(t));this.selectedTab=e;this.calciteTabChange.emit({tab:this.selectedTab})}};t.prototype.componentWillRender=function(){var t=this.parentTabsEl;this.layout=t===null||t===void 0?void 0:t.layout;this.position=t===null||t===void 0?void 0:t.position;this.scale=t===null||t===void 0?void 0:t.scale;this.bordered=t===null||t===void 0?void 0:t.bordered;if(this.selectedTabEl){this.updateOffsetPosition()}};t.prototype.componentDidRender=function(){var t=this;if(this.tabTitles.length&&this.tabTitles.every((function(t){return!t.active}))&&!this.selectedTab){this.tabTitles[0].getTabIdentifier().then((function(e){t.calciteTabChange.emit({tab:e})}))}};t.prototype.render=function(){var t=this;var e=getElementDir(this.el);var i="".concat(this.indicatorWidth,"px");var a="".concat(this.indicatorOffset,"px");var n=e!=="rtl"?{width:i,left:a}:{width:i,right:a};return h(Host,{role:"tablist"},h("div",{class:"tab-nav",onScroll:this.handleContainerScroll,ref:function(e){return t.tabNavEl=e}},h("div",{class:"tab-nav-active-indicator-container",ref:function(e){return t.activeIndicatorContainerEl=e}},h("div",{class:"tab-nav-active-indicator",ref:function(e){return t.activeIndicatorEl=e},style:n})),h("slot",null)))};t.prototype.resizeHandler=function(){this.activeIndicatorEl.style.transitionDuration="0s";this.updateActiveWidth();this.updateOffsetPosition()};t.prototype.focusPreviousTabHandler=function(t){var e=this.getIndexOfTabTitle(t.target,this.enabledTabTitles);var i=this.enabledTabTitles[e-1]||this.enabledTabTitles[this.enabledTabTitles.length-1];i.focus();t.stopPropagation();t.preventDefault()};t.prototype.focusNextTabHandler=function(t){var e=this.getIndexOfTabTitle(t.target,this.enabledTabTitles);var i=this.enabledTabTitles[e+1]||this.enabledTabTitles[0];i.focus();t.stopPropagation();t.preventDefault()};t.prototype.activateTabHandler=function(t){this.selectedTab=t.detail.tab?t.detail.tab:this.getIndexOfTabTitle(t.target);t.stopPropagation();t.preventDefault()};t.prototype.updateTabTitles=function(t){if(t.target.active){this.selectedTab=t.detail}};t.prototype.globalTabChangeHandler=function(t){if(this.syncId&&t.target!==this.el&&t.target.syncId===this.syncId&&this.selectedTab!==t.detail.tab){this.selectedTab=t.detail.tab}};t.prototype.updateOffsetPosition=function(){var t,e,i,a,n;var r=getElementDir(this.el);var o=(t=this.activeIndicatorContainerEl)===null||t===void 0?void 0:t.offsetWidth;var s=(e=this.selectedTabEl)===null||e===void 0?void 0:e.offsetLeft;var c=(i=this.selectedTabEl)===null||i===void 0?void 0:i.offsetWidth;var l=o-(s+c);this.indicatorOffset=r!=="rtl"?s-((a=this.tabNavEl)===null||a===void 0?void 0:a.scrollLeft):l+((n=this.tabNavEl)===null||n===void 0?void 0:n.scrollLeft)};t.prototype.updateActiveWidth=function(){var t;this.indicatorWidth=(t=this.selectedTabEl)===null||t===void 0?void 0:t.offsetWidth};t.prototype.getIndexOfTabTitle=function(t,e){if(e===void 0){e=this.tabTitles}return e.indexOf(t)};t.prototype.getTabTitleById=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){return[2,Promise.all(this.tabTitles.map((function(t){return t.getTabIdentifier()}))).then((function(i){return e.tabTitles[i.indexOf(t)]}))]}))}))};Object.defineProperty(t.prototype,"tabTitles",{get:function(){return filterDirectChildren(this.el,"calcite-tab-title")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"enabledTabTitles",{get:function(){return filterDirectChildren(this.el,"calcite-tab-title:not([disabled])")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["selectedTabChanged"],selectedTabEl:["selectedTabElChanged"]}},enumerable:false,configurable:true});return t}();TabNav.style=tabNavCss;var tabTitleCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{margin-right:1.25rem;display:block;-ms-flex:0 1 auto;flex:0 1 auto;outline:2px solid transparent;outline-offset:2px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:1.25rem;margin-inline-end:1.25rem}:host([layout=center]){margin-top:0px;margin-bottom:0px;margin-left:1.25rem;margin-right:1.25rem;text-align:center;-ms-flex-preferred-size:12rem;flex-basis:12rem}:host([position=below]) a{border-bottom-width:0px;border-top-width:2px;border-top-color:transparent;border-top-style:solid}:host a{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}:host(:focus) a{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host(:active) a,:host(:focus) a,:host(:hover) a{border-color:var(--calcite-ui-border-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host([active]) a{border-color:transparent;color:var(--calcite-ui-text-1)}: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]) span,:host([disabled]) a{pointer-events:none;opacity:0.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){-webkit-margin-end:1rem;margin-inline-end:1rem}:host([scale=s]) a,:host([scale=s]) span{padding-top:0.25rem;padding-bottom:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) a,:host([scale=m]) span{padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){-webkit-margin-end:1.5rem;margin-inline-end:1.5rem}:host([scale=l]) a,:host([scale=l]) span{padding-top:0.75rem;padding-bottom:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}a,span{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:100%;width:100%;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-ms-flex-pack:center;justify-content:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-bottom-width:2px;padding-left:0px;padding-right:0px;padding-top:0.5rem;padding-bottom:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-3);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;border-bottom-color:transparent;border-bottom-style:solid}span{cursor:default}.calcite-tab-title--icon{position:relative;margin:0px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-item-align:center;align-self:center}.calcite-tab-title--icon svg{-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}.container--has-text{padding:0.25rem}.container--has-text .calcite-tab-title--icon.icon-start{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}.container--has-text .calcite-tab-title--icon.icon-end{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}:host([icon-start][icon-end]) .calcite-tab-title--icon:first-child{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([bordered]){-webkit-margin-end:0;margin-inline-end:0}:host([bordered][active]){-webkit-box-shadow:inset 0px -2px var(--calcite-ui-foreground-1);box-shadow:inset 0px -2px var(--calcite-ui-foreground-1)}:host([bordered][active][position=below]){-webkit-box-shadow:inset 0 2px 0 var(--calcite-ui-foreground-1);box-shadow:inset 0 2px 0 var(--calcite-ui-foreground-1)}:host([bordered]:hover) a,:host([bordered]:focus) a,:host([bordered]:active) a{position:relative}:host([bordered]:hover) a{background-color:var(--calcite-button-transparent-hover);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}:host([bordered]) a{border-bottom-style:unset}:host([bordered][position=below]) a{border-top-style:unset}:host([active][bordered]) a{border-left:1px solid var(--calcite-ui-border-1);border-right:1px solid var(--calcite-ui-border-1)}:host([bordered]) a,:host([bordered]) span{padding-left:0.75rem;padding-right:0.75rem}:host([bordered][scale=s]) a,:host([bordered][scale=s]) span{padding-left:0.5rem;padding-right:0.5rem}:host([bordered][scale=l]) a,:host([bordered][scale=l]) span{padding-left:1rem;padding-right:1rem}";var TabTitle=function(){function t(t){var e=this;registerInstance(this,t);this.calciteTabsActivate=createEvent(this,"calciteTabsActivate",7);this.calciteTabsFocusNext=createEvent(this,"calciteTabsFocusNext",7);this.calciteTabsFocusPrevious=createEvent(this,"calciteTabsFocusPrevious",7);this.calciteTabTitleRegister=createEvent(this,"calciteTabTitleRegister",7);this.active=false;this.disabled=false;this.bordered=false;this.mutationObserver=createObserver("mutation",(function(){return e.updateHasText()}));this.hasText=false;this.guid="calcite-tab-title-".concat(guid())}t.prototype.activeTabChanged=function(){if(this.active){this.emitActiveTab()}};t.prototype.connectedCallback=function(){this.setupTextContentObserver();this.parentTabNavEl=this.el.closest("calcite-tab-nav");this.parentTabsEl=this.el.closest("calcite-tabs")};t.prototype.disconnectedCallback=function(){var t,e;(t=this.mutationObserver)===null||t===void 0?void 0:t.disconnect();(e=document.body)===null||e===void 0?void 0:e.dispatchEvent(new CustomEvent("calciteTabTitleUnregister",{detail:this.el}))};t.prototype.componentWillLoad=function(){{this.updateHasText()}if(this.tab&&this.active){this.emitActiveTab()}};t.prototype.componentWillRender=function(){if(this.parentTabsEl){this.layout=this.parentTabsEl.layout;this.position=this.parentTabsEl.position;this.scale=this.parentTabsEl.scale;this.bordered=this.parentTabsEl.bordered}if(!this.parentTabsEl&&this.parentTabNavEl){this.position=getElementProp(this.parentTabNavEl,"position",this.position);this.scale=getElementProp(this.parentTabNavEl,"scale",this.scale)}};t.prototype.render=function(){var t=this.el.id||this.guid;var e=this.bordered&&!this.disabled&&this.layout!=="center";var i=h("calcite-icon",{class:"calcite-tab-title--icon icon-start",flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:"s"});var a=h("calcite-icon",{class:"calcite-tab-title--icon icon-end",flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:"s"});return h(Host,{"aria-controls":this.controls,"aria-expanded":this.active.toString(),id:t,role:"tab"},h("a",{class:{container:true,"container--has-text":this.hasText},style:e&&{width:"".concat(this.parentTabNavEl.indicatorWidth,"px")}},this.iconStart?i:null,h("slot",null),this.iconEnd?a:null))};t.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){switch(i.label){case 0:e=(t=this.calciteTabTitleRegister).emit;return[4,this.getTabIdentifier()];case 1:e.apply(t,[i.sent()]);return[2]}}))}))};t.prototype.componentDidRender=function(){updateHostInteraction(this,true)};t.prototype.tabChangeHandler=function(t){var e=this;var i=t.composedPath().find((function(t){return t.tagName==="CALCITE-TABS"}));if(i!==this.parentTabsEl){return}if(this.tab){this.active=this.tab===t.detail.tab}else{this.getTabIndex().then((function(i){e.active=i===t.detail.tab}))}};t.prototype.onClick=function(){this.emitActiveTab()};t.prototype.keyDownHandler=function(t){switch(t.key){case" ":case"Enter":this.emitActiveTab();t.preventDefault();break;case"ArrowRight":if(getElementDir(this.el)==="ltr"){this.calciteTabsFocusNext.emit()}else{this.calciteTabsFocusPrevious.emit()}break;case"ArrowLeft":if(getElementDir(this.el)==="ltr"){this.calciteTabsFocusPrevious.emit()}else{this.calciteTabsFocusNext.emit()}break}};t.prototype.getTabIndex=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-tab-title"),this.el)]}))}))};t.prototype.getTabIdentifier=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.tab?this.tab:this.getTabIndex()]}))}))};t.prototype.updateAriaInfo=function(t,e){if(t===void 0){t=[]}if(e===void 0){e=[]}return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.controls=t[e.indexOf(this.el.id)]||null;return[2]}))}))};t.prototype.updateHasText=function(){this.hasText=this.el.textContent.trim().length>0};t.prototype.setupTextContentObserver=function(){var t;(t=this.mutationObserver)===null||t===void 0?void 0:t.observe(this.el,{childList:true,subtree:true})};t.prototype.emitActiveTab=function(){if(!this.disabled){this.calciteTabsActivate.emit({tab:this.tab})}};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{active:["activeTabChanged"]}},enumerable:false,configurable:true});return t}();TabTitle.style=tabTitleCss;var SLOTS={tabNav:"tab-nav"};var tabsCss="@-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}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host([bordered]){-webkit-box-shadow:inset 0 1px 0 var(--calcite-ui-border-1);box-shadow:inset 0 1px 0 var(--calcite-ui-border-1);background-color:var(--calcite-ui-foreground-1)}:host([bordered]:not([position=below])) ::slotted(calcite-tab-nav){margin-bottom:-1px}:host([bordered][position=below]) ::slotted(calcite-tab-nav){margin-top:-1px}:host([bordered][position=below]){-webkit-box-shadow:inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1);box-shadow:inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1)}:host([bordered]) section{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1)}:host([bordered][scale=s]) section{padding:0.75rem}:host([bordered][scale=m]) section{padding:0.5rem}:host([bordered][scale=l]) section{padding:1rem}:host([position=below]){-ms-flex-direction:column-reverse;flex-direction:column-reverse}section{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;border-top-width:1px;border-top-color:var(--calcite-ui-border-1);overflow:hidden;border-top-style:solid}:host([position=below]) section{-ms-flex-direction:column-reverse;flex-direction:column-reverse;border-top-width:0px;border-bottom-width:1px;border-bottom-color:var(--calcite-ui-border-1)}:host([position=below]:not([bordered])) section{border-bottom-style:solid}";var Tabs=function(){function t(t){registerInstance(this,t);this.layout="inline";this.position="above";this.scale="m";this.bordered=false;this.titles=[];this.tabs=[]}t.prototype.connectedCallback=function(){if(this.layout==="center"){this.bordered=false}};t.prototype.render=function(){return h(Fragment,null,h("slot",{name:SLOTS.tabNav}),h("section",null,h("slot",null)))};t.prototype.calciteTabTitleRegister=function(t){this.titles=__spreadArray(__spreadArray([],this.titles,true),[t.target],false);this.registryHandler();t.stopPropagation()};t.prototype.calciteTabTitleUnregister=function(t){this.titles=this.titles.filter((function(e){return e!==t.detail}));this.registryHandler();t.stopPropagation()};t.prototype.calciteTabRegister=function(t){this.tabs=__spreadArray(__spreadArray([],this.tabs,true),[t.target],false);this.registryHandler();t.stopPropagation()};t.prototype.calciteTabUnregister=function(t){this.tabs=this.tabs.filter((function(e){return e!==t.detail}));this.registryHandler();t.stopPropagation()};t.prototype.registryHandler=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,a;var n=this;return __generator(this,(function(r){switch(r.label){case 0:if(!(this.tabs.some((function(t){return t.tab}))||this.titles.some((function(t){return t.tab}))))return[3,1];t=this.tabs.sort((function(t,e){return t.tab.localeCompare(e.tab)})).map((function(t){return t.id}));e=this.titles.sort((function(t,e){return t.tab.localeCompare(e.tab)})).map((function(t){return t.id}));return[3,4];case 1:return[4,Promise.all(this.tabs.map((function(t){return t.getTabIndex()})))];case 2:i=r.sent();return[4,Promise.all(this.titles.map((function(t){return t.getTabIndex()})))];case 3:a=r.sent();t=i.reduce((function(t,e,i){t[e]=n.tabs[i].id;return t}),[]);e=a.reduce((function(t,e,i){t[e]=n.titles[i].id;return t}),[]);r.label=4;case 4:this.tabs.forEach((function(i){return i.updateAriaInfo(t,e)}));this.titles.forEach((function(i){return i.updateAriaInfo(t,e)}));return[2]}}))}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Tabs.style=tabsCss;export{Tab as calcite_tab,TabNav as calcite_tab_nav,TabTitle as calcite_tab_title,Tabs as calcite_tabs};
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-03-18T01:11:36",
2
+ "timestamp": "2022-03-18T18:18:14",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.14.2",
@@ -18,6 +18,7 @@ export declare class Tab {
18
18
  /** @internal Parent tabs component scale value */
19
19
  scale: Scale;
20
20
  render(): VNode;
21
+ connectedCallback(): void;
21
22
  componentDidLoad(): void;
22
23
  componentWillRender(): void;
23
24
  disconnectedCallback(): void;
@@ -30,11 +31,9 @@ export declare class Tab {
30
31
  * Return the index of this tab within the tab array
31
32
  */
32
33
  getTabIndex(): Promise<number>;
33
- /**
34
- * @internal
35
- */
36
- private guid;
37
- private labeledBy;
34
+ parentTabsEl: HTMLCalciteTabsElement;
35
+ guid: string;
36
+ labeledBy: string;
38
37
  /**
39
38
  * @internal
40
39
  */
@@ -24,14 +24,6 @@ export declare class TabNav {
24
24
  position: TabPosition;
25
25
  /** @internal Parent tabs component bordered value when layout is "inline" */
26
26
  bordered: boolean;
27
- /**
28
- * @internal
29
- */
30
- selectedTab: TabID;
31
- /**
32
- * @internal
33
- */
34
- selectedTabEl: HTMLCalciteTabTitleElement;
35
27
  /**
36
28
  * @internal
37
29
  */
@@ -42,6 +34,7 @@ export declare class TabNav {
42
34
  indicatorWidth: number;
43
35
  selectedTabChanged(): Promise<void>;
44
36
  selectedTabElChanged(): void;
37
+ connectedCallback(): void;
45
38
  componentWillLoad(): void;
46
39
  componentWillRender(): void;
47
40
  componentDidRender(): void;
@@ -60,15 +53,18 @@ export declare class TabNav {
60
53
  * @see [TabChangeEventDetail](https://github.com/Esri/calcite-components/blob/master/src/components/tab/interfaces.ts#L1)
61
54
  */
62
55
  calciteTabChange: EventEmitter<TabChangeEventDetail>;
63
- private tabNavEl;
64
- private activeIndicatorEl;
65
- private activeIndicatorContainerEl;
66
- private animationActiveDuration;
67
- private handleContainerScroll;
68
- private updateOffsetPosition;
69
- private updateActiveWidth;
70
- private getIndexOfTabTitle;
71
- private getTabTitleById;
72
- private get tabTitles();
73
- private get enabledTabTitles();
56
+ selectedTab: TabID;
57
+ selectedTabEl: HTMLCalciteTabTitleElement;
58
+ parentTabsEl: HTMLCalciteTabsElement;
59
+ tabNavEl: HTMLDivElement;
60
+ activeIndicatorEl: HTMLElement;
61
+ activeIndicatorContainerEl: HTMLDivElement;
62
+ animationActiveDuration: number;
63
+ handleContainerScroll: () => void;
64
+ updateOffsetPosition(): void;
65
+ updateActiveWidth(): void;
66
+ getIndexOfTabTitle(el: HTMLCalciteTabTitleElement, tabTitles?: HTMLCalciteTabTitleElement[]): number;
67
+ getTabTitleById(id: TabID): Promise<HTMLCalciteTabTitleElement | null>;
68
+ get tabTitles(): HTMLCalciteTabTitleElement[];
69
+ get enabledTabTitles(): HTMLCalciteTabTitleElement[];
74
70
  }
@@ -72,23 +72,14 @@ export declare class TabTitle implements InteractiveComponent {
72
72
  */
73
73
  updateAriaInfo(tabIds?: string[], titleIds?: string[]): Promise<void>;
74
74
  /** watches for changing text content **/
75
- private mutationObserver;
76
- private controls;
75
+ mutationObserver: MutationObserver;
76
+ controls: string;
77
77
  /** determine if there is slotted text for styling purposes */
78
- private hasText;
79
- /**
80
- * @internal
81
- */
82
- private parentTabNavEl;
83
- /**
84
- * @internal
85
- */
86
- private parentTabsEl;
87
- private updateHasText;
88
- private setupTextContentObserver;
89
- private emitActiveTab;
90
- /**
91
- * @internal
92
- */
93
- private guid;
78
+ hasText: boolean;
79
+ parentTabNavEl: HTMLCalciteTabNavElement;
80
+ parentTabsEl: HTMLCalciteTabsElement;
81
+ updateHasText(): void;
82
+ setupTextContentObserver(): void;
83
+ emitActiveTab(): void;
84
+ guid: string;
94
85
  }
@@ -42,24 +42,21 @@ export declare class Tabs {
42
42
  */
43
43
  calciteTabUnregister(e: CustomEvent): void;
44
44
  /**
45
- * @internal
46
45
  *
47
46
  * Stores an array of ids of `<calcite-tab-titles>`s to match up ARIA
48
47
  * attributes.
49
48
  */
50
49
  titles: HTMLCalciteTabTitleElement[];
51
50
  /**
52
- * @internal
53
51
  *
54
52
  * Stores an array of ids of `<calcite-tab>`s to match up ARIA attributes.
55
53
  */
56
54
  tabs: HTMLCalciteTabElement[];
57
55
  /**
58
- * @internal
59
56
  *
60
57
  * Matches up elements from the internal `tabs` and `titles` to automatically
61
58
  * update the ARIA attributes and link `<calcite-tab>` and
62
59
  * `<calcite-tab-title>` components.
63
60
  */
64
- private registryHandler;
61
+ registryHandler(): Promise<void>;
65
62
  }
package/hydrate/index.js CHANGED
@@ -29773,14 +29773,6 @@ class Tab {
29773
29773
  this.active = false;
29774
29774
  /** @internal Parent tabs component scale value */
29775
29775
  this.scale = "m";
29776
- //--------------------------------------------------------------------------
29777
- //
29778
- // Private State/Props
29779
- //
29780
- //--------------------------------------------------------------------------
29781
- /**
29782
- * @internal
29783
- */
29784
29776
  this.guid = `calcite-tab-title-${guid()}`;
29785
29777
  }
29786
29778
  //--------------------------------------------------------------------------
@@ -29792,12 +29784,15 @@ class Tab {
29792
29784
  const id = this.el.id || this.guid;
29793
29785
  return (hAsync(Host, { "aria-expanded": this.active.toString(), "aria-labelledby": this.labeledBy, id: id, role: "tabpanel" }, hAsync("section", null, hAsync("slot", null))));
29794
29786
  }
29787
+ connectedCallback() {
29788
+ this.parentTabsEl = this.el.closest("calcite-tabs");
29789
+ }
29795
29790
  componentDidLoad() {
29796
29791
  this.calciteTabRegister.emit();
29797
29792
  }
29798
29793
  componentWillRender() {
29799
29794
  var _a;
29800
- this.scale = (_a = this.el.closest("calcite-tabs")) === null || _a === void 0 ? void 0 : _a.scale;
29795
+ this.scale = (_a = this.parentTabsEl) === null || _a === void 0 ? void 0 : _a.scale;
29801
29796
  }
29802
29797
  disconnectedCallback() {
29803
29798
  var _a;
@@ -29812,10 +29807,13 @@ class Tab {
29812
29807
  //
29813
29808
  //--------------------------------------------------------------------------
29814
29809
  tabChangeHandler(event) {
29810
+ const targetTabsEl = event
29811
+ .composedPath()
29812
+ .find((el) => el.tagName === "CALCITE-TABS");
29815
29813
  // to allow `<calcite-tabs>` to be nested we need to make sure this
29816
- // `calciteTabChange` event was actually fired from a title that is a
29817
- // child of the `<calcite-tabs>` that is the a parent of this tab.
29818
- if (!event.composedPath().includes(this.el.closest("calcite-tabs"))) {
29814
+ // `calciteTabChange` event was actually fired from a within the same
29815
+ // `<calcite-tabs>` that is the a parent of this tab.
29816
+ if (targetTabsEl !== this.parentTabsEl) {
29819
29817
  return;
29820
29818
  }
29821
29819
  if (this.tab) {
@@ -29920,6 +29918,9 @@ class TabNav {
29920
29918
  // Lifecycle
29921
29919
  //
29922
29920
  //--------------------------------------------------------------------------
29921
+ connectedCallback() {
29922
+ this.parentTabsEl = this.el.closest("calcite-tabs");
29923
+ }
29923
29924
  componentWillLoad() {
29924
29925
  const storageKey = `calcite-tab-nav-${this.storageId}`;
29925
29926
  if (localStorage && this.storageId && localStorage.getItem(storageKey)) {
@@ -29931,11 +29932,11 @@ class TabNav {
29931
29932
  }
29932
29933
  }
29933
29934
  componentWillRender() {
29934
- var _a, _b, _c, _d;
29935
- this.layout = (_a = this.el.closest("calcite-tabs")) === null || _a === void 0 ? void 0 : _a.layout;
29936
- this.position = (_b = this.el.closest("calcite-tabs")) === null || _b === void 0 ? void 0 : _b.position;
29937
- this.scale = (_c = this.el.closest("calcite-tabs")) === null || _c === void 0 ? void 0 : _c.scale;
29938
- this.bordered = (_d = this.el.closest("calcite-tabs")) === null || _d === void 0 ? void 0 : _d.bordered;
29935
+ const { parentTabsEl } = this;
29936
+ this.layout = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.layout;
29937
+ this.position = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.position;
29938
+ this.scale = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.scale;
29939
+ this.bordered = parentTabsEl === null || parentTabsEl === void 0 ? void 0 : parentTabsEl.bordered;
29939
29940
  // fix issue with active tab-title not lining up with blue indicator
29940
29941
  if (this.selectedTabEl) {
29941
29942
  this.updateOffsetPosition();
@@ -30098,9 +30099,6 @@ class TabTitle {
30098
30099
  this.mutationObserver = createObserver();
30099
30100
  /** determine if there is slotted text for styling purposes */
30100
30101
  this.hasText = false;
30101
- /**
30102
- * @internal
30103
- */
30104
30102
  this.guid = `calcite-tab-title-${guid()}`;
30105
30103
  }
30106
30104
  activeTabChanged() {
@@ -30166,15 +30164,19 @@ class TabTitle {
30166
30164
  //
30167
30165
  //--------------------------------------------------------------------------
30168
30166
  tabChangeHandler(event) {
30169
- if (event.composedPath().includes(this.parentTabNavEl)) {
30170
- if (this.tab) {
30171
- this.active = this.tab === event.detail.tab;
30172
- }
30173
- else {
30174
- this.getTabIndex().then((index) => {
30175
- this.active = index === event.detail.tab;
30176
- });
30177
- }
30167
+ const targetTabsEl = event
30168
+ .composedPath()
30169
+ .find((el) => el.tagName === "CALCITE-TABS");
30170
+ if (targetTabsEl !== this.parentTabsEl) {
30171
+ return;
30172
+ }
30173
+ if (this.tab) {
30174
+ this.active = this.tab === event.detail.tab;
30175
+ }
30176
+ else {
30177
+ this.getTabIndex().then((index) => {
30178
+ this.active = index === event.detail.tab;
30179
+ });
30178
30180
  }
30179
30181
  }
30180
30182
  onClick() {
@@ -30318,14 +30320,12 @@ class Tabs {
30318
30320
  //
30319
30321
  //--------------------------------------------------------------------------
30320
30322
  /**
30321
- * @internal
30322
30323
  *
30323
30324
  * Stores an array of ids of `<calcite-tab-titles>`s to match up ARIA
30324
30325
  * attributes.
30325
30326
  */
30326
30327
  this.titles = [];
30327
30328
  /**
30328
- * @internal
30329
30329
  *
30330
30330
  * Stores an array of ids of `<calcite-tab>`s to match up ARIA attributes.
30331
30331
  */
@@ -30387,7 +30387,6 @@ class Tabs {
30387
30387
  //
30388
30388
  //--------------------------------------------------------------------------
30389
30389
  /**
30390
- * @internal
30391
30390
  *
30392
30391
  * Matches up elements from the internal `tabs` and `titles` to automatically
30393
30392
  * update the ARIA attributes and link `<calcite-tab>` and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/calcite-components",
3
- "version": "1.0.0-next.424",
3
+ "version": "1.0.0-next.425",
4
4
  "description": "Web Components for Esri's Calcite Design System.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",