@kingteza/crud-component 1.0.63 → 1.0.64
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/crud/CrudComponent.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { CrudSearchComponentProps } from './CrudSearchComponent';
|
|
|
7
7
|
import { FileCrudField } from './FileCrudField';
|
|
8
8
|
import { ImageCrudField } from './ImageCrudField';
|
|
9
9
|
import { CrudImportProps } from './import/CrudImportComponent';
|
|
10
|
-
import { CrudDragableProps } from './view/CrudViewer';
|
|
10
|
+
import { CrudDragableProps, CrudViewableProps } from './view/CrudViewer';
|
|
11
11
|
import { SelectTagRenderProps } from '../common/select/SelectComponent';
|
|
12
12
|
import { default as IdProps } from '../types/Id';
|
|
13
13
|
import { TextAreaBasedFieldProps } from './CrudTextAreaComponent';
|
|
@@ -226,7 +226,7 @@ export type CrudComponentProps<T, FormType = T> = {
|
|
|
226
226
|
isHiding?: boolean;
|
|
227
227
|
isDeleting?: boolean;
|
|
228
228
|
isUpdating?: boolean;
|
|
229
|
-
viewable?:
|
|
229
|
+
viewable?: CrudViewableProps<T>;
|
|
230
230
|
extraAction?: (t: T) => ReactElement;
|
|
231
231
|
paginateProps?: CrudPaginateProps;
|
|
232
232
|
formBuilder?: FormBuilderFunc<T>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),xt=require("antd"),jt=require("@dnd-kit/core"),
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),xt=require("antd"),jt=require("@dnd-kit/core"),yt=require("@dnd-kit/modifiers"),ht=require("@dnd-kit/utilities"),V=require("@dnd-kit/sortable"),qt=require("../../common/button/Button.cjs.js"),lt=require("../../common/button/CloneButtonTable.cjs.js"),Ct=require("../../common/button/DeleteButtonTable.cjs.js"),St=require("../../common/button/ExportButton.cjs.js"),Bt=require("../../common/button/HideButtonTable.cjs.js"),It=require("../../common/button/RefreshButton.cjs.js"),Tt=require("../../common/button/UpdateButtonTable.cjs.js"),Rt=require("../../common/button/ViewButtonTable.cjs.js"),Mt=require("../../common/table/table.cjs.js"),u=require("react"),vt=require("../../locale/index.cjs.js"),Vt=require("../CrudSearchComponent.cjs.js"),Et=require("./CrudDecListView.cjs.js"),et=require("./CrudViewerUtil.cjs.js"),Nt=require("@ant-design/icons"),nt=require("../../util/CrudUtil.cjs.js"),Dt=require("../../common/layout/VerticalSpace.cjs.js"),Lt=u.memo(Mt);function Ot({idField:e="id",loadingData:C,fields:f,isDeleting:R,isHiding:S,viewable:i=!1,paginateProps:j,onDelete:y,onHide:M,onUpdate:l,data:B=[],extraAction:I,onClickUpdate:h,minusHeight:L,scroll:J,onClickClone:E,className:K,expandable:Q,size:X,bordered:Y,descListColumn:ot,extraView:O,decListLayout:rt,scrollToTop:_t,onClickRefresh:Z,closeViewOnClickUpdate:A,onExport:z,confirmHiding:P,confirmDeleting:W,rowClassName:w,actionWidth:p=190,draggable:o,...ut}){const{t:H}=vt.useTranslationLib(),U=u.useMemo(()=>f.map(({hideInTable:t,hidden:s,width:c,label:r,halign:T,...v})=>{const D=nt.getRealName(v.name);return{title:r,width:c,key:D,dataIndex:D,hidden:t||s,align:T??(v.type==="number"?"right":void 0),render:et.getRendererValueCrudViewer(v)}}),[f]),[m,N]=u.useState(),[k,_]=u.useState(),[q,a]=u.useState([]);u.useEffect(()=>{B&&a(B)},[B]),u.useEffect(()=>{B&&N(t=>{if(t)return B.find(s=>s[e]===t[e])})},[B,e,m]);const $=u.useCallback(t=>{var c;const s=I==null?void 0:I(t);return(Array.isArray(s)?(c=s==null?void 0:s.filter(Boolean))!=null&&c.length:s)||l||h||E||y?n.jsxs(n.Fragment,{children:[s,(l||h)&&n.jsx(Tt,{value:t,onClick:r=>{_(r[e]),h==null||h(t),A&&N(void 0)}}),E&&n.jsx(lt,{value:t,onClick:r=>E(r)}),z&&n.jsx(St.ExportButton,{value:t,onClick:async r=>await z(r)}),M&&n.jsx(Bt,{value:t,disabled:S,shouldConfirm:P,loading:S&&t[e]===k,onClick:async r=>{_(r[e]),await M({[e]:r[e]})}}),y&&n.jsx(Ct,{value:t,disabled:R,shouldConfirm:W,loading:R&&t[e]===k,onClick:async r=>{_(r[e]),await y({[e]:r[e]})}})]}):void 0},[A,W,P,I,e,R,S,E,h,y,z,M,l,k]),d=u.useCallback(t=>{var r;const{active:s,over:c}=t;if(o!=null&&o.onDragEnd&&(o==null||o.onDragEnd(t)),s.id!==(c==null?void 0:c.id)){const T=q.findIndex(x=>x[e]===s.id),v=q.findIndex(x=>x[e]===(c==null?void 0:c.id)),D=V.arrayMove(q,T,v);a(x=>{const mt=x.findIndex(G=>G[e]===(s==null?void 0:s.id)),ft=x.findIndex(G=>G[e]===(c==null?void 0:c.id));return V.arrayMove(x,mt,ft)}),(r=o==null?void 0:o.onDrag)==null||r.call(o,{newOrder:D.map(x=>x[e])})}},[q,e,o]),ct=u.useMemo(()=>{let t=typeof i=="string"?m==null?void 0:m[i]:void 0;if(typeof t=="object"){const s=f.find(c=>nt.getRealName(c.name)===i);t=et.getRendererValueCrudViewer(s)(t,m,0)}return t},[i,m,f]),b=u.useMemo(()=>({rowClassName:w,className:K,scroll:J??(L?{y:`calc(100vh - ${L})`}:void 0),id:"crud-table",bordered:Y,size:X,expandable:Q}),[w,K,J,L,Y,X,Q]),F=u.useMemo(()=>j?{total:j.count,onChange:j.setPage,current:j.page,pageSize:j.pageSize}:void 0,[j]),g=u.useMemo(()=>{const t=l||h||y||I||i,s=[];return o&&s.push({key:"key",align:"center",width:5,title:o==null?void 0:o.columnLabel,render:()=>n.jsx(zt,{tooltip:o==null?void 0:o.tooltip})}),s.push(...U),t&&t&&s.push({title:H("str.action"),fixed:"right",width:p,render:(c,r)=>n.jsxs(n.Fragment,{children:[i&&n.jsx(Rt,{value:r,onClick:typeof i=="object"?()=>{var T;return(T=i.onClick)==null?void 0:T.call(i,r)}:N}),$(r)]})}),s},[U,l,h,y,I,i,H,p,$]),tt=u.useMemo(()=>q.map(t=>t[e]),[q,e]),it=u.useCallback(()=>{const t=n.jsx(Lt,{...b,dataSource:q,loading:C,components:o?{body:{row:kt}}:void 0,pagination:F,columns:g});return o?n.jsx(jt.DndContext,{modifiers:[yt.restrictToVerticalAxis],onDragEnd:d,children:n.jsx(V.SortableContext,{items:tt,strategy:V.verticalListSortingStrategy,children:t})}):t},[b,q,C,F,g,o,tt,d]);return n.jsxs("div",{children:[typeof i=="boolean"||typeof i=="string"&&n.jsx(xt.Modal,{width:"100%",open:!!m,title:ct??n.jsx("div",{children:" "}),footer:n.jsx(n.Fragment,{}),closable:!0,onCancel:()=>N(void 0),children:!!m&&n.jsxs("div",{children:[n.jsx(Et.CrudDecListView,{layout:rt,descListColumn:ot,data:m,fields:f,action:$(m)}),O==null?void 0:O(m)]},m==null?void 0:m[e])}),n.jsx(Vt,{fields:f,...ut}),n.jsxs(Dt,{children:[!!Z&&n.jsx(It.RefreshButton,{onClick:Z}),it()]})]})}const st=u.createContext({}),zt=({tooltip:e})=>{const{setActivatorNodeRef:C,listeners:f}=u.useContext(st);return n.jsx(qt,{type:"text",size:"small",tooltip:e,icon:n.jsx(Nt.HolderOutlined,{}),style:{cursor:"move",border:"none"},ref:C,...f})},kt=e=>{const{attributes:C,listeners:f,setNodeRef:R,setActivatorNodeRef:S,transform:i,transition:j,isDragging:y}=V.useSortable({id:e["data-row-key"]}),M={...e.style,transform:ht.CSS.Translate.toString(i),transition:j,...y?{position:"relative",zIndex:9999}:{}},l=u.useMemo(()=>({setActivatorNodeRef:S,listeners:f}),[S,f]);return n.jsx(st.Provider,{value:l,children:n.jsx("tr",{...e,ref:R,style:M,...C})})};module.exports=Ot;
|
|
@@ -15,10 +15,13 @@ export type CrudDragableProps<T> = {
|
|
|
15
15
|
columnLabel?: string;
|
|
16
16
|
tooltip?: string;
|
|
17
17
|
};
|
|
18
|
+
export type CrudViewableProps<T> = boolean | keyof T | {
|
|
19
|
+
onClick: (t: T) => void;
|
|
20
|
+
};
|
|
18
21
|
export type CrudViewerProps<T, FormType> = {
|
|
19
22
|
fields: CrudFieldProps<T>[];
|
|
20
23
|
decListLayout?: "horizontal" | "vertical";
|
|
21
|
-
viewable?:
|
|
24
|
+
viewable?: CrudViewableProps<T>;
|
|
22
25
|
paginateProps?: CrudPaginateProps;
|
|
23
26
|
onDelete?: (id: any) => Promise<any>;
|
|
24
27
|
confirmDeleting?: boolean;
|
|
@@ -1,131 +1,129 @@
|
|
|
1
|
-
import { jsxs as D, Fragment as
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { DndContext as
|
|
4
|
-
import { restrictToVerticalAxis as
|
|
5
|
-
import { CSS as
|
|
6
|
-
import { arrayMove as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { ExportButton as
|
|
11
|
-
import
|
|
12
|
-
import { RefreshButton as
|
|
1
|
+
import { jsxs as D, Fragment as J, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as St } from "antd";
|
|
3
|
+
import { DndContext as Bt } from "@dnd-kit/core";
|
|
4
|
+
import { restrictToVerticalAxis as Ct } from "@dnd-kit/modifiers";
|
|
5
|
+
import { CSS as Rt } from "@dnd-kit/utilities";
|
|
6
|
+
import { arrayMove as st, SortableContext as vt, verticalListSortingStrategy as xt, useSortable as Nt } from "@dnd-kit/sortable";
|
|
7
|
+
import jt from "../../common/button/Button.es.js";
|
|
8
|
+
import Dt from "../../common/button/CloneButtonTable.es.js";
|
|
9
|
+
import Et from "../../common/button/DeleteButtonTable.es.js";
|
|
10
|
+
import { ExportButton as Lt } from "../../common/button/ExportButton.es.js";
|
|
11
|
+
import Mt from "../../common/button/HideButtonTable.es.js";
|
|
12
|
+
import { RefreshButton as Ot } from "../../common/button/RefreshButton.es.js";
|
|
13
13
|
import zt from "../../common/button/UpdateButtonTable.es.js";
|
|
14
14
|
import Vt from "../../common/button/ViewButtonTable.es.js";
|
|
15
|
-
import
|
|
16
|
-
import ut, { useMemo as
|
|
17
|
-
import { useTranslationLib as
|
|
18
|
-
import
|
|
19
|
-
import { CrudDecListView as
|
|
20
|
-
import { getRendererValueCrudViewer as
|
|
21
|
-
import { HolderOutlined as
|
|
15
|
+
import _t from "../../common/table/table.es.js";
|
|
16
|
+
import ut, { useMemo as I, useState as K, useEffect as mt, useCallback as Q, useContext as $t } from "react";
|
|
17
|
+
import { useTranslationLib as qt } from "../../locale/index.es.js";
|
|
18
|
+
import Gt from "../CrudSearchComponent.es.js";
|
|
19
|
+
import { CrudDecListView as Jt } from "./CrudDecListView.es.js";
|
|
20
|
+
import { getRendererValueCrudViewer as et } from "./CrudViewerUtil.es.js";
|
|
21
|
+
import { HolderOutlined as Kt } from "@ant-design/icons";
|
|
22
22
|
import ct from "../../util/CrudUtil.es.js";
|
|
23
|
-
import
|
|
24
|
-
const
|
|
25
|
-
function
|
|
23
|
+
import Qt from "../../common/layout/VerticalSpace.es.js";
|
|
24
|
+
const Xt = ut.memo(_t);
|
|
25
|
+
function ho({
|
|
26
26
|
idField: o = "id",
|
|
27
|
-
loadingData:
|
|
28
|
-
fields:
|
|
29
|
-
isDeleting:
|
|
30
|
-
isHiding:
|
|
31
|
-
viewable:
|
|
32
|
-
paginateProps:
|
|
33
|
-
onDelete:
|
|
34
|
-
onHide:
|
|
35
|
-
onUpdate:
|
|
36
|
-
data:
|
|
37
|
-
extraAction:
|
|
38
|
-
onClickUpdate:
|
|
27
|
+
loadingData: S,
|
|
28
|
+
fields: f,
|
|
29
|
+
isDeleting: x,
|
|
30
|
+
isHiding: B,
|
|
31
|
+
viewable: c = !1,
|
|
32
|
+
paginateProps: y,
|
|
33
|
+
onDelete: h,
|
|
34
|
+
onHide: N,
|
|
35
|
+
onUpdate: l,
|
|
36
|
+
data: C = [],
|
|
37
|
+
extraAction: R,
|
|
38
|
+
onClickUpdate: p,
|
|
39
39
|
minusHeight: O,
|
|
40
|
-
scroll:
|
|
40
|
+
scroll: X,
|
|
41
41
|
onClickClone: E,
|
|
42
|
-
className:
|
|
43
|
-
expandable:
|
|
44
|
-
size:
|
|
42
|
+
className: Y,
|
|
43
|
+
expandable: Z,
|
|
44
|
+
size: k,
|
|
45
45
|
bordered: A,
|
|
46
46
|
descListColumn: it,
|
|
47
|
-
extraView:
|
|
48
|
-
decListLayout:
|
|
49
|
-
scrollToTop:
|
|
47
|
+
extraView: z,
|
|
48
|
+
decListLayout: yt,
|
|
49
|
+
scrollToTop: kt,
|
|
50
50
|
onClickRefresh: P,
|
|
51
51
|
closeViewOnClickUpdate: W,
|
|
52
|
-
onExport:
|
|
53
|
-
confirmHiding:
|
|
54
|
-
confirmDeleting:
|
|
52
|
+
onExport: V,
|
|
53
|
+
confirmHiding: H,
|
|
54
|
+
confirmDeleting: w,
|
|
55
55
|
rowClassName: U,
|
|
56
|
-
actionWidth:
|
|
56
|
+
actionWidth: d = 190,
|
|
57
57
|
draggable: r,
|
|
58
|
-
...
|
|
58
|
+
...ht
|
|
59
59
|
}) {
|
|
60
|
-
const { t:
|
|
61
|
-
() =>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, [B]), st(() => {
|
|
80
|
-
B && L((t) => {
|
|
60
|
+
const { t: F } = qt(), a = I(
|
|
61
|
+
() => f.map(({ hideInTable: t, hidden: n, width: e, label: s, halign: v, ...j }) => {
|
|
62
|
+
const M = ct.getRealName(j.name);
|
|
63
|
+
return {
|
|
64
|
+
title: s,
|
|
65
|
+
width: e,
|
|
66
|
+
key: M,
|
|
67
|
+
dataIndex: M,
|
|
68
|
+
hidden: t || n,
|
|
69
|
+
align: v ?? (j.type === "number" ? "right" : void 0),
|
|
70
|
+
render: et(j)
|
|
71
|
+
};
|
|
72
|
+
}),
|
|
73
|
+
[f]
|
|
74
|
+
), [u, L] = K(), [_, $] = K(), [T, b] = K([]);
|
|
75
|
+
mt(() => {
|
|
76
|
+
C && b(C);
|
|
77
|
+
}, [C]), mt(() => {
|
|
78
|
+
C && L((t) => {
|
|
81
79
|
if (t)
|
|
82
|
-
return
|
|
80
|
+
return C.find((n) => n[o] === t[o]);
|
|
83
81
|
});
|
|
84
|
-
}, [
|
|
85
|
-
const
|
|
82
|
+
}, [C, o, u]);
|
|
83
|
+
const q = Q(
|
|
86
84
|
(t) => {
|
|
87
|
-
var
|
|
88
|
-
const n =
|
|
89
|
-
return (Array.isArray(n) ? (
|
|
85
|
+
var e;
|
|
86
|
+
const n = R == null ? void 0 : R(t);
|
|
87
|
+
return (Array.isArray(n) ? (e = n == null ? void 0 : n.filter(Boolean)) != null && e.length : n) || l || p || E || h ? /* @__PURE__ */ D(J, { children: [
|
|
90
88
|
n,
|
|
91
|
-
(
|
|
89
|
+
(l || p) && /* @__PURE__ */ m(
|
|
92
90
|
zt,
|
|
93
91
|
{
|
|
94
92
|
value: t,
|
|
95
|
-
onClick: (
|
|
96
|
-
|
|
93
|
+
onClick: (s) => {
|
|
94
|
+
$(s[o]), p == null || p(t), W && L(void 0);
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
),
|
|
100
|
-
E && /* @__PURE__ */
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
E && /* @__PURE__ */ m(Dt, { value: t, onClick: (s) => E(s) }),
|
|
99
|
+
V && /* @__PURE__ */ m(
|
|
100
|
+
Lt,
|
|
103
101
|
{
|
|
104
102
|
value: t,
|
|
105
|
-
onClick: async (
|
|
103
|
+
onClick: async (s) => await V(s)
|
|
106
104
|
}
|
|
107
105
|
),
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
N && /* @__PURE__ */ m(
|
|
107
|
+
Mt,
|
|
110
108
|
{
|
|
111
109
|
value: t,
|
|
112
|
-
disabled:
|
|
113
|
-
shouldConfirm:
|
|
114
|
-
loading:
|
|
115
|
-
onClick: async (
|
|
116
|
-
|
|
110
|
+
disabled: B,
|
|
111
|
+
shouldConfirm: H,
|
|
112
|
+
loading: B && t[o] === _,
|
|
113
|
+
onClick: async (s) => {
|
|
114
|
+
$(s[o]), await N({ [o]: s[o] });
|
|
117
115
|
}
|
|
118
116
|
}
|
|
119
117
|
),
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
h && /* @__PURE__ */ m(
|
|
119
|
+
Et,
|
|
122
120
|
{
|
|
123
121
|
value: t,
|
|
124
|
-
disabled:
|
|
125
|
-
shouldConfirm:
|
|
126
|
-
loading:
|
|
127
|
-
onClick: async (
|
|
128
|
-
|
|
122
|
+
disabled: x,
|
|
123
|
+
shouldConfirm: w,
|
|
124
|
+
loading: x && t[o] === _,
|
|
125
|
+
onClick: async (s) => {
|
|
126
|
+
$(s[o]), await h({ [o]: s[o] });
|
|
129
127
|
}
|
|
130
128
|
}
|
|
131
129
|
)
|
|
@@ -133,117 +131,126 @@ function yo({
|
|
|
133
131
|
},
|
|
134
132
|
[
|
|
135
133
|
W,
|
|
134
|
+
w,
|
|
136
135
|
H,
|
|
137
|
-
k,
|
|
138
|
-
C,
|
|
139
|
-
o,
|
|
140
136
|
R,
|
|
141
|
-
|
|
137
|
+
o,
|
|
138
|
+
x,
|
|
139
|
+
B,
|
|
142
140
|
E,
|
|
141
|
+
p,
|
|
142
|
+
h,
|
|
143
|
+
V,
|
|
144
|
+
N,
|
|
143
145
|
l,
|
|
144
|
-
|
|
145
|
-
z,
|
|
146
|
-
x,
|
|
147
|
-
v,
|
|
148
|
-
V
|
|
146
|
+
_
|
|
149
147
|
]
|
|
150
|
-
), g =
|
|
148
|
+
), g = Q(
|
|
151
149
|
(t) => {
|
|
152
|
-
var
|
|
153
|
-
const { active: n, over:
|
|
154
|
-
if (r != null && r.onDragEnd && (r == null || r.onDragEnd(t)), n.id !== (
|
|
155
|
-
const
|
|
150
|
+
var s;
|
|
151
|
+
const { active: n, over: e } = t;
|
|
152
|
+
if (r != null && r.onDragEnd && (r == null || r.onDragEnd(t)), n.id !== (e == null ? void 0 : e.id)) {
|
|
153
|
+
const v = T.findIndex(
|
|
156
154
|
(i) => i[o] === n.id
|
|
157
|
-
),
|
|
158
|
-
(i) => i[o] === (
|
|
159
|
-
), M =
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
(
|
|
163
|
-
),
|
|
164
|
-
(
|
|
155
|
+
), j = T.findIndex(
|
|
156
|
+
(i) => i[o] === (e == null ? void 0 : e.id)
|
|
157
|
+
), M = st(T, v, j);
|
|
158
|
+
b((i) => {
|
|
159
|
+
const lt = i.findIndex(
|
|
160
|
+
(G) => G[o] === (n == null ? void 0 : n.id)
|
|
161
|
+
), It = i.findIndex(
|
|
162
|
+
(G) => G[o] === (e == null ? void 0 : e.id)
|
|
165
163
|
);
|
|
166
|
-
return
|
|
167
|
-
}), (
|
|
164
|
+
return st(i, lt, It);
|
|
165
|
+
}), (s = r == null ? void 0 : r.onDrag) == null || s.call(r, {
|
|
168
166
|
newOrder: M.map((i) => i[o])
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
169
|
},
|
|
172
|
-
[
|
|
173
|
-
),
|
|
174
|
-
let t = typeof
|
|
170
|
+
[T, o, r]
|
|
171
|
+
), pt = I(() => {
|
|
172
|
+
let t = typeof c == "string" ? u == null ? void 0 : u[c] : void 0;
|
|
175
173
|
if (typeof t == "object") {
|
|
176
|
-
const n =
|
|
177
|
-
t =
|
|
174
|
+
const n = f.find((e) => ct.getRealName(e.name) === c);
|
|
175
|
+
t = et(n)(
|
|
178
176
|
t,
|
|
179
|
-
|
|
177
|
+
u,
|
|
180
178
|
0
|
|
181
179
|
);
|
|
182
180
|
}
|
|
183
181
|
return t;
|
|
184
|
-
}, [
|
|
182
|
+
}, [c, u, f]), tt = I(
|
|
185
183
|
() => ({
|
|
186
184
|
rowClassName: U,
|
|
187
|
-
className:
|
|
188
|
-
scroll:
|
|
185
|
+
className: Y,
|
|
186
|
+
scroll: X ?? (O ? { y: `calc(100vh - ${O})` } : void 0),
|
|
189
187
|
id: "crud-table",
|
|
190
188
|
bordered: A,
|
|
191
|
-
size:
|
|
192
|
-
expandable:
|
|
189
|
+
size: k,
|
|
190
|
+
expandable: Z
|
|
193
191
|
}),
|
|
194
|
-
[U,
|
|
195
|
-
), ot =
|
|
196
|
-
() =>
|
|
197
|
-
total:
|
|
198
|
-
onChange:
|
|
199
|
-
current:
|
|
200
|
-
pageSize:
|
|
192
|
+
[U, Y, X, O, A, k, Z]
|
|
193
|
+
), ot = I(
|
|
194
|
+
() => y ? {
|
|
195
|
+
total: y.count,
|
|
196
|
+
onChange: y.setPage,
|
|
197
|
+
current: y.page,
|
|
198
|
+
pageSize: y.pageSize
|
|
201
199
|
} : void 0,
|
|
202
|
-
[
|
|
203
|
-
), nt =
|
|
204
|
-
const t =
|
|
200
|
+
[y]
|
|
201
|
+
), nt = I(() => {
|
|
202
|
+
const t = l || p || h || R || c, n = [];
|
|
205
203
|
return r && n.push({
|
|
206
204
|
key: "key",
|
|
207
205
|
align: "center",
|
|
208
206
|
width: 5,
|
|
209
207
|
title: r == null ? void 0 : r.columnLabel,
|
|
210
|
-
render: () => /* @__PURE__ */
|
|
211
|
-
}), n.push(...
|
|
212
|
-
title:
|
|
208
|
+
render: () => /* @__PURE__ */ m(Yt, { tooltip: r == null ? void 0 : r.tooltip })
|
|
209
|
+
}), n.push(...a), t && t && n.push({
|
|
210
|
+
title: F("str.action"),
|
|
213
211
|
fixed: "right",
|
|
214
|
-
width:
|
|
215
|
-
render: (
|
|
216
|
-
|
|
217
|
-
|
|
212
|
+
width: d,
|
|
213
|
+
render: (e, s) => /* @__PURE__ */ D(J, { children: [
|
|
214
|
+
c && /* @__PURE__ */ m(
|
|
215
|
+
Vt,
|
|
216
|
+
{
|
|
217
|
+
value: s,
|
|
218
|
+
onClick: typeof c == "object" ? () => {
|
|
219
|
+
var v;
|
|
220
|
+
return (v = c.onClick) == null ? void 0 : v.call(c, s);
|
|
221
|
+
} : L
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
q(s)
|
|
218
225
|
] })
|
|
219
226
|
}), n;
|
|
220
227
|
}, [
|
|
221
|
-
d,
|
|
222
|
-
v,
|
|
223
|
-
l,
|
|
224
|
-
y,
|
|
225
|
-
C,
|
|
226
|
-
f,
|
|
227
|
-
b,
|
|
228
228
|
a,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
229
|
+
l,
|
|
230
|
+
p,
|
|
231
|
+
h,
|
|
232
|
+
R,
|
|
233
|
+
c,
|
|
234
|
+
F,
|
|
235
|
+
d,
|
|
236
|
+
q
|
|
237
|
+
]), rt = I(
|
|
238
|
+
() => T.map((t) => t[o]),
|
|
239
|
+
[T, o]
|
|
240
|
+
), Tt = Q(() => {
|
|
241
|
+
const t = /* @__PURE__ */ m(
|
|
242
|
+
Xt,
|
|
236
243
|
{
|
|
237
244
|
...tt,
|
|
238
|
-
dataSource:
|
|
239
|
-
loading:
|
|
240
|
-
components: r ? { body: { row:
|
|
245
|
+
dataSource: T,
|
|
246
|
+
loading: S,
|
|
247
|
+
components: r ? { body: { row: Zt } } : void 0,
|
|
241
248
|
pagination: ot,
|
|
242
249
|
columns: nt
|
|
243
250
|
}
|
|
244
251
|
);
|
|
245
|
-
return r ? /* @__PURE__ */
|
|
246
|
-
|
|
252
|
+
return r ? /* @__PURE__ */ m(Bt, { modifiers: [Ct], onDragEnd: g, children: /* @__PURE__ */ m(
|
|
253
|
+
vt,
|
|
247
254
|
{
|
|
248
255
|
items: rt,
|
|
249
256
|
strategy: xt,
|
|
@@ -252,8 +259,8 @@ function yo({
|
|
|
252
259
|
) }) : t;
|
|
253
260
|
}, [
|
|
254
261
|
tt,
|
|
255
|
-
|
|
256
|
-
|
|
262
|
+
T,
|
|
263
|
+
S,
|
|
257
264
|
ot,
|
|
258
265
|
nt,
|
|
259
266
|
r,
|
|
@@ -261,71 +268,71 @@ function yo({
|
|
|
261
268
|
g
|
|
262
269
|
]);
|
|
263
270
|
return /* @__PURE__ */ D("div", { children: [
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
typeof c == "boolean" || typeof c == "string" && /* @__PURE__ */ m(
|
|
272
|
+
St,
|
|
266
273
|
{
|
|
267
274
|
width: "100%",
|
|
268
|
-
open: !!
|
|
269
|
-
title:
|
|
270
|
-
footer: /* @__PURE__ */
|
|
275
|
+
open: !!u,
|
|
276
|
+
title: pt ?? /* @__PURE__ */ m("div", { children: " " }),
|
|
277
|
+
footer: /* @__PURE__ */ m(J, {}),
|
|
271
278
|
closable: !0,
|
|
272
279
|
onCancel: () => L(void 0),
|
|
273
|
-
children: !!
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
-
|
|
280
|
+
children: !!u && /* @__PURE__ */ D("div", { children: [
|
|
281
|
+
/* @__PURE__ */ m(
|
|
282
|
+
Jt,
|
|
276
283
|
{
|
|
277
|
-
layout:
|
|
284
|
+
layout: yt,
|
|
278
285
|
descListColumn: it,
|
|
279
|
-
data:
|
|
280
|
-
fields:
|
|
281
|
-
action:
|
|
286
|
+
data: u,
|
|
287
|
+
fields: f,
|
|
288
|
+
action: q(u)
|
|
282
289
|
}
|
|
283
290
|
),
|
|
284
|
-
|
|
285
|
-
] },
|
|
291
|
+
z == null ? void 0 : z(u)
|
|
292
|
+
] }, u == null ? void 0 : u[o])
|
|
286
293
|
}
|
|
287
294
|
),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
/* @__PURE__ */ D(
|
|
290
|
-
!!P && /* @__PURE__ */
|
|
291
|
-
|
|
295
|
+
/* @__PURE__ */ m(Gt, { fields: f, ...ht }),
|
|
296
|
+
/* @__PURE__ */ D(Qt, { children: [
|
|
297
|
+
!!P && /* @__PURE__ */ m(Ot, { onClick: P }),
|
|
298
|
+
Tt()
|
|
292
299
|
] })
|
|
293
300
|
] });
|
|
294
301
|
}
|
|
295
|
-
const ft = ut.createContext({}),
|
|
296
|
-
const { setActivatorNodeRef:
|
|
297
|
-
return /* @__PURE__ */
|
|
298
|
-
|
|
302
|
+
const ft = ut.createContext({}), Yt = ({ tooltip: o }) => {
|
|
303
|
+
const { setActivatorNodeRef: S, listeners: f } = $t(ft);
|
|
304
|
+
return /* @__PURE__ */ m(
|
|
305
|
+
jt,
|
|
299
306
|
{
|
|
300
307
|
type: "text",
|
|
301
308
|
size: "small",
|
|
302
309
|
tooltip: o,
|
|
303
|
-
icon: /* @__PURE__ */
|
|
310
|
+
icon: /* @__PURE__ */ m(Kt, {}),
|
|
304
311
|
style: { cursor: "move", border: "none" },
|
|
305
|
-
ref:
|
|
306
|
-
...
|
|
312
|
+
ref: S,
|
|
313
|
+
...f
|
|
307
314
|
}
|
|
308
315
|
);
|
|
309
|
-
},
|
|
316
|
+
}, Zt = (o) => {
|
|
310
317
|
const {
|
|
311
|
-
attributes:
|
|
312
|
-
listeners:
|
|
313
|
-
setNodeRef:
|
|
314
|
-
setActivatorNodeRef:
|
|
315
|
-
transform:
|
|
316
|
-
transition:
|
|
317
|
-
isDragging:
|
|
318
|
-
} = Nt({ id: o["data-row-key"] }),
|
|
318
|
+
attributes: S,
|
|
319
|
+
listeners: f,
|
|
320
|
+
setNodeRef: x,
|
|
321
|
+
setActivatorNodeRef: B,
|
|
322
|
+
transform: c,
|
|
323
|
+
transition: y,
|
|
324
|
+
isDragging: h
|
|
325
|
+
} = Nt({ id: o["data-row-key"] }), N = {
|
|
319
326
|
...o.style,
|
|
320
|
-
transform:
|
|
321
|
-
transition:
|
|
322
|
-
...
|
|
323
|
-
},
|
|
324
|
-
() => ({ setActivatorNodeRef:
|
|
325
|
-
[
|
|
327
|
+
transform: Rt.Translate.toString(c),
|
|
328
|
+
transition: y,
|
|
329
|
+
...h ? { position: "relative", zIndex: 9999 } : {}
|
|
330
|
+
}, l = I(
|
|
331
|
+
() => ({ setActivatorNodeRef: B, listeners: f }),
|
|
332
|
+
[B, f]
|
|
326
333
|
);
|
|
327
|
-
return /* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ m(ft.Provider, { value: l, children: /* @__PURE__ */ m("tr", { ...o, ref: x, style: N, ...S }) });
|
|
328
335
|
};
|
|
329
336
|
export {
|
|
330
|
-
|
|
337
|
+
ho as default
|
|
331
338
|
};
|