@fastspace/schema-form 0.0.11 → 0.0.14
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/dist/index.d.ts
CHANGED
|
@@ -232,6 +232,8 @@ export declare type FieldSchema<T extends FieldValues = FieldValues> = {
|
|
|
232
232
|
noSubmit?: boolean;
|
|
233
233
|
/** 依赖字段(用于触发重新计算/校验) */
|
|
234
234
|
dependencies?: string[];
|
|
235
|
+
/** 组件透传属性 (快捷方式,等同于 ui.props) */
|
|
236
|
+
fieldProps?: Record<string, unknown>;
|
|
235
237
|
};
|
|
236
238
|
|
|
237
239
|
/**
|
package/dist/schema-form-lib.js
CHANGED
|
@@ -24,7 +24,7 @@ theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
|
24
24
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
25
25
|
|
|
26
26
|
export default theme;`}function So(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const el=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let n=0;n<t.length;n+=1)r+=+t[n];return r};function tl(e){Object.assign(e,{alpha(t,r){const n=this||e;return n.colorSpace?`oklch(from ${t} l c h / ${typeof r=="string"?`calc(${r})`:r})`:n.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof r=="string"?`calc(${r})`:r})`:Gt(t,el(r))},lighten(t,r){const n=this||e;return n.colorSpace?`color-mix(in ${n.colorSpace}, ${t}, #fff ${So(r)})`:Yt(t,r)},darken(t,r){const n=this||e;return n.colorSpace?`color-mix(in ${n.colorSpace}, ${t}, #000 ${So(r)})`:Ut(t,r)}})}function Or(e={},...t){const{breakpoints:r,mixins:n={},spacing:o,palette:i={},transitions:a={},typography:l={},shape:u,colorSpace:f,...m}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Ve(20));const y=Er({...i,colorSpace:f}),p=mt(e);let b=ye(p,{mixins:Wa(p.breakpoints,n),palette:y,shadows:Ya.slice(),typography:Fa(y,l),transitions:Qa(a),zIndex:{...Ja}});if(b=ye(b,m),b=t.reduce((h,d)=>ye(h,d),b),process.env.NODE_ENV!=="production"){const h=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],d=(g,x)=>{let A;for(A in g){const R=g[A];if(h.includes(A)&&Object.keys(R).length>0){if(process.env.NODE_ENV!=="production"){const O=ve("",A)}g[A]={}}}};Object.keys(b.components).forEach(g=>{const x=b.components[g].styleOverrides;x&&g.startsWith("Mui")&&d(x,g)})}return b.unstable_sxConfig={...pt,...m?.unstable_sxConfig},b.unstable_sx=function(d){return Ye({sx:d,theme:this})},b.toRuntimeSource=vo,tl(b),b}function $r(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const rl=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=$r(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Co(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function To(e){return e==="dark"?rl:[]}function nl(e){const{palette:t={mode:"light"},opacity:r,overlays:n,colorSpace:o,...i}=e,a=Er({...t,colorSpace:o});return{palette:a,opacity:{...Co(a.mode),...r},overlays:n||To(a.mode),...i}}function ol(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const il=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],sl=e=>(t,r)=>{const n=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o?.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return il(e.cssVarPrefix).forEach(l=>{a[l]=r[l],delete r[l]}),i==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:a}}:i?{[i.replace("%s",t)]:a,[`${n}, ${i.replace("%s",t)}`]:r}:{[n]:{...r,...a}}}if(i&&i!=="media")return`${n}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(i)return i.replace("%s",String(t))}return n};function al(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function S(e,t,r){!e[t]&&r&&(e[t]=r)}function vt(e){return typeof e!="string"||!e.startsWith("hsl")?e:no(e)}function Re(e,t){`${t}Channel`in e||(e[`${t}Channel`]=gt(vt(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
27
|
-
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function ll(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const _e=e=>{try{return e()}catch{}},cl=(e="mui")=>Sa(e);function kr(e,t,r,n,o){if(!r)return;r=r===!0?{}:r;const i=o==="dark"?"dark":"light";if(!n){t[o]=nl({...r,palette:{mode:i,...r?.palette},colorSpace:e});return}const{palette:a,...l}=Or({...n,palette:{mode:i,...r?.palette},colorSpace:e});return t[o]={...r,palette:a,opacity:{...Co(i),...r?.opacity},overlays:r?.overlays||To(i)},l}function ul(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:a=!1,shouldSkipGeneratingVar:l=ol,colorSchemeSelector:u=r.light&&r.dark?"media":void 0,rootSelector:f=":root",...m}=e,y=Object.keys(r)[0],p=n||(r.light&&y!=="light"?"light":y),b=cl(i),{[p]:h,light:d,dark:g,...x}=r,A={...x};let R=h;if((p==="dark"&&!("dark"in r)||p==="light"&&!("light"in r))&&(R=!0),!R)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Ve(21,p));let O;a&&(O="oklch");const C=kr(O,A,R,m,p);d&&!A.light&&kr(O,A,d,void 0,"light"),g&&!A.dark&&kr(O,A,g,void 0,"dark");let E={defaultColorScheme:p,...C,cssVarPrefix:i,colorSchemeSelector:u,rootSelector:f,getCssVar:b,colorSchemes:A,font:{...za(C.typography),...C.font},spacing:ll(m.spacing)};Object.keys(E.colorSchemes).forEach(N=>{const c=E.colorSchemes[N].palette,w=D=>{const M=D.split("-"),X=M[1],re=M[2];return b(D,c[X][re])};c.mode==="light"&&(S(c.common,"background","#fff"),S(c.common,"onBackground","#000")),c.mode==="dark"&&(S(c.common,"background","#000"),S(c.common,"onBackground","#fff"));function T(D,M,X){if(O){let re;return D===Ke&&(re=`transparent ${((1-X)*100).toFixed(0)}%`),D===ie&&(re=`#000 ${(X*100).toFixed(0)}%`),D===se&&(re=`#fff ${(X*100).toFixed(0)}%`),`color-mix(in ${O}, ${M}, ${re})`}return D(M,X)}if(al(c,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),c.mode==="light"){S(c.Alert,"errorColor",T(ie,c.error.light,.6)),S(c.Alert,"infoColor",T(ie,c.info.light,.6)),S(c.Alert,"successColor",T(ie,c.success.light,.6)),S(c.Alert,"warningColor",T(ie,c.warning.light,.6)),S(c.Alert,"errorFilledBg",w("palette-error-main")),S(c.Alert,"infoFilledBg",w("palette-info-main")),S(c.Alert,"successFilledBg",w("palette-success-main")),S(c.Alert,"warningFilledBg",w("palette-warning-main")),S(c.Alert,"errorFilledColor",_e(()=>c.getContrastText(c.error.main))),S(c.Alert,"infoFilledColor",_e(()=>c.getContrastText(c.info.main))),S(c.Alert,"successFilledColor",_e(()=>c.getContrastText(c.success.main))),S(c.Alert,"warningFilledColor",_e(()=>c.getContrastText(c.warning.main))),S(c.Alert,"errorStandardBg",T(se,c.error.light,.9)),S(c.Alert,"infoStandardBg",T(se,c.info.light,.9)),S(c.Alert,"successStandardBg",T(se,c.success.light,.9)),S(c.Alert,"warningStandardBg",T(se,c.warning.light,.9)),S(c.Alert,"errorIconColor",w("palette-error-main")),S(c.Alert,"infoIconColor",w("palette-info-main")),S(c.Alert,"successIconColor",w("palette-success-main")),S(c.Alert,"warningIconColor",w("palette-warning-main")),S(c.AppBar,"defaultBg",w("palette-grey-100")),S(c.Avatar,"defaultBg",w("palette-grey-400")),S(c.Button,"inheritContainedBg",w("palette-grey-300")),S(c.Button,"inheritContainedHoverBg",w("palette-grey-A100")),S(c.Chip,"defaultBorder",w("palette-grey-400")),S(c.Chip,"defaultAvatarColor",w("palette-grey-700")),S(c.Chip,"defaultIconColor",w("palette-grey-700")),S(c.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),S(c.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),S(c.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),S(c.LinearProgress,"primaryBg",T(se,c.primary.main,.62)),S(c.LinearProgress,"secondaryBg",T(se,c.secondary.main,.62)),S(c.LinearProgress,"errorBg",T(se,c.error.main,.62)),S(c.LinearProgress,"infoBg",T(se,c.info.main,.62)),S(c.LinearProgress,"successBg",T(se,c.success.main,.62)),S(c.LinearProgress,"warningBg",T(se,c.warning.main,.62)),S(c.Skeleton,"bg",O?T(Ke,c.text.primary,.11):`rgba(${w("palette-text-primaryChannel")} / 0.11)`),S(c.Slider,"primaryTrack",T(se,c.primary.main,.62)),S(c.Slider,"secondaryTrack",T(se,c.secondary.main,.62)),S(c.Slider,"errorTrack",T(se,c.error.main,.62)),S(c.Slider,"infoTrack",T(se,c.info.main,.62)),S(c.Slider,"successTrack",T(se,c.success.main,.62)),S(c.Slider,"warningTrack",T(se,c.warning.main,.62));const D=O?T(ie,c.background.default,.6825):Ht(c.background.default,.8);S(c.SnackbarContent,"bg",D),S(c.SnackbarContent,"color",_e(()=>O?wr.text.primary:c.getContrastText(D))),S(c.SpeedDialAction,"fabHoverBg",Ht(c.background.paper,.15)),S(c.StepConnector,"border",w("palette-grey-400")),S(c.StepContent,"border",w("palette-grey-400")),S(c.Switch,"defaultColor",w("palette-common-white")),S(c.Switch,"defaultDisabledColor",w("palette-grey-100")),S(c.Switch,"primaryDisabledColor",T(se,c.primary.main,.62)),S(c.Switch,"secondaryDisabledColor",T(se,c.secondary.main,.62)),S(c.Switch,"errorDisabledColor",T(se,c.error.main,.62)),S(c.Switch,"infoDisabledColor",T(se,c.info.main,.62)),S(c.Switch,"successDisabledColor",T(se,c.success.main,.62)),S(c.Switch,"warningDisabledColor",T(se,c.warning.main,.62)),S(c.TableCell,"border",T(se,T(Ke,c.divider,1),.88)),S(c.Tooltip,"bg",T(Ke,c.grey[700],.92))}if(c.mode==="dark"){S(c.Alert,"errorColor",T(se,c.error.light,.6)),S(c.Alert,"infoColor",T(se,c.info.light,.6)),S(c.Alert,"successColor",T(se,c.success.light,.6)),S(c.Alert,"warningColor",T(se,c.warning.light,.6)),S(c.Alert,"errorFilledBg",w("palette-error-dark")),S(c.Alert,"infoFilledBg",w("palette-info-dark")),S(c.Alert,"successFilledBg",w("palette-success-dark")),S(c.Alert,"warningFilledBg",w("palette-warning-dark")),S(c.Alert,"errorFilledColor",_e(()=>c.getContrastText(c.error.dark))),S(c.Alert,"infoFilledColor",_e(()=>c.getContrastText(c.info.dark))),S(c.Alert,"successFilledColor",_e(()=>c.getContrastText(c.success.dark))),S(c.Alert,"warningFilledColor",_e(()=>c.getContrastText(c.warning.dark))),S(c.Alert,"errorStandardBg",T(ie,c.error.light,.9)),S(c.Alert,"infoStandardBg",T(ie,c.info.light,.9)),S(c.Alert,"successStandardBg",T(ie,c.success.light,.9)),S(c.Alert,"warningStandardBg",T(ie,c.warning.light,.9)),S(c.Alert,"errorIconColor",w("palette-error-main")),S(c.Alert,"infoIconColor",w("palette-info-main")),S(c.Alert,"successIconColor",w("palette-success-main")),S(c.Alert,"warningIconColor",w("palette-warning-main")),S(c.AppBar,"defaultBg",w("palette-grey-900")),S(c.AppBar,"darkBg",w("palette-background-paper")),S(c.AppBar,"darkColor",w("palette-text-primary")),S(c.Avatar,"defaultBg",w("palette-grey-600")),S(c.Button,"inheritContainedBg",w("palette-grey-800")),S(c.Button,"inheritContainedHoverBg",w("palette-grey-700")),S(c.Chip,"defaultBorder",w("palette-grey-700")),S(c.Chip,"defaultAvatarColor",w("palette-grey-300")),S(c.Chip,"defaultIconColor",w("palette-grey-300")),S(c.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),S(c.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),S(c.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),S(c.LinearProgress,"primaryBg",T(ie,c.primary.main,.5)),S(c.LinearProgress,"secondaryBg",T(ie,c.secondary.main,.5)),S(c.LinearProgress,"errorBg",T(ie,c.error.main,.5)),S(c.LinearProgress,"infoBg",T(ie,c.info.main,.5)),S(c.LinearProgress,"successBg",T(ie,c.success.main,.5)),S(c.LinearProgress,"warningBg",T(ie,c.warning.main,.5)),S(c.Skeleton,"bg",O?T(Ke,c.text.primary,.13):`rgba(${w("palette-text-primaryChannel")} / 0.13)`),S(c.Slider,"primaryTrack",T(ie,c.primary.main,.5)),S(c.Slider,"secondaryTrack",T(ie,c.secondary.main,.5)),S(c.Slider,"errorTrack",T(ie,c.error.main,.5)),S(c.Slider,"infoTrack",T(ie,c.info.main,.5)),S(c.Slider,"successTrack",T(ie,c.success.main,.5)),S(c.Slider,"warningTrack",T(ie,c.warning.main,.5));const D=O?T(se,c.background.default,.985):Ht(c.background.default,.98);S(c.SnackbarContent,"bg",D),S(c.SnackbarContent,"color",_e(()=>O?fo.text.primary:c.getContrastText(D))),S(c.SpeedDialAction,"fabHoverBg",Ht(c.background.paper,.15)),S(c.StepConnector,"border",w("palette-grey-600")),S(c.StepContent,"border",w("palette-grey-600")),S(c.Switch,"defaultColor",w("palette-grey-300")),S(c.Switch,"defaultDisabledColor",w("palette-grey-600")),S(c.Switch,"primaryDisabledColor",T(ie,c.primary.main,.55)),S(c.Switch,"secondaryDisabledColor",T(ie,c.secondary.main,.55)),S(c.Switch,"errorDisabledColor",T(ie,c.error.main,.55)),S(c.Switch,"infoDisabledColor",T(ie,c.info.main,.55)),S(c.Switch,"successDisabledColor",T(ie,c.success.main,.55)),S(c.Switch,"warningDisabledColor",T(ie,c.warning.main,.55)),S(c.TableCell,"border",T(ie,T(Ke,c.divider,1),.68)),S(c.Tooltip,"bg",T(Ke,c.grey[700],.92))}Re(c.background,"default"),Re(c.background,"paper"),Re(c.common,"background"),Re(c.common,"onBackground"),Re(c,"divider"),Object.keys(c).forEach(D=>{const M=c[D];D!=="tonalOffset"&&M&&typeof M=="object"&&(M.main&&S(c[D],"mainChannel",gt(vt(M.main))),M.light&&S(c[D],"lightChannel",gt(vt(M.light))),M.dark&&S(c[D],"darkChannel",gt(vt(M.dark))),M.contrastText&&S(c[D],"contrastTextChannel",gt(vt(M.contrastText))),D==="text"&&(Re(c[D],"primary"),Re(c[D],"secondary")),D==="action"&&(M.active&&Re(c[D],"active"),M.selected&&Re(c[D],"selected")))})}),E=t.reduce((N,c)=>ye(N,c),E);const z={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:sl(E),enableContrastVars:a},{vars:Z,generateThemeVars:G,generateStyleSheets:Y}=xa(E,z);return E.vars=Z,Object.entries(E.colorSchemes[E.defaultColorScheme]).forEach(([N,c])=>{E[N]=c}),E.generateThemeVars=G,E.generateStyleSheets=Y,E.generateSpacing=function(){return Hn(m.spacing,_t(this))},E.getColorSchemeSelector=wa(u),E.spacing=E.generateSpacing(),E.shouldSkipGeneratingVar=l,E.unstable_sxConfig={...pt,...m?.unstable_sxConfig},E.unstable_sx=function(c){return Ye({sx:c,theme:this})},E.toRuntimeSource=vo,E}function xo(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Er({...r===!0?{}:r.palette,mode:t})})}function wo(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:o=r?void 0:{light:!0},defaultColorScheme:i=r?.mode,...a}=e,l=i||"light",u=o?.[l],f={...o,...r?{[l]:{...typeof u!="boolean"&&u,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Or(e,...t);let m=r;"palette"in e||f[l]&&(f[l]!==!0?m=f[l].palette:l==="dark"&&(m={mode:"dark"}));const y=Or({...e,palette:m},...t);return y.defaultColorScheme=l,y.colorSchemes=f,y.palette.mode==="light"&&(y.colorSchemes.light={...f.light!==!0&&f.light,palette:y.palette},xo(y,"dark",f.dark)),y.palette.mode==="dark"&&(y.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:y.palette},xo(y,"light",f.light)),y}return!r&&!("light"in f)&&l==="light"&&(f.light=!0),ul({...a,colorSchemes:f,defaultColorScheme:l,...typeof n!="boolean"&&n},...t)}const Eo=wo();function Oo(){const e=Wt(Eo);return process.env.NODE_ENV!=="production"&&j.useDebugValue(e),e[Sr]||e}function dl(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const $o=e=>dl(e)&&e!=="classes",ge=Qn({themeId:Sr,defaultTheme:Eo,rootShouldForwardProp:$o});process.env.NODE_ENV!=="production"&&(s.node,s.object.isRequired);function Oe(e){return ya(e)}const Xe=aa({createStyledComponent:ge("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>Oe({props:e,name:"MuiGrid"}),useTheme:Oo});if(process.env.NODE_ENV!=="production"&&(Xe.propTypes={children:s.node,columns:s.oneOfType([s.arrayOf(s.number),s.number,s.object]),columnSpacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),container:s.bool,direction:s.oneOfType([s.oneOf(["column-reverse","column","row-reverse","row"]),s.arrayOf(s.oneOf(["column-reverse","column","row-reverse","row"])),s.object]),offset:s.oneOfType([s.string,s.number,s.arrayOf(s.oneOfType([s.string,s.number])),s.object]),rowSpacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),size:s.oneOfType([s.string,s.bool,s.number,s.arrayOf(s.oneOfType([s.string,s.bool,s.number])),s.object]),spacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),unstable_level:s.number,wrap:s.oneOf(["nowrap","wrap-reverse","wrap"])}),process.env.NODE_ENV!=="production"){const e=Xe,t=la("Grid",e);e.propTypes={...e.propTypes,direction:t("container"),spacing:t("container"),wrap:t("container")}}function fl(e){return e==null?{xs:12}:typeof e=="object"?e:{xs:e}}function pl(e){const t=new Set,r=n=>{const o=i=>{if(i){if(typeof i=="function"){t.add("*");return}"field"in i&&t.add(i.field),"and"in i&&Array.isArray(i.and)&&i.and.forEach(o),"or"in i&&Array.isArray(i.or)&&i.or.forEach(o),"not"in i&&o(i.not)}};o(n.visibleWhen),o(n.disabledWhen),o(n.requiredWhen),n.dependencies&&n.dependencies.forEach(i=>t.add(i))};if(r(e),e.component==="Group"&&e.columns){const n=o=>{o.forEach(i=>{r(i),i.component==="Group"&&i.columns&&n(i.columns)})};n(e.columns)}return Array.from(t)}function ml({field:e,index:t,values:r,form:n,disabled:o=!1,readOnly:i=!1,widgets:a,optionsMap:l,useGrid:u=!0}){const f=ut(e,r,o,i);if(!f.visible)return null;const m=a[e.component]??a.Text,y=l[e.name]??e.ui?.options??[],b=e.component==="Group"||e.component==="FormList"?v.jsx(m,{field:{name:e.name,value:void 0,onChange:()=>{},onBlur:()=>{},ref:()=>{}},form:n,globalDisabled:o,globalReadOnly:i,label:e.ui?.label,optionsMap:l,schema:e,widgets:a,values:r}):v.jsx(Fe.Controller,{control:n.control,name:e.name,render:({field:h,fieldState:d})=>v.jsx(m,{error:!!d.error,field:h,fieldProps:{...e.ui?.props,disabled:f.disabled,required:f.required,readOnly:f.readonly,placeholder:e.ui?.placeholder},form:n,helperText:d.error?.message??e.ui?.helperText,label:e.ui?.label,options:y,values:r,schema:e})});if(u){const h=fl(e.colSpan);return v.jsx(Xe,{size:h,children:b},`${String(e.name)}-${t}`)}return b}const ko=W.memo(ml,(e,t)=>{if(e.field!==t.field||e.index!==t.index||e.disabled!==t.disabled||e.readOnly!==t.readOnly||e.useGrid!==t.useGrid||e.widgets!==t.widgets||e.form!==t.form)return!1;const r=e.optionsMap[e.field.name],n=t.optionsMap[t.field.name];if(r!==n)return!1;const o=pl(t.field);if(o.includes("*"))return!1;for(const i of o)if(e.values[i]!==t.values[i])return!1;return!0}),Ao=({spacing:e=2,children:t})=>v.jsx(Xe,{container:!0,spacing:e,children:t}),Po=Ia({createStyledComponent:ge("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>Oe({props:e,name:"MuiStack"})});process.env.NODE_ENV!=="production"&&(Po.propTypes={children:s.node,component:s.elementType,direction:s.oneOfType([s.oneOf(["column-reverse","column","row-reverse","row"]),s.arrayOf(s.oneOf(["column-reverse","column","row-reverse","row"])),s.object]),divider:s.node,spacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),useFlexGap:s.bool});const Io=({spacing:e=2,children:t})=>v.jsx(Po,{spacing:e,children:t}),$e={"& .MuiInputBase-input":{fontSize:14,padding:"8px 12px"},"& .MuiInputLabel-root":{fontSize:14,transform:"translate(14px, 9px) scale(1)","&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}},"& .MuiOutlinedInput-root":{minHeight:"40px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:12},"& .MuiInputLabel-asterisk":{display:"none"}},Ar="YYYY-MM-DD",Pr="YYYY-MM-DD HH:mm",hl=U.styled("ul")(({theme:e})=>({padding:e.spacing(.5),margin:0,listStyle:"none",maxHeight:260,overflow:"auto","& .MuiAutocomplete-option":{minHeight:36,padding:e.spacing(.75,1.5),display:"flex",alignItems:"center",gap:e.spacing(1),fontSize:14,borderRadius:e.shape.borderRadius,cursor:"pointer",transition:e.transitions.create(["background-color"],{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:e.palette.action.hover},'&[aria-selected="true"]':{backgroundColor:e.palette.action.selected},'&[aria-disabled="true"]':{opacity:.5,cursor:"not-allowed"}},"& .MuiAutocomplete-listboxStatus":{cursor:"default",pointerEvents:"none"}})),gl=W.forwardRef((e,t)=>{const{children:r,fetchingMore:n,hasMore:o=!0,showNoMore:i,empty:a,error:l,...u}=e;return v.jsxs(hl,{...u,ref:t,children:[r,a&&!n&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:2,justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"body2",color:"text.secondary",children:"暂无数据"})}),l&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:2,color:"error.main",justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"body2",children:"加载失败,请重试"})}),n&&v.jsxs(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:1.5,gap:1,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"text.secondary",cursor:"default"},children:[v.jsx(U.CircularProgress,{size:16,color:"inherit"}),v.jsx(U.Typography,{variant:"body2",children:"加载中…"})]}),!o&&i&&!n&&!a&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:1.5,justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"caption",color:"text.disabled",children:"没有更多数据了"})})]})}),lt=({field:e,label:t,error:r,helperText:n,options:o=[],fieldProps:i,form:a,schema:l})=>{const{onChange:u,multiple:f=!1,loading:m,...y}=i??{},p=l?.ui?.remoteConfig,b=W.useRef(p);b.current=p;const[h,d]=W.useState([]),[g,x]=W.useState(!1),[A,R]=W.useState(!1),[O,C]=W.useState(""),[E,z]=W.useState(!1),[Z,G]=W.useState(1),[Y,N]=W.useState(!0),c=W.useRef(null),w=W.useRef(!1),T=p?h:o,D=p?.pageSize??20,M=W.useRef([]);W.useEffect(()=>{if(!p)return;const I=Array.isArray(e.value)?e.value:e.value?[e.value]:[];if(I.length===0)return;const B=h.filter(q=>I.includes(q.value)),V=[...M.current];let F=!1;B.forEach(q=>{V.some(Q=>Q.value==q.value)||(V.push(q),F=!0)}),F&&(M.current=V)},[e.value,h,p]),W.useEffect(()=>{const I=b.current;if(!I?.fetchById||!e.value)return;const V=(Array.isArray(e.value)?e.value:[e.value]).filter(F=>!h.some(q=>q.value==F));V.length!==0&&Promise.all(V.map(async F=>{try{return await I.fetchById(F)}catch{return null}})).then(F=>{const q=F.filter(Q=>Q!==null);q.length>0&&(d(Q=>{const J=[...Q];return q.forEach(ue=>{J.some(_=>_.value==ue.value)||J.push(ue)}),J}),q.forEach(Q=>{M.current.some(J=>J.value==Q.value)||M.current.push(Q)}))})},[e.value,h]);const X=W.useCallback(async(I,B,V=!1)=>{if(p){V||(G(1),N(!0)),V?R(!0):x(!0),p.onLoadingChange?.(!0);try{const F=await p.fetchOptions(I,B,D);if(V)d(q=>{const Q=F.data.filter(J=>!q.some(ue=>ue.value===J.value));return[...q,...Q]});else{const q=[...F.data],Q=Array.isArray(e.value)?e.value:e.value?[e.value]:[];M.current.filter(ue=>Q.includes(ue.value)).forEach(ue=>{q.some(_=>_.value==ue.value)||q.push(ue)}),d(q)}N(F.hasMore)}catch{}finally{V?R(!1):x(!1),p.onLoadingChange?.(!1)}}},[p,D,e.value]),re=W.useRef(null),ce=()=>{c.current=e.value,w.current=!1,z(!0),C(""),p&&X("",1,!1)},$=()=>{if(z(!1),!w.current&&!f){const I=e.value;if(I!=null){const B=T.find(V=>V.value===I);B&&C(B.label)}}},k=(I,B,V)=>{V!=="reset"&&(C(B),p&&(re.current&&clearTimeout(re.current),(V==="input"||V==="clear")&&(re.current=setTimeout(()=>{X(B,1,!1)},p.debounceTimeout??500))))};W.useEffect(()=>()=>{re.current&&clearTimeout(re.current)},[]);const H=I=>{const B=I.currentTarget;if(!g&&!A&&Y&&B.scrollTop+B.clientHeight>=B.scrollHeight-20){const V=Z+1;G(V),X(O,V,!0)}},K=()=>f?T.filter(I=>(e.value??[]).includes(I.value)):T.find(I=>I.value===e.value)??null;return v.jsx(U.FormControl,{fullWidth:!0,error:r,required:y?.required,disabled:y?.disabled,size:"small",sx:$e,children:v.jsx(U.Autocomplete,{multiple:f,disableCloseOnSelect:f,open:E,onOpen:ce,onClose:$,inputValue:p?O:void 0,onInputChange:p?k:void 0,options:T,loading:g||m,filterOptions:p?I=>I:void 0,value:K(),onChange:(I,B)=>{w.current=!0;const V=f?B.map(F=>F.value):B?.value??null;e.onChange(V),!f&&B&&C(B.label),typeof u=="function"&&u(I,B),a?.trigger(e.name)},slots:{listbox:p?gl:void 0},slotProps:{listbox:{onScroll:p?H:void 0,style:{maxHeight:260},...p?{fetchingMore:A,hasMore:Y,showNoMore:h.length>0,empty:h.length===0&&!g&&!A,error:!1}:{}},chip:{size:"small",variant:"outlined",sx:{height:22,fontSize:12,borderRadius:1,backgroundColor:"background.paper","& .MuiChip-label":{px:.75},"& .MuiChip-deleteIcon":{fontSize:16,marginRight:.25}}}},getOptionLabel:I=>I?.label??"",getOptionKey:I=>{const B=I?.key??I?.value;return typeof B=="string"||typeof B=="number"?B:String(B)},isOptionEqualToValue:(I,B)=>I?.value===B?.value,size:"small",disabled:y?.disabled,renderOption:(I,B)=>W.createElement("li",{...I,key:B.key??B.value},B.listLabel??B.label),renderInput:I=>v.jsx(U.TextField,{...I,error:r,fullWidth:!0,helperText:n,label:t,onBlur:()=>{e.onBlur?.(),a?.trigger(e.name)},required:y?.required,size:"small",sx:$e,slotProps:{input:{...I.InputProps,endAdornment:v.jsxs(v.Fragment,{children:[g||m?v.jsx(U.CircularProgress,{color:"inherit",size:20}):null,I.InputProps.endAdornment]})}}})})})},Te=(e,t)=>t?v.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[v.jsx("span",{style:{color:"#d32f2f",marginRight:"4px",fontSize:"20px",fontWeight:"bold",lineHeight:"1",paddingTop:"4px"},children:"*"}),e]}):e,Ir=({field:e,label:t,error:r,helperText:n,fieldProps:o})=>v.jsxs(U.FormControl,{error:r,required:o?.required,component:"fieldset",children:[v.jsx(U.FormControlLabel,{control:v.jsx(U.Checkbox,{checked:e.value??!1,disabled:o?.disabled,onChange:i=>e.onChange(i.target.checked),inputRef:e.ref}),label:Te(t,o?.required)}),n&&v.jsx(U.FormHelperText,{children:n})]}),Mr=({field:e,label:t,error:r,helperText:n,fieldProps:o,form:i,values:a})=>{const{children:l,component:u,...f}=o??{};return l!==void 0?typeof l=="function"?l({field:e,label:t,error:r,helperText:n,form:i,values:a,fieldProps:f}):v.jsx(v.Fragment,{children:l}):u?v.jsx(u,{field:e,label:t,error:r,helperText:n,form:i,values:a,...f}):v.jsx(U.TextField,{...e,label:Te(t,f?.required),error:r,helperText:n,fullWidth:!0,size:"small",sx:$e,...f})},_r=({field:e,label:t,error:r,helperText:n,fieldProps:o})=>v.jsx(or.LocalizationProvider,{adapterLocale:"zh-cn",dateAdapter:ir.AdapterDayjs,children:v.jsx(ri.DateTimePicker,{value:e.value?an(e.value):null,onChange:i=>e.onChange(i?.isValid()?i.format(Pr):""),format:Pr,disabled:o?.disabled,slotProps:{textField:{fullWidth:!0,label:Te(t,o?.required),error:r,helperText:n,required:o?.required,size:"small",sx:$e}},...o})}),Nr=({field:e,label:t,error:r,helperText:n,fieldProps:o,form:i})=>v.jsx(or.LocalizationProvider,{adapterLocale:"zh-cn",dateAdapter:ir.AdapterDayjs,children:v.jsx(ni.DatePicker,{value:e.value?an(e.value):null,onChange:a=>e.onChange(a?.isValid()?a.format(Ar):""),onClose:()=>i?.trigger(e.name),format:Ar,disabled:o?.disabled,slotProps:{textField:{fullWidth:!0,label:Te(t,o?.required),error:r,helperText:n,required:o?.required,size:"small",sx:$e,onBlur:()=>i?.trigger(e.name)}},...o})});function yl(){return Vt}const ke=va;function bl(e){return ve("MuiSvgIcon",e)}Me("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const vl=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${te(t)}`,`fontSize${te(r)}`]};return Pe(o,bl,n)},Sl=ge("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${te(r.color)}`],t[`fontSize${te(r.fontSize)}`]]}})(ke(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Kt=j.forwardRef(function(t,r){const n=Oe({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:l="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:m=!1,titleAccess:y,viewBox:p="0 0 24 24",...b}=n,h=j.isValidElement(o)&&o.type==="svg",d={...n,color:a,component:l,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:m,viewBox:p,hasSvgAsChild:h},g={};m||(g.viewBox=p);const x=vl(d);return v.jsxs(Sl,{as:l,className:fe(x.root,i),focusable:"false",color:f,"aria-hidden":y?void 0:!0,role:y?"img":void 0,ref:r,...g,...b,...h&&o.props,ownerState:d,children:[h?o.props.children:o,y?v.jsx("title",{children:y}):null]})});process.env.NODE_ENV!=="production"&&(Kt.propTypes={children:s.node,classes:s.object,className:s.string,color:s.oneOfType([s.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),s.string]),component:s.elementType,fontSize:s.oneOfType([s.oneOf(["inherit","large","medium","small"]),s.string]),htmlColor:s.string,inheritViewBox:s.bool,shapeRendering:s.string,sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),titleAccess:s.string,viewBox:s.string}),Kt.muiName="SvgIcon";function Rr(e,t){function r(n,o){return v.jsx(Kt,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:o,...n,children:e})}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=Kt.muiName,j.memo(j.forwardRef(r))}function Xt(e){const t=j.useRef(e);return ua(()=>{t.current=e}),j.useRef((...r)=>(0,t.current)(...r)).current}function Mo(...e){const t=j.useRef(void 0),r=j.useCallback(n=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,l=a(n);return typeof l=="function"?l:()=>{a(null)}}return i.current=n,()=>{i.current=null}});return()=>{o.forEach(i=>i?.())}},e);return j.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}const Cl=Rr(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Tl=Rr(v.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),xl=Rr(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),wl=Me("MuiBox",["root"]),El=wo(),Qt=ca({themeId:Sr,defaultTheme:El,defaultClassName:wl.root,generateClassName:Pn.generate});process.env.NODE_ENV!=="production"&&(Qt.propTypes={children:s.node,component:s.elementType,sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object])});const Ol=s.oneOfType([s.func,s.object]);function Jt(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...n){return e(...n)||t(...n)}}function $l(e){const{prototype:t={}}=e;return!!t.isReactComponent}function kl(e,t,r,n,o){const i=e[t],a=o||t;if(i==null||typeof window>"u")return null;let l;return typeof i=="function"&&!$l(i)&&(l="Did you accidentally provide a plain function component instead?"),l!==void 0?new Error(`Invalid ${n} \`${a}\` supplied to \`${r}\`. Expected an element type that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const Al=Jt(s.elementType,kl);function _o(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&window.navigator.userAgent.includes("jsdom")}return!1}const No={};function Ro(e,t){const r=j.useRef(No);return r.current===No&&(r.current=e(t)),r}class Zt{static create(){return new Zt}static use(){const t=Ro(Zt.create).current,[r,n]=j.useState(!1);return t.shouldMount=r,t.setShouldMount=n,j.useEffect(t.mountEffect,[r]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Il(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Pl(){return Zt.use()}function Il(){let e,t;const r=new Promise((n,o)=>{e=n,t=o});return r.resolve=e,r.reject=t,r}function Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dr.apply(null,arguments)}function Ml(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Br(e,t){return Br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Br(e,t)}function _l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Br(e,t)}const Do=W.createContext(null);function Nl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jr(e,t){var r=function(i){return t&&W.isValidElement(i)?t(i):i},n=Object.create(null);return e&&W.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Rl(e,t){e=e||{},t=t||{};function r(m){return m in t?t[m]:e[m]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var u in t){if(n[u])for(a=0;a<n[u].length;a++){var f=n[u][a];l[n[u][a]]=r(f)}l[u]=r(u)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Qe(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Dl(e,t){return jr(e.children,function(r){return W.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Qe(r,"appear",e),enter:Qe(r,"enter",e),exit:Qe(r,"exit",e)})})}function Bl(e,t,r){var n=jr(e.children),o=Rl(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(W.isValidElement(a)){var l=i in t,u=i in n,f=t[i],m=W.isValidElement(f)&&!f.props.in;u&&(!l||m)?o[i]=W.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Qe(a,"exit",e),enter:Qe(a,"enter",e)}):!u&&l&&!m?o[i]=W.cloneElement(a,{in:!1}):u&&l&&W.isValidElement(f)&&(o[i]=W.cloneElement(a,{onExited:r.bind(null,a),in:f.props.in,exit:Qe(a,"exit",e),enter:Qe(a,"enter",e)}))}}),o}var jl=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Vl={component:"div",childFactory:function(t){return t}},Vr=(function(e){_l(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(Nl(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,l=i.handleExited,u=i.firstRender;return{children:u?Dl(o,l):Bl(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=jr(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var u=Dr({},l.children);return delete u[o.key],{children:u}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=Ml(o,["component","childFactory"]),u=this.state.contextValue,f=jl(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?W.createElement(Do.Provider,{value:u},f):W.createElement(Do.Provider,{value:u},W.createElement(i,l,f))},t})(W.Component);Vr.propTypes=process.env.NODE_ENV!=="production"?{component:s.any,children:s.node,appear:s.bool,enter:s.bool,exit:s.bool,childFactory:s.func}:{},Vr.defaultProps=Vl;const zl=[];function Wl(e){j.useEffect(e,zl)}class zr{static create(){return new zr}currentId=null;start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,r()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Ll(){const e=Ro(zr.create).current;return Wl(e.disposeEffect),e}function Bo(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:a,in:l,onExited:u,timeout:f}=e,[m,y]=j.useState(!1),p=fe(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),b={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=fe(r.child,m&&r.childLeaving,n&&r.childPulsate);return!l&&!m&&y(!0),j.useEffect(()=>{if(!l&&u!=null){const d=setTimeout(u,f);return()=>{clearTimeout(d)}}},[u,l,f]),v.jsx("span",{className:p,style:b,children:v.jsx("span",{className:h})})}process.env.NODE_ENV!=="production"&&(Bo.propTypes={classes:s.object.isRequired,className:s.string,in:s.bool,onExited:s.func,pulsate:s.bool,rippleSize:s.number,rippleX:s.number,rippleY:s.number,timeout:s.number.isRequired});const xe=Me("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Wr=550,Fl=80,ql=Be.keyframes`
|
|
27
|
+
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function ll(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const _e=e=>{try{return e()}catch{}},cl=(e="mui")=>Sa(e);function kr(e,t,r,n,o){if(!r)return;r=r===!0?{}:r;const i=o==="dark"?"dark":"light";if(!n){t[o]=nl({...r,palette:{mode:i,...r?.palette},colorSpace:e});return}const{palette:a,...l}=Or({...n,palette:{mode:i,...r?.palette},colorSpace:e});return t[o]={...r,palette:a,opacity:{...Co(i),...r?.opacity},overlays:r?.overlays||To(i)},l}function ul(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:a=!1,shouldSkipGeneratingVar:l=ol,colorSchemeSelector:u=r.light&&r.dark?"media":void 0,rootSelector:f=":root",...m}=e,y=Object.keys(r)[0],p=n||(r.light&&y!=="light"?"light":y),b=cl(i),{[p]:h,light:d,dark:g,...x}=r,A={...x};let R=h;if((p==="dark"&&!("dark"in r)||p==="light"&&!("light"in r))&&(R=!0),!R)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${p}\` option is either missing or invalid.`:Ve(21,p));let O;a&&(O="oklch");const C=kr(O,A,R,m,p);d&&!A.light&&kr(O,A,d,void 0,"light"),g&&!A.dark&&kr(O,A,g,void 0,"dark");let E={defaultColorScheme:p,...C,cssVarPrefix:i,colorSchemeSelector:u,rootSelector:f,getCssVar:b,colorSchemes:A,font:{...za(C.typography),...C.font},spacing:ll(m.spacing)};Object.keys(E.colorSchemes).forEach(N=>{const c=E.colorSchemes[N].palette,w=D=>{const M=D.split("-"),X=M[1],re=M[2];return b(D,c[X][re])};c.mode==="light"&&(S(c.common,"background","#fff"),S(c.common,"onBackground","#000")),c.mode==="dark"&&(S(c.common,"background","#000"),S(c.common,"onBackground","#fff"));function T(D,M,X){if(O){let re;return D===Ke&&(re=`transparent ${((1-X)*100).toFixed(0)}%`),D===ie&&(re=`#000 ${(X*100).toFixed(0)}%`),D===se&&(re=`#fff ${(X*100).toFixed(0)}%`),`color-mix(in ${O}, ${M}, ${re})`}return D(M,X)}if(al(c,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),c.mode==="light"){S(c.Alert,"errorColor",T(ie,c.error.light,.6)),S(c.Alert,"infoColor",T(ie,c.info.light,.6)),S(c.Alert,"successColor",T(ie,c.success.light,.6)),S(c.Alert,"warningColor",T(ie,c.warning.light,.6)),S(c.Alert,"errorFilledBg",w("palette-error-main")),S(c.Alert,"infoFilledBg",w("palette-info-main")),S(c.Alert,"successFilledBg",w("palette-success-main")),S(c.Alert,"warningFilledBg",w("palette-warning-main")),S(c.Alert,"errorFilledColor",_e(()=>c.getContrastText(c.error.main))),S(c.Alert,"infoFilledColor",_e(()=>c.getContrastText(c.info.main))),S(c.Alert,"successFilledColor",_e(()=>c.getContrastText(c.success.main))),S(c.Alert,"warningFilledColor",_e(()=>c.getContrastText(c.warning.main))),S(c.Alert,"errorStandardBg",T(se,c.error.light,.9)),S(c.Alert,"infoStandardBg",T(se,c.info.light,.9)),S(c.Alert,"successStandardBg",T(se,c.success.light,.9)),S(c.Alert,"warningStandardBg",T(se,c.warning.light,.9)),S(c.Alert,"errorIconColor",w("palette-error-main")),S(c.Alert,"infoIconColor",w("palette-info-main")),S(c.Alert,"successIconColor",w("palette-success-main")),S(c.Alert,"warningIconColor",w("palette-warning-main")),S(c.AppBar,"defaultBg",w("palette-grey-100")),S(c.Avatar,"defaultBg",w("palette-grey-400")),S(c.Button,"inheritContainedBg",w("palette-grey-300")),S(c.Button,"inheritContainedHoverBg",w("palette-grey-A100")),S(c.Chip,"defaultBorder",w("palette-grey-400")),S(c.Chip,"defaultAvatarColor",w("palette-grey-700")),S(c.Chip,"defaultIconColor",w("palette-grey-700")),S(c.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),S(c.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),S(c.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),S(c.LinearProgress,"primaryBg",T(se,c.primary.main,.62)),S(c.LinearProgress,"secondaryBg",T(se,c.secondary.main,.62)),S(c.LinearProgress,"errorBg",T(se,c.error.main,.62)),S(c.LinearProgress,"infoBg",T(se,c.info.main,.62)),S(c.LinearProgress,"successBg",T(se,c.success.main,.62)),S(c.LinearProgress,"warningBg",T(se,c.warning.main,.62)),S(c.Skeleton,"bg",O?T(Ke,c.text.primary,.11):`rgba(${w("palette-text-primaryChannel")} / 0.11)`),S(c.Slider,"primaryTrack",T(se,c.primary.main,.62)),S(c.Slider,"secondaryTrack",T(se,c.secondary.main,.62)),S(c.Slider,"errorTrack",T(se,c.error.main,.62)),S(c.Slider,"infoTrack",T(se,c.info.main,.62)),S(c.Slider,"successTrack",T(se,c.success.main,.62)),S(c.Slider,"warningTrack",T(se,c.warning.main,.62));const D=O?T(ie,c.background.default,.6825):Ht(c.background.default,.8);S(c.SnackbarContent,"bg",D),S(c.SnackbarContent,"color",_e(()=>O?wr.text.primary:c.getContrastText(D))),S(c.SpeedDialAction,"fabHoverBg",Ht(c.background.paper,.15)),S(c.StepConnector,"border",w("palette-grey-400")),S(c.StepContent,"border",w("palette-grey-400")),S(c.Switch,"defaultColor",w("palette-common-white")),S(c.Switch,"defaultDisabledColor",w("palette-grey-100")),S(c.Switch,"primaryDisabledColor",T(se,c.primary.main,.62)),S(c.Switch,"secondaryDisabledColor",T(se,c.secondary.main,.62)),S(c.Switch,"errorDisabledColor",T(se,c.error.main,.62)),S(c.Switch,"infoDisabledColor",T(se,c.info.main,.62)),S(c.Switch,"successDisabledColor",T(se,c.success.main,.62)),S(c.Switch,"warningDisabledColor",T(se,c.warning.main,.62)),S(c.TableCell,"border",T(se,T(Ke,c.divider,1),.88)),S(c.Tooltip,"bg",T(Ke,c.grey[700],.92))}if(c.mode==="dark"){S(c.Alert,"errorColor",T(se,c.error.light,.6)),S(c.Alert,"infoColor",T(se,c.info.light,.6)),S(c.Alert,"successColor",T(se,c.success.light,.6)),S(c.Alert,"warningColor",T(se,c.warning.light,.6)),S(c.Alert,"errorFilledBg",w("palette-error-dark")),S(c.Alert,"infoFilledBg",w("palette-info-dark")),S(c.Alert,"successFilledBg",w("palette-success-dark")),S(c.Alert,"warningFilledBg",w("palette-warning-dark")),S(c.Alert,"errorFilledColor",_e(()=>c.getContrastText(c.error.dark))),S(c.Alert,"infoFilledColor",_e(()=>c.getContrastText(c.info.dark))),S(c.Alert,"successFilledColor",_e(()=>c.getContrastText(c.success.dark))),S(c.Alert,"warningFilledColor",_e(()=>c.getContrastText(c.warning.dark))),S(c.Alert,"errorStandardBg",T(ie,c.error.light,.9)),S(c.Alert,"infoStandardBg",T(ie,c.info.light,.9)),S(c.Alert,"successStandardBg",T(ie,c.success.light,.9)),S(c.Alert,"warningStandardBg",T(ie,c.warning.light,.9)),S(c.Alert,"errorIconColor",w("palette-error-main")),S(c.Alert,"infoIconColor",w("palette-info-main")),S(c.Alert,"successIconColor",w("palette-success-main")),S(c.Alert,"warningIconColor",w("palette-warning-main")),S(c.AppBar,"defaultBg",w("palette-grey-900")),S(c.AppBar,"darkBg",w("palette-background-paper")),S(c.AppBar,"darkColor",w("palette-text-primary")),S(c.Avatar,"defaultBg",w("palette-grey-600")),S(c.Button,"inheritContainedBg",w("palette-grey-800")),S(c.Button,"inheritContainedHoverBg",w("palette-grey-700")),S(c.Chip,"defaultBorder",w("palette-grey-700")),S(c.Chip,"defaultAvatarColor",w("palette-grey-300")),S(c.Chip,"defaultIconColor",w("palette-grey-300")),S(c.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),S(c.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),S(c.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),S(c.LinearProgress,"primaryBg",T(ie,c.primary.main,.5)),S(c.LinearProgress,"secondaryBg",T(ie,c.secondary.main,.5)),S(c.LinearProgress,"errorBg",T(ie,c.error.main,.5)),S(c.LinearProgress,"infoBg",T(ie,c.info.main,.5)),S(c.LinearProgress,"successBg",T(ie,c.success.main,.5)),S(c.LinearProgress,"warningBg",T(ie,c.warning.main,.5)),S(c.Skeleton,"bg",O?T(Ke,c.text.primary,.13):`rgba(${w("palette-text-primaryChannel")} / 0.13)`),S(c.Slider,"primaryTrack",T(ie,c.primary.main,.5)),S(c.Slider,"secondaryTrack",T(ie,c.secondary.main,.5)),S(c.Slider,"errorTrack",T(ie,c.error.main,.5)),S(c.Slider,"infoTrack",T(ie,c.info.main,.5)),S(c.Slider,"successTrack",T(ie,c.success.main,.5)),S(c.Slider,"warningTrack",T(ie,c.warning.main,.5));const D=O?T(se,c.background.default,.985):Ht(c.background.default,.98);S(c.SnackbarContent,"bg",D),S(c.SnackbarContent,"color",_e(()=>O?fo.text.primary:c.getContrastText(D))),S(c.SpeedDialAction,"fabHoverBg",Ht(c.background.paper,.15)),S(c.StepConnector,"border",w("palette-grey-600")),S(c.StepContent,"border",w("palette-grey-600")),S(c.Switch,"defaultColor",w("palette-grey-300")),S(c.Switch,"defaultDisabledColor",w("palette-grey-600")),S(c.Switch,"primaryDisabledColor",T(ie,c.primary.main,.55)),S(c.Switch,"secondaryDisabledColor",T(ie,c.secondary.main,.55)),S(c.Switch,"errorDisabledColor",T(ie,c.error.main,.55)),S(c.Switch,"infoDisabledColor",T(ie,c.info.main,.55)),S(c.Switch,"successDisabledColor",T(ie,c.success.main,.55)),S(c.Switch,"warningDisabledColor",T(ie,c.warning.main,.55)),S(c.TableCell,"border",T(ie,T(Ke,c.divider,1),.68)),S(c.Tooltip,"bg",T(Ke,c.grey[700],.92))}Re(c.background,"default"),Re(c.background,"paper"),Re(c.common,"background"),Re(c.common,"onBackground"),Re(c,"divider"),Object.keys(c).forEach(D=>{const M=c[D];D!=="tonalOffset"&&M&&typeof M=="object"&&(M.main&&S(c[D],"mainChannel",gt(vt(M.main))),M.light&&S(c[D],"lightChannel",gt(vt(M.light))),M.dark&&S(c[D],"darkChannel",gt(vt(M.dark))),M.contrastText&&S(c[D],"contrastTextChannel",gt(vt(M.contrastText))),D==="text"&&(Re(c[D],"primary"),Re(c[D],"secondary")),D==="action"&&(M.active&&Re(c[D],"active"),M.selected&&Re(c[D],"selected")))})}),E=t.reduce((N,c)=>ye(N,c),E);const z={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:sl(E),enableContrastVars:a},{vars:Z,generateThemeVars:G,generateStyleSheets:Y}=xa(E,z);return E.vars=Z,Object.entries(E.colorSchemes[E.defaultColorScheme]).forEach(([N,c])=>{E[N]=c}),E.generateThemeVars=G,E.generateStyleSheets=Y,E.generateSpacing=function(){return Hn(m.spacing,_t(this))},E.getColorSchemeSelector=wa(u),E.spacing=E.generateSpacing(),E.shouldSkipGeneratingVar=l,E.unstable_sxConfig={...pt,...m?.unstable_sxConfig},E.unstable_sx=function(c){return Ye({sx:c,theme:this})},E.toRuntimeSource=vo,E}function xo(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Er({...r===!0?{}:r.palette,mode:t})})}function wo(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:o=r?void 0:{light:!0},defaultColorScheme:i=r?.mode,...a}=e,l=i||"light",u=o?.[l],f={...o,...r?{[l]:{...typeof u!="boolean"&&u,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Or(e,...t);let m=r;"palette"in e||f[l]&&(f[l]!==!0?m=f[l].palette:l==="dark"&&(m={mode:"dark"}));const y=Or({...e,palette:m},...t);return y.defaultColorScheme=l,y.colorSchemes=f,y.palette.mode==="light"&&(y.colorSchemes.light={...f.light!==!0&&f.light,palette:y.palette},xo(y,"dark",f.dark)),y.palette.mode==="dark"&&(y.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:y.palette},xo(y,"light",f.light)),y}return!r&&!("light"in f)&&l==="light"&&(f.light=!0),ul({...a,colorSchemes:f,defaultColorScheme:l,...typeof n!="boolean"&&n},...t)}const Eo=wo();function Oo(){const e=Wt(Eo);return process.env.NODE_ENV!=="production"&&j.useDebugValue(e),e[Sr]||e}function dl(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const $o=e=>dl(e)&&e!=="classes",ge=Qn({themeId:Sr,defaultTheme:Eo,rootShouldForwardProp:$o});process.env.NODE_ENV!=="production"&&(s.node,s.object.isRequired);function Oe(e){return ya(e)}const Xe=aa({createStyledComponent:ge("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>Oe({props:e,name:"MuiGrid"}),useTheme:Oo});if(process.env.NODE_ENV!=="production"&&(Xe.propTypes={children:s.node,columns:s.oneOfType([s.arrayOf(s.number),s.number,s.object]),columnSpacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),container:s.bool,direction:s.oneOfType([s.oneOf(["column-reverse","column","row-reverse","row"]),s.arrayOf(s.oneOf(["column-reverse","column","row-reverse","row"])),s.object]),offset:s.oneOfType([s.string,s.number,s.arrayOf(s.oneOfType([s.string,s.number])),s.object]),rowSpacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),size:s.oneOfType([s.string,s.bool,s.number,s.arrayOf(s.oneOfType([s.string,s.bool,s.number])),s.object]),spacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),unstable_level:s.number,wrap:s.oneOf(["nowrap","wrap-reverse","wrap"])}),process.env.NODE_ENV!=="production"){const e=Xe,t=la("Grid",e);e.propTypes={...e.propTypes,direction:t("container"),spacing:t("container"),wrap:t("container")}}function fl(e){return e==null?{xs:12}:typeof e=="object"?e:{xs:e}}function pl(e){const t=new Set,r=n=>{const o=i=>{if(i){if(typeof i=="function"){t.add("*");return}"field"in i&&t.add(i.field),"and"in i&&Array.isArray(i.and)&&i.and.forEach(o),"or"in i&&Array.isArray(i.or)&&i.or.forEach(o),"not"in i&&o(i.not)}};o(n.visibleWhen),o(n.disabledWhen),o(n.requiredWhen),n.dependencies&&n.dependencies.forEach(i=>t.add(i))};if(r(e),e.component==="Group"&&e.columns){const n=o=>{o.forEach(i=>{r(i),i.component==="Group"&&i.columns&&n(i.columns)})};n(e.columns)}return Array.from(t)}function ml({field:e,index:t,values:r,form:n,disabled:o=!1,readOnly:i=!1,widgets:a,optionsMap:l,useGrid:u=!0}){const f=ut(e,r,o,i);if(!f.visible)return null;const m=a[e.component]??a.Text,y=l[e.name]??e.ui?.options??[],b=e.component==="Group"||e.component==="FormList"?v.jsx(m,{field:{name:e.name,value:void 0,onChange:()=>{},onBlur:()=>{},ref:()=>{}},form:n,globalDisabled:o,globalReadOnly:i,label:e.ui?.label,optionsMap:l,schema:e,widgets:a,values:r}):v.jsx(Fe.Controller,{control:n.control,name:e.name,render:({field:h,fieldState:d})=>v.jsx(m,{error:!!d.error,field:h,fieldProps:{...e.ui?.props,...e.fieldProps,disabled:f.disabled,required:f.required,readOnly:f.readonly,placeholder:e.ui?.placeholder},form:n,helperText:d.error?.message??e.ui?.helperText,label:e.ui?.label,options:y,values:r,schema:e})});if(u){const h=fl(e.colSpan);return v.jsx(Xe,{size:h,children:b},`${String(e.name)}-${t}`)}return b}const ko=W.memo(ml,(e,t)=>{if(e.field!==t.field||e.index!==t.index||e.disabled!==t.disabled||e.readOnly!==t.readOnly||e.useGrid!==t.useGrid||e.widgets!==t.widgets||e.form!==t.form)return!1;const r=e.optionsMap[e.field.name],n=t.optionsMap[t.field.name];if(r!==n)return!1;const o=pl(t.field);if(o.includes("*"))return!1;for(const i of o)if(e.values[i]!==t.values[i])return!1;return!0}),Ao=({spacing:e=2,children:t})=>v.jsx(Xe,{container:!0,spacing:e,children:t}),Po=Ia({createStyledComponent:ge("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>Oe({props:e,name:"MuiStack"})});process.env.NODE_ENV!=="production"&&(Po.propTypes={children:s.node,component:s.elementType,direction:s.oneOfType([s.oneOf(["column-reverse","column","row-reverse","row"]),s.arrayOf(s.oneOf(["column-reverse","column","row-reverse","row"])),s.object]),divider:s.node,spacing:s.oneOfType([s.arrayOf(s.oneOfType([s.number,s.string])),s.number,s.object,s.string]),sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),useFlexGap:s.bool});const Io=({spacing:e=2,children:t})=>v.jsx(Po,{spacing:e,children:t}),$e={"& .MuiInputBase-input":{fontSize:14,padding:"8px 12px"},"& .MuiInputLabel-root":{fontSize:14,transform:"translate(14px, 9px) scale(1)","&.MuiInputLabel-shrink":{transform:"translate(14px, -9px) scale(0.75)"}},"& .MuiOutlinedInput-root":{minHeight:"40px"},"& .MuiFormHelperText-root":{marginTop:"4px",fontSize:12},"& .MuiInputLabel-asterisk":{display:"none"}},Ar="YYYY-MM-DD",Pr="YYYY-MM-DD HH:mm",hl=U.styled("ul")(({theme:e})=>({padding:e.spacing(.5),margin:0,listStyle:"none",maxHeight:260,overflow:"auto","& .MuiAutocomplete-option":{minHeight:36,padding:e.spacing(.75,1.5),display:"flex",alignItems:"center",gap:e.spacing(1),fontSize:14,borderRadius:e.shape.borderRadius,cursor:"pointer",transition:e.transitions.create(["background-color"],{duration:e.transitions.duration.shortest}),"&:hover":{backgroundColor:e.palette.action.hover},'&[aria-selected="true"]':{backgroundColor:e.palette.action.selected},'&[aria-disabled="true"]':{opacity:.5,cursor:"not-allowed"}},"& .MuiAutocomplete-listboxStatus":{cursor:"default",pointerEvents:"none"}})),gl=W.forwardRef((e,t)=>{const{children:r,fetchingMore:n,hasMore:o=!0,showNoMore:i,empty:a,error:l,...u}=e;return v.jsxs(hl,{...u,ref:t,children:[r,a&&!n&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:2,justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"body2",color:"text.secondary",children:"暂无数据"})}),l&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:2,color:"error.main",justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"body2",children:"加载失败,请重试"})}),n&&v.jsxs(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:1.5,gap:1,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",color:"text.secondary",cursor:"default"},children:[v.jsx(U.CircularProgress,{size:16,color:"inherit"}),v.jsx(U.Typography,{variant:"body2",children:"加载中…"})]}),!o&&i&&!n&&!a&&v.jsx(U.Box,{component:"li",className:"MuiAutocomplete-option MuiAutocomplete-listboxStatus",sx:{py:1.5,justifyContent:"center",pointerEvents:"none",cursor:"default"},children:v.jsx(U.Typography,{variant:"caption",color:"text.disabled",children:"没有更多数据了"})})]})}),lt=({field:e,label:t,error:r,helperText:n,options:o=[],fieldProps:i,form:a,schema:l})=>{const{onChange:u,multiple:f=!1,loading:m,...y}=i??{},p=l?.ui?.remoteConfig,b=W.useRef(p);b.current=p;const[h,d]=W.useState([]),[g,x]=W.useState(!1),[A,R]=W.useState(!1),[O,C]=W.useState(""),[E,z]=W.useState(!1),[Z,G]=W.useState(1),[Y,N]=W.useState(!0),c=W.useRef(null),w=W.useRef(!1),T=p?h:o,D=p?.pageSize??20,M=W.useRef([]);W.useEffect(()=>{if(!p)return;const I=Array.isArray(e.value)?e.value:e.value?[e.value]:[];if(I.length===0)return;const B=h.filter(q=>I.includes(q.value)),V=[...M.current];let F=!1;B.forEach(q=>{V.some(Q=>Q.value==q.value)||(V.push(q),F=!0)}),F&&(M.current=V)},[e.value,h,p]),W.useEffect(()=>{const I=b.current;if(!I?.fetchById||!e.value)return;const V=(Array.isArray(e.value)?e.value:[e.value]).filter(F=>!h.some(q=>q.value==F));V.length!==0&&Promise.all(V.map(async F=>{try{return await I.fetchById(F)}catch{return null}})).then(F=>{const q=F.filter(Q=>Q!==null);q.length>0&&(d(Q=>{const J=[...Q];return q.forEach(ue=>{J.some(_=>_.value==ue.value)||J.push(ue)}),J}),q.forEach(Q=>{M.current.some(J=>J.value==Q.value)||M.current.push(Q)}))})},[e.value,h]);const X=W.useCallback(async(I,B,V=!1)=>{if(p){V||(G(1),N(!0)),V?R(!0):x(!0),p.onLoadingChange?.(!0);try{const F=await p.fetchOptions(I,B,D);if(V)d(q=>{const Q=F.data.filter(J=>!q.some(ue=>ue.value===J.value));return[...q,...Q]});else{const q=[...F.data],Q=Array.isArray(e.value)?e.value:e.value?[e.value]:[];M.current.filter(ue=>Q.includes(ue.value)).forEach(ue=>{q.some(_=>_.value==ue.value)||q.push(ue)}),d(q)}N(F.hasMore)}catch{}finally{V?R(!1):x(!1),p.onLoadingChange?.(!1)}}},[p,D,e.value]),re=W.useRef(null),ce=()=>{c.current=e.value,w.current=!1,z(!0),C(""),p&&X("",1,!1)},$=()=>{if(z(!1),!w.current&&!f){const I=e.value;if(I!=null){const B=T.find(V=>V.value===I);B&&C(B.label)}}},k=(I,B,V)=>{V!=="reset"&&(C(B),p&&(re.current&&clearTimeout(re.current),(V==="input"||V==="clear")&&(re.current=setTimeout(()=>{X(B,1,!1)},p.debounceTimeout??500))))};W.useEffect(()=>()=>{re.current&&clearTimeout(re.current)},[]);const H=I=>{const B=I.currentTarget;if(!g&&!A&&Y&&B.scrollTop+B.clientHeight>=B.scrollHeight-20){const V=Z+1;G(V),X(O,V,!0)}},K=()=>f?T.filter(I=>(e.value??[]).includes(I.value)):T.find(I=>I.value===e.value)??null;return v.jsx(U.FormControl,{fullWidth:!0,error:r,required:y?.required,disabled:y?.disabled,size:"small",sx:$e,children:v.jsx(U.Autocomplete,{multiple:f,disableCloseOnSelect:f,open:E,onOpen:ce,onClose:$,inputValue:p?O:void 0,onInputChange:p?k:void 0,options:T,loading:g||m,filterOptions:p?I=>I:void 0,value:K(),onChange:(I,B)=>{w.current=!0;const V=f?B.map(F=>F.value):B?.value??null;e.onChange(V),!f&&B&&C(B.label),typeof u=="function"&&u(I,B),a?.trigger(e.name)},slots:{listbox:p?gl:void 0},slotProps:{listbox:{onScroll:p?H:void 0,style:{maxHeight:260},...p?{fetchingMore:A,hasMore:Y,showNoMore:h.length>0,empty:h.length===0&&!g&&!A,error:!1}:{}},chip:{size:"small",variant:"outlined",sx:{height:22,fontSize:12,borderRadius:1,backgroundColor:"background.paper","& .MuiChip-label":{px:.75},"& .MuiChip-deleteIcon":{fontSize:16,marginRight:.25}}}},getOptionLabel:I=>I?.label??"",getOptionKey:I=>{const B=I?.key??I?.value;return typeof B=="string"||typeof B=="number"?B:String(B)},isOptionEqualToValue:(I,B)=>I?.value===B?.value,size:"small",disabled:y?.disabled,renderOption:(I,B)=>W.createElement("li",{...I,key:B.key??B.value},B.listLabel??B.label),renderInput:I=>v.jsx(U.TextField,{...I,error:r,fullWidth:!0,helperText:n,label:t,onBlur:()=>{e.onBlur?.(),a?.trigger(e.name)},required:y?.required,size:"small",sx:$e,slotProps:{input:{...I.InputProps,endAdornment:v.jsxs(v.Fragment,{children:[g||m?v.jsx(U.CircularProgress,{color:"inherit",size:20}):null,I.InputProps.endAdornment]})}}})})})},Te=(e,t)=>t?v.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[v.jsx("span",{style:{color:"#d32f2f",marginRight:"4px",fontSize:"20px",fontWeight:"bold",lineHeight:"1",paddingTop:"4px"},children:"*"}),e]}):e,Ir=({field:e,label:t,error:r,helperText:n,fieldProps:o})=>v.jsxs(U.FormControl,{error:r,required:o?.required,component:"fieldset",children:[v.jsx(U.FormControlLabel,{control:v.jsx(U.Checkbox,{checked:e.value??!1,disabled:o?.disabled,onChange:i=>e.onChange(i.target.checked),inputRef:e.ref}),label:Te(t,o?.required)}),n&&v.jsx(U.FormHelperText,{children:n})]}),Mr=({field:e,label:t,error:r,helperText:n,fieldProps:o,form:i,values:a})=>{const{children:l,component:u,...f}=o??{};return l!==void 0?typeof l=="function"?l({field:e,label:t,error:r,helperText:n,form:i,values:a,fieldProps:f}):v.jsx(v.Fragment,{children:l}):u?v.jsx(u,{field:e,label:t,error:r,helperText:n,form:i,values:a,...f}):v.jsx(U.TextField,{...e,label:Te(t,f?.required),error:r,helperText:n,fullWidth:!0,size:"small",sx:$e,...f})},_r=({field:e,label:t,error:r,helperText:n,fieldProps:o})=>v.jsx(or.LocalizationProvider,{adapterLocale:"zh-cn",dateAdapter:ir.AdapterDayjs,children:v.jsx(ri.DateTimePicker,{value:e.value?an(e.value):null,onChange:i=>e.onChange(i?.isValid()?i.format(Pr):""),format:Pr,disabled:o?.disabled,slotProps:{textField:{fullWidth:!0,label:Te(t,o?.required),error:r,helperText:n,required:o?.required,size:"small",sx:$e}},...o})}),Nr=({field:e,label:t,error:r,helperText:n,fieldProps:o,form:i})=>v.jsx(or.LocalizationProvider,{adapterLocale:"zh-cn",dateAdapter:ir.AdapterDayjs,children:v.jsx(ni.DatePicker,{value:e.value?an(e.value):null,onChange:a=>e.onChange(a?.isValid()?a.format(Ar):""),onClose:()=>i?.trigger(e.name),format:Ar,disabled:o?.disabled,slotProps:{textField:{fullWidth:!0,label:Te(t,o?.required),error:r,helperText:n,required:o?.required,size:"small",sx:$e,onBlur:()=>i?.trigger(e.name)}},...o})});function yl(){return Vt}const ke=va;function bl(e){return ve("MuiSvgIcon",e)}Me("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const vl=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${te(t)}`,`fontSize${te(r)}`]};return Pe(o,bl,n)},Sl=ge("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${te(r.color)}`],t[`fontSize${te(r.fontSize)}`]]}})(ke(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),Kt=j.forwardRef(function(t,r){const n=Oe({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:l="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:m=!1,titleAccess:y,viewBox:p="0 0 24 24",...b}=n,h=j.isValidElement(o)&&o.type==="svg",d={...n,color:a,component:l,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:m,viewBox:p,hasSvgAsChild:h},g={};m||(g.viewBox=p);const x=vl(d);return v.jsxs(Sl,{as:l,className:fe(x.root,i),focusable:"false",color:f,"aria-hidden":y?void 0:!0,role:y?"img":void 0,ref:r,...g,...b,...h&&o.props,ownerState:d,children:[h?o.props.children:o,y?v.jsx("title",{children:y}):null]})});process.env.NODE_ENV!=="production"&&(Kt.propTypes={children:s.node,classes:s.object,className:s.string,color:s.oneOfType([s.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),s.string]),component:s.elementType,fontSize:s.oneOfType([s.oneOf(["inherit","large","medium","small"]),s.string]),htmlColor:s.string,inheritViewBox:s.bool,shapeRendering:s.string,sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object]),titleAccess:s.string,viewBox:s.string}),Kt.muiName="SvgIcon";function Rr(e,t){function r(n,o){return v.jsx(Kt,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:o,...n,children:e})}return process.env.NODE_ENV!=="production"&&(r.displayName=`${t}Icon`),r.muiName=Kt.muiName,j.memo(j.forwardRef(r))}function Xt(e){const t=j.useRef(e);return ua(()=>{t.current=e}),j.useRef((...r)=>(0,t.current)(...r)).current}function Mo(...e){const t=j.useRef(void 0),r=j.useCallback(n=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,l=a(n);return typeof l=="function"?l:()=>{a(null)}}return i.current=n,()=>{i.current=null}});return()=>{o.forEach(i=>i?.())}},e);return j.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}const Cl=Rr(v.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),Tl=Rr(v.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopy"),xl=Rr(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),wl=Me("MuiBox",["root"]),El=wo(),Qt=ca({themeId:Sr,defaultTheme:El,defaultClassName:wl.root,generateClassName:Pn.generate});process.env.NODE_ENV!=="production"&&(Qt.propTypes={children:s.node,component:s.elementType,sx:s.oneOfType([s.arrayOf(s.oneOfType([s.func,s.object,s.bool])),s.func,s.object])});const Ol=s.oneOfType([s.func,s.object]);function Jt(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...n){return e(...n)||t(...n)}}function $l(e){const{prototype:t={}}=e;return!!t.isReactComponent}function kl(e,t,r,n,o){const i=e[t],a=o||t;if(i==null||typeof window>"u")return null;let l;return typeof i=="function"&&!$l(i)&&(l="Did you accidentally provide a plain function component instead?"),l!==void 0?new Error(`Invalid ${n} \`${a}\` supplied to \`${r}\`. Expected an element type that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const Al=Jt(s.elementType,kl);function _o(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&window.navigator.userAgent.includes("jsdom")}return!1}const No={};function Ro(e,t){const r=j.useRef(No);return r.current===No&&(r.current=e(t)),r}class Zt{static create(){return new Zt}static use(){const t=Ro(Zt.create).current,[r,n]=j.useState(!1);return t.shouldMount=r,t.setShouldMount=n,j.useEffect(t.mountEffect,[r]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=Il(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())};start(...t){this.mount().then(()=>this.ref.current?.start(...t))}stop(...t){this.mount().then(()=>this.ref.current?.stop(...t))}pulsate(...t){this.mount().then(()=>this.ref.current?.pulsate(...t))}}function Pl(){return Zt.use()}function Il(){let e,t;const r=new Promise((n,o)=>{e=n,t=o});return r.resolve=e,r.reject=t,r}function Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dr.apply(null,arguments)}function Ml(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Br(e,t){return Br=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Br(e,t)}function _l(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Br(e,t)}const Do=W.createContext(null);function Nl(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jr(e,t){var r=function(i){return t&&W.isValidElement(i)?t(i):i},n=Object.create(null);return e&&W.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Rl(e,t){e=e||{},t=t||{};function r(m){return m in t?t[m]:e[m]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,l={};for(var u in t){if(n[u])for(a=0;a<n[u].length;a++){var f=n[u][a];l[n[u][a]]=r(f)}l[u]=r(u)}for(a=0;a<o.length;a++)l[o[a]]=r(o[a]);return l}function Qe(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Dl(e,t){return jr(e.children,function(r){return W.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Qe(r,"appear",e),enter:Qe(r,"enter",e),exit:Qe(r,"exit",e)})})}function Bl(e,t,r){var n=jr(e.children),o=Rl(t,n);return Object.keys(o).forEach(function(i){var a=o[i];if(W.isValidElement(a)){var l=i in t,u=i in n,f=t[i],m=W.isValidElement(f)&&!f.props.in;u&&(!l||m)?o[i]=W.cloneElement(a,{onExited:r.bind(null,a),in:!0,exit:Qe(a,"exit",e),enter:Qe(a,"enter",e)}):!u&&l&&!m?o[i]=W.cloneElement(a,{in:!1}):u&&l&&W.isValidElement(f)&&(o[i]=W.cloneElement(a,{onExited:r.bind(null,a),in:f.props.in,exit:Qe(a,"exit",e),enter:Qe(a,"enter",e)}))}}),o}var jl=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Vl={component:"div",childFactory:function(t){return t}},Vr=(function(e){_l(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=i.handleExited.bind(Nl(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var a=i.children,l=i.handleExited,u=i.firstRender;return{children:u?Dl(o,l):Bl(o,a,l),firstRender:!1}},r.handleExited=function(o,i){var a=jr(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var u=Dr({},l.children);return delete u[o.key],{children:u}}))},r.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=Ml(o,["component","childFactory"]),u=this.state.contextValue,f=jl(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?W.createElement(Do.Provider,{value:u},f):W.createElement(Do.Provider,{value:u},W.createElement(i,l,f))},t})(W.Component);Vr.propTypes=process.env.NODE_ENV!=="production"?{component:s.any,children:s.node,appear:s.bool,enter:s.bool,exit:s.bool,childFactory:s.func}:{},Vr.defaultProps=Vl;const zl=[];function Wl(e){j.useEffect(e,zl)}class zr{static create(){return new zr}currentId=null;start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,r()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function Ll(){const e=Ro(zr.create).current;return Wl(e.disposeEffect),e}function Bo(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:a,in:l,onExited:u,timeout:f}=e,[m,y]=j.useState(!1),p=fe(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),b={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=fe(r.child,m&&r.childLeaving,n&&r.childPulsate);return!l&&!m&&y(!0),j.useEffect(()=>{if(!l&&u!=null){const d=setTimeout(u,f);return()=>{clearTimeout(d)}}},[u,l,f]),v.jsx("span",{className:p,style:b,children:v.jsx("span",{className:h})})}process.env.NODE_ENV!=="production"&&(Bo.propTypes={classes:s.object.isRequired,className:s.string,in:s.bool,onExited:s.func,pulsate:s.bool,rippleSize:s.number,rippleX:s.number,rippleY:s.number,timeout:s.number.isRequired});const xe=Me("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Wr=550,Fl=80,ql=Be.keyframes`
|
|
28
28
|
0% {
|
|
29
29
|
transform: scale(0);
|
|
30
30
|
opacity: 0.1;
|