Files
weiguang-jewelry-ledger/新账系统/web/dist/assets/card-NznhFUfe.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
45 KiB
JavaScript
Raw Normal View History

import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{$n as t,An as n,B as r,Cn as i,En as a,Ft as o,Jt as s,Kn as c,Kt as l,On as u,Ot as d,Qn as f,Qt as p,Rt as m,St as h,Vn as g,Vt as _,Wt as v,Xn as y,Xt as b,Zn as x,_t as S,cn as C,in as w,kn as T,kt as E,nn as D,qn as O,qt as k,tn as A,tr as j,wn as M,xt as N}from"./index-CPt4N9y-.js";import{c as P,i as F,p as I,r as L,u as R}from"./input-D3_oYg2w.js";import{C as z,T as B,y as V}from"./TextArea-D9hZdiQK.js";var H=e(j()),U=e(t()),W={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z`}},{tag:`path`,attrs:{d:`M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z`}}]},name:`plus`,theme:`outlined`},G=H.forwardRef(function(e,t){return H.createElement(m,f({},e,{ref:t,icon:W}))}),K=(0,H.createContext)(null),q=function(e){var t=e.activeTabOffset,n=e.horizontal,r=e.rtl,i=e.indicator,a=i===void 0?{}:i,o=a.size,s=a.align,c=s===void 0?`center`:s,l=(0,H.useState)(),d=u(l,2),f=d[0],p=d[1],m=(0,H.useRef)(),h=H.useCallback(function(e){return typeof o==`function`?o(e):typeof o==`number`?o:e},[o]);function g(){T.cancel(m.current)}return(0,H.useEffect)(function(){var e={};if(t){if(n){e.width=h(t.width);var i=r?`right`:`left`;c===`start`&&(e[i]=t[i]),c===`center`&&(e[i]=t[i]+t.width/2,e.transform=r?`translateX(50%)`:`translateX(-50%)`),c===`end`&&(e[i]=t[i]+t.width,e.transform=`translateX(-100%)`)}else e.height=h(t.height),c===`start`&&(e.top=t.top),c===`center`&&(e.top=t.top+t.height/2,e.transform=`translateY(-50%)`),c===`end`&&(e.top=t.top+t.height,e.transform=`translateY(-100%)`)}return g(),m.current=T(function(){f&&e&&Object.keys(e).every(function(t){var n=e[t],r=f[t];return typeof n==`number`&&typeof r==`number`?Math.round(n)===Math.round(r):n===r})||p(e)}),g},[JSON.stringify(t),n,r,c,h]),{style:f}},J={width:0,height:0,left:0,top:0};function ee(e,t,n){return(0,H.useMemo)(function(){for(var n=new Map,r=t.get(e[0]?.key)||J,i=r.left+r.width,a=0;a<e.length;a+=1){var o=e[a].key,s=t.get(o);s||=t.get(e[a-1]?.key)||J;var l=n.get(o)||c({},s);l.right=i-l.left-l.width,n.set(o,l)}return n},[e.map(function(e){return e.key}).join(`_`),t,n])}function Y(e,t){var n=H.useRef(e),r=H.useState({}),i=u(r,2)[1];function a(e){var r=typeof e==`function`?e(n.current):e;r!==n.current&&t(r,n.current),n.current=r,i({})}return[n.current,a]}var te=.1,ne=.01,re=20,ie=.995**re;function ae(e,t){var n=(0,H.useState)(),r=u(n,2),i=r[0],a=r[1],o=(0,H.useState)(0),s=u(o,2),c=s[0],l=s[1],d=(0,H.useState)(0),f=u(d,2),p=f[0],m=f[1],h=(0,H.useState)(),g=u(h,2),_=g[0],v=g[1],y=(0,H.useRef)();function b(e){var t=e.touches[0];a({x:t.screenX,y:t.screenY}),window.clearInterval(y.current)}function x(e){if(i){var n=e.touches[0],r=n.screenX,o=n.screenY;a({x:r,y:o});var s=r-i.x,u=o-i.y;t(s,u);var d=Date.now();l(d),m(d-c),v({x:s,y:u})}}function S(){if(i&&(a(null),v(null),_)){var e=_.x/p,n=_.y/p;if(Math.max(Math.abs(e),Math.abs(n))<te)return;var r=e,o=n;y.current=window.setInterval(function(){Math.abs(r)<ne&&Math.abs(o)<ne?window.clearInterval(y.current):(r*=ie,o*=ie,t(r*re,o*re))},re)}}var C=(0,H.useRef)();function w(e){var n=e.deltaX,r=e.deltaY,i=0,a=Math.abs(n),o=Math.abs(r);a===o?i=C.current===`x`?n:r:a>o?(i=n,C.current=`x`):(i=r,C.current=`y`),t(-i,-i)&&e.preventDefault()}var T=(0,H.useRef)(null);T.current={onTouchStart:b,onTouchMove:x,onTouchEnd:S,onWheel:w},H.useEffect(function(){function t(e){T.current.onTouchStart(e)}function n(e){T.current.onTouchMove(e)}function r(e){T.current.onTouchEnd(e)}function i(e){T.current.onWheel(e)}return document.addEventListener(`touchmove`,n,{passive:!1}),document.addEventListener(`touchend`,r,{passive:!0}),e.current.addEventListener(`touchstart`,t,{passive:!0}),e.current.addEventListener(`wheel`,i,{passive:!1}),function(){document.removeEventListener(`touchmove`,n),document.removeEventListener(`touchend`,r)}},[])}function oe(e){var t=(0,H.useState)(0),n=u(t,2),r=n[0],a=n[1],o=(0,H.useRef)(0),s=(0,H.useRef)();return s.current=e,i(function(){var e;(e=s.current)==null||e.call(s)},[r]
right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav,
> div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:`column`,minWidth:s(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:a,textAlign:`center`},[`${t}-tab + ${t}-tab`]:{margin:o},[`${t}-nav-wrap`]:{flexDirection:`column`,"&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:`1 0 auto`,flexDirection:`column`}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:M(s(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${M(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:s(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${M(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},Z=e=>{let{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,cardHeightSM:i,cardHeightLG:a,horizontalItemPaddingSM:o,horizontalItemPaddingLG:s}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:o,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:s,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:i,minHeight:i}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${M(e.borderRadius)} ${M(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${M(e.borderRadius)} ${M(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${M(e.borderRadius)} ${M(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${M(e.borderRadius)} 0 0 ${M(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},Ve=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:i,tabsHorizontalItemMargin:a,horizontalItemPadding:o,itemSelectedColor:c,itemColor:l}=e,u=`${t}-tab`;return{[u]:{position:`relative`,WebkitTouchCallout:`none`,WebkitTapHighlightColor:`transparent`,display:`inline-flex`,alignItems:`center`,padding:o,fontSize:e.titleFontSize,background:`transparent`,border:0,outline:`none`,cursor:`pointer`,color:l,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:`none`,transition:`all ${e.motionDurationSlow}`,[`${u}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM}},"&-remove":Object.assign({flex:`none`,lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading}},s(e)),"&:hover":{color:r},[`&${u}-active ${u}-btn`]:{color:c,textShadow:e.tabsActiveTextShadow},[`&${u}-focus ${u}-btn:focus-visible`]:k(e),[`&${u}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[
> ${n}-typography,
> ${n}-typography-edit-content
`]:{insetInlineStart:0,marginTop:0,marginBottom:0}}),[`${t}-tabs-top`]:{clear:`both`,marginBottom:a,color:e.colorText,fontWeight:`normal`,fontSize:e.fontSize,"&-bar":{borderBottom:`${M(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})},Ze=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:`
${M(i)} 0 0 0 ${n},
0 ${M(i)} 0 0 ${n},
${M(i)} ${M(i)} 0 0 ${n},
${M(i)} 0 0 0 ${n} inset,
0 ${M(i)} 0 0 ${n} inset;
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},Qe=e=>{let{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:i,colorBorderSecondary:a,actionsBg:o}=e;return Object.assign(Object.assign({margin:0,padding:0,listStyle:`none`,background:o,borderTop:`${M(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${M(e.borderRadiusLG)} ${M(e.borderRadiusLG)}`},l()),{"& > li":{margin:r,color:e.colorTextDescription,textAlign:`center`,"> span":{position:`relative`,display:`block`,minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:`pointer`,"&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:`inline-block`,width:`100%`,color:e.colorIcon,lineHeight:M(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:M(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${M(e.lineWidth)} ${e.lineType} ${a}`}}})},$e=e=>Object.assign(Object.assign({margin:`${M(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`},l()),{"&-avatar":{paddingInlineEnd:e.padding},"&-detail":{overflow:`hidden`,flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":Object.assign({color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},p),"&-description":{color:e.colorTextDescription}}),et=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${M(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${M(e.padding)} ${M(i)}`}}},tt=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},nt=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadowTertiary:a,bodyPadding:o,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},b(e)),{position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:Xe(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:s,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${M(e.borderRadiusLG)} ${M(e.borderRadiusLG)}`},[`${t}-grid`]:Ze(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${M(e.borderRadiusLG)} ${M(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:Qe(e),[`${t}-meta`]:$e(e)}),[`${t}-bordered`]:{border:`${M(e.lineWidth)} ${e.lineType} ${i}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:`pointer`,transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:`transparent`,boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${M(e.borderRadiusLG)} ${M(e.borderRadiusLG)} 0 0 `,[`${t}-body`]:{display:`flex`,flexWrap:`wrap`},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:et(e),[`${t}-loading`]:tt(e),[`${t}-rtl`]:{direction:`rtl`}}},rt=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${M(r)}`,fontSize:a,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:`flex`,alignItems:`center`}}}}},it=v(`Card`,e=>{let t=A(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[nt(t),rt(t)]},e=>({headerBg:`transparent`,headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsM