@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 y=require("react/jsx-runtime"),f=require("antd"),l=require("react"),q=require("../../locale/index.cjs.js");;/* empty css */const d=require("react-router-dom"),x=({className:s,to:t,onClick:n,tooltip:o,ref:g,...r})=>{var u;const{t:e}=q.useTranslationLib();let i;try{i=(u=d.useNavigate)==null?void 0:u.call(d)}catch(a){console.error(a)}const c=l.useMemo(()=>y.jsx(f.Button,{onClick:n||(t&&i?()=>i(t):void 0),className:s,...r,children:r.children||e(`button.${r.type}`)}),[s,i,n,r,e,t]);return o?y.jsx(f.Tooltip,{title:o,children:c}):c},b=({className:s,to:t,onClick:n,tooltip:o,ref:g,...r})=>{let e;try{e=d.useNavigate()}catch(h){console.error(h)}const[i,c]=l.useState(!1),u=l.useCallback(async h=>{try{return c(!0),await n(h)}finally{c(!1)}},[n]),a=l.useMemo(()=>y.jsx(f.Button,{loading:i||r.loading,onClick:n?u:t?()=>{e?e==null||e(t):window.location.href=t}:void 0,className:s,...r}),[u,s,i,e,n,r,t]);return o?y.jsx(f.Tooltip,{title:o,children:a}):a};x.Async=b;module.exports=x;
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 d, Tooltip as m } from "antd";
3
- import { useMemo as y, useState as g, useCallback as v } from "react";
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 h } from "react-router-dom";
6
+ import { useNavigate as y } from "react-router-dom";
7
7
  const x = ({
8
8
  className: i,
9
9
  to: r,
10
- onClick: e,
10
+ onClick: t,
11
11
  tooltip: a,
12
- ref: b,
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 = h) == null ? void 0 : l();
19
+ o = (l = y) == null ? void 0 : l();
20
20
  } catch (s) {
21
21
  console.error(s);
22
22
  }
23
- const c = y(
23
+ const c = h(
24
24
  () => /* @__PURE__ */ f(
25
- d,
25
+ u,
26
26
  {
27
- onClick: e || (r && o ? () => o(r) : void 0),
27
+ onClick: t || (r && o ? () => o(r) : void 0),
28
28
  className: i,
29
29
  ...n,
30
- children: n.children || t(`button.${n.type}`)
30
+ children: n.children
31
31
  }
32
32
  ),
33
- [i, o, e, n, t, r]
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: e,
39
+ onClick: t,
40
40
  tooltip: a,
41
- ref: b,
41
+ ref: g,
42
42
  ...n
43
43
  }) => {
44
- let t;
44
+ let e;
45
45
  try {
46
- t = h();
47
- } catch (u) {
48
- console.error(u);
46
+ e = y();
47
+ } catch (d) {
48
+ console.error(d);
49
49
  }
50
- const [o, c] = g(!1), l = v(
51
- async (u) => {
50
+ const [o, c] = b(!1), l = v(
51
+ async (d) => {
52
52
  try {
53
- return c(!0), await e(u);
53
+ return c(!0), await t(d);
54
54
  } finally {
55
55
  c(!1);
56
56
  }
57
57
  },
58
- [e]
59
- ), s = y(
58
+ [t]
59
+ ), s = h(
60
60
  () => /* @__PURE__ */ f(
61
- d,
61
+ u,
62
62
  {
63
63
  loading: o || n.loading,
64
- onClick: e ? l : r ? () => {
65
- t ? t == null || t(r) : window.location.href = r;
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, t, e, n, r]
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.44",
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.6",
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",