antd-crud-table 0.2.0 → 0.4.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.
- package/dist/CrudTable.cjs +1 -1
- package/dist/CrudTable.d.ts +7 -11
- package/dist/CrudTable.js +226 -132
- package/dist/CrudTableLazy.cjs +1 -1
- package/dist/CrudTableLazy.d.ts +1 -0
- package/dist/CrudTableLazy.js +13 -22
- package/dist/exportData.cjs +13 -0
- package/dist/exportData.js +64 -0
- package/dist/index.d.ts +0 -3
- package/dist/useCrudTable.cjs +1 -1
- package/dist/useCrudTable.js +1 -1
- package/dist/useLocalStorageCrud.cjs +1 -0
- package/dist/useLocalStorageCrud.js +201 -0
- package/package.json +13 -1
- package/dist/CrudTable-CDqv0ksy.cjs +0 -387
- package/dist/CrudTable-DbG9ZeYQ.js +0 -73031
- package/dist/CrudTableExperimental.cjs +0 -1
- package/dist/CrudTableExperimental.d.ts +0 -34
- package/dist/CrudTableExperimental.js +0 -304
- package/dist/CrudTableExperimentalLazy.d.ts +0 -4
- package/dist/chunk-BZRuZbSa.cjs +0 -1
- package/dist/chunk-DrlAKpkd.js +0 -23
- package/dist/jsx-runtime-Blo4gjKb.js +0 -475
- package/dist/jsx-runtime-D8R_Hd8N.cjs +0 -16
- package/dist/message-C5ORE39N.cjs +0 -124
- package/dist/message-C9NNC2sM.js +0 -7083
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-BZRuZbSa.cjs`),t=require(`./CrudTable-CDqv0ksy.cjs`),n=require(`./message-C5ORE39N.cjs`),r=require(`./jsx-runtime-D8R_Hd8N.cjs`),i=require(`./useCrudTable.cjs`);let a=require(`react`);var o=e.i(t.h(),1),s=r.t(),c=e=>{let{columns:r,rowKey:c,title:l,defaultPageSize:u=10,hookConfig:d,enableBulkOperations:f=!1,customActions:p}=e,m=i.useCrudTable(c,{defaultPageSize:u,...d}),[h,g]=(0,a.useState)(!1),[_,v]=(0,a.useState)(null),[y,b]=(0,a.useState)([]),[x]=t.d.useForm();(0,a.useEffect)(()=>{m.refresh()},[]);let S=r.map(e=>{let n={...e,dataIndex:e.dataIndex,title:e.title,search:e.searchable!==!1};switch(e.fieldType){case`date`:return{...n,valueType:`dateTime`,render:(n,r)=>{let i=r[e.dataIndex];if(!i)return`-`;try{return(0,s.jsx)(`span`,{children:t.r(t.t(i),`yyyy-MM-dd HH:mm`)})}catch{return(0,s.jsx)(`span`,{children:i})}}};case`enum`:return{...n,valueType:`select`,valueEnum:e.enumOptions,render:(n,r)=>{let i=r[e.dataIndex],a=e.enumOptions?.[i];return a?(0,s.jsx)(t.s,{color:a.color,children:a.text}):i}};case`number`:return{...n,valueType:`digit`,render:(t,n)=>{let r=n[e.dataIndex];return typeof r==`number`?r.toLocaleString():r}};case`boolean`:return{...n,valueType:`switch`,render:(n,r)=>(0,s.jsx)(t.s,{color:r[e.dataIndex]?`green`:`red`,children:r[e.dataIndex]?`Yes`:`No`})};case`custom`:return{...n,render:(t,n)=>e.customRender?.(n[e.dataIndex],n)};default:return n}});S.push({title:`Actions`,valueType:`option`,width:200,render:(e,n)=>{let r=[(0,s.jsx)(t.g,{type:`link`,size:`small`,onClick:()=>w(n),children:`Edit`},`edit`),(0,s.jsx)(t.g,{type:`link`,size:`small`,danger:!0,onClick:()=>E(n[c]),children:`Delete`},`delete`)],i=p?.(n,m)||[];return[...r,...i]}});let C=async(e,t,r)=>{try{let n={current:e.current,pageSize:e.pageSize,sortBy:Object.keys(t)[0],sortOrder:Object.values(t)[0],...r,...e},i=m.operations;if(i?.getList){let e=await i.getList(n);return{data:e.data,success:!0,total:e.total}}return{data:m.state.data,success:!0,total:m.state.total}}catch{return n.t.error(`Failed to fetch data`),{data:[],success:!1,total:0}}},w=e=>{if(v(e||null),e){let t={...e};r.forEach(e=>{let n=e.dataIndex;if(e.fieldType===`date`&&t[n])try{t[n]=(0,o.default)(t[n])}catch{}}),x.setFieldsValue(t)}else x.resetFields();g(!0)},T=async()=>{try{let e=await x.validateFields(),n={...e};r.forEach(r=>{let i=r.dataIndex;if(r.fieldType===`date`&&e[i])try{n[i]=t.n(e[i])}catch{}r.formConfig?.transform&&(n[i]=r.formConfig.transform(e[i]))}),_&&_[c]?await m.update(_[c],n):await m.create(n),g(!1),m.actionRef.current?.reload()}catch(e){console.error(`Form validation failed:`,e)}},E=async e=>{t.l.confirm({title:`Are you sure?`,content:`This action cannot be undone.`,okText:`Yes, Delete`,okType:`danger`,cancelText:`Cancel`,onOk:async()=>{await m.delete(e)&&m.actionRef.current?.reload()}})},D=async()=>{if(y.length===0){n.t.warning(`Please select items to delete`);return}t.l.confirm({title:`Delete ${y.length} items?`,content:`This action cannot be undone.`,okText:`Yes, Delete All`,okType:`danger`,cancelText:`Cancel`,onOk:async()=>{let e=y.map(e=>m.delete(e));await Promise.allSettled(e),b([]),m.actionRef.current?.reload()}})},O=f?{selectedRowKeys:y,onChange:b}:void 0;return(0,s.jsxs)(t.a,{needDeps:!0,intl:t.o,children:[(0,s.jsx)(t.i,{headerTitle:l,rowKey:c,rowClassName:(e,t)=>t%2==0?`row-differentiator`:``,actionRef:m.actionRef,columns:S,request:C,search:{labelWidth:`auto`},pagination:{pageSize:u,showSizeChanger:!0,showQuickJumper:!0},loading:m.state.loading,rowSelection:O,toolBarRender:()=>[(0,s.jsx)(t.g,{type:`primary`,icon:(0,s.jsx)(t.v,{}),onClick:()=>w(),children:`New`},`add`),...f&&y.length>0?[(0,s.jsxs)(t.g,{danger:!0,onClick:D,children:[`Delete Selected (`,y.length,`)`]},`bulk-delete`)]:[],(0,s.jsx)(t.f,{menu:{items:[{key:`export`,label:`Export`,disabled:!0},{key:`refresh`,label:`Refresh`,onClick:()=>m.refresh()}]},children:(0,s.jsx)(t.g,{children:(0,s.jsx)(t.y,{})})},`menu`)],options:{setting:{listsHeight:400},reload:()=>m.refresh()},dateFormatter:`string`}),(0,s.jsx)(t.l,{title:_?`Edit Item`:`Create Item`,open:h,onOk:T,onCancel:()=>g(!1),destroyOnClose:!0,width:600,children:(0,s.jsx)(t.d,{form:x,layout:`vertical`,children:r.map(e=>{if(!e.dataIndex)return null;let n=e.dataIndex,r=e.title,i=!(e.fieldEditable??!0),a=e.formConfig?.rules||(e.formConfig?.required?[{required:!0,message:`${r} is required`}]:[]);if(e.formConfig?.component)return(0,s.jsx)(t.d.Item,{name:n,label:r,rules:a,children:e.formConfig.component},n);switch(e.fieldType){case`string`:return(0,s.jsx)(t.d.Item,{name:n,label:r,rules:a,children:(0,s.jsx)(t.u,{disabled:i})},n);case`number`:return(0,s.jsx)(t.d.Item,{name:n,label:r,rules:a,children:(0,s.jsx)(t.m,{style:{width:`100%`},disabled:i})},n);case`date`:return(0,s.jsx)(t.d.Item,{name:n,label:r,rules:a,children:(0,s.jsx)(t.p,{style:{width:`100%`},showTime:!0,disabled:i})},n);case`boolean`:return(0,s.jsx)(t.d.Item,{name:n,label:r,valuePropName:`checked`,children:(0,s.jsx)(t.c,{disabled:i})},n);case`enum`:return(0,s.jsx)(t.d.Item,{name:n,label:r,rules:a,children:(0,s.jsx)(t._,{disabled:i,placeholder:`Select ${r.toLowerCase()}`,options:Object.entries(e.enumOptions||{}).map(([e,t])=>({label:t.text,value:e}))})},n);default:return null}})})})]})};module.exports=c;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ProColumns } from '@ant-design/pro-components';
|
|
2
|
-
import { UseCrudTableConfig, CrudTableActions } from './hooks/useCrudTable';
|
|
3
|
-
type DataType = Record<string, any>;
|
|
4
|
-
type FieldType = 'string' | 'number' | 'date' | 'boolean' | 'enum' | 'custom';
|
|
5
|
-
interface CrudColumn<T extends DataType> extends ProColumns<T> {
|
|
6
|
-
fieldType?: FieldType;
|
|
7
|
-
enumOptions?: Record<string, {
|
|
8
|
-
text: string;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}>;
|
|
11
|
-
customRender?: (value: any, record: T) => React.ReactNode;
|
|
12
|
-
formConfig?: {
|
|
13
|
-
required?: boolean;
|
|
14
|
-
component?: React.ReactNode;
|
|
15
|
-
transform?: (value: any) => any;
|
|
16
|
-
rules?: any[];
|
|
17
|
-
};
|
|
18
|
-
fieldEditable?: boolean;
|
|
19
|
-
searchable?: boolean;
|
|
20
|
-
}
|
|
21
|
-
interface EnhancedCrudTableConfig<T extends DataType> {
|
|
22
|
-
columns: CrudColumn<T>[];
|
|
23
|
-
rowKey: keyof T;
|
|
24
|
-
title: string;
|
|
25
|
-
defaultPageSize?: number;
|
|
26
|
-
hookConfig: UseCrudTableConfig<T>;
|
|
27
|
-
enableBulkOperations?: boolean;
|
|
28
|
-
enableColumnSettings?: boolean;
|
|
29
|
-
enableExport?: boolean;
|
|
30
|
-
customActions?: (record: T, actions: CrudTableActions<T>) => React.ReactNode[];
|
|
31
|
-
}
|
|
32
|
-
declare const CrudTableExperimental: <T extends DataType>(config: EnhancedCrudTableConfig<T>) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export default CrudTableExperimental;
|
|
34
|
-
export type { EnhancedCrudTableConfig, CrudColumn, DataType };
|
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
import { a as e } from "./chunk-DrlAKpkd.js";
|
|
2
|
-
import { _ as t, a as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "./CrudTable-DbG9ZeYQ.js";
|
|
3
|
-
import { t as b } from "./message-C9NNC2sM.js";
|
|
4
|
-
import { t as x } from "./jsx-runtime-Blo4gjKb.js";
|
|
5
|
-
import { useCrudTable as S } from "./useCrudTable.js";
|
|
6
|
-
import { useEffect as C, useState as w } from "react";
|
|
7
|
-
//#region lib/CrudTableExperimental.tsx
|
|
8
|
-
var T = /* @__PURE__ */ e(s(), 1), E = x(), D = (e) => {
|
|
9
|
-
let { columns: s, rowKey: x, title: D, defaultPageSize: O = 10, hookConfig: k, enableBulkOperations: A = !1, customActions: j } = e, M = S(x, {
|
|
10
|
-
defaultPageSize: O,
|
|
11
|
-
...k
|
|
12
|
-
}), [N, P] = w(!1), [F, I] = w(null), [L, R] = w([]), [z] = i.useForm();
|
|
13
|
-
C(() => {
|
|
14
|
-
M.refresh();
|
|
15
|
-
}, []);
|
|
16
|
-
let B = s.map((e) => {
|
|
17
|
-
let t = {
|
|
18
|
-
...e,
|
|
19
|
-
dataIndex: e.dataIndex,
|
|
20
|
-
title: e.title,
|
|
21
|
-
search: e.searchable !== !1
|
|
22
|
-
};
|
|
23
|
-
switch (e.fieldType) {
|
|
24
|
-
case "date": return {
|
|
25
|
-
...t,
|
|
26
|
-
valueType: "dateTime",
|
|
27
|
-
render: (t, n) => {
|
|
28
|
-
let r = n[e.dataIndex];
|
|
29
|
-
if (!r) return "-";
|
|
30
|
-
try {
|
|
31
|
-
return /* @__PURE__ */ (0, E.jsx)("span", { children: m(g(r), "yyyy-MM-dd HH:mm") });
|
|
32
|
-
} catch {
|
|
33
|
-
return /* @__PURE__ */ (0, E.jsx)("span", { children: r });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
case "enum": return {
|
|
38
|
-
...t,
|
|
39
|
-
valueType: "select",
|
|
40
|
-
valueEnum: e.enumOptions,
|
|
41
|
-
render: (t, n) => {
|
|
42
|
-
let r = n[e.dataIndex], i = e.enumOptions?.[r];
|
|
43
|
-
return i ? /* @__PURE__ */ (0, E.jsx)(h, {
|
|
44
|
-
color: i.color,
|
|
45
|
-
children: i.text
|
|
46
|
-
}) : r;
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
case "number": return {
|
|
50
|
-
...t,
|
|
51
|
-
valueType: "digit",
|
|
52
|
-
render: (t, n) => {
|
|
53
|
-
let r = n[e.dataIndex];
|
|
54
|
-
return typeof r == "number" ? r.toLocaleString() : r;
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
case "boolean": return {
|
|
58
|
-
...t,
|
|
59
|
-
valueType: "switch",
|
|
60
|
-
render: (t, n) => /* @__PURE__ */ (0, E.jsx)(h, {
|
|
61
|
-
color: n[e.dataIndex] ? "green" : "red",
|
|
62
|
-
children: n[e.dataIndex] ? "Yes" : "No"
|
|
63
|
-
})
|
|
64
|
-
};
|
|
65
|
-
case "custom": return {
|
|
66
|
-
...t,
|
|
67
|
-
render: (t, n) => e.customRender?.(n[e.dataIndex], n)
|
|
68
|
-
};
|
|
69
|
-
default: return t;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
B.push({
|
|
73
|
-
title: "Actions",
|
|
74
|
-
valueType: "option",
|
|
75
|
-
width: 200,
|
|
76
|
-
render: (e, t) => {
|
|
77
|
-
let n = [/* @__PURE__ */ (0, E.jsx)(o, {
|
|
78
|
-
type: "link",
|
|
79
|
-
size: "small",
|
|
80
|
-
onClick: () => H(t),
|
|
81
|
-
children: "Edit"
|
|
82
|
-
}, "edit"), /* @__PURE__ */ (0, E.jsx)(o, {
|
|
83
|
-
type: "link",
|
|
84
|
-
size: "small",
|
|
85
|
-
danger: !0,
|
|
86
|
-
onClick: () => W(t[x]),
|
|
87
|
-
children: "Delete"
|
|
88
|
-
}, "delete")], r = j?.(t, M) || [];
|
|
89
|
-
return [...n, ...r];
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
let V = async (e, t, n) => {
|
|
93
|
-
try {
|
|
94
|
-
let r = {
|
|
95
|
-
current: e.current,
|
|
96
|
-
pageSize: e.pageSize,
|
|
97
|
-
sortBy: Object.keys(t)[0],
|
|
98
|
-
sortOrder: Object.values(t)[0],
|
|
99
|
-
...n,
|
|
100
|
-
...e
|
|
101
|
-
}, i = M.operations;
|
|
102
|
-
if (i?.getList) {
|
|
103
|
-
let e = await i.getList(r);
|
|
104
|
-
return {
|
|
105
|
-
data: e.data,
|
|
106
|
-
success: !0,
|
|
107
|
-
total: e.total
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
return {
|
|
111
|
-
data: M.state.data,
|
|
112
|
-
success: !0,
|
|
113
|
-
total: M.state.total
|
|
114
|
-
};
|
|
115
|
-
} catch {
|
|
116
|
-
return b.error("Failed to fetch data"), {
|
|
117
|
-
data: [],
|
|
118
|
-
success: !1,
|
|
119
|
-
total: 0
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}, H = (e) => {
|
|
123
|
-
if (I(e || null), e) {
|
|
124
|
-
let t = { ...e };
|
|
125
|
-
s.forEach((e) => {
|
|
126
|
-
let n = e.dataIndex;
|
|
127
|
-
if (e.fieldType === "date" && t[n]) try {
|
|
128
|
-
t[n] = (0, T.default)(t[n]);
|
|
129
|
-
} catch {}
|
|
130
|
-
}), z.setFieldsValue(t);
|
|
131
|
-
} else z.resetFields();
|
|
132
|
-
P(!0);
|
|
133
|
-
}, U = async () => {
|
|
134
|
-
try {
|
|
135
|
-
let e = await z.validateFields(), t = { ...e };
|
|
136
|
-
s.forEach((n) => {
|
|
137
|
-
let r = n.dataIndex;
|
|
138
|
-
if (n.fieldType === "date" && e[r]) try {
|
|
139
|
-
t[r] = d(e[r]);
|
|
140
|
-
} catch {}
|
|
141
|
-
n.formConfig?.transform && (t[r] = n.formConfig.transform(e[r]));
|
|
142
|
-
}), F && F[x] ? await M.update(F[x], t) : await M.create(t), P(!1), M.actionRef.current?.reload();
|
|
143
|
-
} catch (e) {
|
|
144
|
-
console.error("Form validation failed:", e);
|
|
145
|
-
}
|
|
146
|
-
}, W = async (e) => {
|
|
147
|
-
l.confirm({
|
|
148
|
-
title: "Are you sure?",
|
|
149
|
-
content: "This action cannot be undone.",
|
|
150
|
-
okText: "Yes, Delete",
|
|
151
|
-
okType: "danger",
|
|
152
|
-
cancelText: "Cancel",
|
|
153
|
-
onOk: async () => {
|
|
154
|
-
await M.delete(e) && M.actionRef.current?.reload();
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}, G = async () => {
|
|
158
|
-
if (L.length === 0) {
|
|
159
|
-
b.warning("Please select items to delete");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
l.confirm({
|
|
163
|
-
title: `Delete ${L.length} items?`,
|
|
164
|
-
content: "This action cannot be undone.",
|
|
165
|
-
okText: "Yes, Delete All",
|
|
166
|
-
okType: "danger",
|
|
167
|
-
cancelText: "Cancel",
|
|
168
|
-
onOk: async () => {
|
|
169
|
-
let e = L.map((e) => M.delete(e));
|
|
170
|
-
await Promise.allSettled(e), R([]), M.actionRef.current?.reload();
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}, K = A ? {
|
|
174
|
-
selectedRowKeys: L,
|
|
175
|
-
onChange: R
|
|
176
|
-
} : void 0;
|
|
177
|
-
return /* @__PURE__ */ (0, E.jsxs)(n, {
|
|
178
|
-
needDeps: !0,
|
|
179
|
-
intl: f,
|
|
180
|
-
children: [/* @__PURE__ */ (0, E.jsx)(c, {
|
|
181
|
-
headerTitle: D,
|
|
182
|
-
rowKey: x,
|
|
183
|
-
rowClassName: (e, t) => t % 2 == 0 ? "row-differentiator" : "",
|
|
184
|
-
actionRef: M.actionRef,
|
|
185
|
-
columns: B,
|
|
186
|
-
request: V,
|
|
187
|
-
search: { labelWidth: "auto" },
|
|
188
|
-
pagination: {
|
|
189
|
-
pageSize: O,
|
|
190
|
-
showSizeChanger: !0,
|
|
191
|
-
showQuickJumper: !0
|
|
192
|
-
},
|
|
193
|
-
loading: M.state.loading,
|
|
194
|
-
rowSelection: K,
|
|
195
|
-
toolBarRender: () => [
|
|
196
|
-
/* @__PURE__ */ (0, E.jsx)(o, {
|
|
197
|
-
type: "primary",
|
|
198
|
-
icon: /* @__PURE__ */ (0, E.jsx)(v, {}),
|
|
199
|
-
onClick: () => H(),
|
|
200
|
-
children: "New"
|
|
201
|
-
}, "add"),
|
|
202
|
-
...A && L.length > 0 ? [/* @__PURE__ */ (0, E.jsxs)(o, {
|
|
203
|
-
danger: !0,
|
|
204
|
-
onClick: G,
|
|
205
|
-
children: [
|
|
206
|
-
"Delete Selected (",
|
|
207
|
-
L.length,
|
|
208
|
-
")"
|
|
209
|
-
]
|
|
210
|
-
}, "bulk-delete")] : [],
|
|
211
|
-
/* @__PURE__ */ (0, E.jsx)(a, {
|
|
212
|
-
menu: { items: [{
|
|
213
|
-
key: "export",
|
|
214
|
-
label: "Export",
|
|
215
|
-
disabled: !0
|
|
216
|
-
}, {
|
|
217
|
-
key: "refresh",
|
|
218
|
-
label: "Refresh",
|
|
219
|
-
onClick: () => M.refresh()
|
|
220
|
-
}] },
|
|
221
|
-
children: /* @__PURE__ */ (0, E.jsx)(o, { children: /* @__PURE__ */ (0, E.jsx)(y, {}) })
|
|
222
|
-
}, "menu")
|
|
223
|
-
],
|
|
224
|
-
options: {
|
|
225
|
-
setting: { listsHeight: 400 },
|
|
226
|
-
reload: () => M.refresh()
|
|
227
|
-
},
|
|
228
|
-
dateFormatter: "string"
|
|
229
|
-
}), /* @__PURE__ */ (0, E.jsx)(l, {
|
|
230
|
-
title: F ? "Edit Item" : "Create Item",
|
|
231
|
-
open: N,
|
|
232
|
-
onOk: U,
|
|
233
|
-
onCancel: () => P(!1),
|
|
234
|
-
destroyOnClose: !0,
|
|
235
|
-
width: 600,
|
|
236
|
-
children: /* @__PURE__ */ (0, E.jsx)(i, {
|
|
237
|
-
form: z,
|
|
238
|
-
layout: "vertical",
|
|
239
|
-
children: s.map((e) => {
|
|
240
|
-
if (!e.dataIndex) return null;
|
|
241
|
-
let n = e.dataIndex, a = e.title, o = !(e.fieldEditable ?? !0), s = e.formConfig?.rules || (e.formConfig?.required ? [{
|
|
242
|
-
required: !0,
|
|
243
|
-
message: `${a} is required`
|
|
244
|
-
}] : []);
|
|
245
|
-
if (e.formConfig?.component) return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
246
|
-
name: n,
|
|
247
|
-
label: a,
|
|
248
|
-
rules: s,
|
|
249
|
-
children: e.formConfig.component
|
|
250
|
-
}, n);
|
|
251
|
-
switch (e.fieldType) {
|
|
252
|
-
case "string": return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
253
|
-
name: n,
|
|
254
|
-
label: a,
|
|
255
|
-
rules: s,
|
|
256
|
-
children: /* @__PURE__ */ (0, E.jsx)(_, { disabled: o })
|
|
257
|
-
}, n);
|
|
258
|
-
case "number": return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
259
|
-
name: n,
|
|
260
|
-
label: a,
|
|
261
|
-
rules: s,
|
|
262
|
-
children: /* @__PURE__ */ (0, E.jsx)(u, {
|
|
263
|
-
style: { width: "100%" },
|
|
264
|
-
disabled: o
|
|
265
|
-
})
|
|
266
|
-
}, n);
|
|
267
|
-
case "date": return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
268
|
-
name: n,
|
|
269
|
-
label: a,
|
|
270
|
-
rules: s,
|
|
271
|
-
children: /* @__PURE__ */ (0, E.jsx)(p, {
|
|
272
|
-
style: { width: "100%" },
|
|
273
|
-
showTime: !0,
|
|
274
|
-
disabled: o
|
|
275
|
-
})
|
|
276
|
-
}, n);
|
|
277
|
-
case "boolean": return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
278
|
-
name: n,
|
|
279
|
-
label: a,
|
|
280
|
-
valuePropName: "checked",
|
|
281
|
-
children: /* @__PURE__ */ (0, E.jsx)(r, { disabled: o })
|
|
282
|
-
}, n);
|
|
283
|
-
case "enum": return /* @__PURE__ */ (0, E.jsx)(i.Item, {
|
|
284
|
-
name: n,
|
|
285
|
-
label: a,
|
|
286
|
-
rules: s,
|
|
287
|
-
children: /* @__PURE__ */ (0, E.jsx)(t, {
|
|
288
|
-
disabled: o,
|
|
289
|
-
placeholder: `Select ${a.toLowerCase()}`,
|
|
290
|
-
options: Object.entries(e.enumOptions || {}).map(([e, t]) => ({
|
|
291
|
-
label: t.text,
|
|
292
|
-
value: e
|
|
293
|
-
}))
|
|
294
|
-
})
|
|
295
|
-
}, n);
|
|
296
|
-
default: return null;
|
|
297
|
-
}
|
|
298
|
-
})
|
|
299
|
-
})
|
|
300
|
-
})]
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
//#endregion
|
|
304
|
-
export { D as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { EnhancedCrudTableConfig, DataType } from './CrudTableExperimental';
|
|
2
|
-
declare const CrudTableExperimentalLazy: <T extends DataType>(props: EnhancedCrudTableConfig<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default CrudTableExperimentalLazy;
|
|
4
|
-
export type { EnhancedCrudTableConfig, DataType };
|
package/dist/chunk-BZRuZbSa.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(e&&(t=e(e=0)),t),s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,a)=>(a=n==null?{}:e(i(n)),l(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
|
package/dist/chunk-DrlAKpkd.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (e && (t = e(e = 0)), t), s = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), c = (e, n) => {
|
|
3
|
-
let r = {};
|
|
4
|
-
for (var i in e) t(r, i, {
|
|
5
|
-
get: e[i],
|
|
6
|
-
enumerable: !0
|
|
7
|
-
});
|
|
8
|
-
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
-
}, l = (e, i, o, s) => {
|
|
10
|
-
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
-
get: ((e) => i[e]).bind(null, d),
|
|
12
|
-
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
-
});
|
|
14
|
-
return e;
|
|
15
|
-
}, u = (n, r, a) => (a = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
-
value: n,
|
|
17
|
-
enumerable: !0
|
|
18
|
-
}) : a, n)), d = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
|
|
19
|
-
if (typeof require < "u") return require.apply(this, arguments);
|
|
20
|
-
throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
21
|
-
});
|
|
22
|
-
//#endregion
|
|
23
|
-
export { u as a, d as i, o as n, c as r, s as t };
|