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