ant-design-x-vue
Version:
Craft AI-driven interfaces effortlessly
2 lines (1 loc) • 4.27 kB
JavaScript
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("../../_util/cssinjs/StyleContext.js");require("vue");const S=require("../../_util/cssinjs/util.js");require("../../_util/cssinjs/theme/ThemeCache.js");require("../../_util/warning.js");require("../../_util/cssinjs/transformers/legacyLogicalProperties.js");const h=require("../../_util/cssinjs-utils/util/statistic.js"),p=require("../../theme/genStyleUtils.js");require("../../transition-collapse/index.js");const a=require("../interface.js"),g=require("../../transition-collapse/style/index.js"),f=e=>{const{componentCls:t}=e,i=`${t}-item`,l={[a.THOUGHT_CHAIN_ITEM_STATUS.PENDING]:e.colorPrimaryText,[a.THOUGHT_CHAIN_ITEM_STATUS.SUCCESS]:e.colorSuccessText,[a.THOUGHT_CHAIN_ITEM_STATUS.ERROR]:e.colorErrorText},r=Object.keys(l);return r.reduce((c,o)=>{const m=l[o];return r.forEach(n=>{const d=`& ${i}-${o}-${n}`,u=o===n?{}:{backgroundColor:"none !important",backgroundImage:`linear-gradient(${m}, ${l[n]})`};c[d]={[`& ${i}-icon, & > *::before`]:{backgroundColor:`${m} !important`},"& > :last-child::before":u}}),c},{})},z=e=>{const{calc:t,componentCls:i}=e,l=`${i}-item`,r={content:'""',width:t(e.lineWidth).mul(2).equal(),display:"block",position:"absolute",insetInlineEnd:"none",backgroundColor:e.colorTextPlaceholder};return{"& > :last-child > :last-child":{"&::before":{display:"none !important"},[`&${l}-footer`]:{"&::before":{display:"block !important",bottom:0}}},[`& > ${l}`]:{[`& ${l}-header, & ${l}-content, & ${l}-footer`]:{position:"relative","&::before":{bottom:t(e.itemGap).mul(-1).equal()}},[`& ${l}-header, & ${l}-content`]:{marginInlineStart:t(e.itemSize).mul(-1).equal(),"&::before":{...r,insetInlineStart:t(e.itemSize).div(2).sub(e.lineWidth).equal()}},[`& ${l}-header::before`]:{top:e.itemSize,bottom:t(e.itemGap).mul(-2).equal()},[`& ${l}-content::before`]:{top:"100%"},[`& ${l}-footer::before`]:{...r,top:0,insetInlineStart:t(e.itemSize).div(-2).sub(e.lineWidth).equal()}}}},$=e=>{const{componentCls:t}=e,i=`${t}-item`;return{[i]:{display:"flex",flexDirection:"column",[`& ${i}-collapsible`]:{cursor:"pointer"},[`& ${i}-header`]:{display:"flex",marginBottom:e.itemGap,gap:e.itemGap,alignItems:"flex-start",[`& ${i}-icon`]:{height:e.itemSize,width:e.itemSize,fontSize:e.itemFontSize,display:"flex",justifyContent:"center",alignItems:"center"},[`& ${i}-extra`]:{height:e.itemSize,maxHeight:e.itemSize},[`& ${i}-header-box`]:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden",[`& ${i}-title`]:{height:e.itemSize,lineHeight:`${S.unit(e.itemSize)}`,maxHeight:e.itemSize,fontSize:e.itemFontSize,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",[`& ${i}-collapse-icon`]:{marginInlineEnd:e.marginXS}},[`& ${i}-desc`]:{fontSize:e.itemFontSize,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},[`& ${i}-content`]:{[`& ${i}-content-hidden`]:{display:"none"},[`& ${i}-content-box`]:{padding:e.itemGap,display:"inline-block",maxWidth:`calc(100% - ${e.itemSize})`,borderRadius:e.borderRadiusLG,backgroundColor:e.colorBgContainer,border:`${S.unit(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}},[`& ${i}-footer`]:{marginTop:e.itemGap,display:"inline-flex"}}}},s=(e,t="middle")=>{const{componentCls:i}=e,l={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}}[t];return{[`&${i}-${t}`]:{paddingInlineStart:l.itemSize,gap:l.itemGap,...$({...e,...l}),...z({...e,...l})}}},b=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexDirection:"column",...f(e),...s(e),...s(e,"large"),...s(e,"small"),[`&${t}-rtl`]:{direction:"rtl"}}}},T=p.genStyleHooks("ThoughtChain",e=>{const t=h.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[b(t),g.genTransitionCollapseStyle(t)]});exports.default=T;
;