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