@cosmic-design/san
Advanced tools
Comparing version 0.1.1-beta.a57cb4c to 0.1.1-beta.bc2614d
"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="${t.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${t.button} {{disabled ? ${t.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -5,0 +5,0 @@ name="{{name}}" |
@@ -1,9 +0,5 @@ | ||
"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}}"> | ||
"use strict";var a=require("san");const c=["xs","sm","md","lg","xl","xxl"];function l(r,t,e){return function(n){const s=r[n];if(typeof s=="object")for(const i in s)s.hasOwnProperty(i)&&(t[i][n]=s[i]);else t[e][n]=s}}const d="cos-row",u="cos-col";var p={row:d,col:u};class o extends a.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.isGridRow;)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}o.trimWhitespace="all";o.template=` | ||
<div class="${p.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;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; | ||
`;o.computed={responsive(){const r=this.data.get("size"),t=this.data.get("span"),e=c.reduce((n,s)=>(n[s]=this.data.get(s)||{},n),{});return["span"].forEach(l({span:t},e,r)),e},current(){const r=this.data.get("responsive"),t=this.data.get("size");return r[t]},colStyle(){const r=this.data.get("current"),t=r&&r.span,e=this.data.get("rowCurrent"),n={"box-sizing":"border-box"};if(e&&e.gutter){const s=e.gutter/2;Object.assign(n,{"padding-left":`${s}px`,"padding-right":`${s}px`})}if(e&&e.columns&&t){const s=+t/+e.columns*100;Object.assign(n,{flex:"0 0 auto",width:`${s}%`})}return n}};module.exports=o; |
@@ -1,5 +0,5 @@ | ||
"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}}"> | ||
"use strict";var g=require("san");const u=["xs","sm","md","lg","xl","xxl"];function f(t,s,i){return function(n){const e=t[n];if(typeof e=="object")for(const r in e)e.hasOwnProperty(r)&&(s[r][n]=e[r]);else s[i][n]=e}}const d="cos-row",p="cos-col";var w={row:d,col:p};class o 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:{}}}inited(){this.isGridRow=!0}}o.template=` | ||
<div class="${w.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(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; | ||
`;o.computed={responsive(){const t=this.data.get("size"),s=this.data.get("columns"),i=this.data.get("gutter"),n=this.data.get("align"),e=this.data.get("justify"),r=this.data.get("wrap"),a=u.reduce((c,l)=>(c[l]=this.data.get(l)||{},c),{});return["columns","gutter","align","justify","wrap"].forEach(f({columns:s,gutter:i,align:n,justify:e,wrap:r},a,t)),a},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}};module.exports=o; |
@@ -1,4 +0,4 @@ | ||
"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=` | ||
"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 b={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 A extends n.Component{initData(){return{name:void 0,value:void 0,type:"button",disabled:!1}}click(t){this.fire("click",t)}}A.trimWhitespace="all";A.template=` | ||
<button | ||
class="${v.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${b.button} {{disabled ? ${b.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -10,7 +10,7 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${v.buttonPrefix}"></slot> | ||
<slot class="${v.buttonContent}"></slot> | ||
<slot name="suffix" class="${v.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${b.buttonPrefix}"></slot> | ||
<slot class="${b.buttonContent}"></slot> | ||
<slot name="suffix" class="${b.buttonSuffix}"></slot> | ||
</button> | ||
`;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=` | ||
`;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 E 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}}}E.trimWhitespace="all";E.template=` | ||
<div class="cos-{{direction}}"> | ||
@@ -21,3 +21,3 @@ <div s-if="hasSlot" class="${nt.slotContainer}"> | ||
</div> | ||
`;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=` | ||
`;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 P extends n.Component{initData(){return{spacing:!1}}click(t){this.fire("click",t)}}P.trimWhitespace="all";P.template=` | ||
<div | ||
@@ -42,11 +42,11 @@ s-if="!spacing" | ||
</p> | ||
`;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}}"> | ||
`;const R=["xs","sm","md","lg","xl","xxl"];function B(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 Y={row:mt,col:vt};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.isGridRow;)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="${Y.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;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}}"> | ||
`;w.computed={responsive(){const s=this.data.get("size"),t=this.data.get("span"),e=R.reduce((a,i)=>(a[i]=this.data.get(i)||{},a),{});return["span"].forEach(B({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}};class N 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:{}}}inited(){this.isGridRow=!0}}N.template=` | ||
<div class="${Y.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`;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=` | ||
`;N.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=R.reduce((l,r)=>(l[r]=this.data.get(r)||{},l),{});return["columns","gutter","align","justify","wrap"].forEach(B({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}};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 T 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)}}T.trimWhitespace="all";T.template=` | ||
<div | ||
@@ -92,3 +92,3 @@ class="${d.swiper}" | ||
</div> | ||
`;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=` | ||
`;T.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 | ||
@@ -102,3 +102,3 @@ s-if="ready" | ||
</div> | ||
`;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=` | ||
`;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 I 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)}}I.trimWhitespace="all";I.template=` | ||
<div | ||
@@ -128,11 +128,11 @@ class="${x.image}" | ||
</div> | ||
`;$.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}"> | ||
`;I.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",Rt="cos-input-suffix";var m={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:Rt};class F 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)}}F.template=` | ||
<div class="${m.input}"> | ||
<div | ||
s-if="hasPrefix" | ||
class="${b.inputPrefix}" | ||
class="${m.inputPrefix}" | ||
> | ||
<slot name="prefix"></slot> | ||
</div> | ||
<div class="${b.inputWrapper}"> | ||
<div class="${m.inputWrapper}"> | ||
<input | ||
@@ -144,3 +144,3 @@ type="input" | ||
s-bind="nativeAttributes" | ||
class="${b.inputReal}" | ||
class="${m.inputReal}" | ||
on-input="handleInput" | ||
@@ -152,3 +152,3 @@ on-change="handleChange" | ||
s-if="hasSuffix" | ||
class="${b.inputSuffix}" | ||
class="${m.inputSuffix}" | ||
> | ||
@@ -158,3 +158,3 @@ <slot name="suffix"></slot> | ||
</div> | ||
`;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=` | ||
`;const Bt="cos-tabs",Yt="cos-tabs-nav",Ft="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:Bt,"tabs-nav":"cos-tabs-nav",tabsNav:Yt,"tabs-nav-item":"cos-tabs-nav-item",tabsNavItem:Ft,"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 $ 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(v=>{v.constructor.name==="TabsItem"&&t.push(v)}),this.data.set("paneList",t);const e=this.data.get("index"),a=this.data.get("labelList"),i=this;let o=0;a.forEach((v,z)=>{var M;const X=(M=i.ref("label"+z))==null?void 0:M.offsetWidth;v.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)}}$.trimWhitespace="all";$.template=` | ||
<div class="${p.tabs}"> | ||
@@ -184,3 +184,3 @@ <div class="${p.tabsNav}"> | ||
</div> | ||
`;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=` | ||
`;$.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 | ||
@@ -193,3 +193,3 @@ s-show="active" | ||
</div> | ||
`;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=` | ||
`;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 y 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}}y.template=` | ||
<table class="${g.table}"> | ||
@@ -200,9 +200,9 @@ <slot name="header"></slot> | ||
</table> | ||
`;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=` | ||
`;y.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 C extends n.Component{inited(){this.dispatch(pe,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}C.template=` | ||
<thead class="${g.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 ue="UI:tfoot-inited";class j extends n.Component{inited(){this.dispatch(ue,null)}}j.template=` | ||
`;C.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 n.Component{initData(){return{colspan:1}}}S.template=` | ||
`;j.messages={"click:table-tfoot-item"(){this.fire("click")}};class k extends n.Component{initData(){return{colspan:1}}}k.template=` | ||
<td san-if="colspan !== 1" colspan="{{colspan}}" class="${g.td}"> | ||
@@ -214,3 +214,3 @@ <slot></slot> | ||
</td> | ||
`;class L extends n.Component{initData(){return{width:""}}}L.template=` | ||
`;class S extends n.Component{initData(){return{width:""}}}S.template=` | ||
<th width="{{width}}" class="${g.th}"><slot></slot></th> | ||
@@ -245,7 +245,7 @@ `;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> | ||
`;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=` | ||
`;f.components={"cc-td":k,"cc-th":S};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 L 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}}L.template=` | ||
<tbody> | ||
<slot></slot> | ||
</tbody> | ||
`;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=` | ||
`;L.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 D extends n.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}D.template=` | ||
<cc-table selectable="{{selectable}}" on-select="select($event)"> | ||
@@ -263,2 +263,2 @@ <cc-thead> | ||
</cc-table> | ||
`;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; | ||
`;D.components={"cc-tr":f,"cc-th":S,"cc-td":k,"cc-tbody":L,"cc-thead":C,"cc-table":y};D.filters={renderField(s,t){return typeof s.content=="function"?s.content.call(this,t):s.prop?t[s.prop]:""}};exports.Button=A;exports.Col=w;exports.ConfigurableTable=D;exports.Divider=E;exports.Image=I;exports.Input=F;exports.Paragraph=P;exports.Row=N;exports.Swiper=T;exports.SwiperItem=O;exports.TBody=L;exports.TD=k;exports.TFoot=j;exports.TH=S;exports.THead=C;exports.TR=f;exports.Table=y;exports.Tabs=$;exports.TabsItem=W; |
@@ -1,4 +0,4 @@ | ||
(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=` | ||
(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 o={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="${n.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${o.button} {{disabled ? ${o.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -10,6 +10,6 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${n.buttonPrefix}"></slot> | ||
<slot class="${n.buttonContent}"></slot> | ||
<slot name="suffix" class="${n.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${o.buttonPrefix}"></slot> | ||
<slot class="${o.buttonContent}"></slot> | ||
<slot name="suffix" class="${o.buttonSuffix}"></slot> | ||
</button> | ||
`,s}); |
@@ -1,9 +0,5 @@ | ||
(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}}"> | ||
(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"];function d(o,t,s){return function(n){const e=o[n];if(typeof e=="object")for(const c in e)e.hasOwnProperty(c)&&(t[c][n]=e[c]);else t[s][n]=e}}var l={row:"cos-row",col:"cos-col"};class a extends i.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.isGridRow;)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}return a.trimWhitespace="all",a.template=` | ||
<div class="${l.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,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}); | ||
`,a.computed={responsive(){const o=this.data.get("size"),t=this.data.get("span"),s=r.reduce((n,e)=>(n[e]=this.data.get(e)||{},n),{});return["span"].forEach(d({span:t},s,o)),s},current(){const o=this.data.get("responsive"),t=this.data.get("size");return o[t]},colStyle(){const o=this.data.get("current"),t=o&&o.span,s=this.data.get("rowCurrent"),n={"box-sizing":"border-box"};if(s&&s.gutter){const e=s.gutter/2;Object.assign(n,{"padding-left":`${e}px`,"padding-right":`${e}px`})}if(s&&s.columns&&t){const e=+t/+s.columns*100;Object.assign(n,{flex:"0 0 auto",width:`${e}%`})}return n}},a}); |
@@ -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"];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}}"> | ||
(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 d(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 g={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:{}}}inited(){this.isGridRow=!0}}return c.template=` | ||
<div class="${g.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"),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}); | ||
`,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({columns:s,gutter:i,align:r,justify:e,wrap:a},u,t)),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}); |
@@ -1,4 +0,4 @@ | ||
(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=` | ||
(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="",m={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 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 | ||
class="${v.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${m.button} {{disabled ? ${m.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -10,7 +10,7 @@ name="{{name}}" | ||
> | ||
<slot name="prefix" class="${v.buttonPrefix}"></slot> | ||
<slot class="${v.buttonContent}"></slot> | ||
<slot name="suffix" class="${v.buttonSuffix}"></slot> | ||
<slot name="prefix" class="${m.buttonPrefix}"></slot> | ||
<slot class="${m.buttonContent}"></slot> | ||
<slot name="suffix" class="${m.buttonSuffix}"></slot> | ||
</button> | ||
`;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=` | ||
`;var H={horizontal:"cos-horizontal",vertical:"cos-vertical","slot-container":"cos-slot-container",slotContainer:"cos-slot-container"};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}}"> | ||
@@ -21,3 +21,3 @@ <div s-if="hasSlot" class="${H.slotContainer}"> | ||
</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 W extends n.Component{initData(){return{spacing:!1}}click(t){this.fire("click",t)}}W.trimWhitespace="all",W.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 N extends n.Component{initData(){return{spacing:!1}}click(t){this.fire("click",t)}}N.trimWhitespace="all",N.template=` | ||
<div | ||
@@ -42,11 +42,11 @@ s-if="!spacing" | ||
</p> | ||
`;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}}"> | ||
`;const z=["xs","sm","md","lg","xl","xxl"];function R(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 X={row:"cos-row",col:"cos-col"};class x 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.isGridRow;)t=t.parent;t&&t.data&&(this.data.set("size",t.data.get("size")),this.data.set("rowCurrent",t.data.get("current")))}}x.trimWhitespace="all",x.template=` | ||
<div class="${X.col}" style="{{colStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,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}}"> | ||
`,x.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(R({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}};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:{}}}inited(){this.isGridRow=!0}}W.template=` | ||
<div class="${X.row}" style="{{rowStyle}}"> | ||
<slot></slot> | ||
</div> | ||
`,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=` | ||
`,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=z.reduce((r,d)=>(r[d]=this.data.get(d)||{},r),{});return["columns","gutter","align","justify","wrap"].forEach(R({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}};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 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)}}w.trimWhitespace="all",w.template=` | ||
<div | ||
@@ -92,3 +92,3 @@ class="${h.swiper}" | ||
</div> | ||
`,$.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=` | ||
`,w.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 | ||
@@ -102,14 +102,14 @@ s-if="ready" | ||
</div> | ||
`;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=` | ||
`;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 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)}}I.trimWhitespace="all",I.template=` | ||
<div | ||
class="${I.image}" | ||
class="${$.image}" | ||
on-click="onClick" | ||
on-touchmove="onTouchmove"> | ||
<div s-if="hasContent" class="${I.imageContent}"> | ||
<div s-if="hasContent" class="${$.imageContent}"> | ||
<slot name="content"></slot> | ||
</div> | ||
<div s-if="hasPlaceholder && loading" class="${I.imagePlaceholder}"> | ||
<div s-if="hasPlaceholder && loading" class="${$.imagePlaceholder}"> | ||
<slot name="placeholder"></slot> | ||
</div> | ||
<div s-if="hasFallback && error" class="${I.imageFallback}"> | ||
<div s-if="hasFallback && error" class="${$.imageFallback}"> | ||
<slot name="fallback"></slot> | ||
@@ -128,11 +128,11 @@ </div> | ||
</div> | ||
`,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}"> | ||
`,I.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 v={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 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)}}M.template=` | ||
<div class="${v.input}"> | ||
<div | ||
s-if="hasPrefix" | ||
class="${m.inputPrefix}" | ||
class="${v.inputPrefix}" | ||
> | ||
<slot name="prefix"></slot> | ||
</div> | ||
<div class="${m.inputWrapper}"> | ||
<div class="${v.inputWrapper}"> | ||
<input | ||
@@ -144,3 +144,3 @@ type="input" | ||
s-bind="nativeAttributes" | ||
class="${m.inputReal}" | ||
class="${v.inputReal}" | ||
on-input="handleInput" | ||
@@ -152,3 +152,3 @@ on-change="handleChange" | ||
s-if="hasSuffix" | ||
class="${m.inputSuffix}" | ||
class="${v.inputSuffix}" | ||
> | ||
@@ -158,3 +158,3 @@ <slot name="suffix"></slot> | ||
</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 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=` | ||
`;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 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(A=>{A.constructor.name==="TabsItem"&&t.push(A)}),this.data.set("paneList",t);const e=this.data.get("index"),a=this.data.get("labelList"),i=this;let o=0;a.forEach((A,F)=>{var U;const Y=(U=i.ref("label"+F))==null?void 0:U.offsetWidth;A.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)}}T.trimWhitespace="all",T.template=` | ||
<div class="${u.tabs}"> | ||
@@ -184,3 +184,3 @@ <div class="${u.tabsNav}"> | ||
</div> | ||
`,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=` | ||
`,T.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 | ||
@@ -193,3 +193,3 @@ s-show="active" | ||
</div> | ||
`;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=` | ||
`;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 y 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}}y.template=` | ||
<table class="${b.table}"> | ||
@@ -200,9 +200,9 @@ <slot name="header"></slot> | ||
</table> | ||
`,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=` | ||
`,y.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 C extends n.Component{inited(){this.dispatch(q,null)}updateSelectAllState(t){this.tr&&this.tr.data.set("selected",t)}initData(){return{}}}C.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=` | ||
`,C.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> | ||
`,_.messages={"click:table-tfoot-item"(){this.fire("click")}};class S extends n.Component{initData(){return{colspan:1}}}S.template=` | ||
`,_.messages={"click:table-tfoot-item"(){this.fire("click")}};class k extends n.Component{initData(){return{colspan:1}}}k.template=` | ||
<td san-if="colspan !== 1" colspan="{{colspan}}" class="${b.td}"> | ||
@@ -214,3 +214,3 @@ <slot></slot> | ||
</td> | ||
`;class L extends n.Component{initData(){return{width:""}}}L.template=` | ||
`;class S extends n.Component{initData(){return{width:""}}}S.template=` | ||
<th width="{{width}}" class="${b.th}"><slot></slot></th> | ||
@@ -245,7 +245,7 @@ `;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> | ||
`,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=` | ||
`,f.components={"cc-td":k,"cc-th":S},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 L 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}}L.template=` | ||
<tbody> | ||
<slot></slot> | ||
</tbody> | ||
`,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=` | ||
`,L.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 D extends n.Component{initData(){return{selectable:"single",data:[],field:[]}}select(t){this.fire("select",t)}}D.template=` | ||
<cc-table selectable="{{selectable}}" on-select="select($event)"> | ||
@@ -263,2 +263,2 @@ <cc-thead> | ||
</cc-table> | ||
`,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"}})}); | ||
`,D.components={"cc-tr":f,"cc-th":S,"cc-td":k,"cc-tbody":L,"cc-thead":C,"cc-table":y},D.filters={renderField(s,t){return typeof s.content=="function"?s.content.call(this,t):s.prop?t[s.prop]:""}},l.Button=E,l.Col=x,l.ConfigurableTable=D,l.Divider=P,l.Image=I,l.Input=M,l.Paragraph=N,l.Row=W,l.Swiper=w,l.SwiperItem=O,l.TBody=L,l.TD=k,l.TFoot=_,l.TH=S,l.THead=C,l.TR=f,l.Table=y,l.Tabs=T,l.TabsItem=j,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
@@ -52,3 +52,3 @@ import { Component } from "san"; | ||
<button | ||
class="${style.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${style.button} {{disabled ? ${style.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -55,0 +55,0 @@ name="{{name}}" |
@@ -30,86 +30,2 @@ import { Component } from "san"; | ||
}; | ||
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 { | ||
@@ -131,3 +47,3 @@ initData() { | ||
let parent = this.parent; | ||
while (parent && !(parent instanceof Row)) { | ||
while (parent && !parent.isGridRow) { | ||
parent = parent.parent; | ||
@@ -134,0 +50,0 @@ } |
@@ -48,2 +48,5 @@ import { Component } from "san"; | ||
} | ||
inited() { | ||
this.isGridRow = true; | ||
} | ||
} | ||
@@ -50,0 +53,0 @@ Row.template = ` |
@@ -53,3 +53,3 @@ import { Component, DataTypes } from "san"; | ||
<button | ||
class="${style$6.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${style$6.button} {{disabled ? ${style$6.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -175,2 +175,73 @@ name="{{name}}" | ||
}; | ||
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.isGridRow) { | ||
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; | ||
} | ||
}; | ||
class Row extends Component { | ||
@@ -194,2 +265,5 @@ initData() { | ||
} | ||
inited() { | ||
this.isGridRow = true; | ||
} | ||
} | ||
@@ -261,73 +335,2 @@ Row.template = ` | ||
}; | ||
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"; | ||
@@ -334,0 +337,0 @@ const swiperContainer = "cos-swiper-container"; |
{ | ||
"name": "@cosmic-design/san", | ||
"version": "0.1.1-beta.a57cb4c", | ||
"version": "0.1.1-beta.bc2614d", | ||
"scripts": { | ||
@@ -32,3 +32,3 @@ "build": "node ./script/build.js", | ||
"dependencies": { | ||
"@cosmic-design/style": "0.1.1-beta.a57cb4c", | ||
"@cosmic-design/style": "0.1.1-beta.bc2614d", | ||
"prismjs": "~1.27.0", | ||
@@ -35,0 +35,0 @@ "san": "~3.11.1" |
@@ -16,3 +16,3 @@ /** | ||
<button | ||
class="${style.button} {{disabled ? 'cos-disabled' : ''}}" | ||
class="${style.button} {{disabled ? ${style.disabled} : ''}}" | ||
type="{{type}}" | ||
@@ -19,0 +19,0 @@ name="{{name}}" |
@@ -12,3 +12,2 @@ /** | ||
import style from '@cosmic-design/style/grid.module.css'; | ||
import Row from '../Row/index'; | ||
@@ -92,3 +91,3 @@ export default class Col extends Component { | ||
let parent = this.parent; | ||
while (parent && !(parent instanceof Row)) { | ||
while (parent && !parent.isGridRow) { | ||
parent = parent.parent; | ||
@@ -95,0 +94,0 @@ } |
@@ -114,2 +114,7 @@ /** | ||
} | ||
inited() { | ||
// @ts-ignore | ||
this.isGridRow = true; | ||
} | ||
} |
604901
9182
+ Added@cosmic-design/style@0.1.1-beta.bc2614d(transitive)
- Removed@cosmic-design/style@0.1.1-beta.a57cb4c(transitive)