@nuralyui/tabs 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle.js +8 -448
- package/package.json +1 -1
package/bundle.js
CHANGED
|
@@ -1,477 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2019 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/
|
|
6
|
-
const t=window,i=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e=Symbol(),s=new WeakMap;class r{constructor(t,i,s){if(this._$cssResult$=!0,s!==e)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=i}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=s.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&s.set(e,t))}return t}toString(){return this.cssText}}const n=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let i="";for(const e of t.cssRules)i+=e.cssText;return(t=>new r("string"==typeof t?t:t+"",void 0,e))(i)})(t):t
|
|
7
|
-
/**
|
|
8
|
-
* @license
|
|
9
|
-
* Copyright 2017 Google LLC
|
|
10
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/;var o;const a=window,l=a.trustedTypes,h=l?l.emptyScript:"",d=a.reactiveElementPolyfillSupport,c={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,i){let e=t;switch(i){case Boolean:e=null!==t;break;case Number:e=null===t?null:Number(t);break;case Object:case Array:try{e=JSON.parse(t)}catch(t){e=null}}return e}},u=(t,i)=>i!==t&&(i==i||t==t),v={attribute:!0,type:String,converter:c,reflect:!1,hasChanged:u},b="finalized";class p extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,e)=>{const s=this._$Ep(e,i);void 0!==s&&(this._$Ev.set(s,e),t.push(s))})),t}static createProperty(t,i=v){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const e="symbol"==typeof t?Symbol():"__"+t,s=this.getPropertyDescriptor(t,e,i);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,i,e){return{get(){return this[i]},set(s){const r=this[t];this[i]=s,this.requestUpdate(t,r,e)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||v}static finalize(){if(this.hasOwnProperty(b))return!1;this[b]=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const e of i)this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const e=new Set(t.flat(1/0).reverse());for(const t of e)i.unshift(n(t))}else void 0!==t&&i.push(n(t));return i}static _$Ep(t,i){const e=i.attribute;return!1===e?void 0:"string"==typeof e?e:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var i,e;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(e=t.hostConnected)||void 0===e||e.call(t))}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i])}))}createRenderRoot(){var e;const s=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return((e,s)=>{i?e.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):s.forEach((i=>{const s=document.createElement("style"),r=t.litNonce;void 0!==r&&s.setAttribute("nonce",r),s.textContent=i.cssText,e.appendChild(s)}))})(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}))}attributeChangedCallback(t,i,e){this._$AK(t,e)}_$EO(t,i,e=v){var s;const r=this.constructor._$Ep(t,e);if(void 0!==r&&!0===e.reflect){const n=(void 0!==(null===(s=e.converter)||void 0===s?void 0:s.toAttribute)?e.converter:c).toAttribute(i,e.type);this._$El=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$El=null}}_$AK(t,i){var e;const s=this.constructor,r=s._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=s.getPropertyOptions(r),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(e=t.converter)||void 0===e?void 0:e.fromAttribute)?t.converter:c;this._$El=r,this[r]=n.fromAttribute(i,t.type),this._$El=null}}requestUpdate(t,i,e){let s=!0;void 0!==t&&(((e=e||this.constructor.getPropertyOptions(t)).hasChanged||u)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===e.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,e))):s=!1),!this.isUpdatePending&&s&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(e)):this._$Ek()}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(e)}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
12
|
-
/**
|
|
13
|
-
* @license
|
|
14
|
-
* Copyright 2017 Google LLC
|
|
15
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
-
*/
|
|
17
|
-
var g;p[b]=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:p}),(null!==(o=a.reactiveElementVersions)&&void 0!==o?o:a.reactiveElementVersions=[]).push("1.6.3");const y=window,f=y.trustedTypes,m=f?f.createPolicy("lit-html",{createHTML:t=>t}):void 0,w="$lit$",T=`lit$${(Math.random()+"").slice(9)}$`,x="?"+T,$=`<${x}>`,E=document,k=()=>E.createComment(""),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,C=Array.isArray,S="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,I=/-->/g,_=/>/g,z=RegExp(`>|${S}(?:([^\\s"'>=/]+)(${S}*=${S}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),O=/'/g,j=/"/g,M=/^(?:script|style|textarea|title)$/i,R=Symbol.for("lit-noChange"),U=Symbol.for("lit-nothing"),L=new WeakMap,N=E.createTreeWalker(E,129,null,!1);function K(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==m?m.createHTML(i):i}class P{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let r=0,n=0;const o=t.length-1,a=this.parts,[l,h]=((t,i)=>{const e=t.length-1,s=[];let r,n=2===i?"<svg>":"",o=D;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(o.lastIndex=d,l=o.exec(e),null!==l);)d=o.lastIndex,o===D?"!--"===l[1]?o=I:void 0!==l[1]?o=_:void 0!==l[2]?(M.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=z):void 0!==l[3]&&(o=z):o===z?">"===l[0]?(o=null!=r?r:D,h=-1):void 0===l[1]?h=-2:(h=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?z:'"'===l[3]?j:O):o===j||o===O?o=z:o===I||o===_?o=D:(o=z,r=void 0);const c=o===z&&t[i+1].startsWith("/>")?" ":"";n+=o===D?e+$:h>=0?(s.push(a),e.slice(0,h)+w+e.slice(h)+T+c):e+T+(-2===h?(s.push(void 0),i):c)}return[K(t,n+(t[e]||"<?>")+(2===i?"</svg>":"")),s]})(t,i);if(this.el=P.createElement(l,e),N.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=N.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(w)||i.startsWith(T)){const e=h[n++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+w).split(T),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?q:"?"===i[1]?Z:"@"===i[1]?J:V})}else a.push({type:6,index:r})}for(const i of t)s.removeAttribute(i)}if(M.test(s.tagName)){const t=s.textContent.split(T),i=t.length-1;if(i>0){s.textContent=f?f.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],k()),N.nextNode(),a.push({type:2,index:++r});s.append(t[i],k())}}}else if(8===s.nodeType)if(s.data===x)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(T,t+1));)a.push({type:7,index:r}),t+=T.length-1}r++}}static createElement(t,i){const e=E.createElement("template");return e.innerHTML=t,e}}function F(t,i,e=t,s){var r,n,o,a;if(i===R)return i;let l=void 0!==s?null===(r=e._$Co)||void 0===r?void 0:r[s]:e._$Cl;const h=A(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,s)),void 0!==s?(null!==(o=(a=e)._$Co)&&void 0!==o?o:a._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=F(t,l._$AS(t,i.values),l,s)),i}class B{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:s}=this._$AD,r=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:E).importNode(e,!0);N.currentNode=r;let n=N.nextNode(),o=0,a=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new H(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new Y(n,this,t)),this._$AV.push(i),l=s[++a]}o!==(null==l?void 0:l.index)&&(n=N.nextNode(),o++)}return N.currentNode=E,r}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class H{constructor(t,i,e,s){var r;this.type=2,this._$AH=U,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=F(this,t,i),A(t)?t===U||null==t||""===t?(this._$AH!==U&&this._$AR(),this._$AH=U):t!==this._$AH&&t!==R&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>C(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==U&&A(this._$AH)?this._$AA.nextSibling.data=t:this.$(E.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=P.createElement(K(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===r)this._$AH.v(e);else{const t=new B(r,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=L.get(t.strings);return void 0===i&&L.set(t.strings,i=new P(t)),i}T(t){C(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const r of t)s===i.length?i.push(e=new H(this.k(k()),this.k(k()),this,this.options)):e=i[s],e._$AI(r),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class V{constructor(t,i,e,s,r){this.type=1,this._$AH=U,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=r,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=U}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const r=this.strings;let n=!1;if(void 0===r)t=F(this,t,i,0),n=!A(t)||t!==this._$AH&&t!==R,n&&(this._$AH=t);else{const s=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=F(this,s[e+o],i,o),a===R&&(a=this._$AH[o]),n||(n=!A(a)||a!==this._$AH[o]),a===U?t=U:t!==U&&(t+=(null!=a?a:"")+r[o+1]),this._$AH[o]=a}n&&!s&&this.j(t)}j(t){t===U?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class q extends V{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===U?void 0:t}}const W=f?f.emptyScript:"";class Z extends V{constructor(){super(...arguments),this.type=4}j(t){t&&t!==U?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class J extends V{constructor(t,i,e,s,r){super(t,i,e,s,r),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=F(this,t,i,0))&&void 0!==e?e:U)===R)return;const s=this._$AH,r=t===U&&s!==U||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==U&&(s===U||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Y{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const G=y.litHtmlPolyfillSupport;
|
|
18
|
-
/**
|
|
19
|
-
* @license
|
|
20
|
-
* Copyright 2017 Google LLC
|
|
21
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/
|
|
23
|
-
var Q;null==G||G(P,H),(null!==(g=y.litHtmlVersions)&&void 0!==g?g:y.litHtmlVersions=[]).push("2.8.0");const X=window,tt=X.trustedTypes,it=tt?tt.createPolicy("lit-html",{createHTML:t=>t}):void 0,et="$lit$",st=`lit$${(Math.random()+"").slice(9)}$`,rt="?"+st,nt=`<${rt}>`,ot=document,at=()=>ot.createComment(""),lt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ht=Array.isArray,dt="[ \t\n\f\r]",ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ut=/-->/g,vt=/>/g,bt=RegExp(`>|${dt}(?:([^\\s"'>=/]+)(${dt}*=${dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),pt=/'/g,gt=/"/g,yt=/^(?:script|style|textarea|title)$/i,ft=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),mt=Symbol.for("lit-noChange"),wt=Symbol.for("lit-nothing"),Tt=new WeakMap,xt=ot.createTreeWalker(ot,129,null,!1);function $t(t,i){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==it?it.createHTML(i):i}const Et=(t,i)=>{const e=t.length-1,s=[];let r,n=2===i?"<svg>":"",o=ct;for(let i=0;i<e;i++){const e=t[i];let a,l,h=-1,d=0;for(;d<e.length&&(o.lastIndex=d,l=o.exec(e),null!==l);)d=o.lastIndex,o===ct?"!--"===l[1]?o=ut:void 0!==l[1]?o=vt:void 0!==l[2]?(yt.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=bt):void 0!==l[3]&&(o=bt):o===bt?">"===l[0]?(o=null!=r?r:ct,h=-1):void 0===l[1]?h=-2:(h=o.lastIndex-l[2].length,a=l[1],o=void 0===l[3]?bt:'"'===l[3]?gt:pt):o===gt||o===pt?o=bt:o===ut||o===vt?o=ct:(o=bt,r=void 0);const c=o===bt&&t[i+1].startsWith("/>")?" ":"";n+=o===ct?e+nt:h>=0?(s.push(a),e.slice(0,h)+et+e.slice(h)+st+c):e+st+(-2===h?(s.push(void 0),i):c)}return[$t(t,n+(t[e]||"<?>")+(2===i?"</svg>":"")),s]};class kt{constructor({strings:t,_$litType$:i},e){let s;this.parts=[];let r=0,n=0;const o=t.length-1,a=this.parts,[l,h]=Et(t,i);if(this.el=kt.createElement(l,e),xt.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(s=xt.nextNode())&&a.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const i of s.getAttributeNames())if(i.endsWith(et)||i.startsWith(st)){const e=h[n++];if(t.push(i),void 0!==e){const t=s.getAttribute(e.toLowerCase()+et).split(st),i=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?It:"?"===i[1]?zt:"@"===i[1]?Ot:Dt})}else a.push({type:6,index:r})}for(const i of t)s.removeAttribute(i)}if(yt.test(s.tagName)){const t=s.textContent.split(st),i=t.length-1;if(i>0){s.textContent=tt?tt.emptyScript:"";for(let e=0;e<i;e++)s.append(t[e],at()),xt.nextNode(),a.push({type:2,index:++r});s.append(t[i],at())}}}else if(8===s.nodeType)if(s.data===rt)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=s.data.indexOf(st,t+1));)a.push({type:7,index:r}),t+=st.length-1}r++}}static createElement(t,i){const e=ot.createElement("template");return e.innerHTML=t,e}}function At(t,i,e=t,s){var r,n,o,a;if(i===mt)return i;let l=void 0!==s?null===(r=e._$Co)||void 0===r?void 0:r[s]:e._$Cl;const h=lt(i)?void 0:i._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(n=null==l?void 0:l._$AO)||void 0===n||n.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,e,s)),void 0!==s?(null!==(o=(a=e)._$Co)&&void 0!==o?o:a._$Co=[])[s]=l:e._$Cl=l),void 0!==l&&(i=At(t,l._$AS(t,i.values),l,s)),i}class Ct{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var i;const{el:{content:e},parts:s}=this._$AD,r=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:ot).importNode(e,!0);xt.currentNode=r;let n=xt.nextNode(),o=0,a=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new St(n,n.nextSibling,this,t):1===l.type?i=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(i=new jt(n,this,t)),this._$AV.push(i),l=s[++a]}o!==(null==l?void 0:l.index)&&(n=xt.nextNode(),o++)}return xt.currentNode=ot,r}v(t){let i=0;for(const e of this._$AV)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class St{constructor(t,i,e,s){var r;this.type=2,this._$AH=wt,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=s,this._$Cp=null===(r=null==s?void 0:s.isConnected)||void 0===r||r}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cp}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=At(this,t,i),lt(t)?t===wt||null==t||""===t?(this._$AH!==wt&&this._$AR(),this._$AH=wt):t!==this._$AH&&t!==mt&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):(t=>ht(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==wt&<(this._$AH)?this._$AA.nextSibling.data=t:this.$(ot.createTextNode(t)),this._$AH=t}g(t){var i;const{values:e,_$litType$:s}=t,r="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=kt.createElement($t(s.h,s.h[0]),this.options)),s);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===r)this._$AH.v(e);else{const t=new Ct(r,this),i=t.u(this.options);t.v(e),this.$(i),this._$AH=t}}_$AC(t){let i=Tt.get(t.strings);return void 0===i&&Tt.set(t.strings,i=new kt(t)),i}T(t){ht(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,s=0;for(const r of t)s===i.length?i.push(e=new St(this.k(at()),this.k(at()),this,this.options)):e=i[s],e._$AI(r),s++;s<i.length&&(this._$AR(e&&e._$AB.nextSibling,s),i.length=s)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$Cp=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class Dt{constructor(t,i,e,s,r){this.type=1,this._$AH=wt,this._$AN=void 0,this.element=t,this.name=i,this._$AM=s,this.options=r,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=wt}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,s){const r=this.strings;let n=!1;if(void 0===r)t=At(this,t,i,0),n=!lt(t)||t!==this._$AH&&t!==mt,n&&(this._$AH=t);else{const s=t;let o,a;for(t=r[0],o=0;o<r.length-1;o++)a=At(this,s[e+o],i,o),a===mt&&(a=this._$AH[o]),n||(n=!lt(a)||a!==this._$AH[o]),a===wt?t=wt:t!==wt&&(t+=(null!=a?a:"")+r[o+1]),this._$AH[o]=a}n&&!s&&this.j(t)}j(t){t===wt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class It extends Dt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===wt?void 0:t}}const _t=tt?tt.emptyScript:"";class zt extends Dt{constructor(){super(...arguments),this.type=4}j(t){t&&t!==wt?this.element.setAttribute(this.name,_t):this.element.removeAttribute(this.name)}}class Ot extends Dt{constructor(t,i,e,s,r){super(t,i,e,s,r),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=At(this,t,i,0))&&void 0!==e?e:wt)===mt)return;const s=this._$AH,r=t===wt&&s!==wt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==wt&&(s===wt||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class jt{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){At(this,t)}}const Mt=X.litHtmlPolyfillSupport;null==Mt||Mt(kt,St),(null!==(Q=X.litHtmlVersions)&&void 0!==Q?Q:X.litHtmlVersions=[]).push("2.8.0");
|
|
24
|
-
/**
|
|
25
|
-
* @license
|
|
26
|
-
* Copyright 2017 Google LLC
|
|
27
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
-
*/
|
|
29
|
-
var Rt,Ut;class Lt extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,i;const e=super.createRenderRoot();return null!==(t=(i=this.renderOptions).renderBefore)&&void 0!==t||(i.renderBefore=e.firstChild),e}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,i,e)=>{var s,r;const n=null!==(s=null==e?void 0:e.renderBefore)&&void 0!==s?s:i;let o=n._$litPart$;if(void 0===o){const t=null!==(r=null==e?void 0:e.renderBefore)&&void 0!==r?r:null;n._$litPart$=o=new St(i.insertBefore(at(),t),t,void 0,null!=e?e:{})}return o._$AI(t),o})(i,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return mt}}Lt.finalized=!0,Lt._$litElement$=!0,null===(Rt=globalThis.litElementHydrateSupport)||void 0===Rt||Rt.call(globalThis,{LitElement:Lt});const Nt=globalThis.litElementPolyfillSupport;null==Nt||Nt({LitElement:Lt}),(null!==(Ut=globalThis.litElementVersions)&&void 0!==Ut?Ut:globalThis.litElementVersions=[]).push("3.3.3");
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2017 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
*/
|
|
35
|
-
const Kt=(t,i)=>"method"===i.kind&&i.descriptor&&!("value"in i.descriptor)?{...i,finisher(e){e.createProperty(i.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:i.key,initializer(){"function"==typeof i.initializer&&(this[i.key]=i.initializer.call(this))},finisher(e){e.createProperty(i.key,t)}};
|
|
36
|
-
/**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2017 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*/function Pt(t){return(i,e)=>void 0!==e?((t,i,e)=>{i.constructor.createProperty(e,t)})(t,i,e):Kt(t,i)
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/}var Ft;null===(Ft=window.HTMLSlotElement)||void 0===Ft||Ft.prototype.assignedElements;
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2017 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/
|
|
51
|
-
const Bt=1;class Ht{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,i,e){this._$Ct=t,this._$AM=i,this._$Ci=e}_$AS(t,i){return this.update(t,i)}update(t,i){return this.render(...i)}}
|
|
52
|
-
/**
|
|
53
|
-
* @license
|
|
54
|
-
* Copyright 2018 Google LLC
|
|
55
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
56
|
-
*/const Vt=(t=>(...i)=>({_$litDirective$:t,values:i}))(class extends Ht{constructor(t){var i;if(super(t),t.type!==Bt||"class"!==t.name||(null===(i=t.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(t,[i]){var e,s;if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!(null===(e=this.nt)||void 0===e?void 0:e.has(t))&&this.it.add(t);return this.render(i)}const r=t.element.classList;this.it.forEach((t=>{t in i||(r.remove(t),this.it.delete(t))}));for(const t in i){const e=!!i[t];e===this.it.has(t)||(null===(s=this.nt)||void 0===s?void 0:s.has(t))||(e?(r.add(t),this.it.add(t)):(r.remove(t),this.it.delete(t)))}return R}}),qt=((t,...i)=>{const s=1===t.length?t[0]:i.reduce(((i,e,s)=>i+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(e)+t[s+1]),t[0]);return new r(s,t,e)})`
|
|
57
|
-
:host {
|
|
58
|
-
display: block;
|
|
59
|
-
height: 100%;
|
|
60
|
-
|
|
61
|
-
/* Force CSS custom property inheritance to ensure theme switching works properly */
|
|
62
|
-
color: var(--nuraly-color-text);
|
|
63
|
-
background-color: var(--nuraly-color-background);
|
|
64
|
-
|
|
65
|
-
/* Minimal transitions for better performance */
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/* Force re-evaluation of theme-dependent properties on theme change */
|
|
70
|
-
:host([data-theme]) {
|
|
71
|
-
color: inherit;
|
|
72
|
-
background-color: inherit;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.tabs-container {
|
|
76
|
-
display: flex;
|
|
77
|
-
height: 100%;
|
|
78
|
-
background-color: var(--nuraly-color-background);
|
|
79
|
-
border-radius: var(--nuraly-border-radius-tabs, var(--nuraly-border-radius-medium, 0));
|
|
80
|
-
box-shadow: var(--nuraly-shadow-tabs);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.tab-labels {
|
|
84
|
-
display: flex;
|
|
85
|
-
background-color: var(--nuraly-color-tabs-header-background);
|
|
86
|
-
border: var(--nuraly-border-tabs-header);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Tab label base styles */
|
|
90
|
-
.tab-label {
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
gap: var(--nuraly-spacing-2);
|
|
95
|
-
position: relative;
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
padding: var(--nuraly-spacing-tabs-padding, var(--nuraly-spacing-3) var(--nuraly-spacing-4));
|
|
98
|
-
border: var(--nuraly-border-tabs-label);
|
|
99
|
-
border-bottom: var(--nuraly-border-width-medium, 2px) solid transparent;
|
|
100
|
-
background-color: var(--nuraly-color-tabs-label-background);
|
|
101
|
-
color: var(--nuraly-color-tabs-label-text);
|
|
102
|
-
font-family: var(--nuraly-font-family);
|
|
103
|
-
font-size: var(--nuraly-font-size-body);
|
|
104
|
-
font-weight: var(--nuraly-font-weight-regular);
|
|
105
|
-
user-select: none;
|
|
106
|
-
white-space: nowrap;
|
|
107
|
-
|
|
108
|
-
&:hover {
|
|
109
|
-
color: var(--nuraly-color-tabs-label-text-hover);
|
|
110
|
-
background-color: var(--nuraly-color-tabs-label-background-hover);
|
|
111
|
-
border-color: var(--nuraly-color-tabs-label-border-hover);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
&:focus {
|
|
115
|
-
outline: var(--nuraly-focus-outline);
|
|
116
|
-
outline-offset: var(--nuraly-focus-outline-offset);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
&.active {
|
|
120
|
-
color: var(--nuraly-color-tabs-label-text-active);
|
|
121
|
-
background-color: var(--nuraly-color-tabs-label-background-active);
|
|
122
|
-
border-color: var(--nuraly-color-tabs-label-border-active);
|
|
123
|
-
font-weight: var(--nuraly-font-weight-semibold);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/* Positioning-specific border radius for horizontal tabs */
|
|
127
|
-
&.first-tab {
|
|
128
|
-
border-radius: var(--nuraly-border-radius-tabs-first);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
&.middle-tab {
|
|
132
|
-
border-radius: var(--nuraly-border-radius-tabs-middle);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&.last-tab {
|
|
136
|
-
border-radius: var(--nuraly-border-radius-tabs-last);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
&.single-tab {
|
|
140
|
-
border-radius: var(--nuraly-border-radius-tabs-single);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
&.disabled {
|
|
144
|
-
cursor: not-allowed;
|
|
145
|
-
color: var(--nuraly-color-text-disabled);
|
|
146
|
-
background-color: var(--nuraly-color-background-disabled);
|
|
147
|
-
|
|
148
|
-
&:hover {
|
|
149
|
-
color: var(--nuraly-color-text-disabled);
|
|
150
|
-
background-color: var(--nuraly-color-background-disabled);
|
|
151
|
-
border-color: transparent;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/* Tab icon styling */
|
|
157
|
-
.tab-icon {
|
|
158
|
-
flex-shrink: 0;
|
|
159
|
-
width: var(--nuraly-tabs-icon-size, 1rem);
|
|
160
|
-
height: var(--nuraly-tabs-icon-size, 1rem);
|
|
161
|
-
color: inherit;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/* Tab text styling */
|
|
165
|
-
.tab-text {
|
|
166
|
-
flex: 1;
|
|
167
|
-
color: inherit;
|
|
168
|
-
|
|
169
|
-
&[contenteditable="true"] {
|
|
170
|
-
cursor: text;
|
|
171
|
-
outline: none;
|
|
172
|
-
|
|
173
|
-
&:focus {
|
|
174
|
-
background-color: var(--nuraly-color-tabs-edit-background);
|
|
175
|
-
border-radius: var(--nuraly-border-radius-small);
|
|
176
|
-
padding: var(--nuraly-spacing-1);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/* Close/delete icon styling */
|
|
182
|
-
.close-icon {
|
|
183
|
-
flex-shrink: 0;
|
|
184
|
-
width: var(--nuraly-tabs-close-icon-size, 0.875rem);
|
|
185
|
-
height: var(--nuraly-tabs-close-icon-size, 0.875rem);
|
|
186
|
-
color: var(--nuraly-color-tabs-close-icon);
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
padding: var(--nuraly-spacing-1);
|
|
189
|
-
border-radius: var(--nuraly-border-radius-small);
|
|
190
|
-
|
|
191
|
-
&:hover {
|
|
192
|
-
color: var(--nuraly-color-tabs-close-icon-hover);
|
|
193
|
-
background-color: var(--nuraly-color-tabs-close-icon-background-hover);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&:active {
|
|
197
|
-
color: var(--nuraly-color-tabs-close-icon-active);
|
|
198
|
-
background-color: var(--nuraly-color-tabs-close-icon-background-active);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/* Add tab button styling */
|
|
203
|
-
.add-tab-label {
|
|
204
|
-
min-width: auto;
|
|
205
|
-
width: var(--nuraly-tabs-add-button-size, 2.5rem);
|
|
206
|
-
color: var(--nuraly-color-tabs-add-icon);
|
|
207
|
-
|
|
208
|
-
&:hover {
|
|
209
|
-
color: var(--nuraly-color-tabs-add-icon-hover);
|
|
210
|
-
background-color: var(--nuraly-color-tabs-add-background-hover);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.add-tab-icon {
|
|
215
|
-
width: var(--nuraly-tabs-add-icon-size, 1rem);
|
|
216
|
-
height: var(--nuraly-tabs-add-icon-size, 1rem);
|
|
217
|
-
color: inherit;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/* Tab content area */
|
|
221
|
-
.tab-content {
|
|
222
|
-
flex: 1;
|
|
223
|
-
padding: var(--nuraly-spacing-tabs-content-padding, var(--nuraly-spacing-4));
|
|
224
|
-
background-color: var(--nuraly-color-tabs-content-background);
|
|
225
|
-
border: var(--nuraly-border-tabs-content);
|
|
226
|
-
border-top: var(--nuraly-border-width-thin, 1px) solid var(--nuraly-color-border);
|
|
227
|
-
overflow-y: auto;
|
|
228
|
-
overflow-x: hidden;
|
|
229
|
-
max-height: 100vh;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/* Orientation specific styles */
|
|
233
|
-
.vertical-align {
|
|
234
|
-
flex-direction: row;
|
|
235
|
-
|
|
236
|
-
.tab-labels {
|
|
237
|
-
flex-direction: column;
|
|
238
|
-
min-width: var(--nuraly-tabs-vertical-width, 12rem);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.tab-content {
|
|
242
|
-
border-top: none;
|
|
243
|
-
border-left: var(--nuraly-border-width-thin, 1px) solid var(--nuraly-color-border);
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.tab-label {
|
|
247
|
-
border-bottom: var(--nuraly-border-tabs-label);
|
|
248
|
-
border-right: var(--nuraly-border-width-medium, 2px) solid transparent;
|
|
249
|
-
|
|
250
|
-
&:hover,
|
|
251
|
-
&.active {
|
|
252
|
-
border-right-color: var(--nuraly-color-tabs-label-border-active);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.vertical-align.right-align {
|
|
258
|
-
flex-direction: row-reverse;
|
|
259
|
-
|
|
260
|
-
.tab-content {
|
|
261
|
-
border-left: none;
|
|
262
|
-
border-right: var(--nuraly-border-width-thin, 1px) solid var(--nuraly-color-border);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.tab-label {
|
|
266
|
-
border-right: var(--nuraly-border-tabs-label);
|
|
267
|
-
border-left: var(--nuraly-border-width-medium, 2px) solid transparent;
|
|
268
|
-
|
|
269
|
-
&:hover,
|
|
270
|
-
&.active {
|
|
271
|
-
border-left-color: var(--nuraly-color-tabs-label-border-active);
|
|
272
|
-
border-right-color: transparent;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/* Alignment specific styles */
|
|
278
|
-
.right-align > .tab-labels {
|
|
279
|
-
flex-direction: row-reverse;
|
|
280
|
-
align-self: flex-end;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.center-align > .tab-labels {
|
|
284
|
-
align-self: center;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.horizontal-align {
|
|
288
|
-
flex-direction: column;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
/* Size variations */
|
|
292
|
-
:host([data-size="small"]) {
|
|
293
|
-
.tab-label {
|
|
294
|
-
padding: var(--nuraly-spacing-2) var(--nuraly-spacing-3);
|
|
295
|
-
font-size: var(--nuraly-font-size-small);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.tab-content {
|
|
299
|
-
padding: var(--nuraly-spacing-3);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
:host([data-size="large"]) {
|
|
304
|
-
.tab-label {
|
|
305
|
-
padding: var(--nuraly-spacing-4) var(--nuraly-spacing-6);
|
|
306
|
-
font-size: var(--nuraly-font-size-large);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.tab-content {
|
|
310
|
-
padding: var(--nuraly-spacing-6);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/* Type variations */
|
|
315
|
-
:host([data-type="card"]) {
|
|
316
|
-
.tab-label {
|
|
317
|
-
border: var(--nuraly-border-width-thin, 1px) solid var(--nuraly-color-border);
|
|
318
|
-
border-radius: var(--nuraly-border-radius-medium);
|
|
319
|
-
margin: 0 var(--nuraly-spacing-1);
|
|
320
|
-
|
|
321
|
-
&.active {
|
|
322
|
-
background-color: var(--nuraly-color-primary);
|
|
323
|
-
color: var(--nuraly-color-primary-text);
|
|
324
|
-
border-color: var(--nuraly-color-primary);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
:host([data-type="bordered"]) {
|
|
330
|
-
.tabs-container {
|
|
331
|
-
border: var(--nuraly-border-width-thin, 1px) solid var(--nuraly-color-border);
|
|
332
|
-
border-radius: var(--nuraly-border-radius-medium);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/* Drag and drop states */
|
|
337
|
-
.tab-label.dragging-start {
|
|
338
|
-
opacity: 0.7;
|
|
339
|
-
border: var(--nuraly-border-width-thin, 1px) dashed var(--nuraly-color-border-strong);
|
|
340
|
-
background-color: var(--nuraly-color-background-hover);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.tab-label.dragging {
|
|
344
|
-
border: var(--nuraly-border-width-thin, 1px) dashed var(--nuraly-color-primary);
|
|
345
|
-
background-color: var(--nuraly-color-primary-background);
|
|
346
|
-
opacity: 0.8;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/* Minimal animation support for better performance */
|
|
350
|
-
|
|
351
|
-
@keyframes fadeIn {
|
|
352
|
-
from {
|
|
353
|
-
opacity: 0;
|
|
354
|
-
transform: translateY(var(--nuraly-spacing-2));
|
|
355
|
-
}
|
|
356
|
-
to {
|
|
357
|
-
opacity: 1;
|
|
358
|
-
transform: translateY(0);
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/* Accessibility improvements */
|
|
363
|
-
@media (prefers-reduced-motion: reduce) {
|
|
364
|
-
* {
|
|
365
|
-
transition: none !important;
|
|
366
|
-
animation: none !important;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/* Focus management for keyboard navigation */
|
|
371
|
-
.tab-label[tabindex="0"] {
|
|
372
|
-
position: relative;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
.tab-label:focus-visible {
|
|
376
|
-
z-index: 1;
|
|
377
|
-
}
|
|
378
|
-
`
|
|
1
|
+
import{css as t,LitElement as a,html as e,nothing as i}from"lit";import{property as r,customElement as n}from"lit/decorators.js";import{classMap as s}from"lit/directives/class-map.js";import{NuralyUIBaseMixin as o}from"@nuralyui/common/mixins";const l=t`:host{display:block;height:100%;color:var(--nuraly-color-text);background-color:var(--nuraly-color-background)}:host([data-theme]){color:inherit;background-color:inherit}.tabs-container{display:flex;height:100%;background-color:var(--nuraly-color-background);border-radius:var(--nuraly-border-radius-tabs,var(--nuraly-border-radius-medium,0));box-shadow:var(--nuraly-shadow-tabs)}.tab-labels{display:flex;background-color:var(--nuraly-color-tabs-header-background);border:var(--nuraly-border-tabs-header)}.tab-label{display:flex;align-items:center;justify-content:center;gap:var(--nuraly-spacing-2);position:relative;cursor:pointer;padding:var(--nuraly-spacing-tabs-padding,var(--nuraly-spacing-3) var(--nuraly-spacing-4));border:var(--nuraly-border-tabs-label);border-bottom:var(--nuraly-border-width-medium,2px) solid transparent;background-color:var(--nuraly-color-tabs-label-background);color:var(--nuraly-color-tabs-label-text);font-family:var(--nuraly-font-family);font-size:var(--nuraly-font-size-body);font-weight:var(--nuraly-font-weight-regular);user-select:none;white-space:nowrap;background-color:var(--nuraly-color-tabs-label-background-active);border-color:var(--nuraly-color-tabs-label-border-active);font-weight:var(--nuraly-font-weight-semibold)}&.first-tab{border-radius:var(--nuraly-border-radius-tabs-first)}&.middle-tab{border-radius:var(--nuraly-border-radius-tabs-middle)}&.last-tab{border-radius:var(--nuraly-border-radius-tabs-last)}&.single-tab{border-radius:var(--nuraly-border-radius-tabs-single)}&.disabled{cursor:not-allowed;color:var(--nuraly-color-text-disabled);background-color:var(--nuraly-color-background-disabled)}.tab-text{flex:1;color:inherit;outline:0}.add-tab-label{min-width:auto;width:var(--nuraly-tabs-add-button-size,2.5rem);color:var(--nuraly-color-tabs-add-icon)}.add-tab-icon{width:var(--nuraly-tabs-add-icon-size,1rem);height:var(--nuraly-tabs-add-icon-size,1rem);color:inherit}.tab-content{flex:1;padding:var(--nuraly-spacing-tabs-content-padding,var(--nuraly-spacing-4));background-color:var(--nuraly-color-tabs-content-background);border:var(--nuraly-border-tabs-content);border-top:var(--nuraly-border-width-thin,1px) solid var(--nuraly-color-border);overflow-y:auto;overflow-x:hidden;max-height:100vh}.vertical-align{flex-direction:row;min-width:var(--nuraly-tabs-vertical-width,12rem)}.tab-content{border-top:none;border-left:var(--nuraly-border-width-thin,1px) solid var(--nuraly-color-border)}.tab-label{border-bottom:var(--nuraly-border-tabs-label);border-right:var(--nuraly-border-width-medium,2px) solid transparent}.tab-label{border-right:var(--nuraly-border-tabs-label);border-left:var(--nuraly-border-width-medium,2px) solid transparent}.center-align>.tab-labels{align-self:center}.horizontal-align{flex-direction:column}:host([data-size=small]){font-size:var(--nuraly-font-size-small)}.tab-content{padding:var(--nuraly-spacing-3)}.tab-content{padding:var(--nuraly-spacing-6)}.tab-label.dragging{border:var(--nuraly-border-width-thin,1px) dashed var(--nuraly-color-primary);background-color:var(--nuraly-color-primary-background);opacity:.8}@keyframes fadeIn{from{opacity:0;transform:translateY(var(--nuraly-spacing-2))}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}.tab-label[tabindex="0"]{position:relative}.tab-label:focus-visible{z-index:1}`
|
|
379
2
|
/**
|
|
380
3
|
* @license
|
|
381
4
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
382
5
|
* SPDX-License-Identifier: MIT
|
|
383
|
-
*/,
|
|
6
|
+
*/,d="",h="",b=0,c="label";
|
|
384
7
|
/**
|
|
385
8
|
* @license
|
|
386
9
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
387
10
|
* SPDX-License-Identifier: MIT
|
|
388
11
|
*/
|
|
389
|
-
class
|
|
12
|
+
class u{constructor(t){this._host=t,this._host.addController(this)}get host(){return this._host}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}handleError(t,a){console.error(`[TabsController] Error in ${a}:`,t),this.dispatchEvent(new CustomEvent("tabs-error",{detail:{error:t,context:a,timestamp:Date.now(),controller:this.constructor.name},bubbles:!0,composed:!0}))}dispatchEvent(t){try{this._host.dispatchEvent(t)}catch(t){console.error("[TabsController] Failed to dispatch event:",t)}}isValidTabIndex(t){return t>=0&&t<this.host.tabs.length}getTabElement(t){var a;return(null===(a=this.host.shadowRoot)||void 0===a?void 0:a.querySelector(`[data-index="${t}"]`))||null}}
|
|
390
13
|
/**
|
|
391
14
|
* @license
|
|
392
15
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
393
16
|
* SPDX-License-Identifier: MIT
|
|
394
|
-
*/class
|
|
17
|
+
*/class v extends u{constructor(t){super(t),this._host=t,this.keyboardHandler=t=>this.handleKeyDown(t)}get host(){return this._host}hostConnected(){super.hostConnected(),this._host.addEventListener("keydown",this.keyboardHandler)}hostDisconnected(){super.hostDisconnected(),this._host.removeEventListener("keydown",this.keyboardHandler)}handleKeyDown(t){try{if(this.host.disabled)return;const a=t.target.closest(".tab-label");if(!a)return;const e=parseInt(a.getAttribute("data-index")||"0");if(!this.isValidTabIndex(e))return;this.handleTabKeyDown(t,e)}catch(t){this.handleError(t,"handleKeyDown")}}handleTabKeyDown(t,a){try{const e="vertical"!==this.host.orientation;switch(t.key){case"Enter":case" ":t.preventDefault(),this.activateTab(a,t);break;case"ArrowLeft":e&&(t.preventDefault(),this.navigateToPreviousTab(a));break;case"ArrowRight":e&&(t.preventDefault(),this.navigateToNextTab(a));break;case"ArrowUp":e||(t.preventDefault(),this.navigateToPreviousTab(a));break;case"ArrowDown":e||(t.preventDefault(),this.navigateToNextTab(a));break;case"Home":t.preventDefault(),this.navigateToFirstTab();break;case"End":t.preventDefault(),this.navigateToLastTab()}}catch(t){this.handleError(t,"handleTabKeyDown")}}isActivationKey(t){return"Enter"===t.key||" "===t.key}isArrowKey(t){return["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)}activateTab(t,a){try{this.host.setActiveTab(t,a),this.dispatchEvent(new CustomEvent("tabs-keyboard-activation",{detail:{tabIndex:t,tab:this.host.tabs[t],key:a.key,timestamp:Date.now()},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"activateTab")}}navigateToPreviousTab(t){try{const a=this.getEnabledTabIndices(),e=a.indexOf(t);if(e>0){const t=a[e-1];this.focusTab(t)}else if(a.length>0){const t=a[a.length-1];this.focusTab(t)}}catch(t){this.handleError(t,"navigateToPreviousTab")}}navigateToNextTab(t){try{const a=this.getEnabledTabIndices(),e=a.indexOf(t);if(e<a.length-1){const t=a[e+1];this.focusTab(t)}else if(a.length>0){const t=a[0];this.focusTab(t)}}catch(t){this.handleError(t,"navigateToNextTab")}}navigateToFirstTab(){try{const t=this.getEnabledTabIndices();t.length>0&&this.focusTab(t[0])}catch(t){this.handleError(t,"navigateToFirstTab")}}navigateToLastTab(){try{const t=this.getEnabledTabIndices();t.length>0&&this.focusTab(t[t.length-1])}catch(t){this.handleError(t,"navigateToLastTab")}}focusTab(t){try{const a=this.getTabElement(t);a&&a.focus()}catch(t){this.handleError(t,"focusTab")}}getEnabledTabIndices(){return this.host.tabs.map(((t,a)=>({tab:t,index:a}))).filter((({tab:t})=>!t.disabled)).map((({index:t})=>t))}}
|
|
395
18
|
/**
|
|
396
19
|
* @license
|
|
397
20
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
398
21
|
* SPDX-License-Identifier: MIT
|
|
399
|
-
*/class
|
|
22
|
+
*/class g extends u{constructor(t){super(t),this._host=t,this.dragOverHandler=t=>this.handleDragOver(t)}get host(){return this._host}hostConnected(){super.hostConnected(),this._host.addEventListener("dragover",this.dragOverHandler)}hostDisconnected(){super.hostDisconnected(),this._host.removeEventListener("dragover",this.dragOverHandler)}handleDragStart(t){try{if(!t.dataTransfer)return;const a=t.currentTarget,e=a.dataset.index||"";if(!this.isValidTabIndex(parseInt(e)))return;t.dataTransfer.setData("text/plain",e),t.dataTransfer.effectAllowed="move",a.classList.add("dragging-start"),this.dispatchEvent(new CustomEvent("tabs-drag-start",{detail:{tabIndex:parseInt(e),tab:this.host.tabs[parseInt(e)],timestamp:Date.now()},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"handleDragStart")}}handleDragOver(t){try{t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move")}catch(t){this.handleError(t,"handleDragOver")}}handleDragEnter(t){try{t.preventDefault();const a=t.currentTarget;if(a.contains(t.relatedTarget))return;a.classList.add("dragging")}catch(t){this.handleError(t,"handleDragEnter")}}handleDragLeave(t){try{t.preventDefault();const a=t.currentTarget;if(a.contains(t.relatedTarget))return;a.classList.contains("dragging")&&a.classList.remove("dragging")}catch(t){this.handleError(t,"handleDragLeave")}}handleDrop(t){try{if(t.preventDefault(),!t.dataTransfer)return;const a=t.currentTarget,e=parseInt(t.dataTransfer.getData("text/plain")),i=parseInt(a.dataset.index||"0");this.isValidTabReorder(e,i)&&this.performTabReorder(e,i),this.cleanupDragClasses()}catch(t){this.handleError(t,"handleDrop")}}canMoveTab(){var t,a;return null!==(a=null===(t=this.host.editable)||void 0===t?void 0:t.canMove)&&void 0!==a&&a}isValidTabReorder(t,a){return t!==a&&this.isValidTabIndex(t)&&this.isValidTabIndex(a)&&this.canMoveTab()}performTabReorder(t,a){try{const e=this.host.tabs[t],i=this.host.tabs[a];this.host.dispatchEventWithMetadata("nr-tab-order-change",{sourceIndex:t,targetIndex:a,sourceTab:e,targetTab:i}),this.dispatchEvent(new CustomEvent("tabs-drag-complete",{detail:{sourceIndex:t,targetIndex:a,sourceTab:e,targetTab:i,timestamp:Date.now()},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"performTabReorder")}}cleanupDragClasses(){var t,a;try{const e=this.host.shadowRoot;e&&(null===(t=e.querySelector(".dragging"))||void 0===t||t.classList.remove("dragging"),null===(a=e.querySelector(".dragging-start"))||void 0===a||a.classList.remove("dragging-start"))}catch(t){this.handleError(t,"cleanupDragClasses")}}getDraggableState(){return this.canMoveTab()}}
|
|
400
23
|
/**
|
|
401
24
|
* @license
|
|
402
25
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
403
26
|
* SPDX-License-Identifier: MIT
|
|
404
|
-
*/class
|
|
27
|
+
*/class p extends u{constructor(t){super(t),this._host=t}get host(){return this._host}handleAddTab(){try{if(!this.canAddTab())return void console.warn("[TabsEditableController] Cannot add tab - permission denied");this.host.dispatchEventWithMetadata("nr-tab-add",{}),this.dispatchEvent(new CustomEvent("tabs-add-tab",{detail:{timestamp:Date.now(),totalTabs:this.host.tabs.length},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"handleAddTab")}}handleRemoveTab(t){try{if(!this.isValidTabIndex(t))return void console.warn(`[TabsEditableController] Invalid tab index: ${t}`);const a=this.host.tabs[t];if(!this.canDeleteTab(a))return void console.warn("[TabsEditableController] Cannot delete tab - permission denied");this.host.dispatchEventWithMetadata("nr-tab-remove",{index:t,tab:a}),this.dispatchEvent(new CustomEvent("tabs-remove-tab",{detail:{tabIndex:t,tab:a,timestamp:Date.now(),remainingTabs:this.host.tabs.length-1},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"handleRemoveTab")}}handleEditTab(t,a){try{if(!this.isValidTabIndex(t))return void console.warn(`[TabsEditableController] Invalid tab index: ${t}`);const e=this.host.tabs[t],i=e.label;if(!this.canEditTabTitle(e))return void console.warn("[TabsEditableController] Cannot edit tab title - permission denied");if(a.trim()===i.trim())return;if(!this.isValidTabLabel(a))return void console.warn("[TabsEditableController] Invalid tab label provided");this.host.dispatchEventWithMetadata("nr-tab-edit",{index:t,tab:Object.assign(Object.assign({},e),{label:a.trim()}),oldLabel:i,newLabel:a.trim()}),this.dispatchEvent(new CustomEvent("tabs-edit-tab",{detail:{tabIndex:t,tab:e,oldLabel:i,newLabel:a.trim(),timestamp:Date.now()},bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"handleEditTab")}}canAddTab(){var t,a;return null!==(a=null===(t=this.host.editable)||void 0===t?void 0:t.canAddTab)&&void 0!==a&&a}canDeleteTab(t){var a,e,i,r,n,s,o;return t?null!==(n=null!==(i=null!==(a=t.closable)&&void 0!==a?a:null===(e=t.editable)||void 0===e?void 0:e.canDeleteTab)&&void 0!==i?i:null===(r=this.host.editable)||void 0===r?void 0:r.canDeleteTab)&&void 0!==n&&n:null!==(o=null===(s=this.host.editable)||void 0===s?void 0:s.canDeleteTab)&&void 0!==o&&o}canEditTabTitle(t){var a,e,i,r,n,s;return t?null!==(r=null!==(e=null===(a=t.editable)||void 0===a?void 0:a.canEditTabTitle)&&void 0!==e?e:null===(i=this.host.editable)||void 0===i?void 0:i.canEditTabTitle)&&void 0!==r&&r:null!==(s=null===(n=this.host.editable)||void 0===n?void 0:n.canEditTabTitle)&&void 0!==s&&s}canMoveTab(){var t,a;return null!==(a=null===(t=this.host.editable)||void 0===t?void 0:t.canMove)&&void 0!==a&&a}getTabEditableState(t){return{canDelete:this.canDeleteTab(t),canEdit:this.canEditTabTitle(t),canMove:this.canMoveTab()}}isValidTabLabel(t){return"string"==typeof t&&t.trim().length>0&&t.trim().length<=100}getContentEditableAttribute(t){return this.canEditTabTitle(t)?"true":void 0}handleTabTitleBlur(t,a){var e;try{const i=t.target,r=(null===(e=i.textContent)||void 0===e?void 0:e.trim())||"";if(r)this.handleEditTab(a,r);else{const t=this.host.tabs[a];i.textContent=t.label}}catch(t){this.handleError(t,"handleTabTitleBlur")}}handleTabTitleKeyDown(t,a){try{if("Enter"===t.key){t.preventDefault();t.target.blur()}else if("Escape"===t.key){t.preventDefault();const e=this.host.tabs[a],i=t.target;i.textContent=e.label,i.blur()}}catch(t){this.handleError(t,"handleTabTitleKeyDown")}}}
|
|
405
28
|
/**
|
|
406
29
|
* @license
|
|
407
30
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
408
31
|
* SPDX-License-Identifier: MIT
|
|
409
|
-
*/class
|
|
32
|
+
*/class y extends u{constructor(t){super(t),this._host=t}get host(){return this._host}handleTabClick(t,a){try{if(!this.isValidTabIndex(t))return void console.warn(`[TabsEventController] Invalid tab index: ${t}`);const e=this.host.tabs[t];if(e.disabled)return void a.preventDefault();a.preventDefault(),this.host.setActiveTab(t,a),this.host.dispatchEventWithMetadata("nr-tab-click",{index:t,tab:e,originalEvent:a}),this.dispatchTabEvent("tabs-interaction",{type:"click",tabIndex:t,tab:e,timestamp:Date.now(),modifierKeys:{ctrl:a.ctrlKey,shift:a.shiftKey,alt:a.altKey,meta:a.metaKey}})}catch(t){this.handleError(t,"handleTabClick")}}handleTabFocus(t,a){try{if(!this.isValidTabIndex(t))return;const e=this.host.tabs[t];this.dispatchTabEvent("tabs-focus",{tabIndex:t,tab:e,timestamp:Date.now(),originalEvent:a})}catch(t){this.handleError(t,"handleTabFocus")}}handleTabBlur(t,a){try{if(!this.isValidTabIndex(t))return;const e=this.host.tabs[t];this.dispatchTabEvent("tabs-blur",{tabIndex:t,tab:e,timestamp:Date.now(),originalEvent:a})}catch(t){this.handleError(t,"handleTabBlur")}}dispatchTabEvent(t,a){try{this.dispatchEvent(new CustomEvent(t,{detail:a,bubbles:!0,composed:!0}))}catch(t){this.handleError(t,"dispatchTabEvent")}}handleTabChange(t,a,e){try{if(!this.isValidTabIndex(t))return void console.warn(`[TabsEventController] Invalid new tab index: ${t}`);const i=this.host.tabs[t],r=this.isValidTabIndex(a)?this.host.tabs[a]:null;this.dispatchTabEvent("tabs-change",{newTabIndex:t,previousTabIndex:a,newTab:i,previousTab:r,timestamp:Date.now(),originalEvent:e})}catch(t){this.handleError(t,"handleTabChange")}}handleTabActivation(t,a,e){try{if(!this.isValidTabIndex(t))return;const i=this.host.tabs[t];this.dispatchTabEvent("tabs-activation",{tabIndex:t,tab:i,activationType:a,timestamp:Date.now(),originalEvent:e})}catch(t){this.handleError(t,"handleTabActivation")}}handleTabHover(t,a,e){try{if(!this.isValidTabIndex(t))return;const i=this.host.tabs[t];this.dispatchTabEvent(e?"tabs-hover-enter":"tabs-hover-leave",{tabIndex:t,tab:i,timestamp:Date.now(),originalEvent:a})}catch(t){this.handleError(t,"handleTabHover")}}getTabEventListeners(t){return{click:a=>this.handleTabClick(t,a),focus:a=>this.handleTabFocus(t,a),blur:a=>this.handleTabBlur(t,a),mouseenter:a=>this.handleTabHover(t,a,!0),mouseleave:a=>this.handleTabHover(t,a,!1)}}canActivateTab(t){return!t.disabled}getTabInteractionState(t){var a;const e=this.host.tabs[t];return{isActive:t===this.host.activeTab,isDisabled:null!==(a=e.disabled)&&void 0!==a&&a,canActivate:this.canActivateTab(e)}}}
|
|
410
33
|
/**
|
|
411
34
|
* @license
|
|
412
35
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
413
36
|
* SPDX-License-Identifier: MIT
|
|
414
|
-
*/var
|
|
415
|
-
<div
|
|
416
|
-
class=${Vt({"tabs-container":!0,"vertical-align":"vertical"===this.orientation,"horizontal-align":"horizontal"===this.orientation,"right-align":"right"===this.align,"left-align":"left"===this.align,"center-align":"center"===this.align})}
|
|
417
|
-
role="tablist"
|
|
418
|
-
aria-label="${this.tabsAriaLabel||wt}"
|
|
419
|
-
data-theme="${this.currentTheme}"
|
|
420
|
-
data-size="${this.tabSize}"
|
|
421
|
-
data-type="${this.variant}"
|
|
422
|
-
>
|
|
423
|
-
<div
|
|
424
|
-
class="tab-labels"
|
|
425
|
-
style="flex-direction: ${"vertical"===this.orientation?"column":"row"}"
|
|
426
|
-
>
|
|
427
|
-
<div></div>
|
|
428
|
-
${this.renderTabs()}
|
|
429
|
-
<div></div>
|
|
430
|
-
</div>
|
|
431
|
-
<div class="tab-content" role="tabpanel">
|
|
432
|
-
${this.renderActiveTab()}
|
|
433
|
-
</div>
|
|
434
|
-
</div>
|
|
435
|
-
`}observeChildrenChanges(){new MutationObserver((()=>{this.requestUpdate()})).observe(this,{childList:!0})}renderDeleteIcon(t,i){return this.editableController.canDeleteTab(t)?this.isComponentAvailable("nr-icon")?ft`
|
|
436
|
-
<nr-icon
|
|
437
|
-
name="window-close"
|
|
438
|
-
class="close-icon"
|
|
439
|
-
@mousedown=${t=>{t.stopPropagation(),this.editableController.handleRemoveTab(i)}}
|
|
440
|
-
></nr-icon>
|
|
441
|
-
`:(console.warn("[nr-tabs] Icon component not available. Delete icon will not render."),wt):wt}renderTabs(){const t=[];for(let i=0;i<this.tabs.length;i++){const e=this.tabs[i],s=i===this.activeTab,r=0===i,n=i===this.tabs.length-1,o=1===this.tabs.length,a=!r&&!n&&!o,l=ft`
|
|
442
|
-
<div
|
|
443
|
-
data-index=${i}
|
|
444
|
-
draggable=${this.dragDropController.getDraggableState()?"true":"false"}
|
|
445
|
-
@dragenter=${t=>this.dragDropController.handleDragEnter(t)}
|
|
446
|
-
@dragleave=${t=>this.dragDropController.handleDragLeave(t)}
|
|
447
|
-
@dragstart=${t=>this.dragDropController.handleDragStart(t)}
|
|
448
|
-
@drop=${t=>this.dragDropController.handleDrop(t)}
|
|
449
|
-
class=${Vt({"tab-label":!0,active:s,disabled:!!e.disabled,"first-tab":r&&"horizontal"===this.orientation,"middle-tab":a&&"horizontal"===this.orientation,"last-tab":n&&"horizontal"===this.orientation,"single-tab":o&&"horizontal"===this.orientation})}
|
|
450
|
-
role="tab"
|
|
451
|
-
aria-selected=${s?"true":"false"}
|
|
452
|
-
aria-disabled=${e.disabled?"true":"false"}
|
|
453
|
-
tabindex=${s?"0":"-1"}
|
|
454
|
-
@click=${t=>this.eventController.handleTabClick(i,t)}
|
|
455
|
-
>
|
|
456
|
-
${e.icon&&this.isComponentAvailable("nr-icon")?ft`<nr-icon name=${e.icon} class="tab-icon"></nr-icon>`:wt}
|
|
457
|
-
|
|
458
|
-
<span class="tab-text"
|
|
459
|
-
contenteditable=${this.editableController.getContentEditableAttribute(e)||wt}
|
|
460
|
-
@blur=${t=>this.editableController.handleTabTitleBlur(t,i)}
|
|
461
|
-
@keydown=${t=>this.editableController.handleTabTitleKeyDown(t,i)}
|
|
462
|
-
>${e.label}</span>
|
|
463
|
-
|
|
464
|
-
${this.renderDeleteIcon(e,i)}
|
|
465
|
-
</div>
|
|
466
|
-
`;t.push(l)}if(this.editableController.canAddTab()){const i=ft`
|
|
467
|
-
<div
|
|
468
|
-
class="tab-label add-tab-label"
|
|
469
|
-
role="button"
|
|
470
|
-
aria-label="Add new tab"
|
|
471
|
-
tabindex="0"
|
|
472
|
-
@mousedown=${()=>{this.editableController.handleAddTab()}}
|
|
473
|
-
@keydown=${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.editableController.handleAddTab())}}
|
|
474
|
-
>
|
|
475
|
-
${this.isComponentAvailable("nr-icon")?ft`<nr-icon name="plus" class="add-tab-icon"></nr-icon>`:ft`<span>+</span>`}
|
|
476
|
-
</div>
|
|
477
|
-
`;t.push(i)}return t}updated(t){super.updated(t),this.activeTab>=this.tabs.length?this.activeTab=Math.max(0,this.tabs.length-1):this.activeTab<0&&(this.activeTab=0)}renderActiveTab(){if(0===this.tabs.length||this.activeTab<0||this.activeTab>=this.tabs.length)return wt;const t=this.tabs[this.activeTab];return ft`${t.content||wt}`}setActiveTab(t,i){var e,s;if(i instanceof MouseEvent){null!==(s=null===(e=this.editable)||void 0===e?void 0:e.canMove)&&void 0!==s&&s||i.preventDefault()}if(t<0||t>=this.tabs.length||this.tabs[t].disabled)return;const r=this.activeTab,n=this.tabs[t];this.activeTab=t,this.dispatchEventWithMetadata("nr-tab-click",{index:t,tab:n,previousIndex:r}),r!==t&&this.dispatchEventWithMetadata("nr-tab-change",{index:t,tab:n,previousIndex:r})}};ai.styles=qt,oi([Pt({type:Number})],ai.prototype,"activeTab",void 0),oi([Pt({type:String})],ai.prototype,"orientation",void 0),oi([Pt({type:String})],ai.prototype,"align",void 0),oi([Pt({type:String,attribute:"size"})],ai.prototype,"tabSize",void 0),oi([Pt({type:String,attribute:"type"})],ai.prototype,"variant",void 0),oi([Pt({type:Object})],ai.prototype,"editable",void 0),oi([Pt({type:Array})],ai.prototype,"tabs",void 0),oi([Pt({type:Boolean})],ai.prototype,"animated",void 0),oi([Pt({type:Boolean})],ai.prototype,"destroyInactiveTabPane",void 0),oi([Pt({type:String})],ai.prototype,"tabsAriaLabel",void 0),ai=oi([(t=>i=>"function"==typeof i?((t,i)=>(customElements.define(t,i),i))(t,i):((t,i)=>{const{kind:e,elements:s}=i;return{kind:e,elements:s,finisher(i){customElements.define(t,i)}}})(t,i))("nr-tabs")],ai);export{Jt as DEFAULT_ACTIVE_TAB,Wt as EMPTY_STRING,Yt as LABEL_ATTRIBUTES,Zt as NOTHING_STRING,ai as NrTabsElement,ai as TabsComponent};
|
|
37
|
+
*/var m=function(t,a,e,i){for(var r,n=arguments.length,s=n<3?a:null===i?i=Object.getOwnPropertyDescriptor(a,e):i,o=t.length-1;o>=0;o--)(r=t[o])&&(s=(n<3?r(s):n>3?r(a,e,s):r(a,e))||s);return n>3&&s&&Object.defineProperty(a,e,s),s};let f=class extends(o(a)){constructor(){super(...arguments),this.activeTab=0,this.orientation="horizontal",this.align="left",this.tabSize="medium",this.variant="default",this.tabs=[],this.animated=!0,this.destroyInactiveTabPane=!1,this.tabsAriaLabel="",this.requiredComponents=["nr-icon"],this.keyboardController=new v(this),this.dragDropController=new g(this),this.editableController=new p(this),this.eventController=new y(this)}connectedCallback(){super.connectedCallback(),this.validateDependencies(),this.observeChildrenChanges(),this.keyboardController,this.dragDropController,this.editableController,this.eventController}render(){return e`<div class="${s({"tabs-container":!0,"vertical-align":"vertical"===this.orientation,"horizontal-align":"horizontal"===this.orientation,"right-align":"right"===this.align,"left-align":"left"===this.align,"center-align":"center"===this.align})}" role="tablist" aria-label="${this.tabsAriaLabel||i}" data-theme="${this.currentTheme}" data-size="${this.tabSize}" data-type="${this.variant}"><div class="tab-labels" style="flex-direction:${"vertical"===this.orientation?"column":"row"}"><div></div>${this.renderTabs()}<div></div></div><div class="tab-content" role="tabpanel">${this.renderActiveTab()}</div></div>`}observeChildrenChanges(){new MutationObserver((()=>{this.requestUpdate()})).observe(this,{childList:!0})}renderDeleteIcon(t,a){return this.editableController.canDeleteTab(t)?this.isComponentAvailable("nr-icon")?e`<nr-icon name="window-close" class="close-icon" @mousedown="${t=>{t.stopPropagation(),this.editableController.handleRemoveTab(a)}}"></nr-icon>`:(console.warn("[nr-tabs] Icon component not available. Delete icon will not render."),i):i}renderTabs(){const t=[];for(let a=0;a<this.tabs.length;a++){const r=this.tabs[a],n=a===this.activeTab,o=0===a,l=a===this.tabs.length-1,d=1===this.tabs.length,h=!o&&!l&&!d,b=e`<div data-index="${a}" draggable="${this.dragDropController.getDraggableState()?"true":"false"}" @dragenter="${t=>this.dragDropController.handleDragEnter(t)}" @dragleave="${t=>this.dragDropController.handleDragLeave(t)}" @dragstart="${t=>this.dragDropController.handleDragStart(t)}" @drop="${t=>this.dragDropController.handleDrop(t)}" class="${s({"tab-label":!0,active:n,disabled:!!r.disabled,"first-tab":o&&"horizontal"===this.orientation,"middle-tab":h&&"horizontal"===this.orientation,"last-tab":l&&"horizontal"===this.orientation,"single-tab":d&&"horizontal"===this.orientation})}" role="tab" aria-selected="${n?"true":"false"}" aria-disabled="${r.disabled?"true":"false"}" tabindex="${n?"0":"-1"}" @click="${t=>this.eventController.handleTabClick(a,t)}">${r.icon&&this.isComponentAvailable("nr-icon")?e`<nr-icon name="${r.icon}" class="tab-icon"></nr-icon>`:i} <span class="tab-text" contenteditable="${this.editableController.getContentEditableAttribute(r)||i}" @blur="${t=>this.editableController.handleTabTitleBlur(t,a)}" @keydown="${t=>this.editableController.handleTabTitleKeyDown(t,a)}">${r.label}</span> ${this.renderDeleteIcon(r,a)}</div>`;t.push(b)}if(this.editableController.canAddTab()){const a=e`<div class="tab-label add-tab-label" role="button" aria-label="Add new tab" tabindex="0" @mousedown="${()=>{this.editableController.handleAddTab()}}" @keydown="${t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.editableController.handleAddTab())}}">${this.isComponentAvailable("nr-icon")?e`<nr-icon name="plus" class="add-tab-icon"></nr-icon>`:e`<span>+</span>`}</div>`;t.push(a)}return t}updated(t){super.updated(t),this.activeTab>=this.tabs.length?this.activeTab=Math.max(0,this.tabs.length-1):this.activeTab<0&&(this.activeTab=0)}renderActiveTab(){if(0===this.tabs.length||this.activeTab<0||this.activeTab>=this.tabs.length)return i;const t=this.tabs[this.activeTab];return e`${t.content||i}`}setActiveTab(t,a){var e,i;if(a instanceof MouseEvent){null!==(i=null===(e=this.editable)||void 0===e?void 0:e.canMove)&&void 0!==i&&i||a.preventDefault()}if(t<0||t>=this.tabs.length||this.tabs[t].disabled)return;const r=this.activeTab,n=this.tabs[t];this.activeTab=t,this.dispatchEventWithMetadata("nr-tab-click",{index:t,tab:n,previousIndex:r}),r!==t&&this.dispatchEventWithMetadata("nr-tab-change",{index:t,tab:n,previousIndex:r})}};f.styles=l,m([r({type:Number})],f.prototype,"activeTab",void 0),m([r({type:String})],f.prototype,"orientation",void 0),m([r({type:String})],f.prototype,"align",void 0),m([r({type:String,attribute:"size"})],f.prototype,"tabSize",void 0),m([r({type:String,attribute:"type"})],f.prototype,"variant",void 0),m([r({type:Object})],f.prototype,"editable",void 0),m([r({type:Array})],f.prototype,"tabs",void 0),m([r({type:Boolean})],f.prototype,"animated",void 0),m([r({type:Boolean})],f.prototype,"destroyInactiveTabPane",void 0),m([r({type:String})],f.prototype,"tabsAriaLabel",void 0),f=m([n("nr-tabs")],f);export{b as DEFAULT_ACTIVE_TAB,d as EMPTY_STRING,c as LABEL_ATTRIBUTES,h as NOTHING_STRING,f as NrTabsElement,f as TabsComponent};
|
package/package.json
CHANGED