@ahmadmubarak98/namozaj 1.4.2 → 1.4.4

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 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 l;
4593
- return a ? a(e, t) : e.type === "text" && ((l = e.meta) != null && l.multiline) ? {
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
- md: 6
4601
+ sm: 6
4602
+ } : e.meta.grid || {
4603
+ xs: 12
4602
4604
  };
4603
4605
  };
4604
4606
  function chainPropTypes(e, t) {
@@ -82574,6 +82576,7 @@ const Form = React__default.forwardRef(
82574
82576
  ), y.grid = getTranslatedFieldGrid(
82575
82577
  p,
82576
82578
  h,
82579
+ a,
82577
82580
  (w = e.localization) == null ? void 0 : w.translatedFieldGrid
82578
82581
  ), m.meta = y, m;
82579
82582
  }, d = useMemo(() => {
@@ -82630,7 +82633,11 @@ const Form = React__default.forwardRef(
82630
82633
  onValueChange: (b, w) => {
82631
82634
  var S, x, D;
82632
82635
  l(b), (x = (S = e.localization) == null ? void 0 : S.localePicker) != null && x.onLocaleChange && ((D = e.localization) == null || D.localePicker.onLocaleChange(
82633
- b,
82636
+ b.sort((I, k) => {
82637
+ var B, G;
82638
+ const A = ((B = e.localization) == null ? void 0 : B.locales.indexOf(I)) || 0, L = ((G = e.localization) == null ? void 0 : G.locales.indexOf(k)) || 0;
82639
+ return A - L;
82640
+ }),
82634
82641
  w
82635
82642
  ));
82636
82643
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ahmadmubarak98/namozaj",
3
3
  "private": false,
4
- "version": "1.4.2",
4
+ "version": "1.4.4",
5
5
  "type": "module",
6
6
  "main": "dist/namozaj.js",
7
7
  "types": "dist/main.d.ts",