@kingteza/crud-component 1.26.0 → 1.27.1
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/crud/CrudComponent.cjs.js +1 -1
- package/dist/crud/CrudComponent.d.ts +4 -3
- package/dist/crud/CrudComponent.es.js +29 -27
- package/dist/crud/CrudField.cjs.js +1 -1
- package/dist/crud/CrudField.es.js +44 -42
- package/dist/crud/CrudForm.cjs.js +1 -1
- package/dist/crud/CrudForm.d.ts +3 -2
- package/dist/crud/CrudForm.es.js +14 -13
- package/dist/crud/CrudFormWizard.cjs.js +1 -1
- package/dist/crud/CrudFormWizard.d.ts +3 -1
- package/dist/crud/CrudFormWizard.es.js +105 -93
- package/dist/crud/modal/index.cjs.js +1 -1
- package/dist/crud/modal/index.d.ts +3 -1
- package/dist/crud/modal/index.es.js +66 -63
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),q=require("antd"),n=require("react"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),q=require("antd"),n=require("react"),Y=require("./modal/index.cjs.js"),Z=require("./import/CrudImportButton.cjs.js"),$=require("./view/CrudViewer.cjs.js"),p=require("../common/button/NewButton.cjs.js"),U=require("../common/button/PrintButton.cjs.js");function P({idField:x="id",onCreate:h,onDelete:N,onHide:v,onUpdate:t,onClickUpdate:d,fields:l,data:b,grid:g,isHiding:R,isCreating:y,isDeleting:B,isUpdating:M,paginateProps:S,onPrint:k,printing:I,viewable:O,loadingData:V,formBuilder:W,extraAction:_,minusHeight:w,scroll:z,cloneable:A,fullWidthModal:D=!0,wizard:E,extraView:F,importable:m,onClickNew:r,newButtonProps:c,size:G,headerRender:i,actionWidth:H,onValuesChange:J,...K}){const a=n.useRef(null),L=n.useCallback(()=>{var s;(s=a.current)==null||s.create()},[]),o=n.useCallback(async(s,C=!0,X=!1)=>{var j;await((j=a.current)==null?void 0:j.update(s,C,X))},[]),Q=n.useCallback(async s=>{o(s,!1,!0)},[o]),{onClick:ee,...f}=n.useMemo(()=>c||{},[c]),u=n.useMemo(()=>e.jsx(p.NewButton,{onClick:(s,C)=>{r?r():c!=null&&c.onClick?c.onClick(C):L()},className:"flex-1",...f}),[r,c,f]),T=n.useCallback(()=>i?i({newButton:u}):u,[u,i]);return e.jsxs(e.Fragment,{children:[e.jsxs(q.Space,{direction:"vertical",className:"w-100",children:[e.jsxs("div",{className:"w-100 d-flex",children:[e.jsx("div",{className:"flex-1",children:T()}),e.jsxs(q.Space,{children:[!!k&&e.jsx(U.PrintButton,{className:"float-right",loading:I,onClick:k}),!!m&&e.jsx(Z,{fields:l,importProps:m})]})]}),e.jsx($,{...K,minusHeight:w,scroll:z,data:b,size:G,fields:l,extraAction:_,actionWidth:H,idField:x,isDeleting:B,loadingData:V,onClickUpdate:d||(t?o:void 0),onHide:v,isHiding:R,onDelete:N,onUpdate:t,onClickClone:A?Q:void 0,paginateProps:S,viewable:O,extraView:F})]}),e.jsx(Y,{ref:a,fields:l,wizard:E,grid:g,fullWidthModal:D,isCreating:y,isUpdating:M,onCreate:h,onUpdate:t,idField:x,formBuilder:W,onValuesChange:J})]})}module.exports=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonProps, ColorPickerProps } from 'antd';
|
|
1
|
+
import { ButtonProps, ColorPickerProps, FormProps } from 'antd';
|
|
2
2
|
import { Rule } from 'antd/es/form';
|
|
3
3
|
import { FormInstance, FormItemProps, TablePaginationConfig, TableProps } from 'antd/lib';
|
|
4
4
|
import { Dayjs } from 'dayjs';
|
|
@@ -21,7 +21,7 @@ export type SelectFieldItem = {
|
|
|
21
21
|
disabled?: boolean;
|
|
22
22
|
};
|
|
23
23
|
export interface InitialCrudField<T> {
|
|
24
|
-
formLayoutProps?: Pick<FormItemProps, "layout" |
|
|
24
|
+
formLayoutProps?: Pick<FormItemProps, "layout" | "labelCol" | "wrapperCol">;
|
|
25
25
|
label: string;
|
|
26
26
|
fieldHelper?: ReactNode;
|
|
27
27
|
updatingValue?: T;
|
|
@@ -281,6 +281,7 @@ export type CrudComponentProps<T, FormType = T> = {
|
|
|
281
281
|
headerRender?: (props: {
|
|
282
282
|
newButton: JSX.Element;
|
|
283
283
|
}) => React.ReactElement;
|
|
284
|
+
onValuesChange?: FormProps<T>["onValuesChange"];
|
|
284
285
|
} & CrudSearchComponentProps<T, FormType>;
|
|
285
|
-
declare function CrudComponent<T, FormType = T>({ idField, onCreate, onDelete, onHide, onUpdate, onClickUpdate, fields, data, grid, isHiding, isCreating, isDeleting, isUpdating, paginateProps, onPrint, printing, viewable, loadingData, formBuilder, extraAction, minusHeight, scroll, cloneable, fullWidthModal, wizard, extraView, importable, onClickNew, newButtonProps, size, headerRender, actionWidth, ...props }: CrudComponentProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
|
|
286
|
+
declare function CrudComponent<T, FormType = T>({ idField, onCreate, onDelete, onHide, onUpdate, onClickUpdate, fields, data, grid, isHiding, isCreating, isDeleting, isUpdating, paginateProps, onPrint, printing, viewable, loadingData, formBuilder, extraAction, minusHeight, scroll, cloneable, fullWidthModal, wizard, extraView, importable, onClickNew, newButtonProps, size, headerRender, actionWidth, onValuesChange, ...props }: CrudComponentProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
|
|
286
287
|
export default CrudComponent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as r, jsxs as l, Fragment as
|
|
1
|
+
import { jsx as r, jsxs as l, Fragment as $ } from "react/jsx-runtime";
|
|
2
2
|
import { Space as N } from "antd";
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { NewButton as
|
|
8
|
-
import { PrintButton as
|
|
9
|
-
function
|
|
3
|
+
import { useRef as w, useCallback as c, useMemo as v } from "react";
|
|
4
|
+
import U from "./modal/index.es.js";
|
|
5
|
+
import P from "./import/CrudImportButton.es.js";
|
|
6
|
+
import ee from "./view/CrudViewer.es.js";
|
|
7
|
+
import { NewButton as oe } from "../common/button/NewButton.es.js";
|
|
8
|
+
import { PrintButton as re } from "../common/button/PrintButton.es.js";
|
|
9
|
+
function ue({
|
|
10
10
|
idField: C = "id",
|
|
11
11
|
onCreate: g,
|
|
12
12
|
onDelete: j,
|
|
@@ -39,55 +39,56 @@ function fe({
|
|
|
39
39
|
size: J,
|
|
40
40
|
headerRender: n,
|
|
41
41
|
actionWidth: K,
|
|
42
|
-
|
|
42
|
+
onValuesChange: L,
|
|
43
|
+
...Q
|
|
43
44
|
}) {
|
|
44
|
-
const m =
|
|
45
|
+
const m = w(null), T = c(() => {
|
|
45
46
|
var o;
|
|
46
47
|
(o = m.current) == null || o.create();
|
|
47
48
|
}, []), s = c(
|
|
48
|
-
async (o, u = !0,
|
|
49
|
+
async (o, u = !0, Z = !1) => {
|
|
49
50
|
var x;
|
|
50
|
-
await ((x = m.current) == null ? void 0 : x.update(o, u,
|
|
51
|
+
await ((x = m.current) == null ? void 0 : x.update(o, u, Z));
|
|
51
52
|
},
|
|
52
53
|
[]
|
|
53
|
-
),
|
|
54
|
+
), X = c(
|
|
54
55
|
async (o) => {
|
|
55
56
|
s(o, !1, !0);
|
|
56
57
|
},
|
|
57
58
|
[s]
|
|
58
|
-
), { onClick:
|
|
59
|
+
), { onClick: le, ...p } = v(() => e || {}, [e]), f = v(
|
|
59
60
|
() => /* @__PURE__ */ r(
|
|
60
|
-
|
|
61
|
+
oe,
|
|
61
62
|
{
|
|
62
63
|
onClick: (o, u) => {
|
|
63
|
-
a ? a() : e != null && e.onClick ? e.onClick(u) :
|
|
64
|
+
a ? a() : e != null && e.onClick ? e.onClick(u) : T();
|
|
64
65
|
},
|
|
65
66
|
className: "flex-1",
|
|
66
67
|
...p
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
70
|
[a, e, p]
|
|
70
|
-
),
|
|
71
|
-
return /* @__PURE__ */ l(
|
|
71
|
+
), Y = c(() => n ? n({ newButton: f }) : f, [f, n]);
|
|
72
|
+
return /* @__PURE__ */ l($, { children: [
|
|
72
73
|
/* @__PURE__ */ l(N, { direction: "vertical", className: "w-100", children: [
|
|
73
74
|
/* @__PURE__ */ l("div", { className: "w-100 d-flex", children: [
|
|
74
|
-
/* @__PURE__ */ r("div", { className: "flex-1", children:
|
|
75
|
+
/* @__PURE__ */ r("div", { className: "flex-1", children: Y() }),
|
|
75
76
|
/* @__PURE__ */ l(N, { children: [
|
|
76
77
|
!!k && /* @__PURE__ */ r(
|
|
77
|
-
|
|
78
|
+
re,
|
|
78
79
|
{
|
|
79
80
|
className: "float-right",
|
|
80
81
|
loading: _,
|
|
81
82
|
onClick: k
|
|
82
83
|
}
|
|
83
84
|
),
|
|
84
|
-
!!h && /* @__PURE__ */ r(
|
|
85
|
+
!!h && /* @__PURE__ */ r(P, { fields: t, importProps: h })
|
|
85
86
|
] })
|
|
86
87
|
] }),
|
|
87
88
|
/* @__PURE__ */ r(
|
|
88
|
-
|
|
89
|
+
ee,
|
|
89
90
|
{
|
|
90
|
-
...
|
|
91
|
+
...Q,
|
|
91
92
|
minusHeight: B,
|
|
92
93
|
scroll: D,
|
|
93
94
|
data: M,
|
|
@@ -103,7 +104,7 @@ function fe({
|
|
|
103
104
|
isHiding: O,
|
|
104
105
|
onDelete: j,
|
|
105
106
|
onUpdate: i,
|
|
106
|
-
onClickClone: E ?
|
|
107
|
+
onClickClone: E ? X : void 0,
|
|
107
108
|
paginateProps: W,
|
|
108
109
|
viewable: b,
|
|
109
110
|
extraView: H
|
|
@@ -111,7 +112,7 @@ function fe({
|
|
|
111
112
|
)
|
|
112
113
|
] }),
|
|
113
114
|
/* @__PURE__ */ r(
|
|
114
|
-
|
|
115
|
+
U,
|
|
115
116
|
{
|
|
116
117
|
ref: m,
|
|
117
118
|
fields: t,
|
|
@@ -123,11 +124,12 @@ function fe({
|
|
|
123
124
|
onCreate: g,
|
|
124
125
|
onUpdate: i,
|
|
125
126
|
idField: C,
|
|
126
|
-
formBuilder: z
|
|
127
|
+
formBuilder: z,
|
|
128
|
+
onValuesChange: L
|
|
127
129
|
}
|
|
128
130
|
)
|
|
129
131
|
] });
|
|
130
132
|
}
|
|
131
133
|
export {
|
|
132
|
-
|
|
134
|
+
ue as default
|
|
133
135
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),y=require("antd"),q=require("react"),K=require("react-highlight-words"),Q=require("../locale/index.cjs.js"),V=require("./FileCrudField.cjs.js"),X=require("./ImageCrudField.cjs.js"),Y=require("../common/check-box/CheckBox.cjs.js"),Z=require("../common/date-picker/DatePicker.cjs.js"),ee=require("../common/date-picker/TimePicker.cjs.js"),_=require("../common/select/SelectComponent.cjs.js"),te=require("../common/text-field/NumberField.cjs.js"),re=require("../common/text-field/PhoneNumberField.cjs.js"),ae=require("../common/text-field/TextField.cjs.js"),le=require("../common/tooltip/TooltipComponent.cjs.js"),ne=require("./CrudTextAreaComponent.cjs.js"),U=require("../util/CrudUtil.cjs.js");function oe(N){const{label:o,name:c,type:b,required:i,hidden:P,rules:g=[],updatable:f=!0,readonly:S=!1,fieldClassName:m,customFormFieldRender:w,fieldTooltip:j,fieldHelper:p,formLayoutProps:T,...e}=N,C=y.Form.useFormInstance();q.useEffect(()=>{if(b==="select"){const{items:r=[],onSearch:s,searchOnType:n}=e;!(r!=null&&r.length)&&!n&&(s==null||s(void 0,C,e==null?void 0:e.updatingValue))}},[C,e,b,e==null?void 0:e.updatingValue]);const{t:O}=Q.useTranslationLibNoNS();if(S||P)return t.jsx(t.Fragment,{});if(w)return w(C,N);switch(b){case"text":case"email":case"password":{const{onChange:r,placeholder:s,addonAfter:n,addonBefore:d}=e;return t.jsx(ae.default,{...T,placeholder:s,disabled:!f,rules:g,required:i,onChange:r?h=>r(h,C):void 0,type:b,name:c,tooltip:j,label:o,className:m,autoComplete:"new-password",addonAfter:n,addonBefore:d,help:p})}case"phone":{const{onChange:r,placeholder:s,addonAfter:n,addonBefore:d}=e;return t.jsx(re,{...e,...T,placeholder:s,disabled:!f,rules:g,required:i,onChange:r?h=>r(h,C):void 0,type:b,name:c,tooltip:j,label:o,className:m,autoComplete:"new-password",addonAfter:n,addonBefore:d,help:p})}case"number":{const{onChange:r,placeholder:s,allowMinus:n,min:d,max:h,addonAfter:x,addonBefore:v}=e;return t.jsx(te,{...T,placeholder:s,disabled:!f,moneyField:!!e.formatted,type:b,onChange:r?F=>r(F,C):void 0,rules:g,autoComplete:"false",required:i,tooltip:j,className:m,min:n?null:d,max:h,addonAfter:x,addonBefore:v,name:c,label:o,help:p})}case"date":{const{range:r,disableToday:s,disabledFutureDays:n,disabledPastDays:d,onChange:h,placeholder:x,format:v}=e;return t.jsx(Z,{...T,placeholder:x,required:i,disabled:!f,type:b,format:v,tooltip:j,range:r,name:c,label:o,onChange:h?F=>h(F,C):void 0,className:m,disableToday:s,disabledFutureDays:n,disabledPastDays:d,help:p})}case"time":{const{range:r=!1,disableCurrent:s,disabledFuture:n,disabledPast:d,onChange:h,use12Hours:x,format:v,placeholder:F}=e;return t.jsx(ee,{...T,placeholder:F,required:i,format:v,disabled:!f,type:b,tooltip:j,range:r,use12Hours:x,name:c,label:o,onChange:h?l=>h(l,C):void 0,className:m,disableCurrent:s,disabledFuture:n,disabledPast:d,help:p})}case"textarea":return t.jsx(ne,{...N});case"image":return t.jsx(X.default,{...e,required:i,name:c,label:o,rules:g,fieldHelper:p,fieldClassName:m,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"file":return t.jsx(V.default,{...e,required:i,name:c,label:o,rules:g,fieldHelper:p,fieldClassName:m,onRemoved:e.onRemoved,onUploading:e.onUploading,provider:e.provider});case"select":return t.jsx(D,{...e,required:i,name:c,label:o,rules:g,fieldClassName:m,form:C,help:p,updatable:f,readonly:S,fieldTooltip:j,fieldHelper:p});case"enum":{const{enum:r,radio:s=!1,translation:n,onChange:d,onSearch:h,multiple:x,tagRender:v}=e,F=Array.isArray(r)?r:Object.keys(r);return s?t.jsx(y.Form.Item,{...e,...T,name:c,required:i,tooltip:j,rules:g,label:o,className:["w-100",m].join(" "),help:p,children:t.jsx(y.Radio.Group,{...e,onChange:d?l=>{var k;return d((k=l==null?void 0:l.target)==null?void 0:k.value,C)}:void 0,children:F.map(l=>t.jsx(y.Radio,{disabled:!f,value:l,children:n?O(n[l]):l},l))})}):t.jsx(_,{...e,...T,tagRender:typeof v=="function"?v:v?l=>{const{value:k,label:R}=l,H=v[k];return H?t.jsx(y.Tag,{color:H.color,children:R}):t.jsx(y.Tag,{children:R})}:void 0,onChange:d?l=>d(l,C):void 0,className:["w-100",m].join(" "),name:c,items:F,required:i,tooltip:j,rules:g,label:o,help:p,disabled:!f,onSearch:h?l=>h(l,C):void 0,allowClear:!0,mode:x?"multiple":void 0,showLoadingInEmptyIndicator:!0,itemBuilder:l=>t.jsx(y.Select.Option,{value:l,children:n?O(n[l]):l},l)})}case"checkbox":{const{onChange:r,switch:s}=e;return t.jsx(Y,{...T,className:m,rules:g,onChange:r?n=>r(n,C):void 0,label:o,tooltip:j,disabled:!f,name:c,help:p,switch:s})}case"color":return t.jsx(W,{...e,type:"color",required:i,name:c,label:o,rules:g,fieldClassName:m,updatable:f,readonly:S,fieldTooltip:j,fieldHelper:p});default:return t.jsx(t.Fragment,{children:`${b} Not Implemented`})}}function D(N){const{items:o=[],loading:c,searchOnType:b,onSearch:i,multiple:P,onChange:g,highlightSearch:f,required:S,fieldClassName:m,rules:w,fieldTooltip:j,updatable:p,label:T,name:e,tagRender:C,updatingValue:O,onSet:r,placeholder:s,allowClear:n=!0,selectOptionRender:d,formLayoutProps:h}=N,x=N.form,[v,F]=q.useState(""),l=q.useMemo(()=>U.getRealName(e),[e]),k=q.useMemo(()=>U.getRealName(e,"upsertFieldName"),[e]),R=y.Form.useWatch(l,x),[H,L]=q.useState(!0);q.useEffect(()=>{r&&H&&R&&(r==null||r(R,o,x),L(!1))},[H,x,o,l,r,R]),q.useEffect(()=>{R&&L(!0)},[R]);const G=q.useCallback(async a=>{F(a),b&&(i==null||i(a,x,O))},[x,i,b,O]),$=q.useCallback(a=>d?d(a):a.value,[d]);return t.jsx(_,{...N,...h,showLoadingInEmptyIndicator:!0,maxTagCount:"responsive",maxTagPlaceholder:a=>t.jsxs(le,{title:t.jsx(t.Fragment,{children:a.map(u=>t.jsxs(t.Fragment,{children:[u.label," ",t.jsx("br",{})]}))}),children:["+",a==null?void 0:a.length]}),placeholder:s,onSelect:a=>{r==null||r(a==null?void 0:a.key,o,x)},onChange:g?a=>{F(""),g(a,x)}:void 0,mode:P?"multiple":void 0,className:["w-100",m].join(" "),name:k,items:o,required:S,tooltip:j,tagRender:C,rules:w,disabled:!p,label:T,allowClear:n,onSearch:G,loading:c,filterOption:f?(a,u)=>{var I,A,B;try{const E=a.toLowerCase().split(/\s+/),z=((typeof(u==null?void 0:u.children)=="string"?u==null?void 0:u.children:(A=(I=u==null?void 0:u.children)==null?void 0:I.props)==null?void 0:A.textToHighlight)??"").toLowerCase(),J=(((B=u==null?void 0:u.value)==null?void 0:B.toString())??"").toLowerCase();return E.every(M=>z.indexOf(M)>=0||J.indexOf(M)>=0)}catch{return!0}}:void 0,itemBuilder:f?a=>{const u=a.value?String(a.value):void 0;return t.jsx(y.Select.Option,{value:a.key,title:u,disabled:a.disabled,children:t.jsx(K,{highlightClassName:"highlight-text",searchWords:(v??"").split(" "),autoEscape:!0,textToHighlight:u??""})},a.key)}:a=>t.jsx(y.Select.Option,{value:a.key,title:a.value,disabled:a.disabled,children:$(a)},a.key)})}function W(N){const{formLayoutProps:o,required:c,fieldClassName:b,rules:i,fieldTooltip:P,updatable:g,label:f,name:S,fieldHelper:m}=N;return t.jsx(y.Form.Item,{...o,label:f,name:S,required:c,rules:i,tooltip:P,help:m,getValueFromEvent:w=>typeof w=="object"?w.toHexString():w,children:t.jsx(y.ColorPicker,{disabledAlpha:!0,format:"hex",defaultFormat:"hex",showText:!0,trigger:"click",className:b,disabled:!g,...N.innerProps})})}exports.ColorCrudFieldComponent=W;exports.SelectCrudFieldComponent=D;exports.default=oe;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { useEffect as
|
|
1
|
+
import { jsx as o, Fragment as S, jsxs as W } from "react/jsx-runtime";
|
|
2
|
+
import { Form as I, Radio as _, Select as A, Tag as G, ColorPicker as ee } from "antd";
|
|
3
|
+
import { useEffect as j, useState as $, useMemo as z, useCallback as J } from "react";
|
|
4
4
|
import re from "react-highlight-words";
|
|
5
5
|
import { useTranslationLibNoNS as te } from "../locale/index.es.js";
|
|
6
6
|
import oe from "./FileCrudField.es.js";
|
|
@@ -15,7 +15,7 @@ import ce from "../common/text-field/TextField.es.js";
|
|
|
15
15
|
import me from "../common/tooltip/TooltipComponent.es.js";
|
|
16
16
|
import ue from "./CrudTextAreaComponent.es.js";
|
|
17
17
|
import K from "../util/CrudUtil.es.js";
|
|
18
|
-
function
|
|
18
|
+
function Se(F) {
|
|
19
19
|
const {
|
|
20
20
|
label: n,
|
|
21
21
|
name: m,
|
|
@@ -26,13 +26,13 @@ function Ae(F) {
|
|
|
26
26
|
updatable: f = !0,
|
|
27
27
|
readonly: k = !1,
|
|
28
28
|
fieldClassName: u,
|
|
29
|
-
customFormFieldRender:
|
|
29
|
+
customFormFieldRender: T,
|
|
30
30
|
fieldTooltip: y,
|
|
31
31
|
fieldHelper: g,
|
|
32
|
-
formLayoutProps:
|
|
32
|
+
formLayoutProps: w,
|
|
33
33
|
...e
|
|
34
|
-
} = F, C =
|
|
35
|
-
|
|
34
|
+
} = F, C = I.useFormInstance();
|
|
35
|
+
j(() => {
|
|
36
36
|
if (v === "select") {
|
|
37
37
|
const {
|
|
38
38
|
items: r = [],
|
|
@@ -43,9 +43,9 @@ function Ae(F) {
|
|
|
43
43
|
}
|
|
44
44
|
}, [C, e, v, e == null ? void 0 : e.updatingValue]);
|
|
45
45
|
const { t: O } = te();
|
|
46
|
-
if (k || H) return /* @__PURE__ */ o(
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
46
|
+
if (k || H) return /* @__PURE__ */ o(S, {});
|
|
47
|
+
if (T)
|
|
48
|
+
return T(C, F);
|
|
49
49
|
switch (v) {
|
|
50
50
|
case "text":
|
|
51
51
|
case "email":
|
|
@@ -54,7 +54,7 @@ function Ae(F) {
|
|
|
54
54
|
return /* @__PURE__ */ o(
|
|
55
55
|
ce,
|
|
56
56
|
{
|
|
57
|
-
...
|
|
57
|
+
...w,
|
|
58
58
|
placeholder: i,
|
|
59
59
|
disabled: !f,
|
|
60
60
|
rules: p,
|
|
@@ -78,7 +78,7 @@ function Ae(F) {
|
|
|
78
78
|
se,
|
|
79
79
|
{
|
|
80
80
|
...e,
|
|
81
|
-
...
|
|
81
|
+
...w,
|
|
82
82
|
placeholder: i,
|
|
83
83
|
disabled: !f,
|
|
84
84
|
rules: p,
|
|
@@ -109,7 +109,7 @@ function Ae(F) {
|
|
|
109
109
|
return /* @__PURE__ */ o(
|
|
110
110
|
de,
|
|
111
111
|
{
|
|
112
|
-
...
|
|
112
|
+
...w,
|
|
113
113
|
placeholder: i,
|
|
114
114
|
disabled: !f,
|
|
115
115
|
moneyField: !!e.formatted,
|
|
@@ -143,7 +143,7 @@ function Ae(F) {
|
|
|
143
143
|
return /* @__PURE__ */ o(
|
|
144
144
|
ne,
|
|
145
145
|
{
|
|
146
|
-
...
|
|
146
|
+
...w,
|
|
147
147
|
placeholder: b,
|
|
148
148
|
required: d,
|
|
149
149
|
disabled: !f,
|
|
@@ -176,7 +176,7 @@ function Ae(F) {
|
|
|
176
176
|
return /* @__PURE__ */ o(
|
|
177
177
|
ie,
|
|
178
178
|
{
|
|
179
|
-
...
|
|
179
|
+
...w,
|
|
180
180
|
placeholder: x,
|
|
181
181
|
required: d,
|
|
182
182
|
format: N,
|
|
@@ -259,10 +259,10 @@ function Ae(F) {
|
|
|
259
259
|
tagRender: N
|
|
260
260
|
} = e, x = Array.isArray(r) ? r : Object.keys(r);
|
|
261
261
|
return i ? /* @__PURE__ */ o(
|
|
262
|
-
|
|
262
|
+
I.Item,
|
|
263
263
|
{
|
|
264
264
|
...e,
|
|
265
|
-
...
|
|
265
|
+
...w,
|
|
266
266
|
name: m,
|
|
267
267
|
required: d,
|
|
268
268
|
tooltip: y,
|
|
@@ -286,10 +286,10 @@ function Ae(F) {
|
|
|
286
286
|
Q,
|
|
287
287
|
{
|
|
288
288
|
...e,
|
|
289
|
-
...
|
|
289
|
+
...w,
|
|
290
290
|
tagRender: typeof N == "function" ? N : N ? (a) => {
|
|
291
|
-
const { value: P, label: R } = a,
|
|
292
|
-
return
|
|
291
|
+
const { value: P, label: R } = a, L = N[P];
|
|
292
|
+
return L ? /* @__PURE__ */ o(G, { color: L.color, children: R }) : /* @__PURE__ */ o(G, { children: R });
|
|
293
293
|
} : void 0,
|
|
294
294
|
onChange: s ? (a) => s(a, C) : void 0,
|
|
295
295
|
className: ["w-100", u].join(" "),
|
|
@@ -304,7 +304,8 @@ function Ae(F) {
|
|
|
304
304
|
onSearch: h ? (a) => h(a, C) : void 0,
|
|
305
305
|
allowClear: !0,
|
|
306
306
|
mode: b ? "multiple" : void 0,
|
|
307
|
-
|
|
307
|
+
showLoadingInEmptyIndicator: !0,
|
|
308
|
+
itemBuilder: (a) => /* @__PURE__ */ o(A.Option, { value: a, children: l ? O(l[a]) : a }, a)
|
|
308
309
|
}
|
|
309
310
|
);
|
|
310
311
|
}
|
|
@@ -313,7 +314,7 @@ function Ae(F) {
|
|
|
313
314
|
return /* @__PURE__ */ o(
|
|
314
315
|
le,
|
|
315
316
|
{
|
|
316
|
-
...
|
|
317
|
+
...w,
|
|
317
318
|
className: u,
|
|
318
319
|
rules: p,
|
|
319
320
|
onChange: r ? (l) => r(l, C) : void 0,
|
|
@@ -344,7 +345,7 @@ function Ae(F) {
|
|
|
344
345
|
}
|
|
345
346
|
);
|
|
346
347
|
default:
|
|
347
|
-
return /* @__PURE__ */ o(
|
|
348
|
+
return /* @__PURE__ */ o(S, { children: `${v} Not Implemented` });
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
351
|
function he(F) {
|
|
@@ -358,10 +359,10 @@ function he(F) {
|
|
|
358
359
|
highlightSearch: f,
|
|
359
360
|
required: k,
|
|
360
361
|
fieldClassName: u,
|
|
361
|
-
rules:
|
|
362
|
+
rules: T,
|
|
362
363
|
fieldTooltip: y,
|
|
363
364
|
updatable: g,
|
|
364
|
-
label:
|
|
365
|
+
label: w,
|
|
365
366
|
name: e,
|
|
366
367
|
tagRender: C,
|
|
367
368
|
updatingValue: O,
|
|
@@ -373,11 +374,11 @@ function he(F) {
|
|
|
373
374
|
} = F, b = F.form, [N, x] = $(""), a = z(() => K.getRealName(e), [e]), P = z(
|
|
374
375
|
() => K.getRealName(e, "upsertFieldName"),
|
|
375
376
|
[e]
|
|
376
|
-
), R =
|
|
377
|
-
|
|
378
|
-
r &&
|
|
379
|
-
}, [
|
|
380
|
-
R &&
|
|
377
|
+
), R = I.useWatch(a, b), [L, B] = $(!0);
|
|
378
|
+
j(() => {
|
|
379
|
+
r && L && R && (r == null || r(R, n, b), B(!1));
|
|
380
|
+
}, [L, b, n, a, r, R]), j(() => {
|
|
381
|
+
R && B(!0);
|
|
381
382
|
}, [R]);
|
|
382
383
|
const V = J(
|
|
383
384
|
async (t) => {
|
|
@@ -393,11 +394,12 @@ function he(F) {
|
|
|
393
394
|
{
|
|
394
395
|
...F,
|
|
395
396
|
...h,
|
|
397
|
+
showLoadingInEmptyIndicator: !0,
|
|
396
398
|
maxTagCount: "responsive",
|
|
397
399
|
maxTagPlaceholder: (t) => /* @__PURE__ */ W(
|
|
398
400
|
me,
|
|
399
401
|
{
|
|
400
|
-
title: /* @__PURE__ */ o(
|
|
402
|
+
title: /* @__PURE__ */ o(S, { children: t.map((c) => /* @__PURE__ */ W(S, { children: [
|
|
401
403
|
c.label,
|
|
402
404
|
" ",
|
|
403
405
|
/* @__PURE__ */ o("br", {})
|
|
@@ -422,17 +424,17 @@ function he(F) {
|
|
|
422
424
|
required: k,
|
|
423
425
|
tooltip: y,
|
|
424
426
|
tagRender: C,
|
|
425
|
-
rules:
|
|
427
|
+
rules: T,
|
|
426
428
|
disabled: !g,
|
|
427
|
-
label:
|
|
429
|
+
label: w,
|
|
428
430
|
allowClear: l,
|
|
429
431
|
onSearch: V,
|
|
430
432
|
loading: m,
|
|
431
433
|
filterOption: f ? (t, c) => {
|
|
432
|
-
var U, q
|
|
434
|
+
var E, U, q;
|
|
433
435
|
try {
|
|
434
|
-
const
|
|
435
|
-
return
|
|
436
|
+
const D = t.toLowerCase().split(/\s+/), Y = ((typeof (c == null ? void 0 : c.children) == "string" ? c == null ? void 0 : c.children : (U = (E = c == null ? void 0 : c.children) == null ? void 0 : E.props) == null ? void 0 : U.textToHighlight) ?? "").toLowerCase(), Z = (((q = c == null ? void 0 : c.value) == null ? void 0 : q.toString()) ?? "").toLowerCase();
|
|
437
|
+
return D.every(
|
|
436
438
|
(M) => Y.indexOf(M) >= 0 || Z.indexOf(M) >= 0
|
|
437
439
|
);
|
|
438
440
|
} catch {
|
|
@@ -442,7 +444,7 @@ function he(F) {
|
|
|
442
444
|
itemBuilder: f ? (t) => {
|
|
443
445
|
const c = t.value ? String(t.value) : void 0;
|
|
444
446
|
return /* @__PURE__ */ o(
|
|
445
|
-
|
|
447
|
+
A.Option,
|
|
446
448
|
{
|
|
447
449
|
value: t.key,
|
|
448
450
|
title: c,
|
|
@@ -460,7 +462,7 @@ function he(F) {
|
|
|
460
462
|
t.key
|
|
461
463
|
);
|
|
462
464
|
} : (t) => /* @__PURE__ */ o(
|
|
463
|
-
|
|
465
|
+
A.Option,
|
|
464
466
|
{
|
|
465
467
|
value: t.key,
|
|
466
468
|
title: t.value,
|
|
@@ -485,7 +487,7 @@ function pe(F) {
|
|
|
485
487
|
fieldHelper: u
|
|
486
488
|
} = F;
|
|
487
489
|
return /* @__PURE__ */ o(
|
|
488
|
-
|
|
490
|
+
I.Item,
|
|
489
491
|
{
|
|
490
492
|
...n,
|
|
491
493
|
label: f,
|
|
@@ -494,7 +496,7 @@ function pe(F) {
|
|
|
494
496
|
rules: d,
|
|
495
497
|
tooltip: H,
|
|
496
498
|
help: u,
|
|
497
|
-
getValueFromEvent: (
|
|
499
|
+
getValueFromEvent: (T) => typeof T == "object" ? T.toHexString() : T,
|
|
498
500
|
children: /* @__PURE__ */ o(
|
|
499
501
|
ee,
|
|
500
502
|
{
|
|
@@ -514,5 +516,5 @@ function pe(F) {
|
|
|
514
516
|
export {
|
|
515
517
|
pe as ColorCrudFieldComponent,
|
|
516
518
|
he as SelectCrudFieldComponent,
|
|
517
|
-
|
|
519
|
+
Se as default
|
|
518
520
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),m=require("antd"),j=require("./CrudField.cjs.js"),b=require("../util/CrudUtil.cjs.js");function v({form:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),m=require("antd"),j=require("./CrudField.cjs.js"),b=require("../util/CrudUtil.cjs.js");function v({form:d,purpose:y="new",onValuesChange:o,...i}){return e.jsx(m.Form,{form:d,layout:"vertical",onValuesChange:o,children:e.jsx(x,{...i,purpose:y})})}function x({fields:d,formBuilder:y,grid:o,onDeleteFile:i,onUploadFile:u,purpose:c}){const p=s.useMemo(()=>d.filter(t=>!t.readonly&&(t.type!=="object"||typeof t.customFormFieldRender=="function")).map(t=>{const a={onUploading:t.type==="image"||t.type==="file"?r=>{var n;t.onUploading&&((n=t.onUploading)==null||n.call(t,r)),u==null||u(r)}:void 0,onDelete:t.type==="image"||t.type==="file"?r=>{var n;t.onUploading&&((n=t.onDelete)==null||n.call(t,r)),i==null||i(r)}:void 0};return e.jsx(s.Fragment,{children:t.grid&&o?e.jsx(m.Col,{...t.grid,children:s.createElement(j.default,{...t,...a,key:typeof t.name=="string"?t.name:String(t.name),updatable:c!=="update"?!0:t.updatable})}):s.createElement(j.default,{...t,...a,key:typeof t.name=="string"?t.name:String(t.name),updatable:c!=="update"?!0:t.updatable})},t.name)}),[d,o,i,u,c]),C=s.useCallback((t,a={})=>{const r=d.find(n=>b.getRealName(n.name)===t);if(r!=null&&r.hidden)return e.jsx(e.Fragment,{});if(r){const n={onUploading:r.type==="image"||r.type==="file"?g=>{var f;r.onUploading&&((f=r.onUploading)==null||f.call(r,g)),u==null||u(g)}:void 0,onDelete:r.type==="image"||r.type==="file"?g=>{var f;r.onUploading&&((f=r.onDelete)==null||f.call(r,g)),i==null||i(g)}:void 0},l=b.getRealName(r.name),h=s.createElement(j.default,{...r,...a,...n,key:typeof l=="string"?l:String(l),updatable:c!=="update"?!0:r.updatable});return a.render?a.render(h):h}return e.jsx(e.Fragment,{})},[d,c]);return e.jsx(e.Fragment,{children:y?e.jsxs(e.Fragment,{children:[y(C,{isAnyFieldHidden(...t){const a=Array.isArray(t)?t:[t];return d.filter(n=>a.includes(n.name)).some(n=>n.hidden)},isAllFieldsHidden(...t){const a=Array.isArray(t)?t:[t];return d.filter(n=>a.includes(n.name)).every(n=>n.hidden)},purpose:c}),e.jsxs(m.Form.Item,{hidden:!0,noStyle:!0,children:[e.jsx(m.Input,{name:"id"}),e.jsx(m.Input,{})]})]}):o?e.jsx(m.Row,{gutter:[8,8],children:p}):p})}exports.CrudForm=v;exports.CrudFormFields=x;
|
package/dist/crud/CrudForm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormInstance } from 'antd';
|
|
1
|
+
import { FormInstance, FormProps } from 'antd';
|
|
2
2
|
import { CrudFieldProps, CrudPurpose, FormBuilderFunc } from './CrudComponent';
|
|
3
3
|
export interface CurdFormFieldsProps<T> {
|
|
4
4
|
onDeleteFile?: (e: any) => void;
|
|
@@ -7,8 +7,9 @@ export interface CurdFormFieldsProps<T> {
|
|
|
7
7
|
formBuilder?: FormBuilderFunc<T>;
|
|
8
8
|
fields: CrudFieldProps<T>[];
|
|
9
9
|
purpose?: CrudPurpose;
|
|
10
|
+
onValuesChange?: FormProps<T>["onValuesChange"];
|
|
10
11
|
}
|
|
11
|
-
export declare function CrudForm<T>({ form, purpose, ...props }: Readonly<CurdFormFieldsProps<T> & {
|
|
12
|
+
export declare function CrudForm<T>({ form, purpose, onValuesChange, ...props }: Readonly<CurdFormFieldsProps<T> & {
|
|
12
13
|
form: FormInstance;
|
|
13
14
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export declare function CrudFormFields<T>({ fields, formBuilder, grid, onDeleteFile, onUploadFile, purpose, }: Readonly<CurdFormFieldsProps<T>>): import("react/jsx-runtime").JSX.Element;
|
package/dist/crud/CrudForm.es.js
CHANGED
|
@@ -4,22 +4,23 @@ import { Form as R, Col as w, Input as A, Row as H } from "antd";
|
|
|
4
4
|
import l from "./CrudField.es.js";
|
|
5
5
|
import C from "../util/CrudUtil.es.js";
|
|
6
6
|
function z({
|
|
7
|
-
form:
|
|
7
|
+
form: m,
|
|
8
8
|
purpose: y = "new",
|
|
9
|
-
|
|
9
|
+
onValuesChange: o,
|
|
10
|
+
...d
|
|
10
11
|
}) {
|
|
11
|
-
return /* @__PURE__ */ a(R, { form:
|
|
12
|
+
return /* @__PURE__ */ a(R, { form: m, layout: "vertical", onValuesChange: o, children: /* @__PURE__ */ a(I, { ...d, purpose: y }) });
|
|
12
13
|
}
|
|
13
14
|
function I({
|
|
14
|
-
fields:
|
|
15
|
+
fields: m,
|
|
15
16
|
formBuilder: y,
|
|
16
17
|
grid: o,
|
|
17
|
-
onDeleteFile:
|
|
18
|
+
onDeleteFile: d,
|
|
18
19
|
onUploadFile: e,
|
|
19
20
|
purpose: u
|
|
20
21
|
}) {
|
|
21
22
|
const h = j(
|
|
22
|
-
() =>
|
|
23
|
+
() => m.filter(
|
|
23
24
|
(t) => !t.readonly && (t.type !== "object" || typeof t.customFormFieldRender == "function")
|
|
24
25
|
).map((t) => {
|
|
25
26
|
const i = {
|
|
@@ -29,7 +30,7 @@ function I({
|
|
|
29
30
|
} : void 0,
|
|
30
31
|
onDelete: t.type === "image" || t.type === "file" ? (r) => {
|
|
31
32
|
var n;
|
|
32
|
-
t.onUploading && ((n = t.onDelete) == null || n.call(t, r)),
|
|
33
|
+
t.onUploading && ((n = t.onDelete) == null || n.call(t, r)), d == null || d(r);
|
|
33
34
|
} : void 0
|
|
34
35
|
};
|
|
35
36
|
return /* @__PURE__ */ a(S.Fragment, { children: t.grid && o ? /* @__PURE__ */ a(w, { ...t.grid, children: /* @__PURE__ */ p(
|
|
@@ -50,10 +51,10 @@ function I({
|
|
|
50
51
|
}
|
|
51
52
|
) }, t.name);
|
|
52
53
|
}),
|
|
53
|
-
[
|
|
54
|
+
[m, o, d, e, u]
|
|
54
55
|
), k = N(
|
|
55
56
|
(t, i = {}) => {
|
|
56
|
-
const r =
|
|
57
|
+
const r = m.find(
|
|
57
58
|
(n) => C.getRealName(n.name) === t
|
|
58
59
|
);
|
|
59
60
|
if (r != null && r.hidden) return /* @__PURE__ */ a(g, {});
|
|
@@ -65,7 +66,7 @@ function I({
|
|
|
65
66
|
} : void 0,
|
|
66
67
|
onDelete: r.type === "image" || r.type === "file" ? (c) => {
|
|
67
68
|
var f;
|
|
68
|
-
r.onUploading && ((f = r.onDelete) == null || f.call(r, c)),
|
|
69
|
+
r.onUploading && ((f = r.onDelete) == null || f.call(r, c)), d == null || d(c);
|
|
69
70
|
} : void 0
|
|
70
71
|
}, s = C.getRealName(r.name), b = /* @__PURE__ */ p(
|
|
71
72
|
l,
|
|
@@ -81,17 +82,17 @@ function I({
|
|
|
81
82
|
}
|
|
82
83
|
return /* @__PURE__ */ a(g, {});
|
|
83
84
|
},
|
|
84
|
-
[
|
|
85
|
+
[m, u]
|
|
85
86
|
);
|
|
86
87
|
return /* @__PURE__ */ a(g, { children: y ? /* @__PURE__ */ v(g, { children: [
|
|
87
88
|
y(k, {
|
|
88
89
|
isAnyFieldHidden(...t) {
|
|
89
90
|
const i = Array.isArray(t) ? t : [t];
|
|
90
|
-
return
|
|
91
|
+
return m.filter((n) => i.includes(n.name)).some((n) => n.hidden);
|
|
91
92
|
},
|
|
92
93
|
isAllFieldsHidden(...t) {
|
|
93
94
|
const i = Array.isArray(t) ? t : [t];
|
|
94
|
-
return
|
|
95
|
+
return m.filter((n) => i.includes(n.name)).every((n) => n.hidden);
|
|
95
96
|
},
|
|
96
97
|
purpose: u
|
|
97
98
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),F=require("@ant-design/icons"),c=require("antd"),b=require("react"),R=require("../locale/index.cjs.js"),S=require("./CrudForm.cjs.js"),v=require("../common/wizard/WizardViewForm.cjs.js"),q=require("../util/CrudUtil.cjs.js"),y=require("../common/button/Button.cjs.js");function N({fields:d,className:h,onDeleteFile:f,onUploadFile:s,purpose:l,wizard:t=[],updatingValue:x,onSave:g,submitting:j,onValuesChange:u}){const m=b.useMemo(()=>t.map(r=>{let n=!0;const o=d.filter(i=>r.fields.includes(q.getRealName(i.name)));return o.forEach(i=>n&&(n=i.hidden??!1)),{...r,hidden:n,fieldThatShouldShowing:o}}),[d,t]),a=b.useMemo(()=>m.filter(r=>!r.hidden),[m]);return e.jsx(v,{onSubmit:(r,n)=>{g(n)},className:h,pages:a.map(({title:r,icon:n,fieldThatShouldShowing:o,hidden:i},k)=>({title:r,icon:n,hidden:i,component:C=>e.jsx(w,{fields:o,onDeleteFile:f,onUploadFile:s,purpose:l,i:k,updatingValue:x,backward:C.backward,forward:C.forward,wizard:a,submitting:j,onValuesChange:u},k)}))})}function w({fields:d,onDeleteFile:h,onUploadFile:f,purpose:s,wizard:l=[],i:t,forward:x,backward:g,submitting:j,updatingValue:u,onValuesChange:m}){const a=l[t],{t:r}=R.useTranslationLib(),[n]=c.Form.useForm();return b.useEffect(()=>{if(u&&(s==="update"||s==="clone")){const o={};for(const i of d)o[q.getRealName(i.name,"upsertFieldName")]=u[q.getRealName(i.name,"upsertFieldName")];n.setFieldsValue(o)}},[d,n,s,u]),e.jsxs(c.Form,{name:String(t),form:n,layout:"vertical",onValuesChange:m,children:[e.jsx(S.CrudFormFields,{fields:d,formBuilder:a.formBuilder,grid:a.grid,onDeleteFile:h,onUploadFile:f,purpose:s}),e.jsx(c.Divider,{}),e.jsxs(c.Row,{gutter:[8,8],children:[t>0&&e.jsx(c.Col,{md:12,children:e.jsx(y,{block:!0,icon:e.jsx(F.LeftOutlined,{}),htmlType:"button",type:"default",size:"large",onClick:()=>g(),children:r("str.back")})}),e.jsx(c.Col,{md:t>0?12:24,children:e.jsx(y,{block:!0,icon:l.length-1===t?e.jsx(F.SaveOutlined,{}):e.jsx(F.RightOutlined,{}),htmlType:"submit",type:"primary",loading:j,size:"large",onClick:()=>{n.validateFields().then(o=>{x(o,l.length-1===t,l.length-1===t)})},children:l.length-1===t?r("str."+(s==="update"?"update":"save")):r("str.next")})})]})]})}module.exports=N;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FormProps } from 'antd';
|
|
1
2
|
import { CrudFieldProps, CrudPurpose, CrudWizardProp } from './CrudComponent';
|
|
2
3
|
export interface CrudFormWizardProps<T> {
|
|
3
4
|
onDeleteFile?: (e: any) => void;
|
|
@@ -9,6 +10,7 @@ export interface CrudFormWizardProps<T> {
|
|
|
9
10
|
onSave: (e: T) => void;
|
|
10
11
|
updatingValue?: T;
|
|
11
12
|
submitting?: boolean;
|
|
13
|
+
onValuesChange?: FormProps<T>["onValuesChange"];
|
|
12
14
|
}
|
|
13
|
-
declare function CrudFormWizard<T>({ fields, className, onDeleteFile, onUploadFile, purpose, wizard, updatingValue, onSave, submitting, }: Readonly<CrudFormWizardProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CrudFormWizard<T>({ fields, className, onDeleteFile, onUploadFile, purpose, wizard, updatingValue, onSave, submitting, onValuesChange, }: Readonly<CrudFormWizardProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export default CrudFormWizard;
|
|
@@ -1,140 +1,152 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { LeftOutlined as
|
|
3
|
-
import { Form as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { useTranslationLib as
|
|
6
|
-
import { CrudFormFields as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
function
|
|
1
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { LeftOutlined as R, SaveOutlined as w, RightOutlined as x } from "@ant-design/icons";
|
|
3
|
+
import { Form as C, Divider as T, Row as W, Col as S } from "antd";
|
|
4
|
+
import { useMemo as v, useEffect as j } from "react";
|
|
5
|
+
import { useTranslationLib as z } from "../locale/index.es.js";
|
|
6
|
+
import { CrudFormFields as B } from "./CrudForm.es.js";
|
|
7
|
+
import O from "../common/wizard/WizardViewForm.es.js";
|
|
8
|
+
import b from "../util/CrudUtil.es.js";
|
|
9
|
+
import N from "../common/button/Button.es.js";
|
|
10
|
+
function I({
|
|
11
11
|
fields: d,
|
|
12
|
-
className:
|
|
13
|
-
onDeleteFile:
|
|
12
|
+
className: f,
|
|
13
|
+
onDeleteFile: s,
|
|
14
14
|
onUploadFile: m,
|
|
15
15
|
purpose: l,
|
|
16
16
|
wizard: e = [],
|
|
17
|
-
updatingValue:
|
|
18
|
-
onSave:
|
|
19
|
-
submitting:
|
|
17
|
+
updatingValue: h,
|
|
18
|
+
onSave: g,
|
|
19
|
+
submitting: p,
|
|
20
|
+
onValuesChange: a
|
|
20
21
|
}) {
|
|
21
|
-
const
|
|
22
|
+
const u = v(() => e.map((t) => {
|
|
22
23
|
let r = !0;
|
|
23
24
|
const n = d.filter(
|
|
24
|
-
(i) => t.fields.includes(
|
|
25
|
+
(i) => t.fields.includes(b.getRealName(i.name))
|
|
25
26
|
);
|
|
26
27
|
return n.forEach((i) => r && (r = i.hidden ?? !1)), {
|
|
27
28
|
...t,
|
|
28
29
|
hidden: r,
|
|
29
30
|
fieldThatShouldShowing: n
|
|
30
31
|
};
|
|
31
|
-
}), [d, e]), c =
|
|
32
|
-
() =>
|
|
33
|
-
[
|
|
32
|
+
}), [d, e]), c = v(
|
|
33
|
+
() => u.filter((t) => !t.hidden),
|
|
34
|
+
[u]
|
|
34
35
|
);
|
|
35
36
|
return /* @__PURE__ */ o(
|
|
36
|
-
|
|
37
|
+
O,
|
|
37
38
|
{
|
|
38
39
|
onSubmit: (t, r) => {
|
|
39
|
-
|
|
40
|
+
g(r);
|
|
40
41
|
},
|
|
41
|
-
className:
|
|
42
|
+
className: f,
|
|
42
43
|
pages: c.map(
|
|
43
|
-
({ title: t, icon: r, fieldThatShouldShowing: n, hidden: i },
|
|
44
|
+
({ title: t, icon: r, fieldThatShouldShowing: n, hidden: i }, F) => ({
|
|
44
45
|
title: t,
|
|
45
46
|
icon: r,
|
|
46
47
|
hidden: i,
|
|
47
|
-
component: (
|
|
48
|
-
|
|
48
|
+
component: (k) => /* @__PURE__ */ o(
|
|
49
|
+
E,
|
|
49
50
|
{
|
|
50
51
|
fields: n,
|
|
51
|
-
onDeleteFile:
|
|
52
|
+
onDeleteFile: s,
|
|
52
53
|
onUploadFile: m,
|
|
53
54
|
purpose: l,
|
|
54
|
-
i:
|
|
55
|
-
updatingValue:
|
|
56
|
-
backward:
|
|
57
|
-
forward:
|
|
55
|
+
i: F,
|
|
56
|
+
updatingValue: h,
|
|
57
|
+
backward: k.backward,
|
|
58
|
+
forward: k.forward,
|
|
58
59
|
wizard: c,
|
|
59
|
-
submitting:
|
|
60
|
+
submitting: p,
|
|
61
|
+
onValuesChange: a
|
|
60
62
|
},
|
|
61
|
-
|
|
63
|
+
F
|
|
62
64
|
)
|
|
63
65
|
})
|
|
64
66
|
)
|
|
65
67
|
}
|
|
66
68
|
);
|
|
67
69
|
}
|
|
68
|
-
function
|
|
70
|
+
function E({
|
|
69
71
|
fields: d,
|
|
70
|
-
onDeleteFile:
|
|
71
|
-
onUploadFile:
|
|
72
|
+
onDeleteFile: f,
|
|
73
|
+
onUploadFile: s,
|
|
72
74
|
purpose: m,
|
|
73
75
|
wizard: l = [],
|
|
74
76
|
i: e,
|
|
75
|
-
forward:
|
|
76
|
-
backward:
|
|
77
|
-
submitting:
|
|
78
|
-
updatingValue: a
|
|
77
|
+
forward: h,
|
|
78
|
+
backward: g,
|
|
79
|
+
submitting: p,
|
|
80
|
+
updatingValue: a,
|
|
81
|
+
onValuesChange: u
|
|
79
82
|
}) {
|
|
80
|
-
const c = l[e], { t } =
|
|
81
|
-
return
|
|
83
|
+
const c = l[e], { t } = z(), [r] = C.useForm();
|
|
84
|
+
return j(() => {
|
|
82
85
|
if (a && (m === "update" || m === "clone")) {
|
|
83
86
|
const n = {};
|
|
84
87
|
for (const i of d)
|
|
85
|
-
n[
|
|
88
|
+
n[b.getRealName(i.name, "upsertFieldName")] = a[b.getRealName(i.name, "upsertFieldName")];
|
|
86
89
|
r.setFieldsValue(n);
|
|
87
90
|
}
|
|
88
|
-
}, [d, r, m, a]), /* @__PURE__ */
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
91
|
+
}, [d, r, m, a]), /* @__PURE__ */ y(
|
|
92
|
+
C,
|
|
93
|
+
{
|
|
94
|
+
name: String(e),
|
|
95
|
+
form: r,
|
|
96
|
+
layout: "vertical",
|
|
97
|
+
onValuesChange: u,
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ o(
|
|
100
|
+
B,
|
|
101
|
+
{
|
|
102
|
+
fields: d,
|
|
103
|
+
formBuilder: c.formBuilder,
|
|
104
|
+
grid: c.grid,
|
|
105
|
+
onDeleteFile: f,
|
|
106
|
+
onUploadFile: s,
|
|
107
|
+
purpose: m
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ o(T, {}),
|
|
111
|
+
/* @__PURE__ */ y(W, { gutter: [8, 8], children: [
|
|
112
|
+
e > 0 && /* @__PURE__ */ o(S, { md: 12, children: /* @__PURE__ */ o(
|
|
113
|
+
N,
|
|
114
|
+
{
|
|
115
|
+
block: !0,
|
|
116
|
+
icon: /* @__PURE__ */ o(R, {}),
|
|
117
|
+
htmlType: "button",
|
|
118
|
+
type: "default",
|
|
119
|
+
size: "large",
|
|
120
|
+
onClick: () => g(),
|
|
121
|
+
children: t("str.back")
|
|
122
|
+
}
|
|
123
|
+
) }),
|
|
124
|
+
/* @__PURE__ */ o(S, { md: e > 0 ? 12 : 24, children: /* @__PURE__ */ o(
|
|
125
|
+
N,
|
|
126
|
+
{
|
|
127
|
+
block: !0,
|
|
128
|
+
icon: l.length - 1 === e ? /* @__PURE__ */ o(w, {}) : /* @__PURE__ */ o(x, {}),
|
|
129
|
+
htmlType: "submit",
|
|
130
|
+
type: "primary",
|
|
131
|
+
loading: p,
|
|
132
|
+
size: "large",
|
|
133
|
+
onClick: () => {
|
|
134
|
+
r.validateFields().then((n) => {
|
|
135
|
+
h(
|
|
136
|
+
n,
|
|
137
|
+
l.length - 1 === e,
|
|
138
|
+
l.length - 1 === e
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
children: l.length - 1 === e ? t("str." + (m === "update" ? "update" : "save")) : t("str.next")
|
|
143
|
+
}
|
|
144
|
+
) })
|
|
145
|
+
] })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
);
|
|
137
149
|
}
|
|
138
150
|
export {
|
|
139
|
-
|
|
151
|
+
I as default
|
|
140
152
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const g=require("react/jsx-runtime"),B=require("antd"),t=require("react"),
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),B=require("antd"),t=require("react"),J=require("../CrudForm.cjs.js"),K=require("../CrudFormWizard.cjs.js"),Q=require("../../locale/index.cjs.js"),I=require("../../util/CrudUtil.cjs.js"),X=require("dayjs"),Y=({fields:u,wizard:l,grid:M,fullWidthModal:T,isCreating:h,isUpdating:j,onCreate:b,onUpdate:v,idField:k="id",formBuilder:W,onValuesChange:q},_)=>{const[s]=B.Form.useForm(),{t:S}=Q.useTranslationLib(),[C,m]=t.useState(!1),[p,N]=t.useState("new"),[f,F]=t.useState(),[A,y]=t.useState(),[L,V]=t.useState(!1),[E,x]=t.useState(!1),[$,P]=t.useState(!1),R=t.useCallback(async c=>{var n;const d=l?c:await s.validateFields(),i=u.filter(a=>a.type==="color"),o={};for(const a of i){const e=I.getRealName(a.name,"upsertFieldName"),r=s.getFieldValue(e);o[e]=typeof r=="string"?r:(n=r==null?void 0:r.toHexString())==null?void 0:n.toUpperCase()}Object.assign(d,o),f&&v?(await v({...d,[k]:f[k]}),F(void 0)):!f&&b&&await b(d),y(void 0),s.resetFields(),m(!1)},[u,s,k,b,v,f,l]),U=t.useCallback(async c=>{V(c),x(!0)},[]),O=t.useCallback(async()=>{x(!0)},[]),D=t.useCallback(()=>{m(!0),N("new"),s.resetFields(),F(void 0),y(void 0)},[s]),H=t.useCallback(async(c,d=!0,i=!1)=>{try{P(!0),m(!0),N(i?"clone":"update");const o={};for(const n of u){const a=I.getRealName(n.name,"upsertFieldName"),e=c[a];if(i&&n.type==="image"){const r=e;try{const G=await n.provider.clone(r);o[a]=G;continue}catch{continue}}n.type==="date"||n.type==="time"?e&&(o[a]=X(e)):n.type==="select"?n.multiple&&Array.isArray(e)?o[a]=e.map(r=>r[n.innerFieldId??"id"]):e&&typeof e=="object"?o[a]=e[n.innerFieldId??"id"]:(e&&typeof e=="string"||typeof e=="number")&&(o[a]=e):o[a]=e}s.setFieldsValue(o),y(o),d&&F(c)}finally{P(!1)}},[u,s]);t.useImperativeHandle(_,()=>({create:D,update:H}),[D,H]),t.useEffect(()=>{C&&(V(!1),x(!1))},[C]);const w=t.useCallback(async()=>{try{if(p==="clone"){const c=l?f:s.getFieldsValue(),d=u.filter(i=>i.type==="image");for(const i of d)c[i.name]&&i.provider.delete(c[i.name])}}finally{}l||s.resetFields(),y(void 0),F(void 0),m(!1)},[p,l,s,f,u]);return g.jsx(B.Modal,{width:T?"100%":void 0,title:S(p??"new"),open:C,confirmLoading:h||j,okText:S("str."+(p==="update"?"update":"save")),cancelText:S("str.cancel"),cancelButtonProps:{disabled:E,hidden:!!l},okButtonProps:{disabled:L,hidden:!!l},onCancel:w,onOk:()=>R(),destroyOnHidden:!0,children:g.jsxs(B.Spin,{spinning:$,children:[l?null:g.jsx(J.CrudForm,{purpose:p,fields:u,form:s,formBuilder:W,grid:M,onDeleteFile:O,onUploadFile:U,onValuesChange:q}),l&&g.jsx(K,{submitting:h||j,className:"mt-2",onSave:R,updatingValue:A,fields:u,onDeleteFile:O,onUploadFile:U,purpose:p,wizard:l,onValuesChange:q})]})})},Z=t.forwardRef(Y);module.exports=Z;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FormProps } from 'antd';
|
|
1
2
|
import { Ref } from 'react';
|
|
2
3
|
import { CrudFieldProps, CrudWizardProp, FormBuilderFunc } from '../CrudComponent';
|
|
3
4
|
import { default as IdProps } from '../../types/Id';
|
|
@@ -12,12 +13,13 @@ export interface CrudModalProps<T, FormType> {
|
|
|
12
13
|
onUpdate?: (data: FormType & IdProps) => Promise<any>;
|
|
13
14
|
idField?: string;
|
|
14
15
|
formBuilder?: FormBuilderFunc<T>;
|
|
16
|
+
onValuesChange?: FormProps<T>["onValuesChange"];
|
|
15
17
|
}
|
|
16
18
|
export interface CrudModalRef<T> {
|
|
17
19
|
create: () => void;
|
|
18
20
|
update: (data: T, shouldSetUpdatingField?: boolean, isClone?: boolean) => Promise<void>;
|
|
19
21
|
}
|
|
20
|
-
declare const CrudModal: <T, FormType = T>({ fields, wizard, grid, fullWidthModal, isCreating, isUpdating, onCreate, onUpdate, idField, formBuilder, }: CrudModalProps<T, FormType>, ref: Ref<CrudModalRef<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare const CrudModal: <T, FormType = T>({ fields, wizard, grid, fullWidthModal, isCreating, isUpdating, onCreate, onUpdate, idField, formBuilder, onValuesChange, }: CrudModalProps<T, FormType>, ref: Ref<CrudModalRef<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
declare const _default: <T, FormType = T>(props: CrudModalProps<T, FormType> & {
|
|
22
24
|
ref?: Ref<CrudModalRef<T>>;
|
|
23
25
|
}) => ReturnType<typeof CrudModal>;
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Form as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { CrudForm as
|
|
5
|
-
import
|
|
6
|
-
import { useTranslationLib as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsx as S, jsxs as J } from "react/jsx-runtime";
|
|
2
|
+
import { Form as K, Modal as Q, Spin as X } from "antd";
|
|
3
|
+
import { forwardRef as Y, useState as u, useCallback as m, useImperativeHandle as Z, useEffect as z } from "react";
|
|
4
|
+
import { CrudForm as ee } from "../CrudForm.es.js";
|
|
5
|
+
import te from "../CrudFormWizard.es.js";
|
|
6
|
+
import { useTranslationLib as oe } from "../../locale/index.es.js";
|
|
7
|
+
import R from "../../util/CrudUtil.es.js";
|
|
8
|
+
import ne from "dayjs";
|
|
9
|
+
const se = ({
|
|
10
10
|
fields: c,
|
|
11
11
|
wizard: l,
|
|
12
|
-
grid:
|
|
13
|
-
fullWidthModal:
|
|
14
|
-
isCreating:
|
|
15
|
-
isUpdating:
|
|
12
|
+
grid: T,
|
|
13
|
+
fullWidthModal: W,
|
|
14
|
+
isCreating: x,
|
|
15
|
+
isUpdating: C,
|
|
16
16
|
onCreate: v,
|
|
17
17
|
onUpdate: b,
|
|
18
18
|
idField: B = "id",
|
|
19
|
-
formBuilder:
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
formBuilder: _,
|
|
20
|
+
onValuesChange: V
|
|
21
|
+
}, A) => {
|
|
22
|
+
const [t] = K.useForm(), { t: h } = oe(), [k, F] = u(!1), [p, j] = u("new"), [f, y] = u(), [L, g] = u(), [E, P] = u(!1), [$, N] = u(!1), [q, U] = u(!1), O = m(
|
|
22
23
|
async (i) => {
|
|
23
24
|
var o;
|
|
24
25
|
const d = l ? i : await t.validateFields(), a = c.filter((s) => s.type === "color"), n = {};
|
|
25
26
|
for (const s of a) {
|
|
26
|
-
const e =
|
|
27
|
+
const e = R.getRealName(s.name, "upsertFieldName"), r = t.getFieldValue(e);
|
|
27
28
|
n[e] = typeof r == "string" ? r : (o = r == null ? void 0 : r.toHexString()) == null ? void 0 : o.toUpperCase();
|
|
28
29
|
}
|
|
29
30
|
Object.assign(d, n), f && b ? (await b({
|
|
@@ -32,54 +33,54 @@ const ne = ({
|
|
|
32
33
|
}), y(void 0)) : !f && v && await v(d), g(void 0), t.resetFields(), F(!1);
|
|
33
34
|
},
|
|
34
35
|
[c, t, B, v, b, f, l]
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
}, []),
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
F(!0),
|
|
41
|
-
}, [t]),
|
|
36
|
+
), D = m(async (i) => {
|
|
37
|
+
P(i), N(!0);
|
|
38
|
+
}, []), H = m(async () => {
|
|
39
|
+
N(!0);
|
|
40
|
+
}, []), I = m(() => {
|
|
41
|
+
F(!0), j("new"), t.resetFields(), y(void 0), g(void 0);
|
|
42
|
+
}, [t]), M = m(
|
|
42
43
|
async (i, d = !0, a = !1) => {
|
|
43
44
|
try {
|
|
44
|
-
|
|
45
|
+
U(!0), F(!0), j(a ? "clone" : "update");
|
|
45
46
|
const n = {};
|
|
46
47
|
for (const o of c) {
|
|
47
|
-
const s =
|
|
48
|
+
const s = R.getRealName(
|
|
48
49
|
o.name,
|
|
49
50
|
"upsertFieldName"
|
|
50
51
|
), e = i[s];
|
|
51
52
|
if (a && o.type === "image") {
|
|
52
53
|
const r = e;
|
|
53
54
|
try {
|
|
54
|
-
const
|
|
55
|
-
n[s] =
|
|
55
|
+
const G = await o.provider.clone(r);
|
|
56
|
+
n[s] = G;
|
|
56
57
|
continue;
|
|
57
58
|
} catch {
|
|
58
59
|
continue;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
o.type === "date" || o.type === "time" ? e && (n[s] =
|
|
62
|
+
o.type === "date" || o.type === "time" ? e && (n[s] = ne(e)) : o.type === "select" ? o.multiple && Array.isArray(e) ? n[s] = e.map(
|
|
62
63
|
(r) => r[o.innerFieldId ?? "id"]
|
|
63
64
|
) : e && typeof e == "object" ? n[s] = e[o.innerFieldId ?? "id"] : (e && typeof e == "string" || typeof e == "number") && (n[s] = e) : n[s] = e;
|
|
64
65
|
}
|
|
65
66
|
t.setFieldsValue(n), g(n), d && y(i);
|
|
66
67
|
} finally {
|
|
67
|
-
|
|
68
|
+
U(!1);
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
[c, t]
|
|
71
72
|
);
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
Z(
|
|
74
|
+
A,
|
|
74
75
|
() => ({
|
|
75
|
-
create:
|
|
76
|
-
update:
|
|
76
|
+
create: I,
|
|
77
|
+
update: M
|
|
77
78
|
}),
|
|
78
|
-
[
|
|
79
|
-
),
|
|
80
|
-
k && (
|
|
79
|
+
[I, M]
|
|
80
|
+
), z(() => {
|
|
81
|
+
k && (P(!1), N(!1));
|
|
81
82
|
}, [k]);
|
|
82
|
-
const
|
|
83
|
+
const w = m(async () => {
|
|
83
84
|
try {
|
|
84
85
|
if (p === "clone") {
|
|
85
86
|
const i = l ? f : t.getFieldsValue(), d = c.filter((a) => a.type === "image");
|
|
@@ -90,57 +91,59 @@ const ne = ({
|
|
|
90
91
|
}
|
|
91
92
|
l || t.resetFields(), g(void 0), y(void 0), F(!1);
|
|
92
93
|
}, [p, l, t, f, c]);
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
|
|
94
|
+
return /* @__PURE__ */ S(
|
|
95
|
+
Q,
|
|
95
96
|
{
|
|
96
|
-
width:
|
|
97
|
+
width: W ? "100%" : void 0,
|
|
97
98
|
title: h(p ?? "new"),
|
|
98
99
|
open: k,
|
|
99
|
-
confirmLoading:
|
|
100
|
+
confirmLoading: x || C,
|
|
100
101
|
okText: h("str." + (p === "update" ? "update" : "save")),
|
|
101
102
|
cancelText: h("str.cancel"),
|
|
102
103
|
cancelButtonProps: {
|
|
103
|
-
disabled:
|
|
104
|
+
disabled: $,
|
|
104
105
|
hidden: !!l
|
|
105
106
|
},
|
|
106
107
|
okButtonProps: {
|
|
107
|
-
disabled:
|
|
108
|
+
disabled: E,
|
|
108
109
|
hidden: !!l
|
|
109
110
|
},
|
|
110
|
-
onCancel:
|
|
111
|
-
onOk: () =>
|
|
111
|
+
onCancel: w,
|
|
112
|
+
onOk: () => O(),
|
|
112
113
|
destroyOnHidden: !0,
|
|
113
|
-
children: /* @__PURE__ */
|
|
114
|
-
l ? null : /* @__PURE__ */
|
|
115
|
-
|
|
114
|
+
children: /* @__PURE__ */ J(X, { spinning: q, children: [
|
|
115
|
+
l ? null : /* @__PURE__ */ S(
|
|
116
|
+
ee,
|
|
116
117
|
{
|
|
117
118
|
purpose: p,
|
|
118
119
|
fields: c,
|
|
119
120
|
form: t,
|
|
120
|
-
formBuilder:
|
|
121
|
-
grid:
|
|
122
|
-
onDeleteFile:
|
|
123
|
-
onUploadFile:
|
|
121
|
+
formBuilder: _,
|
|
122
|
+
grid: T,
|
|
123
|
+
onDeleteFile: H,
|
|
124
|
+
onUploadFile: D,
|
|
125
|
+
onValuesChange: V
|
|
124
126
|
}
|
|
125
127
|
),
|
|
126
|
-
l && /* @__PURE__ */
|
|
127
|
-
|
|
128
|
+
l && /* @__PURE__ */ S(
|
|
129
|
+
te,
|
|
128
130
|
{
|
|
129
|
-
submitting:
|
|
131
|
+
submitting: x || C,
|
|
130
132
|
className: "mt-2",
|
|
131
|
-
onSave:
|
|
132
|
-
updatingValue:
|
|
133
|
+
onSave: O,
|
|
134
|
+
updatingValue: L,
|
|
133
135
|
fields: c,
|
|
134
|
-
onDeleteFile:
|
|
135
|
-
onUploadFile:
|
|
136
|
+
onDeleteFile: H,
|
|
137
|
+
onUploadFile: D,
|
|
136
138
|
purpose: p,
|
|
137
|
-
wizard: l
|
|
139
|
+
wizard: l,
|
|
140
|
+
onValuesChange: V
|
|
138
141
|
}
|
|
139
142
|
)
|
|
140
143
|
] })
|
|
141
144
|
}
|
|
142
145
|
);
|
|
143
|
-
},
|
|
146
|
+
}, fe = Y(se);
|
|
144
147
|
export {
|
|
145
|
-
|
|
148
|
+
fe as default
|
|
146
149
|
};
|