@erpsquad/common 1.10.78 → 1.10.79

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.
Files changed (42) hide show
  1. package/dist/chunks/{android-12-switch-1bs0RMnV.js → android-12-switch-BgFAxJ9x.js} +2 -2
  2. package/dist/chunks/{android-12-switch-1bs0RMnV.js.map → android-12-switch-BgFAxJ9x.js.map} +1 -1
  3. package/dist/chunks/{android-12-switch-BQHaGZz6.esm.js → android-12-switch-DoExcS1P.esm.js} +2 -2
  4. package/dist/chunks/{android-12-switch-BQHaGZz6.esm.js.map → android-12-switch-DoExcS1P.esm.js.map} +1 -1
  5. package/dist/chunks/{appbar-DELlMlbx.esm.js → appbar-D1L6GTYk.esm.js} +30 -25
  6. package/dist/chunks/appbar-D1L6GTYk.esm.js.map +1 -0
  7. package/dist/chunks/{appbar-xuAwm7L1.js → appbar-D424Z-Ai.js} +30 -25
  8. package/dist/chunks/appbar-D424Z-Ai.js.map +1 -0
  9. package/dist/chunks/{default-data-DzOhtrxC.esm.js → default-data-CdhwU3H3.esm.js} +3 -3
  10. package/dist/chunks/{default-data-DzOhtrxC.esm.js.map → default-data-CdhwU3H3.esm.js.map} +1 -1
  11. package/dist/chunks/{default-data-BLwWZjhM.js → default-data-Cgb7xKe1.js} +3 -3
  12. package/dist/chunks/{default-data-BLwWZjhM.js.map → default-data-Cgb7xKe1.js.map} +1 -1
  13. package/dist/chunks/{fullScreen-B0QUzNj3.js → fullScreen-BUbaMxdQ.js} +2 -2
  14. package/dist/chunks/{fullScreen-B0QUzNj3.js.map → fullScreen-BUbaMxdQ.js.map} +1 -1
  15. package/dist/chunks/{fullScreen-C8dcx8pG.esm.js → fullScreen-COa9H9T5.esm.js} +2 -2
  16. package/dist/chunks/{fullScreen-C8dcx8pG.esm.js.map → fullScreen-COa9H9T5.esm.js.map} +1 -1
  17. package/dist/chunks/{sidebar-fZ9vocVX.esm.js → sidebar-D5jsYGs8.esm.js} +2 -2
  18. package/dist/chunks/{sidebar-fZ9vocVX.esm.js.map → sidebar-D5jsYGs8.esm.js.map} +1 -1
  19. package/dist/chunks/{sidebar-BC824FOR.js → sidebar-DvPIFrpF.js} +2 -2
  20. package/dist/chunks/{sidebar-BC824FOR.js.map → sidebar-DvPIFrpF.js.map} +1 -1
  21. package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js → sidebarScreen-B4RSyJAT.esm.js} +3 -3
  22. package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js.map → sidebarScreen-B4RSyJAT.esm.js.map} +1 -1
  23. package/dist/chunks/{sidebarScreen-B08K08t5.js → sidebarScreen-CFDnYrtL.js} +3 -3
  24. package/dist/chunks/{sidebarScreen-B08K08t5.js.map → sidebarScreen-CFDnYrtL.js.map} +1 -1
  25. package/dist/chunks/{uom-field-wrapper-Bdou6Bjq.js → uom-field-wrapper-DGt-0_BI.js} +359 -221
  26. package/dist/chunks/{uom-field-wrapper-Bdou6Bjq.js.map → uom-field-wrapper-DGt-0_BI.js.map} +1 -1
  27. package/dist/chunks/{uom-field-wrapper-swTpN914.esm.js → uom-field-wrapper-_O6BmPp4.esm.js} +360 -222
  28. package/dist/chunks/{uom-field-wrapper-swTpN914.esm.js.map → uom-field-wrapper-_O6BmPp4.esm.js.map} +1 -1
  29. package/dist/components/chat-bot/doc-intro.d.ts +4 -2
  30. package/dist/components/index.esm.js +4 -4
  31. package/dist/components/index.js +4 -4
  32. package/dist/index.esm.js +7 -7
  33. package/dist/index.js +7 -7
  34. package/dist/layout/index.esm.js +2 -2
  35. package/dist/layout/index.js +2 -2
  36. package/dist/src/components/chat-bot/doc-intro.d.ts +4 -2
  37. package/dist/style.css +10 -1
  38. package/dist/views/index.esm.js +5 -5
  39. package/dist/views/index.js +4 -4
  40. package/package.json +1 -1
  41. package/dist/chunks/appbar-DELlMlbx.esm.js.map +0 -1
  42. package/dist/chunks/appbar-xuAwm7L1.js.map +0 -1
@@ -3,8 +3,8 @@ const jsxRuntime = require("./jsx-runtime-B6vEU3CM.js");
3
3
  const reactHookForm = require("react-hook-form");
4
4
  const identifier = require("./identifier-CaTy7Osd.js");
5
5
  const useAuth = require("./useAuth-DnCoTAh7.js");
6
- const android12Switch = require("./android-12-switch-1bs0RMnV.js");
7
- const appbar = require("./appbar-xuAwm7L1.js");
6
+ const android12Switch = require("./android-12-switch-BgFAxJ9x.js");
7
+ const appbar = require("./appbar-D424Z-Ai.js");
8
8
  const React = require("react");
9
9
  const DatePicker = require("react-datepicker");
10
10
  ;/* empty css */
@@ -53,7 +53,7 @@ const actionBar = require("./action-bar-DMv6sqDP.js");
53
53
  const DataEditor = require("@glideapps/glide-data-grid");
54
54
  const glideDataGridCells = require("@glideapps/glide-data-grid-cells");
55
55
  const ReactDOM = require("react-dom");
56
- const sidebar = require("./sidebar-BC824FOR.js");
56
+ const sidebar = require("./sidebar-DvPIFrpF.js");
57
57
  const materialReactTable = require("material-react-table");
58
58
  const trash = require("./trash-C63VDmtW.js");
59
59
  const document$1 = require("./document-DzwARg8r.js");
@@ -3978,6 +3978,60 @@ const addressTypeOptions = [
3978
3978
  { label: "Shipping", value: "Shipping" },
3979
3979
  { label: "Office", value: "Office" }
3980
3980
  ];
3981
+ const zipCodeRule = Yup__namespace.string().matches(/^[0-9\u0660-\u0669]+$/, {
3982
+ message: "Zip code must contain only digits without special characters",
3983
+ excludeEmptyString: true
3984
+ }).test(
3985
+ "no-dot-plus",
3986
+ 'Zip code must not contain "." or "+"',
3987
+ (value) => !(value == null ? void 0 : value.includes(".")) && !(value == null ? void 0 : value.includes("+"))
3988
+ );
3989
+ const cityRule = Yup__namespace.string().matches(/^[A-Za-z\u0600-\u06FF\s]+$/, {
3990
+ message: "City must contain alphabets only",
3991
+ excludeEmptyString: true
3992
+ });
3993
+ const ADDRESS_CONTENT_FIELDS = [
3994
+ "address_type",
3995
+ "contact_name",
3996
+ "mobile",
3997
+ "street_1",
3998
+ "street_2",
3999
+ "street_3",
4000
+ "street_name",
4001
+ "building_no",
4002
+ "additional_no",
4003
+ "national_address",
4004
+ "zip_code",
4005
+ "city",
4006
+ "district_name",
4007
+ "state",
4008
+ "country"
4009
+ ];
4010
+ const BLANK_ADDRESS = {
4011
+ address_type: "",
4012
+ contact_name: "",
4013
+ country_code: "",
4014
+ mobile: "",
4015
+ street_1: "",
4016
+ street_2: "",
4017
+ street_3: "",
4018
+ street_name: "",
4019
+ building_no: "",
4020
+ additional_no: "",
4021
+ national_address: "",
4022
+ zip_code: "",
4023
+ city: "",
4024
+ district_name: "",
4025
+ state: null,
4026
+ country: null,
4027
+ summary: "",
4028
+ default_shipping_address: false,
4029
+ default_billing_address: false
4030
+ };
4031
+ const hasValues = (values) => !!values && ADDRESS_CONTENT_FIELDS.some((field) => {
4032
+ const value = values[field];
4033
+ return value !== void 0 && value !== null && String(value).trim() !== "";
4034
+ });
3981
4035
  const buildValidationSchema = (isKSA, optionalFields = []) => {
3982
4036
  const zipOptional = optionalFields.includes("zip_code");
3983
4037
  const stateOptional = optionalFields.includes("state");
@@ -4004,6 +4058,12 @@ const buildValidationSchema = (isKSA, optionalFields = []) => {
4004
4058
  })
4005
4059
  });
4006
4060
  };
4061
+ const arabicValidationSchema = Yup__namespace.object().shape({
4062
+ addresses: Yup__namespace.object().shape({
4063
+ zip_code: zipCodeRule,
4064
+ city: cityRule
4065
+ })
4066
+ });
4007
4067
  const AddressModal = ({
4008
4068
  isOpen,
4009
4069
  setIsOpen,
@@ -4020,6 +4080,8 @@ const AddressModal = ({
4020
4080
  const { t } = reactI18next.useTranslation();
4021
4081
  const isKSA = ((_a = apiConfig.getApiConfigSafe()) == null ? void 0 : _a.countryEnv) === "ksa";
4022
4082
  const [submitLoading, setSubmitLoading] = React.useState(false);
4083
+ const [language, setLanguage] = React.useState("en");
4084
+ const [drafts, setDrafts] = React.useState({});
4023
4085
  const [entryDetails, setEntryDetails] = React.useState({
4024
4086
  country_data: null,
4025
4087
  state_data: null
@@ -4039,7 +4101,7 @@ const AddressModal = ({
4039
4101
  trigger,
4040
4102
  getFieldState
4041
4103
  } = reactHookForm.useForm({
4042
- resolver: appbar.o(validationSchema2),
4104
+ resolver: appbar.o(language === "ar" ? arabicValidationSchema : validationSchema2),
4043
4105
  mode: "all"
4044
4106
  });
4045
4107
  const watchedValues = reactHookForm.useWatch({
@@ -4067,6 +4129,30 @@ const AddressModal = ({
4067
4129
  handleValidateSave(values);
4068
4130
  setSubmitLoading(false);
4069
4131
  };
4132
+ const handleLanguageChange = async (next) => {
4133
+ var _a2;
4134
+ if (next === language) {
4135
+ return;
4136
+ }
4137
+ if (next === "ar" && !hasValues(drafts.ar)) {
4138
+ const isEnglishValid = await trigger();
4139
+ if (!isEnglishValid) {
4140
+ notistack.enqueueSnackbar(
4141
+ t(`accounting.${translationKey}.msg.fill_english_address_first`, {
4142
+ defaultValue: "Please fill the English address first"
4143
+ }),
4144
+ { variant: "error" }
4145
+ );
4146
+ return;
4147
+ }
4148
+ }
4149
+ const current = (_a2 = getValues()) == null ? void 0 : _a2.addresses;
4150
+ setDrafts((prev) => ({ ...prev, [language]: current }));
4151
+ setLanguage(next);
4152
+ reset({
4153
+ addresses: { ...BLANK_ADDRESS, ...drafts[next] ?? {} }
4154
+ });
4155
+ };
4070
4156
  const handleDuplicate = async () => {
4071
4157
  const v = await trigger();
4072
4158
  if (!v) {
@@ -4080,7 +4166,8 @@ const AddressModal = ({
4080
4166
  default_shipping_address: false,
4081
4167
  default_billing_address: false,
4082
4168
  country: country_data,
4083
- state: state_data
4169
+ state: state_data,
4170
+ language
4084
4171
  }
4085
4172
  };
4086
4173
  setSubmitLoading(true);
@@ -4089,6 +4176,7 @@ const AddressModal = ({
4089
4176
  setSubmitLoading(false);
4090
4177
  };
4091
4178
  const handleValidateSave = (values) => {
4179
+ var _a2;
4092
4180
  const validateDefaults = (data, index, type = "shipping") => {
4093
4181
  const u_data = [...data];
4094
4182
  if (index != null && index >= 0) {
@@ -4112,33 +4200,50 @@ const AddressModal = ({
4112
4200
  return false;
4113
4201
  }
4114
4202
  };
4115
- const { addresses } = values;
4116
4203
  try {
4117
- if (addresses == null ? void 0 : addresses.default_shipping_address) {
4204
+ let englishValues = language === "en" ? values == null ? void 0 : values.addresses : drafts.en;
4205
+ const arabicValues = language === "ar" ? values == null ? void 0 : values.addresses : drafts.ar;
4206
+ if (englishValues == null ? void 0 : englishValues.default_shipping_address) {
4118
4207
  validateDefaults(items, itemIndex, "shipping");
4119
4208
  }
4120
- if (addresses == null ? void 0 : addresses.default_billing_address) {
4209
+ if (englishValues == null ? void 0 : englishValues.default_billing_address) {
4121
4210
  validateDefaults(items, itemIndex, "billing");
4122
4211
  }
4123
- if (items && (items == null ? void 0 : items.length) === 0) {
4124
- values = {
4125
- ...values,
4126
- addresses: {
4127
- ...values == null ? void 0 : values.addresses,
4128
- default_shipping_address: true,
4129
- default_billing_address: true
4130
- }
4212
+ if (englishValues && items && (items == null ? void 0 : items.length) === 0) {
4213
+ englishValues = {
4214
+ ...englishValues,
4215
+ default_shipping_address: true,
4216
+ default_billing_address: true
4131
4217
  };
4132
4218
  }
4133
- const v = {
4134
- ...values,
4135
- addresses: {
4136
- ...values == null ? void 0 : values.addresses,
4137
- country: country_data,
4138
- state: state_data
4139
- }
4219
+ if (!hasValues(englishValues) && !hasValues(arabicValues)) {
4220
+ return;
4221
+ }
4222
+ if (!hasValues(englishValues)) {
4223
+ onSave(
4224
+ {
4225
+ ...values,
4226
+ addresses: {
4227
+ ...arabicValues,
4228
+ address_type: (arabicValues == null ? void 0 : arabicValues.address_type) || (itemData == null ? void 0 : itemData.address_type),
4229
+ country: country_data,
4230
+ state: state_data,
4231
+ language: "ar"
4232
+ }
4233
+ },
4234
+ itemIndex
4235
+ );
4236
+ handleModalClose();
4237
+ return;
4238
+ }
4239
+ const row = {
4240
+ ...englishValues,
4241
+ country: country_data,
4242
+ state: state_data,
4243
+ language: "en"
4140
4244
  };
4141
- onSave({ ...v }, itemIndex);
4245
+ row.arabic = hasValues(arabicValues) ? { ...arabicValues, id: (_a2 = itemData == null ? void 0 : itemData.arabic) == null ? void 0 : _a2.id } : null;
4246
+ onSave({ ...values, addresses: row }, itemIndex);
4142
4247
  handleModalClose();
4143
4248
  } catch (error) {
4144
4249
  notistack.enqueueSnackbar((error == null ? void 0 : error.message) || "Something went wrong", {
@@ -4148,6 +4253,8 @@ const AddressModal = ({
4148
4253
  };
4149
4254
  const handleModalClose = () => {
4150
4255
  reset({ addresses: null });
4256
+ setDrafts({});
4257
+ setLanguage("en");
4151
4258
  setEntryDetails({
4152
4259
  state_data: null,
4153
4260
  country_data: null
@@ -4183,21 +4290,37 @@ const AddressModal = ({
4183
4290
  setValue("addresses.summary", summaryVal);
4184
4291
  }, [setValue, watchedValues, country_data, state_data]);
4185
4292
  React.useEffect(() => {
4186
- var _a2, _b2;
4293
+ var _a2, _b2, _c, _d;
4187
4294
  if (itemData) {
4295
+ setLanguage((itemData == null ? void 0 : itemData.language) === "ar" ? "ar" : "en");
4296
+ const { arabic, ...englishData } = itemData;
4297
+ setDrafts(
4298
+ arabic ? {
4299
+ ar: {
4300
+ ...BLANK_ADDRESS,
4301
+ ...arabic,
4302
+ country: ((_a2 = arabic == null ? void 0 : arabic.country) == null ? void 0 : _a2.id) ?? (arabic == null ? void 0 : arabic.country),
4303
+ state: ((_b2 = arabic == null ? void 0 : arabic.state) == null ? void 0 : _b2.id) ?? (arabic == null ? void 0 : arabic.state)
4304
+ }
4305
+ } : {}
4306
+ );
4188
4307
  reset({
4189
4308
  addresses: {
4190
- ...itemData,
4191
- country: (_a2 = itemData == null ? void 0 : itemData.country) == null ? void 0 : _a2.id,
4192
- state: (_b2 = itemData == null ? void 0 : itemData.state) == null ? void 0 : _b2.id
4309
+ ...BLANK_ADDRESS,
4310
+ ...englishData,
4311
+ country: (_c = englishData == null ? void 0 : englishData.country) == null ? void 0 : _c.id,
4312
+ state: (_d = englishData == null ? void 0 : englishData.state) == null ? void 0 : _d.id
4193
4313
  }
4194
4314
  });
4195
4315
  }
4196
4316
  }, [itemData, reset]);
4197
4317
  React.useEffect(() => {
4198
4318
  if (isOpen && !itemData) {
4319
+ setLanguage("en");
4320
+ setDrafts({});
4199
4321
  reset({
4200
4322
  addresses: {
4323
+ ...BLANK_ADDRESS,
4201
4324
  address_type: "Office",
4202
4325
  contact_name: (prefillData == null ? void 0 : prefillData.contact_name) || "",
4203
4326
  mobile: (prefillData == null ? void 0 : prefillData.mobile) || ""
@@ -4230,216 +4353,231 @@ const AddressModal = ({
4230
4353
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(useAuth.Typography, { type: "s3", color: "inherit", weight: "medium", children: t(`accounting.${translationKey}.addressModal.title`) }),
4231
4354
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.IconButton, { onClick: handleModalClose, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(iconsMaterial.Close, { fontSize: "small" }) })
4232
4355
  ] }),
4233
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.DialogContent, { children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(material.Grid, { container: true, rowGap: 1.5, columnSpacing: 3, pt: 3, children: [
4234
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4235
- android12Switch.DynamicSearchSelect,
4236
- {
4237
- label: t(`accounting.${translationKey}.addressModal.address_type_label`),
4238
- options: addressTypeOptions,
4239
- name: "address_type",
4240
- placeholder: t(`accounting.${translationKey}.addressModal.address_type_placeholder`),
4241
- fieldArrayName: "addresses",
4242
- formControl: control,
4243
- required: true
4244
- }
4245
- ) }),
4246
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4247
- appbar.DynamicInput,
4248
- {
4249
- type: "text",
4250
- formControl: control,
4251
- label: t(`accounting.${translationKey}.addressModal.contact_name_label`),
4252
- name: "contact_name",
4253
- fieldArrayName: "addresses",
4254
- placeholder: t(`accounting.${translationKey}.addressModal.contact_name_placeholder`),
4255
- required: true
4256
- }
4257
- ) }),
4258
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4259
- android12Switch.DynamicPhone,
4260
- {
4261
- type: "text",
4262
- formControl: control,
4263
- label: t(`accounting.${translationKey}.addressModal.mobile_label`),
4264
- name: "mobile",
4265
- fieldArrayName: "addresses",
4266
- setCountryCodeField: (country) => handleSetCountryCodeField(country)
4267
- }
4268
- ) }),
4269
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4270
- appbar.DynamicInput,
4271
- {
4272
- type: "text",
4273
- formControl: control,
4274
- label: t(`accounting.${translationKey}.addressModal.address1_label`),
4275
- name: "street_1",
4276
- fieldArrayName: "addresses",
4277
- placeholder: t(`accounting.${translationKey}.addressModal.address1_placeholder`),
4278
- required: true
4279
- }
4280
- ) }),
4281
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4282
- appbar.DynamicInput,
4283
- {
4284
- type: "text",
4285
- formControl: control,
4286
- label: t(`accounting.${translationKey}.addressModal.address2_label`),
4287
- name: "street_2",
4288
- fieldArrayName: "addresses",
4289
- placeholder: t(`accounting.${translationKey}.addressModal.address2_placeholder`)
4290
- }
4291
- ) }),
4292
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4293
- appbar.DynamicInput,
4294
- {
4295
- type: "text",
4296
- formControl: control,
4297
- label: t(`accounting.${translationKey}.addressModal.address3_label`),
4298
- name: "street_3",
4299
- fieldArrayName: "addresses",
4300
- placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
4301
- }
4302
- ) }),
4303
- isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4304
- appbar.DynamicInput,
4356
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(material.DialogContent, { children: [
4357
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
4358
+ material.RadioGroup,
4305
4359
  {
4306
- type: "text",
4307
- formControl: control,
4308
- label: t(`accounting.${translationKey}.addressModal.streetName_label`),
4309
- name: "street_name",
4310
- fieldArrayName: "addresses",
4311
- placeholder: t(`accounting.${translationKey}.addressModal.streetName_placeholder`)
4360
+ className: "addressModal--LanguageSwitch",
4361
+ row: true,
4362
+ value: language,
4363
+ onChange: (e) => handleLanguageChange(e.target.value),
4364
+ children: [
4365
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.FormControlLabel, { value: "en", control: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(android12Switch.Radio, {}), label: "English" }),
4366
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.FormControlLabel, { value: "ar", control: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(android12Switch.Radio, {}), label: "Arabic" })
4367
+ ]
4312
4368
  }
4313
- ) }),
4314
- isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
4369
+ ),
4370
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(material.Grid, { container: true, rowGap: 1.5, columnSpacing: 3, pt: 3, children: [
4371
+ language === "en" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4372
+ android12Switch.DynamicSearchSelect,
4373
+ {
4374
+ label: t(`accounting.${translationKey}.addressModal.address_type_label`),
4375
+ options: addressTypeOptions,
4376
+ name: "address_type",
4377
+ placeholder: t(`accounting.${translationKey}.addressModal.address_type_placeholder`),
4378
+ fieldArrayName: "addresses",
4379
+ formControl: control,
4380
+ required: true
4381
+ }
4382
+ ) }),
4383
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4384
+ appbar.DynamicInput,
4385
+ {
4386
+ type: "text",
4387
+ formControl: control,
4388
+ label: t(`accounting.${translationKey}.addressModal.contact_name_label`),
4389
+ name: "contact_name",
4390
+ fieldArrayName: "addresses",
4391
+ placeholder: t(`accounting.${translationKey}.addressModal.contact_name_placeholder`),
4392
+ required: language === "en"
4393
+ }
4394
+ ) }),
4395
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4396
+ android12Switch.DynamicPhone,
4397
+ {
4398
+ type: "text",
4399
+ formControl: control,
4400
+ label: t(`accounting.${translationKey}.addressModal.mobile_label`),
4401
+ name: "mobile",
4402
+ fieldArrayName: "addresses",
4403
+ setCountryCodeField: (country) => handleSetCountryCodeField(country)
4404
+ }
4405
+ ) }),
4406
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4407
+ appbar.DynamicInput,
4408
+ {
4409
+ type: "text",
4410
+ formControl: control,
4411
+ label: t(`accounting.${translationKey}.addressModal.address1_label`),
4412
+ name: "street_1",
4413
+ fieldArrayName: "addresses",
4414
+ placeholder: t(`accounting.${translationKey}.addressModal.address1_placeholder`),
4415
+ required: language === "en"
4416
+ }
4417
+ ) }),
4418
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4419
+ appbar.DynamicInput,
4420
+ {
4421
+ type: "text",
4422
+ formControl: control,
4423
+ label: t(`accounting.${translationKey}.addressModal.address2_label`),
4424
+ name: "street_2",
4425
+ fieldArrayName: "addresses",
4426
+ placeholder: t(`accounting.${translationKey}.addressModal.address2_placeholder`)
4427
+ }
4428
+ ) }),
4429
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4430
+ appbar.DynamicInput,
4431
+ {
4432
+ type: "text",
4433
+ formControl: control,
4434
+ label: t(`accounting.${translationKey}.addressModal.address3_label`),
4435
+ name: "street_3",
4436
+ fieldArrayName: "addresses",
4437
+ placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
4438
+ }
4439
+ ) }),
4440
+ isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4441
+ appbar.DynamicInput,
4442
+ {
4443
+ type: "text",
4444
+ formControl: control,
4445
+ label: t(`accounting.${translationKey}.addressModal.streetName_label`),
4446
+ name: "street_name",
4447
+ fieldArrayName: "addresses",
4448
+ placeholder: t(`accounting.${translationKey}.addressModal.streetName_placeholder`)
4449
+ }
4450
+ ) }),
4451
+ isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [
4452
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4453
+ appbar.DynamicInput,
4454
+ {
4455
+ type: "text",
4456
+ formControl: control,
4457
+ label: t(`accounting.${translationKey}.addressModal.buildingNo_label`),
4458
+ name: "building_no",
4459
+ fieldArrayName: "addresses",
4460
+ placeholder: "Enter Building No."
4461
+ }
4462
+ ) }),
4463
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4464
+ appbar.DynamicInput,
4465
+ {
4466
+ type: "text",
4467
+ formControl: control,
4468
+ label: t(`accounting.${translationKey}.addressModal.additionalNo_label`),
4469
+ name: "additional_no",
4470
+ fieldArrayName: "addresses",
4471
+ placeholder: "Enter Additional No."
4472
+ }
4473
+ ) })
4474
+ ] }),
4475
+ isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4476
+ appbar.DynamicInput,
4477
+ {
4478
+ type: "text",
4479
+ formControl: control,
4480
+ label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
4481
+ name: "national_address",
4482
+ fieldArrayName: "addresses",
4483
+ placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
4484
+ }
4485
+ ) }),
4315
4486
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4316
4487
  appbar.DynamicInput,
4317
4488
  {
4318
4489
  type: "text",
4319
4490
  formControl: control,
4320
- label: t(`accounting.${translationKey}.addressModal.buildingNo_label`),
4321
- name: "building_no",
4491
+ label: t(`accounting.${translationKey}.addressModal.zip_code_label`),
4492
+ name: "zip_code",
4322
4493
  fieldArrayName: "addresses",
4323
- placeholder: "Enter Building No."
4494
+ placeholder: t(`accounting.${translationKey}.addressModal.zip_code_placeholder`),
4495
+ required: !optionalFields.includes("zip_code") && language === "en"
4496
+ }
4497
+ ) }),
4498
+ language === "en" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4499
+ android12Switch.DynamicSearchSelect,
4500
+ {
4501
+ label: t(`accounting.${translationKey}.addressModal.country_label`),
4502
+ name: "country",
4503
+ placeholder: t(`accounting.${translationKey}.addressModal.country_placeholder`),
4504
+ fieldArrayName: "addresses",
4505
+ formControl: control,
4506
+ apiType: "countries",
4507
+ getSelectedData: (row) => setDetailsData(row, "country_data"),
4508
+ required: true
4509
+ }
4510
+ ) }),
4511
+ language === "en" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4512
+ android12Switch.DynamicSearchSelect,
4513
+ {
4514
+ label: t(`accounting.${translationKey}.addressModal.state_label`),
4515
+ name: "state",
4516
+ placeholder: t(`accounting.${translationKey}.addressModal.state_placeholder`),
4517
+ fieldArrayName: "addresses",
4518
+ formControl: control,
4519
+ apiType: "states",
4520
+ customeFilter: stateFilter,
4521
+ getSelectedData: (row) => setDetailsData(row, "state_data"),
4522
+ required: true
4324
4523
  }
4325
4524
  ) }),
4326
4525
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4526
+ appbar.DynamicInput,
4527
+ {
4528
+ label: t(`accounting.${translationKey}.addressModal.city_label`),
4529
+ name: "city",
4530
+ placeholder: t(`accounting.${translationKey}.addressModal.city_placeholder`),
4531
+ fieldArrayName: "addresses",
4532
+ formControl: control
4533
+ }
4534
+ ) }),
4535
+ isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4327
4536
  appbar.DynamicInput,
4328
4537
  {
4329
4538
  type: "text",
4330
4539
  formControl: control,
4331
- label: t(`accounting.${translationKey}.addressModal.additionalNo_label`),
4332
- name: "additional_no",
4540
+ label: t(`accounting.${translationKey}.addressModal.districtName_label`),
4541
+ name: "district_name",
4542
+ fieldArrayName: "addresses",
4543
+ placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
4544
+ }
4545
+ ) }),
4546
+ /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4547
+ appbar.DynamicInput,
4548
+ {
4549
+ type: "text",
4550
+ formControl: control,
4551
+ label: t(`accounting.${translationKey}.addressModal.summary_label`),
4552
+ name: "summary",
4553
+ fieldArrayName: "addresses",
4554
+ placeholder: t(`accounting.${translationKey}.addressModal.summary_placeholder`),
4555
+ is_multiline: true,
4556
+ disabled: true
4557
+ }
4558
+ ) }),
4559
+ language === "en" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4560
+ android12Switch.DynamicCheckBox,
4561
+ {
4562
+ formControl: control,
4563
+ name: "default_shipping_address",
4564
+ title: t(`accounting.${translationKey}.addressModal.default_shipping_address_label`),
4565
+ fieldArrayName: "addresses",
4566
+ titlePosition: "end"
4567
+ }
4568
+ ) }),
4569
+ language === "en" && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4570
+ android12Switch.DynamicCheckBox,
4571
+ {
4572
+ formControl: control,
4573
+ name: "default_billing_address",
4574
+ title: t(`accounting.${translationKey}.addressModal.default_billing_address_label`),
4333
4575
  fieldArrayName: "addresses",
4334
- placeholder: "Enter Additional No."
4576
+ titlePosition: "end"
4335
4577
  }
4336
4578
  ) })
4337
- ] }),
4338
- isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4339
- appbar.DynamicInput,
4340
- {
4341
- type: "text",
4342
- formControl: control,
4343
- label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
4344
- name: "national_address",
4345
- fieldArrayName: "addresses",
4346
- placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
4347
- }
4348
- ) }),
4349
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4350
- appbar.DynamicInput,
4351
- {
4352
- type: "text",
4353
- formControl: control,
4354
- label: t(`accounting.${translationKey}.addressModal.zip_code_label`),
4355
- name: "zip_code",
4356
- fieldArrayName: "addresses",
4357
- placeholder: t(`accounting.${translationKey}.addressModal.zip_code_placeholder`),
4358
- required: !optionalFields.includes("zip_code")
4359
- }
4360
- ) }),
4361
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4362
- android12Switch.DynamicSearchSelect,
4363
- {
4364
- label: t(`accounting.${translationKey}.addressModal.country_label`),
4365
- name: "country",
4366
- placeholder: t(`accounting.${translationKey}.addressModal.country_placeholder`),
4367
- fieldArrayName: "addresses",
4368
- formControl: control,
4369
- apiType: "countries",
4370
- getSelectedData: (row) => setDetailsData(row, "country_data"),
4371
- required: true
4372
- }
4373
- ) }),
4374
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4375
- android12Switch.DynamicSearchSelect,
4376
- {
4377
- label: t(`accounting.${translationKey}.addressModal.state_label`),
4378
- name: "state",
4379
- placeholder: t(`accounting.${translationKey}.addressModal.state_placeholder`),
4380
- fieldArrayName: "addresses",
4381
- formControl: control,
4382
- apiType: "states",
4383
- customeFilter: stateFilter,
4384
- getSelectedData: (row) => setDetailsData(row, "state_data"),
4385
- required: !optionalFields.includes("state")
4386
- }
4387
- ) }),
4388
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4389
- appbar.DynamicInput,
4390
- {
4391
- label: t(`accounting.${translationKey}.addressModal.city_label`),
4392
- name: "city",
4393
- placeholder: t(`accounting.${translationKey}.addressModal.city_placeholder`),
4394
- fieldArrayName: "addresses",
4395
- formControl: control
4396
- }
4397
- ) }),
4398
- isKSA && /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4399
- appbar.DynamicInput,
4400
- {
4401
- type: "text",
4402
- formControl: control,
4403
- label: t(`accounting.${translationKey}.addressModal.districtName_label`),
4404
- name: "district_name",
4405
- fieldArrayName: "addresses",
4406
- placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
4407
- }
4408
- ) }),
4409
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4410
- appbar.DynamicInput,
4411
- {
4412
- type: "text",
4413
- formControl: control,
4414
- label: t(`accounting.${translationKey}.addressModal.summary_label`),
4415
- name: "summary",
4416
- fieldArrayName: "addresses",
4417
- placeholder: t(`accounting.${translationKey}.addressModal.summary_placeholder`),
4418
- is_multiline: true,
4419
- disabled: true
4420
- }
4421
- ) }),
4422
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4423
- android12Switch.DynamicCheckBox,
4424
- {
4425
- formControl: control,
4426
- name: "default_shipping_address",
4427
- title: t(`accounting.${translationKey}.addressModal.default_shipping_address_label`),
4428
- fieldArrayName: "addresses",
4429
- titlePosition: "end"
4430
- }
4431
- ) }),
4432
- /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(material.Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(
4433
- android12Switch.DynamicCheckBox,
4434
- {
4435
- formControl: control,
4436
- name: "default_billing_address",
4437
- title: t(`accounting.${translationKey}.addressModal.default_billing_address_label`),
4438
- fieldArrayName: "addresses",
4439
- titlePosition: "end"
4440
- }
4441
- ) })
4442
- ] }) }),
4579
+ ] })
4580
+ ] }),
4443
4581
  /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsxs(
4444
4582
  material.DialogActions,
4445
4583
  {
@@ -17048,4 +17186,4 @@ exports.dynamicFields = dynamicFields;
17048
17186
  exports.fields = fields;
17049
17187
  exports.useDynamicLayout = useDynamicLayout;
17050
17188
  exports.validator = validator;
17051
- //# sourceMappingURL=uom-field-wrapper-Bdou6Bjq.js.map
17189
+ //# sourceMappingURL=uom-field-wrapper-DGt-0_BI.js.map