第6项:统一业务控件、主题与移动布局,保留原生输入和焦点契约
This commit is contained in:
1 parent
ff8b05973a
commit
f30905b236
74 files changed
+3567
-2443
No files matched your search
-270
@@ -1,270 +0,0 @@
|
||||
import{n as e,t}from"./rolldown-runtime-Dl_DZoUm.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=(0,e._result)();t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,t.status===void 0&&(t.status=`fulfilled`,t.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,t.status===void 0&&(t.status=`rejected`,t.reason=n))}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.ChilLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(e){var t=Ge(e);return t===e?We(e):t||Ke(e)||qe()}var Je=function(e){return+setTimeout(e,16)},Ye=function(e){return clearTimeout(e)};typeof window<`u`&&`requestAnimationFrame`in window&&(Je=function(e){return window.requestAnimationFrame(e)},Ye=function(e){return window.cancelAnimationFrame(e)});var Xe=0,Ze=new Map;function Qe(e){Ze.delete(e)}var $e=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Xe+=1;var n=Xe;function r(t){if(t===0)Qe(n),e();else{var i=Je(function(){r(t-1)});Ze.set(n,i)}}return r(t),n};$e.cancel=function(e){var t=Ze.get(e);return Qe(e),Ye(t)};function et(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(Array.isArray(e)&&(n==null||n===(typeof Symbol<`u`&&[][Symbol.iterator])||n===[][`@@iterator`]))return e;if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function tt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z(e,t){return et(e,t)||Ke(e,t)||tt()}function nt(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*0x5bd1e995+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*0x5bd1e995+((n>>>16)*59797<<16)^(t&65535)*0x5bd1e995+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*0x5bd1e995+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*0x5bd1e995+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function rt(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function it(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var at=`data-rc-order`,ot=`data-rc-priority`,st=`rc-util-key`,ct=new Map;function lt(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).mark;return e?e.startsWith(`data-`)?e:`data-${e}`:st}function ut(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function dt(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function ft(e){return Array.from((ct.get(e)||e).children).filter(function(e){return e.tagName===`STYLE`})}function pt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!rt())return null;var n=t.csp,r=t.prepend,i=t.priority,a=i===void 0?0:i,o=dt(r),s=o===`prependQueue`,c=document.createElement(`style`);c.setAttribute(at,o),s&&a&&c.setAttribute(ot,`${a}`),n!=null&&n.nonce&&(c.nonce=n?.nonce),c.innerHTML=e;var l=ut(t),u=l.firstChild;if(r){if(s){var d=(t.styles||ft(l)).filter(function(e){return[`prepend`,`prependQueue`].includes(e.getAttribute(at))?a>=Number(e.getAttribute(ot)||0):!1});if(d.length)return l.insertBefore(c,d[d.length-1].nextSibling),c}l.insertBefore(c,u)}else l.appendChild(c);return c}function mt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=ut(t);return(t.styles||ft(n)).find(function(n){return n.getAttribute(lt(t))===e})}function ht(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=mt(e,t);n&&ut(t).removeChild(n)}function gt(e,t){var n=ct.get(e);if(!n||!it(document,n)){var r=pt(``,t),i=r.parentNode;ct.set(e,i),e.removeChild(r)}}function _t(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=ut(n),i=ft(r),a=O(O({},n),{},{styles:i});gt(r,a);var o=mt(t,a);if(o){var s;return(s=a.csp)!=null&&s.nonce&&o.nonce!==a.csp?.nonce&&(o.nonce=a.csp?.nonce),o.innerHTML!==e&&(o.innerHTML=e),o}var c=pt(e,a);return c.setAttribute(lt(a),t),c}function vt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function yt(e,t){if(e==null)return{};var n,r,i=vt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bt(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new Set;function i(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=r.has(e);if(C(!o,`Warning: There may be circular references`),o)return!1;if(e===t)return!0;if(n&&a>1)return!1;r.add(e);var s=a+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var c=0;c<e.length;c++)if(!i(e[c],t[c],s))return!1;return!0}if(e&&t&&l(e)===`object`&&l(t)===`object`){var u=Object.keys(e);return u.length===Object.keys(t).length&&u.every(function(n){return i(e[n],t[n],s)})}return!1}return i(e,t)}var xt=`%`;function St(e){return e.join(xt)}var Ct=function(){function e(t){Oe(this,e),E(this,`instanceId`,void 0),E(this,`cache`,new Map),E(this,`extracted`,new Set),this.instanceId=t}return Ae(e,[{key:`get`,value:function(e){return this.opGet(St(e))}},{key:`opGet`,value:function(e){return this.cache.get(e)||null}},{key:`update`,value:function(e,t){return this.opUpdate(St(e),t)}},{key:`opUpdate`,value:function(e,t){var n=t(this.cache.get(e));n===null?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),wt=`data-token-hash`,Tt=`data-css-hash`,Et=`__cssinjs_instance__`;function Dt(){var e=Math.random().toString(12).slice(2);if(typeof document<`u`&&document.head&&document.body){var t=document.body.querySelectorAll(`style[data-css-hash]`)||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[Et]=t.__cssinjs_instance__||e,t.__cssinjs_instance__===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll(`style[${Tt}]`)).forEach(function(t){var n=t.getAttribute(Tt);if(r[n]){if(t.__cssinjs_instance__===e){var i;(i=t.parentNode)==null||i.removeChild(t)}}else r[n]=!0})}return new Ct(e)}var Ot=s.createContext({hashPriority:`low`,cache:Dt(),defaultCache:!0});function kt(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var At
Line truncated
|
||||
`;else if(r._keyframe)h(r);else{var c=f.reduce(function(e,t){var n;return(t==null||(n=t.visit)==null?void 0:n.call(t,e))||e},r);Object.keys(c).forEach(function(t){var r=c[t];if(l(r)===`object`&&r&&(t!==`animationName`||!r._keyframe)&&!pr(r)){var d=!1,f=t.trim(),g=!1;(i||a)&&s?f.startsWith(`@`)?d=!0:f=mr(f===`&`?``:t,s,u):i&&!s&&(f===`&`||f===``)&&(f=``,g=!0);var _=Z(e(r,n,{root:g,injectHash:d,parentSelectors:[].concat(X(o),[f])}),2),v=_[0],y=_[1];m=O(O({},m),y),p+=`${f}${v}`}else{function e(e,t){var n=e.replace(/[A-Z]/g,function(e){return`-${e.toLowerCase()}`}),r=t;!dn[e]&&typeof r==`number`&&r!==0&&(r=`${r}px`),e===`animationName`&&t!=null&&t._keyframe&&(h(t),r=t.getName(s)),p+=`${n}:${r};`}var b=r?.value??r;l(r)===`object`&&r!=null&&r[dr]&&Array.isArray(b)?b.forEach(function(n){e(t,n)}):e(t,b)}})}}),i?c&&(p&&=`@layer ${c.name} {${p}}`,c.dependencies&&(m[`@layer ${c.name}`]=c.dependencies.map(function(e){return`@layer ${e}, ${c.name};`}).join(`
|
||||
`))):p=`{${p}}`,[p,m]};function gr(e,t){return nt(`${e.join(`%`)}${t}`)}function _r(){return null}var vr=`style`;function yr(e,t){var n=e.token,r=e.path,i=e.hashId,a=e.layer,o=e.nonce,l=e.clientOnly,u=e.order,d=u===void 0?0:u,f=s.useContext(Ot),p=f.autoClear;f.mock;var m=f.defaultCache,h=f.hashPriority,g=f.container,_=f.ssrInline,v=f.transformers,y=f.linters,b=f.cache,x=f.layer,S=n._tokenKey,C=[S];x&&C.push(`layer`),C.push.apply(C,X(r));var w=Vt,T=Z(Qt(vr,C,function(){var e=C.join(`|`);if(cr(e)){var n=Z(lr(e),2),o=n[0],s=n[1];if(o)return[o,S,s,{},l,d]}var c=Z(hr(t(),{hashId:i,hashPriority:h,layer:x?a:void 0,path:r.join(`-`),transformers:v,linters:y}),2),u=c[0],f=c[1],p=fr(u);return[p,S,gr(C,p),f,l,d]},function(e,t){var n=Z(e,3)[2];(t||p)&&Vt&&ht(n,{mark:Tt,attachTo:g})},function(e){var t=Z(e,4),n=t[0];t[1];var r=t[2],i=t[3];if(w&&n!==`_FILE_STYLE__`){var a={mark:Tt,prepend:!x&&`queue`,attachTo:g,priority:d},s=typeof o==`function`?o():o;s&&(a.csp={nonce:s});var c=[],l=[];Object.keys(i).forEach(function(e){e.startsWith(`@layer`)?c.push(e):l.push(e)}),c.forEach(function(e){_t(fr(i[e]),`_layer-${e}`,O(O({},a),{},{prepend:!0}))});var u=_t(n,r,a);u[Et]=b.instanceId,u.setAttribute(wt,S),l.forEach(function(e){_t(fr(i[e]),`_effect-${e}`,a)})}}),3),D=T[0],k=T[1],A=T[2];return function(e){var t=!_||w||!m?s.createElement(_r,null):s.createElement(`style`,c({},E(E({},wt,k),Tt,A),{dangerouslySetInnerHTML:{__html:D}}));return s.createElement(s.Fragment,null,t,e)}}var br=function(e,t,n){var r=Z(e,6),i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=(n||{}).plain;if(c)return null;var d=i,f={"data-rc-order":`prependQueue`,"data-rc-priority":`${l}`};return d=Ht(i,a,o,f,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var n=Ht(fr(s[e]),a,`_effect-${e}`,f,u);e.startsWith(`@layer`)?d=n+d:d+=n}}),[l,o,d]},xr=`cssVar`,Sr=function(e,t){var n=e.key,r=e.prefix,i=e.unitless,a=e.ignore,o=e.token,c=e.scope,l=c===void 0?``:c,u=(0,s.useContext)(Ot),d=u.cache.instanceId,f=u.container,p=o._tokenKey,m=[].concat(X(e.path),[n,l,p]);return Qt(xr,m,function(){var e=Z(Gt(t(),n,{prefix:r,unitless:i,ignore:a,scope:l}),2),o=e[0],s=e[1];return[o,s,gr(m,s),n]},function(e){var t=Z(e,3)[2];Vt&&ht(t,{mark:Tt,attachTo:f})},function(e){var t=Z(e,3),r=t[1],i=t[2];if(r){var a=_t(r,i,{mark:Tt,prepend:`queue`,attachTo:f,priority:-999});a[Et]=d,a.setAttribute(wt,n)}})};E(E(E({},vr,br),cn,un),xr,function(e,t,n){var r=Z(e,4),i=r[1],a=r[2],o=r[3],s=(n||{}).plain;if(!i)return null;var c=-999;return[c,a,Ht(i,o,a,{"data-rc-order":`prependQueue`,"data-rc-priority":`${c}`},s)]});var Cr=function(){function e(t,n){Oe(this,e),E(this,`name`,void 0),E(this,`style`,void 0),E(this,`_keyframe`,!0),this.name=t,this.style=n}return Ae(e,[{key:`getName`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return e?`${e}-${this.name}`:this.name}}]),e}();function wr(e){return e.notSplit=!0,e}wr([`borderTop`,`borderBottom`]),wr([`borderTop`]),wr([`borderBottom`]),wr([`borderLeft`,`borderRight`]),wr([`borderLeft`]),wr([`borderRight`]);var Tr=(0,s.createContext)({});function Er(e){return Ge(e)||Ke(e)||tt()}function Dr(e,t){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function Or(e,t,n,r){if(!t.length)return n;var i=Er(t),a=i[0],o=i.slice(1),s=!e&&typeof a==`number`?[]:Array.isArray(e)?X(e):O({},e);return r&&n===void 0&&o.length===1?delete s[a][o[0]]:s[a]=Or(s[a],o,n,r),s}function kr(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return t.length&&r&&n===void 0&&!Dr(e,t.slice(0,-1))?e:Or(e,t,n,r)}function Ar(e){return l(e)===`object`&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function jr(e){return Array.isArray(e)?[]:{}}var Mr=typeof Reflect>`u`?Object.keys:Reflect.ownKeys;function Nr(){var e=[...arguments],t=jr(e[0]);return e.forEach(function(e){function n(r,i){var a=new Set(i),o=Dr(e,r),s=Array.isArray(o);if(s||Ar(o)){if(!a.has(o)){a.add(o);var c=Dr(t,r);s?t=kr(t,r,[]):c&&l(c)===`object`||(t=kr(t,r,jr(o))),Mr(o).forEach(function(e){n([].concat(X(r),[e]),a)})}}else t=kr(t,r,o)}n([])}),t}function Pr(){}var Fr=s.createContext({}),Ir=()=>{let e=()=>{};return e.deprecated=Pr,e},Lr=(0,s.createContext)(void 0),Rr={items_per_page:`/ page`,jump_to:`Go to`,jump_to_confirm:`confirm`,page:`Page`,prev_page:`Previous Page`,next_page:`Next Page`,prev_5:`Previous 5 Pages`,next_5:`Next 5 Pages`,prev_3:`Previous 3 Pages`,next_3:`Next 3 Pages`,page_size:`Page Size`},zr=O(O({},{yearFormat:`YYYY`,dayFormat:`D`,cellMeridiemFormat:`A`,monthBeforeYear:!0}),{},{locale:`en_US`,today:`Today`,now:`Now`,backToToday:`Back to today`,ok:`OK`,clear:`Clear`,week:`Week`,month:`Month`,year:`Year`,timeSelect:`select time`,dateSelect:`select date`,weekSelect:`Choose a week`,monthSelect:`Choose a month`,yearSelect:`Choose a year`,decadeSelect:`Choose a decade`,dateFormat:`M/D/YYYY`,dateTimeFormat:`M/D/YYYY HH:mm:ss`,previousMonth:`Previous month (PageUp)`,nextMonth:`Next month (PageDown)`,previousYear:`Last year (Control + left)`,next
Line truncated
|
||||
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
||||
'Noto Color Emoji'`,fontFamilyCode:`'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,fontSize:14,lineWidth:1,lineType:`solid`,motionUnit:.1,motionBase:0,motionEaseOutCirc:`cubic-bezier(0.08, 0.82, 0.17, 1)`,motionEaseInOutCirc:`cubic-bezier(0.78, 0.14, 0.15, 0.86)`,motionEaseOut:`cubic-bezier(0.215, 0.61, 0.355, 1)`,motionEaseInOut:`cubic-bezier(0.645, 0.045, 0.355, 1)`,motionEaseOutBack:`cubic-bezier(0.12, 0.4, 0.29, 1.46)`,motionEaseInBack:`cubic-bezier(0.71, -0.46, 0.88, 0.6)`,motionEaseInQuint:`cubic-bezier(0.755, 0.05, 0.855, 0.06)`,motionEaseOutQuint:`cubic-bezier(0.23, 1, 0.32, 1)`,borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),ni=Math.round;function ri(e,t){let n=e.replace(/^[^(]*\((.*)/,`$1`).replace(/\).*/,``).match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||``,e);return r[3]=n[3]?n[3].includes(`%`)?r[3]/100:r[3]:1,r}var ii=(e,t,n)=>n===0?e:e/100;function ai(e,t){let n=t||255;return e>n?n:e<0?0:e}var oi=class e{constructor(t){E(this,`isValid`,!0),E(this,`r`,0),E(this,`g`,0),E(this,`b`,0),E(this,`a`,1),E(this,`_h`,void 0),E(this,`_s`,void 0),E(this,`_l`,void 0),E(this,`_v`,void 0),E(this,`_max`,void 0),E(this,`_min`,void 0),E(this,`_brightness`,void 0);function n(e){return e[0]in t&&e[1]in t&&e[2]in t}if(t){if(typeof t==`string`){let e=t.trim();function n(t){return e.startsWith(t)}/^#?[A-F\d]{3,8}$/i.test(e)?this.fromHexString(e):n(`rgb`)?this.fromRgbString(e):n(`hsl`)?this.fromHslString(e):(n(`hsv`)||n(`hsb`))&&this.fromHsvString(e)}else if(t instanceof e)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n(`rgb`))this.r=ai(t.r),this.g=ai(t.g),this.b=ai(t.b),this.a=typeof t.a==`number`?ai(t.a,1):1;else if(n(`hsl`))this.fromHsl(t);else if(n(`hsv`))this.fromHsv(t);else throw Error(`@ant-design/fast-color: unsupported input `+JSON.stringify(t))}}setR(e){return this._sc(`r`,e)}setG(e){return this._sc(`g`,e)}setB(e){return this._sc(`b`,e)}setA(e){return this._sc(`a`,e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(this._h===void 0){let e=this.getMax()-this.getMin();this._h=e===0?0:ni(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(this._s===void 0){let e=this.getMax()-this.getMin();this._s=e===0?0:e/this.getMax()}return this._s}getLightness(){return this._l===void 0&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return this._v===void 0&&(this._v=this.getMax()/255),this._v}getBrightness(){return this._brightness===void 0&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:ni(i(`r`)),g:ni(i(`g`)),b:ni(i(`b`)),a:ni(i(`a`)*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>ni((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r(`r`),g:r(`g`),b:r(`b`),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e=`#`,t=(this.r||0).toString(16);e+=t.length===2?t:`0`+t;let n=(this.g||0).toString(16);e+=n.length===2?n:`0`+n;let r=(this.b||0).toString(16);if(e+=r.length===2?r:`0`+r,typeof this.a==`number`&&this.a>=0&&this.a<1){let t=ni(this.a*255).toString(16);e+=t.length===2?t:`0`+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=ni(this.getSaturation()*100),n=ni(this.getLightness()*100);return this.a===1?`hsl(${e},${t}%,${n}%)`:`hsla(${e},${t}%,${n}%,${this.a})`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${this.a})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=ai(t,n),r}_c(e){return new this.constructor(e)}getMax(){return this._max===void 0&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return this._min===void 0&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace(`#`,``);functio
Line truncated
|
||||
:root {
|
||||
${Object.keys(n).map(t=>`--${e}-${t}: ${n[t]};`).join(`
|
||||
`)}
|
||||
}
|
||||
`.trim()}function _a(e,t){let n=ga(e,t);rt()&&_t(n,`${ha}-dynamic-theme`)}var va=s.createContext(!1),ya=({children:e,disabled:t})=>{let n=s.useContext(va);return s.createElement(va.Provider,{value:t??n},e)},ba=s.createContext(void 0),xa=({children:e,size:t})=>{let n=s.useContext(ba);return s.createElement(ba.Provider,{value:t||n},e)},Sa=Ae(function e(){Oe(this,e)}),Ca=`CALC_UNIT`,wa=new RegExp(Ca,`g`);function Ta(e){return typeof e==`number`?`${e}${Ca}`:e}var Ea=function(e){Me(n,e);var t=Le(n);function n(e,r){var i;Oe(this,n),i=t.call(this),E(Fe(i),`result`,``),E(Fe(i),`unitlessCssVar`,void 0),E(Fe(i),`lowPriority`,void 0);var a=l(e);return i.unitlessCssVar=r,e instanceof n?i.result=`(${e.result})`:a===`number`?i.result=Ta(e):a===`string`&&(i.result=e),i}return Ae(n,[{key:`add`,value:function(e){return e instanceof n?this.result=`${this.result} + ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} + ${Ta(e)}`),this.lowPriority=!0,this}},{key:`sub`,value:function(e){return e instanceof n?this.result=`${this.result} - ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} - ${Ta(e)}`),this.lowPriority=!0,this}},{key:`mul`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} * ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} * ${e}`),this.lowPriority=!1,this}},{key:`div`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} / ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} / ${e}`),this.lowPriority=!1,this}},{key:`getResult`,value:function(e){return this.lowPriority||e?`(${this.result})`:this.result}},{key:`equal`,value:function(e){var t=this,n=(e||{}).unit,r=!0;return typeof n==`boolean`?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(wa,r?`px`:``),this.lowPriority===void 0?this.result:`calc(${this.result})`}}]),n}(Sa),Da=function(e){Me(n,e);var t=Le(n);function n(e){var r;return Oe(this,n),r=t.call(this),E(Fe(r),`result`,0),e instanceof n?r.result=e.result:typeof e==`number`&&(r.result=e),r}return Ae(n,[{key:`add`,value:function(e){return e instanceof n?this.result+=e.result:typeof e==`number`&&(this.result+=e),this}},{key:`sub`,value:function(e){return e instanceof n?this.result-=e.result:typeof e==`number`&&(this.result-=e),this}},{key:`mul`,value:function(e){return e instanceof n?this.result*=e.result:typeof e==`number`&&(this.result*=e),this}},{key:`div`,value:function(e){return e instanceof n?this.result/=e.result:typeof e==`number`&&(this.result/=e),this}},{key:`equal`,value:function(){return this.result}}]),n}(Sa),Oa=function(e,t){var n=e===`css`?Ea:Da;return function(e){return new n(e,t)}},ka=function(e,t){return`${[t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`)].filter(Boolean).join(`-`)}`};function Aa(e){var t=s.useRef();return t.current=e,s.useCallback(function(){var e,n=[...arguments];return(e=t.current)?.call.apply(e,[t].concat(n))},[])}function ja(e){var t=s.useRef(!1),n=Z(s.useState(e),2),r=n[0],i=n[1];s.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(e,n){n&&t.current||i(e)}return[r,a]}function Ma(e){return e!==void 0}function Na(e,t){var n=t||{},r=n.defaultValue,i=n.value,a=n.onChange,o=n.postState,s=Z(ja(function(){return Ma(i)?i:Ma(r)?typeof r==`function`?r():r:typeof e==`function`?e():e}),2),c=s[0],l=s[1],u=i===void 0?c:i,d=o?o(u):u,f=Aa(a),p=Z(ja([u]),2),m=p[0],h=p[1];return Jt(function(){var e=m[0];c!==e&&f(c,e)},[m]),Jt(function(){Ma(i)||l(i)},[i]),[d,Aa(function(e,t){l(e,t),h([u],t)})]}function Pa(e,t,n,r){var i=O({},t[e]);r!=null&&r.deprecatedTokens&&r.deprecatedTokens.forEach(function(e){var t=Z(e,2),n=t[0],r=t[1];(i!=null&&i[n]||i!=null&&i[r])&&(i[r]??(i[r]=i?.[n]))});var a=O(O({},n),i);return Object.keys(a).forEach(function(e){a[e]===t[e]&&delete a[e]}),a}var Fa=typeof CSSINJS_STATISTIC<`u`,Ia=!0;function La(){var e=[...arguments];if(!Fa)return Object.assign.apply(Object,[{}].concat(e));Ia=!1;var t={};return e.forEach(function(e){l(e)===`object`&&Object.keys(e).forEach(function(n){Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){return e[n]}})})}),Ia=!0,t}var Ra={};function za(){}var Ba=function(e){var t,n=e,r=za;return Fa&&typeof Proxy<`u`&&(t=new Set,n=new Proxy(e,{get:function(e,n){if(Ia){var r;(r=t)==null||r.add(n)}return e[n]}}),r=function(e,n){Ra[e]={global:Array.from(t),component:O(O({},Ra[e]?.component),n)}}),{token:n,keys:t,flush:r}};function Va(e,t,n){return typeof n==`function`?n(La(t,t[e]??{})):n??{}}function Ha(e){return e===`js`?{max:Math.max,min:Math.min}:{max:function(){return`max(${[...arguments].map(function(e){return Q(e)}).join(`,`)})`},min:function(){return`min(${[...arguments].map(function(e){return Q(e)}).join(Line truncated
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowSecondary:`
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowTertiary:`
|
||||
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
||||
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
||||
0 2px 4px 0 rgba(0, 0, 0, 0.02)
|
||||
`,screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:a,screenXLMin:a,screenXLMax:1599,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:`2px 2px 5px rgba(0, 0, 0, 0.05)`,boxShadowCard:`
|
||||
0 1px 2px -2px ${new oi(`rgba(0, 0, 0, 0.16)`).toRgbString()},
|
||||
0 3px 6px 0 ${new oi(`rgba(0, 0, 0, 0.12)`).toRgbString()},
|
||||
0 5px 12px 4px ${new oi(`rgba(0, 0, 0, 0.09)`).toRgbString()}
|
||||
`,boxShadowDrawerRight:`
|
||||
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
||||
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
||||
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerLeft:`
|
||||
6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
||||
3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
||||
9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerUp:`
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerDown:`
|
||||
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowTabsOverflowLeft:`inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowRight:`inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowTop:`inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowBottom:`inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)`}),r)}var eo=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},to={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},no={motionBase:!0,motionUnit:!0},ro={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},io=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:i}=t,a=eo(t,[`override`]),o=Object.assign(Object.assign({},r),{override:i});return o=$a(o),a&&Object.entries(a).forEach(([e,t])=>{let{theme:n}=t,r=eo(t,[`theme`]),i=r;n&&(i=io(Object.assign(Object.assign({},o),r),{override:r},n)),o[e]=i}),o};function ao(){let{token:e,hashed:t,theme:n,override:r,cssVar:i}=s.useContext(ca),a=`${Ya}-${t||``}`,o=n||oa,[c,l,u]=ln(o,[ti,e],{salt:a,override:r,getComputedToken:io,formatToken:$a,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:to,ignore:no,preserve:ro}});return[o,u,t?l:``,c,i]}var oo={overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},so=(e,t=!1)=>({boxSizing:`border-box`,margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:`none`,fontFamily:t?`inherit`:e.fontFamily}),co=()=>({display:`inline-flex`,alignItems:`center`,color:`inherit`,fontStyle:`normal`,lineHeight:0,textAlign:`center`,textTransform:`none`,verticalAlign:`-0.125em`,textRendering:`optimizeLegibility`,"-webkit-font-smoothing":`antialiased`,"-moz-osx-font-smoothing":`grayscale`,"> *":{lineHeight:1},svg:{display:`inline-block`}}),lo=()=>({"&::before":{display:`table`,content:`""`},"&::after":{display:`table`,clear:`both`,content:`""`}}),uo=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:`transparent`,outline:`none`,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":`objects`,"&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:`not-allowed`}}}),fo=(e,t,n,r)=>{let i=`[class^="${t}"], [class*=" ${t}"]`,a=n?`.${n}`:i,o={boxSizing:`border-box`,"&::before, &::after":{boxSizing:`border-box`}},s={};return r!==!1&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},po=(e,t)=>({outline:`${Q(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:`outline-offset 0s, outline 0s`}),mo=(e,t)=>({"&:focus-visible":po(e,t)}),ho=e=>({[`.${e}`]:Object.assign(Object.assign({},co()),{[`.${e} .${e}-icon`]:{display:`block`}})}),go=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:`none`,userSelect:`none`},mo(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}}),{genStyleHooks:_o,genComponentStyleHook:vo,genSubStyleComponent:yo}=qa({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=(0,s.useContext)(da);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{let[e,t,n,r,i]=ao();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{let{csp:e}=(0,s.useContext)(da);return e??{}},getResetStyles:(e,t)=>{let n=uo(e);return[n,{"&":n},ho(t?.prefix.iconPrefixCls??la)]},getCommonStyle:fo,getCompUnitless:()=>to});function bo(e,t){return Ja.reduce((n,r)=>{let i=e[`${r}1`],a=e[`${r}3`],o=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}var xo=(e,t)=>{let[n,r]=ao();return yr({theme:n,token:r,hashId:``,path:[`ant-design-icons`,e],nonce:()=>t?.nonce,layer:{name:`antd`}},()=>ho(e))},{useId:So}=Object.assign({},s),Co=So===void 0?()=>``:So;function wo(e,t,n){Ir(`ConfigProvider`);let r=e||{},i=r.inherit===!1||!t?Object.assign(Object.assign({},sa),{hashed:t?.hashed??sa.hashed,cssVar:t?.cssVar}):t,a=Co();return P(()=>{if(!e)return t;let o=Object.assign({},i.components);Object.k
Line truncated
|
||||
.anticon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
font-style: normal;
|
||||
line-height: 0;
|
||||
text-align: center;
|
||||
text-transform: none;
|
||||
vertical-align: -0.125em;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.anticon > * {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.anticon svg {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.anticon::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.anticon .anticon-icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.anticon[tabindex] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.anticon-spin::before,
|
||||
.anticon-spin {
|
||||
display: inline-block;
|
||||
-webkit-animation: loadingCircle 1s infinite linear;
|
||||
animation: loadingCircle 1s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loadingCircle {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loadingCircle {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
`,qs=function(e){var t=(0,s.useContext)(Tr),n=t.csp,r=t.prefixCls,i=t.layer,a=Ks;r&&(a=a.replace(/anticon/g,r)),i&&(a=`@layer ${i} {
|
||||
${a}
|
||||
}`),(0,s.useEffect)(function(){var t=Rs(e.current);_t(a,`@ant-design-icons`,{prepend:!i,csp:n,attachTo:t})},[])},Js=[`icon`,`className`,`onClick`,`style`,`primaryColor`,`secondaryColor`],Ys={primaryColor:`#333`,secondaryColor:`#E6E6E6`,calculated:!1},Xs=function(e){var t=e.icon,n=e.className,r=e.onClick,i=e.style,a=e.primaryColor,o=e.secondaryColor,c=yt(e,Js),l=s.useRef(),u=Ys;if(a&&(u={primaryColor:a,secondaryColor:o||Ws(a)}),qs(l),Bs(Vs(t),`icon should be icon definiton, but got ${t}`),!Vs(t))return null;var d=t;return d&&typeof d.icon==`function`&&(d=O(O({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),Us(d.icon,`svg-${d.name}`,O(O({className:n,onClick:r,style:i,"data-icon":d.name,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`},c),{},{ref:l}))};Xs.displayName=`IconReact`,Xs.getTwoToneColors=function(){return O({},Ys)},Xs.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Ys.primaryColor=t,Ys.secondaryColor=n||Ws(t),Ys.calculated=!!n};function Zs(e){var t=Z(Gs(e),2),n=t[0],r=t[1];return Xs.setTwoToneColors({primaryColor:n,secondaryColor:r})}var Qs=[`className`,`icon`,`spin`,`rotate`,`tabIndex`,`onClick`,`twoToneColor`];Zs(Oi.primary);var $s=s.forwardRef(function(e,t){var n=e.className,r=e.icon,i=e.spin,a=e.rotate,o=e.tabIndex,l=e.onClick,u=e.twoToneColor,d=yt(e,Qs),f=s.useContext(Tr),p=f.prefixCls,m=p===void 0?`anticon`:p,g=f.rootClassName,_=(0,h.default)(g,m,E(E({},`${m}-${r.name}`,!!r.name),`${m}-spin`,!!i||r.name===`loading`),n),v=o;v===void 0&&l&&(v=-1);var y=a?{msTransform:`rotate(${a}deg)`,transform:`rotate(${a}deg)`}:void 0,b=Z(Gs(u),2),x=b[0],S=b[1];return s.createElement(`span`,c({role:`img`,"aria-label":r.name},d,{ref:t,tabIndex:v,onClick:l,className:_}),s.createElement(Xs,{icon:r,primaryColor:x,secondaryColor:S,style:y}))});$s.displayName=`AntdIcon`,$s.getTwoToneColor=function(){var e=Xs.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},$s.setTwoToneColor=Zs;var ec=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:Fs}))}),tc={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z`}}]},name:`close-circle`,theme:`filled`},nc=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:tc}))}),rc={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z`}}]},name:`close`,theme:`outlined`},ic=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:rc}))}),ac={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`exclamation-circle`,theme:`filled`},oc=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:ac}))}),sc={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`info-circle`,theme:`filled`},cc=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:sc}))}),lc=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
||||
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
||||
charSet checked classID className colSpan cols content contentEditable contextMenu
|
||||
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
||||
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
||||
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
||||
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
||||
mediaGroup method min minLength multiple muted name noValidate nonce open
|
||||
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
||||
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
||||
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
||||
summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
||||
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
||||
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
||||
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
||||
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
||||
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
||||
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/[\s\n]+/),uc=`aria-`,dc=`data-`;function fc(e,t){return e.indexOf(t)===0}function pc(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=t===!1?{aria:!0,data:!0,attr:!0}:t===!0?{aria:!0}:O({},t),r={};return Object.keys(e).forEach(function(t){(n.aria&&(t===`role`||fc(t,uc))||n.data&&fc(t,dc)||n.attr&&lc.includes(t))&&(r[t]=e[t])}),r}function mc(e){return e&&s.isValidElement(e)&&e.type===s.Fragment}var hc=(e,t,n)=>s.isValidElement(e)?s.cloneElement(e,typeof n==`function`?n(e.props||{}):n):t;function gc(e,t){return hc(e,e,t)}var _c=(e,t,n,r,i)=>({background:e,border:`${Q(r.lineWidth)} ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),vc=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:a,fontSizeLG:o,lineHeight:s,borderRadiusLG:c,motionEaseInOutCirc:l,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:m}=e;return{[t]:Object.assign(Object.assign({},so(e)),{position:`relative`,display:`flex`,alignItems:`center`,padding:m,wordWrap:`break-word`,borderRadius:c,[`&${t}-rtl`]:{direction:`rtl`},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:`none`,fontSize:a,lineHeight:s},"&-message":{color:f},[`&${t}-motion-leave`]:{overflow:`hidden`,opacity:1,transition:`max-height ${n} ${l}, opacity ${n} ${l},
|
||||
padding-top ${n} ${l}, padding-bottom ${n} ${l},
|
||||
margin-bottom ${n} ${l}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:`0 !important`,paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:`flex-start`,padding:p,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:`block`,marginBottom:r,color:f,fontSize:o},[`${t}-description`]:{display:`block`,color:d}},[`${t}-banner`]:{marginBottom:0,border:`0 !important`,borderRadius:0}}},yc=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:a,colorWarningBorder:o,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":_c(i,r,n,e,t),"&-info":_c(p,f,d,e,t),"&-warning":_c(s,o,a,e,t),"&-error":Object.assign(Object.assign({},_c(u,l,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},bc=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:a,colorIcon:o,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:`hidden`,fontSize:a,lineHeight:Q(a),backgroundColor:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,[`${n}-close`]:{color:o,transition:`color ${r}`,"&:hover":{color:s}}},"&-close-text":{color:o,transition:`color ${r}`,"&:hover":{color:s}}}}},xc=_o(`Alert`,e=>[vc(e),yc(e),bc(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),Sc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Cc={success:ec,info:cc,error:nc,warning:oc},wc=e=>{let{icon:t,prefixCls:n,type:r}=e,i=Cc[r]||null;return t?hc(t,s.createElement(`span`,{className:`${n}-icon`},t),()=>({className:(0,h.default)(`${n}-icon`,t.props.className)})):s.createElement(i,{className:`${n}-icon`})},Tc=e=>{let{isClosable:t,prefixCls:n,closeIcon:r,handleClose:i,ariaProps:a}=e,o=r===!0||r===void 0?s.createElement(ic,null):r;return t?s.createElement(`button`,Object.assign({type:`button`,onClick:i,className:`${n}-close-icon`,tabIndex:0},a),o):null},Ec=s.forwardRef((e,t)=>{let{description:n,prefixCls:r,message:i,banner:a,className:o,rootClassName:c,style:l,onMouseEnter:u,onMouseLeave:d,onClick:f,afterClose:p,showIcon:m,closable:g,closeText:_,closeIcon:v,action:y,id:b}=e,x=Sc(e,[`description`,`prefixCls`,`message`,`banner`,`className`,`rootClassName`,`style`,`onMouseEnter`,`onMouseLeave`,`onClick`,`afterClose`,`showIcon`,`closable`,`closeText`,`closeIcon`,`action`,`id`]),[S,C]=s.useState(!1),w=s.useRef(null);s.useImperativeHandle(t,()=>({nativeElement:w.current}));let{getPrefixCls:T,direction:E,closable:D,closeIcon:O,className:k,style:A}=ma(`alert`),j=T(`alert`,r),[M,N,P]=xc(j),F=t=>{var n;C(!0),(n=e.onClose)==null||n.call(e,t)},I=s.useMemo(()=>e.type===void 0?a?`warning`:`info`:e.type,[e.type,a]),L=s.useMemo(()=>typeof g==`object`&&g.closeIcon||_?!0:typeof g==`boolean`?g:v!==!1&&v!=null||!!D,[_,v,g,D]),z=a&&m===void 0?!0:m,B=(0,h.default)(j,`${j}-${I}`,{[`${j}-with-description`]:!!n,[`${j}-no-icon`]:!z,[`${j}-banner`]:!!a,[`${j}-rtl`]:E===`rtl`},k,o,c,P,N),V=pc(x,{aria:!0,data:!0}),H=s.useMemo(()=>typeof g==`object`&&g.closeIcon?g.closeIcon:_||(v===void 0?typeof D==`object`&&D.closeIcon?D.closeIcon:O:v),[v,g,D,_,O]),U=s.useMemo(()=>{let e=g??D;if(typeof e==`object`){let{closeIcon:t}=e;return Sc(e,[`closeIcon`])}return{}},[g,D]);return M(s.createElement(vs,{visible:!S,motionName:`${j}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:p},({className:t,style:r},a)=>s.createElement(`div`,Object.assign({id:b,ref:R(w,a),"data-show":!S,className:(0,h.default)(B,t),style:Object.assign(Object.assign(Object.assign({},A),l),r),onMouseEnter:u,onMouseLeave:d,onClick:f,role:`alert`},V),z?s.createElement(wc,{description:n,icon:e.icon,prefixCls:j,type:I}):null,s.createElement(`div`,{className:`${j}-content`},i?s.createElement(`div`,{className:`${j}-message`},i):null,n?s.createElement(`div`,{className:`${j}-description`},n):null),y?s.createElement(`div`,{className:`${j}-action`},y):null,s.createElement(Tc,{isClosable:L,prefixCls:j,closeIcon:H,handleClose:F,ariaProps:U}))))});function Dc(e,t,n){return t=Ne(t),Ie(e,Pe()?Reflect.construct(t,n||[],Ne(e).constructor):t.apply(e,n))}var Oc=function(e){function t(){var e;return Oe(this,t),e=Dc(this,t,arguments),e.state={error:void 0,info:{componentStack:``}},e}return Me(t,e),Ae(t,[{key:`componentDidCatch`,value:function(e,t){this.setState({error:e,info:t})}},{key:`render`,value:function(){let{message:e,description:t,id:n,children:r}=this.props,{error:i,info:a}=this.state,o=a?.componentStack||null,c=e===void
Line truncated
|
||||
${t}-loading > ${n}`]:{color:c}};return[{[t]:Object.assign(Object.assign({},so(e)),{color:i,position:`fixed`,top:f,width:`100%`,pointerEvents:`none`,zIndex:h,[`${t}-move-up`]:{animationFillMode:`forwards`},[`
|
||||
${t}-move-up-appear,
|
||||
${t}-move-up-enter
|
||||
`]:{animationName:y,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[`
|
||||
${t}-move-up-appear${t}-move-up-appear-active,
|
||||
${t}-move-up-enter${t}-move-up-enter-active
|
||||
`]:{animationPlayState:`running`},[`${t}-move-up-leave`]:{animationName:b,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:`running`},"&-rtl":{direction:`rtl`,span:{direction:`rtl`}}})},{[t]:{[`${v}-wrapper`]:Object.assign({},x)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},x),{padding:0,textAlign:`start`})}]},_l=_o(`Message`,e=>gl(La(e,{height:150})),e=>({zIndexPopup:e.zIndexPopupBase+dl+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`})),vl={info:s.createElement(cc,null),success:s.createElement(ec,null),error:s.createElement(nc,null),warning:s.createElement(oc,null),loading:s.createElement(tl,null)},yl=({prefixCls:e,type:t,icon:n,children:r})=>s.createElement(`div`,{className:(0,h.default)(`${e}-custom-content`,`${e}-${t}`)},n||vl[t],s.createElement(`span`,null,r));function bl(e,t){return{motionName:t??`${e}-move-up`}}function xl(e){let t,n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{t?.()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}var Sl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Cl=8,wl=3,Tl=({children:e,prefixCls:t})=>{let n=Rc(t),[r,i,a]=_l(t,n);return r(s.createElement(Vc,{classNames:{list:(0,h.default)(i,a,n)}},e))},El=(e,{prefixCls:t,key:n})=>s.createElement(Tl,{prefixCls:t,key:n},e),Dl=s.forwardRef((e,t)=>{let{top:n,prefixCls:r,getContainer:i,maxCount:a,duration:o=wl,rtl:c,transitionName:l,onAllRemoved:u}=e,{getPrefixCls:d,getPopupContainer:f,message:p,direction:m}=s.useContext(da),g=r||d(`message`),[_,v]=$c({prefixCls:g,style:()=>({left:`50%`,transform:`translateX(-50%)`,top:n??Cl}),className:()=>(0,h.default)({[`${g}-rtl`]:c??m===`rtl`}),motion:()=>bl(g,l),closable:!1,closeIcon:s.createElement(`span`,{className:`${g}-close-x`},s.createElement(ic,{className:`${g}-close-icon`})),duration:o,getContainer:()=>i?.()||f?.()||document.body,maxCount:a,onAllRemoved:u,renderNotifications:El});return s.useImperativeHandle(t,()=>Object.assign(Object.assign({},_),{prefixCls:g,message:p})),v}),Ol=0;function kl(e){let t=s.useRef(null);return Ir(`Message`),[s.useMemo(()=>{let e=e=>{var n;(n=t.current)==null||n.close(e)},n=n=>{if(!t.current){let e=()=>{};return e.then=()=>{},e}let{open:r,prefixCls:i,message:a}=t.current,o=`${i}-notice`,{content:c,icon:l,type:u,key:d,className:f,style:p,onClose:m}=n,g=Sl(n,[`content`,`icon`,`type`,`key`,`className`,`style`,`onClose`]),_=d;return _??=(Ol+=1,`antd-message-${Ol}`),xl(t=>(r(Object.assign(Object.assign({},g),{key:_,content:s.createElement(yl,{prefixCls:i,type:u,icon:l},c),placement:`top`,className:(0,h.default)(u&&`${o}-${u}`,f,a?.className),style:Object.assign(Object.assign({},a?.style),p),onClose:()=>{m?.(),t()}})),()=>{e(_)}))},r={open:n,destroy:n=>{var r;n===void 0?(r=t.current)==null||r.destroy():e(n)}};return[`info`,`success`,`warning`,`error`,`loading`].forEach(e=>{r[e]=(t,r,i)=>{let a;a=t&&typeof t==`object`&&`content`in t?t:{content:t};let o,s;typeof r==`function`?s=r:(o=r,s=i);let c=Object.assign(Object.assign({onClose:s,duration:o},a),{type:e});return n(c)}}),r},[]),s.createElement(Dl,Object.assign({key:`message-holder`},e,{ref:t}))]}function Al(e){return kl(e)}function jl(e,t){this.v=e,this.k=t}function Ml(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Ml=function(e,t,n,r){function a(t,n){Ml(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},Ml(e,t,n,r)}function Nl(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Ml(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?(s>1&&(f.n=s<3?-1:c),p(s,c)):f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{val
Line truncated
|
||||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
||||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),gd=e=>({animationDuration:e,animationFillMode:`both`}),_d=e=>({animationDuration:e,animationFillMode:`both`}),vd=(e,t,n,r,i=!1)=>{let a=i?`&`:``;return{[`
|
||||
${a}${e}-enter,
|
||||
${a}${e}-appear
|
||||
`]:Object.assign(Object.assign({},gd(r)),{animationPlayState:`paused`}),[`${a}${e}-leave`]:Object.assign(Object.assign({},_d(r)),{animationPlayState:`paused`}),[`
|
||||
${a}${e}-enter${e}-enter-active,
|
||||
${a}${e}-appear${e}-appear-active
|
||||
`]:{animationName:t,animationPlayState:`running`},[`${a}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:`running`,pointerEvents:`none`}}},yd=new Cr(`antFadeIn`,{"0%":{opacity:0},"100%":{opacity:1}}),bd=new Cr(`antFadeOut`,{"0%":{opacity:1},"100%":{opacity:0}}),xd=(e,t=!1)=>{let{antCls:n}=e,r=`${n}-fade`,i=t?`&`:``;return[vd(r,yd,bd,e.motionDurationMid,t),{[`
|
||||
${i}${r}-enter,
|
||||
${i}${r}-appear
|
||||
`]:{opacity:0,animationTimingFunction:`linear`},[`${i}${r}-leave`]:{animationTimingFunction:`linear`}}]},Sd=new Cr(`antMoveDownIn`,{"0%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Cd=new Cr(`antMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0}}),wd=new Cr(`antMoveLeftIn`,{"0%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Td=new Cr(`antMoveLeftOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Ed=new Cr(`antMoveRightIn`,{"0%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Dd=new Cr(`antMoveRightOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Od={"move-up":{inKeyframes:new Cr(`antMoveUpIn`,{"0%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),outKeyframes:new Cr(`antMoveUpOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0}})},"move-down":{inKeyframes:Sd,outKeyframes:Cd},"move-left":{inKeyframes:wd,outKeyframes:Td},"move-right":{inKeyframes:Ed,outKeyframes:Dd}},kd=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Od[t];return[vd(r,i,a,e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},Ad=new Cr(`antSlideUpIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1}}),jd=new Cr(`antSlideUpOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),Md=new Cr(`antSlideDownIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1}}),Nd=new Cr(`antSlideDownOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0}}),Pd=new Cr(`antSlideLeftIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1}}),Fd=new Cr(`antSlideLeftOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),Id=new Cr(`antSlideRightIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1}}),Ld=new Cr(`antSlideRightOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0}}),Rd={"slide-up":{inKeyframes:Ad,outKeyframes:jd},"slide-down":{inKeyframes:Md,outKeyframes:Nd},"slide-left":{inKeyframes:Pd,outKeyframes:Fd},"slide-right":{inKeyframes:Id,outKeyframes:Ld}},zd=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Rd[t];return[vd(r,i,a,e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{transform:`scale(0)`,transformOrigin:`0% 0%`,opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:`scale(1)`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},Bd=new Cr(`antZoomIn`,{"0%":{transform:`scale(0.2)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),Vd=new Cr(`antZoomOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.2)`,opacity:0}}),Hd=new Cr(`antZoomBigIn`,{"0%":{transform:`scale(0.8)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),Ud=new Cr(`antZoomBigOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.8)`,opacity:0}}),Wd=new Cr(`antZoomUpIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 0%`}}),Gd=new Cr(`antZoomUpOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 0%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0}}),Kd=new Cr(`antZoomLeftIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`0% 50%`}}),qd=new Cr(`antZoomLeftOut`,{"0%":{transform:`scale(1)`,transformOrigin:`0% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0}}),Jd=new Cr(`antZoomRightIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`100% 50%`}}),Yd=new Cr(`antZoomRightOut`,{"0%":{transform:`scale(1)`,transformOrigin:`100% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0}}),Xd=new Cr(`antZoomDownIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 100%`}}),Zd=new Cr(`antZoomDownOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 100%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0}}),Qd={zoom:{inKeyframes:Bd,outKeyframes:Vd},"zoom-big":{inKeyframes:Hd,outKeyframes:Ud},"zoom-big-fast":{inKeyframes:Hd,outKeyframes:Ud},"zoom-left":{inKeyframes:Kd,outKeyframes:qd},"zoom-right":{inKeyframes:Jd,outKeyframes:Yd},"zoom-up":{inKeyframes:Wd,outKeyframes:Gd},"zoom-down":{inKeyframes:Xd,outKeyframes:Zd}},$d=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Qd[t];return[vd(r,i,a,t===`zoom-big-fast`?e.motionDurationFast:e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{transform:`scale(0)`,opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:`none`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},ef=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:i,headerPadding:a,collapseHeaderPaddingSM:o,collapseHeaderPaddingLG:s,collapsePanelBorderRadius:c,lineWidth:l,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:m,fontSizeLG:h,lineHeight:g,lineHeightLG:_,marginSM:v,paddingSM:y,paddingLG:b,paddingXS:x,motionDurationSlow:S,fontSizeIcon:C,contentPadding:w,fontHeight:T,fontHeightLG:E}=e,D=`${Q(l)} ${u} ${d}`;return{[t]:Object.assign(Object.assign({},so(e)),{backgroundColor:i,border:D,borderRadius:c,"&-rtl":{direction:`rtl`},[`& > ${t}-item`]:{borderBottom:D,"&:first-child":{[`
|
||||
&,
|
||||
& > ${t}-header`]:{borderRadius:`${Q(c)} ${Q(c)} 0 0`}},"&:last-child":{[`
|
||||
&,
|
||||
& > ${t}-header`]:{borderRadius:`0 0 ${Q(c)} ${Q(c)}`}},[`> ${t}-header`]:Object.assign(Object.assign({position:`relative`,display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,padding:a,color:p,lineHeight:g,cursor:`pointer`,transition:`all ${S}, visibility 0s`},mo(e)),{[`> ${t}-header-text`]:{flex:`auto`},[`${t}-expand-icon`]:{height:T,display:`flex`,alignItems:`center`,paddingInlineEnd:v},[`${t}-arrow`]:Object.assign(Object.assign({},co()),{fontSize:C,transition:`transform ${S}`,svg:{transition:`transform ${S}`}}),[`${t}-header-text`]:{marginInlineEnd:`auto`}}),[`${t}-collapsible-header`]:{cursor:`default`,[`${t}-header-text`]:{flex:`none`,cursor:`pointer`},[`${t}-expand-icon`]:{cursor:`pointer`}},[`${t}-collapsible-icon`]:{cursor:`unset`,[`${t}-expand-icon`]:{cursor:`pointer`}}},[`${t}-content`]:{color:f,backgroundColor:n,borderTop:D,[`& > ${t}-content-box`]:{padding:w},"&-hidden":{display:`none`}},"&-small":{[`> ${t}-item`]:{[`> ${t}-header`]:{padding:o,paddingInlineStart:x,[`> ${t}-expand-icon`]:{marginInlineStart:e.calc(y).sub(x).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:y}}},"&-large":{[`> ${t}-item`]:{fontSize:h,lineHeight:_,[`> ${t}-header`]:{padding:s,paddingInlineStart:r,[`> ${t}-expand-icon`]:{height:E,marginInlineStart:e.calc(b).sub(r).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:b}}},[`${t}-item:last-child`]:{borderBottom:0,[`> ${t}-content`]:{borderRadius:`0 0 ${Q(c)} ${Q(c)}`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:m,cursor:`not-allowed`}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:v}}}}})}},tf=e=>{let{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow`;return{[`${t}-rtl`]:{[n]:{transform:`rotate(180deg)`}}}},nf=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:r,borderlessContentBg:i,colorBorder:a}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${a}`},[`
|
||||
> ${t}-item:last-child,
|
||||
> ${t}-item:last-child ${t}-header
|
||||
`]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:i,borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{padding:r}}}},rf=e=>{let{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:`transparent`,border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:`transparent`,border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},af=_o(`Collapse`,e=>{let t=La(e,{collapseHeaderPaddingSM:`${Q(e.paddingXS)} ${Q(e.paddingSM)}`,collapseHeaderPaddingLG:`${Q(e.padding)} ${Q(e.paddingLG)}`,collapsePanelBorderRadius:e.borderRadiusLG});return[ef(t),nf(t),rf(t),tf(t),hd(t)]},e=>({headerPadding:`${e.paddingSM}px ${e.padding}px`,headerBg:e.colorFillAlter,contentPadding:`${e.padding}px 16px`,contentBg:e.colorBgContainer,borderlessContentPadding:`${e.paddingXXS}px 16px ${e.padding}px`,borderlessContentBg:`transparent`})),of=Object.assign(s.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r,expandIcon:i,className:a,style:o}=ma(`collapse`),{prefixCls:c,className:l,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:_=`start`,children:v,destroyInactivePanel:y,destroyOnHidden:b,expandIcon:x}=e,S=Su(e=>m??e??`middle`),C=n(`collapse`,c),w=n(),[T,E,D]=af(C),O=s.useMemo(()=>_===`left`?`start`:_===`right`?`end`:_,[_]),k=x??i,A=s.useCallback((e={})=>{let t=typeof k==`function`?k(e):s.createElement(rd,{rotate:e.isActive?r===`rtl`?-90:90:void 0,"aria-label":e.isActive?`expanded`:`collapsed`});return gc(t,()=>({className:(0,h.default)(t.props?.className,`${C}-arrow`)}))},[k,C,r]),j=(0,h.default)(`${C}-icon-position-${O}`,{[`${C}-borderless`]:!f,[`${C}-rtl`]:r===`rtl`,[`${C}-ghost`]:!!p,[`${C}-${S}`]:S!==`middle`},a,l,u,E,D),M=s.useMemo(()=>Object.assign(Object.assign({},lu(w)),{motionAppear:!1,leavedClassName:`${C}-content-hidden`}),[w,C]),N=s.useMemo(()=>v?g(v).map((e,t)=>{let n=e.props;if(n?.disabled){let r=e.key??String(t);return gc(e,Object.assign(Object.assign({},du(e.props,[`disabled`])),{key:r,collapsible:n.collapsible??`disabled`}))}return e}):null,[v]);return T(s.createElement(pd,Object.assign({ref:t,openMotion:M},du(e,[`rootClassName`]),{expandIcon:A,prefixCls:C,className:j,style:Object.assign(Object.assign({},o),d),destroyInactivePanel:b??y}),N))}),{Panel:md}),sf=e=>e instanceof td?e:new td(e),cf=(e,t)=>{let{r:n,g:r,b:i,a}=e.toRgb(),o=new Qu(e.toRgbString()).onBackground(t).toHsv();return a<=.5?o.v>.5:n*.299+r*.587+i*.114>192},lf=e=>{let{paddingInline:t,onlyIconSize:n}=e;return La(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},uf=e=>{let t=e.contentFontSize??e.fontSize,n=e.contentFontSizeSM??e.fontSize,r=e.contentFontSizeLG??e.fontSizeLG,i=e.contentLineHeight??Zi(t),a=e.contentLineHeightSM??Zi(n),o=e.contentLineHeightLG??Zi(r),s=cf(new td(e.colorBgSolid),`#fff`)?`#000`:`#fff`,c=Ja.reduce((t,n)=>Object.assign(Object.assign({},t),{[`${n}ShadowColor`]:`0 ${Q(e.controlOutlineWidth)} 0 ${Za(e[`${n}1`],e.colorBgContainer)}`}),{});return Object.assign(Object.assign({},c),{fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:`transparent`,defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:`inherit`,onlyIconSizeSM:`inherit`,onlyIconSizeLG:`inherit`,groupBorderColor:e.colorPrimaryHover,linkHoverBg:`transparent`,textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:s,contentFontSize:t,contentFontSizeSM:n,contentFontSizeLG:r,contentLineHeight:i,contentLineHeightSM:a,contentLineHeightLG:o,paddingBlock:Math.max((e.controlHeight-t*i)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-n*a)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-r*o)/2-e.lineWidth,0)})},df=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:c}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-flex`,gap:s,alignItems:`center`,justifyContent:`center`,fontWeight:r,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,background:`transparent`,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,curso
Line truncated
|
||||
#${t}::-webkit-scrollbar {
|
||||
${c?`width: ${s.width};`:``}
|
||||
${l?`height: ${s.height};`:``}
|
||||
}`,t)}catch(e){console.error(e),i=c,a=l}}document.body.appendChild(n);var u=e&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,d=e&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),ht(t),{width:u,height:d}}function op(e){return typeof document>`u`||!e||!(e instanceof Element)?{width:0,height:0}:ap(e)}function sp(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var cp=`rc-util-locker-${Date.now()}`,lp=0;function up(e){var t=!!e,n=Z(s.useState(function(){return lp+=1,`${cp}_${lp}`}),1)[0];qt(function(){if(t){var e=op(document.body).width;_t(`
|
||||
html body {
|
||||
overflow-y: hidden;
|
||||
${sp()?`width: calc(100% - ${e}px);`:``}
|
||||
}`,n)}else ht(n);return function(){ht(n)}},[t,n])}var dp=!1;function fp(e){return typeof e==`boolean`&&(dp=e),dp}var pp=function(e){return e===!1?!1:!rt()||!e?null:typeof e==`string`?document.querySelector(e):typeof e==`function`?e():e},mp=s.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer,a=e.debug,o=e.autoDestroy,c=o===void 0||o,l=e.children,u=Z(s.useState(n),2),d=u[0],f=u[1],p=d||n;s.useEffect(function(){(c||n)&&f(n)},[n,c]);var h=Z(s.useState(function(){return pp(i)}),2),g=h[0],_=h[1];s.useEffect(function(){_(pp(i)??null)});var v=Z(ip(p&&!g,a),2),y=v[0],b=v[1],x=g??y;up(r&&n&&rt()&&(x===y||x===document.body));var S=null;l&&B(l)&&t&&(S=l.ref);var C=z(S,t);if(!p||!rt()||g===void 0)return null;var w=x===!1||fp(),T=l;return t&&(T=s.cloneElement(l,{ref:C})),s.createElement(np.Provider,{value:b},w?T:(0,m.createPortal)(T,x))}),hp=s.createContext({});function gp(){return O({},s).useId}var _p=0,vp=gp(),yp=vp?function(e){var t=vp();return e||t}:function(e){var t=Z(s.useState(`ssr-id`),2),n=t[0],r=t[1];return s.useEffect(function(){var e=_p;_p+=1,r(`rc_unique_${e}`)},[]),e||n};function bp(e,t,n){var r=t;return!r&&n&&(r=`${e}-${n}`),r}function xp(e,t){var n=e[`page${t?`Y`:`X`}Offset`],r=`scroll${t?`Top`:`Left`}`;if(typeof n!=`number`){var i=e.document;n=i.documentElement[r],typeof n!=`number`&&(n=i.body[r])}return n}function Sp(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=xp(i),n.top+=xp(i,!0),n}var Cp=s.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),wp={width:0,height:0,overflow:`hidden`,outline:`none`},Tp={outline:`none`},Ep=s.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,i=e.style,a=e.title,o=e.ariaId,u=e.footer,d=e.closable,f=e.closeIcon,p=e.onClose,m=e.children,g=e.bodyStyle,_=e.bodyProps,v=e.modalRender,y=e.onMouseDown,b=e.onMouseUp,x=e.holderRef,S=e.visible,C=e.forceRender,w=e.width,T=e.height,E=e.classNames,D=e.styles,k=z(x,s.useContext(hp).panel),A=(0,s.useRef)(),j=(0,s.useRef)();s.useImperativeHandle(t,function(){return{focus:function(){var e;(e=A.current)==null||e.focus({preventScroll:!0})},changeActive:function(e){var t=document.activeElement;e&&t===j.current?A.current.focus({preventScroll:!0}):!e&&t===A.current&&j.current.focus({preventScroll:!0})}}});var M={};w!==void 0&&(M.width=w),T!==void 0&&(M.height=T);var N=u?s.createElement(`div`,{className:(0,h.default)(`${n}-footer`,E?.footer),style:O({},D?.footer)},u):null,P=a?s.createElement(`div`,{className:(0,h.default)(`${n}-header`,E?.header),style:O({},D?.header)},s.createElement(`div`,{className:`${n}-title`,id:o},a)):null,F=(0,s.useMemo)(function(){return l(d)===`object`&&d!==null?d:d?{closeIcon:f??s.createElement(`span`,{className:`${n}-close-x`})}:{}},[d,f,n]),I=pc(F,!0),L=l(d)===`object`&&d.disabled,R=d?s.createElement(`button`,c({type:`button`,onClick:p,"aria-label":`Close`},I,{className:`${n}-close`,disabled:L}),F.closeIcon):null,B=s.createElement(`div`,{className:(0,h.default)(`${n}-content`,E?.content),style:D?.content},R,P,s.createElement(`div`,c({className:(0,h.default)(`${n}-body`,E?.body),style:O(O({},g),D?.body)},_),m),N);return s.createElement(`div`,{key:`dialog-element`,role:`dialog`,"aria-labelledby":a?o:null,"aria-modal":`true`,ref:k,style:O(O({},i),M),className:(0,h.default)(n,r),onMouseDown:y,onMouseUp:b},s.createElement(`div`,{ref:A,tabIndex:0,style:Tp},s.createElement(Cp,{shouldUpdate:S||C},v?v(B):B)),s.createElement(`div`,{tabIndex:0,ref:j,style:wp}))}),Dp=s.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,i=e.style,a=e.className,o=e.visible,l=e.forceRender,u=e.destroyOnClose,d=e.motionName,f=e.ariaId,p=e.onVisibleChanged,m=e.mousePosition,g=(0,s.useRef)(),_=Z(s.useState(),2),v=_[0],y=_[1],b={};v&&(b.transformOrigin=v);function x(){var e=Sp(g.current);y(m&&(m.x||m.y)?`${m.x-e.left}px ${m.y-e.top}px`:``)}return s.createElement(vs,{visible:o,onVisibleChanged:p,onAppearPrepare:x,onEnterPrepare:x,forceRender:l,motionName:d,removeOnLeave:u,ref:g},function(o,l){var u=o.className,d=o.style;return s.createElement(Ep,c({},e,{ref:t,title:r,ariaId:f,prefixCls:n,holderRef:l,style:O(O(O({},d),i),b),className:(0,h.default)(a,u)}))})});Dp.displayName=`Content`;var Op=function(e){var t=e.prefixCls,n=e.style,r=e.visible,i=e.maskProps,a=e.motionName,o=e.className;return s.createElement(vs,{key:`mask`,visible:r,motionName:a,leavedClassName:`${t}-mask-hidden`},function(e,r){var a=e.className,l=e.style;return s.createElement(`div`,c({ref:r,style:O(O({},l),n),className:(0,h.default)(`${t}-mask`,a,o)},i))})},kp=function(e){var t=e.prefixCls,n=t===void 0?`rc-dialog`:t,r=e.zIndex,i=e.visible,a=i!==void 0&&i,o=e.keyboard,l=o===void 0||o,u=e.focusTriggerAfterClose,d=u===void 0||u,f=e.wrapStyle,p=e.wrapClassName,m=e.wrapProps,g=e.onClose,_=e.afterOpenChange,v=e.afterClose,y=e.transitionName,b=e.animation,x=e.closable,S=x===void 0||x,C=e.mask,w=C===void 0||C,T=e.maskTransitionName,E=e.maskAnimation,D=e.maskClosable,k=
Line truncated
|
||||
${r},
|
||||
${i} > li,
|
||||
${n},
|
||||
${a},
|
||||
${o},
|
||||
${s}
|
||||
`]:Object.assign({},Nh(e))}}},Uh=_o(`Skeleton`,e=>{let{componentCls:t,calc:n}=e;return Hh(La(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:`1.4s`}))},e=>{let{colorFillContent:t,colorFill:n}=e,r=t,i=n;return{color:r,colorGradientEnd:i,gradientFromColor:r,gradientToColor:i,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[[`color`,`gradientFromColor`],[`colorGradientEnd`,`gradientToColor`]]}),Wh=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,shape:a=`circle`,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(da),l=c(`skeleton`,t),[u,d,f]=Uh(l),p=du(e,[`prefixCls`,`className`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(kh,Object.assign({prefixCls:`${l}-avatar`,shape:a,size:o},p))))},Gh=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,block:a=!1,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(da),l=c(`skeleton`,t),[u,d,f]=Uh(l),p=du(e,[`prefixCls`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:a},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(kh,Object.assign({prefixCls:`${l}-button`,size:o},p))))},Kh=`M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z`,qh=e=>{let{prefixCls:t,className:n,rootClassName:r,style:i,active:a}=e,{getPrefixCls:o}=s.useContext(da),c=o(`skeleton`,t),[l,u,d]=Uh(c),f=(0,h.default)(c,`${c}-element`,{[`${c}-active`]:a},n,r,u,d);return l(s.createElement(`div`,{className:f},s.createElement(`div`,{className:(0,h.default)(`${c}-image`,n),style:i},s.createElement(`svg`,{viewBox:`0 0 1098 1024`,xmlns:`http://www.w3.org/2000/svg`,className:`${c}-image-svg`},s.createElement(`title`,null,`Image placeholder`),s.createElement(`path`,{d:Kh,className:`${c}-image-path`})))))},Jh=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,block:a,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(da),l=c(`skeleton`,t),[u,d,f]=Uh(l),p=du(e,[`prefixCls`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:a},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(kh,Object.assign({prefixCls:`${l}-input`,size:o},p))))},Yh=e=>{let{prefixCls:t,className:n,rootClassName:r,style:i,active:a,children:o}=e,{getPrefixCls:c}=s.useContext(da),l=c(`skeleton`,t),[u,d,f]=Uh(l),p=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:a},d,n,r,f);return u(s.createElement(`div`,{className:p},s.createElement(`div`,{className:(0,h.default)(`${l}-image`,n),style:i},o)))},Xh=(e,t)=>{let{width:n,rows:r=2}=t;if(Array.isArray(n))return n[e];if(r-1===e)return n},Zh=e=>{let{prefixCls:t,className:n,style:r,rows:i=0}=e,a=Array.from({length:i}).map((t,n)=>s.createElement(`li`,{key:n,style:{width:Xh(n,e)}}));return s.createElement(`ul`,{className:(0,h.default)(t,n),style:r},a)},Qh=({prefixCls:e,className:t,width:n,style:r})=>s.createElement(`h3`,{className:(0,h.default)(e,t),style:Object.assign({width:n},r)});function $h(e){return e&&typeof e==`object`?e:{}}function eg(e,t){return e&&!t?{size:`large`,shape:`square`}:{size:`large`,shape:`circle`}}function tg(e,t){return!e&&t?{width:`38%`}:e&&t?{width:`50%`}:{}}function ng(e,t){let n={};return e&&t||(n.width=`61%`),n.rows=!e&&t?3:2,n}var rg=e=>{let{prefixCls:t,loading:n,className:r,rootClassName:i,style:a,children:o,avatar:c=!1,title:l=!0,paragraph:u=!0,active:d,round:f}=e,{getPrefixCls:p,direction:m,className:g,style:_}=ma(`skeleton`),v=p(`skeleton`,t),[y,b,x]=Uh(v);if(n||!(`loading`in e)){let e=!!c,t=!!l,n=!!u,o;if(e){let e=Object.assign(Object.assign({prefixCls:`${v}-avatar`},eg(t,n)),$h(c));o=s.createElement(`div`,{className:`${v}-header`},s.createElement(kh,Object.assign({},e)))}let p;if(t||n){let r;if(t){let t=Object.assign(
Line truncated
|
||||
${t}-body,
|
||||
${t}-confirm-body-wrapper`]:{display:`flex`,flexDirection:`column`,flex:`auto`},[`${t}-confirm-body`]:{marginBottom:`auto`}}}]},Tg=e=>{let{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:`rtl`,[`${t}-confirm-body`]:{direction:`rtl`}}}}},Eg=e=>{let{componentCls:t}=e,n=bg(e),r=Object.assign({},n);delete r.xs;let i=`--${t.replace(`.`,``)}-`,a=Object.keys(r).map(e=>({[`@media (min-width: ${Q(r[e])})`]:{width:`var(${i}${e}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(X(Object.keys(n).map((e,t)=>{let r=Object.keys(n)[t-1];return r?{[`${i}${e}-width`]:`var(${i}${r}-width)`}:null})),[{width:`var(${i}xs-width)`}],X(a))}}},Dg=e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return La(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},Og=e=>({footerBg:`transparent`,headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Q(e.paddingMD)} ${Q(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Q(e.padding)} ${Q(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:`none`,headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Q(e.paddingXS)} ${Q(e.padding)}`:0,footerBorderTop:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:`none`,footerBorderRadius:e.wireframe?`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Q(e.padding*2)} ${Q(e.padding*2)} ${Q(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM}),kg=_o(`Modal`,e=>{let t=Dg(e);return[wg(t),Tg(t),Cg(t),$d(t,`zoom`),Eg(t)]},Og,{unitless:{titleLineHeight:!0}}),Ag=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},jg;Oh()&&document.documentElement.addEventListener(`click`,e=>{jg={x:e.pageX,y:e.pageY},setTimeout(()=>{jg=null},100)},!0);var Mg=e=>{let{prefixCls:t,className:n,rootClassName:r,open:i,wrapClassName:a,centered:o,getContainer:c,focusTriggerAfterClose:l=!0,style:u,visible:d,width:f=520,footer:p,classNames:m,styles:g,children:_,loading:v,confirmLoading:y,zIndex:b,mousePosition:x,onOk:S,onCancel:C,destroyOnHidden:w,destroyOnClose:T,panelRef:E=null,modalRender:D}=e,O=Ag(e,[`prefixCls`,`className`,`rootClassName`,`open`,`wrapClassName`,`centered`,`getContainer`,`focusTriggerAfterClose`,`style`,`visible`,`width`,`footer`,`classNames`,`styles`,`children`,`loading`,`confirmLoading`,`zIndex`,`mousePosition`,`onOk`,`onCancel`,`destroyOnHidden`,`destroyOnClose`,`panelRef`,`modalRender`]),{getPopupContainer:k,getPrefixCls:A,direction:j,modal:M}=s.useContext(da),N=e=>{y||C?.(e)},P=e=>{S?.(e)},F=A(`modal`,t),I=A(),L=Rc(F),[z,B,V]=kg(F,L),H=(0,h.default)(a,{[`${F}-centered`]:o??M?.centered,[`${F}-wrap-rtl`]:j===`rtl`}),U=p!==null&&!v?s.createElement(dg,Object.assign({},e,{onOk:P,onCancel:N})):null,[W,G,K,q]=ol(rl(e),rl(M),{closable:!0,closeIcon:s.createElement(ic,{className:`${F}-close-icon`}),closeIconRender:e=>ug(F,e)}),ee=D?e=>s.createElement(`div`,{className:`${F}-render`},D(e)):void 0,J=R(E,sg(`.${F}-${D?`render`:`content`}`)),[Y,te]=hl(`Modal`,b),[ne,re]=s.useMemo(()=>f&&typeof f==`object`?[void 0,f]:[f,void 0],[f]),ie=s.useMemo(()=>{let e={};return re&&Object.keys(re).forEach(t=>{let n=re[t];n!==void 0&&(e[`--${F}-${t}-width`]=typeof n==`number`?`${n}px`:n)}),e},[F,re]);return z(s.createElement(wh,{form:!0,space:!0},s.createElement(ll.Provider,{value:te},s.createElement(jp,Object.assign({width:ne},O,{zIndex:Y,getContainer:c===void 0?k:c,prefixCls:F,rootClassName:(0,h.default)(B,r,V,L),footer:U,visible:i??d,mousePosition:x??jg,onClose:N,closable:W&&Object.assign({disabled:K,closeIcon:G},q),closeIcon:G,focusTriggerAfterClose:l,transitionName:uu(I,`zoom`,e.transitionName),maskTransitionName:uu(I,`fade`,e.maskTransitionName),className:(0,h.default)(B,n,M?.className),style:Object.assign(Object.assign(Object.assign({},M?.style),u),ie),classNames:Object.assign(Object.assign(Object.assign({},M?.classNames),m),{wrapper:(0,h.default)(H,m?.wrapper)}),styles:Object.assign(Object.assign({},M?.styles),g),panelRef:J,destroyOnClose:w??T,modalRender:ee}),v?s.createElement(ig,{active:!0,title:!1,paragrap
Line truncated
|
||||
${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},Pg=yo([`Modal`,`confirm`],e=>Ng(Dg(e)),Og,{order:-1e3}),Fg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Ig=e=>{let{prefixCls:t,icon:n,okText:r,cancelText:i,confirmPrefixCls:a,type:o,okCancel:c,footer:l,locale:u}=e,d=Fg(e,[`prefixCls`,`icon`,`okText`,`cancelText`,`confirmPrefixCls`,`type`,`okCancel`,`footer`,`locale`]),f=n;if(!n&&n!==null)switch(o){case`info`:f=s.createElement(cc,null);break;case`success`:f=s.createElement(ec,null);break;case`error`:f=s.createElement(nc,null);break;default:f=s.createElement(oc,null)}let p=c??o===`confirm`,m=e.autoFocusButton===null?!1:e.autoFocusButton||`ok`,[g]=Zr(`Modal`),_=u||g,v=r||(p?_?.okText:_?.justOkText),y=i||_?.cancelText,b=s.useMemo(()=>Object.assign({autoFocusButton:m,cancelTextLocale:y,okTextLocale:v,mergedOkCancel:p},d),[m,y,v,p,d]),x=s.createElement(s.Fragment,null,s.createElement(ep,null),s.createElement(tp,null)),S=e.title!==void 0&&e.title!==null,C=`${a}-body`;return s.createElement(`div`,{className:`${a}-body-wrapper`},s.createElement(`div`,{className:(0,h.default)(C,{[`${C}-has-title`]:S})},f,s.createElement(`div`,{className:`${a}-paragraph`},S&&s.createElement(`span`,{className:`${a}-title`},e.title),s.createElement(`div`,{className:`${a}-content`},e.content))),l===void 0||typeof l==`function`?s.createElement($f,{value:b},s.createElement(`div`,{className:`${a}-btns`},typeof l==`function`?l(x,{OkBtn:tp,CancelBtn:ep}):x)):l,s.createElement(Pg,{prefixCls:t}))},Lg=e=>{let{close:t,zIndex:n,maskStyle:r,direction:i,prefixCls:a,wrapClassName:o,rootPrefixCls:c,bodyStyle:l,closable:u=!1,onConfirm:d,styles:f,title:p}=e,m=`${a}-confirm`,g=e.width||416,_=e.style||{},v=e.mask===void 0||e.mask,y=e.maskClosable!==void 0&&e.maskClosable,b=(0,h.default)(m,`${m}-${e.type}`,{[`${m}-rtl`]:i===`rtl`},e.className),[,x]=ao(),S=s.useMemo(()=>n===void 0?x.zIndexPopupBase+dl:n,[n,x]);return s.createElement(Mg,Object.assign({},e,{className:b,wrapClassName:(0,h.default)({[`${m}-centered`]:!!e.centered},o),onCancel:()=>{t?.({triggerCancel:!0}),d?.(!1)},title:p,footer:null,transitionName:uu(c||``,`zoom`,e.transitionName),maskTransitionName:uu(c||``,`fade`,e.maskTransitionName),mask:v,maskClosable:y,style:_,styles:Object.assign({body:l,mask:r},f),width:g,zIndex:S,closable:u}),s.createElement(Ig,Object.assign({},e,{confirmPrefixCls:m})))},Rg=e=>{let{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:i}=e;return s.createElement(Ps,{prefixCls:t,iconPrefixCls:n,direction:r,theme:i},s.createElement(Lg,Object.assign({},e)))},zg=[],Bg=``;function Vg(){return Bg}var Hg=e=>{let{prefixCls:t,getContainer:n,direction:r}=e,i=Yr(),a=(0,s.useContext)(da),o=Vg()||a.getPrefixCls(),c=t||`${o}-modal`,l=n;return l===!1&&(l=void 0),s.createElement(Rg,Object.assign({},e,{rootPrefixCls:o,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r??a.direction,locale:a.locale?.Modal??i,getContainer:l}))};function Ug(e){let t=Ms(),n=document.createDocumentFragment(),r=Object.assign(Object.assign({},e),{close:l,open:!0}),i,a;function o(...t){var n;if(t.some(e=>e?.triggerCancel)){var r;(n=e.onCancel)==null||(r=n).call.apply(r,[e,()=>{}].concat(X(t.slice(1))))}for(let e=0;e<zg.length;e++)if(zg[e]===l){zg.splice(e,1);break}a()}let c=e=>{clearTimeout(i),i=setTimeout(()=>{let r=t.getPrefixCls(void 0,Vg()),i=t.getIconPrefixCls(),o=t.getTheme(),c=s.createElement(Hg,Object.assign({},e));a=iu()(s.createElement(Ps,{prefixCls:r,iconPrefixCls:i,theme:o},typeof t.holderRender==`function`?t.holderRender(c):c),n)})};function l(...t){r=Object.assign(Object.assign({},r),{open:!1,afterClose:()=>{typeof e.afterClose==`function`&&e.afterClose(),o.apply(this,t)}}),r.visible&&delete r.visible,c(r)}function u(e){r=typeof e==`function`?e(r):Object.assign(Object.assign({},r),e),c(r)}return c(r),zg.push(l),{destroy:l,update:u}}function Wg(e){return Object.assign(Object.assign({},e),{type:`warning`})}function Gg(e){return Object.assign(Object.assign({},e),{type:`info`})}function Kg(e){return Object.assign(Object.assign({},e),{type:`success`})}function qg(e){return Object.assign(Object.assign({},e),{type:`error`})}function Jg(e){return Object.assign(Object.assign({},e),{type:`confirm`})}var Yg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Xg=s.forwardRef((e,t)=>{var{afterClose:n,co
Line truncated
|
||||
`,`\r
|
||||
`].includes(e)})},[I]),He=s.useContext(o0)||{},Ue=He.maxCount,We=He.rawValues,Ge=function(e,t,n){if(!(de&&t0(Ue)&&We?.size>=Ue)){var r=!0,i=e;A?.(null);var a=a0(e,I,t0(Ue)?Ue-We.size:void 0),o=n?null:a;return y!==`combobox`&&o&&(i=``,F?.(o),Be(!1),r=!1),P&&De!==i&&P(i,{source:t?`typing`:`effect`}),r}},Ke=function(e){e&&e.trim()&&P(e,{source:`submit`})};s.useEffect(function(){!Le&&!de&&y!==`combobox`&&Ge(``,!1,!1)},[Le]),s.useEffect(function(){Fe&&b&&Ie(!1),b&&!Se.current&&Te(!1)},[b]);var qe=Z(V_(),2),Je=qe[0],Ye=qe[1],Xe=s.useRef(!1),Ze=function(e){var t=Je(),n=e.key,r=n===`Enter`;if(r&&(y!==`combobox`&&e.preventDefault(),Le||Be(!0)),Ye(!!De),n===`Backspace`&&!t&&de&&!De&&f.length){for(var i=X(f),a=null,o=i.length-1;o>=0;--o){var s=i[o];if(!s.disabled){i.splice(o,1),a=s;break}}a&&p(i,{type:`remove`,values:[a]})}var c=[...arguments].slice(1);if(Le&&(!r||!Xe.current)){var l;r&&(Xe.current=!0),(l=xe.current)==null||l.onKeyDown.apply(l,[e].concat(c))}ce?.apply(void 0,[e].concat(c))},Qe=function(e){var t=[...arguments].slice(1);if(Le){var n;(n=xe.current)==null||n.onKeyUp.apply(n,[e].concat(t))}e.key===`Enter`&&(Xe.current=!1),se?.apply(void 0,[e].concat(t))},$e=function(e){p(f.filter(function(t){return t!==e}),{type:`remove`,values:[e]})},et=function(){Xe.current=!1},tt=s.useRef(!1),nt=function(){Te(!0),b||(ae&&!tt.current&&ae.apply(void 0,arguments),ie.includes(`focus`)&&Be(!0)),tt.current=!0},rt=function(){Se.current=!0,Te(!1,function(){tt.current=!1,Se.current=!1,Be(!1)}),b||(De&&(y===`tags`?P(De,{source:`submit`}):y===`multiple`&&P(``,{source:`blur`})),oe&&oe.apply(void 0,arguments))},it=[];s.useEffect(function(){return function(){it.forEach(function(e){return clearTimeout(e)}),it.splice(0,it.length)}},[]);var at=function(e){var t=e.target,n=ye.current?.getPopupElement();if(n&&n.contains(t)){var r=setTimeout(function(){var e=it.indexOf(r);if(e!==-1&&it.splice(e,1),Ee(),!he&&!n.contains(document.activeElement)){var t;(t=be.current)==null||t.focus()}});it.push(r)}var i=[...arguments].slice(1);le?.apply(void 0,[e].concat(i))},ot=Z(s.useState({}),2)[1];function st(){ot({})}var ct;ke&&(ct=function(e){Be(e)}),H_(function(){return[_e.current,ye.current?.getPopupElement()]},ze,Be,!!ke);var lt=s.useMemo(function(){return O(O({},e),{},{notFoundContent:_,open:Le,triggerOpen:ze,id:r,showSearch:fe,multiple:de,toggleOpen:Be})},[e,_,ze,Le,r,fe,de,Be]),ut=!!B||x,dt;ut&&(dt=s.createElement(I_,{className:(0,h.default)(`${i}-arrow`,E({},`${i}-arrow-loading`,x)),customizeIcon:B,customizeIconProps:{loading:x,searchValue:De,open:Le,focused:we,showSearch:fe}}));var ft=L_(i,function(){var e;v?.(),(e=be.current)==null||e.focus(),p([],{type:`clear`,values:f}),Ge(``,!1,!1)},f,L,V,b,De,y),pt=ft.allowClear,mt=ft.clearIcon,ht=s.createElement(H,{ref:xe}),gt=(0,h.default)(i,a,E(E(E(E(E(E(E(E(E(E({},`${i}-focused`,we),`${i}-multiple`,de),`${i}-single`,!de),`${i}-allow-clear`,L),`${i}-show-arrow`,ut),`${i}-disabled`,b),`${i}-loading`,x),`${i}-open`,Le),`${i}-customize-input`,Oe),`${i}-show-search`,fe)),_t=s.createElement($1,{ref:ye,disabled:b,prefixCls:i,visible:ze,popupElement:ht,animation:U,transitionName:W,dropdownStyle:G,dropdownClassName:K,direction:u,dropdownMatchSelectWidth:q,dropdownRender:ee,dropdownAlign:J,placement:Y,builtinPlacements:te,getPopupContainer:ne,empty:m,getTriggerDOMNode:function(e){return ve.current||e},onPopupVisibleChange:ct,onPopupMouseEnter:st},ke?s.cloneElement(ke,{ref:Ae}):s.createElement(C1,c({},e,{domRef:ve,prefixCls:i,inputElement:Oe,ref:be,id:r,prefix:R,showSearch:fe,autoClearSearchValue:N,mode:y,activeDescendantId:j,tagRender:l,values:f,open:Le,onToggleOpen:Be,activeValue:k,searchValue:De,onSearch:Ge,onSearchSubmit:Ke,onRemove:$e,tokenWithEnter:Ve,onInputBlur:et}))),vt=ke?_t:s.createElement(`div`,c({className:gt},pe,{ref:_e,onMouseDown:at,onKeyDown:Ze,onKeyUp:Qe,onFocus:nt,onBlur:rt}),s.createElement(s0,{visible:we&&!Le,values:f}),_t,dt,pt&&mt);return s.createElement(R_.Provider,{value:lt},vt)}),f0=function(){return null};f0.isSelectOptGroup=!0;var p0=function(){return null};p0.isSelectOption=!0;var m0=s.forwardRef(function(e,t){var n=e.height,r=e.offsetY,i=e.offsetX,a=e.children,o=e.prefixCls,l=e.onInnerResize,u=e.innerProps,d=e.rtl,f=e.extra,p={},m={display:`flex`,flexDirection:`column`};return r!==void 0&&(p={height:n,position:`relative`,overflow:`hidden`},m=O(O({},m),{},E(E(E(E(E({transform:`translateY(${r}px)`},d?`marginRight`:`marginLeft`,-i),`position`,`absolute`),`left`,0),`right`,0),`top`,0))),s.createElement(`div`,{style:p},s.createElement(Ue,{onResize:function(e){e.offsetHeight&&l&&l()}},s.createElement(`div`,c({style:m,className:(0,h.default)(E({},`${o}-holder-inner`,o)),ref:t},u),a,f)))});m0.displayName=`Filler`;function h0(e){var t=e.children,n=e.setRef,r=s.useCallback(function(e){n(e)},[]);return s.cloneElement(t,{ref:r})}function g0(e,t,n,r,i,a,o,c){var l=c.getKey;return e.slice(t,n+1).map(function(e,n){var c=o(e,t+n,{style:{width:r},offsetX:i}),u=l(e);return s.createElement(h0,{key:u,se
Line truncated
|
||||
${i}${s}bottomLeft,
|
||||
${a}${s}bottomLeft
|
||||
`]:{animationName:Ad},[`
|
||||
${i}${s}topLeft,
|
||||
${a}${s}topLeft,
|
||||
${i}${s}topRight,
|
||||
${a}${s}topRight
|
||||
`]:{animationName:Md},[`${o}${s}bottomLeft`]:{animationName:jd},[`
|
||||
${o}${s}topLeft,
|
||||
${o}${s}topRight
|
||||
`]:{animationName:Nd},"&-hidden":{display:`none`},[r]:Object.assign(Object.assign({},wv(e)),{cursor:`pointer`,transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:`default`},"&-option":{display:`flex`,"&-content":Object.assign({flex:`auto`},oo),"&-state":{flex:`none`,display:`flex`,alignItems:`center`},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:`not-allowed`},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},wv(e)),{color:e.colorTextDisabled})}),[`${c}:has(+ ${c})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${c}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:`rtl`}})},zd(e,`slide-up`),zd(e,`slide-down`),kd(e,`move-up`),kd(e,`move-down`)]},Ev=e=>{let{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=e,a=e.max(e.calc(n).sub(r).equal(),0);return{basePadding:a,containerPadding:e.max(e.calc(a).sub(i).equal(),0),itemHeight:Q(t),itemLineHeight:Q(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},Dv=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},Ov=e=>{let{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:s,colorIcon:c,colorIconHover:l,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{[`${t}-selection-overflow`]:{position:`relative`,display:`flex`,flex:`auto`,flexWrap:`wrap`,maxWidth:`100%`,"&-item":{flex:`none`,alignSelf:`center`,maxWidth:`calc(100% - 4px)`,display:`inline-flex`},[`${t}-selection-item`]:{display:`flex`,alignSelf:`center`,flex:`none`,boxSizing:`border-box`,maxWidth:`100%`,marginBlock:u,borderRadius:r,cursor:`default`,transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),[`${t}-disabled&`]:{color:o,borderColor:s,cursor:`not-allowed`},"&-content":{display:`inline-block`,marginInlineEnd:e.calc(a).div(2).equal(),overflow:`hidden`,whiteSpace:`pre`,textOverflow:`ellipsis`},"&-remove":Object.assign(Object.assign({},co()),{display:`inline-flex`,alignItems:`center`,color:c,fontWeight:`bold`,fontSize:10,lineHeight:`inherit`,cursor:`pointer`,[`> ${n}`]:{verticalAlign:`-0.2em`},"&:hover":{color:l}})}}}},kv=(e,t)=>{let{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,i=`${n}-selection-overflow`,a=e.multipleSelectItemHeight,o=Dv(e),s=t?`${n}-${t}`:``,c=Ev(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},Ov(e)),{[`${n}-selector`]:{display:`flex`,alignItems:`center`,width:`100%`,height:`100%`,paddingInline:c.basePadding,paddingBlock:c.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:`not-allowed`},"&:after":{display:`inline-block`,width:0,margin:`${Q(r)} 0`,lineHeight:Q(a),visibility:`hidden`,content:`"\\a0"`}},[`${n}-selection-item`]:{height:c.itemHeight,lineHeight:Q(c.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:`flex-start`,"&:after":{lineHeight:Q(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal()},[`${i}-item + ${i}-item,
|
||||
${n}-prefix + ${n}-selection-wrap
|
||||
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:c.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:`inline-flex`,position:`relative`,maxWidth:`100%`,marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(o).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:Q(a),transition:`all ${e.motionDurationSlow}`},"&-input":{width:`100%`,minWidth:4.1},"&-mirror":{position:`absolute`,top:0,insetInlineStart:0,insetInlineEnd:`auto`,zIndex:999,whiteSpace:`pre`,visibility:`hidden`}},[`${n}-selection-placeholder`]:{position:`absolute`,top:`50%`,insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:`translateY(-50%)`,transition:`all ${e.motionDurationSlow}`}})}};function Av(e,t){let{componentCls:n}=e,r={[`${n}-multiple${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:`text`}},[`
|
||||
&${n}-show-arrow ${n}-selector,
|
||||
&${n}-allow-clear ${n}-selector
|
||||
`]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[kv(e,t),r]}var jv=e=>{let{componentCls:t}=e,n=La(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=La(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[Av(e),Av(n,`sm`),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},Av(r,`lg`)]};function Mv(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal();return{[`${n}-single${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},so(e,!0)),{display:`flex`,borderRadius:i,flex:`1 1 auto`,[`${n}-selection-wrap:after`]:{lineHeight:Q(a)},[`${n}-selection-search`]:{position:`absolute`,inset:0,width:`100%`,"&-input":{width:`100%`,WebkitAppearance:`textfield`}},[`
|
||||
${n}-selection-item,
|
||||
${n}-selection-placeholder
|
||||
`]:{display:`block`,padding:0,lineHeight:Q(a),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:`center`},[`${n}-selection-placeholder`]:{transition:`none`,pointerEvents:`none`},[[`&:after`,`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(`,`)]:{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`}}),[`
|
||||
&${n}-show-arrow ${n}-selection-item,
|
||||
&${n}-show-arrow ${n}-selection-search,
|
||||
&${n}-show-arrow ${n}-selection-placeholder
|
||||
`]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:`100%`,height:`100%`,alignItems:`center`,padding:`0 ${Q(r)}`,[`${n}-selection-search-input`]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:Q(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:`none`},[`${n}-selection-search`]:{position:`static`,width:`100%`},[`${n}-selection-placeholder`]:{position:`absolute`,insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Q(r)}`,"&:after":{display:`none`}}}}}}}function Nv(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[Mv(e),Mv(La(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),`sm`),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${Q(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`
|
||||
&${t}-show-arrow ${t}-selection-item,
|
||||
&${t}-show-arrow ${t}-selection-placeholder
|
||||
`]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},Mv(La(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`lg`)]}var Pv=e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:o,paddingXXS:s,controlPaddingHorizontal:c,zIndexPopupBase:l,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:h,colorBgContainerDisabled:g,colorTextDisabled:_,colorPrimaryHover:v,colorPrimary:y,controlOutline:b}=e,x=s*2,S=r*2,C=Math.min(i-x,i-S),w=Math.min(a-x,a-S),T=Math.min(o-x,o-S);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:l+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(i-t*n)/2}px ${c}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:m,clearBg:m,singleItemHeightLG:o,multipleItemBg:h,multipleItemBorderColor:`transparent`,multipleItemHeight:C,multipleItemHeightSM:w,multipleItemHeightLG:T,multipleSelectorBgDisabled:g,multipleItemColorDisabled:_,multipleItemBorderColorDisabled:`transparent`,showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:v,activeBorderColor:y,activeOutlineColor:b,selectAffixPadding:s}},Fv=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:i}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Q(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${Q(i)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},Iv=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Fv(e,t))}),Lv=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Fv(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),Iv(e,{status:`error`,borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),Iv(e,{status:`warning`,borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),Rv=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},zv=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Rv(e,t))}),Bv=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Rv(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),zv(e,{status:`error`,bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),zv(e,{status:`warning`,bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),Vv=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:`transparent`,border:`${Q(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),Hv=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`${Q(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.bLine truncated
|
||||
&:hover ${y}`]:{borderColor:r},[`${t}-input:focus-visible + ${y}`]:po(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:`visible`},[`${t}-inner`]:{"&::after":{boxSizing:`border-box`,position:`absolute`,insetBlockStart:`50%`,insetInlineStart:`50%`,display:`block`,width:x,height:x,marginBlockStart:v(1).mul(i).div(-2).equal({unit:!0}),marginInlineStart:v(1).mul(i).div(-2).equal({unit:!0}),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:x,transform:`scale(0)`,opacity:0,transition:`all ${a} ${s}`,content:`""`},boxSizing:`border-box`,position:`relative`,insetBlockStart:0,insetInlineStart:0,display:`block`,width:x,height:x,backgroundColor:c,borderColor:l,borderStyle:`solid`,borderWidth:u,borderRadius:`50%`,transition:`all ${o}`},[`${t}-input`]:{position:`absolute`,inset:0,zIndex:1,cursor:`pointer`,opacity:0},[`${t}-checked`]:{[y]:{borderColor:r,backgroundColor:_,"&::after":{transform:`scale(${e.calc(e.dotSize).div(i).equal()})`,opacity:1,transition:`all ${a} ${s}`}}},[`${t}-disabled`]:{cursor:`not-allowed`,[y]:{backgroundColor:d,borderColor:l,cursor:`not-allowed`,"&::after":{backgroundColor:m}},[`${t}-input`]:{cursor:`not-allowed`},[`${t}-disabled + span`]:{color:f,cursor:`not-allowed`},[`&${t}-checked`]:{[y]:{"&::after":{transform:`scale(${v(b).div(i).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},K4=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:i,lineType:a,colorBorder:o,motionDurationMid:s,buttonPaddingInline:c,fontSize:l,buttonBg:u,fontSizeLG:d,controlHeightLG:f,controlHeightSM:p,paddingXS:m,borderRadius:h,borderRadiusSM:g,borderRadiusLG:_,buttonCheckedBg:v,buttonSolidCheckedColor:y,colorTextDisabled:b,colorBgContainerDisabled:x,buttonCheckedBgDisabled:S,buttonCheckedColorDisabled:C,colorPrimary:w,colorPrimaryHover:T,colorPrimaryActive:E,buttonSolidCheckedBg:D,buttonSolidCheckedHoverBg:O,buttonSolidCheckedActiveBg:k,calc:A}=e;return{[`${r}-button-wrapper`]:{position:`relative`,display:`inline-block`,height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:l,lineHeight:Q(A(n).sub(A(i).mul(2)).equal()),background:u,border:`${Q(i)} ${a} ${o}`,borderBlockStartWidth:A(i).add(.02).equal(),borderInlineEndWidth:i,cursor:`pointer`,transition:[`color ${s}`,`background ${s}`,`box-shadow ${s}`].join(`,`),a:{color:t},[`> ${r}-button`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:`100%`,height:`100%`},"&:not(:last-child)":{marginInlineEnd:A(i).mul(-1).equal()},"&:first-child":{borderInlineStart:`${Q(i)} ${a} ${o}`,borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},[`${r}-group-large &`]:{height:f,fontSize:d,lineHeight:Q(A(f).sub(A(i).mul(2)).equal()),"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${r}-group-small &`]:{height:p,paddingInline:A(m).sub(i).equal(),paddingBlock:0,lineHeight:Q(A(p).sub(A(i).mul(2)).equal()),"&:first-child":{borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g}},"&:hover":{position:`relative`,color:w},"&:has(:focus-visible)":po(e),[`${r}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:`none`},[`&-checked:not(${r}-button-wrapper-disabled)`]:{zIndex:1,color:w,background:v,borderColor:w,"&::before":{backgroundColor:w},"&:first-child":{borderColor:w},"&:hover":{color:T,borderColor:T,"&::before":{backgroundColor:T}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${r}-group-solid &-checked:not(${r}-button-wrapper-disabled)`]:{color:y,background:D,borderColor:D,"&:hover":{color:y,background:O,borderColor:O},"&:active":{color:y,background:k,borderColor:k}},"&-disabled":{color:b,backgroundColor:x,borderColor:o,cursor:`not-allowed`,"&:first-child, &:hover":{color:b,backgroundColor:x,borderColor:o}},[`&-disabled${r}-button-wrapper-checked`]:{color:C,backgroundColor:S,borderColor:o,boxShadow:`none`},"&-block":{flex:1,textAlign:`center`}}}},q4=_o(`Radio`,e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r=`0 0 0 ${Q(n)} ${t}`,i=La(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[W4(i),G4(i),K4(i)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:i,fontSizeLG:a,colorText:o,colorBgContainer:s,colorTextDisabled:c,controlItemBgActiveDisabled:l,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e,h=a;return{radioSize:h,dotSize:t?h-8:h-(4+i)*2,dotColorDisabled:c,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:s,buttonCheckedBg:s,buttonColor:o,buttonCheckedBgDisabled:l,buttonCheckedColorDisabled:c,buttonPaddingInline:n-i,wrapperMarginInlineEnd:r,radioColor:t?d:m,radioBgColor:t?s:d}},{unitless:{radioSize:!0,dotSize:!0}}),J4=function(e,t){var n={};for(var r in e)Obje
Line truncated
|
||||
& > ${t}-affix-wrapper,
|
||||
& > ${t}-number-affix-wrapper,
|
||||
& > ${n}-picker-range
|
||||
`]:{display:`inline-flex`},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:`none`},[`& > ${n}-select > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete ${t},
|
||||
& > ${n}-cascader-picker ${t},
|
||||
& > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
||||
& > ${n}-select:first-child > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete:first-child ${t},
|
||||
& > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,
|
||||
& > ${n}-select:last-child > ${n}-select-selector,
|
||||
& > ${n}-cascader-picker:last-child ${t},
|
||||
& > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:`top`},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},N3=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:i}=e,a=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},so(e)),j3(e)),g3(e)),S3(e)),y3(e)),D3(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:`none`}})}},P3=e=>{let{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,border:`none`,outline:`none`,backgroundColor:`transparent`,"&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:`hidden`},"&-has-suffix":{margin:`0 ${Q(e.inputAffixPadding)}`}}}},F3=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e,c=`${t}-affix-wrapper`,l=`${t}-affix-wrapper-disabled`;return{[c]:Object.assign(Object.assign(Object.assign(Object.assign({},j3(e)),{display:`inline-flex`,[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:`inherit`,border:`none`,borderRadius:0,outline:`none`,background:`transparent`,color:`inherit`,"&::-ms-reveal":{display:`none`},"&:focus":{boxShadow:`none !important`}},"&::before":{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,"> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:`ltr`},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),P3(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:`pointer`,transition:`all ${i}`,"&:hover":{color:o}}}),[`${t}-underlined`]:{borderRadius:0},[l]:{[`${s}${t}-password-icon`]:{color:a,cursor:`not-allowed`,"&:hover":{color:a}}}}},I3=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},so(e)),M3(e)),{"&-rtl":{direction:`rtl`},"&-wrapper":Object.assign(Object.assign(Object.assign({display:`inline-block`,width:`100%`,textAlign:`start`,verticalAlign:`top`,"&-rtl":{direction:`rtl`},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},v3(e)),w3(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},L3=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:`none`},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:`rtl`},[`&${t}Line truncated
|
||||
> ${t},
|
||||
${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},R3=e=>{let{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},z3=_o([`Input`,`Shared`],e=>{let t=La(e,u3(e));return[N3(t),F3(t)]},d3,{resetFont:!1}),B3=_o([`Input`,`Component`],e=>{let t=La(e,u3(e));return[I3(t),L3(t),R3(t),zf(t)]},d3,{resetFont:!1}),V3={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`},H3=s.forwardRef(function(e,t){return s.createElement($s,c({},e,{ref:t,icon:V3}))}),U3=(0,s.createContext)(null),W3=function(e){var t=e.activeTabOffset,n=e.horizontal,r=e.rtl,i=e.indicator,a=i===void 0?{}:i,o=a.size,c=a.align,l=c===void 0?`center`:c,u=Z((0,s.useState)(),2),d=u[0],f=u[1],p=(0,s.useRef)(),m=s.useCallback(function(e){return typeof o==`function`?o(e):typeof o==`number`?o:e},[o]);function h(){$e.cancel(p.current)}return(0,s.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var i=r?`right`:`left`;l===`start`&&(e[i]=t[i]),l===`center`&&(e[i]=t[i]+t.width/2,e.transform=r?`translateX(50%)`:`translateX(-50%)`),l===`end`&&(e[i]=t[i]+t.width,e.transform=`translateX(-100%)`)}else e.height=m(t.height),l===`start`&&(e.top=t.top),l===`center`&&(e.top=t.top+t.height/2,e.transform=`translateY(-50%)`),l===`end`&&(e.top=t.top+t.height,e.transform=`translateY(-100%)`)}return h(),p.current=$e(function(){d&&e&&Object.keys(e).every(function(t){var n=e[t],r=d[t];return typeof n==`number`&&typeof r==`number`?Math.round(n)===Math.round(r):n===r})||f(e)}),h},[JSON.stringify(t),n,r,l,m]),{style:d}},G3={width:0,height:0,left:0,top:0};function K3(e,t,n){return(0,s.useMemo)(function(){for(var n=new Map,r=t.get(e[0]?.key)||G3,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)||G3;var c=n.get(o)||O({},s);c.right=i-c.left-c.width,n.set(o,c)}return n},[e.map(function(e){return e.key}).join(`_`),t,n])}function q3(e,t){var n=s.useRef(e),r=Z(s.useState({}),2)[1];function i(e){var i=typeof e==`function`?e(n.current):e;i!==n.current&&t(i,n.current),n.current=i,r({})}return[n.current,i]}var J3=.1,Y3=.01,X3=20,Z3=.995**X3;function Q3(e,t){var n=Z((0,s.useState)(),2),r=n[0],i=n[1],a=Z((0,s.useState)(0),2),o=a[0],c=a[1],l=Z((0,s.useState)(0),2),u=l[0],d=l[1],f=Z((0,s.useState)(),2),p=f[0],m=f[1],h=(0,s.useRef)();function g(e){var t=e.touches[0];i({x:t.screenX,y:t.screenY}),window.clearInterval(h.current)}function _(e){if(r){var n=e.touches[0],a=n.screenX,s=n.screenY;i({x:a,y:s});var l=a-r.x,u=s-r.y;t(l,u);var f=Date.now();c(f),d(f-o),m({x:l,y:u})}}function v(){if(r&&(i(null),m(null),p)){var e=p.x/u,n=p.y/u;if(Math.max(Math.abs(e),Math.abs(n))<J3)return;var a=e,o=n;h.current=window.setInterval(function(){Math.abs(a)<Y3&&Math.abs(o)<Y3?window.clearInterval(h.current):(a*=Z3,o*=Z3,t(a*X3,o*X3))},X3)}}var y=(0,s.useRef)();function b(e){var n=e.deltaX,r=e.deltaY,i=0,a=Math.abs(n),o=Math.abs(r);a===o?i=y.current===`x`?n:r:a>o?(i=n,y.current=`x`):(i=r,y.current=`y`),t(-i,-i)&&e.preventDefault()}var x=(0,s.useRef)(null);x.current={onTouchStart:g,onTouchMove:_,onTouchEnd:v,onWheel:b},s.useEffect(function(){function t(e){x.current.onTouchStart(e)}function n(e){x.current.onTouchMove(e)}function r(e){x.current.onTouchEnd(e)}function i(e){x.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 $3(e){var t=Z((0,s.useState)(0),2),n=t[0],r=t[1],i=(0,s.useRef)(0),a=(0,s.useRef)();return a.current=e,Jt(function(){var e;(e=a.current)==null||e.call(a)},[n]),function(){i.current===n&&(i.current+=1,r(i.current))}}function e6(e){var t=(0,s.useRef)([]),n=Z((0,s.useState)({}),2)[1],r=(0,s.useRef)(typeof e==`function`?e():e),i=$3(function(){var e=r.current;t.current.forEach(function(t){e=t(e)}),t.current=[],r.current=e,n({})});function a(e){t.current.push(e),i()}return[r.current,a]}var t6={width:0,height:0,left:0,top:0,right:0};function n6(e,t,n,r,i,a,o){var c=o.tabs,l=o.tabPosition,u=o.rtl,d,f,p;return[`top`,`bottom`].includes(l)?(d=`width`,f=u?`right`:`left`,p=Math.abs(n)):(d=`height`,f=`top`,p=-n),(0,s.useMemo)(function(){if(!c.length)return[0,0];for(var n=c.length,r=n,i=0;i<n;i+=1){var a=e.get(c[i].key)||t6;if(Math.floor(a[f]+a[d])>Math.floor(p+t)){r=i-1;break}}for(var o=0,s=n-1;s>=0;--s)if((e.get(c[s].key)||t6)[f]<p){o=s+1;break}return o>r?[0,-1]:[o,r]},[e,t,r,i,a,p,l,c.map(function(e){return e.key}).join(`_`),u])}function r6(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]
Line truncated
|
||||
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:Q(s(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Q(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:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},F6=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 ${Q(e.borderRadius)} ${Q(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${Q(e.borderRadius)} ${Q(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Q(e.borderRadius)} ${Q(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Q(e.borderRadius)} 0 0 ${Q(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},I6=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:i,tabsHorizontalItemMargin:a,horizontalItemPadding:o,itemSelectedColor:s,itemColor:c}=e,l=`${t}-tab`;return{[l]:{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:c,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:`none`,transition:`all ${e.motionDurationSlow}`,[`${l}-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}},mo(e)),"&:hover":{color:r},[`&${l}-active ${l}-btn`]:{color:s,textShadow:e.tabsActiveTextShadow},[`&${l}-focus ${l}-btn:focus-visible`]:po(e),[`&${l}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${l}-disabled ${l}-btn, &${l}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${l}-remove ${i}`]:{margin:0,verticalAlign:`middle`},[`${i}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${l} + ${l}`]:{margin:{_skip_check_:!0,value:a}}}},L6=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:i,calc:a}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Q(e.marginSM)}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Q(e.marginXS)},marginLeft:{_skip_check_:!0,value:Q(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-navLine truncated
|
||||
> ${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:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})},K6=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:`
|
||||
${Q(i)} 0 0 0 ${n},
|
||||
0 ${Q(i)} 0 0 ${n},
|
||||
${Q(i)} ${Q(i)} 0 0 ${n},
|
||||
${Q(i)} 0 0 0 ${n} inset,
|
||||
0 ${Q(i)} 0 0 ${n} inset;
|
||||
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},q6=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:`${Q(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`},lo()),{"& > 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:Q(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:Q(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${Q(e.lineWidth)} ${e.lineType} ${a}`}}})},J6=e=>Object.assign(Object.assign({margin:`${Q(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`},lo()),{"&-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},oo),"&-description":{color:e.colorTextDescription}}),Y6=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${Q(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${Q(e.padding)} ${Q(i)}`}}},X6=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},Z6=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadowTertiary:a,bodyPadding:o,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},so(e)),{position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:G6(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:s,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`},[`${t}-grid`]:K6(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:q6(e),[`${t}-meta`]:J6(e)}),[`${t}-bordered`]:{border:`${Q(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:`${Q(e.borderRadiusLG)} ${Q(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`]:Y6(e),[`${t}-loading`]:X6(e),[`${t}-rtl`]:{direction:`rtl`}}},Q6=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${Q(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`}}}}},$6=_o(`Card`,e=>{let t=La(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[Z6(t),Q6(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`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:e.bodyPadding??e.paddingLG,headerPadding:e.headerPadding??e.paddingLG})),eb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},tb=e=>{let{actionClasses:t,actions:n=[],actionStyle:r}=e;return s.createElement(`ul`,{className:t,style:r},n.map((e,t)=>{let r=`action-${t}`;return s.createElement(`li`,{style:{width:`${100/n.length}%`},key:r},s.createElement(`span`,null,e))}))},nb=s.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,style:a,extra:o,headStyle:c={},bodyStyle:l={},title:u,loading:d,bordered:
Line truncated
|
||||
${n}:not(${n}-disabled),
|
||||
${t}:not(${t}-disabled)
|
||||
`]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:`rotate(45deg) scale(1) translate(-50%,-50%)`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`
|
||||
${n}-checked:not(${n}-disabled),
|
||||
${t}-checked:not(${t}-disabled)
|
||||
`]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:`50%`,insetInlineStart:`50%`,width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:`translate(-50%, -50%) scale(1)`,opacity:1,content:`""`}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:`not-allowed`},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:`not-allowed`,pointerEvents:`none`},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:`none`},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function lb(e,t){return cb(La(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}var ub=_o(`Checkbox`,(e,{prefixCls:t})=>[lb(t,e)]),db=s.createContext(null),fb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},pb=s.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,children:a,indeterminate:o=!1,style:c,onMouseEnter:l,onMouseLeave:u,skipGroup:d=!1,disabled:f}=e,p=fb(e,[`prefixCls`,`className`,`rootClassName`,`children`,`indeterminate`,`style`,`onMouseEnter`,`onMouseLeave`,`skipGroup`,`disabled`]),{getPrefixCls:m,direction:g,checkbox:_}=s.useContext(da),v=s.useContext(db),{isFormItemInput:y}=s.useContext(xh),b=s.useContext(va),x=(v?.disabled||f)??b,S=s.useRef(p.value),C=s.useRef(null),w=R(t,C);s.useEffect(()=>{v?.registerValue(p.value)},[]),s.useEffect(()=>{if(!d)return p.value!==S.current&&(v?.cancelValue(S.current),v?.registerValue(p.value),S.current=p.value),()=>v?.cancelValue(p.value)},[p.value]),s.useEffect(()=>{C.current?.input&&(C.current.input.indeterminate=o)},[o]);let T=m(`checkbox`,n),E=Rc(T),[D,O,k]=ub(T,E),A=Object.assign({},p);v&&!d&&(A.onChange=(...e)=>{p.onChange&&p.onChange.apply(p,e),v.toggleOption&&v.toggleOption({label:a,value:p.value})},A.name=v.name,A.checked=v.value.includes(p.value));let j=(0,h.default)(`${T}-wrapper`,{[`${T}-rtl`]:g===`rtl`,[`${T}-wrapper-checked`]:A.checked,[`${T}-wrapper-disabled`]:x,[`${T}-wrapper-in-form-item`]:y},_?.className,r,i,k,E,O),M=(0,h.default)({[`${T}-indeterminate`]:o},mu,O),[N,P]=U4(A.onClick);return D(s.createElement(xu,{component:`Checkbox`,disabled:x},s.createElement(`label`,{className:j,style:Object.assign(Object.assign({},_?.style),c),onMouseEnter:l,onMouseLeave:u,onClick:N},s.createElement(H4,Object.assign({},A,{onClick:P,prefixCls:T,className:M,disabled:x,ref:w})),a!=null&&s.createElement(`span`,{className:`${T}-label`},a))))}),mb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},hb=s.forwardRef((e,t)=>{let{defaultValue:n,children:r,options:i=[],prefixCls:a,className:o,rootClassName:c,style:l,onChange:u}=e,d=mb(e,[`defaultValue`,`children`,`options`,`prefixCls`,`className`,`rootClassName`,`style`,`onChange`]),{getPrefixCls:f,direction:p}=s.useContext(da),[m,g]=s.useState(d.value||n||[]),[_,v]=s.useState([]);s.useEffect(()=>{`value`in d&&g(d.value||[])},[d.value]);let y=s.useMemo(()=>i.map(e=>typeof e==`string`||typeof e==`number`?{label:e,value:e}:e),[i]),b=e=>{v(t=>t.filter(t=>t!==e))},x=e=>{v(t=>[].concat(X(t),[e]))},S=e=>{let t=m.indexOf(e.value),n=X(m);t===-1?n.push(e.value):n.splice(t,1),`value`in d||g(n),u?.(n.filter(e=>_.includes(e)).sort((e,t)=>y.findIndex(t=>t.value===e)-y.findIndex(e=>e.value===t)))},C=f(`checkbox`,a),w=`${C}-group`,T=Rc(C),[E,D,O]=ub(C,T),k=du(d,[`value`,`disabled`]),A=i.length?y.map(e=>s.createElement(pb,{prefixCls:C,key:e.value.toString(),disabled:`disabled`in e?e.disabled:d.disabled,value:e.value,checked:m.includes(e.value),onChange:e.onChange,className:(0,h.default)(`${w}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):r,j=s.useMemo(()=>({toggleOption:S,value:m,disabled:d.disabled,name:d.name,registerValue:x,cancelValue:b}),[S,m,d.disabled,d.name,x,b]),M=(0,h.default)(w,{[`${w}-rtl`]:p===`rtl`},o,c,O,T,D);return E(s.createElement(`div`,Object.assign({className:M,style:l},k,{ref:t}),s.createElement(db.Provider,{value:j},A)))}),gb=pb;gb.Group=hb,gb.__ANT_CHECKBOX=!0;var _b=(0,s.createContext)({}),vb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)
Line truncated
|
||||
opacity ${e.motionDurationFast} ${e.motionEaseInOut},
|
||||
transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},D8=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Q(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),O8=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},k8=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},so(e)),D8(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},O8(e,e.controlHeightSM)),"&-large":Object.assign({},O8(e,e.controlHeightLG))})}},A8=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:a,labelColor:o,labelFontSize:s,labelHeight:c,labelColonMarginInlineStart:l,labelColonMarginInlineEnd:u,itemMarginBottom:d}=e;return{[t]:Object.assign(Object.assign({},so(e)),{marginBottom:d,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden,
|
||||
&-hidden${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:e.lineHeight,whiteSpace:`unset`,"> label":{verticalAlign:`middle`,textWrap:`balance`}},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:c,color:o,fontSize:s,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required`]:{"&::before":{display:`inline-block`,marginInlineEnd:e.marginXXS,color:a,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:`none`}}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:l,marginInlineEnd:u},[`&${t}-no-colon::after`]:{content:`"\\a0"`}}},[`${t}-control`]:{"--ant-display":`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`,[`&:has(> ${i}-switch:only-child, > ${i}-rate:only-child)`]:{display:`flex`,alignItems:`center`}}}},[t]:{"&-additional":{display:`flex`,flexDirection:`column`},"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:Bd,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},j8=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{visibility:`hidden`}}}),M8=e=>{let{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:`unset`}},[`${t}-col-24${n}-label,
|
||||
${t}-col-xl-24${n}-label`]:j8(e)}}},N8=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[`${n}-inline`]:{flex:`none`,marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:`nowrap`},[`> ${n}-label,
|
||||
> ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},P8=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:j8(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:`wrap`,[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}}},F8=e=>{let{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:`column`},[`${n}-label > label`]:{height:`auto`},[`${n}-control`]:{width:`100%`},[`${n}-label,
|
||||
${r}-col-24${n}-label,
|
||||
${r}-col-xl-24${n}-label`]:j8(e)},[`@media (max-width: ${Q(e.screenXSMax)})`]:[P8(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:j8(e)}}}],[`@media (max-width: ${Q(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:j8(e)}}},[`@media (max-width: ${Q(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:j8(e)}}},[`@media (max-width: ${Q(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:j8(e)}}}}},I8=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),L8=(e,t)=>La(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),R8=_o(`Form`,(e,{rootPrefixCls:t})=>{let n=L8(e,t);return[k8(n),A8(n),E8(n),M8(n),N8(n),F8(n),hd(n),Bd]},I8,{order:-1e3}),z8=[];function B8(e,t,n,r=0){return{key:typeof e==`string`?e:`${t}-${r}`,error:e,errorStatus:n}}var V8=({help:e,helpStatus:t,errors:n=z8,warnings:r=z8,className:i,fieldId:a,onVisibleChanged:o})=>{let{prefixCls:c}=s.useContext(bh),l=`${c}-item-explain`,u=Rc(c),[d,f,p]=R8(c,u),m=s.useMemo(()=>lu(c),[c]),g=T8(n),_=T8(r),v=s.useMemo(()=>e==null?[].concat(X(g.map((e,t)=>B8(e,`error`,`error`,t))),X(_.map((e,t)=>B8(e,`warning`,`warning`,t)))):[B8(e,`help`,t)],[e,t,g,_]),y=s.useMemo(()=>{let e={};return v.forEach(({key:t})=>{e[t]=(e[t]||0)+1}),v.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?`${t.key}-fallback-${n}`:t.key}))},[v]),b={};return a&&(b.id=`${a}_help`),d(s.createElement(vs,{motionDeadline:m.motionDeadline,motionName:`${c}-show-help`,visible:!!y.length,onVisibleChanged:o},e=>{let{className:t,style:n}=e;return s.createElement(`div`,Object.assign({},b,{className:(0,h.default)(l,t,p,u,i,f),style:n}),s.createElement(_s,Object.assign({keys:y},lu(c),{motionName:`${c}-show-help-item`,component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:i,style:a}=e;return s.createElement(`div`,{key:t,className:(0,h.default)(i,{[`${l}-${r}`]:r}),style:a},n)}))}))},H8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},U8=s.forwardRef((e,t)=>{let n=s.useContext(va),{getPrefixCls:r,direction:i,requiredMark:a,colon:o,scrollToFirstError:c,className:l,style:u}=ma(`form`),{prefixCls:d,className:f,rootClassName:p,size:m,disabled:g=n,form:_,colon:v,labelAlign:y,labelWrap:b,labelCol:x,wrapperCol:S,hideRequiredMark:C,layout:w=`horizontal`,scrollToFirstError:T,requiredMark:E,onFinishFailed:D,name:O,style:k,feedbackIcons:A,variant:j}=e,M=H8(e,[`prefixCls`,`className`,`rootClassName`,`size`,`disabled`,`form`,`colon`,`labelAlign`,`labelWrap`,`labelCol`,`wrapperCol`,`hideRequiredMark`,`layout`,`scrollToFirstError`,`requiredMark`,`onFinishFailed`,`name`,`style`,`feedbackIcons`,`variant`]),N=Su(m),P=s.useContext(Lr),F=s.useMemo(()=>E===void 0?C?!1:a===void 0||a:E,[C,E,a]),I=v??o,L=r(`form`,d),R=Rc(L),[z,B,V]=R8(L,R),H=(0,h.default)(L,`${L}-${w}`,{[`${L}-hide-required-mark`]:F===!1,[`${L}-rtl`]:i===`rtl`,[`${L}-${N}`]:N},V,R,B,l,f,p),[U]=i3(_),{__INTERNAL__:W}=U;W.name=O;let G=s.useMemo(()=>({name:O,labelAlign:y,labelCol:x,labelWrap:b,wrapperCol:S,layout:w,colon:I,requiredMark:F,itemRef:W.itemRef,form:U,feedbackIcons:A}),[O,y,x,S,w,I,F,U,A]),K=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign(Object.assign({},U),{nativeElement:K.current?.nativeElement}));let q=(e,t)=>{if(e){let n={block:`nearest`};typeof e==`object`&&(n=Object.assign(Object.assign({},n),e)),U.scrollToField(t,n)}};return z(s.createElement(Ch.Provider,{value:j},s.createElement(ya,{disabled:g},s.createElement(ba.Provider,{value:N},s.createElement(yh,{validateMessages:P},s.createElement(_h.Provider,{value:G},s.createElement(Sh,{status:!0},s.createElement(gh,Object.assign({id:O},M,{name:O,onFinishFailed:e=>{if(D?.(e),e.errorFields.length){let t=e.errorFields[0].name;if(T!==void 0){q(T,t);return}c!==void 0&&q(c,t)}},form:U,ref:K,style:Object.assign(Object.assign({},u),k),className:H})))))))))});function W8(e){if(typeof e==`function`)return e;let t=g(e);return t.length<=1?t[0]:t}var G8=()=>{let{status:e,errors:t=[],warnings:n=[]}=s.useContext(xh);return{status:e,errors:t,warnings:n}};G8.Context=xh;function K8(e){let[t,n]=s.useState(e),r=s.useRef(null),i=s.useRef([]),a=s.useRef(!1);s.useEffect(()=>(a.current=!1,()=>{a.current=!0,$e.cancel(r.current),r.current=null}),[]);function o(e){a.current||(r.current===null&&(i.current=[],r.current=$e(()=>{r.current=null,n(e=>{let t=e;return i.current.forEach(e=>{t=e(t)}),t})})),i.current.push(e))}return[t,o]}function q8
Line truncated
|
||||
min-height:0 !important;
|
||||
max-height:none !important;
|
||||
height:0 !important;
|
||||
visibility:hidden !important;
|
||||
overflow:hidden !important;
|
||||
position:absolute !important;
|
||||
z-index:-1000 !important;
|
||||
top:0 !important;
|
||||
right:0 !important;
|
||||
pointer-events: none !important;
|
||||
`,Ix=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],Lx={},Rx;function zx(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.getAttribute(`id`)||e.getAttribute(`data-reactid`)||e.getAttribute(`name`);if(t&&Lx[n])return Lx[n];var r=window.getComputedStyle(e),i=r.getPropertyValue(`box-sizing`)||r.getPropertyValue(`-moz-box-sizing`)||r.getPropertyValue(`-webkit-box-sizing`),a=parseFloat(r.getPropertyValue(`padding-bottom`))+parseFloat(r.getPropertyValue(`padding-top`)),o=parseFloat(r.getPropertyValue(`border-bottom-width`))+parseFloat(r.getPropertyValue(`border-top-width`)),s={sizingStyle:Ix.map(function(e){return`${e}:${r.getPropertyValue(e)}`}).join(`;`),paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(Lx[n]=s),s}function Bx(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Rx||(Rx=document.createElement(`textarea`),Rx.setAttribute(`tab-index`,`-1`),Rx.setAttribute(`aria-hidden`,`true`),Rx.setAttribute(`name`,`hiddenTextarea`),document.body.appendChild(Rx)),e.getAttribute(`wrap`)?Rx.setAttribute(`wrap`,e.getAttribute(`wrap`)):Rx.removeAttribute(`wrap`);var i=zx(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,c=i.sizingStyle;Rx.setAttribute(`style`,`${c};${Fx}`),Rx.value=e.value||e.placeholder||``;var l=void 0,u=void 0,d,f=Rx.scrollHeight;if(s===`border-box`?f+=o:s===`content-box`&&(f-=a),n!==null||r!==null){Rx.value=` `;var p=Rx.scrollHeight-a;n!==null&&(l=p*n,s===`border-box`&&(l=l+a+o),f=Math.max(l,f)),r!==null&&(u=p*r,s===`border-box`&&(u=u+a+o),d=f>u?``:`hidden`,f=Math.min(u,f))}var m={height:f,overflowY:d,resize:`none`};return l&&(m.minHeight=l),u&&(m.maxHeight=u),m}var Vx=[`prefixCls`,`defaultValue`,`value`,`autoSize`,`onResize`,`className`,`style`,`disabled`,`onChange`,`onInternalAutoSize`],Hx=0,Ux=1,Wx=2,Gx=s.forwardRef(function(e,t){var n=e,r=n.prefixCls,i=n.defaultValue,a=n.value,o=n.autoSize,u=n.onResize,d=n.className,f=n.style,p=n.disabled,m=n.onChange;n.onInternalAutoSize;var g=yt(n,Vx),_=Z(Na(i,{value:a,postState:function(e){return e??``}}),2),v=_[0],y=_[1],b=function(e){y(e.target.value),m?.(e)},x=s.useRef();s.useImperativeHandle(t,function(){return{textArea:x.current}});var S=Z(s.useMemo(function(){return o&&l(o)===`object`?[o.minRows,o.maxRows]:[]},[o]),2),C=S[0],w=S[1],T=!!o,D=Z(s.useState(Wx),2),k=D[0],A=D[1],j=Z(s.useState(),2),M=j[0],N=j[1],P=function(){A(Hx)};qt(function(){T&&P()},[a,C,w,T]),qt(function(){if(k===Hx)A(Ux);else if(k===Ux){var e=Bx(x.current,!1,C,w);A(Wx),N(e)}},[k]);var F=s.useRef(),I=function(){$e.cancel(F.current)},L=function(e){k===Wx&&(u?.(e),o&&(I(),F.current=$e(function(){P()})))};s.useEffect(function(){return I},[]);var R=T?M:null,z=O(O({},f),R);return(k===Hx||k===Ux)&&(z.overflowY=`hidden`,z.overflowX=`hidden`),s.createElement(Ue,{onResize:L,disabled:!(o||u)},s.createElement(`textarea`,c({},g,{ref:x,style:z,className:(0,h.default)(r,d,E({},`${r}-disabled`,p)),disabled:p,value:v,onChange:b})))}),Kx=[`defaultValue`,`value`,`onFocus`,`onBlur`,`onChange`,`allowClear`,`maxLength`,`onCompositionStart`,`onCompositionEnd`,`suffix`,`prefixCls`,`showCount`,`count`,`className`,`style`,`disabled`,`hidden`,`classNames`,`styles`,`onResize`,`onClear`,`onPressEnter`,`readOnly`,`autoSize`,`onKeyDown`],qx=s.forwardRef(function(e,t){var n=e.defaultValue,r=e.value,i=e.onFocus,a=e.onBlur,o=e.onChange,l=e.allowClear,u=e.maxLength,d=e.onCompositionStart,f=e.onCompositionEnd,p=e.suffix,m=e.prefixCls,g=m===void 0?`rc-textarea`:m,_=e.showCount,v=e.count,y=e.className,b=e.style,x=e.disabled,S=e.hidden,C=e.classNames,w=e.styles,T=e.onResize,D=e.onClear,k=e.onPressEnter,A=e.readOnly,j=e.autoSize,M=e.onKeyDown,N=yt(e,Kx),P=Z(Na(n,{value:r,defaultValue:n}),2),F=P[0],I=P[1],L=F==null?``:String(F),R=Z(s.useState(!1),2),z=R[0],B=R[1],V=s.useRef(!1),H=Z(s.useState(null),2),U=H[0],W=H[1],G=(0,s.useRef)(null),K=(0,s.useRef)(null),q=function(){return K.current?.textArea},ee=function(){q().focus()};(0,s.useImperativeHandle)(t,function(){return{resizableTextArea:K.current,focus:ee,blur:function(){q().blur()},nativeElement:G.current?.nativeElement||q()}}),(0,s.useEffect)(function(){B(function(e){return!x&&e})},[x]);var J=Z(s.useState(null),2),Y=J[0],te=J[1];s.useEffect(function(){if(Y){var e;(e=q()).setSelectionRange.apply(e,X(Y))}},[Y]);var ne=Pb(v,_),re=ne.max??u,ie=Number(re)>0,ae=ne.strategy(L),oe=!!re&&ae>re,se=function(e,t){var n=t;!V.current&&ne.exceedFormatter&&ne.max&&ne.strategy(t)>ne.max&&(n=ne.exceedFormatter(t,{max:ne.max}),t!==n&&te([q().selectionStart||0,q().selectionEnd||0])),I(n),Ab(e.currentTarget,e,o,n)},ce=function(e){V.current=!0,d?.(e)},le=function(e){V.current=!1,se(e,e.currentTarget.value),f?.(e)},ue=function(
Line truncated
|
||||
&-allow-clear > ${t},
|
||||
&-affix-wrapper${r}-has-feedback ${t}
|
||||
`]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:`inherit`,border:`none`,outline:`none`,background:`transparent`,minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:`none !important`}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:`absolute`,insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`,pointerEvents:`none`}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:`ltr`,insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},Yx=_o([`Input`,`TextArea`],e=>Jx(La(e,u3(e))),d3,{resetFont:!1}),Xx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Zx=(0,s.forwardRef)((e,t)=>{let{prefixCls:n,bordered:r=!0,size:i,disabled:a,status:o,allowClear:c,classNames:l,rootClassName:u,className:d,style:f,styles:p,variant:m,showCount:g,onMouseDown:_,onResize:v}=e,y=Xx(e,[`prefixCls`,`bordered`,`size`,`disabled`,`status`,`allowClear`,`classNames`,`rootClassName`,`className`,`style`,`styles`,`variant`,`showCount`,`onMouseDown`,`onResize`]),{getPrefixCls:b,direction:x,allowClear:S,autoComplete:C,className:w,style:T,classNames:E,styles:D}=ma(`textArea`),O=s.useContext(va),k=a??O,{status:A,hasFeedback:j,feedbackIcon:M}=s.useContext(xh),N=dv(A,o),P=s.useRef(null);s.useImperativeHandle(t,()=>({resizableTextArea:P.current?.resizableTextArea,focus:e=>{jb(P.current?.resizableTextArea?.textArea,e)},blur:()=>P.current?.blur()}));let F=b(`input`,n),I=Rc(F),[L,R,z]=z3(F,u),[B]=Yx(F,I),{compactSize:V,compactItemClassnames:H}=Du(F,x),U=Su(e=>i??V??e),[W,G]=xv(`textArea`,m,r),K=Lb(c??S),[q,ee]=s.useState(!1),[J,Y]=s.useState(!1),te=e=>{ee(!0),_?.(e);let t=()=>{ee(!1),document.removeEventListener(`mouseup`,t)};document.addEventListener(`mouseup`,t)},ne=e=>{if(v?.(e),q&&typeof getComputedStyle==`function`){let e=(P.current?.nativeElement)?.querySelector(`textarea`);e&&getComputedStyle(e).resize===`both`&&Y(!0)}};return L(B(s.createElement(qx,Object.assign({autoComplete:C},y,{style:Object.assign(Object.assign({},T),f),styles:Object.assign(Object.assign({},D),p),disabled:k,allowClear:K,className:(0,h.default)(z,I,d,u,H,w,J&&`${F}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},l),E),{textarea:(0,h.default)({[`${F}-sm`]:U===`small`,[`${F}-lg`]:U===`large`},R,l?.textarea,E.textarea,q&&`${F}-mouse-active`),variant:(0,h.default)({[`${F}-${W}`]:G},uv(F,N)),affixWrapper:(0,h.default)(`${F}-textarea-affix-wrapper`,{[`${F}-affix-wrapper-rtl`]:x===`rtl`,[`${F}-affix-wrapper-sm`]:U===`small`,[`${F}-affix-wrapper-lg`]:U===`large`,[`${F}-textarea-show-count`]:g||e.count?.show},R)}),prefixCls:F,suffix:j&&s.createElement(`span`,{className:`${F}-textarea-suffix`},M),showCount:g,ref:P,onResize:ne,onMouseDown:te}))))}),Qx=Vb;Qx.Group=vx,Qx.Search=Px,Qx.TextArea=Zx,Qx.Password=Mx,Qx.OTP=Ex;var $x=100,e5=$x/5,t5=$x/2-e5/2,n5=80*Math.PI,r5=50,i5=e=>{let{dotClassName:t,style:n,hasCircleCls:r}=e;return s.createElement(`circle`,{className:(0,h.default)(`${t}-circle`,{[`${t}-circle-bg`]:r}),r:t5,cx:r5,cy:r5,strokeWidth:e5,style:n})},a5=({percent:e,prefixCls:t})=>{let n=`${t}-dot`,r=`${n}-holder`,i=`${r}-hidden`,[a,o]=s.useState(!1);qt(()=>{e!==0&&o(!0)},[e!==0]);let c=Math.max(Math.min(e,100),0);if(!a)return null;let l={strokeDashoffset:`${n5/4}`,strokeDasharray:`${n5*c/100} ${n5*(100-c)/100}`};return s.createElement(`span`,{className:(0,h.default)(r,`${n}-progress`,c<=0&&i)},s.createElement(`svg`,{viewBox:`0 0 ${$x} ${$x}`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":c},s.createElement(i5,{dotClassName:n,hasCircleCls:!0}),s.createElement(i5,{dotClassName:n,style:l})))};function o5(e){let{prefixCls:t,percent:n=0}=e,r=`${t}-dot`,i=`${r}-holder`,a=`${i}-hidden`;return s.createElement(s.Fragment,null,s.createElement(`span`,{className:(0,h.default)(i,n>0&&a)},s.createElement(`span`,{className:(0,h.default)(r,`${t}-dot-spin`)},[1,2,3,4].map(e=>s.createElement(`i`,{className:`${t}-dot-item`,key:e})))),s.createElement(a5,{prefixCls:t,percent:n}))}function s5(e){let{prefixCls:t,indicator:n,percent:r}=e,i=`${t}-dot`;return n&&s.isValidElement(n)?gc(n,{className:(0,h.default)(n.props?.className,i),percent:r}):s.createElement(o5,{prefixCls:t,percent:r})}var c5=new Cr(`antSpinMove`,{to:{opacity:1}}),l5=new Cr(`antRotate`,{to:{transform:`rotate(405deg)`}}),u5=e=>{let{componentCls:t,calc:n}=e;return{[t]:Object.a
Line truncated
|
||||
h${t}&,
|
||||
div&-h${t},
|
||||
div&-h${t} > textarea,
|
||||
h${t}
|
||||
`]=h7(e[`fontSizeHeading${t}`],e[`lineHeightHeading${t}`],e.colorTextHeading,e)}),n},_7=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},go(e)),{userSelect:`text`,[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:`none`}}})}},v7=e=>({code:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.2em 0.1em`,fontSize:`85%`,fontFamily:e.fontFamilyCode,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3},kbd:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.15em 0.1em`,fontSize:`90%`,fontFamily:e.fontFamilyCode,background:`rgba(150, 150, 150, 0.06)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:Ci[2]},"u, ins":{textDecoration:`underline`,textDecorationSkipInk:`auto`},"s, del":{textDecoration:`line-through`},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:`0 1em`,padding:0,li:{marginInline:`20px 0`,marginBlock:0,paddingInline:`4px 0`,paddingBlock:0}},ul:{listStyleType:`circle`,ul:{listStyleType:`disc`}},ol:{listStyleType:`decimal`},"pre, blockquote":{margin:`1em 0`},pre:{padding:`0.4em 0.6em`,whiteSpace:`pre-wrap`,wordWrap:`break-word`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:`inline`,margin:0,padding:0,fontSize:`inherit`,fontFamily:`inherit`,background:`transparent`,border:0}},blockquote:{paddingInline:`0.6em 0`,paddingBlock:0,borderInlineStart:`4px solid rgba(100, 100, 100, 0.2)`,opacity:.85}}),y7=e=>{let{componentCls:t,paddingSM:n}=e,r=n;return{"&-edit-content":{position:`relative`,"div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(r).div(-2).add(1).equal(),marginBottom:e.calc(r).div(2).sub(2).equal()},[`${t}-edit-content-confirm`]:{position:`absolute`,insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:`normal`,fontSize:e.fontSize,fontStyle:`normal`,pointerEvents:`none`},textarea:{margin:`0!important`,MozTransition:`none`,height:`1em`}}}},b7=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),x7=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:`inline-block`,maxWidth:`100%`},"&-ellipsis-single-line":{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,"a&, span&":{verticalAlign:`bottom`},"> code":{paddingBlock:0,maxWidth:`calc(100% - 1.2em)`,display:`inline-block`,overflow:`hidden`,textOverflow:`ellipsis`,verticalAlign:`bottom`,boxSizing:`content-box`}},"&-ellipsis-multiple-line":{display:`-webkit-box`,overflow:`hidden`,WebkitLineClamp:3,WebkitBoxOrient:`vertical`}}),S7=_o(`Typography`,e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:`break-word`,lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccessText},[`&${t}-warning`]:{color:e.colorWarningText},[`&${t}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,userSelect:`none`},"\n div&,\n p\n ":{marginBottom:`1em`}},g7(e)),{[`
|
||||
& + h1${t},
|
||||
& + h2${t},
|
||||
& + h3${t},
|
||||
& + h4${t},
|
||||
& + h5${t}
|
||||
`]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),v7(e)),_7(e)),{[`
|
||||
${t}-expand,
|
||||
${t}-collapse,
|
||||
${t}-edit,
|
||||
${t}-copy
|
||||
`]:Object.assign(Object.assign({},go(e)),{marginInlineStart:e.marginXXS})}),y7(e)),b7(e)),x7()),{"&-rtl":{direction:`rtl`}})}},()=>({titleMarginTop:`1.2em`,titleMarginBottom:`0.5em`})),C7=e=>{let{prefixCls:t,"aria-label":n,className:r,style:i,direction:a,maxLength:o,autoSize:c=!0,value:l,onSave:u,onCancel:d,onEnd:f,component:p,enterIcon:m=s.createElement(m7,null)}=e,g=s.useRef(null),_=s.useRef(!1),v=s.useRef(null),[y,b]=s.useState(l);s.useEffect(()=>{b(l)},[l]),s.useEffect(()=>{if(g.current?.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let x=({target:e})=>{b(e.value.replace(/[\n\r]/g,``))},S=()=>{_.current=!0},C=()=>{_.current=!1},w=({keyCode:e})=>{_.current||(v.current=e)},T=()=>{u(y.trim())},E=({keyCode:e,ctrlKey:t,altKey:n,metaKey:r,shiftKey:i})=>{v.current!==e||_.current||t||n||r||i||(e===$.ENTER?(T(),f?.()):e===$.ESC&&d())},D=()=>{T()},[O,k,A]=S7(t),j=(0,h.default)(t,`${t}-edit-content`,{[`${t}-rtl`]:a===`rtl`,[`${t}-${p}`]:!!p},r,k,A);return O(s.createElement(`div`,{className:j,style:i},s.createElement(Zx,{ref:g,maxLength:o,value:y,onChange:x,onKeyDown:w,onKeyUp:E,onCompositionStart:S,onCompositionEnd:C,onBlur:D,"aria-label":n,rows:1,autoSize:c}),m===null?null:gc(m,{className:`${t}-edit-content-confirm`})))},w7=t(((e,t)=>{t.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case`INPUT`:case`TEXTAREA`:t.blur();break;default:t=null}return e.removeAllRanges(),function(){e.type===`Caret`&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}})),T7=e(t(((e,t)=>{var n=w7(),r={"text/plain":`Text`,"text/html":`Url`,default:`Text`},i=`Copy to clipboard: #{key}, Enter`;function a(e){var t=(/mac os x/i.test(navigator.userAgent)?`⌘`:`Ctrl`)+`+C`;return e.replace(/#{\s*key\s*}/g,t)}t.exports=function(e,t){var o,s,c,l,u,d,f=!1;t||={},o=t.debug||!1;try{if(c=n(),l=document.createRange(),u=document.getSelection(),d=document.createElement(`span`),d.textContent=e,d.ariaHidden=`true`,d.style.all=`unset`,d.style.position=`fixed`,d.style.top=0,d.style.clip=`rect(0, 0, 0, 0)`,d.style.whiteSpace=`pre`,d.style.webkitUserSelect=`text`,d.style.MozUserSelect=`text`,d.style.msUserSelect=`text`,d.style.userSelect=`text`,d.addEventListener(`copy`,function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),n.clipboardData===void 0){o&&console.warn(`unable to use e.clipboardData`),o&&console.warn(`trying IE specific stuff`),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),u.addRange(l),!document.execCommand(`copy`))throw Error(`copy command was unsuccessful`);f=!0}catch(n){o&&console.error(`unable to copy using execCommand: `,n),o&&console.warn(`trying IE specific stuff`);try{window.clipboardData.setData(t.format||`text`,e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){o&&console.error(`unable to copy using clipboardData: `,n),o&&console.error(`falling back to prompt`),s=a(`message`in t?t.message:i),window.prompt(s,e)}}finally{u&&(typeof u.removeRange==`function`?u.removeRange(l):u.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}}))()),E7=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},D7=({copyConfig:e,children:t})=>{let[n,r]=s.useState(!1),[i,a]=s.useState(!1),o=s.useRef(null),c=()=>{o.current&&clearTimeout(o.current)},l={};return e.format&&(l.format=e.format),s.useEffect(()=>c,[]),{copied:n,copyLoading:i,onClick:Aa(n=>E7(void 0,void 0,void 0,function*(){var i;n?.preventDefault(),n?.stopPropagation(),a(!0);try{let s=typeof e.text==`function`?yield e.text():e.text;(0,T7.default)(s||y5(t,!0).join(``)||``,l),a(!1),r(!0),c(),o.current=setTimeout(()=>{r(!1)},3e3),(i=e.onCopy)==null||i.call(e,n)}catch(e){throw a(!1),e}}))}};function O7(e,t){return s.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&typeof e==`object`?e:null)]},[e])}var k7=e=>{let t=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{t.current=e}),t.current},A7=(e,t,n)=>(0,s.useMemo)(()=>e===!0?{title:t??n}:(0,s.isValidElement)(e)?{title:e}:typeof e==`object`?Object.assign({title:t??n},e):{title:e},[e,t,n]),j7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnume
Line truncated
|
||||
+370
@@ -0,0 +1,370 @@
|
||||
import{n as e,t}from"./rolldown-runtime-Dl_DZoUm.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function N(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function P(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,P(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),P(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=P(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=P(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return P(N(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function F(e,t,n){if(e==null)return e;var r=[],i=0;return P(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function I(e){if(e._status===-1){var t=(0,e._result)();t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,t.status===void 0&&(t.status=`fulfilled`,t.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,t.status===void 0&&(t.status=`rejected`,t.reason=n))}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var L=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function R(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,L)}catch(e){L(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function z(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else R(z.bind(null,e))}var B={map:F,forEach:function(e,t,n){F(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return F(e,function(){t++}),t},toArray:function(e){return F(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.ChilLine truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X(e){var t=Ke(e);return t===e?Ge(e):t||qe(e)||Je()}var Ye=function(e){return+setTimeout(e,16)},Xe=function(e){return clearTimeout(e)};typeof window<`u`&&`requestAnimationFrame`in window&&(Ye=function(e){return window.requestAnimationFrame(e)},Xe=function(e){return window.cancelAnimationFrame(e)});var Ze=0,Qe=new Map;function $e(e){Qe.delete(e)}var et=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;Ze+=1;var n=Ze;function r(t){if(t===0)$e(n),e();else{var i=Ye(function(){r(t-1)});Qe.set(n,i)}}return r(t),n};et.cancel=function(e){var t=Qe.get(e);return $e(e),Xe(t)};function tt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(Array.isArray(e)&&(n==null||n===(typeof Symbol<`u`&&[][Symbol.iterator])||n===[][`@@iterator`]))return e;if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function nt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z(e,t){return tt(e,t)||qe(e,t)||nt()}function rt(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*0x5bd1e995+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*0x5bd1e995+((n>>>16)*59797<<16)^(t&65535)*0x5bd1e995+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*0x5bd1e995+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*0x5bd1e995+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function it(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function at(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var ot=`data-rc-order`,st=`data-rc-priority`,ct=`rc-util-key`,lt=new Map;function ut(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).mark;return e?e.startsWith(`data-`)?e:`data-${e}`:ct}function dt(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function ft(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function pt(e){return Array.from((lt.get(e)||e).children).filter(function(e){return e.tagName===`STYLE`})}function mt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!it())return null;var n=t.csp,r=t.prepend,i=t.priority,a=i===void 0?0:i,o=ft(r),s=o===`prependQueue`,c=document.createElement(`style`);c.setAttribute(ot,o),s&&a&&c.setAttribute(st,`${a}`),n!=null&&n.nonce&&(c.nonce=n?.nonce),c.innerHTML=e;var l=dt(t),u=l.firstChild;if(r){if(s){var d=(t.styles||pt(l)).filter(function(e){return[`prepend`,`prependQueue`].includes(e.getAttribute(ot))?a>=Number(e.getAttribute(st)||0):!1});if(d.length)return l.insertBefore(c,d[d.length-1].nextSibling),c}l.insertBefore(c,u)}else l.appendChild(c);return c}function ht(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=dt(t);return(t.styles||pt(n)).find(function(n){return n.getAttribute(ut(t))===e})}function gt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=ht(e,t);n&&dt(t).removeChild(n)}function _t(e,t){var n=lt.get(e);if(!n||!at(document,n)){var r=mt(``,t),i=r.parentNode;lt.set(e,i),e.removeChild(r)}}function vt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=dt(n),i=pt(r),a=O(O({},n),{},{styles:i});_t(r,a);var o=ht(t,a);if(o){var s;return(s=a.csp)!=null&&s.nonce&&o.nonce!==a.csp?.nonce&&(o.nonce=a.csp?.nonce),o.innerHTML!==e&&(o.innerHTML=e),o}var c=mt(e,a);return c.setAttribute(ut(a),t),c}function yt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function bt(e,t){if(e==null)return{};var n,r,i=yt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xt(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=new Set;function i(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,o=r.has(e);if(C(!o,`Warning: There may be circular references`),o)return!1;if(e===t)return!0;if(n&&a>1)return!1;r.add(e);var s=a+1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var c=0;c<e.length;c++)if(!i(e[c],t[c],s))return!1;return!0}if(e&&t&&l(e)===`object`&&l(t)===`object`){var u=Object.keys(e);return u.length===Object.keys(t).length&&u.every(function(n){return i(e[n],t[n],s)})}return!1}return i(e,t)}var St=`%`;function Ct(e){return e.join(St)}var wt=function(){function e(t){Ae(this,e),E(this,`instanceId`,void 0),E(this,`cache`,new Map),E(this,`extracted`,new Set),this.instanceId=t}return Me(e,[{key:`get`,value:function(e){return this.opGet(Ct(e))}},{key:`opGet`,value:function(e){return this.cache.get(e)||null}},{key:`update`,value:function(e,t){return this.opUpdate(Ct(e),t)}},{key:`opUpdate`,value:function(e,t){var n=t(this.cache.get(e));n===null?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),Tt=`data-token-hash`,Et=`data-css-hash`,Dt=`__cssinjs_instance__`;function Ot(){var e=Math.random().toString(12).slice(2);if(typeof document<`u`&&document.head&&document.body){var t=document.body.querySelectorAll(`style[data-css-hash]`)||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[Dt]=t.__cssinjs_instance__||e,t.__cssinjs_instance__===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll(`style[${Et}]`)).forEach(function(t){var n=t.getAttribute(Et);if(r[n]){if(t.__cssinjs_instance__===e){var i;(i=t.parentNode)==null||i.removeChild(t)}}else r[n]=!0})}return new wt(e)}var kt=s.createContext({hashPriority:`low`,cache:Ot(),defaultCache:!0});function At(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var jt
Line truncated
|
||||
`;else if(r._keyframe)h(r);else{var c=f.reduce(function(e,t){var n;return(t==null||(n=t.visit)==null?void 0:n.call(t,e))||e},r);Object.keys(c).forEach(function(t){var r=c[t];if(l(r)===`object`&&r&&(t!==`animationName`||!r._keyframe)&&!mr(r)){var d=!1,f=t.trim(),g=!1;(i||a)&&s?f.startsWith(`@`)?d=!0:f=hr(f===`&`?``:t,s,u):i&&!s&&(f===`&`||f===``)&&(f=``,g=!0);var _=Z(e(r,n,{root:g,injectHash:d,parentSelectors:[].concat(X(o),[f])}),2),v=_[0],y=_[1];m=O(O({},m),y),p+=`${f}${v}`}else{function e(e,t){var n=e.replace(/[A-Z]/g,function(e){return`-${e.toLowerCase()}`}),r=t;!fn[e]&&typeof r==`number`&&r!==0&&(r=`${r}px`),e===`animationName`&&t!=null&&t._keyframe&&(h(t),r=t.getName(s)),p+=`${n}:${r};`}var b=r?.value??r;l(r)===`object`&&r!=null&&r[fr]&&Array.isArray(b)?b.forEach(function(n){e(t,n)}):e(t,b)}})}}),i?c&&(p&&=`@layer ${c.name} {${p}}`,c.dependencies&&(m[`@layer ${c.name}`]=c.dependencies.map(function(e){return`@layer ${e}, ${c.name};`}).join(`
|
||||
`))):p=`{${p}}`,[p,m]};function _r(e,t){return rt(`${e.join(`%`)}${t}`)}function vr(){return null}var yr=`style`;function br(e,t){var n=e.token,r=e.path,i=e.hashId,a=e.layer,o=e.nonce,l=e.clientOnly,u=e.order,d=u===void 0?0:u,f=s.useContext(kt),p=f.autoClear;f.mock;var m=f.defaultCache,h=f.hashPriority,g=f.container,_=f.ssrInline,v=f.transformers,y=f.linters,b=f.cache,x=f.layer,S=n._tokenKey,C=[S];x&&C.push(`layer`),C.push.apply(C,X(r));var w=Ht,T=Z($t(yr,C,function(){var e=C.join(`|`);if(lr(e)){var n=Z(ur(e),2),o=n[0],s=n[1];if(o)return[o,S,s,{},l,d]}var c=Z(gr(t(),{hashId:i,hashPriority:h,layer:x?a:void 0,path:r.join(`-`),transformers:v,linters:y}),2),u=c[0],f=c[1],p=pr(u);return[p,S,_r(C,p),f,l,d]},function(e,t){var n=Z(e,3)[2];(t||p)&&Ht&>(n,{mark:Et,attachTo:g})},function(e){var t=Z(e,4),n=t[0];t[1];var r=t[2],i=t[3];if(w&&n!==`_FILE_STYLE__`){var a={mark:Et,prepend:!x&&`queue`,attachTo:g,priority:d},s=typeof o==`function`?o():o;s&&(a.csp={nonce:s});var c=[],l=[];Object.keys(i).forEach(function(e){e.startsWith(`@layer`)?c.push(e):l.push(e)}),c.forEach(function(e){vt(pr(i[e]),`_layer-${e}`,O(O({},a),{},{prepend:!0}))});var u=vt(n,r,a);u[Dt]=b.instanceId,u.setAttribute(Tt,S),l.forEach(function(e){vt(pr(i[e]),`_effect-${e}`,a)})}}),3),D=T[0],k=T[1],A=T[2];return function(e){var t=!_||w||!m?s.createElement(vr,null):s.createElement(`style`,c({},E(E({},Tt,k),Et,A),{dangerouslySetInnerHTML:{__html:D}}));return s.createElement(s.Fragment,null,t,e)}}var xr=function(e,t,n){var r=Z(e,6),i=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=(n||{}).plain;if(c)return null;var d=i,f={"data-rc-order":`prependQueue`,"data-rc-priority":`${l}`};return d=Ut(i,a,o,f,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var n=Ut(pr(s[e]),a,`_effect-${e}`,f,u);e.startsWith(`@layer`)?d=n+d:d+=n}}),[l,o,d]},Sr=`cssVar`,Cr=function(e,t){var n=e.key,r=e.prefix,i=e.unitless,a=e.ignore,o=e.token,c=e.scope,l=c===void 0?``:c,u=(0,s.useContext)(kt),d=u.cache.instanceId,f=u.container,p=o._tokenKey,m=[].concat(X(e.path),[n,l,p]);return $t(Sr,m,function(){var e=Z(Kt(t(),n,{prefix:r,unitless:i,ignore:a,scope:l}),2),o=e[0],s=e[1];return[o,s,_r(m,s),n]},function(e){var t=Z(e,3)[2];Ht&>(t,{mark:Et,attachTo:f})},function(e){var t=Z(e,3),r=t[1],i=t[2];if(r){var a=vt(r,i,{mark:Et,prepend:`queue`,attachTo:f,priority:-999});a[Dt]=d,a.setAttribute(Tt,n)}})};E(E(E({},yr,xr),ln,dn),Sr,function(e,t,n){var r=Z(e,4),i=r[1],a=r[2],o=r[3],s=(n||{}).plain;if(!i)return null;var c=-999;return[c,a,Ut(i,o,a,{"data-rc-order":`prependQueue`,"data-rc-priority":`${c}`},s)]});var wr=function(){function e(t,n){Ae(this,e),E(this,`name`,void 0),E(this,`style`,void 0),E(this,`_keyframe`,!0),this.name=t,this.style=n}return Me(e,[{key:`getName`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:``;return e?`${e}-${this.name}`:this.name}}]),e}();function Tr(e){return e.notSplit=!0,e}Tr([`borderTop`,`borderBottom`]),Tr([`borderTop`]),Tr([`borderBottom`]),Tr([`borderLeft`,`borderRight`]),Tr([`borderLeft`]),Tr([`borderRight`]);var Er=(0,s.createContext)({});function Dr(e){return Ke(e)||qe(e)||nt()}function Or(e,t){for(var n=e,r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function kr(e,t,n,r){if(!t.length)return n;var i=Dr(t),a=i[0],o=i.slice(1),s=!e&&typeof a==`number`?[]:Array.isArray(e)?X(e):O({},e);return r&&n===void 0&&o.length===1?delete s[a][o[0]]:s[a]=kr(s[a],o,n,r),s}function Ar(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return t.length&&r&&n===void 0&&!Or(e,t.slice(0,-1))?e:kr(e,t,n,r)}function jr(e){return l(e)===`object`&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Mr(e){return Array.isArray(e)?[]:{}}var Nr=typeof Reflect>`u`?Object.keys:Reflect.ownKeys;function Pr(){var e=[...arguments],t=Mr(e[0]);return e.forEach(function(e){function n(r,i){var a=new Set(i),o=Or(e,r),s=Array.isArray(o);if(s||jr(o)){if(!a.has(o)){a.add(o);var c=Or(t,r);s?t=Ar(t,r,[]):c&&l(c)===`object`||(t=Ar(t,r,Mr(o))),Nr(o).forEach(function(e){n([].concat(X(r),[e]),a)})}}else t=Ar(t,r,o)}n([])}),t}function Fr(){}var Ir=s.createContext({}),Lr=()=>{let e=()=>{};return e.deprecated=Fr,e},Rr=(0,s.createContext)(void 0),zr={items_per_page:`/ page`,jump_to:`Go to`,jump_to_confirm:`confirm`,page:`Page`,prev_page:`Previous Page`,next_page:`Next Page`,prev_5:`Previous 5 Pages`,next_5:`Next 5 Pages`,prev_3:`Previous 3 Pages`,next_3:`Next 3 Pages`,page_size:`Page Size`},Br=O(O({},{yearFormat:`YYYY`,dayFormat:`D`,cellMeridiemFormat:`A`,monthBeforeYear:!0}),{},{locale:`en_US`,today:`Today`,now:`Now`,backToToday:`Back to today`,ok:`OK`,clear:`Clear`,week:`Week`,month:`Month`,year:`Year`,timeSelect:`select time`,dateSelect:`select date`,weekSelect:`Choose a week`,monthSelect:`Choose a month`,yearSelect:`Choose a year`,decadeSelect:`Choose a decade`,dateFormat:`M/D/YYYY`,dateTimeFormat:`M/D/YYYY HH:mm:ss`,previousMonth:`Previous month (PageUp)`,nextMonth:`Next month (PageDown)`,previousYear:`Last year (Control + left)`,next
Line truncated
|
||||
'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
||||
'Noto Color Emoji'`,fontFamilyCode:`'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`,fontSize:14,lineWidth:1,lineType:`solid`,motionUnit:.1,motionBase:0,motionEaseOutCirc:`cubic-bezier(0.08, 0.82, 0.17, 1)`,motionEaseInOutCirc:`cubic-bezier(0.78, 0.14, 0.15, 0.86)`,motionEaseOut:`cubic-bezier(0.215, 0.61, 0.355, 1)`,motionEaseInOut:`cubic-bezier(0.645, 0.045, 0.355, 1)`,motionEaseOutBack:`cubic-bezier(0.12, 0.4, 0.29, 1.46)`,motionEaseInBack:`cubic-bezier(0.71, -0.46, 0.88, 0.6)`,motionEaseInQuint:`cubic-bezier(0.755, 0.05, 0.855, 0.06)`,motionEaseOutQuint:`cubic-bezier(0.23, 1, 0.32, 1)`,borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0}),ri=Math.round;function ii(e,t){let n=e.replace(/^[^(]*\((.*)/,`$1`).replace(/\).*/,``).match(/\d*\.?\d+%?/g)||[],r=n.map(e=>parseFloat(e));for(let e=0;e<3;e+=1)r[e]=t(r[e]||0,n[e]||``,e);return r[3]=n[3]?n[3].includes(`%`)?r[3]/100:r[3]:1,r}var ai=(e,t,n)=>n===0?e:e/100;function oi(e,t){let n=t||255;return e>n?n:e<0?0:e}var si=class e{constructor(t){E(this,`isValid`,!0),E(this,`r`,0),E(this,`g`,0),E(this,`b`,0),E(this,`a`,1),E(this,`_h`,void 0),E(this,`_s`,void 0),E(this,`_l`,void 0),E(this,`_v`,void 0),E(this,`_max`,void 0),E(this,`_min`,void 0),E(this,`_brightness`,void 0);function n(e){return e[0]in t&&e[1]in t&&e[2]in t}if(t){if(typeof t==`string`){let e=t.trim();function n(t){return e.startsWith(t)}/^#?[A-F\d]{3,8}$/i.test(e)?this.fromHexString(e):n(`rgb`)?this.fromRgbString(e):n(`hsl`)?this.fromHslString(e):(n(`hsv`)||n(`hsb`))&&this.fromHsvString(e)}else if(t instanceof e)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n(`rgb`))this.r=oi(t.r),this.g=oi(t.g),this.b=oi(t.b),this.a=typeof t.a==`number`?oi(t.a,1):1;else if(n(`hsl`))this.fromHsl(t);else if(n(`hsv`))this.fromHsv(t);else throw Error(`@ant-design/fast-color: unsupported input `+JSON.stringify(t))}}setR(e){return this._sc(`r`,e)}setG(e){return this._sc(`g`,e)}setB(e){return this._sc(`b`,e)}setA(e){return this._sc(`a`,e,1)}setHue(e){let t=this.toHsv();return t.h=e,this._c(t)}getLuminance(){function e(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}let t=e(this.r),n=e(this.g),r=e(this.b);return .2126*t+.7152*n+.0722*r}getHue(){if(this._h===void 0){let e=this.getMax()-this.getMin();this._h=e===0?0:ri(60*(this.r===this.getMax()?(this.g-this.b)/e+(this.g<this.b?6:0):this.g===this.getMax()?(this.b-this.r)/e+2:(this.r-this.g)/e+4))}return this._h}getSaturation(){if(this._s===void 0){let e=this.getMax()-this.getMin();this._s=e===0?0:e/this.getMax()}return this._s}getLightness(){return this._l===void 0&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return this._v===void 0&&(this._v=this.getMax()/255),this._v}getBrightness(){return this._brightness===void 0&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()-e/100;return r<0&&(r=0),this._c({h:t,s:n,l:r,a:this.a})}lighten(e=10){let t=this.getHue(),n=this.getSaturation(),r=this.getLightness()+e/100;return r>1&&(r=1),this._c({h:t,s:n,l:r,a:this.a})}mix(e,t=50){let n=this._c(e),r=t/100,i=e=>(n[e]-this[e])*r+this[e],a={r:ri(i(`r`)),g:ri(i(`g`)),b:ri(i(`b`)),a:ri(i(`a`)*100)/100};return this._c(a)}tint(e=10){return this.mix({r:255,g:255,b:255,a:1},e)}shade(e=10){return this.mix({r:0,g:0,b:0,a:1},e)}onBackground(e){let t=this._c(e),n=this.a+t.a*(1-this.a),r=e=>ri((this[e]*this.a+t[e]*t.a*(1-this.a))/n);return this._c({r:r(`r`),g:r(`g`),b:r(`b`),a:n})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}clone(){return this._c(this)}toHexString(){let e=`#`,t=(this.r||0).toString(16);e+=t.length===2?t:`0`+t;let n=(this.g||0).toString(16);e+=n.length===2?n:`0`+n;let r=(this.b||0).toString(16);if(e+=r.length===2?r:`0`+r,typeof this.a==`number`&&this.a>=0&&this.a<1){let t=ri(this.a*255).toString(16);e+=t.length===2?t:`0`+t}return e}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){let e=this.getHue(),t=ri(this.getSaturation()*100),n=ri(this.getLightness()*100);return this.a===1?`hsl(${e},${t}%,${n}%)`:`hsla(${e},${t}%,${n}%,${this.a})`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${this.a})`}toString(){return this.toRgbString()}_sc(e,t,n){let r=this.clone();return r[e]=oi(t,n),r}_c(e){return new this.constructor(e)}getMax(){return this._max===void 0&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return this._min===void 0&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(e){let t=e.replace(`#`,``);functio
Line truncated
|
||||
:root {
|
||||
${Object.keys(n).map(t=>`--${e}-${t}: ${n[t]};`).join(`
|
||||
`)}
|
||||
}
|
||||
`.trim()}function va(e,t){let n=_a(e,t);it()&&vt(n,`${ga}-dynamic-theme`)}var ya=s.createContext(!1),ba=({children:e,disabled:t})=>{let n=s.useContext(ya);return s.createElement(ya.Provider,{value:t??n},e)},xa=s.createContext(void 0),Sa=({children:e,size:t})=>{let n=s.useContext(xa);return s.createElement(xa.Provider,{value:t||n},e)},Ca=Me(function e(){Ae(this,e)}),wa=`CALC_UNIT`,Ta=new RegExp(wa,`g`);function Ea(e){return typeof e==`number`?`${e}${wa}`:e}var Da=function(e){Pe(n,e);var t=Re(n);function n(e,r){var i;Ae(this,n),i=t.call(this),E(Y(i),`result`,``),E(Y(i),`unitlessCssVar`,void 0),E(Y(i),`lowPriority`,void 0);var a=l(e);return i.unitlessCssVar=r,e instanceof n?i.result=`(${e.result})`:a===`number`?i.result=Ea(e):a===`string`&&(i.result=e),i}return Me(n,[{key:`add`,value:function(e){return e instanceof n?this.result=`${this.result} + ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} + ${Ea(e)}`),this.lowPriority=!0,this}},{key:`sub`,value:function(e){return e instanceof n?this.result=`${this.result} - ${e.getResult()}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} - ${Ea(e)}`),this.lowPriority=!0,this}},{key:`mul`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} * ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} * ${e}`),this.lowPriority=!1,this}},{key:`div`,value:function(e){return this.lowPriority&&(this.result=`(${this.result})`),e instanceof n?this.result=`${this.result} / ${e.getResult(!0)}`:(typeof e==`number`||typeof e==`string`)&&(this.result=`${this.result} / ${e}`),this.lowPriority=!1,this}},{key:`getResult`,value:function(e){return this.lowPriority||e?`(${this.result})`:this.result}},{key:`equal`,value:function(e){var t=this,n=(e||{}).unit,r=!0;return typeof n==`boolean`?r=n:Array.from(this.unitlessCssVar).some(function(e){return t.result.includes(e)})&&(r=!1),this.result=this.result.replace(Ta,r?`px`:``),this.lowPriority===void 0?this.result:`calc(${this.result})`}}]),n}(Ca),Oa=function(e){Pe(n,e);var t=Re(n);function n(e){var r;return Ae(this,n),r=t.call(this),E(Y(r),`result`,0),e instanceof n?r.result=e.result:typeof e==`number`&&(r.result=e),r}return Me(n,[{key:`add`,value:function(e){return e instanceof n?this.result+=e.result:typeof e==`number`&&(this.result+=e),this}},{key:`sub`,value:function(e){return e instanceof n?this.result-=e.result:typeof e==`number`&&(this.result-=e),this}},{key:`mul`,value:function(e){return e instanceof n?this.result*=e.result:typeof e==`number`&&(this.result*=e),this}},{key:`div`,value:function(e){return e instanceof n?this.result/=e.result:typeof e==`number`&&(this.result/=e),this}},{key:`equal`,value:function(){return this.result}}]),n}(Ca),ka=function(e,t){var n=e===`css`?Da:Oa;return function(e){return new n(e,t)}},Aa=function(e,t){return`${[t,e.replace(/([A-Z]+)([A-Z][a-z]+)/g,`$1-$2`).replace(/([a-z])([A-Z])/g,`$1-$2`)].filter(Boolean).join(`-`)}`};function ja(e){var t=s.useRef();return t.current=e,s.useCallback(function(){var e,n=[...arguments];return(e=t.current)?.call.apply(e,[t].concat(n))},[])}function Ma(e){var t=s.useRef(!1),n=Z(s.useState(e),2),r=n[0],i=n[1];s.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]);function a(e,n){n&&t.current||i(e)}return[r,a]}function Na(e){return e!==void 0}function Pa(e,t){var n=t||{},r=n.defaultValue,i=n.value,a=n.onChange,o=n.postState,s=Z(Ma(function(){return Na(i)?i:Na(r)?typeof r==`function`?r():r:typeof e==`function`?e():e}),2),c=s[0],l=s[1],u=i===void 0?c:i,d=o?o(u):u,f=ja(a),p=Z(Ma([u]),2),m=p[0],h=p[1];return Yt(function(){var e=m[0];c!==e&&f(c,e)},[m]),Yt(function(){Na(i)||l(i)},[i]),[d,ja(function(e,t){l(e,t),h([u],t)})]}function Fa(e,t,n,r){var i=O({},t[e]);r!=null&&r.deprecatedTokens&&r.deprecatedTokens.forEach(function(e){var t=Z(e,2),n=t[0],r=t[1];(i!=null&&i[n]||i!=null&&i[r])&&(i[r]??(i[r]=i?.[n]))});var a=O(O({},n),i);return Object.keys(a).forEach(function(e){a[e]===t[e]&&delete a[e]}),a}var Ia=typeof CSSINJS_STATISTIC<`u`,La=!0;function Ra(){var e=[...arguments];if(!Ia)return Object.assign.apply(Object,[{}].concat(e));La=!1;var t={};return e.forEach(function(e){l(e)===`object`&&Object.keys(e).forEach(function(n){Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){return e[n]}})})}),La=!0,t}var za={};function Ba(){}var Va=function(e){var t,n=e,r=Ba;return Ia&&typeof Proxy<`u`&&(t=new Set,n=new Proxy(e,{get:function(e,n){if(La){var r;(r=t)==null||r.add(n)}return e[n]}}),r=function(e,n){za[e]={global:Array.from(t),component:O(O({},za[e]?.component),n)}}),{token:n,keys:t,flush:r}};function Ha(e,t,n){return typeof n==`function`?n(Ra(t,t[e]??{})):n??{}}function Ua(e){return e===`js`?{max:Math.max,min:Math.min}:{max:function(){return`max(${[...arguments].map(function(e){return Q(e)}).join(`,`)})`},min:function(){return`min(${[...arguments].map(function(e){return Q(e)}).join(`,`)Line truncated
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowSecondary:`
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowTertiary:`
|
||||
0 1px 2px 0 rgba(0, 0, 0, 0.03),
|
||||
0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
||||
0 2px 4px 0 rgba(0, 0, 0, 0.02)
|
||||
`,screenXS:480,screenXSMin:480,screenXSMax:575,screenSM:576,screenSMMin:576,screenSMMax:767,screenMD:768,screenMDMin:768,screenMDMax:991,screenLG:992,screenLGMin:992,screenLGMax:1199,screenXL:a,screenXLMin:a,screenXLMax:1599,screenXXL:o,screenXXLMin:o,boxShadowPopoverArrow:`2px 2px 5px rgba(0, 0, 0, 0.05)`,boxShadowCard:`
|
||||
0 1px 2px -2px ${new si(`rgba(0, 0, 0, 0.16)`).toRgbString()},
|
||||
0 3px 6px 0 ${new si(`rgba(0, 0, 0, 0.12)`).toRgbString()},
|
||||
0 5px 12px 4px ${new si(`rgba(0, 0, 0, 0.09)`).toRgbString()}
|
||||
`,boxShadowDrawerRight:`
|
||||
-6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
||||
-3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
||||
-9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerLeft:`
|
||||
6px 0 16px 0 rgba(0, 0, 0, 0.08),
|
||||
3px 0 6px -4px rgba(0, 0, 0, 0.12),
|
||||
9px 0 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerUp:`
|
||||
0 6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowDrawerDown:`
|
||||
0 -6px 16px 0 rgba(0, 0, 0, 0.08),
|
||||
0 -3px 6px -4px rgba(0, 0, 0, 0.12),
|
||||
0 -9px 28px 8px rgba(0, 0, 0, 0.05)
|
||||
`,boxShadowTabsOverflowLeft:`inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowRight:`inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowTop:`inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)`,boxShadowTabsOverflowBottom:`inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)`}),r)}var to=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},no={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},ro={motionBase:!0,motionUnit:!0},io={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},ao=(e,t,n)=>{let r=n.getDerivativeToken(e),{override:i}=t,a=to(t,[`override`]),o=Object.assign(Object.assign({},r),{override:i});return o=eo(o),a&&Object.entries(a).forEach(([e,t])=>{let{theme:n}=t,r=to(t,[`theme`]),i=r;n&&(i=ao(Object.assign(Object.assign({},o),r),{override:r},n)),o[e]=i}),o};function oo(){let{token:e,hashed:t,theme:n,override:r,cssVar:i}=s.useContext(la),a=`${Xa}-${t||``}`,o=n||sa,[c,l,u]=un(o,[ni,e],{salt:a,override:r,getComputedToken:ao,formatToken:eo,cssVar:i&&{prefix:i.prefix,key:i.key,unitless:no,ignore:ro,preserve:io}});return[o,u,t?l:``,c,i]}var so={overflow:`hidden`,whiteSpace:`nowrap`,textOverflow:`ellipsis`},co=(e,t=!1)=>({boxSizing:`border-box`,margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:`none`,fontFamily:t?`inherit`:e.fontFamily}),lo=()=>({display:`inline-flex`,alignItems:`center`,color:`inherit`,fontStyle:`normal`,lineHeight:0,textAlign:`center`,textTransform:`none`,verticalAlign:`-0.125em`,textRendering:`optimizeLegibility`,"-webkit-font-smoothing":`antialiased`,"-moz-osx-font-smoothing":`grayscale`,"> *":{lineHeight:1},svg:{display:`inline-block`}}),uo=()=>({"&::before":{display:`table`,content:`""`},"&::after":{display:`table`,clear:`both`,content:`""`}}),fo=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:`transparent`,outline:`none`,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":`objects`,"&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:`not-allowed`}}}),po=(e,t,n,r)=>{let i=`[class^="${t}"], [class*=" ${t}"]`,a=n?`.${n}`:i,o={boxSizing:`border-box`,"&::before, &::after":{boxSizing:`border-box`}},s={};return r!==!1&&(s={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[a]:Object.assign(Object.assign(Object.assign({},s),o),{[i]:o})}},mo=(e,t)=>({outline:`${Q(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:`outline-offset 0s, outline 0s`}),ho=(e,t)=>({"&:focus-visible":mo(e,t)}),go=e=>({[`.${e}`]:Object.assign(Object.assign({},lo()),{[`.${e} .${e}-icon`]:{display:`block`}})}),_o=e=>Object.assign(Object.assign({color:e.colorLink,textDecoration:e.linkDecoration,outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:`none`,userSelect:`none`},ho(e)),{"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}}),{genStyleHooks:vo,genComponentStyleHook:yo,genSubStyleComponent:bo}=Ja({usePrefix:()=>{let{getPrefixCls:e,iconPrefixCls:t}=(0,s.useContext)(fa);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{let[e,t,n,r,i]=oo();return{theme:e,realToken:t,hashId:n,token:r,cssVar:i}},useCSP:()=>{let{csp:e}=(0,s.useContext)(fa);return e??{}},getResetStyles:(e,t)=>{let n=fo(e);return[n,{"&":n},go(t?.prefix.iconPrefixCls??ua)]},getCommonStyle:po,getCompUnitless:()=>no});function xo(e,t){return Ya.reduce((n,r)=>{let i=e[`${r}1`],a=e[`${r}3`],o=e[`${r}6`],s=e[`${r}7`];return Object.assign(Object.assign({},n),t(r,{lightColor:i,lightBorderColor:a,darkColor:o,textColor:s}))},{})}var So=(e,t)=>{let[n,r]=oo();return br({theme:n,token:r,hashId:``,path:[`ant-design-icons`,e],nonce:()=>t?.nonce,layer:{name:`antd`}},()=>go(e))},{useId:Co}=Object.assign({},s),wo=Co===void 0?()=>``:Co;function To(e,t,n){Lr(`ConfigProvider`);let r=e||{},i=r.inherit===!1||!t?Object.assign(Object.assign({},ca),{hashed:t?.hashed??ca.hashed,cssVar:t?.cssVar}):t,a=wo();return P(()=>{if(!e)return t;let o=Object.assign({},i.components);Object.k
Line truncated
|
||||
.anticon {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
font-style: normal;
|
||||
line-height: 0;
|
||||
text-align: center;
|
||||
text-transform: none;
|
||||
vertical-align: -0.125em;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.anticon > * {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.anticon svg {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.anticon::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.anticon .anticon-icon {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.anticon[tabindex] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.anticon-spin::before,
|
||||
.anticon-spin {
|
||||
display: inline-block;
|
||||
-webkit-animation: loadingCircle 1s infinite linear;
|
||||
animation: loadingCircle 1s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes loadingCircle {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes loadingCircle {
|
||||
100% {
|
||||
-webkit-transform: rotate(360deg);
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
`,Js=function(e){var t=(0,s.useContext)(Er),n=t.csp,r=t.prefixCls,i=t.layer,a=qs;r&&(a=a.replace(/anticon/g,r)),i&&(a=`@layer ${i} {
|
||||
${a}
|
||||
}`),(0,s.useEffect)(function(){var t=zs(e.current);vt(a,`@ant-design-icons`,{prepend:!i,csp:n,attachTo:t})},[])},Ys=[`icon`,`className`,`onClick`,`style`,`primaryColor`,`secondaryColor`],Xs={primaryColor:`#333`,secondaryColor:`#E6E6E6`,calculated:!1},Zs=function(e){var t=e.icon,n=e.className,r=e.onClick,i=e.style,a=e.primaryColor,o=e.secondaryColor,c=bt(e,Ys),l=s.useRef(),u=Xs;if(a&&(u={primaryColor:a,secondaryColor:o||Gs(a)}),Js(l),Vs(Hs(t),`icon should be icon definiton, but got ${t}`),!Hs(t))return null;var d=t;return d&&typeof d.icon==`function`&&(d=O(O({},d),{},{icon:d.icon(u.primaryColor,u.secondaryColor)})),Ws(d.icon,`svg-${d.name}`,O(O({className:n,onClick:r,style:i,"data-icon":d.name,width:`1em`,height:`1em`,fill:`currentColor`,"aria-hidden":`true`},c),{},{ref:l}))};Zs.displayName=`IconReact`,Zs.getTwoToneColors=function(){return O({},Xs)},Zs.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Xs.primaryColor=t,Xs.secondaryColor=n||Gs(t),Xs.calculated=!!n};function Qs(e){var t=Z(Ks(e),2),n=t[0],r=t[1];return Zs.setTwoToneColors({primaryColor:n,secondaryColor:r})}var $s=[`className`,`icon`,`spin`,`rotate`,`tabIndex`,`onClick`,`twoToneColor`];Qs(ki.primary);var ec=s.forwardRef(function(e,t){var n=e.className,r=e.icon,i=e.spin,a=e.rotate,o=e.tabIndex,l=e.onClick,u=e.twoToneColor,d=bt(e,$s),f=s.useContext(Er),p=f.prefixCls,m=p===void 0?`anticon`:p,g=f.rootClassName,_=(0,h.default)(g,m,E(E({},`${m}-${r.name}`,!!r.name),`${m}-spin`,!!i||r.name===`loading`),n),v=o;v===void 0&&l&&(v=-1);var y=a?{msTransform:`rotate(${a}deg)`,transform:`rotate(${a}deg)`}:void 0,b=Z(Ks(u),2),x=b[0],S=b[1];return s.createElement(`span`,c({role:`img`,"aria-label":r.name},d,{ref:t,tabIndex:v,onClick:l,className:_}),s.createElement(Zs,{icon:r,primaryColor:x,secondaryColor:S,style:y}))});ec.displayName=`AntdIcon`,ec.getTwoToneColor=function(){var e=Zs.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},ec.setTwoToneColor=Qs;var tc=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:Is}))}),nc={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z`}}]},name:`close-circle`,theme:`filled`},rc=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:nc}))}),ic={icon:{tag:`svg`,attrs:{"fill-rule":`evenodd`,viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z`}}]},name:`close`,theme:`outlined`},ac=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:ic}))}),oc={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`exclamation-circle`,theme:`filled`},sc=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:oc}))}),cc={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z`}}]},name:`info-circle`,theme:`filled`},lc=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:cc}))}),uc=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
||||
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
||||
charSet checked classID className colSpan cols content contentEditable contextMenu
|
||||
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
||||
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
||||
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
||||
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
||||
mediaGroup method min minLength multiple muted name noValidate nonce open
|
||||
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
||||
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
||||
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
||||
summary tabIndex target title type useMap value width wmode wrap onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
||||
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
||||
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
||||
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
||||
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
||||
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
||||
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`.split(/[\s\n]+/),dc=`aria-`,fc=`data-`;function pc(e,t){return e.indexOf(t)===0}function mc(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=t===!1?{aria:!0,data:!0,attr:!0}:t===!0?{aria:!0}:O({},t),r={};return Object.keys(e).forEach(function(t){(n.aria&&(t===`role`||pc(t,dc))||n.data&&pc(t,fc)||n.attr&&uc.includes(t))&&(r[t]=e[t])}),r}function hc(e){return e&&s.isValidElement(e)&&e.type===s.Fragment}var gc=(e,t,n)=>s.isValidElement(e)?s.cloneElement(e,typeof n==`function`?n(e.props||{}):n):t;function _c(e,t){return gc(e,e,t)}var vc=(e,t,n,r,i)=>({background:e,border:`${Q(r.lineWidth)} ${r.lineType} ${t}`,[`${i}-icon`]:{color:n}}),yc=e=>{let{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:i,fontSize:a,fontSizeLG:o,lineHeight:s,borderRadiusLG:c,motionEaseInOutCirc:l,withDescriptionIconSize:u,colorText:d,colorTextHeading:f,withDescriptionPadding:p,defaultPadding:m}=e;return{[t]:Object.assign(Object.assign({},co(e)),{position:`relative`,display:`flex`,alignItems:`center`,padding:m,wordWrap:`break-word`,borderRadius:c,[`&${t}-rtl`]:{direction:`rtl`},[`${t}-content`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:`none`,fontSize:a,lineHeight:s},"&-message":{color:f},[`&${t}-motion-leave`]:{overflow:`hidden`,opacity:1,transition:`max-height ${n} ${l}, opacity ${n} ${l},
|
||||
padding-top ${n} ${l}, padding-bottom ${n} ${l},
|
||||
margin-bottom ${n} ${l}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:`0 !important`,paddingTop:0,paddingBottom:0,opacity:0}}),[`${t}-with-description`]:{alignItems:`flex-start`,padding:p,[`${t}-icon`]:{marginInlineEnd:i,fontSize:u,lineHeight:0},[`${t}-message`]:{display:`block`,marginBottom:r,color:f,fontSize:o},[`${t}-description`]:{display:`block`,color:d}},[`${t}-banner`]:{marginBottom:0,border:`0 !important`,borderRadius:0}}},bc=e=>{let{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:i,colorWarning:a,colorWarningBorder:o,colorWarningBg:s,colorError:c,colorErrorBorder:l,colorErrorBg:u,colorInfo:d,colorInfoBorder:f,colorInfoBg:p}=e;return{[t]:{"&-success":vc(i,r,n,e,t),"&-info":vc(p,f,d,e,t),"&-warning":vc(s,o,a,e,t),"&-error":Object.assign(Object.assign({},vc(u,l,c,e,t)),{[`${t}-description > pre`]:{margin:0,padding:0}})}}},xc=e=>{let{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:i,fontSizeIcon:a,colorIcon:o,colorIconHover:s}=e;return{[t]:{"&-action":{marginInlineStart:i},[`${t}-close-icon`]:{marginInlineStart:i,padding:0,overflow:`hidden`,fontSize:a,lineHeight:Q(a),backgroundColor:`transparent`,border:`none`,outline:`none`,cursor:`pointer`,[`${n}-close`]:{color:o,transition:`color ${r}`,"&:hover":{color:s}}},"&-close-text":{color:o,transition:`color ${r}`,"&:hover":{color:s}}}}},Sc=vo(`Alert`,e=>[yc(e),bc(e),xc(e)],e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`})),Cc=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},wc={success:tc,info:lc,error:rc,warning:sc},Tc=e=>{let{icon:t,prefixCls:n,type:r}=e,i=wc[r]||null;return t?gc(t,s.createElement(`span`,{className:`${n}-icon`},t),()=>({className:(0,h.default)(`${n}-icon`,t.props.className)})):s.createElement(i,{className:`${n}-icon`})},Ec=e=>{let{isClosable:t,prefixCls:n,closeIcon:r,handleClose:i,ariaProps:a}=e,o=r===!0||r===void 0?s.createElement(ac,null):r;return t?s.createElement(`button`,Object.assign({type:`button`,onClick:i,className:`${n}-close-icon`,tabIndex:0},a),o):null},Dc=s.forwardRef((e,t)=>{let{description:n,prefixCls:r,message:i,banner:a,className:o,rootClassName:c,style:l,onMouseEnter:u,onMouseLeave:d,onClick:f,afterClose:p,showIcon:m,closable:g,closeText:_,closeIcon:v,action:y,id:b}=e,x=Cc(e,[`description`,`prefixCls`,`message`,`banner`,`className`,`rootClassName`,`style`,`onMouseEnter`,`onMouseLeave`,`onClick`,`afterClose`,`showIcon`,`closable`,`closeText`,`closeIcon`,`action`,`id`]),[S,C]=s.useState(!1),w=s.useRef(null);s.useImperativeHandle(t,()=>({nativeElement:w.current}));let{getPrefixCls:T,direction:E,closable:D,closeIcon:O,className:k,style:A}=ha(`alert`),j=T(`alert`,r),[M,N,P]=Sc(j),F=t=>{var n;C(!0),(n=e.onClose)==null||n.call(e,t)},I=s.useMemo(()=>e.type===void 0?a?`warning`:`info`:e.type,[e.type,a]),L=s.useMemo(()=>typeof g==`object`&&g.closeIcon||_?!0:typeof g==`boolean`?g:v!==!1&&v!=null||!!D,[_,v,g,D]),z=a&&m===void 0?!0:m,B=(0,h.default)(j,`${j}-${I}`,{[`${j}-with-description`]:!!n,[`${j}-no-icon`]:!z,[`${j}-banner`]:!!a,[`${j}-rtl`]:E===`rtl`},k,o,c,P,N),V=mc(x,{aria:!0,data:!0}),H=s.useMemo(()=>typeof g==`object`&&g.closeIcon?g.closeIcon:_||(v===void 0?typeof D==`object`&&D.closeIcon?D.closeIcon:O:v),[v,g,D,_,O]),U=s.useMemo(()=>{let e=g??D;if(typeof e==`object`){let{closeIcon:t}=e;return Cc(e,[`closeIcon`])}return{}},[g,D]);return M(s.createElement(ys,{visible:!S,motionName:`${j}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:e=>({maxHeight:e.offsetHeight}),onLeaveEnd:p},({className:t,style:r},a)=>s.createElement(`div`,Object.assign({id:b,ref:R(w,a),"data-show":!S,className:(0,h.default)(B,t),style:Object.assign(Object.assign(Object.assign({},A),l),r),onMouseEnter:u,onMouseLeave:d,onClick:f,role:`alert`},V),z?s.createElement(Tc,{description:n,icon:e.icon,prefixCls:j,type:I}):null,s.createElement(`div`,{className:`${j}-content`},i?s.createElement(`div`,{className:`${j}-message`},i):null,n?s.createElement(`div`,{className:`${j}-description`},n):null),y?s.createElement(`div`,{className:`${j}-action`},y):null,s.createElement(Ec,{isClosable:L,prefixCls:j,closeIcon:H,handleClose:F,ariaProps:U}))))});function Oc(e,t,n){return t=Fe(t),Le(e,Ie()?Reflect.construct(t,n||[],Fe(e).constructor):t.apply(e,n))}var kc=function(e){function t(){var e;return Ae(this,t),e=Oc(this,t,arguments),e.state={error:void 0,info:{componentStack:``}},e}return Pe(t,e),Me(t,[{key:`componentDidCatch`,value:function(e,t){this.setState({error:e,info:t})}},{key:`render`,value:function(){let{message:e,description:t,id:n,children:r}=this.props,{error:i,info:a}=this.state,o=a?.componentStack||null,c=e===void
Line truncated
|
||||
${t}-loading > ${n}`]:{color:c}};return[{[t]:Object.assign(Object.assign({},co(e)),{color:i,position:`fixed`,top:f,width:`100%`,pointerEvents:`none`,zIndex:h,[`${t}-move-up`]:{animationFillMode:`forwards`},[`
|
||||
${t}-move-up-appear,
|
||||
${t}-move-up-enter
|
||||
`]:{animationName:y,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[`
|
||||
${t}-move-up-appear${t}-move-up-appear-active,
|
||||
${t}-move-up-enter${t}-move-up-enter-active
|
||||
`]:{animationPlayState:`running`},[`${t}-move-up-leave`]:{animationName:b,animationDuration:d,animationPlayState:`paused`,animationTimingFunction:u},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:`running`},"&-rtl":{direction:`rtl`,span:{direction:`rtl`}}})},{[t]:{[`${v}-wrapper`]:Object.assign({},x)}},{[`${t}-notice-pure-panel`]:Object.assign(Object.assign({},x),{padding:0,textAlign:`start`})}]},El=vo(`Message`,e=>Tl(Ra(e,{height:150})),e=>({zIndexPopup:e.zIndexPopupBase+bl+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`})),Dl={info:s.createElement(lc,null),success:s.createElement(tc,null),error:s.createElement(rc,null),warning:s.createElement(sc,null),loading:s.createElement(ol,null)},Ol=({prefixCls:e,type:t,icon:n,children:r})=>s.createElement(`div`,{className:(0,h.default)(`${e}-custom-content`,`${e}-${t}`)},n||Dl[t],s.createElement(`span`,null,r));function kl(e,t){return{motionName:t??`${e}-move-up`}}function Al(e){let t,n=new Promise(n=>{t=e(()=>{n(!0)})}),r=()=>{t?.()};return r.then=(e,t)=>n.then(e,t),r.promise=n,r}var jl=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Ml=8,Nl=3,Pl=({children:e,prefixCls:t})=>{let n=Uc(t),[r,i,a]=El(t,n);return r(s.createElement(Kc,{classNames:{list:(0,h.default)(i,a,n)}},e))},Fl=(e,{prefixCls:t,key:n})=>s.createElement(Pl,{prefixCls:t,key:n},e),Il=s.forwardRef((e,t)=>{let{top:n,prefixCls:r,getContainer:i,maxCount:a,duration:o=Nl,rtl:c,transitionName:l,onAllRemoved:u}=e,{getPrefixCls:d,getPopupContainer:f,message:p,direction:m}=s.useContext(fa),g=r||d(`message`),[_,v]=il({prefixCls:g,style:()=>({left:`50%`,transform:`translateX(-50%)`,top:n??Ml}),className:()=>(0,h.default)({[`${g}-rtl`]:c??m===`rtl`}),motion:()=>kl(g,l),closable:!1,closeIcon:s.createElement(`span`,{className:`${g}-close-x`},s.createElement(ac,{className:`${g}-close-icon`})),duration:o,getContainer:()=>i?.()||f?.()||document.body,maxCount:a,onAllRemoved:u,renderNotifications:Fl});return s.useImperativeHandle(t,()=>Object.assign(Object.assign({},_),{prefixCls:g,message:p})),v}),Ll=0;function Rl(e){let t=s.useRef(null);return Lr(`Message`),[s.useMemo(()=>{let e=e=>{var n;(n=t.current)==null||n.close(e)},n=n=>{if(!t.current){let e=()=>{};return e.then=()=>{},e}let{open:r,prefixCls:i,message:a}=t.current,o=`${i}-notice`,{content:c,icon:l,type:u,key:d,className:f,style:p,onClose:m}=n,g=jl(n,[`content`,`icon`,`type`,`key`,`className`,`style`,`onClose`]),_=d;return _??=(Ll+=1,`antd-message-${Ll}`),Al(t=>(r(Object.assign(Object.assign({},g),{key:_,content:s.createElement(Ol,{prefixCls:i,type:u,icon:l},c),placement:`top`,className:(0,h.default)(u&&`${o}-${u}`,f,a?.className),style:Object.assign(Object.assign({},a?.style),p),onClose:()=>{m?.(),t()}})),()=>{e(_)}))},r={open:n,destroy:n=>{var r;n===void 0?(r=t.current)==null||r.destroy():e(n)}};return[`info`,`success`,`warning`,`error`,`loading`].forEach(e=>{r[e]=(t,r,i)=>{let a;a=t&&typeof t==`object`&&`content`in t?t:{content:t};let o,s;typeof r==`function`?s=r:(o=r,s=i);let c=Object.assign(Object.assign({onClose:s,duration:o},a),{type:e});return n(c)}}),r},[]),s.createElement(Il,Object.assign({key:`message-holder`},e,{ref:t}))]}function zl(e){return Rl(e)}function Bl(e,t){this.v=e,this.k=t}function Vl(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Vl=function(e,t,n,r){function a(t,n){Vl(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},Vl(e,t,n,r)}function Hl(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Vl(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?(s>1&&(f.n=s<3?-1:c),p(s,c)):f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{val
Line truncated
|
||||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:`hidden`,transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},
|
||||
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),Td=e=>({animationDuration:e,animationFillMode:`both`}),Ed=e=>({animationDuration:e,animationFillMode:`both`}),Dd=(e,t,n,r,i=!1)=>{let a=i?`&`:``;return{[`
|
||||
${a}${e}-enter,
|
||||
${a}${e}-appear
|
||||
`]:Object.assign(Object.assign({},Td(r)),{animationPlayState:`paused`}),[`${a}${e}-leave`]:Object.assign(Object.assign({},Ed(r)),{animationPlayState:`paused`}),[`
|
||||
${a}${e}-enter${e}-enter-active,
|
||||
${a}${e}-appear${e}-appear-active
|
||||
`]:{animationName:t,animationPlayState:`running`},[`${a}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:`running`,pointerEvents:`none`}}},Od=new wr(`antFadeIn`,{"0%":{opacity:0},"100%":{opacity:1}}),kd=new wr(`antFadeOut`,{"0%":{opacity:1},"100%":{opacity:0}}),Ad=(e,t=!1)=>{let{antCls:n}=e,r=`${n}-fade`,i=t?`&`:``;return[Dd(r,Od,kd,e.motionDurationMid,t),{[`
|
||||
${i}${r}-enter,
|
||||
${i}${r}-appear
|
||||
`]:{opacity:0,animationTimingFunction:`linear`},[`${i}${r}-leave`]:{animationTimingFunction:`linear`}}]},jd=new wr(`antMoveDownIn`,{"0%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Md=new wr(`antMoveDownOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, 100%, 0)`,transformOrigin:`0 0`,opacity:0}}),Nd=new wr(`antMoveLeftIn`,{"0%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Pd=new wr(`antMoveLeftOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(-100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Fd=new wr(`antMoveRightIn`,{"0%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),Id=new wr(`antMoveRightOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(100%, 0, 0)`,transformOrigin:`0 0`,opacity:0}}),Ld={"move-up":{inKeyframes:new wr(`antMoveUpIn`,{"0%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0},"100%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1}}),outKeyframes:new wr(`antMoveUpOut`,{"0%":{transform:`translate3d(0, 0, 0)`,transformOrigin:`0 0`,opacity:1},"100%":{transform:`translate3d(0, -100%, 0)`,transformOrigin:`0 0`,opacity:0}})},"move-down":{inKeyframes:jd,outKeyframes:Md},"move-left":{inKeyframes:Nd,outKeyframes:Pd},"move-right":{inKeyframes:Fd,outKeyframes:Id}},Rd=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=Ld[t];return[Dd(r,i,a,e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},zd=new wr(`antSlideUpIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1}}),Bd=new wr(`antSlideUpOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),Vd=new wr(`antSlideDownIn`,{"0%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0},"100%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1}}),Hd=new wr(`antSlideDownOut`,{"0%":{transform:`scaleY(1)`,transformOrigin:`100% 100%`,opacity:1},"100%":{transform:`scaleY(0.8)`,transformOrigin:`100% 100%`,opacity:0}}),Ud=new wr(`antSlideLeftIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1}}),Wd=new wr(`antSlideLeftOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`0% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`0% 0%`,opacity:0}}),Gd=new wr(`antSlideRightIn`,{"0%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0},"100%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1}}),Kd=new wr(`antSlideRightOut`,{"0%":{transform:`scaleX(1)`,transformOrigin:`100% 0%`,opacity:1},"100%":{transform:`scaleX(0.8)`,transformOrigin:`100% 0%`,opacity:0}}),qd={"slide-up":{inKeyframes:zd,outKeyframes:Bd},"slide-down":{inKeyframes:Vd,outKeyframes:Hd},"slide-left":{inKeyframes:Ud,outKeyframes:Wd},"slide-right":{inKeyframes:Gd,outKeyframes:Kd}},Jd=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=qd[t];return[Dd(r,i,a,e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{transform:`scale(0)`,transformOrigin:`0% 0%`,opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:`scale(1)`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},Yd=new wr(`antZoomIn`,{"0%":{transform:`scale(0.2)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),Xd=new wr(`antZoomOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.2)`,opacity:0}}),Zd=new wr(`antZoomBigIn`,{"0%":{transform:`scale(0.8)`,opacity:0},"100%":{transform:`scale(1)`,opacity:1}}),Qd=new wr(`antZoomBigOut`,{"0%":{transform:`scale(1)`},"100%":{transform:`scale(0.8)`,opacity:0}}),$d=new wr(`antZoomUpIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 0%`}}),ef=new wr(`antZoomUpOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 0%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 0%`,opacity:0}}),tf=new wr(`antZoomLeftIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`0% 50%`}}),nf=new wr(`antZoomLeftOut`,{"0%":{transform:`scale(1)`,transformOrigin:`0% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`0% 50%`,opacity:0}}),rf=new wr(`antZoomRightIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`100% 50%`}}),af=new wr(`antZoomRightOut`,{"0%":{transform:`scale(1)`,transformOrigin:`100% 50%`},"100%":{transform:`scale(0.8)`,transformOrigin:`100% 50%`,opacity:0}}),of=new wr(`antZoomDownIn`,{"0%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0},"100%":{transform:`scale(1)`,transformOrigin:`50% 100%`}}),sf=new wr(`antZoomDownOut`,{"0%":{transform:`scale(1)`,transformOrigin:`50% 100%`},"100%":{transform:`scale(0.8)`,transformOrigin:`50% 100%`,opacity:0}}),cf={zoom:{inKeyframes:Yd,outKeyframes:Xd},"zoom-big":{inKeyframes:Zd,outKeyframes:Qd},"zoom-big-fast":{inKeyframes:Zd,outKeyframes:Qd},"zoom-left":{inKeyframes:tf,outKeyframes:nf},"zoom-right":{inKeyframes:rf,outKeyframes:af},"zoom-up":{inKeyframes:$d,outKeyframes:ef},"zoom-down":{inKeyframes:of,outKeyframes:sf}},lf=(e,t)=>{let{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:i,outKeyframes:a}=cf[t];return[Dd(r,i,a,t===`zoom-big-fast`?e.motionDurationFast:e.motionDurationMid),{[`
|
||||
${r}-enter,
|
||||
${r}-appear
|
||||
`]:{transform:`scale(0)`,opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:`none`}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},uf=e=>{let{componentCls:t,contentBg:n,padding:r,headerBg:i,headerPadding:a,collapseHeaderPaddingSM:o,collapseHeaderPaddingLG:s,collapsePanelBorderRadius:c,lineWidth:l,lineType:u,colorBorder:d,colorText:f,colorTextHeading:p,colorTextDisabled:m,fontSizeLG:h,lineHeight:g,lineHeightLG:_,marginSM:v,paddingSM:y,paddingLG:b,paddingXS:x,motionDurationSlow:S,fontSizeIcon:C,contentPadding:w,fontHeight:T,fontHeightLG:E}=e,D=`${Q(l)} ${u} ${d}`;return{[t]:Object.assign(Object.assign({},co(e)),{backgroundColor:i,border:D,borderRadius:c,"&-rtl":{direction:`rtl`},[`& > ${t}-item`]:{borderBottom:D,"&:first-child":{[`
|
||||
&,
|
||||
& > ${t}-header`]:{borderRadius:`${Q(c)} ${Q(c)} 0 0`}},"&:last-child":{[`
|
||||
&,
|
||||
& > ${t}-header`]:{borderRadius:`0 0 ${Q(c)} ${Q(c)}`}},[`> ${t}-header`]:Object.assign(Object.assign({position:`relative`,display:`flex`,flexWrap:`nowrap`,alignItems:`flex-start`,padding:a,color:p,lineHeight:g,cursor:`pointer`,transition:`all ${S}, visibility 0s`},ho(e)),{[`> ${t}-header-text`]:{flex:`auto`},[`${t}-expand-icon`]:{height:T,display:`flex`,alignItems:`center`,paddingInlineEnd:v},[`${t}-arrow`]:Object.assign(Object.assign({},lo()),{fontSize:C,transition:`transform ${S}`,svg:{transition:`transform ${S}`}}),[`${t}-header-text`]:{marginInlineEnd:`auto`}}),[`${t}-collapsible-header`]:{cursor:`default`,[`${t}-header-text`]:{flex:`none`,cursor:`pointer`},[`${t}-expand-icon`]:{cursor:`pointer`}},[`${t}-collapsible-icon`]:{cursor:`unset`,[`${t}-expand-icon`]:{cursor:`pointer`}}},[`${t}-content`]:{color:f,backgroundColor:n,borderTop:D,[`& > ${t}-content-box`]:{padding:w},"&-hidden":{display:`none`}},"&-small":{[`> ${t}-item`]:{[`> ${t}-header`]:{padding:o,paddingInlineStart:x,[`> ${t}-expand-icon`]:{marginInlineStart:e.calc(y).sub(x).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:y}}},"&-large":{[`> ${t}-item`]:{fontSize:h,lineHeight:_,[`> ${t}-header`]:{padding:s,paddingInlineStart:r,[`> ${t}-expand-icon`]:{height:E,marginInlineStart:e.calc(b).sub(r).equal()}},[`> ${t}-content > ${t}-content-box`]:{padding:b}}},[`${t}-item:last-child`]:{borderBottom:0,[`> ${t}-content`]:{borderRadius:`0 0 ${Q(c)} ${Q(c)}`}},[`& ${t}-item-disabled > ${t}-header`]:{"\n &,\n & > .arrow\n ":{color:m,cursor:`not-allowed`}},[`&${t}-icon-position-end`]:{[`& > ${t}-item`]:{[`> ${t}-header`]:{[`${t}-expand-icon`]:{order:1,paddingInlineEnd:0,paddingInlineStart:v}}}}})}},df=e=>{let{componentCls:t}=e,n=`> ${t}-item > ${t}-header ${t}-arrow`;return{[`${t}-rtl`]:{[n]:{transform:`rotate(180deg)`}}}},ff=e=>{let{componentCls:t,headerBg:n,borderlessContentPadding:r,borderlessContentBg:i,colorBorder:a}=e;return{[`${t}-borderless`]:{backgroundColor:n,border:0,[`> ${t}-item`]:{borderBottom:`1px solid ${a}`},[`
|
||||
> ${t}-item:last-child,
|
||||
> ${t}-item:last-child ${t}-header
|
||||
`]:{borderRadius:0},[`> ${t}-item:last-child`]:{borderBottom:0},[`> ${t}-item > ${t}-content`]:{backgroundColor:i,borderTop:0},[`> ${t}-item > ${t}-content > ${t}-content-box`]:{padding:r}}}},pf=e=>{let{componentCls:t,paddingSM:n}=e;return{[`${t}-ghost`]:{backgroundColor:`transparent`,border:0,[`> ${t}-item`]:{borderBottom:0,[`> ${t}-content`]:{backgroundColor:`transparent`,border:0,[`> ${t}-content-box`]:{paddingBlock:n}}}}}},mf=vo(`Collapse`,e=>{let t=Ra(e,{collapseHeaderPaddingSM:`${Q(e.paddingXS)} ${Q(e.paddingSM)}`,collapseHeaderPaddingLG:`${Q(e.padding)} ${Q(e.paddingLG)}`,collapsePanelBorderRadius:e.borderRadiusLG});return[uf(t),ff(t),pf(t),df(t),wd(t)]},e=>({headerPadding:`${e.paddingSM}px ${e.padding}px`,headerBg:e.colorFillAlter,contentPadding:`${e.padding}px 16px`,contentBg:e.colorBgContainer,borderlessContentPadding:`${e.paddingXXS}px 16px ${e.padding}px`,borderlessContentBg:`transparent`})),hf=Object.assign(s.forwardRef((e,t)=>{let{getPrefixCls:n,direction:r,expandIcon:i,className:a,style:o}=ha(`collapse`),{prefixCls:c,className:l,rootClassName:u,style:d,bordered:f=!0,ghost:p,size:m,expandIconPosition:_=`start`,children:v,destroyInactivePanel:y,destroyOnHidden:b,expandIcon:x}=e,S=ju(e=>m??e??`middle`),C=n(`collapse`,c),w=n(),[T,E,D]=mf(C),O=s.useMemo(()=>_===`left`?`start`:_===`right`?`end`:_,[_]),k=x??i,A=s.useCallback((e={})=>{let t=typeof k==`function`?k(e):s.createElement(fd,{rotate:e.isActive?r===`rtl`?-90:90:void 0,"aria-label":e.isActive?`expanded`:`collapsed`});return _c(t,()=>({className:(0,h.default)(t.props?.className,`${C}-arrow`)}))},[k,C,r]),j=(0,h.default)(`${C}-icon-position-${O}`,{[`${C}-borderless`]:!f,[`${C}-rtl`]:r===`rtl`,[`${C}-ghost`]:!!p,[`${C}-${S}`]:S!==`middle`},a,l,u,E,D),M=s.useMemo(()=>Object.assign(Object.assign({},vu(w)),{motionAppear:!1,leavedClassName:`${C}-content-hidden`}),[w,C]),N=s.useMemo(()=>v?g(v).map((e,t)=>{let n=e.props;if(n?.disabled){let r=e.key??String(t);return _c(e,Object.assign(Object.assign({},bu(e.props,[`disabled`])),{key:r,collapsible:n.collapsible??`disabled`}))}return e}):null,[v]);return T(s.createElement(Sd,Object.assign({ref:t,openMotion:M},bu(e,[`rootClassName`]),{expandIcon:A,prefixCls:C,className:j,style:Object.assign(Object.assign({},o),d),destroyInactivePanel:b??y}),N))}),{Panel:Cd}),gf=e=>e instanceof ud?e:new ud(e),_f=(e,t)=>{let{r:n,g:r,b:i,a}=e.toRgb(),o=new sd(e.toRgbString()).onBackground(t).toHsv();return a<=.5?o.v>.5:n*.299+r*.587+i*.114>192},vf=e=>{let{paddingInline:t,onlyIconSize:n}=e;return Ra(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n})},yf=e=>{let t=e.contentFontSize??e.fontSize,n=e.contentFontSizeSM??e.fontSize,r=e.contentFontSizeLG??e.fontSizeLG,i=e.contentLineHeight??Qi(t),a=e.contentLineHeightSM??Qi(n),o=e.contentLineHeightLG??Qi(r),s=_f(new ud(e.colorBgSolid),`#fff`)?`#000`:`#fff`,c=Ya.reduce((t,n)=>Object.assign(Object.assign({},t),{[`${n}ShadowColor`]:`0 ${Q(e.controlOutlineWidth)} 0 ${Qa(e[`${n}1`],e.colorBgContainer)}`}),{});return Object.assign(Object.assign({},c),{fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorder,defaultGhostColor:e.colorBgContainer,ghostBg:`transparent`,defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:`inherit`,onlyIconSizeSM:`inherit`,onlyIconSizeLG:`inherit`,groupBorderColor:e.colorPrimaryHover,linkHoverBg:`transparent`,textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:s,contentFontSize:t,contentFontSizeSM:n,contentFontSizeLG:r,contentLineHeight:i,contentLineHeightSM:a,contentLineHeightLG:o,paddingBlock:Math.max((e.controlHeight-t*i)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-n*a)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-r*o)/2-e.lineWidth,0)})},bf=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:c}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-flex`,gap:s,alignItems:`center`,justifyContent:`center`,fontWeight:r,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,background:`transparent`,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,curso
Line truncated
|
||||
#${t}::-webkit-scrollbar {
|
||||
${c?`width: ${s.width};`:``}
|
||||
${l?`height: ${s.height};`:``}
|
||||
}`,t)}catch(e){console.error(e),i=c,a=l}}document.body.appendChild(n);var u=e&&i&&!isNaN(i)?i:n.offsetWidth-n.clientWidth,d=e&&a&&!isNaN(a)?a:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),gt(t),{width:u,height:d}}function gp(e){return typeof document>`u`?0:((e||mp===void 0)&&(mp=hp()),mp.width)}function _p(e){return typeof document>`u`||!e||!(e instanceof Element)?{width:0,height:0}:hp(e)}function vp(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var yp=`rc-util-locker-${Date.now()}`,bp=0;function xp(e){var t=!!e,n=Z(s.useState(function(){return bp+=1,`${yp}_${bp}`}),1)[0];Jt(function(){if(t){var e=_p(document.body).width;vt(`
|
||||
html body {
|
||||
overflow-y: hidden;
|
||||
${vp()?`width: calc(100% - ${e}px);`:``}
|
||||
}`,n)}else gt(n);return function(){gt(n)}},[t,n])}var Sp=!1;function Cp(e){return typeof e==`boolean`&&(Sp=e),Sp}var wp=function(e){return e===!1?!1:!it()||!e?null:typeof e==`string`?document.querySelector(e):typeof e==`function`?e():e},Tp=s.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer,a=e.debug,o=e.autoDestroy,c=o===void 0||o,l=e.children,u=Z(s.useState(n),2),d=u[0],f=u[1],p=d||n;s.useEffect(function(){(c||n)&&f(n)},[n,c]);var h=Z(s.useState(function(){return wp(i)}),2),g=h[0],_=h[1];s.useEffect(function(){_(wp(i)??null)});var v=Z(pp(p&&!g,a),2),y=v[0],b=v[1],x=g??y;xp(r&&n&&it()&&(x===y||x===document.body));var S=null;l&&B(l)&&t&&(S=l.ref);var C=z(S,t);if(!p||!it()||g===void 0)return null;var w=x===!1||Cp(),T=l;return t&&(T=s.cloneElement(l,{ref:C})),s.createElement(dp.Provider,{value:b},w?T:(0,m.createPortal)(T,x))}),Ep=s.createContext({});function Dp(){return O({},s).useId}var Op=0,kp=Dp(),Ap=kp?function(e){var t=kp();return e||t}:function(e){var t=Z(s.useState(`ssr-id`),2),n=t[0],r=t[1];return s.useEffect(function(){var e=Op;Op+=1,r(`rc_unique_${e}`)},[]),e||n};function jp(e,t,n){var r=t;return!r&&n&&(r=`${e}-${n}`),r}function Mp(e,t){var n=e[`page${t?`Y`:`X`}Offset`],r=`scroll${t?`Top`:`Left`}`;if(typeof n!=`number`){var i=e.document;n=i.documentElement[r],typeof n!=`number`&&(n=i.body[r])}return n}function Np(e){var t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,i=r.defaultView||r.parentWindow;return n.left+=Mp(i),n.top+=Mp(i,!0),n}var Pp=s.memo(function(e){return e.children},function(e,t){return!t.shouldUpdate}),Fp={width:0,height:0,overflow:`hidden`,outline:`none`},Ip={outline:`none`},Lp=s.forwardRef(function(e,t){var n=e.prefixCls,r=e.className,i=e.style,a=e.title,o=e.ariaId,u=e.footer,d=e.closable,f=e.closeIcon,p=e.onClose,m=e.children,g=e.bodyStyle,_=e.bodyProps,v=e.modalRender,y=e.onMouseDown,b=e.onMouseUp,x=e.holderRef,S=e.visible,C=e.forceRender,w=e.width,T=e.height,E=e.classNames,D=e.styles,k=z(x,s.useContext(Ep).panel),A=(0,s.useRef)(),j=(0,s.useRef)();s.useImperativeHandle(t,function(){return{focus:function(){var e;(e=A.current)==null||e.focus({preventScroll:!0})},changeActive:function(e){var t=document.activeElement;e&&t===j.current?A.current.focus({preventScroll:!0}):!e&&t===A.current&&j.current.focus({preventScroll:!0})}}});var M={};w!==void 0&&(M.width=w),T!==void 0&&(M.height=T);var N=u?s.createElement(`div`,{className:(0,h.default)(`${n}-footer`,E?.footer),style:O({},D?.footer)},u):null,P=a?s.createElement(`div`,{className:(0,h.default)(`${n}-header`,E?.header),style:O({},D?.header)},s.createElement(`div`,{className:`${n}-title`,id:o},a)):null,F=(0,s.useMemo)(function(){return l(d)===`object`&&d!==null?d:d?{closeIcon:f??s.createElement(`span`,{className:`${n}-close-x`})}:{}},[d,f,n]),I=mc(F,!0),L=l(d)===`object`&&d.disabled,R=d?s.createElement(`button`,c({type:`button`,onClick:p,"aria-label":`Close`},I,{className:`${n}-close`,disabled:L}),F.closeIcon):null,B=s.createElement(`div`,{className:(0,h.default)(`${n}-content`,E?.content),style:D?.content},R,P,s.createElement(`div`,c({className:(0,h.default)(`${n}-body`,E?.body),style:O(O({},g),D?.body)},_),m),N);return s.createElement(`div`,{key:`dialog-element`,role:`dialog`,"aria-labelledby":a?o:null,"aria-modal":`true`,ref:k,style:O(O({},i),M),className:(0,h.default)(n,r),onMouseDown:y,onMouseUp:b},s.createElement(`div`,{ref:A,tabIndex:0,style:Ip},s.createElement(Pp,{shouldUpdate:S||C},v?v(B):B)),s.createElement(`div`,{tabIndex:0,ref:j,style:Fp}))}),Rp=s.forwardRef(function(e,t){var n=e.prefixCls,r=e.title,i=e.style,a=e.className,o=e.visible,l=e.forceRender,u=e.destroyOnClose,d=e.motionName,f=e.ariaId,p=e.onVisibleChanged,m=e.mousePosition,g=(0,s.useRef)(),_=Z(s.useState(),2),v=_[0],y=_[1],b={};v&&(b.transformOrigin=v);function x(){var e=Np(g.current);y(m&&(m.x||m.y)?`${m.x-e.left}px ${m.y-e.top}px`:``)}return s.createElement(ys,{visible:o,onVisibleChanged:p,onAppearPrepare:x,onEnterPrepare:x,forceRender:l,motionName:d,removeOnLeave:u,ref:g},function(o,l){var u=o.className,d=o.style;return s.createElement(Lp,c({},e,{ref:t,title:r,ariaId:f,prefixCls:n,holderRef:l,style:O(O(O({},d),i),b),className:(0,h.default)(a,u)}))})});Rp.displayName=`Content`;var zp=function(e){var t=e.prefixCls,n=e.style,r=e.visible,i=e.maskProps,a=e.motionName,o=e.className;return s.createElement(ys,{key:`mask`,visible:r,motionName:a,leavedClassName:`${t}-mask-hidden`},function(e,r){var a=e.className,l=e.style;return s.createElement(`div`,c({ref:r,style:O(O({},l),n),className:(0,h.default)(`${t}-mask`,a,o)},i))})},Bp=function(e){var t=e.prefixCls,n=t===void 0?`rc-dialog`:t,r=e.zIndex,i=e.visible,a=i!==void 0&&i,o=e.keyboard,l=o===void 0||o,u=e.focusTriggerAfterClose,d=u===void 0||u,f=e.wrapStyle,p=e.wrapClassName,m=e.wrapProps,g=e.onClose,_=e.afterOpenChange,v=e.afterClose,y=e.transitionName,b=e.animation,x=e.closable,S=x===void 0||x,C=e.mask,w=C===void 0||C,T=e.maskTransitionName,E=e.maskAnimation,D=e.maskClosable,k=
Line truncated
|
||||
${r},
|
||||
${i} > li,
|
||||
${n},
|
||||
${a},
|
||||
${o},
|
||||
${s}
|
||||
`]:Object.assign({},Wh(e))}}},eg=vo(`Skeleton`,e=>{let{componentCls:t,calc:n}=e;return $h(Ra(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:`1.4s`}))},e=>{let{colorFillContent:t,colorFill:n}=e,r=t,i=n;return{color:r,colorGradientEnd:i,gradientFromColor:r,gradientToColor:i,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},{deprecatedTokens:[[`color`,`gradientFromColor`],[`colorGradientEnd`,`gradientToColor`]]}),tg=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,shape:a=`circle`,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(fa),l=c(`skeleton`,t),[u,d,f]=eg(l),p=bu(e,[`prefixCls`,`className`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(Bh,Object.assign({prefixCls:`${l}-avatar`,shape:a,size:o},p))))},ng=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,block:a=!1,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(fa),l=c(`skeleton`,t),[u,d,f]=eg(l),p=bu(e,[`prefixCls`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:a},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(Bh,Object.assign({prefixCls:`${l}-button`,size:o},p))))},rg=`M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z`,ig=e=>{let{prefixCls:t,className:n,rootClassName:r,style:i,active:a}=e,{getPrefixCls:o}=s.useContext(fa),c=o(`skeleton`,t),[l,u,d]=eg(c),f=(0,h.default)(c,`${c}-element`,{[`${c}-active`]:a},n,r,u,d);return l(s.createElement(`div`,{className:f},s.createElement(`div`,{className:(0,h.default)(`${c}-image`,n),style:i},s.createElement(`svg`,{viewBox:`0 0 1098 1024`,xmlns:`http://www.w3.org/2000/svg`,className:`${c}-image-svg`},s.createElement(`title`,null,`Image placeholder`),s.createElement(`path`,{d:rg,className:`${c}-image-path`})))))},ag=e=>{let{prefixCls:t,className:n,rootClassName:r,active:i,block:a,size:o=`default`}=e,{getPrefixCls:c}=s.useContext(fa),l=c(`skeleton`,t),[u,d,f]=eg(l),p=bu(e,[`prefixCls`]),m=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:i,[`${l}-block`]:a},n,r,d,f);return u(s.createElement(`div`,{className:m},s.createElement(Bh,Object.assign({prefixCls:`${l}-input`,size:o},p))))},og=e=>{let{prefixCls:t,className:n,rootClassName:r,style:i,active:a,children:o}=e,{getPrefixCls:c}=s.useContext(fa),l=c(`skeleton`,t),[u,d,f]=eg(l),p=(0,h.default)(l,`${l}-element`,{[`${l}-active`]:a},d,n,r,f);return u(s.createElement(`div`,{className:p},s.createElement(`div`,{className:(0,h.default)(`${l}-image`,n),style:i},o)))},sg=(e,t)=>{let{width:n,rows:r=2}=t;if(Array.isArray(n))return n[e];if(r-1===e)return n},cg=e=>{let{prefixCls:t,className:n,style:r,rows:i=0}=e,a=Array.from({length:i}).map((t,n)=>s.createElement(`li`,{key:n,style:{width:sg(n,e)}}));return s.createElement(`ul`,{className:(0,h.default)(t,n),style:r},a)},lg=({prefixCls:e,className:t,width:n,style:r})=>s.createElement(`h3`,{className:(0,h.default)(e,t),style:Object.assign({width:n},r)});function ug(e){return e&&typeof e==`object`?e:{}}function dg(e,t){return e&&!t?{size:`large`,shape:`square`}:{size:`large`,shape:`circle`}}function fg(e,t){return!e&&t?{width:`38%`}:e&&t?{width:`50%`}:{}}function pg(e,t){let n={};return e&&t||(n.width=`61%`),n.rows=!e&&t?3:2,n}var mg=e=>{let{prefixCls:t,loading:n,className:r,rootClassName:i,style:a,children:o,avatar:c=!1,title:l=!0,paragraph:u=!0,active:d,round:f}=e,{getPrefixCls:p,direction:m,className:g,style:_}=ha(`skeleton`),v=p(`skeleton`,t),[y,b,x]=eg(v);if(n||!(`loading`in e)){let e=!!c,t=!!l,n=!!u,o;if(e){let e=Object.assign(Object.assign({prefixCls:`${v}-avatar`},dg(t,n)),ug(c));o=s.createElement(`div`,{className:`${v}-header`},s.createElement(Bh,Object.assign({},e)))}let p;if(t||n){let r;if(t){let t=Object.assign(
Line truncated
|
||||
${t}-body,
|
||||
${t}-confirm-body-wrapper`]:{display:`flex`,flexDirection:`column`,flex:`auto`},[`${t}-confirm-body`]:{marginBottom:`auto`}}}]},Ig=e=>{let{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:`rtl`,[`${t}-confirm-body`]:{direction:`rtl`}}}}},Lg=e=>{let{componentCls:t}=e,n=jg(e),r=Object.assign({},n);delete r.xs;let i=`--${t.replace(`.`,``)}-`,a=Object.keys(r).map(e=>({[`@media (min-width: ${Q(r[e])})`]:{width:`var(${i}${e}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(X(Object.keys(n).map((e,t)=>{let r=Object.keys(n)[t-1];return r?{[`${i}${e}-width`]:`var(${i}${r}-width)`}:null})),[{width:`var(${i}xs-width)`}],X(a))}}},Rg=e=>{let t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return Ra(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},zg=e=>({footerBg:`transparent`,headerBg:e.colorBgElevated,titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Q(e.paddingMD)} ${Q(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Q(e.padding)} ${Q(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:`none`,headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Q(e.paddingXS)} ${Q(e.padding)}`:0,footerBorderTop:e.wireframe?`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:`none`,footerBorderRadius:e.wireframe?`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Q(e.padding*2)} ${Q(e.padding*2)} ${Q(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM}),Bg=vo(`Modal`,e=>{let t=Rg(e);return[Fg(t),Ig(t),Pg(t),lf(t,`zoom`),Lg(t)]},zg,{unitless:{titleLineHeight:!0}}),Vg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Hg;zh()&&document.documentElement.addEventListener(`click`,e=>{Hg={x:e.pageX,y:e.pageY},setTimeout(()=>{Hg=null},100)},!0);var Ug=e=>{let{prefixCls:t,className:n,rootClassName:r,open:i,wrapClassName:a,centered:o,getContainer:c,focusTriggerAfterClose:l=!0,style:u,visible:d,width:f=520,footer:p,classNames:m,styles:g,children:_,loading:v,confirmLoading:y,zIndex:b,mousePosition:x,onOk:S,onCancel:C,destroyOnHidden:w,destroyOnClose:T,panelRef:E=null,modalRender:D}=e,O=Vg(e,[`prefixCls`,`className`,`rootClassName`,`open`,`wrapClassName`,`centered`,`getContainer`,`focusTriggerAfterClose`,`style`,`visible`,`width`,`footer`,`classNames`,`styles`,`children`,`loading`,`confirmLoading`,`zIndex`,`mousePosition`,`onOk`,`onCancel`,`destroyOnHidden`,`destroyOnClose`,`panelRef`,`modalRender`]),{getPopupContainer:k,getPrefixCls:A,direction:j,modal:M}=s.useContext(fa),N=e=>{y||C?.(e)},P=e=>{S?.(e)},F=A(`modal`,t),I=A(),L=Uc(F),[z,B,V]=Bg(F,L),H=(0,h.default)(a,{[`${F}-centered`]:o??M?.centered,[`${F}-wrap-rtl`]:j===`rtl`}),U=p!==null&&!v?s.createElement(Sg,Object.assign({},e,{onOk:P,onCancel:N})):null,[W,G,K,q]=dl(cl(e),cl(M),{closable:!0,closeIcon:s.createElement(ac,{className:`${F}-close-icon`}),closeIconRender:e=>xg(F,e)}),ee=D?e=>s.createElement(`div`,{className:`${F}-render`},D(e)):void 0,J=R(E,vg(`.${F}-${D?`render`:`content`}`)),[te,ne]=wl(`Modal`,b),[re,ie]=s.useMemo(()=>f&&typeof f==`object`?[void 0,f]:[f,void 0],[f]),ae=s.useMemo(()=>{let e={};return ie&&Object.keys(ie).forEach(t=>{let n=ie[t];n!==void 0&&(e[`--${F}-${t}-width`]=typeof n==`number`?`${n}px`:n)}),e},[F,ie]);return z(s.createElement(Fh,{form:!0,space:!0},s.createElement(vl.Provider,{value:ne},s.createElement(Hp,Object.assign({width:re},O,{zIndex:te,getContainer:c===void 0?k:c,prefixCls:F,rootClassName:(0,h.default)(B,r,V,L),footer:U,visible:i??d,mousePosition:x??Hg,onClose:N,closable:W&&Object.assign({disabled:K,closeIcon:G},q),closeIcon:G,focusTriggerAfterClose:l,transitionName:yu(I,`zoom`,e.transitionName),maskTransitionName:yu(I,`fade`,e.maskTransitionName),className:(0,h.default)(B,n,M?.className),style:Object.assign(Object.assign(Object.assign({},M?.style),u),ae),classNames:Object.assign(Object.assign(Object.assign({},M?.classNames),m),{wrapper:(0,h.default)(H,m?.wrapper)}),styles:Object.assign(Object.assign({},M?.styles),g),panelRef:J,destroyOnClose:w??T,modalRender:ee}),v?s.createElement(hg,{active:!0,title:!1,paragr
Line truncated
|
||||
${u}-confirm ${u}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${u}-info ${u}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${u}-success ${u}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},Gg=bo([`Modal`,`confirm`],e=>Wg(Rg(e)),zg,{order:-1e3}),Kg=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},qg=e=>{let{prefixCls:t,icon:n,okText:r,cancelText:i,confirmPrefixCls:a,type:o,okCancel:c,footer:l,locale:u}=e,d=Kg(e,[`prefixCls`,`icon`,`okText`,`cancelText`,`confirmPrefixCls`,`type`,`okCancel`,`footer`,`locale`]),f=n;if(!n&&n!==null)switch(o){case`info`:f=s.createElement(lc,null);break;case`success`:f=s.createElement(tc,null);break;case`error`:f=s.createElement(rc,null);break;default:f=s.createElement(sc,null)}let p=c??o===`confirm`,m=e.autoFocusButton===null?!1:e.autoFocusButton||`ok`,[g]=Qr(`Modal`),_=u||g,v=r||(p?_?.okText:_?.justOkText),y=i||_?.cancelText,b=s.useMemo(()=>Object.assign({autoFocusButton:m,cancelTextLocale:y,okTextLocale:v,mergedOkCancel:p},d),[m,y,v,p,d]),x=s.createElement(s.Fragment,null,s.createElement(lp,null),s.createElement(up,null)),S=e.title!==void 0&&e.title!==null,C=`${a}-body`;return s.createElement(`div`,{className:`${a}-body-wrapper`},s.createElement(`div`,{className:(0,h.default)(C,{[`${C}-has-title`]:S})},f,s.createElement(`div`,{className:`${a}-paragraph`},S&&s.createElement(`span`,{className:`${a}-title`},e.title),s.createElement(`div`,{className:`${a}-content`},e.content))),l===void 0||typeof l==`function`?s.createElement(cp,{value:b},s.createElement(`div`,{className:`${a}-btns`},typeof l==`function`?l(x,{OkBtn:up,CancelBtn:lp}):x)):l,s.createElement(Gg,{prefixCls:t}))},Jg=e=>{let{close:t,zIndex:n,maskStyle:r,direction:i,prefixCls:a,wrapClassName:o,rootPrefixCls:c,bodyStyle:l,closable:u=!1,onConfirm:d,styles:f,title:p}=e,m=`${a}-confirm`,g=e.width||416,_=e.style||{},v=e.mask===void 0||e.mask,y=e.maskClosable!==void 0&&e.maskClosable,b=(0,h.default)(m,`${m}-${e.type}`,{[`${m}-rtl`]:i===`rtl`},e.className),[,x]=oo(),S=s.useMemo(()=>n===void 0?x.zIndexPopupBase+bl:n,[n,x]);return s.createElement(Ug,Object.assign({},e,{className:b,wrapClassName:(0,h.default)({[`${m}-centered`]:!!e.centered},o),onCancel:()=>{t?.({triggerCancel:!0}),d?.(!1)},title:p,footer:null,transitionName:yu(c||``,`zoom`,e.transitionName),maskTransitionName:yu(c||``,`fade`,e.maskTransitionName),mask:v,maskClosable:y,style:_,styles:Object.assign({body:l,mask:r},f),width:g,zIndex:S,closable:u}),s.createElement(qg,Object.assign({},e,{confirmPrefixCls:m})))},Yg=e=>{let{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:i}=e;return s.createElement(Fs,{prefixCls:t,iconPrefixCls:n,direction:r,theme:i},s.createElement(Jg,Object.assign({},e)))},Xg=[],Zg=``;function Qg(){return Zg}var $g=e=>{let{prefixCls:t,getContainer:n,direction:r}=e,i=Xr(),a=(0,s.useContext)(fa),o=Qg()||a.getPrefixCls(),c=t||`${o}-modal`,l=n;return l===!1&&(l=void 0),s.createElement(Yg,Object.assign({},e,{rootPrefixCls:o,prefixCls:c,iconPrefixCls:a.iconPrefixCls,theme:a.theme,direction:r??a.direction,locale:a.locale?.Modal??i,getContainer:l}))};function e_(e){let t=Ns(),n=document.createDocumentFragment(),r=Object.assign(Object.assign({},e),{close:l,open:!0}),i,a;function o(...t){var n;if(t.some(e=>e?.triggerCancel)){var r;(n=e.onCancel)==null||(r=n).call.apply(r,[e,()=>{}].concat(X(t.slice(1))))}for(let e=0;e<Xg.length;e++)if(Xg[e]===l){Xg.splice(e,1);break}a()}let c=e=>{clearTimeout(i),i=setTimeout(()=>{let r=t.getPrefixCls(void 0,Qg()),i=t.getIconPrefixCls(),o=t.getTheme(),c=s.createElement($g,Object.assign({},e));a=pu()(s.createElement(Fs,{prefixCls:r,iconPrefixCls:i,theme:o},typeof t.holderRender==`function`?t.holderRender(c):c),n)})};function l(...t){r=Object.assign(Object.assign({},r),{open:!1,afterClose:()=>{typeof e.afterClose==`function`&&e.afterClose(),o.apply(this,t)}}),r.visible&&delete r.visible,c(r)}function u(e){r=typeof e==`function`?e(r):Object.assign(Object.assign({},r),e),c(r)}return c(r),Xg.push(l),{destroy:l,update:u}}function t_(e){return Object.assign(Object.assign({},e),{type:`warning`})}function n_(e){return Object.assign(Object.assign({},e),{type:`info`})}function r_(e){return Object.assign(Object.assign({},e),{type:`success`})}function i_(e){return Object.assign(Object.assign({},e),{type:`error`})}function a_(e){return Object.assign(Object.assign({},e),{type:`confirm`})}var o_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},s_=s.forwardRef((e,t)=>{var{afterClose:n,co
Line truncated
|
||||
`,`\r
|
||||
`].includes(e)})},[I]),He=s.useContext(_0)||{},Ue=He.maxCount,We=He.rawValues,Ge=function(e,t,n){if(!(fe&&f0(Ue)&&We?.size>=Ue)){var r=!0,i=e;A?.(null);var a=g0(e,I,f0(Ue)?Ue-We.size:void 0),o=n?null:a;return y!==`combobox`&&o&&(i=``,F?.(o),Be(!1),r=!1),P&&Oe!==i&&P(i,{source:t?`typing`:`effect`}),r}},Ke=function(e){e&&e.trim()&&P(e,{source:`submit`})};s.useEffect(function(){!Le&&!fe&&y!==`combobox`&&Ge(``,!1,!1)},[Le]),s.useEffect(function(){Ie&&b&&Y(!1),b&&!Ce.current&&Ee(!1)},[b]);var qe=Z(Q_(),2),Je=qe[0],Ye=qe[1],Xe=s.useRef(!1),Ze=function(e){var t=Je(),n=e.key,r=n===`Enter`;if(r&&(y!==`combobox`&&e.preventDefault(),Le||Be(!0)),Ye(!!Oe),n===`Backspace`&&!t&&fe&&!Oe&&f.length){for(var i=X(f),a=null,o=i.length-1;o>=0;--o){var s=i[o];if(!s.disabled){i.splice(o,1),a=s;break}}a&&p(i,{type:`remove`,values:[a]})}var c=[...arguments].slice(1);if(Le&&(!r||!Xe.current)){var l;r&&(Xe.current=!0),(l=Se.current)==null||l.onKeyDown.apply(l,[e].concat(c))}le?.apply(void 0,[e].concat(c))},Qe=function(e){var t=[...arguments].slice(1);if(Le){var n;(n=Se.current)==null||n.onKeyUp.apply(n,[e].concat(t))}e.key===`Enter`&&(Xe.current=!1),ce?.apply(void 0,[e].concat(t))},$e=function(e){p(f.filter(function(t){return t!==e}),{type:`remove`,values:[e]})},et=function(){Xe.current=!1},tt=s.useRef(!1),nt=function(){Ee(!0),b||(oe&&!tt.current&&oe.apply(void 0,arguments),ae.includes(`focus`)&&Be(!0)),tt.current=!0},rt=function(){Ce.current=!0,Ee(!1,function(){tt.current=!1,Ce.current=!1,Be(!1)}),b||(Oe&&(y===`tags`?P(Oe,{source:`submit`}):y===`multiple`&&P(``,{source:`blur`})),se&&se.apply(void 0,arguments))},it=[];s.useEffect(function(){return function(){it.forEach(function(e){return clearTimeout(e)}),it.splice(0,it.length)}},[]);var at=function(e){var t=e.target,n=be.current?.getPopupElement();if(n&&n.contains(t)){var r=setTimeout(function(){var e=it.indexOf(r);if(e!==-1&&it.splice(e,1),De(),!ge&&!n.contains(document.activeElement)){var t;(t=xe.current)==null||t.focus()}});it.push(r)}var i=[...arguments].slice(1);ue?.apply(void 0,[e].concat(i))},ot=Z(s.useState({}),2)[1];function st(){ot({})}var ct;Ae&&(ct=function(e){Be(e)}),$_(function(){return[ve.current,be.current?.getPopupElement()]},ze,Be,!!Ae);var lt=s.useMemo(function(){return O(O({},e),{},{notFoundContent:_,open:Le,triggerOpen:ze,id:r,showSearch:pe,multiple:fe,toggleOpen:Be})},[e,_,ze,Le,r,pe,fe,Be]),ut=!!B||x,dt;ut&&(dt=s.createElement(q_,{className:(0,h.default)(`${i}-arrow`,E({},`${i}-arrow-loading`,x)),customizeIcon:B,customizeIconProps:{loading:x,searchValue:Oe,open:Le,focused:Te,showSearch:pe}}));var ft=J_(i,function(){var e;v?.(),(e=xe.current)==null||e.focus(),p([],{type:`clear`,values:f}),Ge(``,!1,!1)},f,L,V,b,Oe,y),pt=ft.allowClear,mt=ft.clearIcon,ht=s.createElement(H,{ref:Se}),gt=(0,h.default)(i,a,E(E(E(E(E(E(E(E(E(E({},`${i}-focused`,Te),`${i}-multiple`,fe),`${i}-single`,!fe),`${i}-allow-clear`,L),`${i}-show-arrow`,ut),`${i}-disabled`,b),`${i}-loading`,x),`${i}-open`,Le),`${i}-customize-input`,ke),`${i}-show-search`,pe)),_t=s.createElement(u0,{ref:be,disabled:b,prefixCls:i,visible:ze,popupElement:ht,animation:U,transitionName:W,dropdownStyle:G,dropdownClassName:K,direction:u,dropdownMatchSelectWidth:q,dropdownRender:ee,dropdownAlign:J,placement:te,builtinPlacements:ne,getPopupContainer:re,empty:m,getTriggerDOMNode:function(e){return ye.current||e},onPopupVisibleChange:ct,onPopupMouseEnter:st},Ae?s.cloneElement(Ae,{ref:je}):s.createElement(P1,c({},e,{domRef:ye,prefixCls:i,inputElement:ke,ref:xe,id:r,prefix:R,showSearch:pe,autoClearSearchValue:N,mode:y,activeDescendantId:j,tagRender:l,values:f,open:Le,onToggleOpen:Be,activeValue:k,searchValue:Oe,onSearch:Ge,onSearchSubmit:Ke,onRemove:$e,tokenWithEnter:Ve,onInputBlur:et}))),vt=Ae?_t:s.createElement(`div`,c({className:gt},me,{ref:ve,onMouseDown:at,onKeyDown:Ze,onKeyUp:Qe,onFocus:nt,onBlur:rt}),s.createElement(v0,{visible:Te&&!Le,values:f}),_t,dt,pt&&mt);return s.createElement(Y_.Provider,{value:lt},vt)}),C0=function(){return null};C0.isSelectOptGroup=!0;var w0=function(){return null};w0.isSelectOption=!0;var T0=s.forwardRef(function(e,t){var n=e.height,r=e.offsetY,i=e.offsetX,a=e.children,o=e.prefixCls,l=e.onInnerResize,u=e.innerProps,d=e.rtl,f=e.extra,p={},m={display:`flex`,flexDirection:`column`};return r!==void 0&&(p={height:n,position:`relative`,overflow:`hidden`},m=O(O({},m),{},E(E(E(E(E({transform:`translateY(${r}px)`},d?`marginRight`:`marginLeft`,-i),`position`,`absolute`),`left`,0),`right`,0),`top`,0))),s.createElement(`div`,{style:p},s.createElement(We,{onResize:function(e){e.offsetHeight&&l&&l()}},s.createElement(`div`,c({style:m,className:(0,h.default)(E({},`${o}-holder-inner`,o)),ref:t},u),a,f)))});T0.displayName=`Filler`;function E0(e){var t=e.children,n=e.setRef,r=s.useCallback(function(e){n(e)},[]);return s.cloneElement(t,{ref:r})}function D0(e,t,n,r,i,a,o,c){var l=c.getKey;return e.slice(t,n+1).map(function(e,n){var c=o(e,t+n,{style:{width:r},offsetX:i}),u=l(e);return s.createElement(E0,{key:u,se
Line truncated
|
||||
${i}${s}bottomLeft,
|
||||
${a}${s}bottomLeft
|
||||
`]:{animationName:zd},[`
|
||||
${i}${s}topLeft,
|
||||
${a}${s}topLeft,
|
||||
${i}${s}topRight,
|
||||
${a}${s}topRight
|
||||
`]:{animationName:Vd},[`${o}${s}bottomLeft`]:{animationName:Bd},[`
|
||||
${o}${s}topLeft,
|
||||
${o}${s}topRight
|
||||
`]:{animationName:Hd},"&-hidden":{display:`none`},[r]:Object.assign(Object.assign({},Fv(e)),{cursor:`pointer`,transition:`background ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:`default`},"&-option":{display:`flex`,"&-content":Object.assign({flex:`auto`},so),"&-state":{flex:`none`,display:`flex`,alignItems:`center`},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:`not-allowed`},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":Object.assign(Object.assign({},Fv(e)),{color:e.colorTextDisabled})}),[`${c}:has(+ ${c})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${c}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:`rtl`}})},Jd(e,`slide-up`),Jd(e,`slide-down`),Rd(e,`move-up`),Rd(e,`move-down`)]},Lv=e=>{let{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:i}=e,a=e.max(e.calc(n).sub(r).equal(),0);return{basePadding:a,containerPadding:e.max(e.calc(a).sub(i).equal(),0),itemHeight:Q(t),itemLineHeight:Q(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},Rv=e=>{let{multipleSelectItemHeight:t,selectHeight:n,lineWidth:r}=e;return e.calc(n).sub(t).div(2).sub(r).equal()},zv=e=>{let{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:i,paddingXS:a,multipleItemColorDisabled:o,multipleItemBorderColorDisabled:s,colorIcon:c,colorIconHover:l,INTERNAL_FIXED_ITEM_MARGIN:u}=e;return{[`${t}-selection-overflow`]:{position:`relative`,display:`flex`,flex:`auto`,flexWrap:`wrap`,maxWidth:`100%`,"&-item":{flex:`none`,alignSelf:`center`,maxWidth:`calc(100% - 4px)`,display:`inline-flex`},[`${t}-selection-item`]:{display:`flex`,alignSelf:`center`,flex:`none`,boxSizing:`border-box`,maxWidth:`100%`,marginBlock:u,borderRadius:r,cursor:`default`,transition:`font-size ${i}, line-height ${i}, height ${i}`,marginInlineEnd:e.calc(u).mul(2).equal(),paddingInlineStart:a,paddingInlineEnd:e.calc(a).div(2).equal(),[`${t}-disabled&`]:{color:o,borderColor:s,cursor:`not-allowed`},"&-content":{display:`inline-block`,marginInlineEnd:e.calc(a).div(2).equal(),overflow:`hidden`,whiteSpace:`pre`,textOverflow:`ellipsis`},"&-remove":Object.assign(Object.assign({},lo()),{display:`inline-flex`,alignItems:`center`,color:c,fontWeight:`bold`,fontSize:10,lineHeight:`inherit`,cursor:`pointer`,[`> ${n}`]:{verticalAlign:`-0.2em`},"&:hover":{color:l}})}}}},Bv=(e,t)=>{let{componentCls:n,INTERNAL_FIXED_ITEM_MARGIN:r}=e,i=`${n}-selection-overflow`,a=e.multipleSelectItemHeight,o=Rv(e),s=t?`${n}-${t}`:``,c=Lv(e);return{[`${n}-multiple${s}`]:Object.assign(Object.assign({},zv(e)),{[`${n}-selector`]:{display:`flex`,alignItems:`center`,width:`100%`,height:`100%`,paddingInline:c.basePadding,paddingBlock:c.containerPadding,borderRadius:e.borderRadius,[`${n}-disabled&`]:{background:e.multipleSelectorBgDisabled,cursor:`not-allowed`},"&:after":{display:`inline-block`,width:0,margin:`${Q(r)} 0`,lineHeight:Q(a),visibility:`hidden`,content:`"\\a0"`}},[`${n}-selection-item`]:{height:c.itemHeight,lineHeight:Q(c.itemLineHeight)},[`${n}-selection-wrap`]:{alignSelf:`flex-start`,"&:after":{lineHeight:Q(a),marginBlock:r}},[`${n}-prefix`]:{marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal()},[`${i}-item + ${i}-item,
|
||||
${n}-prefix + ${n}-selection-wrap
|
||||
`]:{[`${n}-selection-search`]:{marginInlineStart:0},[`${n}-selection-placeholder`]:{insetInlineStart:0}},[`${i}-item-suffix`]:{minHeight:c.itemHeight,marginBlock:r},[`${n}-selection-search`]:{display:`inline-flex`,position:`relative`,maxWidth:`100%`,marginInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(o).equal(),"\n &-input,\n &-mirror\n ":{height:a,fontFamily:e.fontFamily,lineHeight:Q(a),transition:`all ${e.motionDurationSlow}`},"&-input":{width:`100%`,minWidth:4.1},"&-mirror":{position:`absolute`,top:0,insetInlineStart:0,insetInlineEnd:`auto`,zIndex:999,whiteSpace:`pre`,visibility:`hidden`}},[`${n}-selection-placeholder`]:{position:`absolute`,top:`50%`,insetInlineStart:e.calc(e.inputPaddingHorizontalBase).sub(c.basePadding).equal(),insetInlineEnd:e.inputPaddingHorizontalBase,transform:`translateY(-50%)`,transition:`all ${e.motionDurationSlow}`}})}};function Vv(e,t){let{componentCls:n}=e,r={[`${n}-multiple${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,[`${n}-selector`]:{[`${n}-show-search&`]:{cursor:`text`}},[`
|
||||
&${n}-show-arrow ${n}-selector,
|
||||
&${n}-allow-clear ${n}-selector
|
||||
`]:{paddingInlineEnd:e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()}}};return[Bv(e,t),r]}var Hv=e=>{let{componentCls:t}=e,n=Ra(e,{selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS}),r=Ra(e,{fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius});return[Vv(e),Vv(n,`sm`),{[`${t}-multiple${t}-sm`]:{[`${t}-selection-placeholder`]:{insetInline:e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()},[`${t}-selection-search`]:{marginInlineStart:2}}},Vv(r,`lg`)]};function Uv(e,t){let{componentCls:n,inputPaddingHorizontalBase:r,borderRadius:i}=e,a=e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal();return{[`${n}-single${t?`${n}-${t}`:``}`]:{fontSize:e.fontSize,height:e.controlHeight,[`${n}-selector`]:Object.assign(Object.assign({},co(e,!0)),{display:`flex`,borderRadius:i,flex:`1 1 auto`,[`${n}-selection-wrap:after`]:{lineHeight:Q(a)},[`${n}-selection-search`]:{position:`absolute`,inset:0,width:`100%`,"&-input":{width:`100%`,WebkitAppearance:`textfield`}},[`
|
||||
${n}-selection-item,
|
||||
${n}-selection-placeholder
|
||||
`]:{display:`block`,padding:0,lineHeight:Q(a),transition:`all ${e.motionDurationSlow}, visibility 0s`,alignSelf:`center`},[`${n}-selection-placeholder`]:{transition:`none`,pointerEvents:`none`},[[`&:after`,`${n}-selection-item:empty:after`,`${n}-selection-placeholder:empty:after`].join(`,`)]:{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`}}),[`
|
||||
&${n}-show-arrow ${n}-selection-item,
|
||||
&${n}-show-arrow ${n}-selection-search,
|
||||
&${n}-show-arrow ${n}-selection-placeholder
|
||||
`]:{paddingInlineEnd:e.showArrowPaddingInlineEnd},[`&${n}-open ${n}-selection-item`]:{color:e.colorTextPlaceholder},[`&:not(${n}-customize-input)`]:{[`${n}-selector`]:{width:`100%`,height:`100%`,alignItems:`center`,padding:`0 ${Q(r)}`,[`${n}-selection-search-input`]:{height:a,fontSize:e.fontSize},"&:after":{lineHeight:Q(a)}}},[`&${n}-customize-input`]:{[`${n}-selector`]:{"&:after":{display:`none`},[`${n}-selection-search`]:{position:`static`,width:`100%`},[`${n}-selection-placeholder`]:{position:`absolute`,insetInlineStart:0,insetInlineEnd:0,padding:`0 ${Q(r)}`,"&:after":{display:`none`}}}}}}}function Wv(e){let{componentCls:t}=e,n=e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();return[Uv(e),Uv(Ra(e,{controlHeight:e.controlHeightSM,borderRadius:e.borderRadiusSM}),`sm`),{[`${t}-single${t}-sm`]:{[`&:not(${t}-customize-input)`]:{[`${t}-selector`]:{padding:`0 ${Q(n)}`},[`&${t}-show-arrow ${t}-selection-search`]:{insetInlineEnd:e.calc(n).add(e.calc(e.fontSize).mul(1.5)).equal()},[`
|
||||
&${t}-show-arrow ${t}-selection-item,
|
||||
&${t}-show-arrow ${t}-selection-placeholder
|
||||
`]:{paddingInlineEnd:e.calc(e.fontSize).mul(1.5).equal()}}}},Uv(Ra(e,{controlHeight:e.singleItemHeightLG,fontSize:e.fontSizeLG,borderRadius:e.borderRadiusLG}),`lg`)]}var Gv=e=>{let{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:i,controlHeightSM:a,controlHeightLG:o,paddingXXS:s,controlPaddingHorizontal:c,zIndexPopupBase:l,colorText:u,fontWeightStrong:d,controlItemBgActive:f,controlItemBgHover:p,colorBgContainer:m,colorFillSecondary:h,colorBgContainerDisabled:g,colorTextDisabled:_,colorPrimaryHover:v,colorPrimary:y,controlOutline:b}=e,x=s*2,S=r*2,C=Math.min(i-x,i-S),w=Math.min(a-x,a-S),T=Math.min(o-x,o-S);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(s/2),zIndexPopup:l+50,optionSelectedColor:u,optionSelectedFontWeight:d,optionSelectedBg:f,optionActiveBg:p,optionPadding:`${(i-t*n)/2}px ${c}px`,optionFontSize:t,optionLineHeight:n,optionHeight:i,selectorBg:m,clearBg:m,singleItemHeightLG:o,multipleItemBg:h,multipleItemBorderColor:`transparent`,multipleItemHeight:C,multipleItemHeightSM:w,multipleItemHeightLG:T,multipleSelectorBgDisabled:g,multipleItemColorDisabled:_,multipleItemBorderColorDisabled:`transparent`,showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:v,activeBorderColor:y,activeOutlineColor:b,selectAffixPadding:s}},Kv=(e,t)=>{let{componentCls:n,antCls:r,controlOutlineWidth:i}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{border:`${Q(e.lineWidth)} ${e.lineType} ${t.borderColor}`,background:e.selectorBg},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{borderColor:t.hoverBorderHover},[`${n}-focused& ${n}-selector`]:{borderColor:t.activeBorderColor,boxShadow:`0 0 0 ${Q(i)} ${t.activeOutlineColor}`,outline:0},[`${n}-prefix`]:{color:t.color}}}},qv=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Kv(e,t))}),Jv=e=>({"&-outlined":Object.assign(Object.assign(Object.assign(Object.assign({},Kv(e,{borderColor:e.colorBorder,hoverBorderHover:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeOutlineColor:e.activeOutlineColor,color:e.colorText})),qv(e,{status:`error`,borderColor:e.colorError,hoverBorderHover:e.colorErrorHover,activeBorderColor:e.colorError,activeOutlineColor:e.colorErrorOutline,color:e.colorError})),qv(e,{status:`warning`,borderColor:e.colorWarning,hoverBorderHover:e.colorWarningHover,activeBorderColor:e.colorWarning,activeOutlineColor:e.colorWarningOutline,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}})}),Yv=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{background:t.bg,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,color:t.color},[`&:not(${n}-disabled):not(${n}-customize-input):not(${r}-pagination-size-changer)`]:{[`&:hover ${n}-selector`]:{background:t.hoverBg},[`${n}-focused& ${n}-selector`]:{background:e.selectorBg,borderColor:t.activeBorderColor,outline:0}}}},Xv=(e,t)=>({[`&${e.componentCls}-status-${t.status}`]:Object.assign({},Yv(e,t))}),Zv=e=>({"&-filled":Object.assign(Object.assign(Object.assign(Object.assign({},Yv(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,color:e.colorText})),Xv(e,{status:`error`,bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,color:e.colorError})),Xv(e,{status:`warning`,bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,color:e.colorWarning})),{[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{borderColor:e.colorBorder,background:e.colorBgContainerDisabled,color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.colorBgContainer,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}})}),Qv=e=>({"&-borderless":{[`${e.componentCls}-selector`]:{background:`transparent`,border:`${Q(e.lineWidth)} ${e.lineType} transparent`},[`&${e.componentCls}-disabled`]:{[`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]:{color:e.colorTextDisabled}},[`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]:{background:e.multipleItemBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`},[`&${e.componentCls}-status-error`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorError}},[`&${e.componentCls}-status-warning`]:{[`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]:{color:e.colorWarning}}}}),$v=(e,t)=>{let{componentCls:n,antCls:r}=e;return{[`&:not(${n}-customize-input) ${n}-selector`]:{borderWidth:`${Q(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.bLine truncated
|
||||
> ${t}-item-active,
|
||||
> ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:`transparent`},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${n}`,`background ${n}`].join(`,`)},[`${t}-submenu-arrow`]:{display:`none`}}}},o3=({componentCls:e,menuArrowOffset:t,calc:n})=>({[`${e}-rtl`]:{direction:`rtl`},[`${e}-submenu-rtl`]:{transformOrigin:`100% 0`},[`${e}-rtl${e}-vertical,
|
||||
${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Q(n(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Q(t)})`}}}}),s3=e=>mo(e),c3=(e,t)=>{let{componentCls:n,itemColor:r,itemSelectedColor:i,subMenuItemSelectedColor:a,groupTitleColor:o,itemBg:s,subMenuItemBg:c,itemSelectedBg:l,activeBarHeight:u,activeBarWidth:d,activeBarBorderWidth:f,motionDurationSlow:p,motionEaseInOut:m,motionEaseOut:h,itemPaddingInline:g,motionDurationMid:_,itemHoverColor:v,lineType:y,colorSplit:b,itemDisabledColor:x,dangerItemColor:S,dangerItemHoverColor:C,dangerItemSelectedColor:w,dangerItemActiveBg:T,dangerItemSelectedBg:E,popupBg:D,itemHoverBg:O,itemActiveBg:k,menuSubMenuBg:A,horizontalItemSelectedColor:j,horizontalItemSelectedBg:M,horizontalItemBorderRadius:N,horizontalItemHoverBg:P}=e;return{[`${n}-${t}, ${n}-${t} > ${n}`]:{color:r,background:s,[`&${n}-root:focus-visible`]:Object.assign({},s3(e)),[`${n}-item`]:{"&-group-title, &-extra":{color:o}},[`${n}-submenu-selected > ${n}-submenu-title`]:{color:a},[`${n}-item, ${n}-submenu-title`]:{color:r,[`&:not(${n}-item-disabled):focus-visible`]:Object.assign({},s3(e))},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${x} !important`},[`${n}-item:not(${n}-item-selected):not(${n}-submenu-selected)`]:{[`&:hover, > ${n}-submenu-title:hover`]:{color:v}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:k}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:O},"&:active":{backgroundColor:k}}},[`${n}-item-danger`]:{color:S,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:C}},[`&${n}-item:active`]:{background:T}},[`${n}-item a`]:{"&, &:hover":{color:`inherit`}},[`${n}-item-selected`]:{color:i,[`&${n}-item-danger`]:{color:w},"a, a:hover":{color:`inherit`}},[`& ${n}-item-selected`]:{backgroundColor:l,[`&${n}-item-danger`]:{backgroundColor:E}},[`&${n}-submenu > ${n}`]:{backgroundColor:A},[`&${n}-popup > ${n}`]:{backgroundColor:D},[`&${n}-submenu-popup > ${n}`]:{backgroundColor:D},[`&${n}-horizontal`]:Object.assign(Object.assign({},t===`dark`?{borderBottom:0}:{}),{[`> ${n}-item, > ${n}-submenu`]:{top:f,marginTop:e.calc(f).mul(-1).equal(),marginBottom:0,borderRadius:N,"&::after":{position:`absolute`,insetInline:g,bottom:0,borderBottom:`${Q(u)} solid transparent`,transition:`border-color ${p} ${m}`,content:`""`},"&:hover, &-active, &-open":{background:P,"&::after":{borderBottomWidth:u,borderBottomColor:j}},"&-selected":{color:j,backgroundColor:M,"&:hover":{backgroundColor:M},"&::after":{borderBottomWidth:u,borderBottomColor:j}}}}),[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${Q(f)} ${y} ${b}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:c},[`${n}-item`]:{position:`relative`,"&::after":{position:`absolute`,insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Q(d)} solid ${i}`,transform:`scaleY(0.0001)`,opacity:0,transition:[`transform ${_} ${h}`,`opacity ${_} ${h}`].join(`,`),content:`""`},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:w}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:`scaleY(1)`,opacity:1,transition:[`transform ${_} ${m}`,`opacity ${_} ${m}`].join(`,`)}}}}}},l3=e=>{let{componentCls:t,itemHeight:n,itemMarginInline:r,padding:i,menuArrowSize:a,marginXS:o,itemMarginBlock:s,itemWidth:c,itemPaddingInline:l}=e,u=e.calc(a).add(i).add(o).equal();return{[`${t}-item`]:{position:`relative`,overflow:`hidden`},[`${t}-item, ${t}-submenu-title`]:{height:n,lineHeight:Q(n),paddingInline:l,overflow:`hidden`,textOverflow:`ellipsis`,marginInline:r,marginBlock:s,width:c},[`> ${t}-item,
|
||||
> ${t}-submenu > ${t}-submenu-title`]:{height:n,lineHeight:Q(n)},[`${t}-item-group-list ${t}-submenu-title,
|
||||
${t}-submenu-title`]:{paddingInlineEnd:u}}},u3=e=>{let{componentCls:t,iconCls:n,itemHeight:r,colorTextLightSolid:i,dropdownWidth:a,controlHeightLG:o,motionEaseOut:s,paddingXL:c,itemMarginInline:l,fontSizeLG:u,motionDurationFast:d,motionDurationSlow:f,paddingXS:p,boxShadowSecondary:m,collapsedWidth:h,collapsedIconSize:g}=e,_={height:r,lineHeight:Q(r),listStylePosition:`inside`,listStyleType:`disc`};return[{[t]:{"&-inline, &-vertical":Object.assign({[`&${t}-root`]:{boxShadow:`none`}},l3(e))},[`${t}-submenu-popup`]:{[`${t}-vertical`]:Object.assign(Object.assign({},l3(e)),{boxShadow:m})}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:a,maxHeight:`calc(100vh - ${Q(e.calc(o).mul(2.5).equal())})`,padding:`0`,overflow:`hidden`,borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:`hidden`,overflowY:`auto`}}},{[`${t}-inline`]:{width:`100%`,[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:`flex`,alignItems:`center`,transition:[`border-color ${f}`,`background ${f}`,`padding ${d} ${s}`].join(`,`),[`> ${t}-title-content`]:{flex:`auto`,minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`},"> *":{flex:`none`}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:`none`,[`& > ${t}-submenu > ${t}-submenu-title`]:_,[`& ${t}-item-group-title`]:{paddingInlineStart:c}},[`${t}-item`]:_}},{[`${t}-inline-collapsed`]:{width:h,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:u,textAlign:`center`}}},[`> ${t}-item,
|
||||
> ${t}-item-group > ${t}-item-group-list > ${t}-item,
|
||||
> ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title,
|
||||
> ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Q(e.calc(g).div(2).equal())} - ${Q(l)})`,textOverflow:`clip`,[`
|
||||
${t}-submenu-arrow,
|
||||
${t}-submenu-expand-icon
|
||||
`]:{opacity:0},[`${t}-item-icon, ${n}`]:{margin:0,fontSize:g,lineHeight:Q(r),"+ span":{display:`inline-block`,opacity:0}}},[`${t}-item-icon, ${n}`]:{display:`inline-block`},"&-tooltip":{pointerEvents:`none`,[`${t}-item-icon, ${n}`]:{display:`none`},"a, a:hover":{color:i}},[`${t}-item-group-title`]:Object.assign(Object.assign({},so),{paddingInline:p})}}]},d3=e=>{let{componentCls:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:i,motionEaseOut:a,iconCls:o,iconSize:s,iconMarginInlineEnd:c}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:`relative`,display:`block`,margin:0,whiteSpace:`nowrap`,cursor:`pointer`,transition:[`border-color ${n}`,`background ${n}`,`padding calc(${n} + 0.1s) ${i}`].join(`,`),[`${t}-item-icon, ${o}`]:{minWidth:s,fontSize:s,transition:[`font-size ${r} ${a}`,`margin ${n} ${i}`,`color ${n}`].join(`,`),"+ span":{marginInlineStart:c,opacity:1,transition:[`opacity ${n} ${i}`,`margin ${n}`,`color ${n}`].join(`,`)}},[`${t}-item-icon`]:Object.assign({},lo()),[`&${t}-item-only-child`]:{[`> ${o}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:`none !important`,cursor:`not-allowed`,"&::after":{borderColor:`transparent !important`},a:{color:`inherit !important`,cursor:`not-allowed`,pointerEvents:`none`},[`> ${t}-submenu-title`]:{color:`inherit !important`,cursor:`not-allowed`}}}},f3=e=>{let{componentCls:t,motionDurationSlow:n,motionEaseInOut:r,borderRadius:i,menuArrowSize:a,menuArrowOffset:o}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:`absolute`,top:`50%`,insetInlineEnd:e.margin,width:a,color:`currentcolor`,transform:`translateY(-50%)`,transition:`transform ${n} ${r}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:`absolute`,width:e.calc(a).mul(.6).equal(),height:e.calc(a).mul(.15).equal(),backgroundColor:`currentcolor`,borderRadius:i,transition:[`background ${n} ${r}`,`transform ${n} ${r}`,`top ${n} ${r}`,`color ${n} ${r}`].join(`,`),content:`""`},"&::before":{transform:`rotate(45deg) translateY(${Q(e.calc(o).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Q(o)})`}}}}},p3=e=>{let{antCls:t,componentCls:n,fontSize:r,motionDurationSlow:i,motionDurationMid:a,motionEaseInOut:o,paddingXS:s,padding:c,colorSplit:l,lineWidth:u,zIndexPopup:d,borderRadiusLG:f,subMenuItemBorderRadius:p,menuArrowSize:m,menuArrowOffset:h,lineType:g,groupTitleLineHeight:_,groupTitleFontSize:v}=e;return[{"":{[n]:Object.assign(Object.assign({},uo()),{"&-hidden":{display:`none`}})},[`${n}-submenu-hidden`]:{display:`none`}},{[n]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},co(e)),uo()),{marginBottom:0,paddingInlineStart:0,fontSize:r,lineHeight:0,listStyle:`none`,outline:`none`,transition:`width ${i} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:`none`},"&-overflow":{display:`flex`,[`${n}-item`]:{flex:`none`}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${n}-item-group-title`]:{padding:`${Q(s)} ${Q(c)}`,fontSize:v,lineHeight:_,transition:`all ${i}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`].join(`,`)},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${i} ${o}`,`background ${i} ${o}`,`padding ${a} ${o}`].join(`,`)},[`${n}-submenu ${n}-sub`]:{cursor:`initial`,transition:[`background ${i} ${o}`,`padding ${i} ${o}`].join(`,`)},[`${n}-title-content`]:{transition:`color ${i}`,"&-with-extra":{display:`inline-flex`,alignItems:`center`,width:`100%`},[`> ${t}-typography-ellipsis-single-line`]:{display:`inline`,verticalAlign:`unset`},[`${n}-item-extra`]:{marginInlineStart:`auto`,paddingInlineStart:e.padding}},[`${n}-item a`]:{"&::before":{position:`absolute`,inset:0,backgroundColor:`transparent`,content:`""`}},[`${n}-item-divider`]:{overflow:`hidden`,lineHeight:0,borderColor:l,borderStyle:g,borderWidth:0,borderTopWidth:u,marginBlock:u,padding:0,"&-dashed":{borderStyle:`dashed`}}}),d3(e)),{[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${Q(e.calc(r).mul(2).equal())} ${Q(c)}`}}},"&-submenu":{"&-popup":{position:`absolute`,zIndex:d,borderRadius:f,boxShadow:`none`,transformOrigin:`0 0`,[`&${n}-submenu`]:{background:`transparent`},"&::before":{position:`absolute`,inset:0,zIndex:-1,width:`100%`,height:`100%`,opacity:0,content:`""`},[`> ${n}`]:Object.assign(Object.assign(Object.assign({borderRadius:f},d3(e)),f3(e)),{[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:p},[`${n}-submenu-title::after`]:{transition:`transform ${i} ${o}`}})},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:`100% 0`},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:`100% 100%`},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:`0 100%Line truncated
|
||||
&-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Q(h)})`},"&::after":{transform:`rotate(45deg) translateX(${Q(e.calc(h).mul(-1).equal())})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(${Q(e.calc(m).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Q(e.calc(h).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Q(h)})`}}})},{[`${t}-layout-header`]:{[n]:{lineHeight:`inherit`}}}]},m3=e=>{let{colorPrimary:t,colorError:n,colorTextDisabled:r,colorErrorBg:i,colorText:a,colorTextDescription:o,colorBgContainer:s,colorFillAlter:c,colorFillContent:l,lineWidth:u,lineWidthBold:d,controlItemBgActive:f,colorBgTextHover:p,controlHeightLG:m,lineHeight:h,colorBgElevated:g,marginXXS:_,padding:v,fontSize:y,controlHeightSM:b,fontSizeLG:x,colorTextLightSolid:S,colorErrorHover:C}=e,w=e.activeBarWidth??0,T=e.activeBarBorderWidth??u,E=e.itemMarginInline??e.marginXXS,D=new si(S).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:a,itemColor:a,colorItemTextHover:a,itemHoverColor:a,colorItemTextHoverHorizontal:t,horizontalItemHoverColor:t,colorGroupTitle:o,groupTitleColor:o,colorItemTextSelected:t,itemSelectedColor:t,subMenuItemSelectedColor:t,colorItemTextSelectedHorizontal:t,horizontalItemSelectedColor:t,colorItemBg:s,itemBg:s,colorItemBgHover:p,itemHoverBg:p,colorItemBgActive:l,itemActiveBg:f,colorSubItemBg:c,subMenuItemBg:c,colorItemBgSelected:f,itemSelectedBg:f,colorItemBgSelectedHorizontal:`transparent`,horizontalItemSelectedBg:`transparent`,colorActiveBarWidth:0,activeBarWidth:w,colorActiveBarHeight:d,activeBarHeight:d,colorActiveBarBorderSize:u,activeBarBorderWidth:T,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:n,dangerItemColor:n,colorDangerItemTextHover:n,dangerItemHoverColor:n,colorDangerItemTextSelected:n,dangerItemSelectedColor:n,colorDangerItemBgActive:i,dangerItemActiveBg:i,colorDangerItemBgSelected:i,dangerItemSelectedBg:i,itemMarginInline:E,horizontalItemBorderRadius:0,horizontalItemHoverBg:`transparent`,itemHeight:m,groupTitleLineHeight:h,collapsedWidth:m*2,popupBg:g,itemMarginBlock:_,itemPaddingInline:v,horizontalLineHeight:`${m*1.15}px`,iconSize:y,iconMarginInlineEnd:b-y,collapsedIconSize:x,groupTitleFontSize:y,darkItemDisabledColor:new si(S).setA(.25).toRgbString(),darkItemColor:D,darkDangerItemColor:n,darkItemBg:`#001529`,darkPopupBg:`#001529`,darkSubMenuItemBg:`#000c17`,darkItemSelectedColor:S,darkItemSelectedBg:t,darkDangerItemSelectedBg:n,darkItemHoverBg:`transparent`,darkGroupTitleColor:D,darkItemHoverColor:S,darkDangerItemHoverColor:C,darkDangerItemSelectedColor:S,darkDangerItemActiveBg:n,itemWidth:w?`calc(100% + ${T}px)`:`calc(100% - ${E*2}px)`}},h3=(e,t=e,n=!0)=>vo(`Menu`,e=>{let{colorBgElevated:t,controlHeightLG:n,fontSize:r,darkItemColor:i,darkDangerItemColor:a,darkItemBg:o,darkSubMenuItemBg:s,darkItemSelectedColor:c,darkItemSelectedBg:l,darkDangerItemSelectedBg:u,darkItemHoverBg:d,darkGroupTitleColor:f,darkItemHoverColor:p,darkItemDisabledColor:m,darkDangerItemHoverColor:h,darkDangerItemSelectedColor:g,darkDangerItemActiveBg:_,popupBg:v,darkPopupBg:y}=e,b=e.calc(r).div(7).mul(5).equal(),x=Ra(e,{menuArrowSize:b,menuHorizontalHeight:e.calc(n).mul(1.15).equal(),menuArrowOffset:e.calc(b).mul(.25).equal(),menuSubMenuBg:t,calc:e.calc,popupBg:v}),S=Ra(x,{itemColor:i,itemHoverColor:p,groupTitleColor:f,itemSelectedColor:c,subMenuItemSelectedColor:c,itemBg:o,popupBg:y,subMenuItemBg:s,itemActiveBg:`transparent`,itemSelectedBg:l,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:d,itemDisabledColor:m,dangerItemColor:a,dangerItemHoverColor:h,dangerItemSelectedColor:g,dangerItemActiveBg:_,dangerItemSelectedBg:u,menuSubMenuBg:s,horizontalItemSelectedColor:c,horizontalItemSelectedBg:l});return[p3(x),a3(x),u3(x),c3(x,`light`),c3(S,`dark`),o3(x),wd(x),Jd(x,`slide-up`),Jd(x,`slide-down`),lf(x,`zoom-big`)]},m3,{deprecatedTokens:[[`colorGroupTitle`,`groupTitleColor`],[`radiusItem`,`itemBorderRadius`],[`radiusSubMenuItem`,`subMenuItemBorderRadius`],[`colorItemText`,`itemColor`],[`colorItemTextHover`,`itemHoverColor`],[`colorItemTextHoverHorizontal`,`horizontalItemHoverColor`],[`colorItemTextSelected`,`itemSelectedColor`],[`colorItemTextSelectedHorizontal`,`horizontalItemSelectedColor`],[`colorItemTextDisabled`,`itemDisabledColor`],[`colorDangerItemText`,`dangerItemColor`],[`colorDangerItemTextHover`,`dangerItemHoverColor`],[`colorDangerItemTextSelected`,`dangerItemSelectedColor`],[`colorDangerItemBgActive`,`dangerItemActiveBg`],[`colorDangerItemBgSelected`,`dangerItemSelectedBg`],[`colorItemBg`,`itemBg`],[`colorItemBgHover`,`itemHoverBg`],[`colorSubItemBg`,`subMenuItemBg`],[`colorItemBgActive`,`itemActiveBg`],[`colorItemBgSelectedHorizontal`,`horizontalItemSelectedBg`],[`Line truncated
|
||||
&${o}-slide-down-appear${o}-slide-down-appear-active${t}-placement-bottomLeft,
|
||||
&${o}-slide-down-enter${o}-slide-down-enter-active${t}-placement-bottom,
|
||||
&${o}-slide-down-appear${o}-slide-down-appear-active${t}-placement-bottom,
|
||||
&${o}-slide-down-enter${o}-slide-down-enter-active${t}-placement-bottomRight,
|
||||
&${o}-slide-down-appear${o}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:zd},[`&${o}-slide-up-enter${o}-slide-up-enter-active${t}-placement-topLeft,
|
||||
&${o}-slide-up-appear${o}-slide-up-appear-active${t}-placement-topLeft,
|
||||
&${o}-slide-up-enter${o}-slide-up-enter-active${t}-placement-top,
|
||||
&${o}-slide-up-appear${o}-slide-up-appear-active${t}-placement-top,
|
||||
&${o}-slide-up-enter${o}-slide-up-enter-active${t}-placement-topRight,
|
||||
&${o}-slide-up-appear${o}-slide-up-appear-active${t}-placement-topRight`]:{animationName:Vd},[`&${o}-slide-down-leave${o}-slide-down-leave-active${t}-placement-bottomLeft,
|
||||
&${o}-slide-down-leave${o}-slide-down-leave-active${t}-placement-bottom,
|
||||
&${o}-slide-down-leave${o}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:Bd},[`&${o}-slide-up-leave${o}-slide-up-leave-active${t}-placement-topLeft,
|
||||
&${o}-slide-up-leave${o}-slide-up-leave-active${t}-placement-top,
|
||||
&${o}-slide-up-leave${o}-slide-up-leave-active${t}-placement-topRight`]:{animationName:Hd}}},By(e,h,{arrowPlacement:{top:!0,bottom:!0}}),{[`${t} ${n}`]:{position:`relative`,margin:0},[`${n}-submenu-popup`]:{position:`absolute`,zIndex:r,background:`transparent`,boxShadow:`none`,transformOrigin:`0 0`,"ul, li":{listStyle:`none`,margin:0}},[`${t}, ${t}-menu-submenu`]:Object.assign(Object.assign({},co(e)),{[n]:Object.assign(Object.assign({padding:d,listStyleType:`none`,backgroundColor:h,backgroundClip:`padding-box`,borderRadius:e.borderRadiusLG,outline:`none`,boxShadow:e.boxShadowSecondary},ho(e)),{"&:empty":{padding:0,boxShadow:`none`},[`${n}-item-group-title`]:{padding:`${Q(l)} ${Q(m)}`,color:e.colorTextDescription,transition:`all ${c}`},[`${n}-item`]:{position:`relative`,display:`flex`,alignItems:`center`},[`${n}-item-icon`]:{minWidth:u,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${n}-title-content`]:{flex:`auto`,"&-with-extra":{display:`inline-flex`,alignItems:`center`,width:`100%`},"> a":{color:`inherit`,transition:`all ${c}`,"&:hover":{color:`inherit`},"&::after":{position:`absolute`,inset:0,content:`""`}},[`${n}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:`auto`,fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${n}-item, ${n}-submenu-title`]:Object.assign(Object.assign({display:`flex`,margin:0,padding:`${Q(l)} ${Q(m)}`,color:e.colorText,fontWeight:`normal`,fontSize:u,lineHeight:e.lineHeight,cursor:`pointer`,transition:`all ${c}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover}},ho(e)),{"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:f,cursor:`not-allowed`,"&:hover":{color:f,backgroundColor:h,cursor:`not-allowed`},a:{pointerEvents:`none`}},"&-divider":{height:1,margin:`${Q(e.marginXXS)} 0`,overflow:`hidden`,lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:`absolute`,insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:`0 !important`,color:e.colorIcon,fontSize:p,fontStyle:`normal`}}}),[`${n}-item-group-list`]:{margin:`0 ${Q(e.marginXS)}`,padding:0,listStyle:`none`},[`${n}-submenu-title`]:{paddingInlineEnd:e.calc(m).add(e.fontSizeSM).equal()},[`${n}-submenu-vertical`]:{position:`relative`},[`${n}-submenu${n}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:f,backgroundColor:h,cursor:`not-allowed`}},[`${n}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}})})},[Jd(e,`slide-up`),Jd(e,`slide-down`),Rd(e,`move-up`),Rd(e,`move-down`),lf(e,`zoom-big`)]]},w3=vo(`Dropdown`,e=>{let{marginXXS:t,sizePopupArrow:n,paddingXXS:r,componentCls:i}=e,a=Ra(e,{menuCls:`${i}-menu`,dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:r});return[C3(a),S3(a)]},e=>Object.assign(Object.assign({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2},Ry({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0})),Iy(e)),{resetStyle:!1}),T3=e=>{let{menu:t,arrow:n,prefixCls:r,children:i,trigger:a,disabled:o,dropdownRender:c,popupRender:l,getPopupContainer:u,overlayClassName:d,rootClassName:f,overlayStyle:p,open:m,onOpenChange:g,visible:_,onVisibleChange:v,mouseEnterDelay:y=.15,mouseLeaveDelay:b=.1,autoAdjustOverflow:x=!0,placement:S=``,overlay:C,transitionName:w,destroyOnHidden:T,destroyPopupOnHide:E}=e,{getPopupContainer:D,getPrefixCls:O,direction:k,dropdown:A}=s.useContext(fa),j=l||c;Lr(`Dropdown`);let M=s.useMemo(()=>{let e=O();return w===void 0?S.includes(`top`)?`${e}-slide-down`:`${e}-slide-up`:w},[O,S,w]),N=s.useMemo(()=>S?S.includes(`Center`)?S.slice(0,S.indexOf(`Center`)):S:k===`rtl`?`bottomRight`:`bottomLeft`,[S,k]),P=O(`dropdown`,r),F=Uc(P),[I,L,R]=w3(P,F),[,z]=oo(),B=s.Children.only(w2(i)?s.createElement(`span`,null,i):i),V=_c(B,{className:(0,h.default)(`${P}-trigger`,{[`${P}-rtl`]:k===`rtl`},B.props.className),disabled:B.props.disabled??o}),H=o?[]:a,U=!!H?.includes(`contextMenu`),[W,G]=Pa(!1,{value:m??_}),K=ja(e=>{g?.(e,{source:`trigger`}),v?.(e),G(e)}),q=(0,h.default)(d,f,L,R,F,A?.className,{[`${P}-rtl`]:k===`rtl`}),ee=Gy({arrowPointAtCenter:typeof n==`object`&&n.pointAtCenter,autoAdjustOverflow:x,offset:z.marginXXS,arrowWidth:n?z.sizePopupArrow:0,borderRadius:z.borderRadius}),J=ja(()=>{t?.selectable&&t?.multiple||(g?.(!1,{source:`menu`}),G(!1))}),te=()=>{let e;return e=t?.items?s.createElement(x3,Object.assign({},t)):typeof C==`function`?C():C,j&&(e=j(e)),e=s.Children.only(typeof e==`string`?s.createElement(`span`,null,e):e),s.createElement(i3,{prefixCls:`${P}-menu`,rootClassName:(0,h.default)(R,F),expandIcon:s.createElement(`span`,{className:`${P}-menu-submenu-arrow`},k===`rtl`?s.createElement(p2,{className:`${P}-menu-submenu-arrow-icon`}):s.createElement(fd,{className:`${P}-menu-submenu-arrow-icon`})),mode:`vertical`,selectable:!1,onClick:J,validator:({mode:e})=>
Line truncated
|
||||
&:hover ${y}`]:{borderColor:r},[`${t}-input:focus-visible + ${y}`]:mo(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:`visible`},[`${t}-inner`]:{"&::after":{boxSizing:`border-box`,position:`absolute`,insetBlockStart:`50%`,insetInlineStart:`50%`,display:`block`,width:x,height:x,marginBlockStart:v(1).mul(i).div(-2).equal({unit:!0}),marginInlineStart:v(1).mul(i).div(-2).equal({unit:!0}),backgroundColor:g,borderBlockStart:0,borderInlineStart:0,borderRadius:x,transform:`scale(0)`,opacity:0,transition:`all ${a} ${s}`,content:`""`},boxSizing:`border-box`,position:`relative`,insetBlockStart:0,insetInlineStart:0,display:`block`,width:x,height:x,backgroundColor:c,borderColor:l,borderStyle:`solid`,borderWidth:u,borderRadius:`50%`,transition:`all ${o}`},[`${t}-input`]:{position:`absolute`,inset:0,zIndex:1,cursor:`pointer`,opacity:0},[`${t}-checked`]:{[y]:{borderColor:r,backgroundColor:_,"&::after":{transform:`scale(${e.calc(e.dotSize).div(i).equal()})`,opacity:1,transition:`all ${a} ${s}`}}},[`${t}-disabled`]:{cursor:`not-allowed`,[y]:{backgroundColor:d,borderColor:l,cursor:`not-allowed`,"&::after":{backgroundColor:m}},[`${t}-input`]:{cursor:`not-allowed`},[`${t}-disabled + span`]:{color:f,cursor:`not-allowed`},[`&${t}-checked`]:{[y]:{"&::after":{transform:`scale(${v(b).div(i).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:p,paddingInlineEnd:p}})}},I3=e=>{let{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:i,lineType:a,colorBorder:o,motionDurationMid:s,buttonPaddingInline:c,fontSize:l,buttonBg:u,fontSizeLG:d,controlHeightLG:f,controlHeightSM:p,paddingXS:m,borderRadius:h,borderRadiusSM:g,borderRadiusLG:_,buttonCheckedBg:v,buttonSolidCheckedColor:y,colorTextDisabled:b,colorBgContainerDisabled:x,buttonCheckedBgDisabled:S,buttonCheckedColorDisabled:C,colorPrimary:w,colorPrimaryHover:T,colorPrimaryActive:E,buttonSolidCheckedBg:D,buttonSolidCheckedHoverBg:O,buttonSolidCheckedActiveBg:k,calc:A}=e;return{[`${r}-button-wrapper`]:{position:`relative`,display:`inline-block`,height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:l,lineHeight:Q(A(n).sub(A(i).mul(2)).equal()),background:u,border:`${Q(i)} ${a} ${o}`,borderBlockStartWidth:A(i).add(.02).equal(),borderInlineEndWidth:i,cursor:`pointer`,transition:[`color ${s}`,`background ${s}`,`box-shadow ${s}`].join(`,`),a:{color:t},[`> ${r}-button`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:`100%`,height:`100%`},"&:not(:last-child)":{marginInlineEnd:A(i).mul(-1).equal()},"&:first-child":{borderInlineStart:`${Q(i)} ${a} ${o}`,borderStartStartRadius:h,borderEndStartRadius:h},"&:last-child":{borderStartEndRadius:h,borderEndEndRadius:h},"&:first-child:last-child":{borderRadius:h},[`${r}-group-large &`]:{height:f,fontSize:d,lineHeight:Q(A(f).sub(A(i).mul(2)).equal()),"&:first-child":{borderStartStartRadius:_,borderEndStartRadius:_},"&:last-child":{borderStartEndRadius:_,borderEndEndRadius:_}},[`${r}-group-small &`]:{height:p,paddingInline:A(m).sub(i).equal(),paddingBlock:0,lineHeight:Q(A(p).sub(A(i).mul(2)).equal()),"&:first-child":{borderStartStartRadius:g,borderEndStartRadius:g},"&:last-child":{borderStartEndRadius:g,borderEndEndRadius:g}},"&:hover":{position:`relative`,color:w},"&:has(:focus-visible)":mo(e),[`${r}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:`none`},[`&-checked:not(${r}-button-wrapper-disabled)`]:{zIndex:1,color:w,background:v,borderColor:w,"&::before":{backgroundColor:w},"&:first-child":{borderColor:w},"&:hover":{color:T,borderColor:T,"&::before":{backgroundColor:T}},"&:active":{color:E,borderColor:E,"&::before":{backgroundColor:E}}},[`${r}-group-solid &-checked:not(${r}-button-wrapper-disabled)`]:{color:y,background:D,borderColor:D,"&:hover":{color:y,background:O,borderColor:O},"&:active":{color:y,background:k,borderColor:k}},"&-disabled":{color:b,backgroundColor:x,borderColor:o,cursor:`not-allowed`,"&:first-child, &:hover":{color:b,backgroundColor:x,borderColor:o}},[`&-disabled${r}-button-wrapper-checked`]:{color:C,backgroundColor:S,borderColor:o,boxShadow:`none`},"&-block":{flex:1,textAlign:`center`}}}},L3=vo(`Radio`,e=>{let{controlOutline:t,controlOutlineWidth:n}=e,r=`0 0 0 ${Q(n)} ${t}`,i=Ra(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[P3(i),F3(i),I3(i)]},e=>{let{wireframe:t,padding:n,marginXS:r,lineWidth:i,fontSizeLG:a,colorText:o,colorBgContainer:s,colorTextDisabled:c,controlItemBgActiveDisabled:l,colorTextLightSolid:u,colorPrimary:d,colorPrimaryHover:f,colorPrimaryActive:p,colorWhite:m}=e,h=a;return{radioSize:h,dotSize:t?h-8:h-(4+i)*2,dotColorDisabled:c,buttonSolidCheckedColor:u,buttonSolidCheckedBg:d,buttonSolidCheckedHoverBg:f,buttonSolidCheckedActiveBg:p,buttonBg:s,buttonCheckedBg:s,buttonColor:o,buttonCheckedBgDisabled:l,buttonCheckedColorDisabled:c,buttonPaddingInline:n-i,wrapperMarginInlineEnd:r,radioColor:t?d:m,radioBgColor:t?s:d}},{unitless:{radioSize:!0,dotSize:!0}}),R3=function(e,t){var n={};for(var r in e)Obje
Line truncated
|
||||
& > ${t}-affix-wrapper,
|
||||
& > ${t}-number-affix-wrapper,
|
||||
& > ${n}-picker-range
|
||||
`]:{display:`inline-flex`},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:`none`},[`& > ${n}-select > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete ${t},
|
||||
& > ${n}-cascader-picker ${t},
|
||||
& > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child,
|
||||
& > ${n}-select:first-child > ${n}-select-selector,
|
||||
& > ${n}-select-auto-complete:first-child ${t},
|
||||
& > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child,
|
||||
& > ${n}-select:last-child > ${n}-select-selector,
|
||||
& > ${n}-cascader-picker:last-child ${t},
|
||||
& > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:`top`},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{borderRadius:0}},[`${t}-group-wrapper:not(:last-child)`]:{[`&${t}-search > ${t}-group`]:{[`& > ${t}-group-addon > ${t}-search-button`]:{borderRadius:0},[`& > ${t}`]:{borderStartStartRadius:e.borderRadius,borderStartEndRadius:0,borderEndEndRadius:0,borderEndStartRadius:e.borderRadius}}}})}},C6=e=>{let{componentCls:t,controlHeightSM:n,lineWidth:r,calc:i}=e,a=i(n).sub(i(r).mul(2)).sub(16).div(2).equal();return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},co(e)),x6(e)),o6(e)),f6(e)),l6(e)),_6(e)),{'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:a,paddingBottom:a}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:`none`}})}},w6=e=>{let{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:`pointer`,transition:`color ${e.motionDurationSlow}`,border:`none`,outline:`none`,backgroundColor:`transparent`,"&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:`hidden`},"&-has-suffix":{margin:`0 ${Q(e.inputAffixPadding)}`}}}},T6=e=>{let{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:i,colorIcon:a,colorIconHover:o,iconCls:s}=e,c=`${t}-affix-wrapper`,l=`${t}-affix-wrapper-disabled`;return{[c]:Object.assign(Object.assign(Object.assign(Object.assign({},x6(e)),{display:`inline-flex`,[`&:not(${t}-disabled):hover`]:{zIndex:1,[`${t}-search-with-button &`]:{zIndex:0}},"&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:`inherit`,border:`none`,borderRadius:0,outline:`none`,background:`transparent`,color:`inherit`,"&::-ms-reveal":{display:`none`},"&:focus":{boxShadow:`none !important`}},"&::before":{display:`inline-block`,width:0,visibility:`hidden`,content:`"\\a0"`},[t]:{"&-prefix, &-suffix":{display:`flex`,flex:`none`,alignItems:`center`,"> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:`ltr`},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}}}),w6(e)),{[`${s}${t}-password-icon`]:{color:a,cursor:`pointer`,transition:`all ${i}`,"&:hover":{color:o}}}),[`${t}-underlined`]:{borderRadius:0},[l]:{[`${s}${t}-password-icon`]:{color:a,cursor:`not-allowed`,"&:hover":{color:a}}}}},E6=e=>{let{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:Object.assign(Object.assign(Object.assign({},co(e)),S6(e)),{"&-rtl":{direction:`rtl`},"&-wrapper":Object.assign(Object.assign(Object.assign({display:`inline-block`,width:`100%`,textAlign:`start`,verticalAlign:`top`,"&-rtl":{direction:`rtl`},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}}},c6(e)),m6(e)),{[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}})})}},D6=e=>{let{componentCls:t,antCls:n}=e,r=`${t}-search`;return{[r]:{[t]:{"&:not([disabled]):hover, &:not([disabled]):focus":{[`+ ${t}-group-addon ${r}-button:not(${n}-btn-color-primary):not(${n}-btn-variant-text)`]:{borderInlineStartColor:e.colorPrimaryHover}}},[`${t}-affix-wrapper`]:{height:e.controlHeight,borderRadius:0},[`${t}-lg`]:{lineHeight:e.calc(e.lineHeightLG).sub(2e-4).equal()},[`> ${t}-group`]:{[`> ${t}-group-addon:last-child`]:{insetInlineStart:-1,padding:0,border:0,[`${r}-button`]:{marginInlineEnd:-1,borderStartStartRadius:0,borderEndStartRadius:0,boxShadow:`none`},[`${r}-button:not(${n}-btn-color-primary)`]:{color:e.colorTextDescription,"&:not([disabled]):hover":{color:e.colorPrimaryHover},"&:active":{color:e.colorPrimaryActive},[`&${n}-btn-loading::before`]:{inset:0}}}},[`${r}-button`]:{height:e.controlHeight,"&:hover, &:focus":{zIndex:1}},"&-large":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightLG}},"&-small":{[`${t}-affix-wrapper, ${r}-button`]:{height:e.controlHeightSM}},"&-rtl":{direction:`rtl`},[`&${t}Line truncated
|
||||
> ${t},
|
||||
${t}-affix-wrapper`]:{"&:hover, &:focus, &:active":{zIndex:2}},[`> ${t}-affix-wrapper-focused`]:{zIndex:2}}}}},O6=e=>{let{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},k6=vo([`Input`,`Shared`],e=>{let t=Ra(e,e6(e));return[C6(t),T6(t)]},t6,{resetFont:!1}),A6=vo([`Input`,`Component`],e=>{let t=Ra(e,e6(e));return[E6(t),D6(t),O6(t),Jf(t)]},t6,{resetFont:!1}),j6={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`},M6=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:j6}))}),N6=(0,s.createContext)(null),P6=function(e){var t=e.activeTabOffset,n=e.horizontal,r=e.rtl,i=e.indicator,a=i===void 0?{}:i,o=a.size,c=a.align,l=c===void 0?`center`:c,u=Z((0,s.useState)(),2),d=u[0],f=u[1],p=(0,s.useRef)(),m=s.useCallback(function(e){return typeof o==`function`?o(e):typeof o==`number`?o:e},[o]);function h(){et.cancel(p.current)}return(0,s.useEffect)(function(){var e={};if(t){if(n){e.width=m(t.width);var i=r?`right`:`left`;l===`start`&&(e[i]=t[i]),l===`center`&&(e[i]=t[i]+t.width/2,e.transform=r?`translateX(50%)`:`translateX(-50%)`),l===`end`&&(e[i]=t[i]+t.width,e.transform=`translateX(-100%)`)}else e.height=m(t.height),l===`start`&&(e.top=t.top),l===`center`&&(e.top=t.top+t.height/2,e.transform=`translateY(-50%)`),l===`end`&&(e.top=t.top+t.height,e.transform=`translateY(-100%)`)}return h(),p.current=et(function(){d&&e&&Object.keys(e).every(function(t){var n=e[t],r=d[t];return typeof n==`number`&&typeof r==`number`?Math.round(n)===Math.round(r):n===r})||f(e)}),h},[JSON.stringify(t),n,r,l,m]),{style:d}},F6={width:0,height:0,left:0,top:0};function I6(e,t,n){return(0,s.useMemo)(function(){for(var n=new Map,r=t.get(e[0]?.key)||F6,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)||F6;var c=n.get(o)||O({},s);c.right=i-c.left-c.width,n.set(o,c)}return n},[e.map(function(e){return e.key}).join(`_`),t,n])}function L6(e,t){var n=s.useRef(e),r=Z(s.useState({}),2)[1];function i(e){var i=typeof e==`function`?e(n.current):e;i!==n.current&&t(i,n.current),n.current=i,r({})}return[n.current,i]}var R6=.1,z6=.01,B6=20,V6=.995**B6;function H6(e,t){var n=Z((0,s.useState)(),2),r=n[0],i=n[1],a=Z((0,s.useState)(0),2),o=a[0],c=a[1],l=Z((0,s.useState)(0),2),u=l[0],d=l[1],f=Z((0,s.useState)(),2),p=f[0],m=f[1],h=(0,s.useRef)();function g(e){var t=e.touches[0];i({x:t.screenX,y:t.screenY}),window.clearInterval(h.current)}function _(e){if(r){var n=e.touches[0],a=n.screenX,s=n.screenY;i({x:a,y:s});var l=a-r.x,u=s-r.y;t(l,u);var f=Date.now();c(f),d(f-o),m({x:l,y:u})}}function v(){if(r&&(i(null),m(null),p)){var e=p.x/u,n=p.y/u;if(Math.max(Math.abs(e),Math.abs(n))<R6)return;var a=e,o=n;h.current=window.setInterval(function(){Math.abs(a)<z6&&Math.abs(o)<z6?window.clearInterval(h.current):(a*=V6,o*=V6,t(a*B6,o*B6))},B6)}}var y=(0,s.useRef)();function b(e){var n=e.deltaX,r=e.deltaY,i=0,a=Math.abs(n),o=Math.abs(r);a===o?i=y.current===`x`?n:r:a>o?(i=n,y.current=`x`):(i=r,y.current=`y`),t(-i,-i)&&e.preventDefault()}var x=(0,s.useRef)(null);x.current={onTouchStart:g,onTouchMove:_,onTouchEnd:v,onWheel:b},s.useEffect(function(){function t(e){x.current.onTouchStart(e)}function n(e){x.current.onTouchMove(e)}function r(e){x.current.onTouchEnd(e)}function i(e){x.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 U6(e){var t=Z((0,s.useState)(0),2),n=t[0],r=t[1],i=(0,s.useRef)(0),a=(0,s.useRef)();return a.current=e,Yt(function(){var e;(e=a.current)==null||e.call(a)},[n]),function(){i.current===n&&(i.current+=1,r(i.current))}}function W6(e){var t=(0,s.useRef)([]),n=Z((0,s.useState)({}),2)[1],r=(0,s.useRef)(typeof e==`function`?e():e),i=U6(function(){var e=r.current;t.current.forEach(function(t){e=t(e)}),t.current=[],r.current=e,n({})});function a(e){t.current.push(e),i()}return[r.current,a]}var G6={width:0,height:0,left:0,top:0,right:0};function K6(e,t,n,r,i,a,o){var c=o.tabs,l=o.tabPosition,u=o.rtl,d,f,p;return[`top`,`bottom`].includes(l)?(d=`width`,f=u?`right`:`left`,p=Math.abs(n)):(d=`height`,f=`top`,p=-n),(0,s.useMemo)(function(){if(!c.length)return[0,0];for(var n=c.length,r=n,i=0;i<n;i+=1){var a=e.get(c[i].key)||G6;if(Math.floor(a[f]+a[d])>Math.floor(p+t)){r=i-1;break}}for(var o=0,s=n-1;s>=0;--s)if((e.get(c[s].key)||G6)[f]<p){o=s+1;break}return o>r?[0,-1]:[o,r]},[e,t,r,i,a,p,l,c.map(function(e){return e.key}).join(`_`),u])}function q6(e){var t;return e instanceof Map?(t={},e.forEach(function(e,n){t[n]
Line truncated
|
||||
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:Q(s(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Q(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:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},Tb=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 ${Q(e.borderRadius)} ${Q(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${Q(e.borderRadius)} ${Q(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Q(e.borderRadius)} ${Q(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Q(e.borderRadius)} 0 0 ${Q(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:a,minHeight:a}}}}}},Eb=e=>{let{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:i,tabsHorizontalItemMargin:a,horizontalItemPadding:o,itemSelectedColor:s,itemColor:c}=e,l=`${t}-tab`;return{[l]:{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:c,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:`none`,transition:`all ${e.motionDurationSlow}`,[`${l}-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}},ho(e)),"&:hover":{color:r},[`&${l}-active ${l}-btn`]:{color:s,textShadow:e.tabsActiveTextShadow},[`&${l}-focus ${l}-btn:focus-visible`]:mo(e),[`&${l}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`},[`&${l}-disabled ${l}-btn, &${l}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${l}-remove ${i}`]:{margin:0,verticalAlign:`middle`},[`${i}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${l} + ${l}`]:{margin:{_skip_check_:!0,value:a}}}},Db=e=>{let{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:i,calc:a}=e;return{[`${t}-rtl`]:{direction:`rtl`,[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Q(e.marginSM)}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Q(e.marginXS)},marginLeft:{_skip_check_:!0,value:Q(a(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-navLine truncated
|
||||
> ${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:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}})},Ib=e=>{let{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:i}=e;return{width:`33.33%`,padding:t,border:0,borderRadius:0,boxShadow:`
|
||||
${Q(i)} 0 0 0 ${n},
|
||||
0 ${Q(i)} 0 0 ${n},
|
||||
${Q(i)} ${Q(i)} 0 0 ${n},
|
||||
${Q(i)} 0 0 0 ${n} inset,
|
||||
0 ${Q(i)} 0 0 ${n} inset;
|
||||
`,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:`relative`,zIndex:1,boxShadow:r}}},Lb=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:`${Q(e.lineWidth)} ${e.lineType} ${a}`,display:`flex`,borderRadius:`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`},uo()),{"& > 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:Q(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:i,lineHeight:Q(e.calc(i).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${Q(e.lineWidth)} ${e.lineType} ${a}`}}})},Rb=e=>Object.assign(Object.assign({margin:`${Q(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:`flex`},uo()),{"&-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},so),"&-description":{color:e.colorTextDescription}}),zb=e=>{let{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:i}=e;return{[`${t}-head`]:{padding:`0 ${Q(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${Q(e.padding)} ${Q(i)}`}}},Bb=e=>{let{componentCls:t}=e;return{overflow:`hidden`,[`${t}-body`]:{userSelect:`none`}}},Vb=e=>{let{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:i,boxShadowTertiary:a,bodyPadding:o,extraColor:s}=e;return{[t]:Object.assign(Object.assign({},co(e)),{position:`relative`,background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:a},[`${t}-head`]:Fb(e),[`${t}-extra`]:{marginInlineStart:`auto`,color:s,fontWeight:`normal`,fontSize:e.fontSize},[`${t}-body`]:{padding:o,borderRadius:`0 0 ${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)}`},[`${t}-grid`]:Ib(e),[`${t}-cover`]:{"> *":{display:`block`,width:`100%`,borderRadius:`${Q(e.borderRadiusLG)} ${Q(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:Lb(e),[`${t}-meta`]:Rb(e)}),[`${t}-bordered`]:{border:`${Q(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:`${Q(e.borderRadiusLG)} ${Q(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`]:zb(e),[`${t}-loading`]:Bb(e),[`${t}-rtl`]:{direction:`rtl`}}},Hb=e=>{let{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:i,headerFontSizeSM:a}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:i,padding:`0 ${Q(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`}}}}},Ub=vo(`Card`,e=>{let t=Ra(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[Vb(t),Hb(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`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:e.bodyPadding??e.paddingLG,headerPadding:e.headerPadding??e.paddingLG})),Wb=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Gb=e=>{let{actionClasses:t,actions:n=[],actionStyle:r}=e;return s.createElement(`ul`,{className:t,style:r},n.map((e,t)=>{let r=`action-${t}`;return s.createElement(`li`,{style:{width:`${100/n.length}%`},key:r},s.createElement(`span`,null,e))}))},Kb=s.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,style:a,extra:o,headStyle:c={},bodyStyle:l={},title:u,loading:d,bordered:
Line truncated
|
||||
${n}:not(${n}-disabled),
|
||||
${t}:not(${t}-disabled)
|
||||
`]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:`rotate(45deg) scale(1) translate(-50%,-50%)`,transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`
|
||||
${n}-checked:not(${n}-disabled),
|
||||
${t}-checked:not(${t}-disabled)
|
||||
`]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:`transparent`}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:`50%`,insetInlineStart:`50%`,width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:`translate(-50%, -50%) scale(1)`,opacity:1,content:`""`}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:`not-allowed`},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:`not-allowed`,pointerEvents:`none`},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:`none`},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function g8(e,t){return h8(Ra(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize}))}var _8=vo(`Checkbox`,(e,{prefixCls:t})=>[g8(t,e)]),v8=s.createContext(null),y8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},b8=s.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,children:a,indeterminate:o=!1,style:c,onMouseEnter:l,onMouseLeave:u,skipGroup:d=!1,disabled:f}=e,p=y8(e,[`prefixCls`,`className`,`rootClassName`,`children`,`indeterminate`,`style`,`onMouseEnter`,`onMouseLeave`,`skipGroup`,`disabled`]),{getPrefixCls:m,direction:g,checkbox:_}=s.useContext(fa),v=s.useContext(v8),{isFormItemInput:y}=s.useContext(Mh),b=s.useContext(ya),x=(v?.disabled||f)??b,S=s.useRef(p.value),C=s.useRef(null),w=R(t,C);s.useEffect(()=>{v?.registerValue(p.value)},[]),s.useEffect(()=>{if(!d)return p.value!==S.current&&(v?.cancelValue(S.current),v?.registerValue(p.value),S.current=p.value),()=>v?.cancelValue(p.value)},[p.value]),s.useEffect(()=>{C.current?.input&&(C.current.input.indeterminate=o)},[o]);let T=m(`checkbox`,n),E=Uc(T),[D,O,k]=_8(T,E),A=Object.assign({},p);v&&!d&&(A.onChange=(...e)=>{p.onChange&&p.onChange.apply(p,e),v.toggleOption&&v.toggleOption({label:a,value:p.value})},A.name=v.name,A.checked=v.value.includes(p.value));let j=(0,h.default)(`${T}-wrapper`,{[`${T}-rtl`]:g===`rtl`,[`${T}-wrapper-checked`]:A.checked,[`${T}-wrapper-disabled`]:x,[`${T}-wrapper-in-form-item`]:y},_?.className,r,i,k,E,O),M=(0,h.default)({[`${T}-indeterminate`]:o},Cu,O),[N,P]=N3(A.onClick);return D(s.createElement(Au,{component:`Checkbox`,disabled:x},s.createElement(`label`,{className:j,style:Object.assign(Object.assign({},_?.style),c),onMouseEnter:l,onMouseLeave:u,onClick:N},s.createElement(M3,Object.assign({},A,{onClick:P,prefixCls:T,className:M,disabled:x,ref:w})),a!=null&&s.createElement(`span`,{className:`${T}-label`},a))))}),x8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},S8=s.forwardRef((e,t)=>{let{defaultValue:n,children:r,options:i=[],prefixCls:a,className:o,rootClassName:c,style:l,onChange:u}=e,d=x8(e,[`defaultValue`,`children`,`options`,`prefixCls`,`className`,`rootClassName`,`style`,`onChange`]),{getPrefixCls:f,direction:p}=s.useContext(fa),[m,g]=s.useState(d.value||n||[]),[_,v]=s.useState([]);s.useEffect(()=>{`value`in d&&g(d.value||[])},[d.value]);let y=s.useMemo(()=>i.map(e=>typeof e==`string`||typeof e==`number`?{label:e,value:e}:e),[i]),b=e=>{v(t=>t.filter(t=>t!==e))},x=e=>{v(t=>[].concat(X(t),[e]))},S=e=>{let t=m.indexOf(e.value),n=X(m);t===-1?n.push(e.value):n.splice(t,1),`value`in d||g(n),u?.(n.filter(e=>_.includes(e)).sort((e,t)=>y.findIndex(t=>t.value===e)-y.findIndex(e=>e.value===t)))},C=f(`checkbox`,a),w=`${C}-group`,T=Uc(C),[E,D,O]=_8(C,T),k=bu(d,[`value`,`disabled`]),A=i.length?y.map(e=>s.createElement(b8,{prefixCls:C,key:e.value.toString(),disabled:`disabled`in e?e.disabled:d.disabled,value:e.value,checked:m.includes(e.value),onChange:e.onChange,className:(0,h.default)(`${w}-item`,e.className),style:e.style,title:e.title,id:e.id,required:e.required},e.label)):r,j=s.useMemo(()=>({toggleOption:S,value:m,disabled:d.disabled,name:d.name,registerValue:x,cancelValue:b}),[S,m,d.disabled,d.name,x,b]),M=(0,h.default)(w,{[`${w}-rtl`]:p===`rtl`},o,c,O,T,D);return E(s.createElement(`div`,Object.assign({className:M,style:l},k,{ref:t}),s.createElement(v8.Provider,{value:j},A)))}),C8=b8;C8.Group=S8,C8.__ANT_CHECKBOX=!0;var w8=(0,s.createContext)({}),T8=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)
Line truncated
|
||||
opacity ${e.motionDurationFast} ${e.motionEaseInOut},
|
||||
transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},Lx=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Q(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),Rx=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},zx=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},co(e)),Lx(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},Rx(e,e.controlHeightSM)),"&-large":Object.assign({},Rx(e,e.controlHeightLG))})}},Bx=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:a,labelColor:o,labelFontSize:s,labelHeight:c,labelColonMarginInlineStart:l,labelColonMarginInlineEnd:u,itemMarginBottom:d}=e;return{[t]:Object.assign(Object.assign({},co(e)),{marginBottom:d,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden,
|
||||
&-hidden${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:e.lineHeight,whiteSpace:`unset`,"> label":{verticalAlign:`middle`,textWrap:`balance`}},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:c,color:o,fontSize:s,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required`]:{"&::before":{display:`inline-block`,marginInlineEnd:e.marginXXS,color:a,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:`none`}}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:l,marginInlineEnd:u},[`&${t}-no-colon::after`]:{content:`"\\a0"`}}},[`${t}-control`]:{"--ant-display":`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`,[`&:has(> ${i}-switch:only-child, > ${i}-rate:only-child)`]:{display:`flex`,alignItems:`center`}}}},[t]:{"&-additional":{display:`flex`,flexDirection:`column`},"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:Yd,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},Vx=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{visibility:`hidden`}}}),Hx=e=>{let{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:`unset`}},[`${t}-col-24${n}-label,
|
||||
${t}-col-xl-24${n}-label`]:Vx(e)}}},Ux=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[`${n}-inline`]:{flex:`none`,marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:`nowrap`},[`> ${n}-label,
|
||||
> ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},Wx=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:Vx(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:`wrap`,[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}}},Gx=e=>{let{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:`column`},[`${n}-label > label`]:{height:`auto`},[`${n}-control`]:{width:`100%`},[`${n}-label,
|
||||
${r}-col-24${n}-label,
|
||||
${r}-col-xl-24${n}-label`]:Vx(e)},[`@media (max-width: ${Q(e.screenXSMax)})`]:[Wx(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:Vx(e)}}}],[`@media (max-width: ${Q(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:Vx(e)}}},[`@media (max-width: ${Q(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:Vx(e)}}},[`@media (max-width: ${Q(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:Vx(e)}}}}},Kx=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),qx=(e,t)=>Ra(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),Jx=vo(`Form`,(e,{rootPrefixCls:t})=>{let n=qx(e,t);return[zx(n),Bx(n),Ix(n),Hx(n),Ux(n),Gx(n),wd(n),Yd]},Kx,{order:-1e3}),Yx=[];function Xx(e,t,n,r=0){return{key:typeof e==`string`?e:`${t}-${r}`,error:e,errorStatus:n}}var Zx=({help:e,helpStatus:t,errors:n=Yx,warnings:r=Yx,className:i,fieldId:a,onVisibleChanged:o})=>{let{prefixCls:c}=s.useContext(jh),l=`${c}-item-explain`,u=Uc(c),[d,f,p]=Jx(c,u),m=s.useMemo(()=>vu(c),[c]),g=Fx(n),_=Fx(r),v=s.useMemo(()=>e==null?[].concat(X(g.map((e,t)=>Xx(e,`error`,`error`,t))),X(_.map((e,t)=>Xx(e,`warning`,`warning`,t)))):[Xx(e,`help`,t)],[e,t,g,_]),y=s.useMemo(()=>{let e={};return v.forEach(({key:t})=>{e[t]=(e[t]||0)+1}),v.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?`${t.key}-fallback-${n}`:t.key}))},[v]),b={};return a&&(b.id=`${a}_help`),d(s.createElement(ys,{motionDeadline:m.motionDeadline,motionName:`${c}-show-help`,visible:!!y.length,onVisibleChanged:o},e=>{let{className:t,style:n}=e;return s.createElement(`div`,Object.assign({},b,{className:(0,h.default)(l,t,p,u,i,f),style:n}),s.createElement(vs,Object.assign({keys:y},vu(c),{motionName:`${c}-show-help-item`,component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:i,style:a}=e;return s.createElement(`div`,{key:t,className:(0,h.default)(i,{[`${l}-${r}`]:r}),style:a},n)}))}))},Qx=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},$x=s.forwardRef((e,t)=>{let n=s.useContext(ya),{getPrefixCls:r,direction:i,requiredMark:a,colon:o,scrollToFirstError:c,className:l,style:u}=ha(`form`),{prefixCls:d,className:f,rootClassName:p,size:m,disabled:g=n,form:_,colon:v,labelAlign:y,labelWrap:b,labelCol:x,wrapperCol:S,hideRequiredMark:C,layout:w=`horizontal`,scrollToFirstError:T,requiredMark:E,onFinishFailed:D,name:O,style:k,feedbackIcons:A,variant:j}=e,M=Qx(e,[`prefixCls`,`className`,`rootClassName`,`size`,`disabled`,`form`,`colon`,`labelAlign`,`labelWrap`,`labelCol`,`wrapperCol`,`hideRequiredMark`,`layout`,`scrollToFirstError`,`requiredMark`,`onFinishFailed`,`name`,`style`,`feedbackIcons`,`variant`]),N=ju(m),P=s.useContext(Rr),F=s.useMemo(()=>E===void 0?C?!1:a===void 0||a:E,[C,E,a]),I=v??o,L=r(`form`,d),R=Uc(L),[z,B,V]=Jx(L,R),H=(0,h.default)(L,`${L}-${w}`,{[`${L}-hide-required-mark`]:F===!1,[`${L}-rtl`]:i===`rtl`,[`${L}-${N}`]:N},V,R,B,l,f,p),[U]=J3(_),{__INTERNAL__:W}=U;W.name=O;let G=s.useMemo(()=>({name:O,labelAlign:y,labelCol:x,labelWrap:b,wrapperCol:S,layout:w,colon:I,requiredMark:F,itemRef:W.itemRef,form:U,feedbackIcons:A}),[O,y,x,S,w,I,F,U,A]),K=s.useRef(null);s.useImperativeHandle(t,()=>Object.assign(Object.assign({},U),{nativeElement:K.current?.nativeElement}));let q=(e,t)=>{if(e){let n={block:`nearest`};typeof e==`object`&&(n=Object.assign(Object.assign({},n),e)),U.scrollToField(t,n)}};return z(s.createElement(Ph.Provider,{value:j},s.createElement(ba,{disabled:g},s.createElement(xa.Provider,{value:N},s.createElement(Ah,{validateMessages:P},s.createElement(Oh.Provider,{value:G},s.createElement(Nh,{status:!0},s.createElement(Dh,Object.assign({id:O},M,{name:O,onFinishFailed:e=>{if(D?.(e),e.errorFields.length){let t=e.errorFields[0].name;if(T!==void 0){q(T,t);return}c!==void 0&&q(c,t)}},form:U,ref:K,style:Object.assign(Object.assign({},u),k),className:H})))))))))});function e5(e){if(typeof e==`function`)return e;let t=g(e);return t.length<=1?t[0]:t}var t5=()=>{let{status:e,errors:t=[],warnings:n=[]}=s.useContext(Mh);return{status:e,errors:t,warnings:n}};t5.Context=Mh;function n5(e){let[t,n]=s.useState(e),r=s.useRef(null),i=s.useRef([]),a=s.useRef(!1);s.useEffect(()=>(a.current=!1,()=>{a.current=!0,et.cancel(r.current),r.current=null}),[]);function o(e){a.current||(r.current===null&&(i.current=[],r.current=et(()=>{r.current=null,n(e=>{let t=e;return i.current.forEach(e=>{t=e(t)}),t})})),i.current.push(e))}return[t,o]}function r5
Line truncated
|
||||
min-height:0 !important;
|
||||
max-height:none !important;
|
||||
height:0 !important;
|
||||
visibility:hidden !important;
|
||||
overflow:hidden !important;
|
||||
position:absolute !important;
|
||||
z-index:-1000 !important;
|
||||
top:0 !important;
|
||||
right:0 !important;
|
||||
pointer-events: none !important;
|
||||
`,q5=[`letter-spacing`,`line-height`,`padding-top`,`padding-bottom`,`font-family`,`font-weight`,`font-size`,`font-variant`,`text-rendering`,`text-transform`,`width`,`text-indent`,`padding-left`,`padding-right`,`border-width`,`box-sizing`,`word-break`,`white-space`],J5={},Y5;function X5(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.getAttribute(`id`)||e.getAttribute(`data-reactid`)||e.getAttribute(`name`);if(t&&J5[n])return J5[n];var r=window.getComputedStyle(e),i=r.getPropertyValue(`box-sizing`)||r.getPropertyValue(`-moz-box-sizing`)||r.getPropertyValue(`-webkit-box-sizing`),a=parseFloat(r.getPropertyValue(`padding-bottom`))+parseFloat(r.getPropertyValue(`padding-top`)),o=parseFloat(r.getPropertyValue(`border-bottom-width`))+parseFloat(r.getPropertyValue(`border-top-width`)),s={sizingStyle:q5.map(function(e){return`${e}:${r.getPropertyValue(e)}`}).join(`;`),paddingSize:a,borderSize:o,boxSizing:i};return t&&n&&(J5[n]=s),s}function Z5(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Y5||(Y5=document.createElement(`textarea`),Y5.setAttribute(`tab-index`,`-1`),Y5.setAttribute(`aria-hidden`,`true`),Y5.setAttribute(`name`,`hiddenTextarea`),document.body.appendChild(Y5)),e.getAttribute(`wrap`)?Y5.setAttribute(`wrap`,e.getAttribute(`wrap`)):Y5.removeAttribute(`wrap`);var i=X5(e,t),a=i.paddingSize,o=i.borderSize,s=i.boxSizing,c=i.sizingStyle;Y5.setAttribute(`style`,`${c};${K5}`),Y5.value=e.value||e.placeholder||``;var l=void 0,u=void 0,d,f=Y5.scrollHeight;if(s===`border-box`?f+=o:s===`content-box`&&(f-=a),n!==null||r!==null){Y5.value=` `;var p=Y5.scrollHeight-a;n!==null&&(l=p*n,s===`border-box`&&(l=l+a+o),f=Math.max(l,f)),r!==null&&(u=p*r,s===`border-box`&&(u=u+a+o),d=f>u?``:`hidden`,f=Math.min(u,f))}var m={height:f,overflowY:d,resize:`none`};return l&&(m.minHeight=l),u&&(m.maxHeight=u),m}var Q5=[`prefixCls`,`defaultValue`,`value`,`autoSize`,`onResize`,`className`,`style`,`disabled`,`onChange`,`onInternalAutoSize`],$5=0,e7=1,t7=2,n7=s.forwardRef(function(e,t){var n=e,r=n.prefixCls,i=n.defaultValue,a=n.value,o=n.autoSize,u=n.onResize,d=n.className,f=n.style,p=n.disabled,m=n.onChange;n.onInternalAutoSize;var g=bt(n,Q5),_=Z(Pa(i,{value:a,postState:function(e){return e??``}}),2),v=_[0],y=_[1],b=function(e){y(e.target.value),m?.(e)},x=s.useRef();s.useImperativeHandle(t,function(){return{textArea:x.current}});var S=Z(s.useMemo(function(){return o&&l(o)===`object`?[o.minRows,o.maxRows]:[]},[o]),2),C=S[0],w=S[1],T=!!o,D=Z(s.useState(t7),2),k=D[0],A=D[1],j=Z(s.useState(),2),M=j[0],N=j[1],P=function(){A($5)};Jt(function(){T&&P()},[a,C,w,T]),Jt(function(){if(k===$5)A(e7);else if(k===e7){var e=Z5(x.current,!1,C,w);A(t7),N(e)}},[k]);var F=s.useRef(),I=function(){et.cancel(F.current)},L=function(e){k===t7&&(u?.(e),o&&(I(),F.current=et(function(){P()})))};s.useEffect(function(){return I},[]);var R=T?M:null,z=O(O({},f),R);return(k===$5||k===e7)&&(z.overflowY=`hidden`,z.overflowX=`hidden`),s.createElement(We,{onResize:L,disabled:!(o||u)},s.createElement(`textarea`,c({},g,{ref:x,style:z,className:(0,h.default)(r,d,E({},`${r}-disabled`,p)),disabled:p,value:v,onChange:b})))}),r7=[`defaultValue`,`value`,`onFocus`,`onBlur`,`onChange`,`allowClear`,`maxLength`,`onCompositionStart`,`onCompositionEnd`,`suffix`,`prefixCls`,`showCount`,`count`,`className`,`style`,`disabled`,`hidden`,`classNames`,`styles`,`onResize`,`onClear`,`onPressEnter`,`readOnly`,`autoSize`,`onKeyDown`],i7=s.forwardRef(function(e,t){var n=e.defaultValue,r=e.value,i=e.onFocus,a=e.onBlur,o=e.onChange,l=e.allowClear,u=e.maxLength,d=e.onCompositionStart,f=e.onCompositionEnd,p=e.suffix,m=e.prefixCls,g=m===void 0?`rc-textarea`:m,_=e.showCount,v=e.count,y=e.className,b=e.style,x=e.disabled,S=e.hidden,C=e.classNames,w=e.styles,T=e.onResize,D=e.onClear,k=e.onPressEnter,A=e.readOnly,j=e.autoSize,M=e.onKeyDown,N=bt(e,r7),P=Z(Pa(n,{value:r,defaultValue:n}),2),F=P[0],I=P[1],L=F==null?``:String(F),R=Z(s.useState(!1),2),z=R[0],B=R[1],V=s.useRef(!1),H=Z(s.useState(null),2),U=H[0],W=H[1],G=(0,s.useRef)(null),K=(0,s.useRef)(null),q=function(){return K.current?.textArea},ee=function(){q().focus()};(0,s.useImperativeHandle)(t,function(){return{resizableTextArea:K.current,focus:ee,blur:function(){q().blur()},nativeElement:G.current?.nativeElement||q()}}),(0,s.useEffect)(function(){B(function(e){return!x&&e})},[x]);var J=Z(s.useState(null),2),te=J[0],ne=J[1];s.useEffect(function(){if(te){var e;(e=q()).setSelectionRange.apply(e,X(te))}},[te]);var re=V8(v,_),ie=re.max??u,ae=Number(ie)>0,oe=re.strategy(L),se=!!ie&&oe>ie,ce=function(e,t){var n=t;!V.current&&re.exceedFormatter&&re.max&&re.strategy(t)>re.max&&(n=re.exceedFormatter(t,{max:re.max}),t!==n&&ne([q().selectionStart||0,q().selectionEnd||0])),I(n),L8(e.currentTarget,e,o,n)},le=function(e){V.current=!0,d?.(e)},ue=function(e){V.current=!1,ce(e,e.currentTarget.value),f?.(e)},de=funct
Line truncated
|
||||
&-allow-clear > ${t},
|
||||
&-affix-wrapper${r}-has-feedback ${t}
|
||||
`]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:`inherit`,border:`none`,outline:`none`,background:`transparent`,minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:`none !important`}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:`absolute`,insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:`absolute`,top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:`inline-flex`,alignItems:`center`,margin:`auto`,pointerEvents:`none`}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:`ltr`,insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},o7=vo([`Input`,`TextArea`],e=>a7(Ra(e,e6(e))),t6,{resetFont:!1}),s7=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},c7=(0,s.forwardRef)((e,t)=>{let{prefixCls:n,bordered:r=!0,size:i,disabled:a,status:o,allowClear:c,classNames:l,rootClassName:u,className:d,style:f,styles:p,variant:m,showCount:g,onMouseDown:_,onResize:v}=e,y=s7(e,[`prefixCls`,`bordered`,`size`,`disabled`,`status`,`allowClear`,`classNames`,`rootClassName`,`className`,`style`,`styles`,`variant`,`showCount`,`onMouseDown`,`onResize`]),{getPrefixCls:b,direction:x,allowClear:S,autoComplete:C,className:w,style:T,classNames:E,styles:D}=ha(`textArea`),O=s.useContext(ya),k=a??O,{status:A,hasFeedback:j,feedbackIcon:M}=s.useContext(Mh),N=Sv(A,o),P=s.useRef(null);s.useImperativeHandle(t,()=>({resizableTextArea:P.current?.resizableTextArea,focus:e=>{R8(P.current?.resizableTextArea?.textArea,e)},blur:()=>P.current?.blur()}));let F=b(`input`,n),I=Uc(F),[L,R,z]=k6(F,u),[B]=o7(F,I),{compactSize:V,compactItemClassnames:H}=Iu(F,x),U=ju(e=>i??V??e),[W,G]=Mv(`textArea`,m,r),K=W8(c??S),[q,ee]=s.useState(!1),[J,te]=s.useState(!1),ne=e=>{ee(!0),_?.(e);let t=()=>{ee(!1),document.removeEventListener(`mouseup`,t)};document.addEventListener(`mouseup`,t)},re=e=>{if(v?.(e),q&&typeof getComputedStyle==`function`){let e=(P.current?.nativeElement)?.querySelector(`textarea`);e&&getComputedStyle(e).resize===`both`&&te(!0)}};return L(B(s.createElement(i7,Object.assign({autoComplete:C},y,{style:Object.assign(Object.assign({},T),f),styles:Object.assign(Object.assign({},D),p),disabled:k,allowClear:K,className:(0,h.default)(z,I,d,u,H,w,J&&`${F}-textarea-affix-wrapper-resize-dirty`),classNames:Object.assign(Object.assign(Object.assign({},l),E),{textarea:(0,h.default)({[`${F}-sm`]:U===`small`,[`${F}-lg`]:U===`large`},R,l?.textarea,E.textarea,q&&`${F}-mouse-active`),variant:(0,h.default)({[`${F}-${W}`]:G},xv(F,N)),affixWrapper:(0,h.default)(`${F}-textarea-affix-wrapper`,{[`${F}-affix-wrapper-rtl`]:x===`rtl`,[`${F}-affix-wrapper-sm`]:U===`small`,[`${F}-affix-wrapper-lg`]:U===`large`,[`${F}-textarea-show-count`]:g||e.count?.show},R)}),prefixCls:F,suffix:j&&s.createElement(`span`,{className:`${F}-textarea-suffix`},M),showCount:g,ref:P,onResize:re,onMouseDown:ne}))))}),l7=J8;l7.Group=k5,l7.Search=G5,l7.TextArea=c7,l7.Password=U5,l7.OTP=L5;var u7={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z`}}]},name:`double-left`,theme:`outlined`},d7=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:u7}))}),f7={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z`}}]},name:`double-right`,theme:`outlined`},p7=s.forwardRef(function(e,t){return s.createElement(ec,c({},e,{ref:t,icon:f7}))}),m7={items_per_page:`条/页`,jump_to:`跳至`,jump_to_confirm:`确定`,page:`页`,prev_page:`上一页`,next_page:`下一页`,prev_5:`向前 5 页`,next_5:`向后 5 页`,prev_3:`向前 3 页`,next_3:`向后 3 页`,page_size:`页码`},h7=[10,20,50,100],g7=function(e){var t=e.pageSizeOptions,n=t===void 0?h7:t,r=e.locale,i=e.changeSize,a=e.pageSize,o=e.goButton,c=
Line truncated
|
||||
&${t}-mini ${t}-prev ${t}-item-link,
|
||||
&${t}-mini ${t}-next ${t}-item-link
|
||||
`]:{backgroundColor:`transparent`,borderColor:`transparent`,"&::after":{height:e.itemSizeSM,lineHeight:Q(e.itemSizeSM)}},[`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]:{height:e.itemSizeSM,marginInlineEnd:0,lineHeight:Q(e.itemSizeSM)},[`&${t}-mini ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-size-changer":{top:e.miniOptionsSizeChangerTop},"&-quick-jumper":{height:e.itemSizeSM,lineHeight:Q(e.itemSizeSM),input:Object.assign(Object.assign({},b6(e)),{width:e.paginationMiniQuickJumperInputWidth,height:e.controlHeightSM})}}}},T7=e=>{let{componentCls:t}=e;return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSize,lineHeight:Q(e.itemSize),verticalAlign:`top`,[`${t}-item-link`]:{height:e.itemSize,backgroundColor:`transparent`,border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:e.itemSize,lineHeight:Q(e.itemSize)}}},[`${t}-simple-pager`]:{display:`inline-flex`,alignItems:`center`,height:e.itemSize,marginInlineEnd:e.marginXS,input:{boxSizing:`border-box`,height:`100%`,width:e.quickJumperInputWidth,padding:`0 ${Q(e.paginationItemPaddingInline)}`,textAlign:`center`,backgroundColor:e.itemInputBg,border:`${Q(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:`none`,transition:`border-color ${e.motionDurationMid}`,color:`inherit`,"&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${Q(e.inputOutlineOffset)} 0 ${Q(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:`not-allowed`}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:`transparent`}}}},[`&${t}-mini`]:{[`${t}-prev, ${t}-next`]:{height:e.itemSizeSM,lineHeight:Q(e.itemSizeSM),[`${t}-item-link`]:{height:e.itemSizeSM,"&::after":{height:e.itemSizeSM,lineHeight:Q(e.itemSizeSM)}}},[`${t}-simple-pager`]:{height:e.itemSizeSM,input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},E7=e=>{let{componentCls:t}=e;return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:`relative`,[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:`auto`}},[`${t}-item-ellipsis`]:{position:`absolute`,top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:`block`,margin:`auto`,color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:`center`,textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[`
|
||||
${t}-prev,
|
||||
${t}-jump-prev,
|
||||
${t}-jump-next
|
||||
`]:{marginInlineEnd:e.marginXS},[`
|
||||
${t}-prev,
|
||||
${t}-next,
|
||||
${t}-jump-prev,
|
||||
${t}-jump-next
|
||||
`]:{display:`inline-block`,minWidth:e.itemSize,height:e.itemSize,color:e.colorText,fontFamily:e.fontFamily,lineHeight:Q(e.itemSize),textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,borderRadius:e.borderRadius,cursor:`pointer`,transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:`pointer`,userSelect:`none`},[`${t}-item-link`]:{display:`block`,width:`100%`,height:`100%`,padding:0,fontSize:e.fontSizeSM,textAlign:`center`,backgroundColor:`transparent`,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:`none`,transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:`transparent`}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:`inline-block`,marginInlineStart:e.margin,verticalAlign:`middle`,"&-size-changer":{display:`inline-block`,width:`auto`},"&-quick-jumper":{display:`inline-block`,height:e.controlHeight,marginInlineStart:e.marginXS,lineHeight:Q(e.controlHeight),verticalAlign:`top`,input:Object.assign(Object.assign(Object.assign({},x6(e)),i6(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow})),{"&[disabled]":Object.assign({},r6(e)),width:e.quickJumperInputWidth,height:e.controlHeight,boxSizing:`border-box`,margin:0,marginInlineStart:e.marginXS,marginInlineEnd:e.marginXS})}}}},D7=e=>{let{componentCls:t}=e;return{[`${t}-item`]:{display:`inline-block`,minWidth:e.itemSize,height:e.itemSize,marginInlineEnd:e.marginXS,fontFamily:e.fontFamily,lineHeight:Q(e.calc(e.itemSize).sub(2).equal()),textAlign:`center`,verticalAlign:`middle`,listStyle:`none`,backgroundColor:e.itemBg,border:`${Q(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:`pointer`,userSelect:`none`,a:{display:`block`,padding:`0 ${Q(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:`none`}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.itemActiveColor},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.itemActiveColorHover}}}}},O7=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},co(e)),{display:`flex`,flexWrap:`wrap`,rowGap:e.paddingXS,"&-start":{justifyContent:`start`},"&-center":{justifyContent:`center`},"&-end":{justifyContent:`end`},"ul, ol":{margin:0,padding:0,listStyle:`none`},"&::after":{display:`block`,clear:`both`,height:0,overflow:`hidden`,visibility:`hidden`,content:`""`},[`${t}-total-text`]:{display:`inline-block`,height:e.itemSize,marginInlineEnd:e.marginXS,lineHeight:Q(e.calc(e.itemSize).sub(2).equal()),verticalAlign:`middle`}}),D7(e)),E7(e)),T7(e)),w7(e)),C7(e)),{[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:`none`}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:`none`}}}),[`&${e.componentCls}-rtl`]:{direction:`rtl`}}},k7=e=>{let{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:Object.assign({},ho(e)),[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":Object.assign({[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}},mo(e))},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:mo(e)}}}},A7=e=>Object.assign({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemActiveBg:e.colorBgContainer,itemActiveColor:e.colorPrimary,itemActiveColorHover:e.colorPrimaryHover,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0},t6(e)),j7=e=>Ra(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:`0.13em`},e6(e)),M7=vo(`Pagination`,e=>{let t=j7(e);return[O7(t),k7(t)]},A7),N7=e=>{let{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled:not(${t}-mini)`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:
Line truncated
|
||||
${Q(c(c(i).add(n)).mul(-1).equal())}`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:Object.assign(Object.assign(Object.assign({[`> ${t}-title`]:{border:l,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:l,borderTop:l,[`
|
||||
> ${t}-content,
|
||||
> ${t}-header,
|
||||
> ${t}-body,
|
||||
> ${t}-summary
|
||||
`]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:l},"> thead":{"> tr:not(:last-child) > th":{borderBottom:l},"> tr > th::before":{backgroundColor:`transparent !important`}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:l}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${Q(c(o).mul(-1).equal())} ${Q(c(c(s).add(n)).mul(-1).equal())}`,"&::after":{position:`absolute`,top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:l,content:`""`}}}}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[`
|
||||
> tr${t}-expanded-row,
|
||||
> tr${t}-placeholder
|
||||
`]:{"> th, > td":{borderInlineEnd:0}}}}}},u(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle)),u(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall)),{[`> ${t}-footer`]:{border:l,borderTop:0}}),[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${Q(n)} 0 ${Q(n)} ${a}`}},[`${t}-bordered ${t}-cell-scrollbar`]:{borderInlineEnd:l}}}},KT=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:Object.assign(Object.assign({},so),{wordBreak:`keep-all`,[`
|
||||
&${t}-cell-fix-left-last,
|
||||
&${t}-cell-fix-right-first
|
||||
`]:{overflow:`visible`,[`${t}-cell-content`]:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`}},[`${t}-column-title`]:{overflow:`hidden`,textOverflow:`ellipsis`,wordBreak:`keep-all`}})}}},qT=e=>{let{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:`center`,color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},JT=e=>{let{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:i,paddingXS:a,lineType:o,tableBorderColor:s,tableExpandIconBg:c,tableExpandColumnWidth:l,borderRadius:u,tablePaddingVertical:d,tablePaddingHorizontal:f,tableExpandedRowBg:p,paddingXXS:m,expandIconMarginTop:h,expandIconSize:g,expandIconHalfInner:_,expandIconScale:v,calc:y}=e,b=`${Q(i)} ${o} ${s}`,x=y(m).sub(i).equal();return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:l},[`${t}-row-expand-icon-cell`]:{textAlign:`center`,[`${t}-row-expand-icon`]:{display:`inline-flex`,float:`none`,verticalAlign:`sub`}},[`${t}-row-indent`]:{height:1,float:`left`},[`${t}-row-expand-icon`]:Object.assign(Object.assign({},_o(e)),{position:`relative`,float:`left`,width:g,height:g,color:`inherit`,lineHeight:Q(g),background:c,border:b,borderRadius:u,transform:`scale(${v})`,"&:focus, &:hover, &:active":{borderColor:`currentcolor`},"&::before, &::after":{position:`absolute`,background:`currentcolor`,transition:`transform ${r} ease-out`,content:`""`},"&::before":{top:_,insetInlineEnd:x,insetInlineStart:x,height:i},"&::after":{top:x,bottom:x,insetInlineStart:_,width:i,transform:`rotate(90deg)`},"&-collapsed::before":{transform:`rotate(-180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`},"&-spaced":{"&::before, &::after":{display:`none`,content:`none`},background:`transparent`,border:0,visibility:`hidden`}}),[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:h,marginInlineEnd:a},[`tr${t}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:p}},[`${n}-descriptions-view`]:{display:`flex`,table:{flex:`auto`,width:`100%`}}},[`${t}-expanded-row-fixed`]:{position:`relative`,margin:`${Q(y(d).mul(-1).equal())} ${Q(y(f).mul(-1).equal())}`,padding:`${Q(d)} ${Q(f)}`}}}},YT=e=>{let{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:i,tableFilterDropdownSearchWidth:a,paddingXXS:o,paddingXS:s,colorText:c,lineWidth:l,lineType:u,tableBorderColor:d,headerIconColor:f,fontSizeSM:p,tablePaddingHorizontal:m,borderRadius:h,motionDurationSlow:g,colorIcon:_,colorPrimary:v,tableHeaderFilterActiveBg:y,colorTextDisabled:b,tableFilterDropdownBg:x,tableFilterDropdownHeight:S,controlItemBgHover:C,controlItemBgActive:w,boxShadowSecondary:T,filterDropdownMenuBg:E,calc:D}=e,O=`${n}-dropdown`,k=`${t}-filter-dropdown`,A=`${n}-tree`,j=`${Q(l)} ${u} ${d}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:`flex`,justifyContent:`space-between`},[`${t}-filter-trigger`]:{position:`relative`,display:`flex`,alignItems:`center`,marginBlock:D(o).mul(-1).equal(),marginInline:`${Q(o)} ${Q(D(m).div(2).mul(-1).equal())}`,padding:`0 ${Q(o)}`,color:f,fontSize:p,borderRadius:h,cursor:`pointer`,transition:`all ${g}`,"&:hover":{color:_,background:y},"&.active":{color:v}}}},{[`${n}-dropdown`]:{[k]:Object.assign(Object.assign({},co(e)),{minWidth:i,backgroundColor:x,borderRadius:h,boxShadow:T,overflow:`hidden`,[`${O}-menu`]:{maxHeight:S,overflowX:`hidden`,border:0,boxShadow:`none`,borderRadius:`unset`,backgroundColor:E,"&:empty::after":{display:`block`,padding:`${Q(s)} 0`,color:b,fontSize:p,textAlign:`center`,content:`"Not Found"`}},[`${k}-tree`]:{paddingBlock:`${Q(s)} 0`,paddingInline:s,[A]:{padding:0},[`${A}-treenode ${A}-node-content-wrapper:hover`]:{backgroundColor:C},[`${A}-treenode-checkbox-checked ${A}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:w}}},[`${k}-search`]:{padding:s,borderBottom:j,"&-input":{input:{minWidth:a},[r]:{color:b}}},[`${k}-checkall`]:{width:`100%`,marginBottom:o,marginInlineStart:o},[`${k}-btns`]:{display:`flex`,justifyContent:`space-between`,padding:`${Q(D(s).sub(l).equal())} ${Q(s)}`,overflow:`hidden`,borderTop:j}})}},{[`${n}-dropdown ${k}, ${k}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:s,color:c},"> ul":{maxHeight:`calc(100vh - 130px)`,overflowX:`hidden`,overflowY:`auto`}}}]},XT=e=>{let{componentCls:t,lineWidth:n,colorSplit:r,motionDurationSlow:i,zIndexTableFixed:a,tableBg:o,zIndexTableSticky:s,calc:c}=e,l=r;return{[`${t}-wrapper`]:{[`
|
||||
${t}-cell-fix-left,
|
||||
${t}-cell-fix-right
|
||||
`]:{position:`sticky !important`,zIndex:a,background:o},[`
|
||||
${t}-cell-fix-left-first::after,
|
||||
${t}-cell-fix-left-last::after
|
||||
`]:{position:`absolute`,top:0,right:{_skip_check_:!0,value:0},bottom:c(n).mul(-1).equal(),width:30,transform:`translateX(100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`,willChange:`transform`},[`${t}-cell-fix-left-all::after`]:{display:`none`},[`
|
||||
${t}-cell-fix-right-first::after,
|
||||
${t}-cell-fix-right-last::after
|
||||
`]:{position:`absolute`,top:0,bottom:c(n).mul(-1).equal(),left:{_skip_check_:!0,value:0},width:30,transform:`translateX(-100%)`,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},[`${t}-container`]:{position:`relative`,"&::before, &::after":{position:`absolute`,top:0,bottom:0,zIndex:c(s).add(1).equal({unit:!1}),width:30,transition:`box-shadow ${i}`,content:`""`,pointerEvents:`none`},"&::before":{insetInlineStart:0},"&::after":{insetInlineEnd:0}},[`${t}-ping-left`]:{[`&:not(${t}-has-fix-left) ${t}-container::before`]:{boxShadow:`inset 10px 0 8px -8px ${l}`},[`
|
||||
${t}-cell-fix-left-first::after,
|
||||
${t}-cell-fix-left-last::after
|
||||
`]:{boxShadow:`inset 10px 0 8px -8px ${l}`},[`${t}-cell-fix-left-last::before`]:{backgroundColor:`transparent !important`}},[`${t}-ping-right`]:{[`&:not(${t}-has-fix-right) ${t}-container::after`]:{boxShadow:`inset -10px 0 8px -8px ${l}`},[`
|
||||
${t}-cell-fix-right-first::after,
|
||||
${t}-cell-fix-right-last::after
|
||||
`]:{boxShadow:`inset -10px 0 8px -8px ${l}`}},[`${t}-fixed-column-gapped`]:{[`
|
||||
${t}-cell-fix-left-first::after,
|
||||
${t}-cell-fix-left-last::after,
|
||||
${t}-cell-fix-right-first::after,
|
||||
${t}-cell-fix-right-last::after
|
||||
`]:{boxShadow:`none`}}}}},ZT=e=>{let{componentCls:t,antCls:n,margin:r}=e;return{[`${t}-wrapper ${t}-pagination${n}-pagination`]:{margin:`${Q(r)} 0`}}},QT=e=>{let{componentCls:t,tableRadius:n}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${Q(n)} ${Q(n)} 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,[`${t}-header, table`]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:`0 0 ${Q(n)} ${Q(n)}`}}}}},$T=e=>{let{componentCls:t}=e;return{[`${t}-wrapper-rtl`]:{direction:`rtl`,table:{direction:`rtl`},[`${t}-pagination-left`]:{justifyContent:`flex-end`},[`${t}-pagination-right`]:{justifyContent:`flex-start`},[`${t}-row-expand-icon`]:{float:`right`,"&::after":{transform:`rotate(-90deg)`},"&-collapsed::before":{transform:`rotate(180deg)`},"&-collapsed::after":{transform:`rotate(0deg)`}},[`${t}-container`]:{"&::before":{insetInlineStart:`unset`,insetInlineEnd:0},"&::after":{insetInlineStart:0,insetInlineEnd:`unset`},[`${t}-row-indent`]:{float:`right`}}}}},eE=e=>{let{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:i,padding:a,paddingXS:o,headerIconColor:s,headerIconHoverColor:c,tableSelectionColumnWidth:l,tableSelectedRowBg:u,tableSelectedRowHoverBg:d,tableRowHoverBg:f,tablePaddingHorizontal:p,calc:m}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:l,[`&${t}-selection-col-with-dropdown`]:{width:m(l).add(i).add(m(a).div(4)).equal()}},[`${t}-bordered ${t}-selection-col`]:{width:m(l).add(m(o).mul(2)).equal(),[`&${t}-selection-col-with-dropdown`]:{width:m(l).add(i).add(m(a).div(4)).add(m(o).mul(2)).equal()}},[`
|
||||
table tr th${t}-selection-column,
|
||||
table tr td${t}-selection-column,
|
||||
${t}-selection-column
|
||||
`]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:`center`,[`${n}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:m(e.zIndexTableFixed).add(1).equal({unit:!1})},[`table tr th${t}-selection-column::after`]:{backgroundColor:`transparent !important`},[`${t}-selection`]:{position:`relative`,display:`inline-flex`,flexDirection:`column`},[`${t}-selection-extra`]:{position:`absolute`,top:0,zIndex:1,cursor:`pointer`,transition:`all ${e.motionDurationSlow}`,marginInlineStart:`100%`,paddingInlineStart:Q(m(p).div(4).equal()),[r]:{color:s,fontSize:i,verticalAlign:`baseline`,"&:hover":{color:c}}},[`${t}-tbody`]:{[`${t}-row`]:{[`&${t}-row-selected`]:{[`> ${t}-cell`]:{background:u,"&-row-hover":{background:d}}},[`> ${t}-cell-row-hover`]:{background:f}}}}}},tE=e=>{let{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,i=(e,i,a,o)=>({[`${t}${t}-${e}`]:{fontSize:o,[`
|
||||
${t}-title,
|
||||
${t}-footer,
|
||||
${t}-cell,
|
||||
${t}-thead > tr > th,
|
||||
${t}-tbody > tr > th,
|
||||
${t}-tbody > tr > td,
|
||||
tfoot > tr > th,
|
||||
tfoot > tr > td
|
||||
`]:{padding:`${Q(i)} ${Q(a)}`},[`${t}-filter-trigger`]:{marginInlineEnd:Q(r(a).div(2).mul(-1).equal())},[`${t}-expanded-row-fixed`]:{margin:`${Q(r(i).mul(-1).equal())} ${Q(r(a).mul(-1).equal())}`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:Q(r(i).mul(-1).equal()),marginInline:`${Q(r(n).sub(a).equal())} ${Q(r(a).mul(-1).equal())}`}},[`${t}-selection-extra`]:{paddingInlineStart:Q(r(a).div(4).equal())}}});return{[`${t}-wrapper`]:Object.assign(Object.assign({},i(`middle`,e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle)),i(`small`,e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall))}},nE=e=>{let{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:i,headerIconHoverColor:a}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:`none`,cursor:`pointer`,transition:`all ${e.motionDurationSlow}, left 0s`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:`transparent !important`}},"&:focus-visible":{color:e.colorPrimary},[`
|
||||
&${t}-cell-fix-left:hover,
|
||||
&${t}-cell-fix-right:hover
|
||||
`]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:`transparent !important`}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:`relative`,zIndex:1,flex:1,minWidth:0},[`${t}-column-sorters`]:{display:`flex`,flex:`auto`,alignItems:`center`,justifyContent:`space-between`,"&::after":{position:`absolute`,inset:0,width:`100%`,height:`100%`,content:`""`}},[`${t}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:`none`}},[`${t}-column-sorter`]:{marginInlineStart:n,color:i,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:`inline-flex`,flexDirection:`column`,alignItems:`center`},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:`-0.3em`}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:a}}}},rE=e=>{let{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:i,tableScrollThumbSize:a,tableScrollBg:o,zIndexTableSticky:s,stickyScrollBarBorderRadius:c,lineWidth:l,lineType:u,tableBorderColor:d}=e,f=`${Q(l)} ${u} ${d}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:`sticky`,zIndex:s,background:e.colorBgContainer},"&-scroll":{position:`sticky`,bottom:0,height:`${Q(a)} !important`,zIndex:s,display:`flex`,alignItems:`center`,background:o,borderTop:f,opacity:n,"&:hover":{transformOrigin:`center bottom`},"&-bar":{height:a,backgroundColor:r,borderRadius:c,transition:`all ${e.motionDurationSlow}, transform 0s`,position:`absolute`,bottom:0,"&:hover, &-active":{backgroundColor:i}}}}}}},iE=e=>{let{componentCls:t,lineWidth:n,tableBorderColor:r,calc:i}=e,a=`${Q(n)} ${e.lineType} ${r}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:`relative`,zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:a}}},[`div${t}-summary`]:{boxShadow:`0 ${Q(i(n).mul(-1).equal())} 0 ${r}`}}}},aE=e=>{let{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:i,tableBorderColor:a,calc:o}=e,s=`${Q(r)} ${i} ${a}`,c=`${t}-expanded-row-cell`;return{[`${t}-wrapper`]:{[`${t}-tbody-virtual`]:{[`${t}-tbody-virtual-holder-inner`]:{[`
|
||||
& > ${t}-row,
|
||||
& > div:not(${t}-row) > ${t}-row
|
||||
`]:{display:`flex`,boxSizing:`border-box`,width:`100%`}},[`${t}-cell`]:{borderBottom:s,transition:`background ${n}`},[`${t}-expanded-row`]:{[`${c}${c}-fixed`]:{position:`sticky`,insetInlineStart:0,overflow:`hidden`,width:`calc(var(--virtual-width) - ${Q(r)})`,borderInlineEnd:`none`}}},[`${t}-bordered`]:{[`${t}-tbody-virtual`]:{"&:after":{content:`""`,insetInline:0,bottom:0,borderBottom:s,position:`absolute`},[`${t}-cell`]:{borderInlineEnd:s,[`&${t}-cell-fix-right-first:before`]:{content:`""`,position:`absolute`,insetBlock:0,insetInlineStart:o(r).mul(-1).equal(),borderInlineStart:s}}},[`&${t}-virtual`]:{[`${t}-placeholder ${t}-cell`]:{borderInlineEnd:s,borderBottom:s}}}}}},oE=e=>{let{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:i,tableExpandColumnWidth:a,lineWidth:o,lineType:s,tableBorderColor:c,tableFontSize:l,tableBg:u,tableRadius:d,tableHeaderTextColor:f,motionDurationMid:p,tableHeaderBg:m,tableHeaderCellSplitColor:h,tableFooterTextColor:g,tableFooterBg:_,calc:v}=e,y=`${Q(o)} ${s} ${c}`;return{[`${t}-wrapper`]:Object.assign(Object.assign({clear:`both`,maxWidth:`100%`,"--rc-virtual-list-scrollbar-bg":e.tableScrollBg},uo()),{[t]:Object.assign(Object.assign({},co(e)),{fontSize:l,background:u,borderRadius:`${Q(d)} ${Q(d)} 0 0`,scrollbarColor:`${e.tableScrollThumbBg} ${e.tableScrollBg}`}),table:{width:`100%`,textAlign:`start`,borderRadius:`${Q(d)} ${Q(d)} 0 0`,borderCollapse:`separate`,borderSpacing:0},[`
|
||||
${t}-cell,
|
||||
${t}-thead > tr > th,
|
||||
${t}-tbody > tr > th,
|
||||
${t}-tbody > tr > td,
|
||||
tfoot > tr > th,
|
||||
tfoot > tr > td
|
||||
`]:{position:`relative`,padding:`${Q(r)} ${Q(i)}`,overflowWrap:`break-word`},[`${t}-title`]:{padding:`${Q(r)} ${Q(i)}`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:`relative`,color:f,fontWeight:n,textAlign:`start`,background:m,borderBottom:y,transition:`background ${p} ease`,"&[colspan]:not([colspan='1'])":{textAlign:`center`},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:`absolute`,top:`50%`,insetInlineEnd:0,width:1,height:`1.6em`,backgroundColor:h,transform:`translateY(-50%)`,transition:`background-color ${p}`,content:`""`}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}-tbody`]:{"> tr":{"> th, > td":{transition:`background ${p}, border-color ${p}`,borderBottom:y,[`
|
||||
> ${t}-wrapper:only-child,
|
||||
> ${t}-expanded-row-fixed > ${t}-wrapper:only-child
|
||||
`]:{[t]:{marginBlock:Q(v(r).mul(-1).equal()),marginInline:`${Q(v(a).sub(i).equal())}
|
||||
${Q(v(i).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:`relative`,color:f,fontWeight:n,textAlign:`start`,background:m,borderBottom:y,transition:`background ${p} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:`0 !important`,borderBlock:`0 !important`,[`${t}-measure-cell-content`]:{height:0,overflow:`hidden`,pointerEvents:`none`}}}},[`${t}-footer`]:{padding:`${Q(r)} ${Q(i)}`,color:g,background:_}})}},sE=e=>{let{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:i,colorFillContent:a,controlItemBgActive:o,controlItemBgActiveHover:s,padding:c,paddingSM:l,paddingXS:u,colorBorderSecondary:d,borderRadiusLG:f,controlHeight:p,colorTextPlaceholder:m,fontSize:h,fontSizeSM:g,lineHeight:_,lineWidth:v,colorIcon:y,colorIconHover:b,opacityLoading:x,controlInteractiveSize:S}=e,C=new si(i).onBackground(n).toHexString(),w=new si(a).onBackground(n).toHexString(),T=new si(t).onBackground(n).toHexString(),E=new si(y),D=new si(b),O=S/2-v,k=O*2+v*3;return{headerBg:T,headerColor:r,headerSortActiveBg:C,headerSortHoverBg:w,bodySortBg:T,rowHoverBg:T,rowSelectedBg:o,rowSelectedHoverBg:s,rowExpandedBg:t,cellPaddingBlock:c,cellPaddingInline:c,cellPaddingBlockMD:l,cellPaddingInlineMD:u,cellPaddingBlockSM:u,cellPaddingInlineSM:u,borderColor:d,headerBorderRadius:f,footerBg:T,footerColor:r,cellFontSize:h,cellFontSizeMD:h,cellFontSizeSM:h,headerSplitColor:d,fixedHeaderSortActiveBg:C,headerFilterHoverBg:a,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:p,stickyScrollBarBg:m,stickyScrollBarBorderRadius:100,expandIconMarginTop:(h*_-v*3)/2-Math.ceil((g*1.4-v*3)/2),headerIconColor:E.clone().setA(E.a*x).toRgbString(),headerIconHoverColor:D.clone().setA(D.a*x).toRgbString(),expandIconHalfInner:O,expandIconSize:k,expandIconScale:S/k}},cE=2,lE=vo(`Table`,e=>{let{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:i,headerBg:a,headerColor:o,headerSortActiveBg:s,headerSortHoverBg:c,bodySortBg:l,rowHoverBg:u,rowSelectedBg:d,rowSelectedHoverBg:f,rowExpandedBg:p,cellPaddingBlock:m,cellPaddingInline:h,cellPaddingBlockMD:g,cellPaddingInlineMD:_,cellPaddingBlockSM:v,cellPaddingInlineSM:y,borderColor:b,footerBg:x,footerColor:S,headerBorderRadius:C,cellFontSize:w,cellFontSizeMD:T,cellFontSizeSM:E,headerSplitColor:D,fixedHeaderSortActiveBg:O,headerFilterHoverBg:k,filterDropdownBg:A,expandIconBg:j,selectionColumnWidth:M,stickyScrollBarBg:N,calc:P}=e,F=Ra(e,{tableFontSize:w,tableBg:r,tableRadius:C,tablePaddingVertical:m,tablePaddingHorizontal:h,tablePaddingVerticalMiddle:g,tablePaddingHorizontalMiddle:_,tablePaddingVerticalSmall:v,tablePaddingHorizontalSmall:y,tableBorderColor:b,tableHeaderTextColor:o,tableHeaderBg:a,tableFooterTextColor:S,tableFooterBg:x,tableHeaderCellSplitColor:D,tableHeaderSortBg:s,tableHeaderSortHoverBg:c,tableBodySortBg:l,tableFixedHeaderSortActiveBg:O,tableHeaderFilterActiveBg:k,tableFilterDropdownBg:A,tableRowHoverBg:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:f,zIndexTableFixed:cE,zIndexTableSticky:P(cE).add(1).equal({unit:!1}),tableFontSizeMiddle:T,tableFontSizeSmall:E,tableSelectionColumnWidth:M,tableExpandIconBg:j,tableExpandColumnWidth:P(i).add(P(e.padding).mul(2)).equal(),tableExpandedRowBg:p,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:N,tableScrollThumbBgHover:t,tableScrollBg:n});return[oE(F),ZT(F),iE(F),nE(F),YT(F),GT(F),QT(F),JT(F),iE(F),qT(F),eE(F),XT(F),rE(F),KT(F),tE(F),$T(F),aE(F)]},sE,{unitless:{expandIconScale:!0}}),uE=[],dE=s.forwardRef((e,t)=>{let{prefixCls:n,className:r,rootClassName:i,style:a,size:o,bordered:c,dropdownPrefixCls:l,dataSource:u,pagination:d,rowSelection:f,rowKey:p=`key`,rowClassName:m,columns:g,children:_,childrenColumnName:v,onChange:y,getPopupContainer:b,loading:x,expandIcon:S,expandable:C,expandedRowRender:w,expandIconColumnIndex:T,indentSize:E,scroll:D,sortDirections:O,locale:k,showSorterTooltip:A={target:`full-header`},virtual:j}=e;Lr(`Table`);let M=s.useMemo(()=>g||HS(_),[g,_]),N=Dy(s.useMemo(()=>M.some(e=>e.responsive),[M])),P=s.useMemo(()=>{let e=new Set(Object.keys(N).filter(e=>N[e]));return M.filter(t=>!t.responsive||t.responsive.some(t=>e.has(t)))},[M,N]),F=bu(e,[`className`,`style`,`columns`]),{locale:I=Gr,direction:L,table:R,renderEmpty:z,getPrefixCls:B,getPopupContainer:V}=s.useContext(fa),H=ju(o),U=Object.assign(Object.assign({},I.Table),k),W=u||uE,G=B(`table`,n),K=B(`dropdown`,l),[,q]=oo(),ee=Uc(G),[J,te,ne]=lE(G,ee),re=Object.assign(Object.assign({childrenColumnName:v,expandIconColumnIndex:T},C),{expandIcon:C?.expandIcon??R?.expandable?.expandIcon}),{childrenColumnName:ie=`children`}=re,ae=s.useMemo(()=>W.some(e=>e?.[ie])?`nest`:w||C?.expandedRowRender?`row`:null,[W]),oe={body:s.useRef(null)},se=ZC(G),ce=s.useRef(null),le=s.useRef(null);gl(t,()=>Object.assign(Object.assign({},le.current),{nativeElement:ce.curre
Line truncated
|
||||
h${t}&,
|
||||
div&-h${t},
|
||||
div&-h${t} > textarea,
|
||||
h${t}
|
||||
`]=NE(e[`fontSizeHeading${t}`],e[`lineHeightHeading${t}`],e.colorTextHeading,e)}),n},FE=e=>{let{componentCls:t}=e;return{"a&, a":Object.assign(Object.assign({},_o(e)),{userSelect:`text`,[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,"&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:`none`}}})}},IE=e=>({code:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.2em 0.1em`,fontSize:`85%`,fontFamily:e.fontFamilyCode,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3},kbd:{margin:`0 0.2em`,paddingInline:`0.4em`,paddingBlock:`0.15em 0.1em`,fontSize:`90%`,fontFamily:e.fontFamilyCode,background:`rgba(150, 150, 150, 0.06)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:wi[2]},"u, ins":{textDecoration:`underline`,textDecorationSkipInk:`auto`},"s, del":{textDecoration:`line-through`},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:`0 1em`,padding:0,li:{marginInline:`20px 0`,marginBlock:0,paddingInline:`4px 0`,paddingBlock:0}},ul:{listStyleType:`circle`,ul:{listStyleType:`disc`}},ol:{listStyleType:`decimal`},"pre, blockquote":{margin:`1em 0`},pre:{padding:`0.4em 0.6em`,whiteSpace:`pre-wrap`,wordWrap:`break-word`,background:`rgba(150, 150, 150, 0.1)`,border:`1px solid rgba(100, 100, 100, 0.2)`,borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:`inline`,margin:0,padding:0,fontSize:`inherit`,fontFamily:`inherit`,background:`transparent`,border:0}},blockquote:{paddingInline:`0.6em 0`,paddingBlock:0,borderInlineStart:`4px solid rgba(100, 100, 100, 0.2)`,opacity:.85}}),LE=e=>{let{componentCls:t,paddingSM:n}=e,r=n;return{"&-edit-content":{position:`relative`,"div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(r).div(-2).add(1).equal(),marginBottom:e.calc(r).div(2).sub(2).equal()},[`${t}-edit-content-confirm`]:{position:`absolute`,insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:`normal`,fontSize:e.fontSize,fontStyle:`normal`,pointerEvents:`none`},textarea:{margin:`0!important`,MozTransition:`none`,height:`1em`}}}},RE=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),zE=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:`inline-block`,maxWidth:`100%`},"&-ellipsis-single-line":{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,"a&, span&":{verticalAlign:`bottom`},"> code":{paddingBlock:0,maxWidth:`calc(100% - 1.2em)`,display:`inline-block`,overflow:`hidden`,textOverflow:`ellipsis`,verticalAlign:`bottom`,boxSizing:`content-box`}},"&-ellipsis-multiple-line":{display:`-webkit-box`,overflow:`hidden`,WebkitLineClamp:3,WebkitBoxOrient:`vertical`}}),BE=vo(`Typography`,e=>{let{componentCls:t,titleMarginTop:n}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({color:e.colorText,wordBreak:`break-word`,lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccessText},[`&${t}-warning`]:{color:e.colorWarningText},[`&${t}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:`not-allowed`,userSelect:`none`},"\n div&,\n p\n ":{marginBottom:`1em`}},PE(e)),{[`
|
||||
& + h1${t},
|
||||
& + h2${t},
|
||||
& + h3${t},
|
||||
& + h4${t},
|
||||
& + h5${t}
|
||||
`]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}}}),IE(e)),FE(e)),{[`
|
||||
${t}-expand,
|
||||
${t}-collapse,
|
||||
${t}-edit,
|
||||
${t}-copy
|
||||
`]:Object.assign(Object.assign({},_o(e)),{marginInlineStart:e.marginXXS})}),LE(e)),RE(e)),zE()),{"&-rtl":{direction:`rtl`}})}},()=>({titleMarginTop:`1.2em`,titleMarginBottom:`0.5em`})),VE=e=>{let{prefixCls:t,"aria-label":n,className:r,style:i,direction:a,maxLength:o,autoSize:c=!0,value:l,onSave:u,onCancel:d,onEnd:f,component:p,enterIcon:m=s.createElement(ME,null)}=e,g=s.useRef(null),_=s.useRef(!1),v=s.useRef(null),[y,b]=s.useState(l);s.useEffect(()=>{b(l)},[l]),s.useEffect(()=>{if(g.current?.resizableTextArea){let{textArea:e}=g.current.resizableTextArea;e.focus();let{length:t}=e.value;e.setSelectionRange(t,t)}},[]);let x=({target:e})=>{b(e.value.replace(/[\n\r]/g,``))},S=()=>{_.current=!0},C=()=>{_.current=!1},w=({keyCode:e})=>{_.current||(v.current=e)},T=()=>{u(y.trim())},E=({keyCode:e,ctrlKey:t,altKey:n,metaKey:r,shiftKey:i})=>{v.current!==e||_.current||t||n||r||i||(e===$.ENTER?(T(),f?.()):e===$.ESC&&d())},D=()=>{T()},[O,k,A]=BE(t),j=(0,h.default)(t,`${t}-edit-content`,{[`${t}-rtl`]:a===`rtl`,[`${t}-${p}`]:!!p},r,k,A);return O(s.createElement(`div`,{className:j,style:i},s.createElement(c7,{ref:g,maxLength:o,value:y,onChange:x,onKeyDown:w,onKeyUp:E,onCompositionStart:S,onCompositionEnd:C,onBlur:D,"aria-label":n,rows:1,autoSize:c}),m===null?null:_c(m,{className:`${t}-edit-content-confirm`})))},HE=t(((e,t)=>{t.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case`INPUT`:case`TEXTAREA`:t.blur();break;default:t=null}return e.removeAllRanges(),function(){e.type===`Caret`&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}})),UE=e(t(((e,t)=>{var n=HE(),r={"text/plain":`Text`,"text/html":`Url`,default:`Text`},i=`Copy to clipboard: #{key}, Enter`;function a(e){var t=(/mac os x/i.test(navigator.userAgent)?`⌘`:`Ctrl`)+`+C`;return e.replace(/#{\s*key\s*}/g,t)}t.exports=function(e,t){var o,s,c,l,u,d,f=!1;t||={},o=t.debug||!1;try{if(c=n(),l=document.createRange(),u=document.getSelection(),d=document.createElement(`span`),d.textContent=e,d.ariaHidden=`true`,d.style.all=`unset`,d.style.position=`fixed`,d.style.top=0,d.style.clip=`rect(0, 0, 0, 0)`,d.style.whiteSpace=`pre`,d.style.webkitUserSelect=`text`,d.style.MozUserSelect=`text`,d.style.msUserSelect=`text`,d.style.userSelect=`text`,d.addEventListener(`copy`,function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),n.clipboardData===void 0){o&&console.warn(`unable to use e.clipboardData`),o&&console.warn(`trying IE specific stuff`),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),u.addRange(l),!document.execCommand(`copy`))throw Error(`copy command was unsuccessful`);f=!0}catch(n){o&&console.error(`unable to copy using execCommand: `,n),o&&console.warn(`trying IE specific stuff`);try{window.clipboardData.setData(t.format||`text`,e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){o&&console.error(`unable to copy using clipboardData: `,n),o&&console.error(`falling back to prompt`),s=a(`message`in t?t.message:i),window.prompt(s,e)}}finally{u&&(typeof u.removeRange==`function`?u.removeRange(l):u.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}}))()),WE=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},GE=({copyConfig:e,children:t})=>{let[n,r]=s.useState(!1),[i,a]=s.useState(!1),o=s.useRef(null),c=()=>{o.current&&clearTimeout(o.current)},l={};return e.format&&(l.format=e.format),s.useEffect(()=>c,[]),{copied:n,copyLoading:i,onClick:ja(n=>WE(void 0,void 0,void 0,function*(){var i;n?.preventDefault(),n?.stopPropagation(),a(!0);try{let s=typeof e.text==`function`?yield e.text():e.text;(0,UE.default)(s||i9(t,!0).join(``)||``,l),a(!1),r(!0),c(),o.current=setTimeout(()=>{r(!1)},3e3),(i=e.onCopy)==null||i.call(e,n)}catch(e){throw a(!1),e}}))}};function KE(e,t){return s.useMemo(()=>{let n=!!e;return[n,Object.assign(Object.assign({},t),n&&typeof e==`object`?e:null)]},[e])}var qE=e=>{let t=(0,s.useRef)(void 0);return(0,s.useEffect)(()=>{t.current=e}),t.current},JE=(e,t,n)=>(0,s.useMemo)(()=>e===!0?{title:t??n}:(0,s.isValidElement)(e)?{title:e}:typeof e==`object`?Object.assign({title:t??n},e):{title:e},[e,t,n]),YE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnume
Line truncated
|
||||
+1
@@ -0,0 +1 @@
|
||||
.recoveries-page{color:var(--ink,var(--ink));min-width:0}.recoveries-page [hidden]{display:none!important}.recoveries-page h1,.recoveries-page h2,.recoveries-page h3{margin:0}.recoveries-page h1{font-size:clamp(1.9rem,4vw,3rem)}.recoveries-page p{color:var(--muted,var(--muted));line-height:1.55}.recoveries-page .panel,.recoveries-page .stock-review-status{background:var(--surface,var(--white));border:1px solid var(--line,var(--border));border-radius:12px;margin-block:14px;padding:18px}.recoveries-page .panel-title,.recoveries-page .actions,.recoveries-page .form-actions,.recoveries-page .stock-history-filters{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.recoveries-page .panel-title{justify-content:space-between}.recoveries-page .recovery-row{grid-template-columns:repeat(auto-fit,minmax(min(135px,100%),1fr));gap:12px;display:grid}.recoveries-page label{align-content:start;gap:5px;margin-block:8px;display:grid}.recoveries-page label:has([type=checkbox]){align-items:center;display:flex}.recoveries-page input,.recoveries-page select,.recoveries-page textarea,.recoveries-page button{font:inherit}.recoveries-page input:not([type=checkbox]),.recoveries-page select,.recoveries-page textarea{border:1px solid var(--border-strong);width:100%;min-width:0;color:inherit;box-sizing:border-box;background:#fff;border-radius:6px;padding:8px}.recoveries-page fieldset{border:0;min-width:0;margin:0;padding:0}.recoveries-page button{cursor:pointer;border:1px solid var(--border-strong);color:inherit;background:#fff;border-radius:7px;margin:2px;padding:7px 12px}.recoveries-page button:disabled{cursor:default;opacity:.48}.recoveries-page .primary,.recoveries-page button[aria-pressed=true]{background:var(--green);color:#fff}.recoveries-page .table-wrap{overflow:auto}.recoveries-page table{border-collapse:collapse;text-align:left;width:100%}.recoveries-page td,.recoveries-page th{border-bottom:1px solid var(--border);vertical-align:top;padding:9px}.recoveries-page th{white-space:nowrap}.recoveries-page dialog{border:1px solid var(--border);width:100%;max-width:min(720px,94vw);max-height:86dvh;color:inherit;box-sizing:border-box;border-radius:13px;padding:24px;position:fixed;overflow:auto}.recoveries-page dialog::backdrop{background:color-mix(in srgb, var(--ink) 33%, transparent)}.recoveries-page .dialog-close{float:right}.recoveries-page .error{color:var(--danger)}.recoveries-page .recovery-net{align-items:center;gap:18px;display:flex}.recoveries-page .recovery-net strong{font-size:1.5rem}.recoveries-page .modified{background:var(--internal-bg)}.recoveries-page table td{white-space:pre-line}.recoveries-page .recovery-new-product{border-top:1px solid var(--border);padding-top:10px}.inventory-page{color:var(--ink,var(--ink));min-width:0}.inventory-page [hidden]{display:none!important}.inventory-page h1,.inventory-page h2,.inventory-page h3{margin:0}.inventory-page h1{font-size:clamp(1.9rem,4vw,3rem)}.inventory-page p{color:var(--muted,var(--muted));line-height:1.55}.inventory-page .panel,.inventory-page .stock-card,.inventory-page .stock-review-status{background:var(--surface,var(--white));border:1px solid var(--line,var(--border));border-radius:12px;margin-block:14px;padding:18px}.inventory-page .stock-cards{grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:10px;display:grid}.inventory-page .stock-card{margin:0}.inventory-page .stock-card strong{font-size:1.6rem}.inventory-page .stock-card .yesterday{border-top:1px solid var(--border);gap:4px;margin-top:12px;padding-top:10px;display:grid}.inventory-page .panel-title,.inventory-page .actions,.inventory-page .form-actions,.inventory-page .stock-history-filters{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.inventory-page .panel-title{justify-content:space-between}.inventory-page .stock-entry-fields{grid-template-columns:repeat(auto-fit,minmax(min(135px,100%),1fr));gap:12px;display:grid}.inventory-page label{align-content:start;gap:5px;margin-block:8px;display:grid}.inventory-page label:has([type=checkbox]){align-items:center;display:flex}.inventory-page input,.inventory-page select,.inventory-page textarea,.inventory-page button{font:inherit}.inventory-page input:not([type=checkbox]),.inventory-page select,.inventory-page textarea{border:1px solid var(--border-strong);width:100%;min-width:0;color:inherit;box-sizing:border-box;background:#fff;border-radius:6px;padding:8px}.inventory-page fieldset{border:0;min-width:0;margin:0;padding:0}.inventory-page button{cursor:pointer;border:1px solid var(--border-strong);color:inherit;background:#fff;border-radius:7px;margin:2px;padding:7px 12px}.inventory-page button:disabled{cursor:default;opacity:.48}.inventory-page .primary,.inventory-page button[aria-pressed=true]{background:var(--green);color:#fff}.inventory-page .table-wrap{overflow:auto}.inventory-page table{border-collapse:collapse;text-align:left;width:100%}.inventory-page td,.inventory-page th{border-bottom:1px solid var(--border);vertical-aligLine truncated
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
import{n as e,t}from"./rolldown-runtime-Dl_DZoUm.js";import{A as n,B as r,C as i,D as a,E as o,F as s,H as c,I as l,L as u,M as d,N as f,O as p,P as m,R as h,S as g,T as _,_ as v,a as y,b,c as x,d as S,f as C,g as w,h as T,i as E,j as D,k as O,l as k,m as A,n as j,o as M,p as N,r as P,s as F,t as I,u as L,v as R,w as z,x as B,y as V,z as ee}from"./antd-Bh8pVx-K.js";import{n as te,t as H}from"./react-BvkltZ40.js";var U=t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=i()})(n,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)rLine truncated
|
||||
0.58×(822+45)+55=558
|
||||
769+558=1327`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&r.trim()&&(e.preventDefault(),s(!1))}}),(0,q.jsxs)(_,{wrap:!0,style:{marginTop:8},children:[(0,q.jsx)(l,{type:`primary`,onClick:()=>s(!1),children:`识别并预填`}),a?.kind===`warning`&&(0,q.jsx)(l,{onClick:()=>s(!0),children:`按计算金额预填`}),r&&(0,q.jsx)(l,{onClick:()=>{i(``),o(null)},children:`清空公式`})]}),(0,q.jsx)(`p`,{className:`small muted`,children:`括号内是克工费;金价乘克重后加的是一件工费,再加的金额记为附加费。合计行只校验,不增加商品。客户、货盘及内部成本仍按实际填写。`}),a&&(0,q.jsx)(h,{role:`status`,type:a.kind===`note`?`success`:a.kind,message:a.title||(a.kind===`error`?a.lines[0]:``),description:a.kind===`error`?void 0:(0,q.jsx)(`div`,{children:a.lines.filter(Boolean).map((e,t)=>(0,q.jsx)(`p`,{children:e},t))})})]})}function Pn({order:e,error:t,onRetry:r,onPreview:i,onNew:a}){let{message:o}=s.useApp(),[c,u]=(0,W.useState)(!1),f=e.total!==void 0;async function p(){if(e.paper_number)try{await navigator.clipboard.writeText(e.paper_number),u(!0),o.success(`已复制纸单号 `+e.paper_number),window.setTimeout(()=>u(!1),1800)}catch{u(!1),o.info(`请手动选择纸单号复制`)}}return(0,q.jsx)(`div`,{className:`issued-page`,children:(0,q.jsx)(O,{className:`issued-card`,children:(0,q.jsx)(w,{status:`success`,title:`销售单据已生成`,subTitle:f?e.materialCostPending?`收款、费用和出库已记账;料费待补,补足购料后自动核算利润。`:`收款、费用、出库和利润已记账。`:t||`正在读取已生成的销售单…`,extra:(0,q.jsxs)(_,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[f&&(0,q.jsxs)(`dl`,{className:`issued-summary`,"data-testid":`issued-summary`,children:[(0,q.jsxs)(`div`,{className:`issued-item`,children:[(0,q.jsx)(`dt`,{children:(0,q.jsx)(S.Text,{type:`secondary`,children:`纸单号`})}),(0,q.jsxs)(`dd`,{className:`issued-value-row`,children:[(0,q.jsx)(`span`,{className:`issued-value num`,"data-testid":`issued-paper-number`,children:e.paper_number||`未分配`}),e.paper_number&&(0,q.jsx)(d,{title:c?`已复制`:`复制纸单号`,children:(0,q.jsx)(l,{type:`text`,size:`small`,className:`issued-copy-btn`,"aria-label":`复制纸单号`,icon:c?(0,q.jsx)(m,{}):(0,q.jsx)(C,{}),onClick:()=>void p()})})]})]}),(0,q.jsxs)(`div`,{className:`issued-item`,children:[(0,q.jsx)(`dt`,{children:(0,q.jsx)(S.Text,{type:`secondary`,children:`成交合计`})}),(0,q.jsx)(`dd`,{className:`issued-value issued-total num`,"data-testid":`issued-total`,children:ct(e.total??null,e.rounding_mode||`cent`)})]}),e.customer&&(0,q.jsxs)(`div`,{className:`issued-item`,children:[(0,q.jsx)(`dt`,{children:(0,q.jsx)(S.Text,{type:`secondary`,children:`客户`})}),(0,q.jsx)(`dd`,{className:`issued-value small`,children:e.customer})]})]}),(0,q.jsxs)(`div`,{className:`issued-actions`,children:[(0,q.jsx)(l,{type:`primary`,size:`large`,icon:(0,q.jsx)(P,{}),href:`/print/`+encodeURIComponent(e.id)+`?mode=full`,onClick:()=>{i().catch(e=>o.error(e.message))},target:`_blank`,rel:`noopener`,"data-action":`print-preview`,children:`打开打印预览`}),(0,q.jsx)(l,{size:`large`,icon:(0,q.jsx)(n,{}),onClick:a,"data-action":`new-order`,children:`开始新的一单`}),!f&&(0,q.jsx)(l,{size:`large`,onClick:r,children:`重新读取订单`})]}),(0,q.jsx)(l,{href:ge(`orders`)+`?order=`+encodeURIComponent(e.id),onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),K(`orders`,{search:`?order=`+encodeURIComponent(e.id)}))},type:`link`,icon:(0,q.jsx)(z,{}),children:`查看订单详情`})]})})})})}function Fn(e){let{client:t,state:n}=e,r=De(`draft`),[i,a]=(0,W.useState)(r?null:{draft:Mt(window.localStorage,n.user.id),note:``});return(0,W.useEffect)(()=>{if(!r)return;let e=!0;return(async()=>{try{if(n.user.role!==`owner`)throw Error(`已有草稿由店主继续填写并开单;无单号的新开单流程照常使用。`);let i=await t.api(`/api/orders/`+encodeURIComponent(r));if(i.status!==`draft`)throw Error(`这张订单不是未开单的旧草稿,请在订单页查看。`);e&&a({draft:Y.draftInputs(i),note:`正在继续填写旧草稿,生成销售单据后完成记账。`})}catch(t){e&&a({draft:Mt(window.localStorage,n.user.id),note:`旧草稿未能打开:`+t.message})}})(),()=>{e=!1}},[t,r,n.user.id,n.user.role]),i?(0,q.jsx)(In,{...e,initialDraft:i.draft,initialNote:i.note}):(0,q.jsx)(`div`,{className:`page-loading`,children:(0,q.jsx)(b,{tip:`正在读取旧草稿…`,children:(0,q.jsx)(`div`,{style:{height:60}})})})}function In({client:e,state:t,session:n,refreshState:r,onAccountChanged:i,onRecoverOther:a,initialDraft:o,initialNote:c}){let{message:u}=s.useApp();Oe(e);let{store:d,update:f,reset:p,ctx:m,poolError:g,loadPools:_}=Zt({client:e,state:t,session:n,initialDraft:o}),{form:v,summary:y}=d,[b,C]=(0,W.useState)(``),[w,T]=(0,W.useState)(!1),[E,D]=(0,W.useState)(null),O=E!==null,k
Line truncated
|
||||
`),u=e=>e?.exchange?.fee_items.map(e=>`${e.note}:${e.amount}元 · ${o(e.payer)}付款`).join(`
|
||||
`)||`无`,d=e=>e?.exchange?.charges.map(e=>`${e.name}:${e.amount}元`).join(`
|
||||
`)||`无`,f=n.exchange||{},p=r?.exchange||{},m=e=>e?.mode===`pool`?`料池 `+e.poolId:e?`手填 `+e.rate+`元/克`:`无补金差重`,h=e=>e?e.mode===`gram`?e.rate+`元/克`:e.amount+`元总工费`:`未提供`;if(i.push(a(`业务日期`,n.date,r?.date||`取消原记录`),a(`客户`,n.customer,r?.customer),a(`开单人`,n.salesperson,r?.salesperson),a(`归属`,o(n.member),r?o(r.member):`沿用原身份留档`),a(`旧料逐项称重`,l(n),r?l(r):`冲正原库存及关联购料`),a(`旧料入库货盘`,s(n.old_pocket??`回收旧料`),r?s(r.old_pocket??`回收旧料`):`冲回原入库货盘`),a(`旧料入库数量(对)`,Gi(n.old_stock_count==null?null:Number(n.old_stock_count)),r?Gi(r.old_stock_count==null?null:Number(r.old_stock_count)):`冲回原入库数量`),a(`回收单价(元/克)`,n.buy_rate,r?.buy_rate),a(`回收结算额(元)`,n.buy_total,r?.buy_total),a(`实际收付款账户`,c(n.payment_account),r?c(r.payment_account):`冲正原收付记录`),a(`付款人`,o(n.payer),r?o(r.payer):`原付款流水保留`),a(`备注`,n.note,r?.note)),(n.surplus_mode===`deposit`||r?.surplus_mode===`deposit`)&&i.push(a(`余料处理`,n.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`,r?r.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`:`撤回本单寄存余料`)),(n.old_source===`deposit`||r?.old_source===`deposit`)&&i.push(a(`使用客户寄存料`,n.old_source===`deposit`?n.deposit_id+` · `+n.deposit_weight+`g`:`本次交来旧料`,r?.old_source===`deposit`?r.deposit_id+` · `+r.deposit_weight+`g`:r?`本次交来旧料`:`退回寄存账户`)),n.exchange?.items||r?.exchange?.items){let e=e=>(e?.exchange?.items||[]).map((e,t)=>t+1+` · `+e.exchange.name+(e.old_source===`deposit`?` · 寄存记录 `+e.deposit_id+` 使用 `+e.deposit_weight+`g`:``)+(e.surplus_mode===`deposit`?` · 余料寄存,暂不结算`:``)+` · 旧料 `+e.old_lines.map(e=>e.melted_weight+`g × `+e.purity+`%`).join(`+`)+` 入`+s(e.old_pocket)+` · 新货 `+e.exchange.quantity+`g `+(s(e.exchange.pocket)||`外配`)+` · 补金 `+e.exchange.gold_price+`元/g · 折旧 `+e.exchange.depreciation_weight+`g × `+e.exchange.depreciation_rate+`元/g · 回收 `+e.buy_rate+`元/g,`+e.buy_total+`元 · 料费 `+JSON.stringify(e.exchange.cost_material)+` · 料费付款 `+o(e.exchange.cost_material_payer)+` · 进货工费 `+JSON.stringify(e.exchange.cost_labor)+`,`+o(e.exchange.cost_labor_payer)).join(`;`);i.push(a(`逐件置换完整资料`,e(n),r?e(r):`全部冲回`))}if(n.exchange?.products||r?.exchange?.products){let e=e=>(e?.products??(e?[e]:[])).map((e,t)=>t+1+` · `+e.name+` · `+e.quantity+`g · `+(s(e.pocket)||`外配`)+` · 销售工费 `+e.labor_rate+(e.labor_mode===`total`?`元`:`元/克`)+` · 进货工费 `+(e.cost_labor?.rate??e.cost_labor?.amount??`待补`)+` · `+o(e.cost_labor_payer)+(e.stockCount==null?``:` · `+e.stockCount+`对`)).join(`;`);i.push(a(`逐件置换商品`,e(n.exchange),r?e(r.exchange):`冲回全部新货出库`))}n.mode===`exchange`&&i.push(a(`置换新货`,f.name,p.name),a(`新货克重(g)`,f.quantity,p.quantity),a(`实际货盘`,s(f.pocket)||`外配`,r?s(p.pocket)||`外配`:`冲回原出库货盘`),a(`出库数量(对)`,Gi(f.stockCount==null?null:Number(f.stockCount)),Gi(p.stockCount==null?null:Number(p.stockCount))),a(`销售金价(元/克)`,f.gold_price,p.gold_price),a(`销售工费`,f.labor_rate+`元/`+(f.labor_mode===`gram`?`克`:`总额`),r?p.labor_rate+`元/`+(p.labor_mode===`gram`?`克`:`总额`):`取消`),a(`折旧计费克重/单价`,f.depreciation_weight+`g × `+f.depreciation_rate+`元/克`,r?p.depreciation_weight+`g × `+p.depreciation_rate+`元/克`:`取消`),a(`附加收费`,d(n),r?d(r):`取消`),a(`优惠(元)`,f.discount,p.discount),a(`取整方式`,f.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`,r?p.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`:`取消`),a(`补金差重进货来源`,m(f.cost_material),r?m(p.cost_material):`释放原耗用`),a(`料费付款人`,o(f.cost_material_payer),r?o(p.cost_material_payer):`原来源留档`),a(`进货工费`,h(f.cost_labor),r?h(p.cost_labor):`取消`),a(`工费付款人`,o(f.cost_labor_payer),r?o(p.cost_labor_payer):`原来源留档`),a(`实际费用`,u(n),r?u(r):`冲正原费用`));let g=e.summary.before||{},_=e.summary.after||{};return i.push(...[[`实际收客户`,`cashReceipt`],[`实际付客户`,`cashPayment`],[`购料成本`,`purchaseAmount`],[`订单货品成本`,`goodsCost`],[`实际费用`,`directCost`],[`原账利润`,`profit`]].map(([e,t])=>a(e,g[t]==null?`待核实`:`¥`+st(g[t]),r?_[t]==null?`待核实`:`¥`+st(_[t]):`取消后冲正`))),(0,q.jsxs)(q.Fragment,{children:[e.summary.legacyCountNotice&&(0,q.jsxs)(`p`,{children:[e.summary.legacyCountNotice,e.summary.legacyCountVerified&&`(申请人已确认)`]}),(0,q.jsx)(`div`,{className:`table-wrap`,children:(0,q.jsxs)(`table`,{"aria-label":`回收更正原值与申请值`,children:[(0,q.jsx)
Line truncated
|
||||
`)}function a(){return e?.shopSettings?.storeName||e?.printing?.store||t?.brand?.storeName||`珠宝台账`}function o(e=!1,{historical:t=!1,selected:n=``}={}){let r=(t?V():ee()).filter(e=>c()||e!==`assistant2`);e&&(r=[...r.filter(e=>e!==`owner`),...r.filter(e=>e===`owner`)]);let i=r.map(e=>[e,R(e)+(t&&!te(e)?`(已停用)`:``)]);return n&&V().includes(n)&&!r.includes(n)&&i.push([n,R(n)+`(已停用 · 原记录)`]),i}function s(){return e?.user?.member||t?.user?.member||(e?.user?.role===`owner`?`owner`:`assistant`)}function c(){return!!(e?.user?.member||e?.members?.some(e=>e.member===`assistant2`))}let l=Ne.validDate;function u(e){return e==null?`待确认`:`¥`+m(e)}function d(e){let{total:t,complete:n,amounts:r}=hs.reimbursementAmounts(e,J.cents);return{total:t,complete:n,formula:r.map(e=>`¥`+m(e)).join(` + `)}}function f(e){return[...H(),`owner`].filter(t=>e&&Object.hasOwn(e,t))}function p(e,t){let n=e.unknownCounts?.[t]||0;return n&&e.knownCounts?.[t]===0&&!e[t]&&!e.afterSaleCount?`待补齐`:(n?`已知 `:``)+`¥`+m(e[t])}let m=e=>e==null?`待补`:Ne.yuan(e);function h(e){return e.from===e.date?e.date:e.from+` 至 `+e.date}function g(e){let t=U(e);return t?R(t.member)+t.channel:e}function _(e,t,n=!1){return e===null?(n?`待核算(已核算 ¥`:`待补齐(已知 ¥`)+m(t)+`)`:`¥`+m(e)}function v(e){let t=e.summary,n=e.receiptsByOrderDate;return[a()+`三人账 · `+h(e),`利润留在店里,按订单归属分别记业绩。经营款各自管理;未导入真实期初经营款。`,...re(e.peopleCount),`销售净额:`+p(t,`sale`),`本期净利润:`+p(t,`profit`),`本期实收:¥`+m(n.receipt)+`;本期实退:¥`+m(n.refund),...D(e),...O(e),...k(e),...A(e),`按实际付款人核对成本`,...f(e.payerCosts).flatMap(t=>{let n=e.payerCosts[t];return[R(t)+`:实际货品支出 `+y(n.goods,n.missingCount)+`;已付费用 ¥`+m(n.paidFees),..._s(n).map(e=>e.date+` / `+x(e)+` / `+e.name+` / `+C(e))]}),`订单与售后`,...e.orderRows.map(e=>e.date+` / `+(e.paper_number||e.number||e.project)+` / `+(e.customer||`未填客户`)+` / `+R(e.member)+` / 销售 `+E(e,`sale`)+` / 净利润 `+E(e,`profit`)),`历史两人结算不计入团队新债务。`].join(`
|
||||
`)}function y(e,t=0){return t&&e===0?`待补齐`:(t?`已知 `:``)+`¥`+m(e)}function b(e){return[e.missingCount?e.missingCount+` 项成本待补齐`:``,e.pendingCount?e.pendingCount+` 项费用未入账,不计合计`:``].filter(Boolean).join(`;`)}function x(e){return e.materialPoolId?e.materialPoolId+` 购料`:e.kind===`afterSale`?`售后 · `+(e.customer||`未填客户`):(e.price_lock_id?`锁价 · `:``)+(e.paper_number||e.number||`锁价记录`)+(e.customer?` · `+e.customer:``)}function S(e){let t=e.calculation;return t?M(t.quantity)+`g × `+(t.rate==null?e.component===`material`?`每克料价待补齐`:`每克工费待补齐`:m(t.rate)+`元/克`)+(e.amount==null?``:` = `+m(e.amount)+`元`):``}function C(e){return e.kind===`pending`?`未入账`+(e.amount==null?`(金额待补)`:`(登记 ¥`+m(e.amount)+`)`):e.amount==null?`待补齐`:`¥`+m(e.amount)}function w(e){return e.costItems?.[0]?.payer?R(e.costItems[0].payer):`付款人待补`}let T={draft:`旧草稿`,confirmed:`旧单待补齐`,delivered:`已完成`,returned:`已退货`,cancelled:`已取消`,after_sale:`售后`,recovery:`回收`};function E(e,t){if(e.status===`draft`)return`未开单`;if(t===`goods`){let t=vs(e);return y(t.goods,t.missing)}return t===`paidFees`?`¥`+m(vs(e).paidFees):e[t]==null?e.known?.[t]?`已知 ¥`+m(e.known[t])+`(待补齐)`:`待补齐`:`¥`+m(e[t])}function D(e){let t=e.dailyProfits,n=e=>`销售净额 ¥${m(e.sales)} / 成本 ${_(e.totalCost,e.knownTotalCost)} / 利润 ${_(e.profit,e.knownProfit,!0)}`;return[`每日利润表(按日期与订单归属人;普通订单按开单日、锁价成单按交付日、售后按记录日)`,...t.rows.length?t.rows.map(e=>`${e.date} / ${e.name} / ${n(e)}`):[`所选范围暂无订单或售后记录。`],`所选范围合计:${n(t.summary)}`,``]}function O(e){return[`按订单归属核对净收入(收款减退款,已含他人代收,尚未扣成本与费用)`,...ke(e).flatMap(t=>{let n=e.ownershipReceipts[t];return[`${n.name}所属订单净收入:¥${m(n.net)};实收 ¥${m(n.receipt)};实退 ¥${m(n.refund)}`,...n.accounts.map(e=>`${e.recipient===n.member?`本人收款`:`他人代收`} / ${g(e.account)}:实收 ¥${m(e.receipt)},实退 ¥${m(e.refund)},净额 ¥${m(e.net)}`),...ie(e.ownershipBusiness[t]),``]})]}function k(e){let t={date:e.date,from:e.from,month:n},r=e.dailyFunds;if(r?.team)return[`每日报销单(按报销日期归集,已批准报销不在当日订单往来重复相加)`,...r.reimbursements.flatMap(e=>[`${e.date} / ${e.requester_name} / ${z[e.status]} / 合计 ¥${m(e.total)}`,...e.items.map(e=>`${e.name}:¥${m(e.amount)}`)]),``];if(!r||r.rangeUnsupported)return[`每天转账核对`,`尚未取得完整转账资料,不输出应转金额。`,``];try{Ee(r,t)}catch{return[`每天转账核对`,`资料未完整返回,不输出应转金额。`,``]}let i=[`每天转账核对(应转合计,未扣已转)`,`${R(`owner`)}实收 ¥${m(r.ownerReceipts.receipt)} − 实退 ¥${m(r.ownerReceipts.refund)} = 净收款 ¥${m(r.ownerReceipts.net)}`];r.ready?i.push(`${R(`owner`)}净收款 ¥${m(r.ownerReceipts.net)} − 确认完整对外支出 ¥${m(r.actualOutlay)} + 已批准报销 ¥${m(r.approvedReimbursements)} = 应转合计 ¥${m(r.transferAmount)}`,(r.transferAmount??0)>0?`方向:`+R(`owner`)+`转`+R(`assistant`):(r.transferAmount??0)<0?`方向:`+R(`assistant`)+`转`+R(`owner`):`方向:无需转款`):i.push(`当天完整支出尚未全部确认,暂不输出完整应转合计。`,...r.missingDates.length?[`待确认日期:`+r.missingDates.join(`、`)]:[],...r.staleDates.length?[`来源变动待重新确认:`+r.staleDates.join(`、`)]:[]),i.push(`不要与旧按单/剩料待结重复相加;报销与确认不扣订单利润。`,`已批准报销项目(按报销日期归集)`);let a=r.reimbursements.filter(e=>e.status===`approved`);return i.push(...a.length?a.flatMap(e=>[`${e.date} / ${e.requester_name} / 合计 ¥${m(e.total)} / ${e.reviewer_name||R(`owner`)}复核`,...e.items.map(e=>`${e.name}:¥${m(e.amount)}`)]):[`本期暂无已批准报销。`],``),i}function A(e){return[`按收款人汇总(普通订单按开单日归集当前收付,锁价按实际收付日归集;负数为冲回)`,...f(e.recipientReceipts).flatMap(t=>{let n=e.recipientReceipts[t];return[`${n.name}总收款:¥${m(n.receipt)};退款 ¥${m(n.refund)};净收款 ¥${m(n.net)}`,...[`receipt`,`refund`].flatMap(e=>{let t=n.items.filter(t=>t.kind===e),r=e===`receipt`?`收款`:`退款`;return[`${n.name}${r}明细(日期为实际${r}日):`,...t.length?t.map(e=>`${e.date} / ${ae(e)} / ${e.paper_number||e.number||(e.price_lock_id?`锁价记录`:`订单记录`)} / 客户 ${e.customer||`未填客户称呼`} / ${g(e.account)} / ${oe(e)} ¥${m(e.amount)}${e.reference||e.note?` / `+(e.reference||e.note):``}`):[`所选范围没有`+n.name+r+`记录。`],`${r}明细合计:¥${m(n[e])}`]}),``]})]}function j(e){if(!e?.summary?.event
Line truncated
|
||||
|
||||
`)||`无已记费用`}function M(e){let t=new Set((e.corrections||[]).filter(e=>e.type===`payment`).map(e=>e.target));return e.payments.filter(e=>e.amount>0&&!t.has(e.id)).map(e=>`${e.date} · ${e.kind===`receipt`?`客户收款`:`客户退款`}\n${V(e.amount)} · ${e.account?G(e.account):`账户未提供`}`).join(`
|
||||
|
||||
`)||`无有效收退款`}function N(e,t,n=`锁价购料成本`){if(!e.priceLockCosts&&!t.priceLockCosts)return``;if(e.priceLockCosts?.lines||t.priceLockCosts?.lines){let n=e.priceLockCosts||{},r=t.priceLockCosts||{},i=n.lines||r.lines;return W.Children.toArray(i.map((e,t)=>{let i=n.lines?.find(t=>t.lineId===e.lineId)||{},a=r.lines?.find(t=>t.lineId===e.lineId)||{};return N({priceLockCosts:{...i,date:n.date}},{priceLockCosts:{...a,date:r.date}},`商品 `+(t+1)+` · 锁价购料成本`)}))}let r=e.priceLockCosts||{},i=t.priceLockCosts||{},a=e=>e===`pool`?`原锁料池`:e===`manual`?`手填原锁料价`:`未提供`;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`tr`,{className:`change-section-row`,children:(0,q.jsx)(`th`,{colSpan:3,scope:`colgroup`,children:n})}),F(`原锁日期`,r.date,i.date),F(`原锁料费来源`,a(r.materialSource),a(i.materialSource)),F(`原锁进货料价(每克)`,V(r.buyRate),V(i.buyRate)),F(`原锁料费付款人`,r.materialSource===`pool`?`按原锁料池分摊`:B(r.buyPayer),i.materialSource===`pool`?`按原锁料池分摊`:B(i.buyPayer)),F(`原锁整批料费`,V(r.materialAmount),V(i.materialAmount)),F(`补重进货料价(每克)`,V(r.extraRate),V(i.extraRate)),F(`补重料费付款人`,r.extraPayer?B(r.extraPayer):`无补重`,i.extraPayer?B(i.extraPayer):`无补重`)]})}function P(e,t){if(!e)return`无此商品`;let n=V;if(t===`name`)return`${e.name||`未填写`}${e.priceNote?`
|
||||
`+e.priceNote:``}`;if(t===`code`)return e.code||`未填写`;if(t===`quantity`)return e.unit===`g`?De(e.quantity)+`g`:String(e.quantity)+`件`;if(t===`sale`)return n(e.sale);if(t===`pricing`)return e.goldPrice==null?`手填基础金额 ${n(e.baseSale??e.sale)}`:`销售金价 ${n(e.goldPrice)}/克\n${e.laborMode===`gram`?`销售克工费`:`销售件工费`} ${n(e.laborRate)}${e.laborMode===`gram`?`/克`:`/件`}\n件数 ${e.pieces??`未填写`}`;if(t===`stockCount`)return Number.isSafeInteger(e.stockCount)||H(e.pocket)?te(e.stockCount):`不记录对数`;if(t===`pocket`)return U(e.pocket)||`外配/不扣黄金`;if(t===`charges`)return e.charges?.length?e.charges.map(e=>`${e.name}:${n(e.amount)}`).join(`
|
||||
`):`无附加收费`;if(t===`cost`)return n(e.cost);if(t===`material`){let t=e.costMaterial;return t?.mode===`pool`?`每日购料:${t.poolId}\n本行料费:${n(e.costParts?.material)}${e.materialPool?.allocations?.length?`
|
||||
`+e.materialPool.allocations.map(e=>B(e.payer)+` `+n(e.amount)).join(`;`):e.costParts?.material==null?`
|
||||
待补采购后分摊`:``}`:`${t?.mode===`gram`?`每克料价 `+n(t.rate)+`/克`:`料费总额`}\n${n(e.costParts?.material)}`}return t===`labor`?`${e.costLabor?.mode===`gram`?`进货克工费 `+n(e.costLabor.rate)+`/克`:`进货总工费`}\n${n(e.costParts?.labor)}`:t===`extra`?e.costParts?`配件 ${n(e.costParts.accessories)}\n其他 ${n(e.costParts.other)}`:`原货品成本未分项`:t===`payers`?`料费:${e.costMaterial?.mode===`pool`?e.materialPool?.allocations?.map(e=>B(e.payer)+` `+n(e.amount)).join(`;`)||`按真实采购分摊`:B(e.costPayers?.material??e.payer)}\n进货工费:${B(e.costPayers?.labor??e.payer)}\n配件及其他:${B(e.payer)}`:``}function F(e,t,n){let r=String(t??``)!==String(n??``);return(0,q.jsxs)(`tr`,{...r?{className:`order-change-modified`}:{},children:[(0,q.jsxs)(`th`,{scope:`row`,children:[e,r?(0,q.jsx)(`span`,{className:`change-mark`,children:`已修改`}):``]}),(0,q.jsx)(`td`,{children:z(t)}),(0,q.jsx)(`td`,{children:z(n)})]})}function I(e){if(e===void 0)return[];let t=e=>e===null||Number.isSafeInteger(e)&&e>=0,n=e=>e&&t(e.materialAmount)&&[`usedMaterialAmount`,`leftoverCost`].every(n=>!Object.hasOwn(e,n)||t(e[n]))&&Array.isArray(e.allocations)&&e.allocations.every(e=>ze().includes(e.payer)&&Number.isSafeInteger(e.amount)&&e.amount>=0)&&(e.materialAmount===null||e.allocations.reduce((e,t)=>e+t.amount,0)===e.materialAmount);if(!Array.isArray(e)||!e.every(e=>e&&typeof e.id==`string`&&e.id&&Ae(e.date)&&n(e.before)&&n(e.after)))throw Error(`关联锁价单的成本影响未完整返回,请重新读取后复核。`);return e}function L(e,t=void 0){let n=t=>t&&t.id===e.order_id&&Number.isSafeInteger(t.total)&&Array.isArray(t.lines)&&Array.isArray(t.expenses)&&Array.isArray(t.payments),r=e=>e===null||Number.isSafeInteger(e);if(!e||typeof e.id!=`string`||!e.id||typeof e.order_id!=`string`||t&&e.order_id!==t||!Object.hasOwn(oe,e.status)||!Number.isSafeInteger(e.order_revision)||typeof e.reason!=`string`||typeof e.requester_name!=`string`||typeof e.created!=`string`||typeof e.stale!=`boolean`||typeof e.canApprove!=`boolean`||!n(e.before)||!n(e.after)||![`before`,`after`].every(t=>e.summary?.[t]&&[`total`,`netReceived`,`directCost`].every(n=>Number.isSafeInteger(e.summary[t][n]))&&[`goodsCost`,`profit`,`settlementDue`].every(n=>r(e.summary[t][n]))))throw Error(`修改申请资料未完整返回,请重新读取订单后复核。`);if(e.relatedOrders!==void 0){if(!Array.isArray(e.relatedOrders))throw Error(`关联订单的修改影响未完整返回,请重新读取后复核。`);e.relatedOrders.forEach(t=>L({...e,order_id:t.id,before:t.before,after:t.after,summary:t.summary,relatedOrders:[]}))}if(I(e.relatedPriceLocks),e.action!==void 0&&!Object.hasOwn(se,e.action))throw Error(`变更申请类型未完整返回,请重新读取后复核。`);let i=e.summary.inventory;if(i!==void 0&&(!i||![`before`,`after`,`changes`].every(e=>Array.isArray(i[e])&&i[e].every(e=>typeof e.date==`string`&&typeof e.pocket==`string`&&Number.isSafeInteger(e.mg)))))throw Error(`变更申请库存摘要未完整返回,请重新读取后复核。`);return e}function R(e){let t=L(e),n=t.before,r=t.after,i=(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(q.Fragment,{children:[W.Children.toArray([[`业务日期`,`date`],[`客户称呼/代号`,`customer`],[`开单人`,`salesperson`],[`收款方式与收款人`,`payment_account`],[`客户单备注`,`note`],[`内部备注(客户不可见)`,`internal_note`]].map(([e,t])=>F(e,t===`payment_account`?G(n[t]):n[t],t===`payment_account`?G(r[t]):r[t]))),F(`成交取整方式`,n.rounding_mode===`yuan`?`四舍五入到整数元`:`保留到分`,r.rounding_mode===`yuan`?`四舍五入到整数元`:`保留到分`)]}),F(`新增费用默认支付日期`,n.fees_date||n.date,r.fees_date||r.date)]}),F(`交付日期`,n.delivered_date,r.delivered_date)]}),a=W.Children.toArray([[`成交金额`,`total`],[`收款净额`,`netReceived`],[`货品成本`,`goodsCost`],[`实际费用合计`,`directCost`],[`利润`,`profit`],[`双方待结净额`,`settlementDue`]].map(([e,n])=>F(e,V(t.summary.before[n]),V(t.summary.after[n])))),o=W.Children.toArray(Array.from({length:Math.max(n.lines.length,r.lines.length)},(e,t)=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`tr`,{className:`change-section-row`,children:(0,q.jsxs)(`th`,{colSpan:3,scope:`colgroup`,children:[`商品 `,t+1]})}),W.Children.toArray([[`商品与销售计价说明`,`name`],[`商品编号`,`code`],[`克重/数量`,`quantity`],[`销售金价、工费与件数`,`pricing`],[`成交金额(含附加收费)`,`sale`],[`客户附加收费`,`charges`],[`货盘`,`pocket`],[`出库数量(对)`,`stockCount`],[`货品成本合计`,`cost`],[`进货料价与料费`,`material`],[`进货工费`,`labor`],[`其他货品成本`,`extra`],[`成本付款人`,`payers`]].map(([e,i])=>F(e,P(n.lines[t],i),P(r.lines[t],i))))]}))),s=W.Children.toArray((t.relatedOrders||[]).map(e=>(0,q.jsxs)(`section`,{classNLine truncated
|
||||
`).map((e,t)=>(0,q.jsxs)(W.Fragment,{children:[t>0&&(0,q.jsx)(`br`,{}),e]},t))}function B(e){return e?Re(e):`待补齐`}function V(e){return e==null?`待补齐`:`¥`+He(e)}function ee(e){try{return V(J.cents(e))}catch{return`金额未提供`}}function te(e,{signed:t=!1,unknown:n=`未记录对数`}={}){return Number.isSafeInteger(e)?(t&&Number(e)>0?`+`:``)+e+`对`:n}function H(t){return!!t&&e?.pocketCatalog?.some(e=>e.key===t&&e.countUnit===`pair`)===!0}function U(t){return e?.pocketCatalog?.find(e=>e.key===t)?.name||String(t??``)}function ne(e){if(!e||!Array.isArray(e.lines)||!e.lines.length||!e.lines.every(e=>[`quantity`,`materialReturnedCost`,`laborRestockedCost`,`costLoss`].every(t=>Number.isSafeInteger(e[t])))||!e.summary||![`refundAmount`,`retainedAmount`,`materialReturnedCost`,`laborRestockedCost`,`costLoss`,`directCost`,`profit`,`profitAdjustment`].every(t=>Number.isSafeInteger(e.summary[t])))throw Error(`售后核算资料未完整返回,请重新读取订单。`);return e}function re(e,{preview:t=!1}={}){let n=ne(e),r=n.summary,i=e=>`¥`+He(e),a=[[`实际退款`,r.refundAmount],[`扣留客户款`,r.retainedAmount],[`回料池原料成本`,r.materialReturnedCost],[`现货保留工费`,r.laborRestockedCost],[`本单货品成本损失`,r.costLoss],[`售后最终利润`,r.profit],[`本次售后利润调整`,r.profitAdjustment]];return(0,q.jsxs)(`section`,{className:`order-after-sale-summary`+(t?` is-preview`:``),"aria-label":t?`售后核对预览`:`已保存售后详情`,children:[(0,q.jsxs)(`div`,{className:`panel-title`,children:[(0,q.jsx)(`h3`,{children:t?`售后核对预览`:`售后处理结果`}),(0,q.jsx)(`span`,{className:`badge`,children:t?`尚未保存`:`已记账`})]}),(0,q.jsx)(`dl`,{className:`order-after-sale-totals`,children:W.Children.toArray(a.map(([e,t])=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:e}),(0,q.jsx)(`dd`,{...t<0?{className:`danger-text`}:{},children:i(t)})]})))}),(0,q.jsx)(`div`,{className:`table-wrap`,children:(0,q.jsxs)(`table`,{"aria-label":`逐件售后回库与成本`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:`商品与实际去向`}),(0,q.jsx)(`th`,{children:`实际退回`}),(0,q.jsx)(`th`,{children:`回料成本`}),(0,q.jsx)(`th`,{children:`保留工费`}),(0,q.jsx)(`th`,{children:`成本损失`})]})}),(0,q.jsx)(`tbody`,{children:W.Children.toArray(n.lines.map(e=>(0,q.jsxs)(`tr`,{children:[(0,q.jsxs)(`td`,{children:[e.name||`商品 `+(e.lineIndex+1),(0,q.jsxs)(`div`,{className:`small muted`,children:[U(e.pocket),` · `,e.disposition===`stock`?`完好现货`:`旧料/损坏`]})]}),(0,q.jsxs)(`td`,{children:[De(e.quantity),`g`,e.disposition===`stock`&&H(e.pocket)?(0,q.jsx)(`div`,{className:`small`,children:te(e.stockCount)}):``]}),(0,q.jsx)(`td`,{children:i(e.materialReturnedCost)}),(0,q.jsx)(`td`,{children:i(e.laborRestockedCost)}),(0,q.jsx)(`td`,{children:i(e.costLoss)})]})))})]})}),(0,q.jsx)(`p`,{className:`small muted`,children:`实退材料按原成本回售后日料池,不新增采购付款。完好现货工费留在退回现货批次;旧料工费与未退回材料成本计损失。原单实际费用继续保留。`})]})}function ie(e){let t=e.action||`edit`,n=e.action_input||e.action_details||{};if(t===`edit`)return``;if(n.afterSale){let t=_e(e.after);return(0,q.jsxs)(`section`,{className:`order-change-action-summary`,children:[(0,q.jsx)(`h3`,{children:`本次售后申请`}),(0,q.jsxs)(`p`,{children:[`售后日期:`,n.date,` · 申请原因:`,e.reason]}),re(t,{preview:!0})]})}let r=[[`申请动作`,ce(e)],[`业务日期`,n.date||e.after.returned_date||e.after.date]];return n.amount!==void 0&&r.push([`本次金额`,ee(n.amount)]),n.account&&r.push([`退款账户`,G(n.account)]),n.payer&&r.push([`实际付款人`,B(n.payer)]),n.note&&r.push([`费用项目/说明`,n.note]),n.reference&&r.push([`退款凭据备注`,n.reference]),Array.isArray(n.returnCounts)&&r.push([`实际退回数量(对)`,n.returnCounts.map((e,t)=>`商品 `+(t+1)+`:`+te(e==null?null:Number(e))).join(`
|
||||
`)]),Array.isArray(n.returnPockets)&&r.push([`退货实物去向`,n.returnPockets.map((t,n)=>`${e.before.lines[n]?.name||`商品 `+(n+1)}:${U(t)||`退供应商/不留黄金货盘`}`).join(`
|
||||
`)]),Array.isArray(n.fee_items)&&r.push([`本次旧费用`,n.fee_items.map(e=>`${e.note||`费用`}:${ee(e.amount)} · ${B(e.payer)}支付`).join(`
|
||||
`)]),(0,q.jsxs)(`section`,{className:`order-change-action-summary`,children:[(0,q.jsx)(`h3`,{children:`本次申请动作`}),(0,q.jsx)(`dl`,{className:`order-change-action-facts`,children:W.Children.toArray(r.map(([e,t])=>(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`dt`,{children:e}),(0,q.jsx)(`dd`,{children:z(t)})]})))}),(0,q.jsx)(`p`,{className:`small muted`,children:`下方对照为服务器试算;批准后才登记这笔变更,不会由系统发起真实收款、退款或转账。`})]})}function ae(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未提供`:t.toLocaleString(`zh-CN`)}let oe={pending:`待店主复核`,approved:`已同意变更`,rejected:`已驳回`},se={edit:`修改订单`,expense:`费用补记`,fees:`旧费用核实`,refund:`退款`,return:`退货`,cost:`成本补录`};function ce(e){return(e.action_input||e.action_details)?.afterSale?`处理订单售后`:e.action_label||se[e.action||`edit`]||`订单变更`}let le={pending:`待店主复核`,approved:`已同意取消`,rejected:`已驳回`};function ue(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未提供`:t.toLocaleString(`zh-CN`)}let de=e=>Ne.accountIdentity(ze(),e);function G(e){let t=de(e);return t?Re(t.member)+t.channel:e}function fe(e){if(!e||![`total`,`netReceived`,`directCost`].every(t=>Number.isSafeInteger(e[t]))||![`goodsCost`,`profit`,`settlementDue`].every(t=>e[t]===null||Number.isSafeInteger(e[t]))||!Array.isArray(e.inventory)||!e.inventory.every(e=>typeof e.date==`string`&&typeof e.pocket==`string`&&Number.isSafeInteger(e.mg)))throw Error(`取消撤销摘要未完整返回,请重新读取订单。`);return e}function pe(e=n){let t=K(e)?.data;if(!t?.eligible||t.pending||t.directToday!==!0||!/^\d{4}-\d{2}-\d{2}$/.test(t.directActionDate||``)||e?.date!==t.directActionDate||e?.price_lock_id||![`draft`,`confirmed`,`delivered`].includes(e?.status||``))return!1;try{return fe(t.summary),!0}catch{return!1}}function me(t,r=e.today,i=n){let a=Se(i)?.data;return[`expense`,`fees`,`refund`,`return`].includes(t)&&!!a&&!a.pending&&/^\d{4}-\d{2}-\d{2}$/.test(a.directActionDate||``)&&a.actions?.[t]?.directToday===!0&&i?.date===a.directActionDate&&r===a.directActionDate&&!(o.action===t&&o.forceApproval)}function he(t){return e.user.role===`assistant`&&[`expense`,`fees`,`refund`,`return`,`cost`].includes(t)}function ge(t,n=e.today){return he(t)&&!me(t,n)}function _e(e){return e?.orderAfterSale||null}function ve(){return t?.user?.id||``}function ye(e=n){return e&&i?.id===e.id&&i.user===ve()&&i.revision===e.revision?i:null}function be(e=n){return ye(e)?.data?.pending||e?.ownershipPending||null}function xe(){return t?.user?.id||``}function Se(e=n){return e&&r?.id===e.id&&r.user===xe()&&r.revision===e.revision?r:null}function Ce(e){return Se(e)?.data?.pending||e?.changePending||null}function we(){return t?.user?.id||``}function K(e=n){return e&&a?.id===e.id&&a.user===we()&&a.revision===e.revision?a:null}function Te(e){return K(e)?.data?.pending||e.cancellationPending||null}function Ee(e){if([`afterSale`,`orderAfterSale`].includes(e.kind??``))return``;let t=e.printStatus?.printed;return(0,q.jsx)(`span`,{"data-print-kind":e.printStatus?.kind||(e.kind===`recovery`?`recovery`:`order`),"data-print-id":e.printStatus?.id||e.id,className:`document-print-badge `+(t?`is-printed`:`is-unprinted`),title:t?`已记录打印操作`:`尚未记录打印操作`,children:t?`✓ 已打印`:`未打印`})}let De=Ne.grams,Oe=e=>String(e??``),ke=new Intl.DateTimeFormat(`zh-CN`,{timeZone:`Asia/Shanghai`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),Ae=Ne.validDate;function je(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d{1,3})?)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||!Ae(e.slice(0,10)))return`未记录`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`未记录`;let n=Object.fromEntries(ke.formatToParts(t).map(e=>[e.type,e.value]));return`${n.year}-${n.month}-${n.day} ${n.hour}:${n.minute}`}function Me(e){return(0,q.jsxs)(`div`,{className:`small muted order-entry-time`,children:[`录入时间(北京时间):`,je(e.created)]})}function Pe(e){return![`afterSale`,`orderAfterSale`,`recovery`].includes(e.kind??``)&&Number.isSafeInteger(e.revision)&&e.revision>0&&e.reviewed_revision===e.revision}let Fe={draft:`旧草稿`,confirmed:`旧单待补齐`,delivered:`已完成`,returned:`已退货`,cancelled:`已取消`,after_sale:`售后`,recovery:`回收`},Ie=e=>(0,q.jsx)(`span`,{className:`order-status `+([`draft`,`confirmed`].includes(e.status)?`danger-text`:`muted`),children:Fe[e.status]||e.status}),Le=(e,t,n=``,r={})=>(0,q.jsx)(`button`,{type:`button`,"data-action":t,className:n,...r,children:e});function Re(n){return e?.shopSettings?.members?.find(e=>e.member===n)?.label||e?.members?.find(e=>e.member===n)?.label||t?.loginOptions?.find(e=>e.member===n)?.label||{owner:`麦麦`,assistant:`娜娜`,assistant2:`小昊`}[n??``]||`待确认`}let ze=(
Line truncated
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import{n as e,t}from"./rolldown-runtime-Dl_DZoUm.js";import{A as n,B as r,C as i,D as a,E as o,F as s,I as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,T as g,U as _,V as v,_ as y,a as b,b as x,c as S,d as C,f as w,g as T,h as E,i as D,j as O,k,l as A,m as j,n as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z,w as B,x as V,y as ee,z as H}from"./antd-CChM6Pac.js";import{n as te,t as U}from"./react-Btsc-Yng.js";var ne=t(((e,t,n)=>{var r;(function(n,i){typeof e==`object`&&t!==void 0?t.exports=i():typeof r==`function`&&r.amd?r(i):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=i()})(n,(function(){var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof E||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new E(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var E=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);ifLine truncated
|
||||
0.58×(822+45)+55=558
|
||||
769+558=1327`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&r.trim()&&(e.preventDefault(),c(!1))}}),(0,K.jsxs)(o,{wrap:!0,style:{marginTop:8},children:[(0,K.jsx)(l,{type:`primary`,onClick:()=>c(!1),children:`识别并预填`}),a?.kind===`warning`&&(0,K.jsx)(l,{onClick:()=>c(!0),children:`按计算金额预填`}),r&&(0,K.jsx)(l,{onClick:()=>{i(``),s(null)},children:`清空公式`})]}),(0,K.jsx)(`p`,{className:`small muted`,children:`括号内是克工费;金价乘克重后加的是一件工费,再加的金额记为附加费。合计行只校验,不增加商品。客户、货盘及内部成本仍按实际填写。`}),a&&(0,K.jsx)(H,{role:`status`,type:a.kind===`note`?`success`:a.kind,message:a.title||(a.kind===`error`?a.lines[0]:``),description:a.kind===`error`?void 0:(0,K.jsx)(`div`,{children:a.lines.filter(Boolean).map((e,t)=>(0,K.jsx)(`p`,{children:e},t))})})]})}function In({order:e,error:t,onRetry:r,onPreview:i,onNew:a}){let{message:u}=c.useApp(),[f,p]=(0,W.useState)(!1),m=e.total!==void 0;async function h(){if(e.paper_number)try{await navigator.clipboard.writeText(e.paper_number),p(!0),u.success(`已复制纸单号 `+e.paper_number),window.setTimeout(()=>p(!1),1800)}catch{p(!1),u.info(`请手动选择纸单号复制`)}}return(0,K.jsx)(`div`,{className:`issued-page`,children:(0,K.jsx)(n,{className:`issued-card`,children:(0,K.jsx)(y,{status:`success`,title:`销售单据已生成`,subTitle:m?e.materialCostPending?`收款、费用和出库已记账;料费待补,补足购料后自动核算利润。`:`收款、费用、出库和利润已记账。`:t||`正在读取已生成的销售单…`,extra:(0,K.jsxs)(o,{direction:`vertical`,size:`large`,style:{width:`100%`},children:[m&&(0,K.jsxs)(`dl`,{className:`issued-summary`,"data-testid":`issued-summary`,children:[(0,K.jsxs)(`div`,{className:`issued-item`,children:[(0,K.jsx)(`dt`,{children:(0,K.jsx)(C.Text,{type:`secondary`,children:`纸单号`})}),(0,K.jsxs)(`dd`,{className:`issued-value-row`,children:[(0,K.jsx)(`span`,{className:`issued-value num`,"data-testid":`issued-paper-number`,children:e.paper_number||`未分配`}),e.paper_number&&(0,K.jsx)(d,{title:f?`已复制`:`复制纸单号`,children:(0,K.jsx)(l,{type:`text`,size:`small`,className:`issued-copy-btn`,"aria-label":`复制纸单号`,icon:f?(0,K.jsx)(s,{}):(0,K.jsx)(w,{}),onClick:()=>void h()})})]})]}),(0,K.jsxs)(`div`,{className:`issued-item`,children:[(0,K.jsx)(`dt`,{children:(0,K.jsx)(C.Text,{type:`secondary`,children:`成交合计`})}),(0,K.jsx)(`dd`,{className:`issued-value issued-total num`,"data-testid":`issued-total`,children:ut(e.total??null,e.rounding_mode||`cent`)})]}),e.customer&&(0,K.jsxs)(`div`,{className:`issued-item`,children:[(0,K.jsx)(`dt`,{children:(0,K.jsx)(C.Text,{type:`secondary`,children:`客户`})}),(0,K.jsx)(`dd`,{className:`issued-value small`,children:e.customer})]})]}),(0,K.jsxs)(`div`,{className:`issued-actions`,children:[(0,K.jsx)(l,{type:`primary`,size:`large`,icon:(0,K.jsx)(F,{}),href:`/print/`+encodeURIComponent(e.id)+`?mode=full`,onClick:()=>{i().catch(e=>u.error(e.message))},target:`_blank`,rel:`noopener`,"data-action":`print-preview`,children:`打开打印预览`}),(0,K.jsx)(l,{size:`large`,icon:(0,K.jsx)(O,{}),onClick:a,"data-action":`new-order`,children:`开始新的一单`}),!m&&(0,K.jsx)(l,{size:`large`,onClick:r,children:`重新读取订单`})]}),(0,K.jsx)(l,{href:ve(`orders`)+`?order=`+encodeURIComponent(e.id),onClick:t=>{t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),G(`orders`,{search:`?order=`+encodeURIComponent(e.id)}))},type:`link`,icon:(0,K.jsx)(g,{}),children:`查看订单详情`})]})})})})}function Ln(e){let{client:t,state:n}=e,r=ke(`draft`),[i,a]=(0,W.useState)(r?null:{draft:Pt(window.localStorage,n.user.id),note:``});return(0,W.useEffect)(()=>{if(!r)return;let e=!0;return(async()=>{try{if(n.user.role!==`owner`)throw Error(`已有草稿由店主继续填写并开单;无单号的新开单流程照常使用。`);let i=await t.api(`/api/orders/`+encodeURIComponent(r));if(i.status!==`draft`)throw Error(`这张订单不是未开单的旧草稿,请在订单页查看。`);e&&a({draft:J.draftInputs(i),note:`正在继续填写旧草稿,生成销售单据后完成记账。`})}catch(t){e&&a({draft:Pt(window.localStorage,n.user.id),note:`旧草稿未能打开:`+t.message})}})(),()=>{e=!1}},[t,r,n.user.id,n.user.role]),i?(0,K.jsx)(Rn,{...e,initialDraft:i.draft,initialNote:i.note}):(0,K.jsx)(`div`,{className:`page-loading`,children:(0,K.jsx)(V,{tip:`正在读取旧草稿…`,children:(0,K.jsx)(`div`,{style:{height:60}})})})}function Rn({client:e,state:t,session:n,refreshState:r,onAccountChanged:i,onRecoverOther:a,initialDraft:o,initialNote:s}){let{message:u}=c.useApp();Ae(e);let{store:d,update:f,reset:p,ctx:m,poolError:h,loadPools:g}=$t({client:e,state:t,session:n,initialDraft:o}),{form:_,summary:v}=d,[y,b]=(0,W.useState)(``),[x,w]=(0,W.useState)(!1),[T,E]=(0,W.useState)(null),D=T!==null,O
Line truncated
|
||||
`),u=e=>e?.exchange?.fee_items.map(e=>`${e.note}:${e.amount}元 · ${o(e.payer)}付款`).join(`
|
||||
`)||`无`,d=e=>e?.exchange?.charges.map(e=>`${e.name}:${e.amount}元`).join(`
|
||||
`)||`无`,f=n.exchange||{},p=r?.exchange||{},m=e=>e?.mode===`pool`?`料池 `+e.poolId:e?`手填 `+e.rate+`元/克`:`无补金差重`,h=e=>e?e.mode===`gram`?e.rate+`元/克`:e.amount+`元总工费`:`未提供`;if(i.push(a(`业务日期`,n.date,r?.date||`取消原记录`),a(`客户`,n.customer,r?.customer),a(`开单人`,n.salesperson,r?.salesperson),a(`归属`,o(n.member),r?o(r.member):`沿用原身份留档`),a(`旧料逐项称重`,l(n),r?l(r):`冲正原库存及关联购料`),a(`旧料入库货盘`,s(n.old_pocket??`回收旧料`),r?s(r.old_pocket??`回收旧料`):`冲回原入库货盘`),a(`旧料入库数量(对)`,ia(n.old_stock_count==null?null:Number(n.old_stock_count)),r?ia(r.old_stock_count==null?null:Number(r.old_stock_count)):`冲回原入库数量`),a(`回收单价(元/克)`,n.buy_rate,r?.buy_rate),a(`回收结算额(元)`,n.buy_total,r?.buy_total),a(`实际收付款账户`,c(n.payment_account),r?c(r.payment_account):`冲正原收付记录`),a(`付款人`,o(n.payer),r?o(r.payer):`原付款流水保留`),a(`备注`,n.note,r?.note)),(n.surplus_mode===`deposit`||r?.surplus_mode===`deposit`)&&i.push(a(`余料处理`,n.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`,r?r.surplus_mode===`deposit`?`寄存,暂不结算`:`按回收价结算`:`撤回本单寄存余料`)),(n.old_source===`deposit`||r?.old_source===`deposit`)&&i.push(a(`使用客户寄存料`,n.old_source===`deposit`?n.deposit_id+` · `+n.deposit_weight+`g`:`本次交来旧料`,r?.old_source===`deposit`?r.deposit_id+` · `+r.deposit_weight+`g`:r?`本次交来旧料`:`退回寄存账户`)),n.exchange?.items||r?.exchange?.items){let e=e=>(e?.exchange?.items||[]).map((e,t)=>t+1+` · `+e.exchange.name+(e.old_source===`deposit`?` · 寄存记录 `+e.deposit_id+` 使用 `+e.deposit_weight+`g`:``)+(e.surplus_mode===`deposit`?` · 余料寄存,暂不结算`:``)+` · 旧料 `+e.old_lines.map(e=>e.melted_weight+`g × `+e.purity+`%`).join(`+`)+` 入`+s(e.old_pocket)+` · 新货 `+e.exchange.quantity+`g `+(s(e.exchange.pocket)||`外配`)+` · 补金 `+e.exchange.gold_price+`元/g · 折旧 `+e.exchange.depreciation_weight+`g × `+e.exchange.depreciation_rate+`元/g · 回收 `+e.buy_rate+`元/g,`+e.buy_total+`元 · 料费 `+JSON.stringify(e.exchange.cost_material)+` · 料费付款 `+o(e.exchange.cost_material_payer)+` · 进货工费 `+JSON.stringify(e.exchange.cost_labor)+`,`+o(e.exchange.cost_labor_payer)).join(`;`);i.push(a(`逐件置换完整资料`,e(n),r?e(r):`全部冲回`))}if(n.exchange?.products||r?.exchange?.products){let e=e=>(e?.products??(e?[e]:[])).map((e,t)=>t+1+` · `+e.name+` · `+e.quantity+`g · `+(s(e.pocket)||`外配`)+` · 销售工费 `+e.labor_rate+(e.labor_mode===`total`?`元`:`元/克`)+` · 进货工费 `+(e.cost_labor?.rate??e.cost_labor?.amount??`待补`)+` · `+o(e.cost_labor_payer)+(e.stockCount==null?``:` · `+e.stockCount+`对`)).join(`;`);i.push(a(`逐件置换商品`,e(n.exchange),r?e(r.exchange):`冲回全部新货出库`))}n.mode===`exchange`&&i.push(a(`置换新货`,f.name,p.name),a(`新货克重(g)`,f.quantity,p.quantity),a(`实际货盘`,s(f.pocket)||`外配`,r?s(p.pocket)||`外配`:`冲回原出库货盘`),a(`出库数量(对)`,ia(f.stockCount==null?null:Number(f.stockCount)),ia(p.stockCount==null?null:Number(p.stockCount))),a(`销售金价(元/克)`,f.gold_price,p.gold_price),a(`销售工费`,f.labor_rate+`元/`+(f.labor_mode===`gram`?`克`:`总额`),r?p.labor_rate+`元/`+(p.labor_mode===`gram`?`克`:`总额`):`取消`),a(`折旧计费克重/单价`,f.depreciation_weight+`g × `+f.depreciation_rate+`元/克`,r?p.depreciation_weight+`g × `+p.depreciation_rate+`元/克`:`取消`),a(`附加收费`,d(n),r?d(r):`取消`),a(`优惠(元)`,f.discount,p.discount),a(`取整方式`,f.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`,r?p.rounding_mode===`yuan`?`四舍五入到元`:`保留到分`:`取消`),a(`补金差重进货来源`,m(f.cost_material),r?m(p.cost_material):`释放原耗用`),a(`料费付款人`,o(f.cost_material_payer),r?o(p.cost_material_payer):`原来源留档`),a(`进货工费`,h(f.cost_labor),r?h(p.cost_labor):`取消`),a(`工费付款人`,o(f.cost_labor_payer),r?o(p.cost_labor_payer):`原来源留档`),a(`实际费用`,u(n),r?u(r):`冲正原费用`));let g=e.summary.before||{},_=e.summary.after||{};return i.push(...[[`实际收客户`,`cashReceipt`],[`实际付客户`,`cashPayment`],[`购料成本`,`purchaseAmount`],[`订单货品成本`,`goodsCost`],[`实际费用`,`directCost`],[`原账利润`,`profit`]].map(([e,t])=>a(e,g[t]==null?`待核实`:`¥`+lt(g[t]),r?_[t]==null?`待核实`:`¥`+lt(_[t]):`取消后冲正`))),(0,K.jsxs)(K.Fragment,{children:[e.summary.legacyCountNotice&&(0,K.jsxs)(`p`,{children:[e.summary.legacyCountNotice,e.summary.legacyCountVerified&&`(申请人已确认)`]}),(0,K.jsx)(`div`,{className:`table-wrap`,children:(0,K.jsx)(ir,{"aria-label":`回收更正原值与申请值`,columns:[{title:`核对Line truncated
|
||||
`)}function a(){return e?.shopSettings?.storeName||e?.printing?.store||t?.brand?.storeName||`珠宝台账`}function o(e=!1,{historical:t=!1,selected:n=``}={}){let r=(t?V():ee()).filter(e=>c()||e!==`assistant2`);e&&(r=[...r.filter(e=>e!==`owner`),...r.filter(e=>e===`owner`)]);let i=r.map(e=>[e,R(e)+(t&&!H(e)?`(已停用)`:``)]);return n&&V().includes(n)&&!r.includes(n)&&i.push([n,R(n)+`(已停用 · 原记录)`]),i}function s(){return e?.user?.member||t?.user?.member||(e?.user?.role===`owner`?`owner`:`assistant`)}function c(){return!!(e?.user?.member||e?.members?.some(e=>e.member===`assistant2`))}let l=Fe.validDate;function u(e){return e==null?`待确认`:`¥`+m(e)}function d(e){let{total:t,complete:n,amounts:r}=As.reimbursementAmounts(e,q.cents);return{total:t,complete:n,formula:r.map(e=>`¥`+m(e)).join(` + `)}}function f(e){return[...te(),`owner`].filter(t=>e&&Object.hasOwn(e,t))}function p(e,t){let n=e.unknownCounts?.[t]||0;return n&&e.knownCounts?.[t]===0&&!e[t]&&!e.afterSaleCount?`待补齐`:(n?`已知 `:``)+`¥`+m(e[t])}let m=e=>e==null?`待补`:Fe.yuan(e);function h(e){return e.from===e.date?e.date:e.from+` 至 `+e.date}function g(e){let t=U(e);return t?R(t.member)+t.channel:e}function _(e,t,n=!1){return e===null?(n?`待核算(已核算 ¥`:`待补齐(已知 ¥`)+m(t)+`)`:`¥`+m(e)}function v(e){let t=e.summary,n=e.receiptsByOrderDate;return[a()+`三人账 · `+h(e),`利润留在店里,按订单归属分别记业绩。经营款各自管理;未导入真实期初经营款。`,...W(e.peopleCount),`销售净额:`+p(t,`sale`),`本期净利润:`+p(t,`profit`),`本期实收:¥`+m(n.receipt)+`;本期实退:¥`+m(n.refund),...D(e),...O(e),...k(e),...A(e),`按实际付款人核对成本`,...f(e.payerCosts).flatMap(t=>{let n=e.payerCosts[t];return[R(t)+`:实际货品支出 `+y(n.goods,n.missingCount)+`;已付费用 ¥`+m(n.paidFees),...Ms(n).map(e=>e.date+` / `+x(e)+` / `+e.name+` / `+C(e))]}),`订单与售后`,...e.orderRows.map(e=>e.date+` / `+(e.paper_number||e.number||e.project)+` / `+(e.customer||`未填客户`)+` / `+R(e.member)+` / 销售 `+E(e,`sale`)+` / 净利润 `+E(e,`profit`)),`历史两人结算不计入团队新债务。`].join(`
|
||||
`)}function y(e,t=0){return t&&e===0?`待补齐`:(t?`已知 `:``)+`¥`+m(e)}function b(e){return[e.missingCount?e.missingCount+` 项成本待补齐`:``,e.pendingCount?e.pendingCount+` 项费用未入账,不计合计`:``].filter(Boolean).join(`;`)}function x(e){return e.materialPoolId?e.materialPoolId+` 购料`:e.kind===`afterSale`?`售后 · `+(e.customer||`未填客户`):(e.price_lock_id?`锁价 · `:``)+(e.paper_number||e.number||`锁价记录`)+(e.customer?` · `+e.customer:``)}function S(e){let t=e.calculation;return t?M(t.quantity)+`g × `+(t.rate==null?e.component===`material`?`每克料价待补齐`:`每克工费待补齐`:m(t.rate)+`元/克`)+(e.amount==null?``:` = `+m(e.amount)+`元`):``}function C(e){return e.kind===`pending`?`未入账`+(e.amount==null?`(金额待补)`:`(登记 ¥`+m(e.amount)+`)`):e.amount==null?`待补齐`:`¥`+m(e.amount)}function w(e){return e.costItems?.[0]?.payer?R(e.costItems[0].payer):`付款人待补`}let T={draft:`旧草稿`,confirmed:`旧单待补齐`,delivered:`已完成`,returned:`已退货`,cancelled:`已取消`,after_sale:`售后`,recovery:`回收`};function E(e,t){if(e.status===`draft`)return`未开单`;if(t===`goods`){let t=Ns(e);return y(t.goods,t.missing)}return t===`paidFees`?`¥`+m(Ns(e).paidFees):e[t]==null?e.known?.[t]?`已知 ¥`+m(e.known[t])+`(待补齐)`:`待补齐`:`¥`+m(e[t])}function D(e){let t=e.dailyProfits,n=e=>`销售净额 ¥${m(e.sales)} / 成本 ${_(e.totalCost,e.knownTotalCost)} / 利润 ${_(e.profit,e.knownProfit,!0)}`;return[`每日利润表(按日期与订单归属人;普通订单按开单日、锁价成单按交付日、售后按记录日)`,...t.rows.length?t.rows.map(e=>`${e.date} / ${e.name} / ${n(e)}`):[`所选范围暂无订单或售后记录。`],`所选范围合计:${n(t.summary)}`,``]}function O(e){return[`按订单归属核对净收入(收款减退款,已含他人代收,尚未扣成本与费用)`,...K(e).flatMap(t=>{let n=e.ownershipReceipts[t];return[`${n.name}所属订单净收入:¥${m(n.net)};实收 ¥${m(n.receipt)};实退 ¥${m(n.refund)}`,...n.accounts.map(e=>`${e.recipient===n.member?`本人收款`:`他人代收`} / ${g(e.account)}:实收 ¥${m(e.receipt)},实退 ¥${m(e.refund)},净额 ¥${m(e.net)}`),...ie(e.ownershipBusiness[t]),``]})]}function k(e){let t={date:e.date,from:e.from,month:n},r=e.dailyFunds;if(r?.team)return[`每日报销单(按报销日期归集,已批准报销不在当日订单往来重复相加)`,...r.reimbursements.flatMap(e=>[`${e.date} / ${e.requester_name} / ${z[e.status]} / 合计 ¥${m(e.total)}`,...e.items.map(e=>`${e.name}:¥${m(e.amount)}`)]),``];if(!r||r.rangeUnsupported)return[`每天转账核对`,`尚未取得完整转账资料,不输出应转金额。`,``];try{De(r,t)}catch{return[`每天转账核对`,`资料未完整返回,不输出应转金额。`,``]}let i=[`每天转账核对(应转合计,未扣已转)`,`${R(`owner`)}实收 ¥${m(r.ownerReceipts.receipt)} − 实退 ¥${m(r.ownerReceipts.refund)} = 净收款 ¥${m(r.ownerReceipts.net)}`];r.ready?i.push(`${R(`owner`)}净收款 ¥${m(r.ownerReceipts.net)} − 确认完整对外支出 ¥${m(r.actualOutlay)} + 已批准报销 ¥${m(r.approvedReimbursements)} = 应转合计 ¥${m(r.transferAmount)}`,(r.transferAmount??0)>0?`方向:`+R(`owner`)+`转`+R(`assistant`):(r.transferAmount??0)<0?`方向:`+R(`assistant`)+`转`+R(`owner`):`方向:无需转款`):i.push(`当天完整支出尚未全部确认,暂不输出完整应转合计。`,...r.missingDates.length?[`待确认日期:`+r.missingDates.join(`、`)]:[],...r.staleDates.length?[`来源变动待重新确认:`+r.staleDates.join(`、`)]:[]),i.push(`不要与旧按单/剩料待结重复相加;报销与确认不扣订单利润。`,`已批准报销项目(按报销日期归集)`);let a=r.reimbursements.filter(e=>e.status===`approved`);return i.push(...a.length?a.flatMap(e=>[`${e.date} / ${e.requester_name} / 合计 ¥${m(e.total)} / ${e.reviewer_name||R(`owner`)}复核`,...e.items.map(e=>`${e.name}:¥${m(e.amount)}`)]):[`本期暂无已批准报销。`],``),i}function A(e){return[`按收款人汇总(普通订单按开单日归集当前收付,锁价按实际收付日归集;负数为冲回)`,...f(e.recipientReceipts).flatMap(t=>{let n=e.recipientReceipts[t];return[`${n.name}总收款:¥${m(n.receipt)};退款 ¥${m(n.refund)};净收款 ¥${m(n.net)}`,...[`receipt`,`refund`].flatMap(e=>{let t=n.items.filter(t=>t.kind===e),r=e===`receipt`?`收款`:`退款`;return[`${n.name}${r}明细(日期为实际${r}日):`,...t.length?t.map(e=>`${e.date} / ${ae(e)} / ${e.paper_number||e.number||(e.price_lock_id?`锁价记录`:`订单记录`)} / 客户 ${e.customer||`未填客户称呼`} / ${g(e.account)} / ${oe(e)} ¥${m(e.amount)}${e.reference||e.note?` / `+(e.reference||e.note):``}`):[`所选范围没有`+n.name+r+`记录。`],`${r}明细合计:¥${m(n[e])}`]}),``]})]}function j(e){if(!e?.summary?.eventC
Line truncated
|
||||
|
||||
`)||`无已记费用`}function M(e){let t=new Set((e.corrections||[]).filter(e=>e.type===`payment`).map(e=>e.target));return e.payments.filter(e=>e.amount>0&&!t.has(e.id)).map(e=>`${e.date} · ${e.kind===`receipt`?`客户收款`:`客户退款`}\n${V(e.amount)} · ${e.account?fe(e.account):`账户未提供`}`).join(`
|
||||
|
||||
`)||`无有效收退款`}function N(e,t,n=`锁价购料成本`){if(!e.priceLockCosts&&!t.priceLockCosts)return``;if(e.priceLockCosts?.lines||t.priceLockCosts?.lines){let n=e.priceLockCosts||{},r=t.priceLockCosts||{},i=n.lines||r.lines;return W.Children.toArray(i.map((e,t)=>{let i=n.lines?.find(t=>t.lineId===e.lineId)||{},a=r.lines?.find(t=>t.lineId===e.lineId)||{};return N({priceLockCosts:{...i,date:n.date}},{priceLockCosts:{...a,date:r.date}},`商品 `+(t+1)+` · 锁价购料成本`)}))}let r=e.priceLockCosts||{},i=t.priceLockCosts||{},a=e=>e===`pool`?`原锁料池`:e===`manual`?`手填原锁料价`:`未提供`;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`tr`,{className:`change-section-row`,children:(0,K.jsx)(`th`,{colSpan:3,scope:`colgroup`,children:n})}),F(`原锁日期`,r.date,i.date),F(`原锁料费来源`,a(r.materialSource),a(i.materialSource)),F(`原锁进货料价(每克)`,V(r.buyRate),V(i.buyRate)),F(`原锁料费付款人`,r.materialSource===`pool`?`按原锁料池分摊`:B(r.buyPayer),i.materialSource===`pool`?`按原锁料池分摊`:B(i.buyPayer)),F(`原锁整批料费`,V(r.materialAmount),V(i.materialAmount)),F(`补重进货料价(每克)`,V(r.extraRate),V(i.extraRate)),F(`补重料费付款人`,r.extraPayer?B(r.extraPayer):`无补重`,i.extraPayer?B(i.extraPayer):`无补重`)]})}function P(e,t){if(!e)return`无此商品`;let n=V;if(t===`name`)return`${e.name||`未填写`}${e.priceNote?`
|
||||
`+e.priceNote:``}`;if(t===`code`)return e.code||`未填写`;if(t===`quantity`)return e.unit===`g`?Oe(e.quantity)+`g`:String(e.quantity)+`件`;if(t===`sale`)return n(e.sale);if(t===`pricing`)return e.goldPrice==null?`手填基础金额 ${n(e.baseSale??e.sale)}`:`销售金价 ${n(e.goldPrice)}/克\n${e.laborMode===`gram`?`销售克工费`:`销售件工费`} ${n(e.laborRate)}${e.laborMode===`gram`?`/克`:`/件`}\n件数 ${e.pieces??`未填写`}`;if(t===`stockCount`)return Number.isSafeInteger(e.stockCount)||te(e.pocket)?H(e.stockCount):`不记录对数`;if(t===`pocket`)return U(e.pocket)||`外配/不扣黄金`;if(t===`charges`)return e.charges?.length?e.charges.map(e=>`${e.name}:${n(e.amount)}`).join(`
|
||||
`):`无附加收费`;if(t===`cost`)return n(e.cost);if(t===`material`){let t=e.costMaterial;return t?.mode===`pool`?`每日购料:${t.poolId}\n本行料费:${n(e.costParts?.material)}${e.materialPool?.allocations?.length?`
|
||||
`+e.materialPool.allocations.map(e=>B(e.payer)+` `+n(e.amount)).join(`;`):e.costParts?.material==null?`
|
||||
待补采购后分摊`:``}`:`${t?.mode===`gram`?`每克料价 `+n(t.rate)+`/克`:`料费总额`}\n${n(e.costParts?.material)}`}return t===`labor`?`${e.costLabor?.mode===`gram`?`进货克工费 `+n(e.costLabor.rate)+`/克`:`进货总工费`}\n${n(e.costParts?.labor)}`:t===`extra`?e.costParts?`配件 ${n(e.costParts.accessories)}\n其他 ${n(e.costParts.other)}`:`原货品成本未分项`:t===`payers`?`料费:${e.costMaterial?.mode===`pool`?e.materialPool?.allocations?.map(e=>B(e.payer)+` `+n(e.amount)).join(`;`)||`按真实采购分摊`:B(e.costPayers?.material??e.payer)}\n进货工费:${B(e.costPayers?.labor??e.payer)}\n配件及其他:${B(e.payer)}`:``}function F(e,t,n){let r=String(t??``)!==String(n??``);return(0,K.jsxs)(`tr`,{...r?{className:`order-change-modified`}:{},children:[(0,K.jsxs)(`th`,{scope:`row`,children:[e,r?(0,K.jsx)(`span`,{className:`change-mark`,children:`已修改`}):``]}),(0,K.jsx)(`td`,{children:z(t)}),(0,K.jsx)(`td`,{children:z(n)})]})}function I(e){if(e===void 0)return[];let t=e=>e===null||Number.isSafeInteger(e)&&e>=0,n=e=>e&&t(e.materialAmount)&&[`usedMaterialAmount`,`leftoverCost`].every(n=>!Object.hasOwn(e,n)||t(e[n]))&&Array.isArray(e.allocations)&&e.allocations.every(e=>Be().includes(e.payer)&&Number.isSafeInteger(e.amount)&&e.amount>=0)&&(e.materialAmount===null||e.allocations.reduce((e,t)=>e+t.amount,0)===e.materialAmount);if(!Array.isArray(e)||!e.every(e=>e&&typeof e.id==`string`&&e.id&&je(e.date)&&n(e.before)&&n(e.after)))throw Error(`关联锁价单的成本影响未完整返回,请重新读取后复核。`);return e}function L(e,t=void 0){let n=t=>t&&t.id===e.order_id&&Number.isSafeInteger(t.total)&&Array.isArray(t.lines)&&Array.isArray(t.expenses)&&Array.isArray(t.payments),r=e=>e===null||Number.isSafeInteger(e);if(!e||typeof e.id!=`string`||!e.id||typeof e.order_id!=`string`||t&&e.order_id!==t||!Object.hasOwn(oe,e.status)||!Number.isSafeInteger(e.order_revision)||typeof e.reason!=`string`||typeof e.requester_name!=`string`||typeof e.created!=`string`||typeof e.stale!=`boolean`||typeof e.canApprove!=`boolean`||!n(e.before)||!n(e.after)||![`before`,`after`].every(t=>e.summary?.[t]&&[`total`,`netReceived`,`directCost`].every(n=>Number.isSafeInteger(e.summary[t][n]))&&[`goodsCost`,`profit`,`settlementDue`].every(n=>r(e.summary[t][n]))))throw Error(`修改申请资料未完整返回,请重新读取订单后复核。`);if(e.relatedOrders!==void 0){if(!Array.isArray(e.relatedOrders))throw Error(`关联订单的修改影响未完整返回,请重新读取后复核。`);e.relatedOrders.forEach(t=>L({...e,order_id:t.id,before:t.before,after:t.after,summary:t.summary,relatedOrders:[]}))}if(I(e.relatedPriceLocks),e.action!==void 0&&!Object.hasOwn(se,e.action))throw Error(`变更申请类型未完整返回,请重新读取后复核。`);let i=e.summary.inventory;if(i!==void 0&&(!i||![`before`,`after`,`changes`].every(e=>Array.isArray(i[e])&&i[e].every(e=>typeof e.date==`string`&&typeof e.pocket==`string`&&Number.isSafeInteger(e.mg)))))throw Error(`变更申请库存摘要未完整返回,请重新读取后复核。`);return e}function R(e){let t=L(e),n=t.before,r=t.after,i=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(K.Fragment,{children:[W.Children.toArray([[`业务日期`,`date`],[`客户称呼/代号`,`customer`],[`开单人`,`salesperson`],[`收款方式与收款人`,`payment_account`],[`客户单备注`,`note`],[`内部备注(客户不可见)`,`internal_note`]].map(([e,t])=>F(e,t===`payment_account`?fe(n[t]):n[t],t===`payment_account`?fe(r[t]):r[t]))),F(`成交取整方式`,n.rounding_mode===`yuan`?`四舍五入到整数元`:`保留到分`,r.rounding_mode===`yuan`?`四舍五入到整数元`:`保留到分`)]}),F(`新增费用默认支付日期`,n.fees_date||n.date,r.fees_date||r.date)]}),F(`交付日期`,n.delivered_date,r.delivered_date)]}),a=W.Children.toArray([[`成交金额`,`total`],[`收款净额`,`netReceived`],[`货品成本`,`goodsCost`],[`实际费用合计`,`directCost`],[`利润`,`profit`],[`双方待结净额`,`settlementDue`]].map(([e,n])=>F(e,V(t.summary.before[n]),V(t.summary.after[n])))),o=W.Children.toArray(Array.from({length:Math.max(n.lines.length,r.lines.length)},(e,t)=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`tr`,{className:`change-section-row`,children:(0,K.jsxs)(`th`,{colSpan:3,scope:`colgroup`,children:[`商品 `,t+1]})}),W.Children.toArray([[`商品与销售计价说明`,`name`],[`商品编号`,`code`],[`克重/数量`,`quantity`],[`销售金价、工费与件数`,`pricing`],[`成交金额(含附加收费)`,`sale`],[`客户附加收费`,`charges`],[`货盘`,`pocket`],[`出库数量(对)`,`stockCount`],[`货品成本合计`,`cost`],[`进货料价与料费`,`material`],[`进货工费`,`labor`],[`其他货品成本`,`extra`],[`成本付款人`,`payers`]].map(([e,i])=>F(e,P(n.lines[t],i),P(r.lines[t],i))))]}))),s=W.Children.toArray((t.relatedOrders||[]).map(e=>(0,K.jsxs)(`section`,{clasLine truncated
|
||||
`).map((e,t)=>(0,K.jsxs)(W.Fragment,{children:[t>0&&(0,K.jsx)(`br`,{}),e]},t))}function B(e){return e?ze(e):`待补齐`}function V(e){return e==null?`待补齐`:`¥`+Ue(e)}function ee(e){try{return V(q.cents(e))}catch{return`金额未提供`}}function H(e,{signed:t=!1,unknown:n=`未记录对数`}={}){return Number.isSafeInteger(e)?(t&&Number(e)>0?`+`:``)+e+`对`:n}function te(t){return!!t&&e?.pocketCatalog?.some(e=>e.key===t&&e.countUnit===`pair`)===!0}function U(t){return e?.pocketCatalog?.find(e=>e.key===t)?.name||String(t??``)}function ne(e){if(!e||!Array.isArray(e.lines)||!e.lines.length||!e.lines.every(e=>[`quantity`,`materialReturnedCost`,`laborRestockedCost`,`costLoss`].every(t=>Number.isSafeInteger(e[t])))||!e.summary||![`refundAmount`,`retainedAmount`,`materialReturnedCost`,`laborRestockedCost`,`costLoss`,`directCost`,`profit`,`profitAdjustment`].every(t=>Number.isSafeInteger(e.summary[t])))throw Error(`售后核算资料未完整返回,请重新读取订单。`);return e}function re(e,{preview:t=!1}={}){let n=ne(e),r=n.summary,i=e=>`¥`+Ue(e),a=[[`实际退款`,r.refundAmount],[`扣留客户款`,r.retainedAmount],[`回料池原料成本`,r.materialReturnedCost],[`现货保留工费`,r.laborRestockedCost],[`本单货品成本损失`,r.costLoss],[`售后最终利润`,r.profit],[`本次售后利润调整`,r.profitAdjustment]];return(0,K.jsxs)(`section`,{className:`order-after-sale-summary`+(t?` is-preview`:``),"aria-label":t?`售后核对预览`:`已保存售后详情`,children:[(0,K.jsxs)(`div`,{className:`panel-title`,children:[(0,K.jsx)(`h3`,{children:t?`售后核对预览`:`售后处理结果`}),(0,K.jsx)(`span`,{className:`badge`,children:t?`尚未保存`:`已记账`})]}),(0,K.jsx)(`dl`,{className:`order-after-sale-totals`,children:W.Children.toArray(a.map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:e}),(0,K.jsx)(`dd`,{...t<0?{className:`danger-text`}:{},children:i(t)})]})))}),(0,K.jsx)(`div`,{className:`table-wrap`,children:(0,K.jsx)(ir,{"aria-label":`逐件售后回库与成本`,columns:[{title:`商品与实际去向`},{title:`实际退回`},{title:`回料成本`},{title:`保留工费`},{title:`成本损失`}],rows:n.lines.map((e,t)=>({key:t,cells:[(0,K.jsxs)(K.Fragment,{children:[e.name||`商品 `+(e.lineIndex+1),(0,K.jsxs)(`div`,{className:`small muted`,children:[U(e.pocket),` · `,e.disposition===`stock`?`完好现货`:`旧料/损坏`]})]}),(0,K.jsxs)(K.Fragment,{children:[Oe(e.quantity),`g`,e.disposition===`stock`&&te(e.pocket)?(0,K.jsx)(`div`,{className:`small`,children:H(e.stockCount)}):``]}),i(e.materialReturnedCost),i(e.laborRestockedCost),i(e.costLoss)]}))})}),(0,K.jsx)(`p`,{className:`small muted`,children:`实退材料按原成本回售后日料池,不新增采购付款。完好现货工费留在退回现货批次;旧料工费与未退回材料成本计损失。原单实际费用继续保留。`})]})}function ie(e){let t=e.action||`edit`,n=e.action_input||e.action_details||{};if(t===`edit`)return``;if(n.afterSale){let t=ve(e.after);return(0,K.jsxs)(`section`,{className:`order-change-action-summary`,children:[(0,K.jsx)(`h3`,{children:`本次售后申请`}),(0,K.jsxs)(`p`,{children:[`售后日期:`,n.date,` · 申请原因:`,e.reason]}),re(t,{preview:!0})]})}let r=[[`申请动作`,ce(e)],[`业务日期`,n.date||e.after.returned_date||e.after.date]];return n.amount!==void 0&&r.push([`本次金额`,ee(n.amount)]),n.account&&r.push([`退款账户`,fe(n.account)]),n.payer&&r.push([`实际付款人`,B(n.payer)]),n.note&&r.push([`费用项目/说明`,n.note]),n.reference&&r.push([`退款凭据备注`,n.reference]),Array.isArray(n.returnCounts)&&r.push([`实际退回数量(对)`,n.returnCounts.map((e,t)=>`商品 `+(t+1)+`:`+H(e==null?null:Number(e))).join(`
|
||||
`)]),Array.isArray(n.returnPockets)&&r.push([`退货实物去向`,n.returnPockets.map((t,n)=>`${e.before.lines[n]?.name||`商品 `+(n+1)}:${U(t)||`退供应商/不留黄金货盘`}`).join(`
|
||||
`)]),Array.isArray(n.fee_items)&&r.push([`本次旧费用`,n.fee_items.map(e=>`${e.note||`费用`}:${ee(e.amount)} · ${B(e.payer)}支付`).join(`
|
||||
`)]),(0,K.jsxs)(`section`,{className:`order-change-action-summary`,children:[(0,K.jsx)(`h3`,{children:`本次申请动作`}),(0,K.jsx)(`dl`,{className:`order-change-action-facts`,children:W.Children.toArray(r.map(([e,t])=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`dt`,{children:e}),(0,K.jsx)(`dd`,{children:z(t)})]})))}),(0,K.jsx)(`p`,{className:`small muted`,children:`下方对照为服务器试算;批准后才登记这笔变更,不会由系统发起真实收款、退款或转账。`})]})}function ae(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未提供`:t.toLocaleString(`zh-CN`)}let oe={pending:`待店主复核`,approved:`已同意变更`,rejected:`已驳回`},se={edit:`修改订单`,expense:`费用补记`,fees:`旧费用核实`,refund:`退款`,return:`退货`,cost:`成本补录`};function ce(e){return(e.action_input||e.action_details)?.afterSale?`处理订单售后`:e.action_label||se[e.action||`edit`]||`订单变更`}let le={pending:`待店主复核`,approved:`已同意取消`,rejected:`已驳回`};function ue(e){let t=new Date(e);return Number.isNaN(t.getTime())?`时间未提供`:t.toLocaleString(`zh-CN`)}let de=e=>Fe.accountIdentity(Be(),e);function fe(e){let t=de(e);return t?ze(t.member)+t.channel:e}function pe(e){if(!e||![`total`,`netReceived`,`directCost`].every(t=>Number.isSafeInteger(e[t]))||![`goodsCost`,`profit`,`settlementDue`].every(t=>e[t]===null||Number.isSafeInteger(e[t]))||!Array.isArray(e.inventory)||!e.inventory.every(e=>typeof e.date==`string`&&typeof e.pocket==`string`&&Number.isSafeInteger(e.mg)))throw Error(`取消撤销摘要未完整返回,请重新读取订单。`);return e}function me(e=n){let t=Ee(e)?.data;if(!t?.eligible||t.pending||t.directToday!==!0||!/^\d{4}-\d{2}-\d{2}$/.test(t.directActionDate||``)||e?.date!==t.directActionDate||e?.price_lock_id||![`draft`,`confirmed`,`delivered`].includes(e?.status||``))return!1;try{return pe(t.summary),!0}catch{return!1}}function he(t,r=e.today,i=n){let a=Ce(i)?.data;return[`expense`,`fees`,`refund`,`return`].includes(t)&&!!a&&!a.pending&&/^\d{4}-\d{2}-\d{2}$/.test(a.directActionDate||``)&&a.actions?.[t]?.directToday===!0&&i?.date===a.directActionDate&&r===a.directActionDate&&!(o.action===t&&o.forceApproval)}function ge(t){return e.user.role===`assistant`&&[`expense`,`fees`,`refund`,`return`,`cost`].includes(t)}function _e(t,n=e.today){return ge(t)&&!he(t,n)}function ve(e){return e?.orderAfterSale||null}function ye(){return t?.user?.id||``}function be(e=n){return e&&i?.id===e.id&&i.user===ye()&&i.revision===e.revision?i:null}function xe(e=n){return be(e)?.data?.pending||e?.ownershipPending||null}function Se(){return t?.user?.id||``}function Ce(e=n){return e&&r?.id===e.id&&r.user===Se()&&r.revision===e.revision?r:null}function we(e){return Ce(e)?.data?.pending||e?.changePending||null}function Te(){return t?.user?.id||``}function Ee(e=n){return e&&a?.id===e.id&&a.user===Te()&&a.revision===e.revision?a:null}function G(e){return Ee(e)?.data?.pending||e.cancellationPending||null}function De(e){if([`afterSale`,`orderAfterSale`].includes(e.kind??``))return``;let t=e.printStatus?.printed;return(0,K.jsx)(`span`,{"data-print-kind":e.printStatus?.kind||(e.kind===`recovery`?`recovery`:`order`),"data-print-id":e.printStatus?.id||e.id,className:`document-print-badge `+(t?`is-printed`:`is-unprinted`),title:t?`已记录打印操作`:`尚未记录打印操作`,children:t?`✓ 已打印`:`未打印`})}let Oe=Fe.grams,ke=e=>String(e??``),Ae=new Intl.DateTimeFormat(`zh-CN`,{timeZone:`Asia/Shanghai`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}),je=Fe.validDate;function Me(e){if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d{1,3})?)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||!je(e.slice(0,10)))return`未记录`;let t=new Date(e);if(Number.isNaN(t.getTime()))return`未记录`;let n=Object.fromEntries(Ae.formatToParts(t).map(e=>[e.type,e.value]));return`${n.year}-${n.month}-${n.day} ${n.hour}:${n.minute}`}function Ne(e){return(0,K.jsxs)(`div`,{className:`small muted order-entry-time`,children:[`录入时间(北京时间):`,Me(e.created)]})}function Pe(e){return![`afterSale`,`orderAfterSale`,`recovery`].includes(e.kind??``)&&Number.isSafeInteger(e.revision)&&e.revision>0&&e.reviewed_revision===e.revision}let Ie={draft:`旧草稿`,confirmed:`旧单待补齐`,delivered:`已完成`,returned:`已退货`,cancelled:`已取消`,after_sale:`售后`,recovery:`回收`},Le=e=>(0,K.jsx)(`span`,{className:`order-status `+([`draft`,`confirmed`].includes(e.status)?`danger-text`:`muted`),children:Ie[e.status]||e.status}),Re=(e,t,n=``,r={})=>(0,K.jsx)(X,{type:`button`,"data-action":t,className:n,...r,children:e});function ze(n){return e?.shopSettings?.members?.find(e=>e.member===n)?.label||e?.members?.find(e=>e.member===n)?.label||t?.loginOptions?.find(e=>e.member===n)?.label||{owner:`麦麦`,assistant:`娜娜`,assistant2:`小昊`}[n??``]||`待确认`}let Be=()=>F
Line truncated
|
||||
-1
@@ -1 +0,0 @@
|
||||
.recoveries-page{color:var(--ink,#233832);min-width:0}.recoveries-page [hidden]{display:none!important}.recoveries-page h1,.recoveries-page h2,.recoveries-page h3{margin:0}.recoveries-page h1{font-size:clamp(1.9rem,4vw,3rem)}.recoveries-page p{color:var(--muted,#596963);line-height:1.55}.recoveries-page .panel,.recoveries-page .stock-review-status{background:var(--surface,#fff);border:1px solid var(--line,#dce4df);border-radius:12px;margin-block:14px;padding:18px}.recoveries-page .panel-title,.recoveries-page .actions,.recoveries-page .form-actions,.recoveries-page .stock-history-filters{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.recoveries-page .panel-title{justify-content:space-between}.recoveries-page .recovery-row{grid-template-columns:repeat(auto-fit,minmax(min(135px,100%),1fr));gap:12px;display:grid}.recoveries-page label{align-content:start;gap:5px;margin-block:8px;display:grid}.recoveries-page label:has([type=checkbox]){align-items:center;display:flex}.recoveries-page input,.recoveries-page select,.recoveries-page textarea,.recoveries-page button{font:inherit}.recoveries-page input:not([type=checkbox]),.recoveries-page select,.recoveries-page textarea{width:100%;min-width:0;color:inherit;box-sizing:border-box;background:#fff;border:1px solid #b9c6bf;border-radius:6px;padding:8px}.recoveries-page fieldset{border:0;min-width:0;margin:0;padding:0}.recoveries-page button{cursor:pointer;color:inherit;background:#fff;border:1px solid #b9c6bf;border-radius:7px;margin:2px;padding:7px 12px}.recoveries-page button:disabled{cursor:default;opacity:.48}.recoveries-page .primary,.recoveries-page button[aria-pressed=true]{color:#fff;background:#254f46}.recoveries-page .table-wrap{overflow:auto}.recoveries-page table{border-collapse:collapse;text-align:left;width:100%}.recoveries-page td,.recoveries-page th{vertical-align:top;border-bottom:1px solid #dde4df;padding:9px}.recoveries-page th{white-space:nowrap}.recoveries-page dialog{width:100%;max-width:min(720px,94vw);max-height:86dvh;color:inherit;box-sizing:border-box;border:1px solid #dce4df;border-radius:13px;padding:24px;position:fixed;overflow:auto}.recoveries-page dialog::backdrop{background:#18332b55}.recoveries-page .dialog-close{float:right}.recoveries-page .error{color:#9a372c}.recoveries-page .recovery-net{align-items:center;gap:18px;display:flex}.recoveries-page .recovery-net strong{font-size:1.5rem}.recoveries-page .modified{background:#fff8e7}.recoveries-page table td{white-space:pre-line}.recoveries-page .recovery-new-product{border-top:1px solid #dce4df;padding-top:10px}.inventory-page{color:var(--ink,#233832);min-width:0}.inventory-page [hidden]{display:none!important}.inventory-page h1,.inventory-page h2,.inventory-page h3{margin:0}.inventory-page h1{font-size:clamp(1.9rem,4vw,3rem)}.inventory-page p{color:var(--muted,#596963);line-height:1.55}.inventory-page .panel,.inventory-page .stock-card,.inventory-page .stock-review-status{background:var(--surface,#fff);border:1px solid var(--line,#dce4df);border-radius:12px;margin-block:14px;padding:18px}.inventory-page .stock-cards{grid-template-columns:repeat(auto-fit,minmax(min(160px,100%),1fr));gap:10px;display:grid}.inventory-page .stock-card{margin:0}.inventory-page .stock-card strong{font-size:1.6rem}.inventory-page .stock-card .yesterday{border-top:1px solid #dce4df;gap:4px;margin-top:12px;padding-top:10px;display:grid}.inventory-page .panel-title,.inventory-page .actions,.inventory-page .form-actions,.inventory-page .stock-history-filters{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.inventory-page .panel-title{justify-content:space-between}.inventory-page .stock-entry-fields{grid-template-columns:repeat(auto-fit,minmax(min(135px,100%),1fr));gap:12px;display:grid}.inventory-page label{align-content:start;gap:5px;margin-block:8px;display:grid}.inventory-page label:has([type=checkbox]){align-items:center;display:flex}.inventory-page input,.inventory-page select,.inventory-page textarea,.inventory-page button{font:inherit}.inventory-page input:not([type=checkbox]),.inventory-page select,.inventory-page textarea{width:100%;min-width:0;color:inherit;box-sizing:border-box;background:#fff;border:1px solid #b9c6bf;border-radius:6px;padding:8px}.inventory-page fieldset{border:0;min-width:0;margin:0;padding:0}.inventory-page button{cursor:pointer;color:inherit;background:#fff;border:1px solid #b9c6bf;border-radius:7px;margin:2px;padding:7px 12px}.inventory-page button:disabled{cursor:default;opacity:.48}.inventory-page .primary,.inventory-page button[aria-pressed=true]{color:#fff;background:#254f46}.inventory-page .table-wrap{overflow:auto}.inventory-page table{border-collapse:collapse;text-align:left;width:100%}.inventory-page td,.inventory-page th{vertical-align:top;border-bottom:1px solid #dde4df;padding:9px}.inventory-page th{white-space:nowrap}.inventory-page dialog{width:100%;max-width:min(720px,94vw);max-height:86dvh;color:inherit;box-sizing:border-box;border:1px solid #dce4Line truncated
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import{t as e}from"./rolldown-runtime-Dl_DZoUm.js";import{H as t,V as n}from"./antd-Bh8pVx-K.js";var r=e((e=>{function t(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,oe());else{var t=n(l);t!==null&&le(ee,t.startTime-e)}}}var te=!1,ne=-1,re=5,ie=-1;function ae(){return g?!0:!(e.unstable_now()-ie<re)}function x(){if(g=!1,te){var t=e.unstable_now();ie=t;var i=!0;try{e:{m=!1,h&&(h=!1,v(ne),ne=-1),p=!0;var a=f;try{t:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ae());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break t}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(ee,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?oe():te=!1}}}var oe;if(typeof y==`function`)oe=function(){y(x)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=x,oe=function(){ce.postMessage(null)}}else oe=function(){_(x,0)};function le(t,n){ne=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):re=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ne),ne=-1):h=!0,le(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,oe()))),r},e.unstable_shouldYield=ae,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var r=i(),a=t(),o=n();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){Line truncated
|
||||
import{t as e}from"./rolldown-runtime-Dl_DZoUm.js";import{H as t,U as n}from"./antd-CChM6Pac.js";var r=e((e=>{function t(e,t){var n=e.length;for(e.push(t);0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,oe());else{var t=n(l);t!==null&&le(ee,t.startTime-e)}}}var te=!1,ne=-1,re=5,ie=-1;function ae(){return g?!0:!(e.unstable_now()-ie<re)}function x(){if(g=!1,te){var t=e.unstable_now();ie=t;var i=!0;try{e:{m=!1,h&&(h=!1,v(ne),ne=-1),p=!0;var a=f;try{t:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ae());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break t}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&le(ee,u.startTime-t),i=!1}}break e}finally{d=null,f=a,p=!1}i=void 0}}finally{i?oe():te=!1}}}var oe;if(typeof y==`function`)oe=function(){y(x)};else if(typeof MessageChannel<`u`){var se=new MessageChannel,ce=se.port2;se.port1.onmessage=x,oe=function(){ce.postMessage(null)}}else oe=function(){_(x,0)};function le(t,n){ne=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):re=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=0x3fffffff;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(ne),ne=-1):h=!0,le(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,oe()))),r},e.unstable_shouldYield=ae,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),i=e(((e,t)=>{t.exports=r()})),a=e((e=>{var r=i(),a=n(),o=t();function s(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(s(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(s(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=a;else{for(var o=!1,c=i.child;c;){if(c===n){Line truncated
|
||||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||||
`+Ve+e+He}var We=!1;function Ge(e,t){if(!e||We)return``;We=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
||||
`),l=s.split(`
|
||||
Vendored
+4
-4
@@ -4,11 +4,11 @@
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
|
||||
<title>珠宝台账 · 新账系统</title>
|
||||
<script type="module" crossorigin src="/next/assets/index-BNkcCTjw.js"></script>
|
||||
<script type="module" crossorigin src="/next/assets/index-BTO1FiGO.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/next/assets/rolldown-runtime-Dl_DZoUm.js">
|
||||
<link rel="modulepreload" crossorigin href="/next/assets/antd-Bh8pVx-K.js">
|
||||
<link rel="modulepreload" crossorigin href="/next/assets/react-BvkltZ40.js">
|
||||
<link rel="stylesheet" crossorigin href="/next/assets/index-C7B_UPXs.css">
|
||||
<link rel="modulepreload" crossorigin href="/next/assets/antd-CChM6Pac.js">
|
||||
<link rel="modulepreload" crossorigin href="/next/assets/react-Btsc-Yng.js">
|
||||
<link rel="stylesheet" crossorigin href="/next/assets/index-2AN6aBP4.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import path from 'node:path';
|
||||
|
||||
// Vite 展开业务页的本地 @import 后,按来源文件限定选择器。
|
||||
// React 页面及其原生 dialog 继承同一套表格、金额和打印状态样式。
|
||||
export default {
|
||||
plugins: [
|
||||
{
|
||||
postcssPlugin: 'scope-business-pages',
|
||||
Once(root) {
|
||||
if (path.basename(root.source.input.file) !== 'business-pages.css') return;
|
||||
root.walkRules(rule => {
|
||||
if (path.basename(rule.source.input.file) !== 'app.css') return;
|
||||
if (rule.selector === ':root' || rule.selector === 'body') {
|
||||
// 外壳统一提供字体和主题变量,原生 dialog 保留浏览器居中方式。
|
||||
rule.remove();
|
||||
} else if (rule.selector === 'html:has(#order-form)') {
|
||||
rule.selector = 'html:has(.business-pages #order-form)';
|
||||
} else {
|
||||
rule.selectors = rule.selectors.map(selector => '.business-pages ' + selector);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
+306
-12
@@ -1,20 +1,314 @@
|
||||
/* PostCSS 把原控件样式限制在业务页及其原生弹窗内。 */
|
||||
@import '../../public/app.css';
|
||||
|
||||
/* 业务单据共用开单页主题,保留打印和原生表单的焦点及提交语义。 */
|
||||
.business-pages {
|
||||
min-width: 0;
|
||||
padding-bottom: 32px;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
color: var(--ink);
|
||||
font: 14px/1.6 var(--font);
|
||||
padding-block-end: 32px;
|
||||
}
|
||||
.business-pages .page-heading {
|
||||
gap: 16px;
|
||||
.business-pages [hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
.business-pages .table-wrap {
|
||||
.business-pages :where(h1, h2, h3, h4, p, dl) {
|
||||
margin-block: 0 0.65em;
|
||||
}
|
||||
.business-pages h1 {
|
||||
font-size: clamp(24px, 3vw, 32px);
|
||||
line-height: 1.25;
|
||||
letter-spacing: -0.025em;
|
||||
}
|
||||
.business-pages h2 {
|
||||
font-size: 19px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.business-pages h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
.business-pages :where(.actions, .form-actions, .panel-title, .change-list-tabs, .order-detail-navigation-row) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
.business-pages .panel-title {
|
||||
justify-content: space-between;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.business-pages .panel-title > :is(h2, h3, p) {
|
||||
margin-block: 0;
|
||||
}
|
||||
.business-pages .form-actions {
|
||||
margin-top: 16px;
|
||||
}
|
||||
.business-pages :where(.panel, .stat, .order-line-card, .line-item, .old-item, .recovery-item) {
|
||||
min-width: 0;
|
||||
padding: clamp(14px, 2vw, 24px);
|
||||
background: var(--white);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
}
|
||||
.business-pages :where(.panel, .page-heading, .cards, .filters) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.business-pages .panel .panel {
|
||||
padding: 14px;
|
||||
margin-block: 10px;
|
||||
}
|
||||
.business-pages .internal {
|
||||
background: var(--internal-bg);
|
||||
border-color: var(--internal-border);
|
||||
}
|
||||
.business-pages .grid,
|
||||
.business-pages .cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
.business-pages .grid.two {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.business-pages .grid.three {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
.business-pages .grid.four {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
}
|
||||
.business-pages :where(.grid, .cards) > * {
|
||||
min-width: 0;
|
||||
}
|
||||
.business-pages :where(.stat, .summary-amount, .price-lock-facts) strong {
|
||||
display: block;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.business-pages .summary-amount,
|
||||
.business-pages .stat strong {
|
||||
font-size: 21px;
|
||||
font-weight: 650;
|
||||
}
|
||||
.business-pages :where(label:not(.ant-checkbox-wrapper):not(.ant-radio-wrapper)) {
|
||||
display: grid;
|
||||
align-content: start;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
.business-pages :where(label.check, label:has(> input[type='radio']), label:has(> input[type='checkbox'])) {
|
||||
display: inline-flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
.business-pages :where(input:not([type='checkbox']):not([type='radio']):not([type='hidden']), select, textarea) {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
max-width: 100%;
|
||||
overscroll-behavior-x: contain;
|
||||
min-height: 36px;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
padding: 6px 10px;
|
||||
color: var(--ink);
|
||||
background: var(--white);
|
||||
font: inherit;
|
||||
}
|
||||
.business-pages button:focus-visible {
|
||||
outline: 2px solid var(--green);
|
||||
.business-pages :where(input[readonly], input:disabled, textarea:disabled, select:disabled) {
|
||||
background: var(--paper);
|
||||
color: var(--muted);
|
||||
}
|
||||
.business-pages :where(input[type='number'], .number, .summary-amount) {
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.business-pages input:is([type='checkbox'], [type='radio']) {
|
||||
accent-color: var(--green);
|
||||
}
|
||||
.business-pages textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
.business-pages :where(input, select, textarea, button, summary, a):focus-visible {
|
||||
outline: 2px solid var(--green-hover);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.business-pages :where(.filters, .toolbar, .filter-bar, .purchase-controls) {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
.business-pages :where(.filters, .toolbar) label {
|
||||
flex: 1 1 135px;
|
||||
}
|
||||
.business-pages :where(.charge-list, .order-fee-parts, .cost-fields, .price-lock-items, .timeline) {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
}
|
||||
.business-pages :where(.charge-row, .recovery-row, .fee-row, .cost-row, .purchase-cost-grid) {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr));
|
||||
align-items: end;
|
||||
gap: 10px;
|
||||
}
|
||||
.business-pages :where(.charge-row, .fee-row, .line-item) + :where(.charge-row, .fee-row, .line-item) {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.business-pages :where(fieldset) {
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
}
|
||||
.business-pages :where(.table-wrap, .material-detail-table-wrap) {
|
||||
max-width: 100%;
|
||||
overflow-x: auto;
|
||||
overscroll-behavior-x: contain;
|
||||
}
|
||||
.business-pages table {
|
||||
width: 100%;
|
||||
border-spacing: 0;
|
||||
border-collapse: collapse;
|
||||
font-size: 13px;
|
||||
}
|
||||
.business-pages :where(th, td) {
|
||||
padding: 9px 12px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
text-align: start;
|
||||
vertical-align: top;
|
||||
}
|
||||
.business-pages :where(thead th) {
|
||||
background: var(--soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
.business-pages :where(td, th).number {
|
||||
text-align: end;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.business-pages :where(td .actions, td button) {
|
||||
margin-block: 2px;
|
||||
}
|
||||
.business-pages :where(.badge, .document-print-badge, .pill) {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
border-radius: 100px;
|
||||
background: var(--soft);
|
||||
color: var(--green);
|
||||
font-size: 12px;
|
||||
}
|
||||
.business-pages :where(.warn, .pending, .is-unprinted) {
|
||||
color: var(--internal-text);
|
||||
}
|
||||
.business-pages :where(.empty, .muted, .hint) {
|
||||
color: var(--muted);
|
||||
}
|
||||
.business-pages .empty {
|
||||
padding: 18px 0;
|
||||
}
|
||||
.business-pages :where(.error, .note, .calculation, .purchase-formula, .price-lock-voided-note) {
|
||||
margin-block: 10px;
|
||||
padding: 9px 12px;
|
||||
border-radius: 6px;
|
||||
background: var(--soft);
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
.business-pages :where(.error, .danger-text) {
|
||||
color: var(--danger);
|
||||
}
|
||||
.business-pages .error {
|
||||
background: color-mix(in srgb, var(--danger) 7%, var(--white));
|
||||
}
|
||||
.business-pages .small,
|
||||
.business-pages small {
|
||||
font-size: 12px;
|
||||
}
|
||||
.business-pages details > summary {
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
}
|
||||
.business-pages details[open] > summary {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.business-pages :where(dialog) {
|
||||
width: min(900px, calc(100% - 28px));
|
||||
max-width: 100%;
|
||||
max-height: 88dvh;
|
||||
padding: clamp(16px, 2.5vw, 28px);
|
||||
overflow: auto;
|
||||
overscroll-behavior: contain;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
color: var(--ink);
|
||||
background: var(--white);
|
||||
box-shadow: 0 18px 60px color-mix(in srgb, var(--ink) 22%, transparent);
|
||||
}
|
||||
.business-pages dialog::backdrop {
|
||||
background: color-mix(in srgb, var(--ink) 46%, transparent);
|
||||
}
|
||||
.business-pages :where(dialog h2) {
|
||||
padding-inline-end: 36px;
|
||||
}
|
||||
.business-pages .dialog-close {
|
||||
float: right;
|
||||
}
|
||||
.business-pages :where(.sr-only, .visually-hidden) {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
clip-path: inset(50%);
|
||||
}
|
||||
.business-pages :where(.facts, .after-sale-facts, .order-detail-breakdown) {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
.business-pages dd {
|
||||
margin-inline-start: 0;
|
||||
}
|
||||
.business-pages .link-button {
|
||||
padding-inline: 0;
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.business-pages :is(.grid.three, .grid.four, .cards) {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.business-pages :where(th, td) {
|
||||
padding: 7px 8px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 520px) {
|
||||
.business-pages :is(.grid.two, .grid.three, .grid.four, .cards, .order-detail-breakdown) {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
.business-pages .page-heading {
|
||||
align-items: start;
|
||||
flex-direction: column;
|
||||
}
|
||||
.business-pages :where(.filters, .toolbar) label {
|
||||
flex-basis: 45%;
|
||||
}
|
||||
.business-pages :where(dialog) {
|
||||
width: calc(100% - 16px);
|
||||
max-height: 94dvh;
|
||||
}
|
||||
.business-pages :where(input, select, textarea) {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.business-pages .material-purchase-fields {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
|
||||
align-items: end;
|
||||
gap: 12px;
|
||||
}
|
||||
.business-pages .material-scroll-hint {
|
||||
display: none;
|
||||
}
|
||||
.business-pages .material-pool-summary {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 20px;
|
||||
margin-block: 16px;
|
||||
}
|
||||
@media (max-width: 520px) {
|
||||
.business-pages .material-purchase-fields {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
.business-pages .material-purchase-fields > label:last-of-type {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
import { Button, Input, Table, type InputRef } from 'antd';
|
||||
import {
|
||||
createContext,
|
||||
useContext,
|
||||
useCallback,
|
||||
useImperativeHandle,
|
||||
useLayoutEffect,
|
||||
useState,
|
||||
type ChangeEventHandler,
|
||||
useRef,
|
||||
type Key,
|
||||
type ReactNode,
|
||||
type ComponentPropsWithRef,
|
||||
type ComponentPropsWithoutRef,
|
||||
} from 'react';
|
||||
import type { TextAreaRef } from 'antd/es/input/TextArea';
|
||||
|
||||
function classes(base: string, className?: string) {
|
||||
return className ? base + ' ' + className : base;
|
||||
}
|
||||
|
||||
export function LedgerButton({
|
||||
type = 'submit',
|
||||
className,
|
||||
...props
|
||||
}: Omit<ComponentPropsWithoutRef<'button'>, 'color'>) {
|
||||
const tokens = className?.split(/\s+/);
|
||||
return (
|
||||
<Button
|
||||
{...props}
|
||||
htmlType={type}
|
||||
type={tokens?.includes('primary') ? 'primary' : 'default'}
|
||||
danger={tokens?.includes('danger')}
|
||||
className={classes('ledger-button', className)}
|
||||
autoInsertSpace={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
type TextControl = HTMLInputElement | HTMLTextAreaElement;
|
||||
type FieldValue = ComponentPropsWithoutRef<'input'>['value'];
|
||||
|
||||
// Ant Input 在内部跟踪值。非受控业务表单仍须能通过原生 reset 还原其初始值。
|
||||
function useFormValue<T extends TextControl>(
|
||||
value: FieldValue,
|
||||
defaultValue: FieldValue,
|
||||
onChange: ChangeEventHandler<T> | undefined,
|
||||
control: () => T | null,
|
||||
) {
|
||||
const initial = String(defaultValue ?? '');
|
||||
const [edited, setEdited] = useState(initial);
|
||||
const uncontrolled = value === undefined;
|
||||
useLayoutEffect(() => {
|
||||
if (!uncontrolled) return;
|
||||
const field = control(),
|
||||
form = field?.form;
|
||||
if (!field || !form) return;
|
||||
const reset = (event: Event) => {
|
||||
// 默认动作在事件分发结束后执行。取消重置时保留原输入。
|
||||
field.defaultValue = initial;
|
||||
queueMicrotask(() => {
|
||||
if (!event.defaultPrevented) setEdited(initial);
|
||||
});
|
||||
};
|
||||
form.addEventListener('reset', reset);
|
||||
return () => form.removeEventListener('reset', reset);
|
||||
}, [control, initial, uncontrolled]);
|
||||
const change: ChangeEventHandler<T> = event => {
|
||||
if (uncontrolled) setEdited(event.target.value);
|
||||
onChange?.(event);
|
||||
};
|
||||
return { value: uncontrolled ? edited : value, onChange: change };
|
||||
}
|
||||
|
||||
function AntLedgerInput({
|
||||
size,
|
||||
defaultValue,
|
||||
value,
|
||||
onChange,
|
||||
...props
|
||||
}: Omit<ComponentPropsWithoutRef<'input'>, 'prefix'>) {
|
||||
const editor = useRef<InputRef>(null);
|
||||
const input = useCallback(() => editor.current?.input ?? null, []);
|
||||
const field = useFormValue(value, defaultValue, onChange, input);
|
||||
return <Input {...props} {...field} htmlSize={size} ref={editor} />;
|
||||
}
|
||||
|
||||
export function LedgerInput({ type, className, ...props }: ComponentPropsWithoutRef<'input'>) {
|
||||
const style = classes('ledger-input', className);
|
||||
if (type === 'checkbox' || type === 'radio' || type === 'date' || type === 'hidden' || type === 'file')
|
||||
return <input {...props} type={type} className={style} />;
|
||||
return <AntLedgerInput {...props} type={type} className={style} />;
|
||||
}
|
||||
|
||||
export function LedgerTextArea({
|
||||
ref,
|
||||
className,
|
||||
value,
|
||||
defaultValue,
|
||||
onChange,
|
||||
...props
|
||||
}: ComponentPropsWithRef<'textarea'>) {
|
||||
const editor = useRef<TextAreaRef>(null);
|
||||
const input = useCallback(() => editor.current?.resizableTextArea?.textArea ?? null, []);
|
||||
const field = useFormValue(value, defaultValue, onChange, input);
|
||||
useImperativeHandle(ref, () => editor.current!.resizableTextArea!.textArea);
|
||||
return <Input.TextArea {...props} {...field} ref={editor} className={classes('ledger-textarea', className)} />;
|
||||
}
|
||||
|
||||
export function LedgerSelect({ className, ...props }: ComponentPropsWithRef<'select'>) {
|
||||
return <select {...props} className={classes('ledger-select', className)} />;
|
||||
}
|
||||
|
||||
export function LedgerTable({ className, ...props }: ComponentPropsWithRef<'table'>) {
|
||||
return <table {...props} className={classes('ledger-table', className)} />;
|
||||
}
|
||||
|
||||
export function LedgerDialog({
|
||||
className,
|
||||
initialFocusSelector,
|
||||
...props
|
||||
}: ComponentPropsWithoutRef<'dialog'> & { initialFocusSelector?: string }) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useLayoutEffect(() => {
|
||||
const dialog = ref.current!;
|
||||
dialog.showModal();
|
||||
if (initialFocusSelector) dialog.querySelector<HTMLElement>(initialFocusSelector)?.focus();
|
||||
// 原生 close() 在 DOM 移除前归还焦点给打开弹窗的按钮。
|
||||
return () => dialog.close();
|
||||
}, [initialFocusSelector]);
|
||||
return <dialog {...props} ref={ref} className={classes('ledger-dialog', className)} />;
|
||||
}
|
||||
|
||||
interface Column {
|
||||
title: ReactNode;
|
||||
headerClassName?: string;
|
||||
rowScope?: 'row';
|
||||
}
|
||||
interface TableRow {
|
||||
key: Key;
|
||||
cells: ReactNode[];
|
||||
attributes?: ComponentPropsWithoutRef<'tr'> & { [key: `data-${string}`]: unknown };
|
||||
cellClasses?: (string | undefined)[];
|
||||
}
|
||||
type TableAttributes = Omit<ComponentPropsWithoutRef<'table'>, 'children'>;
|
||||
const TableAttributesContext = createContext<TableAttributes>({});
|
||||
function DataTableElement(props: ComponentPropsWithoutRef<'table'>) {
|
||||
const attributes = useContext(TableAttributesContext);
|
||||
return <LedgerTable {...props} {...attributes} />;
|
||||
}
|
||||
const tableComponents = { table: DataTableElement };
|
||||
|
||||
export function LedgerDataTable({
|
||||
columns,
|
||||
rows,
|
||||
...attributes
|
||||
}: TableAttributes & {
|
||||
columns: Column[];
|
||||
rows: TableRow[];
|
||||
}) {
|
||||
if (!rows.length) {
|
||||
// 原表在无记录时保留空表体,页面自行展示对应的空状态。
|
||||
return (
|
||||
<LedgerTable {...attributes}>
|
||||
<thead>
|
||||
<tr>
|
||||
{columns.map((column, i) => (
|
||||
<th key={i} className={column.headerClassName}>
|
||||
{column.title}
|
||||
</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody />
|
||||
</LedgerTable>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<TableAttributesContext.Provider value={attributes}>
|
||||
<Table<TableRow>
|
||||
size="small"
|
||||
rowKey="key"
|
||||
dataSource={rows}
|
||||
pagination={false}
|
||||
components={tableComponents}
|
||||
onRow={row => row.attributes || {}}
|
||||
columns={columns.map(({ title, headerClassName, rowScope }, index) => ({
|
||||
key: index,
|
||||
title,
|
||||
rowScope,
|
||||
onHeaderCell: () => ({ className: headerClassName }),
|
||||
onCell: row => ({ className: row.cellClasses?.[index] }),
|
||||
render: (_value, row) => row.cells[index],
|
||||
}))}
|
||||
/>
|
||||
</TableAttributesContext.Provider>
|
||||
);
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
type Selection,
|
||||
type Values,
|
||||
} from './data';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
type List = { requests: ChangeRequest[]; counts: Record<string, number> };
|
||||
function checkValues(v?: Values) {
|
||||
if (
|
||||
@@ -101,9 +102,9 @@ export function Changes({
|
||||
<section className="panel" id="inventory-changes">
|
||||
<div className="panel-title">
|
||||
<h2>{owner ? '库存修改审批' : '我的库存修改申请'}</h2>
|
||||
<button data-action="inventory-change-refresh" onClick={() => retry(n => n + 1)}>
|
||||
<LedgerButton data-action="inventory-change-refresh" onClick={() => retry(n => n + 1)}>
|
||||
刷新申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<p>
|
||||
员工可直接修改本人当天的手动流水;跨天修改、改到其他日期及删除须{Model.memberName(state, 'owner')}
|
||||
@@ -114,9 +115,9 @@ export function Changes({
|
||||
{result?.error ? (
|
||||
<div>
|
||||
{result.error}{' '}
|
||||
<button data-action="inventory-change-refresh" onClick={() => retry(n => n + 1)}>
|
||||
<LedgerButton data-action="inventory-change-refresh" onClick={() => retry(n => n + 1)}>
|
||||
重新读取
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : !r ? (
|
||||
'正在读取库存申请…'
|
||||
@@ -124,7 +125,7 @@ export function Changes({
|
||||
<>
|
||||
<div role="group" aria-label="库存申请状态">
|
||||
{Object.entries({ ...statuses, pending: '待审批', all: '全部' }).map(([k, t]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={k}
|
||||
data-action="inventory-change-filter"
|
||||
data-status={k}
|
||||
@@ -136,57 +137,56 @@ export function Changes({
|
||||
>
|
||||
{t}
|
||||
{k !== 'all' && '(' + r.counts[k] + ')'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
{!r.requests.length ? (
|
||||
<p>全部日期没有此状态的库存申请。</p>
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['原库存记录/申请内容', '申请人/说明', '状态/处理意见', '操作'].map(t => (
|
||||
<th key={t}>{t}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{r.requests.map(x => (
|
||||
<tr key={x.id} data-inventory-request={x.id}>
|
||||
<td>
|
||||
<div>{summary(x.before)}</div>
|
||||
<div>{x.action === 'delete' ? '申请删除整组记录' : '申请改为:' + summary(x.after)}</div>
|
||||
</td>
|
||||
<td>
|
||||
{actor(state, x.requesterName) || Model.memberName(state, x.requesterMember)}
|
||||
<div>{x.created && time(x.created)}</div>
|
||||
<div>{x.reason || '—'}</div>
|
||||
</td>
|
||||
<td>
|
||||
{statuses[x.status]}
|
||||
{x.stale && x.status === 'pending' && <div>原记录已变化,请驳回后重新申请。</div>}
|
||||
<div>{x.note}</div>
|
||||
{x.reviewerName && (
|
||||
<div>
|
||||
{actor(state, x.reviewerName)} · {time(x.reviewed)}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<button
|
||||
disabled={blocked}
|
||||
data-action="inventory-change-open-request"
|
||||
data-id={x.id}
|
||||
onClick={() => open({ kind: 'request', id: x.id })}
|
||||
>
|
||||
{owner && x.status === 'pending' ? '查看并审批' : '查看申请'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '原库存记录/申请内容' },
|
||||
{ title: '申请人/说明' },
|
||||
{ title: '状态/处理意见' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={r.requests.map(x => ({
|
||||
key: x.id,
|
||||
attributes: { 'data-inventory-request': x.id },
|
||||
cells: [
|
||||
<>
|
||||
<div>{summary(x.before)}</div>
|
||||
<div>{x.action === 'delete' ? '申请删除整组记录' : '申请改为:' + summary(x.after)}</div>
|
||||
</>,
|
||||
<>
|
||||
{actor(state, x.requesterName) || Model.memberName(state, x.requesterMember)}
|
||||
<div>{x.created && time(x.created)}</div>
|
||||
<div>{x.reason || '—'}</div>
|
||||
</>,
|
||||
<>
|
||||
{statuses[x.status]}
|
||||
{x.stale && x.status === 'pending' && <div>原记录已变化,请驳回后重新申请。</div>}
|
||||
<div>{x.note}</div>
|
||||
{x.reviewerName && (
|
||||
<div>
|
||||
{actor(state, x.reviewerName)} · {time(x.reviewed)}
|
||||
</div>
|
||||
)}
|
||||
</>,
|
||||
<>
|
||||
<LedgerButton
|
||||
disabled={blocked}
|
||||
data-action="inventory-change-open-request"
|
||||
data-id={x.id}
|
||||
onClick={() => open({ kind: 'request', id: x.id })}
|
||||
>
|
||||
{owner && x.status === 'pending' ? '查看并审批' : '查看申请'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
@@ -238,7 +238,7 @@ function Legacy({ record }: { record: LegacyCount }) {
|
||||
'这笔历史记录未记录对数,当前对数按实际盘点基准保留。本次旧重量冲回不自动更改当前对数,如实物有变化请另做当天对数调整。'}
|
||||
</p>
|
||||
<label>
|
||||
<input type="checkbox" name="legacyCountVerified" required />
|
||||
<LedgerInput type="checkbox" name="legacyCountVerified" required />
|
||||
已核对当前对数基准,理解本次更正对历史对数的处理
|
||||
</label>
|
||||
</>
|
||||
@@ -348,16 +348,16 @@ export function ChangeDialog({
|
||||
<div id="inventory-change-error" aria-live="polite">
|
||||
{err}{' '}
|
||||
{stale && (
|
||||
<button type="button" onClick={readAgain}>
|
||||
<LedgerButton type="button" onClick={readAgain}>
|
||||
{review ? '重新读取申请' : '重新读取原记录'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
const cancel = (
|
||||
<button type="button" data-action="inventory-change-close" disabled={client.busy} onClick={close}>
|
||||
<LedgerButton type="button" data-action="inventory-change-close" disabled={client.busy} onClick={close}>
|
||||
{review ? '关闭' : '取消'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
function submit(e: FormEvent<HTMLFormElement>) {
|
||||
e.preventDefault();
|
||||
@@ -368,7 +368,7 @@ export function ChangeDialog({
|
||||
{!result?.value ? (
|
||||
result?.error ? (
|
||||
<div>
|
||||
{result.error} <button onClick={readAgain}>重新读取</button>
|
||||
{result.error} <LedgerButton onClick={readAgain}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : (
|
||||
<p>{review ? '正在读取申请与原记录…' : '正在读取整组库存记录…'}</p>
|
||||
@@ -401,24 +401,24 @@ export function ChangeDialog({
|
||||
<Legacy record={request} />
|
||||
<label>
|
||||
处理意见(批准时选填,驳回时必填)
|
||||
<textarea name="note" maxLength={200} rows={2} />
|
||||
<LedgerTextArea name="note" maxLength={200} rows={2} />
|
||||
</label>
|
||||
</fieldset>
|
||||
{problem}
|
||||
<div className="form-actions">
|
||||
{cancel}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="inventory-change-reject"
|
||||
disabled={stale || blocked}
|
||||
onClick={e => void save(e.currentTarget.form!, 'reject')}
|
||||
>
|
||||
驳回申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{!request.stale && request.canApprove !== false && (
|
||||
<button type="submit" className="primary" disabled={stale || blocked}>
|
||||
<LedgerButton type="submit" className="primary" disabled={stale || blocked}>
|
||||
批准{act}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
@@ -433,7 +433,9 @@ export function ChangeDialog({
|
||||
{detail.pending && '这组记录已有申请,等待审批期间库存不变。'}
|
||||
</p>
|
||||
{detail.pending && (
|
||||
<button onClick={() => open({ kind: 'request', id: detail.pending!.id })}>查看待审批申请</button>
|
||||
<LedgerButton onClick={() => open({ kind: 'request', id: detail.pending!.id })}>
|
||||
查看待审批申请
|
||||
</LedgerButton>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
@@ -465,15 +467,20 @@ export function ChangeDialog({
|
||||
)}
|
||||
<label>
|
||||
说明(选填)
|
||||
<input name="reason" type="text" maxLength={200} placeholder="可填写修正原因,供审批或后续核对" />
|
||||
<LedgerInput
|
||||
name="reason"
|
||||
type="text"
|
||||
maxLength={200}
|
||||
placeholder="可填写修正原因,供审批或后续核对"
|
||||
/>
|
||||
</label>
|
||||
</fieldset>
|
||||
{problem}
|
||||
<div className="form-actions">
|
||||
{cancel}
|
||||
<button type="submit" className="primary" disabled={blocked || stale}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked || stale}>
|
||||
{approval ? '提交' + act + '申请' : deleting ? '确认删除' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef, type ReactNode } from 'react';
|
||||
import { type ReactNode } from 'react';
|
||||
import { LedgerButton, LedgerDialog } from '../../components/BusinessControls';
|
||||
export function Dialog({
|
||||
id,
|
||||
title,
|
||||
@@ -10,16 +11,9 @@ export function Dialog({
|
||||
close: () => void;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const dialog = ref.current!;
|
||||
dialog.showModal();
|
||||
return () => dialog.close();
|
||||
}, []);
|
||||
const pocket = id === 'pocket-editor-dialog';
|
||||
return (
|
||||
<dialog
|
||||
ref={ref}
|
||||
<LedgerDialog
|
||||
id={id}
|
||||
aria-labelledby={pocket ? 'pocket-editor-title' : 'inventory-change-title'}
|
||||
onCancel={e => {
|
||||
@@ -27,7 +21,7 @@ export function Dialog({
|
||||
close();
|
||||
}}
|
||||
>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action={pocket ? 'pocket-manager-close' : 'inventory-change-close'}
|
||||
@@ -35,9 +29,9 @@ export function Dialog({
|
||||
onClick={close}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id={pocket ? 'pocket-editor-title' : 'inventory-change-title'}>{title}</h2>
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
@@ -20,6 +20,7 @@ import { Movements } from './Movements';
|
||||
import { Changes, ChangeDialog } from './Changes';
|
||||
import { Pockets, type RegisterLeaveGuard } from './Pockets';
|
||||
import './inventory.css';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
const viewMemory = new WeakMap<Props['client'], { user: string; history: boolean; manager: boolean }>();
|
||||
export function InventoryPage({
|
||||
@@ -106,7 +107,7 @@ export function InventoryPage({
|
||||
{page && (
|
||||
<div className="actions">
|
||||
{owner && (
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="pocket-manager-toggle"
|
||||
aria-controls="pocket-manager"
|
||||
aria-expanded={manager}
|
||||
@@ -121,9 +122,9 @@ export function InventoryPage({
|
||||
}}
|
||||
>
|
||||
管理货盘
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button
|
||||
<LedgerButton
|
||||
id="inventory-changes-entry"
|
||||
data-action="inventory-change-jump"
|
||||
onClick={() => {
|
||||
@@ -135,20 +136,20 @@ export function InventoryPage({
|
||||
>
|
||||
{owner ? '库存修改审批' : '我的库存申请'}
|
||||
{pendingCount != null && '(' + pendingCount + (owner ? '' : '待批') + ')'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{owner && page.canReview && (
|
||||
<button className="primary" disabled={blocked} data-action="inventory-review" onClick={review}>
|
||||
<LedgerButton className="primary" disabled={blocked} data-action="inventory-review" onClick={review}>
|
||||
复核并保存今日快照
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="inventory-history"
|
||||
aria-expanded={history}
|
||||
aria-controls="inventory-history"
|
||||
onClick={() => changeView(!history, manager)}
|
||||
>
|
||||
{history ? '收起每日快照' : '查看每日快照'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{owner && <a href="/api/export/inventory">导出当前库存</a>}
|
||||
</div>
|
||||
)}
|
||||
@@ -159,9 +160,9 @@ export function InventoryPage({
|
||||
<div className="error">
|
||||
{response.error}
|
||||
<div>
|
||||
<button data-action="inventory-retry" onClick={reload}>
|
||||
<LedgerButton data-action="inventory-retry" onClick={reload}>
|
||||
重新读取库存
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
) : !page ? (
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { grams } from '../../lib/format';
|
||||
import { Model } from '../../shared';
|
||||
import { actor, count, label, useRead, type Context, type Selection, type Movement } from './data';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
const names: Record<string, string> = {
|
||||
increase: '增加',
|
||||
decrease: '减少',
|
||||
@@ -154,7 +155,7 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
['previous', '上一页'],
|
||||
['next', '下一页'],
|
||||
].map(([k, t]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={k}
|
||||
data-action="inventory-movements-page"
|
||||
data-direction={k}
|
||||
@@ -162,7 +163,7 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
onClick={() => update({ page: r.page + (k === 'next' ? 1 : -1) })}
|
||||
>
|
||||
{t}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
@@ -184,7 +185,7 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
' 条'
|
||||
: '共 0 条')}
|
||||
</span>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
id="inventory-movements-export"
|
||||
data-action="inventory-movements-export"
|
||||
@@ -192,7 +193,7 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
onClick={download}
|
||||
>
|
||||
{exporting ? '正在导出…' : '导出Excel'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<p>团队共用库存,全部流水可查看。员工可直接修改本人当天的手动记录;跨天修改、改到其他日期及删除仍须店主审批。</p>
|
||||
@@ -204,7 +205,7 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
{(['from', 'to'] as const).map(k => (
|
||||
<label key={k}>
|
||||
{k === 'from' ? '开始日期' : '结束日期'}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id={'inventory-movements-' + k}
|
||||
value={filter[k]}
|
||||
@@ -212,12 +213,16 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
/>
|
||||
</label>
|
||||
))}
|
||||
<button data-action="inventory-movements-clear-dates" onClick={() => update({ from: '', to: '' })}>
|
||||
<LedgerButton data-action="inventory-movements-clear-dates" onClick={() => update({ from: '', to: '' })}>
|
||||
全部日期
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<label>
|
||||
筛选货盘
|
||||
<select id="inventory-movements-pocket" value={pocket} onChange={e => update({ pocket: e.target.value })}>
|
||||
<LedgerSelect
|
||||
id="inventory-movements-pocket"
|
||||
value={pocket}
|
||||
onChange={e => update({ pocket: e.target.value })}
|
||||
>
|
||||
<option value="">全部货盘</option>
|
||||
{options.map(o => (
|
||||
<option key={o.pocket} value={o.pocket}>
|
||||
@@ -225,11 +230,11 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
{!o.active && '(已停用 · 历史)'}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label>
|
||||
流水类型
|
||||
<select id="inventory-movements-kind" value={kind} onChange={e => update({ kind: e.target.value })}>
|
||||
<LedgerSelect id="inventory-movements-kind" value={kind} onChange={e => update({ kind: e.target.value })}>
|
||||
{Object.entries({
|
||||
all: '全部流水',
|
||||
increase: '手动增加',
|
||||
@@ -241,16 +246,16 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
{v}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="inventory-movements-toggle-deleted"
|
||||
id="inventory-movements-toggle-deleted"
|
||||
aria-pressed={hideDeleted}
|
||||
onClick={() => update({ hideDeleted: !hideDeleted })}
|
||||
>
|
||||
{hideDeleted ? '显示' : '隐藏'}已删除记录
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span>按流水日期筛选,含起止当天;留空不限。每页100条,可翻页查看更早记录。平移按两边货盘分别记一条。</span>
|
||||
</div>
|
||||
<div id="inventory-movements-pagination">{pager}</div>
|
||||
@@ -260,7 +265,8 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
<div id="inventory-movements-list" aria-live="polite" aria-busy={valid && !reply}>
|
||||
{!valid || reply?.error ? (
|
||||
<div>
|
||||
{reply?.error || '开始日期不能晚于结束日期'} <button onClick={() => retry(n => n + 1)}>重新读取流水</button>
|
||||
{reply?.error || '开始日期不能晚于结束日期'}{' '}
|
||||
<LedgerButton onClick={() => retry(n => n + 1)}>重新读取流水</LedgerButton>
|
||||
</div>
|
||||
) : !r ? (
|
||||
'正在读取库存流水…'
|
||||
@@ -270,41 +276,41 @@ export function Movements({ client, state, version, blocked, open }: { open: (s:
|
||||
'当前筛选下暂无库存流水。'
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['日期', '货盘', '变动', '动作', '备注/原单', '经办人', '状态/操作'].map(t => (
|
||||
<th key={t}>{t}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{r.movements.map(row => (
|
||||
<tr key={row.id} data-movement-id={row.id}>
|
||||
<td>{row.date}</td>
|
||||
<td>
|
||||
{label(state, row.pocket)}
|
||||
{!Model.activePocketKeys(state).includes(row.pocket) && <div>已停用 · 历史</div>}
|
||||
</td>
|
||||
<td>
|
||||
{row.mg > 0 && '+'}
|
||||
{grams(row.mg)}g
|
||||
{(row.stockCount != null || Model.pocketCountsEnabled(state, row.pocket)) && (
|
||||
<div>{count(row.stockCount, true)}</div>
|
||||
)}
|
||||
</td>
|
||||
<td>{names[row.kind] || row.kind}</td>
|
||||
<td>
|
||||
{row.reversal || row.kind === 'manual_reversal' ? '撤回旧记录的库存影响' : row.note || '—'}
|
||||
</td>
|
||||
<td>{actor(state, row.actor)}</td>
|
||||
<td>
|
||||
<Actions row={row} open={open} blocked={blocked} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '日期' },
|
||||
{ title: '货盘' },
|
||||
{ title: '变动' },
|
||||
{ title: '动作' },
|
||||
{ title: '备注/原单' },
|
||||
{ title: '经办人' },
|
||||
{ title: '状态/操作' },
|
||||
]}
|
||||
rows={r.movements.map(row => ({
|
||||
key: row.id,
|
||||
attributes: { 'data-movement-id': row.id },
|
||||
cells: [
|
||||
row.date,
|
||||
<>
|
||||
{label(state, row.pocket)}
|
||||
{!Model.activePocketKeys(state).includes(row.pocket) && <div>已停用 · 历史</div>}
|
||||
</>,
|
||||
<>
|
||||
{row.mg > 0 && '+'}
|
||||
{grams(row.mg)}g
|
||||
{(row.stockCount != null || Model.pocketCountsEnabled(state, row.pocket)) && (
|
||||
<div>{count(row.stockCount, true)}</div>
|
||||
)}
|
||||
</>,
|
||||
names[row.kind] || row.kind,
|
||||
row.reversal || row.kind === 'manual_reversal' ? '撤回旧记录的库存影响' : row.note || '—',
|
||||
actor(state, row.actor),
|
||||
<>
|
||||
<Actions row={row} open={open} blocked={blocked} />
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{pager}
|
||||
@@ -332,37 +338,37 @@ function Actions({ row: r, open, blocked }: { row: Movement; open: (s: Selection
|
||||
<>
|
||||
{text && <div>{text}</div>}
|
||||
{manual && r.pendingRequestId ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
disabled={blocked}
|
||||
data-action="inventory-change-open-request"
|
||||
data-id={r.pendingRequestId}
|
||||
onClick={() => open({ id: r.pendingRequestId!, kind: 'request' })}
|
||||
>
|
||||
待审批 · 查看
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : manual && r.pendingApproval ? (
|
||||
'待店主审批'
|
||||
) : canChange && (r.canEdit || r.canDelete) ? (
|
||||
<>
|
||||
{r.canEdit && (
|
||||
<button
|
||||
<LedgerButton
|
||||
disabled={blocked}
|
||||
data-action="inventory-change-edit"
|
||||
data-id={r.id}
|
||||
onClick={() => open({ id: r.id, kind: 'update' })}
|
||||
>
|
||||
修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{r.canDelete && (
|
||||
<button
|
||||
<LedgerButton
|
||||
disabled={blocked}
|
||||
data-action="inventory-change-delete"
|
||||
data-id={r.id}
|
||||
onClick={() => open({ id: r.id, kind: 'delete' })}
|
||||
>
|
||||
删除
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</>
|
||||
) : manual ? (
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useEffect, useState, type FormEvent } from 'react';
|
||||
import type { ApiError } from '../../lib/api';
|
||||
import { Dialog } from './Dialog';
|
||||
import { countValue, useRead, type CatalogRow, type Context } from './data';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput } from '../../components/BusinessControls';
|
||||
export type RegisterLeaveGuard = (check: () => boolean) => () => void;
|
||||
type Reply = { catalog: CatalogRow[]; pockets: string[]; canManage?: boolean };
|
||||
function validate(r: Reply) {
|
||||
@@ -127,9 +128,9 @@ export function Pockets({
|
||||
<div className="error">
|
||||
{error}
|
||||
{stale && (
|
||||
<button type="button" data-action="pocket-manager-reload" onClick={refresh}>
|
||||
<LedgerButton type="button" data-action="pocket-manager-reload" onClick={refresh}>
|
||||
重新读取货盘
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@@ -139,18 +140,18 @@ export function Pockets({
|
||||
<div className="panel-title">
|
||||
<h2>货盘管理</h2>
|
||||
<div>
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="pocket-manager-add"
|
||||
className="primary"
|
||||
disabled={blocked || stale}
|
||||
onClick={() => edit('new')}
|
||||
>
|
||||
+ 新增货盘
|
||||
</button>
|
||||
<button data-action="pocket-manager-reload" disabled={blocked} onClick={refresh}>
|
||||
</LedgerButton>
|
||||
<LedgerButton data-action="pocket-manager-reload" disabled={blocked} onClick={refresh}>
|
||||
重新读取
|
||||
</button>
|
||||
<button
|
||||
</LedgerButton>
|
||||
<LedgerButton
|
||||
data-action="pocket-manager-toggle"
|
||||
disabled={blocked}
|
||||
onClick={() => {
|
||||
@@ -158,14 +159,14 @@ export function Pockets({
|
||||
}}
|
||||
>
|
||||
收起
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<p>新增货盘按自有库存管理。停用后保留库存与历史记录,可重新启用。</p>
|
||||
<div id="pocket-manager-content" aria-live="polite" aria-busy={open && !response}>
|
||||
{response?.error ? (
|
||||
<div>
|
||||
{response.error} <button onClick={refresh}>重新读取</button>
|
||||
{response.error} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : !rows ? (
|
||||
'正在读取货盘…'
|
||||
@@ -173,7 +174,7 @@ export function Pockets({
|
||||
<>
|
||||
<label>
|
||||
搜索货盘
|
||||
<input
|
||||
<LedgerInput
|
||||
type="search"
|
||||
id="pocket-manager-search"
|
||||
value={search}
|
||||
@@ -187,48 +188,41 @@ export function Pockets({
|
||||
'没有匹配的货盘。'
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['货盘名称', '计数方式', '状态', '操作'].map(s => (
|
||||
<th key={s}>{s}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{found.map(r => (
|
||||
<tr key={r.key}>
|
||||
<td>{r.name}</td>
|
||||
<td>{r.countUnit === 'pair' ? '克重 + 对数' : '仅克重'}</td>
|
||||
<td>{r.active ? '已启用' : '已停用'}</td>
|
||||
<td>
|
||||
<button
|
||||
data-action="pocket-manager-edit"
|
||||
data-pocket-key={r.key}
|
||||
onClick={() => edit(r)}
|
||||
disabled={blocked || stale}
|
||||
>
|
||||
编辑
|
||||
</button>
|
||||
<button
|
||||
data-action="pocket-manager-status"
|
||||
data-pocket-key={r.key}
|
||||
data-active={!r.active}
|
||||
disabled={blocked || stale}
|
||||
onClick={() =>
|
||||
void save('/api/pockets/' + encodeURIComponent(r.key) + '/update', {
|
||||
revision: r.revision,
|
||||
active: !r.active,
|
||||
})
|
||||
}
|
||||
>
|
||||
{r.active ? '停用' : '启用'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[{ title: '货盘名称' }, { title: '计数方式' }, { title: '状态' }, { title: '操作' }]}
|
||||
rows={found.map(r => ({
|
||||
key: r.key,
|
||||
cells: [
|
||||
r.name,
|
||||
r.countUnit === 'pair' ? '克重 + 对数' : '仅克重',
|
||||
r.active ? '已启用' : '已停用',
|
||||
<>
|
||||
<LedgerButton
|
||||
data-action="pocket-manager-edit"
|
||||
data-pocket-key={r.key}
|
||||
onClick={() => edit(r)}
|
||||
disabled={blocked || stale}
|
||||
>
|
||||
编辑
|
||||
</LedgerButton>
|
||||
<LedgerButton
|
||||
data-action="pocket-manager-status"
|
||||
data-pocket-key={r.key}
|
||||
data-active={!r.active}
|
||||
disabled={blocked || stale}
|
||||
onClick={() =>
|
||||
void save('/api/pockets/' + encodeURIComponent(r.key) + '/update', {
|
||||
revision: r.revision,
|
||||
active: !r.active,
|
||||
})
|
||||
}
|
||||
>
|
||||
{r.active ? '停用' : '启用'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -248,7 +242,7 @@ export function Pockets({
|
||||
>
|
||||
<label>
|
||||
货盘名称
|
||||
<input
|
||||
<LedgerInput
|
||||
autoFocus
|
||||
required
|
||||
maxLength={40}
|
||||
@@ -265,7 +259,7 @@ export function Pockets({
|
||||
) : (
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="enableCounts"
|
||||
checked={enable}
|
||||
@@ -277,7 +271,7 @@ export function Pockets({
|
||||
<div data-pocket-count-baseline hidden={!enable}>
|
||||
<label>
|
||||
实际当前库存数量(对)
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name="initialCount"
|
||||
min="0"
|
||||
@@ -290,7 +284,7 @@ export function Pockets({
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
<LedgerInput
|
||||
name="countVerified"
|
||||
type="checkbox"
|
||||
disabled={!enable || blocked || stale}
|
||||
@@ -306,12 +300,12 @@ export function Pockets({
|
||||
{problem}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="button" data-action="pocket-manager-close" disabled={blocked} onClick={close}>
|
||||
<LedgerButton type="button" data-action="pocket-manager-close" disabled={blocked} onClick={close}>
|
||||
取消
|
||||
</button>
|
||||
<button type="submit" className="primary" disabled={blocked || stale}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked || stale}>
|
||||
{editor === 'new' ? '新增货盘' : '保存设置'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</Dialog>
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
type Snapshot,
|
||||
type Context,
|
||||
} from './data';
|
||||
import { LedgerButton, LedgerInput, LedgerTable } from '../../components/BusinessControls';
|
||||
|
||||
export function Status({ page, state }: { page: Inventory; state: Context['state'] }) {
|
||||
const s = page.todaySnapshot,
|
||||
@@ -105,7 +106,7 @@ export function SnapshotHistory({ page, open, client, state, version }: { page:
|
||||
['month', '本月'],
|
||||
['all', '全部记录'],
|
||||
].map(([k, t]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={k}
|
||||
data-action="inventory-history-period"
|
||||
data-period={k}
|
||||
@@ -116,12 +117,12 @@ export function SnapshotHistory({ page, open, client, state, version }: { page:
|
||||
}}
|
||||
>
|
||||
{t}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
<label>
|
||||
指定日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id="inventory-history-date"
|
||||
value={mode === 'date' ? date : page.date}
|
||||
@@ -143,9 +144,9 @@ export function SnapshotHistory({ page, open, client, state, version }: { page:
|
||||
(!valid || reply?.error ? (
|
||||
<div>
|
||||
{reply?.error || '请选择今天或之前的有效日期。'}{' '}
|
||||
<button data-action="inventory-history-retry" onClick={() => retry(n => n + 1)}>
|
||||
<LedgerButton data-action="inventory-history-retry" onClick={() => retry(n => n + 1)}>
|
||||
重新读取快照
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : !snapshots ? (
|
||||
'正在读取已保存的快照…'
|
||||
@@ -153,7 +154,7 @@ export function SnapshotHistory({ page, open, client, state, version }: { page:
|
||||
'这段日期尚未保存每日库存快照。'
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<LedgerTable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
@@ -198,7 +199,7 @@ export function SnapshotHistory({ page, open, client, state, version }: { page:
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState, type FormEvent } from 'react';
|
||||
import { stockInput } from './stockInput';
|
||||
import { Model, type LedgerState } from '../../shared';
|
||||
import { kinds, type Values, type Context } from './data';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
export function StockFields({
|
||||
state,
|
||||
@@ -39,7 +40,7 @@ export function StockFields({
|
||||
const date = (
|
||||
<label>
|
||||
业务日期
|
||||
<input
|
||||
<LedgerInput
|
||||
name="date"
|
||||
type="date"
|
||||
defaultValue={original?.date || state.today}
|
||||
@@ -55,7 +56,7 @@ export function StockFields({
|
||||
{original && date}
|
||||
<label>
|
||||
{original ? '类型' : '动作'}
|
||||
<select name="kind" value={kind} onChange={e => setKind(e.target.value)}>
|
||||
<LedgerSelect name="kind" value={kind} onChange={e => setKind(e.target.value)}>
|
||||
{Object.entries(kinds)
|
||||
.filter(([key]) => key !== 'adjustment' || state.user.role === 'owner' || original?.kind === key)
|
||||
.map(([key, n]) => (
|
||||
@@ -63,23 +64,29 @@ export function StockFields({
|
||||
{key === 'adjustment' && !original ? '只调整对数' : n}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label>
|
||||
<span data-stock-pocket-label>{transfer ? '从哪移出' : '货盘'}</span>
|
||||
<select name="pocket" value={pocket} onChange={e => setPocket(e.target.value)}>
|
||||
<LedgerSelect name="pocket" value={pocket} onChange={e => setPocket(e.target.value)}>
|
||||
{options(original?.pocket)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label data-stock-to hidden={!transfer}>
|
||||
移到哪
|
||||
<select name="to" value={to} disabled={!transfer} required={transfer} onChange={e => setTo(e.target.value)}>
|
||||
<LedgerSelect
|
||||
name="to"
|
||||
value={to}
|
||||
disabled={!transfer}
|
||||
required={transfer}
|
||||
onChange={e => setTo(e.target.value)}
|
||||
>
|
||||
{options(original?.to)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label>
|
||||
{original ? '克重(g)' : '数量(g)'}
|
||||
<input
|
||||
<LedgerInput
|
||||
name="grams"
|
||||
type="number"
|
||||
required
|
||||
@@ -94,7 +101,7 @@ export function StockFields({
|
||||
</label>
|
||||
<label data-stock-count-field hidden={!counted}>
|
||||
库存数量(对)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="stockCount"
|
||||
type="number"
|
||||
defaultValue={original?.stockCount ?? ''}
|
||||
@@ -119,7 +126,7 @@ export function StockFields({
|
||||
)}
|
||||
<label>
|
||||
备注(选填)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="note"
|
||||
type="text"
|
||||
maxLength={200}
|
||||
@@ -128,9 +135,9 @@ export function StockFields({
|
||||
/>
|
||||
</label>
|
||||
{!original && (
|
||||
<button className="primary" id="stock-submit" disabled={!active.length}>
|
||||
<LedgerButton className="primary" id="stock-submit" disabled={!active.length}>
|
||||
{adjustment ? '保存对数调整' : '登记' + kinds[kind]}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.inventory-page {
|
||||
color: var(--ink, #233832);
|
||||
color: var(--ink, var(--ink));
|
||||
min-width: 0;
|
||||
}
|
||||
.inventory-page [hidden] {
|
||||
@@ -14,14 +14,14 @@
|
||||
font-size: clamp(1.9rem, 4vw, 3rem);
|
||||
}
|
||||
.inventory-page p {
|
||||
color: var(--muted, #596963);
|
||||
color: var(--muted, var(--muted));
|
||||
line-height: 1.55;
|
||||
}
|
||||
.inventory-page .panel,
|
||||
.inventory-page .stock-card,
|
||||
.inventory-page .stock-review-status {
|
||||
background: var(--surface, #fff);
|
||||
border: 1px solid var(--line, #dce4df);
|
||||
background: var(--surface, var(--white));
|
||||
border: 1px solid var(--line, var(--border));
|
||||
border-radius: 12px;
|
||||
padding: 18px;
|
||||
margin-block: 14px;
|
||||
@@ -38,7 +38,7 @@
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
.inventory-page .stock-card .yesterday {
|
||||
border-top: 1px solid #dce4df;
|
||||
border-top: 1px solid var(--border);
|
||||
margin-top: 12px;
|
||||
padding-top: 10px;
|
||||
display: grid;
|
||||
@@ -83,7 +83,7 @@
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 8px;
|
||||
border: 1px solid #b9c6bf;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
color: inherit;
|
||||
background: white;
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
.inventory-page button {
|
||||
cursor: pointer;
|
||||
border: 1px solid #b9c6bf;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 7px;
|
||||
background: white;
|
||||
color: inherit;
|
||||
@@ -110,7 +110,7 @@
|
||||
}
|
||||
.inventory-page .primary,
|
||||
.inventory-page button[aria-pressed='true'] {
|
||||
background: #254f46;
|
||||
background: var(--green);
|
||||
color: white;
|
||||
}
|
||||
.inventory-page .table-wrap {
|
||||
@@ -124,7 +124,7 @@
|
||||
.inventory-page td,
|
||||
.inventory-page th {
|
||||
padding: 9px;
|
||||
border-bottom: 1px solid #dde4df;
|
||||
border-bottom: 1px solid var(--border);
|
||||
vertical-align: top;
|
||||
}
|
||||
.inventory-page th {
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
.inventory-page dialog {
|
||||
position: fixed;
|
||||
border: 1px solid #dce4df;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 13px;
|
||||
max-width: min(720px, 94vw);
|
||||
width: 100%;
|
||||
@@ -143,13 +143,13 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.inventory-page dialog::backdrop {
|
||||
background: #18332b55;
|
||||
background: color-mix(in srgb, var(--ink) 33%, transparent);
|
||||
}
|
||||
.inventory-page .dialog-close {
|
||||
float: right;
|
||||
}
|
||||
.inventory-page .error {
|
||||
color: #9a372c;
|
||||
color: var(--danger);
|
||||
}
|
||||
.inventory-page .inventory-change-comparison {
|
||||
display: grid;
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
type Purchase,
|
||||
type EnablePreview,
|
||||
} from './model';
|
||||
import { LedgerButton, LedgerDialog } from '../../components/BusinessControls';
|
||||
|
||||
interface Props {
|
||||
client: LedgerClient;
|
||||
@@ -52,15 +53,9 @@ function MaterialDialog({
|
||||
retry: () => Promise<void>;
|
||||
reload: () => void;
|
||||
} & Props) {
|
||||
const ref = useRef<HTMLDialogElement>(null),
|
||||
[data, setData] = useState<DialogData | null>(null),
|
||||
const [data, setData] = useState<DialogData | null>(null),
|
||||
[readError, setReadError] = useState(''),
|
||||
[error, setError] = useState<ApiError | null>(null);
|
||||
useEffect(() => {
|
||||
const el = ref.current!;
|
||||
el.showModal();
|
||||
return () => el.close();
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
let active = true;
|
||||
async function read(): Promise<DialogData | null> {
|
||||
@@ -112,7 +107,7 @@ function MaterialDialog({
|
||||
const stale =
|
||||
!!error && !settling && (pending || (buying ? error.status === 409 : [403, 404, 409].includes(error.status ?? 0)));
|
||||
const reloadButton = (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
data-action={
|
||||
@@ -127,7 +122,7 @@ function MaterialDialog({
|
||||
onClick={reload}
|
||||
>
|
||||
{buying ? '重新读取这笔购料' : spec.kind === 'enable' ? '重新核对' : '重新读取申请'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
const actions = {
|
||||
blocked,
|
||||
@@ -138,7 +133,7 @@ function MaterialDialog({
|
||||
<div className="error">
|
||||
{error.message}{' '}
|
||||
{pending ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="danger"
|
||||
data-action="retry"
|
||||
@@ -146,7 +141,7 @@ function MaterialDialog({
|
||||
onClick={() => void retry().catch(setError)}
|
||||
>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
(stale || (!buying && !settling)) && reloadButton
|
||||
)}
|
||||
@@ -180,8 +175,7 @@ function MaterialDialog({
|
||||
? '更正申请未读到'
|
||||
: '读取购料更正申请';
|
||||
return (
|
||||
<dialog
|
||||
ref={ref}
|
||||
<LedgerDialog
|
||||
id={prefix + '-dialog'}
|
||||
aria-labelledby={prefix + '-title'}
|
||||
onCancel={e => {
|
||||
@@ -189,7 +183,7 @@ function MaterialDialog({
|
||||
close();
|
||||
}}
|
||||
>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action={
|
||||
@@ -205,7 +199,7 @@ function MaterialDialog({
|
||||
onClick={close}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id={prefix + '-title'}>{title}</h2>
|
||||
{readError ? (
|
||||
<div className="error">
|
||||
@@ -235,7 +229,7 @@ function MaterialDialog({
|
||||
: '正在读取原购料记录及订单影响…'}
|
||||
</p>
|
||||
)}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
const lastPool = new WeakMap<LedgerClient, { user: string; date: string }>();
|
||||
@@ -369,14 +363,14 @@ export function MaterialPoolsPage({ client, state, onState, onRecoverOther }: Pr
|
||||
{pending && !client.busy && (
|
||||
<div className="note" role="alert">
|
||||
上次提交结果尚未确认,请先恢复原操作。{' '}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="retry"
|
||||
className="danger"
|
||||
onClick={() => void retry().catch(e => setNotice(e.message))}
|
||||
>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
{saved ? (
|
||||
@@ -391,16 +385,16 @@ export function MaterialPoolsPage({ client, state, onState, onRecoverOther }: Pr
|
||||
: '正在读取最新材料记录…'}
|
||||
</p>
|
||||
<div className="actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="refresh-material-pools"
|
||||
className="primary"
|
||||
onClick={() => void refresh()}
|
||||
>
|
||||
重新读取每日料价
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{saved === '购料已保存' && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="new-material-purchase"
|
||||
onClick={() => {
|
||||
@@ -409,7 +403,7 @@ export function MaterialPoolsPage({ client, state, onState, onRecoverOther }: Pr
|
||||
}}
|
||||
>
|
||||
继续登记另一笔购料
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
@@ -422,9 +416,9 @@ export function MaterialPoolsPage({ client, state, onState, onRecoverOther }: Pr
|
||||
<h1>每日购料</h1>
|
||||
<p>购料付款当天记支出,余料结转;订单按实际耗用自动计料费。</p>
|
||||
</div>
|
||||
<button type="button" data-action="refresh-material-pools" onClick={() => void refresh()}>
|
||||
<LedgerButton type="button" data-action="refresh-material-pools" onClick={() => void refresh()}>
|
||||
刷新
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
{notice && (
|
||||
<div role="status" className="note">
|
||||
@@ -443,9 +437,9 @@ export function MaterialPoolsPage({ client, state, onState, onRecoverOther }: Pr
|
||||
{readError ? (
|
||||
<div className="error">
|
||||
{readError}{' '}
|
||||
<button type="button" data-action="refresh-material-pools" onClick={() => void refresh()}>
|
||||
<LedgerButton type="button" data-action="refresh-material-pools" onClick={() => void refresh()}>
|
||||
重新读取
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : data ? (
|
||||
<>
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
type DialogSpec,
|
||||
type Usage,
|
||||
} from './model';
|
||||
import { LedgerButton, LedgerDataTable, LedgerTable } from '../../components/BusinessControls';
|
||||
|
||||
interface Actions {
|
||||
state: LedgerState;
|
||||
@@ -34,7 +35,7 @@ function SourceLink({
|
||||
recoveries: ['recovery-open', 'recovery'],
|
||||
}[kind];
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="link-button"
|
||||
data-action={target[0]}
|
||||
@@ -44,7 +45,7 @@ function SourceLink({
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
export function RollingSummary({ pool: p, cutover }: { pool: Pool; cutover: string }) {
|
||||
@@ -223,7 +224,7 @@ function PurchaseActions({ p, rolling, state, openDialog }: Actions & { p: Purch
|
||||
return (
|
||||
<div className="actions">
|
||||
{(['edit', 'delete'] as const).map(kind => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={kind}
|
||||
type="button"
|
||||
className={kind === 'edit' ? 'quiet' : 'danger'}
|
||||
@@ -233,7 +234,7 @@ function PurchaseActions({ p, rolling, state, openDialog }: Actions & { p: Purch
|
||||
>
|
||||
{prefix}
|
||||
{kind === 'edit' ? '修改' : '删除'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
@@ -267,38 +268,37 @@ function PoolSettlement({ pool: p, state, openDialog }: Actions & { pool: Pool }
|
||||
: (due! < 0 ? owner + '待转回' + assistant : assistant + '待交' + owner) + ' ' + money(Math.abs(due!))}
|
||||
</span>
|
||||
{!blocked && due !== 0 && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="material-pool-settlement"
|
||||
data-id={p.id}
|
||||
onClick={() => openDialog({ kind: 'settlement', pool: p })}
|
||||
>
|
||||
登记实际交款/返款
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
{!!p.settlements?.length && (
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>实际交款/返款</th>
|
||||
<th className="number">金额</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{p.settlements.map((s, i) => (
|
||||
<tr key={i}>
|
||||
<td>{s.date}</td>
|
||||
<td>{s.amount < 0 ? owner + ' → ' + assistant : assistant + ' → ' + owner}</td>
|
||||
<td className="number">{money(Math.abs(s.amount))}</td>
|
||||
<td>{s.note}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="material-detail-table"
|
||||
columns={[
|
||||
{ title: '日期' },
|
||||
{ title: '实际交款/返款' },
|
||||
{ title: '金额', headerClassName: 'number' },
|
||||
{ title: '备注' },
|
||||
]}
|
||||
rows={p.settlements.map((s, i) => ({
|
||||
key: i,
|
||||
cellClasses: [undefined, undefined, 'number', undefined],
|
||||
cells: [
|
||||
s.date,
|
||||
s.amount < 0 ? owner + ' → ' + assistant : assistant + ' → ' + owner,
|
||||
money(Math.abs(s.amount)),
|
||||
s.note,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -327,7 +327,7 @@ function PoolDetail({ pool: p, rolling, state, openDialog }: Actions & { pool: P
|
||||
<h3>{p.date} 购料明细(按录入先后)</h3>
|
||||
<p className="small muted">单价=本笔购买总价÷购买克重,与当天加权料价分开显示;显示精度不改变记账金额。</p>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table material-purchase-table">
|
||||
<LedgerTable className="material-detail-table material-purchase-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>购料日期</th>
|
||||
@@ -359,49 +359,48 @@ function PoolDetail({ pool: p, rolling, state, openDialog }: Actions & { pool: P
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
{!!p.returns?.length && (
|
||||
<>
|
||||
<h3>退货回料追溯</h3>
|
||||
<p className="small muted">回料没有新增购料付款。金料按原订单成本计入,工费与快递费不加入料池。</p>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table material-return-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>回料日期/原订单</th>
|
||||
<th className="number">实际退回克重</th>
|
||||
<th className="number">原金料成本</th>
|
||||
<th>计入方式</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{p.returns.map((r, i) => (
|
||||
<tr key={i}>
|
||||
<td>
|
||||
{r.date || p.date}
|
||||
{r.order_id && (
|
||||
<>
|
||||
<br />
|
||||
<SourceLink kind="orders" id={r.order_id}>
|
||||
{r.number || '查看原订单'}
|
||||
</SourceLink>
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
<td className="number">{grams(r.mg ?? r.grossMg)}g</td>
|
||||
<td className="number">{money(r.amount ?? r.grossAmount)}</td>
|
||||
<td>{r.sameDay ? '同日售退已净抵销' : '并入回料当天材料'}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="material-detail-table material-return-table"
|
||||
columns={[
|
||||
{ title: '回料日期/原订单' },
|
||||
{ title: '实际退回克重', headerClassName: 'number' },
|
||||
{ title: '原金料成本', headerClassName: 'number' },
|
||||
{ title: '计入方式' },
|
||||
]}
|
||||
rows={p.returns.map((r, i) => ({
|
||||
key: i,
|
||||
cellClasses: [undefined, 'number', 'number', undefined],
|
||||
cells: [
|
||||
<>
|
||||
{r.date || p.date}
|
||||
{r.order_id && (
|
||||
<>
|
||||
<br />
|
||||
<SourceLink kind="orders" id={r.order_id}>
|
||||
{r.number || '查看原订单'}
|
||||
</SourceLink>
|
||||
</>
|
||||
)}
|
||||
</>,
|
||||
<>{grams(r.mg ?? r.grossMg)}g</>,
|
||||
money(r.amount ?? r.grossAmount),
|
||||
r.sameDay ? '同日售退已净抵销' : '并入回料当天材料',
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
<h3>订单耗用与锁价原料明细</h3>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table">
|
||||
<LedgerTable className="material-detail-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/订单或锁价单</th>
|
||||
@@ -441,7 +440,7 @@ function PoolDetail({ pool: p, rolling, state, openDialog }: Actions & { pool: P
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
<PoolSettlement pool={p} state={state} openDialog={openDialog} />
|
||||
</div>
|
||||
@@ -479,14 +478,14 @@ export function PoolList({
|
||||
<div className="panel-title">
|
||||
<h2>合并未用完的材料</h2>
|
||||
{state.user.role === 'owner' && data.rolling.canEnable && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="primary"
|
||||
data-action="material-rolling-enable-preview"
|
||||
onClick={() => openDialog({ kind: 'enable' })}
|
||||
>
|
||||
核对并启用跨日结转
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
<p className="small muted">
|
||||
@@ -522,7 +521,7 @@ export function PoolList({
|
||||
</span>
|
||||
</div>
|
||||
<div className="table-wrap">
|
||||
<table className={'material-pool-table' + (rolling ? ' material-rolling-history-table' : '')}>
|
||||
<LedgerTable className={'material-pool-table' + (rolling ? ' material-rolling-history-table' : '')}>
|
||||
<thead>
|
||||
<tr>
|
||||
{headings.map((h, i) => (
|
||||
@@ -580,7 +579,7 @@ export function PoolList({
|
||||
</>
|
||||
)}
|
||||
<td>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
data-action="toggle-material-pool"
|
||||
@@ -589,7 +588,7 @@ export function PoolList({
|
||||
onClick={() => toggle(open ? '' : p.id)}
|
||||
>
|
||||
{open ? '收起' : '查看'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</td>
|
||||
</tr>
|
||||
{open && (
|
||||
@@ -610,7 +609,7 @@ export function PoolList({
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
<p className="small muted material-pool-footnote">
|
||||
{rolling
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
type PurchaseInput,
|
||||
type Save,
|
||||
} from './model';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
function initialDraft(state: LedgerState) {
|
||||
let saved: Record<string, unknown> | null;
|
||||
@@ -43,11 +44,11 @@ function PurchaseFields({
|
||||
<div className="material-purchase-fields">
|
||||
<label>
|
||||
购料日期
|
||||
<input name="date" defaultValue={value.date} type="date" required min={minDate} max={state.today} />
|
||||
<LedgerInput name="date" defaultValue={value.date} type="date" required min={minDate} max={state.today} />
|
||||
</label>
|
||||
<label>
|
||||
购买克重(g)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="grams"
|
||||
defaultValue={value.grams}
|
||||
type="number"
|
||||
@@ -60,7 +61,7 @@ function PurchaseFields({
|
||||
</label>
|
||||
<label>
|
||||
购买总价(元)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="total"
|
||||
defaultValue={value.total}
|
||||
type="number"
|
||||
@@ -73,17 +74,17 @@ function PurchaseFields({
|
||||
</label>
|
||||
<label>
|
||||
付款人
|
||||
<select name="payer" defaultValue={value.payer}>
|
||||
<LedgerSelect name="payer" defaultValue={value.payer}>
|
||||
{Model.memberOptions(state, false, { selected: value.payer }).map(([key, name]) => (
|
||||
<option key={key} value={key}>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label>
|
||||
备注(选填)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="note"
|
||||
defaultValue={value.note}
|
||||
type="text"
|
||||
@@ -142,9 +143,9 @@ export function PurchaseForm({
|
||||
onSubmit={submit}
|
||||
>
|
||||
<PurchaseFields state={state} value={draft} create>
|
||||
<button type="submit" className="primary" disabled={blocked}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked}>
|
||||
保存购料
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</PurchaseFields>
|
||||
<div id="material-purchase-error" aria-live="polite">
|
||||
{error && <div className="error">{error}</div>}
|
||||
@@ -185,18 +186,23 @@ export function PurchaseChange({
|
||||
return (
|
||||
<>
|
||||
<p>这笔购料已删除,原记录与操作历史保留。</p>
|
||||
<button className="primary" type="button" data-action="refresh-changed-material-purchase" onClick={refresh}>
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
type="button"
|
||||
data-action="refresh-changed-material-purchase"
|
||||
onClick={refresh}
|
||||
>
|
||||
关闭并刷新每日购料
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
if (p.recovery_id)
|
||||
return (
|
||||
<>
|
||||
<p>这笔购料随回收/置换原单保留,不能在购料页独立修改或删除。</p>
|
||||
<button type="button" className="quiet" data-action="close-material-purchase" onClick={close}>
|
||||
<LedgerButton type="button" className="quiet" data-action="close-material-purchase" onClick={close}>
|
||||
关闭
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
if (p.canEdit === false && p.canRequestChange === false)
|
||||
@@ -284,7 +290,7 @@ export function PurchaseChange({
|
||||
<div className="material-purchase-review-fields" hidden={!approval}>
|
||||
<label>
|
||||
更正原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="change_reason"
|
||||
maxLength={200}
|
||||
rows={2}
|
||||
@@ -293,7 +299,7 @@ export function PurchaseChange({
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input name="change_verified" type="checkbox" required={approval} />
|
||||
<LedgerInput name="change_verified" type="checkbox" required={approval} />
|
||||
已核对原始购料凭据与本次申请值,提交店主复核后再更正。
|
||||
</label>
|
||||
</div>
|
||||
@@ -303,12 +309,12 @@ export function PurchaseChange({
|
||||
{error}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="button" className="quiet" data-action="close-material-purchase" onClick={close}>
|
||||
<LedgerButton type="button" className="quiet" data-action="close-material-purchase" onClick={close}>
|
||||
取消
|
||||
</button>
|
||||
<button type="submit" className={edit ? 'primary' : 'danger'} disabled={blocked || stale}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" className={edit ? 'primary' : 'danger'} disabled={blocked || stale}>
|
||||
{approval ? '提交' + text + '申请' : edit ? '保存修改' : '确认删除购料'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
@@ -345,22 +351,22 @@ export function Settlement({ state, pool: p, actions }: { state: LedgerState; po
|
||||
<div className="grid three">
|
||||
<label>
|
||||
业务日期
|
||||
<input name="date" defaultValue={state.today} type="date" max={state.today} required />
|
||||
<LedgerInput name="date" defaultValue={state.today} type="date" max={state.today} required />
|
||||
</label>
|
||||
<label>
|
||||
转款方向
|
||||
<select name="direction" defaultValue={due < 0 ? 'toAssistant' : 'toOwner'}>
|
||||
<LedgerSelect name="direction" defaultValue={due < 0 ? 'toAssistant' : 'toOwner'}>
|
||||
<option value="toOwner">
|
||||
{assistant} → {owner}
|
||||
</option>
|
||||
<option value="toAssistant">
|
||||
{owner} → {assistant}
|
||||
</option>
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label>
|
||||
实际转账金额(元)
|
||||
<input
|
||||
<LedgerInput
|
||||
name="amount"
|
||||
defaultValue={(Math.abs(due) / 100).toFixed(2)}
|
||||
type="number"
|
||||
@@ -372,22 +378,22 @@ export function Settlement({ state, pool: p, actions }: { state: LedgerState; po
|
||||
</div>
|
||||
<label>
|
||||
凭据/备注(选填)
|
||||
<input name="note" type="text" maxLength={150} />
|
||||
<LedgerInput name="note" type="text" maxLength={150} />
|
||||
</label>
|
||||
<label className="check">
|
||||
<input name="verified" type="checkbox" required />
|
||||
<LedgerInput name="verified" type="checkbox" required />
|
||||
已核实双方实际转账。
|
||||
</label>
|
||||
<div id="material-settlement-error" aria-live="polite">
|
||||
{error}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="button" className="quiet" data-action="close-material-settlement" onClick={close}>
|
||||
<LedgerButton type="button" className="quiet" data-action="close-material-settlement" onClick={close}>
|
||||
取消
|
||||
</button>
|
||||
<button type="submit" className="primary" disabled={blocked}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked}>
|
||||
保存实际交款
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
type Purchase,
|
||||
} from './model';
|
||||
import type { FormActions } from './PurchaseForms';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
function time(value?: string) {
|
||||
const date = new Date(value || '');
|
||||
@@ -67,29 +68,34 @@ export function ChangePanel({
|
||||
<section className="panel material-change-panel">
|
||||
<div className="panel-title">
|
||||
<h2>{state.user.role === 'owner' ? '历史购料更正复核' : '我的历史购料更正'}</h2>
|
||||
<button type="button" data-action="material-change-refresh" className="quiet" onClick={() => reload(seq + 1)}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="material-change-refresh"
|
||||
className="quiet"
|
||||
onClick={() => reload(seq + 1)}
|
||||
>
|
||||
刷新更正申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<p className="small muted">历史购料修改或删除先提交申请,店主查看料价和订单影响后批准;待批期间仍按原值记账。</p>
|
||||
<div id="material-changes-list" aria-live="polite" aria-busy={busy}>
|
||||
{error ? (
|
||||
<div className="error">
|
||||
{error}{' '}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
data-action="material-change-refresh"
|
||||
onClick={() => reload(seq + 1)}
|
||||
>
|
||||
重新读取申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : list ? (
|
||||
<>
|
||||
<div className="material-change-tabs" role="group" aria-label="购料更正状态">
|
||||
{(['pending', 'approved', 'rejected', 'all'] as const).map((s, i) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={s}
|
||||
type="button"
|
||||
data-action="material-change-filter"
|
||||
@@ -104,65 +110,61 @@ export function ChangePanel({
|
||||
>
|
||||
{['待复核', '已批准', '已驳回', '全部'][i]}
|
||||
{s !== 'all' && '(' + list.counts[s] + ')'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
{list.rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="material-change-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>更正内容</th>
|
||||
<th>申请人/原因</th>
|
||||
<th>状态/处理意见</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{list.rows.map(r => (
|
||||
<tr key={r.id}>
|
||||
<td>
|
||||
{r.action === 'delete' ? '删除历史购料' : '修改历史购料'}
|
||||
{r.preview?.before && (
|
||||
<div className="small muted">
|
||||
{r.preview.before.date} · {grams(r.preview.before.mg)}g · {money(r.preview.before.amount)}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{r.requester_name}
|
||||
<div className="small muted">{time(r.created)}</div>
|
||||
<div className="material-change-text">{r.reason}</div>
|
||||
</td>
|
||||
<td>
|
||||
<span className={'badge ' + (r.status === 'pending' ? 'warn' : '')}>
|
||||
{statuses[r.status]}
|
||||
</span>
|
||||
{r.stale && r.status === 'pending' && (
|
||||
<div className="small danger-text">原记录已变化,需重新核对。</div>
|
||||
)}
|
||||
{r.note && <div className="small material-change-text">{r.note}</div>}
|
||||
{r.reviewer_name && (
|
||||
<div className="small muted">
|
||||
{r.reviewer_name} · {time(r.reviewed)}
|
||||
</div>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<button
|
||||
type="button"
|
||||
className="quiet"
|
||||
data-action="material-change-open"
|
||||
data-id={r.id}
|
||||
onClick={() => open(r.id)}
|
||||
>
|
||||
{state.user.role === 'owner' && r.status === 'pending' ? '查看影响并复核' : '查看申请'}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="material-change-table"
|
||||
columns={[
|
||||
{ title: '更正内容' },
|
||||
{ title: '申请人/原因' },
|
||||
{ title: '状态/处理意见' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={list.rows.map(r => ({
|
||||
key: r.id,
|
||||
cells: [
|
||||
<>
|
||||
{r.action === 'delete' ? '删除历史购料' : '修改历史购料'}
|
||||
{r.preview?.before && (
|
||||
<div className="small muted">
|
||||
{r.preview.before.date} · {grams(r.preview.before.mg)}g · {money(r.preview.before.amount)}
|
||||
</div>
|
||||
)}
|
||||
</>,
|
||||
<>
|
||||
{r.requester_name}
|
||||
<div className="small muted">{time(r.created)}</div>
|
||||
<div className="material-change-text">{r.reason}</div>
|
||||
</>,
|
||||
<>
|
||||
<span className={'badge ' + (r.status === 'pending' ? 'warn' : '')}>{statuses[r.status]}</span>
|
||||
{r.stale && r.status === 'pending' && (
|
||||
<div className="small danger-text">原记录已变化,需重新核对。</div>
|
||||
)}
|
||||
{r.note && <div className="small material-change-text">{r.note}</div>}
|
||||
{r.reviewer_name && (
|
||||
<div className="small muted">
|
||||
{r.reviewer_name} · {time(r.reviewed)}
|
||||
</div>
|
||||
)}
|
||||
</>,
|
||||
<>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
data-action="material-change-open"
|
||||
data-id={r.id}
|
||||
onClick={() => open(r.id)}
|
||||
>
|
||||
{state.user.role === 'owner' && r.status === 'pending' ? '查看影响并复核' : '查看申请'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="small muted material-rolling-empty">没有此状态的更正申请。</p>
|
||||
@@ -188,24 +190,16 @@ function Comparison({
|
||||
}) {
|
||||
return (
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table material-change-comparison" aria-label={label}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
<th>{head[0]}</th>
|
||||
<th>{head[1]}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map(([name, a, b]) => (
|
||||
<tr key={name} className={highlight && a !== b ? 'material-change-different' : undefined}>
|
||||
<th scope="row">{name}</th>
|
||||
<td>{a}</td>
|
||||
<td>{b}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="material-detail-table material-change-comparison"
|
||||
aria-label={label}
|
||||
columns={[{ title: '核对项目', rowScope: 'row' }, { title: head[0] }, { title: head[1] }]}
|
||||
rows={rows.map(([name, a, b]) => ({
|
||||
key: name,
|
||||
attributes: { className: highlight && a !== b ? 'material-change-different' : undefined },
|
||||
cells: [name, a, b],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -335,27 +329,27 @@ export function EnableForm({
|
||||
onSubmit={onSubmit}
|
||||
>
|
||||
<label className="check">
|
||||
<input name="verified" type="checkbox" required disabled={blocked || stale} />
|
||||
<LedgerInput name="verified" type="checkbox" required disabled={blocked || stale} />
|
||||
已核对结转克重、金料成本及今日订单影响,确认从 {p.date} 起启用。
|
||||
</label>
|
||||
<div id="material-rolling-error" aria-live="polite">
|
||||
{error}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="button" className="quiet" data-action="material-rolling-close" onClick={close}>
|
||||
<LedgerButton type="button" className="quiet" data-action="material-rolling-close" onClick={close}>
|
||||
取消
|
||||
</button>
|
||||
<button type="submit" className="primary" disabled={stale || blocked}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" className="primary" disabled={stale || blocked}>
|
||||
确认启用跨日结转
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
) : (
|
||||
<>
|
||||
<p className="error">{p.reason || '暂不能启用,请先核对材料记录。'}</p>
|
||||
<button type="button" data-action="material-rolling-enable-preview" className="quiet" onClick={reload}>
|
||||
<LedgerButton type="button" data-action="material-rolling-enable-preview" className="quiet" onClick={reload}>
|
||||
重新核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
@@ -390,9 +384,9 @@ export function ReviewForm({ r, state, actions }: { r: Change; state: LedgerStat
|
||||
['备注', p => p.note || '未填写'],
|
||||
];
|
||||
const closeButton = (
|
||||
<button type="button" data-action="material-rolling-close" className="quiet" onClick={close}>
|
||||
<LedgerButton type="button" data-action="material-rolling-close" className="quiet" onClick={close}>
|
||||
关闭
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
@@ -434,11 +428,11 @@ export function ReviewForm({ r, state, actions }: { r: Change; state: LedgerStat
|
||||
>
|
||||
<label>
|
||||
处理意见(批准时选填,驳回时必填)
|
||||
<textarea name="note" maxLength={200} rows={2} disabled={blocked || stale} />
|
||||
<LedgerTextArea name="note" maxLength={200} rows={2} disabled={blocked || stale} />
|
||||
</label>
|
||||
{approve && (
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required disabled={blocked || stale} />
|
||||
<LedgerInput type="checkbox" name="verified" required disabled={blocked || stale} />
|
||||
已核对原购料凭据、申请值与关联订单影响,确认批准本次更正。
|
||||
</label>
|
||||
)}
|
||||
@@ -447,7 +441,7 @@ export function ReviewForm({ r, state, actions }: { r: Change; state: LedgerStat
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
{closeButton}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="danger"
|
||||
data-action="material-change-reject"
|
||||
@@ -455,11 +449,11 @@ export function ReviewForm({ r, state, actions }: { r: Change; state: LedgerStat
|
||||
onClick={e => review(e.currentTarget.form!, 'reject')}
|
||||
>
|
||||
驳回申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{approve && (
|
||||
<button type="submit" className="primary" disabled={blocked || stale}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked || stale}>
|
||||
批准购料更正
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useRef, useEffect, type ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { LedgerButton, LedgerDialog } from '../../components/BusinessControls';
|
||||
export function Dialog({
|
||||
id,
|
||||
label,
|
||||
@@ -12,16 +13,9 @@ export function Dialog({
|
||||
children: ReactNode;
|
||||
ownClose?: boolean;
|
||||
}) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const node = ref.current!;
|
||||
node.showModal();
|
||||
return () => node.close();
|
||||
}, []);
|
||||
return (
|
||||
<dialog
|
||||
<LedgerDialog
|
||||
id={id}
|
||||
ref={ref}
|
||||
aria-label={label}
|
||||
onCancel={event => {
|
||||
event.preventDefault();
|
||||
@@ -29,11 +23,17 @@ export function Dialog({
|
||||
}}
|
||||
>
|
||||
{!ownClose && (
|
||||
<button type="button" className="dialog-close" data-action="close-dialog" aria-label={label} onClick={close}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action="close-dialog"
|
||||
aria-label={label}
|
||||
onClick={close}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
@@ -17,12 +17,13 @@ type TextKey<T> = { [K in keyof T]-?: T[K] extends string ? K : never }[keyof T]
|
||||
|
||||
import { Fees, Model } from '../../shared';
|
||||
import { uuid } from '../CreateOrder/useOrderForm';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
export function Input({ label, name, value, type = 'text', hidden, help, onChange, ...props }: InputProps) {
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<input
|
||||
<LedgerInput
|
||||
{...props}
|
||||
name={name}
|
||||
type={type}
|
||||
@@ -38,7 +39,7 @@ export function Choice({ label, name, value, options, hidden, help, onChange, ..
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<select
|
||||
<LedgerSelect
|
||||
{...props}
|
||||
name={name}
|
||||
value={value ?? ''}
|
||||
@@ -53,7 +54,7 @@ export function Choice({ label, name, value, options, hidden, help, onChange, ..
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
{help}
|
||||
</label>
|
||||
);
|
||||
@@ -111,7 +112,7 @@ export function EditLine({
|
||||
<div className="line-item" data-legacy={line.legacy}>
|
||||
<div className="panel-title">
|
||||
<h3>商品 {index + 1}</h3>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="remove-line"
|
||||
onClick={() => {
|
||||
@@ -123,7 +124,7 @@ export function EditLine({
|
||||
}}
|
||||
>
|
||||
移除
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div className="grid four">
|
||||
<Choice label="商品名称" {...prop('nameType')} options={[...Model.productNames, '其他']} />
|
||||
@@ -163,9 +164,13 @@ export function EditLine({
|
||||
<div className="sale-charges">
|
||||
<div className="panel-title">
|
||||
<strong>工费附加项目(选填)</strong>
|
||||
<button type="button" data-action="add-charge" onClick={() => update(f => Model.addCharge(f, index, uuid))}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="add-charge"
|
||||
onClick={() => update(f => Model.addCharge(f, index, uuid))}
|
||||
>
|
||||
+ 添加附加项目
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
{line.charges.map((c, i) => (
|
||||
<div key={c.id} className="charge-row grid four">
|
||||
@@ -191,13 +196,16 @@ export function EditLine({
|
||||
value={c.amount}
|
||||
onChange={value => updateCharge(i, charge => Model.setChargeAmount(charge, value))}
|
||||
/>
|
||||
<button type="button" onClick={() => change(l => ({ ...l, charges: l.charges.filter((_, j) => j !== i) }))}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
onClick={() => change(l => ({ ...l, charges: l.charges.filter((_, j) => j !== i) }))}
|
||||
>
|
||||
移除项目
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{c.costRemoved && (
|
||||
<button type="button" onClick={() => update(f => Model.restoreChargeCost(f, index, i))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.restoreChargeCost(f, index, i))}>
|
||||
恢复内部成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
@@ -235,7 +243,7 @@ export function EditLine({
|
||||
<>
|
||||
<Choice label="货品成本付款人" {...prop('payer')} options={members(line.payer)} />
|
||||
<Input label="原单货品成本(旧版未分项)" {...prop('cost')} type="number" readOnly />
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
onClick={() =>
|
||||
change(l => {
|
||||
@@ -252,7 +260,7 @@ export function EditLine({
|
||||
}
|
||||
>
|
||||
拆分这行成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
) : (
|
||||
<div className="cost-fields grid">
|
||||
@@ -277,9 +285,9 @@ export function EditLine({
|
||||
hidden={!pooled}
|
||||
onChange={poolId => change(l => ({ ...l, pool: { ...l.pool!, poolId, defaultDate: false } }))}
|
||||
/>
|
||||
<button type="button" onClick={reloadPools}>
|
||||
<LedgerButton type="button" onClick={reloadPools}>
|
||||
刷新料价
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{line.view.poolNote && <p>{line.view.poolNote}</p>}
|
||||
</div>
|
||||
)}
|
||||
@@ -352,7 +360,7 @@ export function EditLine({
|
||||
options={members(p!.laborPayer)}
|
||||
/>
|
||||
{laborFunding && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="labor"
|
||||
@@ -371,9 +379,9 @@ export function EditLine({
|
||||
) : (
|
||||
<>
|
||||
{(['accessories', 'other'] as const).map(key => (
|
||||
<input key={key} type="hidden" name={prefix + key} value={p![key]} />
|
||||
<LedgerInput key={key} type="hidden" name={prefix + key} value={p![key]} />
|
||||
))}
|
||||
<input type="hidden" name="payer" value={line.payer} />
|
||||
<LedgerInput type="hidden" name="payer" value={line.payer} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -393,9 +401,9 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
<section className="panel internal">
|
||||
<div className="panel-title">
|
||||
<h2>实际费用(内部)</h2>
|
||||
<button type="button" onClick={() => update(f => Model.addManualFee(f, state, uuid))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.addManualFee(f, state, uuid))}>
|
||||
+ 添加其他成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<Input
|
||||
label="新增费用默认支付日期"
|
||||
@@ -411,7 +419,7 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
{Model.presetCatalogView(form, state).map(item => (
|
||||
<Fragment key={item.kind}>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name={'cost_' + item.kind}
|
||||
disabled={hasLinkedCost(item.kind)}
|
||||
@@ -490,12 +498,12 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
onChange={v => edit('date', v)}
|
||||
/>
|
||||
{!row.automatic && (
|
||||
<button type="button" onClick={() => update(f => Model.removeFeeRow(f, i))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.removeFeeRow(f, i))}>
|
||||
移除费用
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{ref && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="fee"
|
||||
|
||||
@@ -6,6 +6,7 @@ import { orderViews } from './orderViews';
|
||||
import { Dialog } from './Dialog';
|
||||
import { useRead } from './orderReads';
|
||||
import type { IndependentRequest } from './orderData';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
interface SaleProps {
|
||||
client: LedgerClient;
|
||||
@@ -241,23 +242,23 @@ export function IndependentAfterSale({
|
||||
}
|
||||
}
|
||||
const reread = (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
disabled={client.busy}
|
||||
data-action={review ? 'after-sale-change-open' : 'after-sale-edit'}
|
||||
data-id={id}
|
||||
>
|
||||
{review ? '重新读取申请并复核' : '重新读取售后'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
const feedback = error && (
|
||||
<div className="error" role="alert">
|
||||
{error}{' '}
|
||||
{id &&
|
||||
(client.pending() ? (
|
||||
<button type="button" data-action="retry" disabled={client.busy}>
|
||||
<LedgerButton type="button" data-action="retry" disabled={client.busy}>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
reread
|
||||
))}
|
||||
@@ -269,18 +270,18 @@ export function IndependentAfterSale({
|
||||
if (receipt || (path && (review ? !request : !detail))) {
|
||||
content = (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="dialog-close"
|
||||
data-action={review ? 'after-sale-changes-close' : 'close-after-sale'}
|
||||
aria-label={review ? '关闭售后修改复核' : '关闭售后记录'}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2>{receipt || (review ? '售后修改复核' : '修改售后')}</h2>
|
||||
{read.error || error ? (
|
||||
<div className="error" role="alert">
|
||||
{read.error || error} {reread}
|
||||
{review && <button data-action="after-sale-changes-reload">返回申请列表</button>}
|
||||
{review && <LedgerButton data-action="after-sale-changes-reload">返回申请列表</LedgerButton>}
|
||||
</div>
|
||||
) : (
|
||||
<p role="status">{receipt ? '正在刷新…' : review ? '正在读取申请…' : '正在读取售后记录…'}</p>
|
||||
|
||||
@@ -36,6 +36,7 @@ type UpdateInput = (fields: Partial<EditInputs>) => void;
|
||||
import { Calc as LedgerCalc, Fees, Model, Values } from '../../shared';
|
||||
import { Button } from '../Settings/controls';
|
||||
import { Input, Choice } from './EditFields';
|
||||
import { LedgerButton, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
const { yuan, grams, validateOrderIdentity } = Model;
|
||||
const feeCategories: Record<string, string> = {
|
||||
jd: 'shipping',
|
||||
@@ -440,7 +441,7 @@ function EditableFees({
|
||||
return (
|
||||
<div key={kind} className="order-cost-box">
|
||||
<label className="order-cost-option">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name={'cost_' + kind}
|
||||
checked={checked}
|
||||
@@ -466,7 +467,7 @@ function EditableFees({
|
||||
{row.byQuantity && (
|
||||
<label className="order-cost-quantity">
|
||||
{configured ? '数量(个)' : '盒子数量(个)'}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={'cost_' + kind + '_quantity'}
|
||||
min="1"
|
||||
@@ -548,7 +549,7 @@ function EditableFees({
|
||||
</Button>
|
||||
)}
|
||||
{!automatic && row.funding && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="fee"
|
||||
@@ -736,7 +737,7 @@ function LockLine({
|
||||
/>
|
||||
</div>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="lock_material_verified"
|
||||
checked={!!mat.verified}
|
||||
@@ -781,7 +782,7 @@ function LockLine({
|
||||
/>
|
||||
</div>
|
||||
<label className="check" hidden={pooledExtra}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="lock_extra_verified"
|
||||
checked={!!extra.verified}
|
||||
@@ -1021,7 +1022,7 @@ export function LockOrderEditor({
|
||||
['returning', '老客户'],
|
||||
].map(([key, text]) => (
|
||||
<label key={key} title={key === 'new' ? '首次成交' : '再次成交'}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={key}
|
||||
@@ -1056,7 +1057,7 @@ export function LockOrderEditor({
|
||||
</p>
|
||||
<label>
|
||||
客户单备注
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={240}
|
||||
rows={2}
|
||||
@@ -1066,7 +1067,7 @@ export function LockOrderEditor({
|
||||
</label>
|
||||
<label>
|
||||
内部备注(客户不可见)<span className="small muted">必填,至少3个字符(含#号),最多500字</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="internal_note"
|
||||
ref={textarea}
|
||||
maxLength={500}
|
||||
@@ -1085,7 +1086,7 @@ export function LockOrderEditor({
|
||||
<div data-order-note-tags className="order-note-tag-options" aria-label="内部备注快捷标签">
|
||||
{filteredTags.length ? (
|
||||
filteredTags.map(tag => (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
key={tag}
|
||||
@@ -1100,7 +1101,7 @@ export function LockOrderEditor({
|
||||
}}
|
||||
>
|
||||
{tag}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))
|
||||
) : (
|
||||
<span className="small muted">
|
||||
@@ -1160,7 +1161,7 @@ export function LockOrderEditor({
|
||||
</div>
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="edit_reason"
|
||||
required
|
||||
maxLength={200}
|
||||
@@ -1171,7 +1172,7 @@ export function LockOrderEditor({
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="edit_verified"
|
||||
required
|
||||
@@ -1185,14 +1186,14 @@ export function LockOrderEditor({
|
||||
<Button action="cancel-order-edit" className="quiet" onClick={onCancel}>
|
||||
取消修改
|
||||
</Button>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
type="submit"
|
||||
data-order-edit-submit
|
||||
disabled={client.busy || !!client.pending() || entry.conflicted}
|
||||
>
|
||||
{approval ? '提交修改申请' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id="order-error" aria-live="polite">
|
||||
{serverFeedback}
|
||||
|
||||
@@ -38,6 +38,7 @@ import { navigate } from '../../lib/router';
|
||||
import { orderViews } from './orderViews';
|
||||
import { Dialog } from './Dialog';
|
||||
import { queues, useRead } from './orderReads';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
const stop = (e: SyntheticEvent) => {
|
||||
e.stopPropagation();
|
||||
@@ -59,19 +60,19 @@ function DetailNavigation({
|
||||
const i = ids.indexOf(id);
|
||||
return (
|
||||
<div className="order-detail-navigation-row" role="group" aria-label="切换订单">
|
||||
<button data-action="order-detail-prev" disabled={blocked || i <= 0} onClick={() => open(ids[i - 1])}>
|
||||
<LedgerButton data-action="order-detail-prev" disabled={blocked || i <= 0} onClick={() => open(ids[i - 1])}>
|
||||
← 上一条
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span aria-live="polite">
|
||||
{i + 1} / {ids.length}
|
||||
</span>
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="order-detail-next"
|
||||
disabled={blocked || i < 0 || i >= ids.length - 1}
|
||||
onClick={() => open(ids[i + 1])}
|
||||
>
|
||||
下一条 →
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<small>按当前筛选后的销售订单顺序查看</small>
|
||||
</div>
|
||||
);
|
||||
@@ -526,12 +527,12 @@ export function OrderActionDialog({
|
||||
panel = (
|
||||
<>
|
||||
<fieldset disabled>{panel}</fieldset>
|
||||
<button type="button" onClick={refreshDetail}>
|
||||
<LedgerButton type="button" onClick={refreshDetail}>
|
||||
重新读取订单
|
||||
</button>
|
||||
<button type="button" onClick={clearForm} disabled={client.busy}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="button" onClick={clearForm} disabled={client.busy}>
|
||||
收起
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
@@ -539,7 +540,7 @@ export function OrderActionDialog({
|
||||
<div id="order-content" onClick={onClick} onChange={onChange} onSubmit={submit}>
|
||||
{details.error ? (
|
||||
<p role="alert">
|
||||
{details.error} <button onClick={refreshDetail}>重新读取</button>
|
||||
{details.error} <LedgerButton onClick={refreshDetail}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : !order ? (
|
||||
'正在读取订单…'
|
||||
|
||||
@@ -20,6 +20,7 @@ import { useOrderForm } from '../CreateOrder/useOrderForm';
|
||||
import { EditLine, EditFees, Input, Choice } from './EditFields';
|
||||
import { isRecord, errorMessage, errorStatus } from './readOrder';
|
||||
import { useRead } from './orderReads';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
interface SavedEdit {
|
||||
id: string;
|
||||
@@ -160,25 +161,18 @@ function ConflictPanel({
|
||||
{order.date} · {order.customer || '未填客户称呼'} · 开单人 {order.salesperson} · {order.payment_account} ·
|
||||
成交 {Model.orderAmount(order.total, order.rounding_mode)}
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['商品', '克重/数量', '成交金额', '货品成本'].map(label => (
|
||||
<th key={label}>{label}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{order.lines.map((line, i) => (
|
||||
<tr key={i}>
|
||||
<td>{line.name}</td>
|
||||
<td>{line.unit === 'g' ? Model.grams(line.quantity) + 'g' : line.quantity + '件'}</td>
|
||||
<td>¥{Model.yuan(line.sale)}</td>
|
||||
<td>{line.cost == null ? '待补' : '¥' + Model.yuan(line.cost)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[{ title: '商品' }, { title: '克重/数量' }, { title: '成交金额' }, { title: '货品成本' }]}
|
||||
rows={order.lines.map((line, i) => ({
|
||||
key: i,
|
||||
cells: [
|
||||
line.name,
|
||||
line.unit === 'g' ? Model.grams(line.quantity) + 'g' : line.quantity + '件',
|
||||
<>¥{Model.yuan(line.sale)}</>,
|
||||
line.cost == null ? '待补' : '¥' + Model.yuan(line.cost),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
<p>
|
||||
实际费用 ¥{Model.yuan(order.directCost)};客户单备注:{order.note || '无'}
|
||||
</p>
|
||||
@@ -189,17 +183,17 @@ function ConflictPanel({
|
||||
)}
|
||||
<div className="actions">
|
||||
{order ? (
|
||||
<button disabled={disabled} data-action="keep-order-edit" onClick={() => read('keep')}>
|
||||
<LedgerButton disabled={disabled} data-action="keep-order-edit" onClick={() => read('keep')}>
|
||||
已核对,保留草稿继续修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
<button disabled={disabled} data-action="reload-order-edit" onClick={() => read('review')}>
|
||||
<LedgerButton disabled={disabled} data-action="reload-order-edit" onClick={() => read('review')}>
|
||||
读取最新订单供核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button disabled={disabled} data-action="reset-order-edit" onClick={() => read('reset')}>
|
||||
<LedgerButton disabled={disabled} data-action="reset-order-edit" onClick={() => read('reset')}>
|
||||
改用当前订单内容
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -356,8 +350,8 @@ export function OrderEditPage({ client, state, session, refreshState, registerLe
|
||||
<div className="business-pages">
|
||||
<h1>订单修改已保存</h1>
|
||||
<p>已更新原订单,原单号保留。</p>
|
||||
<button onClick={go}>查看修改后的订单</button>
|
||||
<button onClick={() => navigate('orders')}>重新读取订单</button>
|
||||
<LedgerButton onClick={go}>查看修改后的订单</LedgerButton>
|
||||
<LedgerButton onClick={() => navigate('orders')}>重新读取订单</LedgerButton>
|
||||
{error && <p role="alert">{error}</p>}
|
||||
</div>
|
||||
);
|
||||
@@ -366,24 +360,24 @@ export function OrderEditPage({ client, state, session, refreshState, registerLe
|
||||
<div className="business-pages">
|
||||
<h1>修改订单</h1>
|
||||
<p>{id ? error || '正在读取已记录的订单…' : '请选择要修改的订单。'}</p>
|
||||
<button disabled={reading} onClick={() => read()}>
|
||||
<LedgerButton disabled={reading} onClick={() => read()}>
|
||||
重新读取订单
|
||||
</button>
|
||||
<button onClick={() => navigate('orders')}>返回订单列表</button>
|
||||
</LedgerButton>
|
||||
<LedgerButton onClick={() => navigate('orders')}>返回订单列表</LedgerButton>
|
||||
</div>
|
||||
);
|
||||
const serverFeedback = error && (
|
||||
<div role="alert" className="error">
|
||||
{error}
|
||||
{entry.conflicted && !entry.latest && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="reload-order-edit"
|
||||
disabled={reading || client.busy || !!client.pending()}
|
||||
onClick={() => read('review')}
|
||||
>
|
||||
读取最新订单供核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@@ -522,7 +516,7 @@ function EditForm({
|
||||
['returning', '老客户'],
|
||||
].map(([k, l]) => (
|
||||
<label key={k}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={k}
|
||||
@@ -547,7 +541,7 @@ function EditForm({
|
||||
<>
|
||||
<label>
|
||||
内部备注(客户不可见)<span className="small muted">必填,至少3个字符(含#号),最多500字</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="internal_note"
|
||||
rows={3}
|
||||
required
|
||||
@@ -559,20 +553,20 @@ function EditForm({
|
||||
/>
|
||||
</label>
|
||||
{(Model.filterNoteTags(tags.value?.tags || [], form.internal_note) || []).map(tag => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={tag}
|
||||
type="button"
|
||||
onClick={() => set('internal_note')(Model.insertNoteTag(form.internal_note, tag))}
|
||||
>
|
||||
{tag}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
const note = (
|
||||
<label>
|
||||
客户单备注
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={240}
|
||||
rows={finance ? 2 : 3}
|
||||
@@ -591,9 +585,9 @@ function EditForm({
|
||||
{entry.order.paper_number || entry.order.number} · {entry.order.date}
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" onClick={go}>
|
||||
<LedgerButton type="button" onClick={go}>
|
||||
取消修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div className="note" id="order-edit-save-intro">
|
||||
{(approval ? '店主复核同意后' : '保存后') +
|
||||
@@ -608,9 +602,9 @@ function EditForm({
|
||||
>
|
||||
{finance ? (
|
||||
<>
|
||||
<input type="hidden" name="rounding_mode" value={form.rounding_mode} />
|
||||
<input type="hidden" name="orderId" value={entry.id} />
|
||||
<input type="hidden" name="revision" value={entry.revision} />
|
||||
<LedgerInput type="hidden" name="rounding_mode" value={form.rounding_mode} />
|
||||
<LedgerInput type="hidden" name="orderId" value={entry.id} />
|
||||
<LedgerInput type="hidden" name="revision" value={entry.revision} />
|
||||
<section className="panel">
|
||||
<div className="panel-title">
|
||||
<h2>客户与单据</h2>
|
||||
@@ -665,9 +659,9 @@ function EditForm({
|
||||
{...{ index, line, state, ctx, form, update: change, reloadPools: loadPools, error: setError }}
|
||||
/>
|
||||
))}
|
||||
<button type="button" onClick={() => change(f => Model.addLine(f, ctx))}>
|
||||
<LedgerButton type="button" onClick={() => change(f => Model.addLine(f, ctx))}>
|
||||
+ 添加商品
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{poolError && <p role="alert">{poolError}</p>}
|
||||
</section>
|
||||
<EditFees {...{ store, state, update: change }} />
|
||||
@@ -708,7 +702,7 @@ function EditForm({
|
||||
</p>
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="edit_reason"
|
||||
required
|
||||
rows={2}
|
||||
@@ -719,7 +713,7 @@ function EditForm({
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="edit_verified"
|
||||
required
|
||||
@@ -731,12 +725,12 @@ function EditForm({
|
||||
: '已核实客户称呼、开单人及备注的本次更正。'}
|
||||
</label>
|
||||
<div className="form-actions">
|
||||
<button type="button" onClick={go}>
|
||||
<LedgerButton type="button" onClick={go}>
|
||||
取消修改
|
||||
</button>
|
||||
<button data-order-edit-submit disabled={blocked} className="primary" type="submit">
|
||||
</LedgerButton>
|
||||
<LedgerButton data-order-edit-submit disabled={blocked} className="primary" type="submit">
|
||||
{approval ? '提交修改申请' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</section>
|
||||
<div id="order-error" aria-live="polite">
|
||||
|
||||
@@ -27,6 +27,7 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { navigate, searchParam } from '../../lib/router';
|
||||
import { orderViews } from './orderViews';
|
||||
import { OrderActionDialog, IndependentAfterSale } from './OrderDialogs';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
function initialFilters(state: LedgerState): Filters {
|
||||
const defaults: Filters = { mode: 'today', date: '', from: '', to: '', q: '', status: '', member: '', pocket: '' };
|
||||
@@ -304,26 +305,26 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
</summary>
|
||||
<div className="order-review-options">
|
||||
{queues.map(([kind, , name, action, id], i) => (
|
||||
<button key={kind} type="button" id={id} data-action={action}>
|
||||
<LedgerButton key={kind} type="button" id={id} data-action={action}>
|
||||
{name}
|
||||
{kind === 'after-sale' ? (state.user.role === 'owner' ? '复核' : '申请') : ''}(
|
||||
{counts.value?.[i] ?? '…'})
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
</details>
|
||||
<button type="button" data-action="new-after-sale">
|
||||
<LedgerButton type="button" data-action="new-after-sale">
|
||||
新增售后费用
|
||||
</button>
|
||||
<button type="button" data-action="refresh">
|
||||
</LedgerButton>
|
||||
<LedgerButton type="button" data-action="refresh">
|
||||
刷新
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="order-book-dates">
|
||||
<div className="order-period-buttons" role="group" aria-label="订单日期">
|
||||
{views.orderBookPeriodOptions.map(([value, name]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
key={value}
|
||||
data-action="order-period"
|
||||
@@ -331,12 +332,12 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
aria-pressed={value === filters.mode}
|
||||
>
|
||||
{name}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
<label id="order-single-date" hidden={filters.mode !== 'date'}>
|
||||
指定日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id="order-date"
|
||||
value={filters.mode === 'date' ? filters.date : range?.date || state.today}
|
||||
@@ -350,7 +351,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
{(['from', 'to'] as const).map((key, i) => (
|
||||
<label key={key}>
|
||||
{i ? '结束' : '开始'}日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id={'order-' + key}
|
||||
value={filters[key]}
|
||||
@@ -372,7 +373,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
</details>
|
||||
<section className="panel order-book-panel">
|
||||
<div className="filters order-book-filters">
|
||||
<input
|
||||
<LedgerInput
|
||||
id="order-search"
|
||||
aria-label="搜索订单(单号、客户、商品或克重)"
|
||||
value={filters.q}
|
||||
@@ -380,35 +381,35 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
maxLength={100}
|
||||
onChange={e => filter({ q: e.target.value })}
|
||||
/>
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-filter"
|
||||
aria-label="筛选状态"
|
||||
value={filters.status}
|
||||
onChange={e => filter({ status: e.target.value })}
|
||||
>
|
||||
{options(views.orderBookStatusOptions)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
<label>
|
||||
出货货盘
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-pocket-filter"
|
||||
aria-label="出货货盘"
|
||||
value={filters.pocket}
|
||||
onChange={e => filter({ pocket: e.target.value })}
|
||||
>
|
||||
{options(views.orderBookPocketOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
{state.user.role === 'owner' && memberOptions.length > 0 && (
|
||||
<label>
|
||||
订单归属
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-member-filter"
|
||||
value={filters.member}
|
||||
onChange={e => filter({ member: e.target.value })}
|
||||
>
|
||||
{options([['', '全部成员'], ...memberOptions])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
)}
|
||||
<span id="order-book-count">{content?.count}</span>
|
||||
@@ -418,7 +419,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
<div id="order-list" aria-live="polite">
|
||||
{bookError ? (
|
||||
<p role="alert">
|
||||
{bookError} <button onClick={refresh}>重新读取</button>
|
||||
{bookError} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : (
|
||||
(content?.list ?? '正在读取订单…')
|
||||
@@ -435,7 +436,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
<p className="small muted">{queueInfo[3]}</p>
|
||||
{list.error ? (
|
||||
<p>
|
||||
{list.error} <button onClick={refresh}>重新读取</button>
|
||||
{list.error} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : (
|
||||
review || '正在读取…'
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState } from 'react';
|
||||
import { Calc as LedgerCalc } from '../../../shared';
|
||||
import type { OrderLine } from '../orderData';
|
||||
import type { SharedViews } from '../viewTypes';
|
||||
import { LedgerInput, LedgerSelect } from '../../../components/BusinessControls';
|
||||
type CostModeKey = 'material' | 'labor';
|
||||
type CostInputs = Record<string, string>;
|
||||
type LineProps = { line: OrderLine; index: number; members: SharedViews['teamMemberOptions']; fallback: string } & Pick<
|
||||
@@ -64,7 +65,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
const amount = (key: string, title: string, value: string, gram = false) => (
|
||||
<label>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={prefix + key}
|
||||
min="0"
|
||||
@@ -116,7 +117,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
<div className="grid purchase-cost-grid">
|
||||
<label>
|
||||
{material ? '进货料费方式' : '进货工费方式'}
|
||||
<select
|
||||
<LedgerSelect
|
||||
name={prefix + key + 'Mode'}
|
||||
value={modes[key]}
|
||||
onChange={event => updateMode(key, event.target.value, value)}
|
||||
@@ -125,11 +126,11 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
{material ? '按克料价' : '克工费'}
|
||||
</option>
|
||||
<option value="total">{material ? '直接填总料费' : '总工费'}</option>
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label hidden={!gram}>
|
||||
{material ? '进货料价(元/克)' : '进货克工费(元/克)'}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={prefix + key + 'Rate'}
|
||||
min="0"
|
||||
@@ -144,7 +145,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
{amount(key, material ? '料费成本合计(元)' : '进货总工费(元)', value, gram)}
|
||||
<label className="purchase-payer">
|
||||
{material ? '料费付款人' : '进货工费付款人'}
|
||||
<select
|
||||
<LedgerSelect
|
||||
required
|
||||
name={prefix + key + 'Payer'}
|
||||
defaultValue={options.some(([id]) => id === payer) ? payer : ''}
|
||||
@@ -155,7 +156,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
</option>
|
||||
)}
|
||||
{opts(options)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="purchase-formula small muted" aria-live="polite">
|
||||
|
||||
@@ -10,6 +10,14 @@ import type {
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import { Calc as LedgerCalc, Values } from '../../../shared';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTable,
|
||||
LedgerTextArea,
|
||||
} from '../../../components/BusinessControls';
|
||||
function object(value: unknown): value is Record<string, unknown> {
|
||||
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
||||
}
|
||||
@@ -84,11 +92,17 @@ export function afterSales(
|
||||
<h3>{kind === 'approve' ? '同意售后修改' : '驳回售后修改'}</h3>
|
||||
<label>
|
||||
{kind === 'approve' ? '复核备注(选填)' : '驳回意见'}
|
||||
<textarea disabled={ui.blocked} name="note" rows={2} maxLength={200} required={kind === 'reject'}></textarea>
|
||||
<LedgerTextArea
|
||||
disabled={ui.blocked}
|
||||
name="note"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
required={kind === 'reject'}
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
{kind === 'approve' ? (
|
||||
<label className="check">
|
||||
<input disabled={ui.blocked} type="checkbox" name="verified" required />
|
||||
<LedgerInput disabled={ui.blocked} type="checkbox" name="verified" required />
|
||||
已核对原值、申请值、日期、金额和付款人。
|
||||
</label>
|
||||
) : (
|
||||
@@ -96,9 +110,9 @@ export function afterSales(
|
||||
)}
|
||||
<div className="form-actions">
|
||||
{button('取消', 'after-sale-review-cancel', 'quiet', { disabled: ui.busy })}
|
||||
<button type="submit" disabled={ui.blocked} className={kind === 'approve' ? 'primary' : ''}>
|
||||
<LedgerButton type="submit" disabled={ui.blocked} className={kind === 'approve' ? 'primary' : ''}>
|
||||
{kind === 'approve' ? '确认同意修改' : '确认驳回申请'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
@@ -107,9 +121,9 @@ export function afterSales(
|
||||
const canReview = state.user.role === 'owner' && request.status === 'pending';
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="after-sale-changes-close" aria-label="关闭售后修改复核">
|
||||
<LedgerButton className="dialog-close" data-action="after-sale-changes-close" aria-label="关闭售后修改复核">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-changes-title">售后修改{request.status === 'pending' ? '复核' : '记录'}</h2>
|
||||
<div className="actions">{button('返回申请列表', 'after-sale-changes-reload', 'quiet')}</div>
|
||||
<p>
|
||||
@@ -247,7 +261,7 @@ export function afterSales(
|
||||
};
|
||||
return (
|
||||
<div className="table-wrap after-sale-comparison">
|
||||
<table className="order-change-table" aria-label="售后修改原值与申请值对照">
|
||||
<LedgerTable className="order-change-table" aria-label="售后修改原值与申请值对照">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
@@ -262,7 +276,7 @@ export function afterSales(
|
||||
{pair('金额', 'amount', value => '¥' + yuan(Number(value)))}
|
||||
{pair('谁支付', 'payer', teamMemberName)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -288,9 +302,9 @@ export function afterSales(
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="close-after-sale" aria-label="关闭售后记录">
|
||||
<LedgerButton className="dialog-close" data-action="close-after-sale" aria-label="关闭售后记录">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-title">修改售后</h2>
|
||||
{detail.permissions.canEdit ? (
|
||||
<form id="after-sale-edit-form" data-id={record.id} data-approval={String(ui.approval)}>
|
||||
@@ -321,7 +335,12 @@ export function afterSales(
|
||||
</div>
|
||||
<label>
|
||||
修改说明(选填)
|
||||
<textarea name="reason" rows={2} maxLength={200} placeholder="例如:售后金额或付款人录错。"></textarea>
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
placeholder="例如:售后金额或付款人录错。"
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</fieldset>
|
||||
<div id="after-sale-edit-error" aria-live="polite">
|
||||
@@ -331,9 +350,9 @@ export function afterSales(
|
||||
<span className="small muted">金额可填 0。归属沿用原记录。</span>
|
||||
<div className="actions">
|
||||
{button('取消', 'close-after-sale', 'quiet', { disabled: ui.busy })}
|
||||
<button type="submit" disabled={ui.blocked} className="primary">
|
||||
<LedgerButton type="submit" disabled={ui.blocked} className="primary">
|
||||
{ui.approval ? '提交修改申请' : '直接保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -364,17 +383,17 @@ export function afterSales(
|
||||
) : (
|
||||
<label>
|
||||
订单归属(经营款与业绩)
|
||||
<input defaultValue={teamMemberName(selected)} readOnly />
|
||||
<input type="hidden" name="member" defaultValue={selected} />
|
||||
<LedgerInput defaultValue={teamMemberName(selected)} readOnly />
|
||||
<LedgerInput type="hidden" name="member" defaultValue={selected} />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
function newIndependentSale() {
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="close-after-sale" aria-label="关闭新增售后">
|
||||
<LedgerButton className="dialog-close" data-action="close-after-sale" aria-label="关闭新增售后">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-title">新增售后</h2>
|
||||
<p className="small muted">售后费用计入所选日期,并扣减当天利润。</p>
|
||||
<form id="after-sale-form">
|
||||
@@ -397,12 +416,12 @@ export function afterSales(
|
||||
{orderMemberField()}
|
||||
<label>
|
||||
谁支付
|
||||
<select name="payer" required defaultValue="">
|
||||
<LedgerSelect name="payer" required defaultValue="">
|
||||
<option value="" disabled>
|
||||
请选择
|
||||
</option>
|
||||
{opts(teamMemberOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<div id="after-sale-error" aria-live="polite">
|
||||
@@ -412,9 +431,9 @@ export function afterSales(
|
||||
<span className="small muted">金额可填 0,请按实际支出填写。</span>
|
||||
<div className="actions">
|
||||
{button('取消', 'close-after-sale', 'quiet')}
|
||||
<button className="primary" type="submit">
|
||||
<LedgerButton className="primary" type="submit">
|
||||
保存售后
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -648,13 +667,13 @@ export function afterSales(
|
||||
})}
|
||||
<label>
|
||||
售后原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
required
|
||||
placeholder="填写客户实际退货退款原因。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</div>
|
||||
<section className="order-after-sale-products">
|
||||
@@ -678,13 +697,13 @@ export function afterSales(
|
||||
</div>
|
||||
<label>
|
||||
扣留款原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="deduction_reason"
|
||||
required={ui.reasonRequired}
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
placeholder="有扣留款时填写,如约定扣除不可退工费或实际损耗。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<p className="small muted">扣留款与支付渠道手续费分开核对。原单已经发生的支付手续费、邮费等成本继续保留。</p>
|
||||
</section>
|
||||
@@ -697,9 +716,14 @@ export function afterSales(
|
||||
<div id="order-after-sale-expenses">{ui.expenses}</div>
|
||||
</section>
|
||||
<div className="form-actions">
|
||||
<button type="button" className="primary" data-action="order-after-sale-preview" disabled={ui.previewLoading}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="primary"
|
||||
data-action="order-after-sale-preview"
|
||||
disabled={ui.previewLoading}
|
||||
>
|
||||
核对售后预览
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span className="small muted" id="order-after-sale-preview-status" aria-live="polite">
|
||||
{ui.previewStatus || '填好后先预览,核对回库、回料、退款和利润。'}
|
||||
</span>
|
||||
@@ -711,23 +735,23 @@ export function afterSales(
|
||||
})}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required disabled={!ui.preview} />
|
||||
<LedgerInput type="checkbox" name="verified" required disabled={!ui.preview} />
|
||||
已按实际退回商品、退款凭据和新增成本,核对以下预览。
|
||||
</label>
|
||||
<div id="order-after-sale-error" aria-live="polite">
|
||||
{ui.afterError && (
|
||||
<div className="error">
|
||||
{ui.afterError}{' '}
|
||||
<button type="button" data-action="reload-order-change">
|
||||
<LedgerButton type="button" data-action="reload-order-change">
|
||||
重新读取订单
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary" data-order-after-sale-submit="" disabled={!ui.preview}>
|
||||
<LedgerButton type="submit" className="primary" data-order-after-sale-submit="" disabled={!ui.preview}>
|
||||
{orderAfterSaleApproval(ui.date) ? '提交售后申请' : '确认并保存售后'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'order-after-sale-close', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -826,49 +850,43 @@ export function afterSales(
|
||||
</div>
|
||||
{rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>售后记录</th>
|
||||
<th>修改后日期</th>
|
||||
<th>申请人</th>
|
||||
<th>申请时间</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.before.customer}</strong>
|
||||
<div className="small muted">
|
||||
{request.before.date} · {request.before.project}
|
||||
</div>
|
||||
</td>
|
||||
<td>{request.after.date}</td>
|
||||
<td>{request.requesterName || '未提供'}</td>
|
||||
<td>{afterSaleTime(request.created)}</td>
|
||||
<td>
|
||||
{afterSaleStatus(request)}
|
||||
{request.stale ? <div className="small danger-text">原记录已有变动</div> : ''}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
state.user.role === 'owner' && request.status === 'pending' ? '查看并复核' : '查看修改',
|
||||
'after-sale-change-open',
|
||||
'',
|
||||
{
|
||||
'data-id': request.id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
columns={[
|
||||
{ title: '售后记录' },
|
||||
{ title: '修改后日期' },
|
||||
{ title: '申请人' },
|
||||
{ title: '申请时间' },
|
||||
{ title: '状态' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={rows.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.before.customer}</strong>
|
||||
<div className="small muted">
|
||||
{request.before.date} · {request.before.project}
|
||||
</div>
|
||||
</>,
|
||||
request.after.date,
|
||||
request.requesterName || '未提供',
|
||||
afterSaleTime(request.created),
|
||||
<>
|
||||
{afterSaleStatus(request)}
|
||||
{request.stale ? <div className="small danger-text">原记录已有变动</div> : ''}
|
||||
</>,
|
||||
button(
|
||||
state.user.role === 'owner' && request.status === 'pending' ? '查看并复核' : '查看修改',
|
||||
'after-sale-change-open',
|
||||
'',
|
||||
{
|
||||
'data-id': request.id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">没有符合状态的售后修改申请。</p>
|
||||
|
||||
@@ -13,6 +13,7 @@ interface ActionInput extends Record<string, unknown> {
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import { Cards as CreditCardFees, Calc as LedgerCalc } from '../../../shared';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect, LedgerTextArea } from '../../../components/BusinessControls';
|
||||
export function orderActions(
|
||||
{ currentOrder, ui = {}, state }: OrderContext,
|
||||
{
|
||||
@@ -143,18 +144,18 @@ export function orderActions(
|
||||
) : (
|
||||
<label>
|
||||
<span id="order-action-reason-label">{approval ? '申请原因' : '登记原因'}</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="change_reason"
|
||||
maxLength={200}
|
||||
rows={2}
|
||||
required
|
||||
placeholder="写清本次需要登记或更正的原因。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
)}
|
||||
{['cost', 'expense'].includes(kind) ? (
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实本次金额、实际付款人与凭据一致。
|
||||
</label>
|
||||
) : (
|
||||
@@ -217,7 +218,7 @@ export function orderActions(
|
||||
<div className="credit-card-fields">
|
||||
<label>
|
||||
手续费(元,自动)
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
@@ -229,9 +230,9 @@ export function orderActions(
|
||||
</label>
|
||||
<label>
|
||||
手续费付款人
|
||||
<select name="credit_card_fee_payer" defaultValue={payer} required={!!visible} disabled={!visible}>
|
||||
<LedgerSelect name="credit_card_fee_payer" defaultValue={payer} required={!!visible} disabled={!visible}>
|
||||
{opts(teamMemberOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="small muted" data-credit-card-formula="" aria-live="polite">
|
||||
@@ -284,7 +285,7 @@ export function orderActions(
|
||||
{choice('收款方式', 'payment_method', methods, identity?.channel || '微信')}
|
||||
<label>
|
||||
收款人
|
||||
<select
|
||||
<LedgerSelect
|
||||
name="payment_recipient"
|
||||
key={card ? 'card' : 'standard'}
|
||||
defaultValue={card ? '麦麦' : ui.recipient || prefix}
|
||||
@@ -293,7 +294,7 @@ export function orderActions(
|
||||
disabled={card}
|
||||
>
|
||||
{opts(recipients)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
{creditCardAvailable() ? (
|
||||
<small className="small muted payment-account-note" hidden={!card}>
|
||||
信用卡统一由{teamMemberName('owner')}收款。
|
||||
@@ -346,7 +347,7 @@ export function orderActions(
|
||||
)}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实实际支付,没有发生的费用已填0。
|
||||
</label>
|
||||
</>
|
||||
@@ -378,7 +379,7 @@ export function orderActions(
|
||||
placeholder: '交易凭据末几位或说明',
|
||||
})}
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已在实际账户核实{action === 'receipt' ? '到账' : '退款成功'},不是仅收到客户截图。
|
||||
</label>
|
||||
</>
|
||||
@@ -445,7 +446,7 @@ export function orderActions(
|
||||
补齐这张旧单的销售记账:按填写金额记录实际费用、从原货盘扣减黄金并计入销售与利润。款项未收齐或成本金额有空白时,请先补齐。
|
||||
</p>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实全额收款、商品已交付,所填费用为实际已付金额,没有发生的已填0。
|
||||
</label>
|
||||
</>
|
||||
@@ -494,7 +495,7 @@ export function orderActions(
|
||||
本入口办理整单退货,原销售额与货品成本在退货日冲回。已花费的运费等仍保留。换货先退原单,再开新单;部分退货暂未开放。
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实本单全部商品退回,所选去向与实际一致。
|
||||
</label>
|
||||
</>
|
||||
@@ -539,7 +540,7 @@ export function orderActions(
|
||||
: `货款待结 ¥${yuan(o.costDue)};利润待结 ¥${yuan(o.profitDue)}(负数为${teamMemberName('owner')}需转回)。`}
|
||||
</p>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实各人实际转账,不是仅记录计划交款。
|
||||
</label>
|
||||
</>
|
||||
@@ -590,9 +591,9 @@ export function orderActions(
|
||||
{moneyField('更正后金额(元)', 'amount')}
|
||||
<label>
|
||||
更正后收退款账户(仅收退款)
|
||||
<select name="account" defaultValue="助理微信">
|
||||
<LedgerSelect name="account" defaultValue="助理微信">
|
||||
{opts(activePaymentAccounts())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
<small className="small muted correction-card-note" hidden={!isCreditCardAccount(ui.values?.account)}>
|
||||
信用卡统一由{teamMemberName('owner')}收款。
|
||||
</small>
|
||||
@@ -622,7 +623,7 @@ export function orderActions(
|
||||
maxLength: 200,
|
||||
})}
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实原凭据,这次是修正登记错误。
|
||||
</label>
|
||||
</>
|
||||
@@ -662,9 +663,9 @@ export function orderActions(
|
||||
<div className="error">
|
||||
{ui.actionError}
|
||||
{ui.retryKey && (
|
||||
<button type="submit" formNoValidate data-retry-key={ui.retryKey} disabled={!!ui.retryBusy}>
|
||||
<LedgerButton type="submit" formNoValidate data-retry-key={ui.retryKey} disabled={!!ui.retryBusy}>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{ui.stale && <> {button('重新读取订单后申请', 'reload-order-change')}</>}
|
||||
</div>
|
||||
@@ -675,7 +676,7 @@ export function orderActions(
|
||||
html
|
||||
)}
|
||||
<div className="form-actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
disabled={!!ui.stale || !!ui.actionBlocked}
|
||||
{...(changeForm
|
||||
@@ -685,7 +686,7 @@ export function orderActions(
|
||||
: {})}
|
||||
>
|
||||
{requiresApproval ? '提交变更申请' : changeForm ? '核实并保存' : '确认保存'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'hide-action', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { BookData, BookRow, BookSummary, LockActivity, MoneyKey } from '../
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children, Fragment } from 'react';
|
||||
import { Values } from '../../../shared';
|
||||
import { LedgerButton, LedgerDataTable, LedgerTable } from '../../../components/BusinessControls';
|
||||
export function orderBook(
|
||||
{ orderBookFilters, state }: OrderContext,
|
||||
{
|
||||
@@ -84,37 +85,34 @@ export function orderBook(
|
||||
<details>
|
||||
<summary>查看 {rows.length} 项收付记录</summary>
|
||||
<div className="table-wrap">
|
||||
<table className="lock-activity-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/锁价单</th>
|
||||
<th>项目/客户</th>
|
||||
<th>账户/付款人</th>
|
||||
<th className="number">金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(item => (
|
||||
<tr>
|
||||
<td>
|
||||
{item.date}
|
||||
<br />
|
||||
<button className="link-button" data-action="open-price-lock" data-id={item.price_lock_id}>
|
||||
{item.number || '锁价记录'}
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</td>
|
||||
<td>{item.who}</td>
|
||||
<td className="number">{item.amount == null ? '待补齐' : '¥' + yuan(item.amount)}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="lock-activity-table"
|
||||
columns={[
|
||||
{ title: '日期/锁价单' },
|
||||
{ title: '项目/客户' },
|
||||
{ title: '账户/付款人' },
|
||||
{ title: '金额', headerClassName: 'number' },
|
||||
]}
|
||||
rows={rows.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, undefined, 'number'],
|
||||
cells: [
|
||||
<>
|
||||
{item.date}
|
||||
<br />
|
||||
<LedgerButton className="link-button" data-action="open-price-lock" data-id={item.price_lock_id}>
|
||||
{item.number || '锁价记录'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
<>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</>,
|
||||
item.who,
|
||||
item.amount == null ? '待补齐' : '¥' + yuan(item.amount),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
@@ -383,7 +381,7 @@ export function orderBook(
|
||||
function orderBookIdentity(row: BookRow, version: number | undefined = undefined) {
|
||||
if (row.kind === 'orderAfterSale')
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.order_id || row.id}
|
||||
@@ -391,12 +389,12 @@ export function orderBook(
|
||||
<strong className="order-book-customer-name">{row.customer || '未填称呼'}</strong>
|
||||
<span className="order-book-secondary muted">订单售后 · {row.paper_number || row.number}</span>
|
||||
<span className="small muted">查看原单售后结果</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
if (row.kind === 'recovery')
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="recovery-open"
|
||||
data-id={row.recovery_id || row.id}
|
||||
@@ -407,7 +405,7 @@ export function orderBook(
|
||||
</span>
|
||||
<span className="order-book-secondary muted">{row.number}</span>
|
||||
<span className="order-book-recovery-payment">回收付款 ¥{yuan(row.cashPayment)}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('打印', 'recovery-print', 'quiet order-book-recovery-print', {
|
||||
'data-id': row.recovery_id || row.id,
|
||||
'aria-label': '打印 ' + (row.customer || '客户') + ' 的回收单',
|
||||
@@ -434,7 +432,7 @@ export function orderBook(
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -442,7 +440,7 @@ export function orderBook(
|
||||
>
|
||||
{customer}
|
||||
<span className="order-book-secondary muted">{row.paper_number || row.number}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
if (row.kind === 'afterSale')
|
||||
@@ -454,7 +452,7 @@ export function orderBook(
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -462,7 +460,7 @@ export function orderBook(
|
||||
>
|
||||
<strong>{row.paper_number || row.number}</strong>
|
||||
<span>{row.customer || '未填称呼'}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
const card = (title: string, value: ReactNode, hint: ReactNode = '', emphasis = false) => (
|
||||
@@ -659,7 +657,7 @@ export function orderBook(
|
||||
}
|
||||
const table = (
|
||||
<div className="table-wrap order-book-table-wrap">
|
||||
<table className="order-book-table" aria-label={range.name + '订单账本'}>
|
||||
<LedgerTable className="order-book-table" aria-label={range.name + '订单账本'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="order-index">序号</th>
|
||||
@@ -805,7 +803,7 @@ export function orderBook(
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
return {
|
||||
|
||||
@@ -6,6 +6,7 @@ type CostRow = ReturnType<typeof import('../../../../../public/calculations.js')
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children, Fragment } from 'react';
|
||||
import { Calc as LedgerCalc } from '../../../shared';
|
||||
import { LedgerDataTable, LedgerTable } from '../../../components/BusinessControls';
|
||||
export function orderDetail(
|
||||
{ currentOrder, state, detailForm, error, navigation }: OrderContext,
|
||||
{
|
||||
@@ -84,30 +85,19 @@ export function orderDetail(
|
||||
].sort((a, b) => a.date.localeCompare(b.date));
|
||||
return rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>业务</th>
|
||||
<th>金额</th>
|
||||
<th>账户/经办人</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(r => (
|
||||
<tr>
|
||||
<td>{r.date}</td>
|
||||
<td>{r.type}</td>
|
||||
<td>¥{yuan(r.amount)}</td>
|
||||
<td>{r.who}</td>
|
||||
<td>{r.note}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '日期' },
|
||||
{ title: '业务' },
|
||||
{ title: '金额' },
|
||||
{ title: '账户/经办人' },
|
||||
{ title: '说明' },
|
||||
]}
|
||||
rows={rows.map((r, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [r.date, r.type, <>¥{yuan(r.amount)}</>, r.who, r.note],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="muted">还没有收退款、费用或交款记录。</p>
|
||||
@@ -224,7 +214,7 @@ export function orderDetail(
|
||||
const names = Object.fromEntries(teamMemberKeys().map(member => [member, teamMemberName(member)]));
|
||||
return (
|
||||
<div className="table-wrap">
|
||||
<table className="detail-cost-table" aria-label={label}>
|
||||
<LedgerTable className="detail-cost-table" aria-label={label}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>成本项目</th>
|
||||
@@ -284,7 +274,7 @@ export function orderDetail(
|
||||
}),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import type { CancellationRequest, OwnershipRequest, ChangeRequest, ReviewList, CancelSummary } from '../orderData';
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTextArea,
|
||||
} from '../../../components/BusinessControls';
|
||||
export function orderReviews(
|
||||
{
|
||||
state,
|
||||
@@ -67,64 +74,58 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="cancellation-list-table" aria-label="全部日期的取消申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原订单/日期</th>
|
||||
<th>经办/申请人及时间</th>
|
||||
<th>取消原因</th>
|
||||
<th>状态/处理记录</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">原成交 ¥{yuan(request.summary.total)}</div>
|
||||
</td>
|
||||
<td>
|
||||
{request.direct === true ? '经办人:' : ''}
|
||||
{request.operator_name || request.requester_name}
|
||||
<div className="small muted">
|
||||
{orderCancellationTime(request.executedAt || request.created)}
|
||||
</div>
|
||||
</td>
|
||||
<td className="cancellation-reason">{request.reason}</td>
|
||||
<td>
|
||||
{orderCancellationRecordStatus(request)}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small cancellation-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderCancellationTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-cancellation-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="cancellation-list-table"
|
||||
aria-label="全部日期的取消申请"
|
||||
columns={[
|
||||
{ title: '原订单/日期' },
|
||||
{ title: '经办/申请人及时间' },
|
||||
{ title: '取消原因' },
|
||||
{ title: '状态/处理记录' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'cancellation-reason', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">原成交 ¥{yuan(request.summary.total)}</div>
|
||||
</>,
|
||||
<>
|
||||
{request.direct === true ? '经办人:' : ''}
|
||||
{request.operator_name || request.requester_name}
|
||||
<div className="small muted">{orderCancellationTime(request.executedAt || request.created)}</div>
|
||||
</>,
|
||||
request.reason,
|
||||
<>
|
||||
{orderCancellationRecordStatus(request)}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small cancellation-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderCancellationTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-cancellation-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的取消申请。</p>
|
||||
@@ -158,65 +159,60 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table" aria-label="全部日期的归属申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>订单/日期</th>
|
||||
<th>归属修改</th>
|
||||
<th>申请人/原因</th>
|
||||
<th>复核结果</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong className="order-ownership-list-customer">
|
||||
{request.order_customer || '未填客户称呼'}
|
||||
</strong>
|
||||
<div className="small muted">
|
||||
{request.order_number} · {request.order_date}
|
||||
</div>
|
||||
</td>
|
||||
<td>{orderOwnershipPairHTML(request)}</td>
|
||||
<td>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderOwnershipTime(request.created)}</div>
|
||||
<p className="change-reason">{request.reason}</p>
|
||||
</td>
|
||||
<td>
|
||||
{orderOwnershipStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">订单已有变动,需驳回后重申</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <p className="small change-reason">{request.note}</p> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderOwnershipTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'order-ownership-open-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
aria-label="全部日期的归属申请"
|
||||
columns={[
|
||||
{ title: '订单/日期' },
|
||||
{ title: '归属修改' },
|
||||
{ title: '申请人/原因' },
|
||||
{ title: '复核结果' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
<strong className="order-ownership-list-customer">
|
||||
{request.order_customer || '未填客户称呼'}
|
||||
</strong>
|
||||
<div className="small muted">
|
||||
{request.order_number} · {request.order_date}
|
||||
</div>
|
||||
</>,
|
||||
orderOwnershipPairHTML(request),
|
||||
<>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderOwnershipTime(request.created)}</div>
|
||||
<p className="change-reason">{request.reason}</p>
|
||||
</>,
|
||||
<>
|
||||
{orderOwnershipStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">订单已有变动,需驳回后重申</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <p className="small change-reason">{request.note}</p> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderOwnershipTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'order-ownership-open-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的归属申请。</p>
|
||||
@@ -250,69 +246,60 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table" aria-label="全部日期的变更申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原订单/日期</th>
|
||||
<th>申请人/申请时间</th>
|
||||
<th>动作/申请原因</th>
|
||||
<th>状态/复核意见</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">
|
||||
原成交 {orderChangeMoney(request.summary.before.total)}
|
||||
<br />
|
||||
申请成交 {orderChangeMoney(request.summary.after.total)}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderChangeTime(request.created)}</div>
|
||||
</td>
|
||||
<td className="change-reason">
|
||||
<strong>{orderChangeActionLabel(request)}</strong>
|
||||
<br />
|
||||
{request.reason}
|
||||
</td>
|
||||
<td>
|
||||
{orderChangeStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small change-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderChangeTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-change-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
aria-label="全部日期的变更申请"
|
||||
columns={[
|
||||
{ title: '原订单/日期' },
|
||||
{ title: '申请人/申请时间' },
|
||||
{ title: '动作/申请原因' },
|
||||
{ title: '状态/复核意见' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'change-reason', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">
|
||||
原成交 {orderChangeMoney(request.summary.before.total)}
|
||||
<br />
|
||||
申请成交 {orderChangeMoney(request.summary.after.total)}
|
||||
</div>
|
||||
</>,
|
||||
<>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderChangeTime(request.created)}</div>
|
||||
</>,
|
||||
<>
|
||||
<strong>{orderChangeActionLabel(request)}</strong>
|
||||
<br />
|
||||
{request.reason}
|
||||
</>,
|
||||
<>
|
||||
{orderChangeStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small change-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderChangeTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(owner && request.status === 'pending' ? '查看并复核' : '查看订单', 'open-change-order', '', {
|
||||
'data-id': request.order_id,
|
||||
}),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的变更申请。</p>
|
||||
@@ -330,7 +317,7 @@ export function orderReviews(
|
||||
'这笔历史记录未记录对数,当前对数按实际盘点基准保留。本次旧重量冲回不自动更改当前对数,如实物有变化请另做当天对数调整。'}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input name="legacyCountVerified" type="checkbox" required />
|
||||
<LedgerInput name="legacyCountVerified" type="checkbox" required />
|
||||
已核对当前对数基准,理解本次更正对历史对数的处理
|
||||
</label>
|
||||
</>
|
||||
@@ -404,32 +391,25 @@ export function orderReviews(
|
||||
{summary.legacyCountNotice ? <p className="note">{summary.legacyCountNotice}</p> : ''}
|
||||
{summary.inventory.length ? (
|
||||
<div className="table-wrap">
|
||||
<table aria-label="取消后库存冲回摘要">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原日期</th>
|
||||
<th>货盘</th>
|
||||
<th className="number">恢复/冲回克重</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
summary.inventory.map(item => (
|
||||
<tr>
|
||||
<td>{item.date}</td>
|
||||
<td>{pocketLabel(item.pocket)}</td>
|
||||
<td className="number">
|
||||
{item.mg > 0 ? '+' : ''}
|
||||
{grams(item.mg)}g
|
||||
{inventoryCountHTML(item, {
|
||||
signed: true,
|
||||
})}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
aria-label="取消后库存冲回摘要"
|
||||
columns={[{ title: '原日期' }, { title: '货盘' }, { title: '恢复/冲回克重', headerClassName: 'number' }]}
|
||||
rows={summary.inventory.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'number'],
|
||||
cells: [
|
||||
item.date,
|
||||
pocketLabel(item.pocket),
|
||||
<>
|
||||
{item.mg > 0 ? '+' : ''}
|
||||
{grams(item.mg)}g
|
||||
{inventoryCountHTML(item, {
|
||||
signed: true,
|
||||
})}
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="small muted">本单没有需要冲回的库存出入。</p>
|
||||
@@ -471,20 +451,20 @@ export function orderReviews(
|
||||
这张订单是今天开的,核实后直接按录错作废,无需另行审批。业务日期:{data.directActionDate}
|
||||
。本入口不办理真实退货或退款。
|
||||
</div>
|
||||
<input type="hidden" name="date" defaultValue={data.directActionDate} />
|
||||
<LedgerInput type="hidden" name="date" defaultValue={data.directActionDate} />
|
||||
{orderCancellationSummaryDataHTML(data.summary)}
|
||||
<label>
|
||||
取消原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清这张单录错的原因,例如:同一笔销售重复录入。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实这是录错作废,并确认撤销上述记账和冲回库存;本次不登记真实退货退款。
|
||||
</label>
|
||||
</>
|
||||
@@ -500,13 +480,13 @@ export function orderReviews(
|
||||
<p className="small muted">真实退货请从“整单退货”办理;这里不会发起真实退款。</p>
|
||||
<label>
|
||||
取消原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清这张单录错的原因,例如:同一笔销售重复录入。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -521,10 +501,10 @@ export function orderReviews(
|
||||
<p className="cancellation-reason">取消原因:{request.reason}</p>
|
||||
{orderCancellationSummaryHTML(request)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实这是录错作废,并确认撤销上述记账和冲回库存;本次不登记真实退货退款。
|
||||
</label>
|
||||
</>
|
||||
@@ -538,13 +518,13 @@ export function orderReviews(
|
||||
<p className="small muted">驳回后原订单继续计账,申请人可核对后重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清需要补充或重新核对的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -564,13 +544,13 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-cancellation-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
type="submit"
|
||||
data-order-cancellation-submit=""
|
||||
className={['approve', 'direct'].includes(kind) ? 'danger' : 'primary'}
|
||||
>
|
||||
{submit}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'close-order-cancellation-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -608,16 +588,16 @@ export function orderReviews(
|
||||
<div className="grid two">
|
||||
<label>
|
||||
当前归属
|
||||
<input defaultValue={before.label} readOnly />
|
||||
<LedgerInput defaultValue={before.label} readOnly />
|
||||
</label>
|
||||
<label>
|
||||
修改为
|
||||
<select name="member" required defaultValue="">
|
||||
<LedgerSelect name="member" required defaultValue="">
|
||||
{opts([
|
||||
['', '请选择新归属'],
|
||||
...members.map((member): [string, string] => [member.member, member.label]),
|
||||
])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="order-ownership-selection" id="order-ownership-selection" aria-live="polite">
|
||||
@@ -626,16 +606,16 @@ export function orderReviews(
|
||||
{orderOwnershipEffectHTML(data.member)}
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清原归属录错的原因及正确归属。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对原归属、新归属和修改原因,确认本次归属{direct ? '更正' : '申请'}。
|
||||
</label>
|
||||
</>
|
||||
@@ -654,10 +634,10 @@ export function orderReviews(
|
||||
<>
|
||||
{orderOwnershipEffectHTML(request.before.member)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对原归属、新归属和原因,同意后按新归属统计,并更新原助理的查看权限。
|
||||
</label>
|
||||
</>
|
||||
@@ -666,13 +646,13 @@ export function orderReviews(
|
||||
<p className="small muted">驳回后保留原归属,申请人可核对后重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清需要重新核对的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
)}
|
||||
@@ -685,9 +665,9 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-ownership-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary">
|
||||
<LedgerButton type="submit" className="primary">
|
||||
{submit}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'order-ownership-close-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -723,10 +703,10 @@ export function orderReviews(
|
||||
{orderChangeActionSummaryHTML(request)}
|
||||
{orderChangeComparisonHTML(request)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对本次申请动作、金额、日期、账户或付款人、退货去向及库存,确认原值与申请值,以及以上关联订单的本次修改。
|
||||
</label>
|
||||
</>
|
||||
@@ -736,13 +716,13 @@ export function orderReviews(
|
||||
<p>驳回后原单继续计账,申请人可按最新原单重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清需要重新核对或补充的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -752,9 +732,9 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-change-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary">
|
||||
<LedgerButton type="submit" className="primary">
|
||||
{kind === 'approve' ? '同意变更并更新原单' : '确认驳回'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'close-order-change-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -18,6 +18,13 @@ import type {
|
||||
} from '../orderData';
|
||||
import { Children, Fragment } from 'react';
|
||||
import { Calc as LedgerCalc, Cards as CreditCardFees, Values } from '../../../shared';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTable,
|
||||
} from '../../../components/BusinessControls';
|
||||
export function sharedViews({
|
||||
state,
|
||||
session,
|
||||
@@ -80,7 +87,7 @@ export function sharedViews({
|
||||
return (
|
||||
<label className="stock-count-field" data-stock-count-field="" hidden={!visible}>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
name={name}
|
||||
readOnly={readOnly}
|
||||
defaultValue={value ?? ''}
|
||||
@@ -136,9 +143,9 @@ export function sharedViews({
|
||||
return (
|
||||
<label>
|
||||
{title}
|
||||
<select name={name} defaultValue={selected}>
|
||||
<LedgerSelect name={name} defaultValue={selected}>
|
||||
{opts(values)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
);
|
||||
};
|
||||
@@ -157,7 +164,7 @@ export function sharedViews({
|
||||
) => (
|
||||
<label>
|
||||
{title}
|
||||
<input type={type} name={name} defaultValue={value} {...props} />
|
||||
<LedgerInput type={type} name={name} defaultValue={value} {...props} />
|
||||
</label>
|
||||
);
|
||||
const opts = (values: Options) =>
|
||||
@@ -280,7 +287,10 @@ export function sharedViews({
|
||||
{lock.customer ? ' · ' + lock.customer : ''}
|
||||
</h3>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table material-change-comparison" aria-label="关联锁价单成本影响">
|
||||
<LedgerTable
|
||||
className="material-detail-table material-change-comparison"
|
||||
aria-label="关联锁价单成本影响"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
@@ -310,7 +320,7 @@ export function sharedViews({
|
||||
: ''}
|
||||
{pair('自动付款归属', sources(lock.before), sources(lock.after))}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</>
|
||||
)),
|
||||
@@ -338,7 +348,7 @@ export function sharedViews({
|
||||
<h3>{title}</h3>
|
||||
{rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="order-change-inventory">
|
||||
<LedgerTable className="order-change-inventory">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
@@ -365,7 +375,7 @@ export function sharedViews({
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
) : (
|
||||
<p className="small muted">{changes ? '本次没有黄金货盘净变动。' : '没有本单库存流水。'}</p>
|
||||
@@ -745,7 +755,7 @@ export function sharedViews({
|
||||
原值为申请时快照,申请值由服务器按本次变更试算。批准前请核对客户实付、商品、成本、费用及付款人。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table className="order-change-table" aria-label="变更申请原值与申请值对照">
|
||||
<LedgerTable className="order-change-table" aria-label="变更申请原值与申请值对照">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
@@ -777,7 +787,7 @@ export function sharedViews({
|
||||
orderChangeExpensesValue(after),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
{orderChangeInventoryHTML(request.summary.inventory)}
|
||||
{related}
|
||||
@@ -888,42 +898,38 @@ export function sharedViews({
|
||||
)}
|
||||
</dl>
|
||||
<div className="table-wrap">
|
||||
<table aria-label="逐件售后回库与成本">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品与实际去向</th>
|
||||
<th>实际退回</th>
|
||||
<th>回料成本</th>
|
||||
<th>保留工费</th>
|
||||
<th>成本损失</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
record.lines.map(line => (
|
||||
<tr>
|
||||
<td>
|
||||
{line.name || '商品 ' + (line.lineIndex + 1)}
|
||||
<div className="small muted">
|
||||
{pocketLabel(line.pocket)} · {line.disposition === 'stock' ? '完好现货' : '旧料/损坏'}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{grams(line.quantity)}g
|
||||
{line.disposition === 'stock' && pocketCountsEnabled(line.pocket) ? (
|
||||
<div className="small">{stockCountText(line.stockCount)}</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>{money(line.materialReturnedCost)}</td>
|
||||
<td>{money(line.laborRestockedCost)}</td>
|
||||
<td>{money(line.costLoss)}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
aria-label="逐件售后回库与成本"
|
||||
columns={[
|
||||
{ title: '商品与实际去向' },
|
||||
{ title: '实际退回' },
|
||||
{ title: '回料成本' },
|
||||
{ title: '保留工费' },
|
||||
{ title: '成本损失' },
|
||||
]}
|
||||
rows={record.lines.map((line, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
{line.name || '商品 ' + (line.lineIndex + 1)}
|
||||
<div className="small muted">
|
||||
{pocketLabel(line.pocket)} · {line.disposition === 'stock' ? '完好现货' : '旧料/损坏'}
|
||||
</div>
|
||||
</>,
|
||||
<>
|
||||
{grams(line.quantity)}g
|
||||
{line.disposition === 'stock' && pocketCountsEnabled(line.pocket) ? (
|
||||
<div className="small">{stockCountText(line.stockCount)}</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
money(line.materialReturnedCost),
|
||||
money(line.laborRestockedCost),
|
||||
money(line.costLoss),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
<p className="small muted">
|
||||
实退材料按原成本回售后日料池,不新增采购付款。完好现货工费留在退回现货批次;旧料工费与未退回材料成本计损失。原单实际费用继续保留。
|
||||
@@ -1209,9 +1215,9 @@ export function sharedViews({
|
||||
[key: `data-${string}`]: string | number | boolean | undefined;
|
||||
} = {},
|
||||
) => (
|
||||
<button type="button" data-action={action} className={cls} {...props}>
|
||||
<LedgerButton type="button" data-action={action} className={cls} {...props}>
|
||||
{text}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
function teamMemberName(member: string | undefined) {
|
||||
return (
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { StockSelection, EditLine } from './deliveryTypes';
|
||||
import type { useLockPool } from './useLockPool';
|
||||
import { Model } from '../../shared';
|
||||
import { Act, Field, Money, Choice, Check, Charges } from './formParts';
|
||||
import { LedgerInput } from '../../components/BusinessControls';
|
||||
export function DeliveryFields({
|
||||
views,
|
||||
state,
|
||||
@@ -289,7 +290,7 @@ export function DeliveryFields({
|
||||
/>
|
||||
<p className="purchase-formula">{line.view?.laborFormula}</p>
|
||||
{Model.teamMode(state) && p.costFundings?.labor && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="labor"
|
||||
@@ -297,9 +298,9 @@ export function DeliveryFields({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
<input type="hidden" name="cost-accessories" value={p.accessories} />
|
||||
<input type="hidden" name="cost-other" value={p.other} />
|
||||
<input type="hidden" name="payer" value={line.payer} />
|
||||
<LedgerInput type="hidden" name="cost-accessories" value={p.accessories} />
|
||||
<LedgerInput type="hidden" name="cost-other" value={p.other} />
|
||||
<LedgerInput type="hidden" name="payer" value={line.payer} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -470,7 +471,7 @@ export function FeeFields({
|
||||
移除费用
|
||||
</Act>
|
||||
{Model.teamMode(state) && r.funding && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="fee"
|
||||
|
||||
@@ -2,29 +2,15 @@ import { savedCreate } from './draftInput';
|
||||
import { lockEditKey, lockDraftKey } from './receipts';
|
||||
import type { FormEvent } from 'react';
|
||||
import type { LedgerState, SessionInfo } from '../../shared';
|
||||
import type { LockPayment } from './formParts';
|
||||
import type { LockPayment } from './formValues';
|
||||
import type { InputLine, LockEdit, LockProps, LockViews, PreviewRow, SaveLock, InputMaterial } from './types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Model, Calc } from '../../shared';
|
||||
import { navigate } from '../../lib/router';
|
||||
import {
|
||||
Act,
|
||||
Field,
|
||||
Money,
|
||||
Choice,
|
||||
Check,
|
||||
Heading,
|
||||
Charges,
|
||||
AccountFields,
|
||||
CardPreview,
|
||||
amountPreview,
|
||||
safeEstimate,
|
||||
saleCharges,
|
||||
initialPayment,
|
||||
paymentPayload,
|
||||
readDraft,
|
||||
} from './formParts';
|
||||
import { Act, Field, Money, Choice, Check, Heading, Charges, AccountFields, CardPreview } from './formParts';
|
||||
import { amountPreview, safeEstimate, saleCharges, initialPayment, paymentPayload, readDraft } from './formValues';
|
||||
import { useLockPool } from './useLockPool';
|
||||
import { LedgerButton, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
function PoolQuote({
|
||||
q,
|
||||
@@ -370,8 +356,8 @@ export function LockCreate({
|
||||
) : (
|
||||
<label>
|
||||
订单归属(经营款与业绩)
|
||||
<input value={Model.memberName(state, d.member)} readOnly />
|
||||
<input type="hidden" name="member" value={d.member} />
|
||||
<LedgerInput value={Model.memberName(state, d.member)} readOnly />
|
||||
<LedgerInput type="hidden" name="member" value={d.member} />
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
@@ -628,7 +614,7 @@ export function LockCreate({
|
||||
)}
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="pending_edit_reason"
|
||||
required
|
||||
maxLength={200}
|
||||
@@ -655,7 +641,7 @@ export function LockCreate({
|
||||
/>
|
||||
<label>
|
||||
客户可见备注
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={170}
|
||||
rows={2}
|
||||
@@ -681,9 +667,14 @@ export function LockCreate({
|
||||
</div>
|
||||
<div className="small muted">待交付,不计利润</div>
|
||||
</div>
|
||||
<button className="primary" type="submit" data-lock-create-submit="" disabled={blocked || d.conflicted}>
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
type="submit"
|
||||
data-lock-create-submit=""
|
||||
disabled={blocked || d.conflicted}
|
||||
>
|
||||
{edit ? (approval ? '提交修改申请' : '保存锁价修改') : '保存锁价待交付'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id="price-lock-error" aria-live="polite">
|
||||
{error && <div className="error">{error}</div>}
|
||||
|
||||
@@ -3,26 +3,16 @@ import { lockDeliveryKey } from './receipts';
|
||||
import type { FormEvent } from 'react';
|
||||
import type { OrderForm, SyncContext } from '../../shared';
|
||||
import type { LockRecord, LockProps, LockViews, SaveLock, DeliveryCost } from './types';
|
||||
import type { LockPayment } from './formParts';
|
||||
import type { LockPayment } from './formValues';
|
||||
import type { DeliveryForm, DeliveryLine, SavedLine } from './deliveryTypes';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Model, Calc, Cards } from '../../shared';
|
||||
import { navigate } from '../../lib/router';
|
||||
import {
|
||||
Heading,
|
||||
Act,
|
||||
Field,
|
||||
Money,
|
||||
Check,
|
||||
AccountFields,
|
||||
CardPreview,
|
||||
initialPayment,
|
||||
paymentPayload,
|
||||
readDraft,
|
||||
safeEstimate,
|
||||
} from './formParts';
|
||||
import { Heading, Act, Field, Money, Check, AccountFields, CardPreview } from './formParts';
|
||||
import { initialPayment, paymentPayload, readDraft, safeEstimate } from './formValues';
|
||||
import { DeliveryFields, FeeFields } from './DeliveryFields';
|
||||
import { useLockPool } from './useLockPool';
|
||||
import { LedgerButton, LedgerInput } from '../../components/BusinessControls';
|
||||
|
||||
const uuid = () => crypto.randomUUID();
|
||||
function initialize(lock: LockRecord, views: LockViews, ctx: SyncContext, key: string): DeliveryForm {
|
||||
@@ -293,7 +283,7 @@ export function LockDelivery({
|
||||
['returning', '老客户'],
|
||||
].map(([k, l]) => (
|
||||
<label key={k} title={k === 'new' ? '首次成交' : '再次成交'}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={k}
|
||||
@@ -440,9 +430,9 @@ export function LockDelivery({
|
||||
</Check>
|
||||
<div className="form-actions">
|
||||
<span className="small muted">保存后才记销售、完整成本和利润,可打印正式客户单据。</span>
|
||||
<button type="submit" className="primary" disabled={blocked}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked}>
|
||||
确认整单交付并生成销售单
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id="price-lock-error" aria-live="polite">
|
||||
{error && <div className="error">{error}</div>}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { clearMatching, type DraftSubmission } from '../../lib/receipt';
|
||||
import { lockReceipt } from './receipts';
|
||||
import { useEffect, useMemo, useRef, useState, type FormEvent, type MouseEvent, type ReactNode } from 'react';
|
||||
import { useEffect, useMemo, useState, type FormEvent, type MouseEvent, type ReactNode } from 'react';
|
||||
import type { LedgerClient } from '../../lib/api';
|
||||
import type { LedgerState } from '../../shared';
|
||||
import { loadState } from '../../lib/session';
|
||||
@@ -12,6 +12,7 @@ import { lockViews } from './lockViews';
|
||||
import { Act, Heading } from './formParts';
|
||||
import { LockCreate } from './LockCreate';
|
||||
import { LockDelivery } from './LockDelivery';
|
||||
import { LedgerButton, LedgerDialog } from '../../components/BusinessControls';
|
||||
|
||||
type DialogKind = 'changes' | 'review' | 'cancel' | 'detail';
|
||||
type LocalDialog = { kind: DialogKind; id?: string };
|
||||
@@ -142,24 +143,16 @@ function readChanges(r: unknown) {
|
||||
const modalId = (k: DialogKind) =>
|
||||
['changes', 'review'].includes(k) ? 'price-lock-changes-dialog' : 'price-lock-dialog';
|
||||
function Modal({ children, kind, close }: { children: ReactNode; kind: DialogKind; close: () => void }) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const root = ref.current;
|
||||
if (!root) return;
|
||||
root.showModal();
|
||||
return () => root.close();
|
||||
}, []);
|
||||
return (
|
||||
<dialog
|
||||
<LedgerDialog
|
||||
id={modalId(kind)}
|
||||
ref={ref}
|
||||
onCancel={e => {
|
||||
e.preventDefault();
|
||||
close();
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
const previousFilters = new WeakMap<LedgerClient, { user: string; list: string; changes: string }>();
|
||||
@@ -458,9 +451,9 @@ export function LockPage({ client, state, session, route, onState, onRecoverOthe
|
||||
const waiting = resource.error ? (
|
||||
<div className="error">
|
||||
{resource.error}{' '}
|
||||
<button type="button" onClick={reload}>
|
||||
<LedgerButton type="button" onClick={reload}>
|
||||
重新读取
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : (
|
||||
<p>正在读取锁价记录…</p>
|
||||
@@ -471,9 +464,9 @@ export function LockPage({ client, state, session, route, onState, onRecoverOthe
|
||||
{formPending && !client.busy && (
|
||||
<div className="note" role="alert">
|
||||
上次提交结果尚未确认。
|
||||
<button type="button" data-action="retry" disabled={client.busy} onClick={retry}>
|
||||
<LedgerButton type="button" data-action="retry" disabled={client.busy} onClick={retry}>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
{message && (
|
||||
@@ -588,9 +581,14 @@ export function LockPage({ client, state, session, route, onState, onRecoverOthe
|
||||
<Modal key={kind + '-' + id} kind={dialog.kind} close={close}>
|
||||
{kind === 'changes' ? (
|
||||
<>
|
||||
<button type="button" className="dialog-close" data-action="price-lock-changes-close" aria-label="关闭">
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action="price-lock-changes-close"
|
||||
aria-label="关闭"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2>锁价修改与作废申请</h2>
|
||||
<div className="actions">
|
||||
{['pending', 'all'].map(s => (
|
||||
@@ -608,9 +606,14 @@ export function LockPage({ client, state, session, route, onState, onRecoverOthe
|
||||
</>
|
||||
) : kind === 'detail' ? (
|
||||
<>
|
||||
<button type="button" className="dialog-close" data-action="close-price-lock" aria-label="关闭锁价记录">
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action="close-price-lock"
|
||||
aria-label="关闭锁价记录"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<div id="price-lock-detail">{lock ? views.detailView(lock) : waiting}</div>
|
||||
</>
|
||||
) : (kind === 'cancel' ? cancel : review) ? (
|
||||
@@ -636,15 +639,15 @@ export function LockPage({ client, state, session, route, onState, onRecoverOthe
|
||||
{error && (
|
||||
<div role="alert" className="error">
|
||||
{error}{' '}
|
||||
<button type="button" onClick={reload}>
|
||||
<LedgerButton type="button" onClick={reload}>
|
||||
重新读取
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
{stale && (
|
||||
<button type="button" onClick={close}>
|
||||
<LedgerButton type="button" onClick={close}>
|
||||
关闭
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</Modal>
|
||||
)}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LineState, OrderForm } from '../../shared';
|
||||
import type { LockPayment, SavedPayment } from './formParts';
|
||||
import type { LockPayment, SavedPayment } from './formValues';
|
||||
|
||||
// 锁价交付在本地保存可提交的商品行。早期单件草稿将商品放在顶层的 line。
|
||||
export interface DeliveryLine {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LockCreateDraft, InputLine } from './types';
|
||||
import type { SavedPayment } from './formParts';
|
||||
import type { SavedPayment } from './formValues';
|
||||
import type { DeliveryDraft, SavedLine } from './deliveryTypes';
|
||||
|
||||
const record = (value: unknown): value is Record<string, unknown> =>
|
||||
|
||||
@@ -17,25 +17,14 @@ interface CheckProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'
|
||||
value?: boolean;
|
||||
update: (v: boolean) => void;
|
||||
}
|
||||
export interface LockPayment {
|
||||
method: string;
|
||||
recipient: string;
|
||||
payer: string;
|
||||
verified: boolean;
|
||||
amount: string;
|
||||
}
|
||||
export interface SavedPayment {
|
||||
account?: string;
|
||||
credit_card_fee_payer?: string;
|
||||
verified?: boolean;
|
||||
amount?: string;
|
||||
}
|
||||
import type { LockPayment } from './formValues';
|
||||
interface PaymentProps {
|
||||
state: LedgerState;
|
||||
payment: LockPayment;
|
||||
change: (p: LockPayment) => void;
|
||||
}
|
||||
import { Model, Cards, Calc } from '../../shared';
|
||||
import { Model, Cards } from '../../shared';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
export function Field({
|
||||
label,
|
||||
@@ -50,7 +39,7 @@ export function Field({
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<input
|
||||
<LedgerInput
|
||||
type={type}
|
||||
name={name}
|
||||
value={value ?? ''}
|
||||
@@ -68,7 +57,12 @@ export function Choice({ label, name, value, options, update, children, hidden,
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<select name={name} value={value ?? ''} {...props} onChange={update ? e => update(e.target.value) : undefined}>
|
||||
<LedgerSelect
|
||||
name={name}
|
||||
value={value ?? ''}
|
||||
{...props}
|
||||
onChange={update ? e => update(e.target.value) : undefined}
|
||||
>
|
||||
{options.map(v => {
|
||||
const [k, title, disabled] = typeof v === 'string' ? [v, v] : v;
|
||||
return (
|
||||
@@ -77,7 +71,7 @@ export function Choice({ label, name, value, options, update, children, hidden,
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
{children}
|
||||
</label>
|
||||
);
|
||||
@@ -85,16 +79,16 @@ export function Choice({ label, name, value, options, update, children, hidden,
|
||||
export function Check({ name, value, update, children, hidden, ...props }: CheckProps) {
|
||||
return (
|
||||
<label className="check" hidden={hidden}>
|
||||
<input type="checkbox" name={name} checked={!!value} onChange={e => update(e.target.checked)} {...props} />
|
||||
<LedgerInput type="checkbox" name={name} checked={!!value} onChange={e => update(e.target.checked)} {...props} />
|
||||
{children}
|
||||
</label>
|
||||
);
|
||||
}
|
||||
export function Act({ name, onClick, children, className = '', ...props }: ButtonHTMLAttributes<HTMLButtonElement>) {
|
||||
return (
|
||||
<button type="button" className={className} data-action={name} onClick={onClick} {...props}>
|
||||
<LedgerButton type="button" className={className} data-action={name} onClick={onClick} {...props}>
|
||||
{children}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
export function Heading({
|
||||
@@ -246,7 +240,7 @@ export function CardPreview({
|
||||
<div className="credit-card-fields">
|
||||
<label>
|
||||
手续费(元,自动)
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
@@ -284,53 +278,3 @@ export function CardPreview({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export function amountPreview(raw: string) {
|
||||
try {
|
||||
return Calc.cents(raw);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export function safeEstimate<T>(fn: () => T): { result: T; error?: undefined } | { result?: undefined; error: string } {
|
||||
try {
|
||||
return { result: fn() };
|
||||
} catch (error) {
|
||||
return { error: error instanceof Error ? error.message : String(error) };
|
||||
}
|
||||
}
|
||||
export function readDraft<T>(key: string, valid: (v: unknown) => v is T): T | null {
|
||||
try {
|
||||
const value: unknown = JSON.parse(localStorage.getItem(key) || 'null');
|
||||
return valid(value) ? value : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export function saleCharges(charges: ChargeState[]) {
|
||||
return charges.map(r => ({
|
||||
id: r.id,
|
||||
nameType: r.type,
|
||||
customName: r.customName,
|
||||
name: r.type === '其他' ? r.customName : r.type,
|
||||
amount: r.amount,
|
||||
chargePrices: r.prices,
|
||||
...(r.costRemoved ? { costRemoved: true } : {}),
|
||||
}));
|
||||
}
|
||||
export function initialPayment(state: LedgerState, p: SavedPayment | undefined, member: string): LockPayment {
|
||||
const id = Model.accountIdentity(state, p?.account || '');
|
||||
return {
|
||||
method: id?.channel || '微信',
|
||||
recipient: Model.memberAccountPrefix(id?.member || (Model.teamMode(state) ? member : 'assistant')),
|
||||
payer: p?.credit_card_fee_payer || 'owner',
|
||||
verified: !!p?.verified,
|
||||
amount: p?.amount ?? '',
|
||||
};
|
||||
}
|
||||
export function paymentPayload(payment: LockPayment) {
|
||||
return {
|
||||
account: Cards.normalizeAccount((payment.method === '信用卡' ? '麦麦' : payment.recipient) + payment.method),
|
||||
credit_card_fee_payer: payment.payer,
|
||||
verified: payment.verified,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import { Cards, Calc, Model, type ChargeState, type LedgerState } from '../../shared';
|
||||
export interface LockPayment {
|
||||
method: string;
|
||||
recipient: string;
|
||||
payer: string;
|
||||
verified: boolean;
|
||||
amount: string;
|
||||
}
|
||||
export interface SavedPayment {
|
||||
account?: string;
|
||||
credit_card_fee_payer?: string;
|
||||
verified?: boolean;
|
||||
amount?: string;
|
||||
}
|
||||
export function amountPreview(raw: string) {
|
||||
try {
|
||||
return Calc.cents(raw);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export function safeEstimate<T>(fn: () => T): { result: T; error?: undefined } | { result?: undefined; error: string } {
|
||||
try {
|
||||
return { result: fn() };
|
||||
} catch (error) {
|
||||
return { error: error instanceof Error ? error.message : String(error) };
|
||||
}
|
||||
}
|
||||
export function readDraft<T>(key: string, valid: (v: unknown) => v is T): T | null {
|
||||
try {
|
||||
const value: unknown = JSON.parse(localStorage.getItem(key) || 'null');
|
||||
return valid(value) ? value : null;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export function saleCharges(charges: ChargeState[]) {
|
||||
return charges.map(r => ({
|
||||
id: r.id,
|
||||
nameType: r.type,
|
||||
customName: r.customName,
|
||||
name: r.type === '其他' ? r.customName : r.type,
|
||||
amount: r.amount,
|
||||
chargePrices: r.prices,
|
||||
...(r.costRemoved ? { costRemoved: true } : {}),
|
||||
}));
|
||||
}
|
||||
export function initialPayment(state: LedgerState, p: SavedPayment | undefined, member: string): LockPayment {
|
||||
const id = Model.accountIdentity(state, p?.account || '');
|
||||
return {
|
||||
method: id?.channel || '微信',
|
||||
recipient: Model.memberAccountPrefix(id?.member || (Model.teamMode(state) ? member : 'assistant')),
|
||||
payer: p?.credit_card_fee_payer || 'owner',
|
||||
verified: !!p?.verified,
|
||||
amount: p?.amount ?? '',
|
||||
};
|
||||
}
|
||||
export function paymentPayload(payment: LockPayment) {
|
||||
return {
|
||||
account: Cards.normalizeAccount((payment.method === '信用卡' ? '麦麦' : payment.recipient) + payment.method),
|
||||
credit_card_fee_payer: payment.payer,
|
||||
verified: payment.verified,
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,13 @@ import type {
|
||||
import { Children, Fragment } from 'react';
|
||||
import { describeMaterialSources, validateMaterialQuote as checkMaterialQuote } from '../../lib/materialQuote';
|
||||
import { Model, Calc as LedgerCalc, Values } from '../../shared';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerTable,
|
||||
LedgerTextArea,
|
||||
} from '../../components/BusinessControls';
|
||||
function isInputSnapshot(value: LockRecord | LockCreateDraft): value is LockCreateDraft {
|
||||
const first = value.lines?.[0];
|
||||
return !!first && !('line' in first);
|
||||
@@ -442,9 +449,9 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
const id = result.lock.id;
|
||||
return (
|
||||
<>
|
||||
<button className={'dialog-close'} data-action={'close-price-lock'} aria-label={'关闭'}>
|
||||
<LedgerButton className={'dialog-close'} data-action={'close-price-lock'} aria-label={'关闭'}>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<div className={'order-header'}>
|
||||
<div className={'eyebrow'}>VOID PRICE LOCK</div>
|
||||
<h2>
|
||||
@@ -461,10 +468,10 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
</div>
|
||||
<form id={'price-lock-cancel-form'}>
|
||||
<label>
|
||||
作废原因<textarea name={'reason'} required={true} maxLength={200} rows={2}></textarea>
|
||||
作废原因<LedgerTextArea name={'reason'} required={true} maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className={'check'}>
|
||||
<input name={'verified'} type={'checkbox'} required={true} />
|
||||
<LedgerInput name={'verified'} type={'checkbox'} required={true} />
|
||||
已核实这是一张录错的待交付锁价单,确认整单作废。
|
||||
</label>
|
||||
{approval ? (
|
||||
@@ -478,9 +485,9 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
{button('返回锁价详情', 'open-price-lock', 'quiet', {
|
||||
'data-id': id,
|
||||
})}
|
||||
<button className={'danger'} type={'submit'}>
|
||||
<LedgerButton className={'danger'} type={'submit'}>
|
||||
{approval ? '提交作废申请' : '确认整单作废'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id={'price-lock-action-error'} aria-live={'polite'}></div>
|
||||
</form>
|
||||
@@ -495,34 +502,23 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
<section className={'lock-related-orders'}>
|
||||
<h3>受影响的销售单({rows.length}张)</h3>
|
||||
<div className={'table-wrap'}>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>订单</th>
|
||||
<th>货品成本:当前 → 生效后</th>
|
||||
<th>利润:当前 → 生效后</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(row => (
|
||||
<>
|
||||
<tr>
|
||||
<td>
|
||||
{row.date} · {row.number || row.id}
|
||||
</td>
|
||||
<td>
|
||||
{money(row.before?.goodsCost)} → {money(row.after?.goodsCost)}
|
||||
</td>
|
||||
<td>
|
||||
{money(row.before?.profit)} → {money(row.after?.profit)}
|
||||
</td>
|
||||
</tr>
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[{ title: '订单' }, { title: '货品成本:当前 → 生效后' }, { title: '利润:当前 → 生效后' }]}
|
||||
rows={rows.map((row, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
{row.date} · {row.number || row.id}
|
||||
</>,
|
||||
<>
|
||||
{money(row.before?.goodsCost)} → {money(row.after?.goodsCost)}
|
||||
</>,
|
||||
<>
|
||||
{money(row.before?.profit)} → {money(row.after?.profit)}
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
@@ -593,7 +589,7 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
{lock.customer ? ' · ' + lock.customer : ''}
|
||||
</h3>
|
||||
<div className={'table-wrap'}>
|
||||
<table
|
||||
<LedgerTable
|
||||
className={'material-detail-table material-change-comparison'}
|
||||
aria-label={'关联锁价单成本影响'}
|
||||
>
|
||||
@@ -626,7 +622,7 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
: ''}
|
||||
{pair('自动付款归属', sources(lock.before), sources(lock.after))}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</>
|
||||
)),
|
||||
@@ -647,7 +643,7 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
return (
|
||||
<>
|
||||
<div className={'table-wrap price-lock-items'}>
|
||||
<table aria-label={'锁价商品明细'}>
|
||||
<LedgerTable aria-label={'锁价商品明细'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品</th>
|
||||
@@ -746,7 +742,7 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
}),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
@@ -795,53 +791,44 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
{value.date || ''} · {value.customer || ''} · 开单人 {value.salesperson || '未提供'}
|
||||
</p>
|
||||
<div className={'table-wrap'}>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>商品</th>
|
||||
<th>锁重/售价</th>
|
||||
<th>销售工费/附加项目</th>
|
||||
<th>原锁料费/付款人</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(row => (
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '商品' },
|
||||
{ title: '锁重/售价' },
|
||||
{ title: '销售工费/附加项目' },
|
||||
{ title: '原锁料费/付款人' },
|
||||
]}
|
||||
rows={rows.map((row, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
row.name || '未提供',
|
||||
<>
|
||||
{row.quantity || '未提供'}g<br />¥{row.goldPrice ?? '未提供'}/克
|
||||
</>,
|
||||
<>
|
||||
{row.laborMode === 'piece' ? '件工费' : '克工费'} ¥{row.laborRate ?? '未提供'}
|
||||
{row.laborMode === 'piece' ? ' × ' + (row.pieces || 1) + '件' : '/克'}
|
||||
{Children.toArray(
|
||||
(row.charges || []).map(charge => (
|
||||
<>
|
||||
<br />
|
||||
{charge.name} ¥{charge.amount}
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</>,
|
||||
row.material?.source === 'pool' ? (
|
||||
'当日加权料池'
|
||||
) : (
|
||||
<>
|
||||
<tr>
|
||||
<td>{row.name || '未提供'}</td>
|
||||
<td>
|
||||
{row.quantity || '未提供'}g<br />¥{row.goldPrice ?? '未提供'}/克
|
||||
</td>
|
||||
<td>
|
||||
{row.laborMode === 'piece' ? '件工费' : '克工费'} ¥{row.laborRate ?? '未提供'}
|
||||
{row.laborMode === 'piece' ? ' × ' + (row.pieces || 1) + '件' : '/克'}
|
||||
{Children.toArray(
|
||||
(row.charges || []).map(charge => (
|
||||
<>
|
||||
<br />
|
||||
{charge.name} ¥{charge.amount}
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{row.material?.source === 'pool' ? (
|
||||
'当日加权料池'
|
||||
) : (
|
||||
<>
|
||||
手填 ¥{row.material?.rate ?? '未提供'}/克
|
||||
<br />
|
||||
{priceLockPayerName(row.material?.payer)}
|
||||
</>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
手填 ¥{row.material?.rate ?? '未提供'}/克
|
||||
<br />
|
||||
{priceLockPayerName(row.material?.payer)}
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
<p>
|
||||
客户实际付款 ¥{value.payment?.amount ?? '未提供'} · {accountDisplayName(value.payment?.account || '')} ·
|
||||
@@ -861,9 +848,9 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
function changeDetail(result: LockChange, canReview: boolean) {
|
||||
return (
|
||||
<>
|
||||
<button className={'dialog-close'} data-action={'price-lock-changes-close'} aria-label={'关闭'}>
|
||||
<LedgerButton className={'dialog-close'} data-action={'price-lock-changes-close'} aria-label={'关闭'}>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<div className={'eyebrow'}>PRICE LOCK REVIEW</div>
|
||||
<h2>{result.action === 'cancel' ? '录错作废' : '整单修改'}申请</h2>
|
||||
<p>
|
||||
@@ -912,12 +899,17 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
<form id={'price-lock-review-form'}>
|
||||
<label>
|
||||
复核备注
|
||||
<textarea name={'review_note'} maxLength={240} rows={2} placeholder={'驳回时必填'}></textarea>
|
||||
<LedgerTextArea
|
||||
name={'review_note'}
|
||||
maxLength={240}
|
||||
rows={2}
|
||||
placeholder={'驳回时必填'}
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
{canReview ? (
|
||||
<>
|
||||
<label className={'check'}>
|
||||
<input type={'checkbox'} name={'verified'} />
|
||||
<LedgerInput type={'checkbox'} name={'verified'} />
|
||||
已逐件核对商品、收款、购料与关联影响,确认批准本次申请。
|
||||
</label>
|
||||
</>
|
||||
@@ -927,16 +919,16 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
<div className={'actions'}>
|
||||
{canReview ? (
|
||||
<>
|
||||
<button className={'primary'} name={'decision'} value={'approve'} type={'submit'}>
|
||||
<LedgerButton className={'primary'} name={'decision'} value={'approve'} type={'submit'}>
|
||||
批准申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
<button className={'danger'} name={'decision'} value={'reject'} type={'submit'}>
|
||||
<LedgerButton className={'danger'} name={'decision'} value={'reject'} type={'submit'}>
|
||||
驳回申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id={'price-lock-action-error'} aria-live={'polite'}></div>
|
||||
</form>
|
||||
@@ -951,51 +943,41 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
return result.rows.length ? (
|
||||
<>
|
||||
<div className={'table-wrap'}>
|
||||
<table className={'price-lock-change-list'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原锁价单/客户</th>
|
||||
<th>申请</th>
|
||||
<th>申请人/日期</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.rows.map(row => (
|
||||
<>
|
||||
<tr>
|
||||
<td>
|
||||
{row.number || row.before?.number || '锁价单'}
|
||||
<div className={'small muted'}>{row.customer || row.before?.customer || ''}</div>
|
||||
</td>
|
||||
<td>
|
||||
{row.action === 'cancel' ? '录错作废' : '修改整单'}
|
||||
<div className={'small muted'}>{row.reason || ''}</div>
|
||||
</td>
|
||||
<td>
|
||||
{row.requester_name || row.requester || ''}
|
||||
<div className={'small muted'}>{row.created || ''}</div>
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
pending: '待店主复核',
|
||||
approved: '已批准',
|
||||
rejected: '已驳回',
|
||||
}[row.status] || row.status}
|
||||
</td>
|
||||
<td>
|
||||
{button('查看申请', 'price-lock-change-open', '', {
|
||||
'data-id': row.requestId || row.id,
|
||||
})}
|
||||
</td>
|
||||
</tr>
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className={'price-lock-change-list'}
|
||||
columns={[
|
||||
{ title: '原锁价单/客户' },
|
||||
{ title: '申请' },
|
||||
{ title: '申请人/日期' },
|
||||
{ title: '状态' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={result.rows.map((row, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
{row.number || row.before?.number || '锁价单'}
|
||||
<div className={'small muted'}>{row.customer || row.before?.customer || ''}</div>
|
||||
</>,
|
||||
<>
|
||||
{row.action === 'cancel' ? '录错作废' : '修改整单'}
|
||||
<div className={'small muted'}>{row.reason || ''}</div>
|
||||
</>,
|
||||
<>
|
||||
{row.requester_name || row.requester || ''}
|
||||
<div className={'small muted'}>{row.created || ''}</div>
|
||||
</>,
|
||||
{
|
||||
pending: '待店主复核',
|
||||
approved: '已批准',
|
||||
rejected: '已驳回',
|
||||
}[row.status] || row.status,
|
||||
button('查看申请', 'price-lock-change-open', '', {
|
||||
'data-id': row.requestId || row.id,
|
||||
}),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
@@ -1019,9 +1001,9 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
);
|
||||
}
|
||||
const button = (text: string, action: string, cls = '', props: Record<string, string | boolean | null> = {}) => (
|
||||
<button type="button" data-action={action} className={cls} {...props}>
|
||||
<LedgerButton type="button" data-action={action} className={cls} {...props}>
|
||||
{text}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
const materialSourceSegmentsText = (sources: SourceDescription[]) => describeMaterialSources(sources, teamMemberName);
|
||||
function priceLockMaterialAllocations(lock: LockRecord) {
|
||||
@@ -1120,85 +1102,72 @@ export function lockViews(state: LedgerState, session: SessionInfo) {
|
||||
return result.rows.length ? (
|
||||
<>
|
||||
<div className={'table-wrap'}>
|
||||
<table className={'price-lock-list'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>锁价日期/客户</th>
|
||||
<th>黄金商品</th>
|
||||
<th className={'number'}>锁定克重</th>
|
||||
<th className={'number'}>销售金价</th>
|
||||
<th className={'number'}>已收净额</th>
|
||||
<th>{status === 'cancelled' ? '原录入成本(已撤销记账)' : '原料来源/成本'}</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.rows.map(lock => (
|
||||
<>
|
||||
<tr>
|
||||
<td>
|
||||
{lock.date}
|
||||
<br />
|
||||
{lock.customer}
|
||||
</td>
|
||||
<td>
|
||||
{priceLockLines(lock)
|
||||
.map(row => row.line?.name || '黄金')
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <br />}
|
||||
{part}
|
||||
</Fragment>
|
||||
))}
|
||||
</td>
|
||||
<td className={'number'}>
|
||||
{grams(priceLockLines(lock).reduce((sum, row) => sum + row.locked_mg, 0))}g
|
||||
</td>
|
||||
<td className={'number'}>
|
||||
{priceLockLines(lock)
|
||||
.map(row => '¥' + yuan(row.sell_rate) + '/克')
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <br />}
|
||||
{part}
|
||||
</Fragment>
|
||||
))}
|
||||
</td>
|
||||
<td className={'number'}>¥{yuan(lock.netReceived)}</td>
|
||||
<td>
|
||||
{priceLockLines(lock)
|
||||
.map(row => renderPriceLockItemFacts(row))
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <hr className="lock-row-divider" />}
|
||||
{part}
|
||||
</Fragment>
|
||||
))}
|
||||
</td>
|
||||
<td>
|
||||
<div className={'actions'}>
|
||||
{button('查看', 'open-price-lock', '', {
|
||||
'data-id': lock.id,
|
||||
})}
|
||||
{lock.status === 'pending' ? (
|
||||
<>
|
||||
{button('交付', 'deliver-price-lock', 'primary', {
|
||||
'data-id': lock.id,
|
||||
})}
|
||||
{renderPriceLockPendingButtons(lock)}
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className={'price-lock-list'}
|
||||
columns={[
|
||||
{ title: '锁价日期/客户' },
|
||||
{ title: '黄金商品' },
|
||||
{ title: '锁定克重', headerClassName: 'number' },
|
||||
{ title: '销售金价', headerClassName: 'number' },
|
||||
{ title: '已收净额', headerClassName: 'number' },
|
||||
{ title: status === 'cancelled' ? '原录入成本(已撤销记账)' : '原料来源/成本' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={result.rows.map((lock, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'number', 'number', 'number', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
{lock.date}
|
||||
<br />
|
||||
{lock.customer}
|
||||
</>,
|
||||
priceLockLines(lock)
|
||||
.map(row => row.line?.name || '黄金')
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <br />}
|
||||
{part}
|
||||
</Fragment>
|
||||
)),
|
||||
<>{grams(priceLockLines(lock).reduce((sum, row) => sum + row.locked_mg, 0))}g</>,
|
||||
priceLockLines(lock)
|
||||
.map(row => '¥' + yuan(row.sell_rate) + '/克')
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <br />}
|
||||
{part}
|
||||
</Fragment>
|
||||
)),
|
||||
<>¥{yuan(lock.netReceived)}</>,
|
||||
priceLockLines(lock)
|
||||
.map(row => renderPriceLockItemFacts(row))
|
||||
.map((part, i) => (
|
||||
<Fragment key={i}>
|
||||
{i > 0 && <hr className="lock-row-divider" />}
|
||||
{part}
|
||||
</Fragment>
|
||||
)),
|
||||
<>
|
||||
<div className={'actions'}>
|
||||
{button('查看', 'open-price-lock', '', {
|
||||
'data-id': lock.id,
|
||||
})}
|
||||
{lock.status === 'pending' ? (
|
||||
<>
|
||||
{button('交付', 'deliver-price-lock', 'primary', {
|
||||
'data-id': lock.id,
|
||||
})}
|
||||
{renderPriceLockPendingButtons(lock)}
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</div>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
) : status === 'cancelled' ? (
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { LedgerClient } from '../../lib/api';
|
||||
import type { LedgerState, SessionInfo, LockCostEstimate } from '../../shared';
|
||||
import type { Allocation, Impact } from '../MaterialPools/model';
|
||||
import type { QuoteBalance, QuoteEntry, QuoteSource } from '../../lib/materialQuote';
|
||||
import type { SavedPayment } from './formParts';
|
||||
import type { SavedPayment } from './formValues';
|
||||
import type { lockViews } from './lockViews';
|
||||
|
||||
export interface LockProps {
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { LockViews, PreviewRow } from './types';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Calc, Model } from '../../shared';
|
||||
import { validatePools, poolRows } from '../MaterialPools/model';
|
||||
import { safeEstimate } from './formParts';
|
||||
import { safeEstimate } from './formValues';
|
||||
|
||||
// 公共料池以采购付款顺序分摊。先扣已用与本单前序行,余款才归本行。
|
||||
function publicQuote(pool: Pool | undefined, entries: QuoteEntry[], all: Pool[], state: LedgerState): PreviewRow[] {
|
||||
|
||||
@@ -4,7 +4,8 @@ type Cell = string | number | null | undefined;
|
||||
import { Model } from '../../shared';
|
||||
import { yuan } from '../../lib/format';
|
||||
import { count as stockCountText } from '../Inventory/data';
|
||||
import { rowLabel } from './controls';
|
||||
import { rowLabel } from './presentation';
|
||||
import { LedgerDataTable } from '../../components/BusinessControls';
|
||||
export function Comparison({ request, state }: { request: ChangeRequest; state: LedgerState }) {
|
||||
const before = request.before,
|
||||
after = request.after,
|
||||
@@ -212,24 +213,19 @@ export function Comparison({ request, state }: { request: ChangeRequest; state:
|
||||
</p>
|
||||
)}
|
||||
<div className="table-wrap">
|
||||
<table aria-label="回收更正原值与申请值">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
<th>原值</th>
|
||||
<th>{request.action === 'cancel' ? '取消后' : '申请值'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map(([t, a, b]) => (
|
||||
<tr key={t} className={String(a ?? '') !== String(b ?? '') ? 'modified' : undefined}>
|
||||
<th scope="row">{t}</th>
|
||||
<td>{a == null || a === '' ? '未提供' : a}</td>
|
||||
<td>{b == null || b === '' ? '未提供' : b}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
aria-label="回收更正原值与申请值"
|
||||
columns={[
|
||||
{ title: '核对项目', rowScope: 'row' },
|
||||
{ title: '原值' },
|
||||
{ title: request.action === 'cancel' ? '取消后' : '申请值' },
|
||||
]}
|
||||
rows={rows.map(([t, a, b]) => ({
|
||||
key: t,
|
||||
attributes: { className: String(a ?? '') !== String(b ?? '') ? 'modified' : undefined },
|
||||
cells: [t, a == null || a === '' ? '未提供' : a, b == null || b === '' ? '未提供' : b],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -5,14 +5,7 @@ import type { FormEvent } from 'react';
|
||||
import type { PageProps, RecoveryModel, DepositListData } from './types';
|
||||
import { useState } from 'react';
|
||||
import { grams } from '../../lib/format';
|
||||
export function validateDeposits(r: DepositListData) {
|
||||
if (
|
||||
!Array.isArray(r.rows) ||
|
||||
!Number.isSafeInteger(r.remainingMg) ||
|
||||
r.rows.some(i => !Number.isSafeInteger(i.remainingMg) || i.remainingMg < 0 || !Array.isArray(i.events))
|
||||
)
|
||||
throw new Error('寄存资料未完整返回');
|
||||
}
|
||||
import { LedgerButton, LedgerInput, LedgerTable } from '../../components/BusinessControls';
|
||||
export function DepositList({
|
||||
data,
|
||||
error,
|
||||
@@ -29,19 +22,19 @@ export function DepositList({
|
||||
<div className="panel-title">
|
||||
<h2>客户寄存料</h2>
|
||||
<div>
|
||||
<button data-action="customer-material-new" onClick={start}>
|
||||
<LedgerButton data-action="customer-material-new" onClick={start}>
|
||||
寄存,暂不结算
|
||||
</button>
|
||||
<button data-action="customer-material-refresh" onClick={refresh}>
|
||||
</LedgerButton>
|
||||
<LedgerButton data-action="customer-material-refresh" onClick={refresh}>
|
||||
刷新寄存记录
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<p>公共寄存台账,仅按克重和备忘记录;不计入自有库存、购料成本或可用料池。</p>
|
||||
<div id="customer-material-list">
|
||||
{error ? (
|
||||
<div>
|
||||
{error} <button onClick={refresh}>重新读取</button>
|
||||
{error} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : !data ? (
|
||||
'正在读取寄存记录…'
|
||||
@@ -53,7 +46,7 @@ export function DepositList({
|
||||
{'\u3000'}已用于置换<strong>{grams(data.usedMg)}g</strong>
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<LedgerTable>
|
||||
<thead>
|
||||
<tr>
|
||||
{['日期/寄存号', '备忘', '寄存', '已用', '剩余', '经办人/记录'].map(t => (
|
||||
@@ -97,7 +90,7 @@ export function DepositList({
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -143,11 +136,11 @@ export function DepositForm({ client, state, model, saved }: PageProps & { model
|
||||
<div className="recovery-row">
|
||||
<label>
|
||||
寄存日期
|
||||
<input type="date" name="date" defaultValue={draft.date || state.today} required max={state.today} />
|
||||
<LedgerInput type="date" name="date" defaultValue={draft.date || state.today} required max={state.today} />
|
||||
</label>
|
||||
<label>
|
||||
寄存克重(g)
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name="grams"
|
||||
defaultValue={draft.grams || ''}
|
||||
@@ -159,7 +152,7 @@ export function DepositForm({ client, state, model, saved }: PageProps & { model
|
||||
</label>
|
||||
<label>
|
||||
备忘
|
||||
<input
|
||||
<LedgerInput
|
||||
type="text"
|
||||
name="memo"
|
||||
defaultValue={draft.memo || ''}
|
||||
@@ -170,16 +163,16 @@ export function DepositForm({ client, state, model, saved }: PageProps & { model
|
||||
</label>
|
||||
<label>
|
||||
经办人
|
||||
<input value={state.user.label || state.user.name} readOnly />
|
||||
<LedgerInput value={state.user.label || state.user.name} readOnly />
|
||||
</label>
|
||||
</div>
|
||||
<label>
|
||||
<input type="checkbox" name="verified" required defaultChecked={!!draft.verified} />
|
||||
<LedgerInput type="checkbox" name="verified" required defaultChecked={!!draft.verified} />
|
||||
已确认寄存克重和备忘,本次不结算
|
||||
</label>
|
||||
<button className="primary" type="submit" disabled={client.busy || !!client.pending()}>
|
||||
<LedgerButton className="primary" type="submit" disabled={client.busy || !!client.pending()}>
|
||||
保存寄存记录
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<div id="customer-material-error">{error}</div>
|
||||
</form>
|
||||
);
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
ExtraKinds,
|
||||
PoolChoice,
|
||||
} from './types';
|
||||
import type { Choice } from './controls';
|
||||
import type { Choice } from './presentation';
|
||||
interface Fields {
|
||||
text(title: string, key: TextField, limit: number, props?: InputHTMLAttributes<HTMLInputElement>): ReactNode;
|
||||
num(title: string, key: TextField, places?: number, props?: InputHTMLAttributes<HTMLInputElement>): ReactNode;
|
||||
@@ -27,8 +27,10 @@ interface Fields {
|
||||
}
|
||||
import { Model } from '../../shared';
|
||||
import { grams } from '../../lib/format';
|
||||
import { pocketOptions, Settlement, money } from './controls';
|
||||
import { Settlement } from './controls';
|
||||
import { pocketOptions, money } from './presentation';
|
||||
import { describeMaterialSources } from '../../lib/materialQuote';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
// 早期的置换单按每件新货分别核算来料、差重和余料。修改时沿用原单结构。
|
||||
export function IndependentItems({
|
||||
@@ -86,14 +88,14 @@ export function IndependentItems({
|
||||
<section className="panel" key={i} data-recovery-item={i} data-recovery-product={i ? index : undefined}>
|
||||
<h2>置换商品 {i + 1}</h2>
|
||||
{i > 0 && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-remove-product"
|
||||
data-index={index}
|
||||
onClick={() => remove(index)}
|
||||
>
|
||||
移除商品
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<div className="recovery-row">
|
||||
{f.select('旧料来源', 'old_source', [
|
||||
@@ -173,14 +175,14 @@ export function IndependentItems({
|
||||
{f.num('折旧费单价(元/g)', 'depreciation_rate', 2, { required: true })}
|
||||
{f.num('折旧计费克重(g,可改)', 'depreciation_weight', 3, { required: true })}
|
||||
</div>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-item-reset-depreciation"
|
||||
data-index={i}
|
||||
onClick={() => setField('depreciation_manual', false, index)}
|
||||
>
|
||||
恢复本件默认折旧克重
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<div hidden={!hasBuy}>
|
||||
<h3>本件余料处理</h3>
|
||||
{f.select(
|
||||
@@ -201,14 +203,14 @@ export function IndependentItems({
|
||||
<div hidden={saveSurplus}>
|
||||
{f.rateField('回收单价(元/g)', 'buy_rate', true, { disabled: !hasBuy || saveSurplus })}
|
||||
{f.num('余料回收款(元,可改)', 'buy_total', 2, { required: true, disabled: !hasBuy || saveSurplus })}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-item-reset-buy"
|
||||
disabled={!hasBuy || saveSurplus}
|
||||
onClick={() => setField('buy_total_manual', false, index)}
|
||||
>
|
||||
恢复本件自动回收款
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<h3>本件内部成本</h3>
|
||||
@@ -282,9 +284,9 @@ export function IndependentItems({
|
||||
</section>
|
||||
);
|
||||
})}
|
||||
<button type="button" data-action="recovery-add-product" onClick={add}>
|
||||
<LedgerButton type="button" data-action="recovery-add-product" onClick={add}>
|
||||
+ 添加置换新货
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<section className="panel">
|
||||
<h3>整单收费与费用</h3>
|
||||
<div className="recovery-row">
|
||||
|
||||
@@ -17,8 +17,17 @@ import { useCallback, useState } from 'react';
|
||||
import { Model } from '../../shared';
|
||||
import { grams } from '../../lib/format';
|
||||
import { useRead, dateValid, count } from '../Inventory/data';
|
||||
import { LegacyCount, Modal, Settlement, money, options, rowLabel } from './controls';
|
||||
import { LegacyCount, Modal, Settlement } from './controls';
|
||||
import { money, options, rowLabel } from './presentation';
|
||||
import { Comparison } from './Comparison';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTable,
|
||||
LedgerTextArea,
|
||||
} from '../../components/BusinessControls';
|
||||
const modes = { direct: '直接回收', exchange: '置换' };
|
||||
const status = (r: ChangeRequest) =>
|
||||
({ pending: '待店主复核', approved: r.action === 'cancel' ? '已同意取消' : '已同意修改', rejected: '已驳回' })[
|
||||
@@ -27,9 +36,9 @@ const status = (r: ChangeRequest) =>
|
||||
const print = (id: string) => window.open('/print/recoveries/' + encodeURIComponent(id), '_blank', 'noopener');
|
||||
export function PrintButton({ id, title = '客户预览/打印' }: { id: string; title?: string }) {
|
||||
return (
|
||||
<button data-action="recovery-print" data-id={id} onClick={() => print(id)}>
|
||||
<LedgerButton data-action="recovery-print" data-id={id} onClick={() => print(id)}>
|
||||
{title}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
function PrintBadge({ row, statuses }: { row: SummaryRow; statuses: PrintStatuses }) {
|
||||
@@ -81,9 +90,9 @@ export function Records({
|
||||
<section className="panel" id="recovery-history">
|
||||
<div className="panel-title">
|
||||
<h2>回收/置换记录</h2>
|
||||
<button data-action="recovery-refresh-list" onClick={() => retry(n => n + 1)}>
|
||||
<LedgerButton data-action="recovery-refresh-list" onClick={() => retry(n => n + 1)}>
|
||||
刷新记录
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<form
|
||||
id="recovery-filter-form"
|
||||
@@ -101,7 +110,7 @@ export function Records({
|
||||
).map(([k, t]) => (
|
||||
<label key={k}>
|
||||
{t}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
required
|
||||
max={state.today}
|
||||
@@ -113,25 +122,29 @@ export function Records({
|
||||
))}
|
||||
<label>
|
||||
业务类型
|
||||
<select name="mode" value={draft.mode} onChange={e => setDraft({ ...draft, mode: e.target.value })}>
|
||||
<LedgerSelect name="mode" value={draft.mode} onChange={e => setDraft({ ...draft, mode: e.target.value })}>
|
||||
{options([['', '全部'], ...Object.entries(modes)])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
{state.user.role === 'owner' && (
|
||||
<label>
|
||||
归属成员
|
||||
<select name="member" value={draft.member} onChange={e => setDraft({ ...draft, member: e.target.value })}>
|
||||
<LedgerSelect
|
||||
name="member"
|
||||
value={draft.member}
|
||||
onChange={e => setDraft({ ...draft, member: e.target.value })}
|
||||
>
|
||||
{options([['', '全部成员'], ...Model.memberOptions(state)])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
)}
|
||||
<button type="submit">查询</button>
|
||||
<LedgerButton type="submit">查询</LedgerButton>
|
||||
</form>
|
||||
<div id="recovery-list">
|
||||
{!valid || r?.error ? (
|
||||
<div>
|
||||
{r?.error || '日期请选今天或之前,开始日期不能晚于结束日期。'}{' '}
|
||||
<button onClick={() => retry(n => n + 1)}>重新读取</button>
|
||||
<LedgerButton onClick={() => retry(n => n + 1)}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : !r ? (
|
||||
'正在读取回收/置换记录…'
|
||||
@@ -141,46 +154,47 @@ export function Records({
|
||||
</p>
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['日期/单号', '客户/开单人', '类型/归属', '折后旧重', '新货克重', '实际收付', '操作'].map(t => (
|
||||
<th key={t}>{t}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{r.value!.rows.map(v => (
|
||||
<tr key={v.id}>
|
||||
<td>
|
||||
{v.date}
|
||||
<div>{v.number}</div>
|
||||
</td>
|
||||
<td>
|
||||
{v.customer}
|
||||
<div>{v.salesperson}</div>
|
||||
</td>
|
||||
<td>
|
||||
{modes[v.mode]}
|
||||
<div>{Model.memberName(state, v.member)}</div>
|
||||
</td>
|
||||
<td>{grams(v.oldMg)}g</td>
|
||||
<td>{v.mode === 'exchange' ? grams(v.newMg) + 'g' : '—'}</td>
|
||||
<td>
|
||||
{v.netSettlement > 0 ? '客户补款' : v.netSettlement < 0 ? '店里付款' : '无需现金'}
|
||||
<div>{money(Math.abs(v.netSettlement))}</div>
|
||||
</td>
|
||||
<td>
|
||||
<PrintBadge row={v} statuses={printStatuses} />
|
||||
<button data-action="recovery-open" data-id={v.id} onClick={() => detail(v.id)}>
|
||||
查看
|
||||
</button>
|
||||
<PrintButton title="打印" id={v.id} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '日期/单号' },
|
||||
{ title: '客户/开单人' },
|
||||
{ title: '类型/归属' },
|
||||
{ title: '折后旧重' },
|
||||
{ title: '新货克重' },
|
||||
{ title: '实际收付' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={r.value!.rows.map(v => ({
|
||||
key: v.id,
|
||||
cells: [
|
||||
<>
|
||||
{v.date}
|
||||
<div>{v.number}</div>
|
||||
</>,
|
||||
<>
|
||||
{v.customer}
|
||||
<div>{v.salesperson}</div>
|
||||
</>,
|
||||
<>
|
||||
{modes[v.mode]}
|
||||
<div>{Model.memberName(state, v.member)}</div>
|
||||
</>,
|
||||
<>{grams(v.oldMg)}g</>,
|
||||
v.mode === 'exchange' ? grams(v.newMg) + 'g' : '—',
|
||||
<>
|
||||
{v.netSettlement > 0 ? '客户补款' : v.netSettlement < 0 ? '店里付款' : '无需现金'}
|
||||
<div>{money(Math.abs(v.netSettlement))}</div>
|
||||
</>,
|
||||
<>
|
||||
<PrintBadge row={v} statuses={printStatuses} />
|
||||
<LedgerButton data-action="recovery-open" data-id={v.id} onClick={() => detail(v.id)}>
|
||||
查看
|
||||
</LedgerButton>
|
||||
<PrintButton title="打印" id={v.id} />
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -263,7 +277,7 @@ export function Detail({
|
||||
<Modal id="recovery-dialog" title={v?.customer || '回收/置换单'} action="recovery-close" close={close}>
|
||||
{response?.error ? (
|
||||
<div>
|
||||
{response.error} <button onClick={() => retry(n => n + 1)}>重新读取</button>
|
||||
{response.error} <LedgerButton onClick={() => retry(n => n + 1)}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : !v || !data ? (
|
||||
<p>正在读取单据…</p>
|
||||
@@ -276,14 +290,14 @@ export function Detail({
|
||||
<small>点击客户预览里的“打印”后自动记录。</small>
|
||||
<div className="actions">
|
||||
{data.permissions.canEdit && (
|
||||
<button data-id={id} data-action="recovery-edit-open" onClick={() => edit(id)}>
|
||||
<LedgerButton data-id={id} data-action="recovery-edit-open" onClick={() => edit(id)}>
|
||||
修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{data.permissions.canCancel && (
|
||||
<button data-id={id} data-action="recovery-edit-cancel" onClick={() => cancel(id)}>
|
||||
<LedgerButton data-id={id} data-action="recovery-edit-cancel" onClick={() => cancel(id)}>
|
||||
取消这笔记录
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<PrintButton id={id} />
|
||||
{v.order_id && (
|
||||
@@ -302,26 +316,25 @@ export function Detail({
|
||||
</p>
|
||||
))}
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['旧料', '来料(g)', '熔后(g)', '成色', '折后(g)'].map(t => (
|
||||
<th key={t}>{t}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{v.old_lines.map((r, i) => (
|
||||
<tr key={i}>
|
||||
<td>{r.name || 'Au旧料'}</td>
|
||||
<td>{grams(r.incomingMg)}</td>
|
||||
<td>{grams(r.meltedMg)}</td>
|
||||
<td>{r.purity}%</td>
|
||||
<td>{grams(r.foldedMg)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '旧料' },
|
||||
{ title: '来料(g)' },
|
||||
{ title: '熔后(g)' },
|
||||
{ title: '成色' },
|
||||
{ title: '折后(g)' },
|
||||
]}
|
||||
rows={v.old_lines.map((r, i) => ({
|
||||
key: i,
|
||||
cells: [
|
||||
r.name || 'Au旧料',
|
||||
grams(r.incomingMg),
|
||||
grams(r.meltedMg),
|
||||
<>{r.purity}%</>,
|
||||
grams(r.foldedMg),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
<section className="panel">
|
||||
@@ -413,9 +426,9 @@ export function Detail({
|
||||
<h3>待店主复核</h3>
|
||||
<p>原记录仍生效,申请尚未记账。</p>
|
||||
<Comparison request={data.pending} state={state} />
|
||||
<button data-action="recovery-change-open" onClick={() => review(data.pending!.id)}>
|
||||
<LedgerButton data-action="recovery-change-open" onClick={() => review(data.pending!.id)}>
|
||||
{state.user.role === 'owner' ? '查看并复核' : '查看申请'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</section>
|
||||
)}
|
||||
{!!data.history.length && (
|
||||
@@ -424,9 +437,9 @@ export function Detail({
|
||||
{data.history.map(h => (
|
||||
<p key={h.id}>
|
||||
{status(h)} · {h.reason}{' '}
|
||||
<button data-action="recovery-change-open" onClick={() => review(h.id)}>
|
||||
<LedgerButton data-action="recovery-change-open" onClick={() => review(h.id)}>
|
||||
查看申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</p>
|
||||
))}
|
||||
</details>
|
||||
@@ -543,7 +556,7 @@ export function ChangeDialog({
|
||||
>
|
||||
{reply?.error ? (
|
||||
<div>
|
||||
{reply.error} <button onClick={reread}>重新读取</button>
|
||||
{reply.error} <LedgerButton onClick={reread}>重新读取</LedgerButton>
|
||||
</div>
|
||||
) : !r ? (
|
||||
'正在读取…'
|
||||
@@ -558,7 +571,7 @@ export function ChangeDialog({
|
||||
['all', '全部'],
|
||||
] as const
|
||||
).map(([k, t]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={k}
|
||||
data-action="recovery-changes-filter"
|
||||
data-status={k}
|
||||
@@ -567,10 +580,10 @@ export function ChangeDialog({
|
||||
>
|
||||
{t}
|
||||
{k !== 'all' && '(' + r.counts[k] + ')'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
<table>
|
||||
<LedgerTable>
|
||||
<thead>
|
||||
<tr>
|
||||
{['原记录', '动作', '申请人', '状态', '操作'].map(t => (
|
||||
@@ -588,9 +601,12 @@ export function ChangeDialog({
|
||||
<td>{row.requesterName}</td>
|
||||
<td>{status(row)}</td>
|
||||
<td>
|
||||
<button data-action="recovery-change-open" onClick={() => select({ kind: 'request', id: row.id })}>
|
||||
<LedgerButton
|
||||
data-action="recovery-change-open"
|
||||
onClick={() => select({ kind: 'request', id: row.id })}
|
||||
>
|
||||
查看
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
@@ -600,7 +616,7 @@ export function ChangeDialog({
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
) : 'permissions' in r ? (
|
||||
<>
|
||||
@@ -613,25 +629,25 @@ export function ChangeDialog({
|
||||
<LegacyCount value={r.permissions} />
|
||||
<label>
|
||||
取消原因
|
||||
<textarea name="reason" required maxLength={200} rows={2} />
|
||||
<LedgerTextArea name="reason" required maxLength={200} rows={2} />
|
||||
</label>
|
||||
<label>
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实这笔记录需要取消,并核对关联用料自动重算与实际收付款。
|
||||
</label>
|
||||
<button type="button" data-action="recovery-changes-close" onClick={close}>
|
||||
<LedgerButton type="button" data-action="recovery-changes-close" onClick={close}>
|
||||
返回
|
||||
</button>
|
||||
<button type="submit" disabled={stale || client.busy || !!client.pending()}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" disabled={stale || client.busy || !!client.pending()}>
|
||||
{r.permissions.requiresApproval ? '提交取消申请' : '确认取消记录'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</form>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<button data-action="recovery-changes-open" onClick={() => select({ kind: 'list' })}>
|
||||
<LedgerButton data-action="recovery-changes-open" onClick={() => select({ kind: 'list' })}>
|
||||
返回申请列表
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<p>
|
||||
{status(r)} · {r.requesterName}提交{r.reviewerName && ' · ' + r.reviewerName + '复核'}
|
||||
</p>
|
||||
@@ -645,40 +661,40 @@ export function ChangeDialog({
|
||||
{!decision ? (
|
||||
<>
|
||||
{r.canApprove && !r.stale && (
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="recovery-change-decision"
|
||||
data-kind="approve"
|
||||
onClick={() => setDecision('approve')}
|
||||
>
|
||||
同意申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="recovery-change-decision"
|
||||
data-kind="reject"
|
||||
onClick={() => setDecision('reject')}
|
||||
>
|
||||
驳回申请
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
) : (
|
||||
<form id="recovery-change-review-form" data-kind={decision} onSubmit={submit}>
|
||||
<label>
|
||||
{decision === 'reject' ? '驳回意见' : '复核备注(选填)'}
|
||||
<textarea name="note" maxLength={200} rows={2} required={decision === 'reject'} />
|
||||
<LedgerTextArea name="note" maxLength={200} rows={2} required={decision === 'reject'} />
|
||||
</label>
|
||||
{decision === 'approve' && (
|
||||
<label>
|
||||
<input name="verified" type="checkbox" required />
|
||||
<LedgerInput name="verified" type="checkbox" required />
|
||||
已核对申请内容及关联账务,确认同意。
|
||||
</label>
|
||||
)}
|
||||
<button type="button" onClick={() => setDecision('')}>
|
||||
<LedgerButton type="button" onClick={() => setDecision('')}>
|
||||
返回
|
||||
</button>
|
||||
<button type="submit" disabled={stale || client.busy || !!client.pending()}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="submit" disabled={stale || client.busy || !!client.pending()}>
|
||||
{decision === 'approve' ? '确认同意' : '确认驳回'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
@@ -687,7 +703,7 @@ export function ChangeDialog({
|
||||
)}
|
||||
{message && (
|
||||
<p role="alert">
|
||||
{message} {stale && <button onClick={reread}>重新读取</button>}
|
||||
{message} {stale && <LedgerButton onClick={reread}>重新读取</LedgerButton>}
|
||||
</p>
|
||||
)}
|
||||
</Modal>
|
||||
|
||||
@@ -5,12 +5,13 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { useRead } from '../Inventory/data';
|
||||
import { useClientSnapshot } from '../../lib/useClient';
|
||||
import { usePrintStatuses } from '../../lib/printStatus';
|
||||
import { recoveryModel } from './model';
|
||||
import { recoveryModel, validateDeposits } from './model';
|
||||
import { Head } from './controls';
|
||||
import { RecoveryForm } from './RecoveryForm';
|
||||
import { DepositForm, DepositList, validateDeposits } from './Deposit';
|
||||
import { DepositForm, DepositList } from './Deposit';
|
||||
import { Records, Detail, ChangeDialog, PrintButton } from './Records';
|
||||
import './recoveries.css';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
const lastQuery = new WeakMap<LedgerClient, { user: string; value: Filters }>();
|
||||
export function RecoveriesPage({ client, state, search = window.location.search }: PageProps & { search?: string }) {
|
||||
@@ -133,7 +134,7 @@ export function RecoveriesPage({ client, state, search = window.location.search
|
||||
{page === 'deposit' ? (
|
||||
<>
|
||||
<Head eye="CUSTOMER MATERIAL" title="寄存,暂不结算" sub="只记已确认克重与备忘,不按当天金价结算。">
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="customer-material-back"
|
||||
onClick={() => {
|
||||
setPage('new');
|
||||
@@ -141,7 +142,7 @@ export function RecoveriesPage({ client, state, search = window.location.search
|
||||
}}
|
||||
>
|
||||
返回回收/置换
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</Head>
|
||||
<DepositForm
|
||||
key={formKey}
|
||||
@@ -172,13 +173,13 @@ export function RecoveriesPage({ client, state, search = window.location.search
|
||||
? '购料和回收旧料库存已经一并登记。'
|
||||
: '等重实物、补金差重和余料已按本单结算登记。'}
|
||||
</p>
|
||||
<button data-action="recovery-open" onClick={() => setDetail(result.r.id)}>
|
||||
<LedgerButton data-action="recovery-open" onClick={() => setDetail(result.r.id)}>
|
||||
查看已保存单据
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<PrintButton id={result.r.id} />
|
||||
<button data-action="recovery-new" onClick={newForm}>
|
||||
<LedgerButton data-action="recovery-new" onClick={newForm}>
|
||||
继续开另一单
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</section>
|
||||
</>
|
||||
) : (
|
||||
@@ -190,20 +191,20 @@ export function RecoveriesPage({ client, state, search = window.location.search
|
||||
>
|
||||
{!edit && (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="recovery-scroll-list"
|
||||
onClick={() => historyRef.current?.scrollIntoView({ behavior: 'smooth' })}
|
||||
>
|
||||
查看记录
|
||||
</button>
|
||||
<button
|
||||
</LedgerButton>
|
||||
<LedgerButton
|
||||
id="recovery-changes-entry"
|
||||
data-action="recovery-changes-open"
|
||||
onClick={() => select({ kind: 'list' })}
|
||||
>
|
||||
{state.user.role === 'owner' ? '回收更正复核' : '回收更正申请'}(
|
||||
{count?.value?.counts.pending ?? (count?.error ? '读取失败' : '…')})
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
)}
|
||||
</Head>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { recoveryDraftKey, recoveryEditKey } from './receipts';
|
||||
import { derive } from './derive';
|
||||
import type { ChangeEvent, FormEvent, InputHTMLAttributes, SelectHTMLAttributes } from 'react';
|
||||
import type { ApiError } from '../../lib/api';
|
||||
import type { Choice } from './controls';
|
||||
import type { Choice } from './presentation';
|
||||
import type {
|
||||
EditDetail,
|
||||
Draft,
|
||||
@@ -24,10 +24,12 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { Model, Cards } from '../../shared';
|
||||
import { grams } from '../../lib/format';
|
||||
import { memberAccountPrefix, recoveryModel } from './model';
|
||||
import { LegacyCount, Settlement, money, options, pocketOptions, rowLabel } from './controls';
|
||||
import { LegacyCount, Settlement } from './controls';
|
||||
import { money, options, pocketOptions, rowLabel } from './presentation';
|
||||
import { IndependentItems } from './IndependentItems';
|
||||
import { localMaterialNote, quotedMaterialNote } from './materialPreview';
|
||||
import { useRead } from '../Inventory/data';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
function RecoveryCardFee({ state, edit, net }: { state: PageProps['state']; edit: EditDetail | null; net: number }) {
|
||||
const rate = edit ? edit.record.credit_card_rate_permille : state.shopSettings?.creditCardRatePermille;
|
||||
@@ -48,6 +50,32 @@ function RecoveryCardFee({ state, edit, net }: { state: PageProps['state']; edit
|
||||
}
|
||||
|
||||
const basicMethods = ['微信', '支付宝', '现金'];
|
||||
function DailyRateButton({
|
||||
field,
|
||||
index,
|
||||
prefix,
|
||||
disabled,
|
||||
apply,
|
||||
}: {
|
||||
field: TextField;
|
||||
index: number;
|
||||
prefix: string;
|
||||
disabled: boolean;
|
||||
apply: (field: TextField, index: number) => Promise<void>;
|
||||
}) {
|
||||
return (
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-use-daily-rate"
|
||||
data-rate-field={prefix + field}
|
||||
disabled={disabled}
|
||||
onClick={() => void apply(field, index)}
|
||||
>
|
||||
使用当日加权料价
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
|
||||
export function RecoveryForm({
|
||||
client,
|
||||
state,
|
||||
@@ -252,7 +280,7 @@ export function RecoveryForm({
|
||||
) => (
|
||||
<label>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="text"
|
||||
{...attrs(k)}
|
||||
value={(index < 0 ? raw : raw.extra_products![index])[k] ?? ''}
|
||||
@@ -264,7 +292,7 @@ export function RecoveryForm({
|
||||
const num = (title: string, k: TextField, places = 2, props: InputHTMLAttributes<HTMLInputElement> = {}) => (
|
||||
<label>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
min="0"
|
||||
step={places === 3 ? '0.001' : '0.01'}
|
||||
@@ -282,15 +310,15 @@ export function RecoveryForm({
|
||||
) => (
|
||||
<label>
|
||||
{title}
|
||||
<select {...attrs(k)} {...props}>
|
||||
<LedgerSelect {...attrs(k)} {...props}>
|
||||
{options(choices)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
);
|
||||
const pairs = (title: string, k: TextField, pocket: string, visible = true, optional = false) => (
|
||||
<label hidden={!visible || !Model.pocketCountsEnabled(state, pocket)}>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
min="1"
|
||||
max="1000000000"
|
||||
@@ -308,15 +336,7 @@ export function RecoveryForm({
|
||||
{num(title, k, 2, { required: true, ...props })}
|
||||
{use && (
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
data-action="recovery-use-daily-rate"
|
||||
data-rate-field={prefix + k}
|
||||
disabled={off}
|
||||
onClick={() => daily(k, index)}
|
||||
>
|
||||
使用当日加权料价
|
||||
</button>
|
||||
<DailyRateButton field={k} index={index} prefix={prefix} disabled={off} apply={daily} />
|
||||
<p data-rate-status>{rate.name === k && rate.index === index ? rate.text : ''}</p>
|
||||
</>
|
||||
)}
|
||||
@@ -339,9 +359,14 @@ export function RecoveryForm({
|
||||
>
|
||||
<h3>置换新货 {index + 2}</h3>
|
||||
{index >= 0 && (
|
||||
<button type="button" data-action="recovery-remove-product" data-index={index} onClick={() => remove(index)}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-remove-product"
|
||||
data-index={index}
|
||||
onClick={() => remove(index)}
|
||||
>
|
||||
移除商品
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<div className="recovery-row">
|
||||
{f.text('新货商品', 'new_name', 60, { list: 'recovery-product-names', required: true })}
|
||||
@@ -458,11 +483,15 @@ export function RecoveryForm({
|
||||
: '费用名称'
|
||||
: t}
|
||||
{k === 'payer' ? (
|
||||
<select name={name} value={String(r[k] || '')} onChange={e => change(i + 1, k, e.target.value)}>
|
||||
<LedgerSelect
|
||||
name={name}
|
||||
value={String(r[k] || '')}
|
||||
onChange={e => change(i + 1, k, e.target.value)}
|
||||
>
|
||||
{options(members)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
) : (
|
||||
<input
|
||||
<LedgerInput
|
||||
name={name}
|
||||
type={number ? 'number' : 'text'}
|
||||
required
|
||||
@@ -478,7 +507,7 @@ export function RecoveryForm({
|
||||
</label>
|
||||
);
|
||||
})}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-edit-remove-row"
|
||||
data-kind={kind}
|
||||
@@ -486,25 +515,25 @@ export function RecoveryForm({
|
||||
onClick={() => updateRows(rows.filter((_, j) => j !== i + 1))}
|
||||
>
|
||||
移除这项
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
))}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-edit-add-row"
|
||||
data-kind={kind}
|
||||
onClick={() => updateRows([...(rows.length ? rows : [defaults]), { ...defaults }])}
|
||||
>
|
||||
+ 添加{caption}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<form id="recovery-form" data-recovery-edit={edit ? 'true' : undefined} onSubmit={submit}>
|
||||
{local.invalid !== null && <p role="alert">{unreadableDraft}</p>}
|
||||
<input type="hidden" name="mode" value={d.mode} />
|
||||
<input type="hidden" name="shared_old_notice" value={d.shared_old_notice || ''} />
|
||||
<LedgerInput type="hidden" name="mode" value={d.mode} />
|
||||
<LedgerInput type="hidden" name="shared_old_notice" value={d.shared_old_notice || ''} />
|
||||
{!edit && (
|
||||
<div className="actions">
|
||||
{(
|
||||
@@ -513,7 +542,7 @@ export function RecoveryForm({
|
||||
['exchange', '置换'],
|
||||
] as const
|
||||
).map(([mode, name]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
key={mode}
|
||||
data-action="recovery-mode"
|
||||
@@ -522,11 +551,11 @@ export function RecoveryForm({
|
||||
onClick={() => setRaw({ ...d, mode, buy_total_manual: false, buy_total: '', verified: false })}
|
||||
>
|
||||
{name}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
<button type="button" data-action="customer-material-new" onClick={deposit}>
|
||||
<LedgerButton type="button" data-action="customer-material-new" onClick={deposit}>
|
||||
寄存,暂不结算
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
<section className="panel">
|
||||
@@ -535,7 +564,7 @@ export function RecoveryForm({
|
||||
<div className="recovery-row">
|
||||
<label>
|
||||
业务日期
|
||||
<input type="date" {...attrs('date')} max={state.today} required />
|
||||
<LedgerInput type="date" {...attrs('date')} max={state.today} required />
|
||||
</label>
|
||||
{text('客户称呼/代号', 'customer', 60, { required: true, placeholder: '必填' })}
|
||||
{exchange && (
|
||||
@@ -546,7 +575,7 @@ export function RecoveryForm({
|
||||
['returning', '老客户'],
|
||||
].map(([k, t]) => (
|
||||
<label key={k}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={k}
|
||||
@@ -565,8 +594,8 @@ export function RecoveryForm({
|
||||
) : (
|
||||
<label>
|
||||
归属成员
|
||||
<input value={Model.memberName(state, d.member)} readOnly />
|
||||
<input type="hidden" name="member" value={d.member} />
|
||||
<LedgerInput value={Model.memberName(state, d.member)} readOnly />
|
||||
<LedgerInput type="hidden" name="member" value={d.member} />
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
@@ -679,9 +708,9 @@ export function RecoveryForm({
|
||||
</datalist>
|
||||
{product(d, -1)}
|
||||
{d.extra_products?.map((r, i) => product(r, i))}
|
||||
<button type="button" data-action="recovery-add-product" onClick={add} disabled={!exchange}>
|
||||
<LedgerButton type="button" data-action="recovery-add-product" onClick={add} disabled={!exchange}>
|
||||
+ 添加置换新货
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span>补金、折旧和余料按新货总克重结算;每件可选不同货盘或外配。</span>
|
||||
<h3>整单差重与折旧</h3>
|
||||
<div className="recovery-row">
|
||||
@@ -694,14 +723,14 @@ export function RecoveryForm({
|
||||
{num('折旧费单价(元/g)', 'depreciation_rate', 2, { required: true, disabled: !exchange })}
|
||||
{num('折旧计费克重(g,可改)', 'depreciation_weight', 3, { required: true, disabled: !exchange })}
|
||||
</div>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-reset-depreciation"
|
||||
disabled={!exchange}
|
||||
onClick={() => setField('depreciation_manual', false)}
|
||||
>
|
||||
恢复默认克重
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<details>
|
||||
<summary>其他收费与优惠(选填)</summary>
|
||||
<div className="recovery-row">
|
||||
@@ -761,14 +790,14 @@ export function RecoveryForm({
|
||||
required: true,
|
||||
disabled: !hasBuy || surplusDeposit,
|
||||
})}
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-reset-buy"
|
||||
disabled={!hasBuy || surplusDeposit}
|
||||
onClick={() => setField('buy_total_manual', false)}
|
||||
>
|
||||
恢复自动金额
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<p>
|
||||
{q
|
||||
@@ -885,7 +914,7 @@ export function RecoveryForm({
|
||||
{conflict && (
|
||||
<div>
|
||||
记录已有变动,填写已保留,请核对最新记录。
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-edit-reload"
|
||||
onClick={async () => {
|
||||
@@ -897,9 +926,9 @@ export function RecoveryForm({
|
||||
}}
|
||||
>
|
||||
重新读取并核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{conflict.latest && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-edit-keep"
|
||||
onClick={() => {
|
||||
@@ -909,7 +938,7 @@ export function RecoveryForm({
|
||||
}}
|
||||
>
|
||||
已核对最新记录,保留填写继续
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
@@ -917,7 +946,7 @@ export function RecoveryForm({
|
||||
)}
|
||||
{text('备注(选填,可打印)', 'note', 240)}
|
||||
<label>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="verified"
|
||||
required
|
||||
@@ -927,13 +956,13 @@ export function RecoveryForm({
|
||||
已核实重量、结算金额和实际收付款
|
||||
</label>
|
||||
{edit && (
|
||||
<button type="button" data-action="recovery-edit-close" onClick={exitEdit}>
|
||||
<LedgerButton type="button" data-action="recovery-edit-close" onClick={exitEdit}>
|
||||
取消修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button className="primary" id="recovery-save" type="submit" disabled={disabled || !!conflict}>
|
||||
<LedgerButton className="primary" id="recovery-save" type="submit" disabled={disabled || !!conflict}>
|
||||
{edit ? (approval ? '提交修改申请' : '保存修改') : '保存' + (exchange ? '置换' : '回收') + '单'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span id="recovery-quote-status" aria-live="polite">
|
||||
{signature ? (quote.signature === signature ? quote.text : '正在核对结算…') : ''}
|
||||
</span>
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import type { LedgerState } from '../../shared';
|
||||
import type { Draft, Input, Totals, Permission } from './types';
|
||||
export type Choice = string | readonly (string | boolean)[];
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { Model } from '../../shared';
|
||||
import { grams, yuan } from '../../lib/format';
|
||||
export const money = (value?: number | null) => (value == null ? '待填写' : '¥' + yuan(value));
|
||||
export const rowLabel = (s: LedgerState, key?: string) => s.pocketCatalog?.find(p => p.key === key)?.name || key;
|
||||
export function options(pairs: readonly Choice[]) {
|
||||
return pairs.map(opt => {
|
||||
const [value, text, disabled] = typeof opt === 'string' ? [opt, opt] : opt;
|
||||
return (
|
||||
<option key={String(value)} value={String(value)} disabled={!!disabled}>
|
||||
{text}
|
||||
</option>
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
import { money } from './presentation';
|
||||
import { grams } from '../../lib/format';
|
||||
import { LedgerButton, LedgerDialog, LedgerInput } from '../../components/BusinessControls';
|
||||
export function Head({ eye, title, sub, children }: { eye: string; title: string; sub: string; children?: ReactNode }) {
|
||||
return (
|
||||
<header className="page-heading">
|
||||
@@ -42,27 +29,26 @@ export function Modal({
|
||||
action: string;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const d = ref.current!;
|
||||
d.showModal();
|
||||
return () => d.close();
|
||||
}, []);
|
||||
return (
|
||||
<dialog
|
||||
ref={ref}
|
||||
<LedgerDialog
|
||||
id={id}
|
||||
onCancel={e => {
|
||||
e.preventDefault();
|
||||
close();
|
||||
}}
|
||||
>
|
||||
<button type="button" className="dialog-close" aria-label={'关闭' + title} data-action={action} onClick={close}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
aria-label={'关闭' + title}
|
||||
data-action={action}
|
||||
onClick={close}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id={id === 'recovery-dialog' ? 'recovery-detail-title' : 'recovery-change-title'}>{title}</h2>
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
export function Settlement({ q, draft, input }: { q?: Totals | null; draft?: Draft; input?: Partial<Input> | null }) {
|
||||
@@ -157,23 +143,12 @@ export function Settlement({ q, draft, input }: { q?: Totals | null; draft?: Dra
|
||||
</>
|
||||
);
|
||||
}
|
||||
export function pocketOptions(state: LedgerState, key: string, historical: boolean, blank?: string) {
|
||||
const active = Model.activePocketKeys(state),
|
||||
result: (string | boolean)[][] = active.map(p => [p, rowLabel(state, p) || p]);
|
||||
if (key && !active.includes(key))
|
||||
result.push([
|
||||
key,
|
||||
rowLabel(state, key) + (historical ? '(已停用 · 原货盘)' : '(已停用,请重新选择)'),
|
||||
!historical,
|
||||
]);
|
||||
return blank ? [['', blank], ...result] : result;
|
||||
}
|
||||
export function LegacyCount({ value }: { value?: Permission }) {
|
||||
return value?.requiresLegacyCountVerified ? (
|
||||
<>
|
||||
<p>{value.legacyCountNotice || '这笔历史记录未记录对数,当前对数按实际盘点基准保留。'}</p>
|
||||
<label>
|
||||
<input type="checkbox" name="legacyCountVerified" required />
|
||||
<LedgerInput type="checkbox" name="legacyCountVerified" required />
|
||||
已核对当前对数基准,理解本次更正对历史对数的处理
|
||||
</label>
|
||||
</>
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Input, Draft, EditDetail, Calculation, QuoteItem, MaterialPool, Re
|
||||
import { Calc, Model } from '../../shared';
|
||||
import { grams } from '../../lib/format';
|
||||
import { describeMaterialBalance, describeMaterialSources, validateMaterialQuote } from '../../lib/materialQuote';
|
||||
import { money } from './controls';
|
||||
import { money } from './presentation';
|
||||
|
||||
// 与结算报价分开读取料池余额。余额暂不可用时仍可核对已算出的来源、成本和结算。
|
||||
export async function quotedMaterialNote(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { LedgerState } from '../../shared';
|
||||
import type { EditDetail } from './types';
|
||||
import type { EditDetail, DepositListData } from './types';
|
||||
import RecoveryRules from '@public/recovery-rules.js';
|
||||
import { Model, Calc, Values } from '../../shared';
|
||||
import { countValue, dateValid as validOrderDate } from '../Inventory/data';
|
||||
@@ -24,3 +24,12 @@ export function recoveryModel(state: LedgerState, editData: EditDetail | null =
|
||||
isSilver: Calc.isSilver,
|
||||
});
|
||||
}
|
||||
|
||||
export function validateDeposits(r: DepositListData) {
|
||||
if (
|
||||
!Array.isArray(r.rows) ||
|
||||
!Number.isSafeInteger(r.remainingMg) ||
|
||||
r.rows.some(i => !Number.isSafeInteger(i.remainingMg) || i.remainingMg < 0 || !Array.isArray(i.events))
|
||||
)
|
||||
throw new Error('寄存资料未完整返回');
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import { Model, type LedgerState } from '../../shared';
|
||||
import { yuan } from '../../lib/format';
|
||||
export type Choice = string | readonly (string | boolean)[];
|
||||
export const money = (value?: number | null) => (value == null ? '待填写' : '¥' + yuan(value));
|
||||
export const rowLabel = (s: LedgerState, key?: string) => s.pocketCatalog?.find(p => p.key === key)?.name || key;
|
||||
export function options(pairs: readonly Choice[]) {
|
||||
return pairs.map(opt => {
|
||||
const [value, text, disabled] = typeof opt === 'string' ? [opt, opt] : opt;
|
||||
return (
|
||||
<option key={String(value)} value={String(value)} disabled={!!disabled}>
|
||||
{text}
|
||||
</option>
|
||||
);
|
||||
});
|
||||
}
|
||||
export function pocketOptions(state: LedgerState, key: string, historical: boolean, blank?: string) {
|
||||
const active = Model.activePocketKeys(state),
|
||||
result: (string | boolean)[][] = active.map(p => [p, rowLabel(state, p) || p]);
|
||||
if (key && !active.includes(key))
|
||||
result.push([
|
||||
key,
|
||||
rowLabel(state, key) + (historical ? '(已停用 · 原货盘)' : '(已停用,请重新选择)'),
|
||||
!historical,
|
||||
]);
|
||||
return blank ? [['', blank], ...result] : result;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
.recoveries-page {
|
||||
color: var(--ink, #233832);
|
||||
color: var(--ink, var(--ink));
|
||||
min-width: 0;
|
||||
}
|
||||
.recoveries-page [hidden] {
|
||||
@@ -14,13 +14,13 @@
|
||||
font-size: clamp(1.9rem, 4vw, 3rem);
|
||||
}
|
||||
.recoveries-page p {
|
||||
color: var(--muted, #596963);
|
||||
color: var(--muted, var(--muted));
|
||||
line-height: 1.55;
|
||||
}
|
||||
.recoveries-page .panel,
|
||||
.recoveries-page .stock-review-status {
|
||||
background: var(--surface, #fff);
|
||||
border: 1px solid var(--line, #dce4df);
|
||||
background: var(--surface, var(--white));
|
||||
border: 1px solid var(--line, var(--border));
|
||||
border-radius: 12px;
|
||||
padding: 18px;
|
||||
margin-block: 14px;
|
||||
@@ -64,7 +64,7 @@
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 8px;
|
||||
border: 1px solid #b9c6bf;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
color: inherit;
|
||||
background: white;
|
||||
@@ -78,7 +78,7 @@
|
||||
}
|
||||
.recoveries-page button {
|
||||
cursor: pointer;
|
||||
border: 1px solid #b9c6bf;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 7px;
|
||||
background: white;
|
||||
color: inherit;
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
.recoveries-page .primary,
|
||||
.recoveries-page button[aria-pressed='true'] {
|
||||
background: #254f46;
|
||||
background: var(--green);
|
||||
color: white;
|
||||
}
|
||||
.recoveries-page .table-wrap {
|
||||
@@ -105,7 +105,7 @@
|
||||
.recoveries-page td,
|
||||
.recoveries-page th {
|
||||
padding: 9px;
|
||||
border-bottom: 1px solid #dde4df;
|
||||
border-bottom: 1px solid var(--border);
|
||||
vertical-align: top;
|
||||
}
|
||||
.recoveries-page th {
|
||||
@@ -113,7 +113,7 @@
|
||||
}
|
||||
.recoveries-page dialog {
|
||||
position: fixed;
|
||||
border: 1px solid #dce4df;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 13px;
|
||||
max-width: min(720px, 94vw);
|
||||
width: 100%;
|
||||
@@ -124,13 +124,13 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.recoveries-page dialog::backdrop {
|
||||
background: #18332b55;
|
||||
background: color-mix(in srgb, var(--ink) 33%, transparent);
|
||||
}
|
||||
.recoveries-page .dialog-close {
|
||||
float: right;
|
||||
}
|
||||
.recoveries-page .error {
|
||||
color: #9a372c;
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.recoveries-page .recovery-net {
|
||||
@@ -142,12 +142,12 @@
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
.recoveries-page .modified {
|
||||
background: #fff8e7;
|
||||
background: var(--internal-bg);
|
||||
}
|
||||
.recoveries-page table td {
|
||||
white-space: pre-line;
|
||||
}
|
||||
.recoveries-page .recovery-new-product {
|
||||
border-top: 1px solid #dce4df;
|
||||
border-top: 1px solid var(--border);
|
||||
padding-top: 10px;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import { useEffect, useEffectEvent, useLayoutEffect, useRef, useState } from 're
|
||||
import { Calc, Model } from '../../shared';
|
||||
import { Button, Choice, Dialog, Field } from '../Settings/controls';
|
||||
import { errorText } from '../Settings/settingsModel';
|
||||
import { LedgerButton, LedgerInput, LedgerTable, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
type View = ReturnType<typeof reportPresentation>;
|
||||
interface Props {
|
||||
@@ -84,7 +85,7 @@ function PendingList({
|
||||
<h2>所有日期待复核报销单({list.counts.pending})</h2>
|
||||
<p className="small muted">点击原报销日期查看并复核;批准后回到该日期的应转合计。</p>
|
||||
<div className="table-wrap">
|
||||
<table className="daily-reimbursements-global-table" aria-label="所有日期待复核报销单">
|
||||
<LedgerTable className="daily-reimbursements-global-table" aria-label="所有日期待复核报销单">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>报销日期</th>
|
||||
@@ -123,7 +124,7 @@ function PendingList({
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<span className="small muted">
|
||||
@@ -480,7 +481,7 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
含未售现货采购及当天实际对外付款。不含客户退款(已从净收款扣除)、双方互转或报销转账。之前已经支付的货品,后续卖出不算一笔新支出。
|
||||
</p>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="verified"
|
||||
checked={out.verified}
|
||||
@@ -492,9 +493,9 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
</label>
|
||||
{errBox('daily-outlay-error', 'outlay')}
|
||||
<div className="actions">
|
||||
<button type="submit" className="primary" disabled={blocked}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked}>
|
||||
确认当天支出
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{data?.ready && btn('收起', 'daily-outlay-close')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -570,7 +571,7 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
<div className="reimbursement-item-row" data-index={i} key={item.id || item.sourceKey || i}>
|
||||
<label>
|
||||
<span className="sr-only">项目 {i + 1}</span>
|
||||
<input
|
||||
<LedgerInput
|
||||
name="itemName"
|
||||
value={item.name}
|
||||
required
|
||||
@@ -583,7 +584,7 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
</label>
|
||||
<label>
|
||||
<span className="sr-only">金额 {i + 1}</span>
|
||||
<input
|
||||
<LedgerInput
|
||||
name="itemAmount"
|
||||
value={item.amount}
|
||||
type="number"
|
||||
@@ -656,9 +657,9 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
</p>
|
||||
{errBox('reimbursement-error', 'draft')}
|
||||
<div className="actions">
|
||||
<button className="primary" type="submit" disabled={blocked}>
|
||||
<LedgerButton className="primary" type="submit" disabled={blocked}>
|
||||
{draft.id ? '保存并重新提交复核' : '提交店主复核'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
@@ -679,7 +680,7 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
{view.renderReimbursementItems(row)}
|
||||
<label>
|
||||
{review.kind === 'reject' ? '驳回原因' : '复核备注(选填)'}
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={300}
|
||||
rows={2}
|
||||
@@ -691,7 +692,7 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
</label>
|
||||
{review.kind === 'approve' && (
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="verified"
|
||||
checked={review.verified}
|
||||
@@ -706,9 +707,9 @@ export function Reimbursements({ client, state, view, data, query, changeDate, r
|
||||
)}
|
||||
{errBox('reimbursement-review-error', 'review')}
|
||||
<div className="actions">
|
||||
<button type="submit" className="primary" disabled={blocked}>
|
||||
<LedgerButton type="submit" className="primary" disabled={blocked}>
|
||||
{review.kind === 'approve' ? '同意报销' : '确认驳回'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { errorText } from '../Settings/settingsModel';
|
||||
import { reportPresentation } from './presentation';
|
||||
import { Reimbursements } from './Reimbursements';
|
||||
import './report.css';
|
||||
import { LedgerInput } from '../../components/BusinessControls';
|
||||
|
||||
type ReportProps = Pick<ReportContext, 'state' | 'session'> & { client: LedgerClient };
|
||||
type Reply = { query: ReportQuery; version: number } & (
|
||||
@@ -168,7 +169,7 @@ export function ReportPage({ client, state, session }: ReportProps) {
|
||||
)}
|
||||
<label>
|
||||
对账日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id="report-date"
|
||||
value={query.date}
|
||||
@@ -178,7 +179,7 @@ export function ReportPage({ client, state, session }: ReportProps) {
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
id="report-month"
|
||||
checked={query.month}
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { ReactNode } from 'react';
|
||||
import type * as T from './contracts';
|
||||
import { Children } from 'react';
|
||||
import { reportData } from './reportData';
|
||||
import { LedgerButton, LedgerDataTable, LedgerTable } from '../../components/BusinessControls';
|
||||
const withKeys = Children.toArray;
|
||||
const fallback = (rows: ReactNode[], empty: ReactNode) => (rows.length ? rows : empty);
|
||||
const e = (value: unknown) => (value == null ? '' : String(value));
|
||||
@@ -103,7 +104,7 @@ export function reportPresentation({
|
||||
<h2>按收款账户核对</h2>
|
||||
<p className="small muted">{reportPeriod(range)}普通订单当前收付,加上同期锁价实际收付。</p>
|
||||
<div className="table-wrap">
|
||||
<table aria-label="按收款账户核对">
|
||||
<LedgerTable aria-label="按收款账户核对">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账户</th>
|
||||
@@ -139,7 +140,7 @@ export function reportPresentation({
|
||||
<td className="number">¥{yuan(receipts.net)}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
<p className="small muted report-cost-note">
|
||||
请按这些订单的收退款记录与微信、支付宝、现金、信用卡核对;系统尚未接入支付平台账单。
|
||||
@@ -173,14 +174,14 @@ export function reportPresentation({
|
||||
r.warnings.map(w => (
|
||||
<li>
|
||||
{w.id ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-order"
|
||||
data-id={w.id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{w.number}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
@@ -195,23 +196,23 @@ export function reportPresentation({
|
||||
<div className="form-actions">
|
||||
<div className={'small ' + (close?.stale ? 'danger-text' : 'muted')}>{closeStatus}</div>
|
||||
<div className="actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="download-report"
|
||||
className=""
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'下载对账报告'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{state.user.role === 'owner' && !reportMonth ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="close-day"
|
||||
className="primary"
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'保存核对快照'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
@@ -255,7 +256,7 @@ export function reportPresentation({
|
||||
{reportPeriod(table)} · 按日期、订单归属人核对。勾选“汇总当月”可查看当月逐日利润。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table aria-label="每日利润明细">
|
||||
<LedgerTable aria-label="每日利润明细">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">日期</th>
|
||||
@@ -301,7 +302,7 @@ export function reportPresentation({
|
||||
{amounts(table.summary)}
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
<p className="small muted report-daily-profit-note">
|
||||
普通订单按开单日、锁价成单按交付日、售后按记录日归集。成本含实际耗用料费和费用;退货、作废沿原账冲回。
|
||||
@@ -349,7 +350,7 @@ export function reportPresentation({
|
||||
{!readOnly ? (
|
||||
<div className="actions">
|
||||
{row.canEdit && row.status !== 'approved' ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="reimbursement-edit"
|
||||
className=""
|
||||
@@ -357,13 +358,13 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{row.status === 'rejected' ? '修改后重新提交' : '修改报销单'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{dailyFundsOwner() && row.canApprove && row.status === 'pending' ? (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="reimbursement-approve"
|
||||
className="primary"
|
||||
@@ -371,8 +372,8 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'复核通过'}
|
||||
</button>
|
||||
<button
|
||||
</LedgerButton>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="reimbursement-reject"
|
||||
className=""
|
||||
@@ -380,7 +381,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'驳回'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
@@ -413,7 +414,7 @@ export function reportPresentation({
|
||||
''
|
||||
)}
|
||||
<div className="table-wrap">
|
||||
<table className="daily-funds-month-table" aria-label="每日转账核对汇总">
|
||||
<LedgerTable className="daily-funds-month-table" aria-label="每日转账核对汇总">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
@@ -430,7 +431,7 @@ export function reportPresentation({
|
||||
data.days.map(day => (
|
||||
<tr>
|
||||
<td>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="daily-funds-open-date"
|
||||
className="link-button"
|
||||
@@ -438,7 +439,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{day.date}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</td>
|
||||
<td className="number">¥{yuan(day.ownerReceipts.net)}</td>
|
||||
<td className="number">{dailyFundsMoney(day.actualOutlay)}</td>
|
||||
@@ -455,7 +456,7 @@ export function reportPresentation({
|
||||
</tr>,
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
@@ -473,7 +474,7 @@ export function reportPresentation({
|
||||
按真实付款日期记录的费用、日购料和锁价采购等;不把普通订单耗用成本当作当天付款。完整总额以店主核实为准。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table aria-label={'' + teamMemberName('owner') + '已记录实际付款参考'}>
|
||||
<LedgerTable aria-label={'' + teamMemberName('owner') + '已记录实际付款参考'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>付款日期</th>
|
||||
@@ -502,7 +503,7 @@ export function reportPresentation({
|
||||
</tr>,
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
@@ -666,7 +667,7 @@ export function reportPresentation({
|
||||
普通订单按开单日归集;每日购料按实际购买日期归集,订单耗用料费不再计一次支出;锁价料费、工费与费用按实际付款日归集,原锁料费不在交付时重复计入。实际支出可能与本期订单耗用成本不同。转账请以核实后的完整实际支出为准。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table className="report-payer-table" aria-label={'助理与' + teamMemberName('owner') + '支出成本'}>
|
||||
<LedgerTable className="report-payer-table" aria-label={'助理与' + teamMemberName('owner') + '支出成本'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>付款人</th>
|
||||
@@ -712,7 +713,7 @@ export function reportPresentation({
|
||||
<td className="number">{reportCostAmount(r.outlayTotal ?? r.goods + r.expense, missing + pending)}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
{withKeys(people.map(reportCostDetails))}
|
||||
<p className="small muted report-cost-note">
|
||||
@@ -750,42 +751,39 @@ export function reportPresentation({
|
||||
<details>
|
||||
<summary>查看 {rows.length} 项收付记录</summary>
|
||||
<div className="table-wrap">
|
||||
<table className="lock-activity-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/锁价单</th>
|
||||
<th>项目/客户</th>
|
||||
<th>账户/付款人</th>
|
||||
<th className="number">金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{withKeys(
|
||||
rows.map(item => (
|
||||
<tr>
|
||||
<td>
|
||||
{item.date}
|
||||
<br />
|
||||
<button
|
||||
className="link-button"
|
||||
data-action="open-price-lock"
|
||||
data-id={item.price_lock_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.number || '锁价记录'}
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</td>
|
||||
<td>{item.who}</td>
|
||||
<td className="number">{item.amount == null ? '待补齐' : '¥' + yuan(item.amount)}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="lock-activity-table"
|
||||
columns={[
|
||||
{ title: '日期/锁价单' },
|
||||
{ title: '项目/客户' },
|
||||
{ title: '账户/付款人' },
|
||||
{ title: '金额', headerClassName: 'number' },
|
||||
]}
|
||||
rows={rows.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, undefined, 'number'],
|
||||
cells: [
|
||||
<>
|
||||
{item.date}
|
||||
<br />
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-price-lock"
|
||||
data-id={item.price_lock_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.number || '锁价记录'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
<>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</>,
|
||||
item.who,
|
||||
item.amount == null ? '待补齐' : '¥' + yuan(item.amount),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
@@ -801,39 +799,36 @@ export function reportPresentation({
|
||||
按实际购买日期计支出,与下方订单耗用成本分别核对;本表金额已包含在上方双方实际支出中。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>购料日期</th>
|
||||
<th className="number">购买克重</th>
|
||||
<th className="number">实际总价</th>
|
||||
<th>付款人</th>
|
||||
<th>备注</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{withKeys(
|
||||
activity.purchases.map(item => (
|
||||
<tr>
|
||||
<td>
|
||||
<button
|
||||
className="link-button"
|
||||
data-action="goto-material-pools"
|
||||
data-id={item.pool_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.date}
|
||||
</button>
|
||||
</td>
|
||||
<td className="number">{grams(item.mg)}g</td>
|
||||
<td className="number">¥{yuan(item.amount)}</td>
|
||||
<td>{materialPayerName(materialPurchasePayer(item))}</td>
|
||||
<td>{item.note}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="material-detail-table"
|
||||
columns={[
|
||||
{ title: '购料日期' },
|
||||
{ title: '购买克重', headerClassName: 'number' },
|
||||
{ title: '实际总价', headerClassName: 'number' },
|
||||
{ title: '付款人' },
|
||||
{ title: '备注' },
|
||||
]}
|
||||
rows={activity.purchases.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, 'number', 'number', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="goto-material-pools"
|
||||
data-id={item.pool_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.date}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
<>{grams(item.mg)}g</>,
|
||||
<>¥{yuan(item.amount)}</>,
|
||||
materialPayerName(materialPurchasePayer(item)),
|
||||
item.note,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -849,7 +844,7 @@ export function reportPresentation({
|
||||
范围内,普通订单按开单日、锁价成单按交付日、售后按记录日期归集。这里显示订单完整耗用成本,与上方实际付款分开核对;旧草稿不计金额。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table className="report-order-table" aria-label="订单与售后净额明细">
|
||||
<LedgerTable className="report-order-table" aria-label="订单与售后净额明细">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/单号或售后项目</th>
|
||||
@@ -905,7 +900,7 @@ export function reportPresentation({
|
||||
<td className="number">{reportSummaryAmount(s, 'profit')}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -978,7 +973,7 @@ export function reportPresentation({
|
||||
{teamMemberName('owner')}直收款的订单,先复核货款与利润归属。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<LedgerTable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>订单</th>
|
||||
@@ -994,14 +989,14 @@ export function reportPresentation({
|
||||
r.unsettled.map(o => (
|
||||
<tr>
|
||||
<td>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-order"
|
||||
data-id={o.id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{o.number}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</td>
|
||||
<td className="number">{materialReportMoney(o.costDue)}</td>
|
||||
<td className="number">{materialReportMoney(o.profitDue)}</td>
|
||||
@@ -1015,7 +1010,7 @@ export function reportPresentation({
|
||||
</tr>,
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -1030,70 +1025,67 @@ export function reportPresentation({
|
||||
{teamMemberName('assistant')}垫付的未耗用材料单独核对;耗用后按订单分摊,避免在订单与剩余料款重复结算。
|
||||
</p>
|
||||
<div className="table-wrap">
|
||||
<table className="material-detail-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>购料日期</th>
|
||||
<th className="number">{teamMemberName('assistant')}垫付的剩余料款</th>
|
||||
<th className="number">实际已交净额</th>
|
||||
<th className="number">本批料款待结</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{withKeys(
|
||||
value.pools.map(item => (
|
||||
<tr>
|
||||
<td>
|
||||
<button
|
||||
className="link-button"
|
||||
data-action="goto-material-pools"
|
||||
data-id={item.id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.date}
|
||||
</button>
|
||||
</td>
|
||||
<td className="number">{materialReportMoney(item.assistantInventoryCredit)}</td>
|
||||
<td className="number">¥{yuan(item.transferred)}</td>
|
||||
<td className="number">
|
||||
{materialReportMoney(item.settlementDue)}
|
||||
{(item.settlementDue ?? 0) < 0 ? (
|
||||
<LedgerDataTable
|
||||
className="material-detail-table"
|
||||
columns={[
|
||||
{ title: '购料日期' },
|
||||
{ title: <>{teamMemberName('assistant')}垫付的剩余料款</>, headerClassName: 'number' },
|
||||
{ title: '实际已交净额', headerClassName: 'number' },
|
||||
{ title: '本批料款待结', headerClassName: 'number' },
|
||||
]}
|
||||
rows={value.pools.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, 'number', 'number', 'number'],
|
||||
cells: [
|
||||
<>
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="goto-material-pools"
|
||||
data-id={item.id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.date}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
materialReportMoney(item.assistantInventoryCredit),
|
||||
<>¥{yuan(item.transferred)}</>,
|
||||
<>
|
||||
{materialReportMoney(item.settlementDue)}
|
||||
{(item.settlementDue ?? 0) < 0 ? (
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<div className="small muted"></div>
|
||||
{teamMemberName('owner')}
|
||||
</>
|
||||
{' → '}
|
||||
</>
|
||||
{teamMemberName('assistant')}
|
||||
</>
|
||||
{'</div>'}
|
||||
</>
|
||||
) : (item.settlementDue ?? 0) > 0 ? (
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<div className="small muted"></div>
|
||||
{teamMemberName('assistant')}
|
||||
</>
|
||||
{' → '}
|
||||
</>
|
||||
<div className="small muted"></div>
|
||||
{teamMemberName('owner')}
|
||||
</>
|
||||
{'</div>'}
|
||||
{' → '}
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
{teamMemberName('assistant')}
|
||||
</>
|
||||
{'</div>'}
|
||||
</>
|
||||
) : (item.settlementDue ?? 0) > 0 ? (
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<>
|
||||
<div className="small muted"></div>
|
||||
{teamMemberName('assistant')}
|
||||
</>
|
||||
{' → '}
|
||||
</>
|
||||
{teamMemberName('owner')}
|
||||
</>
|
||||
{'</div>'}
|
||||
</>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
className="small muted"
|
||||
@@ -1185,7 +1177,7 @@ export function reportPresentation({
|
||||
</span>
|
||||
</summary>
|
||||
<div className="table-wrap" tabIndex={0} role="region" aria-label={person.name + name + '明细表'}>
|
||||
<table className="report-receipt-table" aria-label={person.name + name + '逐笔明细'}>
|
||||
<LedgerTable className="report-receipt-table" aria-label={person.name + name + '逐笔明细'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>实际{name}日/归集口径</th>
|
||||
@@ -1233,7 +1225,7 @@ export function reportPresentation({
|
||||
<td className="number">¥{yuan(person[kind])}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
@@ -1258,7 +1250,7 @@ export function reportPresentation({
|
||||
</span>
|
||||
</summary>
|
||||
<div className="table-wrap">
|
||||
<table className="report-cost-detail-table" aria-label={'' + cost.name + '支出成本逐项明细'}>
|
||||
<LedgerTable className="report-cost-detail-table" aria-label={'' + cost.name + '支出成本逐项明细'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/单号或客户</th>
|
||||
@@ -1312,7 +1304,7 @@ export function reportPresentation({
|
||||
</tr>,
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
</details>
|
||||
);
|
||||
@@ -1321,7 +1313,7 @@ export function reportPresentation({
|
||||
function orderBookIdentity(row: T.Row, version?: string) {
|
||||
if (row.kind === 'orderAfterSale')
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.order_id || row.id}
|
||||
@@ -1330,12 +1322,12 @@ export function reportPresentation({
|
||||
<strong className="order-book-customer-name">{row.customer || '未填称呼'}</strong>
|
||||
<span className="order-book-secondary muted">订单售后 · {row.paper_number || row.number}</span>
|
||||
<span className="small muted">查看原单售后结果</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
if (row.kind === 'recovery')
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="recovery-open"
|
||||
data-id={row.recovery_id || row.id}
|
||||
@@ -1347,8 +1339,8 @@ export function reportPresentation({
|
||||
</span>
|
||||
<span className="order-book-secondary muted">{row.number}</span>
|
||||
<span className="order-book-recovery-payment">回收付款 ¥{yuan(row.cashPayment)}</span>
|
||||
</button>
|
||||
<button
|
||||
</LedgerButton>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="recovery-print"
|
||||
className="quiet order-book-recovery-print"
|
||||
@@ -1357,7 +1349,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'打印'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
if (version !== undefined) {
|
||||
@@ -1380,7 +1372,7 @@ export function reportPresentation({
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -1389,7 +1381,7 @@ export function reportPresentation({
|
||||
>
|
||||
{customer}
|
||||
<span className="order-book-secondary muted">{row.paper_number || row.number}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
if (row.kind === 'afterSale')
|
||||
@@ -1401,7 +1393,7 @@ export function reportPresentation({
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -1410,7 +1402,7 @@ export function reportPresentation({
|
||||
>
|
||||
<strong>{row.paper_number || row.number}</strong>
|
||||
<span>{row.customer || '未填称呼'}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1517,31 +1509,30 @@ export function reportPresentation({
|
||||
)}
|
||||
{day.items.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="report-owner-advance-table" aria-label={day.date + ' ' + label}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>客户/单号</th>
|
||||
<th>成本项目</th>
|
||||
<th className="number">{teamMemberName('owner')}承担金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{withKeys(
|
||||
day.items.map(item => (
|
||||
<tr className={item.status === 'recorded' ? undefined : 'report-pending-cost'}>
|
||||
<td>{item.date}</td>
|
||||
<td>{reportOwnerAdvanceIdentity(item)}</td>
|
||||
<td>
|
||||
{item.name}
|
||||
{item.source ? <small className="muted">{item.source}</small> : ''}
|
||||
</td>
|
||||
<td className="number">{reportOwnerAdvanceItemAmount(item)}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="report-owner-advance-table"
|
||||
aria-label={day.date + ' ' + label}
|
||||
columns={[
|
||||
{ title: '日期' },
|
||||
{ title: '客户/单号' },
|
||||
{ title: '成本项目' },
|
||||
{ title: <>{teamMemberName('owner')}承担金额</>, headerClassName: 'number' },
|
||||
]}
|
||||
rows={day.items.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
attributes: { className: item.status === 'recorded' ? undefined : 'report-pending-cost' },
|
||||
cellClasses: [undefined, undefined, undefined, 'number'],
|
||||
cells: [
|
||||
item.date,
|
||||
reportOwnerAdvanceIdentity(item),
|
||||
<>
|
||||
{item.name}
|
||||
{item.source ? <small className="muted">{item.source}</small> : ''}
|
||||
</>,
|
||||
reportOwnerAdvanceItemAmount(item),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
@@ -1661,7 +1652,7 @@ export function reportPresentation({
|
||||
function renderReportReceiptIdentity(item: T.ReceiptItem) {
|
||||
const number = item.paper_number || item.number || (item.price_lock_id ? '锁价记录' : '订单记录');
|
||||
const identity = item.order_id ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="open-order"
|
||||
className="link-button"
|
||||
@@ -1669,9 +1660,9 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{number}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : item.price_lock_id ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="open-price-lock"
|
||||
className="link-button"
|
||||
@@ -1679,7 +1670,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{number}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
number
|
||||
);
|
||||
@@ -1691,7 +1682,7 @@ export function reportPresentation({
|
||||
</>
|
||||
{item.order_id && item.price_lock_id ? (
|
||||
<div className="small">
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="open-price-lock"
|
||||
className="link-button"
|
||||
@@ -1699,7 +1690,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'原锁价单'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
@@ -1710,14 +1701,14 @@ export function reportPresentation({
|
||||
|
||||
function materialReportCostLink(item: T.CostItem) {
|
||||
return item.materialPoolId ? (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="goto-material-pools"
|
||||
data-id={item.materialPoolId}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.materialPoolId} 购料
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
priceLockCostLink(item)
|
||||
);
|
||||
@@ -1725,7 +1716,7 @@ export function reportPresentation({
|
||||
|
||||
function afterSaleEditButton(row: T.Row) {
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="after-sale-edit"
|
||||
className="after-sale-edit-button"
|
||||
@@ -1734,7 +1725,7 @@ export function reportPresentation({
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{'修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1776,14 +1767,14 @@ export function reportPresentation({
|
||||
function reportOwnerAdvanceIdentity(item: T.AdvanceItem) {
|
||||
return item.kind === 'order' ? (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-order"
|
||||
data-id={item.id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.customer || '未填客户'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<small className="muted">{item.paperNumber || item.number}</small>
|
||||
</>
|
||||
) : (
|
||||
@@ -1799,26 +1790,26 @@ export function reportPresentation({
|
||||
if (item.price_lock_id)
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-price-lock"
|
||||
data-id={item.price_lock_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.number || '锁价记录'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{item.customer ? <div className="small muted">{item.customer}</div> : ''}
|
||||
</>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button"
|
||||
data-action="open-order"
|
||||
data-id={item.order_id}
|
||||
onClick={event => onAction(event.currentTarget.dataset)}
|
||||
>
|
||||
{item.paper_number || item.number}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
.report-page {
|
||||
min-width: 0;
|
||||
line-height: 1.55;
|
||||
color: #233f32;
|
||||
color: var(--ink);
|
||||
font-size: 14px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
.report-page .panel,
|
||||
.report-page .stat {
|
||||
min-width: 0;
|
||||
background: #fff;
|
||||
border: 1px solid #d9e4df;
|
||||
background: var(--white);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: clamp(14px, 2vw, 24px);
|
||||
margin: 12px 0;
|
||||
@@ -29,7 +29,7 @@
|
||||
.report-page h1,
|
||||
.report-page h2,
|
||||
.report-page h3 {
|
||||
color: #193c2e;
|
||||
color: var(--green);
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
.report-page h1 {
|
||||
@@ -55,7 +55,7 @@
|
||||
.report-page select,
|
||||
.report-page textarea {
|
||||
font: inherit;
|
||||
border: 1px solid #b8cbbf;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
color: inherit;
|
||||
padding: 6px 9px;
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
.report-page button.primary {
|
||||
color: white;
|
||||
background: #23583d;
|
||||
background: var(--green);
|
||||
}
|
||||
.report-page button:disabled {
|
||||
opacity: 0.5;
|
||||
@@ -77,7 +77,7 @@
|
||||
.report-page .muted,
|
||||
.report-page .eyebrow,
|
||||
.report-page .hint {
|
||||
color: #566d61;
|
||||
color: var(--muted);
|
||||
}
|
||||
.report-page .small,
|
||||
.report-page .hint {
|
||||
@@ -85,7 +85,7 @@
|
||||
}
|
||||
.report-page .error,
|
||||
.report-page .danger-text {
|
||||
color: #96332d;
|
||||
color: var(--danger);
|
||||
}
|
||||
.report-page .stat > strong,
|
||||
.report-page .daily-transfer-parts strong,
|
||||
@@ -110,19 +110,19 @@
|
||||
}
|
||||
.report-page summary {
|
||||
cursor: pointer;
|
||||
color: #234b35;
|
||||
color: var(--green);
|
||||
}
|
||||
.report-page p {
|
||||
margin: 6px 0 10px;
|
||||
}
|
||||
.report-page .note,
|
||||
.report-page .badge {
|
||||
background: #edf5f0;
|
||||
background: var(--soft);
|
||||
border-radius: 6px;
|
||||
padding: 5px 8px;
|
||||
}
|
||||
.report-page .warn {
|
||||
background: #fbefdd;
|
||||
background: var(--internal-bg);
|
||||
}
|
||||
.report-page .table-wrap {
|
||||
overflow: auto;
|
||||
@@ -135,7 +135,7 @@
|
||||
.report-page th,
|
||||
.report-page td {
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #d9e4df;
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 7px;
|
||||
vertical-align: top;
|
||||
}
|
||||
@@ -147,7 +147,7 @@
|
||||
.report-page .link-button {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
color: #235c3e;
|
||||
color: var(--green);
|
||||
text-align: left;
|
||||
}
|
||||
.report-page .link-button > span,
|
||||
@@ -171,7 +171,7 @@
|
||||
.report-page button:focus-visible,
|
||||
.report-page input:focus-visible,
|
||||
.report-page summary:focus-visible {
|
||||
outline: 2px solid #3d7a52;
|
||||
outline: 2px solid var(--green-hover);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.report-page .sr-only {
|
||||
@@ -188,12 +188,12 @@
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
padding: 20px;
|
||||
border: 1px solid #cbdacf;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
color: inherit;
|
||||
}
|
||||
.report-page dialog::backdrop {
|
||||
background: #132a1e66;
|
||||
background: color-mix(in srgb, var(--ink) 40%, transparent);
|
||||
}
|
||||
.report-page .dialog-close {
|
||||
float: right;
|
||||
@@ -205,7 +205,7 @@
|
||||
transform: translateX(-50%);
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
background: #edf5ef;
|
||||
background: var(--soft);
|
||||
border-radius: 8px;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { type LedgerClient } from '../../lib/api';
|
||||
import { Calc, Fees, type MemberRow } from '../../shared';
|
||||
import { Button, Choice, Dialog, Field } from './controls';
|
||||
import { errorText, memberOptions, readForm, type Notice, type Shop } from './settingsModel';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput } from '../../components/BusinessControls';
|
||||
|
||||
interface Cost {
|
||||
name: string;
|
||||
@@ -108,7 +109,7 @@ export function Costs({
|
||||
</div>
|
||||
<label className="shop-cost-search">
|
||||
搜索成本
|
||||
<input
|
||||
<LedgerInput
|
||||
type="search"
|
||||
id="shop-cost-search"
|
||||
placeholder="输入成本名称"
|
||||
@@ -120,52 +121,50 @@ export function Costs({
|
||||
<div id="shop-cost-list">
|
||||
{visible.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="shop-cost-table">
|
||||
<thead>
|
||||
<tr>
|
||||
{['成本名称', '金额/单价', '付款人', '计费方式', '状态', '操作'].map(text => (
|
||||
<th key={text}>{text}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{visible.map(([kind, row]) => (
|
||||
<tr key={kind} data-cost-row={kind}>
|
||||
<td>
|
||||
<strong>{row.name}</strong>
|
||||
</td>
|
||||
<td>¥{row.amount}</td>
|
||||
<td>
|
||||
{row.payer === 'order'
|
||||
? '订单归属人'
|
||||
: members.find(m => m.member === row.payer)?.label || '待确认'}
|
||||
</td>
|
||||
<td>{row.byQuantity ? '单价 × 数量' : '每单一次'}</td>
|
||||
<td>{row.enabled ? '启用' : '停用'}</td>
|
||||
<td>
|
||||
<div className="actions">
|
||||
<Button
|
||||
action="shop-cost-edit"
|
||||
className="quiet"
|
||||
data-kind={kind}
|
||||
onClick={() => open('edit', kind)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
action="shop-cost-delete"
|
||||
className="danger"
|
||||
data-kind={kind}
|
||||
onClick={() => open('delete', kind)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="shop-cost-table"
|
||||
columns={[
|
||||
{ title: '成本名称' },
|
||||
{ title: '金额/单价' },
|
||||
{ title: '付款人' },
|
||||
{ title: '计费方式' },
|
||||
{ title: '状态' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={visible.map(([kind, row]) => ({
|
||||
key: kind,
|
||||
attributes: { 'data-cost-row': kind },
|
||||
cells: [
|
||||
<>
|
||||
<strong>{row.name}</strong>
|
||||
</>,
|
||||
<>¥{row.amount}</>,
|
||||
row.payer === 'order' ? '订单归属人' : members.find(m => m.member === row.payer)?.label || '待确认',
|
||||
row.byQuantity ? '单价 × 数量' : '每单一次',
|
||||
row.enabled ? '启用' : '停用',
|
||||
<>
|
||||
<div className="actions">
|
||||
<Button
|
||||
action="shop-cost-edit"
|
||||
className="quiet"
|
||||
data-kind={kind}
|
||||
onClick={() => open('edit', kind)}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
<Button
|
||||
action="shop-cost-delete"
|
||||
className="danger"
|
||||
data-kind={kind}
|
||||
onClick={() => open('delete', kind)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
</div>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">
|
||||
@@ -251,9 +250,13 @@ export function Costs({
|
||||
<Button action="shop-cost-close" className="quiet" onClick={close} disabled={saving}>
|
||||
取消
|
||||
</Button>
|
||||
<button type="submit" className={editor.action === 'delete' ? 'danger' : 'primary'} disabled={saving}>
|
||||
<LedgerButton
|
||||
type="submit"
|
||||
className={editor.action === 'delete' ? 'danger' : 'primary'}
|
||||
disabled={saving}
|
||||
>
|
||||
{editor.action === 'delete' ? '确认删除' : '保存成本'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</Dialog>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useSta
|
||||
import type { ApiError, LedgerClient } from '../../lib/api';
|
||||
import { Button, Choice, Dialog, Field } from './controls';
|
||||
import { errorText, readForm, type LeaveChecks, type Notice } from './settingsModel';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput } from '../../components/BusinessControls';
|
||||
|
||||
interface Employee {
|
||||
member: string;
|
||||
@@ -312,9 +313,9 @@ export const Employees = forwardRef<
|
||||
defaultValue={filter.status}
|
||||
disabled={guarded}
|
||||
/>
|
||||
<button type="submit" disabled={guarded}>
|
||||
<LedgerButton type="submit" disabled={guarded}>
|
||||
搜索
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<Button action="employee-reload" className="quiet" disabled={guarded} onClick={load}>
|
||||
刷新
|
||||
</Button>
|
||||
@@ -333,97 +334,97 @@ export const Employees = forwardRef<
|
||||
<p className="empty">没有符合条件的员工。</p>
|
||||
) : (
|
||||
<div className="table-wrap">
|
||||
<table className="employee-table">
|
||||
<thead>
|
||||
<tr>
|
||||
{['账号名称', '经办人名称(开单人)', '手机号/原登录名', '账号状态', '历史记录', '操作'].map(
|
||||
name => (
|
||||
<th key={name}>{name}</th>
|
||||
),
|
||||
)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.employees.map(item => (
|
||||
<tr key={item.member} data-employee={item.member}>
|
||||
<td>
|
||||
<strong>{item.label}</strong>
|
||||
<div className="small muted">{item.member === 'owner' ? '店主' : '员工'}</div>
|
||||
</td>
|
||||
<td>{item.operatorName || item.label}</td>
|
||||
<td>
|
||||
{item.loginName}
|
||||
<div className="small muted">{item.passwordSet ? '已设置密码' : '尚未设置密码'}</div>
|
||||
</td>
|
||||
<td>
|
||||
<span className={'badge ' + (item.enabled ? '' : 'warn')}>
|
||||
{item.enabled ? '已启用' : '已停用'}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<p className="small muted employee-delete-reason">{deleteReason(item)}</p>
|
||||
{!!item.businessUsage.length && (
|
||||
<details>
|
||||
<summary className="small">关联记录</summary>
|
||||
<ul className="small">
|
||||
{item.businessUsage.map(i => (
|
||||
<li key={i.source}>
|
||||
{i.label || i.source}:{i.count} 条
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<div className="actions">
|
||||
<LedgerDataTable
|
||||
className="employee-table"
|
||||
columns={[
|
||||
{ title: '账号名称' },
|
||||
{ title: '经办人名称(开单人)' },
|
||||
{ title: '手机号/原登录名' },
|
||||
{ title: '账号状态' },
|
||||
{ title: '历史记录' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={rows.employees.map(item => ({
|
||||
key: item.member,
|
||||
attributes: { 'data-employee': item.member },
|
||||
cells: [
|
||||
<>
|
||||
<strong>{item.label}</strong>
|
||||
<div className="small muted">{item.member === 'owner' ? '店主' : '员工'}</div>
|
||||
</>,
|
||||
item.operatorName || item.label,
|
||||
<>
|
||||
{item.loginName}
|
||||
<div className="small muted">{item.passwordSet ? '已设置密码' : '尚未设置密码'}</div>
|
||||
</>,
|
||||
<>
|
||||
<span className={'badge ' + (item.enabled ? '' : 'warn')}>
|
||||
{item.enabled ? '已启用' : '已停用'}
|
||||
</span>
|
||||
</>,
|
||||
<>
|
||||
<p className="small muted employee-delete-reason">{deleteReason(item)}</p>
|
||||
{!!item.businessUsage.length && (
|
||||
<details>
|
||||
<summary className="small">关联记录</summary>
|
||||
<ul className="small">
|
||||
{item.businessUsage.map(i => (
|
||||
<li key={i.source}>
|
||||
{i.label || i.source}:{i.count} 条
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
)}
|
||||
</>,
|
||||
<>
|
||||
<div className="actions">
|
||||
<Button
|
||||
action="employee-edit"
|
||||
data-member={item.member}
|
||||
onClick={() => open('update', item)}
|
||||
disabled={guarded}
|
||||
>
|
||||
编辑
|
||||
</Button>
|
||||
{item.canDeactivate ? (
|
||||
<Button
|
||||
action="employee-edit"
|
||||
action="employee-deactivate"
|
||||
className="quiet"
|
||||
data-member={item.member}
|
||||
onClick={() => open('update', item)}
|
||||
disabled={guarded}
|
||||
onClick={() => open('deactivate', item)}
|
||||
>
|
||||
编辑
|
||||
停用
|
||||
</Button>
|
||||
{item.canDeactivate ? (
|
||||
<Button
|
||||
action="employee-deactivate"
|
||||
className="quiet"
|
||||
data-member={item.member}
|
||||
disabled={guarded}
|
||||
onClick={() => open('deactivate', item)}
|
||||
>
|
||||
停用
|
||||
</Button>
|
||||
) : item.member !== 'owner' && !item.enabled ? (
|
||||
<Button
|
||||
action="employee-reactivate"
|
||||
data-member={item.member}
|
||||
disabled={guarded}
|
||||
onClick={() => open('reactivate', item)}
|
||||
>
|
||||
启用
|
||||
</Button>
|
||||
) : null}
|
||||
{item.member !== 'owner' && (
|
||||
<Button
|
||||
action="employee-delete"
|
||||
className="quiet"
|
||||
data-member={item.member}
|
||||
disabled={guarded || !item.canDelete}
|
||||
aria-label={'删除' + item.label}
|
||||
title={deleteReason(item)}
|
||||
onClick={() => open('delete', item)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
) : item.member !== 'owner' && !item.enabled ? (
|
||||
<Button
|
||||
action="employee-reactivate"
|
||||
data-member={item.member}
|
||||
disabled={guarded}
|
||||
onClick={() => open('reactivate', item)}
|
||||
>
|
||||
启用
|
||||
</Button>
|
||||
) : null}
|
||||
{item.member !== 'owner' && (
|
||||
<Button
|
||||
action="employee-delete"
|
||||
className="quiet"
|
||||
data-member={item.member}
|
||||
disabled={guarded || !item.canDelete}
|
||||
aria-label={'删除' + item.label}
|
||||
title={deleteReason(item)}
|
||||
onClick={() => open('delete', item)}
|
||||
>
|
||||
删除
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -519,9 +520,9 @@ export const Employees = forwardRef<
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
<button type="submit" className="primary" disabled={guarded || stale}>
|
||||
<LedgerButton type="submit" className="primary" disabled={guarded || stale}>
|
||||
{adding ? '添加员工' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
@@ -534,7 +535,7 @@ export const Employees = forwardRef<
|
||||
<p className="note">{statusMessage[status]}</p>
|
||||
<form id="employee-status-form" onSubmit={submit} data-stale={stale || undefined}>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required disabled={guarded || stale} />
|
||||
<LedgerInput type="checkbox" name="verified" required disabled={guarded || stale} />
|
||||
已核对员工,确认{statusName[status]}账号。
|
||||
</label>
|
||||
{actions}
|
||||
@@ -547,13 +548,13 @@ export const Employees = forwardRef<
|
||||
>
|
||||
取消
|
||||
</Button>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="submit"
|
||||
className={status === 'delete' ? 'danger' : 'primary'}
|
||||
disabled={guarded || stale}
|
||||
>
|
||||
确认{statusName[status]}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useRef, useState, type FormEvent } from 'react';
|
||||
import { type LedgerClient } from '../../lib/api';
|
||||
import { Button, Field } from './controls';
|
||||
import { errorText, readForm, type Printing, type Notice } from './settingsModel';
|
||||
import { LedgerButton, LedgerTable } from '../../components/BusinessControls';
|
||||
|
||||
const metrics = [
|
||||
['rows', '表格最少行数', 3, 12],
|
||||
@@ -100,9 +101,9 @@ export function PrintingPanel({
|
||||
: '当前生效设置;修改后请点击保存。'}
|
||||
</p>
|
||||
</div>
|
||||
<button type="submit" form="print-settings" className="primary" disabled={saving || client.busy}>
|
||||
<LedgerButton type="submit" form="print-settings" className="primary" disabled={saving || client.busy}>
|
||||
保存打印设置
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<form
|
||||
id="print-settings"
|
||||
@@ -155,7 +156,7 @@ export function PrintingPanel({
|
||||
<p id="print-mini-contact" hidden={!printing.contact}>
|
||||
{printing.contact}
|
||||
</p>
|
||||
<table>
|
||||
<LedgerTable>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>商品名称</td>
|
||||
@@ -173,7 +174,7 @@ export function PrintingPanel({
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
<p>合计金额{'\u3000'}¥1,200.00</p>
|
||||
<p>大写:壹仟贰佰元整</p>
|
||||
<p>注意事项 · 珠宝首饰保养须知</p>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { Employees } from './Employees';
|
||||
import { PrintingPanel } from './Printing';
|
||||
import { ShopForm } from './Shop';
|
||||
import './settings.css';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
export interface SettingsProps {
|
||||
client: LedgerClient;
|
||||
@@ -137,7 +138,7 @@ export function SettingsPage({
|
||||
/>
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button disabled={client.busy}>修改并重新登录</button>
|
||||
<LedgerButton disabled={client.busy}>修改并重新登录</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { LedgerClient } from '../../lib/api';
|
||||
import { Calc, type MemberRow } from '../../shared';
|
||||
import { Choice, Field } from './controls';
|
||||
import { errorText, memberOptions, readForm, type Shop, type Notice } from './settingsModel';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
function shopValues(shop: Shop, today: string) {
|
||||
const month = today.slice(0, 7);
|
||||
@@ -202,9 +203,9 @@ export function ShopForm({
|
||||
{error}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button className="primary" type="submit" disabled={busy || client.busy || !!client.pending()}>
|
||||
<LedgerButton className="primary" type="submit" disabled={busy || client.busy || !!client.pending()}>
|
||||
保存店铺配置
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
</>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useLayoutEffect, useRef } from 'react';
|
||||
import type { ButtonHTMLAttributes, InputHTMLAttributes, ReactNode, SelectHTMLAttributes } from 'react';
|
||||
import { LedgerButton, LedgerDialog, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
export function Field({ label, ...props }: InputHTMLAttributes<HTMLInputElement> & { label: string }) {
|
||||
return (
|
||||
<label>
|
||||
{label}
|
||||
<input type="text" {...props} />
|
||||
<LedgerInput type="text" {...props} />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
@@ -16,18 +16,18 @@ export function Choice({
|
||||
return (
|
||||
<label>
|
||||
{label}
|
||||
<select {...props}>
|
||||
<LedgerSelect {...props}>
|
||||
{options.map(([value, name]) => (
|
||||
<option key={value} value={value}>
|
||||
{name}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
);
|
||||
}
|
||||
export function Button({ action, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & { action: string }) {
|
||||
return <button type="button" data-action={action} {...props} />;
|
||||
return <LedgerButton type="button" data-action={action} {...props} />;
|
||||
}
|
||||
export function Dialog({
|
||||
id,
|
||||
@@ -40,16 +40,9 @@ export function Dialog({
|
||||
close: () => void;
|
||||
children: ReactNode;
|
||||
}) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useLayoutEffect(() => {
|
||||
const node = ref.current!;
|
||||
node.showModal();
|
||||
node.querySelector<HTMLInputElement>('input:not([type=checkbox])')?.focus();
|
||||
return () => node.close();
|
||||
}, []);
|
||||
return (
|
||||
<dialog
|
||||
ref={ref}
|
||||
<LedgerDialog
|
||||
initialFocusSelector="input:not([type=checkbox])"
|
||||
id={id}
|
||||
aria-labelledby={labelledBy}
|
||||
onCancel={event => {
|
||||
@@ -58,6 +51,6 @@ export function Dialog({
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
@@ -3,14 +3,14 @@
|
||||
display: grid;
|
||||
gap: 18px;
|
||||
line-height: 1.55;
|
||||
color: #243d34;
|
||||
color: var(--ink);
|
||||
}
|
||||
.settings-page .panel {
|
||||
min-width: 0;
|
||||
padding: clamp(16px, 2vw, 28px);
|
||||
border: 1px solid #d9e4df;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
background: #fff;
|
||||
background: var(--white);
|
||||
}
|
||||
.settings-page .team-settings {
|
||||
order: 0;
|
||||
@@ -34,7 +34,7 @@
|
||||
.settings-page h1,
|
||||
.settings-page h2,
|
||||
.settings-page h3 {
|
||||
color: #193c2e;
|
||||
color: var(--green);
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
.settings-page h1 {
|
||||
@@ -55,7 +55,7 @@
|
||||
}
|
||||
.settings-page .muted,
|
||||
.settings-page .eyebrow {
|
||||
color: #536b61;
|
||||
color: var(--muted);
|
||||
}
|
||||
.settings-page .eyebrow {
|
||||
font-size: 12px;
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
.settings-page .note,
|
||||
.settings-page .badge {
|
||||
background: #edf5f0;
|
||||
background: var(--soft);
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
}
|
||||
@@ -72,11 +72,11 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
.settings-page .warn {
|
||||
background: #fbf0db;
|
||||
background: var(--internal-bg);
|
||||
}
|
||||
.settings-page .danger-text,
|
||||
.settings-page .error {
|
||||
color: #982f28;
|
||||
color: var(--danger);
|
||||
}
|
||||
.settings-page fieldset {
|
||||
border: 0;
|
||||
@@ -98,7 +98,7 @@
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
min-height: 38px;
|
||||
border: 1px solid #bdcec4;
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 6px;
|
||||
padding: 6px 9px;
|
||||
background: white;
|
||||
@@ -107,10 +107,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.settings-page input:read-only {
|
||||
background: #f6f8f6;
|
||||
background: var(--soft);
|
||||
}
|
||||
.settings-page button {
|
||||
border: 1px solid #b7c9be;
|
||||
border: 1px solid var(--border-strong);
|
||||
color: inherit;
|
||||
background: white;
|
||||
cursor: pointer;
|
||||
@@ -119,20 +119,20 @@
|
||||
font: inherit;
|
||||
}
|
||||
.settings-page button.primary {
|
||||
background: #23583d;
|
||||
background: var(--green);
|
||||
color: white;
|
||||
border-color: transparent;
|
||||
}
|
||||
.settings-page button.danger {
|
||||
color: #982f28;
|
||||
border-color: #d8a8a0;
|
||||
color: var(--danger);
|
||||
border-color: color-mix(in srgb, var(--danger) 38%, var(--white));
|
||||
}
|
||||
.settings-page button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
.settings-page :is(button, input, select, summary):focus-visible {
|
||||
outline: 2px solid #377951;
|
||||
outline: 2px solid var(--green-hover);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
.settings-page .grid,
|
||||
@@ -170,19 +170,19 @@
|
||||
.settings-page th {
|
||||
padding: 8px;
|
||||
text-align: left;
|
||||
border-bottom: 1px solid #dbe5df;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.settings-page th {
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
color: #4c6658;
|
||||
color: var(--muted);
|
||||
}
|
||||
.settings-page .empty {
|
||||
padding: 12px;
|
||||
color: #52685d;
|
||||
color: var(--muted);
|
||||
}
|
||||
.settings-page .shop-cost-manager {
|
||||
border-top: 1px solid #e3e9e3;
|
||||
border-top: 1px solid var(--border);
|
||||
margin-top: 22px;
|
||||
padding-top: 14px;
|
||||
}
|
||||
@@ -190,13 +190,13 @@
|
||||
max-width: 320px;
|
||||
}
|
||||
.settings-page .paper-mini {
|
||||
background: #fcfaf4;
|
||||
border: 1px solid #d8d2c2;
|
||||
background: var(--white);
|
||||
border: 1px solid var(--border-strong);
|
||||
padding: 16px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
.settings-page .paper-mini td {
|
||||
border: 1px solid #ccc6b6;
|
||||
border: 1px solid var(--border-strong);
|
||||
font-size: 12px;
|
||||
}
|
||||
.settings-page dialog {
|
||||
@@ -205,13 +205,13 @@
|
||||
overflow: auto;
|
||||
box-sizing: border-box;
|
||||
padding: 24px;
|
||||
border: 1px solid #cbdbd0;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
color: inherit;
|
||||
box-shadow: 0 25px 65px #11281940;
|
||||
box-shadow: 0 25px 65px color-mix(in srgb, var(--ink) 25%, transparent);
|
||||
}
|
||||
.settings-page dialog::backdrop {
|
||||
background: #132a1e66;
|
||||
background: color-mix(in srgb, var(--ink) 40%, transparent);
|
||||
}
|
||||
.settings-page .dialog-close {
|
||||
float: right;
|
||||
@@ -224,15 +224,15 @@
|
||||
z-index: 10;
|
||||
max-width: 90vw;
|
||||
pointer-events: none;
|
||||
background: #ecf4ef;
|
||||
color: #234d33;
|
||||
border: 1px solid #bacfc1;
|
||||
background: var(--soft);
|
||||
color: var(--green);
|
||||
border: 1px solid var(--border-strong);
|
||||
border-radius: 8px;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.settings-page .settings-notice.error {
|
||||
color: #8f302a;
|
||||
background: #fff4f1;
|
||||
color: var(--danger);
|
||||
background: color-mix(in srgb, var(--danger) 6%, var(--white));
|
||||
}
|
||||
@media (max-width: 850px) {
|
||||
.settings-page .three,
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { act, fireEvent, render } from '@testing-library/react';
|
||||
import { expect, it } from 'vitest';
|
||||
import { LedgerButton, LedgerInput, LedgerTextArea } from '../src/components/BusinessControls';
|
||||
|
||||
it('业务控件的 FormData 保留小数尾零,原生重置还原金额和备注', async () => {
|
||||
const { container, rerender } = render(<Form />);
|
||||
function Form() {
|
||||
return (
|
||||
<form>
|
||||
<LedgerInput type="number" step="0.001" name="grams" defaultValue="1.200" />
|
||||
<LedgerTextArea name="note" defaultValue="原备注" />
|
||||
<LedgerButton type="submit" name="decision" value="reject">
|
||||
驳回
|
||||
</LedgerButton>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
const form = container.querySelector('form')!;
|
||||
const grams = form.elements.namedItem('grams') as HTMLInputElement;
|
||||
const note = form.elements.namedItem('note') as HTMLTextAreaElement;
|
||||
const button = form.elements.namedItem('decision') as HTMLButtonElement;
|
||||
fireEvent.change(grams, { target: { value: '2.350' } });
|
||||
fireEvent.change(note, { target: { value: '已编辑' } });
|
||||
expect(Object.fromEntries(new FormData(form, button))).toEqual({
|
||||
grams: '2.350',
|
||||
note: '已编辑',
|
||||
decision: 'reject',
|
||||
});
|
||||
await act(async () => form.reset());
|
||||
rerender(<Form />);
|
||||
expect(Object.fromEntries(new FormData(form))).toEqual({ grams: '1.200', note: '原备注' });
|
||||
});
|
||||
Reference in new issue
Block a user