@ahmadmubarak98/namozaj 1.6.12 → 1.6.14
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 -0
- package/dist/namozaj.js +75 -67
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -296,6 +296,7 @@ export declare interface NamozajLocalizationOptions {
|
|
|
296
296
|
localePicker?: {
|
|
297
297
|
name?: string;
|
|
298
298
|
label?: string;
|
|
299
|
+
defaultValue?: string[];
|
|
299
300
|
getLocaleLabel: (locale: string) => string;
|
|
300
301
|
onLocaleChange: (locale: string[], formMethods: any) => void;
|
|
301
302
|
grid?: GridColumnConfig;
|
package/dist/namozaj.js
CHANGED
|
@@ -85021,8 +85021,7 @@ const _ = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports), MultiSelectFie
|
|
|
85021
85021
|
error: h.fieldState.error
|
|
85022
85022
|
}) }),
|
|
85023
85023
|
((w = d.helperText) == null ? void 0 : w.content) && shouldRenderHelperText(e.type) && /* @__PURE__ */ jsx(Box, { mt: 0.25, children: /* @__PURE__ */ jsx(HelperText, { ...d.helperText }) }),
|
|
85024
|
-
h.fieldState.error && h.fieldState.error.message && /* @__PURE__ */ jsx(FormHelperText$1, { error: !0, children: h.fieldState.error.message })
|
|
85025
|
-
JSON.stringify(h.fieldState.error)
|
|
85024
|
+
h.fieldState.error && h.fieldState.error.message && /* @__PURE__ */ jsx(FormHelperText$1, { error: !0, children: h.fieldState.error.message })
|
|
85026
85025
|
]
|
|
85027
85026
|
}
|
|
85028
85027
|
) : null;
|
|
@@ -85238,100 +85237,109 @@ const Form = React__default.forwardRef(
|
|
|
85238
85237
|
}
|
|
85239
85238
|
), Namozaj = forwardRef(
|
|
85240
85239
|
(e, t) => {
|
|
85241
|
-
var d;
|
|
85240
|
+
var d, u, b;
|
|
85242
85241
|
const [a, l] = useState(
|
|
85243
|
-
((d = e.localization) == null ? void 0 : d.
|
|
85244
|
-
), c = (
|
|
85245
|
-
var
|
|
85246
|
-
const
|
|
85247
|
-
return
|
|
85248
|
-
|
|
85249
|
-
|
|
85250
|
-
(
|
|
85251
|
-
),
|
|
85252
|
-
|
|
85253
|
-
|
|
85254
|
-
(
|
|
85255
|
-
),
|
|
85256
|
-
|
|
85257
|
-
|
|
85242
|
+
((u = (d = e.localization) == null ? void 0 : d.localePicker) == null ? void 0 : u.defaultValue) || []
|
|
85243
|
+
), c = (h, g) => {
|
|
85244
|
+
var v, w, S;
|
|
85245
|
+
const m = h.meta || {}, y = { ...h }, C = { ...m };
|
|
85246
|
+
return y.name = getTranslatedFieldName(
|
|
85247
|
+
h,
|
|
85248
|
+
g,
|
|
85249
|
+
(v = e.localization) == null ? void 0 : v.translatedFieldNameSuffix
|
|
85250
|
+
), C.label = getTranslatedFieldLabel(
|
|
85251
|
+
h,
|
|
85252
|
+
g,
|
|
85253
|
+
(w = e.localization) == null ? void 0 : w.translatedLabel
|
|
85254
|
+
), C.grid = getTranslatedFieldGrid(
|
|
85255
|
+
h,
|
|
85256
|
+
g,
|
|
85258
85257
|
a,
|
|
85259
|
-
(
|
|
85260
|
-
),
|
|
85258
|
+
(S = e.localization) == null ? void 0 : S.translatedFieldGrid
|
|
85259
|
+
), y.meta = C, y.locale = g, y;
|
|
85261
85260
|
}, p = useMemo(() => {
|
|
85262
|
-
var
|
|
85263
|
-
const
|
|
85264
|
-
if (e.fields.forEach((
|
|
85265
|
-
const
|
|
85266
|
-
if (
|
|
85267
|
-
const
|
|
85268
|
-
|
|
85269
|
-
if (!(
|
|
85270
|
-
|
|
85261
|
+
var g, m, y, C;
|
|
85262
|
+
const h = [];
|
|
85263
|
+
if (e.fields.forEach((v) => {
|
|
85264
|
+
const S = (v.meta || {}).translated || !1;
|
|
85265
|
+
if (v.type === "field-array" || v.type === "repeater") {
|
|
85266
|
+
const x = v.meta.fields || [], L = [];
|
|
85267
|
+
x.forEach((D) => {
|
|
85268
|
+
if (!(D.meta || {}).translated) {
|
|
85269
|
+
L.push(D);
|
|
85271
85270
|
return;
|
|
85272
85271
|
}
|
|
85273
|
-
a == null || a.forEach((
|
|
85274
|
-
const
|
|
85275
|
-
|
|
85272
|
+
a == null || a.forEach((k) => {
|
|
85273
|
+
const H = c(D, k);
|
|
85274
|
+
L.push(H);
|
|
85276
85275
|
});
|
|
85277
|
-
}),
|
|
85278
|
-
...
|
|
85276
|
+
}), h.push({
|
|
85277
|
+
...v,
|
|
85279
85278
|
meta: {
|
|
85280
|
-
...
|
|
85281
|
-
fields:
|
|
85279
|
+
...v.meta,
|
|
85280
|
+
fields: L
|
|
85282
85281
|
}
|
|
85283
85282
|
});
|
|
85284
85283
|
return;
|
|
85285
85284
|
}
|
|
85286
|
-
if (!
|
|
85287
|
-
|
|
85285
|
+
if (!S) {
|
|
85286
|
+
h.push(v);
|
|
85288
85287
|
return;
|
|
85289
85288
|
}
|
|
85290
|
-
a == null || a.forEach((
|
|
85291
|
-
const
|
|
85292
|
-
|
|
85293
|
-
...
|
|
85289
|
+
a == null || a.forEach((x) => {
|
|
85290
|
+
const L = c(v, x);
|
|
85291
|
+
h.push({
|
|
85292
|
+
...L
|
|
85294
85293
|
});
|
|
85295
85294
|
});
|
|
85296
|
-
}), e.localization && a.length > 0 && ((
|
|
85297
|
-
const
|
|
85298
|
-
name: ((
|
|
85295
|
+
}), e.localization && a.length > 0 && ((g = e.localization) != null && g.localePicker)) {
|
|
85296
|
+
const v = {
|
|
85297
|
+
name: ((m = e.localization) == null ? void 0 : m.localePicker.name) || DEFAULT_LOCALE_PICKER_FIELD_NAME,
|
|
85299
85298
|
type: "checkbox-group",
|
|
85300
85299
|
meta: {
|
|
85301
|
-
label: ((
|
|
85300
|
+
label: ((y = e.localization) == null ? void 0 : y.localePicker.label) || "Select Input Locale",
|
|
85302
85301
|
defaultValue: a,
|
|
85303
85302
|
horizontal: !0,
|
|
85304
85303
|
min: 1,
|
|
85305
|
-
options: async () =>
|
|
85306
|
-
var
|
|
85307
|
-
return {
|
|
85308
|
-
|
|
85309
|
-
|
|
85310
|
-
|
|
85311
|
-
|
|
85312
|
-
|
|
85313
|
-
|
|
85314
|
-
|
|
85315
|
-
|
|
85316
|
-
|
|
85317
|
-
|
|
85318
|
-
|
|
85319
|
-
|
|
85320
|
-
|
|
85304
|
+
options: async () => {
|
|
85305
|
+
var w;
|
|
85306
|
+
return (((w = e.localization) == null ? void 0 : w.locales) || []).map((S) => {
|
|
85307
|
+
var x;
|
|
85308
|
+
return {
|
|
85309
|
+
label: ((x = e.localization) == null ? void 0 : x.localePicker).getLocaleLabel(
|
|
85310
|
+
S
|
|
85311
|
+
) || S,
|
|
85312
|
+
value: S
|
|
85313
|
+
};
|
|
85314
|
+
});
|
|
85315
|
+
},
|
|
85316
|
+
onValueChange: (w, S) => {
|
|
85317
|
+
var x, L, D;
|
|
85318
|
+
l(w), (L = (x = e.localization) == null ? void 0 : x.localePicker) != null && L.onLocaleChange && ((D = e.localization) == null || D.localePicker.onLocaleChange(
|
|
85319
|
+
w.sort((N, I) => {
|
|
85320
|
+
var G, Y;
|
|
85321
|
+
const k = ((G = e.localization) == null ? void 0 : G.locales.indexOf(N)) || 0, H = ((Y = e.localization) == null ? void 0 : Y.locales.indexOf(I)) || 0;
|
|
85322
|
+
return k - H;
|
|
85321
85323
|
}),
|
|
85322
|
-
|
|
85324
|
+
S
|
|
85323
85325
|
));
|
|
85324
85326
|
},
|
|
85325
|
-
grid: ((
|
|
85327
|
+
grid: ((C = e.localization) == null ? void 0 : C.localePicker.grid) || {
|
|
85326
85328
|
xs: 12
|
|
85327
85329
|
}
|
|
85328
85330
|
}
|
|
85329
85331
|
};
|
|
85330
|
-
|
|
85332
|
+
h.unshift(v);
|
|
85331
85333
|
}
|
|
85332
|
-
return
|
|
85334
|
+
return h;
|
|
85333
85335
|
}, [e.fields, a, e.localization]);
|
|
85334
|
-
return
|
|
85336
|
+
return useEffect(() => {
|
|
85337
|
+
var h, g, m;
|
|
85338
|
+
if ((h = e.localization) != null && h.localePicker) {
|
|
85339
|
+
const y = (m = (g = e.localization) == null ? void 0 : g.localePicker) == null ? void 0 : m.defaultValue;
|
|
85340
|
+
Array.isArray(y) ? l(y) : l([]);
|
|
85341
|
+
}
|
|
85342
|
+
}, [(b = e.localization) == null ? void 0 : b.localePicker]), /* @__PURE__ */ jsx(
|
|
85335
85343
|
DynamicFormLocalProvider,
|
|
85336
85344
|
{
|
|
85337
85345
|
value: {
|