@kingteza/crud-component 1.22.0 → 1.22.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,2 +1,2 @@
1
- "use strict";const n=require("react/jsx-runtime"),v=require("@ant-design/icons"),V=require("papaparse"),f=require("antd"),W=require("file-saver"),r=require("react"),O=require("../../locale/index.cjs.js"),L=require("../view/CrudViewer.cjs.js"),R=require("../../util/DateUtil.cjs.js"),z=require("../../common/button/Button.cjs.js"),$=require("../../common/button/ImportButton.cjs.js");function H({onCloseMethod:y,open:w,fields:q,importProps:i}){const[c,C]=r.useState([]),[k,g]=r.useState(!1),[I,D]=r.useState(0);r.useEffect(()=>{w||(C([]),g(!1))},[w]);const x=r.useMemo(()=>new Map(q.filter(e=>{var t;return!e.hidden&&!((t=e.importProps)!=null&&t.hidden)&&!e.readonly}).map(e=>[e.name,e])),[q]),A=r.useMemo(()=>Array.from(x.values()).flatMap(e=>{var t;return[e.name,...((t=e.importProps)==null?void 0:t.extraFields)??[]]}),[x]),E=r.useCallback(async function(){const e=`${A.join(",")}
2
- `,t=new Blob([e],{type:"text/csv;charset=utf-8;"});W.saveAs(t,(i==null?void 0:i.name)+" - "+R.formatDateTimeWithSecond(new Date).replaceAll(":","-")+".csv")},[A,i==null?void 0:i.name]),{t:o}=O.useTranslationLib(),_=r.useCallback(async e=>{const t=new FileReader;t.onerror=console.error,t.onload=async s=>{var a;const d=(a=s==null?void 0:s.target)==null?void 0:a.result,l=V.parse(d,{header:!0});C(l.data.map((u,m)=>({...u,id_private_private:"crud-import-"+m})))},t.readAsText(e)},[]),B=r.useCallback(async e=>{C(c.filter(t=>t.id_private_private!==e))},[c]),j=r.useMemo(()=>{var t,s,d;let e=!1;for(const l of c)for(const[a,u]of x.entries()){const m=l[a],p=m||!isNaN(m);if(u.required&&!p)if((s=(t=u.importProps)==null?void 0:t.extraFields)!=null&&s.length)for(const T of((d=u.importProps)==null?void 0:d.extraFields)??[])if(l[T]||!isNaN(l[T])){e=!1;break}else return!0;else return!0}return e},[c,x]),b=r.useCallback(e=>(t,s)=>{var l,a,u;const d=t||!isNaN(t);if(e.required&&!d){let m=o("err.validation.required");if((a=(l=e.importProps)==null?void 0:l.extraFields)!=null&&a.length){const p=(u=e.importProps)==null?void 0:u.extraFields;(p==null?void 0:p.find(N=>!s[N]))&&(m="Either one of these fields is required: "+[e.name,...p].join(", "))}return n.jsxs(f.Tooltip,{className:"d-flex",title:m,children:[n.jsx(v.WarningTwoTone,{twoToneColor:"#ee9702"}),t]})}return t},[o]),F=r.useCallback(async e=>{D(e)},[]),h=r.useCallback(async()=>{try{g(!0),await i.onClickImport(c,F),y(!1)}finally{g(!1),D(0)}},[c,i,y,F]),{modal:S}=f.App.useApp(),M=r.useCallback(async()=>{j?S.warning?S.warning({title:o("str.warning"),content:o("qus.importWithIssues"),okText:o("str.import"),onOk:h,okCancel:!0,closable:!0}):(console.error("You must wrap your react app with App component. https://ant.design/components/app"),window.confirm(o("qus.importWithIssues"))&&h()):h()},[j,h,o]);return n.jsxs(f.Modal,{title:[o("str.import"),i==null?void 0:i.name].filter(Boolean).join(" "),width:"100%",open:w,onOk:M,destroyOnHidden:!0,onCancel:()=>y(!1),okText:o("str.import"),confirmLoading:k,okButtonProps:{disabled:!(c!=null&&c.length)},footer:(e,{OkBtn:t,CancelBtn:s})=>n.jsxs(f.Space,{children:[n.jsx(s,{}),n.jsx(t,{}),j&&n.jsx(f.Tooltip,{className:"d-flex",title:"Some fields have issue. Please review before submit.",children:n.jsx(v.WarningTwoTone,{twoToneColor:"#ee9702"})})]}),children:[n.jsxs(f.Space,{children:[n.jsx(z,{onClick:E,icon:n.jsx(v.DownloadOutlined,{}),children:o("str.downloadCsvTemplate")}),n.jsx($.ImportButton,{disabled:k,type:"default",onClick:_,accept:".csv",children:o("str.importCsvFile")})]}),n.jsx(f.Spin,{spinning:k,indicator:I?n.jsx(f.Progress,{type:"circle",percent:I*100,size:50,format:e=>`${parseInt(e)}%`}):void 0,children:n.jsx(L,{data:c,bordered:!0,size:"small",idField:"id_private_private",onDelete:B,confirmDeleting:!1,fields:Array.from(x.values()).flatMap(e=>{var t,s,d,l;return e.type==="text"?[{...e,label:e.name,hideInTable:!1,render:b(e)},...((s=(t=e.importProps)==null?void 0:t.extraFields)==null?void 0:s.map((a,u)=>({...e,name:a,label:a,hideInTable:!1,render:b(e)})))??[]]:e.type==="select"?[{...e,label:e.name,hideInTable:!1,type:"text",render:b(e)},...((l=(d=e.importProps)==null?void 0:d.extraFields)==null?void 0:l.map(a=>({...e,name:a,label:a,hideInTable:!1,type:"text",render:b(e)})))??[]]:[{...e,label:e.name,hideInTable:!1,render:b(e)}]})})})]})}module.exports=H;
1
+ "use strict";const s=require("react/jsx-runtime"),T=require("@ant-design/icons"),O=require("papaparse"),f=require("antd"),L=require("file-saver"),n=require("react"),R=require("../../locale/index.cjs.js"),z=require("../view/CrudViewer.cjs.js"),$=require("../../util/DateUtil.cjs.js"),H=require("../../common/button/Button.cjs.js"),U=require("../../common/button/ImportButton.cjs.js");function Y({onCloseMethod:w,open:y,fields:q,importProps:a}){const[c,g]=n.useState([]),[C,k]=n.useState(!1),[D,S]=n.useState(0);n.useEffect(()=>{y||(g([]),k(!1))},[y]);const p=n.useMemo(()=>new Map(q.filter(e=>{var t;return!e.hidden&&!((t=e.importProps)!=null&&t.hidden)&&!e.readonly}).map(e=>[e.name,e])),[q]),A=n.useMemo(()=>Array.from(p.values()).flatMap(e=>{var t;return[e.name,...((t=e.importProps)==null?void 0:t.extraFields)??[]]}),[p]),M=n.useCallback(async function(){const e=`${A.join(",")}
2
+ `,t=new Blob([e],{type:"text/csv;charset=utf-8;"});L.saveAs(t,(a==null?void 0:a.name)+" - "+$.formatDateTimeWithSecond(new Date).replaceAll(":","-")+".csv")},[A,a==null?void 0:a.name]),{t:i}=R.useTranslationLib(),_=n.useCallback(async e=>{const t=new FileReader;t.onerror=console.error,t.onload=async r=>{var o;const d=(o=r==null?void 0:r.target)==null?void 0:o.result,l=O.parse(d,{header:!0});g(l.data.map((u,m)=>({...u,id_private_private:"crud-import-"+m})))},t.readAsText(e)},[]),B=n.useCallback(async e=>{console.log("Deleting item from import component",e,c),g(t=>t.filter(r=>r.id_private_private!==e))},[c]),j=n.useMemo(()=>{var t,r,d;let e=!1;for(const l of c)for(const[o,u]of p.entries()){const m=l[o],h=m||!isNaN(m);if(u.required&&!h)if((r=(t=u.importProps)==null?void 0:t.extraFields)!=null&&r.length)for(const v of((d=u.importProps)==null?void 0:d.extraFields)??[])if(l[v]||!isNaN(l[v])){e=!1;break}else return!0;else return!0}return e},[c,p]),x=n.useCallback(e=>(t,r)=>{var l,o,u;const d=t||!isNaN(t);if(e.required&&!d){let m=i("err.validation.required");if((o=(l=e.importProps)==null?void 0:l.extraFields)!=null&&o.length){const h=(u=e.importProps)==null?void 0:u.extraFields;(h==null?void 0:h.find(E=>!r[E]))&&(m="Either one of these fields is required: "+[e.name,...h].join(", "))}return s.jsxs(f.Tooltip,{className:"d-flex",title:m,children:[s.jsx(T.WarningTwoTone,{twoToneColor:"#ee9702"}),t]})}return t},[i]),I=n.useCallback(async e=>{S(e)},[]),b=n.useCallback(async()=>{try{k(!0),await a.onClickImport(c,I),w(!1)}finally{k(!1),S(0)}},[c,a,w,I]),{modal:F}=f.App.useApp(),V=n.useCallback(async()=>{j?F.warning?F.warning({title:i("str.warning"),content:i("qus.importWithIssues"),okText:i("str.import"),onOk:b,okCancel:!0,closable:!0}):(console.error("You must wrap your react app with App component. https://ant.design/components/app"),window.confirm(i("qus.importWithIssues"))&&b()):b()},[j,b,i]),N=n.useMemo(()=>Array.from(p.values()).flatMap(e=>{var t,r,d,l;return e.type==="text"?[{...e,label:e.name,render:x(e)},...((r=(t=e.importProps)==null?void 0:t.extraFields)==null?void 0:r.map((o,u)=>({...e,name:o,label:o,render:x(e)})))??[]]:e.type==="select"?[{...e,label:e.name,type:"text",render:x(e)},...((l=(d=e.importProps)==null?void 0:d.extraFields)==null?void 0:l.map(o=>({...e,name:o,label:o,type:"text",render:x(e)})))??[]]:[{...e,label:e.name,render:x(e)}]}),[p,x]),W=n.useMemo(()=>N.map(e=>({...e,hideInTable:!1})),[N]);return s.jsxs(f.Modal,{title:[i("str.import"),a==null?void 0:a.name].filter(Boolean).join(" "),width:"100%",open:y,onOk:V,destroyOnHidden:!0,onCancel:()=>w(!1),okText:i("str.import"),confirmLoading:C,okButtonProps:{disabled:!(c!=null&&c.length)},footer:(e,{OkBtn:t,CancelBtn:r})=>s.jsxs(f.Space,{children:[s.jsx(r,{}),s.jsx(t,{}),j&&s.jsx(f.Tooltip,{className:"d-flex",title:"Some fields have issue. Please review before submit.",children:s.jsx(T.WarningTwoTone,{twoToneColor:"#ee9702"})})]}),children:[s.jsxs(f.Space,{children:[s.jsx(H,{onClick:M,icon:s.jsx(T.DownloadOutlined,{}),children:i("str.downloadCsvTemplate")}),s.jsx(U.ImportButton,{disabled:C,type:"default",onClick:_,accept:".csv",children:i("str.importCsvFile")})]}),s.jsx(f.Spin,{spinning:C,indicator:D?s.jsx(f.Progress,{type:"circle",percent:D*100,size:50,format:e=>`${parseInt(e)}%`}):void 0,children:s.jsx(z,{data:c,bordered:!0,size:"small",idField:"id_private_private",onDelete:B,confirmDeleting:!1,fields:W})})]})}module.exports=Y;
@@ -1,33 +1,33 @@
1
- import { jsxs as y, jsx as i } from "react/jsx-runtime";
2
- import { WarningTwoTone as S, DownloadOutlined as z } from "@ant-design/icons";
3
- import $ from "papaparse";
4
- import { Tooltip as B, App as H, Modal as R, Space as V, Spin as U, Progress as Y } from "antd";
5
- import { saveAs as G } from "file-saver";
6
- import { useState as I, useEffect as J, useMemo as D, useCallback as m } from "react";
7
- import { useTranslationLib as K } from "../../locale/index.es.js";
8
- import Q from "../view/CrudViewer.es.js";
9
- import X from "../../util/DateUtil.es.js";
10
- import Z from "../../common/button/Button.es.js";
11
- import { ImportButton as P } from "../../common/button/ImportButton.es.js";
12
- function fe({
13
- onCloseMethod: w,
1
+ import { jsxs as b, jsx as i } from "react/jsx-runtime";
2
+ import { WarningTwoTone as B, DownloadOutlined as H } from "@ant-design/icons";
3
+ import R from "papaparse";
4
+ import { Tooltip as V, App as U, Modal as Y, Space as O, Spin as G, Progress as J } from "antd";
5
+ import { saveAs as K } from "file-saver";
6
+ import { useState as A, useEffect as Q, useMemo as w, useCallback as f } from "react";
7
+ import { useTranslationLib as X } from "../../locale/index.es.js";
8
+ import Z from "../view/CrudViewer.es.js";
9
+ import P from "../../util/DateUtil.es.js";
10
+ import ee from "../../common/button/Button.es.js";
11
+ import { ImportButton as te } from "../../common/button/ImportButton.es.js";
12
+ function pe({
13
+ onCloseMethod: g,
14
14
  open: x,
15
- fields: A,
15
+ fields: F,
16
16
  importProps: o
17
17
  }) {
18
- const [l, g] = I([]), [v, C] = I(!1), [F, N] = I(0);
19
- J(() => {
20
- x || (g([]), C(!1));
18
+ const [l, v] = A([]), [C, k] = A(!1), [I, N] = A(0);
19
+ Q(() => {
20
+ x || (v([]), k(!1));
21
21
  }, [x]);
22
- const p = D(
22
+ const p = w(
23
23
  () => new Map(
24
- A.filter((e) => {
24
+ F.filter((e) => {
25
25
  var t;
26
26
  return !e.hidden && !((t = e.importProps) != null && t.hidden) && !e.readonly;
27
27
  }).map((e) => [e.name, e])
28
28
  ),
29
- [A]
30
- ), E = D(
29
+ [F]
30
+ ), S = w(
31
31
  () => Array.from(p.values()).flatMap((e) => {
32
32
  var t;
33
33
  return [
@@ -36,189 +36,195 @@ function fe({
36
36
  ];
37
37
  }),
38
38
  [p]
39
- ), O = m(
39
+ ), W = f(
40
40
  async function() {
41
- const e = `${E.join(",")}
41
+ const e = `${S.join(",")}
42
42
  `, t = new Blob([e], { type: "text/csv;charset=utf-8;" });
43
- G(
43
+ K(
44
44
  t,
45
- (o == null ? void 0 : o.name) + " - " + X.formatDateTimeWithSecond(/* @__PURE__ */ new Date()).replaceAll(":", "-") + ".csv"
45
+ (o == null ? void 0 : o.name) + " - " + P.formatDateTimeWithSecond(/* @__PURE__ */ new Date()).replaceAll(":", "-") + ".csv"
46
46
  );
47
47
  },
48
- [E, o == null ? void 0 : o.name]
49
- ), { t: a } = K(), W = m(async (e) => {
48
+ [S, o == null ? void 0 : o.name]
49
+ ), { t: a } = X(), L = f(async (e) => {
50
50
  const t = new FileReader();
51
51
  t.onerror = console.error, t.onload = async (r) => {
52
52
  var n;
53
- const c = (n = r == null ? void 0 : r.target) == null ? void 0 : n.result, s = $.parse(c, { header: !0 });
54
- g(s.data.map((d, f) => ({ ...d, id_private_private: "crud-import-" + f })));
53
+ const c = (n = r == null ? void 0 : r.target) == null ? void 0 : n.result, s = R.parse(c, { header: !0 });
54
+ v(
55
+ s.data.map((d, m) => ({
56
+ ...d,
57
+ id_private_private: "crud-import-" + m
58
+ }))
59
+ );
55
60
  }, t.readAsText(e);
56
- }, []), L = m(async (e) => {
57
- g(l.filter((t) => t.id_private_private !== e));
58
- }, [l]), T = D(() => {
61
+ }, []), M = f(
62
+ async (e) => {
63
+ console.log("Deleting item from import component", e, l), v((t) => t.filter((r) => r.id_private_private !== e));
64
+ },
65
+ [l]
66
+ ), T = w(() => {
59
67
  var t, r, c;
60
68
  let e = !1;
61
69
  for (const s of l)
62
70
  for (const [n, d] of p.entries()) {
63
- const f = s[n], u = f || !isNaN(f);
64
- if (d.required && !u)
71
+ const m = s[n], h = m || !isNaN(m);
72
+ if (d.required && !h)
65
73
  if ((r = (t = d.importProps) == null ? void 0 : t.extraFields) != null && r.length)
66
- for (const k of ((c = d.importProps) == null ? void 0 : c.extraFields) ?? [])
67
- if (s[k] || !isNaN(s[k])) {
74
+ for (const D of ((c = d.importProps) == null ? void 0 : c.extraFields) ?? [])
75
+ if (s[D] || !isNaN(s[D])) {
68
76
  e = !1;
69
77
  break;
70
78
  } else return !0;
71
79
  else return !0;
72
80
  }
73
81
  return e;
74
- }, [l, p]), h = m(
82
+ }, [l, p]), u = f(
75
83
  (e) => (t, r) => {
76
84
  var s, n, d;
77
85
  const c = t || !isNaN(t);
78
86
  if (e.required && !c) {
79
- let f = a("err.validation.required");
87
+ let m = a("err.validation.required");
80
88
  if ((n = (s = e.importProps) == null ? void 0 : s.extraFields) != null && n.length) {
81
- const u = (d = e.importProps) == null ? void 0 : d.extraFields;
82
- (u == null ? void 0 : u.find((q) => !r[q])) && (f = "Either one of these fields is required: " + [e.name, ...u].join(", "));
89
+ const h = (d = e.importProps) == null ? void 0 : d.extraFields;
90
+ (h == null ? void 0 : h.find((q) => !r[q])) && (m = "Either one of these fields is required: " + [e.name, ...h].join(", "));
83
91
  }
84
- return /* @__PURE__ */ y(B, { className: "d-flex", title: f, children: [
85
- /* @__PURE__ */ i(S, { twoToneColor: "#ee9702" }),
92
+ return /* @__PURE__ */ b(V, { className: "d-flex", title: m, children: [
93
+ /* @__PURE__ */ i(B, { twoToneColor: "#ee9702" }),
86
94
  t
87
95
  ] });
88
96
  }
89
97
  return t;
90
98
  },
91
99
  [a]
92
- ), _ = m(async (e) => {
100
+ ), E = f(async (e) => {
93
101
  N(e);
94
- }, []), b = m(async () => {
102
+ }, []), y = f(async () => {
95
103
  try {
96
- C(!0), await o.onClickImport(l, _), w(!1);
104
+ k(!0), await o.onClickImport(l, E), g(!1);
97
105
  } finally {
98
- C(!1), N(0);
106
+ k(!1), N(0);
99
107
  }
100
- }, [l, o, w, _]), { modal: j } = H.useApp(), M = m(async () => {
101
- T ? j.warning ? j.warning({
108
+ }, [l, o, g, E]), { modal: _ } = U.useApp(), z = f(async () => {
109
+ T ? _.warning ? _.warning({
102
110
  title: a("str.warning"),
103
111
  content: a("qus.importWithIssues"),
104
112
  okText: a("str.import"),
105
- onOk: b,
113
+ onOk: y,
106
114
  okCancel: !0,
107
115
  closable: !0
108
116
  }) : (console.error(
109
117
  "You must wrap your react app with App component. https://ant.design/components/app"
110
- ), window.confirm(a("qus.importWithIssues")) && b()) : b();
111
- }, [T, b, a]);
112
- return /* @__PURE__ */ y(
113
- R,
118
+ ), window.confirm(a("qus.importWithIssues")) && y()) : y();
119
+ }, [T, y, a]), j = w(
120
+ () => Array.from(p.values()).flatMap((e) => {
121
+ var t, r, c, s;
122
+ return e.type === "text" ? [
123
+ {
124
+ ...e,
125
+ label: e.name,
126
+ render: u(e)
127
+ },
128
+ ...((r = (t = e.importProps) == null ? void 0 : t.extraFields) == null ? void 0 : r.map((n, d) => ({
129
+ ...e,
130
+ name: n,
131
+ label: n,
132
+ render: u(e)
133
+ }))) ?? []
134
+ ] : e.type === "select" ? [
135
+ {
136
+ ...e,
137
+ label: e.name,
138
+ type: "text",
139
+ render: u(e)
140
+ },
141
+ ...((s = (c = e.importProps) == null ? void 0 : c.extraFields) == null ? void 0 : s.map((n) => ({
142
+ ...e,
143
+ name: n,
144
+ label: n,
145
+ type: "text",
146
+ render: u(e)
147
+ }))) ?? []
148
+ ] : [
149
+ {
150
+ ...e,
151
+ label: e.name,
152
+ render: u(e)
153
+ }
154
+ ];
155
+ }),
156
+ [p, u]
157
+ ), $ = w(() => j.map((e) => ({ ...e, hideInTable: !1 })), [j]);
158
+ return /* @__PURE__ */ b(
159
+ Y,
114
160
  {
115
161
  title: [a("str.import"), o == null ? void 0 : o.name].filter(Boolean).join(" "),
116
162
  width: "100%",
117
163
  open: x,
118
- onOk: M,
164
+ onOk: z,
119
165
  destroyOnHidden: !0,
120
- onCancel: () => w(!1),
166
+ onCancel: () => g(!1),
121
167
  okText: a("str.import"),
122
- confirmLoading: v,
168
+ confirmLoading: C,
123
169
  okButtonProps: {
124
170
  disabled: !(l != null && l.length)
125
171
  },
126
- footer: (e, { OkBtn: t, CancelBtn: r }) => /* @__PURE__ */ y(V, { children: [
172
+ footer: (e, { OkBtn: t, CancelBtn: r }) => /* @__PURE__ */ b(O, { children: [
127
173
  /* @__PURE__ */ i(r, {}),
128
174
  /* @__PURE__ */ i(t, {}),
129
175
  T && /* @__PURE__ */ i(
130
- B,
176
+ V,
131
177
  {
132
178
  className: "d-flex",
133
179
  title: "Some fields have issue. Please review before submit.",
134
- children: /* @__PURE__ */ i(S, { twoToneColor: "#ee9702" })
180
+ children: /* @__PURE__ */ i(B, { twoToneColor: "#ee9702" })
135
181
  }
136
182
  )
137
183
  ] }),
138
184
  children: [
139
- /* @__PURE__ */ y(V, { children: [
185
+ /* @__PURE__ */ b(O, { children: [
140
186
  /* @__PURE__ */ i(
141
- Z,
187
+ ee,
142
188
  {
143
- onClick: O,
144
- icon: /* @__PURE__ */ i(z, {}),
189
+ onClick: W,
190
+ icon: /* @__PURE__ */ i(H, {}),
145
191
  children: a("str.downloadCsvTemplate")
146
192
  }
147
193
  ),
148
194
  /* @__PURE__ */ i(
149
- P,
195
+ te,
150
196
  {
151
- disabled: v,
197
+ disabled: C,
152
198
  type: "default",
153
- onClick: W,
199
+ onClick: L,
154
200
  accept: ".csv",
155
201
  children: a("str.importCsvFile")
156
202
  }
157
203
  )
158
204
  ] }),
159
205
  /* @__PURE__ */ i(
160
- U,
206
+ G,
161
207
  {
162
- spinning: v,
163
- indicator: F ? /* @__PURE__ */ i(
164
- Y,
208
+ spinning: C,
209
+ indicator: I ? /* @__PURE__ */ i(
210
+ J,
165
211
  {
166
212
  type: "circle",
167
- percent: F * 100,
213
+ percent: I * 100,
168
214
  size: 50,
169
215
  format: (e) => `${parseInt(e)}%`
170
216
  }
171
217
  ) : void 0,
172
218
  children: /* @__PURE__ */ i(
173
- Q,
219
+ Z,
174
220
  {
175
221
  data: l,
176
222
  bordered: !0,
177
223
  size: "small",
178
224
  idField: "id_private_private",
179
- onDelete: L,
225
+ onDelete: M,
180
226
  confirmDeleting: !1,
181
- fields: Array.from(p.values()).flatMap((e) => {
182
- var t, r, c, s;
183
- return e.type === "text" ? [
184
- {
185
- ...e,
186
- label: e.name,
187
- hideInTable: !1,
188
- render: h(e)
189
- },
190
- ...((r = (t = e.importProps) == null ? void 0 : t.extraFields) == null ? void 0 : r.map((n, d) => ({
191
- ...e,
192
- name: n,
193
- label: n,
194
- hideInTable: !1,
195
- render: h(e)
196
- }))) ?? []
197
- ] : e.type === "select" ? [
198
- {
199
- ...e,
200
- label: e.name,
201
- hideInTable: !1,
202
- type: "text",
203
- render: h(e)
204
- },
205
- ...((s = (c = e.importProps) == null ? void 0 : c.extraFields) == null ? void 0 : s.map((n) => ({
206
- ...e,
207
- name: n,
208
- label: n,
209
- hideInTable: !1,
210
- type: "text",
211
- render: h(e)
212
- }))) ?? []
213
- ] : [
214
- {
215
- ...e,
216
- label: e.name,
217
- hideInTable: !1,
218
- render: h(e)
219
- }
220
- ];
221
- })
227
+ fields: $
222
228
  }
223
229
  )
224
230
  }
@@ -228,5 +234,5 @@ function fe({
228
234
  );
229
235
  }
230
236
  export {
231
- fe as default
237
+ pe as default
232
238
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.22.0",
4
+ "version": "1.22.2",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",