@ahmadmubarak98/namozaj 1.4.3 → 1.4.5
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 +15 -5
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ export declare interface NamozajLocalizationOptions {
|
|
|
237
237
|
locales: string[];
|
|
238
238
|
translatedLabel?: (label: string, locale: string) => string;
|
|
239
239
|
translatedFieldNameSuffix?: (locale: string) => string;
|
|
240
|
-
translatedFieldGrid?: (field: DynamicFormField, locale: string) => GridColumnConfig;
|
|
240
|
+
translatedFieldGrid?: (field: DynamicFormField, locale: string, selectedLocales: string[]) => GridColumnConfig;
|
|
241
241
|
localePicker?: {
|
|
242
242
|
name?: string;
|
|
243
243
|
label?: string;
|
package/dist/namozaj.js
CHANGED
|
@@ -4588,17 +4588,19 @@ const getDefaultValue = (e) => {
|
|
|
4588
4588
|
const l = t.charAt(0).toUpperCase() + t.slice(1);
|
|
4589
4589
|
return `${e.meta.label} (${l})`;
|
|
4590
4590
|
}
|
|
4591
|
-
}, getTranslatedFieldGrid = (e, t, a) => {
|
|
4592
|
-
var
|
|
4593
|
-
return
|
|
4591
|
+
}, getTranslatedFieldGrid = (e, t, a, l) => {
|
|
4592
|
+
var c;
|
|
4593
|
+
return l ? l(e, t, a) : e.type === "text" && ((c = e.meta) != null && c.multiline) ? {
|
|
4594
4594
|
xs: 12,
|
|
4595
4595
|
sm: 12,
|
|
4596
4596
|
md: 12,
|
|
4597
4597
|
lg: 12,
|
|
4598
4598
|
xl: 12
|
|
4599
|
-
} : {
|
|
4599
|
+
} : a.length > 1 ? {
|
|
4600
4600
|
xs: 12,
|
|
4601
|
-
|
|
4601
|
+
sm: 6
|
|
4602
|
+
} : e.meta.grid || {
|
|
4603
|
+
xs: 12
|
|
4602
4604
|
};
|
|
4603
4605
|
};
|
|
4604
4606
|
function chainPropTypes(e, t) {
|
|
@@ -82228,6 +82230,12 @@ const ConfirmationDialog = ({
|
|
|
82228
82230
|
y(!1), b(null);
|
|
82229
82231
|
};
|
|
82230
82232
|
return useEffect(() => {
|
|
82233
|
+
l && Array.isArray(l) && l.length > 0 ? f.replace(l) : L && l.length < L && f.replace(
|
|
82234
|
+
Array.from({ length: L }, (Z, Re) => u.fields.reduce((ye, De) => (ye[De.name] = {
|
|
82235
|
+
...De,
|
|
82236
|
+
id: De.id || generateFieldId()
|
|
82237
|
+
}, ye), {}))
|
|
82238
|
+
);
|
|
82231
82239
|
}, []), /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Fieldset, { id: e, legend: /* @__PURE__ */ jsx(FieldLabel, { field: t }), children: [
|
|
82232
82240
|
f.fields.length === 0 && /* @__PURE__ */ jsxs(
|
|
82233
82241
|
Box,
|
|
@@ -82285,6 +82293,7 @@ const ConfirmationDialog = ({
|
|
|
82285
82293
|
enableRtl: d,
|
|
82286
82294
|
defaultValues: l[Re],
|
|
82287
82295
|
onChange: re.bind(null, Re),
|
|
82296
|
+
error: c == null ? void 0 : c[Re],
|
|
82288
82297
|
validationMode: "onChange",
|
|
82289
82298
|
defaultSubmitButtonProps: {
|
|
82290
82299
|
hidden: !0
|
|
@@ -82574,6 +82583,7 @@ const Form = React__default.forwardRef(
|
|
|
82574
82583
|
), y.grid = getTranslatedFieldGrid(
|
|
82575
82584
|
p,
|
|
82576
82585
|
h,
|
|
82586
|
+
a,
|
|
82577
82587
|
(w = e.localization) == null ? void 0 : w.translatedFieldGrid
|
|
82578
82588
|
), m.meta = y, m;
|
|
82579
82589
|
}, d = useMemo(() => {
|