mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
1 line
8.8 KiB
JavaScript
1 line
8.8 KiB
JavaScript
import{S as t,i as e,s,v as n,D as l,q as c,L as i,h as a,k as o,l as r,n as u,o as h,r as d,M as p,w as f,N as $,O as m,I as x,z as v,A as b,t as w,b as g,J as H,C as y,G as _,g as E,y as M,R as V,$ as k,j as z,c as A,p as I,a as O,x as j,m as C,a0 as N,K as S,E as B,F as D,d as L,B as R,a1 as T,H as P}from"./index.c2c9d961.js";import{C as U}from"./Close20.452e634c.js";import{I as Y}from"./Icon.f19a7424.js";import{s as q}from"./SkipToContent.9e8bdedb.js";function F(t){let e,s;return{c(){e=i("title"),s=a(t[2])},l(n){e=o(n,"title",{},1);var l=r(e);s=u(l,t[2]),l.forEach(h)},m(t,n){c(t,e,n),d(e,s)},p(t,e){4&e&&p(s,t[2])},d(t){t&&h(e)}}}function G(t){let e,s,a,u,p;const y=t[8].default,_=n(y,t,t[7],null),E=_||function(t){let e,s=t[2]&&F(t);return{c(){s&&s.c(),e=l()},l(t){s&&s.l(t),e=l()},m(t,n){s&&s.m(t,n),c(t,e,n)},p(t,n){t[2]?s?s.p(t,n):(s=F(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(t){s&&s.d(t),t&&h(e)}}}(t);let M=[{"data-carbon-icon":"AppSwitcher20"},{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{width:"20"},{height:"20"},{class:t[0]},{preserveAspectRatio:"xMidYMid meet"},{style:t[3]},{id:t[1]},t[4]],V={};for(let t=0;t<M.length;t+=1)V=f(V,M[t]);return{c(){e=i("svg"),s=i("path"),E&&E.c(),this.h()},l(t){e=o(t,"svg",{"data-carbon-icon":!0,xmlns:!0,viewBox:!0,fill:!0,width:!0,height:!0,class:!0,preserveAspectRatio:!0,style:!0,id:!0},1);var n=r(e);s=o(n,"path",{d:!0},1),r(s).forEach(h),E&&E.l(n),n.forEach(h),this.h()},h(){$(s,"d","M14 4H18V8H14zM4 4H8V8H4zM24 4H28V8H24zM14 14H18V18H14zM4 14H8V18H4zM24 14H28V18H24zM14 24H18V28H14zM4 24H8V28H4zM24 24H28V28H24z"),m(e,V)},m(n,l){c(n,e,l),d(e,s),E&&E.m(e,null),a=!0,u||(p=[x(e,"click",t[9]),x(e,"mouseover",t[10]),x(e,"mouseenter",t[11]),x(e,"mouseleave",t[12]),x(e,"keyup",t[13]),x(e,"keydown",t[14])],u=!0)},p(t,[s]){_?_.p&&128&s&&v(_,y,t,t[7],s,null,null):E&&E.p&&4&s&&E.p(t,s),m(e,V=b(M,[{"data-carbon-icon":"AppSwitcher20"},{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{width:"20"},{height:"20"},(!a||1&s)&&{class:t[0]},{preserveAspectRatio:"xMidYMid meet"},(!a||8&s)&&{style:t[3]},(!a||2&s)&&{id:t[1]},16&s&&t[4]]))},i(t){a||(w(E,t),a=!0)},o(t){g(E,t),a=!1},d(t){t&&h(e),E&&E.d(t),u=!1,H(p)}}}function J(t,e,s){let n,l,c,i,{$$slots:a={},$$scope:o}=e,{class:r}=e,{id:u}=e,{tabindex:h}=e,{focusable:d=!1}=e,{title:p}=e,{style:$}=e;return t.$$set=t=>{s(18,e=f(f({},e),y(t))),"class"in t&&s(0,r=t.class),"id"in t&&s(1,u=t.id),"tabindex"in t&&s(5,h=t.tabindex),"focusable"in t&&s(6,d=t.focusable),"title"in t&&s(2,p=t.title),"style"in t&&s(3,$=t.style),"$$scope"in t&&s(7,o=t.$$scope)},t.$$.update=()=>{s(15,n=e["aria-label"]),s(16,l=e["aria-labelledby"]),98308&t.$$.dirty&&s(17,c=n||l||p),229472&t.$$.dirty&&s(4,i={"aria-label":n,"aria-labelledby":l,"aria-hidden":!c||void 0,role:c?"img":void 0,focusable:"0"===h||d,tabindex:h})},e=y(e),[r,u,p,$,i,h,d,o,a,function(e){_(t,e)},function(e){_(t,e)},function(e){_(t,e)},function(e){_(t,e)},function(e){_(t,e)},function(e){_(t,e)}]}class K extends t{constructor(t){super(),e(this,t,J,G,s,{class:0,id:1,tabindex:5,focusable:6,title:2,style:3})}}const Q=t=>({}),W=t=>({});function X(t){let e,s;return{c(){e=E("span"),s=a(t[3]),this.h()},l(n){e=o(n,"SPAN",{class:!0});var l=r(e);s=u(l,t[3]),l.forEach(h),this.h()},h(){$(e,"class","svelte-19vx6se")},m(t,n){c(t,e,n),d(e,s)},p(t,e){8&e&&p(s,t[3])},d(t){t&&h(e)}}}function Z(t){let e,s,l;const i=t[8].default,a=n(i,t,t[7],null);return{c(){e=E("div"),a&&a.c(),this.h()},l(t){e=o(t,"DIV",{});var s=r(e);a&&a.l(s),s.forEach(h),this.h()},h(){M(e,"bx--header-panel",!0),M(e,"bx--header-panel--expanded",!0)},m(s,n){c(s,e,n),a&&a.m(e,null),t[13](e),l=!0},p(t,e){a&&a.p&&128&e&&v(a,i,t,t[7],e,null,null)},i(t){l||(w(a,t),V(()=>{s||(s=k(e,q,{duration:200},!0)),s.run(1)}),l=!0)},o(t){g(a,t),s||(s=k(e,q,{duration:200},!1)),s.run(0),l=!1},d(n){n&&h(e),a&&a.d(n),t[13](null),n&&s&&s.end()}}}function tt(t){let e,s,i,a,u,p,$,m,y;const _=[{render:t[0]?U:K},t[2]];let V={};for(let t=0;t<_.length;t+=1)V=f(V,_[t]);a=new Y({props:V});const k=t[8].text,R=n(k,t,t[7],W),T=R||function(t){let e,s=t[3]&&X(t);return{c(){s&&s.c(),e=l()},l(t){s&&s.l(t),e=l()},m(t,n){s&&s.m(t,n),c(t,e,n)},p(t,n){t[3]?s?s.p(t,n):(s=X(t),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null)},d(t){s&&s.d(t),t&&h(e)}}}(t);let P=[{type:"button"},t[6]],q={};for(let t=0;t<P.length;t+=1)q=f(q,P[t]);let F=t[0]&&Z(t);return{c(){e=z(),s=E("div"),i=E("button"),A(a.$$.fragment),u=z(),T&&T.c(),p=z(),F&&F.c(),this.h()},l(t){e=I(t),s=o(t,"DIV",{});var n=r(s);i=o(n,"BUTTON",{type:!0});var l=r(i);O(a.$$.fragment,l),u=I(l),T&&T.l(l),l.forEach(h),p=I(n),F&&F.l(n),n.forEach(h),this.h()},h(){j(i,q),M(i,"bx--header__action",!0),M(i,"bx--header__action--active",t[0]),M(i,"action-text",t[3]),M(i,"svelte-19vx6se",!0)},m(n,l){c(n,e,l),c(n,s,l),d(s,i),C(a,i,null),d(i,u),T&&T.m(i,null),t[11](i),d(s,p),F&&F.m(s,null),$=!0,m||(y=[x(document.body,"click",t[10]),x(i,"click",t[9]),x(i,"click",N(t[12]))],m=!0)},p(t,[e]){const n=5&e?b(_,[1&e&&{render:t[0]?U:K},4&e&&S(t[2])]):{};a.$set(n),R?R.p&&128&e&&v(R,k,t,t[7],e,Q,W):T&&T.p&&8&e&&T.p(t,e),j(i,q=b(P,[{type:"button"},64&e&&t[6]])),M(i,"bx--header__action",!0),M(i,"bx--header__action--active",t[0]),M(i,"action-text",t[3]),M(i,"svelte-19vx6se",!0),t[0]?F?(F.p(t,e),1&e&&w(F,1)):(F=Z(t),F.c(),w(F,1),F.m(s,null)):F&&(B(),g(F,1,1,()=>{F=null}),D())},i(t){$||(w(a.$$.fragment,t),w(T,t),w(F),$=!0)},o(t){g(a.$$.fragment,t),g(T,t),g(F),$=!1},d(n){n&&h(e),n&&h(s),L(a),T&&T.d(n),t[11](null),F&&F.d(),m=!1,H(y)}}}function et(t,e,s){const n=["isOpen","icon","text","ref"];let l=R(e,n),{$$slots:c={},$$scope:i}=e,{isOpen:a=!1}=e,{icon:o}=e,{text:r}=e,{ref:u=null}=e;const h=T();let d=null;return t.$$set=t=>{e=f(f({},e),y(t)),s(6,l=R(e,n)),"isOpen"in t&&s(0,a=t.isOpen),"icon"in t&&s(2,o=t.icon),"text"in t&&s(3,r=t.text),"ref"in t&&s(1,u=t.ref),"$$scope"in t&&s(7,i=t.$$scope)},[a,u,o,r,d,h,l,i,c,function(e){_(t,e)},({target:t})=>{!a||u.contains(t)||d.contains(t)||(s(0,a=!1),h("close"))},function(t){P[t?"unshift":"push"](()=>{u=t,s(1,u)})},()=>{s(0,a=!a),h(a?"open":"close")},function(t){P[t?"unshift":"push"](()=>{d=t,s(4,d)})}]}class st extends t{constructor(t){super(),e(this,t,et,tt,s,{isOpen:0,icon:2,text:3,ref:1})}}function nt(t){let e,s,l;const i=t[1].default,a=n(i,t,t[0],null);return{c(){e=E("li"),s=E("span"),a&&a.c(),this.h()},l(t){e=o(t,"LI",{class:!0});var n=r(e);s=o(n,"SPAN",{class:!0});var l=r(s);a&&a.l(l),l.forEach(h),n.forEach(h),this.h()},h(){$(s,"class","svelte-298l2"),$(e,"class","subject-divider svelte-298l2")},m(t,n){c(t,e,n),d(e,s),a&&a.m(s,null),l=!0},p(t,[e]){a&&a.p&&1&e&&v(a,i,t,t[0],e,null,null)},i(t){l||(w(a,t),l=!0)},o(t){g(a,t),l=!1},d(t){t&&h(e),a&&a.d(t)}}}function lt(t,e,s){let{$$slots:n={},$$scope:l}=e;return t.$$set=t=>{"$$scope"in t&&s(0,l=t.$$scope)},[l,n]}class ct extends t{constructor(t){super(),e(this,t,lt,nt,s,{})}}function it(t){let e,s,l,i,a;const u=t[4].default,p=n(u,t,t[3],null);let $=[{href:t[1]},t[2]],m={};for(let t=0;t<$.length;t+=1)m=f(m,$[t]);return{c(){e=E("li"),s=E("a"),p&&p.c(),this.h()},l(t){e=o(t,"LI",{});var n=r(e);s=o(n,"A",{href:!0});var l=r(s);p&&p.l(l),l.forEach(h),n.forEach(h),this.h()},h(){j(s,m),M(s,"bx--switcher__item-link",!0),M(e,"bx--switcher__item",!0)},m(n,o){c(n,e,o),d(e,s),p&&p.m(s,null),t[6](s),l=!0,i||(a=x(s,"click",t[5]),i=!0)},p(t,[e]){p&&p.p&&8&e&&v(p,u,t,t[3],e,null,null),j(s,m=b($,[(!l||2&e)&&{href:t[1]},4&e&&t[2]])),M(s,"bx--switcher__item-link",!0)},i(t){l||(w(p,t),l=!0)},o(t){g(p,t),l=!1},d(s){s&&h(e),p&&p.d(s),t[6](null),i=!1,a()}}}function at(t,e,s){const n=["href","ref"];let l=R(e,n),{$$slots:c={},$$scope:i}=e,{href:a}=e,{ref:o=null}=e;return t.$$set=t=>{e=f(f({},e),y(t)),s(2,l=R(e,n)),"href"in t&&s(1,a=t.href),"ref"in t&&s(0,o=t.ref),"$$scope"in t&&s(3,i=t.$$scope)},[o,a,l,i,c,function(e){_(t,e)},function(t){P[t?"unshift":"push"](()=>{o=t,s(0,o)})}]}class ot extends t{constructor(t){super(),e(this,t,at,it,s,{href:1,ref:0})}}function rt(t){let e,s;const l=t[1].default,i=n(l,t,t[0],null);return{c(){e=E("ul"),i&&i.c(),this.h()},l(t){e=o(t,"UL",{});var s=r(e);i&&i.l(s),s.forEach(h),this.h()},h(){M(e,"bx--switcher__item",!0)},m(t,n){c(t,e,n),i&&i.m(e,null),s=!0},p(t,[e]){i&&i.p&&1&e&&v(i,l,t,t[0],e,null,null)},i(t){s||(w(i,t),s=!0)},o(t){g(i,t),s=!1},d(t){t&&h(e),i&&i.d(t)}}}function ut(t,e,s){let{$$slots:n={},$$scope:l}=e;return t.$$set=t=>{"$$scope"in t&&s(0,l=t.$$scope)},[l,n]}class ht extends t{constructor(t){super(),e(this,t,ut,rt,s,{})}}function dt(t){let e,s;const l=t[1].default,i=n(l,t,t[0],null);return{c(){e=E("div"),i&&i.c(),this.h()},l(t){e=o(t,"DIV",{});var s=r(e);i&&i.l(s),s.forEach(h),this.h()},h(){M(e,"bx--header__global",!0)},m(t,n){c(t,e,n),i&&i.m(e,null),s=!0},p(t,[e]){i&&i.p&&1&e&&v(i,l,t,t[0],e,null,null)},i(t){s||(w(i,t),s=!0)},o(t){g(i,t),s=!1},d(t){t&&h(e),i&&i.d(t)}}}function pt(t,e,s){let{$$slots:n={},$$scope:l}=e;return t.$$set=t=>{"$$scope"in t&&s(0,l=t.$$scope)},[l,n]}class ft extends t{constructor(t){super(),e(this,t,pt,dt,s,{})}}export{ft as H,st as a,ht as b,ct as c,ot as d};
|