ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
2 lines (1 loc) • 7.05 kB
JavaScript
;Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../../chunks/module-chunk.js");require("../../_util/cssinjs/StyleContext.js");require("vue");const m=require("../../_util/cssinjs/util.js"),f=require("../../_util/cssinjs/Keyframes.js");require("../../_util/cssinjs/theme/ThemeCache.js");require("../../_util/warning.js");require("../../_util/cssinjs/transformers/legacyLogicalProperties.js");const C=require("../../_util/cssinjs-utils/util/statistic.js"),x=require("../../theme/genStyleUtils.js");require("../../transition-collapse/index.js");const c=require("../interface.js"),z=require("./item.js"),_=require("../../transition-collapse/style/index.js"),p=new f.default("antXThoughtChainBlink",{"0%":{backgroundPositionX:"-200%",backgroundPositionY:"100%"},"25%":{backgroundPositionX:"-100%",backgroundPositionY:"100%"},"50%":{backgroundPositionX:"0%",backgroundPositionY:"100%"},"75%":{backgroundPositionX:"100%",backgroundPositionY:"100%"},"100%":{backgroundPositionX:"200%",backgroundPositionY:"100%"}}),y=e=>{const{componentCls:o}=e,t=`${o}-item`,i={[c.THOUGHT_CHAIN_ITEM_STATUS.LOADING]:e.colorPrimaryText,[c.THOUGHT_CHAIN_ITEM_STATUS.SUCCESS]:e.colorSuccessText,[c.THOUGHT_CHAIN_ITEM_STATUS.ERROR]:e.colorErrorText,[c.THOUGHT_CHAIN_ITEM_STATUS.ABORT]:e.colorTextSecondary,[c.THOUGHT_CHAIN_ITEM_STATUS.PENDING]:e.colorPrimaryText},r=Object.keys(i);return r.reduce((l,a)=>{const d=i[a];return r.forEach(s=>{const u=`& ${t}-${a}-${s}`,g=a===s?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${d}, ${i[s]})`};l[u]={[`& ${t}-icon, & > *::before`]:{backgroundColor:`${d} !important`},"& > :last-child::before":g}}),l},{})},G=e=>{const{calc:o,componentCls:t}=e,i=`${t}-item`,r={content:'""',width:o(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${i}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${i}`]:{[`& ${i}-header, & ${i}-content, & ${i}-footer`]:{position:"relative","&::before":{bottom:o(e.itemGap).mul(-1).equal()}},[`& ${i}-header, & ${i}-content`]:{marginInlineStart:o(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:o(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${i}-header::before`]:{top:e.itemSize,bottom:o(e.itemGap).mul(-2).equal()},[`& ${i}-content::before`]:{top:"100%"},[`& ${i}-footer::before`]:{...r,top:0,insetInlineStart:o(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},I=e=>{const{componentCls:o}=e,t=`${o}-item`;return{[t]:{display:"flex",flexDirection:"column",[`& ${t}-collapsible`]:{cursor:"pointer"},[`& ${t}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${t}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${t}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${t}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${t}-title`]:{height:e.itemSize,lineHeight:`${m.unit(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",[`& ${t}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${t}-desc`]:{fontSize:e.itemFontSize,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},[`& ${t}-content`]:{[`& ${t}-content-hidden`]:{display:"none"},[`& ${t}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${m.unit(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${t}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},S=(e,o="middle")=>{const{componentCls:t}=e,i={large:{itemSize:e.itemSizeLG,itemGap:e.itemGapLG,itemFontSize:e.itemFontSizeLG},middle:{itemSize:e.itemSize,itemGap:e.itemGap,itemFontSize:e.itemFontSize},small:{itemSize:e.itemSizeSM,itemGap:e.itemGapSM,itemFontSize:e.itemFontSizeSM}}[o];return{[`&${t}-${o}`]:{paddingInlineStart:i.itemSize,gap:i.itemGap,...I({...e,...i}),...G({...e,...i})}}},H=e=>{const{calc:o,componentCls:t}=e,i=`${t}-item`,r=o(e.lineWidth).mul(2).equal(),l={width:0,backgroundColor:"transparent !important",backgroundImage:"none !important"};return{[`&${t}-line-false`]:{[`& > ${i}`]:{[`& ${i}-header, & ${i}-content, & ${i}-footer`]:{"&::before":{display:"none !important"}}}},[`&${t}-line-dashed`]:{[`& > ${i}`]:{[`& ${i}-header::before, & ${i}-content::before, & ${i}-footer::before`]:{...l,borderInlineStart:`${m.unit(r)} dashed ${e.colorTextPlaceholder}`}}},[`&${t}-line-dotted`]:{[`& > ${i}`]:{[`& ${i}-header::before, & ${i}-content::before, & ${i}-footer::before`]:{...l,borderInlineStart:`${m.unit(r)} dotted ${e.colorTextPlaceholder}`}}}}},F=e=>{const{componentCls:o}=e;return{[o]:{display:"flex",flexDirection:"column",...y(e),...S(e),...S(e,"large"),...S(e,"small"),...H(e),[`${o}-motion-blink`]:{backgroundClip:"text",color:e.colorTextBlinkDefault,WebkitBackgroundClip:"text",backgroundImage:`linear-gradient(90deg,transparent,${e.colorTextBlink},transparent)`,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationFillMode:"forwards",backgroundSize:"50%",backgroundRepeat:"no-repeat",animationName:p},[`&${o}-rtl`]:{direction:"rtl"}}}},h=e=>{const o=new n.FastColor(e.colorTextDescription).setA(.25).toRgbString(),t=e.colorTextDescription,i=e.colorTextBase,r=new n.FastColor(e.colorErrorText).setA(.45).toRgbString(),l=new n.FastColor(e.colorErrorText).setA(.45).toRgbString(),a=new n.FastColor(e.colorFillTertiary).setA(.06).toRgbString(),d=new n.FastColor(e.colorErrorText).setA(.25).toRgbString(),s=new n.FastColor(e.colorTextDescription).setA(.25).toRgbString(),u=new n.FastColor(e.colorText).setA(.45).toRgbString(),g=new n.FastColor(e.colorErrorBg).setA(.25).toRgbString(),b=a,T=new n.FastColor(e.colorSuccess).setA(.45).toRgbString(),$=new n.FastColor(e.colorPrimary).setA(.45).toRgbString();return{colorDescriptionDisabled:s,colorPrimaryDisabled:$,colorSuccessDisabled:T,colorTitleDisabled:u,colorErrorTextDisabled:l,colorErrorBgDisabled:g,colorErrorTextDescriptionDisabled:d,itemMotionDescription:o,colorTextBlinkDefault:t,colorTextBlink:i,itemSolidBg:e.colorFillTertiary,itemSolidHoverBg:a,itemOutlinedBg:e.colorBgContainer,itemOutlinedHoverBg:b,itemBorderRadius:e.borderRadius,colorErrorTextDescription:r}},q=x.genStyleHooks("ThoughtChain",e=>{const o=C.merge(e,{itemFontSizeSM:e.fontSizeSM,itemSizeSM:e.calc(e.controlHeightXS).add(e.controlHeightSM).div(2).equal(),itemGapSM:e.marginSM,itemFontSize:e.fontSize,itemSize:e.calc(e.controlHeightSM).add(e.controlHeight).div(2).equal(),itemGap:e.margin,itemFontSizeLG:e.fontSizeLG,itemSizeLG:e.calc(e.controlHeight).add(e.controlHeightLG).div(2).equal(),itemGapLG:e.marginLG});return[p,F(o),z.default(o),_.genTransitionCollapseStyle(o)]},h);exports.default=q;exports.prepareComponentToken=h;