@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>>;
|
package/dist/locale/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./hooks/translation-constants.cjs.js"),
|
|
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;
|
package/dist/locale/index.es.js
CHANGED
|
@@ -8,18 +8,18 @@ const N = {
|
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
10
|
let e = a;
|
|
11
|
-
const c = (
|
|
11
|
+
const c = (n = {}) => {
|
|
12
12
|
const {
|
|
13
|
-
translations:
|
|
13
|
+
translations: t = N,
|
|
14
14
|
language: i = "en",
|
|
15
15
|
i18nInstance: s
|
|
16
|
-
} =
|
|
17
|
-
return e = r, r.isInitialized ? Object.entries(
|
|
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:
|
|
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 = (
|
|
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 = (
|
|
39
|
-
const
|
|
40
|
-
return
|
|
41
|
-
}, O = (
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
},
|
|
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
|
-
...
|
|
47
|
-
}),
|
|
48
|
-
const s =
|
|
49
|
-
return s &&
|
|
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
|
-
...
|
|
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
|
-
|
|
59
|
-
|
|
58
|
+
R as t,
|
|
59
|
+
S as tWithOrWithoutNS,
|
|
60
60
|
E as updateTranslations,
|
|
61
61
|
L as useTranslationLib,
|
|
62
62
|
O as useTranslationLibNoNS
|