@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.
- package/dist/common/date-picker/TimePicker.cjs.js +1 -1
- package/dist/common/date-picker/TimePicker.es.js +35 -37
- package/dist/common/picker/ImagePicker.cjs.js +1 -1
- package/dist/common/picker/ImagePicker.es.js +35 -37
- package/dist/crud/CrudFormWizard.cjs.js +1 -1
- package/dist/crud/CrudFormWizard.es.js +34 -34
- package/dist/crud/CrudReportComponent.cjs.js +3 -3
- package/dist/crud/CrudReportComponent.es.js +41 -41
- package/dist/crud/FileCrudField.cjs.js +1 -1
- package/dist/crud/FileCrudField.es.js +81 -86
- package/dist/crud/ImageCrudField.cjs.js +1 -1
- package/dist/crud/ImageCrudField.es.js +25 -26
- package/dist/crud/actions/index.cjs.js +1 -1
- package/dist/crud/actions/index.es.js +30 -35
- package/package.json +1 -1
|
@@ -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"),
|
|
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
|
|
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
|
|
4
|
-
import
|
|
5
|
-
import { ExportButton as
|
|
6
|
-
import
|
|
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
|
|
8
|
+
import c from "../modal/index.es.js";
|
|
9
9
|
function a({
|
|
10
10
|
data: y,
|
|
11
11
|
idField: b = "id",
|
|
12
|
-
extraAction:
|
|
13
|
-
onUpdate:
|
|
12
|
+
extraAction: u,
|
|
13
|
+
onUpdate: K,
|
|
14
14
|
onClickUpdate: h,
|
|
15
|
-
onClickClone:
|
|
16
|
-
onDelete:
|
|
17
|
-
onHide:
|
|
18
|
-
onExport:
|
|
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:
|
|
26
|
+
setOpenView: J,
|
|
27
27
|
inBuiltModalProps: f
|
|
28
28
|
}) {
|
|
29
29
|
var X;
|
|
30
|
-
const
|
|
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 ?
|
|
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
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
54
|
-
|
|
48
|
+
G && /* @__PURE__ */ g(
|
|
49
|
+
F,
|
|
55
50
|
{
|
|
56
51
|
value: y,
|
|
57
|
-
onClick: async (m) => await
|
|
52
|
+
onClick: async (m) => await G(m)
|
|
58
53
|
}
|
|
59
54
|
),
|
|
60
|
-
|
|
61
|
-
|
|
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
|
|
63
|
+
v == null || v(m[b]), await z({ [b]: m[b] });
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
66
|
),
|
|
72
|
-
|
|
73
|
-
|
|
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
|
|
75
|
+
v == null || v(m[b]), await q({ [b]: m[b] });
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
)
|