@oiij/chrome-tabs 0.0.2 → 0.0.4
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/dist/TabItem.vue.d.ts +1 -1
- package/dist/Tabs.vue.d.ts +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +243 -246
- package/dist/index.umd.cjs +7 -7
- package/package.json +9 -6
package/dist/TabItem.vue.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { TabsItemProps } from '
|
1
|
+
import { TabsItemProps } from '.';
|
2
2
|
declare const _default: import('vue').DefineComponent<TabsItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
3
3
|
itemClick: (ev: MouseEvent) => any;
|
4
4
|
itemContextmenu: (ev: MouseEvent) => any;
|
package/dist/Tabs.vue.d.ts
CHANGED
package/dist/index.cjs
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");function pe(e){let t=".",n="__",o="--",i;if(e){let a=e.blockPrefix;a&&(t=a),a=e.elementPrefix,a&&(n=a),a=e.modifierPrefix,a&&(o=a)}const l={install(a){i=a.c;const
|
2
|
-
`+Object.entries(e).map(n=>t+` ${
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");function pe(e){let t=".",n="__",o="--",i;if(e){let a=e.blockPrefix;a&&(t=a),a=e.elementPrefix,a&&(n=a),a=e.modifierPrefix,a&&(o=a)}const l={install(a){i=a.c;const v=a.context;v.bem={},v.bem.b=null,v.bem.els=null}};function s(a){let v,h;return{before(p){v=p.bem.b,h=p.bem.els,p.bem.els=null},after(p){p.bem.b=v,p.bem.els=h},$({context:p,props:k}){return a=typeof a=="string"?a:a({context:p,props:k}),p.bem.b=a,`${k?.bPrefix||t}${p.bem.b}`}}}function u(a){let v;return{before(h){v=h.bem.els},after(h){h.bem.els=v},$({context:h,props:p}){return a=typeof a=="string"?a:a({context:h,props:p}),h.bem.els=a.split(",").map(k=>k.trim()),h.bem.els.map(k=>`${p?.bPrefix||t}${h.bem.b}${n}${k}`).join(", ")}}}function f(a){return{$({context:v,props:h}){a=typeof a=="string"?a:a({context:v,props:h});const p=a.split(",").map(I=>I.trim());function k(I){return p.map(A=>`&${h?.bPrefix||t}${v.bem.b}${I!==void 0?`${n}${I}`:""}${o}${A}`).join(", ")}const S=v.bem.els;if(S!==null){if(process.env.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${a}) is invalid, using modifier inside multiple elements is not allowed`);return k(S[0])}else return k()}}}function d(a){return{$({context:v,props:h}){a=typeof a=="string"?a:a({context:v,props:h});const p=v.bem.els;if(process.env.NODE_ENV!=="production"&&p!==null&&p.length>=2)throw Error(`[css-render/plugin-bem]: notM(${a}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${h?.bPrefix||t}${v.bem.b}${p!==null&&p.length>0?`${n}${p[0]}`:""}${o}${a})`}}}return Object.assign(l,{cB:(...a)=>i(s(a[0]),a[1],a[2]),cE:(...a)=>i(u(a[0]),a[1],a[2]),cM:(...a)=>i(f(a[0]),a[1],a[2]),cNotM:(...a)=>i(d(a[0]),a[1],a[2])}),l}function ve(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const le=/\s*,(?![^(]*\))\s*/g,be=/\s+/g;function ge(e,t){const n=[];return t.split(le).forEach(o=>{let i=ve(o);if(i){if(i===1){e.forEach(s=>{n.push(o.replace("&",s))});return}}else{e.forEach(s=>{n.push((s&&s+" ")+o)});return}let l=[o];for(;i--;){const s=[];l.forEach(u=>{e.forEach(f=>{s.push(u.replace("&",f))})}),l=s}l.forEach(s=>n.push(s))}),n}function xe(e,t){const n=[];return t.split(le).forEach(o=>{e.forEach(i=>{n.push((i&&i+" ")+o)})}),n}function ye(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ge(t,n):t=xe(t,n))}),t.join(", ").replace(be," ")}function Z(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function q(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function ke(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function R(e){return e?/^\s*@(s|m)/.test(e):!1}const $e=/[A-Z]/g;function se(e){return e.replace($e,t=>"-"+t.toLowerCase())}function Ce(e,t=" "){return typeof e=="object"&&e!==null?` {
|
2
|
+
`+Object.entries(e).map(n=>t+` ${se(n[0])}: ${n[1]};`).join(`
|
3
3
|
`)+`
|
4
4
|
`+t+"}":`: ${e};`}function we(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function U(e,t,n,o){if(!t)return"";const i=we(t,n,o);if(!i)return"";if(typeof i=="string")return`${e} {
|
5
5
|
${i}
|
6
6
|
}`;const l=Object.keys(i);if(l.length===0)return n.config.keepEmptyBlock?e+` {
|
7
|
-
}`:"";const
|
8
|
-
`+
|
9
|
-
`);return}
|
10
|
-
`)}function F(e,t,n){e&&e.forEach(o=>{if(Array.isArray(o))F(o,t,n);else if(typeof o=="function"){const i=o(t);Array.isArray(i)?F(i,t,n):i&&n(i)}else o&&n(o)})}function
|
7
|
+
}`:"";const s=e?[e+" {"]:[];return l.forEach(u=>{const f=i[u];if(u==="raw"){s.push(`
|
8
|
+
`+f+`
|
9
|
+
`);return}u=se(u),f!=null&&s.push(` ${u}${Ce(f)}`)}),e&&s.push("}"),s.join(`
|
10
|
+
`)}function F(e,t,n){e&&e.forEach(o=>{if(Array.isArray(o))F(o,t,n);else if(typeof o=="function"){const i=o(t);Array.isArray(i)?F(i,t,n):i&&n(i)}else o&&n(o)})}function ue(e,t,n,o,i){const l=e.$;let s="";if(!l||typeof l=="string")R(l)?s=l:t.push(l);else if(typeof l=="function"){const d=l({context:o.context,props:i});R(d)?s=d:t.push(d)}else if(l.before&&l.before(o.context),!l.$||typeof l.$=="string")R(l.$)?s=l.$:t.push(l.$);else if(l.$){const d=l.$({context:o.context,props:i});R(d)?s=d:t.push(d)}const u=ye(t),f=U(u,e.props,o,i);s?n.push(`${s} {`):f.length&&n.push(f),e.children&&F(e.children,{context:o.context,props:i},d=>{if(typeof d=="string"){const m=U(u,{raw:d},o,i);n.push(m)}else ue(d,t,n,o,i)}),t.pop(),s&&n.push("}"),l&&l.after&&l.after(o.context)}function Ee(e,t,n){const o=[];return ue(e,[],o,t,n),o.join(`
|
11
11
|
|
12
|
-
`)}function Ne(e){for(var t=0,n,o=0,i=e.length;i>=4;++o,i-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Be(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(Z),t.els=[];else{const l=q(n,o);l&&i.includes(l)&&(Z(l),t.els=i.filter(
|
12
|
+
`)}function Ne(e){for(var t=0,n,o=0,i=e.length;i>=4;++o,i-=4)n=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Be(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(Z),t.els=[];else{const l=q(n,o);l&&i.includes(l)&&(Z(l),t.els=i.filter(s=>s!==l))}}function K(e,t){e.push(t)}function Ie(e,t,n,o,i,l,s,u,f){let d;if(n===void 0&&(d=t.render(o),n=Ne(d)),f){f.adapter(n,d??t.render(o));return}u===void 0&&(u=document.head);const m=q(n,u);if(m!==null&&!l)return m;const c=m??ke(n);if(d===void 0&&(d=t.render(o)),c.textContent=d,m!==null)return m;if(s){const b=u.querySelector(`meta[name="${s}"]`);if(b)return u.insertBefore(c,b),K(t.els,c),c}return i?u.insertBefore(c,u.querySelector("style, link")):u.appendChild(c),K(t.els,c),c}function Me(e){return Ee(this,this.instance,e)}function Se(e={}){const{id:t,ssr:n,props:o,head:i=!1,force:l=!1,anchorMetaName:s,parent:u}=e;return Ie(this.instance,this,t,o,i,l,s,u,n)}function Ve(e={}){const{id:t,parent:n}=e;Be(this.instance,this,t,n)}const z=function(e,t,n,o){return{instance:e,$:t,props:n,children:o,els:[],render:Me,mount:Se,unmount:Ve}},_e=function(e,t,n,o){return Array.isArray(t)?z(e,{$:null},null,t):Array.isArray(n)?z(e,t,null,n):Array.isArray(o)?z(e,t,n,o):z(e,t,n,null)};function Ae(e={}){const t={c:(...n)=>_e(t,...n),use:(n,...o)=>n.install(t,...o),find:q,context:{},config:e};return t}function Re(e){const{namespace:t="n",blockPrefix:n=`.${t}-`,elementPrefix:o="__",modifierPrefix:i="--"}=e??{},l=Ae(),s=pe({blockPrefix:n,elementPrefix:o,modifierPrefix:i});return l.use(s),{namespace:t,blockPrefix:n,elementPrefix:o,modifierPrefix:i,cssr:l,plugin:s}}const ze="@css-render/vue3-ssr";function Le(e,t){return`<style cssr-id="${e}">
|
13
13
|
${t}
|
14
|
-
</style>`}function je(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Te(e,t)))}const Pe=typeof document<"u";function Oe(){if(Pe)return;const e=r.inject(Le,null);if(e!==null)return{adapter:(t,n)=>je(t,n,e),context:e}}function De(e,t){const n=Oe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:We,plugin:_e,namespace:ae}=ze(),{c:x,cB:T,cE:g,cM:D,cNotM:Y}={...We,..._e},V=`${ae}-chrome-tabs`,C=`${ae}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function He(){return x([T("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[x(".group-move, .group-enter-active, .group-leave-active",{transition:M}),x(".group-enter-from, .group-leave-to",{opacity:0}),x(".group-leave-active",{}),g("prefix",{}),g("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[x("svg",{width:"100%",height:"100%",fill:"currentColor"}),x("&:hover",{backgroundColor:"var(--primary-color)"})]),g("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),g("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[g("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[x("&:hover",{backgroundColor:"var(--primary-color)"})])]),g("suffix",{})]),T("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[D("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),D("active",[g("background",{opacity:1})]),Y("active",[x("&:hover",{},[g("content",{backgroundColor:"var(--primary-color)"})])]),x("&::first-child",{marginLeft:"0 !important"}),x("&::last-child",{marginRight:"0 !important"}),g("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),g("slot",{}),g("icon",{},[x("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),g("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[x("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),x("svg",{width:"100%",height:"100%",fill:"currentColor"})]),g("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[g("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),x("svg",{fill:"var(--active-background-color)"})]),g("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[D("show",{opacity:1})])]),x(".dark",[T("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[g("icon",{backgroundColor:"var(--active-background-color-dark)"},[x("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),T("chrome-tabs-item",{},[Y("active",[x("&:hover",{},[g("content",{backgroundColor:"var(--primary-color-dark)"})])]),g("background",{},[g("block",{backgroundColor:"var(--active-background-color-dark)"}),x("svg",{fill:"var(--active-background-color-dark)"})])])])])}const O=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Fe={name:"LineMdLoadingTwotoneLoop"},qe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ge(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",qe,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ze=O(Fe,[["render",Ge]]),Ue={name:"RiCloseLine"},Ke={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ye(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ke,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Je=O(Ue,[["render",Ye]]),ce=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${C}__label`},e.label):e.label),u=r.computed(()=>e.loadingIcon??r.h(Ze));function s(m){var c;m.stopPropagation(),n("itemClick",m),(c=e.onClick)==null||c.call(e,m)}function d(m){var c;n("itemContextmenu",m),(c=e.onContextMenu)==null||c.call(e,m)}function f(){var m;n("itemClose"),(m=e.onClose)==null||m.call(e)}return(m,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(C),{[`${r.unref(C)}--active`]:i.value,[`${r.unref(C)}--disabled`]:m.disabled}]),onClick:s,onContextmenu:d},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?u.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(C)}__close`]),onClick:r.withModifiers(f,["stop"])},[r.createVNode(Je)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__background`])},[c[0]||(c[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__block`])},null,2),c[1]||(c[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref(C)}__line`,o.value?`${r.unref(C)}__line--show`:""])},null,2)],34))}});function fe(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Qe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xe=Object.prototype.toString,et=e=>Xe.call(e)==="[object Object]",J=()=>{};function tt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function nt(e,t={}){let n,o,i=J;const l=d=>{clearTimeout(d),i(),i=J};let u;return d=>{const f=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),f<=0||m!==void 0&&m<=0?(o&&(l(o),o=null),Promise.resolve(d())):new Promise((c,v)=>{i=t.rejectOnCancel?v:c,u=d,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=null,c(u())},m)),n=setTimeout(()=>{o&&l(o),o=null,c(d())},f)})}}function P(e){return Array.isArray(e)?e:[e]}function ot(e){return r.getCurrentInstance()}function rt(e,t=200,n={}){return tt(nt(t,n),e)}function it(e,t=!0,n){ot()?r.onMounted(e,n):t?e():r.nextTick(e)}function lt(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const G=Qe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function ut(...e){const t=[],n=()=>{t.forEach(s=>s()),t.length=0},o=(s,d,f,m)=>(s.addEventListener(d,f,m),()=>s.removeEventListener(d,f,m)),i=r.computed(()=>{const s=P(r.toValue(e[0])).filter(d=>d!=null);return s.every(d=>typeof d!="string")?s:void 0}),l=lt(()=>{var s,d;return[(d=(s=i.value)==null?void 0:s.map(f=>B(f)))!=null?d:[G].filter(f=>f!=null),P(r.toValue(i.value?e[1]:e[0])),P(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([s,d,f,m])=>{if(n(),!(s!=null&&s.length)||!(d!=null&&d.length)||!(f!=null&&f.length))return;const c=et(m)?{...m}:m;t.push(...s.flatMap(v=>d.flatMap($=>f.map(a=>o(v,$,a,c)))))},{flush:"post"}),u=()=>{l(),n()};return fe(n),u}function st(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function at(e){const t=st();return r.computed(()=>(t.value,!!e()))}function ct(e,t,n={}){const{window:o=G,...i}=n;let l;const u=at(()=>o&&"ResizeObserver"in o),s=()=>{l&&(l.disconnect(),l=void 0)},d=r.computed(()=>{const c=r.toValue(e);return Array.isArray(c)?c.map(v=>B(v)):[B(c)]}),f=r.watch(d,c=>{if(s(),u.value&&o){l=new ResizeObserver(t);for(const v of c)v&&l.observe(v,i)}},{immediate:!0,flush:"post"}),m=()=>{s(),f()};return fe(m),{isSupported:u,stop:m}}function ft(e,t={width:0,height:0},n={}){const{window:o=G,box:i="content-box"}=n,l=r.computed(()=>{var c,v;return(v=(c=B(e))==null?void 0:c.namespaceURI)==null?void 0:v.includes("svg")}),u=r.shallowRef(t.width),s=r.shallowRef(t.height),{stop:d}=ct(e,([c])=>{const v=i==="border-box"?c.borderBoxSize:i==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(o&&l.value){const $=B(e);if($){const a=$.getBoundingClientRect();u.value=a.width,s.value=a.height}}else if(v){const $=P(v);u.value=$.reduce((a,{inlineSize:b})=>a+b,0),s.value=$.reduce((a,{blockSize:b})=>a+b,0)}else u.value=c.contentRect.width,s.value=c.contentRect.height},n);it(()=>{const c=B(e);c&&(u.value="offsetWidth"in c?c.offsetWidth:t.width,s.value="offsetHeight"in c?c.offsetHeight:t.height)});const f=r.watch(()=>B(e),c=>{u.value=c?t.width:0,s.value=c?t.height:0});function m(){d(),f()}return{width:u,height:s,stop:m}}function dt(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:u}=ft(i);async function s(m){var v;await r.nextTick();const c=(v=i.value)==null?void 0:v.querySelector(t);c&&c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function d(m){var v,$;if(!n)return;m.preventDefault();const{deltaY:c}=m;switch(o){case"vertical":(v=i.value)==null||v.scrollBy({top:c>0?u.value:-u.value,behavior:"smooth"});break;case"horizontal":($=i.value)==null||$.scrollBy({left:c>0?l.value:-l.value,behavior:"smooth"});break}}ut(i,"wheel",d);const f=rt(s,500);return r.watch([l,u],()=>{f()}),{scrollRef:i,scrollToView:s}}var mt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},E=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},de=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Q=function(e){return{r:E(e.r,0,255),g:E(e.g,0,255),b:E(e.b,0,255),a:E(e.a)}},W=function(e){return{r:y(e.r),g:y(e.g),b:y(e.b),a:y(e.a,3)}},ht=/^#([0-9a-f]{3,8})$/i,j=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},me=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),u=l-Math.min(t,n,o),s=u?l===t?(n-o)/u:l===n?2+(o-t)/u:4+(t-n)/u:0;return{h:60*(s<0?s+6:s),s:l?u/l*100:0,v:l/255*100,a:i}},he=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),u=o*(1-n),s=o*(1-(t-l)*n),d=o*(1-(1-t+l)*n),f=l%6;return{r:255*[o,s,u,u,d,o][f],g:255*[d,o,o,s,u,u][f],b:255*[u,u,d,o,o,s][f],a:i}},X=function(e){return{h:de(e.h),s:E(e.s,0,100),l:E(e.l,0,100),a:E(e.a)}},ee=function(e){return{h:y(e.h),s:y(e.s),l:y(e.l),a:y(e.a,3)}},te=function(e){return he((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},A=function(e){return{h:(t=me(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},pt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne={string:[[function(e){var t=ht.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?y(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=bt.exec(e)||gt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Q({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pt.exec(e)||vt.exec(e);if(!t)return null;var n,o,i=X({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(mt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return te(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?Q({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var u=X({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return te(u)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var u=function(s){return{h:de(s.h),s:E(s.s,0,100),v:E(s.v,0,100),a:E(s.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return he(u)},"hsv"]]},oe=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},xt=function(e){return typeof e=="string"?oe(e.trim(),ne.string):typeof e=="object"&&e!==null?oe(e,ne.object):[null,void 0]},_=function(e,t){var n=A(e);return{h:n.h,s:E(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},re=function(e,t){var n=A(e);return{h:n.h,s:n.s,l:E(n.l+100*t,0,100),a:n.a}},ie=function(){function e(t){this.parsed=xt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return y(H(this.rgba),2)},e.prototype.isDark=function(){return H(this.rgba)<.5},e.prototype.isLight=function(){return H(this.rgba)>=.5},e.prototype.toHex=function(){return t=W(this.rgba),n=t.r,o=t.g,i=t.b,u=(l=t.a)<1?j(y(255*l)):"","#"+j(n)+j(o)+j(i)+u;var t,n,o,i,l,u},e.prototype.toRgb=function(){return W(this.rgba)},e.prototype.toRgbString=function(){return t=W(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ee(A(this.rgba))},e.prototype.toHslString=function(){return t=ee(A(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=me(this.rgba),{h:y(t.h),s:y(t.s),v:y(t.v),a:y(t.a,3)};var t},e.prototype.invert=function(){return w({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),w(_(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),w(_(this.rgba,-t))},e.prototype.grayscale=function(){return w(_(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),w(re(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),w(re(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?w({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):y(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=A(this.rgba);return typeof t=="number"?w({h:t,s:n.s,l:n.l,a:n.a}):y(n.h)},e.prototype.isEqual=function(t){return this.toHex()===w(t).toHex()},e}(),w=function(e){return e instanceof ie?e:new ie(e)};const yt={name:"RiAddLine"},kt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function $t(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",kt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const Ct=O(yt,[["render",$t]]),wt={name:"RiArrowDropDownLine"},Et={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Nt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Et,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const Bt=O(wt,[["render",Nt]]),It=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;De("n-chrome-tabs",He());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},u=r.useModel(e,"value"),s=r.computed(()=>{var h;return(h=e.options)==null?void 0:h.findIndex(p=>p.key===u.value)}),{scrollRef:d,scrollToView:f}=dt({activeClassName:`.${C}--active`,direction:"horizontal"});r.watch(u,()=>{f()},{immediate:!0});const m=r.computed(()=>w(o).darken(.9).toHex()),c=r.computed(()=>w(i).darken(.8).toHex()),v=r.computed(()=>w(l).darken(.3).toHex());function $(h){n("click",h)}function a(h){n("contextmenu",h)}function b(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${c.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${v.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(Bt)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:d,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:k,...S},I)=>(r.openBlock(),r.createBlock(ce,r.mergeProps({key:k},{ref_for:!0},S,{index:I,"active-index":s.value,onItemClick:R=>$(k),onItemContextmenu:R=>a(k),onItemClose:R=>b(k)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=k=>n("add"))},[r.createVNode(Ct)],2)):r.createCommentVNode("",!0)],6))}});exports.CTabItem=ce;exports.CTabs=It;
|
14
|
+
</style>`}function Te(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Le(e,t)))}const je=typeof document<"u";function Pe(){if(je)return;const e=r.inject(ze,null);if(e!==null)return{adapter:(t,n)=>Te(t,n,e),context:e}}function Oe(e,t){const n=Pe();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}const{cssr:De,plugin:He,namespace:ae}=Re(),{c:g,cB:L,cE:x,cM:O,cNotM:Y}={...De,...He},V=`${ae}-chrome-tabs`,$=`${ae}-chrome-tabs-item`,M="all .2s cubic-bezier(.4, 0, .2, 1)";function We(){return g([L("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[g("div",{boxSizing:"border-box"}),g(".group-move, .group-enter-active, .group-leave-active",{transition:M}),g(".group-enter-from, .group-leave-to",{opacity:0}),g(".group-leave-active",{}),x("prefix",{}),x("icon",{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",padding:"5px",borderRadius:"10px",backgroundColor:"var(--active-background-color)",transition:M},[g("svg",{width:"100%",height:"100%",fill:"currentColor"}),g("&:hover",{backgroundColor:"var(--primary-color)"})]),x("content",{flex:"1",height:"100%",minWidth:0,overflow:"hidden",marginLeft:"-6px",padding:"0 10px"}),x("scroll",{position:"relative",display:"flex",alignItems:"center",height:"100%"},[x("icon",{marginLeft:"5px",borderRadius:"50%",backgroundColor:"transparent",flexShrink:0},[g("&:hover",{backgroundColor:"var(--primary-color)"})])]),x("suffix",{})]),L("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 10px 0px 10px"},[O("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),O("active",[x("background",{opacity:1})]),Y("active",[g("&:hover",{},[x("content",{backgroundColor:"var(--primary-color)"})])]),g("&::first-child",{marginLeft:"0 !important"}),g("&::last-child",{marginRight:"0 !important"}),x("content",{position:"relative",zIndex:1,height:"28px",display:"flex",alignItems:"center",gap:"5px",borderRadius:"10px",padding:"0 10px",transition:M}),x("slot",{}),x("icon",{lineHeight:1},[g("svg",{width:"1.2em",height:"1.2em",fill:"currentColor"})]),x("close",{width:"16px",height:"16px",padding:"2px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:M},[g("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),g("svg",{width:"100%",height:"100%",fill:"currentColor"})]),x("background",{position:"absolute",opacity:0,left:0,bottom:0,zIndex:0,height:"34px",width:"100%",display:"flex",alignItems:"flex-end",transition:M},[x("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),g("svg",{fill:"var(--active-background-color)"})]),x("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:M,backgroundColor:"var(--primary-color)",opacity:0},[O("show",{opacity:1})])]),g(".dark",[L("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[x("icon",{backgroundColor:"var(--active-background-color-dark)"},[g("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),L("chrome-tabs-item",{},[Y("active",[g("&:hover",{},[x("content",{backgroundColor:"var(--primary-color-dark)"})])]),x("background",{},[x("block",{backgroundColor:"var(--active-background-color-dark)"}),g("svg",{fill:"var(--active-background-color-dark)"})])])])])}const P=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},Fe={name:"LineMdLoadingTwotoneLoop"},qe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ge(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",qe,t[0]||(t[0]=[r.createStaticVNode('<g fill="none" stroke="#757575" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path stroke-dasharray="16" stroke-dashoffset="16" d="M12 3c4.97 0 9 4.03 9 9"><animate fill="freeze" attributeName="stroke-dashoffset" dur="0.3s" values="16;0"></animate><animateTransform attributeName="transform" dur="1.5s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></path><path stroke-dasharray="64" stroke-dashoffset="64" stroke-opacity=".3" d="M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z"><animate fill="freeze" attributeName="stroke-dashoffset" dur="1.2s" values="64;0"></animate></path></g>',1)]))}const Ze=P(Fe,[["render",Ge]]),Ue={name:"RiCloseLine"},Ke={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Ye(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Ke,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 10.587l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.415 1.414l-4.95-4.95l-4.949 4.95l-1.414-1.415l4.95-4.95l-4.95-4.95L7.05 5.638z"},null,-1)]))}const Je=P(Ue,[["render",Ye]]),ce=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},activeIndex:{default:0},index:{}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.index&&e.activeIndex!==e.index-1),i=r.computed(()=>e.activeIndex===e.index),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label),s=r.computed(()=>e.loadingIcon??r.h(Ze));function u(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(m)}function f(m){n("itemContextmenu",m),e.onContextMenu?.(m)}function d(){n("itemClose"),e.onClose?.()}return(m,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:m.disabled}]),onClick:u,onContextmenu:f},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.loading?s.value:m.icon)))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),m.closable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Je)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[c[0]||(c[0]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 10 A 10 10 0 0 0 10 0 L 10 10 Z"})],-1)),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__block`])},null,2),c[1]||(c[1]=r.createElementVNode("svg",{width:"10",height:"10"},[r.createElementVNode("path",{d:"M 0 0 A 10 10 0 0 0 10 10 L 0 10 Z"})],-1))],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__line`,o.value?`${r.unref($)}__line--show`:""])},null,2)],34))}});function de(e){return r.getCurrentScope()?(r.onScopeDispose(e),!0):!1}const Qe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xe=Object.prototype.toString,et=e=>Xe.call(e)==="[object Object]",J=()=>{};function tt(e,t){function n(...o){return new Promise((i,l)=>{Promise.resolve(e(()=>t.apply(this,o),{fn:t,thisArg:this,args:o})).then(i).catch(l)})}return n}function nt(e,t={}){let n,o,i=J;const l=f=>{clearTimeout(f),i(),i=J};let s;return f=>{const d=r.toValue(e),m=r.toValue(t.maxWait);return n&&l(n),d<=0||m!==void 0&&m<=0?(o&&(l(o),o=void 0),Promise.resolve(f())):new Promise((c,b)=>{i=t.rejectOnCancel?b:c,s=f,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,c(s())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,c(f())},d)})}}function j(e){return Array.isArray(e)?e:[e]}function ot(e){return r.getCurrentInstance()}function rt(e,t=200,n={}){return tt(nt(t,n),e)}function it(e,t=!0,n){ot()?r.onMounted(e,n):t?e():r.nextTick(e)}function lt(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const G=Qe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n?.$el)!=null?t:n}function st(...e){const t=[],n=()=>{t.forEach(u=>u()),t.length=0},o=(u,f,d,m)=>(u.addEventListener(f,d,m),()=>u.removeEventListener(f,d,m)),i=r.computed(()=>{const u=j(r.toValue(e[0])).filter(f=>f!=null);return u.every(f=>typeof f!="string")?u:void 0}),l=lt(()=>{var u,f;return[(f=(u=i.value)==null?void 0:u.map(d=>B(d)))!=null?f:[G].filter(d=>d!=null),j(r.toValue(i.value?e[1]:e[0])),j(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([u,f,d,m])=>{if(n(),!u?.length||!f?.length||!d?.length)return;const c=et(m)?{...m}:m;t.push(...u.flatMap(b=>f.flatMap(E=>d.map(a=>o(b,E,a,c)))))},{flush:"post"}),s=()=>{l(),n()};return de(n),s}function ut(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function at(e){const t=ut();return r.computed(()=>(t.value,!!e()))}function ct(e,t,n={}){const{window:o=G,...i}=n;let l;const s=at(()=>o&&"ResizeObserver"in o),u=()=>{l&&(l.disconnect(),l=void 0)},f=r.computed(()=>{const c=r.toValue(e);return Array.isArray(c)?c.map(b=>B(b)):[B(c)]}),d=r.watch(f,c=>{if(u(),s.value&&o){l=new ResizeObserver(t);for(const b of c)b&&l.observe(b,i)}},{immediate:!0,flush:"post"}),m=()=>{u(),d()};return de(m),{isSupported:s,stop:m}}function dt(e,t={width:0,height:0},n={}){const{window:o=G,box:i="content-box"}=n,l=r.computed(()=>{var c,b;return(b=(c=B(e))==null?void 0:c.namespaceURI)==null?void 0:b.includes("svg")}),s=r.shallowRef(t.width),u=r.shallowRef(t.height),{stop:f}=ct(e,([c])=>{const b=i==="border-box"?c.borderBoxSize:i==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(o&&l.value){const E=B(e);if(E){const a=E.getBoundingClientRect();s.value=a.width,u.value=a.height}}else if(b){const E=j(b);s.value=E.reduce((a,{inlineSize:v})=>a+v,0),u.value=E.reduce((a,{blockSize:v})=>a+v,0)}else s.value=c.contentRect.width,u.value=c.contentRect.height},n);it(()=>{const c=B(e);c&&(s.value="offsetWidth"in c?c.offsetWidth:t.width,u.value="offsetHeight"in c?c.offsetHeight:t.height)});const d=r.watch(()=>B(e),c=>{s.value=c?t.width:0,u.value=c?t.height:0});function m(){f(),d()}return{width:s,height:u,stop:m}}function ft(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:s}=dt(i);async function u(m){await r.nextTick();const c=i.value?.querySelector(t);c&&c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function f(m){if(!n)return;m.preventDefault();const{deltaY:c}=m;switch(o){case"vertical":i.value?.scrollBy({top:c>0?s.value:-s.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:c>0?l.value:-l.value,behavior:"smooth"});break}}st(i,"wheel",f);const d=rt(u,500);return r.watch([l,s],()=>{d()}),{scrollRef:i,scrollToView:u}}var mt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},y=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},w=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},fe=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Q=function(e){return{r:w(e.r,0,255),g:w(e.g,0,255),b:w(e.b,0,255),a:w(e.a)}},D=function(e){return{r:y(e.r),g:y(e.g),b:y(e.b),a:y(e.a,3)}},ht=/^#([0-9a-f]{3,8})$/i,T=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},me=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),s=l-Math.min(t,n,o),u=s?l===t?(n-o)/s:l===n?2+(o-t)/s:4+(t-n)/s:0;return{h:60*(u<0?u+6:u),s:l?s/l*100:0,v:l/255*100,a:i}},he=function(e){var t=e.h,n=e.s,o=e.v,i=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),s=o*(1-n),u=o*(1-(t-l)*n),f=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,u,s,s,f,o][d],g:255*[f,o,o,u,s,s][d],b:255*[s,s,f,o,o,u][d],a:i}},X=function(e){return{h:fe(e.h),s:w(e.s,0,100),l:w(e.l,0,100),a:w(e.a)}},ee=function(e){return{h:y(e.h),s:y(e.s),l:y(e.l),a:y(e.a,3)}},te=function(e){return he((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},_=function(e){return{h:(t=me(e)).h,s:(i=(200-(n=t.s))*(o=t.v)/100)>0&&i<200?n*o/100/(i<=100?i:200-i)*100:0,l:i/2,a:t.a};var t,n,o,i},pt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ne={string:[[function(e){var t=ht.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?y(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?y(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=bt.exec(e)||gt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Q({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=pt.exec(e)||vt.exec(e);if(!t)return null;var n,o,i=X({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(mt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return te(i)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=i===void 0?1:i;return N(t)&&N(n)&&N(o)?Q({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=X({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return te(s)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,i=e.a,l=i===void 0?1:i;if(!N(t)||!N(n)||!N(o))return null;var s=function(u){return{h:fe(u.h),s:w(u.s,0,100),v:w(u.v,0,100),a:w(u.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return he(s)},"hsv"]]},oe=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},xt=function(e){return typeof e=="string"?oe(e.trim(),ne.string):typeof e=="object"&&e!==null?oe(e,ne.object):[null,void 0]},H=function(e,t){var n=_(e);return{h:n.h,s:w(n.s+100*t,0,100),l:n.l,a:n.a}},W=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},re=function(e,t){var n=_(e);return{h:n.h,s:n.s,l:w(n.l+100*t,0,100),a:n.a}},ie=function(){function e(t){this.parsed=xt(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return y(W(this.rgba),2)},e.prototype.isDark=function(){return W(this.rgba)<.5},e.prototype.isLight=function(){return W(this.rgba)>=.5},e.prototype.toHex=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,s=(l=t.a)<1?T(y(255*l)):"","#"+T(n)+T(o)+T(i)+s;var t,n,o,i,l,s},e.prototype.toRgb=function(){return D(this.rgba)},e.prototype.toRgbString=function(){return t=D(this.rgba),n=t.r,o=t.g,i=t.b,(l=t.a)<1?"rgba("+n+", "+o+", "+i+", "+l+")":"rgb("+n+", "+o+", "+i+")";var t,n,o,i,l},e.prototype.toHsl=function(){return ee(_(this.rgba))},e.prototype.toHslString=function(){return t=ee(_(this.rgba)),n=t.h,o=t.s,i=t.l,(l=t.a)<1?"hsla("+n+", "+o+"%, "+i+"%, "+l+")":"hsl("+n+", "+o+"%, "+i+"%)";var t,n,o,i,l},e.prototype.toHsv=function(){return t=me(this.rgba),{h:y(t.h),s:y(t.s),v:y(t.v),a:y(t.a,3)};var t},e.prototype.invert=function(){return C({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),C(H(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),C(H(this.rgba,-t))},e.prototype.grayscale=function(){return C(H(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),C(re(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),C(re(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?C({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):y(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=_(this.rgba);return typeof t=="number"?C({h:t,s:n.s,l:n.l,a:n.a}):y(n.h)},e.prototype.isEqual=function(t){return this.toHex()===C(t).toHex()},e}(),C=function(e){return e instanceof ie?e:new ie(e)};const yt={name:"RiAddLine"},kt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function $t(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",kt,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)]))}const Ct=P(yt,[["render",$t]]),wt={name:"RiArrowDropDownLine"},Et={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Nt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",Et,t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"m12 15l-4.243-4.242l1.415-1.414L12 12.172l2.828-2.828l1.415 1.414z"},null,-1)]))}const Bt=P(wt,[["render",Nt]]),It=r.defineComponent({__name:"Tabs",props:r.mergeModels({colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{}},{value:{},valueModifiers:{}}),emits:r.mergeModels(["click","contextmenu","close","add"],["update:value"]),setup(e,{emit:t}){const n=t;Oe("n-chrome-tabs",We());const{background:o="#E5E7EB",active:i="#fff",primary:l="rgba(251,191,36,1)"}=e.colors??{},s=r.useModel(e,"value"),u=r.computed(()=>e.options?.findIndex(h=>h.key===s.value)),{scrollRef:f,scrollToView:d}=ft({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(s,()=>{d()},{immediate:!0});const m=r.computed(()=>C(o).darken(.9).toHex()),c=r.computed(()=>C(i).darken(.8).toHex()),b=r.computed(()=>C(l).darken(.3).toHex());function E(h){n("click",h)}function a(h){n("contextmenu",h)}function v(h){n("close",h)}return(h,p)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(V)]),style:r.normalizeStyle({"--background-color":`${r.unref(o)}`,"--background-color-dark":`${m.value}`,"--active-background-color":`${r.unref(i)}`,"--active-background-color-dark":`${c.value}`,"--primary-color":`${r.unref(l)}`,"--primary-color-dark":`${b.value}`})},[h.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(V)}__icon`])},[r.createVNode(Bt)],2)):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:f,class:r.normalizeClass([`${r.unref(V)}__content`])},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(V)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.options,({key:k,...S},I)=>(r.openBlock(),r.createBlock(ce,r.mergeProps({key:k},{ref_for:!0},S,{index:I,"active-index":u.value,onItemClick:A=>E(k),onItemContextmenu:A=>a(k),onItemClose:A=>v(k)}),null,16,["index","active-index","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],2),r.renderSlot(h.$slots,"suffix"),h.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(V)}__icon`]),onClick:p[0]||(p[0]=k=>n("add"))},[r.createVNode(Ct)],2)):r.createCommentVNode("",!0)],6))}});exports.CTabItem=ce;exports.CTabs=It;
|