@kingteza/crud-component 1.0.44 → 1.0.45
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
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),h=require("antd"),l=require("react"),q=require("../../locale/index.cjs.js");;/* empty css */const d=require("react-router-dom"),y=({className:i,to:e,onClick:t,tooltip:o,ref:g,...r})=>{var u;const{t:n}=q.useTranslationLib();let s;try{s=(u=d.useNavigate)==null?void 0:u.call(d)}catch(a){console.error(a)}const c=l.useMemo(()=>f.jsx(h.Button,{onClick:t||(e&&s?()=>s(e):void 0),className:i,...r,children:r.children}),[i,s,t,r,n,e]);return o?f.jsx(h.Tooltip,{title:o,children:c}):c},j=({className:i,to:e,onClick:t,tooltip:o,ref:g,...r})=>{let n;try{n=d.useNavigate()}catch(x){console.error(x)}const[s,c]=l.useState(!1),u=l.useCallback(async x=>{try{return c(!0),await t(x)}finally{c(!1)}},[t]),a=l.useMemo(()=>f.jsx(h.Button,{loading:s||r.loading,onClick:t?u:e?()=>{n?n==null||n(e):window.location.href=e}:void 0,className:i,...r}),[u,i,s,n,t,r,e]);return o?f.jsx(h.Tooltip,{title:o,children:a}):a};y.Async=j;module.exports=y;
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { useMemo as
|
|
2
|
+
import { Button as u, Tooltip as m } from "antd";
|
|
3
|
+
import { useMemo as h, useState as b, useCallback as v } from "react";
|
|
4
4
|
import { useTranslationLib as w } from "../../locale/index.es.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { useNavigate as
|
|
6
|
+
import { useNavigate as y } from "react-router-dom";
|
|
7
7
|
const x = ({
|
|
8
8
|
className: i,
|
|
9
9
|
to: r,
|
|
10
|
-
onClick:
|
|
10
|
+
onClick: t,
|
|
11
11
|
tooltip: a,
|
|
12
|
-
ref:
|
|
12
|
+
ref: g,
|
|
13
13
|
...n
|
|
14
14
|
}) => {
|
|
15
15
|
var l;
|
|
16
|
-
const { t } = w();
|
|
16
|
+
const { t: e } = w();
|
|
17
17
|
let o;
|
|
18
18
|
try {
|
|
19
|
-
o = (l =
|
|
19
|
+
o = (l = y) == null ? void 0 : l();
|
|
20
20
|
} catch (s) {
|
|
21
21
|
console.error(s);
|
|
22
22
|
}
|
|
23
|
-
const c =
|
|
23
|
+
const c = h(
|
|
24
24
|
() => /* @__PURE__ */ f(
|
|
25
|
-
|
|
25
|
+
u,
|
|
26
26
|
{
|
|
27
|
-
onClick:
|
|
27
|
+
onClick: t || (r && o ? () => o(r) : void 0),
|
|
28
28
|
className: i,
|
|
29
29
|
...n,
|
|
30
|
-
children: n.children
|
|
30
|
+
children: n.children
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
[i, o,
|
|
33
|
+
[i, o, t, n, e, r]
|
|
34
34
|
);
|
|
35
35
|
return a ? /* @__PURE__ */ f(m, { title: a, children: c }) : c;
|
|
36
36
|
}, A = ({
|
|
37
37
|
className: i,
|
|
38
38
|
to: r,
|
|
39
|
-
onClick:
|
|
39
|
+
onClick: t,
|
|
40
40
|
tooltip: a,
|
|
41
|
-
ref:
|
|
41
|
+
ref: g,
|
|
42
42
|
...n
|
|
43
43
|
}) => {
|
|
44
|
-
let
|
|
44
|
+
let e;
|
|
45
45
|
try {
|
|
46
|
-
|
|
47
|
-
} catch (
|
|
48
|
-
console.error(
|
|
46
|
+
e = y();
|
|
47
|
+
} catch (d) {
|
|
48
|
+
console.error(d);
|
|
49
49
|
}
|
|
50
|
-
const [o, c] =
|
|
51
|
-
async (
|
|
50
|
+
const [o, c] = b(!1), l = v(
|
|
51
|
+
async (d) => {
|
|
52
52
|
try {
|
|
53
|
-
return c(!0), await
|
|
53
|
+
return c(!0), await t(d);
|
|
54
54
|
} finally {
|
|
55
55
|
c(!1);
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
|
-
[
|
|
59
|
-
), s =
|
|
58
|
+
[t]
|
|
59
|
+
), s = h(
|
|
60
60
|
() => /* @__PURE__ */ f(
|
|
61
|
-
|
|
61
|
+
u,
|
|
62
62
|
{
|
|
63
63
|
loading: o || n.loading,
|
|
64
|
-
onClick:
|
|
65
|
-
|
|
64
|
+
onClick: t ? l : r ? () => {
|
|
65
|
+
e ? e == null || e(r) : window.location.href = r;
|
|
66
66
|
} : void 0,
|
|
67
67
|
className: i,
|
|
68
68
|
...n
|
|
69
69
|
}
|
|
70
70
|
),
|
|
71
|
-
[l, i, o,
|
|
71
|
+
[l, i, o, e, t, n, r]
|
|
72
72
|
);
|
|
73
73
|
return a ? /* @__PURE__ */ f(m, { title: a, children: s }) : s;
|
|
74
74
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingteza/crud-component",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.45",
|
|
5
5
|
"description": "React CRUD component library with Ant Design",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/react-show-more-text": "^1.4.5",
|
|
87
87
|
"@types/uuid": "^10.0.0",
|
|
88
88
|
"@vitejs/plugin-react": "^4.3.4",
|
|
89
|
-
"antd": "^5.22.
|
|
89
|
+
"antd": "^5.22.7",
|
|
90
90
|
"eslint": "^9.17.0",
|
|
91
91
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
92
92
|
"eslint-plugin-react-refresh": "^0.4.16",
|