@kingteza/crud-component 1.2.5 → 1.2.6

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
  )
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.6",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",