@kingteza/crud-component 1.2.5 → 1.2.7

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 v=require("react/jsx-runtime"),Y=require("react"),A=require("../../common/button/CloneButtonTable.cjs.js"),H=require("../../common/button/DeleteButtonTable.cjs.js"),V=require("../../common/button/ExportButton.cjs.js"),s=require("../../common/button/HideButtonTable.cjs.js"),c=require("../../common/button/UpdateButtonTable.cjs.js"),r=require("../modal/index.cjs.js");function F({data:b,idField:j="id",extraAction:T,onUpdate:g,onClickUpdate:m,onClickClone:x,onDelete:h,onHide:z,onExport:E,isHiding:J,isDeleting:K,confirmHiding:Z,confirmDeleting:_,closeViewOnClickUpdate:$,recentUpdateOrDeleteId:L,setRecentUpdateOrDeleteId:q,setOpenView:G,inBuiltModalProps:f}){var S;const y=T==null?void 0:T(b),N=Y.useRef(null),Q=Y.useCallback((u,w=!0,W=!1)=>{var X;q==null||q(u[j]),f?(X=N.current)==null||X.update(u,w,W):W?x==null||x(u):m==null||m(u),$&&(G==null||G(void 0))},[f,m]);return console.log({onUpdate:g,onClickUpdate:m,onClickClone:x,onDelete:h}),(Array.isArray(y)?(S=y==null?void 0:y.filter(Boolean))!=null&&S.length:y)||g||m||f!=null&&f.onUpdate||x||f!=null&&f.onCreate||h||E||z?v.jsxs(v.Fragment,{children:[f&&v.jsx(r,{ref:N,...f}),y,(g||m||(f==null?void 0:f.onUpdate))&&v.jsx(c,{value:b,onClick:u=>Q(u)}),(x||(f==null?void 0:f.onCreate))&&v.jsx(A,{value:b,onClick:u=>Q(u,!1,!0)}),E&&v.jsx(V.ExportButton,{value:b,onClick:async u=>await E(u)}),z&&v.jsx(s,{value:b,disabled:J,shouldConfirm:Z,loading:J&&b[j]===L,onClick:async u=>{q==null||q(u[j]),await z({[j]:u[j]})}}),h&&v.jsx(H,{value:b,disabled:K,shouldConfirm:_,loading:K&&b[j]===L,onClick:async u=>{q==null||q(u[j]),await h({[j]:u[j]})}})]}):void 0}module.exports=F;
1
+ "use strict";const v=require("react/jsx-runtime"),Y=require("react"),A=require("../../common/button/CloneButtonTable.cjs.js"),H=require("../../common/button/DeleteButtonTable.cjs.js"),V=require("../../common/button/ExportButton.cjs.js"),c=require("../../common/button/HideButtonTable.cjs.js"),k=require("../../common/button/UpdateButtonTable.cjs.js"),s=require("../modal/index.cjs.js");function r({data:b,idField:j="id",extraAction:h,onUpdate:G,onClickUpdate:m,onClickClone:y,onDelete:T,onHide:g,onExport:z,isHiding:J,isDeleting:K,confirmHiding:Z,confirmDeleting:_,closeViewOnClickUpdate:$,recentUpdateOrDeleteId:L,setRecentUpdateOrDeleteId:q,setOpenView:E,inBuiltModalProps:f}){var S;const x=h==null?void 0:h(b),N=Y.useRef(null),Q=Y.useCallback((u,w=!0,W=!1)=>{var X;q==null||q(u[j]),f?(X=N.current)==null||X.update(u,w,W):W?y==null||y(u):m==null||m(u),$&&(E==null||E(void 0))},[f,m]);return(Array.isArray(x)?(S=x==null?void 0:x.filter(Boolean))!=null&&S.length:x)||G||m||f!=null&&f.onUpdate||y||f!=null&&f.onCreate||T||z||g?v.jsxs(v.Fragment,{children:[f&&v.jsx(s,{ref:N,...f}),x,(G||m||(f==null?void 0:f.onUpdate))&&v.jsx(k,{value:b,onClick:u=>Q(u)}),(y||(f==null?void 0:f.onCreate))&&v.jsx(A,{value:b,onClick:u=>Q(u,!1,!0)}),z&&v.jsx(V.ExportButton,{value:b,onClick:async u=>await z(u)}),g&&v.jsx(c,{value:b,disabled:J,shouldConfirm:Z,loading:J&&b[j]===L,onClick:async u=>{q==null||q(u[j]),await g({[j]:u[j]})}}),T&&v.jsx(H,{value:b,disabled:K,shouldConfirm:_,loading:K&&b[j]===L,onClick:async u=>{q==null||q(u[j]),await T({[j]:u[j]})}})]}):void 0}module.exports=r;
@@ -1,21 +1,21 @@
1
- import { jsxs as E, Fragment as H, jsx as j } from "react/jsx-runtime";
1
+ import { jsxs as E, Fragment as H, jsx as g } from "react/jsx-runtime";
2
2
  import { useRef as x, useCallback as V } from "react";
3
- import F from "../../common/button/CloneButtonTable.es.js";
4
- import k from "../../common/button/DeleteButtonTable.es.js";
5
- import { ExportButton as r } from "../../common/button/ExportButton.es.js";
6
- import C from "../../common/button/HideButtonTable.es.js";
3
+ import k from "../../common/button/CloneButtonTable.es.js";
4
+ import C from "../../common/button/DeleteButtonTable.es.js";
5
+ import { ExportButton as F } from "../../common/button/ExportButton.es.js";
6
+ import r from "../../common/button/HideButtonTable.es.js";
7
7
  import R from "../../common/button/UpdateButtonTable.es.js";
8
- import I from "../modal/index.es.js";
8
+ import c from "../modal/index.es.js";
9
9
  function a({
10
10
  data: y,
11
11
  idField: b = "id",
12
- extraAction: q,
13
- onUpdate: z,
12
+ extraAction: u,
13
+ onUpdate: K,
14
14
  onClickUpdate: h,
15
- onClickClone: T,
16
- onDelete: u,
17
- onHide: G,
18
- onExport: J,
15
+ onClickClone: j,
16
+ onDelete: q,
17
+ onHide: z,
18
+ onExport: G,
19
19
  isHiding: L,
20
20
  isDeleting: N,
21
21
  confirmHiding: _,
@@ -23,61 +23,56 @@ function a({
23
23
  closeViewOnClickUpdate: w,
24
24
  recentUpdateOrDeleteId: Q,
25
25
  setRecentUpdateOrDeleteId: v,
26
- setOpenView: K,
26
+ setOpenView: J,
27
27
  inBuiltModalProps: f
28
28
  }) {
29
29
  var X;
30
- const g = q == null ? void 0 : q(y), S = x(null), W = V(
30
+ const T = u == null ? void 0 : u(y), S = x(null), W = V(
31
31
  (m, A = !0, Y = !1) => {
32
32
  var Z;
33
- v == null || v(m[b]), f ? (Z = S.current) == null || Z.update(m, A, Y) : Y ? T == null || T(m) : h == null || h(m), w && (K == null || K(void 0));
33
+ v == null || v(m[b]), f ? (Z = S.current) == null || Z.update(m, A, Y) : Y ? j == null || j(m) : h == null || h(m), w && (J == null || J(void 0));
34
34
  },
35
35
  [f, h]
36
36
  );
37
- return console.log({
38
- onUpdate: z,
39
- onClickUpdate: h,
40
- onClickClone: T,
41
- onDelete: u
42
- }), (Array.isArray(g) ? (X = g == null ? void 0 : g.filter(Boolean)) != null && X.length : g) || z || h || f != null && f.onUpdate || T || f != null && f.onCreate || u || J || G ? /* @__PURE__ */ E(H, { children: [
43
- f && /* @__PURE__ */ j(I, { ref: S, ...f }),
44
- g,
45
- (z || h || (f == null ? void 0 : f.onUpdate)) && /* @__PURE__ */ j(R, { value: y, onClick: (m) => W(m) }),
46
- (T || (f == null ? void 0 : f.onCreate)) && /* @__PURE__ */ j(
47
- F,
37
+ return (Array.isArray(T) ? (X = T == null ? void 0 : T.filter(Boolean)) != null && X.length : T) || K || h || f != null && f.onUpdate || j || f != null && f.onCreate || q || G || z ? /* @__PURE__ */ E(H, { children: [
38
+ f && /* @__PURE__ */ g(c, { ref: S, ...f }),
39
+ T,
40
+ (K || h || (f == null ? void 0 : f.onUpdate)) && /* @__PURE__ */ g(R, { value: y, onClick: (m) => W(m) }),
41
+ (j || (f == null ? void 0 : f.onCreate)) && /* @__PURE__ */ g(
42
+ k,
48
43
  {
49
44
  value: y,
50
45
  onClick: (m) => W(m, !1, !0)
51
46
  }
52
47
  ),
53
- J && /* @__PURE__ */ j(
54
- r,
48
+ G && /* @__PURE__ */ g(
49
+ F,
55
50
  {
56
51
  value: y,
57
- onClick: async (m) => await J(m)
52
+ onClick: async (m) => await G(m)
58
53
  }
59
54
  ),
60
- G && /* @__PURE__ */ j(
61
- C,
55
+ z && /* @__PURE__ */ g(
56
+ r,
62
57
  {
63
58
  value: y,
64
59
  disabled: L,
65
60
  shouldConfirm: _,
66
61
  loading: L && y[b] === Q,
67
62
  onClick: async (m) => {
68
- v == null || v(m[b]), await G({ [b]: m[b] });
63
+ v == null || v(m[b]), await z({ [b]: m[b] });
69
64
  }
70
65
  }
71
66
  ),
72
- u && /* @__PURE__ */ j(
73
- k,
67
+ q && /* @__PURE__ */ g(
68
+ C,
74
69
  {
75
70
  value: y,
76
71
  disabled: N,
77
72
  shouldConfirm: $,
78
73
  loading: N && y[b] === Q,
79
74
  onClick: async (m) => {
80
- v == null || v(m[b]), await u({ [b]: m[b] });
75
+ v == null || v(m[b]), await q({ [b]: m[b] });
81
76
  }
82
77
  }
83
78
  )
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),b=require("@ant-design/icons"),h=require("antd"),A=require("../../common/show-more/index.cjs.js"),F=require("../FileCrudField.cjs.js"),T=require("../ImageCrudField.cjs.js"),j=require("../../util/DateUtil.cjs.js"),q=require("../../util/NumberUtil.cjs.js"),g=require("../../locale/index.cjs.js"),B=require("../../util/CrudUtil.cjs.js"),m=require("../../common/error/ErrorBoundaryComponent.cjs.js");function R({type:l,render:r,...o}){try{return l==="object"?(t,e,i)=>typeof r=="function"?r(t,e,i):"":l==="select"?(t,e,i)=>{if(!t)return"-";const n=o,a=t||(n.items??[]).find(s=>s[n.innerFieldId??"key"]===e[B.getRealName(o.name,"upsertFieldName")]),f=n.multiple?Array.isArray(a)?a.map(s=>s==null?void 0:s[n.innerFieldLabel??"name"]):void 0:a==null?void 0:a[n.innerFieldLabel??"value"];return typeof r=="function"?r(f,e,i):Array.isArray(f)?f.join(", "):f}:l==="number"?(t,e,i)=>typeof r=="function"?r(t,e,i):o!=null&&o.int?q.default.toInt(t,o.formatted):q.default.toMoney(t):l==="enum"?(t,e,i)=>{var s;if(!t)return"-";const n=o;if(typeof r=="function")return r(t,e,i);if(n.multiple){const c=Array.isArray(t)?t:t?[t]:[];return typeof n.tagRender=="object"?u.jsx(m.ErrorBoundaryComponent,{children:u.jsx(h.Space,{wrap:!0,children:c.map((d,y)=>{var v,S;const x=(v=n.tagRender)==null?void 0:v[d],C=g.tWithOrWithoutNS(((S=n==null?void 0:n.translation)==null?void 0:S[d??""])??d);return x?u.jsx(h.Tag,{color:x.color,children:C},y+d):C})})}):n!=null&&n.translation?u.jsx(m.ErrorBoundaryComponent,{children:c==null?void 0:c.map(d=>{var y;return g.tWithOrWithoutNS(((y=n==null?void 0:n.translation)==null?void 0:y[d??""])??d)}).join(", ")}):c==null?void 0:c.join(", ")}const a=((s=n==null?void 0:n.translation)==null?void 0:s[t??""])??t,f=g.tWithOrWithoutNS(a);if(typeof n.tagRender=="object"){const c=n.tagRender[t];if(c)return u.jsx(h.Tag,{color:c.color,children:f})}return f}:l==="date"?(t,e,i)=>{if(!t)return"-";const n=o!=null&&o.formatTime?j.formatDateTime(t):j.formatDate(t);return u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,e,i):n})}:l==="checkbox"?(t,e,i)=>typeof r=="function"?r(t,e,i):t?u.jsx(b.CheckOutlined,{}):u.jsx(b.CloseOutlined,{}):l==="image"?(t,e,i)=>t?u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,e,i):u.jsx(T.ImageCrudCellValue,{value:t,provider:o.provider})}):"-":l==="file"?(t,e,i)=>t?u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,e,i):u.jsx(F.FileCrudCellValue,{value:t,provider:o.provider})}):"":l==="time"?(t,e,i)=>{if(!t)return"-";const n=o==null?void 0:o.format,a=o==null?void 0:o.use12Hours,f=j.formatTime(t,n||(a?"hh:mm:ss A":void 0));return u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,e,i):f})}:l==="color"?(t,e,i)=>t?typeof r=="function"?r(t,e,i):typeof t=="string"&&t.startsWith("#")?u.jsx(h.Tooltip,{title:t,children:u.jsx(h.Avatar,{style:{backgroundColor:t}})}):String(t):"-":l==="textarea"?(t,e,i)=>{if(!t)return"-";const n=o,a=n.truncated??1;return typeof r=="function"?r(t,e,i):a?u.jsx(m.ErrorBoundaryComponent,{children:u.jsx(A.ShowMore,{lines:a===!0?1:a,children:n.rich?u.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:t}}):t})}):n.rich?u.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:t}}):t}:typeof r=="function"?r:(t,e,i)=>t}catch(t){return console.warn("An error occurred while rendering the value for field: "+String(o.name),t),"-"}}exports.getRendererValueCrudViewer=R;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),b=require("@ant-design/icons"),h=require("antd"),A=require("../../common/show-more/index.cjs.js"),F=require("../FileCrudField.cjs.js"),T=require("../ImageCrudField.cjs.js"),j=require("../../util/DateUtil.cjs.js"),q=require("../../util/NumberUtil.cjs.js"),g=require("../../locale/index.cjs.js"),B=require("../../util/CrudUtil.cjs.js"),m=require("../../common/error/ErrorBoundaryComponent.cjs.js");function R({type:c,render:r,...i}){try{return c==="object"?(t,o,e)=>typeof r=="function"?r(t,o,e):"":c==="select"?(t,o,e)=>{if(!t)return"-";const n=i,l=t||(n.items??[]).find(s=>s[n.innerFieldId??"key"]===o[B.getRealName(i.name,"upsertFieldName")]),a=n.multiple?Array.isArray(l)?l.map(s=>s==null?void 0:s[n.innerFieldLabel??"name"]):void 0:l==null?void 0:l[n.innerFieldLabel??"value"];return typeof r=="function"?r(a,o,e):Array.isArray(a)?a.join(", "):a}:c==="number"?(t,o,e)=>typeof r=="function"?r(t,o,e):i!=null&&i.int?q.default.toInt(t,i.formatted):q.default.toMoney(t):c==="enum"?(t,o,e)=>{var s;if(!t)return"-";const n=i;if(typeof r=="function")return r(t,o,e);if(n.multiple){const f=Array.isArray(t)?t:t?[t]:[];return typeof n.tagRender=="object"?u.jsx(m.ErrorBoundaryComponent,{children:u.jsx(h.Space,{wrap:!0,children:f.map((d,y)=>{var v,S;const x=(v=n.tagRender)==null?void 0:v[d],C=g.tWithOrWithoutNS(((S=n==null?void 0:n.translation)==null?void 0:S[d??""])??d);return x?u.jsx(h.Tag,{color:x.color,children:C},y+d):C})})}):n!=null&&n.translation?u.jsx(m.ErrorBoundaryComponent,{children:f==null?void 0:f.map(d=>{var y;return g.tWithOrWithoutNS(((y=n==null?void 0:n.translation)==null?void 0:y[d??""])??d)}).join(", ")}):f==null?void 0:f.join(", ")}const l=((s=n==null?void 0:n.translation)==null?void 0:s[t??""])??t,a=g.tWithOrWithoutNS(l);if(typeof n.tagRender=="object"){const f=n.tagRender[t];if(f)return u.jsx(h.Tag,{color:f.color,children:a})}return a}:c==="date"?(t,o,e)=>{if(!t)return"-";const n=i!=null&&i.formatTime?j.formatDateTime(t):j.formatDate(t);return u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,o,e):n})}:c==="checkbox"?(t,o,e)=>typeof r=="function"?r(t,o,e):t?u.jsx(b.CheckOutlined,{}):u.jsx(b.CloseOutlined,{}):c==="image"?(t,o,e)=>t?u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,o,e):u.jsx(T.ImageCrudCellValue,{value:t,provider:i.provider})}):"-":c==="file"?(t,o,e)=>t?u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,o,e):u.jsx(F.FileCrudCellValue,{value:t,provider:i.provider})}):"":c==="time"?(t,o,e)=>{if(!t)return"-";const n=i==null?void 0:i.format,l=i==null?void 0:i.use12Hours,a=j.formatTime(t,n||(l?"hh:mm:ss A":void 0));return u.jsx(m.ErrorBoundaryComponent,{children:typeof r=="function"?r(t,o,e):a})}:c==="color"?(t,o,e)=>t?typeof r=="function"?r(t,o,e):typeof t=="string"&&t.startsWith("#")?u.jsx(h.Tooltip,{title:t,children:u.jsx(h.Avatar,{style:{backgroundColor:t}})}):String(t):"-":c==="textarea"?(t,o,e)=>{if(!t)return"-";const n=i,l=n.truncated??1,a=typeof r=="function"?r(t,o,e):l?u.jsx(m.ErrorBoundaryComponent,{children:u.jsx(A.ShowMore,{lines:l===!0?1:l,children:n.rich?u.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:t}}):t})}):n.rich?u.jsx("div",{style:{all:"unset"},dangerouslySetInnerHTML:{__html:t}}):t;return console.log("component",a),a}:typeof r=="function"?r:(t,o,e)=>t}catch(t){return console.warn("An error occurred while rendering the value for field: "+String(i.name),t),"-"}}exports.getRendererValueCrudViewer=R;
@@ -4,62 +4,62 @@ import { Space as R, Tag as S, Tooltip as w, Avatar as I } from "antd";
4
4
  import { ShowMore as V } from "../../common/show-more/index.es.js";
5
5
  import { FileCrudCellValue as k } from "../FileCrudField.es.js";
6
6
  import { ImageCrudCellValue as x } from "../ImageCrudField.es.js";
7
- import y from "../../util/DateUtil.es.js";
7
+ import g from "../../util/DateUtil.es.js";
8
8
  import j from "../../util/NumberUtil.es.js";
9
- import { tWithOrWithoutNS as g } from "../../locale/index.es.js";
9
+ import { tWithOrWithoutNS as y } from "../../locale/index.es.js";
10
10
  import H from "../../util/CrudUtil.es.js";
11
11
  import { ErrorBoundaryComponent as h } from "../../common/error/ErrorBoundaryComponent.es.js";
12
12
  function z({
13
13
  type: u,
14
- render: n,
14
+ render: i,
15
15
  ...l
16
16
  }) {
17
17
  try {
18
- return u === "object" ? (t, o, r) => typeof n == "function" ? n(t, o, r) : "" : u === "select" ? (t, o, r) => {
18
+ return u === "object" ? (t, o, r) => typeof i == "function" ? i(t, o, r) : "" : u === "select" ? (t, o, r) => {
19
19
  if (!t) return "-";
20
- const i = l, a = t || (i.items ?? []).find(
21
- (m) => m[i.innerFieldId ?? "key"] === o[H.getRealName(l.name, "upsertFieldName")]
22
- ), f = i.multiple ? Array.isArray(a) ? a.map((m) => m == null ? void 0 : m[i.innerFieldLabel ?? "name"]) : void 0 : a == null ? void 0 : a[i.innerFieldLabel ?? "value"];
23
- return typeof n == "function" ? n(f, o, r) : Array.isArray(f) ? f.join(", ") : f;
24
- } : u === "number" ? (t, o, r) => typeof n == "function" ? n(t, o, r) : l != null && l.int ? j.toInt(t, l.formatted) : j.toMoney(t) : u === "enum" ? (t, o, r) => {
20
+ const n = l, a = t || (n.items ?? []).find(
21
+ (m) => m[n.innerFieldId ?? "key"] === o[H.getRealName(l.name, "upsertFieldName")]
22
+ ), c = n.multiple ? Array.isArray(a) ? a.map((m) => m == null ? void 0 : m[n.innerFieldLabel ?? "name"]) : void 0 : a == null ? void 0 : a[n.innerFieldLabel ?? "value"];
23
+ return typeof i == "function" ? i(c, o, r) : Array.isArray(c) ? c.join(", ") : c;
24
+ } : u === "number" ? (t, o, r) => typeof i == "function" ? i(t, o, r) : l != null && l.int ? j.toInt(t, l.formatted) : j.toMoney(t) : u === "enum" ? (t, o, r) => {
25
25
  var m;
26
26
  if (!t) return "-";
27
- const i = l;
28
- if (typeof n == "function")
29
- return n(t, o, r);
30
- if (i.multiple) {
31
- const c = Array.isArray(t) ? t : t ? [t] : [];
32
- return typeof i.tagRender == "object" ? /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(R, { wrap: !0, children: c.map((d, s) => {
27
+ const n = l;
28
+ if (typeof i == "function")
29
+ return i(t, o, r);
30
+ if (n.multiple) {
31
+ const f = Array.isArray(t) ? t : t ? [t] : [];
32
+ return typeof n.tagRender == "object" ? /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(R, { wrap: !0, children: f.map((d, s) => {
33
33
  var b, A;
34
- const v = (b = i.tagRender) == null ? void 0 : b[d], C = g(
35
- ((A = i == null ? void 0 : i.translation) == null ? void 0 : A[d ?? ""]) ?? d
34
+ const v = (b = n.tagRender) == null ? void 0 : b[d], C = y(
35
+ ((A = n == null ? void 0 : n.translation) == null ? void 0 : A[d ?? ""]) ?? d
36
36
  );
37
37
  return v ? /* @__PURE__ */ e(S, { color: v.color, children: C }, s + d) : C;
38
- }) }) }) : i != null && i.translation ? /* @__PURE__ */ e(h, { children: c == null ? void 0 : c.map(
38
+ }) }) }) : n != null && n.translation ? /* @__PURE__ */ e(h, { children: f == null ? void 0 : f.map(
39
39
  (d) => {
40
40
  var s;
41
- return g(((s = i == null ? void 0 : i.translation) == null ? void 0 : s[d ?? ""]) ?? d);
41
+ return y(((s = n == null ? void 0 : n.translation) == null ? void 0 : s[d ?? ""]) ?? d);
42
42
  }
43
- ).join(", ") }) : c == null ? void 0 : c.join(", ");
43
+ ).join(", ") }) : f == null ? void 0 : f.join(", ");
44
44
  }
45
- const a = ((m = i == null ? void 0 : i.translation) == null ? void 0 : m[t ?? ""]) ?? t, f = g(a);
46
- if (typeof i.tagRender == "object") {
47
- const c = i.tagRender[t];
48
- if (c)
49
- return /* @__PURE__ */ e(S, { color: c.color, children: f });
45
+ const a = ((m = n == null ? void 0 : n.translation) == null ? void 0 : m[t ?? ""]) ?? t, c = y(a);
46
+ if (typeof n.tagRender == "object") {
47
+ const f = n.tagRender[t];
48
+ if (f)
49
+ return /* @__PURE__ */ e(S, { color: f.color, children: c });
50
50
  }
51
- return f;
51
+ return c;
52
52
  } : u === "date" ? (t, o, r) => {
53
53
  if (!t) return "-";
54
- const i = l != null && l.formatTime ? y.formatDateTime(t) : y.formatDate(t);
55
- return /* @__PURE__ */ e(h, { children: typeof n == "function" ? n(t, o, r) : i });
56
- } : u === "checkbox" ? (t, o, r) => typeof n == "function" ? n(t, o, r) : t ? /* @__PURE__ */ e(T, {}) : /* @__PURE__ */ e(F, {}) : u === "image" ? (t, o, r) => t ? /* @__PURE__ */ e(h, { children: typeof n == "function" ? n(t, o, r) : /* @__PURE__ */ e(
54
+ const n = l != null && l.formatTime ? g.formatDateTime(t) : g.formatDate(t);
55
+ return /* @__PURE__ */ e(h, { children: typeof i == "function" ? i(t, o, r) : n });
56
+ } : u === "checkbox" ? (t, o, r) => typeof i == "function" ? i(t, o, r) : t ? /* @__PURE__ */ e(T, {}) : /* @__PURE__ */ e(F, {}) : u === "image" ? (t, o, r) => t ? /* @__PURE__ */ e(h, { children: typeof i == "function" ? i(t, o, r) : /* @__PURE__ */ e(
57
57
  x,
58
58
  {
59
59
  value: t,
60
60
  provider: l.provider
61
61
  }
62
- ) }) : "-" : u === "file" ? (t, o, r) => t ? /* @__PURE__ */ e(h, { children: typeof n == "function" ? n(t, o, r) : /* @__PURE__ */ e(
62
+ ) }) : "-" : u === "file" ? (t, o, r) => t ? /* @__PURE__ */ e(h, { children: typeof i == "function" ? i(t, o, r) : /* @__PURE__ */ e(
63
63
  k,
64
64
  {
65
65
  value: t,
@@ -67,28 +67,28 @@ function z({
67
67
  }
68
68
  ) }) : "" : u === "time" ? (t, o, r) => {
69
69
  if (!t) return "-";
70
- const i = l == null ? void 0 : l.format, a = l == null ? void 0 : l.use12Hours, f = y.formatTime(
70
+ const n = l == null ? void 0 : l.format, a = l == null ? void 0 : l.use12Hours, c = g.formatTime(
71
71
  t,
72
- i || (a ? "hh:mm:ss A" : void 0)
72
+ n || (a ? "hh:mm:ss A" : void 0)
73
73
  );
74
- return /* @__PURE__ */ e(h, { children: typeof n == "function" ? n(t, o, r) : f });
75
- } : u === "color" ? (t, o, r) => t ? typeof n == "function" ? n(t, o, r) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ e(w, { title: t, children: /* @__PURE__ */ e(I, { style: { backgroundColor: t } }) }) : String(t) : "-" : u === "textarea" ? (t, o, r) => {
74
+ return /* @__PURE__ */ e(h, { children: typeof i == "function" ? i(t, o, r) : c });
75
+ } : u === "color" ? (t, o, r) => t ? typeof i == "function" ? i(t, o, r) : typeof t == "string" && t.startsWith("#") ? /* @__PURE__ */ e(w, { title: t, children: /* @__PURE__ */ e(I, { style: { backgroundColor: t } }) }) : String(t) : "-" : u === "textarea" ? (t, o, r) => {
76
76
  if (!t) return "-";
77
- const i = l, a = i.truncated ?? 1;
78
- return typeof n == "function" ? n(t, o, r) : a ? /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(V, { lines: a === !0 ? 1 : a, children: i.rich ? /* @__PURE__ */ e(
77
+ const n = l, a = n.truncated ?? 1, c = typeof i == "function" ? i(t, o, r) : a ? /* @__PURE__ */ e(h, { children: /* @__PURE__ */ e(V, { lines: a === !0 ? 1 : a, children: n.rich ? /* @__PURE__ */ e(
79
78
  "div",
80
79
  {
81
80
  style: { all: "unset" },
82
81
  dangerouslySetInnerHTML: { __html: t }
83
82
  }
84
- ) : t }) }) : i.rich ? /* @__PURE__ */ e(
83
+ ) : t }) }) : n.rich ? /* @__PURE__ */ e(
85
84
  "div",
86
85
  {
87
86
  style: { all: "unset" },
88
87
  dangerouslySetInnerHTML: { __html: t }
89
88
  }
90
89
  ) : t;
91
- } : typeof n == "function" ? n : (t, o, r) => t;
90
+ return console.log("component", c), c;
91
+ } : typeof i == "function" ? i : (t, o, r) => t;
92
92
  } catch (t) {
93
93
  return console.warn(
94
94
  "An error occurred while rendering the value for field: " + String(l.name),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.2.5",
4
+ "version": "1.2.7",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",