@cosmic-design/san
Advanced tools
Comparing version 0.1.1-beta.98ba66f to 0.1.1-beta.a57cb4c
@@ -1,2 +0,2 @@ | ||
"use strict";var o=require("san");const r="cos-avatar",e="cos-md",c="cos-sm",n="cos-lg",i="cos-xl",v="cos-avatar-content",d="cos-avatar-placeholder",h="cos-avatar-fallback",m="cos-avatar-img";var t={avatar:r,md:e,sm:c,lg:n,xl:i,"avatar-content":"cos-avatar-content",avatarContent:v,"avatar-placeholder":"cos-avatar-placeholder",avatarPlaceholder:d,"avatar-fallback":"cos-avatar-fallback",avatarFallback:h,"avatar-img":"cos-avatar-img",avatarImg:m};class s extends o.Component{initData(){return{nativeAttributes:{},src:"",alt:"",loading:!0,error:!1,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,hasPlaceholder:!!this.sourceSlots.named.placeholder}}onLoad(a){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",a)}onError(a){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",a)}onClick(a){this.fire("click",a);const l={event:a};this.dispatch("click:avatar",l)}}s.trimWhitespace="all";s.template=` | ||
"use strict";var o=require("san");const r="cos-avatar",c="cos-md",e="cos-sm",n="cos-lg",i="cos-xl",d="cos-avatar-content",v="cos-avatar-placeholder",h="cos-avatar-fallback",m="cos-avatar-img";var t={avatar:r,md:c,sm:e,lg:n,xl:i,"avatar-content":"cos-avatar-content",avatarContent:d,"avatar-placeholder":"cos-avatar-placeholder",avatarPlaceholder:v,"avatar-fallback":"cos-avatar-fallback",avatarFallback:h,"avatar-img":"cos-avatar-img",avatarImg:m};class s extends o.Component{initData(){return{src:"",alt:"",loading:!0,error:!1,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,hasPlaceholder:!!this.sourceSlots.named.placeholder}}onLoad(a){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",a)}onError(a){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",a)}onClick(a){this.fire("click",a);const l={event:a};this.dispatch("click:avatar",l)}}s.trimWhitespace="all";s.template=` | ||
<div class="${t.avatar} cos-{{size}}"> | ||
@@ -3,0 +3,0 @@ <div s-if="hasContent" class="${t.avatarContent}"> |
@@ -1,4 +0,4 @@ | ||
"use strict";var e=require("san");const c="cos-button",i="cos-hover",u="cos-active",a="cos-disabled",l="cos-button-icon",b="cos-button-prefix",d="cos-button-suffix",f="cos-button-content",r="cos-square",x="cos-dashed",h="cos-light",p="cos-link",v="cos-solid",m="cos-text";var s={button:c,hover:i,active:u,disabled:a,"button-icon":"cos-button-icon",buttonIcon:l,"button-prefix":"cos-button-prefix",buttonPrefix:b,"button-suffix":"cos-button-suffix",buttonSuffix:d,"button-content":"cos-button-content",buttonContent:f,square:r,dashed:x,light:h,link:p,solid:v,text:m};class n extends e.Component{initData(){var t,o;return{name:void 0,value:void 0,type:"button",disabled:!1,hasPrefix:!!((t=this.sourceSlots)!=null&&t.named.prefix),hasSuffix:!!((o=this.sourceSlots)!=null&&o.named.suffix)}}click(t){this.fire("click",t);const o={event:t};this.dispatch("click:button",o)}}n.trimWhitespace="all";n.template=` | ||
"use strict";var n=require("san");const e="cos-button",c="cos-hover",i="cos-active",u="cos-disabled",a="cos-button-icon",l="cos-button-prefix",b="cos-button-suffix",d="cos-button-content",f="cos-square",r="cos-dashed",x="cos-light",v="cos-link",h="cos-solid",p="cos-text";var t={button:e,hover:c,active:i,disabled:u,"button-icon":"cos-button-icon",buttonIcon:a,"button-prefix":"cos-button-prefix",buttonPrefix:l,"button-suffix":"cos-button-suffix",buttonSuffix:b,"button-content":"cos-button-content",buttonContent:d,square:f,dashed:r,light:x,link:v,solid:h,text:p};class o extends n.Component{initData(){return{name:void 0,value:void 0,type:"button",disabled:!1}}click(s){this.fire("click",s)}}o.trimWhitespace="all";o.template=` | ||
<button | ||
class="${s.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${t.button} {{disabled ? 'cos-disabled' : ''}}" | ||
type="{{type}}" | ||
@@ -10,8 +10,6 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${s.buttonPrefix}"></slot> | ||
<div class="${s.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot name="suffix" class="${s.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${t.buttonPrefix}"></slot> | ||
<slot class="${t.buttonContent}"></slot> | ||
<slot name="suffix" class="${t.buttonSuffix}"></slot> | ||
</button> | ||
`;module.exports=n; | ||
`;module.exports=o; |
@@ -1,5 +0,9 @@ | ||
"use strict";var i=require("san");const c=["xs","sm","md","lg","xl","xxl"],l="cos-row",d="cos-col";var p={row:l,col:d};function u(n,t){const e=n.size;return function(s){const o=n[s];if(typeof o=="object")for(const a in o)o.hasOwnProperty(a)&&(t[a][s]=o[a]);else t[e][s]=o}}class r extends i.Component{initData(){var t,e,s;return{nativeAttributes:{},span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:(e=(t=this.parentComponent)==null?void 0:t.data.get("size"))!=null?e:"xs",rowCurrent:(s=this.parentComponent)==null?void 0:s.data.get("current")}}}r.trimWhitespace="all";r.template=` | ||
<div class="${p.col}" style="{{colStyle}}"> | ||
"use strict";var u=require("san");const d=["xs","sm","md","lg","xl","xxl"];function p(s,t,e){return function(i){const n=s[i];if(typeof n=="object")for(const a in n)n.hasOwnProperty(a)&&(t[a][i]=n[a]);else t[e][i]=n}}const h="cos-row",x="cos-col";var f={row:h,col:x};class o extends u.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}o.template=` | ||
<div class="${f.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;r.computed={responsive(){const n=this.data.get("size"),t=this.data.get("span"),e=c.reduce((s,o)=>(s[o]=this.data.get(o)||{},s),{});return["span"].forEach(u({size:n,span:t},e)),e},colStyle(){const n=this.data.get("span"),t=this.data.get("rowCurrent"),e={"box-sizing":"border-box"};if(t&&t.gutter){const s=t.gutter/2;Object.assign(e,{"padding-left":`${s}px`,"padding-right":`${s}px`})}if(t&&t.columns&&n){const s=+n/+t.columns*100;Object.assign(e,{flex:"0 0 auto",width:`${s}%`})}return e}};module.exports=r; | ||
`;o.computed={responsive(){const s=this.data.get("size"),t=this.data.get("columns"),e=this.data.get("gutter"),i=this.data.get("align"),n=this.data.get("justify"),a=this.data.get("wrap"),c=d.reduce((l,g)=>(l[g]=this.data.get(g)||{},l),{});return["columns","gutter","align","justify","wrap"].forEach(p({columns:t,gutter:e,align:i,justify:n,wrap:a},c,s)),c},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},rowStyle(){const s=this.data.get("current"),t={};if(s.gutter){const e=s.gutter/-2;Object.assign(t,{"margin-left":`${e}px`,"margin-right":`${e}px`})}return s.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),s.justify&&Object.assign(t,{"justify-content":s.justify}),s.align&&Object.assign(t,{"align-items":s.align}),t}};class r extends u.Component{initData(){return{span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:"xs",rowCurrent:void 0}}inited(){let t=this.parent;for(;t&&!(t instanceof o);)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}r.trimWhitespace="all";r.template=` | ||
<div class="${f.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;r.computed={responsive(){const s=this.data.get("size"),t=this.data.get("span"),e=d.reduce((i,n)=>(i[n]=this.data.get(n)||{},i),{});return["span"].forEach(p({span:t},e,s)),e},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},colStyle(){const s=this.data.get("current"),t=s&&s.span,e=this.data.get("rowCurrent"),i={"box-sizing":"border-box"};if(e&&e.gutter){const n=e.gutter/2;Object.assign(i,{"padding-left":`${n}px`,"padding-right":`${n}px`})}if(e&&e.columns&&t){const n=+t/+e.columns*100;Object.assign(i,{flex:"0 0 auto",width:`${n}%`})}return i}};module.exports=r; |
@@ -1,5 +0,5 @@ | ||
"use strict";var g=require("san");const u=["xs","sm","md","lg","xl","xxl"],f="cos-row",d="cos-col";var p={row:f,col:d};function m(t,s){const n=t.size;return function(i){const e=t[i];if(typeof e=="object")for(const r in e)e.hasOwnProperty(r)&&(s[r][i]=e[r]);else s[n][i]=e}}class a extends g.Component{initData(){return{nativeAttributes:{},size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}a.template=` | ||
<div class="${p.row}" style="{{rowStyle}}"> | ||
"use strict";var g=require("san");const u=["xs","sm","md","lg","xl","xxl"];function f(t,s,n){return function(i){const e=t[i];if(typeof e=="object")for(const r in e)e.hasOwnProperty(r)&&(s[r][i]=e[r]);else s[n][i]=e}}const d="cos-row",p="cos-col";var m={row:d,col:p};class a extends g.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}a.template=` | ||
<div class="${m.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;a.computed={responsive(){const t=this.data.get("size"),s=this.data.get("columns"),n=this.data.get("gutter"),i=this.data.get("align"),e=this.data.get("justify"),r=this.data.get("wrap"),o=u.reduce((c,l)=>(c[l]=this.data.get(l)||{},c),{});return["columns","gutter","align","justify","wrap"].forEach(m({size:t,columns:s,gutter:n,align:i,justify:e,wrap:r},o)),o},current(){const t=this.data.get("responsive"),s=this.data.get("size");return t[s]},rowStyle(){const t=this.data.get("current"),s={};if(t.gutter){const n=t.gutter/-2;Object.assign(s,{"margin-left":`${n}px`,"margin-right":`${n}px`})}return t.wrap&&Object.assign(s,{"flex-wrap":"wrap"}),t.justify&&Object.assign(s,{"justify-content":t.justify}),t.align&&Object.assign(s,{"align-items":t.align}),s}};module.exports=a; | ||
`;a.computed={responsive(){const t=this.data.get("size"),s=this.data.get("columns"),n=this.data.get("gutter"),i=this.data.get("align"),e=this.data.get("justify"),r=this.data.get("wrap"),o=u.reduce((c,l)=>(c[l]=this.data.get(l)||{},c),{});return["columns","gutter","align","justify","wrap"].forEach(f({columns:s,gutter:n,align:i,justify:e,wrap:r},o,t)),o},current(){const t=this.data.get("responsive"),s=this.data.get("size");return t[s]},rowStyle(){const t=this.data.get("current"),s={};if(t.gutter){const n=t.gutter/-2;Object.assign(s,{"margin-left":`${n}px`,"margin-right":`${n}px`})}return t.wrap&&Object.assign(s,{"flex-wrap":"wrap"}),t.justify&&Object.assign(s,{"justify-content":t.justify}),t.align&&Object.assign(s,{"align-items":t.align}),s}};module.exports=a; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var l=require("san");const R="cos-button",U="cos-hover",H="cos-active",V="cos-disabled",q="cos-button-icon",K="cos-button-prefix",G="cos-button-suffix",J="cos-button-content",Q="cos-square",Z="cos-dashed",tt="cos-light",et="cos-link",st="cos-solid",at="cos-text";var v={button:R,hover:U,active:H,disabled:V,"button-icon":"cos-button-icon",buttonIcon:q,"button-prefix":"cos-button-prefix",buttonPrefix:K,"button-suffix":"cos-button-suffix",buttonSuffix:G,"button-content":"cos-button-content",buttonContent:J,square:Q,dashed:Z,light:tt,link:et,solid:st,text:at};class A extends l.Component{initData(){var t,e;return{name:void 0,value:void 0,type:"button",disabled:!1,hasPrefix:!!((t=this.sourceSlots)!=null&&t.named.prefix),hasSuffix:!!((e=this.sourceSlots)!=null&&e.named.suffix)}}click(t){this.fire("click",t);const e={event:t};this.dispatch("click:button",e)}}A.trimWhitespace="all";A.template=` | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var n=require("san");const U="cos-button",H="cos-hover",V="cos-active",q="cos-disabled",K="cos-button-icon",G="cos-button-prefix",J="cos-button-suffix",Q="cos-button-content",Z="cos-square",tt="cos-dashed",et="cos-light",st="cos-link",at="cos-solid",it="cos-text";var v={button:U,hover:H,active:V,disabled:q,"button-icon":"cos-button-icon",buttonIcon:K,"button-prefix":"cos-button-prefix",buttonPrefix:G,"button-suffix":"cos-button-suffix",buttonSuffix:J,"button-content":"cos-button-content",buttonContent:Q,square:Z,dashed:tt,light:et,link:st,solid:at,text:it};class E extends n.Component{initData(){return{name:void 0,value:void 0,type:"button",disabled:!1}}click(t){this.fire("click",t)}}E.trimWhitespace="all";E.template=` | ||
<button | ||
@@ -11,8 +11,6 @@ class="${v.button} {{disabled ? 'cos-disabled' : ''}}" | ||
<slot name="prefix" class="${v.buttonPrefix}"></slot> | ||
<div class="${v.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot class="${v.buttonContent}"></slot> | ||
<slot name="suffix" class="${v.buttonSuffix}"></slot> | ||
</button> | ||
`;const it="cos-horizontal",ot="cos-vertical",ct="cos-slot-container";var nt={horizontal:it,vertical:ot,"slot-container":"cos-slot-container",slotContainer:ct};class E extends l.Component{initData(){var e,s;const t=!!((s=(e=this.sourceSlots)==null?void 0:e.noname)!=null&&s.length)||0;return{nativeAttributes:{},direction:"horizontal",hasSlot:t>0}}}E.trimWhitespace="all";E.template=` | ||
`;const ot="cos-horizontal",ct="cos-vertical",lt="cos-slot-container";var nt={horizontal:ot,vertical:ct,"slot-container":"cos-slot-container",slotContainer:lt};class P extends n.Component{initData(){var e,a;const t=!!((a=(e=this.sourceSlots)==null?void 0:e.noname)!=null&&a.length)||0;return{nativeAttributes:{},direction:"horizontal",hasSlot:t>0}}}P.trimWhitespace="all";P.template=` | ||
<div class="cos-{{direction}}"> | ||
@@ -23,3 +21,3 @@ <div s-if="hasSlot" class="${nt.slotContainer}"> | ||
</div> | ||
`;const lt="cos-paragraph",rt="cos-md",dt="cos-xs",ht="cos-sm",pt="cos-lg",ut="cos-paragraph-nospacing",ft="cos-paragraph-prefix",gt="cos-paragraph-suffix";var h={paragraph:lt,md:rt,xs:dt,sm:ht,lg:pt,"paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:ut,"paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:ft,"paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:gt};class P extends l.Component{initData(){return{nativeAttributes:{},spacing:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}click(t){this.fire("click",t);const e={event:t};this.dispatch("click:paragraph",e)}}P.trimWhitespace="all";P.template=` | ||
`;const rt="cos-paragraph",dt="cos-md",ht="cos-xs",pt="cos-sm",ut="cos-lg",ft="cos-paragraph-nospacing",gt="cos-paragraph-prefix",bt="cos-paragraph-suffix";var h={paragraph:rt,md:dt,xs:ht,sm:pt,lg:ut,"paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:ft,"paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:gt,"paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:bt};class N extends n.Component{initData(){return{spacing:!1}}click(t){this.fire("click",t)}}N.trimWhitespace="all";N.template=` | ||
<div | ||
@@ -30,11 +28,5 @@ s-if="!spacing" | ||
<p class="${h.paragraph}"> | ||
<span s-if="hasPrefix" class="${h.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${h.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${h.paragraphPrefix}"></slot> | ||
<slot class="${h.paragraphContent}"></slot> | ||
<slot name="suffix" class="${h.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -47,21 +39,15 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${h.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${h.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${h.paragraphPrefix}"></slot> | ||
<slot class="${h.paragraphContent}"></slot> | ||
<slot name="suffix" class="${h.paragraphSuffix}"></slot> | ||
</p> | ||
`;const B=["xs","sm","md","lg","xl","xxl"],mt="cos-row",bt="cos-col";var Y={row:mt,col:bt};function vt(a,t){const e=a.size;return function(s){const i=a[s];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][s]=i[o]);else t[e][s]=i}}class w extends l.Component{initData(){var t,e,s;return{nativeAttributes:{},span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:(e=(t=this.parentComponent)==null?void 0:t.data.get("size"))!=null?e:"xs",rowCurrent:(s=this.parentComponent)==null?void 0:s.data.get("current")}}}w.trimWhitespace="all";w.template=` | ||
<div class="${Y.col}" style="{{colStyle}}"> | ||
`;const B=["xs","sm","md","lg","xl","xxl"];function Y(s,t,e){return function(a){const i=s[a];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][a]=i[o]);else t[e][a]=i}}const mt="cos-row",vt="cos-col";var F={row:mt,col:vt};class w extends n.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}w.template=` | ||
<div class="${F.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;w.computed={responsive(){const a=this.data.get("size"),t=this.data.get("span"),e=B.reduce((s,i)=>(s[i]=this.data.get(i)||{},s),{});return["span"].forEach(vt({size:a,span:t},e)),e},colStyle(){const a=this.data.get("span"),t=this.data.get("rowCurrent"),e={"box-sizing":"border-box"};if(t&&t.gutter){const s=t.gutter/2;Object.assign(e,{"padding-left":`${s}px`,"padding-right":`${s}px`})}if(t&&t.columns&&a){const s=+a/+t.columns*100;Object.assign(e,{flex:"0 0 auto",width:`${s}%`})}return e}};function xt(a,t){const e=a.size;return function(s){const i=a[s];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][s]=i[o]);else t[e][s]=i}}class O extends l.Component{initData(){return{nativeAttributes:{},size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}O.template=` | ||
<div class="${Y.row}" style="{{rowStyle}}"> | ||
`;w.computed={responsive(){const s=this.data.get("size"),t=this.data.get("columns"),e=this.data.get("gutter"),a=this.data.get("align"),i=this.data.get("justify"),o=this.data.get("wrap"),c=B.reduce((l,r)=>(l[r]=this.data.get(r)||{},l),{});return["columns","gutter","align","justify","wrap"].forEach(Y({columns:t,gutter:e,align:a,justify:i,wrap:o},c,s)),c},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},rowStyle(){const s=this.data.get("current"),t={};if(s.gutter){const e=s.gutter/-2;Object.assign(t,{"margin-left":`${e}px`,"margin-right":`${e}px`})}return s.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),s.justify&&Object.assign(t,{"justify-content":s.justify}),s.align&&Object.assign(t,{"align-items":s.align}),t}};class T extends n.Component{initData(){return{span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:"xs",rowCurrent:void 0}}inited(){let t=this.parent;for(;t&&!(t instanceof w);)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}T.trimWhitespace="all";T.template=` | ||
<div class="${F.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;O.computed={responsive(){const a=this.data.get("size"),t=this.data.get("columns"),e=this.data.get("gutter"),s=this.data.get("align"),i=this.data.get("justify"),o=this.data.get("wrap"),c=B.reduce((n,r)=>(n[r]=this.data.get(r)||{},n),{});return["columns","gutter","align","justify","wrap"].forEach(xt({size:a,columns:t,gutter:e,align:s,justify:i,wrap:o},c)),c},current(){const a=this.data.get("responsive"),t=this.data.get("size");return a[t]},rowStyle(){const a=this.data.get("current"),t={};if(a.gutter){const e=a.gutter/-2;Object.assign(t,{"margin-left":`${e}px`,"margin-right":`${e}px`})}return a.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),a.justify&&Object.assign(t,{"justify-content":a.justify}),a.align&&Object.assign(t,{"align-items":a.align}),t}};const wt="cos-swiper -v-text -v-border-none rounded",Tt="cos-swiper-container",It="cos-swiper-arrow -v-bg-light -v-color-primary",yt="cos-swiper-arrow-left",$t="cos-swiper-arrow-right",Ct="cos-swiper-indicator",St="cos-dot",kt="cos-active",Lt="cos-line",Dt="cos-swiper-item",At="cos-light";var d={swiper:wt,"swiper-container":"cos-swiper-container",swiperContainer:Tt,"swiper-arrow":"cos-swiper-arrow -v-bg-light -v-color-primary",swiperArrow:It,"swiper-arrow-left":"cos-swiper-arrow-left",swiperArrowLeft:yt,"swiper-arrow-right":"cos-swiper-arrow-right",swiperArrowRight:$t,"swiper-indicator":"cos-swiper-indicator",swiperIndicator:Ct,dot:St,active:kt,line:Lt,"swiper-item":"cos-swiper-item",swiperItem:Dt,light:At};class T extends l.Component{constructor(){super(...arguments),this.lastTime=0,this.touchStartTime=0,this.touchDuration=0,this.startX=0,this.startY=0,this.disX=0,this.disY=0,this.speedThreshold=.23}initData(){return{nativeAttributes:{},autoplay:!0,interval:3e3,height:"200",arrow:"hover",items:[],prevIcon:"left",nextIcon:"right",activeIndex:0,indicator:!0,loop:!0,allowTouch:!1,indicatorType:"dot",indicatorColor:["",""],transition:"slide",direction:"horizontal",trigger:"hover",indicatorAlign:"center"}}inited(){this.data.set("items",[])}handleTouchStart(t){this.pauseTimer(),(t==null?void 0:t.changedTouches.length)===1&&(this.touchStartTime=new Date().getTime(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY)}handleTouchMove(t){if(t.changedTouches.length!==1)return!0;const e=t.touches[0].clientX,s=t.touches[0].clientY,i=e-this.startX,o=s-this.startY,c=this.getDirection(i,o);return(c===1||c===2)&&(t.cancelable&&t.preventDefault(),t.stopPropagation(),this.disX=i),!0}getDirection(t,e){let s=0;if(Math.abs(t)<2&&Math.abs(e)<2)return s;const i=this.getAngle(t,e);return i>=135&&i<=180||i>=-180&&i<-135?s=1:i>=-45&&i<=45&&(s=2),s}getAngle(t,e){return Math.atan2(e,t)*180/Math.PI}handleTouchEnd(t){var n;if((t==null?void 0:t.changedTouches.length)!==1)return;const e=new Date().getTime();this.touchDuration=e-this.touchStartTime;const s=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;this.disX=s-this.startX,this.disY=i-this.startY;const o=Math.abs(this.disX/this.touchDuration),c=((n=this.el)==null?void 0:n.scrollWidth)||844;o>=this.speedThreshold?this.move():Math.abs(this.disX)>c/2&&this.move()}move(){if(!this.data.get("allowTouch"))return;const e=this.data.get("activeIndex");this.disX>0?this.prevClick(e-1):this.nextClick(e+1),this.startTimer()}prevClick(t){this.arrowClick(t),this.fire("prev-click",t)}nextClick(t){this.arrowClick(t),this.fire("next-click",t)}arrowClick(t){const e=Number(new Date);(e-this.lastTime>400||!this.lastTime)&&(this.lastTime=e,this.setActiveItem(t))}attached(){this.watch("activeIndex",t=>{this.resetItemPosition(),this.fire("change",t)}),this.startTimer()}detached(){this.data.set("activeIndex",0),this.pauseTimer()}setActiveItem(t){const e=this.data.get("items"),s=this.data.get("loop"),i=e.length;t<0?s?this.data.set("activeIndex",i-1):this.data.set("activeIndex",0):t>=i?s?this.data.set("activeIndex",0):this.data.set("activeIndex",i-1):this.data.set("activeIndex",t)}handleMouseEnter(){this.pauseTimer()}handleMouseLeave(){this.startTimer()}handleIndicatorClick(t){this.data.set("activeIndex",t)}handleIndicatorHover(t){this.data.get("trigger")==="hover"&&t!==this.data.get("activeIndex")&&this.data.set("activeIndex",t)}resetItemPosition(){this.data.get("items").forEach((e,s)=>{this.translateItem(e,s,this.data.get("activeIndex"))})}translateItem(t,e,s){const i=this.data.get("items"),o=t.el.parentNode.offsetWidth,c=i.length;let n=e;n!==s&&c>2&&(n=this.resetIndex(n,s,c)),t.data.set("active",n===s),t.data.set("translate",o*(n-s)),t.data.set("ready",!0)}resetIndex(t,e,s){return e===0&&t===s-1?-1:e===s-1&&t===0?s:t<e-1&&e-t>=s/2?s+1:t>e+1&&t-e>=s/2?-2:t}pauseTimer(){this.timer&&clearInterval(this.timer),this.timer=null}startTimer(){const t=this.data.get("interval"),e=this.data.get("autoplay");t<=0||!e||(this.timer=setInterval(()=>{this.playSlides()},t))}playSlides(){const t=this.data.get("items");let e=this.data.get("activeIndex");e<t.length-1?this.data.set("activeIndex",e+=1):this.data.set("activeIndex",0)}click(t){this.fire("click",t)}}T.trimWhitespace="all";T.template=` | ||
`;T.computed={responsive(){const s=this.data.get("size"),t=this.data.get("span"),e=B.reduce((a,i)=>(a[i]=this.data.get(i)||{},a),{});return["span"].forEach(Y({span:t},e,s)),e},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},colStyle(){const s=this.data.get("current"),t=s&&s.span,e=this.data.get("rowCurrent"),a={"box-sizing":"border-box"};if(e&&e.gutter){const i=e.gutter/2;Object.assign(a,{"padding-left":`${i}px`,"padding-right":`${i}px`})}if(e&&e.columns&&t){const i=+t/+e.columns*100;Object.assign(a,{flex:"0 0 auto",width:`${i}%`})}return a}};const xt="cos-swiper -v-text -v-border-none rounded",wt="cos-swiper-container",Tt="cos-swiper-arrow -v-bg-light -v-color-primary",It="cos-swiper-arrow-left",$t="cos-swiper-arrow-right",yt="cos-swiper-indicator",Ct="cos-dot",kt="cos-active",St="cos-line",Lt="cos-swiper-item",Dt="cos-light";var d={swiper:xt,"swiper-container":"cos-swiper-container",swiperContainer:wt,"swiper-arrow":"cos-swiper-arrow -v-bg-light -v-color-primary",swiperArrow:Tt,"swiper-arrow-left":"cos-swiper-arrow-left",swiperArrowLeft:It,"swiper-arrow-right":"cos-swiper-arrow-right",swiperArrowRight:$t,"swiper-indicator":"cos-swiper-indicator",swiperIndicator:yt,dot:Ct,active:kt,line:St,"swiper-item":"cos-swiper-item",swiperItem:Lt,light:Dt};class I extends n.Component{constructor(){super(...arguments),this.lastTime=0,this.touchStartTime=0,this.touchDuration=0,this.startX=0,this.startY=0,this.disX=0,this.disY=0,this.speedThreshold=.23}initData(){return{nativeAttributes:{},autoplay:!0,interval:3e3,height:"200",arrow:"hover",items:[],prevIcon:"left",nextIcon:"right",activeIndex:0,indicator:!0,loop:!0,allowTouch:!1,indicatorType:"dot",indicatorColor:["",""],transition:"slide",direction:"horizontal",trigger:"hover",indicatorAlign:"center"}}inited(){this.data.set("items",[])}handleTouchStart(t){this.pauseTimer(),(t==null?void 0:t.changedTouches.length)===1&&(this.touchStartTime=new Date().getTime(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY)}handleTouchMove(t){if(t.changedTouches.length!==1)return!0;const e=t.touches[0].clientX,a=t.touches[0].clientY,i=e-this.startX,o=a-this.startY,c=this.getDirection(i,o);return(c===1||c===2)&&(t.cancelable&&t.preventDefault(),t.stopPropagation(),this.disX=i),!0}getDirection(t,e){let a=0;if(Math.abs(t)<2&&Math.abs(e)<2)return a;const i=this.getAngle(t,e);return i>=135&&i<=180||i>=-180&&i<-135?a=1:i>=-45&&i<=45&&(a=2),a}getAngle(t,e){return Math.atan2(e,t)*180/Math.PI}handleTouchEnd(t){var l;if((t==null?void 0:t.changedTouches.length)!==1)return;const e=new Date().getTime();this.touchDuration=e-this.touchStartTime;const a=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;this.disX=a-this.startX,this.disY=i-this.startY;const o=Math.abs(this.disX/this.touchDuration),c=((l=this.el)==null?void 0:l.scrollWidth)||844;o>=this.speedThreshold?this.move():Math.abs(this.disX)>c/2&&this.move()}move(){if(!this.data.get("allowTouch"))return;const e=this.data.get("activeIndex");this.disX>0?this.prevClick(e-1):this.nextClick(e+1),this.startTimer()}prevClick(t){this.arrowClick(t),this.fire("prev-click",t)}nextClick(t){this.arrowClick(t),this.fire("next-click",t)}arrowClick(t){const e=Number(new Date);(e-this.lastTime>400||!this.lastTime)&&(this.lastTime=e,this.setActiveItem(t))}attached(){this.watch("activeIndex",t=>{this.resetItemPosition(),this.fire("change",t)}),this.startTimer()}detached(){this.data.set("activeIndex",0),this.pauseTimer()}setActiveItem(t){const e=this.data.get("items"),a=this.data.get("loop"),i=e.length;t<0?a?this.data.set("activeIndex",i-1):this.data.set("activeIndex",0):t>=i?a?this.data.set("activeIndex",0):this.data.set("activeIndex",i-1):this.data.set("activeIndex",t)}handleMouseEnter(){this.pauseTimer()}handleMouseLeave(){this.startTimer()}handleIndicatorClick(t){this.data.set("activeIndex",t)}handleIndicatorHover(t){this.data.get("trigger")==="hover"&&t!==this.data.get("activeIndex")&&this.data.set("activeIndex",t)}resetItemPosition(){this.data.get("items").forEach((e,a)=>{this.translateItem(e,a,this.data.get("activeIndex"))})}translateItem(t,e,a){const i=this.data.get("items"),o=t.el.parentNode.offsetWidth,c=i.length;let l=e;l!==a&&c>2&&(l=this.resetIndex(l,a,c)),t.data.set("active",l===a),t.data.set("translate",o*(l-a)),t.data.set("ready",!0)}resetIndex(t,e,a){return e===0&&t===a-1?-1:e===a-1&&t===0?a:t<e-1&&e-t>=a/2?a+1:t>e+1&&t-e>=a/2?-2:t}pauseTimer(){this.timer&&clearInterval(this.timer),this.timer=null}startTimer(){const t=this.data.get("interval"),e=this.data.get("autoplay");t<=0||!e||(this.timer=setInterval(()=>{this.playSlides()},t))}playSlides(){const t=this.data.get("items");let e=this.data.get("activeIndex");e<t.length-1?this.data.set("activeIndex",e+=1):this.data.set("activeIndex",0)}click(t){this.fire("click",t)}}I.trimWhitespace="all";I.template=` | ||
<div | ||
@@ -107,3 +93,3 @@ class="${d.swiper}" | ||
</div> | ||
`;T.messages={"UI:swiper-item-attached"(a){const t=this.data.get("items");t.push(a.target),this.translateItem(a.target,t.length-1,this.data.get("activeIndex"))},"UI:swiper-item-detached"(a){const t=this.data.get("items");let e=t.length;for(;e--;)t[e]===a.target&&t.splice(e,1)}};class N extends l.Component{initData(){return{nativeAttributes:{},translate:0,active:!1,ready:!1}}attached(){this.dispatch("UI:swiper-item-attached")}detached(){this.dispatch("UI:swiper-item-detached")}}N.trimWhitespace="all";N.template=` | ||
`;I.messages={"UI:swiper-item-attached"(s){const t=this.data.get("items");t.push(s.target),this.translateItem(s.target,t.length-1,this.data.get("activeIndex"))},"UI:swiper-item-detached"(s){const t=this.data.get("items");let e=t.length;for(;e--;)t[e]===s.target&&t.splice(e,1)}};class O extends n.Component{initData(){return{nativeAttributes:{},translate:0,active:!1,ready:!1}}attached(){this.dispatch("UI:swiper-item-attached")}detached(){this.dispatch("UI:swiper-item-detached")}}O.trimWhitespace="all";O.template=` | ||
<div | ||
@@ -117,3 +103,3 @@ s-if="ready" | ||
</div> | ||
`;const Et="cos-image",Pt="cos-image-placeholder",Ot="cos-image-fallback",Nt="cos-image-content";var x={image:Et,"image-placeholder":"cos-image-placeholder",imagePlaceholder:Pt,"image-fallback":"cos-image-fallback",imageFallback:Ot,"image-content":"cos-image-content",imageContent:Nt};class I extends l.Component{initData(){return{nativeAttributes:{},src:"",alt:"",width:void 0,height:void 0,objectFit:"fill",hasPlaceholder:!!this.sourceSlots.named.placeholder,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,loading:!0,error:!1}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const e={event:t};this.dispatch("click:image",e)}onTouchmove(t){this.fire("touchmove",t);const e={event:t};this.dispatch("touchmove:image",e)}}I.trimWhitespace="all";I.template=` | ||
`;const At="cos-image",Et="cos-image-placeholder",Pt="cos-image-fallback",Nt="cos-image-content";var x={image:At,"image-placeholder":"cos-image-placeholder",imagePlaceholder:Et,"image-fallback":"cos-image-fallback",imageFallback:Pt,"image-content":"cos-image-content",imageContent:Nt};class $ extends n.Component{initData(){return{nativeAttributes:{},src:"",alt:"",width:void 0,height:void 0,objectFit:"fill",hasPlaceholder:!!this.sourceSlots.named.placeholder,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,loading:!0,error:!1}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const e={event:t};this.dispatch("click:image",e)}onTouchmove(t){this.fire("touchmove",t);const e={event:t};this.dispatch("touchmove:image",e)}}$.trimWhitespace="all";$.template=` | ||
<div | ||
@@ -143,11 +129,11 @@ class="${x.image}" | ||
</div> | ||
`;I.computed={objectFitValue(){const a="object-fit:",t=this.data.get("objectFit");return t&&["fill","contain","cover","none","scale-down"].indexOf(t)!==-1?`${a}${t};`:""}};const Wt="cos-root -v-bg-inapparent -v-h -v-px -v-text",jt="cos-active",zt="cos-prefix",_t="cos-input",Xt="cos-input-wrapper",Mt="cos-input-real -v-text",Bt="cos-input-prefix",Yt="cos-input-suffix";var m={root:Wt,active:jt,prefix:zt,input:_t,"input-wrapper":"cos-input-wrapper",inputWrapper:Xt,"input-real":"cos-input-real -v-text",inputReal:Mt,"input-prefix":"cos-input-prefix",inputPrefix:Bt,"input-suffix":"cos-input-suffix",inputSuffix:Yt};class F extends l.Component{initData(){return{nativeAttributes:{},value:"",placeholder:"",disabled:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}handleInput(t){const e=this.data.get("value");this.fire("input",e);const s={event:t,value:e};this.dispatch("input:input",s)}handleChange(t){const e=this.data.get("value");this.fire("change",e);const s={event:t,value:e};this.dispatch("change:input",s)}}F.template=` | ||
<div class="${m.input}"> | ||
`;$.computed={objectFitValue(){const s="object-fit:",t=this.data.get("objectFit");return t&&["fill","contain","cover","none","scale-down"].indexOf(t)!==-1?`${s}${t};`:""}};const Ot="cos-root -v-bg-inapparent -v-h -v-px -v-text",Wt="cos-active",jt="cos-prefix",_t="cos-input",zt="cos-input-wrapper",Xt="cos-input-real -v-text",Mt="cos-input-prefix",Bt="cos-input-suffix";var b={root:Ot,active:Wt,prefix:jt,input:_t,"input-wrapper":"cos-input-wrapper",inputWrapper:zt,"input-real":"cos-input-real -v-text",inputReal:Xt,"input-prefix":"cos-input-prefix",inputPrefix:Mt,"input-suffix":"cos-input-suffix",inputSuffix:Bt};class R extends n.Component{initData(){return{nativeAttributes:{},value:"",placeholder:"",disabled:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}handleInput(t){const e=this.data.get("value");this.fire("input",e);const a={event:t,value:e};this.dispatch("input:input",a)}handleChange(t){const e=this.data.get("value");this.fire("change",e);const a={event:t,value:e};this.dispatch("change:input",a)}}R.template=` | ||
<div class="${b.input}"> | ||
<div | ||
s-if="hasPrefix" | ||
class="${m.inputPrefix}" | ||
class="${b.inputPrefix}" | ||
> | ||
<slot name="prefix"></slot> | ||
</div> | ||
<div class="${m.inputWrapper}"> | ||
<div class="${b.inputWrapper}"> | ||
<input | ||
@@ -159,3 +145,3 @@ type="input" | ||
s-bind="nativeAttributes" | ||
class="${m.inputReal}" | ||
class="${b.inputReal}" | ||
on-input="handleInput" | ||
@@ -167,3 +153,3 @@ on-change="handleChange" | ||
s-if="hasSuffix" | ||
class="${m.inputSuffix}" | ||
class="${b.inputSuffix}" | ||
> | ||
@@ -173,3 +159,3 @@ <slot name="suffix"></slot> | ||
</div> | ||
`;const Ft="cos-tabs",Rt="cos-tabs-nav",Ut="cos-tabs-nav-item",Ht="cos-tabs-divider",Vt="cos-tabs-cursor",qt="cos-selected",Kt="cos-tabs-item relative -v-px -v-py -v-text rounded",Gt="cos-hover",Jt="cos-active";var p={tabs:Ft,"tabs-nav":"cos-tabs-nav",tabsNav:Rt,"tabs-nav-item":"cos-tabs-nav-item",tabsNavItem:Ut,"tabs-divider":"cos-tabs-divider",tabsDivider:Ht,"tabs-cursor":"cos-tabs-cursor",tabsCursor:Vt,selected:qt,"tabs-item":"cos-tabs-item relative -v-px -v-py -v-text rounded",tabsItem:Kt,hover:Gt,active:Jt};class y extends l.Component{initData(){return{nativeAttributes:{},index:0,animated:!1,paneList:[],labelList:[],cursorWidth:0,cursorLeft:0}}inited(){var s,i;const t=[];(i=(s=this==null?void 0:this.sourceSlots)==null?void 0:s.noname)==null||i.forEach(o=>{o&&o.tagName&&o.tagName.indexOf("cos-tabs-item")!==-1&&t.push(o)});const e=[];t.forEach(o=>{var c;(c=o==null?void 0:o.props)==null||c.forEach(n=>{n.name==="label"&&e.push({text:n.expr.value})})}),this.data.set("labelList",e)}attached(){var c,n,r,u,z;const t=[];(z=(u=(r=(n=(c=this==null?void 0:this.children)==null?void 0:c[1])==null?void 0:n.children)==null?void 0:r[0])==null?void 0:u.children)==null||z.forEach(b=>{b.constructor.name==="TabsItem"&&t.push(b)}),this.data.set("paneList",t);const e=this.data.get("index"),s=this.data.get("labelList"),i=this;let o=0;s.forEach((b,_)=>{var M;const X=(M=i.ref("label"+_))==null?void 0:M.offsetWidth;b.width=X,e===_&&(o=X)}),this.data.set("labelList",s),this.data.set("cursorWidth",o)}handleLabelClick(t,e,s){this.fire("tab-click",{index:e,label:t.text});let i={event:s,index:e,label:t.text};if(this.dispatch("tab-click:tabs",i),this.data.get("index")===e)return;this.data.set("index",e),this.data.get("paneList").forEach((r,u)=>{r.setPaneShow(u===e)});let o=0,c=0;this.data.get("labelList").forEach((r,u)=>{if(u<e){o+=(r==null?void 0:r.width)||0;return}u===e&&(c=(r==null?void 0:r.width)||0)}),this.data.set("cursorLeft",o),this.data.set("cursorWidth",c),this.fire("change",{index:e,label:t.text}),i={event:s,index:e,label:t.text},this.dispatch("change:tabs",i)}}y.trimWhitespace="all";y.template=` | ||
`;const Yt="cos-tabs",Ft="cos-tabs-nav",Rt="cos-tabs-nav-item",Ut="cos-tabs-divider",Ht="cos-tabs-cursor",Vt="cos-selected",qt="cos-tabs-item relative -v-px -v-py -v-text rounded",Kt="cos-hover",Gt="cos-active";var p={tabs:Yt,"tabs-nav":"cos-tabs-nav",tabsNav:Ft,"tabs-nav-item":"cos-tabs-nav-item",tabsNavItem:Rt,"tabs-divider":"cos-tabs-divider",tabsDivider:Ut,"tabs-cursor":"cos-tabs-cursor",tabsCursor:Ht,selected:Vt,"tabs-item":"cos-tabs-item relative -v-px -v-py -v-text rounded",tabsItem:qt,hover:Kt,active:Gt};class y extends n.Component{initData(){return{nativeAttributes:{},index:0,animated:!1,paneList:[],labelList:[],cursorWidth:0,cursorLeft:0}}inited(){var a,i;const t=[];(i=(a=this==null?void 0:this.sourceSlots)==null?void 0:a.noname)==null||i.forEach(o=>{o&&o.tagName&&o.tagName.indexOf("cos-tabs-item")!==-1&&t.push(o)});const e=[];t.forEach(o=>{var c;(c=o==null?void 0:o.props)==null||c.forEach(l=>{l.name==="label"&&e.push({text:l.expr.value})})}),this.data.set("labelList",e)}attached(){var c,l,r,u,_;const t=[];(_=(u=(r=(l=(c=this==null?void 0:this.children)==null?void 0:c[1])==null?void 0:l.children)==null?void 0:r[0])==null?void 0:u.children)==null||_.forEach(m=>{m.constructor.name==="TabsItem"&&t.push(m)}),this.data.set("paneList",t);const e=this.data.get("index"),a=this.data.get("labelList"),i=this;let o=0;a.forEach((m,z)=>{var M;const X=(M=i.ref("label"+z))==null?void 0:M.offsetWidth;m.width=X,e===z&&(o=X)}),this.data.set("labelList",a),this.data.set("cursorWidth",o)}handleLabelClick(t,e,a){this.fire("tab-click",{index:e,label:t.text});let i={event:a,index:e,label:t.text};if(this.dispatch("tab-click:tabs",i),this.data.get("index")===e)return;this.data.set("index",e),this.data.get("paneList").forEach((r,u)=>{r.setPaneShow(u===e)});let o=0,c=0;this.data.get("labelList").forEach((r,u)=>{if(u<e){o+=(r==null?void 0:r.width)||0;return}u===e&&(c=(r==null?void 0:r.width)||0)}),this.data.set("cursorLeft",o),this.data.set("cursorWidth",c),this.fire("change",{index:e,label:t.text}),i={event:a,index:e,label:t.text},this.dispatch("change:tabs",i)}}y.trimWhitespace="all";y.template=` | ||
<div class="${p.tabs}"> | ||
@@ -199,3 +185,3 @@ <div class="${p.tabsNav}"> | ||
</div> | ||
`;y.computed={cursorStyle(){const a=this.data.get("cursorLeft"),t=this.data.get("cursorWidth");return`left: ${a}px; width: ${t}px`}};class W extends l.Component{initData(){return{nativeAttributes:{},label:"",active:!1}}inited(){var s,i,o,c;const t=(i=(s=this.parentComponent)==null?void 0:s.data)==null?void 0:i.raw;((c=(o=t==null?void 0:t.labelList)==null?void 0:o[t==null?void 0:t.index])==null?void 0:c.text)===this.data.get("label")&&this.data.set("active",!0)}setPaneShow(t){this.data.set("active",t)}}W.trimWhitespace="all";W.template=` | ||
`;y.computed={cursorStyle(){const s=this.data.get("cursorLeft"),t=this.data.get("cursorWidth");return`left: ${s}px; width: ${t}px`}};class W extends n.Component{initData(){return{nativeAttributes:{},label:"",active:!1}}inited(){var a,i,o,c;const t=(i=(a=this.parentComponent)==null?void 0:a.data)==null?void 0:i.raw;((c=(o=t==null?void 0:t.labelList)==null?void 0:o[t==null?void 0:t.index])==null?void 0:c.text)===this.data.get("label")&&this.data.set("active",!0)}setPaneShow(t){this.data.set("active",t)}}W.trimWhitespace="all";W.template=` | ||
<div | ||
@@ -208,3 +194,3 @@ s-show="active" | ||
</div> | ||
`;const Qt="cos-table",Zt="cos-thead",te="cos-th",ee="cos-td",se="cos-xs",ae="cos-icon",ie="cos-sm",oe="cos-md",ce="cos-lg",ne="cos-xl",le="cos-xxl",re="cos-tr",de="cos-hover",he="cos-active",pe="cos-disabled";var g={table:Qt,thead:Zt,th:te,td:ee,xs:se,icon:ae,sm:ie,md:oe,lg:ce,xl:ne,xxl:le,tr:re,hover:de,active:he,disabled:pe};class $ extends l.Component{initData(){return{selectable:""}}attached(){!this.data.get("selectable")||this.thead&&this.thead.updateSelectAllState(this.isAllSelected())}isAllSelected(){var s;const t=((s=this==null?void 0:this.tbody)==null?void 0:s.findChildTRs())||[];let e=!0;if((t==null?void 0:t.length)>0){for(let i=0,o=t==null?void 0:t.length;i<o;i++)if(!t[i].data.get("selected")){e=!1;break}}else e=!1;return e}}$.template=` | ||
`;const Jt="cos-table",Qt="cos-thead",Zt="cos-th",te="cos-td",ee="cos-xs",se="cos-icon",ae="cos-sm",ie="cos-md",oe="cos-lg",ce="cos-xl",le="cos-xxl",ne="cos-tr",re="cos-hover",de="cos-active",he="cos-disabled";var g={table:Jt,thead:Qt,th:Zt,td:te,xs:ee,icon:se,sm:ae,md:ie,lg:oe,xl:ce,xxl:le,tr:ne,hover:re,active:de,disabled:he};class C extends n.Component{initData(){return{selectable:""}}attached(){!this.data.get("selectable")||this.thead&&this.thead.updateSelectAllState(this.isAllSelected())}isAllSelected(){var a;const t=((a=this==null?void 0:this.tbody)==null?void 0:a.findChildTRs())||[];let e=!0;if((t==null?void 0:t.length)>0){for(let i=0,o=t==null?void 0:t.length;i<o;i++)if(!t[i].data.get("selected")){e=!1;break}}else e=!1;return e}}C.template=` | ||
<table class="${g.table}"> | ||
@@ -215,9 +201,9 @@ <slot name="header"></slot> | ||
</table> | ||
`;$.messages={"UI:tbody-inited"(a){var t;this.tbody=a.target,(t=a==null?void 0:a.target)==null||t.data.set("tableSelectable",this.data.get("selectable"))},"UI:thead-inited"(a){var t,e;this.thead=a.target,(e=(t=a==null?void 0:a.target)==null?void 0:t.data)==null||e.set("tableSelectable",this.data.get("selectable"))},"select:table-select-head"(a){var s;let t=[];const e=a.value;(s=this==null?void 0:this.tbody)==null||s.eachItem((i,o)=>{i.data.get("disabled")?i.data.get("selected")&&t.push(o):(i.data.set("selected",e),e&&t.push(o))}),this.fire("select",t)},"select:table-select-body"(a){this.thead&&this.thead.updateSelectAllState(this.isAllSelected()),this.fire("select",a.value)},"click:table-tbody-tr"(a){this.fire("click",a.value)}};const ue="UI:thead-inited";class C extends l.Component{inited(){this.dispatch(ue,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}C.template=` | ||
`;C.messages={"UI:tbody-inited"(s){var t;this.tbody=s.target,(t=s==null?void 0:s.target)==null||t.data.set("tableSelectable",this.data.get("selectable"))},"UI:thead-inited"(s){var t,e;this.thead=s.target,(e=(t=s==null?void 0:s.target)==null?void 0:t.data)==null||e.set("tableSelectable",this.data.get("selectable"))},"select:table-select-head"(s){var a;let t=[];const e=s.value;(a=this==null?void 0:this.tbody)==null||a.eachItem((i,o)=>{i.data.get("disabled")?i.data.get("selected")&&t.push(o):(i.data.set("selected",e),e&&t.push(o))}),this.fire("select",t)},"select:table-select-body"(s){this.thead&&this.thead.updateSelectAllState(this.isAllSelected()),this.fire("select",s.value)},"click:table-tbody-tr"(s){this.fire("click",s.value)}};const pe="UI:thead-inited";class k extends n.Component{inited(){this.dispatch(pe,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}k.template=` | ||
<thead class="${g.thead}"><slot></slot></thead> | ||
`;C.messages={"UI:tr-inited"(a){var t,e;(t=a.target)==null||t.data.set("pos","thead"),(e=a.target)==null||e.data.set("tableSelectable",this.data.get("tableSelectable")),this.tr=a.target}};const fe="UI:tfoot-inited";class j extends l.Component{inited(){this.dispatch(fe,null)}}j.template=` | ||
`;k.messages={"UI:tr-inited"(s){var t,e;(t=s.target)==null||t.data.set("pos","thead"),(e=s.target)==null||e.data.set("tableSelectable",this.data.get("tableSelectable")),this.tr=s.target}};const ue="UI:tfoot-inited";class j extends n.Component{inited(){this.dispatch(ue,null)}}j.template=` | ||
<tfoot> | ||
<slot></slot> | ||
</tfoot> | ||
`;j.messages={"click:table-tfoot-item"(){this.fire("click")}};class S extends l.Component{initData(){return{colspan:1}}}S.template=` | ||
`;j.messages={"click:table-tfoot-item"(){this.fire("click")}};class S extends n.Component{initData(){return{colspan:1}}}S.template=` | ||
<td san-if="colspan !== 1" colspan="{{colspan}}" class="${g.td}"> | ||
@@ -229,5 +215,5 @@ <slot></slot> | ||
</td> | ||
`;class k extends l.Component{initData(){return{width:""}}}k.template=` | ||
`;class L extends n.Component{initData(){return{width:""}}}L.template=` | ||
<th width="{{width}}" class="${g.th}"><slot></slot></th> | ||
`;const ge="UI:tr-inited",me="click:table-tfoot-item",be="click:table-tbody-item";class f extends l.Component{constructor(){super(...arguments),this.tag=Number(Math.random()+Date.now())}initData(){return{selected:!1,pos:"tbody",tableSelectable:"single"}}inited(){this.dispatch(ge,null)}select(){const t=this.data.get("selected"),e=this.data.get("pos");this.data.set("selected",!t),this.dispatch(`select:table-select-${e==="tbody"?"item":"head"}`,!t)}handleClick(){var s,i,o;if(((s=this==null?void 0:this.parentComponent)==null?void 0:s.tagName)==="thead")return;if(((i=this==null?void 0:this.parentComponent)==null?void 0:i.tagName)==="tfoot"){this.dispatch(me,"tfoot");return}const t=((o=this==null?void 0:this.parent)==null?void 0:o.children)||[];let e=0;t.forEach((c,n)=>{this.tag===c.tag&&(e=n)}),this.dispatch(be,e)}}f.template=` | ||
`;const fe="UI:tr-inited",ge="click:table-tfoot-item",be="click:table-tbody-item";class f extends n.Component{constructor(){super(...arguments),this.tag=Number(Math.random()+Date.now())}initData(){return{selected:!1,pos:"tbody",tableSelectable:"single"}}inited(){this.dispatch(fe,null)}select(){const t=this.data.get("selected"),e=this.data.get("pos");this.data.set("selected",!t),this.dispatch(`select:table-select-${e==="tbody"?"item":"head"}`,!t)}handleClick(){var a,i,o;if(((a=this==null?void 0:this.parentComponent)==null?void 0:a.tagName)==="thead")return;if(((i=this==null?void 0:this.parentComponent)==null?void 0:i.tagName)==="tfoot"){this.dispatch(ge,"tfoot");return}const t=((o=this==null?void 0:this.parent)==null?void 0:o.children)||[];let e=0;t.forEach((c,l)=>{this.tag===c.tag&&(e=l)}),this.dispatch(be,e)}}f.template=` | ||
<tr class="${g.tr}" on-click="handleClick($event)"> | ||
@@ -260,7 +246,7 @@ <cc-th | ||
</tr> | ||
`;f.components={"cc-td":S,"cc-th":k};f.computed={checked(){const a=this.data.get("selected");switch(this.data.get("tableSelectable")){case"single":return a?"ON":"";case"multi":return a?["ON"]:[""]}}};f.dataTypes={selected:l.DataTypes.bool,pos:l.DataTypes.oneOf(["tbody","thead","tfoot"])};const ve="select:table-select-body",xe="click:table-tbody-tr",we="UI:tbody-inited";class L extends l.Component{initData(){return{}}inited(){this.dispatch(we,null)}eachItem(t){this.findChildTRs().forEach((e,s)=>{t.call(this,e,s),s++})}findChildTRs(){let t=[];function e(s){s instanceof f?t.push(s):s.children&&s.children.forEach(i=>{e(i)})}return e(this),t}}L.template=` | ||
`;f.components={"cc-td":S,"cc-th":L};f.computed={checked(){const s=this.data.get("selected");switch(this.data.get("tableSelectable")){case"single":return s?"ON":"";case"multi":return s?["ON"]:[""]}}};f.dataTypes={selected:n.DataTypes.bool,pos:n.DataTypes.oneOf(["tbody","thead","tfoot"])};const me="select:table-select-body",ve="click:table-tbody-tr",xe="UI:tbody-inited";class D extends n.Component{initData(){return{}}inited(){this.dispatch(xe,null)}eachItem(t){this.findChildTRs().forEach((e,a)=>{t.call(this,e,a),a++})}findChildTRs(){let t=[];function e(a){a instanceof f?t.push(a):a.children&&a.children.forEach(i=>{e(i)})}return e(this),t}}D.template=` | ||
<tbody> | ||
<slot></slot> | ||
</tbody> | ||
`;L.messages={"UI:tr-inited"(a){var e,s;let t=(a==null?void 0:a.target)||null;(e=t==null?void 0:t.data)==null||e.set("pos","tbody"),(s=t==null?void 0:t.data)==null||s.set("tableSelectable",this.data.get("tableSelectable"))},"select:table-select-item"(a){let t=this.data.get("tableSelectable"),e=1;switch(t){case"single":this.eachItem((s,i)=>{let o=s===a.target;s.data.set("selected",o),o&&(e=i)});break;case"multi":e=[],this.eachItem((s,i)=>{s.data.get("selected")&&e.push(i)});break}this.dispatch(ve,e)},"click:table-tbody-item"(a){this.dispatch(xe,a.value)}};class D extends l.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}D.template=` | ||
`;D.messages={"UI:tr-inited"(s){var e,a;let t=(s==null?void 0:s.target)||null;(e=t==null?void 0:t.data)==null||e.set("pos","tbody"),(a=t==null?void 0:t.data)==null||a.set("tableSelectable",this.data.get("tableSelectable"))},"select:table-select-item"(s){let t=this.data.get("tableSelectable"),e=1;switch(t){case"single":this.eachItem((a,i)=>{let o=a===s.target;a.data.set("selected",o),o&&(e=i)});break;case"multi":e=[],this.eachItem((a,i)=>{a.data.get("selected")&&e.push(i)});break}this.dispatch(me,e)},"click:table-tbody-item"(s){this.dispatch(ve,s.value)}};class A extends n.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}A.template=` | ||
<cc-table selectable="{{selectable}}" on-select="select($event)"> | ||
@@ -278,2 +264,2 @@ <cc-thead> | ||
</cc-table> | ||
`;D.components={"cc-tr":f,"cc-th":k,"cc-td":S,"cc-tbody":L,"cc-thead":C,"cc-table":$};D.filters={renderField(a,t){return typeof a.content=="function"?a.content.call(this,t):a.prop?t[a.prop]:""}};exports.Button=A;exports.Col=w;exports.ConfigurableTable=D;exports.Divider=E;exports.Image=I;exports.Input=F;exports.Paragraph=P;exports.Row=O;exports.Swiper=T;exports.SwiperItem=N;exports.TBody=L;exports.TD=S;exports.TFoot=j;exports.TH=k;exports.THead=C;exports.TR=f;exports.Table=$;exports.Tabs=y;exports.TabsItem=W; | ||
`;A.components={"cc-tr":f,"cc-th":L,"cc-td":S,"cc-tbody":D,"cc-thead":k,"cc-table":C};A.filters={renderField(s,t){return typeof s.content=="function"?s.content.call(this,t):s.prop?t[s.prop]:""}};exports.Button=E;exports.Col=T;exports.ConfigurableTable=A;exports.Divider=P;exports.Image=$;exports.Input=R;exports.Paragraph=N;exports.Row=w;exports.Swiper=I;exports.SwiperItem=O;exports.TBody=D;exports.TD=S;exports.TFoot=j;exports.TH=L;exports.THead=k;exports.TR=f;exports.Table=C;exports.Tabs=y;exports.TabsItem=W; |
@@ -1,2 +0,2 @@ | ||
"use strict";var i=require("san");const c="cos-paragraph",o="cos-md",n="cos-xs",f="cos-sm",t="cos-lg",h="cos-paragraph-nospacing",l="cos-paragraph-prefix",e="cos-paragraph-suffix";var a={paragraph:c,md:o,xs:n,sm:f,lg:t,"paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:h,"paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:l,"paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:e};class s extends i.Component{initData(){return{nativeAttributes:{},spacing:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}click(p){this.fire("click",p);const r={event:p};this.dispatch("click:paragraph",r)}}s.trimWhitespace="all";s.template=` | ||
"use strict";var r=require("san");const c="cos-paragraph",o="cos-md",i="cos-xs",g="cos-sm",t="cos-lg",l="cos-paragraph-nospacing",n="cos-paragraph-prefix",e="cos-paragraph-suffix";var a={paragraph:c,md:o,xs:i,sm:g,lg:t,"paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:l,"paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:n,"paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:e};class s extends r.Component{initData(){return{spacing:!1}}click(p){this.fire("click",p)}}s.trimWhitespace="all";s.template=` | ||
<div | ||
@@ -7,11 +7,5 @@ s-if="!spacing" | ||
<p class="${a.paragraph}"> | ||
<span s-if="hasPrefix" class="${a.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${a.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${a.paragraphPrefix}"></slot> | ||
<slot class="${a.paragraphContent}"></slot> | ||
<slot name="suffix" class="${a.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -24,12 +18,6 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${a.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${a.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${a.paragraphPrefix}"></slot> | ||
<slot class="${a.paragraphContent}"></slot> | ||
<slot name="suffix" class="${a.paragraphSuffix}"></slot> | ||
</p> | ||
`;module.exports=s; |
@@ -1,2 +0,2 @@ | ||
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e(require("san")):typeof define=="function"&&define.amd?define(["san"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,a["@cosmic-design/san"]=e(a.san))})(this,function(a){"use strict";var s={avatar:"cos-avatar",md:"cos-md",sm:"cos-sm",lg:"cos-lg",xl:"cos-xl","avatar-content":"cos-avatar-content",avatarContent:"cos-avatar-content","avatar-placeholder":"cos-avatar-placeholder",avatarPlaceholder:"cos-avatar-placeholder","avatar-fallback":"cos-avatar-fallback",avatarFallback:"cos-avatar-fallback","avatar-img":"cos-avatar-img",avatarImg:"cos-avatar-img"};class o extends a.Component{initData(){return{nativeAttributes:{},src:"",alt:"",loading:!0,error:!1,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,hasPlaceholder:!!this.sourceSlots.named.placeholder}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const l={event:t};this.dispatch("click:avatar",l)}}return o.trimWhitespace="all",o.template=` | ||
(function(a,e){typeof exports=="object"&&typeof module!="undefined"?module.exports=e(require("san")):typeof define=="function"&&define.amd?define(["san"],e):(a=typeof globalThis!="undefined"?globalThis:a||self,a["@cosmic-design/san"]=e(a.san))})(this,function(a){"use strict";var s={avatar:"cos-avatar",md:"cos-md",sm:"cos-sm",lg:"cos-lg",xl:"cos-xl","avatar-content":"cos-avatar-content",avatarContent:"cos-avatar-content","avatar-placeholder":"cos-avatar-placeholder",avatarPlaceholder:"cos-avatar-placeholder","avatar-fallback":"cos-avatar-fallback",avatarFallback:"cos-avatar-fallback","avatar-img":"cos-avatar-img",avatarImg:"cos-avatar-img"};class o extends a.Component{initData(){return{src:"",alt:"",loading:!0,error:!1,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,hasPlaceholder:!!this.sourceSlots.named.placeholder}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const l={event:t};this.dispatch("click:avatar",l)}}return o.trimWhitespace="all",o.template=` | ||
<div class="${s.avatar} cos-{{size}}"> | ||
@@ -3,0 +3,0 @@ <div s-if="hasContent" class="${s.avatarContent}"> |
@@ -1,4 +0,4 @@ | ||
(function(t,n){typeof exports=="object"&&typeof module!="undefined"?module.exports=n(require("san")):typeof define=="function"&&define.amd?define(["san"],n):(t=typeof globalThis!="undefined"?globalThis:t||self,t["@cosmic-design/san"]=n(t.san))})(this,function(t){"use strict";var s={button:"cos-button",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled","button-icon":"cos-button-icon",buttonIcon:"cos-button-icon","button-prefix":"cos-button-prefix",buttonPrefix:"cos-button-prefix","button-suffix":"cos-button-suffix",buttonSuffix:"cos-button-suffix","button-content":"cos-button-content",buttonContent:"cos-button-content",square:"cos-square",dashed:"cos-dashed",light:"cos-light",link:"cos-link",solid:"cos-solid",text:"cos-text"};class i extends t.Component{initData(){var o,e;return{name:void 0,value:void 0,type:"button",disabled:!1,hasPrefix:!!((o=this.sourceSlots)!=null&&o.named.prefix),hasSuffix:!!((e=this.sourceSlots)!=null&&e.named.suffix)}}click(o){this.fire("click",o);const e={event:o};this.dispatch("click:button",e)}}return i.trimWhitespace="all",i.template=` | ||
(function(t,o){typeof exports=="object"&&typeof module!="undefined"?module.exports=o(require("san")):typeof define=="function"&&define.amd?define(["san"],o):(t=typeof globalThis!="undefined"?globalThis:t||self,t["@cosmic-design/san"]=o(t.san))})(this,function(t){"use strict";var n={button:"cos-button",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled","button-icon":"cos-button-icon",buttonIcon:"cos-button-icon","button-prefix":"cos-button-prefix",buttonPrefix:"cos-button-prefix","button-suffix":"cos-button-suffix",buttonSuffix:"cos-button-suffix","button-content":"cos-button-content",buttonContent:"cos-button-content",square:"cos-square",dashed:"cos-dashed",light:"cos-light",link:"cos-link",solid:"cos-solid",text:"cos-text"};class s extends t.Component{initData(){return{name:void 0,value:void 0,type:"button",disabled:!1}}click(e){this.fire("click",e)}}return s.trimWhitespace="all",s.template=` | ||
<button | ||
class="${s.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${n.button} {{disabled ? 'cos-disabled' : ''}}" | ||
type="{{type}}" | ||
@@ -10,8 +10,6 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${s.buttonPrefix}"></slot> | ||
<div class="${s.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot name="suffix" class="${s.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${n.buttonPrefix}"></slot> | ||
<slot class="${n.buttonContent}"></slot> | ||
<slot name="suffix" class="${n.buttonSuffix}"></slot> | ||
</button> | ||
`,i}); | ||
`,s}); |
@@ -1,5 +0,9 @@ | ||
(function(i,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r(require("san")):typeof define=="function"&&define.amd?define(["san"],r):(i=typeof globalThis!="undefined"?globalThis:i||self,i["@cosmic-design/san"]=r(i.san))})(this,function(i){"use strict";const r=["xs","sm","md","lg","xl","xxl"];var d={row:"cos-row",col:"cos-col"};function l(n,t){const s=n.size;return function(e){const o=n[e];if(typeof o=="object")for(const c in o)o.hasOwnProperty(c)&&(t[c][e]=o[c]);else t[s][e]=o}}class a extends i.Component{initData(){var t,s,e;return{nativeAttributes:{},span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:(s=(t=this.parentComponent)==null?void 0:t.data.get("size"))!=null?s:"xs",rowCurrent:(e=this.parentComponent)==null?void 0:e.data.get("current")}}}return a.trimWhitespace="all",a.template=` | ||
<div class="${d.col}" style="{{colStyle}}"> | ||
(function(o,r){typeof exports=="object"&&typeof module!="undefined"?module.exports=r(require("san")):typeof define=="function"&&define.amd?define(["san"],r):(o=typeof globalThis!="undefined"?globalThis:o||self,o["@cosmic-design/san"]=r(o.san))})(this,function(o){"use strict";const r=["xs","sm","md","lg","xl","xxl"];function d(e,t,s){return function(i){const n=e[i];if(typeof n=="object")for(const a in n)n.hasOwnProperty(a)&&(t[a][i]=n[a]);else t[s][i]=n}}var u={row:"cos-row",col:"cos-col"};class l extends o.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}l.template=` | ||
<div class="${u.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,a.computed={responsive(){const n=this.data.get("size"),t=this.data.get("span"),s=r.reduce((e,o)=>(e[o]=this.data.get(o)||{},e),{});return["span"].forEach(l({size:n,span:t},s)),s},colStyle(){const n=this.data.get("span"),t=this.data.get("rowCurrent"),s={"box-sizing":"border-box"};if(t&&t.gutter){const e=t.gutter/2;Object.assign(s,{"padding-left":`${e}px`,"padding-right":`${e}px`})}if(t&&t.columns&&n){const e=+n/+t.columns*100;Object.assign(s,{flex:"0 0 auto",width:`${e}%`})}return s}},a}); | ||
`,l.computed={responsive(){const e=this.data.get("size"),t=this.data.get("columns"),s=this.data.get("gutter"),i=this.data.get("align"),n=this.data.get("justify"),a=this.data.get("wrap"),g=r.reduce((p,f)=>(p[f]=this.data.get(f)||{},p),{});return["columns","gutter","align","justify","wrap"].forEach(d({columns:t,gutter:s,align:i,justify:n,wrap:a},g,e)),g},current(){const e=this.data.get("responsive"),t=this.data.get("size");return e[t]},rowStyle(){const e=this.data.get("current"),t={};if(e.gutter){const s=e.gutter/-2;Object.assign(t,{"margin-left":`${s}px`,"margin-right":`${s}px`})}return e.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),e.justify&&Object.assign(t,{"justify-content":e.justify}),e.align&&Object.assign(t,{"align-items":e.align}),t}};class c extends o.Component{initData(){return{span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:"xs",rowCurrent:void 0}}inited(){let t=this.parent;for(;t&&!(t instanceof l);)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}return c.trimWhitespace="all",c.template=` | ||
<div class="${u.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,c.computed={responsive(){const e=this.data.get("size"),t=this.data.get("span"),s=r.reduce((i,n)=>(i[n]=this.data.get(n)||{},i),{});return["span"].forEach(d({span:t},s,e)),s},current(){const e=this.data.get("responsive"),t=this.data.get("size");return e[t]},colStyle(){const e=this.data.get("current"),t=e&&e.span,s=this.data.get("rowCurrent"),i={"box-sizing":"border-box"};if(s&&s.gutter){const n=s.gutter/2;Object.assign(i,{"padding-left":`${n}px`,"padding-right":`${n}px`})}if(s&&s.columns&&t){const n=+t/+s.columns*100;Object.assign(i,{flex:"0 0 auto",width:`${n}%`})}return i}},c}); |
@@ -1,5 +0,5 @@ | ||
(function(n,o){typeof exports=="object"&&typeof module!="undefined"?module.exports=o(require("san")):typeof define=="function"&&define.amd?define(["san"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,n["@cosmic-design/san"]=o(n.san))})(this,function(n){"use strict";const o=["xs","sm","md","lg","xl","xxl"];var g={row:"cos-row",col:"cos-col"};function d(t,s){const i=t.size;return function(r){const e=t[r];if(typeof e=="object")for(const a in e)e.hasOwnProperty(a)&&(s[a][r]=e[a]);else s[i][r]=e}}class c extends n.Component{initData(){return{nativeAttributes:{},size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}return c.template=` | ||
<div class="${g.row}" style="{{rowStyle}}"> | ||
(function(n,o){typeof exports=="object"&&typeof module!="undefined"?module.exports=o(require("san")):typeof define=="function"&&define.amd?define(["san"],o):(n=typeof globalThis!="undefined"?globalThis:n||self,n["@cosmic-design/san"]=o(n.san))})(this,function(n){"use strict";const o=["xs","sm","md","lg","xl","xxl"];function g(t,s,i){return function(r){const e=t[r];if(typeof e=="object")for(const a in e)e.hasOwnProperty(a)&&(s[a][r]=e[a]);else s[i][r]=e}}var d={row:"cos-row",col:"cos-col"};class c extends n.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}return c.template=` | ||
<div class="${d.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,c.computed={responsive(){const t=this.data.get("size"),s=this.data.get("columns"),i=this.data.get("gutter"),r=this.data.get("align"),e=this.data.get("justify"),a=this.data.get("wrap"),u=o.reduce((l,f)=>(l[f]=this.data.get(f)||{},l),{});return["columns","gutter","align","justify","wrap"].forEach(d({size:t,columns:s,gutter:i,align:r,justify:e,wrap:a},u)),u},current(){const t=this.data.get("responsive"),s=this.data.get("size");return t[s]},rowStyle(){const t=this.data.get("current"),s={};if(t.gutter){const i=t.gutter/-2;Object.assign(s,{"margin-left":`${i}px`,"margin-right":`${i}px`})}return t.wrap&&Object.assign(s,{"flex-wrap":"wrap"}),t.justify&&Object.assign(s,{"justify-content":t.justify}),t.align&&Object.assign(s,{"align-items":t.align}),s}},c}); | ||
`,c.computed={responsive(){const t=this.data.get("size"),s=this.data.get("columns"),i=this.data.get("gutter"),r=this.data.get("align"),e=this.data.get("justify"),a=this.data.get("wrap"),l=o.reduce((u,f)=>(u[f]=this.data.get(f)||{},u),{});return["columns","gutter","align","justify","wrap"].forEach(g({columns:s,gutter:i,align:r,justify:e,wrap:a},l,t)),l},current(){const t=this.data.get("responsive"),s=this.data.get("size");return t[s]},rowStyle(){const t=this.data.get("current"),s={};if(t.gutter){const i=t.gutter/-2;Object.assign(s,{"margin-left":`${i}px`,"margin-right":`${i}px`})}return t.wrap&&Object.assign(s,{"flex-wrap":"wrap"}),t.justify&&Object.assign(s,{"justify-content":t.justify}),t.align&&Object.assign(s,{"align-items":t.align}),s}},c}); |
@@ -1,2 +0,2 @@ | ||
(function(n,l){typeof exports=="object"&&typeof module!="undefined"?l(exports,require("san")):typeof define=="function"&&define.amd?define(["exports","san"],l):(n=typeof globalThis!="undefined"?globalThis:n||self,l(n["@cosmic-design/san"]={},n.san))})(this,function(n,l){"use strict";var st="",v={button:"cos-button",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled","button-icon":"cos-button-icon",buttonIcon:"cos-button-icon","button-prefix":"cos-button-prefix",buttonPrefix:"cos-button-prefix","button-suffix":"cos-button-suffix",buttonSuffix:"cos-button-suffix","button-content":"cos-button-content",buttonContent:"cos-button-content",square:"cos-square",dashed:"cos-dashed",light:"cos-light",link:"cos-link",solid:"cos-solid",text:"cos-text"};class E extends l.Component{initData(){var t,e;return{name:void 0,value:void 0,type:"button",disabled:!1,hasPrefix:!!((t=this.sourceSlots)!=null&&t.named.prefix),hasSuffix:!!((e=this.sourceSlots)!=null&&e.named.suffix)}}click(t){this.fire("click",t);const e={event:t};this.dispatch("click:button",e)}}E.trimWhitespace="all",E.template=` | ||
(function(l,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("san")):typeof define=="function"&&define.amd?define(["exports","san"],n):(l=typeof globalThis!="undefined"?globalThis:l||self,n(l["@cosmic-design/san"]={},l.san))})(this,function(l,n){"use strict";var et="",v={button:"cos-button",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled","button-icon":"cos-button-icon",buttonIcon:"cos-button-icon","button-prefix":"cos-button-prefix",buttonPrefix:"cos-button-prefix","button-suffix":"cos-button-suffix",buttonSuffix:"cos-button-suffix","button-content":"cos-button-content",buttonContent:"cos-button-content",square:"cos-square",dashed:"cos-dashed",light:"cos-light",link:"cos-link",solid:"cos-solid",text:"cos-text"};class P extends n.Component{initData(){return{name:void 0,value:void 0,type:"button",disabled:!1}}click(t){this.fire("click",t)}}P.trimWhitespace="all",P.template=` | ||
<button | ||
@@ -11,14 +11,12 @@ class="${v.button} {{disabled ? 'cos-disabled' : ''}}" | ||
<slot name="prefix" class="${v.buttonPrefix}"></slot> | ||
<div class="${v.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot class="${v.buttonContent}"></slot> | ||
<slot name="suffix" class="${v.buttonSuffix}"></slot> | ||
</button> | ||
`;var U={horizontal:"cos-horizontal",vertical:"cos-vertical","slot-container":"cos-slot-container",slotContainer:"cos-slot-container"};class P extends l.Component{initData(){var e,s;const t=!!((s=(e=this.sourceSlots)==null?void 0:e.noname)!=null&&s.length)||0;return{nativeAttributes:{},direction:"horizontal",hasSlot:t>0}}}P.trimWhitespace="all",P.template=` | ||
`;var H={horizontal:"cos-horizontal",vertical:"cos-vertical","slot-container":"cos-slot-container",slotContainer:"cos-slot-container"};class N extends n.Component{initData(){var e,a;const t=!!((a=(e=this.sourceSlots)==null?void 0:e.noname)!=null&&a.length)||0;return{nativeAttributes:{},direction:"horizontal",hasSlot:t>0}}}N.trimWhitespace="all",N.template=` | ||
<div class="cos-{{direction}}"> | ||
<div s-if="hasSlot" class="${U.slotContainer}"> | ||
<div s-if="hasSlot" class="${H.slotContainer}"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
`;var p={paragraph:"cos-paragraph",md:"cos-md",xs:"cos-xs",sm:"cos-sm",lg:"cos-lg","paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:"cos-paragraph-nospacing","paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:"cos-paragraph-prefix","paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:"cos-paragraph-suffix"};class N extends l.Component{initData(){return{nativeAttributes:{},spacing:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}click(t){this.fire("click",t);const e={event:t};this.dispatch("click:paragraph",e)}}N.trimWhitespace="all",N.template=` | ||
`;var p={paragraph:"cos-paragraph",md:"cos-md",xs:"cos-xs",sm:"cos-sm",lg:"cos-lg","paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:"cos-paragraph-nospacing","paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:"cos-paragraph-prefix","paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:"cos-paragraph-suffix"};class W extends n.Component{initData(){return{spacing:!1}}click(t){this.fire("click",t)}}W.trimWhitespace="all",W.template=` | ||
<div | ||
@@ -29,11 +27,5 @@ s-if="!spacing" | ||
<p class="${p.paragraph}"> | ||
<span s-if="hasPrefix" class="${p.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${p.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${p.paragraphPrefix}"></slot> | ||
<slot class="${p.paragraphContent}"></slot> | ||
<slot name="suffix" class="${p.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -46,21 +38,15 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${p.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${p.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${p.paragraphPrefix}"></slot> | ||
<slot class="${p.paragraphContent}"></slot> | ||
<slot name="suffix" class="${p.paragraphSuffix}"></slot> | ||
</p> | ||
`;const _=["xs","sm","md","lg","xl","xxl"];var X={row:"cos-row",col:"cos-col"};function H(a,t){const e=a.size;return function(s){const i=a[s];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][s]=i[o]);else t[e][s]=i}}class x extends l.Component{initData(){var t,e,s;return{nativeAttributes:{},span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:(e=(t=this.parentComponent)==null?void 0:t.data.get("size"))!=null?e:"xs",rowCurrent:(s=this.parentComponent)==null?void 0:s.data.get("current")}}}x.trimWhitespace="all",x.template=` | ||
<div class="${X.col}" style="{{colStyle}}"> | ||
`;const z=["xs","sm","md","lg","xl","xxl"];function X(s,t,e){return function(a){const i=s[a];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][a]=i[o]);else t[e][a]=i}}var M={row:"cos-row",col:"cos-col"};class x extends n.Component{initData(){return{size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}x.template=` | ||
<div class="${M.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,x.computed={responsive(){const a=this.data.get("size"),t=this.data.get("span"),e=_.reduce((s,i)=>(s[i]=this.data.get(i)||{},s),{});return["span"].forEach(H({size:a,span:t},e)),e},colStyle(){const a=this.data.get("span"),t=this.data.get("rowCurrent"),e={"box-sizing":"border-box"};if(t&&t.gutter){const s=t.gutter/2;Object.assign(e,{"padding-left":`${s}px`,"padding-right":`${s}px`})}if(t&&t.columns&&a){const s=+a/+t.columns*100;Object.assign(e,{flex:"0 0 auto",width:`${s}%`})}return e}};function V(a,t){const e=a.size;return function(s){const i=a[s];if(typeof i=="object")for(const o in i)i.hasOwnProperty(o)&&(t[o][s]=i[o]);else t[e][s]=i}}class O extends l.Component{initData(){return{nativeAttributes:{},size:"xs",scope:"self",columns:void 0,gutter:0,align:void 0,justify:void 0,wrap:!1,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{}}}}O.template=` | ||
<div class="${X.row}" style="{{rowStyle}}"> | ||
`,x.computed={responsive(){const s=this.data.get("size"),t=this.data.get("columns"),e=this.data.get("gutter"),a=this.data.get("align"),i=this.data.get("justify"),o=this.data.get("wrap"),c=z.reduce((r,d)=>(r[d]=this.data.get(d)||{},r),{});return["columns","gutter","align","justify","wrap"].forEach(X({columns:t,gutter:e,align:a,justify:i,wrap:o},c,s)),c},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},rowStyle(){const s=this.data.get("current"),t={};if(s.gutter){const e=s.gutter/-2;Object.assign(t,{"margin-left":`${e}px`,"margin-right":`${e}px`})}return s.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),s.justify&&Object.assign(t,{"justify-content":s.justify}),s.align&&Object.assign(t,{"align-items":s.align}),t}};class w extends n.Component{initData(){return{span:void 0,xs:{},sm:{},md:{},lg:{},xl:{},xxl:{},size:"xs",rowCurrent:void 0}}inited(){let t=this.parent;for(;t&&!(t instanceof x);)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}w.trimWhitespace="all",w.template=` | ||
<div class="${M.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,O.computed={responsive(){const a=this.data.get("size"),t=this.data.get("columns"),e=this.data.get("gutter"),s=this.data.get("align"),i=this.data.get("justify"),o=this.data.get("wrap"),c=_.reduce((r,d)=>(r[d]=this.data.get(d)||{},r),{});return["columns","gutter","align","justify","wrap"].forEach(V({size:a,columns:t,gutter:e,align:s,justify:i,wrap:o},c)),c},current(){const a=this.data.get("responsive"),t=this.data.get("size");return a[t]},rowStyle(){const a=this.data.get("current"),t={};if(a.gutter){const e=a.gutter/-2;Object.assign(t,{"margin-left":`${e}px`,"margin-right":`${e}px`})}return a.wrap&&Object.assign(t,{"flex-wrap":"wrap"}),a.justify&&Object.assign(t,{"justify-content":a.justify}),a.align&&Object.assign(t,{"align-items":a.align}),t}};var h={swiper:"cos-swiper -v-text -v-border-none rounded","swiper-container":"cos-swiper-container",swiperContainer:"cos-swiper-container","swiper-arrow":"cos-swiper-arrow -v-bg-light -v-color-primary",swiperArrow:"cos-swiper-arrow -v-bg-light -v-color-primary","swiper-arrow-left":"cos-swiper-arrow-left",swiperArrowLeft:"cos-swiper-arrow-left","swiper-arrow-right":"cos-swiper-arrow-right",swiperArrowRight:"cos-swiper-arrow-right","swiper-indicator":"cos-swiper-indicator",swiperIndicator:"cos-swiper-indicator",dot:"cos-dot",active:"cos-active",line:"cos-line","swiper-item":"cos-swiper-item",swiperItem:"cos-swiper-item",light:"cos-light"};class w extends l.Component{constructor(){super(...arguments),this.lastTime=0,this.touchStartTime=0,this.touchDuration=0,this.startX=0,this.startY=0,this.disX=0,this.disY=0,this.speedThreshold=.23}initData(){return{nativeAttributes:{},autoplay:!0,interval:3e3,height:"200",arrow:"hover",items:[],prevIcon:"left",nextIcon:"right",activeIndex:0,indicator:!0,loop:!0,allowTouch:!1,indicatorType:"dot",indicatorColor:["",""],transition:"slide",direction:"horizontal",trigger:"hover",indicatorAlign:"center"}}inited(){this.data.set("items",[])}handleTouchStart(t){this.pauseTimer(),(t==null?void 0:t.changedTouches.length)===1&&(this.touchStartTime=new Date().getTime(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY)}handleTouchMove(t){if(t.changedTouches.length!==1)return!0;const e=t.touches[0].clientX,s=t.touches[0].clientY,i=e-this.startX,o=s-this.startY,c=this.getDirection(i,o);return(c===1||c===2)&&(t.cancelable&&t.preventDefault(),t.stopPropagation(),this.disX=i),!0}getDirection(t,e){let s=0;if(Math.abs(t)<2&&Math.abs(e)<2)return s;const i=this.getAngle(t,e);return i>=135&&i<=180||i>=-180&&i<-135?s=1:i>=-45&&i<=45&&(s=2),s}getAngle(t,e){return Math.atan2(e,t)*180/Math.PI}handleTouchEnd(t){var r;if((t==null?void 0:t.changedTouches.length)!==1)return;const e=new Date().getTime();this.touchDuration=e-this.touchStartTime;const s=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;this.disX=s-this.startX,this.disY=i-this.startY;const o=Math.abs(this.disX/this.touchDuration),c=((r=this.el)==null?void 0:r.scrollWidth)||844;o>=this.speedThreshold?this.move():Math.abs(this.disX)>c/2&&this.move()}move(){if(!this.data.get("allowTouch"))return;const e=this.data.get("activeIndex");this.disX>0?this.prevClick(e-1):this.nextClick(e+1),this.startTimer()}prevClick(t){this.arrowClick(t),this.fire("prev-click",t)}nextClick(t){this.arrowClick(t),this.fire("next-click",t)}arrowClick(t){const e=Number(new Date);(e-this.lastTime>400||!this.lastTime)&&(this.lastTime=e,this.setActiveItem(t))}attached(){this.watch("activeIndex",t=>{this.resetItemPosition(),this.fire("change",t)}),this.startTimer()}detached(){this.data.set("activeIndex",0),this.pauseTimer()}setActiveItem(t){const e=this.data.get("items"),s=this.data.get("loop"),i=e.length;t<0?s?this.data.set("activeIndex",i-1):this.data.set("activeIndex",0):t>=i?s?this.data.set("activeIndex",0):this.data.set("activeIndex",i-1):this.data.set("activeIndex",t)}handleMouseEnter(){this.pauseTimer()}handleMouseLeave(){this.startTimer()}handleIndicatorClick(t){this.data.set("activeIndex",t)}handleIndicatorHover(t){this.data.get("trigger")==="hover"&&t!==this.data.get("activeIndex")&&this.data.set("activeIndex",t)}resetItemPosition(){this.data.get("items").forEach((e,s)=>{this.translateItem(e,s,this.data.get("activeIndex"))})}translateItem(t,e,s){const i=this.data.get("items"),o=t.el.parentNode.offsetWidth,c=i.length;let r=e;r!==s&&c>2&&(r=this.resetIndex(r,s,c)),t.data.set("active",r===s),t.data.set("translate",o*(r-s)),t.data.set("ready",!0)}resetIndex(t,e,s){return e===0&&t===s-1?-1:e===s-1&&t===0?s:t<e-1&&e-t>=s/2?s+1:t>e+1&&t-e>=s/2?-2:t}pauseTimer(){this.timer&&clearInterval(this.timer),this.timer=null}startTimer(){const t=this.data.get("interval"),e=this.data.get("autoplay");t<=0||!e||(this.timer=setInterval(()=>{this.playSlides()},t))}playSlides(){const t=this.data.get("items");let e=this.data.get("activeIndex");e<t.length-1?this.data.set("activeIndex",e+=1):this.data.set("activeIndex",0)}click(t){this.fire("click",t)}}w.trimWhitespace="all",w.template=` | ||
`,w.computed={responsive(){const s=this.data.get("size"),t=this.data.get("span"),e=z.reduce((a,i)=>(a[i]=this.data.get(i)||{},a),{});return["span"].forEach(X({span:t},e,s)),e},current(){const s=this.data.get("responsive"),t=this.data.get("size");return s[t]},colStyle(){const s=this.data.get("current"),t=s&&s.span,e=this.data.get("rowCurrent"),a={"box-sizing":"border-box"};if(e&&e.gutter){const i=e.gutter/2;Object.assign(a,{"padding-left":`${i}px`,"padding-right":`${i}px`})}if(e&&e.columns&&t){const i=+t/+e.columns*100;Object.assign(a,{flex:"0 0 auto",width:`${i}%`})}return a}};var h={swiper:"cos-swiper -v-text -v-border-none rounded","swiper-container":"cos-swiper-container",swiperContainer:"cos-swiper-container","swiper-arrow":"cos-swiper-arrow -v-bg-light -v-color-primary",swiperArrow:"cos-swiper-arrow -v-bg-light -v-color-primary","swiper-arrow-left":"cos-swiper-arrow-left",swiperArrowLeft:"cos-swiper-arrow-left","swiper-arrow-right":"cos-swiper-arrow-right",swiperArrowRight:"cos-swiper-arrow-right","swiper-indicator":"cos-swiper-indicator",swiperIndicator:"cos-swiper-indicator",dot:"cos-dot",active:"cos-active",line:"cos-line","swiper-item":"cos-swiper-item",swiperItem:"cos-swiper-item",light:"cos-light"};class $ extends n.Component{constructor(){super(...arguments),this.lastTime=0,this.touchStartTime=0,this.touchDuration=0,this.startX=0,this.startY=0,this.disX=0,this.disY=0,this.speedThreshold=.23}initData(){return{nativeAttributes:{},autoplay:!0,interval:3e3,height:"200",arrow:"hover",items:[],prevIcon:"left",nextIcon:"right",activeIndex:0,indicator:!0,loop:!0,allowTouch:!1,indicatorType:"dot",indicatorColor:["",""],transition:"slide",direction:"horizontal",trigger:"hover",indicatorAlign:"center"}}inited(){this.data.set("items",[])}handleTouchStart(t){this.pauseTimer(),(t==null?void 0:t.changedTouches.length)===1&&(this.touchStartTime=new Date().getTime(),this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY)}handleTouchMove(t){if(t.changedTouches.length!==1)return!0;const e=t.touches[0].clientX,a=t.touches[0].clientY,i=e-this.startX,o=a-this.startY,c=this.getDirection(i,o);return(c===1||c===2)&&(t.cancelable&&t.preventDefault(),t.stopPropagation(),this.disX=i),!0}getDirection(t,e){let a=0;if(Math.abs(t)<2&&Math.abs(e)<2)return a;const i=this.getAngle(t,e);return i>=135&&i<=180||i>=-180&&i<-135?a=1:i>=-45&&i<=45&&(a=2),a}getAngle(t,e){return Math.atan2(e,t)*180/Math.PI}handleTouchEnd(t){var r;if((t==null?void 0:t.changedTouches.length)!==1)return;const e=new Date().getTime();this.touchDuration=e-this.touchStartTime;const a=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;this.disX=a-this.startX,this.disY=i-this.startY;const o=Math.abs(this.disX/this.touchDuration),c=((r=this.el)==null?void 0:r.scrollWidth)||844;o>=this.speedThreshold?this.move():Math.abs(this.disX)>c/2&&this.move()}move(){if(!this.data.get("allowTouch"))return;const e=this.data.get("activeIndex");this.disX>0?this.prevClick(e-1):this.nextClick(e+1),this.startTimer()}prevClick(t){this.arrowClick(t),this.fire("prev-click",t)}nextClick(t){this.arrowClick(t),this.fire("next-click",t)}arrowClick(t){const e=Number(new Date);(e-this.lastTime>400||!this.lastTime)&&(this.lastTime=e,this.setActiveItem(t))}attached(){this.watch("activeIndex",t=>{this.resetItemPosition(),this.fire("change",t)}),this.startTimer()}detached(){this.data.set("activeIndex",0),this.pauseTimer()}setActiveItem(t){const e=this.data.get("items"),a=this.data.get("loop"),i=e.length;t<0?a?this.data.set("activeIndex",i-1):this.data.set("activeIndex",0):t>=i?a?this.data.set("activeIndex",0):this.data.set("activeIndex",i-1):this.data.set("activeIndex",t)}handleMouseEnter(){this.pauseTimer()}handleMouseLeave(){this.startTimer()}handleIndicatorClick(t){this.data.set("activeIndex",t)}handleIndicatorHover(t){this.data.get("trigger")==="hover"&&t!==this.data.get("activeIndex")&&this.data.set("activeIndex",t)}resetItemPosition(){this.data.get("items").forEach((e,a)=>{this.translateItem(e,a,this.data.get("activeIndex"))})}translateItem(t,e,a){const i=this.data.get("items"),o=t.el.parentNode.offsetWidth,c=i.length;let r=e;r!==a&&c>2&&(r=this.resetIndex(r,a,c)),t.data.set("active",r===a),t.data.set("translate",o*(r-a)),t.data.set("ready",!0)}resetIndex(t,e,a){return e===0&&t===a-1?-1:e===a-1&&t===0?a:t<e-1&&e-t>=a/2?a+1:t>e+1&&t-e>=a/2?-2:t}pauseTimer(){this.timer&&clearInterval(this.timer),this.timer=null}startTimer(){const t=this.data.get("interval"),e=this.data.get("autoplay");t<=0||!e||(this.timer=setInterval(()=>{this.playSlides()},t))}playSlides(){const t=this.data.get("items");let e=this.data.get("activeIndex");e<t.length-1?this.data.set("activeIndex",e+=1):this.data.set("activeIndex",0)}click(t){this.fire("click",t)}}$.trimWhitespace="all",$.template=` | ||
<div | ||
@@ -106,3 +92,3 @@ class="${h.swiper}" | ||
</div> | ||
`,w.messages={"UI:swiper-item-attached"(a){const t=this.data.get("items");t.push(a.target),this.translateItem(a.target,t.length-1,this.data.get("activeIndex"))},"UI:swiper-item-detached"(a){const t=this.data.get("items");let e=t.length;for(;e--;)t[e]===a.target&&t.splice(e,1)}};class W extends l.Component{initData(){return{nativeAttributes:{},translate:0,active:!1,ready:!1}}attached(){this.dispatch("UI:swiper-item-attached")}detached(){this.dispatch("UI:swiper-item-detached")}}W.trimWhitespace="all",W.template=` | ||
`,$.messages={"UI:swiper-item-attached"(s){const t=this.data.get("items");t.push(s.target),this.translateItem(s.target,t.length-1,this.data.get("activeIndex"))},"UI:swiper-item-detached"(s){const t=this.data.get("items");let e=t.length;for(;e--;)t[e]===s.target&&t.splice(e,1)}};class O extends n.Component{initData(){return{nativeAttributes:{},translate:0,active:!1,ready:!1}}attached(){this.dispatch("UI:swiper-item-attached")}detached(){this.dispatch("UI:swiper-item-detached")}}O.trimWhitespace="all",O.template=` | ||
<div | ||
@@ -116,14 +102,14 @@ s-if="ready" | ||
</div> | ||
`;var $={image:"cos-image","image-placeholder":"cos-image-placeholder",imagePlaceholder:"cos-image-placeholder","image-fallback":"cos-image-fallback",imageFallback:"cos-image-fallback","image-content":"cos-image-content",imageContent:"cos-image-content"};class I extends l.Component{initData(){return{nativeAttributes:{},src:"",alt:"",width:void 0,height:void 0,objectFit:"fill",hasPlaceholder:!!this.sourceSlots.named.placeholder,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,loading:!0,error:!1}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const e={event:t};this.dispatch("click:image",e)}onTouchmove(t){this.fire("touchmove",t);const e={event:t};this.dispatch("touchmove:image",e)}}I.trimWhitespace="all",I.template=` | ||
`;var I={image:"cos-image","image-placeholder":"cos-image-placeholder",imagePlaceholder:"cos-image-placeholder","image-fallback":"cos-image-fallback",imageFallback:"cos-image-fallback","image-content":"cos-image-content",imageContent:"cos-image-content"};class T extends n.Component{initData(){return{nativeAttributes:{},src:"",alt:"",width:void 0,height:void 0,objectFit:"fill",hasPlaceholder:!!this.sourceSlots.named.placeholder,hasFallback:!!this.sourceSlots.named.fallback,hasContent:!!this.sourceSlots.named.content,loading:!0,error:!1}}onLoad(t){this.data.set("loading",!1),this.data.set("error",!1),this.fire("load",t)}onError(t){this.data.set("loading",!1),this.data.set("error",!0),this.fire("error",t)}onClick(t){this.fire("click",t);const e={event:t};this.dispatch("click:image",e)}onTouchmove(t){this.fire("touchmove",t);const e={event:t};this.dispatch("touchmove:image",e)}}T.trimWhitespace="all",T.template=` | ||
<div | ||
class="${$.image}" | ||
class="${I.image}" | ||
on-click="onClick" | ||
on-touchmove="onTouchmove"> | ||
<div s-if="hasContent" class="${$.imageContent}"> | ||
<div s-if="hasContent" class="${I.imageContent}"> | ||
<slot name="content"></slot> | ||
</div> | ||
<div s-if="hasPlaceholder && loading" class="${$.imagePlaceholder}"> | ||
<div s-if="hasPlaceholder && loading" class="${I.imagePlaceholder}"> | ||
<slot name="placeholder"></slot> | ||
</div> | ||
<div s-if="hasFallback && error" class="${$.imageFallback}"> | ||
<div s-if="hasFallback && error" class="${I.imageFallback}"> | ||
<slot name="fallback"></slot> | ||
@@ -142,3 +128,3 @@ </div> | ||
</div> | ||
`,I.computed={objectFitValue(){const a="object-fit:",t=this.data.get("objectFit");return t&&["fill","contain","cover","none","scale-down"].indexOf(t)!==-1?`${a}${t};`:""}};var m={root:"cos-root -v-bg-inapparent -v-h -v-px -v-text",active:"cos-active",prefix:"cos-prefix",input:"cos-input","input-wrapper":"cos-input-wrapper",inputWrapper:"cos-input-wrapper","input-real":"cos-input-real -v-text",inputReal:"cos-input-real -v-text","input-prefix":"cos-input-prefix",inputPrefix:"cos-input-prefix","input-suffix":"cos-input-suffix",inputSuffix:"cos-input-suffix"};class M extends l.Component{initData(){return{nativeAttributes:{},value:"",placeholder:"",disabled:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}handleInput(t){const e=this.data.get("value");this.fire("input",e);const s={event:t,value:e};this.dispatch("input:input",s)}handleChange(t){const e=this.data.get("value");this.fire("change",e);const s={event:t,value:e};this.dispatch("change:input",s)}}M.template=` | ||
`,T.computed={objectFitValue(){const s="object-fit:",t=this.data.get("objectFit");return t&&["fill","contain","cover","none","scale-down"].indexOf(t)!==-1?`${s}${t};`:""}};var m={root:"cos-root -v-bg-inapparent -v-h -v-px -v-text",active:"cos-active",prefix:"cos-prefix",input:"cos-input","input-wrapper":"cos-input-wrapper",inputWrapper:"cos-input-wrapper","input-real":"cos-input-real -v-text",inputReal:"cos-input-real -v-text","input-prefix":"cos-input-prefix",inputPrefix:"cos-input-prefix","input-suffix":"cos-input-suffix",inputSuffix:"cos-input-suffix"};class R extends n.Component{initData(){return{nativeAttributes:{},value:"",placeholder:"",disabled:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}handleInput(t){const e=this.data.get("value");this.fire("input",e);const a={event:t,value:e};this.dispatch("input:input",a)}handleChange(t){const e=this.data.get("value");this.fire("change",e);const a={event:t,value:e};this.dispatch("change:input",a)}}R.template=` | ||
<div class="${m.input}"> | ||
@@ -170,3 +156,3 @@ <div | ||
</div> | ||
`;var u={tabs:"cos-tabs","tabs-nav":"cos-tabs-nav",tabsNav:"cos-tabs-nav","tabs-nav-item":"cos-tabs-nav-item",tabsNavItem:"cos-tabs-nav-item","tabs-divider":"cos-tabs-divider",tabsDivider:"cos-tabs-divider","tabs-cursor":"cos-tabs-cursor",tabsCursor:"cos-tabs-cursor",selected:"cos-selected","tabs-item":"cos-tabs-item relative -v-px -v-py -v-text rounded",tabsItem:"cos-tabs-item relative -v-px -v-py -v-text rounded",hover:"cos-hover",active:"cos-active"};class T extends l.Component{initData(){return{nativeAttributes:{},index:0,animated:!1,paneList:[],labelList:[],cursorWidth:0,cursorLeft:0}}inited(){var s,i;const t=[];(i=(s=this==null?void 0:this.sourceSlots)==null?void 0:s.noname)==null||i.forEach(o=>{o&&o.tagName&&o.tagName.indexOf("cos-tabs-item")!==-1&&t.push(o)});const e=[];t.forEach(o=>{var c;(c=o==null?void 0:o.props)==null||c.forEach(r=>{r.name==="label"&&e.push({text:r.expr.value})})}),this.data.set("labelList",e)}attached(){var c,r,d,b,R;const t=[];(R=(b=(d=(r=(c=this==null?void 0:this.children)==null?void 0:c[1])==null?void 0:r.children)==null?void 0:d[0])==null?void 0:b.children)==null||R.forEach(A=>{A.constructor.name==="TabsItem"&&t.push(A)}),this.data.set("paneList",t);const e=this.data.get("index"),s=this.data.get("labelList"),i=this;let o=0;s.forEach((A,B)=>{var Y;const F=(Y=i.ref("label"+B))==null?void 0:Y.offsetWidth;A.width=F,e===B&&(o=F)}),this.data.set("labelList",s),this.data.set("cursorWidth",o)}handleLabelClick(t,e,s){this.fire("tab-click",{index:e,label:t.text});let i={event:s,index:e,label:t.text};if(this.dispatch("tab-click:tabs",i),this.data.get("index")===e)return;this.data.set("index",e),this.data.get("paneList").forEach((d,b)=>{d.setPaneShow(b===e)});let o=0,c=0;this.data.get("labelList").forEach((d,b)=>{if(b<e){o+=(d==null?void 0:d.width)||0;return}b===e&&(c=(d==null?void 0:d.width)||0)}),this.data.set("cursorLeft",o),this.data.set("cursorWidth",c),this.fire("change",{index:e,label:t.text}),i={event:s,index:e,label:t.text},this.dispatch("change:tabs",i)}}T.trimWhitespace="all",T.template=` | ||
`;var u={tabs:"cos-tabs","tabs-nav":"cos-tabs-nav",tabsNav:"cos-tabs-nav","tabs-nav-item":"cos-tabs-nav-item",tabsNavItem:"cos-tabs-nav-item","tabs-divider":"cos-tabs-divider",tabsDivider:"cos-tabs-divider","tabs-cursor":"cos-tabs-cursor",tabsCursor:"cos-tabs-cursor",selected:"cos-selected","tabs-item":"cos-tabs-item relative -v-px -v-py -v-text rounded",tabsItem:"cos-tabs-item relative -v-px -v-py -v-text rounded",hover:"cos-hover",active:"cos-active"};class y extends n.Component{initData(){return{nativeAttributes:{},index:0,animated:!1,paneList:[],labelList:[],cursorWidth:0,cursorLeft:0}}inited(){var a,i;const t=[];(i=(a=this==null?void 0:this.sourceSlots)==null?void 0:a.noname)==null||i.forEach(o=>{o&&o.tagName&&o.tagName.indexOf("cos-tabs-item")!==-1&&t.push(o)});const e=[];t.forEach(o=>{var c;(c=o==null?void 0:o.props)==null||c.forEach(r=>{r.name==="label"&&e.push({text:r.expr.value})})}),this.data.set("labelList",e)}attached(){var c,r,d,g,B;const t=[];(B=(g=(d=(r=(c=this==null?void 0:this.children)==null?void 0:c[1])==null?void 0:r.children)==null?void 0:d[0])==null?void 0:g.children)==null||B.forEach(E=>{E.constructor.name==="TabsItem"&&t.push(E)}),this.data.set("paneList",t);const e=this.data.get("index"),a=this.data.get("labelList"),i=this;let o=0;a.forEach((E,F)=>{var U;const Y=(U=i.ref("label"+F))==null?void 0:U.offsetWidth;E.width=Y,e===F&&(o=Y)}),this.data.set("labelList",a),this.data.set("cursorWidth",o)}handleLabelClick(t,e,a){this.fire("tab-click",{index:e,label:t.text});let i={event:a,index:e,label:t.text};if(this.dispatch("tab-click:tabs",i),this.data.get("index")===e)return;this.data.set("index",e),this.data.get("paneList").forEach((d,g)=>{d.setPaneShow(g===e)});let o=0,c=0;this.data.get("labelList").forEach((d,g)=>{if(g<e){o+=(d==null?void 0:d.width)||0;return}g===e&&(c=(d==null?void 0:d.width)||0)}),this.data.set("cursorLeft",o),this.data.set("cursorWidth",c),this.fire("change",{index:e,label:t.text}),i={event:a,index:e,label:t.text},this.dispatch("change:tabs",i)}}y.trimWhitespace="all",y.template=` | ||
<div class="${u.tabs}"> | ||
@@ -196,3 +182,3 @@ <div class="${u.tabsNav}"> | ||
</div> | ||
`,T.computed={cursorStyle(){const a=this.data.get("cursorLeft"),t=this.data.get("cursorWidth");return`left: ${a}px; width: ${t}px`}};class j extends l.Component{initData(){return{nativeAttributes:{},label:"",active:!1}}inited(){var s,i,o,c;const t=(i=(s=this.parentComponent)==null?void 0:s.data)==null?void 0:i.raw;((c=(o=t==null?void 0:t.labelList)==null?void 0:o[t==null?void 0:t.index])==null?void 0:c.text)===this.data.get("label")&&this.data.set("active",!0)}setPaneShow(t){this.data.set("active",t)}}j.trimWhitespace="all",j.template=` | ||
`,y.computed={cursorStyle(){const s=this.data.get("cursorLeft"),t=this.data.get("cursorWidth");return`left: ${s}px; width: ${t}px`}};class j extends n.Component{initData(){return{nativeAttributes:{},label:"",active:!1}}inited(){var a,i,o,c;const t=(i=(a=this.parentComponent)==null?void 0:a.data)==null?void 0:i.raw;((c=(o=t==null?void 0:t.labelList)==null?void 0:o[t==null?void 0:t.index])==null?void 0:c.text)===this.data.get("label")&&this.data.set("active",!0)}setPaneShow(t){this.data.set("active",t)}}j.trimWhitespace="all",j.template=` | ||
<div | ||
@@ -205,4 +191,4 @@ s-show="active" | ||
</div> | ||
`;var g={table:"cos-table",thead:"cos-thead",th:"cos-th",td:"cos-td",xs:"cos-xs",icon:"cos-icon",sm:"cos-sm",md:"cos-md",lg:"cos-lg",xl:"cos-xl",xxl:"cos-xxl",tr:"cos-tr",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled"};class y extends l.Component{initData(){return{selectable:""}}attached(){!this.data.get("selectable")||this.thead&&this.thead.updateSelectAllState(this.isAllSelected())}isAllSelected(){var s;const t=((s=this==null?void 0:this.tbody)==null?void 0:s.findChildTRs())||[];let e=!0;if((t==null?void 0:t.length)>0){for(let i=0,o=t==null?void 0:t.length;i<o;i++)if(!t[i].data.get("selected")){e=!1;break}}else e=!1;return e}}y.template=` | ||
<table class="${g.table}"> | ||
`;var b={table:"cos-table",thead:"cos-thead",th:"cos-th",td:"cos-td",xs:"cos-xs",icon:"cos-icon",sm:"cos-sm",md:"cos-md",lg:"cos-lg",xl:"cos-xl",xxl:"cos-xxl",tr:"cos-tr",hover:"cos-hover",active:"cos-active",disabled:"cos-disabled"};class C extends n.Component{initData(){return{selectable:""}}attached(){!this.data.get("selectable")||this.thead&&this.thead.updateSelectAllState(this.isAllSelected())}isAllSelected(){var a;const t=((a=this==null?void 0:this.tbody)==null?void 0:a.findChildTRs())||[];let e=!0;if((t==null?void 0:t.length)>0){for(let i=0,o=t==null?void 0:t.length;i<o;i++)if(!t[i].data.get("selected")){e=!1;break}}else e=!1;return e}}C.template=` | ||
<table class="${b.table}"> | ||
<slot name="header"></slot> | ||
@@ -212,19 +198,19 @@ <slot></slot> | ||
</table> | ||
`,y.messages={"UI:tbody-inited"(a){var t;this.tbody=a.target,(t=a==null?void 0:a.target)==null||t.data.set("tableSelectable",this.data.get("selectable"))},"UI:thead-inited"(a){var t,e;this.thead=a.target,(e=(t=a==null?void 0:a.target)==null?void 0:t.data)==null||e.set("tableSelectable",this.data.get("selectable"))},"select:table-select-head"(a){var s;let t=[];const e=a.value;(s=this==null?void 0:this.tbody)==null||s.eachItem((i,o)=>{i.data.get("disabled")?i.data.get("selected")&&t.push(o):(i.data.set("selected",e),e&&t.push(o))}),this.fire("select",t)},"select:table-select-body"(a){this.thead&&this.thead.updateSelectAllState(this.isAllSelected()),this.fire("select",a.value)},"click:table-tbody-tr"(a){this.fire("click",a.value)}};const q="UI:thead-inited";class C extends l.Component{inited(){this.dispatch(q,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}C.template=` | ||
<thead class="${g.thead}"><slot></slot></thead> | ||
`,C.messages={"UI:tr-inited"(a){var t,e;(t=a.target)==null||t.data.set("pos","thead"),(e=a.target)==null||e.data.set("tableSelectable",this.data.get("tableSelectable")),this.tr=a.target}};const K="UI:tfoot-inited";class z extends l.Component{inited(){this.dispatch(K,null)}}z.template=` | ||
`,C.messages={"UI:tbody-inited"(s){var t;this.tbody=s.target,(t=s==null?void 0:s.target)==null||t.data.set("tableSelectable",this.data.get("selectable"))},"UI:thead-inited"(s){var t,e;this.thead=s.target,(e=(t=s==null?void 0:s.target)==null?void 0:t.data)==null||e.set("tableSelectable",this.data.get("selectable"))},"select:table-select-head"(s){var a;let t=[];const e=s.value;(a=this==null?void 0:this.tbody)==null||a.eachItem((i,o)=>{i.data.get("disabled")?i.data.get("selected")&&t.push(o):(i.data.set("selected",e),e&&t.push(o))}),this.fire("select",t)},"select:table-select-body"(s){this.thead&&this.thead.updateSelectAllState(this.isAllSelected()),this.fire("select",s.value)},"click:table-tbody-tr"(s){this.fire("click",s.value)}};const q="UI:thead-inited";class k extends n.Component{inited(){this.dispatch(q,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}k.template=` | ||
<thead class="${b.thead}"><slot></slot></thead> | ||
`,k.messages={"UI:tr-inited"(s){var t,e;(t=s.target)==null||t.data.set("pos","thead"),(e=s.target)==null||e.data.set("tableSelectable",this.data.get("tableSelectable")),this.tr=s.target}};const V="UI:tfoot-inited";class _ extends n.Component{inited(){this.dispatch(V,null)}}_.template=` | ||
<tfoot> | ||
<slot></slot> | ||
</tfoot> | ||
`,z.messages={"click:table-tfoot-item"(){this.fire("click")}};class S extends l.Component{initData(){return{colspan:1}}}S.template=` | ||
<td san-if="colspan !== 1" colspan="{{colspan}}" class="${g.td}"> | ||
`,_.messages={"click:table-tfoot-item"(){this.fire("click")}};class S extends n.Component{initData(){return{colspan:1}}}S.template=` | ||
<td san-if="colspan !== 1" colspan="{{colspan}}" class="${b.td}"> | ||
<slot></slot> | ||
</td> | ||
<td san-else class="${g.td}"> | ||
<td san-else class="${b.td}"> | ||
<slot></slot> | ||
</td> | ||
`;class k extends l.Component{initData(){return{width:""}}}k.template=` | ||
<th width="{{width}}" class="${g.th}"><slot></slot></th> | ||
`;const G="UI:tr-inited",J="click:table-tfoot-item",Q="click:table-tbody-item";class f extends l.Component{constructor(){super(...arguments),this.tag=Number(Math.random()+Date.now())}initData(){return{selected:!1,pos:"tbody",tableSelectable:"single"}}inited(){this.dispatch(G,null)}select(){const t=this.data.get("selected"),e=this.data.get("pos");this.data.set("selected",!t),this.dispatch(`select:table-select-${e==="tbody"?"item":"head"}`,!t)}handleClick(){var s,i,o;if(((s=this==null?void 0:this.parentComponent)==null?void 0:s.tagName)==="thead")return;if(((i=this==null?void 0:this.parentComponent)==null?void 0:i.tagName)==="tfoot"){this.dispatch(J,"tfoot");return}const t=((o=this==null?void 0:this.parent)==null?void 0:o.children)||[];let e=0;t.forEach((c,r)=>{this.tag===c.tag&&(e=r)}),this.dispatch(Q,e)}}f.template=` | ||
<tr class="${g.tr}" on-click="handleClick($event)"> | ||
`;class L extends n.Component{initData(){return{width:""}}}L.template=` | ||
<th width="{{width}}" class="${b.th}"><slot></slot></th> | ||
`;const K="UI:tr-inited",G="click:table-tfoot-item",J="click:table-tbody-item";class f extends n.Component{constructor(){super(...arguments),this.tag=Number(Math.random()+Date.now())}initData(){return{selected:!1,pos:"tbody",tableSelectable:"single"}}inited(){this.dispatch(K,null)}select(){const t=this.data.get("selected"),e=this.data.get("pos");this.data.set("selected",!t),this.dispatch(`select:table-select-${e==="tbody"?"item":"head"}`,!t)}handleClick(){var a,i,o;if(((a=this==null?void 0:this.parentComponent)==null?void 0:a.tagName)==="thead")return;if(((i=this==null?void 0:this.parentComponent)==null?void 0:i.tagName)==="tfoot"){this.dispatch(G,"tfoot");return}const t=((o=this==null?void 0:this.parent)==null?void 0:o.children)||[];let e=0;t.forEach((c,r)=>{this.tag===c.tag&&(e=r)}),this.dispatch(J,e)}}f.template=` | ||
<tr class="${b.tr}" on-click="handleClick($event)"> | ||
<cc-th | ||
@@ -256,7 +242,7 @@ s-if="tableSelectable === 'multi'"> | ||
</tr> | ||
`,f.components={"cc-td":S,"cc-th":k},f.computed={checked(){const a=this.data.get("selected");switch(this.data.get("tableSelectable")){case"single":return a?"ON":"";case"multi":return a?["ON"]:[""]}}},f.dataTypes={selected:l.DataTypes.bool,pos:l.DataTypes.oneOf(["tbody","thead","tfoot"])};const Z="select:table-select-body",tt="click:table-tbody-tr",et="UI:tbody-inited";class L extends l.Component{initData(){return{}}inited(){this.dispatch(et,null)}eachItem(t){this.findChildTRs().forEach((e,s)=>{t.call(this,e,s),s++})}findChildTRs(){let t=[];function e(s){s instanceof f?t.push(s):s.children&&s.children.forEach(i=>{e(i)})}return e(this),t}}L.template=` | ||
`,f.components={"cc-td":S,"cc-th":L},f.computed={checked(){const s=this.data.get("selected");switch(this.data.get("tableSelectable")){case"single":return s?"ON":"";case"multi":return s?["ON"]:[""]}}},f.dataTypes={selected:n.DataTypes.bool,pos:n.DataTypes.oneOf(["tbody","thead","tfoot"])};const Q="select:table-select-body",Z="click:table-tbody-tr",tt="UI:tbody-inited";class D extends n.Component{initData(){return{}}inited(){this.dispatch(tt,null)}eachItem(t){this.findChildTRs().forEach((e,a)=>{t.call(this,e,a),a++})}findChildTRs(){let t=[];function e(a){a instanceof f?t.push(a):a.children&&a.children.forEach(i=>{e(i)})}return e(this),t}}D.template=` | ||
<tbody> | ||
<slot></slot> | ||
</tbody> | ||
`,L.messages={"UI:tr-inited"(a){var e,s;let t=(a==null?void 0:a.target)||null;(e=t==null?void 0:t.data)==null||e.set("pos","tbody"),(s=t==null?void 0:t.data)==null||s.set("tableSelectable",this.data.get("tableSelectable"))},"select:table-select-item"(a){let t=this.data.get("tableSelectable"),e=1;switch(t){case"single":this.eachItem((s,i)=>{let o=s===a.target;s.data.set("selected",o),o&&(e=i)});break;case"multi":e=[],this.eachItem((s,i)=>{s.data.get("selected")&&e.push(i)});break}this.dispatch(Z,e)},"click:table-tbody-item"(a){this.dispatch(tt,a.value)}};class D extends l.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}D.template=` | ||
`,D.messages={"UI:tr-inited"(s){var e,a;let t=(s==null?void 0:s.target)||null;(e=t==null?void 0:t.data)==null||e.set("pos","tbody"),(a=t==null?void 0:t.data)==null||a.set("tableSelectable",this.data.get("tableSelectable"))},"select:table-select-item"(s){let t=this.data.get("tableSelectable"),e=1;switch(t){case"single":this.eachItem((a,i)=>{let o=a===s.target;a.data.set("selected",o),o&&(e=i)});break;case"multi":e=[],this.eachItem((a,i)=>{a.data.get("selected")&&e.push(i)});break}this.dispatch(Q,e)},"click:table-tbody-item"(s){this.dispatch(Z,s.value)}};class A extends n.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}A.template=` | ||
<cc-table selectable="{{selectable}}" on-select="select($event)"> | ||
@@ -274,2 +260,2 @@ <cc-thead> | ||
</cc-table> | ||
`,D.components={"cc-tr":f,"cc-th":k,"cc-td":S,"cc-tbody":L,"cc-thead":C,"cc-table":y},D.filters={renderField(a,t){return typeof a.content=="function"?a.content.call(this,t):a.prop?t[a.prop]:""}},n.Button=E,n.Col=x,n.ConfigurableTable=D,n.Divider=P,n.Image=I,n.Input=M,n.Paragraph=N,n.Row=O,n.Swiper=w,n.SwiperItem=W,n.TBody=L,n.TD=S,n.TFoot=z,n.TH=k,n.THead=C,n.TR=f,n.Table=y,n.Tabs=T,n.TabsItem=j,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
`,A.components={"cc-tr":f,"cc-th":L,"cc-td":S,"cc-tbody":D,"cc-thead":k,"cc-table":C},A.filters={renderField(s,t){return typeof s.content=="function"?s.content.call(this,t):s.prop?t[s.prop]:""}},l.Button=P,l.Col=w,l.ConfigurableTable=A,l.Divider=N,l.Image=T,l.Input=R,l.Paragraph=W,l.Row=x,l.Swiper=$,l.SwiperItem=O,l.TBody=D,l.TD=S,l.TFoot=_,l.TH=L,l.THead=k,l.TR=f,l.Table=C,l.Tabs=y,l.TabsItem=j,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
@@ -1,2 +0,2 @@ | ||
(function(s,p){typeof exports=="object"&&typeof module!="undefined"?module.exports=p(require("san")):typeof define=="function"&&define.amd?define(["san"],p):(s=typeof globalThis!="undefined"?globalThis:s||self,s["@cosmic-design/san"]=p(s.san))})(this,function(s){"use strict";var a={paragraph:"cos-paragraph",md:"cos-md",xs:"cos-xs",sm:"cos-sm",lg:"cos-lg","paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:"cos-paragraph-nospacing","paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:"cos-paragraph-prefix","paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:"cos-paragraph-suffix"};class r extends s.Component{initData(){return{nativeAttributes:{},spacing:!1,hasPrefix:!!this.sourceSlots.named.prefix,hasSuffix:!!this.sourceSlots.named.suffix}}click(i){this.fire("click",i);const n={event:i};this.dispatch("click:paragraph",n)}}return r.trimWhitespace="all",r.template=` | ||
(function(s,p){typeof exports=="object"&&typeof module!="undefined"?module.exports=p(require("san")):typeof define=="function"&&define.amd?define(["san"],p):(s=typeof globalThis!="undefined"?globalThis:s||self,s["@cosmic-design/san"]=p(s.san))})(this,function(s){"use strict";var a={paragraph:"cos-paragraph",md:"cos-md",xs:"cos-xs",sm:"cos-sm",lg:"cos-lg","paragraph-nospacing":"cos-paragraph-nospacing",paragraphNospacing:"cos-paragraph-nospacing","paragraph-prefix":"cos-paragraph-prefix",paragraphPrefix:"cos-paragraph-prefix","paragraph-suffix":"cos-paragraph-suffix",paragraphSuffix:"cos-paragraph-suffix"};class r extends s.Component{initData(){return{spacing:!1}}click(i){this.fire("click",i)}}return r.trimWhitespace="all",r.template=` | ||
<div | ||
@@ -7,11 +7,5 @@ s-if="!spacing" | ||
<p class="${a.paragraph}"> | ||
<span s-if="hasPrefix" class="${a.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${a.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${a.paragraphPrefix}"></slot> | ||
<slot class="${a.paragraphContent}"></slot> | ||
<slot name="suffix" class="${a.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -24,12 +18,6 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${a.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${a.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${a.paragraphPrefix}"></slot> | ||
<slot class="${a.paragraphContent}"></slot> | ||
<slot name="suffix" class="${a.paragraphSuffix}"></slot> | ||
</p> | ||
`,r}); |
@@ -29,3 +29,2 @@ import { Component } from "san"; | ||
return { | ||
nativeAttributes: {}, | ||
src: "", | ||
@@ -32,0 +31,0 @@ alt: "", |
@@ -38,3 +38,2 @@ import { Component } from "san"; | ||
initData() { | ||
var _a, _b; | ||
return { | ||
@@ -44,5 +43,3 @@ name: void 0, | ||
type: "button", | ||
disabled: false, | ||
hasPrefix: !!((_a = this.sourceSlots) == null ? void 0 : _a.named.prefix), | ||
hasSuffix: !!((_b = this.sourceSlots) == null ? void 0 : _b.named.suffix) | ||
disabled: false | ||
}; | ||
@@ -52,4 +49,2 @@ } | ||
this.fire("click", event); | ||
const payload = { event }; | ||
this.dispatch("click:button", payload); | ||
} | ||
@@ -68,5 +63,3 @@ } | ||
<slot name="prefix" class="${style.buttonPrefix}"></slot> | ||
<div class="${style.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot class="${style.buttonContent}"></slot> | ||
<slot name="suffix" class="${style.buttonSuffix}"></slot> | ||
@@ -73,0 +66,0 @@ </button> |
@@ -10,10 +10,3 @@ import { Component } from "san"; | ||
]; | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var styles = { | ||
row, | ||
col | ||
}; | ||
function transform(input, output) { | ||
const currentSize = input.size; | ||
function transform(input, output, currentSize) { | ||
return function(prop) { | ||
@@ -32,7 +25,95 @@ const propValue = input[prop]; | ||
} | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var style = { | ||
row, | ||
col | ||
}; | ||
class Row extends Component { | ||
initData() { | ||
return { | ||
size: "xs", | ||
scope: "self", | ||
columns: void 0, | ||
gutter: 0, | ||
align: void 0, | ||
justify: void 0, | ||
wrap: false, | ||
xs: {}, | ||
sm: {}, | ||
md: {}, | ||
lg: {}, | ||
xl: {}, | ||
xxl: {} | ||
}; | ||
} | ||
} | ||
Row.template = ` | ||
<div class="${style.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`; | ||
Row.computed = { | ||
responsive() { | ||
const size = this.data.get("size"); | ||
const columns = this.data.get("columns"); | ||
const gutter = this.data.get("gutter"); | ||
const align = this.data.get("align"); | ||
const justify = this.data.get("justify"); | ||
const wrap = this.data.get("wrap"); | ||
const responsive = breakpoints.reduce((acc, cur) => { | ||
acc[cur] = this.data.get(cur) || {}; | ||
return acc; | ||
}, {}); | ||
[ | ||
"columns", | ||
"gutter", | ||
"align", | ||
"justify", | ||
"wrap" | ||
].forEach(transform({ | ||
columns, | ||
gutter, | ||
align, | ||
justify, | ||
wrap | ||
}, responsive, size)); | ||
return responsive; | ||
}, | ||
current() { | ||
const responsive = this.data.get("responsive"); | ||
const size = this.data.get("size"); | ||
return responsive[size]; | ||
}, | ||
rowStyle() { | ||
const current = this.data.get("current"); | ||
const rowStyle = {}; | ||
if (current.gutter) { | ||
const marginValue = current.gutter / -2; | ||
Object.assign(rowStyle, { | ||
"margin-left": `${marginValue}px`, | ||
"margin-right": `${marginValue}px` | ||
}); | ||
} | ||
if (current.wrap) { | ||
Object.assign(rowStyle, { | ||
"flex-wrap": "wrap" | ||
}); | ||
} | ||
if (current.justify) { | ||
Object.assign(rowStyle, { | ||
"justify-content": current.justify | ||
}); | ||
} | ||
if (current.align) { | ||
Object.assign(rowStyle, { | ||
"align-items": current.align | ||
}); | ||
} | ||
return rowStyle; | ||
} | ||
}; | ||
class Col extends Component { | ||
initData() { | ||
var _a, _b, _c; | ||
return { | ||
nativeAttributes: {}, | ||
span: void 0, | ||
@@ -45,10 +126,20 @@ xs: {}, | ||
xxl: {}, | ||
size: (_b = (_a = this.parentComponent) == null ? void 0 : _a.data.get("size")) != null ? _b : "xs", | ||
rowCurrent: (_c = this.parentComponent) == null ? void 0 : _c.data.get("current") | ||
size: "xs", | ||
rowCurrent: void 0 | ||
}; | ||
} | ||
inited() { | ||
let parent = this.parent; | ||
while (parent && !(parent instanceof Row)) { | ||
parent = parent.parent; | ||
} | ||
if (parent && parent.data) { | ||
this.data.set("size", parent.data.get("size")); | ||
this.data.set("rowCurrent", parent.data.get("current")); | ||
} | ||
} | ||
} | ||
Col.trimWhitespace = "all"; | ||
Col.template = ` | ||
<div class="${styles.col}" style="{{colStyle}}"> | ||
<div class="${style.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
@@ -65,10 +156,13 @@ </div> | ||
}, {}); | ||
["span"].forEach(transform({ | ||
size, | ||
span | ||
}, responsive)); | ||
["span"].forEach(transform({ span }, responsive, size)); | ||
return responsive; | ||
}, | ||
current() { | ||
const responsive = this.data.get("responsive"); | ||
const size = this.data.get("size"); | ||
return responsive[size]; | ||
}, | ||
colStyle() { | ||
const span = this.data.get("span"); | ||
const current = this.data.get("current"); | ||
const span = current && current.span; | ||
const rowCurrent = this.data.get("rowCurrent"); | ||
@@ -75,0 +169,0 @@ const colStyle = { |
@@ -10,10 +10,3 @@ import { Component } from "san"; | ||
]; | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var styles = { | ||
row, | ||
col | ||
}; | ||
function transform(input, output) { | ||
const currentSize = input.size; | ||
function transform(input, output, currentSize) { | ||
return function(prop) { | ||
@@ -32,6 +25,11 @@ const propValue = input[prop]; | ||
} | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var style = { | ||
row, | ||
col | ||
}; | ||
class Row extends Component { | ||
initData() { | ||
return { | ||
nativeAttributes: {}, | ||
size: "xs", | ||
@@ -54,3 +52,3 @@ scope: "self", | ||
Row.template = ` | ||
<div class="${styles.row}" style="{{rowStyle}}"> | ||
<div class="${style.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
@@ -78,3 +76,2 @@ </div> | ||
].forEach(transform({ | ||
size, | ||
columns, | ||
@@ -85,3 +82,3 @@ gutter, | ||
wrap | ||
}, responsive)); | ||
}, responsive, size)); | ||
return responsive; | ||
@@ -88,0 +85,0 @@ }, |
@@ -17,3 +17,3 @@ import { Component, DataTypes } from "san"; | ||
const text = "cos-text"; | ||
var style$5 = { | ||
var style$6 = { | ||
button, | ||
@@ -40,3 +40,2 @@ hover: hover$2, | ||
initData() { | ||
var _a, _b; | ||
return { | ||
@@ -46,5 +45,3 @@ name: void 0, | ||
type: "button", | ||
disabled: false, | ||
hasPrefix: !!((_a = this.sourceSlots) == null ? void 0 : _a.named.prefix), | ||
hasSuffix: !!((_b = this.sourceSlots) == null ? void 0 : _b.named.suffix) | ||
disabled: false | ||
}; | ||
@@ -54,4 +51,2 @@ } | ||
this.fire("click", event); | ||
const payload = { event }; | ||
this.dispatch("click:button", payload); | ||
} | ||
@@ -62,3 +57,3 @@ } | ||
<button | ||
class="${style$5.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${style$6.button} {{disabled ? 'cos-disabled' : ''}}" | ||
type="{{type}}" | ||
@@ -70,7 +65,5 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${style$5.buttonPrefix}"></slot> | ||
<div class="${style$5.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot name="suffix" class="${style$5.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${style$6.buttonPrefix}"></slot> | ||
<slot class="${style$6.buttonContent}"></slot> | ||
<slot name="suffix" class="${style$6.buttonSuffix}"></slot> | ||
</button> | ||
@@ -81,3 +74,3 @@ `; | ||
const slotContainer = "cos-slot-container"; | ||
var styles$2 = { | ||
var styles$1 = { | ||
horizontal, | ||
@@ -102,3 +95,3 @@ vertical, | ||
<div class="cos-{{direction}}"> | ||
<div s-if="hasSlot" class="${styles$2.slotContainer}"> | ||
<div s-if="hasSlot" class="${styles$1.slotContainer}"> | ||
<slot></slot> | ||
@@ -116,3 +109,3 @@ </div> | ||
const paragraphSuffix = "cos-paragraph-suffix"; | ||
var style$4 = { | ||
var style$5 = { | ||
paragraph, | ||
@@ -133,6 +126,3 @@ md: md$1, | ||
return { | ||
nativeAttributes: {}, | ||
spacing: false, | ||
hasPrefix: !!this.sourceSlots.named.prefix, | ||
hasSuffix: !!this.sourceSlots.named.suffix | ||
spacing: false | ||
}; | ||
@@ -142,4 +132,2 @@ } | ||
this.fire("click", event); | ||
const payload = { event }; | ||
this.dispatch("click:paragraph", payload); | ||
} | ||
@@ -151,14 +139,8 @@ } | ||
s-if="!spacing" | ||
class="${style$4.paragraphNospacing} ${style$4.md}" | ||
class="${style$5.paragraphNospacing} ${style$5.md}" | ||
on-click="click"> | ||
<p class="${style$4.paragraph}"> | ||
<span s-if="hasPrefix" class="${style$4.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style$4.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<p class="${style$5.paragraph}"> | ||
<slot name="prefix" class="${style$5.paragraphPrefix}"></slot> | ||
<slot class="${style$5.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style$5.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -168,14 +150,8 @@ </div> | ||
s-else | ||
class="${style$4.paragraph} ${style$4.md}" | ||
class="${style$5.paragraph} ${style$5.md}" | ||
on-click="click" | ||
> | ||
<span s-if="hasPrefix" class="${style$4.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style$4.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${style$5.paragraphPrefix}"></slot> | ||
<slot class="${style$5.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style$5.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -191,10 +167,3 @@ `; | ||
]; | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var styles$1 = { | ||
row, | ||
col | ||
}; | ||
function transform$1(input2, output) { | ||
const currentSize = input2.size; | ||
function transform(input2, output, currentSize) { | ||
return function(prop) { | ||
@@ -213,81 +182,11 @@ const propValue = input2[prop]; | ||
} | ||
class Col extends Component { | ||
initData() { | ||
var _a, _b, _c; | ||
return { | ||
nativeAttributes: {}, | ||
span: void 0, | ||
xs: {}, | ||
sm: {}, | ||
md: {}, | ||
lg: {}, | ||
xl: {}, | ||
xxl: {}, | ||
size: (_b = (_a = this.parentComponent) == null ? void 0 : _a.data.get("size")) != null ? _b : "xs", | ||
rowCurrent: (_c = this.parentComponent) == null ? void 0 : _c.data.get("current") | ||
}; | ||
} | ||
} | ||
Col.trimWhitespace = "all"; | ||
Col.template = ` | ||
<div class="${styles$1.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`; | ||
Col.computed = { | ||
responsive() { | ||
const size = this.data.get("size"); | ||
const span = this.data.get("span"); | ||
const responsive = breakpoints.reduce((acc, cur) => { | ||
acc[cur] = this.data.get(cur) || {}; | ||
return acc; | ||
}, {}); | ||
["span"].forEach(transform$1({ | ||
size, | ||
span | ||
}, responsive)); | ||
return responsive; | ||
}, | ||
colStyle() { | ||
const span = this.data.get("span"); | ||
const rowCurrent = this.data.get("rowCurrent"); | ||
const colStyle = { | ||
"box-sizing": "border-box" | ||
}; | ||
if (rowCurrent && rowCurrent.gutter) { | ||
const paddingValue = rowCurrent.gutter / 2; | ||
Object.assign(colStyle, { | ||
"padding-left": `${paddingValue}px`, | ||
"padding-right": `${paddingValue}px` | ||
}); | ||
} | ||
if (rowCurrent && rowCurrent.columns && span) { | ||
const width = +span / +rowCurrent.columns * 100; | ||
Object.assign(colStyle, { | ||
flex: "0 0 auto", | ||
width: `${width}%` | ||
}); | ||
} | ||
return colStyle; | ||
} | ||
const row = "cos-row"; | ||
const col = "cos-col"; | ||
var style$4 = { | ||
row, | ||
col | ||
}; | ||
function transform(input2, output) { | ||
const currentSize = input2.size; | ||
return function(prop) { | ||
const propValue = input2[prop]; | ||
if (typeof propValue === "object") { | ||
for (const size in propValue) { | ||
if (propValue.hasOwnProperty(size)) { | ||
output[size][prop] = propValue[size]; | ||
} | ||
} | ||
} else { | ||
output[currentSize][prop] = propValue; | ||
} | ||
}; | ||
} | ||
class Row extends Component { | ||
initData() { | ||
return { | ||
nativeAttributes: {}, | ||
size: "xs", | ||
@@ -310,3 +209,3 @@ scope: "self", | ||
Row.template = ` | ||
<div class="${styles$1.row}" style="{{rowStyle}}"> | ||
<div class="${style$4.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
@@ -334,3 +233,2 @@ </div> | ||
].forEach(transform({ | ||
size, | ||
columns, | ||
@@ -341,3 +239,3 @@ gutter, | ||
wrap | ||
}, responsive)); | ||
}, responsive, size)); | ||
return responsive; | ||
@@ -378,2 +276,73 @@ }, | ||
}; | ||
class Col extends Component { | ||
initData() { | ||
return { | ||
span: void 0, | ||
xs: {}, | ||
sm: {}, | ||
md: {}, | ||
lg: {}, | ||
xl: {}, | ||
xxl: {}, | ||
size: "xs", | ||
rowCurrent: void 0 | ||
}; | ||
} | ||
inited() { | ||
let parent = this.parent; | ||
while (parent && !(parent instanceof Row)) { | ||
parent = parent.parent; | ||
} | ||
if (parent && parent.data) { | ||
this.data.set("size", parent.data.get("size")); | ||
this.data.set("rowCurrent", parent.data.get("current")); | ||
} | ||
} | ||
} | ||
Col.trimWhitespace = "all"; | ||
Col.template = ` | ||
<div class="${style$4.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`; | ||
Col.computed = { | ||
responsive() { | ||
const size = this.data.get("size"); | ||
const span = this.data.get("span"); | ||
const responsive = breakpoints.reduce((acc, cur) => { | ||
acc[cur] = this.data.get(cur) || {}; | ||
return acc; | ||
}, {}); | ||
["span"].forEach(transform({ span }, responsive, size)); | ||
return responsive; | ||
}, | ||
current() { | ||
const responsive = this.data.get("responsive"); | ||
const size = this.data.get("size"); | ||
return responsive[size]; | ||
}, | ||
colStyle() { | ||
const current = this.data.get("current"); | ||
const span = current && current.span; | ||
const rowCurrent = this.data.get("rowCurrent"); | ||
const colStyle = { | ||
"box-sizing": "border-box" | ||
}; | ||
if (rowCurrent && rowCurrent.gutter) { | ||
const paddingValue = rowCurrent.gutter / 2; | ||
Object.assign(colStyle, { | ||
"padding-left": `${paddingValue}px`, | ||
"padding-right": `${paddingValue}px` | ||
}); | ||
} | ||
if (rowCurrent && rowCurrent.columns && span) { | ||
const width = +span / +rowCurrent.columns * 100; | ||
Object.assign(colStyle, { | ||
flex: "0 0 auto", | ||
width: `${width}%` | ||
}); | ||
} | ||
return colStyle; | ||
} | ||
}; | ||
const swiper = "cos-swiper -v-text -v-border-none rounded"; | ||
@@ -380,0 +349,0 @@ const swiperContainer = "cos-swiper-container"; |
@@ -26,6 +26,3 @@ import { Component } from "san"; | ||
return { | ||
nativeAttributes: {}, | ||
spacing: false, | ||
hasPrefix: !!this.sourceSlots.named.prefix, | ||
hasSuffix: !!this.sourceSlots.named.suffix | ||
spacing: false | ||
}; | ||
@@ -35,4 +32,2 @@ } | ||
this.fire("click", event); | ||
const payload = { event }; | ||
this.dispatch("click:paragraph", payload); | ||
} | ||
@@ -47,11 +42,5 @@ } | ||
<p class="${style.paragraph}"> | ||
<span s-if="hasPrefix" class="${style.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${style.paragraphPrefix}"></slot> | ||
<slot class="${style.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -64,13 +53,7 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${style.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${style.paragraphPrefix}"></slot> | ||
<slot class="${style.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style.paragraphSuffix}"></slot> | ||
</p> | ||
`; | ||
export { Paragraph as default }; |
{ | ||
"name": "@cosmic-design/san", | ||
"version": "0.1.1-beta.98ba66f", | ||
"version": "0.1.1-beta.a57cb4c", | ||
"scripts": { | ||
@@ -32,3 +32,3 @@ "build": "node ./script/build.js", | ||
"dependencies": { | ||
"@cosmic-design/style": "0.1.1-beta.98ba66f", | ||
"@cosmic-design/style": "0.1.1-beta.a57cb4c", | ||
"prismjs": "~1.27.0", | ||
@@ -35,0 +35,0 @@ "san": "~3.11.1" |
@@ -39,4 +39,2 @@ /** | ||
return { | ||
nativeAttributes: {}, | ||
src: '', | ||
@@ -43,0 +41,0 @@ alt: '', |
@@ -10,3 +10,3 @@ ## API | ||
|value|在 form 表单中使用时对应 name 的 value|string|--|--| | ||
|type|按钮的默认行人|string|'submit'/'reset'/'button'|'button'| | ||
|type|按钮的默认行为|string|'submit'/'reset'/'button'|'button'| | ||
@@ -13,0 +13,0 @@ ## Component Class |
@@ -7,6 +7,5 @@ /** | ||
import {Component} from 'san'; | ||
import type { ButtonData } from './interface'; | ||
import style from '@cosmic-design/style/button.module.css'; | ||
import type { ButtonData } from './interface'; | ||
export default class Button extends Component { | ||
@@ -26,5 +25,3 @@ | ||
<slot name="prefix" class="${style.buttonPrefix}"></slot> | ||
<div class="${style.buttonContent}"> | ||
<slot></slot> | ||
</div> | ||
<slot class="${style.buttonContent}"></slot> | ||
<slot name="suffix" class="${style.buttonSuffix}"></slot> | ||
@@ -40,7 +37,3 @@ </button> | ||
type: 'button', | ||
disabled: false, | ||
// state | ||
hasPrefix: !!(this as any).sourceSlots?.named.prefix, | ||
hasSuffix: !!(this as any).sourceSlots?.named.suffix | ||
disabled: false | ||
}; | ||
@@ -51,7 +44,3 @@ } | ||
this.fire('click', event); | ||
const payload = {event}; | ||
this.dispatch('click:button', payload); | ||
} | ||
} |
@@ -9,7 +9,4 @@ export interface ButtonProps { | ||
export interface ButtonState { | ||
hasPrefix?: boolean; | ||
hasSuffix?: boolean; | ||
} | ||
export interface ButtonState {} | ||
export interface ButtonData extends ButtonProps, ButtonState {} |
@@ -7,24 +7,9 @@ /** | ||
import type {ColData, Responsive, SubColProps} from '../interface'; | ||
import {breakpoints} from '../helper'; | ||
import styles from '@cosmic-design/style/grid.module.css'; | ||
import { | ||
breakpoints, | ||
transform | ||
} from '../helper'; | ||
import style from '@cosmic-design/style/grid.module.css'; | ||
import Row from '../Row/index'; | ||
function transform(input: Partial<ColData>, output: Record<Responsive, SubColProps>) { | ||
const currentSize = input.size; | ||
return function (prop: keyof SubColProps) { | ||
const propValue = input[prop]; | ||
if (typeof propValue === 'object') { | ||
for (const size in propValue) { | ||
if (propValue.hasOwnProperty(size)) { | ||
// eslint-disable-next-line | ||
output[size as Responsive][prop] = propValue[size as Responsive]; | ||
} | ||
} | ||
} | ||
else { | ||
// eslint-disable-next-line | ||
output[currentSize as Responsive][prop] = propValue; | ||
} | ||
}; | ||
} | ||
export default class Col extends Component { | ||
@@ -35,3 +20,3 @@ | ||
static template = ` | ||
<div class="${styles.col}" style="{{colStyle}}"> | ||
<div class="${style.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
@@ -51,12 +36,14 @@ </div> | ||
(['span'] as Array<(keyof SubColProps)>).forEach(transform({ | ||
size, | ||
span | ||
}, responsive)); | ||
(['span'] as Array<(keyof SubColProps)>).forEach(transform<SubColProps>({span}, responsive, size)); | ||
return responsive; | ||
}, | ||
current(this: Col) { | ||
const responsive = this.data.get('responsive'); | ||
const size = this.data.get('size'); | ||
return responsive[size]; | ||
}, | ||
colStyle(this: Col) { | ||
const span = this.data.get('span'); | ||
const current = this.data.get('current'); | ||
const span = current && current.span; | ||
const rowCurrent = this.data.get('rowCurrent'); | ||
@@ -90,6 +77,2 @@ | ||
return { | ||
// base props | ||
nativeAttributes: {}, | ||
// props & variants | ||
span: undefined, | ||
@@ -103,7 +86,20 @@ xs: {}, | ||
// state | ||
size: this.parentComponent?.data.get('size') ?? 'xs', | ||
rowCurrent: this.parentComponent?.data.get('current') | ||
// state from row | ||
size: 'xs', | ||
rowCurrent: undefined | ||
}; | ||
} | ||
inited() { | ||
// @ts-ignore | ||
let parent = this.parent; | ||
while (parent && !(parent instanceof Row)) { | ||
parent = parent.parent; | ||
} | ||
if (parent && parent.data) { | ||
this.data.set('size', parent.data.get('size')); | ||
this.data.set('rowCurrent', parent.data.get('current')); | ||
} | ||
} | ||
} |
@@ -6,3 +6,7 @@ /** | ||
import {Responsive} from './interface'; | ||
import type { | ||
SubRowProps, | ||
SubColProps, | ||
Responsive | ||
} from './interface'; | ||
@@ -17,1 +21,19 @@ export const breakpoints: Responsive[] = [ | ||
]; | ||
// from: {a: {sm, md, lg}, b: 1, c: {sm}} | ||
// to: {sm: {a, c}, md: {a, b}, lg: {a}} | ||
export function transform<T extends SubRowProps | SubColProps>(input: T, output: Record<Responsive, T>, currentSize: Responsive) { | ||
return function (prop: keyof T) { | ||
const propValue = input[prop] as unknown as Record<Responsive, unknown>; | ||
if (typeof propValue === 'object') { | ||
for (const size in propValue) { | ||
if (propValue.hasOwnProperty(size)) { | ||
output[size as Responsive][prop] = propValue[size as Responsive] as T[keyof T]; | ||
} | ||
} | ||
} | ||
else { | ||
output[currentSize][prop] = propValue; | ||
} | ||
}; | ||
} |
@@ -90,3 +90,2 @@ export type Responsive = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; | ||
nativeAttributes?: Record<string, unknown>; | ||
/** | ||
@@ -147,3 +146,3 @@ * 响应式对象 | ||
export interface ColProps extends BaseProps, SubColProps { | ||
export interface ColProps extends SubColProps { | ||
@@ -170,5 +169,5 @@ xs?: number | SubColProps; | ||
size: Responsive; | ||
rowCurrent: SubRowProps; | ||
rowCurrent?: SubRowProps; | ||
} | ||
export interface ColData extends ColProps, ColState {}; |
@@ -7,28 +7,12 @@ /** | ||
import type {RowData, SubRowProps, Responsive} from '../interface'; | ||
import {breakpoints} from '../helper'; | ||
import styles from '@cosmic-design/style/grid.module.css'; | ||
import { | ||
breakpoints, | ||
transform | ||
} from '../helper'; | ||
import style from '@cosmic-design/style/grid.module.css'; | ||
function transform(input: Partial<RowData>, output: Record<Responsive, SubRowProps>) { | ||
const currentSize = input.size; | ||
return function (prop: keyof SubRowProps) { | ||
const propValue = input[prop]; | ||
if (typeof propValue === 'object') { | ||
for (const size in propValue) { | ||
if (propValue.hasOwnProperty(size)) { | ||
// eslint-disable-next-line | ||
output[size as Responsive][prop] = propValue[size as Responsive]; | ||
} | ||
} | ||
} | ||
else { | ||
// eslint-disable-next-line | ||
output[currentSize as Responsive][prop] = propValue; | ||
} | ||
}; | ||
} | ||
export default class Row extends Component { | ||
static template = ` | ||
<div class="${styles.row}" style="{{rowStyle}}"> | ||
<div class="${style.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
@@ -60,4 +44,3 @@ </div> | ||
'wrap' | ||
] as Array<keyof SubRowProps>).forEach(transform({ | ||
size, | ||
] as Array<keyof SubRowProps>).forEach(transform<SubRowProps>({ | ||
columns, | ||
@@ -68,3 +51,3 @@ gutter, | ||
wrap | ||
}, responsive)); | ||
}, responsive, size)); | ||
@@ -117,6 +100,2 @@ return responsive; | ||
return { | ||
// base props | ||
nativeAttributes: {}, | ||
// props & variants | ||
// TODO 暂时直接基于初始断点获得当前断点,后续支持动态检测容器宽度获得 | ||
@@ -123,0 +102,0 @@ size: 'xs', |
@@ -7,16 +7,5 @@ /** | ||
import {Component} from 'san'; | ||
import type { ParagraphData } from './interface'; | ||
import style from '@cosmic-design/style/paragraph.module.css'; | ||
interface Props { | ||
nativeAttributes: Record<string, unknown>; | ||
spacing?: boolean; | ||
} | ||
interface State { | ||
hasPrefix?: boolean; | ||
hasSuffix?: boolean; | ||
} | ||
interface ParagraphData extends Props, State {} | ||
export default class Paragraph extends Component { | ||
@@ -32,11 +21,5 @@ | ||
<p class="${style.paragraph}"> | ||
<span s-if="hasPrefix" class="${style.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${style.paragraphPrefix}"></slot> | ||
<slot class="${style.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -49,11 +32,5 @@ </div> | ||
> | ||
<span s-if="hasPrefix" class="${style.paragraphPrefix}"> | ||
<slot name="prefix"></slot> | ||
</span> | ||
<span> | ||
<slot></slot> | ||
</span> | ||
<span s-if="hasSuffix" class="${style.paragraphSuffix}"> | ||
<slot name="suffix"></slot> | ||
</span> | ||
<slot name="prefix" class="${style.paragraphPrefix}"></slot> | ||
<slot class="${style.paragraphContent}"></slot> | ||
<slot name="suffix" class="${style.paragraphSuffix}"></slot> | ||
</p> | ||
@@ -64,11 +41,3 @@ `; | ||
return { | ||
// base props | ||
nativeAttributes: {}, | ||
// props | ||
spacing: false, | ||
// state | ||
hasPrefix: !!(this as any).sourceSlots.named.prefix, | ||
hasSuffix: !!(this as any).sourceSlots.named.suffix | ||
spacing: false | ||
}; | ||
@@ -79,6 +48,3 @@ } | ||
this.fire('click', event); | ||
const payload = {event}; | ||
this.dispatch('click:paragraph', payload); | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 3 instances in 1 package
36
608617
9269
+ Added@cosmic-design/style@0.1.1-beta.a57cb4c(transitive)
- Removed@cosmic-design/style@0.1.1-beta.98ba66f(transitive)