@kingteza/crud-component 1.36.0 → 1.37.0

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.
@@ -5,10 +5,16 @@ export type CrudSearchOption<T> = {
5
5
  } & ({
6
6
  type: "text";
7
7
  name: keyof T;
8
+ label?: string;
9
+ placeholder?: string;
10
+ fieldClassName?: string;
8
11
  } | {
9
12
  type: "select";
10
13
  name: keyof T;
11
14
  multiple?: boolean;
15
+ label?: string;
16
+ placeholder?: string;
17
+ fieldClassName?: string;
12
18
  });
13
19
  export interface CrudSearchComponentProps<T, FormType> {
14
20
  searchFields?: Array<keyof T | CrudSearchOption<T>>;
@@ -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"),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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),A=require("./translations/en.cjs.js"),r=require("i18next"),u=require("react-i18next"),l={en:{[a.TRANSLATION_NAMESPACE]:A}};exports.i18nInstance=r;const c=(t={})=>{const{translations:n=l,language:e="en",i18nInstance:i}=t,s=i||r;return exports.i18nInstance=s,s.isInitialized?Object.entries(n).forEach(([o,T])=>{Object.entries(T).forEach(([I,N])=>{s.addResourceBundle(o,I,N,!0,!0)})}):s.use(u.initReactI18next).init({resources:n,lng:e,fallbackLng:"en",ns:a.TRANSLATION_NAMESPACE,interpolation:{escapeValue:!1}}),s},d=(t,n,e)=>{(e||r).addResourceBundle(t,a.TRANSLATION_NAMESPACE,n,!0,!0)},S=t=>{const n=exports.i18nInstance||r;return n.isInitialized||c({}),u.useTranslation(a.TRANSLATION_NAMESPACE,{...t,i18n:n})},E=t=>{const n=exports.i18nInstance||r;return n.isInitialized||c({}),u.useTranslation(void 0,{...t,i18n:n})},f=(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,o;const i=(s=exports.i18nInstance)==null?void 0:s.t(t,n);return i&&t&&i!==t?i:e||((o=exports.i18nInstance)==null?void 0:o.t(t,{ns:void 0,...n}))};exports.defaultTranslations=l;exports.setupI18n=c;exports.t=f;exports.tWithOrWithoutNS=L;exports.updateTranslations=d;exports.useTranslationLib=S;exports.useTranslationLibNoNS=E;
@@ -8,18 +8,18 @@ const N = {
8
8
  }
9
9
  };
10
10
  let e = a;
11
- const c = (t = {}) => {
11
+ const c = (n = {}) => {
12
12
  const {
13
- translations: n = N,
13
+ translations: t = N,
14
14
  language: i = "en",
15
15
  i18nInstance: s
16
- } = t, r = s || a;
17
- return e = r, r.isInitialized ? Object.entries(n).forEach(([l, d]) => {
16
+ } = n, r = s || a;
17
+ return e = r, r.isInitialized ? Object.entries(t).forEach(([l, d]) => {
18
18
  Object.entries(d).forEach(([f, T]) => {
19
19
  r.addResourceBundle(l, f, T, !0, !0);
20
20
  });
21
21
  }) : r.use(p).init({
22
- resources: n,
22
+ resources: t,
23
23
  lng: i,
24
24
  fallbackLng: "en",
25
25
  ns: o,
@@ -27,36 +27,36 @@ const c = (t = {}) => {
27
27
  escapeValue: !1
28
28
  }
29
29
  }), r;
30
- }, E = (t, n, i) => {
30
+ }, E = (n, t, i) => {
31
31
  (i || a).addResourceBundle(
32
- t,
33
- o,
34
32
  n,
33
+ o,
34
+ t,
35
35
  !0,
36
36
  !0
37
37
  );
38
- }, L = (t) => {
39
- const n = e || a;
40
- return n.isInitialized || c({}), u(o, { ...t, i18n: n });
41
- }, O = (t) => {
42
- const n = e || a;
43
- return n.isInitialized || c({}), u(void 0, { ...t, i18n: n });
44
- }, I = (t, n) => e == null ? void 0 : e.t(t, {
38
+ }, L = (n) => {
39
+ const t = e || a;
40
+ return t.isInitialized || c({}), u(o, { ...n, i18n: t });
41
+ }, O = (n) => {
42
+ const t = e || a;
43
+ return t.isInitialized || c({}), u(void 0, { ...n, i18n: t });
44
+ }, R = (n, t) => e == null ? void 0 : e.t(n, {
45
45
  ns: o,
46
- ...n
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, {
46
+ ...t
47
+ }), S = (n, t, i) => {
48
+ const s = e == null ? void 0 : e.t(n, t);
49
+ return s && n && s !== n ? s : i || (e == null ? void 0 : e.t(n, {
50
50
  ns: void 0,
51
- ...n
51
+ ...t
52
52
  }));
53
53
  };
54
54
  export {
55
55
  N as defaultTranslations,
56
56
  e as i18nInstance,
57
57
  c as setupI18n,
58
- I as t,
59
- R as tWithOrWithoutNS,
58
+ R as t,
59
+ S as tWithOrWithoutNS,
60
60
  E as updateTranslations,
61
61
  L as useTranslationLib,
62
62
  O as useTranslationLibNoNS
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kingteza/crud-component",
3
3
  "private": false,
4
- "version": "1.36.0",
4
+ "version": "1.37.0",
5
5
  "description": "React CRUD component library with Ant Design",
6
6
  "keywords": [
7
7
  "react",