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