@kingteza/crud-component 1.14.8 → 1.14.9

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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),d=require("./translations/en.cjs.js"),r=require("i18next"),o=require("react-i18next"),u={en:{[a.TRANSLATION_NAMESPACE]:d}};exports.i18nInstance=r;const c=(t={})=>{const{translations:n=u,language:e="en",i18nInstance:i}=t,s=i||r;return exports.i18nInstance=s,s.isInitialized?Object.entries(n).forEach(([T,I])=>{Object.entries(I).forEach(([N,A])=>{s.addResourceBundle(T,N,A,!0,!0)})}):s.use(o.initReactI18next).init({resources:n,lng:e,fallbackLng:"en",ns:a.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),s},S=(t,n,e)=>{(e||r).addResourceBundle(t,a.TRANSLATION_NAMESPACE,n,!0,!0)},E=t=>{const n=exports.i18nInstance||r;return n.isInitialized||c({}),console.log("i18nInstance",n,t),o.useTranslation(a.TRANSLATION_NAMESPACE,{...t,i18n:n})},f=t=>{const n=exports.i18nInstance||r;return n.isInitialized||c({}),console.log("i18nInstance",n,t),o.useTranslation(void 0,{...t,i18n:n})},l=(t,n)=>{var e;return(e=exports.i18nInstance)==null?void 0:e.t(t,{ns:a.TRANSLATION_NAMESPACE,...n})},L=(t,n,e)=>{var s;const i=l(t,n);return i&&t&&i!==t?i:e||((s=exports.i18nInstance)==null?void 0:s.t(t,{ns:void 0,...n}))};exports.defaultTranslations=u;exports.setupI18n=c;exports.t=l;exports.tWithOrWithoutNS=L;exports.updateTranslations=S;exports.useTranslationLib=E;exports.useTranslationLibNoNS=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),d=require("./translations/en.cjs.js"),r=require("i18next"),o=require("react-i18next"),c={en:{[a.TRANSLATION_NAMESPACE]:d}};exports.i18nInstance=r;const u=(t={})=>{const{translations:n=c,language:e="en",i18nInstance:i}=t,s=i||r;return exports.i18nInstance=s,s.isInitialized?Object.entries(n).forEach(([T,N])=>{Object.entries(N).forEach(([A,I])=>{s.addResourceBundle(T,A,I,!0,!0)})}):s.use(o.initReactI18next).init({resources:n,lng:e,fallbackLng:"en",ns:a.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),s},S=(t,n,e)=>{(e||r).addResourceBundle(t,a.TRANSLATION_NAMESPACE,n,!0,!0)},E=t=>{const n=exports.i18nInstance||r;return n.isInitialized||u({}),o.useTranslation(a.TRANSLATION_NAMESPACE,{...t,i18n:n})},f=t=>{const n=exports.i18nInstance||r;return n.isInitialized||u({}),o.useTranslation(void 0,{...t,i18n:n})},l=(t,n)=>{var e;return(e=exports.i18nInstance)==null?void 0:e.t(t,{ns:a.TRANSLATION_NAMESPACE,...n})},L=(t,n,e)=>{var s;const i=l(t,n);return i&&t&&i!==t?i:e||((s=exports.i18nInstance)==null?void 0:s.t(t,{ns:void 0,...n}))};exports.defaultTranslations=c;exports.setupI18n=u;exports.t=l;exports.tWithOrWithoutNS=L;exports.updateTranslations=S;exports.useTranslationLib=E;exports.useTranslationLibNoNS=f;
@@ -1,61 +1,61 @@
1
- import { TRANSLATION_NAMESPACE as r } from "./hooks/translation-constants.es.js";
1
+ import { TRANSLATION_NAMESPACE as o } from "./hooks/translation-constants.es.js";
2
2
  import m from "./translations/en.es.js";
3
3
  import a from "i18next";
4
- import { initReactI18next as I, useTranslation as c } from "react-i18next";
5
- const g = {
4
+ import { initReactI18next as p, useTranslation as u } from "react-i18next";
5
+ const N = {
6
6
  en: {
7
- [r]: m
7
+ [o]: m
8
8
  }
9
9
  };
10
10
  let e = a;
11
- const u = (t = {}) => {
11
+ const c = (t = {}) => {
12
12
  const {
13
- translations: n = g,
14
- language: s = "en",
15
- i18nInstance: i
16
- } = t, o = i || a;
17
- return e = o, o.isInitialized ? Object.entries(n).forEach(([l, d]) => {
13
+ translations: n = N,
14
+ language: i = "en",
15
+ i18nInstance: s
16
+ } = t, r = s || a;
17
+ return e = r, r.isInitialized ? Object.entries(n).forEach(([l, d]) => {
18
18
  Object.entries(d).forEach(([f, T]) => {
19
- o.addResourceBundle(l, f, T, !0, !0);
19
+ r.addResourceBundle(l, f, T, !0, !0);
20
20
  });
21
- }) : o.use(I).init({
21
+ }) : r.use(p).init({
22
22
  resources: n,
23
- lng: s,
23
+ lng: i,
24
24
  fallbackLng: "en",
25
- ns: r,
25
+ ns: o,
26
26
  interpolation: {
27
27
  escapeValue: !1
28
28
  }
29
- }), o;
30
- }, E = (t, n, s) => {
31
- (s || a).addResourceBundle(
29
+ }), r;
30
+ }, E = (t, n, i) => {
31
+ (i || a).addResourceBundle(
32
32
  t,
33
- r,
33
+ o,
34
34
  n,
35
35
  !0,
36
36
  !0
37
37
  );
38
38
  }, L = (t) => {
39
39
  const n = e || a;
40
- return n.isInitialized || u({}), console.log("i18nInstance", n, t), c(r, { ...t, i18n: n });
40
+ return n.isInitialized || c({}), u(o, { ...t, i18n: n });
41
41
  }, O = (t) => {
42
42
  const n = e || a;
43
- return n.isInitialized || u({}), console.log("i18nInstance", n, t), c(void 0, { ...t, i18n: n });
44
- }, p = (t, n) => e == null ? void 0 : e.t(t, {
45
- ns: r,
43
+ return n.isInitialized || c({}), u(void 0, { ...t, i18n: n });
44
+ }, I = (t, n) => e == null ? void 0 : e.t(t, {
45
+ ns: o,
46
46
  ...n
47
- }), R = (t, n, s) => {
48
- const i = p(t, n);
49
- return i && t && i !== t ? i : s || (e == null ? void 0 : e.t(t, {
47
+ }), R = (t, n, i) => {
48
+ const s = I(t, n);
49
+ return s && t && s !== t ? s : i || (e == null ? void 0 : e.t(t, {
50
50
  ns: void 0,
51
51
  ...n
52
52
  }));
53
53
  };
54
54
  export {
55
- g as defaultTranslations,
55
+ N as defaultTranslations,
56
56
  e as i18nInstance,
57
- u as setupI18n,
58
- p as t,
57
+ c as setupI18n,
58
+ I as t,
59
59
  R as tWithOrWithoutNS,
60
60
  E as updateTranslations,
61
61
  L as useTranslationLib,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.14.8",
4
+ "version": "1.14.9",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",
@@ -112,7 +112,17 @@
112
112
  "antd": ">=5.22.6",
113
113
  "react": ">=18.3.1",
114
114
  "react-dom": ">=18.3.1",
115
- "react-router-dom": ">=6.3.0"
115
+ "react-router-dom": ">=6.3.0",
116
+ "i18next": "^24.2.0",
117
+ "react-i18next": "^15.2.0"
118
+ },
119
+ "peerDependenciesMeta": {
120
+ "i18next": {
121
+ "optional": true
122
+ },
123
+ "react-i18next": {
124
+ "optional": true
125
+ }
116
126
  },
117
127
  "scripts": {
118
128
  "dev": "vite",