@oiij/chrome-tabs 0.0.12 → 0.0.13
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/Tabs.vue.d.ts +2 -2
- package/dist/index.cjs +8 -8
- package/dist/index.js +382 -385
- package/dist/index.umd.cjs +8 -8
- package/package.json +7 -14
package/dist/index.umd.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(function(I,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(I=typeof globalThis<"u"?globalThis:I||self,r(I["@oiij/chrome-tabs"]={},I.Vue))})(this,(function(I,r){"use strict";function
|
|
1
|
+
(function(I,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(I=typeof globalThis<"u"?globalThis:I||self,r(I["@oiij/chrome-tabs"]={},I.Vue))})(this,(function(I,r){"use strict";function me(e){let t=".",n="__",o="--",i;if(e){let s=e.blockPrefix;s&&(t=s),s=e.elementPrefix,s&&(n=s),s=e.modifierPrefix,s&&(o=s)}const l={install(s){i=s.c;const h=s.context;h.bem={},h.bem.b=null,h.bem.els=null}};function a(s){let h,b;return{before(g){h=g.bem.b,b=g.bem.els,g.bem.els=null},after(g){g.bem.b=h,g.bem.els=b},$({context:g,props:E}){return s=typeof s=="string"?s:s({context:g,props:E}),g.bem.b=s,`${E?.bPrefix||t}${g.bem.b}`}}}function u(s){let h;return{before(b){h=b.bem.els},after(b){b.bem.els=h},$({context:b,props:g}){return s=typeof s=="string"?s:s({context:b,props:g}),b.bem.els=s.split(",").map(E=>E.trim()),b.bem.els.map(E=>`${g?.bPrefix||t}${b.bem.b}${n}${E}`).join(", ")}}}function m(s){return{$({context:h,props:b}){s=typeof s=="string"?s:s({context:h,props:b});const g=s.split(",").map(P=>P.trim());function E(P){return g.map(St=>`&${b?.bPrefix||t}${h.bem.b}${P!==void 0?`${n}${P}`:""}${o}${St}`).join(", ")}const G=h.bem.els;if(G!==null){if(process.env.NODE_ENV!=="production"&&G.length>=2)throw Error(`[css-render/plugin-bem]: m(${s}) is invalid, using modifier inside multiple elements is not allowed`);return E(G[0])}else return E()}}}function d(s){return{$({context:h,props:b}){s=typeof s=="string"?s:s({context:h,props:b});const g=h.bem.els;if(process.env.NODE_ENV!=="production"&&g!==null&&g.length>=2)throw Error(`[css-render/plugin-bem]: notM(${s}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${b?.bPrefix||t}${h.bem.b}${g!==null&&g.length>0?`${n}${g[0]}`:""}${o}${s})`}}}return Object.assign(l,{cB:((...s)=>i(a(s[0]),s[1],s[2])),cE:((...s)=>i(u(s[0]),s[1],s[2])),cM:((...s)=>i(m(s[0]),s[1],s[2])),cNotM:((...s)=>i(d(s[0]),s[1],s[2]))}),l}function he(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const Z=/\s*,(?![^(]*\))\s*/g,be=/\s+/g;function ge(e,t){const n=[];return t.split(Z).forEach(o=>{let i=he(o);if(i){if(i===1){e.forEach(a=>{n.push(o.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+o)});return}let l=[o];for(;i--;){const a=[];l.forEach(u=>{e.forEach(m=>{a.push(u.replace("&",m))})}),l=a}l.forEach(a=>n.push(a))}),n}function pe(e,t){const n=[];return t.split(Z).forEach(o=>{e.forEach(i=>{n.push((i&&i+" ")+o)})}),n}function xe(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ge(t,n):t=pe(t,n))}),t.join(", ").replace(be," ")}function U(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function O(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function ye(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function M(e){return e?/^\s*@(s|m)/.test(e):!1}const ve=/[A-Z]/g;function Y(e){return e.replace(ve,t=>"-"+t.toLowerCase())}function ke(e,t=" "){return typeof e=="object"&&e!==null?` {
|
|
2
2
|
`+Object.entries(e).map(n=>t+` ${Y(n[0])}: ${n[1]};`).join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`+t+"}":`: ${e};`}function
|
|
4
|
+
`+t+"}":`: ${e};`}function $e(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function J(e,t,n,o){if(!t)return"";const i=$e(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 a=e?[e+" {"]:[];return l.forEach(
|
|
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 Q(e,t,n,o,i){const l=e.$;let a="";if(!l||typeof l=="string")M(l)?a=l:t.push(l);else if(typeof l=="function"){const d=l({context:o.context,props:i});M(d)?a=d:t.push(d)}else if(l.before&&l.before(o.context),!l.$||typeof l.$=="string")M(l.$)?a=l.$:t.push(l.$);else if(l.$){const d=l.$({context:o.context,props:i});M(d)?a=d:t.push(d)}const
|
|
7
|
+
}`:"";const a=e?[e+" {"]:[];return l.forEach(u=>{const m=i[u];if(u==="raw"){a.push(`
|
|
8
|
+
`+m+`
|
|
9
|
+
`);return}u=Y(u),m!=null&&a.push(` ${u}${ke(m)}`)}),e&&a.push("}"),a.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 Q(e,t,n,o,i){const l=e.$;let a="";if(!l||typeof l=="string")M(l)?a=l:t.push(l);else if(typeof l=="function"){const d=l({context:o.context,props:i});M(d)?a=d:t.push(d)}else if(l.before&&l.before(o.context),!l.$||typeof l.$=="string")M(l.$)?a=l.$:t.push(l.$);else if(l.$){const d=l.$({context:o.context,props:i});M(d)?a=d:t.push(d)}const u=xe(t),m=J(u,e.props,o,i);a?n.push(`${a} {`):m.length&&n.push(m),e.children&&F(e.children,{context:o.context,props:i},d=>{if(typeof d=="string"){const f=J(u,{raw:d},o,i);n.push(f)}else Q(d,t,n,o,i)}),t.pop(),a&&n.push("}"),l&&l.after&&l.after(o.context)}function Ce(e,t,n){const o=[];return Q(e,[],o,t,n),o.join(`
|
|
11
11
|
|
|
12
|
-
`)}function
|
|
12
|
+
`)}function we(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 Ee(e,t,n,o){const{els:i}=t;if(n===void 0)i.forEach(U),t.els=[];else{const l=O(n,o);l&&i.includes(l)&&(U(l),t.els=i.filter(a=>a!==l))}}function X(e,t){e.push(t)}function Ne(e,t,n,o,i,l,a,u,m){let d;if(n===void 0&&(d=t.render(o),n=we(d)),m){m.adapter(n,d??t.render(o));return}u===void 0&&(u=document.head);const f=O(n,u);if(f!==null&&!l)return f;const c=f??ye(n);if(d===void 0&&(d=t.render(o)),c.textContent=d,f!==null)return f;if(a){const y=u.querySelector(`meta[name="${a}"]`);if(y)return u.insertBefore(c,y),X(t.els,c),c}return i?u.insertBefore(c,u.querySelector("style, link")):u.appendChild(c),X(t.els,c),c}function Ie(e){return Ce(this,this.instance,e)}function Be(e={}){const{id:t,ssr:n,props:o,head:i=!1,force:l=!1,anchorMetaName:a,parent:u}=e;return Ne(this.instance,this,t,o,i,l,a,u,n)}function Se(e={}){const{id:t,parent:n}=e;Ee(this.instance,this,t,n)}const A=function(e,t,n,o){return{instance:e,$:t,props:n,children:o,els:[],render:Ie,mount:Be,unmount:Se}},Ve=function(e,t,n,o){return Array.isArray(t)?A(e,{$:null},null,t):Array.isArray(n)?A(e,t,null,n):Array.isArray(o)?A(e,t,n,o):A(e,t,n,null)};function ze(e={}){const t={c:((...n)=>Ve(t,...n)),use:(n,...o)=>n.install(t,...o),find:O,context:{},config:e};return t}function Me(e){const{namespace:t="n",blockPrefix:n=`.${t}-`,elementPrefix:o="__",modifierPrefix:i="--"}=e??{},l=ze(),a=me({blockPrefix:n,elementPrefix:o,modifierPrefix:i});return l.use(a),{namespace:t,blockPrefix:n,elementPrefix:o,modifierPrefix:i,cssr:l,plugin:a}}const Ae="@css-render/vue3-ssr";function Re(e,t){return`<style cssr-id="${e}">
|
|
13
13
|
${t}
|
|
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(Re,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()})}function _(e,t){return r.getCurrentScope()?(r.onScopeDispose(e,t),!0):!1}const Fe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const De=Object.prototype.toString,He=e=>De.call(e)==="[object Object]",ee=()=>{};function We(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 Ke(e,t={}){let n,o,i=ee;const l=f=>{clearTimeout(f),i(),i=ee};let a;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((s,y)=>{i=t.rejectOnCancel?y:s,a=f,m&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,s(a())},m)),n=setTimeout(()=>{o&&l(o),o=void 0,s(f())},d)})}}function R(e){return Array.isArray(e)?e:[e]}function qe(e){return r.getCurrentInstance()}function Ge(e,t=200,n={}){return We(Ke(t,n),e)}function Ze(e,t=!0,n){qe()?r.onMounted(e,n):t?e():r.nextTick(e)}function Ue(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const D=Fe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Ye(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,f,d,m)=>(c.addEventListener(f,d,m),()=>c.removeEventListener(f,d,m)),i=r.computed(()=>{const c=R(r.toValue(e[0])).filter(f=>f!=null);return c.every(f=>typeof f!="string")?c:void 0}),l=Ue(()=>{var c,f;return[(c=(f=i.value)===null||f===void 0?void 0:f.map(d=>B(d)))!==null&&c!==void 0?c:[D].filter(d=>d!=null),R(r.toValue(i.value?e[1]:e[0])),R(r.unref(i.value?e[2]:e[1])),r.toValue(i.value?e[3]:e[2])]},([c,f,d,m])=>{if(n(),!c?.length||!f?.length||!d?.length)return;const s=He(m)?{...m}:m;t.push(...c.flatMap(y=>f.flatMap(k=>d.map(u=>o(y,k,u,s)))))},{flush:"post"}),a=()=>{l(),n()};return _(n),a}function Je(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function Qe(e){const t=Je();return r.computed(()=>(t.value,!!e()))}function Xe(e,t,n={}){const{window:o=D,...i}=n;let l;const a=Qe(()=>o&&"ResizeObserver"in o),c=()=>{l&&(l.disconnect(),l=void 0)},f=r.watch(r.computed(()=>{const m=r.toValue(e);return Array.isArray(m)?m.map(s=>B(s)):[B(m)]}),m=>{if(c(),a.value&&o){l=new ResizeObserver(t);for(const s of m)s&&l.observe(s,i)}},{immediate:!0,flush:"post"}),d=()=>{c(),f()};return _(d),{isSupported:a,stop:d}}function _e(e,t={width:0,height:0},n={}){const{window:o=D,box:i="content-box"}=n,l=r.computed(()=>{var s;return(s=B(e))===null||s===void 0||(s=s.namespaceURI)===null||s===void 0?void 0:s.includes("svg")}),a=r.shallowRef(t.width),c=r.shallowRef(t.height),{stop:f}=Xe(e,([s])=>{const y=i==="border-box"?s.borderBoxSize:i==="content-box"?s.contentBoxSize:s.devicePixelContentBoxSize;if(o&&l.value){const k=B(e);if(k){const u=k.getBoundingClientRect();a.value=u.width,c.value=u.height}}else if(y){const k=R(y);a.value=k.reduce((u,{inlineSize:h})=>u+h,0),c.value=k.reduce((u,{blockSize:h})=>u+h,0)}else a.value=s.contentRect.width,c.value=s.contentRect.height},n);Ze(()=>{const s=B(e);s&&(a.value="offsetWidth"in s?s.offsetWidth:t.width,c.value="offsetHeight"in s?s.offsetHeight:t.height)});const d=r.watch(()=>B(e),s=>{a.value=s?t.width:0,c.value=s?t.height:0});function m(){f(),d()}return{width:a,height:c,stop:m}}function et(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:a}=_e(i);async function c(m){await r.nextTick();const s=i.value?.querySelector(t);s&&s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...m})}function f(m){if(!n)return;m.preventDefault();const{deltaY:s}=m;switch(o){case"vertical":i.value?.scrollBy({top:s>0?a.value:-a.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:s>0?l.value:-l.value,behavior:"smooth"});break}}Ye(i,"wheel",f);const d=Ge(c,500);return r.watch([l,a],()=>{d()}),{scrollRef:i,scrollToView:c}}var tt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},v=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},C=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},te=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ne=function(e){return{r:C(e.r,0,255),g:C(e.g,0,255),b:C(e.b,0,255),a:C(e.a)}},H=function(e){return{r:v(e.r),g:v(e.g),b:v(e.b),a:v(e.a,3)}},nt=/^#([0-9a-f]{3,8})$/i,L=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},oe=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),a=l-Math.min(t,n,o),c=a?l===t?(n-o)/a:l===n?2+(o-t)/a:4+(t-n)/a:0;return{h:60*(c<0?c+6:c),s:l?a/l*100:0,v:l/255*100,a:i}},re=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),a=o*(1-n),c=o*(1-(t-l)*n),f=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,c,a,a,f,o][d],g:255*[f,o,o,c,a,a][d],b:255*[a,a,f,o,o,c][d],a:i}},ie=function(e){return{h:te(e.h),s:C(e.s,0,100),l:C(e.l,0,100),a:C(e.a)}},le=function(e){return{h:v(e.h),s:v(e.s),l:v(e.l),a:v(e.a,3)}},ae=function(e){return re((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},V=function(e){return{h:(t=oe(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},ot=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,it=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ce={string:[[function(e){var t=nt.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?v(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?v(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=it.exec(e)||lt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ne({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=ot.exec(e)||rt.exec(e);if(!t)return null;var n,o,i=ie({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(tt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return ae(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)?ne({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 a=ie({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ae(a)},"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 a=(function(c){return{h:te(c.h),s:C(c.s,0,100),v:C(c.v,0,100),a:C(c.a)}})({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return re(a)},"hsv"]]},se=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]},at=function(e){return typeof e=="string"?se(e.trim(),ce.string):typeof e=="object"&&e!==null?se(e,ce.object):[null,void 0]},W=function(e,t){var n=V(e);return{h:n.h,s:C(n.s+100*t,0,100),l:n.l,a:n.a}},K=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},ue=function(e,t){var n=V(e);return{h:n.h,s:n.s,l:C(n.l+100*t,0,100),a:n.a}},de=(function(){function e(t){this.parsed=at(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 v(K(this.rgba),2)},e.prototype.isDark=function(){return K(this.rgba)<.5},e.prototype.isLight=function(){return K(this.rgba)>=.5},e.prototype.toHex=function(){return t=H(this.rgba),n=t.r,o=t.g,i=t.b,a=(l=t.a)<1?L(v(255*l)):"","#"+L(n)+L(o)+L(i)+a;var t,n,o,i,l,a},e.prototype.toRgb=function(){return H(this.rgba)},e.prototype.toRgbString=function(){return t=H(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 le(V(this.rgba))},e.prototype.toHslString=function(){return t=le(V(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=oe(this.rgba),{h:v(t.h),s:v(t.s),v:v(t.v),a:v(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(W(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),w(W(this.rgba,-t))},e.prototype.grayscale=function(){return w(W(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),w(ue(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),w(ue(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}):v(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=V(this.rgba);return typeof t=="number"?w({h:t,s:n.s,l:n.l,a:n.a}):v(n.h)},e.prototype.isEqual=function(t){return this.toHex()===w(t).toHex()},e})(),w=function(e){return e instanceof de?e:new de(e)};const{cssr:ct,plugin:st,namespace:fe}=Ae(),{c:p,cB:T,cE:x,cM:q,cNotM:me}={...ct,...st},z=`${fe}-chrome-tabs`,$=`${fe}-chrome-tabs-item`,S="all .2s cubic-bezier(.4, 0, .2, 1)";function ut(){return p([T("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[p("div",{boxSizing:"border-box"}),p(".group-move, .group-enter-active, .group-leave-active",{transition:S}),p(".group-enter-from, .group-leave-to",{opacity:0}),p(".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:S},[p("svg",{width:"100%",height:"100%",fill:"currentColor"}),p("&: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},[p("&:hover",{backgroundColor:"var(--primary-color)"})])]),x("suffix",{})]),T("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 15px 0px 15px"},[q("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),q("active",[x("background",{opacity:1})]),me("active",[p("&:hover",{},[x("content",{backgroundColor:"var(--primary-color)"})])]),p("&::first-child",{marginLeft:"0 !important"}),p("&::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:S}),x("slot",{}),x("icon",{lineHeight:1},[p("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:S},[p("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),p("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:S},[x("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),p("svg",{fill:"var(--active-background-color)"})]),x("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:S,backgroundColor:"var(--primary-color)",opacity:0},[q("show",{opacity:1})])]),p(".dark",[T("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[x("icon",{backgroundColor:"var(--active-background-color-dark)"},[p("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),T("chrome-tabs-item",{},[me("active",[p("&:hover",{},[x("content",{backgroundColor:"var(--primary-color-dark)"})])]),x("background",{},[x("block",{backgroundColor:"var(--active-background-color-dark)"}),p("svg",{fill:"var(--active-background-color-dark)"})])])])])}const j=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},dt={name:"RiAddLine"},ft={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function mt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",ft,[...t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const ht=j(dt,[["render",mt]]),bt={name:"RiArrowDropDownLine"},gt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function pt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",gt,[...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 xt=j(bt,[["render",pt]]),yt={name:"LineMdLoadingTwotoneLoop"},vt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function kt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",vt,[...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 $t=j(yt,[["render",kt]]),Ct={name:"RiCloseLine"},wt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Et(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",wt,[...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 Nt=j(Ct,[["render",Et]]),It=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:[Boolean,Function]},disabled:{type:[Boolean,Function]},loading:{type:[Boolean,Function]},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},class:{},style:{},activeIndex:{default:0},itemIndex:{},itemKey:{},iconSize:{default:20}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.itemIndex&&e.activeIndex-1!==e.itemIndex),i=r.computed(()=>e.activeIndex===e.itemIndex),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label(e.itemKey,e.itemIndex)),a=r.computed(()=>e.loadingIcon?.(e.itemKey,e.itemIndex)??r.h($t));function c(m){m.stopPropagation(),n("itemClick",m),e.onClick?.(e.itemKey,e.itemIndex,m)}function f(m){n("itemContextmenu",m),e.onContextMenu?.(e.itemKey,e.itemIndex,m)}function d(m){n("itemClose"),e.onClose?.(e.itemKey,e.itemIndex,m)}return(m,s)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:typeof e.disabled=="function"?e.disabled(e.itemKey,e.itemIndex):e.disabled}]),onClick:c,onContextmenu:f},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`]),style:r.normalizeStyle({fontSize:`${e.iconSize}px`})},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(typeof e.loading=="function"?e.loading(e.itemKey,e.itemIndex):e.loading?a.value:e.icon?.(e.itemKey,e.itemIndex)??void 0)))],6),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),(typeof e.closable=="function"?e.closable(e.itemKey,e.itemIndex):e.closable)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Nt)],2)):r.createCommentVNode("",!0)],2),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__background`])},[s[0]||(s[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),s[1]||(s[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))}}),Bt=r.defineComponent({__name:"Tabs",props:{value:{},colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{},loadingValue:{},iconSize:{},contentClass:{},contentStyle:{}},emits:["update:value","click","contextmenu","close","add"],setup(e,{emit:t}){const n=t;Oe("n-chrome-tabs",ut());const o=r.computed(()=>e.value?e.options?.findIndex(s=>s.key===e.value):0),{scrollRef:i,scrollToView:l}=et({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(()=>e.value,()=>{l()},{immediate:!0});const a=r.computed(()=>({background:"#F1F1F1",active:"#fff",primary:"rgba(0,0,0,.1)",...e.colors})),c=r.computed(()=>({background:w(a.value.background).darken(.8).toHex(),active:w(a.value.active).darken(.8).toHex(),primary:w(a.value.primary).darken(.3).toHex()}));function f(s,y){n("update:value",s),n("click",s,y)}function d(s,y){n("contextmenu",s,y)}function m(s,y){n("close",s,y)}return(s,y)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(z)]),style:r.normalizeStyle({"--background-color":`${a.value.background}`,"--background-color-dark":`${c.value.background}`,"--active-background-color":`${a.value.active}`,"--active-background-color-dark":`${c.value.active}`,"--primary-color":`${a.value.primary}`,"--primary-color-dark":`${c.value.primary}`})},[e.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(z)}__icon`])},[r.createVNode(xt)],2)):r.createCommentVNode("",!0),r.renderSlot(s.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:i,class:r.normalizeClass([`${r.unref(z)}__content`,e.contentClass]),style:r.normalizeStyle(e.contentStyle)},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(z)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.options,({key:k,...u},h)=>(r.openBlock(),r.createBlock(It,r.mergeProps({key:k,loading:e.loadingValue===k},{ref_for:!0},u,{"item-key":k,"item-index":h,"active-index":o.value,"icon-size":e.iconSize,onItemClick:b=>f(k,h),onItemContextmenu:b=>d(k,h),onItemClose:b=>m(k,h)}),null,16,["loading","item-key","item-index","active-index","icon-size","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],6),r.renderSlot(s.$slots,"suffix"),e.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(z)}__icon`]),onClick:y[0]||(y[0]=k=>n("add"))},[r.createVNode(ht)],2)):r.createCommentVNode("",!0)],6))}});I.CTabs=Bt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
|
14
|
+
</style>`}function Le(e,t,n){const{styles:o,ids:i}=n;i.has(e)||o!==null&&(i.add(e),o.push(Re(e,t)))}const Te=typeof document<"u";function je(){if(Te)return;const e=r.inject(Ae,null);if(e!==null)return{adapter:(t,n)=>Le(t,n,e),context:e}}function Pe(e,t){const n=je();function o(){t.mount({id:e,head:!0,ssr:n})}n?o():r.onBeforeMount(()=>{o()})}function Oe(e,t){return r.getCurrentScope()?(r.onScopeDispose(e,t),!0):!1}const Fe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const De=Object.prototype.toString,He=e=>De.call(e)==="[object Object]",_=()=>{};function We(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 Ke(e,t={}){let n,o,i=_;const l=m=>{clearTimeout(m),i(),i=_};let a;return m=>{const d=r.toValue(e),f=r.toValue(t.maxWait);return n&&l(n),d<=0||f!==void 0&&f<=0?(o&&(l(o),o=void 0),Promise.resolve(m())):new Promise((c,y)=>{i=t.rejectOnCancel?y:c,a=m,f&&!o&&(o=setTimeout(()=>{n&&l(n),o=void 0,c(a())},f)),n=setTimeout(()=>{o&&l(o),o=void 0,c(m())},d)})}}function R(e){return Array.isArray(e)?e:[e]}function qe(e){return r.getCurrentInstance()}function Ge(e,t=200,n={}){return We(Ke(t,n),e)}function Ze(e,t=!0,n){qe()?r.onMounted(e,n):t?e():r.nextTick(e)}function Ue(e,t,n){return r.watch(e,t,{...n,immediate:!0})}const D=Fe?window:void 0;function B(e){var t;const n=r.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Ye(...e){const t=(o,i,l,a)=>(o.addEventListener(i,l,a),()=>o.removeEventListener(i,l,a)),n=r.computed(()=>{const o=R(r.toValue(e[0])).filter(i=>i!=null);return o.every(i=>typeof i!="string")?o:void 0});return Ue(()=>{var o,i;return[(o=(i=n.value)===null||i===void 0?void 0:i.map(l=>B(l)))!==null&&o!==void 0?o:[D].filter(l=>l!=null),R(r.toValue(n.value?e[1]:e[0])),R(r.unref(n.value?e[2]:e[1])),r.toValue(n.value?e[3]:e[2])]},([o,i,l,a],u,m)=>{if(!o?.length||!i?.length||!l?.length)return;const d=He(a)?{...a}:a,f=o.flatMap(c=>i.flatMap(y=>l.map(k=>t(c,y,k,d))));m(()=>{f.forEach(c=>c())})},{flush:"post"})}function Je(){const e=r.shallowRef(!1),t=r.getCurrentInstance();return t&&r.onMounted(()=>{e.value=!0},t),e}function Qe(e){const t=Je();return r.computed(()=>(t.value,!!e()))}function Xe(e,t,n={}){const{window:o=D,...i}=n;let l;const a=Qe(()=>o&&"ResizeObserver"in o),u=()=>{l&&(l.disconnect(),l=void 0)},m=r.watch(r.computed(()=>{const f=r.toValue(e);return Array.isArray(f)?f.map(c=>B(c)):[B(f)]}),f=>{if(u(),a.value&&o){l=new ResizeObserver(t);for(const c of f)c&&l.observe(c,i)}},{immediate:!0,flush:"post"}),d=()=>{u(),m()};return Oe(d),{isSupported:a,stop:d}}function _e(e,t={width:0,height:0},n={}){const{window:o=D,box:i="content-box"}=n,l=r.computed(()=>{var c;return(c=B(e))===null||c===void 0||(c=c.namespaceURI)===null||c===void 0?void 0:c.includes("svg")}),a=r.shallowRef(t.width),u=r.shallowRef(t.height),{stop:m}=Xe(e,([c])=>{const y=i==="border-box"?c.borderBoxSize:i==="content-box"?c.contentBoxSize:c.devicePixelContentBoxSize;if(o&&l.value){const k=B(e);if(k){const s=k.getBoundingClientRect();a.value=s.width,u.value=s.height}}else if(y){const k=R(y);a.value=k.reduce((s,{inlineSize:h})=>s+h,0),u.value=k.reduce((s,{blockSize:h})=>s+h,0)}else a.value=c.contentRect.width,u.value=c.contentRect.height},n);Ze(()=>{const c=B(e);c&&(a.value="offsetWidth"in c?c.offsetWidth:t.width,u.value="offsetHeight"in c?c.offsetHeight:t.height)});const d=r.watch(()=>B(e),c=>{a.value=c?t.width:0,u.value=c?t.height:0});function f(){m(),d()}return{width:a,height:u,stop:f}}function et(e){const{activeClassName:t=".active",enableWheel:n=!0,direction:o="vertical"}=e??{},i=r.ref(),{width:l,height:a}=_e(i);async function u(f){await r.nextTick();const c=i.value?.querySelector(t);c&&c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest",...f})}function m(f){if(!n)return;f.preventDefault();const{deltaY:c}=f;switch(o){case"vertical":i.value?.scrollBy({top:c>0?a.value:-a.value,behavior:"smooth"});break;case"horizontal":i.value?.scrollBy({left:c>0?l.value:-l.value,behavior:"smooth"});break}}Ye(i,"wheel",m);const d=Ge(u,500);return r.watch([l,a],()=>{d()}),{scrollRef:i,scrollToView:u}}var tt={grad:.9,turn:360,rad:360/(2*Math.PI)},N=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},v=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},C=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},ee=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},te=function(e){return{r:C(e.r,0,255),g:C(e.g,0,255),b:C(e.b,0,255),a:C(e.a)}},H=function(e){return{r:v(e.r),g:v(e.g),b:v(e.b),a:v(e.a,3)}},nt=/^#([0-9a-f]{3,8})$/i,L=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ne=function(e){var t=e.r,n=e.g,o=e.b,i=e.a,l=Math.max(t,n,o),a=l-Math.min(t,n,o),u=a?l===t?(n-o)/a:l===n?2+(o-t)/a:4+(t-n)/a:0;return{h:60*(u<0?u+6:u),s:l?a/l*100:0,v:l/255*100,a:i}},oe=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),a=o*(1-n),u=o*(1-(t-l)*n),m=o*(1-(1-t+l)*n),d=l%6;return{r:255*[o,u,a,a,m,o][d],g:255*[m,o,o,u,a,a][d],b:255*[a,a,m,o,o,u][d],a:i}},re=function(e){return{h:ee(e.h),s:C(e.s,0,100),l:C(e.l,0,100),a:C(e.a)}},ie=function(e){return{h:v(e.h),s:v(e.s),l:v(e.l),a:v(e.a,3)}},le=function(e){return oe((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},V=function(e){return{h:(t=ne(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},ot=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rt=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,it=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,lt=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ae={string:[[function(e){var t=nt.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?v(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?v(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=it.exec(e)||lt.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:te({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=ot.exec(e)||rt.exec(e);if(!t)return null;var n,o,i=re({h:(n=t[1],o=t[2],o===void 0&&(o="deg"),Number(n)*(tt[o]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return le(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)?te({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 a=re({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return le(a)},"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 a=(function(u){return{h:ee(u.h),s:C(u.s,0,100),v:C(u.v,0,100),a:C(u.a)}})({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return oe(a)},"hsv"]]},ce=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]},at=function(e){return typeof e=="string"?ce(e.trim(),ae.string):typeof e=="object"&&e!==null?ce(e,ae.object):[null,void 0]},W=function(e,t){var n=V(e);return{h:n.h,s:C(n.s+100*t,0,100),l:n.l,a:n.a}},K=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},se=function(e,t){var n=V(e);return{h:n.h,s:n.s,l:C(n.l+100*t,0,100),a:n.a}},ue=(function(){function e(t){this.parsed=at(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 v(K(this.rgba),2)},e.prototype.isDark=function(){return K(this.rgba)<.5},e.prototype.isLight=function(){return K(this.rgba)>=.5},e.prototype.toHex=function(){return t=H(this.rgba),n=t.r,o=t.g,i=t.b,a=(l=t.a)<1?L(v(255*l)):"","#"+L(n)+L(o)+L(i)+a;var t,n,o,i,l,a},e.prototype.toRgb=function(){return H(this.rgba)},e.prototype.toRgbString=function(){return t=H(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 ie(V(this.rgba))},e.prototype.toHslString=function(){return t=ie(V(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=ne(this.rgba),{h:v(t.h),s:v(t.s),v:v(t.v),a:v(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(W(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),w(W(this.rgba,-t))},e.prototype.grayscale=function(){return w(W(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),w(se(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),w(se(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}):v(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=V(this.rgba);return typeof t=="number"?w({h:t,s:n.s,l:n.l,a:n.a}):v(n.h)},e.prototype.isEqual=function(t){return this.toHex()===w(t).toHex()},e})(),w=function(e){return e instanceof ue?e:new ue(e)};const{cssr:ct,plugin:st,namespace:de}=Me(),{c:p,cB:T,cE:x,cM:q,cNotM:fe}={...ct,...st},z=`${de}-chrome-tabs`,$=`${de}-chrome-tabs-item`,S="all .2s cubic-bezier(.4, 0, .2, 1)";function ut(){return p([T("chrome-tabs",{display:"flex",width:"100%",height:"40px",padding:"0 10px",alignItems:"center",backgroundColor:"var(--background-color)",color:"var(--background-color-dark)"},[p("div",{boxSizing:"border-box"}),p(".group-move, .group-enter-active, .group-leave-active",{transition:S}),p(".group-enter-from, .group-leave-to",{opacity:0}),p(".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:S},[p("svg",{width:"100%",height:"100%",fill:"currentColor"}),p("&: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},[p("&:hover",{backgroundColor:"var(--primary-color)"})])]),x("suffix",{})]),T("chrome-tabs-item",{position:"relative",margin:"0 -5px",height:"100%",flexShrink:0,cursor:"default",userSelect:"none",padding:"6px 15px 0px 15px"},[q("disabled",{cursor:"not-allowed",pointerEvents:"none",opacity:.5,filter:"grayscale(0.5)"}),q("active",[x("background",{opacity:1})]),fe("active",[p("&:hover",{},[x("content",{backgroundColor:"var(--primary-color)"})])]),p("&::first-child",{marginLeft:"0 !important"}),p("&::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:S}),x("slot",{}),x("icon",{lineHeight:1},[p("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:S},[p("&:hover",{backgroundColor:"rgba(0,0,0,0.1)"}),p("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:S},[x("block",{height:"100%",flex:1,minWidth:0,borderRadius:"10px 10px 0 0",backgroundColor:"var(--active-background-color)"}),p("svg",{fill:"var(--active-background-color)"})]),x("line",{position:"absolute",bottom:"12px",right:"4px",height:"16px",width:"2px",borderRadius:"1px",transition:S,backgroundColor:"var(--primary-color)",opacity:0},[q("show",{opacity:1})])]),p(".dark",[T("chrome-tabs",{backgroundColor:"var(--background-color-dark)",color:"var(--background-color)"},[x("icon",{backgroundColor:"var(--active-background-color-dark)"},[p("&:hover",{backgroundColor:"var(--primary-color-dark)"})])]),T("chrome-tabs-item",{},[fe("active",[p("&:hover",{},[x("content",{backgroundColor:"var(--primary-color-dark)"})])]),x("background",{},[x("block",{backgroundColor:"var(--active-background-color-dark)"}),p("svg",{fill:"var(--active-background-color-dark)"})])])])])}const j=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},dt={name:"RiAddLine"},ft={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function mt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",ft,[...t[0]||(t[0]=[r.createElementVNode("path",{fill:"#757575",d:"M11 11V5h2v6h6v2h-6v6h-2v-6H5v-2z"},null,-1)])])}const ht=j(dt,[["render",mt]]),bt={name:"RiArrowDropDownLine"},gt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function pt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",gt,[...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 xt=j(bt,[["render",pt]]),yt={name:"LineMdLoadingTwotoneLoop"},vt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function kt(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",vt,[...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 $t=j(yt,[["render",kt]]),Ct={name:"RiCloseLine"},wt={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24"};function Et(e,t,n,o,i,l){return r.openBlock(),r.createElementBlock("svg",wt,[...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 Nt=j(Ct,[["render",Et]]),It=r.defineComponent({__name:"TabItem",props:{label:{type:[String,Function]},icon:{type:Function},closable:{type:[Boolean,Function]},disabled:{type:[Boolean,Function]},loading:{type:[Boolean,Function]},loadingIcon:{type:Function},onClick:{type:Function},onContextMenu:{type:Function},onClose:{type:Function},class:{},style:{},activeIndex:{default:0},itemIndex:{},itemKey:{},iconSize:{default:20}},emits:["itemClick","itemContextmenu","itemClose"],setup(e,{emit:t}){const n=t,o=r.computed(()=>e.activeIndex!==e.itemIndex&&e.activeIndex-1!==e.itemIndex),i=r.computed(()=>e.activeIndex===e.itemIndex),l=r.computed(()=>typeof e.label=="string"?r.h("span",{class:`${$}__label`},e.label):e.label(e.itemKey,e.itemIndex)),a=r.computed(()=>e.loadingIcon?.(e.itemKey,e.itemIndex)??r.h($t));function u(f){f.stopPropagation(),n("itemClick",f),e.onClick?.(e.itemKey,e.itemIndex,f)}function m(f){n("itemContextmenu",f),e.onContextMenu?.(e.itemKey,e.itemIndex,f)}function d(f){n("itemClose"),e.onClose?.(e.itemKey,e.itemIndex,f)}return(f,c)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref($),{[`${r.unref($)}--active`]:i.value,[`${r.unref($)}--disabled`]:typeof e.disabled=="function"?e.disabled(e.itemKey,e.itemIndex):e.disabled}]),onClick:u,onContextmenu:m},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__content`])},[r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__icon`]),style:r.normalizeStyle({fontSize:`${e.iconSize}px`})},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(typeof e.loading=="function"?e.loading(e.itemKey,e.itemIndex):e.loading?a.value:e.icon?.(e.itemKey,e.itemIndex)??void 0)))],6),r.createElementVNode("div",{class:r.normalizeClass([`${r.unref($)}__slot`])},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.value)))],2),(typeof e.closable=="function"?e.closable(e.itemKey,e.itemIndex):e.closable)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref($)}__close`]),onClick:r.withModifiers(d,["stop"])},[r.createVNode(Nt)],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))}}),Bt=r.defineComponent({__name:"Tabs",props:{value:{},colors:{},dropdown:{type:Boolean},addable:{type:Boolean},options:{},loadingValue:{},iconSize:{},contentClass:{},contentStyle:{}},emits:["update:value","click","contextmenu","close","add"],setup(e,{emit:t}){const n=t;Pe("n-chrome-tabs",ut());const o=r.computed(()=>e.value?e.options?.findIndex(c=>c.key===e.value):0),{scrollRef:i,scrollToView:l}=et({activeClassName:`.${$}--active`,direction:"horizontal"});r.watch(()=>e.value,()=>{l()},{immediate:!0});const a=r.computed(()=>({background:"#F1F1F1",active:"#fff",primary:"rgba(0,0,0,.1)",...e.colors})),u=r.computed(()=>({background:w(a.value.background).darken(.8).toHex(),active:w(a.value.active).darken(.8).toHex(),primary:w(a.value.primary).darken(.3).toHex()}));function m(c,y){n("update:value",c),n("click",c,y)}function d(c,y){n("contextmenu",c,y)}function f(c,y){n("close",c,y)}return(c,y)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass([r.unref(z)]),style:r.normalizeStyle({"--background-color":`${a.value.background}`,"--background-color-dark":`${u.value.background}`,"--active-background-color":`${a.value.active}`,"--active-background-color-dark":`${u.value.active}`,"--primary-color":`${a.value.primary}`,"--primary-color-dark":`${u.value.primary}`})},[e.dropdown?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass([`${r.unref(z)}__icon`])},[r.createVNode(xt)],2)):r.createCommentVNode("",!0),r.renderSlot(c.$slots,"prefix"),r.createElementVNode("div",{ref_key:"scrollRef",ref:i,class:r.normalizeClass([`${r.unref(z)}__content`,e.contentClass]),style:r.normalizeStyle(e.contentStyle)},[r.createVNode(r.TransitionGroup,{name:"group",tag:"div",class:r.normalizeClass([`${r.unref(z)}__scroll`])},{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.options,({key:k,...s},h)=>(r.openBlock(),r.createBlock(It,r.mergeProps({key:k,loading:e.loadingValue===k},{ref_for:!0},s,{"item-key":k,"item-index":h,"active-index":o.value,"icon-size":e.iconSize,onItemClick:b=>m(k,h),onItemContextmenu:b=>d(k,h),onItemClose:b=>f(k,h)}),null,16,["loading","item-key","item-index","active-index","icon-size","onItemClick","onItemContextmenu","onItemClose"]))),128))]),_:1},8,["class"])],6),r.renderSlot(c.$slots,"suffix"),e.addable?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass([`${r.unref(z)}__icon`]),onClick:y[0]||(y[0]=k=>n("add"))},[r.createVNode(ht)],2)):r.createCommentVNode("",!0)],6))}});I.CTabs=Bt,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oiij/chrome-tabs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "A Vue Component Likes Chrome Tabs Style.",
|
|
6
6
|
"author": "oiij",
|
|
7
7
|
"license": "MIT",
|
|
@@ -16,13 +16,6 @@
|
|
|
16
16
|
"chrome-tabs"
|
|
17
17
|
],
|
|
18
18
|
"sideEffects": false,
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.js",
|
|
23
|
-
"require": "./dist/index.cjs"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
19
|
"main": "./dist/index.js",
|
|
27
20
|
"module": "./dist/index.js",
|
|
28
21
|
"types": "./dist/index.d.ts",
|
|
@@ -34,15 +27,15 @@
|
|
|
34
27
|
],
|
|
35
28
|
"peerDependencies": {
|
|
36
29
|
"colord": "^2.9.3",
|
|
37
|
-
"vue": "^3.5.
|
|
38
|
-
"@oiij/css-render": "0.0.
|
|
39
|
-
"@oiij/use": "0.0.
|
|
30
|
+
"vue": "^3.5.25",
|
|
31
|
+
"@oiij/css-render": "0.0.7",
|
|
32
|
+
"@oiij/use": "0.0.28"
|
|
40
33
|
},
|
|
41
34
|
"devDependencies": {
|
|
42
35
|
"colord": "^2.9.3",
|
|
43
|
-
"vue": "^3.5.
|
|
44
|
-
"@oiij/css-render": "0.0.
|
|
45
|
-
"@oiij/use": "0.0.
|
|
36
|
+
"vue": "^3.5.25",
|
|
37
|
+
"@oiij/css-render": "0.0.7",
|
|
38
|
+
"@oiij/use": "0.0.28"
|
|
46
39
|
},
|
|
47
40
|
"publishConfig": {
|
|
48
41
|
"access": "public"
|