@ahmadmubarak98/namozaj 1.6.17 → 1.6.18
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.
- package/dist/main.d.ts +1 -1
- package/dist/namozaj.js +28 -28
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -291,13 +291,13 @@ export declare const Namozaj: default_2.ForwardRefExoticComponent<DynamicFormPro
|
|
|
291
291
|
|
|
292
292
|
export declare interface NamozajLocalizationOptions {
|
|
293
293
|
locales: string[];
|
|
294
|
+
defaultSelectedLocales?: string[];
|
|
294
295
|
translatedLabel?: (label: string, locale: string) => string;
|
|
295
296
|
translatedFieldNameSuffix?: (locale: string) => string;
|
|
296
297
|
translatedFieldGrid?: (field: DynamicFormField, locale: string, selectedLocales: string[]) => GridColumnConfig;
|
|
297
298
|
localePicker?: {
|
|
298
299
|
name?: string;
|
|
299
300
|
label?: string;
|
|
300
|
-
defaultValue?: string[];
|
|
301
301
|
getLocaleLabel: (locale: string) => string;
|
|
302
302
|
onLocaleChange: (locale: string[], formMethods: any) => void;
|
|
303
303
|
grid?: GridColumnConfig;
|
package/dist/namozaj.js
CHANGED
|
@@ -85256,29 +85256,29 @@ const Form = React__default.forwardRef(
|
|
|
85256
85256
|
}
|
|
85257
85257
|
), Namozaj = forwardRef(
|
|
85258
85258
|
(e, t) => {
|
|
85259
|
-
var d, u
|
|
85259
|
+
var d, u;
|
|
85260
85260
|
const [a, l] = useState(
|
|
85261
|
-
((
|
|
85262
|
-
), c = (
|
|
85263
|
-
var v, w
|
|
85264
|
-
const
|
|
85265
|
-
return
|
|
85261
|
+
((d = e.localization) == null ? void 0 : d.defaultSelectedLocales) || []
|
|
85262
|
+
), c = (b, h) => {
|
|
85263
|
+
var C, v, w;
|
|
85264
|
+
const g = b.meta || {}, m = { ...b }, y = { ...g };
|
|
85265
|
+
return m.name = getTranslatedFieldName(
|
|
85266
|
+
b,
|
|
85266
85267
|
h,
|
|
85267
|
-
|
|
85268
|
-
|
|
85269
|
-
|
|
85268
|
+
(C = e.localization) == null ? void 0 : C.translatedFieldNameSuffix
|
|
85269
|
+
), y.label = getTranslatedFieldLabel(
|
|
85270
|
+
b,
|
|
85270
85271
|
h,
|
|
85271
|
-
|
|
85272
|
-
|
|
85273
|
-
|
|
85272
|
+
(v = e.localization) == null ? void 0 : v.translatedLabel
|
|
85273
|
+
), y.grid = getTranslatedFieldGrid(
|
|
85274
|
+
b,
|
|
85274
85275
|
h,
|
|
85275
|
-
g,
|
|
85276
85276
|
a,
|
|
85277
|
-
(
|
|
85278
|
-
),
|
|
85277
|
+
(w = e.localization) == null ? void 0 : w.translatedFieldGrid
|
|
85278
|
+
), m.meta = y, m.locale = h, m;
|
|
85279
85279
|
}, p = useMemo(() => {
|
|
85280
|
-
var g, m, y, C;
|
|
85281
|
-
const
|
|
85280
|
+
var h, g, m, y, C;
|
|
85281
|
+
const b = [];
|
|
85282
85282
|
if (e.fields.forEach((v) => {
|
|
85283
85283
|
const S = (v.meta || {}).translated || !1;
|
|
85284
85284
|
if (v.type === "field-array" || v.type === "repeater") {
|
|
@@ -85292,7 +85292,7 @@ const Form = React__default.forwardRef(
|
|
|
85292
85292
|
const H = c(D, k);
|
|
85293
85293
|
L.push(H);
|
|
85294
85294
|
});
|
|
85295
|
-
}),
|
|
85295
|
+
}), b.push({
|
|
85296
85296
|
...v,
|
|
85297
85297
|
meta: {
|
|
85298
85298
|
...v.meta,
|
|
@@ -85302,16 +85302,16 @@ const Form = React__default.forwardRef(
|
|
|
85302
85302
|
return;
|
|
85303
85303
|
}
|
|
85304
85304
|
if (!S) {
|
|
85305
|
-
|
|
85305
|
+
b.push(v);
|
|
85306
85306
|
return;
|
|
85307
85307
|
}
|
|
85308
85308
|
a == null || a.forEach((x) => {
|
|
85309
85309
|
const L = c(v, x);
|
|
85310
|
-
|
|
85310
|
+
b.push({
|
|
85311
85311
|
...L
|
|
85312
85312
|
});
|
|
85313
85313
|
});
|
|
85314
|
-
}), e.localization &&
|
|
85314
|
+
}), e.localization && ((h = e.localization) == null ? void 0 : h.locales.length) > 0 && ((g = e.localization) != null && g.localePicker)) {
|
|
85315
85315
|
const v = {
|
|
85316
85316
|
name: ((m = e.localization) == null ? void 0 : m.localePicker.name) || DEFAULT_LOCALE_PICKER_FIELD_NAME,
|
|
85317
85317
|
type: "checkbox-group",
|
|
@@ -85348,17 +85348,17 @@ const Form = React__default.forwardRef(
|
|
|
85348
85348
|
}
|
|
85349
85349
|
}
|
|
85350
85350
|
};
|
|
85351
|
-
|
|
85351
|
+
b.unshift(v);
|
|
85352
85352
|
}
|
|
85353
|
-
return
|
|
85353
|
+
return b;
|
|
85354
85354
|
}, [e.fields, a, e.localization]);
|
|
85355
85355
|
return useEffect(() => {
|
|
85356
|
-
var h, g
|
|
85357
|
-
if ((h = e.localization) != null && h.
|
|
85358
|
-
const
|
|
85359
|
-
Array.isArray(
|
|
85356
|
+
var b, h, g;
|
|
85357
|
+
if ((h = (b = e.localization) == null ? void 0 : b.defaultSelectedLocales) != null && h.length) {
|
|
85358
|
+
const m = (g = e.localization) == null ? void 0 : g.defaultSelectedLocales;
|
|
85359
|
+
Array.isArray(m) ? l(m) : l([]);
|
|
85360
85360
|
}
|
|
85361
|
-
}, [(
|
|
85361
|
+
}, [JSON.stringify((u = e.localization) == null ? void 0 : u.defaultSelectedLocales)]), /* @__PURE__ */ jsx(
|
|
85362
85362
|
DynamicFormLocalProvider,
|
|
85363
85363
|
{
|
|
85364
85364
|
value: {
|