@topthink/components 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -95,7 +95,7 @@ import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-c
|
|
|
95
95
|
margin-bottom: 4px;
|
|
96
96
|
color: rgba(0, 0, 0, .45);
|
|
97
97
|
font-size: 1.1rem;
|
|
98
|
-
`;function Ge(){}function Ye(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function Je(e){let{total:t=0,onChange:n=Ge,defaultCurrent:o=1,defaultPageSize:i=10,className:a,...l}=e;const[d,u]=c(o),[m,f]=c(i);s((()=>{Ye(l.current)&&u(l.current)}),[l.current]),s((()=>{Ye(l.pageSize)&&f(l.pageSize)}),[l.pageSize]);const g=h((()=>Math.floor((t-1)/m)+1),[t,m]),y=p((e=>()=>{e!==d&&(u(e),n(e,m))}),[n,d,m]),v=d-1>0?d-1:0,b=d+1<g?d+1:g,x=[];let w=null,k=null,C=null,S=null;if(g<=7)for(let e=1;e<=g;e+=1){const t=d===e;x.push(r(E.Item,{active:t,onClick:y(e),children:e},e))}else{S=r(E.Last,{onClick:y(g)},"last"),C=r(E.First,{onClick:y(1)},"first"),w=r(E.Prev,{onClick:y(v)},"prev"),k=r(E.Next,{onClick:y(b)},"next");let e=Math.max(1,d-2),t=Math.min(d+2,g);d-1<=2&&(t=5),g-d<=2&&(e=g-4);for(let n=e;n<=t;n+=1){const e=d===n;x.push(r(E.Item,{active:e,onClick:y(n),children:n},n))}d-1>=4&&3!==d&&x.unshift(w),g-d>=4&&d!==g-2&&x.push(k),1!==e&&x.unshift(C),t!==g&&x.push(S)}return r(E,{className:a,children:x})}function Qe(e){let{className:t,value:n,locale:i="zh-CN",currency:a=!0,options:c={}}=e;const s=h((()=>{let e;return e=a?{style:"currency",currency:"CNY"}:{minimumFractionDigits:2},new Intl.NumberFormat(i,{...e,...c})}),[a,i,c]);return t?r("span",{className:t,children:s.format(n)}):r(o,{children:s.format(n)})}function We(e){let{loading:t,disabled:n,children:o,...i}=e;return r(S,{...i,disabled:t||n,children:t?"Loading…":o})}const Xe=g((()=>import("./image-zoom-912e2b3b.js")));function Ze(e){return r(y,{fallback:null,children:r(Xe,{...e})})}function et(e){let{url:t,method:r,confirm:n,onSuccess:o,children:i,disabled:a,as:c=le,...s}=e;const[l,d]=we(!1),u=p((async e=>{e.preventDefault();try{if(d(!0),n&&!await ue.confirm({message:n}))return;const e="string"==typeof t?{url:t,method:r}:{method:r,...t},i=await xe(e);o&&o(i)}catch(e){be(e)}finally{d(!1)}}),[t,r,d]);return v(c,{...s,disabled:a||l,onClick:u},i)}const tt=require("ajv-i18n/localize/zh"),rt={upload:function(e){let{options:t,...n}=e;const{widgets:o}=R();return t.endpoint&&(t.onUpload=async e=>{const r=new FormData;r.set("file",e);const{url:n}=await xe({url:t.endpoint,method:"post",data:r});return
|
|
98
|
+
`;function Ge(){}function Ye(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function Je(e){let{total:t=0,onChange:n=Ge,defaultCurrent:o=1,defaultPageSize:i=10,className:a,...l}=e;const[d,u]=c(o),[m,f]=c(i);s((()=>{Ye(l.current)&&u(l.current)}),[l.current]),s((()=>{Ye(l.pageSize)&&f(l.pageSize)}),[l.pageSize]);const g=h((()=>Math.floor((t-1)/m)+1),[t,m]),y=p((e=>()=>{e!==d&&(u(e),n(e,m))}),[n,d,m]),v=d-1>0?d-1:0,b=d+1<g?d+1:g,x=[];let w=null,k=null,C=null,S=null;if(g<=7)for(let e=1;e<=g;e+=1){const t=d===e;x.push(r(E.Item,{active:t,onClick:y(e),children:e},e))}else{S=r(E.Last,{onClick:y(g)},"last"),C=r(E.First,{onClick:y(1)},"first"),w=r(E.Prev,{onClick:y(v)},"prev"),k=r(E.Next,{onClick:y(b)},"next");let e=Math.max(1,d-2),t=Math.min(d+2,g);d-1<=2&&(t=5),g-d<=2&&(e=g-4);for(let n=e;n<=t;n+=1){const e=d===n;x.push(r(E.Item,{active:e,onClick:y(n),children:n},n))}d-1>=4&&3!==d&&x.unshift(w),g-d>=4&&d!==g-2&&x.push(k),1!==e&&x.unshift(C),t!==g&&x.push(S)}return r(E,{className:a,children:x})}function Qe(e){let{className:t,value:n,locale:i="zh-CN",currency:a=!0,options:c={}}=e;const s=h((()=>{let e;return e=a?{style:"currency",currency:"CNY"}:{minimumFractionDigits:2},new Intl.NumberFormat(i,{...e,...c})}),[a,i,c]);return t?r("span",{className:t,children:s.format(n)}):r(o,{children:s.format(n)})}function We(e){let{loading:t,disabled:n,children:o,...i}=e;return r(S,{...i,disabled:t||n,children:t?"Loading…":o})}const Xe=g((()=>import("./image-zoom-912e2b3b.js")));function Ze(e){return r(y,{fallback:null,children:r(Xe,{...e})})}function et(e){let{url:t,method:r,confirm:n,onSuccess:o,children:i,disabled:a,as:c=le,...s}=e;const[l,d]=we(!1),u=p((async e=>{e.preventDefault();try{if(d(!0),n&&!await ue.confirm({message:n}))return;const e="string"==typeof t?{url:t,method:r}:{method:r,...t},i=await xe(e);o&&o(i)}catch(e){be(e)}finally{d(!1)}}),[t,r,d]);return v(c,{...s,disabled:a||l,onClick:u},i)}const tt=require("ajv-i18n/localize/zh"),rt={upload:function(e){let{options:t,...n}=e;const{widgets:o}=R();return t.endpoint&&(t.onUpload=async e=>{const r=new FormData;r.set("file",e);const{url:n,value:o}=await xe({url:t.endpoint,method:"post",data:r});return{url:n,value:o}}),r(o.upload,{...n,options:t})},editor:function(e){let{options:t,...n}=e;const{widgets:o}=R();return t.endpoint&&(t.onUpload=async e=>{const r=new FormData;r.set("file",e);const{url:n}=await xe({url:t.endpoint,method:"post",data:r});return n}),r(o.editor,{...n,options:t})},typeahead:function(e){let{options:t,...n}=e;const{widgets:o}=R();return t.endpoint&&(t.onSearch=async e=>{let{value:r,query:n}=e;return await xe({url:t.endpoint,params:{value:r,query:n}})}),r(o.typeahead,{...n,options:t})}},nt=m(((e,t)=>{let{action:n,method:o="post",onSuccess:i,formData:a,onSubmitting:s,onSubmit:l,onChange:d,submitText:u="提交",transformData:h,children:m,...f}=e;const[g,y]=c(),[v,b]=we(!1),[x,w]=c(a),k=p((async(e,t)=>{if(!v)try{if(b(!0),s&&s(!0),n){let{formData:t}=e;h&&(t=h(t));try{const e=await xe({url:n,method:o,data:t});return y(void 0),i&&await i(e),e}catch(e){if(!H.isAxiosError(e))throw e;y((e=>{const t=e.errors;return"string"==typeof t?{__errors:[t]}:B(t,(e=>({__errors:[e]})))})(e))}}else if(l)return await l(e,t)}finally{b(!1),s&&s(!1)}}),[n,o,l]),C=p((e=>{const{formData:t}=e;w(t),d&&d(e)}),[w,d]),S=p((e=>(e=e.map((e=>({keyword:e.name,dataPath:e.property,...e}))),tt(e),e)),[]),z=r(le,{className:"px-4",loading:v,type:"submit",variant:"primary",children:u});return"function"==typeof m&&(m=m({submit:z,loading:v})),r(I,{ref:t,extraErrors:g,onSubmit:k,transformErrors:S,noHtml5Validate:!0,noValidate:!0,...f,formData:x,onChange:C,widgets:rt,children:m||r("div",{className:"col-12",children:z})})})),ot=function(e){let{indeterminate:t=!1,...n}=e;const o=a(null);return s((()=>{o.current&&(o.current.indeterminate=t)}),[t]),r("input",{ref:o,...n,className:"form-check-input",type:"checkbox"})};var it;function at(){return at=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},at.apply(this,arguments)}const ct=e=>i.createElement("svg",at({viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},e),it||(it=i.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zM511.78 714.496c22.71 0 36.425-15.854 36.425-40.704V547.365H682.35c24.009 0 40.722-12.874 40.722-35.584 0-23.132-15.854-36.426-40.722-36.426H548.206V340.773c0-24.85-13.715-40.704-36.425-40.704s-35.566 16.713-35.566 40.722v134.583H342.49c-24.85 0-41.142 13.275-41.142 36.407 0 22.71 17.152 35.584 41.142 35.584h133.724v126.427c0 23.99 12.855 40.704 35.566 40.704z"})));var st;function lt(){return lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lt.apply(this,arguments)}const dt=e=>i.createElement("svg",lt({viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor"},e),st||(st=i.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zm86.582-289.719h344.576c23.991 0 40.704-12.855 40.704-35.566 0-23.15-15.433-36.425-40.704-36.425H339.931c-24.868 0-40.722 13.276-40.722 36.425 0 22.711 16.713 35.566 40.722 35.566z"})));function ut(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=a(e);return s((()=>{r.current=e})),p((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.current?.(...t)}),t)}function pt(e){const{value:t,defaultValue:r,onChange:n,shouldUpdate:o=((e,t)=>e!==t)}=e,i=ut(n),a=ut(o),[s,l]=c(r),d=void 0!==t,u=d?t:s,p=ut((e=>{const t="function"==typeof e?e(u):e;a(u,t)&&(d||l(t),i(t))}),[d,i,u,a]);return[u,p]}function ht(e,t,r){const n=a(e),o=a(D(e,t,r));return s((()=>{n.current=e})),s((()=>{o.current=D((function(){n.current(...arguments)}),t,r)}),[t,r]),o.current}function mt(e){let{data:t,options:o,columns:i,onSearch:a}=e;const[s,l]=c(0),d={"ui:col":10,"ui:order":o.order},u={};o.fields.forEach((e=>{const t=i.find((t=>t.dataIndex===e));if(t){const r=t.title;if("string"==typeof r){if(d[e]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[e]},t.valueEnum){const n=t.valueEnum;return d[e]["ui:placeholder"]="请选择",u[e]={title:r,type:"string",enum:Object.keys(n).flatMap((e=>"string"==typeof n[e].text?[e]:[])),enumNames:Object.keys(n).flatMap((e=>{const t=n[e].text;return"string"==typeof t?[t]:[]}))}}return u[e]={title:r,type:"string"}}}})),o.extraFields&&Object.entries(o.extraFields).forEach((e=>{let[t,r]=e;d[t]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[t]},u[t]={title:r,type:"string"}}));const h={type:"object",properties:u},m=p((e=>{let{formData:t}=e;a(t)}),[a]),f=p((()=>{l((e=>e+1)),a({})}),[]);return r(ft,{children:r(nt,{formContext:{layout:"horizontal"},schema:h,uiSchema:d,onSubmit:m,formData:t,children:r("div",{className:"col-2 ms-auto mt-auto",children:n("div",{className:"justify-content-end d-flex gap-2 ",children:[r(le,{className:"px-4",onClick:f,variant:"secondary",children:"重置"}),r(le,{className:"px-4",type:"submit",variant:"primary",children:"查询"})]})})})},s)}const ft=_.div`
|
|
99
99
|
margin-bottom: 1rem;
|
|
100
100
|
`;function gt(e){let{keyword:t,onKeywordChange:n}=e;const[o,i]=c(t),a=ht(n,500);s((()=>{i(t)}),[t]);const l=p((e=>{i(e.target.value),a(e.target.value)}),[a,i]);return r(P,{value:o,onChange:l,type:"search",placeholder:"Search..."})}const yt=_.thead`
|
|
101
101
|
th {
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils/message.ts","../src/components/modal/message.tsx","../src/hooks/use-state-with-callback.ts","../src/components/modal/show.tsx","../src/components/tooltip.tsx","../src/components/table/context.ts","../src/components/button.tsx","../src/components/modal/confirm.tsx","../src/components/modal/index.tsx","../src/errors/unauthorized.ts","../src/utils/toast.tsx","../src/request.ts","../src/hooks/use-safe-state.ts","../src/hooks/use-unmounted-ref.ts","../src/utils/wait-pay-complete.tsx","../src/components/result.tsx","../src/components/dimmer.tsx","../src/components/loader.tsx","../src/components/card.tsx","../src/components/error.tsx","../src/components/space.tsx","../src/images/step_check.svg","../src/components/steps.tsx","../src/components/statistic.tsx","../src/components/pagination.tsx","../src/components/number-format.tsx","../src/components/loading-button.tsx","../src/components/image-zoom.tsx","../src/components/request-button.tsx","../src/components/form.tsx","../src/components/table/use-selection.tsx","../src/images/plus_square.svg","../src/images/minus_square.svg","../src/hooks/use-callback-ref.ts","../src/hooks/use-controllable-state.ts","../src/hooks/use-debounce.ts","../src/components/table/search.tsx","../src/components/table/index.tsx","../src/hooks/use-overlay-state.ts","../src/components/modal-button.tsx","../src/components/modal-form.tsx","../src/hooks/use-request.ts"],"sourcesContent":["import Swal from 'sweetalert2/dist/sweetalert2.js';\r\nimport withReactContent from 'sweetalert2-react-content';\r\nimport { SweetAlertOptions, SweetAlertResult } from 'sweetalert2';\r\n\r\nconst CustomSwal = withReactContent(Swal);\r\n\r\ninterface MessageOptions<T = any> extends SweetAlertOptions<T> {\r\n\r\n}\r\n\r\nconst defaultOptions: MessageOptions = {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n};\r\n\r\nconst Message = {\r\n confirm: async <T = any>(options: MessageOptions<T>) => {\r\n const { isConfirmed } = await CustomSwal.fire({\r\n ...defaultOptions,\r\n icon: 'warning',\r\n showCancelButton: true,\r\n ...options,\r\n async preConfirm(data) {\r\n if (options.preConfirm) {\r\n try {\r\n return await options.preConfirm(data);\r\n } catch (e) {\r\n if (e instanceof Error) {\r\n CustomSwal.showValidationMessage(e.message);\r\n }\r\n return false;\r\n }\r\n }\r\n return true;\r\n },\r\n });\r\n\r\n return isConfirmed;\r\n },\r\n success: (options: MessageOptions) => {\r\n CustomSwal.fire({\r\n ...defaultOptions,\r\n toast: true,\r\n position: 'top',\r\n icon: 'success',\r\n timer: 2000,\r\n showConfirmButton: false,\r\n ...options\r\n });\r\n },\r\n error: (options: MessageOptions) => {\r\n CustomSwal.fire({\r\n ...defaultOptions,\r\n toast: true,\r\n position: 'top',\r\n icon: 'error',\r\n timer: 5000,\r\n showConfirmButton: false,\r\n ...options\r\n });\r\n },\r\n close: (result?: SweetAlertResult) => {\r\n CustomSwal.close(result);\r\n },\r\n defaults: defaultOptions\r\n};\r\n\r\nexport default Message;\r\n","import {\r\n ComponentType,\r\n createContext,\r\n Fragment,\r\n ReactNode,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useState\r\n} from 'react';\r\nimport useStateWithCallback from '../../hooks/use-state-with-callback';\r\nimport { ModalProps } from 'react-bootstrap';\r\n\r\ninterface MessageContextType {\r\n container?: ModalProps['container'];\r\n}\r\n\r\nconst MessageContext = createContext<MessageContextType>({});\r\n\r\ntype MessageWrapProps<T, P = void> = {\r\n resolve: (value: P | void) => void\r\n destroy: () => void\r\n message: T\r\n}\r\n\r\nexport type MessageProps<T, P = void> = {\r\n resolve: (value: P | void) => void\r\n message: T\r\n state: {\r\n show: boolean\r\n onHide: () => void\r\n onExited: () => void\r\n container?: ModalProps['container']\r\n }\r\n}\r\n\r\nexport function wrapMessage<T = {}, P = any>(Component: ComponentType<MessageProps<T, P>>): ComponentType<MessageWrapProps<T, P>> {\r\n\r\n return ({ resolve, destroy, message }) => {\r\n\r\n const [show, setShow] = useStateWithCallback(true);\r\n const context = useContext(MessageContext);\r\n\r\n const handleResolve = useCallback((value: P | void) => {\r\n setShow(false, () => {\r\n resolve(value);\r\n });\r\n }, [setShow, resolve]);\r\n\r\n const state = useMemo(() => {\r\n return {\r\n show,\r\n onHide: () => handleResolve(),\r\n onExited: () => destroy(),\r\n container: context.container\r\n };\r\n }, [show, handleResolve, destroy]);\r\n\r\n return <Component\r\n resolve={handleResolve}\r\n state={state}\r\n message={message}\r\n />;\r\n };\r\n}\r\n\r\nexport function createMessage<T = {}, P = any>(Component: ComponentType<MessageWrapProps<T, P>>): (message: T) => Promise<P | void> {\r\n return (message) => {\r\n return new Promise<P | void>((resolve) => {\r\n const component = <Component\r\n resolve={resolve}\r\n destroy={() => {\r\n hide(component);\r\n }}\r\n message={message}\r\n />;\r\n\r\n show(component);\r\n });\r\n };\r\n}\r\n\r\ntype State = Set<ReactNode>\r\n\r\nlet listener: (state: State) => void = () => void 0;\r\n\r\nlet memoryState: State = new Set();\r\n\r\nexport const show = (modal: ReactNode) => {\r\n memoryState = new Set(memoryState);\r\n memoryState.add(modal);\r\n\r\n listener(memoryState);\r\n};\r\n\r\nexport const hide = (modal: ReactNode) => {\r\n memoryState = new Set(memoryState);\r\n memoryState.delete(modal);\r\n\r\n listener(memoryState);\r\n};\r\n\r\nexport default function Message(props: MessageContextType) {\r\n const [state, setState] = useState<State>(memoryState);\r\n useEffect(() => {\r\n listener = setState;\r\n }, []);\r\n\r\n return <MessageContext.Provider value={props}>\r\n {Array.from(state).map((message, index) => <Fragment key={`message-${index}`}>{message}</Fragment>)}\r\n </MessageContext.Provider>;\r\n}\r\n","import { SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport default function useStateWithCallback<S>(initState: S): [S, (value: SetStateAction<S>, callback: () => void) => void] {\n const callbackRef = useRef<Function | null>(null);\n\n const [state, setState] = useState(initState);\n\n useEffect(() => {\n if (callbackRef.current) {\n callbackRef.current();\n callbackRef.current = null;\n }\n }, [state]);\n\n const setCallbackState = (value: SetStateAction<S>, callback: () => void) => {\n callbackRef.current = typeof callback === 'function' ? callback : null;\n setState(value);\n };\n\n return [state, setCallbackState];\n}\n","import { createMessage, MessageProps, wrapMessage } from './message';\r\nimport { ComponentType } from 'react';\r\n\r\nexport default function show<T, P = any>(Component: ComponentType<MessageProps<any, T>>, options?: P) {\r\n return createMessage(wrapMessage(Component))(options);\r\n}\r\n","import { OverlayTrigger, OverlayTriggerProps, Tooltip as BsTooltip } from 'react-bootstrap';\r\nimport { uniqueId } from 'lodash';\r\n\r\ninterface TooltipProps {\r\n tooltip: string;\r\n children: OverlayTriggerProps['children'];\r\n placement?: OverlayTriggerProps['placement'];\r\n}\r\n\r\nexport default function Tooltip({ tooltip, children, placement = 'bottom' }: TooltipProps) {\r\n\r\n return <OverlayTrigger\r\n placement={placement}\r\n overlay={\r\n <BsTooltip id={uniqueId()}>\r\n {tooltip}\r\n </BsTooltip>\r\n }\r\n >\r\n {children}\r\n </OverlayTrigger>;\r\n}\r\n","import { createContext } from 'react';\r\n\r\nexport const TableContext = createContext(false);\r\n","import { Button as BsButton, ButtonProps as BsButtonProps, Spinner } from 'react-bootstrap';\r\nimport { forwardRef, useContext } from 'react';\r\nimport Tooltip from './tooltip';\r\nimport { TableContext } from './table/context';\r\n\r\nexport interface ButtonProps extends BsButtonProps {\r\n loading?: boolean;\r\n percent?: number;\r\n tooltip?: string;\r\n}\r\n\r\nconst Button = forwardRef<any, ButtonProps>((\r\n {\r\n loading,\r\n percent,\r\n disabled,\r\n children,\r\n tooltip,\r\n variant,\r\n ...props\r\n },\r\n ref\r\n) => {\r\n\r\n const inTable = useContext(TableContext);\r\n\r\n if (inTable && !variant) {\r\n variant = 'link';\r\n }\r\n\r\n if (loading) {\r\n disabled = true;\r\n children = <>\r\n <Spinner ref={ref} as='span' size='sm' role='status' aria-hidden='true' animation='border' />\r\n {percent ? <span className='ms-2'>{percent}%</span> : null}\r\n </>;\r\n }\r\n\r\n const button = <BsButton ref={ref} {...props} variant={variant} disabled={disabled}>{children}</BsButton>;\r\n\r\n if (tooltip) {\r\n return <Tooltip tooltip={tooltip}>\r\n <span className={'d-inline-block'}>{button}</span>\r\n </Tooltip>;\r\n }\r\n\r\n return button;\r\n});\r\n\r\nexport default Button;\r\n","import { FC } from 'react';\r\nimport { Modal } from 'react-bootstrap';\r\nimport { createMessage, MessageProps, wrapMessage } from './message';\r\nimport Button from '../button';\r\n\r\ninterface ConfirmOptions {\r\n title?: string;\r\n message: string;\r\n okText?: string;\r\n cancelText?: string;\r\n}\r\n\r\nconst Confirm: FC<MessageProps<ConfirmOptions, true>> = function({\r\n state,\r\n message: {\r\n title,\r\n message,\r\n okText,\r\n cancelText\r\n },\r\n resolve,\r\n}) {\r\n return <Modal centered {...state} >\r\n <Modal.Header>\r\n <Modal.Title as='h5'>{title || '确认'}</Modal.Title>\r\n </Modal.Header>\r\n <Modal.Body>{message}</Modal.Body>\r\n <Modal.Footer>\r\n <Button variant='secondary' onClick={() => resolve()}>{cancelText || '取消'}</Button>\r\n <Button onClick={() => resolve(true)}>{okText || '确定'}</Button>\r\n </Modal.Footer>\r\n </Modal>;\r\n};\r\n\r\nexport default function confirm(options: ConfirmOptions) {\r\n return createMessage(wrapMessage(Confirm))(options);\r\n}\r\n","import { Modal as ReactModal, ModalProps as ReactModalProps } from 'react-bootstrap';\r\nimport { ElementType, MouseEvent, ReactNode, useMemo, useState } from 'react';\r\nimport Button, { ButtonProps } from '../button';\r\nimport show from './show';\r\nimport confirm from './confirm';\r\nimport Message, { MessageProps } from './message';\r\n\r\nexport interface ModalProps extends Pick<\r\n ReactModalProps,\r\n 'style' | 'container' | 'backdrop' | 'centered' | 'size' | 'scrollable' | 'fullscreen' | 'onHide' | 'onShow' | 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited'\r\n> {\r\n children: ReactNode;\r\n header?: ReactNode;\r\n footer?: ReactNode | ((args: { okButton: ReactNode, cancelButton: ReactNode }) => ReactNode);\r\n okText?: string;\r\n cancelText?: string;\r\n closable?: boolean;\r\n show?: boolean;\r\n onOk?: (e: MouseEvent) => void;\r\n onCancel?: (e: MouseEvent) => void;\r\n okButtonProps?: ButtonProps;\r\n bodyAs?: ElementType;\r\n headerAs?: ElementType;\r\n confirmLoading?: boolean;\r\n}\r\n\r\nconst Modal = ({\r\n header,\r\n children,\r\n footer,\r\n closable = true,\r\n show,\r\n cancelText = '取消',\r\n okText = '确定',\r\n onOk,\r\n onCancel,\r\n onHide,\r\n okButtonProps,\r\n bodyAs,\r\n headerAs = 'h5',\r\n confirmLoading = false,\r\n ...rest\r\n}: ModalProps) => {\r\n\r\n const [loading, setLoading] = useState(false);\r\n\r\n const okButton = useMemo(() => {\r\n return <Button loading={loading || confirmLoading} variant={'primary'} onClick={async (e) => {\r\n setLoading(true);\r\n try {\r\n await onOk?.(e);\r\n if (!e.defaultPrevented) {\r\n onHide?.();\r\n }\r\n } finally {\r\n setLoading(false);\r\n }\r\n }} {...okButtonProps}>{okText}</Button>;\r\n }, [okButtonProps, okText, onOk, onHide, loading, confirmLoading]);\r\n\r\n const cancelButton = useMemo(() => {\r\n return <Button variant='secondary' onClick={(e) => {\r\n onCancel?.(e);\r\n if (!e.defaultPrevented) {\r\n onHide?.();\r\n }\r\n }}>{cancelText}</Button>;\r\n }, [onCancel, onHide, cancelText]);\r\n\r\n switch (typeof footer) {\r\n case 'undefined':\r\n footer = <>\r\n {cancelButton}\r\n {okButton}\r\n </>;\r\n break;\r\n case 'function':\r\n footer = footer({ okButton, cancelButton });\r\n break;\r\n }\r\n\r\n return <ReactModal {...rest} onHide={onHide} show={show}>\r\n {header && <ReactModal.Header closeButton={closable}>\r\n <ReactModal.Title as={headerAs}>{header}</ReactModal.Title>\r\n </ReactModal.Header>}\r\n <ReactModal.Body as={bodyAs}>{children}</ReactModal.Body>\r\n {footer && <ReactModal.Footer>{footer}</ReactModal.Footer>}\r\n </ReactModal>;\r\n};\r\n\r\nModal.Message = Message;\r\nModal.confirm = confirm;\r\nModal.show = show;\r\nexport default Modal;\r\nexport { MessageProps };\r\n","export default class Unauthorized extends Error {\r\n\r\n url: string;\r\n\r\n constructor(url: string) {\r\n super('Unauthorized');\r\n this.url = url;\r\n }\r\n}\r\n","import { Alert } from 'react-bootstrap';\r\nimport { NoticeContent, NotificationInstance } from 'rc-notification/lib/Notification';\r\nimport Notification from 'rc-notification';\r\nimport { NotificationProps } from 'rc-notification/es/Notification';\r\n\r\nlet noticeInstance: NotificationInstance | null;\r\n\r\nconst defaultOptions: NotificationProps & {\r\n getContainer?: () => HTMLElement;\r\n} = {};\r\n\r\nfunction getNoticeInstance(callback: (instance: NotificationInstance) => void) {\r\n if (noticeInstance) {\r\n return callback(noticeInstance);\r\n }\r\n\r\n Notification.newInstance({\r\n ...defaultOptions,\r\n prefixCls: 'notification',\r\n maxCount: 5,\r\n style: {\r\n top: 20,\r\n right: 20\r\n }\r\n }, (instance) => {\r\n if (noticeInstance) {\r\n callback(noticeInstance);\r\n return;\r\n }\r\n noticeInstance = instance;\r\n callback(instance);\r\n });\r\n}\r\n\r\n\r\nconst notice = ({ type, ...options }: { type: string } & NoticeContent) => {\r\n getNoticeInstance((instance) => {\r\n options.duration = 3;\r\n let variant = type;\r\n switch (type) {\r\n case 'error':\r\n variant = 'danger';\r\n options.duration = options.closable ? 0 : 5;\r\n break;\r\n }\r\n\r\n options.content = <Alert variant={variant}>{options.content}</Alert>;\r\n\r\n instance.notice(options);\r\n });\r\n};\r\n\r\nconst types = ['error', 'success', 'info'] as const;\r\n\r\ntype ToastType = Record<typeof types[number], (content: string, options?: NoticeContent) => void> & {\r\n defaults: typeof defaultOptions;\r\n};\r\n\r\nconst Toast = types.reduce((toast, type) => {\r\n toast[type] = (content: string, options?: NoticeContent) => {\r\n notice({\r\n ...options,\r\n type,\r\n content\r\n });\r\n };\r\n return toast;\r\n}, {} as any);\r\n\r\nToast.defaults = defaultOptions;\r\n\r\nexport default Toast as ToastType;\r\n","import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';\r\nimport queryString from 'query-string';\r\nimport * as rax from 'retry-axios';\r\nimport { RetryConfig } from 'retry-axios';\r\nimport Unauthorized from './errors/unauthorized';\r\nimport Toast from './utils/toast';\r\n\r\nexport type Errors = string | {\r\n [key: string]: string\r\n}\r\n\r\ndeclare module 'retry-axios' {\r\n interface RetryConfig {\r\n retryDecider?: () => boolean;\r\n }\r\n}\r\n\r\ndeclare module 'axios' {\r\n interface AxiosError {\r\n errors: Errors;\r\n }\r\n\r\n interface AxiosRequestConfig {\r\n raxConfig?: RetryConfig;\r\n authTokenName?: string;\r\n }\r\n}\r\n\r\nrax.attach();\r\n\r\naxios.defaults.raxConfig = {\r\n retryDelay: 2000,\r\n backoffType: 'static',\r\n shouldRetry: ({ config, response }) => {\r\n if (config.raxConfig?.retryDecider && !config.raxConfig.retryDecider()) {\r\n return false;\r\n }\r\n return config.method?.toUpperCase() === 'GET' && response?.status === 449;\r\n }\r\n};\r\naxios.defaults.maxContentLength = Infinity;\r\naxios.defaults.maxBodyLength = Infinity;\r\naxios.defaults.baseURL = '/api';\r\naxios.defaults.authTokenName = 'authorization';\r\naxios.interceptors.request.use(\r\n config => {\r\n const key = config.authTokenName;\r\n if (key) {\r\n const token = localStorage.getItem(key);\r\n\r\n if (token) {\r\n config.headers = {\r\n Authorization: `Bearer ${token}`,\r\n ...config.headers,\r\n };\r\n }\r\n }\r\n return config;\r\n },\r\n error => {\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\nconst isRecord = (data: any): data is Record<string, string> => {\r\n return data && (typeof data === 'object');\r\n};\r\n\r\naxios.interceptors.response.use(\r\n response => {\r\n if (response.status === 201 && response.data.location) {\r\n window.location.href = response.data.location;\r\n response.data = undefined; //防止多次跳转\r\n }\r\n\r\n return response;\r\n },\r\n e => {\r\n if (axios.isAxiosError(e)) {\r\n if (e.response) {\r\n const { data, status } = e.response;\r\n if (status === 401) {\r\n e.errors = 'Unauthorized';\r\n if (isRecord(data) && data.url) {\r\n e = new Unauthorized(data.url);\r\n }\r\n Toast.error('Unauthorized');\r\n } else {\r\n if (isRecord(data)) {\r\n if (status === 422) {\r\n e.errors = data;\r\n } else if ('message' in data) {\r\n e.errors = data['message'];\r\n }\r\n } else {\r\n e.errors = data as string;\r\n }\r\n }\r\n }\r\n }\r\n return Promise.reject(e);\r\n }\r\n);\r\n\r\nexport type RequestConfig = AxiosRequestConfig | string\r\nexport type RequestInstance = AxiosInstance\r\nexport const isRequestError = axios.isAxiosError;\r\n\r\nexport const showRequestError = (e: any) => {\r\n if (axios.isAxiosError(e)) {\r\n let errors = e.errors;\r\n if (typeof e.errors !== 'string') {\r\n errors = Object.values(e.errors).join('<br />');\r\n }\r\n Toast.error(errors as string);\r\n } else {\r\n throw e;\r\n }\r\n};\r\n\r\nconst request = async function <T = any>(config: RequestConfig) {\r\n config = typeof config === 'string' ? { url: config } : config;\r\n\r\n const { data } = await axios.request<T>({\r\n paramsSerializer: function(params) {\r\n return queryString.stringify(params, {\r\n sort: false,\r\n skipNull: true,\r\n skipEmptyString: true,\r\n arrayFormat: 'bracket',\r\n });\r\n },\r\n ...config\r\n });\r\n\r\n return data;\r\n};\r\n\r\nrequest.defaults = axios.defaults;\r\nrequest.interceptors = axios.interceptors;\r\n\r\nexport default request;\r\n","import { useCallback, useState } from 'react';\r\nimport type { Dispatch, SetStateAction } from 'react';\r\nimport useUnmountedRef from './use-unmounted-ref';\r\n\r\nfunction useSafeState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];\r\n\r\nfunction useSafeState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];\r\n\r\nfunction useSafeState<S>(initialState?: S | (() => S)) {\r\n const unmountedRef = useUnmountedRef();\r\n const [state, setState] = useState(initialState);\r\n const setCurrentState = useCallback((currentState) => {\r\n /** if component is unmounted, stop update */\r\n if (unmountedRef.current) return;\r\n setState(currentState);\r\n }, []);\r\n\r\n return [state, setCurrentState] as const;\r\n}\r\n\r\nexport default useSafeState;\r\n","import { useEffect, useRef } from 'react';\r\n\r\nconst useUnmountedRef = () => {\r\n const unmountedRef = useRef(false);\r\n useEffect(() => {\r\n unmountedRef.current = false;\r\n return () => {\r\n unmountedRef.current = true;\r\n };\r\n }, []);\r\n return unmountedRef;\r\n};\r\n\r\nexport default useUnmountedRef;\r\n","import show from '../components/modal/show';\r\nimport Modal, { MessageProps } from '../components/modal';\r\nimport { useEffect, useRef } from 'react';\r\nimport request from '../request';\r\nimport useSafeState from '../hooks/use-safe-state';\r\n\r\ninterface PayResult {\r\n pay_url: string;\r\n order_no: string;\r\n}\r\n\r\ninterface Options {\r\n result: PayResult;\r\n checkUrl: string;\r\n onComplete?: () => void;\r\n}\r\n\r\nconst WaitModal = function({ state, message, resolve }: MessageProps<Options>) {\r\n\r\n const open = useRef(true);\r\n const { result, checkUrl, onComplete } = message;\r\n const [checking, setChecking] = useSafeState(false);\r\n\r\n useEffect(() => {\r\n request({\r\n url: checkUrl,\r\n method: 'post',\r\n data: { order_no: result.order_no },\r\n raxConfig: {\r\n shouldRetry(err) {\r\n return open.current && err.response?.status === 449;\r\n }\r\n }\r\n }).then(() => {\r\n onComplete?.();\r\n resolve();\r\n }).catch(() => null);\r\n }, []);\r\n\r\n return <Modal\r\n {...state}\r\n centered\r\n onHide={() => {\r\n open.current = false;\r\n state.onHide();\r\n }}\r\n backdrop='static'\r\n header='支付结果'\r\n okText='已完成支付'\r\n okButtonProps={{ loading: checking }}\r\n onOk={async (e) => {\r\n e.preventDefault();\r\n try {\r\n setChecking(true);\r\n await request({\r\n url: checkUrl,\r\n method: 'post',\r\n data: { order_no: result.order_no },\r\n raxConfig: {\r\n shouldRetry() {\r\n return false;\r\n }\r\n }\r\n });\r\n onComplete?.();\r\n resolve();\r\n } catch {\r\n // ignore\r\n } finally {\r\n setChecking(false);\r\n }\r\n }}\r\n cancelText='取消'\r\n >\r\n 请在新打开的页面上进行支付,支付完成后再关闭此窗口\r\n </Modal>;\r\n};\r\n\r\nexport default function waitPayComplete(options: Options) {\r\n const { result } = options;\r\n window.open(result.pay_url);\r\n show(WaitModal, options);\r\n}\r\n","import { ReactNode } from 'react';\r\nimport styled from 'styled-components';\r\n\r\nconst Container = styled.div`\r\n padding: 48px 32px;\r\n`;\r\n\r\nconst Icon = styled.div`\r\n margin-bottom: 24px;\r\n text-align: center;\r\n font-size: 72px;\r\n`;\r\n\r\nconst Title = styled.div`\r\n color: rgba(0, 0, 0, .85);\r\n font-size: 24px;\r\n line-height: 1.8;\r\n text-align: center;\r\n`;\r\n\r\nconst Extra = styled.div`\r\n margin-top: 32px;\r\n text-align: center;\r\n`;\r\n\r\nconst IconMap = {\r\n success: <i className='bi bi-check-circle-fill text-success' />,\r\n error: <i className='bi bi-exclamation-circle-fill text-danger' />,\r\n info: <i className='bi bi-info-circle-fill text-info' />,\r\n warning: <i className='bi bi-exclamation-triangle-fill text-warning' />,\r\n};\r\n\r\ninterface ResultProps {\r\n status?: keyof typeof IconMap\r\n icon?: ReactNode\r\n title?: string\r\n extra?: ReactNode;\r\n}\r\n\r\nexport default function Result({ status, title, icon, extra }: ResultProps) {\r\n\r\n if (!icon && status) {\r\n icon = IconMap[status];\r\n }\r\n\r\n return <Container>\r\n {icon && <Icon>{icon}</Icon>}\r\n {title && <Title>{title}</Title>}\r\n {extra && <Extra>{extra}</Extra>}\r\n </Container>;\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const Dimmable = styled.div`\r\n position: relative;\r\n`;\r\n\r\ninterface DimmerProps {\r\n active?: boolean\r\n inverted?: boolean\r\n}\r\n\r\nconst Dimmer = styled.div<DimmerProps>`\r\n display: ${props => props.active ? 'flex' : 'none'};\r\n position: absolute;\r\n top: 0 !important;\r\n left: 0 !important;\r\n width: 100%;\r\n height: 100%;\r\n text-align: center;\r\n vertical-align: middle;\r\n padding: 1em;\r\n background-color: ${props => props.inverted ? 'rgba(255, 255, 255, .85)' : 'rgba(0, 0, 0, .85)'};\r\n opacity: ${props => props.active ? 1 : 0};\r\n line-height: 1;\r\n animation-fill-mode: both;\r\n animation-duration: .5s;\r\n transition: background-color .5s linear;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n user-select: none;\r\n will-change: opacity;\r\n z-index: 990;\r\n`;\r\n\r\nexport default Dimmer;\r\n","import { PropsWithChildren } from 'react';\r\nimport { Spinner, SpinnerProps } from 'react-bootstrap';\r\nimport Dimmer from './dimmer';\r\nimport styled from 'styled-components';\r\n\r\ninterface LoaderProps {\r\n loading?: boolean;\r\n animation?: SpinnerProps['animation'];\r\n wrap?: boolean | number;\r\n}\r\n\r\nexport default function Loader({\r\n loading = true,\r\n children,\r\n variant = 'primary',\r\n animation = 'border',\r\n wrap,\r\n ...props\r\n}: PropsWithChildren<LoaderProps & Omit<SpinnerProps, 'animation'>>): JSX.Element | null {\r\n if (!loading) {\r\n return null;\r\n }\r\n\r\n if (children) {\r\n children = <p className='mt-3 text-secondary'>{children}</p>;\r\n }\r\n\r\n children = <Dimmer inverted active>\r\n <Spinner animation={animation} variant={variant} {...props} />\r\n {children}\r\n </Dimmer>;\r\n\r\n if (wrap) {\r\n return <Wrap $height={typeof wrap === 'number' ? wrap : 150}>\r\n {children}\r\n </Wrap>;\r\n }\r\n\r\n return children as JSX.Element;\r\n}\r\n\r\nconst Wrap = styled.div<{ $height: number }>`\r\n position: relative;\r\n height: ${props => `${props.$height}px`};\r\n`;\r\n","import { PropsWithChildren } from 'react';\r\nimport { Card as BsCard, CardProps as BsCardProps } from 'react-bootstrap';\r\nimport classNames from 'classnames';\r\n\r\ninterface CardProps extends BsCardProps {\r\n title?: string;\r\n}\r\n\r\nexport default function Card({ children, title, className, ...props }: PropsWithChildren<CardProps>) {\r\n\r\n return <BsCard className={classNames('border-0 shadow-sm mb-3', className)} {...props}>\r\n <div className='card-body'>\r\n {title && <>\r\n <h5>{title}</h5>\r\n <hr />\r\n </>}\r\n {children}\r\n </div>\r\n </BsCard>;\r\n}\r\n","import { Alert } from 'react-bootstrap';\r\nimport { Errors } from '../request';\r\n\r\nexport default function Error({ errors }: { errors?: Errors }) {\r\n if (!errors) {\r\n return null;\r\n }\r\n return <Alert variant='danger'>\r\n <ul className='mb-0'>\r\n {typeof errors === 'string'\r\n ? <li>{errors}</li>\r\n : Object.entries(errors).map(([name, error]) => <li key={name}>{error}</li>)\r\n }\r\n </ul>\r\n </Alert>;\r\n}\r\n","import { Children, ReactNode } from 'react';\r\nimport styled, { css } from 'styled-components';\r\n\r\ninterface SpaceProps {\r\n children: ReactNode;\r\n size?: 'small' | 'middle' | 'large' | number;\r\n direction?: 'vertical' | 'horizontal';\r\n className?: string;\r\n}\r\n\r\n\r\nexport default function Space({ children, className, size = 'small', direction = 'horizontal' }: SpaceProps) {\r\n\r\n if (typeof size === 'string') {\r\n size = {\r\n small: 8,\r\n middle: 16,\r\n large: 24\r\n }[size];\r\n }\r\n\r\n const items = Children.map(children, (child) => {\r\n if (child) {\r\n return <Item>{child}</Item>;\r\n }\r\n });\r\n\r\n return <Container className={className} $direction={direction} $size={size}>\r\n {items}\r\n </Container>;\r\n}\r\n\r\nconst Container = styled.div<{ $size: number, $direction: string }>`\r\n display: inline-flex;\r\n align-items: center;\r\n gap: ${props => props.$size}px;\r\n\r\n ${props => props.$direction === 'vertical' && css`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: inherit;\r\n `}\r\n`;\r\n\r\nconst Item = styled.div`\r\n\r\n`;\r\n","var img = \"data:image/svg+xml,%3csvg t='1651217947509' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2548' width='16' height='16' fill='currentColor'%3e %3cpath d='M887.904 298.208c-12.864-12.064-33.152-11.488-45.216 1.408L415.936 753.984l-233.12-229.696C170.208 511.872 149.952 512 137.536 524.608c-12.416 12.576-12.256 32.864 0.352 45.248l256.48 252.672c0.096 0.096 0.224 0.128 0.32 0.224 0.096 0.096 0.128 0.224 0.224 0.32 2.016 1.92 4.448 3.008 6.784 4.288 1.152 0.672 2.144 1.664 3.36 2.144 3.776 1.472 7.776 2.24 11.744 2.24 4.192 0 8.384-0.832 12.288-2.496 1.312-0.544 2.336-1.664 3.552-2.368 2.4-1.408 4.896-2.592 6.944-4.672 0.096-0.096 0.128-0.256 0.224-0.352 0.064-0.096 0.192-0.128 0.288-0.224l449.184-478.208C901.44 330.592 900.768 310.336 887.904 298.208z' p-id='2549'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","import RcSteps from 'rc-steps';\r\nimport 'rc-steps/assets/index.css';\r\nimport styled from 'styled-components';\r\nimport { ComponentProps } from 'react';\r\nimport { ReactComponent as CheckIcon } from '../images/step_check.svg';\r\n\r\nexport default function Steps(props: ComponentProps<typeof RcSteps>) {\r\n return <CustomRcSteps\r\n icons={{\r\n finish: <CheckIcon />,\r\n error: <></>\r\n }}\r\n {...props}\r\n />;\r\n}\r\n\r\nSteps.Step = RcSteps.Step;\r\n\r\nconst CustomRcSteps = styled(RcSteps)`\r\n .rc-steps-item-icon {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n & > .rc-steps-icon {\r\n top: 0;\r\n }\r\n }\r\n\r\n .rc-steps-item-process {\r\n .rc-steps-item-icon {\r\n background: var(--bs-primary);\r\n border-color: var(--bs-primary);\r\n }\r\n }\r\n\r\n .rc-steps-item-finish {\r\n .rc-steps-item-icon {\r\n border-color: var(--bs-primary);\r\n\r\n & > .rc-steps-icon {\r\n color: var(--bs-primary);\r\n }\r\n }\r\n\r\n .rc-steps-item-title:after {\r\n background-color: var(--bs-primary);\r\n }\r\n }\r\n\r\n`;\r\n","import { ReactNode } from 'react';\r\nimport Card from './card';\r\nimport styled from 'styled-components';\r\n\r\nexport interface StatisticProps {\r\n title: ReactNode;\r\n content: ReactNode;\r\n footer?: ReactNode;\r\n}\r\n\r\nexport default function Statistic({ title, content, footer }: StatisticProps) {\r\n\r\n return <Card>\r\n <Title>{title}</Title>\r\n <Content>{content}</Content>\r\n {footer && <Footer>{footer}</Footer>}\r\n </Card>;\r\n}\r\n\r\nconst Footer = styled.div`\r\n margin-top: 9px;\r\n padding-top: 10px;\r\n border-top: 1px solid #f0f0f0;\r\n color: rgba(0, 0, 0, .65);\r\n`;\r\n\r\nconst Content = styled.div`\r\n color: rgba(0, 0, 0, .85);\r\n font-size: 24px;\r\n`;\r\n\r\nconst Title = styled.div`\r\n margin-bottom: 4px;\r\n color: rgba(0, 0, 0, .45);\r\n font-size: 1.1rem;\r\n`;\r\n\r\n","import { ReactNode, useCallback, useEffect, useMemo, useState } from 'react';\r\nimport { Pagination as BsPagination } from 'react-bootstrap';\r\n\r\nfunction noop() {\r\n}\r\n\r\n\r\nfunction isInteger(value: any): value is number {\r\n return (\r\n typeof value === 'number' && isFinite(value) && Math.floor(value) === value\r\n );\r\n}\r\n\r\nexport interface PaginationProps {\r\n className?: string\r\n total: number\r\n current?: number\r\n defaultCurrent?: number\r\n pageSize?: number\r\n defaultPageSize?: number,\r\n onChange?: (current: number, pageSize: number) => void\r\n}\r\n\r\nexport default function Pagination({\r\n total = 0,\r\n onChange = noop,\r\n defaultCurrent = 1,\r\n defaultPageSize = 10,\r\n className,\r\n ...props\r\n}: PaginationProps) {\r\n\r\n const [current, setCurrent] = useState(defaultCurrent);\r\n const [pageSize, setPageSize] = useState(defaultPageSize);\r\n\r\n useEffect(() => {\r\n if (isInteger(props.current)) {\r\n setCurrent(props.current);\r\n }\r\n }, [props.current]);\r\n\r\n useEffect(() => {\r\n if (isInteger(props.pageSize)) {\r\n setPageSize(props.pageSize);\r\n }\r\n }, [props.pageSize]);\r\n\r\n const allPages = useMemo(() => {\r\n return Math.floor((total - 1) / pageSize) + 1;\r\n }, [total, pageSize]);\r\n\r\n const handleChange = useCallback((p: number) => {\r\n return () => {\r\n if (p !== current) {\r\n setCurrent(p);\r\n onChange(p, pageSize);\r\n }\r\n };\r\n }, [onChange, current, pageSize]);\r\n\r\n const pageBufferSize = 2;\r\n const prevPage = current - 1 > 0 ? current - 1 : 0;\r\n const nextPage = current + 1 < allPages ? current + 1 : allPages;\r\n\r\n const pagerList: ReactNode[] = [];\r\n let jumpPrev: ReactNode = null;\r\n let jumpNext: ReactNode = null;\r\n let firstPager: ReactNode = null;\r\n let lastPager: ReactNode = null;\r\n\r\n if (allPages <= 3 + pageBufferSize * 2) {\r\n for (let i = 1; i <= allPages; i += 1) {\r\n const active = current === i;\r\n pagerList.push(\r\n <BsPagination.Item key={i} active={active} onClick={handleChange(i)}>{i}</BsPagination.Item>\r\n );\r\n }\r\n } else {\r\n lastPager = <BsPagination.Last key='last' onClick={handleChange(allPages)} />;\r\n firstPager = <BsPagination.First key='first' onClick={handleChange(1)} />;\r\n jumpPrev = <BsPagination.Prev key='prev' onClick={handleChange(prevPage)} />;\r\n jumpNext = <BsPagination.Next key='next' onClick={handleChange(nextPage)} />;\r\n\r\n let left = Math.max(1, current - pageBufferSize);\r\n let right = Math.min(current + pageBufferSize, allPages);\r\n\r\n if (current - 1 <= pageBufferSize) {\r\n right = 1 + pageBufferSize * 2;\r\n }\r\n\r\n if (allPages - current <= pageBufferSize) {\r\n left = allPages - pageBufferSize * 2;\r\n }\r\n\r\n for (let i = left; i <= right; i += 1) {\r\n const active = current === i;\r\n pagerList.push(\r\n <BsPagination.Item key={i} active={active} onClick={handleChange(i)}>{i}</BsPagination.Item>\r\n );\r\n }\r\n\r\n if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {\r\n pagerList.unshift(jumpPrev);\r\n }\r\n if (\r\n allPages - current >= pageBufferSize * 2 &&\r\n current !== allPages - 2\r\n ) {\r\n pagerList.push(jumpNext);\r\n }\r\n\r\n if (left !== 1) {\r\n pagerList.unshift(firstPager);\r\n }\r\n if (right !== allPages) {\r\n pagerList.push(lastPager);\r\n }\r\n }\r\n\r\n return <BsPagination className={className}>\r\n {pagerList}\r\n </BsPagination>;\r\n\r\n}\r\n","import { useMemo } from 'react';\r\n\r\ninterface Props {\r\n value: number;\r\n currency?: boolean;\r\n locale?: string;\r\n className?: string;\r\n options?: Intl.NumberFormatOptions;\r\n}\r\n\r\nexport default function NumberFormat({ className, value, locale = 'zh-CN', currency = true, options = {} }: Props) {\r\n\r\n const formatter = useMemo(() => {\r\n\r\n let opt;\r\n\r\n if (currency) {\r\n opt = {\r\n style: 'currency',\r\n currency: 'CNY'\r\n };\r\n } else {\r\n opt = {\r\n minimumFractionDigits: 2,\r\n };\r\n }\r\n\r\n return new Intl.NumberFormat(locale, { ...opt, ...options });\r\n }, [currency, locale, options]);\r\n\r\n if (className) {\r\n return <span className={className}>{formatter.format(value)}</span>;\r\n }\r\n\r\n return <>{formatter.format(value)}</>;\r\n}\r\n","import { Button, ButtonProps } from 'react-bootstrap';\r\n\r\ninterface CustomButtonProps extends ButtonProps {\r\n loading: boolean;\r\n}\r\n\r\nexport default function LoadingButton({ loading, disabled, children, ...props }: CustomButtonProps) {\r\n\r\n return <Button {...props} disabled={loading || disabled}>\r\n {loading ? 'Loading…' : children}\r\n </Button>;\r\n}\r\n","import { ComponentProps, lazy, Suspense } from 'react';\r\n\r\nconst LazyImageZoom = lazy(() => import('./lazy/image-zoom'));\r\n\r\nexport default function ImageZoom(props: ComponentProps<typeof LazyImageZoom>) {\r\n return <Suspense fallback={null}>\r\n <LazyImageZoom {...props} />\r\n </Suspense>;\r\n}\r\n","import request, { RequestConfig, showRequestError } from '../request';\r\nimport { createElement, ElementType, MouseEvent, useCallback } from 'react';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport Button, { ButtonProps } from './button';\r\nimport useSafeState from '../hooks/use-safe-state';\r\nimport Modal from './modal';\r\n\r\ninterface Props extends Omit<ButtonProps, 'as'> {\r\n url: RequestConfig;\r\n method?: AxiosRequestConfig['method'];\r\n confirm?: string;\r\n onSuccess?: (result: any) => void;\r\n as?: ElementType | ButtonProps['as'];\r\n}\r\n\r\nexport default function RequestButton({\r\n url,\r\n method,\r\n confirm,\r\n onSuccess,\r\n children,\r\n disabled,\r\n as = Button,\r\n ...props\r\n}: Props) {\r\n\r\n const [fetching, setFetching] = useSafeState(false);\r\n\r\n const handleClick = useCallback(async (e: MouseEvent) => {\r\n e.preventDefault();\r\n try {\r\n setFetching(true);\r\n if (confirm) {\r\n if (!await Modal.confirm({ message: confirm })) {\r\n return;\r\n }\r\n }\r\n\r\n const config = typeof url === 'string' ? { url, method } : { method, ...url };\r\n\r\n const result = await request(config);\r\n\r\n if (onSuccess) {\r\n onSuccess(result);\r\n }\r\n } catch (e) {\r\n showRequestError(e);\r\n } finally {\r\n setFetching(false);\r\n }\r\n }, [url, method, setFetching]);\r\n\r\n return createElement(as, {\r\n ...props,\r\n disabled: disabled || fetching,\r\n onClick: handleClick\r\n }, children);\r\n}\r\n","import JsonForm, { getRegistry, JsonFormProps, JsonFormType } from '@topthink/json-form';\r\nimport * as React from 'react';\r\nimport {\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useCallback,\r\n useState\r\n} from 'react';\r\nimport axios, { AxiosError, Method } from 'axios';\r\nimport request from '../request';\r\nimport { mapValues } from 'lodash';\r\nimport { AjvError, ISubmitEvent, WidgetProps } from '@rjsf/core';\r\nimport Button from './button';\r\nimport useSafeState from '../hooks/use-safe-state';\r\n\r\nconst localize = require('ajv-i18n/localize/zh');\r\n\r\nexport interface FormProps<T = any> extends JsonFormProps<T> {\r\n onSuccess?: (data: any) => void;\r\n method?: Method;\r\n children?: ReactNode | ((props: { submit: ReactNode, loading: boolean }) => ReactNode);\r\n submitText?: string;\r\n onSubmitting?: (submitting: boolean) => void;\r\n transformData?: (data: T) => T;\r\n}\r\n\r\ntype Error = {\r\n __errors: string[]\r\n}\r\n\r\ntype Errors = Error | {\r\n [key: string]: Error\r\n}\r\n\r\nconst toExtraErrors = (error: AxiosError): Errors => {\r\n const errors = error.errors;\r\n if (typeof errors === 'string') {\r\n return {\r\n __errors: [errors]\r\n };\r\n }\r\n return mapValues(errors, (e) => {\r\n return {\r\n __errors: [e]\r\n };\r\n });\r\n};\r\n\r\nconst widgets = {\r\n upload: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onUpload = async (file: File) => {\r\n\r\n const data = new FormData();\r\n\r\n data.set('file', file);\r\n\r\n const { url } = await request({\r\n url: options.endpoint as string,\r\n method: 'post',\r\n data\r\n });\r\n\r\n return url;\r\n };\r\n }\r\n\r\n return <widgets.upload {...props} options={options} />;\r\n },\r\n editor: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onUpload = async (file: File) => {\r\n\r\n const data = new FormData();\r\n\r\n data.set('file', file);\r\n\r\n const { url } = await request({\r\n url: options.endpoint as string,\r\n method: 'post',\r\n data\r\n });\r\n\r\n return url;\r\n };\r\n }\r\n\r\n return <widgets.editor {...props} options={options} />;\r\n },\r\n typeahead: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onSearch = async ({ value, query }) => {\r\n return await request({\r\n url: options.endpoint as string,\r\n params: { value, query }\r\n });\r\n };\r\n }\r\n\r\n return <widgets.typeahead {...props} options={options} />;\r\n }\r\n};\r\n\r\nexport interface FormType extends JsonFormType {\r\n\r\n}\r\n\r\ntype Form<T = any> = ForwardRefExoticComponent<PropsWithoutRef<FormProps<T>> & RefAttributes<FormType>>\r\n\r\nconst Form: Form = forwardRef(({\r\n action,\r\n method = 'post',\r\n onSuccess,\r\n formData,\r\n onSubmitting,\r\n onSubmit,\r\n onChange,\r\n submitText = '提交',\r\n transformData,\r\n children,\r\n ...props\r\n}, ref) => {\r\n\r\n const [extraErrors, setExtraErrors] = useState<Errors>();\r\n const [loading, setLoading] = useSafeState(false);\r\n const [data, setData] = useState(formData);\r\n\r\n const handleSubmit = useCallback(async (e: ISubmitEvent<any>, nativeEvent: React.FormEvent<HTMLFormElement>) => {\r\n if (!loading) {\r\n try {\r\n setLoading(true);\r\n if (onSubmitting) {\r\n onSubmitting(true);\r\n }\r\n if (action) {\r\n let { formData } = e;\r\n\r\n if (transformData) {\r\n formData = transformData(formData);\r\n }\r\n\r\n //todo 包含File对象需转FormData\r\n try {\r\n const result = await request({\r\n url: action,\r\n method,\r\n data: formData\r\n });\r\n setExtraErrors(undefined);\r\n if (onSuccess) {\r\n await onSuccess(result);\r\n }\r\n return result;\r\n } catch (e) {\r\n if (axios.isAxiosError(e)) {\r\n setExtraErrors(toExtraErrors(e));\r\n } else {\r\n throw e;\r\n }\r\n }\r\n } else if (onSubmit) {\r\n return await onSubmit(e, nativeEvent);\r\n }\r\n } finally {\r\n setLoading(false);\r\n if (onSubmitting) {\r\n onSubmitting(false);\r\n }\r\n }\r\n }\r\n }, [action, method, onSubmit]);\r\n\r\n const handleChange = useCallback((e: ISubmitEvent<any>) => {\r\n const { formData } = e;\r\n setData(formData);\r\n if (onChange) {\r\n onChange(e);\r\n }\r\n }, [setData, onChange]);\r\n\r\n const transformErrors = useCallback((errors: AjvError[]) => {\r\n errors = errors.map(error => ({\r\n keyword: error.name,\r\n dataPath: error.property,\r\n ...error\r\n }));\r\n\r\n localize(errors);\r\n\r\n return errors;\r\n }, []);\r\n\r\n const submit = <Button className={'px-4'} loading={loading} type='submit' variant='primary'>{submitText}</Button>;\r\n\r\n if (typeof children === 'function') {\r\n children = children({ submit, loading });\r\n }\r\n\r\n return <JsonForm\r\n ref={ref}\r\n extraErrors={extraErrors}\r\n onSubmit={handleSubmit}\r\n transformErrors={transformErrors}\r\n noHtml5Validate\r\n noValidate\r\n {...props}\r\n formData={data}\r\n onChange={handleChange}\r\n widgets={widgets}\r\n >\r\n {children || <div className='col-12'>\r\n {submit}\r\n </div>}\r\n </JsonForm>;\r\n});\r\n\r\nexport default Form;\r\n","import { Columns, TableProps, TableRowSelection } from './index';\r\nimport { InputHTMLAttributes, Key, useCallback, useEffect, useRef, useState } from 'react';\r\n\r\nconst Checkbox = function({\r\n indeterminate = false,\r\n ...props\r\n}: InputHTMLAttributes<HTMLInputElement> & { indeterminate?: boolean }) {\r\n\r\n const ref = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (ref.current) {\r\n ref.current.indeterminate = indeterminate;\r\n }\r\n }, [indeterminate]);\r\n\r\n return <input\r\n ref={ref}\r\n {...props}\r\n className='form-check-input'\r\n type='checkbox'\r\n />;\r\n};\r\n\r\nexport default function useSelection<T = any>(\r\n rowSelection: TableRowSelection<T> | undefined,\r\n rowKey: Required<TableProps<T>>['rowKey'],\r\n data: T[]\r\n): [(columns: Columns<T>) => Columns<T>, (keys: Key[]) => void] {\r\n const [keys, setKeys] = useState(() => new Set(rowSelection?.selectedRowKeys || []));\r\n\r\n const getRowKey = (record: T) => {\r\n if (typeof rowKey === 'string') {\r\n // @ts-ignore\r\n return record[rowKey];\r\n } else {\r\n return rowKey(record);\r\n }\r\n };\r\n\r\n const getRecordByKey = (key: Key) => {\r\n return data.find((record) => {\r\n return getRowKey(record) === key;\r\n })!;\r\n };\r\n\r\n const setSelectedKeys = useCallback((keys: Set<Key> | Key[]) => {\r\n if (!(keys instanceof Set)) {\r\n keys = new Set(keys);\r\n }\r\n\r\n setKeys(keys);\r\n const changedKeys = Array.from(keys);\r\n\r\n const records = changedKeys.map(function(key) {\r\n return getRecordByKey(key);\r\n });\r\n\r\n if (rowSelection?.onChange) {\r\n rowSelection?.onChange(changedKeys, records);\r\n }\r\n }, [getRecordByKey]);\r\n\r\n const transformColumns = useCallback((columns: Columns): Columns => {\r\n if (!rowSelection) {\r\n return columns;\r\n }\r\n\r\n const recordKeys = data.map(getRowKey);\r\n\r\n const checkedCurrentAll = recordKeys.every(function(key) {\r\n return keys.has(key);\r\n });\r\n\r\n const checkedCurrentSome = recordKeys.some(function(key) {\r\n return keys.has(key);\r\n });\r\n\r\n return [{\r\n key: 'selection',\r\n title: <Checkbox\r\n checked={checkedCurrentAll && data.length > 0}\r\n indeterminate={!checkedCurrentAll && checkedCurrentSome}\r\n onChange={() => {\r\n if (checkedCurrentAll) {\r\n recordKeys.forEach(function(key) {\r\n keys.delete(key);\r\n });\r\n } else {\r\n recordKeys.forEach(function(key) {\r\n keys.add(key);\r\n });\r\n }\r\n setSelectedKeys(new Set(keys));\r\n }}\r\n />,\r\n width: 30,\r\n align: 'center',\r\n render({ record }) {\r\n const key = getRowKey(record);\r\n const checked = keys.has(key);\r\n return <Checkbox\r\n checked={checked}\r\n onChange={() => {\r\n if (checked) {\r\n keys.delete(key);\r\n } else {\r\n keys.add(key);\r\n }\r\n setSelectedKeys(new Set(keys));\r\n }}\r\n />;\r\n }\r\n }, ...columns];\r\n }, [data, rowSelection, keys]);\r\n\r\n return [transformColumns, setSelectedKeys];\r\n}\r\n","var img = \"data:image/svg+xml,%3csvg t='1681378941268' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='11434' width='16' height='16' fill='currentColor'%3e %3cpath d='M252.068571 906.496h520.283429c89.581714 0 134.144-44.562286 134.144-132.845714V250.331429c0-88.283429-44.562286-132.845714-134.144-132.845715H252.068571c-89.142857 0-134.582857 44.141714-134.582857 132.845715V773.668571c0 88.704 45.44 132.845714 134.582857 132.845715z m1.28-68.992c-42.843429 0-66.852571-22.710857-66.852571-67.291429V253.805714c0-44.580571 24.009143-67.291429 66.852571-67.291428h517.723429c42.422857 0 66.432 22.710857 66.432 67.291428V770.194286c0 44.580571-24.009143 67.291429-66.432 67.291428z m258.432-123.008c22.710857 0 36.425143-15.853714 36.425143-40.704v-126.427429h134.144c24.009143 0 40.722286-12.873143 40.722286-35.584 0-23.131429-15.853714-36.425143-40.722286-36.425142H548.205714v-134.582858c0-24.850286-13.714286-40.704-36.425143-40.704s-35.565714 16.713143-35.565714 40.722286v134.582857H342.491429c-24.850286 0-41.142857 13.275429-41.142858 36.406857 0 22.710857 17.152 35.584 41.142858 35.584h133.723428v126.427429c0 23.990857 12.854857 40.704 35.565714 40.704z' p-id='11435'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","var img = \"data:image/svg+xml,%3csvg t='1681378996359' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='12821' width='16' height='16' fill='currentColor'%3e %3cpath d='M252.068571 906.496h520.283429c89.581714 0 134.144-44.562286 134.144-132.845714V250.331429c0-88.283429-44.562286-132.845714-134.144-132.845715H252.068571c-89.142857 0-134.582857 44.141714-134.582857 132.845715V773.668571c0 88.704 45.44 132.845714 134.582857 132.845715z m1.28-68.992c-42.843429 0-66.852571-22.710857-66.852571-67.291429V253.805714c0-44.580571 24.009143-67.291429 66.852571-67.291428h517.723429c42.422857 0 66.432 22.710857 66.432 67.291428V770.194286c0 44.580571-24.009143 67.291429-66.432 67.291428z m86.582858-289.718857h344.576c23.990857 0 40.704-12.854857 40.704-35.565714 0-23.149714-15.433143-36.425143-40.704-36.425143H339.931429c-24.868571 0-40.722286 13.275429-40.722286 36.425143 0 22.710857 16.713143 35.565714 40.722286 35.565714z' p-id='12822'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","import { DependencyList, useCallback, useEffect, useRef } from 'react';\r\n\r\nexport default function useCallbackRef<T extends (...args: any[]) => any>(\r\n callback: T | undefined,\r\n deps: DependencyList = [],\r\n) {\r\n const callbackRef = useRef(callback);\r\n\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n return useCallback(((...args) => callbackRef.current?.(...args)) as T, deps);\r\n}\r\n","import { Dispatch, SetStateAction, useState } from 'react';\r\nimport useCallbackRef from './use-callback-ref';\r\n\r\nexport interface UseControllableStateProps<T> {\r\n value?: T;\r\n defaultValue?: T | (() => T);\r\n onChange?: (value: T) => void;\r\n shouldUpdate?: (prev: T, next: T) => boolean;\r\n}\r\n\r\nexport default function useControllableState<T>(props: UseControllableStateProps<T>) {\r\n const {\r\n value: valueProp,\r\n defaultValue,\r\n onChange,\r\n shouldUpdate = (prev, next) => prev !== next,\r\n } = props;\r\n\r\n const onChangeProp = useCallbackRef(onChange);\r\n const shouldUpdateProp = useCallbackRef(shouldUpdate);\r\n\r\n const [uncontrolledState, setUncontrolledState] = useState(defaultValue as T);\r\n const controlled = valueProp !== undefined;\r\n const value = controlled ? valueProp : uncontrolledState;\r\n\r\n const setValue = useCallbackRef(\r\n (next: SetStateAction<T>) => {\r\n const setter = next as (prevState?: T) => T;\r\n const nextValue = typeof next === 'function' ? setter(value) : next;\r\n\r\n if (!shouldUpdateProp(value, nextValue)) {\r\n return;\r\n }\r\n\r\n if (!controlled) {\r\n setUncontrolledState(nextValue);\r\n }\r\n\r\n onChangeProp(nextValue);\r\n },\r\n [controlled, onChangeProp, value, shouldUpdateProp],\r\n );\r\n\r\n return [value, setValue] as [T, Dispatch<SetStateAction<T>>];\r\n}\r\n","import { debounce, DebouncedFunc } from 'lodash';\r\nimport { useEffect, useRef } from 'react';\r\n\r\nexport default function useDebounce<T extends (...args: any) => any>(callback: T, wait: number, options?: {}): DebouncedFunc<T> {\r\n const callbackRef = useRef<T>(callback);\r\n const debouncedCallbackRef = useRef<DebouncedFunc<T>>(\r\n debounce(callback, wait, options)\r\n );\r\n\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n useEffect(() => {\r\n debouncedCallbackRef.current = debounce((...args: any) => {\r\n callbackRef.current(...args);\r\n }, wait, options);\r\n }, [wait, options]);\r\n\r\n return debouncedCallbackRef.current;\r\n}\r\n","import { ChangeEvent, useCallback, useEffect, useState } from 'react';\r\nimport useDebounce from '../../hooks/use-debounce';\r\nimport styled from 'styled-components';\r\nimport Button from '../button';\r\nimport Form from '../form';\r\nimport { FormControl } from 'react-bootstrap';\r\nimport type { Columns } from './index';\r\nimport { Schema, UiSchema } from '@topthink/json-form';\r\n\r\nexport type SearchOptions = {\r\n fields: string[];\r\n extraFields?: Record<string, string>;\r\n ui?: Record<string, UiSchema>;\r\n order?: string[];\r\n};\r\n\r\ninterface SearchProps {\r\n data: Record<string, string>;\r\n options: SearchOptions;\r\n columns: Columns;\r\n onSearch: (params: Record<string, any>) => void;\r\n}\r\n\r\nexport default function Search({ data, options, columns, onSearch }: SearchProps) {\r\n\r\n const [key, setKey] = useState(0);\r\n\r\n const uiSchema: UiSchema = {\r\n 'ui:col': 10,\r\n 'ui:order': options.order\r\n };\r\n\r\n const properties: Schema['properties'] = {};\r\n\r\n options.fields.forEach(field => {\r\n const column = columns.find(column => column.dataIndex === field);\r\n\r\n if (column) {\r\n const title = column.title;\r\n if (typeof title === 'string') {\r\n uiSchema[field] = {\r\n 'ui:col': 4,\r\n 'ui:labelCol': 3,\r\n 'ui:placeholder': '请输入',\r\n ...options.ui?.[field]\r\n };\r\n\r\n if (column.valueEnum) {\r\n const valueEnum = column.valueEnum;\r\n\r\n uiSchema[field]['ui:placeholder'] = '请选择';\r\n\r\n return properties[field] = {\r\n title,\r\n type: 'string',\r\n enum: Object.keys(valueEnum).flatMap(key => {\r\n const text = valueEnum[key].text;\r\n if (typeof text === 'string') {\r\n return [key];\r\n }\r\n return [];\r\n }),\r\n enumNames: Object.keys(valueEnum).flatMap(key => {\r\n const text = valueEnum[key].text;\r\n if (typeof text === 'string') {\r\n return [text];\r\n }\r\n return [];\r\n }),\r\n };\r\n }\r\n\r\n return properties[field] = {\r\n title,\r\n type: 'string',\r\n };\r\n }\r\n }\r\n });\r\n\r\n if (options.extraFields) {\r\n Object.entries(options.extraFields).forEach(([field, title]) => {\r\n uiSchema[field] = {\r\n 'ui:col': 4,\r\n 'ui:labelCol': 3,\r\n 'ui:placeholder': '请输入',\r\n ...options.ui?.[field]\r\n };\r\n properties[field] = {\r\n title,\r\n type: 'string',\r\n };\r\n });\r\n }\r\n\r\n const schema: Schema = {\r\n type: 'object',\r\n properties\r\n };\r\n\r\n const onSubmit = useCallback(({ formData }) => {\r\n onSearch(formData);\r\n }, [onSearch]);\r\n\r\n const onReset = useCallback(() => {\r\n setKey(key => key + 1);\r\n onSearch({});\r\n }, []);\r\n\r\n return <Container key={key}>\r\n <Form\r\n formContext={{ layout: 'horizontal' }}\r\n schema={schema}\r\n uiSchema={uiSchema}\r\n onSubmit={onSubmit}\r\n formData={data}\r\n >\r\n <div className='col-2 ms-auto mt-auto'>\r\n <div className='justify-content-end d-flex gap-2 '>\r\n <Button className={'px-4'} onClick={onReset} variant='secondary'>重置</Button>\r\n <Button className={'px-4'} type='submit' variant='primary'>查询</Button>\r\n </div>\r\n </div>\r\n </Form>\r\n </Container>;\r\n}\r\n\r\nconst Container = styled.div`\r\n margin-bottom: 1rem;\r\n`;\r\n\r\ninterface Props {\r\n keyword: string;\r\n onKeywordChange: (value: string) => void;\r\n}\r\n\r\nexport function LightSearch({ keyword, onKeywordChange }: Props) {\r\n\r\n const [value, setValue] = useState(keyword);\r\n\r\n const debouncedOnKeywordChange = useDebounce(onKeywordChange, 500);\r\n\r\n useEffect(() => {\r\n setValue(keyword);\r\n }, [keyword]);\r\n\r\n const onChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\r\n setValue(e.target.value);\r\n debouncedOnKeywordChange(e.target.value);\r\n }, [debouncedOnKeywordChange, setValue]);\r\n\r\n return <FormControl value={value} onChange={onChange} type={'search'} placeholder={'Search...'} />;\r\n}\r\n","import RcTable, { TableProps as RcTableProps } from 'rc-table';\r\nimport { unstable_batchedUpdates } from 'react-dom';\r\nimport { ColumnType as BsColumnType, RenderedCell, RenderExpandIconProps } from 'rc-table/es/interface';\r\nimport { Table as BsTable } from 'react-bootstrap';\r\nimport { useUrlSearchParams } from 'use-url-search-params';\r\nimport {\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n Key,\r\n memo,\r\n PropsWithChildren,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useCallback,\r\n useEffect,\r\n useImperativeHandle,\r\n useMemo,\r\n useRef,\r\n useState\r\n} from 'react';\r\nimport Pagination from '../pagination';\r\nimport styled from 'styled-components';\r\nimport request from '../../request';\r\nimport Card from '../card';\r\nimport Loader from '../loader';\r\nimport Space from '../space';\r\nimport useSelection from './use-selection';\r\nimport { PaginationType } from '../../utils/types';\r\nimport { ReactComponent as PlusIcon } from '../../images/plus_square.svg';\r\nimport { ReactComponent as MinusIcon } from '../../images/minus_square.svg';\r\nimport useControllableState from '../../hooks/use-controllable-state';\r\nimport Search, { LightSearch, SearchOptions } from './search';\r\nimport NumberFormat from '../number-format';\r\nimport { TableContext } from './context';\r\n\r\nexport interface TableType {\r\n reload: () => void;\r\n}\r\n\r\ninterface ColumnType<RecordType> extends BsColumnType<RecordType> {\r\n render?: (data: {\r\n value: any,\r\n record: RecordType,\r\n index: number,\r\n action: TableType\r\n }) => ReactNode | RenderedCell<RecordType>;\r\n valueType?: 'currency';\r\n valueEnum?: Record<number | string, {\r\n text: ReactNode;\r\n status?: string;\r\n }>;\r\n}\r\n\r\nexport type Columns<RecordType = any> = ColumnType<RecordType>[]\r\n\r\nconst CustomTHead = styled.thead`\r\n th {\r\n padding: 0.5rem 0.5rem;\r\n border-bottom-width: 1px;\r\n border-color: var(--bs-border-color);\r\n }\r\n`;\r\n\r\nconst components: RcTableProps['components'] = {\r\n table: (props) => {\r\n return <BsTable {...props} className='mb-0 align-middle table-hover' />;\r\n },\r\n header: {\r\n wrapper(props) {\r\n return <CustomTHead {...props} />;\r\n }\r\n }\r\n};\r\n\r\nconst ExpandIconContainer = styled.a`\r\n cursor: pointer;\r\n width: 28px;\r\n height: 28px;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n vertical-align: middle;\r\n`;\r\n\r\nconst ExpandIcon = function <RecordType>({\r\n record,\r\n expanded,\r\n expandable,\r\n onExpand\r\n}: RenderExpandIconProps<RecordType>) {\r\n if (!expandable) return <ExpandIconContainer />;\r\n return <ExpandIconContainer onClick={e => onExpand(record, e)}>\r\n {expanded ? <MinusIcon /> : <PlusIcon />}\r\n </ExpandIconContainer>;\r\n};\r\n\r\nconst CustomPagination = styled(Pagination)`\r\n margin-bottom: 0;\r\n justify-content: flex-end;\r\n margin-top: 1rem;\r\n`;\r\n\r\nfunction isPagination<T>(data: any): data is PaginationType<T> {\r\n return 'current_page' in data;\r\n}\r\n\r\nexport interface TableRowSelection<RecordType = any> {\r\n selectedRowKeys?: Key[];\r\n onChange?: (selectedRowKeys: Key[], selectedRows: RecordType[]) => void;\r\n}\r\n\r\nexport interface TableProps<RecordType = any> extends Omit<RcTableProps<RecordType>, 'children' | 'columns'> {\r\n source: string | ((params: Params) => Promise<RecordType>);\r\n paginate?: boolean;\r\n columns: Columns<RecordType>;\r\n toolBarRender?: ((action: TableType) => ReactNode) | false;\r\n search?: boolean | SearchOptions;\r\n rowSelection?: TableRowSelection<RecordType>;\r\n card?: boolean;\r\n sync?: boolean;\r\n}\r\n\r\ntype Params = {\r\n page?: number;\r\n sortField?: string;\r\n sortOrder?: number;\r\n q?: string;\r\n [key: string]: any;\r\n};\r\n\r\ntype CustomTableType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<TableProps<T>>>\r\n & RefAttributes<TableType>>\r\n\r\nconst Table: CustomTableType = forwardRef((\r\n {\r\n source,\r\n rowKey = 'id',\r\n paginate = true,\r\n toolBarRender,\r\n columns = [],\r\n search,\r\n rowSelection,\r\n card = true,\r\n expandable = {},\r\n sync = false,\r\n ...props\r\n },\r\n ref\r\n) => {\r\n const [data, setData] = useState<any[]>([]);\r\n const [pagination, setPagination] = useState(paginate ? { total: 0, current: 1, pageSize: 10 } : null);\r\n const [loading, setLoading] = useState(true);\r\n\r\n const [params, setParams] = useUrlSearchParams({});\r\n\r\n //多选\r\n const [transformColumns, setSelectionRowKeys] = useSelection(rowSelection, rowKey, data);\r\n\r\n const [filters, setFilters] = useControllableState<Record<string, string>>({\r\n value: sync ? (params as Record<string, string> || {}) : undefined,\r\n defaultValue: {},\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams(value);\r\n }\r\n }\r\n });\r\n\r\n const [keyword, setKeyword] = useControllableState<string>({\r\n value: sync ? (params.q as string || '') : undefined,\r\n defaultValue: '',\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams({ q: value || undefined });\r\n }\r\n }\r\n });\r\n\r\n const [page, setPage] = useControllableState<number>({\r\n value: sync ? (params.page as number || 1) : undefined,\r\n defaultValue: 1,\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams({ page: value || undefined });\r\n }\r\n }\r\n });\r\n\r\n const fetchData = useCallback(async () => {\r\n setLoading(true);\r\n setSelectionRowKeys([]);\r\n try {\r\n let result;\r\n const params: Params = {\r\n ...filters,\r\n q: keyword,\r\n page: page > 1 ? page : undefined,\r\n };\r\n\r\n if (typeof source === 'string') {\r\n result = await request({\r\n url: source,\r\n params,\r\n });\r\n } else {\r\n result = await source(params);\r\n }\r\n\r\n if (paginate && isPagination<any>(result)) {\r\n setPagination({\r\n total: result.total,\r\n current: result.current_page,\r\n pageSize: result.per_page\r\n });\r\n result = result.data;\r\n }\r\n setData(result);\r\n } catch (e) {\r\n\r\n } finally {\r\n setLoading(false);\r\n }\r\n }, [source, setData, keyword, page, filters]);\r\n\r\n useEffect(() => {\r\n fetchData();\r\n }, [keyword, page, filters]);\r\n\r\n const action = useRef<TableType>({\r\n reload: fetchData\r\n });\r\n\r\n useEffect(() => {\r\n action.current = {\r\n reload: fetchData\r\n };\r\n }, [fetchData]);\r\n\r\n useImperativeHandle(ref, () => action.current);\r\n\r\n const customColumns = useMemo(() => {\r\n return transformColumns(columns).map(({ render, valueType, valueEnum, ...column }) => {\r\n const customColumn: BsColumnType<any> = { ...column };\r\n\r\n if (render) {\r\n customColumn.render = (value, record, index) => {\r\n return render({ value, record, index, action: action.current });\r\n };\r\n } else if (valueType === 'currency') {\r\n customColumn.render = (value) => {\r\n return <NumberFormat value={value} />;\r\n };\r\n } else if (valueEnum) {\r\n customColumn.render = (value) => {\r\n if (valueEnum[value]) {\r\n if (valueEnum[value].status) {\r\n return <span className={`text-${valueEnum[value].status}`}>{valueEnum[value].text}</span>;\r\n }\r\n return valueEnum[value].text;\r\n }\r\n return value;\r\n };\r\n }\r\n return customColumn;\r\n });\r\n }, [columns, transformColumns, action]);\r\n\r\n const children = <>\r\n <Loader loading={loading} />\r\n {typeof search === 'object' && <Search\r\n data={filters}\r\n columns={columns}\r\n options={search}\r\n onSearch={(data) => {\r\n unstable_batchedUpdates(() => {\r\n setPage(1);\r\n setFilters(data);\r\n });\r\n }}\r\n />}\r\n {toolBarRender !== false && <Header>\r\n <LeftTools size={12}>\r\n {toolBarRender && toolBarRender(action.current)}\r\n </LeftTools>\r\n <RightTools size={12}>\r\n {search === true && <LightSearch keyword={keyword} onKeywordChange={(value) => {\r\n unstable_batchedUpdates(() => {\r\n setPage(1);\r\n setKeyword(value);\r\n });\r\n }} />}\r\n <Action onClick={action.current.reload}><i className='bi bi-arrow-repeat' /></Action>\r\n </RightTools>\r\n </Header>}\r\n <TableContext.Provider value={true}>\r\n <RcTable {...props} expandable={{ expandIcon: ExpandIcon, ...expandable }} rowKey={rowKey} columns={customColumns} components={components} data={data} />\r\n </TableContext.Provider>\r\n {pagination && <CustomPagination {...pagination} onChange={setPage} />}\r\n </>;\r\n\r\n if (card) {\r\n return <Card>\r\n {children}\r\n </Card>;\r\n }\r\n return children;\r\n});\r\n\r\nexport default memo(Table) as CustomTableType;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n justify-content: space-between;\r\n padding-bottom: 1rem;\r\n height: 48px;\r\n border-bottom: 2px solid #212529;\r\n`;\r\n\r\nconst RightTools = styled(Space)`\r\n\r\n`;\r\nconst LeftTools = styled(Space)`\r\n\r\n`;\r\n\r\nconst Action = styled.span`\r\n cursor: pointer;\r\n font-size: 20px;\r\n line-height: 1;\r\n\r\n &:hover {\r\n color: var(--bs-primary);\r\n }\r\n`;\r\n","import { useCallback, useState } from 'react';\r\n\r\ninterface Options {\r\n onHide?: () => void;\r\n onShow?: () => void;\r\n}\r\n\r\nlet id = 0;\r\n\r\nexport default function useOverlayState({ onHide, onShow }: Options = {}) {\r\n const [visible, setVisible] = useState(false);\r\n\r\n const [key, setKey] = useState(`visible-${id}`);\r\n\r\n const hide = useCallback(() => {\r\n setVisible(false);\r\n if (onHide) {\r\n onHide();\r\n }\r\n }, [setVisible, onHide]);\r\n\r\n const exit = useCallback(() => {\r\n setKey(`visible-${++id}`);\r\n }, [setKey, id]);\r\n\r\n const show = useCallback(() => {\r\n setVisible(true);\r\n if (onShow) {\r\n onShow();\r\n }\r\n }, [setVisible, onShow]);\r\n\r\n const state = {\r\n show: visible,\r\n onHide: hide,\r\n onExited: exit,\r\n key\r\n };\r\n\r\n return {\r\n visible,\r\n show,\r\n hide,\r\n state\r\n };\r\n}\r\n","import {\r\n createElement,\r\n ElementType,\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n MouseEvent,\r\n PropsWithChildren,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useImperativeHandle\r\n} from 'react';\r\nimport useOverlayState from '../hooks/use-overlay-state';\r\nimport Modal, { ModalProps } from './modal';\r\nimport { ButtonProps } from 'react-bootstrap';\r\nimport Button from './button';\r\n\r\nexport interface ModalButtonProps extends Omit<ButtonProps, 'as'> {\r\n text: ReactNode;\r\n modalProps?: Omit<ModalProps, 'children' | 'confirmLoading' | 'onOk'>;\r\n onOk?: () => any;\r\n onShow?: () => void;\r\n confirmLoading?: boolean;\r\n as?: ElementType | ButtonProps['as'];\r\n}\r\n\r\nexport interface ModalType {\r\n close: () => void;\r\n}\r\n\r\ntype ModalButtonType = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<ModalButtonProps>>\r\n & RefAttributes<ModalType>>\r\n\r\nconst ModalButton: ModalButtonType = forwardRef(({\r\n text,\r\n onOk,\r\n modalProps,\r\n children,\r\n onShow,\r\n confirmLoading,\r\n as = Button,\r\n ...props\r\n}, ref) => {\r\n\r\n const { state, show, hide } = useOverlayState({ onShow });\r\n\r\n useImperativeHandle(ref, () => ({\r\n close: hide\r\n }));\r\n\r\n const handleOk = async (e: MouseEvent) => {\r\n if (onOk) {\r\n const result = await onOk();\r\n if (result === false) {\r\n e.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n const button = createElement(as, {\r\n ...props,\r\n onClick: show\r\n }, text);\r\n\r\n return <>\r\n {button}\r\n <Modal\r\n header={text}\r\n {...modalProps}\r\n {...state}\r\n confirmLoading={confirmLoading}\r\n onOk={handleOk}\r\n >\r\n {children}\r\n </Modal>\r\n </>;\r\n});\r\n\r\nexport default ModalButton;\r\n","import ModalButton, { ModalButtonProps, ModalType } from './modal-button';\r\nimport { ReactNode, useCallback, useRef, useState } from 'react';\r\nimport Form, { FormProps, FormType } from './form';\r\n\r\nexport interface ModalFormProps<T = any> extends FormProps<T> {\r\n text: ReactNode;\r\n buttonProps?: Omit<ModalButtonProps, 'text' | 'modalProps' | 'confirmLoading' | 'onOk'>;\r\n modalProps?: ModalButtonProps['modalProps'];\r\n children?: ReactNode;\r\n}\r\n\r\nexport default function ModalForm<T = any>({\r\n text,\r\n onSuccess,\r\n buttonProps,\r\n modalProps,\r\n children,\r\n ...props\r\n}: ModalFormProps<T>) {\r\n\r\n const [loading, setLoading] = useState(false);\r\n\r\n const ref = useRef<ModalType>(null);\r\n const form = useRef<FormType>(null);\r\n\r\n const handleOk = useCallback(() => {\r\n form.current?.submit();\r\n return false;\r\n }, []);\r\n\r\n const handleSuccess = useCallback((data) => {\r\n if (onSuccess) {\r\n onSuccess(data);\r\n }\r\n ref.current?.close();\r\n }, [onSuccess]);\r\n\r\n return <ModalButton\r\n ref={ref}\r\n text={text}\r\n {...buttonProps}\r\n modalProps={modalProps}\r\n onOk={handleOk}\r\n confirmLoading={loading}\r\n >\r\n <Form\r\n {...props}\r\n onSubmitting={setLoading}\r\n ref={form}\r\n onSuccess={handleSuccess}\r\n >\r\n {children}\r\n <input type='submit' hidden />\r\n </Form>\r\n </ModalButton>;\r\n}\r\n","import { useAsyncCallback, UseAsyncCallbackOptions } from 'react-async-hook';\r\nimport request, { isRequestError, RequestConfig } from '../request';\r\nimport { DependencyList, useCallback, useEffect } from 'react';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport { values } from 'lodash';\r\n\r\ntype UseRequestOptions<T> = {\r\n manual?: boolean\r\n refreshDeps?: DependencyList;\r\n} & UseAsyncCallbackOptions<T>;\r\n\r\nexport default function useRequest<T = any>(config: RequestConfig, {\r\n manual,\r\n refreshDeps,\r\n ...options\r\n}: UseRequestOptions<T> = {}) {\r\n let { execute, currentParams, error, ...others } = useAsyncCallback(async (params?: AxiosRequestConfig) => {\r\n\r\n config = typeof config === 'string' ? { url: config } : config;\r\n\r\n return await request<T>({\r\n ...config,\r\n ...params\r\n });\r\n }, options);\r\n\r\n useEffect(() => {\r\n if (!manual && !refreshDeps) {\r\n try {\r\n execute();\r\n } catch {\r\n\r\n }\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (refreshDeps) {\r\n refresh();\r\n }\r\n }, refreshDeps);\r\n\r\n const refresh = useCallback(async () => {\r\n try {\r\n if (currentParams) {\r\n await execute(...currentParams);\r\n } else {\r\n await execute();\r\n }\r\n } catch {\r\n\r\n }\r\n }, [execute, currentParams]);\r\n\r\n if (error && isRequestError(error)) {\r\n const errors = error.errors;\r\n error = new Error(typeof errors === 'string' ? errors : values(errors).join(''));\r\n }\r\n\r\n return {\r\n refresh,\r\n execute,\r\n error,\r\n ...others\r\n };\r\n}\r\n"],"names":["CustomSwal","withReactContent","Swal","defaultOptions","confirmButtonText","cancelButtonText","Message","confirm","async","isConfirmed","fire","icon","showCancelButton","options","data","preConfirm","e","Error","showValidationMessage","message","success","toast","position","timer","showConfirmButton","error","close","result","defaults","MessageContext","createContext","wrapMessage","Component","_ref","resolve","destroy","show","setShow","initState","callbackRef","useRef","state","setState","useState","useEffect","current","value","callback","useStateWithCallback","context","useContext","handleResolve","useCallback","useMemo","onHide","onExited","container","_jsx","createMessage","Promise","component","hide","listener","memoryState","Set","modal","add","delete","Tooltip","tooltip","children","placement","OverlayTrigger","overlay","BsTooltip","id","uniqueId","TableContext","Button","forwardRef","ref","loading","percent","disabled","variant","props","_jsxs","Spinner","as","size","role","animation","className","button","BsButton","Confirm","title","okText","cancelText","Modal","centered","Header","Title","Body","Footer","onClick","header","footer","closable","onOk","onCancel","okButtonProps","bodyAs","headerAs","confirmLoading","rest","setLoading","okButton","defaultPrevented","cancelButton","_Fragment","ReactModal","closeButton","Provider","Array","from","map","index","Fragment","Unauthorized","constructor","url","super","_defineProperty","this","noticeInstance","notice","type","Notification","newInstance","prefixCls","maxCount","style","top","right","instance","getNoticeInstance","duration","content","Alert","Toast","reduce","rax","attach","axios","raxConfig","retryDelay","backoffType","shouldRetry","config","response","retryDecider","method","toUpperCase","status","maxContentLength","Infinity","maxBodyLength","baseURL","authTokenName","interceptors","request","use","key","token","localStorage","getItem","headers","Authorization","reject","isRecord","location","window","href","undefined","isAxiosError","errors","isRequestError","showRequestError","Object","values","join","paramsSerializer","params","queryString","stringify","sort","skipNull","skipEmptyString","arrayFormat","useSafeState","initialState","unmountedRef","useUnmountedRef","currentState","WaitModal","open","checkUrl","onComplete","checking","setChecking","order_no","err","then","catch","backdrop","preventDefault","waitPayComplete","pay_url","Container","styled","div","Icon","Extra","IconMap","info","warning","Result","extra","Dimmer","active","inverted","Loader","wrap","Wrap","$height","Card","BsCard","classNames","entries","_ref2","name","Space","direction","small","middle","large","items","Children","child","Item","$direction","$size","css","_path","_extends","assign","bind","target","i","arguments","length","source","prototype","hasOwnProperty","call","apply","SvgStepCheck","React","createElement","viewBox","xmlns","width","height","fill","d","Steps","CustomRcSteps","icons","finish","CheckIcon","Step","RcSteps","Statistic","Content","noop","isInteger","isFinite","Math","floor","Pagination","total","onChange","defaultCurrent","defaultPageSize","setCurrent","pageSize","setPageSize","allPages","handleChange","p","prevPage","nextPage","pagerList","jumpPrev","jumpNext","firstPager","lastPager","push","BsPagination","Last","First","Prev","Next","left","max","min","pageBufferSize","unshift","NumberFormat","locale","currency","formatter","opt","minimumFractionDigits","Intl","format","LoadingButton","LazyImageZoom","lazy","import","ImageZoom","Suspense","fallback","RequestButton","onSuccess","fetching","setFetching","handleClick","localize","require","widgets","upload","getRegistry","endpoint","onUpload","FormData","set","file","editor","typeahead","_ref3","onSearch","query","_ref4","Form","_ref5","action","formData","onSubmitting","onSubmit","submitText","transformData","extraErrors","setExtraErrors","setData","handleSubmit","nativeEvent","__errors","mapValues","toExtraErrors","transformErrors","keyword","dataPath","property","submit","JsonForm","noHtml5Validate","noValidate","Checkbox","indeterminate","SvgPlusSquare","SvgMinusSquare","useCallbackRef","deps","_len","args","_key","useControllableState","valueProp","defaultValue","shouldUpdate","prev","next","onChangeProp","shouldUpdateProp","uncontrolledState","setUncontrolledState","controlled","setValue","nextValue","useDebounce","wait","debouncedCallbackRef","debounce","Search","columns","setKey","uiSchema","order","properties","fields","forEach","field","column","find","dataIndex","ui","valueEnum","enum","keys","flatMap","text","enumNames","extraFields","schema","onReset","formContext","layout","LightSearch","onKeywordChange","debouncedOnKeywordChange","FormControl","placeholder","CustomTHead","thead","components","table","BsTable","wrapper","ExpandIconContainer","a","ExpandIcon","record","expanded","expandable","onExpand","MinusIcon","PlusIcon","CustomPagination","Table","rowKey","paginate","toolBarRender","search","rowSelection","card","sync","pagination","setPagination","setParams","useUrlSearchParams","transformColumns","setSelectionRowKeys","setKeys","selectedRowKeys","getRowKey","getRecordByKey","setSelectedKeys","changedKeys","records","recordKeys","checkedCurrentAll","every","has","checkedCurrentSome","some","checked","align","render","useSelection","filters","setFilters","setKeyword","q","page","setPage","fetchData","isPagination","current_page","per_page","reload","useImperativeHandle","customColumns","valueType","customColumn","unstable_batchedUpdates","LeftTools","RightTools","Action","RcTable","expandIcon","memo","span","useOverlayState","onShow","visible","setVisible","exit","ModalButton","modalProps","ModalForm","buttonProps","form","handleOk","handleSuccess","hidden","useRequest","manual","refreshDeps","execute","currentParams","others","useAsyncCallback","refresh"],"mappings":"g1CAIA,MAAMA,EAAaC,EAAiBC,GAM9BC,EAAiC,CACnCC,kBAAmB,KACnBC,iBAAkB,MAGhBC,EAAU,CACZC,QAASC,UACL,MAAMC,YAAEA,SAAsBT,EAAWU,KAAK,IACvCP,EACHQ,KAAM,UACNC,kBAAkB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AAMK,EAAUxd,GAAY5C,UACxB,IACQigB,QACMD,KAAWC,SAEXD,GAIb,CAFC,MAED,IACF,CAACA,EAASC,IAEb,GAAIhf,GAASkK,GAAelK,GAAQ,CAChC,MAAMiK,EAASjK,EAAMiK,OACrBjK,EAAQ,IAAIR,MAAwB,iBAAXyK,EAAsBA,EAASI,EAAOJ,GAAQK,KAAK,IAC/E,CAED,MAAO,CACH6U,UACAJ,UACA/e,WACGif,EAEX"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/message.ts","../src/components/modal/message.tsx","../src/hooks/use-state-with-callback.ts","../src/components/modal/show.tsx","../src/components/tooltip.tsx","../src/components/table/context.ts","../src/components/button.tsx","../src/components/modal/confirm.tsx","../src/components/modal/index.tsx","../src/errors/unauthorized.ts","../src/utils/toast.tsx","../src/request.ts","../src/hooks/use-safe-state.ts","../src/hooks/use-unmounted-ref.ts","../src/utils/wait-pay-complete.tsx","../src/components/result.tsx","../src/components/dimmer.tsx","../src/components/loader.tsx","../src/components/card.tsx","../src/components/error.tsx","../src/components/space.tsx","../src/images/step_check.svg","../src/components/steps.tsx","../src/components/statistic.tsx","../src/components/pagination.tsx","../src/components/number-format.tsx","../src/components/loading-button.tsx","../src/components/image-zoom.tsx","../src/components/request-button.tsx","../src/components/form.tsx","../src/components/table/use-selection.tsx","../src/images/plus_square.svg","../src/images/minus_square.svg","../src/hooks/use-callback-ref.ts","../src/hooks/use-controllable-state.ts","../src/hooks/use-debounce.ts","../src/components/table/search.tsx","../src/components/table/index.tsx","../src/hooks/use-overlay-state.ts","../src/components/modal-button.tsx","../src/components/modal-form.tsx","../src/hooks/use-request.ts"],"sourcesContent":["import Swal from 'sweetalert2/dist/sweetalert2.js';\r\nimport withReactContent from 'sweetalert2-react-content';\r\nimport { SweetAlertOptions, SweetAlertResult } from 'sweetalert2';\r\n\r\nconst CustomSwal = withReactContent(Swal);\r\n\r\ninterface MessageOptions<T = any> extends SweetAlertOptions<T> {\r\n\r\n}\r\n\r\nconst defaultOptions: MessageOptions = {\r\n confirmButtonText: '确定',\r\n cancelButtonText: '取消',\r\n};\r\n\r\nconst Message = {\r\n confirm: async <T = any>(options: MessageOptions<T>) => {\r\n const { isConfirmed } = await CustomSwal.fire({\r\n ...defaultOptions,\r\n icon: 'warning',\r\n showCancelButton: true,\r\n ...options,\r\n async preConfirm(data) {\r\n if (options.preConfirm) {\r\n try {\r\n return await options.preConfirm(data);\r\n } catch (e) {\r\n if (e instanceof Error) {\r\n CustomSwal.showValidationMessage(e.message);\r\n }\r\n return false;\r\n }\r\n }\r\n return true;\r\n },\r\n });\r\n\r\n return isConfirmed;\r\n },\r\n success: (options: MessageOptions) => {\r\n CustomSwal.fire({\r\n ...defaultOptions,\r\n toast: true,\r\n position: 'top',\r\n icon: 'success',\r\n timer: 2000,\r\n showConfirmButton: false,\r\n ...options\r\n });\r\n },\r\n error: (options: MessageOptions) => {\r\n CustomSwal.fire({\r\n ...defaultOptions,\r\n toast: true,\r\n position: 'top',\r\n icon: 'error',\r\n timer: 5000,\r\n showConfirmButton: false,\r\n ...options\r\n });\r\n },\r\n close: (result?: SweetAlertResult) => {\r\n CustomSwal.close(result);\r\n },\r\n defaults: defaultOptions\r\n};\r\n\r\nexport default Message;\r\n","import {\r\n ComponentType,\r\n createContext,\r\n Fragment,\r\n ReactNode,\r\n useCallback,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n useState\r\n} from 'react';\r\nimport useStateWithCallback from '../../hooks/use-state-with-callback';\r\nimport { ModalProps } from 'react-bootstrap';\r\n\r\ninterface MessageContextType {\r\n container?: ModalProps['container'];\r\n}\r\n\r\nconst MessageContext = createContext<MessageContextType>({});\r\n\r\ntype MessageWrapProps<T, P = void> = {\r\n resolve: (value: P | void) => void\r\n destroy: () => void\r\n message: T\r\n}\r\n\r\nexport type MessageProps<T, P = void> = {\r\n resolve: (value: P | void) => void\r\n message: T\r\n state: {\r\n show: boolean\r\n onHide: () => void\r\n onExited: () => void\r\n container?: ModalProps['container']\r\n }\r\n}\r\n\r\nexport function wrapMessage<T = {}, P = any>(Component: ComponentType<MessageProps<T, P>>): ComponentType<MessageWrapProps<T, P>> {\r\n\r\n return ({ resolve, destroy, message }) => {\r\n\r\n const [show, setShow] = useStateWithCallback(true);\r\n const context = useContext(MessageContext);\r\n\r\n const handleResolve = useCallback((value: P | void) => {\r\n setShow(false, () => {\r\n resolve(value);\r\n });\r\n }, [setShow, resolve]);\r\n\r\n const state = useMemo(() => {\r\n return {\r\n show,\r\n onHide: () => handleResolve(),\r\n onExited: () => destroy(),\r\n container: context.container\r\n };\r\n }, [show, handleResolve, destroy]);\r\n\r\n return <Component\r\n resolve={handleResolve}\r\n state={state}\r\n message={message}\r\n />;\r\n };\r\n}\r\n\r\nexport function createMessage<T = {}, P = any>(Component: ComponentType<MessageWrapProps<T, P>>): (message: T) => Promise<P | void> {\r\n return (message) => {\r\n return new Promise<P | void>((resolve) => {\r\n const component = <Component\r\n resolve={resolve}\r\n destroy={() => {\r\n hide(component);\r\n }}\r\n message={message}\r\n />;\r\n\r\n show(component);\r\n });\r\n };\r\n}\r\n\r\ntype State = Set<ReactNode>\r\n\r\nlet listener: (state: State) => void = () => void 0;\r\n\r\nlet memoryState: State = new Set();\r\n\r\nexport const show = (modal: ReactNode) => {\r\n memoryState = new Set(memoryState);\r\n memoryState.add(modal);\r\n\r\n listener(memoryState);\r\n};\r\n\r\nexport const hide = (modal: ReactNode) => {\r\n memoryState = new Set(memoryState);\r\n memoryState.delete(modal);\r\n\r\n listener(memoryState);\r\n};\r\n\r\nexport default function Message(props: MessageContextType) {\r\n const [state, setState] = useState<State>(memoryState);\r\n useEffect(() => {\r\n listener = setState;\r\n }, []);\r\n\r\n return <MessageContext.Provider value={props}>\r\n {Array.from(state).map((message, index) => <Fragment key={`message-${index}`}>{message}</Fragment>)}\r\n </MessageContext.Provider>;\r\n}\r\n","import { SetStateAction, useEffect, useRef, useState } from 'react';\n\nexport default function useStateWithCallback<S>(initState: S): [S, (value: SetStateAction<S>, callback: () => void) => void] {\n const callbackRef = useRef<Function | null>(null);\n\n const [state, setState] = useState(initState);\n\n useEffect(() => {\n if (callbackRef.current) {\n callbackRef.current();\n callbackRef.current = null;\n }\n }, [state]);\n\n const setCallbackState = (value: SetStateAction<S>, callback: () => void) => {\n callbackRef.current = typeof callback === 'function' ? callback : null;\n setState(value);\n };\n\n return [state, setCallbackState];\n}\n","import { createMessage, MessageProps, wrapMessage } from './message';\r\nimport { ComponentType } from 'react';\r\n\r\nexport default function show<T, P = any>(Component: ComponentType<MessageProps<any, T>>, options?: P) {\r\n return createMessage(wrapMessage(Component))(options);\r\n}\r\n","import { OverlayTrigger, OverlayTriggerProps, Tooltip as BsTooltip } from 'react-bootstrap';\r\nimport { uniqueId } from 'lodash';\r\n\r\ninterface TooltipProps {\r\n tooltip: string;\r\n children: OverlayTriggerProps['children'];\r\n placement?: OverlayTriggerProps['placement'];\r\n}\r\n\r\nexport default function Tooltip({ tooltip, children, placement = 'bottom' }: TooltipProps) {\r\n\r\n return <OverlayTrigger\r\n placement={placement}\r\n overlay={\r\n <BsTooltip id={uniqueId()}>\r\n {tooltip}\r\n </BsTooltip>\r\n }\r\n >\r\n {children}\r\n </OverlayTrigger>;\r\n}\r\n","import { createContext } from 'react';\r\n\r\nexport const TableContext = createContext(false);\r\n","import { Button as BsButton, ButtonProps as BsButtonProps, Spinner } from 'react-bootstrap';\r\nimport { forwardRef, useContext } from 'react';\r\nimport Tooltip from './tooltip';\r\nimport { TableContext } from './table/context';\r\n\r\nexport interface ButtonProps extends BsButtonProps {\r\n loading?: boolean;\r\n percent?: number;\r\n tooltip?: string;\r\n}\r\n\r\nconst Button = forwardRef<any, ButtonProps>((\r\n {\r\n loading,\r\n percent,\r\n disabled,\r\n children,\r\n tooltip,\r\n variant,\r\n ...props\r\n },\r\n ref\r\n) => {\r\n\r\n const inTable = useContext(TableContext);\r\n\r\n if (inTable && !variant) {\r\n variant = 'link';\r\n }\r\n\r\n if (loading) {\r\n disabled = true;\r\n children = <>\r\n <Spinner ref={ref} as='span' size='sm' role='status' aria-hidden='true' animation='border' />\r\n {percent ? <span className='ms-2'>{percent}%</span> : null}\r\n </>;\r\n }\r\n\r\n const button = <BsButton ref={ref} {...props} variant={variant} disabled={disabled}>{children}</BsButton>;\r\n\r\n if (tooltip) {\r\n return <Tooltip tooltip={tooltip}>\r\n <span className={'d-inline-block'}>{button}</span>\r\n </Tooltip>;\r\n }\r\n\r\n return button;\r\n});\r\n\r\nexport default Button;\r\n","import { FC } from 'react';\r\nimport { Modal } from 'react-bootstrap';\r\nimport { createMessage, MessageProps, wrapMessage } from './message';\r\nimport Button from '../button';\r\n\r\ninterface ConfirmOptions {\r\n title?: string;\r\n message: string;\r\n okText?: string;\r\n cancelText?: string;\r\n}\r\n\r\nconst Confirm: FC<MessageProps<ConfirmOptions, true>> = function({\r\n state,\r\n message: {\r\n title,\r\n message,\r\n okText,\r\n cancelText\r\n },\r\n resolve,\r\n}) {\r\n return <Modal centered {...state} >\r\n <Modal.Header>\r\n <Modal.Title as='h5'>{title || '确认'}</Modal.Title>\r\n </Modal.Header>\r\n <Modal.Body>{message}</Modal.Body>\r\n <Modal.Footer>\r\n <Button variant='secondary' onClick={() => resolve()}>{cancelText || '取消'}</Button>\r\n <Button onClick={() => resolve(true)}>{okText || '确定'}</Button>\r\n </Modal.Footer>\r\n </Modal>;\r\n};\r\n\r\nexport default function confirm(options: ConfirmOptions) {\r\n return createMessage(wrapMessage(Confirm))(options);\r\n}\r\n","import { Modal as ReactModal, ModalProps as ReactModalProps } from 'react-bootstrap';\r\nimport { ElementType, MouseEvent, ReactNode, useMemo, useState } from 'react';\r\nimport Button, { ButtonProps } from '../button';\r\nimport show from './show';\r\nimport confirm from './confirm';\r\nimport Message, { MessageProps } from './message';\r\n\r\nexport interface ModalProps extends Pick<\r\n ReactModalProps,\r\n 'style' | 'container' | 'backdrop' | 'centered' | 'size' | 'scrollable' | 'fullscreen' | 'onHide' | 'onShow' | 'onEnter' | 'onEntering' | 'onEntered' | 'onExit' | 'onExiting' | 'onExited'\r\n> {\r\n children: ReactNode;\r\n header?: ReactNode;\r\n footer?: ReactNode | ((args: { okButton: ReactNode, cancelButton: ReactNode }) => ReactNode);\r\n okText?: string;\r\n cancelText?: string;\r\n closable?: boolean;\r\n show?: boolean;\r\n onOk?: (e: MouseEvent) => void;\r\n onCancel?: (e: MouseEvent) => void;\r\n okButtonProps?: ButtonProps;\r\n bodyAs?: ElementType;\r\n headerAs?: ElementType;\r\n confirmLoading?: boolean;\r\n}\r\n\r\nconst Modal = ({\r\n header,\r\n children,\r\n footer,\r\n closable = true,\r\n show,\r\n cancelText = '取消',\r\n okText = '确定',\r\n onOk,\r\n onCancel,\r\n onHide,\r\n okButtonProps,\r\n bodyAs,\r\n headerAs = 'h5',\r\n confirmLoading = false,\r\n ...rest\r\n}: ModalProps) => {\r\n\r\n const [loading, setLoading] = useState(false);\r\n\r\n const okButton = useMemo(() => {\r\n return <Button loading={loading || confirmLoading} variant={'primary'} onClick={async (e) => {\r\n setLoading(true);\r\n try {\r\n await onOk?.(e);\r\n if (!e.defaultPrevented) {\r\n onHide?.();\r\n }\r\n } finally {\r\n setLoading(false);\r\n }\r\n }} {...okButtonProps}>{okText}</Button>;\r\n }, [okButtonProps, okText, onOk, onHide, loading, confirmLoading]);\r\n\r\n const cancelButton = useMemo(() => {\r\n return <Button variant='secondary' onClick={(e) => {\r\n onCancel?.(e);\r\n if (!e.defaultPrevented) {\r\n onHide?.();\r\n }\r\n }}>{cancelText}</Button>;\r\n }, [onCancel, onHide, cancelText]);\r\n\r\n switch (typeof footer) {\r\n case 'undefined':\r\n footer = <>\r\n {cancelButton}\r\n {okButton}\r\n </>;\r\n break;\r\n case 'function':\r\n footer = footer({ okButton, cancelButton });\r\n break;\r\n }\r\n\r\n return <ReactModal {...rest} onHide={onHide} show={show}>\r\n {header && <ReactModal.Header closeButton={closable}>\r\n <ReactModal.Title as={headerAs}>{header}</ReactModal.Title>\r\n </ReactModal.Header>}\r\n <ReactModal.Body as={bodyAs}>{children}</ReactModal.Body>\r\n {footer && <ReactModal.Footer>{footer}</ReactModal.Footer>}\r\n </ReactModal>;\r\n};\r\n\r\nModal.Message = Message;\r\nModal.confirm = confirm;\r\nModal.show = show;\r\nexport default Modal;\r\nexport { MessageProps };\r\n","export default class Unauthorized extends Error {\r\n\r\n url: string;\r\n\r\n constructor(url: string) {\r\n super('Unauthorized');\r\n this.url = url;\r\n }\r\n}\r\n","import { Alert } from 'react-bootstrap';\r\nimport { NoticeContent, NotificationInstance } from 'rc-notification/lib/Notification';\r\nimport Notification from 'rc-notification';\r\nimport { NotificationProps } from 'rc-notification/es/Notification';\r\n\r\nlet noticeInstance: NotificationInstance | null;\r\n\r\nconst defaultOptions: NotificationProps & {\r\n getContainer?: () => HTMLElement;\r\n} = {};\r\n\r\nfunction getNoticeInstance(callback: (instance: NotificationInstance) => void) {\r\n if (noticeInstance) {\r\n return callback(noticeInstance);\r\n }\r\n\r\n Notification.newInstance({\r\n ...defaultOptions,\r\n prefixCls: 'notification',\r\n maxCount: 5,\r\n style: {\r\n top: 20,\r\n right: 20\r\n }\r\n }, (instance) => {\r\n if (noticeInstance) {\r\n callback(noticeInstance);\r\n return;\r\n }\r\n noticeInstance = instance;\r\n callback(instance);\r\n });\r\n}\r\n\r\n\r\nconst notice = ({ type, ...options }: { type: string } & NoticeContent) => {\r\n getNoticeInstance((instance) => {\r\n options.duration = 3;\r\n let variant = type;\r\n switch (type) {\r\n case 'error':\r\n variant = 'danger';\r\n options.duration = options.closable ? 0 : 5;\r\n break;\r\n }\r\n\r\n options.content = <Alert variant={variant}>{options.content}</Alert>;\r\n\r\n instance.notice(options);\r\n });\r\n};\r\n\r\nconst types = ['error', 'success', 'info'] as const;\r\n\r\ntype ToastType = Record<typeof types[number], (content: string, options?: NoticeContent) => void> & {\r\n defaults: typeof defaultOptions;\r\n};\r\n\r\nconst Toast = types.reduce((toast, type) => {\r\n toast[type] = (content: string, options?: NoticeContent) => {\r\n notice({\r\n ...options,\r\n type,\r\n content\r\n });\r\n };\r\n return toast;\r\n}, {} as any);\r\n\r\nToast.defaults = defaultOptions;\r\n\r\nexport default Toast as ToastType;\r\n","import axios, { AxiosInstance, AxiosRequestConfig } from 'axios';\r\nimport queryString from 'query-string';\r\nimport * as rax from 'retry-axios';\r\nimport { RetryConfig } from 'retry-axios';\r\nimport Unauthorized from './errors/unauthorized';\r\nimport Toast from './utils/toast';\r\n\r\nexport type Errors = string | {\r\n [key: string]: string\r\n}\r\n\r\ndeclare module 'retry-axios' {\r\n interface RetryConfig {\r\n retryDecider?: () => boolean;\r\n }\r\n}\r\n\r\ndeclare module 'axios' {\r\n interface AxiosError {\r\n errors: Errors;\r\n }\r\n\r\n interface AxiosRequestConfig {\r\n raxConfig?: RetryConfig;\r\n authTokenName?: string;\r\n }\r\n}\r\n\r\nrax.attach();\r\n\r\naxios.defaults.raxConfig = {\r\n retryDelay: 2000,\r\n backoffType: 'static',\r\n shouldRetry: ({ config, response }) => {\r\n if (config.raxConfig?.retryDecider && !config.raxConfig.retryDecider()) {\r\n return false;\r\n }\r\n return config.method?.toUpperCase() === 'GET' && response?.status === 449;\r\n }\r\n};\r\naxios.defaults.maxContentLength = Infinity;\r\naxios.defaults.maxBodyLength = Infinity;\r\naxios.defaults.baseURL = '/api';\r\naxios.defaults.authTokenName = 'authorization';\r\naxios.interceptors.request.use(\r\n config => {\r\n const key = config.authTokenName;\r\n if (key) {\r\n const token = localStorage.getItem(key);\r\n\r\n if (token) {\r\n config.headers = {\r\n Authorization: `Bearer ${token}`,\r\n ...config.headers,\r\n };\r\n }\r\n }\r\n return config;\r\n },\r\n error => {\r\n return Promise.reject(error);\r\n }\r\n);\r\n\r\nconst isRecord = (data: any): data is Record<string, string> => {\r\n return data && (typeof data === 'object');\r\n};\r\n\r\naxios.interceptors.response.use(\r\n response => {\r\n if (response.status === 201 && response.data.location) {\r\n window.location.href = response.data.location;\r\n response.data = undefined; //防止多次跳转\r\n }\r\n\r\n return response;\r\n },\r\n e => {\r\n if (axios.isAxiosError(e)) {\r\n if (e.response) {\r\n const { data, status } = e.response;\r\n if (status === 401) {\r\n e.errors = 'Unauthorized';\r\n if (isRecord(data) && data.url) {\r\n e = new Unauthorized(data.url);\r\n }\r\n Toast.error('Unauthorized');\r\n } else {\r\n if (isRecord(data)) {\r\n if (status === 422) {\r\n e.errors = data;\r\n } else if ('message' in data) {\r\n e.errors = data['message'];\r\n }\r\n } else {\r\n e.errors = data as string;\r\n }\r\n }\r\n }\r\n }\r\n return Promise.reject(e);\r\n }\r\n);\r\n\r\nexport type RequestConfig = AxiosRequestConfig | string\r\nexport type RequestInstance = AxiosInstance\r\nexport const isRequestError = axios.isAxiosError;\r\n\r\nexport const showRequestError = (e: any) => {\r\n if (axios.isAxiosError(e)) {\r\n let errors = e.errors;\r\n if (typeof e.errors !== 'string') {\r\n errors = Object.values(e.errors).join('<br />');\r\n }\r\n Toast.error(errors as string);\r\n } else {\r\n throw e;\r\n }\r\n};\r\n\r\nconst request = async function <T = any>(config: RequestConfig) {\r\n config = typeof config === 'string' ? { url: config } : config;\r\n\r\n const { data } = await axios.request<T>({\r\n paramsSerializer: function(params) {\r\n return queryString.stringify(params, {\r\n sort: false,\r\n skipNull: true,\r\n skipEmptyString: true,\r\n arrayFormat: 'bracket',\r\n });\r\n },\r\n ...config\r\n });\r\n\r\n return data;\r\n};\r\n\r\nrequest.defaults = axios.defaults;\r\nrequest.interceptors = axios.interceptors;\r\n\r\nexport default request;\r\n","import { useCallback, useState } from 'react';\r\nimport type { Dispatch, SetStateAction } from 'react';\r\nimport useUnmountedRef from './use-unmounted-ref';\r\n\r\nfunction useSafeState<S>(initialState: S | (() => S)): [S, Dispatch<SetStateAction<S>>];\r\n\r\nfunction useSafeState<S = undefined>(): [S | undefined, Dispatch<SetStateAction<S | undefined>>];\r\n\r\nfunction useSafeState<S>(initialState?: S | (() => S)) {\r\n const unmountedRef = useUnmountedRef();\r\n const [state, setState] = useState(initialState);\r\n const setCurrentState = useCallback((currentState) => {\r\n /** if component is unmounted, stop update */\r\n if (unmountedRef.current) return;\r\n setState(currentState);\r\n }, []);\r\n\r\n return [state, setCurrentState] as const;\r\n}\r\n\r\nexport default useSafeState;\r\n","import { useEffect, useRef } from 'react';\r\n\r\nconst useUnmountedRef = () => {\r\n const unmountedRef = useRef(false);\r\n useEffect(() => {\r\n unmountedRef.current = false;\r\n return () => {\r\n unmountedRef.current = true;\r\n };\r\n }, []);\r\n return unmountedRef;\r\n};\r\n\r\nexport default useUnmountedRef;\r\n","import show from '../components/modal/show';\r\nimport Modal, { MessageProps } from '../components/modal';\r\nimport { useEffect, useRef } from 'react';\r\nimport request from '../request';\r\nimport useSafeState from '../hooks/use-safe-state';\r\n\r\ninterface PayResult {\r\n pay_url: string;\r\n order_no: string;\r\n}\r\n\r\ninterface Options {\r\n result: PayResult;\r\n checkUrl: string;\r\n onComplete?: () => void;\r\n}\r\n\r\nconst WaitModal = function({ state, message, resolve }: MessageProps<Options>) {\r\n\r\n const open = useRef(true);\r\n const { result, checkUrl, onComplete } = message;\r\n const [checking, setChecking] = useSafeState(false);\r\n\r\n useEffect(() => {\r\n request({\r\n url: checkUrl,\r\n method: 'post',\r\n data: { order_no: result.order_no },\r\n raxConfig: {\r\n shouldRetry(err) {\r\n return open.current && err.response?.status === 449;\r\n }\r\n }\r\n }).then(() => {\r\n onComplete?.();\r\n resolve();\r\n }).catch(() => null);\r\n }, []);\r\n\r\n return <Modal\r\n {...state}\r\n centered\r\n onHide={() => {\r\n open.current = false;\r\n state.onHide();\r\n }}\r\n backdrop='static'\r\n header='支付结果'\r\n okText='已完成支付'\r\n okButtonProps={{ loading: checking }}\r\n onOk={async (e) => {\r\n e.preventDefault();\r\n try {\r\n setChecking(true);\r\n await request({\r\n url: checkUrl,\r\n method: 'post',\r\n data: { order_no: result.order_no },\r\n raxConfig: {\r\n shouldRetry() {\r\n return false;\r\n }\r\n }\r\n });\r\n onComplete?.();\r\n resolve();\r\n } catch {\r\n // ignore\r\n } finally {\r\n setChecking(false);\r\n }\r\n }}\r\n cancelText='取消'\r\n >\r\n 请在新打开的页面上进行支付,支付完成后再关闭此窗口\r\n </Modal>;\r\n};\r\n\r\nexport default function waitPayComplete(options: Options) {\r\n const { result } = options;\r\n window.open(result.pay_url);\r\n show(WaitModal, options);\r\n}\r\n","import { ReactNode } from 'react';\r\nimport styled from 'styled-components';\r\n\r\nconst Container = styled.div`\r\n padding: 48px 32px;\r\n`;\r\n\r\nconst Icon = styled.div`\r\n margin-bottom: 24px;\r\n text-align: center;\r\n font-size: 72px;\r\n`;\r\n\r\nconst Title = styled.div`\r\n color: rgba(0, 0, 0, .85);\r\n font-size: 24px;\r\n line-height: 1.8;\r\n text-align: center;\r\n`;\r\n\r\nconst Extra = styled.div`\r\n margin-top: 32px;\r\n text-align: center;\r\n`;\r\n\r\nconst IconMap = {\r\n success: <i className='bi bi-check-circle-fill text-success' />,\r\n error: <i className='bi bi-exclamation-circle-fill text-danger' />,\r\n info: <i className='bi bi-info-circle-fill text-info' />,\r\n warning: <i className='bi bi-exclamation-triangle-fill text-warning' />,\r\n};\r\n\r\ninterface ResultProps {\r\n status?: keyof typeof IconMap\r\n icon?: ReactNode\r\n title?: string\r\n extra?: ReactNode;\r\n}\r\n\r\nexport default function Result({ status, title, icon, extra }: ResultProps) {\r\n\r\n if (!icon && status) {\r\n icon = IconMap[status];\r\n }\r\n\r\n return <Container>\r\n {icon && <Icon>{icon}</Icon>}\r\n {title && <Title>{title}</Title>}\r\n {extra && <Extra>{extra}</Extra>}\r\n </Container>;\r\n}\r\n","import styled from 'styled-components';\r\n\r\nexport const Dimmable = styled.div`\r\n position: relative;\r\n`;\r\n\r\ninterface DimmerProps {\r\n active?: boolean\r\n inverted?: boolean\r\n}\r\n\r\nconst Dimmer = styled.div<DimmerProps>`\r\n display: ${props => props.active ? 'flex' : 'none'};\r\n position: absolute;\r\n top: 0 !important;\r\n left: 0 !important;\r\n width: 100%;\r\n height: 100%;\r\n text-align: center;\r\n vertical-align: middle;\r\n padding: 1em;\r\n background-color: ${props => props.inverted ? 'rgba(255, 255, 255, .85)' : 'rgba(0, 0, 0, .85)'};\r\n opacity: ${props => props.active ? 1 : 0};\r\n line-height: 1;\r\n animation-fill-mode: both;\r\n animation-duration: .5s;\r\n transition: background-color .5s linear;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n user-select: none;\r\n will-change: opacity;\r\n z-index: 990;\r\n`;\r\n\r\nexport default Dimmer;\r\n","import { PropsWithChildren } from 'react';\r\nimport { Spinner, SpinnerProps } from 'react-bootstrap';\r\nimport Dimmer from './dimmer';\r\nimport styled from 'styled-components';\r\n\r\ninterface LoaderProps {\r\n loading?: boolean;\r\n animation?: SpinnerProps['animation'];\r\n wrap?: boolean | number;\r\n}\r\n\r\nexport default function Loader({\r\n loading = true,\r\n children,\r\n variant = 'primary',\r\n animation = 'border',\r\n wrap,\r\n ...props\r\n}: PropsWithChildren<LoaderProps & Omit<SpinnerProps, 'animation'>>): JSX.Element | null {\r\n if (!loading) {\r\n return null;\r\n }\r\n\r\n if (children) {\r\n children = <p className='mt-3 text-secondary'>{children}</p>;\r\n }\r\n\r\n children = <Dimmer inverted active>\r\n <Spinner animation={animation} variant={variant} {...props} />\r\n {children}\r\n </Dimmer>;\r\n\r\n if (wrap) {\r\n return <Wrap $height={typeof wrap === 'number' ? wrap : 150}>\r\n {children}\r\n </Wrap>;\r\n }\r\n\r\n return children as JSX.Element;\r\n}\r\n\r\nconst Wrap = styled.div<{ $height: number }>`\r\n position: relative;\r\n height: ${props => `${props.$height}px`};\r\n`;\r\n","import { PropsWithChildren } from 'react';\r\nimport { Card as BsCard, CardProps as BsCardProps } from 'react-bootstrap';\r\nimport classNames from 'classnames';\r\n\r\ninterface CardProps extends BsCardProps {\r\n title?: string;\r\n}\r\n\r\nexport default function Card({ children, title, className, ...props }: PropsWithChildren<CardProps>) {\r\n\r\n return <BsCard className={classNames('border-0 shadow-sm mb-3', className)} {...props}>\r\n <div className='card-body'>\r\n {title && <>\r\n <h5>{title}</h5>\r\n <hr />\r\n </>}\r\n {children}\r\n </div>\r\n </BsCard>;\r\n}\r\n","import { Alert } from 'react-bootstrap';\r\nimport { Errors } from '../request';\r\n\r\nexport default function Error({ errors }: { errors?: Errors }) {\r\n if (!errors) {\r\n return null;\r\n }\r\n return <Alert variant='danger'>\r\n <ul className='mb-0'>\r\n {typeof errors === 'string'\r\n ? <li>{errors}</li>\r\n : Object.entries(errors).map(([name, error]) => <li key={name}>{error}</li>)\r\n }\r\n </ul>\r\n </Alert>;\r\n}\r\n","import { Children, ReactNode } from 'react';\r\nimport styled, { css } from 'styled-components';\r\n\r\ninterface SpaceProps {\r\n children: ReactNode;\r\n size?: 'small' | 'middle' | 'large' | number;\r\n direction?: 'vertical' | 'horizontal';\r\n className?: string;\r\n}\r\n\r\n\r\nexport default function Space({ children, className, size = 'small', direction = 'horizontal' }: SpaceProps) {\r\n\r\n if (typeof size === 'string') {\r\n size = {\r\n small: 8,\r\n middle: 16,\r\n large: 24\r\n }[size];\r\n }\r\n\r\n const items = Children.map(children, (child) => {\r\n if (child) {\r\n return <Item>{child}</Item>;\r\n }\r\n });\r\n\r\n return <Container className={className} $direction={direction} $size={size}>\r\n {items}\r\n </Container>;\r\n}\r\n\r\nconst Container = styled.div<{ $size: number, $direction: string }>`\r\n display: inline-flex;\r\n align-items: center;\r\n gap: ${props => props.$size}px;\r\n\r\n ${props => props.$direction === 'vertical' && css`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: inherit;\r\n `}\r\n`;\r\n\r\nconst Item = styled.div`\r\n\r\n`;\r\n","var img = \"data:image/svg+xml,%3csvg t='1651217947509' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='2548' width='16' height='16' fill='currentColor'%3e %3cpath d='M887.904 298.208c-12.864-12.064-33.152-11.488-45.216 1.408L415.936 753.984l-233.12-229.696C170.208 511.872 149.952 512 137.536 524.608c-12.416 12.576-12.256 32.864 0.352 45.248l256.48 252.672c0.096 0.096 0.224 0.128 0.32 0.224 0.096 0.096 0.128 0.224 0.224 0.32 2.016 1.92 4.448 3.008 6.784 4.288 1.152 0.672 2.144 1.664 3.36 2.144 3.776 1.472 7.776 2.24 11.744 2.24 4.192 0 8.384-0.832 12.288-2.496 1.312-0.544 2.336-1.664 3.552-2.368 2.4-1.408 4.896-2.592 6.944-4.672 0.096-0.096 0.128-0.256 0.224-0.352 0.064-0.096 0.192-0.128 0.288-0.224l449.184-478.208C901.44 330.592 900.768 310.336 887.904 298.208z' p-id='2549'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","import RcSteps from 'rc-steps';\r\nimport 'rc-steps/assets/index.css';\r\nimport styled from 'styled-components';\r\nimport { ComponentProps } from 'react';\r\nimport { ReactComponent as CheckIcon } from '../images/step_check.svg';\r\n\r\nexport default function Steps(props: ComponentProps<typeof RcSteps>) {\r\n return <CustomRcSteps\r\n icons={{\r\n finish: <CheckIcon />,\r\n error: <></>\r\n }}\r\n {...props}\r\n />;\r\n}\r\n\r\nSteps.Step = RcSteps.Step;\r\n\r\nconst CustomRcSteps = styled(RcSteps)`\r\n .rc-steps-item-icon {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n\r\n & > .rc-steps-icon {\r\n top: 0;\r\n }\r\n }\r\n\r\n .rc-steps-item-process {\r\n .rc-steps-item-icon {\r\n background: var(--bs-primary);\r\n border-color: var(--bs-primary);\r\n }\r\n }\r\n\r\n .rc-steps-item-finish {\r\n .rc-steps-item-icon {\r\n border-color: var(--bs-primary);\r\n\r\n & > .rc-steps-icon {\r\n color: var(--bs-primary);\r\n }\r\n }\r\n\r\n .rc-steps-item-title:after {\r\n background-color: var(--bs-primary);\r\n }\r\n }\r\n\r\n`;\r\n","import { ReactNode } from 'react';\r\nimport Card from './card';\r\nimport styled from 'styled-components';\r\n\r\nexport interface StatisticProps {\r\n title: ReactNode;\r\n content: ReactNode;\r\n footer?: ReactNode;\r\n}\r\n\r\nexport default function Statistic({ title, content, footer }: StatisticProps) {\r\n\r\n return <Card>\r\n <Title>{title}</Title>\r\n <Content>{content}</Content>\r\n {footer && <Footer>{footer}</Footer>}\r\n </Card>;\r\n}\r\n\r\nconst Footer = styled.div`\r\n margin-top: 9px;\r\n padding-top: 10px;\r\n border-top: 1px solid #f0f0f0;\r\n color: rgba(0, 0, 0, .65);\r\n`;\r\n\r\nconst Content = styled.div`\r\n color: rgba(0, 0, 0, .85);\r\n font-size: 24px;\r\n`;\r\n\r\nconst Title = styled.div`\r\n margin-bottom: 4px;\r\n color: rgba(0, 0, 0, .45);\r\n font-size: 1.1rem;\r\n`;\r\n\r\n","import { ReactNode, useCallback, useEffect, useMemo, useState } from 'react';\r\nimport { Pagination as BsPagination } from 'react-bootstrap';\r\n\r\nfunction noop() {\r\n}\r\n\r\n\r\nfunction isInteger(value: any): value is number {\r\n return (\r\n typeof value === 'number' && isFinite(value) && Math.floor(value) === value\r\n );\r\n}\r\n\r\nexport interface PaginationProps {\r\n className?: string\r\n total: number\r\n current?: number\r\n defaultCurrent?: number\r\n pageSize?: number\r\n defaultPageSize?: number,\r\n onChange?: (current: number, pageSize: number) => void\r\n}\r\n\r\nexport default function Pagination({\r\n total = 0,\r\n onChange = noop,\r\n defaultCurrent = 1,\r\n defaultPageSize = 10,\r\n className,\r\n ...props\r\n}: PaginationProps) {\r\n\r\n const [current, setCurrent] = useState(defaultCurrent);\r\n const [pageSize, setPageSize] = useState(defaultPageSize);\r\n\r\n useEffect(() => {\r\n if (isInteger(props.current)) {\r\n setCurrent(props.current);\r\n }\r\n }, [props.current]);\r\n\r\n useEffect(() => {\r\n if (isInteger(props.pageSize)) {\r\n setPageSize(props.pageSize);\r\n }\r\n }, [props.pageSize]);\r\n\r\n const allPages = useMemo(() => {\r\n return Math.floor((total - 1) / pageSize) + 1;\r\n }, [total, pageSize]);\r\n\r\n const handleChange = useCallback((p: number) => {\r\n return () => {\r\n if (p !== current) {\r\n setCurrent(p);\r\n onChange(p, pageSize);\r\n }\r\n };\r\n }, [onChange, current, pageSize]);\r\n\r\n const pageBufferSize = 2;\r\n const prevPage = current - 1 > 0 ? current - 1 : 0;\r\n const nextPage = current + 1 < allPages ? current + 1 : allPages;\r\n\r\n const pagerList: ReactNode[] = [];\r\n let jumpPrev: ReactNode = null;\r\n let jumpNext: ReactNode = null;\r\n let firstPager: ReactNode = null;\r\n let lastPager: ReactNode = null;\r\n\r\n if (allPages <= 3 + pageBufferSize * 2) {\r\n for (let i = 1; i <= allPages; i += 1) {\r\n const active = current === i;\r\n pagerList.push(\r\n <BsPagination.Item key={i} active={active} onClick={handleChange(i)}>{i}</BsPagination.Item>\r\n );\r\n }\r\n } else {\r\n lastPager = <BsPagination.Last key='last' onClick={handleChange(allPages)} />;\r\n firstPager = <BsPagination.First key='first' onClick={handleChange(1)} />;\r\n jumpPrev = <BsPagination.Prev key='prev' onClick={handleChange(prevPage)} />;\r\n jumpNext = <BsPagination.Next key='next' onClick={handleChange(nextPage)} />;\r\n\r\n let left = Math.max(1, current - pageBufferSize);\r\n let right = Math.min(current + pageBufferSize, allPages);\r\n\r\n if (current - 1 <= pageBufferSize) {\r\n right = 1 + pageBufferSize * 2;\r\n }\r\n\r\n if (allPages - current <= pageBufferSize) {\r\n left = allPages - pageBufferSize * 2;\r\n }\r\n\r\n for (let i = left; i <= right; i += 1) {\r\n const active = current === i;\r\n pagerList.push(\r\n <BsPagination.Item key={i} active={active} onClick={handleChange(i)}>{i}</BsPagination.Item>\r\n );\r\n }\r\n\r\n if (current - 1 >= pageBufferSize * 2 && current !== 1 + 2) {\r\n pagerList.unshift(jumpPrev);\r\n }\r\n if (\r\n allPages - current >= pageBufferSize * 2 &&\r\n current !== allPages - 2\r\n ) {\r\n pagerList.push(jumpNext);\r\n }\r\n\r\n if (left !== 1) {\r\n pagerList.unshift(firstPager);\r\n }\r\n if (right !== allPages) {\r\n pagerList.push(lastPager);\r\n }\r\n }\r\n\r\n return <BsPagination className={className}>\r\n {pagerList}\r\n </BsPagination>;\r\n\r\n}\r\n","import { useMemo } from 'react';\r\n\r\ninterface Props {\r\n value: number;\r\n currency?: boolean;\r\n locale?: string;\r\n className?: string;\r\n options?: Intl.NumberFormatOptions;\r\n}\r\n\r\nexport default function NumberFormat({ className, value, locale = 'zh-CN', currency = true, options = {} }: Props) {\r\n\r\n const formatter = useMemo(() => {\r\n\r\n let opt;\r\n\r\n if (currency) {\r\n opt = {\r\n style: 'currency',\r\n currency: 'CNY'\r\n };\r\n } else {\r\n opt = {\r\n minimumFractionDigits: 2,\r\n };\r\n }\r\n\r\n return new Intl.NumberFormat(locale, { ...opt, ...options });\r\n }, [currency, locale, options]);\r\n\r\n if (className) {\r\n return <span className={className}>{formatter.format(value)}</span>;\r\n }\r\n\r\n return <>{formatter.format(value)}</>;\r\n}\r\n","import { Button, ButtonProps } from 'react-bootstrap';\r\n\r\ninterface CustomButtonProps extends ButtonProps {\r\n loading: boolean;\r\n}\r\n\r\nexport default function LoadingButton({ loading, disabled, children, ...props }: CustomButtonProps) {\r\n\r\n return <Button {...props} disabled={loading || disabled}>\r\n {loading ? 'Loading…' : children}\r\n </Button>;\r\n}\r\n","import { ComponentProps, lazy, Suspense } from 'react';\r\n\r\nconst LazyImageZoom = lazy(() => import('./lazy/image-zoom'));\r\n\r\nexport default function ImageZoom(props: ComponentProps<typeof LazyImageZoom>) {\r\n return <Suspense fallback={null}>\r\n <LazyImageZoom {...props} />\r\n </Suspense>;\r\n}\r\n","import request, { RequestConfig, showRequestError } from '../request';\r\nimport { createElement, ElementType, MouseEvent, useCallback } from 'react';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport Button, { ButtonProps } from './button';\r\nimport useSafeState from '../hooks/use-safe-state';\r\nimport Modal from './modal';\r\n\r\ninterface Props extends Omit<ButtonProps, 'as'> {\r\n url: RequestConfig;\r\n method?: AxiosRequestConfig['method'];\r\n confirm?: string;\r\n onSuccess?: (result: any) => void;\r\n as?: ElementType | ButtonProps['as'];\r\n}\r\n\r\nexport default function RequestButton({\r\n url,\r\n method,\r\n confirm,\r\n onSuccess,\r\n children,\r\n disabled,\r\n as = Button,\r\n ...props\r\n}: Props) {\r\n\r\n const [fetching, setFetching] = useSafeState(false);\r\n\r\n const handleClick = useCallback(async (e: MouseEvent) => {\r\n e.preventDefault();\r\n try {\r\n setFetching(true);\r\n if (confirm) {\r\n if (!await Modal.confirm({ message: confirm })) {\r\n return;\r\n }\r\n }\r\n\r\n const config = typeof url === 'string' ? { url, method } : { method, ...url };\r\n\r\n const result = await request(config);\r\n\r\n if (onSuccess) {\r\n onSuccess(result);\r\n }\r\n } catch (e) {\r\n showRequestError(e);\r\n } finally {\r\n setFetching(false);\r\n }\r\n }, [url, method, setFetching]);\r\n\r\n return createElement(as, {\r\n ...props,\r\n disabled: disabled || fetching,\r\n onClick: handleClick\r\n }, children);\r\n}\r\n","import JsonForm, { getRegistry, JsonFormProps, JsonFormType } from '@topthink/json-form';\r\nimport * as React from 'react';\r\nimport {\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useCallback,\r\n useState\r\n} from 'react';\r\nimport axios, { AxiosError, Method } from 'axios';\r\nimport request from '../request';\r\nimport { mapValues } from 'lodash';\r\nimport { AjvError, ISubmitEvent, WidgetProps } from '@rjsf/core';\r\nimport Button from './button';\r\nimport useSafeState from '../hooks/use-safe-state';\r\n\r\nconst localize = require('ajv-i18n/localize/zh');\r\n\r\nexport interface FormProps<T = any> extends JsonFormProps<T> {\r\n onSuccess?: (data: any) => void;\r\n method?: Method;\r\n children?: ReactNode | ((props: { submit: ReactNode, loading: boolean }) => ReactNode);\r\n submitText?: string;\r\n onSubmitting?: (submitting: boolean) => void;\r\n transformData?: (data: T) => T;\r\n}\r\n\r\ntype Error = {\r\n __errors: string[]\r\n}\r\n\r\ntype Errors = Error | {\r\n [key: string]: Error\r\n}\r\n\r\nconst toExtraErrors = (error: AxiosError): Errors => {\r\n const errors = error.errors;\r\n if (typeof errors === 'string') {\r\n return {\r\n __errors: [errors]\r\n };\r\n }\r\n return mapValues(errors, (e) => {\r\n return {\r\n __errors: [e]\r\n };\r\n });\r\n};\r\n\r\nconst widgets = {\r\n upload: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onUpload = async (file: File) => {\r\n\r\n const data = new FormData();\r\n\r\n data.set('file', file);\r\n\r\n const { url, value } = await request({\r\n url: options.endpoint as string,\r\n method: 'post',\r\n data\r\n });\r\n\r\n return { url, value };\r\n };\r\n }\r\n\r\n return <widgets.upload {...props} options={options} />;\r\n },\r\n editor: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onUpload = async (file: File) => {\r\n\r\n const data = new FormData();\r\n\r\n data.set('file', file);\r\n\r\n const { url } = await request({\r\n url: options.endpoint as string,\r\n method: 'post',\r\n data\r\n });\r\n\r\n return url;\r\n };\r\n }\r\n\r\n return <widgets.editor {...props} options={options} />;\r\n },\r\n typeahead: function({ options, ...props }: WidgetProps) {\r\n const { widgets } = getRegistry();\r\n\r\n if (options.endpoint) {\r\n options.onSearch = async ({ value, query }) => {\r\n return await request({\r\n url: options.endpoint as string,\r\n params: { value, query }\r\n });\r\n };\r\n }\r\n\r\n return <widgets.typeahead {...props} options={options} />;\r\n }\r\n};\r\n\r\nexport interface FormType extends JsonFormType {\r\n\r\n}\r\n\r\ntype Form<T = any> = ForwardRefExoticComponent<PropsWithoutRef<FormProps<T>> & RefAttributes<FormType>>\r\n\r\nconst Form: Form = forwardRef(({\r\n action,\r\n method = 'post',\r\n onSuccess,\r\n formData,\r\n onSubmitting,\r\n onSubmit,\r\n onChange,\r\n submitText = '提交',\r\n transformData,\r\n children,\r\n ...props\r\n}, ref) => {\r\n\r\n const [extraErrors, setExtraErrors] = useState<Errors>();\r\n const [loading, setLoading] = useSafeState(false);\r\n const [data, setData] = useState(formData);\r\n\r\n const handleSubmit = useCallback(async (e: ISubmitEvent<any>, nativeEvent: React.FormEvent<HTMLFormElement>) => {\r\n if (!loading) {\r\n try {\r\n setLoading(true);\r\n if (onSubmitting) {\r\n onSubmitting(true);\r\n }\r\n if (action) {\r\n let { formData } = e;\r\n\r\n if (transformData) {\r\n formData = transformData(formData);\r\n }\r\n\r\n //todo 包含File对象需转FormData\r\n try {\r\n const result = await request({\r\n url: action,\r\n method,\r\n data: formData\r\n });\r\n setExtraErrors(undefined);\r\n if (onSuccess) {\r\n await onSuccess(result);\r\n }\r\n return result;\r\n } catch (e) {\r\n if (axios.isAxiosError(e)) {\r\n setExtraErrors(toExtraErrors(e));\r\n } else {\r\n throw e;\r\n }\r\n }\r\n } else if (onSubmit) {\r\n return await onSubmit(e, nativeEvent);\r\n }\r\n } finally {\r\n setLoading(false);\r\n if (onSubmitting) {\r\n onSubmitting(false);\r\n }\r\n }\r\n }\r\n }, [action, method, onSubmit]);\r\n\r\n const handleChange = useCallback((e: ISubmitEvent<any>) => {\r\n const { formData } = e;\r\n setData(formData);\r\n if (onChange) {\r\n onChange(e);\r\n }\r\n }, [setData, onChange]);\r\n\r\n const transformErrors = useCallback((errors: AjvError[]) => {\r\n errors = errors.map(error => ({\r\n keyword: error.name,\r\n dataPath: error.property,\r\n ...error\r\n }));\r\n\r\n localize(errors);\r\n\r\n return errors;\r\n }, []);\r\n\r\n const submit = <Button className={'px-4'} loading={loading} type='submit' variant='primary'>{submitText}</Button>;\r\n\r\n if (typeof children === 'function') {\r\n children = children({ submit, loading });\r\n }\r\n\r\n return <JsonForm\r\n ref={ref}\r\n extraErrors={extraErrors}\r\n onSubmit={handleSubmit}\r\n transformErrors={transformErrors}\r\n noHtml5Validate\r\n noValidate\r\n {...props}\r\n formData={data}\r\n onChange={handleChange}\r\n widgets={widgets}\r\n >\r\n {children || <div className='col-12'>\r\n {submit}\r\n </div>}\r\n </JsonForm>;\r\n});\r\n\r\nexport default Form;\r\n","import { Columns, TableProps, TableRowSelection } from './index';\r\nimport { InputHTMLAttributes, Key, useCallback, useEffect, useRef, useState } from 'react';\r\n\r\nconst Checkbox = function({\r\n indeterminate = false,\r\n ...props\r\n}: InputHTMLAttributes<HTMLInputElement> & { indeterminate?: boolean }) {\r\n\r\n const ref = useRef<HTMLInputElement>(null);\r\n\r\n useEffect(() => {\r\n if (ref.current) {\r\n ref.current.indeterminate = indeterminate;\r\n }\r\n }, [indeterminate]);\r\n\r\n return <input\r\n ref={ref}\r\n {...props}\r\n className='form-check-input'\r\n type='checkbox'\r\n />;\r\n};\r\n\r\nexport default function useSelection<T = any>(\r\n rowSelection: TableRowSelection<T> | undefined,\r\n rowKey: Required<TableProps<T>>['rowKey'],\r\n data: T[]\r\n): [(columns: Columns<T>) => Columns<T>, (keys: Key[]) => void] {\r\n const [keys, setKeys] = useState(() => new Set(rowSelection?.selectedRowKeys || []));\r\n\r\n const getRowKey = (record: T) => {\r\n if (typeof rowKey === 'string') {\r\n // @ts-ignore\r\n return record[rowKey];\r\n } else {\r\n return rowKey(record);\r\n }\r\n };\r\n\r\n const getRecordByKey = (key: Key) => {\r\n return data.find((record) => {\r\n return getRowKey(record) === key;\r\n })!;\r\n };\r\n\r\n const setSelectedKeys = useCallback((keys: Set<Key> | Key[]) => {\r\n if (!(keys instanceof Set)) {\r\n keys = new Set(keys);\r\n }\r\n\r\n setKeys(keys);\r\n const changedKeys = Array.from(keys);\r\n\r\n const records = changedKeys.map(function(key) {\r\n return getRecordByKey(key);\r\n });\r\n\r\n if (rowSelection?.onChange) {\r\n rowSelection?.onChange(changedKeys, records);\r\n }\r\n }, [getRecordByKey]);\r\n\r\n const transformColumns = useCallback((columns: Columns): Columns => {\r\n if (!rowSelection) {\r\n return columns;\r\n }\r\n\r\n const recordKeys = data.map(getRowKey);\r\n\r\n const checkedCurrentAll = recordKeys.every(function(key) {\r\n return keys.has(key);\r\n });\r\n\r\n const checkedCurrentSome = recordKeys.some(function(key) {\r\n return keys.has(key);\r\n });\r\n\r\n return [{\r\n key: 'selection',\r\n title: <Checkbox\r\n checked={checkedCurrentAll && data.length > 0}\r\n indeterminate={!checkedCurrentAll && checkedCurrentSome}\r\n onChange={() => {\r\n if (checkedCurrentAll) {\r\n recordKeys.forEach(function(key) {\r\n keys.delete(key);\r\n });\r\n } else {\r\n recordKeys.forEach(function(key) {\r\n keys.add(key);\r\n });\r\n }\r\n setSelectedKeys(new Set(keys));\r\n }}\r\n />,\r\n width: 30,\r\n align: 'center',\r\n render({ record }) {\r\n const key = getRowKey(record);\r\n const checked = keys.has(key);\r\n return <Checkbox\r\n checked={checked}\r\n onChange={() => {\r\n if (checked) {\r\n keys.delete(key);\r\n } else {\r\n keys.add(key);\r\n }\r\n setSelectedKeys(new Set(keys));\r\n }}\r\n />;\r\n }\r\n }, ...columns];\r\n }, [data, rowSelection, keys]);\r\n\r\n return [transformColumns, setSelectedKeys];\r\n}\r\n","var img = \"data:image/svg+xml,%3csvg t='1681378941268' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='11434' width='16' height='16' fill='currentColor'%3e %3cpath d='M252.068571 906.496h520.283429c89.581714 0 134.144-44.562286 134.144-132.845714V250.331429c0-88.283429-44.562286-132.845714-134.144-132.845715H252.068571c-89.142857 0-134.582857 44.141714-134.582857 132.845715V773.668571c0 88.704 45.44 132.845714 134.582857 132.845715z m1.28-68.992c-42.843429 0-66.852571-22.710857-66.852571-67.291429V253.805714c0-44.580571 24.009143-67.291429 66.852571-67.291428h517.723429c42.422857 0 66.432 22.710857 66.432 67.291428V770.194286c0 44.580571-24.009143 67.291429-66.432 67.291428z m258.432-123.008c22.710857 0 36.425143-15.853714 36.425143-40.704v-126.427429h134.144c24.009143 0 40.722286-12.873143 40.722286-35.584 0-23.131429-15.853714-36.425143-40.722286-36.425142H548.205714v-134.582858c0-24.850286-13.714286-40.704-36.425143-40.704s-35.565714 16.713143-35.565714 40.722286v134.582857H342.491429c-24.850286 0-41.142857 13.275429-41.142858 36.406857 0 22.710857 17.152 35.584 41.142858 35.584h133.723428v126.427429c0 23.990857 12.854857 40.704 35.565714 40.704z' p-id='11435'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","var img = \"data:image/svg+xml,%3csvg t='1681378996359' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='12821' width='16' height='16' fill='currentColor'%3e %3cpath d='M252.068571 906.496h520.283429c89.581714 0 134.144-44.562286 134.144-132.845714V250.331429c0-88.283429-44.562286-132.845714-134.144-132.845715H252.068571c-89.142857 0-134.582857 44.141714-134.582857 132.845715V773.668571c0 88.704 45.44 132.845714 134.582857 132.845715z m1.28-68.992c-42.843429 0-66.852571-22.710857-66.852571-67.291429V253.805714c0-44.580571 24.009143-67.291429 66.852571-67.291428h517.723429c42.422857 0 66.432 22.710857 66.432 67.291428V770.194286c0 44.580571-24.009143 67.291429-66.432 67.291428z m86.582858-289.718857h344.576c23.990857 0 40.704-12.854857 40.704-35.565714 0-23.149714-15.433143-36.425143-40.704-36.425143H339.931429c-24.868571 0-40.722286 13.275429-40.722286 36.425143 0 22.710857 16.713143 35.565714 40.722286 35.565714z' p-id='12822'%3e%3c/path%3e%3c/svg%3e\";\n export default img;","import { DependencyList, useCallback, useEffect, useRef } from 'react';\r\n\r\nexport default function useCallbackRef<T extends (...args: any[]) => any>(\r\n callback: T | undefined,\r\n deps: DependencyList = [],\r\n) {\r\n const callbackRef = useRef(callback);\r\n\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n return useCallback(((...args) => callbackRef.current?.(...args)) as T, deps);\r\n}\r\n","import { Dispatch, SetStateAction, useState } from 'react';\r\nimport useCallbackRef from './use-callback-ref';\r\n\r\nexport interface UseControllableStateProps<T> {\r\n value?: T;\r\n defaultValue?: T | (() => T);\r\n onChange?: (value: T) => void;\r\n shouldUpdate?: (prev: T, next: T) => boolean;\r\n}\r\n\r\nexport default function useControllableState<T>(props: UseControllableStateProps<T>) {\r\n const {\r\n value: valueProp,\r\n defaultValue,\r\n onChange,\r\n shouldUpdate = (prev, next) => prev !== next,\r\n } = props;\r\n\r\n const onChangeProp = useCallbackRef(onChange);\r\n const shouldUpdateProp = useCallbackRef(shouldUpdate);\r\n\r\n const [uncontrolledState, setUncontrolledState] = useState(defaultValue as T);\r\n const controlled = valueProp !== undefined;\r\n const value = controlled ? valueProp : uncontrolledState;\r\n\r\n const setValue = useCallbackRef(\r\n (next: SetStateAction<T>) => {\r\n const setter = next as (prevState?: T) => T;\r\n const nextValue = typeof next === 'function' ? setter(value) : next;\r\n\r\n if (!shouldUpdateProp(value, nextValue)) {\r\n return;\r\n }\r\n\r\n if (!controlled) {\r\n setUncontrolledState(nextValue);\r\n }\r\n\r\n onChangeProp(nextValue);\r\n },\r\n [controlled, onChangeProp, value, shouldUpdateProp],\r\n );\r\n\r\n return [value, setValue] as [T, Dispatch<SetStateAction<T>>];\r\n}\r\n","import { debounce, DebouncedFunc } from 'lodash';\r\nimport { useEffect, useRef } from 'react';\r\n\r\nexport default function useDebounce<T extends (...args: any) => any>(callback: T, wait: number, options?: {}): DebouncedFunc<T> {\r\n const callbackRef = useRef<T>(callback);\r\n const debouncedCallbackRef = useRef<DebouncedFunc<T>>(\r\n debounce(callback, wait, options)\r\n );\r\n\r\n useEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n useEffect(() => {\r\n debouncedCallbackRef.current = debounce((...args: any) => {\r\n callbackRef.current(...args);\r\n }, wait, options);\r\n }, [wait, options]);\r\n\r\n return debouncedCallbackRef.current;\r\n}\r\n","import { ChangeEvent, useCallback, useEffect, useState } from 'react';\r\nimport useDebounce from '../../hooks/use-debounce';\r\nimport styled from 'styled-components';\r\nimport Button from '../button';\r\nimport Form from '../form';\r\nimport { FormControl } from 'react-bootstrap';\r\nimport type { Columns } from './index';\r\nimport { Schema, UiSchema } from '@topthink/json-form';\r\n\r\nexport type SearchOptions = {\r\n fields: string[];\r\n extraFields?: Record<string, string>;\r\n ui?: Record<string, UiSchema>;\r\n order?: string[];\r\n};\r\n\r\ninterface SearchProps {\r\n data: Record<string, string>;\r\n options: SearchOptions;\r\n columns: Columns;\r\n onSearch: (params: Record<string, any>) => void;\r\n}\r\n\r\nexport default function Search({ data, options, columns, onSearch }: SearchProps) {\r\n\r\n const [key, setKey] = useState(0);\r\n\r\n const uiSchema: UiSchema = {\r\n 'ui:col': 10,\r\n 'ui:order': options.order\r\n };\r\n\r\n const properties: Schema['properties'] = {};\r\n\r\n options.fields.forEach(field => {\r\n const column = columns.find(column => column.dataIndex === field);\r\n\r\n if (column) {\r\n const title = column.title;\r\n if (typeof title === 'string') {\r\n uiSchema[field] = {\r\n 'ui:col': 4,\r\n 'ui:labelCol': 3,\r\n 'ui:placeholder': '请输入',\r\n ...options.ui?.[field]\r\n };\r\n\r\n if (column.valueEnum) {\r\n const valueEnum = column.valueEnum;\r\n\r\n uiSchema[field]['ui:placeholder'] = '请选择';\r\n\r\n return properties[field] = {\r\n title,\r\n type: 'string',\r\n enum: Object.keys(valueEnum).flatMap(key => {\r\n const text = valueEnum[key].text;\r\n if (typeof text === 'string') {\r\n return [key];\r\n }\r\n return [];\r\n }),\r\n enumNames: Object.keys(valueEnum).flatMap(key => {\r\n const text = valueEnum[key].text;\r\n if (typeof text === 'string') {\r\n return [text];\r\n }\r\n return [];\r\n }),\r\n };\r\n }\r\n\r\n return properties[field] = {\r\n title,\r\n type: 'string',\r\n };\r\n }\r\n }\r\n });\r\n\r\n if (options.extraFields) {\r\n Object.entries(options.extraFields).forEach(([field, title]) => {\r\n uiSchema[field] = {\r\n 'ui:col': 4,\r\n 'ui:labelCol': 3,\r\n 'ui:placeholder': '请输入',\r\n ...options.ui?.[field]\r\n };\r\n properties[field] = {\r\n title,\r\n type: 'string',\r\n };\r\n });\r\n }\r\n\r\n const schema: Schema = {\r\n type: 'object',\r\n properties\r\n };\r\n\r\n const onSubmit = useCallback(({ formData }) => {\r\n onSearch(formData);\r\n }, [onSearch]);\r\n\r\n const onReset = useCallback(() => {\r\n setKey(key => key + 1);\r\n onSearch({});\r\n }, []);\r\n\r\n return <Container key={key}>\r\n <Form\r\n formContext={{ layout: 'horizontal' }}\r\n schema={schema}\r\n uiSchema={uiSchema}\r\n onSubmit={onSubmit}\r\n formData={data}\r\n >\r\n <div className='col-2 ms-auto mt-auto'>\r\n <div className='justify-content-end d-flex gap-2 '>\r\n <Button className={'px-4'} onClick={onReset} variant='secondary'>重置</Button>\r\n <Button className={'px-4'} type='submit' variant='primary'>查询</Button>\r\n </div>\r\n </div>\r\n </Form>\r\n </Container>;\r\n}\r\n\r\nconst Container = styled.div`\r\n margin-bottom: 1rem;\r\n`;\r\n\r\ninterface Props {\r\n keyword: string;\r\n onKeywordChange: (value: string) => void;\r\n}\r\n\r\nexport function LightSearch({ keyword, onKeywordChange }: Props) {\r\n\r\n const [value, setValue] = useState(keyword);\r\n\r\n const debouncedOnKeywordChange = useDebounce(onKeywordChange, 500);\r\n\r\n useEffect(() => {\r\n setValue(keyword);\r\n }, [keyword]);\r\n\r\n const onChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {\r\n setValue(e.target.value);\r\n debouncedOnKeywordChange(e.target.value);\r\n }, [debouncedOnKeywordChange, setValue]);\r\n\r\n return <FormControl value={value} onChange={onChange} type={'search'} placeholder={'Search...'} />;\r\n}\r\n","import RcTable, { TableProps as RcTableProps } from 'rc-table';\r\nimport { unstable_batchedUpdates } from 'react-dom';\r\nimport { ColumnType as BsColumnType, RenderedCell, RenderExpandIconProps } from 'rc-table/es/interface';\r\nimport { Table as BsTable } from 'react-bootstrap';\r\nimport { useUrlSearchParams } from 'use-url-search-params';\r\nimport {\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n Key,\r\n memo,\r\n PropsWithChildren,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useCallback,\r\n useEffect,\r\n useImperativeHandle,\r\n useMemo,\r\n useRef,\r\n useState\r\n} from 'react';\r\nimport Pagination from '../pagination';\r\nimport styled from 'styled-components';\r\nimport request from '../../request';\r\nimport Card from '../card';\r\nimport Loader from '../loader';\r\nimport Space from '../space';\r\nimport useSelection from './use-selection';\r\nimport { PaginationType } from '../../utils/types';\r\nimport { ReactComponent as PlusIcon } from '../../images/plus_square.svg';\r\nimport { ReactComponent as MinusIcon } from '../../images/minus_square.svg';\r\nimport useControllableState from '../../hooks/use-controllable-state';\r\nimport Search, { LightSearch, SearchOptions } from './search';\r\nimport NumberFormat from '../number-format';\r\nimport { TableContext } from './context';\r\n\r\nexport interface TableType {\r\n reload: () => void;\r\n}\r\n\r\ninterface ColumnType<RecordType> extends BsColumnType<RecordType> {\r\n render?: (data: {\r\n value: any,\r\n record: RecordType,\r\n index: number,\r\n action: TableType\r\n }) => ReactNode | RenderedCell<RecordType>;\r\n valueType?: 'currency';\r\n valueEnum?: Record<number | string, {\r\n text: ReactNode;\r\n status?: string;\r\n }>;\r\n}\r\n\r\nexport type Columns<RecordType = any> = ColumnType<RecordType>[]\r\n\r\nconst CustomTHead = styled.thead`\r\n th {\r\n padding: 0.5rem 0.5rem;\r\n border-bottom-width: 1px;\r\n border-color: var(--bs-border-color);\r\n }\r\n`;\r\n\r\nconst components: RcTableProps['components'] = {\r\n table: (props) => {\r\n return <BsTable {...props} className='mb-0 align-middle table-hover' />;\r\n },\r\n header: {\r\n wrapper(props) {\r\n return <CustomTHead {...props} />;\r\n }\r\n }\r\n};\r\n\r\nconst ExpandIconContainer = styled.a`\r\n cursor: pointer;\r\n width: 28px;\r\n height: 28px;\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n vertical-align: middle;\r\n`;\r\n\r\nconst ExpandIcon = function <RecordType>({\r\n record,\r\n expanded,\r\n expandable,\r\n onExpand\r\n}: RenderExpandIconProps<RecordType>) {\r\n if (!expandable) return <ExpandIconContainer />;\r\n return <ExpandIconContainer onClick={e => onExpand(record, e)}>\r\n {expanded ? <MinusIcon /> : <PlusIcon />}\r\n </ExpandIconContainer>;\r\n};\r\n\r\nconst CustomPagination = styled(Pagination)`\r\n margin-bottom: 0;\r\n justify-content: flex-end;\r\n margin-top: 1rem;\r\n`;\r\n\r\nfunction isPagination<T>(data: any): data is PaginationType<T> {\r\n return 'current_page' in data;\r\n}\r\n\r\nexport interface TableRowSelection<RecordType = any> {\r\n selectedRowKeys?: Key[];\r\n onChange?: (selectedRowKeys: Key[], selectedRows: RecordType[]) => void;\r\n}\r\n\r\nexport interface TableProps<RecordType = any> extends Omit<RcTableProps<RecordType>, 'children' | 'columns'> {\r\n source: string | ((params: Params) => Promise<RecordType>);\r\n paginate?: boolean;\r\n columns: Columns<RecordType>;\r\n toolBarRender?: ((action: TableType) => ReactNode) | false;\r\n search?: boolean | SearchOptions;\r\n rowSelection?: TableRowSelection<RecordType>;\r\n card?: boolean;\r\n sync?: boolean;\r\n}\r\n\r\ntype Params = {\r\n page?: number;\r\n sortField?: string;\r\n sortOrder?: number;\r\n q?: string;\r\n [key: string]: any;\r\n};\r\n\r\ntype CustomTableType<T = any> = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<TableProps<T>>>\r\n & RefAttributes<TableType>>\r\n\r\nconst Table: CustomTableType = forwardRef((\r\n {\r\n source,\r\n rowKey = 'id',\r\n paginate = true,\r\n toolBarRender,\r\n columns = [],\r\n search,\r\n rowSelection,\r\n card = true,\r\n expandable = {},\r\n sync = false,\r\n ...props\r\n },\r\n ref\r\n) => {\r\n const [data, setData] = useState<any[]>([]);\r\n const [pagination, setPagination] = useState(paginate ? { total: 0, current: 1, pageSize: 10 } : null);\r\n const [loading, setLoading] = useState(true);\r\n\r\n const [params, setParams] = useUrlSearchParams({});\r\n\r\n //多选\r\n const [transformColumns, setSelectionRowKeys] = useSelection(rowSelection, rowKey, data);\r\n\r\n const [filters, setFilters] = useControllableState<Record<string, string>>({\r\n value: sync ? (params as Record<string, string> || {}) : undefined,\r\n defaultValue: {},\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams(value);\r\n }\r\n }\r\n });\r\n\r\n const [keyword, setKeyword] = useControllableState<string>({\r\n value: sync ? (params.q as string || '') : undefined,\r\n defaultValue: '',\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams({ q: value || undefined });\r\n }\r\n }\r\n });\r\n\r\n const [page, setPage] = useControllableState<number>({\r\n value: sync ? (params.page as number || 1) : undefined,\r\n defaultValue: 1,\r\n onChange: (value) => {\r\n if (sync) {\r\n setParams({ page: value || undefined });\r\n }\r\n }\r\n });\r\n\r\n const fetchData = useCallback(async () => {\r\n setLoading(true);\r\n setSelectionRowKeys([]);\r\n try {\r\n let result;\r\n const params: Params = {\r\n ...filters,\r\n q: keyword,\r\n page: page > 1 ? page : undefined,\r\n };\r\n\r\n if (typeof source === 'string') {\r\n result = await request({\r\n url: source,\r\n params,\r\n });\r\n } else {\r\n result = await source(params);\r\n }\r\n\r\n if (paginate && isPagination<any>(result)) {\r\n setPagination({\r\n total: result.total,\r\n current: result.current_page,\r\n pageSize: result.per_page\r\n });\r\n result = result.data;\r\n }\r\n setData(result);\r\n } catch (e) {\r\n\r\n } finally {\r\n setLoading(false);\r\n }\r\n }, [source, setData, keyword, page, filters]);\r\n\r\n useEffect(() => {\r\n fetchData();\r\n }, [keyword, page, filters]);\r\n\r\n const action = useRef<TableType>({\r\n reload: fetchData\r\n });\r\n\r\n useEffect(() => {\r\n action.current = {\r\n reload: fetchData\r\n };\r\n }, [fetchData]);\r\n\r\n useImperativeHandle(ref, () => action.current);\r\n\r\n const customColumns = useMemo(() => {\r\n return transformColumns(columns).map(({ render, valueType, valueEnum, ...column }) => {\r\n const customColumn: BsColumnType<any> = { ...column };\r\n\r\n if (render) {\r\n customColumn.render = (value, record, index) => {\r\n return render({ value, record, index, action: action.current });\r\n };\r\n } else if (valueType === 'currency') {\r\n customColumn.render = (value) => {\r\n return <NumberFormat value={value} />;\r\n };\r\n } else if (valueEnum) {\r\n customColumn.render = (value) => {\r\n if (valueEnum[value]) {\r\n if (valueEnum[value].status) {\r\n return <span className={`text-${valueEnum[value].status}`}>{valueEnum[value].text}</span>;\r\n }\r\n return valueEnum[value].text;\r\n }\r\n return value;\r\n };\r\n }\r\n return customColumn;\r\n });\r\n }, [columns, transformColumns, action]);\r\n\r\n const children = <>\r\n <Loader loading={loading} />\r\n {typeof search === 'object' && <Search\r\n data={filters}\r\n columns={columns}\r\n options={search}\r\n onSearch={(data) => {\r\n unstable_batchedUpdates(() => {\r\n setPage(1);\r\n setFilters(data);\r\n });\r\n }}\r\n />}\r\n {toolBarRender !== false && <Header>\r\n <LeftTools size={12}>\r\n {toolBarRender && toolBarRender(action.current)}\r\n </LeftTools>\r\n <RightTools size={12}>\r\n {search === true && <LightSearch keyword={keyword} onKeywordChange={(value) => {\r\n unstable_batchedUpdates(() => {\r\n setPage(1);\r\n setKeyword(value);\r\n });\r\n }} />}\r\n <Action onClick={action.current.reload}><i className='bi bi-arrow-repeat' /></Action>\r\n </RightTools>\r\n </Header>}\r\n <TableContext.Provider value={true}>\r\n <RcTable {...props} expandable={{ expandIcon: ExpandIcon, ...expandable }} rowKey={rowKey} columns={customColumns} components={components} data={data} />\r\n </TableContext.Provider>\r\n {pagination && <CustomPagination {...pagination} onChange={setPage} />}\r\n </>;\r\n\r\n if (card) {\r\n return <Card>\r\n {children}\r\n </Card>;\r\n }\r\n return children;\r\n});\r\n\r\nexport default memo(Table) as CustomTableType;\r\n\r\nconst Header = styled.div`\r\n display: flex;\r\n justify-content: space-between;\r\n padding-bottom: 1rem;\r\n height: 48px;\r\n border-bottom: 2px solid #212529;\r\n`;\r\n\r\nconst RightTools = styled(Space)`\r\n\r\n`;\r\nconst LeftTools = styled(Space)`\r\n\r\n`;\r\n\r\nconst Action = styled.span`\r\n cursor: pointer;\r\n font-size: 20px;\r\n line-height: 1;\r\n\r\n &:hover {\r\n color: var(--bs-primary);\r\n }\r\n`;\r\n","import { useCallback, useState } from 'react';\r\n\r\ninterface Options {\r\n onHide?: () => void;\r\n onShow?: () => void;\r\n}\r\n\r\nlet id = 0;\r\n\r\nexport default function useOverlayState({ onHide, onShow }: Options = {}) {\r\n const [visible, setVisible] = useState(false);\r\n\r\n const [key, setKey] = useState(`visible-${id}`);\r\n\r\n const hide = useCallback(() => {\r\n setVisible(false);\r\n if (onHide) {\r\n onHide();\r\n }\r\n }, [setVisible, onHide]);\r\n\r\n const exit = useCallback(() => {\r\n setKey(`visible-${++id}`);\r\n }, [setKey, id]);\r\n\r\n const show = useCallback(() => {\r\n setVisible(true);\r\n if (onShow) {\r\n onShow();\r\n }\r\n }, [setVisible, onShow]);\r\n\r\n const state = {\r\n show: visible,\r\n onHide: hide,\r\n onExited: exit,\r\n key\r\n };\r\n\r\n return {\r\n visible,\r\n show,\r\n hide,\r\n state\r\n };\r\n}\r\n","import {\r\n createElement,\r\n ElementType,\r\n forwardRef,\r\n ForwardRefExoticComponent,\r\n MouseEvent,\r\n PropsWithChildren,\r\n PropsWithoutRef,\r\n ReactNode,\r\n RefAttributes,\r\n useImperativeHandle\r\n} from 'react';\r\nimport useOverlayState from '../hooks/use-overlay-state';\r\nimport Modal, { ModalProps } from './modal';\r\nimport { ButtonProps } from 'react-bootstrap';\r\nimport Button from './button';\r\n\r\nexport interface ModalButtonProps extends Omit<ButtonProps, 'as'> {\r\n text: ReactNode;\r\n modalProps?: Omit<ModalProps, 'children' | 'confirmLoading' | 'onOk'>;\r\n onOk?: () => any;\r\n onShow?: () => void;\r\n confirmLoading?: boolean;\r\n as?: ElementType | ButtonProps['as'];\r\n}\r\n\r\nexport interface ModalType {\r\n close: () => void;\r\n}\r\n\r\ntype ModalButtonType = ForwardRefExoticComponent<PropsWithoutRef<PropsWithChildren<ModalButtonProps>>\r\n & RefAttributes<ModalType>>\r\n\r\nconst ModalButton: ModalButtonType = forwardRef(({\r\n text,\r\n onOk,\r\n modalProps,\r\n children,\r\n onShow,\r\n confirmLoading,\r\n as = Button,\r\n ...props\r\n}, ref) => {\r\n\r\n const { state, show, hide } = useOverlayState({ onShow });\r\n\r\n useImperativeHandle(ref, () => ({\r\n close: hide\r\n }));\r\n\r\n const handleOk = async (e: MouseEvent) => {\r\n if (onOk) {\r\n const result = await onOk();\r\n if (result === false) {\r\n e.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n const button = createElement(as, {\r\n ...props,\r\n onClick: show\r\n }, text);\r\n\r\n return <>\r\n {button}\r\n <Modal\r\n header={text}\r\n {...modalProps}\r\n {...state}\r\n confirmLoading={confirmLoading}\r\n onOk={handleOk}\r\n >\r\n {children}\r\n </Modal>\r\n </>;\r\n});\r\n\r\nexport default ModalButton;\r\n","import ModalButton, { ModalButtonProps, ModalType } from './modal-button';\r\nimport { ReactNode, useCallback, useRef, useState } from 'react';\r\nimport Form, { FormProps, FormType } from './form';\r\n\r\nexport interface ModalFormProps<T = any> extends FormProps<T> {\r\n text: ReactNode;\r\n buttonProps?: Omit<ModalButtonProps, 'text' | 'modalProps' | 'confirmLoading' | 'onOk'>;\r\n modalProps?: ModalButtonProps['modalProps'];\r\n children?: ReactNode;\r\n}\r\n\r\nexport default function ModalForm<T = any>({\r\n text,\r\n onSuccess,\r\n buttonProps,\r\n modalProps,\r\n children,\r\n ...props\r\n}: ModalFormProps<T>) {\r\n\r\n const [loading, setLoading] = useState(false);\r\n\r\n const ref = useRef<ModalType>(null);\r\n const form = useRef<FormType>(null);\r\n\r\n const handleOk = useCallback(() => {\r\n form.current?.submit();\r\n return false;\r\n }, []);\r\n\r\n const handleSuccess = useCallback((data) => {\r\n if (onSuccess) {\r\n onSuccess(data);\r\n }\r\n ref.current?.close();\r\n }, [onSuccess]);\r\n\r\n return <ModalButton\r\n ref={ref}\r\n text={text}\r\n {...buttonProps}\r\n modalProps={modalProps}\r\n onOk={handleOk}\r\n confirmLoading={loading}\r\n >\r\n <Form\r\n {...props}\r\n onSubmitting={setLoading}\r\n ref={form}\r\n onSuccess={handleSuccess}\r\n >\r\n {children}\r\n <input type='submit' hidden />\r\n </Form>\r\n </ModalButton>;\r\n}\r\n","import { useAsyncCallback, UseAsyncCallbackOptions } from 'react-async-hook';\r\nimport request, { isRequestError, RequestConfig } from '../request';\r\nimport { DependencyList, useCallback, useEffect } from 'react';\r\nimport { AxiosRequestConfig } from 'axios';\r\nimport { values } from 'lodash';\r\n\r\ntype UseRequestOptions<T> = {\r\n manual?: boolean\r\n refreshDeps?: DependencyList;\r\n} & UseAsyncCallbackOptions<T>;\r\n\r\nexport default function useRequest<T = any>(config: RequestConfig, {\r\n manual,\r\n refreshDeps,\r\n ...options\r\n}: UseRequestOptions<T> = {}) {\r\n let { execute, currentParams, error, ...others } = useAsyncCallback(async (params?: AxiosRequestConfig) => {\r\n\r\n config = typeof config === 'string' ? { url: config } : config;\r\n\r\n return await request<T>({\r\n ...config,\r\n ...params\r\n });\r\n }, options);\r\n\r\n useEffect(() => {\r\n if (!manual && !refreshDeps) {\r\n try {\r\n execute();\r\n } catch {\r\n\r\n }\r\n }\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (refreshDeps) {\r\n refresh();\r\n }\r\n }, refreshDeps);\r\n\r\n const refresh = useCallback(async () => {\r\n try {\r\n if (currentParams) {\r\n await execute(...currentParams);\r\n } else {\r\n await execute();\r\n }\r\n } catch {\r\n\r\n }\r\n }, [execute, currentParams]);\r\n\r\n if (error && isRequestError(error)) {\r\n const errors = error.errors;\r\n error = new Error(typeof errors === 'string' ? errors : values(errors).join(''));\r\n }\r\n\r\n return {\r\n refresh,\r\n execute,\r\n error,\r\n ...others\r\n };\r\n}\r\n"],"names":["CustomSwal","withReactContent","Swal","defaultOptions","confirmButtonText","cancelButtonText","Message","confirm","async","isConfirmed","fire","icon","showCancelButton","options","data","preConfirm","e","Error","showValidationMessage","message","success","toast","position","timer","showConfirmButton","error","close","result","defaults","MessageContext","createContext","wrapMessage","Component","_ref","resolve","destroy","show","setShow","initState","callbackRef","useRef","state","setState","useState","useEffect","current","value","callback","useStateWithCallback","context","useContext","handleResolve","useCallback","useMemo","onHide","onExited","container","_jsx","createMessage","Promise","component","hide","listener","memoryState","Set","modal","add","delete","Tooltip","tooltip","children","placement","OverlayTrigger","overlay","BsTooltip","id","uniqueId","TableContext","Button","forwardRef","ref","loading","percent","disabled","variant","props","_jsxs","Spinner","as","size","role","animation","className","button","BsButton","Confirm","title","okText","cancelText","Modal","centered","Header","Title","Body","Footer","onClick","header","footer","closable","onOk","onCancel","okButtonProps","bodyAs","headerAs","confirmLoading","rest","setLoading","okButton","defaultPrevented","cancelButton","_Fragment","ReactModal","closeButton","Provider","Array","from","map","index","Fragment","Unauthorized","constructor","url","super","_defineProperty","this","noticeInstance","notice","type","Notification","newInstance","prefixCls","maxCount","style","top","right","instance","getNoticeInstance","duration","content","Alert","Toast","reduce","rax","attach","axios","raxConfig","retryDelay","backoffType","shouldRetry","config","response","retryDecider","method","toUpperCase","status","maxContentLength","Infinity","maxBodyLength","baseURL","authTokenName","interceptors","request","use","key","token","localStorage","getItem","headers","Authorization","reject","isRecord","location","window","href","undefined","isAxiosError","errors","isRequestError","showRequestError","Object","values","join","paramsSerializer","params","queryString","stringify","sort","skipNull","skipEmptyString","arrayFormat","useSafeState","initialState","unmountedRef","useUnmountedRef","currentState","WaitModal","open","checkUrl","onComplete","checking","setChecking","order_no","err","then","catch","backdrop","preventDefault","waitPayComplete","pay_url","Container","styled","div","Icon","Extra","IconMap","info","warning","Result","extra","Dimmer","active","inverted","Loader","wrap","Wrap","$height","Card","BsCard","classNames","entries","_ref2","name","Space","direction","small","middle","large","items","Children","child","Item","$direction","$size","css","_path","_extends","assign","bind","target","i","arguments","length","source","prototype","hasOwnProperty","call","apply","SvgStepCheck","React","createElement","viewBox","xmlns","width","height","fill","d","Steps","CustomRcSteps","icons","finish","CheckIcon","Step","RcSteps","Statistic","Content","noop","isInteger","isFinite","Math","floor","Pagination","total","onChange","defaultCurrent","defaultPageSize","setCurrent","pageSize","setPageSize","allPages","handleChange","p","prevPage","nextPage","pagerList","jumpPrev","jumpNext","firstPager","lastPager","push","BsPagination","Last","First","Prev","Next","left","max","min","pageBufferSize","unshift","NumberFormat","locale","currency","formatter","opt","minimumFractionDigits","Intl","format","LoadingButton","LazyImageZoom","lazy","import","ImageZoom","Suspense","fallback","RequestButton","onSuccess","fetching","setFetching","handleClick","localize","require","widgets","upload","getRegistry","endpoint","onUpload","FormData","set","file","editor","typeahead","_ref3","onSearch","query","_ref4","Form","_ref5","action","formData","onSubmitting","onSubmit","submitText","transformData","extraErrors","setExtraErrors","setData","handleSubmit","nativeEvent","__errors","mapValues","toExtraErrors","transformErrors","keyword","dataPath","property","submit","JsonForm","noHtml5Validate","noValidate","Checkbox","indeterminate","SvgPlusSquare","SvgMinusSquare","useCallbackRef","deps","_len","args","_key","useControllableState","valueProp","defaultValue","shouldUpdate","prev","next","onChangeProp","shouldUpdateProp","uncontrolledState","setUncontrolledState","controlled","setValue","nextValue","useDebounce","wait","debouncedCallbackRef","debounce","Search","columns","setKey","uiSchema","order","properties","fields","forEach","field","column","find","dataIndex","ui","valueEnum","enum","keys","flatMap","text","enumNames","extraFields","schema","onReset","formContext","layout","LightSearch","onKeywordChange","debouncedOnKeywordChange","FormControl","placeholder","CustomTHead","thead","components","table","BsTable","wrapper","ExpandIconContainer","a","ExpandIcon","record","expanded","expandable","onExpand","MinusIcon","PlusIcon","CustomPagination","Table","rowKey","paginate","toolBarRender","search","rowSelection","card","sync","pagination","setPagination","setParams","useUrlSearchParams","transformColumns","setSelectionRowKeys","setKeys","selectedRowKeys","getRowKey","getRecordByKey","setSelectedKeys","changedKeys","records","recordKeys","checkedCurrentAll","every","has","checkedCurrentSome","some","checked","align","render","useSelection","filters","setFilters","setKeyword","q","page","setPage","fetchData","isPagination","current_page","per_page","reload","useImperativeHandle","customColumns","valueType","customColumn","unstable_batchedUpdates","LeftTools","RightTools","Action","RcTable","expandIcon","memo","span","useOverlayState","onShow","visible","setVisible","exit","ModalButton","modalProps","ModalForm","buttonProps","form","handleOk","handleSuccess","hidden","useRequest","manual","refreshDeps","execute","currentParams","others","useAsyncCallback","refresh"],"mappings":"g1CAIA,MAAMA,EAAa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AAsB,CAAE5B,IAAK4B,GAAWA,QAE3CY,GAAW,IACjBZ,KACAkC,MAERpL,GAEH+B,GAAU,KACN,IAAK0d,IAAWC,EACZ,IACIC,GAGH,CAFC,MAED,CACJ,GACF,IAEH5d,GAAU,KACF2d,GACAK,GACH,GACFL,GAEH,MAAMK,EAAUxd,GAAY5C,UACxB,IACQigB,QACMD,KAAWC,SAEXD,GAIb,CAFC,MAED,IACF,CAACA,EAASC,IAEb,GAAIhf,GAASkK,GAAelK,GAAQ,CAChC,MAAMiK,EAASjK,EAAMiK,OACrBjK,EAAQ,IAAIR,MAAwB,iBAAXyK,EAAsBA,EAASI,EAAOJ,GAAQK,KAAK,IAC/E,CAED,MAAO,CACH6U,UACAJ,UACA/e,WACGif,EAEX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prebuild": "rimraf lib types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.11.2",
|
|
20
20
|
"@topthink/bootstrap": "^1.0.23",
|
|
21
|
-
"@topthink/json-form": "^1.0.
|
|
21
|
+
"@topthink/json-form": "^1.0.41",
|
|
22
22
|
"@types/styled-components": "^5.1.11",
|
|
23
23
|
"ajv-i18n": "^4.0.0",
|
|
24
24
|
"axios": "^0.27.2",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
},
|
|
63
63
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
64
64
|
"license": "MIT",
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "68eee4860cd1c4afc573cde6d5f565009bf451ad"
|
|
66
66
|
}
|