@kingteza/crud-component 1.0.64 → 1.0.66
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/App.d.ts +126 -0
- package/crud/CrudComponent.cjs.js +1 -1
- package/crud/CrudComponent.es.js +96 -185
- package/crud/actions/index.cjs.js +1 -0
- package/crud/actions/index.d.ts +26 -0
- package/crud/actions/index.es.js +88 -0
- package/crud/index.d.ts +4 -0
- package/crud/modal/index.cjs.js +1 -0
- package/crud/modal/index.d.ts +24 -0
- package/crud/modal/index.es.js +146 -0
- package/crud/view/CrudDecListView.cjs.js +1 -1
- package/crud/view/CrudDecListView.d.ts +5 -4
- package/crud/view/CrudDecListView.es.js +39 -27
- package/crud/view/CrudViewer.cjs.js +1 -1
- package/crud/view/CrudViewer.d.ts +3 -16
- package/crud/view/CrudViewer.es.js +239 -273
- package/index.cjs.js +1 -1
- package/index.es.js +24 -20
- package/package.json +1 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx as N, jsxs as G } from "react/jsx-runtime";
|
|
2
|
+
import { Form as J, Modal as K, Spin as Q } from "antd";
|
|
3
|
+
import { forwardRef as X, useState as u, useCallback as m, useImperativeHandle as Y, useEffect as Z } from "react";
|
|
4
|
+
import { CrudForm as z } from "../CrudForm.es.js";
|
|
5
|
+
import ee from "../CrudFormWizard.es.js";
|
|
6
|
+
import { useTranslationLib as te } from "../../locale/index.es.js";
|
|
7
|
+
import M from "../../util/CrudUtil.es.js";
|
|
8
|
+
import oe from "dayjs";
|
|
9
|
+
const ne = ({
|
|
10
|
+
fields: c,
|
|
11
|
+
wizard: l,
|
|
12
|
+
grid: R,
|
|
13
|
+
fullWidthModal: T,
|
|
14
|
+
isCreating: S,
|
|
15
|
+
isUpdating: V,
|
|
16
|
+
onCreate: v,
|
|
17
|
+
onUpdate: b,
|
|
18
|
+
idField: B = "id",
|
|
19
|
+
formBuilder: W
|
|
20
|
+
}, _) => {
|
|
21
|
+
const [t] = J.useForm(), { t: h } = te(), [k, F] = u(!1), [p, x] = u("new"), [f, y] = u(), [A, g] = u(), [L, j] = u(!1), [E, C] = u(!1), [$, P] = u(!1), U = m(
|
|
22
|
+
async (i) => {
|
|
23
|
+
var o;
|
|
24
|
+
const d = l ? i : await t.validateFields(), a = c.filter((s) => s.type === "color"), n = {};
|
|
25
|
+
for (const s of a) {
|
|
26
|
+
const e = M.getRealName(s.name, "upsertFieldName"), r = t.getFieldValue(e);
|
|
27
|
+
n[e] = typeof r == "string" ? r : (o = r == null ? void 0 : r.toHexString()) == null ? void 0 : o.toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
Object.assign(d, n), f && b ? (await b({
|
|
30
|
+
...d,
|
|
31
|
+
[B]: f[B]
|
|
32
|
+
}), y(void 0)) : !f && v && await v(d), g(void 0), t.resetFields(), F(!1);
|
|
33
|
+
},
|
|
34
|
+
[c, t, B, v, b, f, l]
|
|
35
|
+
), O = m(async (i) => {
|
|
36
|
+
j(i), C(!0);
|
|
37
|
+
}, []), D = m(async () => {
|
|
38
|
+
C(!0);
|
|
39
|
+
}, []), H = m(() => {
|
|
40
|
+
F(!0), x("new"), t.resetFields(), y(void 0), g(void 0);
|
|
41
|
+
}, [t]), I = m(
|
|
42
|
+
async (i, d = !0, a = !1) => {
|
|
43
|
+
try {
|
|
44
|
+
P(!0), F(!0), x(a ? "clone" : "update");
|
|
45
|
+
const n = {};
|
|
46
|
+
for (const o of c) {
|
|
47
|
+
const s = M.getRealName(
|
|
48
|
+
o.name,
|
|
49
|
+
"upsertFieldName"
|
|
50
|
+
), e = i[s];
|
|
51
|
+
if (a && o.type === "image") {
|
|
52
|
+
const r = e;
|
|
53
|
+
try {
|
|
54
|
+
const w = await o.provider.clone(r);
|
|
55
|
+
n[s] = w;
|
|
56
|
+
continue;
|
|
57
|
+
} catch {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
o.type === "date" || o.type === "time" ? e && (n[s] = oe(e)) : o.type === "select" ? o.multiple && Array.isArray(e) ? n[s] = e.map(
|
|
62
|
+
(r) => r[o.innerFieldId ?? "id"]
|
|
63
|
+
) : 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
|
+
t.setFieldsValue(n), g(n), d && y(i);
|
|
66
|
+
} finally {
|
|
67
|
+
P(!1);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
[c, t]
|
|
71
|
+
);
|
|
72
|
+
Y(
|
|
73
|
+
_,
|
|
74
|
+
() => ({
|
|
75
|
+
create: H,
|
|
76
|
+
update: I
|
|
77
|
+
}),
|
|
78
|
+
[H, I]
|
|
79
|
+
), Z(() => {
|
|
80
|
+
k && (j(!1), C(!1));
|
|
81
|
+
}, [k]);
|
|
82
|
+
const q = m(async () => {
|
|
83
|
+
try {
|
|
84
|
+
if (p === "clone") {
|
|
85
|
+
const i = l ? f : t.getFieldsValue(), d = c.filter((a) => a.type === "image");
|
|
86
|
+
for (const a of d)
|
|
87
|
+
i[a.name] && a.provider.delete(i[a.name]);
|
|
88
|
+
}
|
|
89
|
+
} finally {
|
|
90
|
+
}
|
|
91
|
+
l || t.resetFields(), g(void 0), y(void 0), F(!1);
|
|
92
|
+
}, [p, l, t, f, c]);
|
|
93
|
+
return /* @__PURE__ */ N(
|
|
94
|
+
K,
|
|
95
|
+
{
|
|
96
|
+
width: T ? "100%" : void 0,
|
|
97
|
+
title: h(p ?? "new"),
|
|
98
|
+
open: k,
|
|
99
|
+
confirmLoading: S || V,
|
|
100
|
+
okText: h("str." + (p === "update" ? "update" : "save")),
|
|
101
|
+
cancelText: h("str.cancel"),
|
|
102
|
+
cancelButtonProps: {
|
|
103
|
+
disabled: E,
|
|
104
|
+
hidden: !!l
|
|
105
|
+
},
|
|
106
|
+
okButtonProps: {
|
|
107
|
+
disabled: L,
|
|
108
|
+
hidden: !!l
|
|
109
|
+
},
|
|
110
|
+
onCancel: q,
|
|
111
|
+
onOk: () => U(),
|
|
112
|
+
destroyOnHidden: !0,
|
|
113
|
+
children: /* @__PURE__ */ G(Q, { spinning: $, children: [
|
|
114
|
+
l ? null : /* @__PURE__ */ N(
|
|
115
|
+
z,
|
|
116
|
+
{
|
|
117
|
+
purpose: p,
|
|
118
|
+
fields: c,
|
|
119
|
+
form: t,
|
|
120
|
+
formBuilder: W,
|
|
121
|
+
grid: R,
|
|
122
|
+
onDeleteFile: D,
|
|
123
|
+
onUploadFile: O
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
l && /* @__PURE__ */ N(
|
|
127
|
+
ee,
|
|
128
|
+
{
|
|
129
|
+
submitting: S || V,
|
|
130
|
+
className: "mt-2",
|
|
131
|
+
onSave: U,
|
|
132
|
+
updatingValue: A,
|
|
133
|
+
fields: c,
|
|
134
|
+
onDeleteFile: D,
|
|
135
|
+
onUploadFile: O,
|
|
136
|
+
purpose: p,
|
|
137
|
+
wizard: l
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
] })
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}, pe = X(ne);
|
|
144
|
+
export {
|
|
145
|
+
pe as default
|
|
146
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),d=require("../../common/description/DescList.cjs.js"),j=require("react"),v=require("../../locale/index.cjs.js"),V=require("./CrudViewerUtil.cjs.js"),f=require("../../util/CrudUtil.cjs.js"),p=require("../actions/index.cjs.js");function w({className:m,fields:i,data:e,descListColumn:b={xs:1,md:3,sm:2,lg:4},layout:g,keepEmptyValues:q,inBuiltModalProps:u,...s}){const{t:o}=v.useTranslationLib(),x=j.useMemo(()=>{const l=i.filter(({hidden:r,hideInDescList:n})=>!r&&!n).map((r,n)=>{const C=f.getRealName(r.name);return{label:r.label,noFormatting:!0,value:V.getRendererValueCrudViewer(r)(e==null?void 0:e[C],e,n)}}),c=e?t.jsx(p,{data:e,...s,inBuiltModalProps:u?{...u,fields:i}:void 0}):void 0;return c&&l.push({label:o("str.action"),value:c}),l},[e,i,o,s]);return e?t.jsx(d,{keepEmptyValues:q,bordered:!0,column:b,className:m,layout:g,list:x}):t.jsx(t.Fragment,{})}exports.CrudDecListView=w;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { Breakpoint } from 'antd';
|
|
2
|
-
import { default as React } from 'react';
|
|
3
2
|
import { CrudFieldProps } from '../CrudComponent';
|
|
3
|
+
import { CrudActionsProps } from '../actions';
|
|
4
|
+
import { CrudModalProps } from '../modal';
|
|
4
5
|
export type DescListColumn = number | Partial<Record<Breakpoint, number>> | undefined;
|
|
5
|
-
export interface CrudDecListViewProps<T> {
|
|
6
|
+
export interface CrudDecListViewProps<T, FormType = T> extends Omit<CrudActionsProps<T, FormType>, "inBuiltModalProps"> {
|
|
6
7
|
fields: CrudFieldProps<T>[];
|
|
7
8
|
data: T | undefined;
|
|
8
9
|
className?: string;
|
|
9
10
|
descListColumn?: DescListColumn;
|
|
10
11
|
layout?: "horizontal" | "vertical";
|
|
11
|
-
action?: React.JSX.Element;
|
|
12
12
|
keepEmptyValues?: boolean;
|
|
13
|
+
inBuiltModalProps?: Omit<CrudModalProps<T, FormType>, "fields">;
|
|
13
14
|
}
|
|
14
|
-
export declare function CrudDecListView<T>({ className, fields, data, descListColumn, layout,
|
|
15
|
+
export declare function CrudDecListView<T, FormType = T>({ className, fields, data, descListColumn, layout, keepEmptyValues, inBuiltModalProps, ...crudActionsProps }: Readonly<CrudDecListViewProps<T, FormType>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,45 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import x from "../../common/description/DescList.es.js";
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useTranslationLib as
|
|
5
|
-
import { getRendererValueCrudViewer as
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import { useMemo as F } from "react";
|
|
4
|
+
import { useTranslationLib as L } from "../../locale/index.es.js";
|
|
5
|
+
import { getRendererValueCrudViewer as V } from "./CrudViewerUtil.es.js";
|
|
6
|
+
import w from "../../util/CrudUtil.es.js";
|
|
7
|
+
import D from "../actions/index.es.js";
|
|
8
|
+
function _({
|
|
9
|
+
className: p,
|
|
10
|
+
fields: o,
|
|
10
11
|
data: r,
|
|
11
|
-
descListColumn:
|
|
12
|
+
descListColumn: c = { xs: 1, md: 3, sm: 2, lg: 4 },
|
|
12
13
|
layout: f,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
keepEmptyValues: b,
|
|
15
|
+
inBuiltModalProps: m,
|
|
16
|
+
...n
|
|
15
17
|
}) {
|
|
16
|
-
const { t:
|
|
17
|
-
const l =
|
|
18
|
-
const
|
|
18
|
+
const { t: u } = L(), g = F(() => {
|
|
19
|
+
const l = o.filter(({ hidden: e, hideInDescList: t }) => !e && !t).map((e, t) => {
|
|
20
|
+
const C = w.getRealName(e.name);
|
|
19
21
|
return {
|
|
20
22
|
label: e.label,
|
|
21
23
|
noFormatting: !0,
|
|
22
|
-
value:
|
|
23
|
-
r == null ? void 0 : r[
|
|
24
|
+
value: V(e)(
|
|
25
|
+
r == null ? void 0 : r[C],
|
|
24
26
|
r,
|
|
25
|
-
|
|
27
|
+
t
|
|
26
28
|
)
|
|
27
29
|
};
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
}), s = r ? /* @__PURE__ */ i(
|
|
31
|
+
D,
|
|
32
|
+
{
|
|
33
|
+
data: r,
|
|
34
|
+
...n,
|
|
35
|
+
inBuiltModalProps: m ? { ...m, fields: o } : void 0
|
|
36
|
+
}
|
|
37
|
+
) : void 0;
|
|
38
|
+
return s && l.push({
|
|
39
|
+
label: u("str.action"),
|
|
40
|
+
value: s
|
|
41
|
+
}), l;
|
|
42
|
+
}, [r, o, u, n]);
|
|
43
|
+
return r ? /* @__PURE__ */ i(
|
|
32
44
|
x,
|
|
33
45
|
{
|
|
34
|
-
keepEmptyValues:
|
|
46
|
+
keepEmptyValues: b,
|
|
35
47
|
bordered: !0,
|
|
36
|
-
column:
|
|
37
|
-
className:
|
|
48
|
+
column: c,
|
|
49
|
+
className: p,
|
|
38
50
|
layout: f,
|
|
39
|
-
list:
|
|
51
|
+
list: g
|
|
40
52
|
}
|
|
41
|
-
) : /* @__PURE__ */
|
|
53
|
+
) : /* @__PURE__ */ i(v, {});
|
|
42
54
|
}
|
|
43
55
|
export {
|
|
44
|
-
|
|
56
|
+
_ as CrudDecListView
|
|
45
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),xt=require("antd"),ft=require("@dnd-kit/core"),jt=require("@dnd-kit/modifiers"),yt=require("@dnd-kit/utilities"),d=require("@dnd-kit/sortable"),ht=require("../../common/button/Button.cjs.js"),qt=require("../../common/button/RefreshButton.cjs.js"),Ct=require("../../common/button/ViewButtonTable.cjs.js"),St=require("../actions/index.cjs.js"),It=require("../../common/table/table.cjs.js"),r=require("react"),lt=require("../../locale/index.cjs.js"),Rt=require("../CrudSearchComponent.cjs.js"),Mt=require("./CrudDecListView.cjs.js"),tt=require("./CrudViewerUtil.cjs.js"),dt=require("@ant-design/icons"),et=require("../../util/CrudUtil.cjs.js"),Tt=require("../../common/layout/VerticalSpace.cjs.js"),Bt=r.memo(It);function Dt({idField:n="id",loadingData:h,fields:m,isDeleting:T,isHiding:l,viewable:c=!1,paginateProps:j,onDelete:q,onHide:B,onUpdate:C,data:S=[],extraAction:D,onClickUpdate:V,minusHeight:E,scroll:k,onClickClone:v,className:z,expandable:$,size:p,bordered:A,descListColumn:ot,extraView:L,decListLayout:st,scrollToTop:Et,onClickRefresh:_,closeViewOnClickUpdate:G,onExport:J,confirmHiding:K,confirmDeleting:Q,rowClassName:X,actionWidth:Y=190,draggable:t,...rt}){const{t:Z}=lt.useTranslationLib(),P=r.useMemo(()=>m.map(({hideInTable:o,hidden:s,width:u,label:x,halign:I,...M})=>{const N=et.getRealName(M.name);return{title:x,width:u,key:N,dataIndex:N,hidden:o||s,align:I??(M.type==="number"?"right":void 0),render:tt.getRendererValueCrudViewer(M)}}),[m]),[i,R]=r.useState(),[W,H]=r.useState(),[y,U]=r.useState([]);r.useEffect(()=>{S&&U(S)},[S]),r.useEffect(()=>{S&&R(o=>{if(o)return S.find(s=>s[n]===o[n])})},[S,n,i]);const w=r.useCallback(o=>{var x;const{active:s,over:u}=o;if(t!=null&&t.onDragEnd&&(t==null||t.onDragEnd(o)),s.id!==(u==null?void 0:u.id)){const I=y.findIndex(f=>f[n]===s.id),M=y.findIndex(f=>f[n]===(u==null?void 0:u.id)),N=d.arrayMove(y,I,M);U(f=>{const it=f.findIndex(O=>O[n]===(s==null?void 0:s.id)),mt=f.findIndex(O=>O[n]===(u==null?void 0:u.id));return d.arrayMove(f,it,mt)}),(x=t==null?void 0:t.onDrag)==null||x.call(t,{newOrder:N.map(f=>f[n])})}},[y,n,t]),ct=r.useMemo(()=>{let o=typeof c=="string"?i==null?void 0:i[c]:void 0;if(typeof o=="object"){const s=m.find(u=>et.getRealName(u.name)===c);o=tt.getRendererValueCrudViewer(s)(o,i,0)}return o},[c,i,m]),a=r.useMemo(()=>({rowClassName:X,className:z,scroll:k??(E?{y:`calc(100vh - ${E})`}:void 0),id:"crud-table",bordered:A,size:p,expandable:$}),[X,z,k,E,A,p,$]),F=r.useMemo(()=>j?{total:j.count,onChange:j.setPage,current:j.page,pageSize:j.pageSize}:void 0,[j]),b=r.useMemo(()=>{const o=C||V||q||D||c,s=[];return t&&s.push({key:"key",align:"center",width:5,title:t==null?void 0:t.columnLabel,render:()=>e.jsx(Vt,{tooltip:t==null?void 0:t.tooltip})}),s.push(...P),o&&o&&s.push({title:Z("str.action"),fixed:"right",width:Y,render:(u,x)=>e.jsxs(e.Fragment,{children:[c&&e.jsx(Ct,{value:x,onClick:typeof c=="object"?()=>{var I;return(I=c.onClick)==null?void 0:I.call(c,x)}:R}),e.jsx(St,{data:x,idField:n,extraAction:D,onUpdate:C,onClickUpdate:V,onClickClone:v,onDelete:q,onHide:B,onExport:J,isHiding:l,isDeleting:T,confirmHiding:K,confirmDeleting:Q,closeViewOnClickUpdate:G,recentUpdateOrDeleteId:W,setRecentUpdateOrDeleteId:H,setOpenView:R})]})}),s},[P,C,V,q,D,c,Z,Y]),g=r.useMemo(()=>y.map(o=>o[n]),[y,n]),ut=r.useCallback(()=>{const o=e.jsx(Bt,{...a,dataSource:y,loading:h,components:t?{body:{row:Nt}}:void 0,pagination:F,columns:b});return t?e.jsx(ft.DndContext,{modifiers:[jt.restrictToVerticalAxis],onDragEnd:w,children:e.jsx(d.SortableContext,{items:g,strategy:d.verticalListSortingStrategy,children:o})}):o},[a,y,h,F,b,t,g,w]);return e.jsxs("div",{children:[typeof c=="boolean"||typeof c=="string"&&e.jsx(xt.Modal,{width:"100%",open:!!i,title:ct??e.jsx("div",{children:" "}),footer:e.jsx(e.Fragment,{}),closable:!0,onCancel:()=>R(void 0),children:!!i&&e.jsxs("div",{children:[e.jsx(Mt.CrudDecListView,{layout:st,descListColumn:ot,data:i,fields:m,idField:n,extraAction:D,onUpdate:C,onClickUpdate:V,onClickClone:v,onDelete:q,onHide:B,onExport:J,isHiding:l,isDeleting:T,confirmHiding:K,confirmDeleting:Q,closeViewOnClickUpdate:G,recentUpdateOrDeleteId:W,setRecentUpdateOrDeleteId:H,setOpenView:R}),L==null?void 0:L(i)]},i==null?void 0:i[n])}),e.jsx(Rt,{fields:m,...rt}),e.jsxs(Tt,{children:[!!_&&e.jsx(qt.RefreshButton,{onClick:_}),ut()]})]})}const nt=r.createContext({}),Vt=({tooltip:n})=>{const{setActivatorNodeRef:h,listeners:m}=r.useContext(nt);return e.jsx(ht,{type:"text",size:"small",tooltip:n,icon:e.jsx(dt.HolderOutlined,{}),style:{cursor:"move",border:"none"},ref:h,...m})},Nt=n=>{const{attributes:h,listeners:m,setNodeRef:T,setActivatorNodeRef:l,transform:c,transition:j,isDragging:q}=d.useSortable({id:n["data-row-key"]}),B={...n.style,transform:yt.CSS.Translate.toString(c),transition:j,...q?{position:"relative",zIndex:9999}:{}},C=r.useMemo(()=>({setActivatorNodeRef:l,listeners:m}),[l,m]);return e.jsx(nt.Provider,{value:C,children:e.jsx("tr",{...n,ref:T,style:B,...h})})};module.exports=Dt;
|
|
@@ -2,8 +2,8 @@ import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
|
2
2
|
import { ExpandableConfig } from 'antd/es/table/interface';
|
|
3
3
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
4
4
|
import { TableProps } from 'antd/lib';
|
|
5
|
-
import {
|
|
6
|
-
import { default as
|
|
5
|
+
import { CrudActionsProps } from '../actions';
|
|
6
|
+
import { default as React } from 'react';
|
|
7
7
|
import { CrudFieldProps, CrudPaginateProps } from '../CrudComponent';
|
|
8
8
|
import { CrudSearchComponentProps } from '../CrudSearchComponent';
|
|
9
9
|
import { DescListColumn } from './CrudDecListView';
|
|
@@ -23,26 +23,13 @@ export type CrudViewerProps<T, FormType> = {
|
|
|
23
23
|
decListLayout?: "horizontal" | "vertical";
|
|
24
24
|
viewable?: CrudViewableProps<T>;
|
|
25
25
|
paginateProps?: CrudPaginateProps;
|
|
26
|
-
onDelete?: (id: any) => Promise<any>;
|
|
27
|
-
confirmDeleting?: boolean;
|
|
28
|
-
confirmHiding?: boolean;
|
|
29
|
-
onHide?: (id: any) => Promise<any>;
|
|
30
|
-
onUpdate?: (t: FormType & IdProps) => Promise<any>;
|
|
31
|
-
onExport?: (t: T) => Promise<any>;
|
|
32
26
|
data: T[] | undefined;
|
|
33
|
-
extraAction?: (t: T) => ReactElement | undefined | ReactElement[];
|
|
34
|
-
onClickUpdate?: (t: T) => void;
|
|
35
|
-
closeViewOnClickUpdate?: boolean;
|
|
36
|
-
isHiding?: boolean;
|
|
37
|
-
isDeleting?: boolean;
|
|
38
|
-
idField?: string;
|
|
39
27
|
loadingData?: boolean;
|
|
40
28
|
minusHeight?: string;
|
|
41
29
|
scroll?: TableProps<T>["scroll"];
|
|
42
30
|
className?: string;
|
|
43
31
|
bordered?: boolean;
|
|
44
32
|
size?: SizeType;
|
|
45
|
-
onClickClone?: (t: T) => Promise<any>;
|
|
46
33
|
onClickRefresh?: () => void;
|
|
47
34
|
expandable?: ExpandableConfig<T>;
|
|
48
35
|
descListColumn?: DescListColumn;
|
|
@@ -51,6 +38,6 @@ export type CrudViewerProps<T, FormType> = {
|
|
|
51
38
|
rowClassName?: TableProps<T>["rowClassName"];
|
|
52
39
|
actionWidth?: string | number;
|
|
53
40
|
draggable?: CrudDragableProps<T>;
|
|
54
|
-
} & CrudSearchComponentProps<T, FormType>;
|
|
41
|
+
} & CrudActionsProps<T, FormType> & CrudSearchComponentProps<T, FormType>;
|
|
55
42
|
declare function CrudViewer<T, FormType = T>({ idField, loadingData, fields, isDeleting, isHiding, viewable, paginateProps, onDelete, onHide, onUpdate, data, extraAction, onClickUpdate, minusHeight, scroll, onClickClone, className, expandable, size, bordered, descListColumn, extraView, decListLayout, scrollToTop, onClickRefresh, closeViewOnClickUpdate, onExport, confirmHiding, confirmDeleting, rowClassName, actionWidth, draggable, ...props }: CrudViewerProps<T, FormType>): import("react/jsx-runtime").JSX.Element;
|
|
56
43
|
export default CrudViewer;
|