@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.
- package/dist/chunks/{android-12-switch-1bs0RMnV.js → android-12-switch-BgFAxJ9x.js} +2 -2
- package/dist/chunks/{android-12-switch-1bs0RMnV.js.map → android-12-switch-BgFAxJ9x.js.map} +1 -1
- package/dist/chunks/{android-12-switch-BQHaGZz6.esm.js → android-12-switch-DoExcS1P.esm.js} +2 -2
- package/dist/chunks/{android-12-switch-BQHaGZz6.esm.js.map → android-12-switch-DoExcS1P.esm.js.map} +1 -1
- package/dist/chunks/{appbar-DELlMlbx.esm.js → appbar-D1L6GTYk.esm.js} +30 -25
- package/dist/chunks/appbar-D1L6GTYk.esm.js.map +1 -0
- package/dist/chunks/{appbar-xuAwm7L1.js → appbar-D424Z-Ai.js} +30 -25
- package/dist/chunks/appbar-D424Z-Ai.js.map +1 -0
- package/dist/chunks/{default-data-DzOhtrxC.esm.js → default-data-CdhwU3H3.esm.js} +3 -3
- package/dist/chunks/{default-data-DzOhtrxC.esm.js.map → default-data-CdhwU3H3.esm.js.map} +1 -1
- package/dist/chunks/{default-data-BLwWZjhM.js → default-data-Cgb7xKe1.js} +3 -3
- package/dist/chunks/{default-data-BLwWZjhM.js.map → default-data-Cgb7xKe1.js.map} +1 -1
- package/dist/chunks/{fullScreen-B0QUzNj3.js → fullScreen-BUbaMxdQ.js} +2 -2
- package/dist/chunks/{fullScreen-B0QUzNj3.js.map → fullScreen-BUbaMxdQ.js.map} +1 -1
- package/dist/chunks/{fullScreen-C8dcx8pG.esm.js → fullScreen-COa9H9T5.esm.js} +2 -2
- package/dist/chunks/{fullScreen-C8dcx8pG.esm.js.map → fullScreen-COa9H9T5.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-fZ9vocVX.esm.js → sidebar-D5jsYGs8.esm.js} +2 -2
- package/dist/chunks/{sidebar-fZ9vocVX.esm.js.map → sidebar-D5jsYGs8.esm.js.map} +1 -1
- package/dist/chunks/{sidebar-BC824FOR.js → sidebar-DvPIFrpF.js} +2 -2
- package/dist/chunks/{sidebar-BC824FOR.js.map → sidebar-DvPIFrpF.js.map} +1 -1
- package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js → sidebarScreen-B4RSyJAT.esm.js} +3 -3
- package/dist/chunks/{sidebarScreen--NIbnhIf.esm.js.map → sidebarScreen-B4RSyJAT.esm.js.map} +1 -1
- package/dist/chunks/{sidebarScreen-B08K08t5.js → sidebarScreen-CFDnYrtL.js} +3 -3
- package/dist/chunks/{sidebarScreen-B08K08t5.js.map → sidebarScreen-CFDnYrtL.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-Bdou6Bjq.js → uom-field-wrapper-DGt-0_BI.js} +359 -221
- package/dist/chunks/{uom-field-wrapper-Bdou6Bjq.js.map → uom-field-wrapper-DGt-0_BI.js.map} +1 -1
- package/dist/chunks/{uom-field-wrapper-swTpN914.esm.js → uom-field-wrapper-_O6BmPp4.esm.js} +360 -222
- package/dist/chunks/{uom-field-wrapper-swTpN914.esm.js.map → uom-field-wrapper-_O6BmPp4.esm.js.map} +1 -1
- package/dist/components/chat-bot/doc-intro.d.ts +4 -2
- package/dist/components/index.esm.js +4 -4
- package/dist/components/index.js +4 -4
- package/dist/index.esm.js +7 -7
- package/dist/index.js +7 -7
- package/dist/layout/index.esm.js +2 -2
- package/dist/layout/index.js +2 -2
- package/dist/src/components/chat-bot/doc-intro.d.ts +4 -2
- package/dist/style.css +10 -1
- package/dist/views/index.esm.js +5 -5
- package/dist/views/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/appbar-DELlMlbx.esm.js.map +0 -1
- package/dist/chunks/appbar-xuAwm7L1.js.map +0 -1
|
@@ -2,15 +2,15 @@ import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
|
|
|
2
2
|
import { useFieldArray, Controller, useForm, useWatch, useFormContext } from "react-hook-form";
|
|
3
3
|
import { P as PropTypes, e as _objectWithoutPropertiesLoose, _ as _extends$1, g as generateUtilityClass, j as capitalize, u as useDefaultProps, k as interopRequireDefaultExports, y as lighten_1, z as darken_1, f as alpha_1 } from "./identifier-0SZUhw_A.esm.js";
|
|
4
4
|
import { i as default_1$3, T as Typography, e as useForkRef, o as ownerWindow, d as useEnhancedEffect, h as debounce, p as isMuiElement, u as useAuth, q as useControlled, r as requireCreateSvgIcon } from "./useAuth-BwERM1Dl.esm.js";
|
|
5
|
-
import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-
|
|
6
|
-
import { D as DynamicInput, z as Typography$1, b as Avatar, F as o, M as Modal, c as ConfirmPopUp, B as Box$1, d as Toast, u as useTheme$1, S as SearchBar, G as resolveComponentProps, I as mergeSlotProps, J as appendOwnerState, P as Paper$1, n as chainPropTypes, f as ButtonBase$1, x as default_1$6, T as TextField$1, e as Tooltip$1, E as default_1$7, w as default_1$8, K as Menu$2, N as MenuItem$1, p as useRtl, y as List$1, t as ListItem, O as ListItemText$1, Q as refType } from "./appbar-
|
|
5
|
+
import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, a5 as Radio, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-DoExcS1P.esm.js";
|
|
6
|
+
import { D as DynamicInput, z as Typography$1, b as Avatar, F as o, M as Modal, c as ConfirmPopUp, B as Box$1, d as Toast, u as useTheme$1, S as SearchBar, G as resolveComponentProps, I as mergeSlotProps, J as appendOwnerState, P as Paper$1, n as chainPropTypes, f as ButtonBase$1, x as default_1$6, T as TextField$1, e as Tooltip$1, E as default_1$7, w as default_1$8, K as Menu$2, N as MenuItem$1, p as useRtl, y as List$1, t as ListItem, O as ListItemText$1, Q as refType } from "./appbar-D1L6GTYk.esm.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import React__default, { useState, lazy, useMemo, useRef, useEffect, useCallback, useLayoutEffect, useContext, createElement, createContext, cloneElement } from "react";
|
|
9
9
|
import DatePicker from "react-datepicker";
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { C as CalenderIcon, i as images } from "./images-DvZ6-RV8.esm.js";
|
|
12
12
|
import { KeyboardArrowLeft, KeyboardArrowRight, Close, ChevronLeft, ChevronRight, Add, AccessTimeRounded, KeyboardArrowUp, KeyboardArrowDown, Clear } from "@mui/icons-material";
|
|
13
|
-
import { Box, styled as styled$1, TextField, DialogTitle, IconButton, DialogContent, MenuItem, DialogActions, CircularProgress, FormControlLabel, Checkbox as Checkbox$2, Grid, ButtonBase, useTheme, useMediaQuery, Drawer, Tooltip, Collapse, Divider, ButtonGroup, Button as Button$1, Popper, Grow, Paper, ClickAwayListener, Menu as Menu$1, ListItemIcon, ListItemText, OutlinedInput, InputAdornment, Popover, Dialog, FormHelperText, Card as Card$1, CardContent as CardContent$1, TableRow, TableCell, TableContainer, Table, TableHead, TableBody } from "@mui/material";
|
|
13
|
+
import { Box, styled as styled$1, TextField, DialogTitle, IconButton, DialogContent, MenuItem, DialogActions, CircularProgress, FormControlLabel, Checkbox as Checkbox$2, Grid, RadioGroup, ButtonBase, useTheme, useMediaQuery, Drawer, Tooltip, Collapse, Divider, ButtonGroup, Button as Button$1, Popper, Grow, Paper, ClickAwayListener, Menu as Menu$1, ListItemIcon, ListItemText, OutlinedInput, InputAdornment, Popover, Dialog, FormHelperText, Card as Card$1, CardContent as CardContent$1, TableRow, TableCell, TableContainer, Table, TableHead, TableBody } from "@mui/material";
|
|
14
14
|
import { u as useLanguage } from "./useLangauge-B5J47qzp.esm.js";
|
|
15
15
|
import dayjs from "dayjs";
|
|
16
16
|
/* empty css */
|
|
@@ -53,7 +53,7 @@ import { v as viewTypes } from "./action-bar-BsXTcYpL.esm.js";
|
|
|
53
53
|
import DataEditor, { GridCellKind } from "@glideapps/glide-data-grid";
|
|
54
54
|
import { useExtraCells } from "@glideapps/glide-data-grid-cells";
|
|
55
55
|
import { createPortal } from "react-dom";
|
|
56
|
-
import { C as Collapse$1 } from "./sidebar-
|
|
56
|
+
import { C as Collapse$1 } from "./sidebar-D5jsYGs8.esm.js";
|
|
57
57
|
import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
|
|
58
58
|
import { R as RecgtangleIcon, C as CheckBoxIcon$1, T as Trash, E as Edit } from "./trash-Dgfsw2UY.esm.js";
|
|
59
59
|
import { C as Close$1 } from "./document-CFCrnZGh.esm.js";
|
|
@@ -3959,6 +3959,60 @@ const addressTypeOptions = [
|
|
|
3959
3959
|
{ label: "Shipping", value: "Shipping" },
|
|
3960
3960
|
{ label: "Office", value: "Office" }
|
|
3961
3961
|
];
|
|
3962
|
+
const zipCodeRule = Yup.string().matches(/^[0-9\u0660-\u0669]+$/, {
|
|
3963
|
+
message: "Zip code must contain only digits without special characters",
|
|
3964
|
+
excludeEmptyString: true
|
|
3965
|
+
}).test(
|
|
3966
|
+
"no-dot-plus",
|
|
3967
|
+
'Zip code must not contain "." or "+"',
|
|
3968
|
+
(value) => !(value == null ? void 0 : value.includes(".")) && !(value == null ? void 0 : value.includes("+"))
|
|
3969
|
+
);
|
|
3970
|
+
const cityRule = Yup.string().matches(/^[A-Za-z\u0600-\u06FF\s]+$/, {
|
|
3971
|
+
message: "City must contain alphabets only",
|
|
3972
|
+
excludeEmptyString: true
|
|
3973
|
+
});
|
|
3974
|
+
const ADDRESS_CONTENT_FIELDS = [
|
|
3975
|
+
"address_type",
|
|
3976
|
+
"contact_name",
|
|
3977
|
+
"mobile",
|
|
3978
|
+
"street_1",
|
|
3979
|
+
"street_2",
|
|
3980
|
+
"street_3",
|
|
3981
|
+
"street_name",
|
|
3982
|
+
"building_no",
|
|
3983
|
+
"additional_no",
|
|
3984
|
+
"national_address",
|
|
3985
|
+
"zip_code",
|
|
3986
|
+
"city",
|
|
3987
|
+
"district_name",
|
|
3988
|
+
"state",
|
|
3989
|
+
"country"
|
|
3990
|
+
];
|
|
3991
|
+
const BLANK_ADDRESS = {
|
|
3992
|
+
address_type: "",
|
|
3993
|
+
contact_name: "",
|
|
3994
|
+
country_code: "",
|
|
3995
|
+
mobile: "",
|
|
3996
|
+
street_1: "",
|
|
3997
|
+
street_2: "",
|
|
3998
|
+
street_3: "",
|
|
3999
|
+
street_name: "",
|
|
4000
|
+
building_no: "",
|
|
4001
|
+
additional_no: "",
|
|
4002
|
+
national_address: "",
|
|
4003
|
+
zip_code: "",
|
|
4004
|
+
city: "",
|
|
4005
|
+
district_name: "",
|
|
4006
|
+
state: null,
|
|
4007
|
+
country: null,
|
|
4008
|
+
summary: "",
|
|
4009
|
+
default_shipping_address: false,
|
|
4010
|
+
default_billing_address: false
|
|
4011
|
+
};
|
|
4012
|
+
const hasValues = (values) => !!values && ADDRESS_CONTENT_FIELDS.some((field) => {
|
|
4013
|
+
const value = values[field];
|
|
4014
|
+
return value !== void 0 && value !== null && String(value).trim() !== "";
|
|
4015
|
+
});
|
|
3962
4016
|
const buildValidationSchema = (isKSA, optionalFields = []) => {
|
|
3963
4017
|
const zipOptional = optionalFields.includes("zip_code");
|
|
3964
4018
|
const stateOptional = optionalFields.includes("state");
|
|
@@ -3985,6 +4039,12 @@ const buildValidationSchema = (isKSA, optionalFields = []) => {
|
|
|
3985
4039
|
})
|
|
3986
4040
|
});
|
|
3987
4041
|
};
|
|
4042
|
+
const arabicValidationSchema = Yup.object().shape({
|
|
4043
|
+
addresses: Yup.object().shape({
|
|
4044
|
+
zip_code: zipCodeRule,
|
|
4045
|
+
city: cityRule
|
|
4046
|
+
})
|
|
4047
|
+
});
|
|
3988
4048
|
const AddressModal = ({
|
|
3989
4049
|
isOpen,
|
|
3990
4050
|
setIsOpen,
|
|
@@ -4001,6 +4061,8 @@ const AddressModal = ({
|
|
|
4001
4061
|
const { t } = useTranslation();
|
|
4002
4062
|
const isKSA = ((_a = getApiConfigSafe()) == null ? void 0 : _a.countryEnv) === "ksa";
|
|
4003
4063
|
const [submitLoading, setSubmitLoading] = useState(false);
|
|
4064
|
+
const [language, setLanguage] = useState("en");
|
|
4065
|
+
const [drafts, setDrafts] = useState({});
|
|
4004
4066
|
const [entryDetails, setEntryDetails] = useState({
|
|
4005
4067
|
country_data: null,
|
|
4006
4068
|
state_data: null
|
|
@@ -4020,7 +4082,7 @@ const AddressModal = ({
|
|
|
4020
4082
|
trigger,
|
|
4021
4083
|
getFieldState
|
|
4022
4084
|
} = useForm({
|
|
4023
|
-
resolver: o(validationSchema2),
|
|
4085
|
+
resolver: o(language === "ar" ? arabicValidationSchema : validationSchema2),
|
|
4024
4086
|
mode: "all"
|
|
4025
4087
|
});
|
|
4026
4088
|
const watchedValues = useWatch({
|
|
@@ -4048,6 +4110,30 @@ const AddressModal = ({
|
|
|
4048
4110
|
handleValidateSave(values);
|
|
4049
4111
|
setSubmitLoading(false);
|
|
4050
4112
|
};
|
|
4113
|
+
const handleLanguageChange = async (next) => {
|
|
4114
|
+
var _a2;
|
|
4115
|
+
if (next === language) {
|
|
4116
|
+
return;
|
|
4117
|
+
}
|
|
4118
|
+
if (next === "ar" && !hasValues(drafts.ar)) {
|
|
4119
|
+
const isEnglishValid = await trigger();
|
|
4120
|
+
if (!isEnglishValid) {
|
|
4121
|
+
enqueueSnackbar(
|
|
4122
|
+
t(`accounting.${translationKey}.msg.fill_english_address_first`, {
|
|
4123
|
+
defaultValue: "Please fill the English address first"
|
|
4124
|
+
}),
|
|
4125
|
+
{ variant: "error" }
|
|
4126
|
+
);
|
|
4127
|
+
return;
|
|
4128
|
+
}
|
|
4129
|
+
}
|
|
4130
|
+
const current = (_a2 = getValues()) == null ? void 0 : _a2.addresses;
|
|
4131
|
+
setDrafts((prev) => ({ ...prev, [language]: current }));
|
|
4132
|
+
setLanguage(next);
|
|
4133
|
+
reset({
|
|
4134
|
+
addresses: { ...BLANK_ADDRESS, ...drafts[next] ?? {} }
|
|
4135
|
+
});
|
|
4136
|
+
};
|
|
4051
4137
|
const handleDuplicate = async () => {
|
|
4052
4138
|
const v = await trigger();
|
|
4053
4139
|
if (!v) {
|
|
@@ -4061,7 +4147,8 @@ const AddressModal = ({
|
|
|
4061
4147
|
default_shipping_address: false,
|
|
4062
4148
|
default_billing_address: false,
|
|
4063
4149
|
country: country_data,
|
|
4064
|
-
state: state_data
|
|
4150
|
+
state: state_data,
|
|
4151
|
+
language
|
|
4065
4152
|
}
|
|
4066
4153
|
};
|
|
4067
4154
|
setSubmitLoading(true);
|
|
@@ -4070,6 +4157,7 @@ const AddressModal = ({
|
|
|
4070
4157
|
setSubmitLoading(false);
|
|
4071
4158
|
};
|
|
4072
4159
|
const handleValidateSave = (values) => {
|
|
4160
|
+
var _a2;
|
|
4073
4161
|
const validateDefaults = (data, index, type = "shipping") => {
|
|
4074
4162
|
const u_data = [...data];
|
|
4075
4163
|
if (index != null && index >= 0) {
|
|
@@ -4093,33 +4181,50 @@ const AddressModal = ({
|
|
|
4093
4181
|
return false;
|
|
4094
4182
|
}
|
|
4095
4183
|
};
|
|
4096
|
-
const { addresses } = values;
|
|
4097
4184
|
try {
|
|
4098
|
-
|
|
4185
|
+
let englishValues = language === "en" ? values == null ? void 0 : values.addresses : drafts.en;
|
|
4186
|
+
const arabicValues = language === "ar" ? values == null ? void 0 : values.addresses : drafts.ar;
|
|
4187
|
+
if (englishValues == null ? void 0 : englishValues.default_shipping_address) {
|
|
4099
4188
|
validateDefaults(items, itemIndex, "shipping");
|
|
4100
4189
|
}
|
|
4101
|
-
if (
|
|
4190
|
+
if (englishValues == null ? void 0 : englishValues.default_billing_address) {
|
|
4102
4191
|
validateDefaults(items, itemIndex, "billing");
|
|
4103
4192
|
}
|
|
4104
|
-
if (items && (items == null ? void 0 : items.length) === 0) {
|
|
4105
|
-
|
|
4106
|
-
...
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
default_shipping_address: true,
|
|
4110
|
-
default_billing_address: true
|
|
4111
|
-
}
|
|
4193
|
+
if (englishValues && items && (items == null ? void 0 : items.length) === 0) {
|
|
4194
|
+
englishValues = {
|
|
4195
|
+
...englishValues,
|
|
4196
|
+
default_shipping_address: true,
|
|
4197
|
+
default_billing_address: true
|
|
4112
4198
|
};
|
|
4113
4199
|
}
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4200
|
+
if (!hasValues(englishValues) && !hasValues(arabicValues)) {
|
|
4201
|
+
return;
|
|
4202
|
+
}
|
|
4203
|
+
if (!hasValues(englishValues)) {
|
|
4204
|
+
onSave(
|
|
4205
|
+
{
|
|
4206
|
+
...values,
|
|
4207
|
+
addresses: {
|
|
4208
|
+
...arabicValues,
|
|
4209
|
+
address_type: (arabicValues == null ? void 0 : arabicValues.address_type) || (itemData == null ? void 0 : itemData.address_type),
|
|
4210
|
+
country: country_data,
|
|
4211
|
+
state: state_data,
|
|
4212
|
+
language: "ar"
|
|
4213
|
+
}
|
|
4214
|
+
},
|
|
4215
|
+
itemIndex
|
|
4216
|
+
);
|
|
4217
|
+
handleModalClose();
|
|
4218
|
+
return;
|
|
4219
|
+
}
|
|
4220
|
+
const row = {
|
|
4221
|
+
...englishValues,
|
|
4222
|
+
country: country_data,
|
|
4223
|
+
state: state_data,
|
|
4224
|
+
language: "en"
|
|
4121
4225
|
};
|
|
4122
|
-
|
|
4226
|
+
row.arabic = hasValues(arabicValues) ? { ...arabicValues, id: (_a2 = itemData == null ? void 0 : itemData.arabic) == null ? void 0 : _a2.id } : null;
|
|
4227
|
+
onSave({ ...values, addresses: row }, itemIndex);
|
|
4123
4228
|
handleModalClose();
|
|
4124
4229
|
} catch (error) {
|
|
4125
4230
|
enqueueSnackbar((error == null ? void 0 : error.message) || "Something went wrong", {
|
|
@@ -4129,6 +4234,8 @@ const AddressModal = ({
|
|
|
4129
4234
|
};
|
|
4130
4235
|
const handleModalClose = () => {
|
|
4131
4236
|
reset({ addresses: null });
|
|
4237
|
+
setDrafts({});
|
|
4238
|
+
setLanguage("en");
|
|
4132
4239
|
setEntryDetails({
|
|
4133
4240
|
state_data: null,
|
|
4134
4241
|
country_data: null
|
|
@@ -4164,21 +4271,37 @@ const AddressModal = ({
|
|
|
4164
4271
|
setValue("addresses.summary", summaryVal);
|
|
4165
4272
|
}, [setValue, watchedValues, country_data, state_data]);
|
|
4166
4273
|
useEffect(() => {
|
|
4167
|
-
var _a2, _b2;
|
|
4274
|
+
var _a2, _b2, _c, _d;
|
|
4168
4275
|
if (itemData) {
|
|
4276
|
+
setLanguage((itemData == null ? void 0 : itemData.language) === "ar" ? "ar" : "en");
|
|
4277
|
+
const { arabic, ...englishData } = itemData;
|
|
4278
|
+
setDrafts(
|
|
4279
|
+
arabic ? {
|
|
4280
|
+
ar: {
|
|
4281
|
+
...BLANK_ADDRESS,
|
|
4282
|
+
...arabic,
|
|
4283
|
+
country: ((_a2 = arabic == null ? void 0 : arabic.country) == null ? void 0 : _a2.id) ?? (arabic == null ? void 0 : arabic.country),
|
|
4284
|
+
state: ((_b2 = arabic == null ? void 0 : arabic.state) == null ? void 0 : _b2.id) ?? (arabic == null ? void 0 : arabic.state)
|
|
4285
|
+
}
|
|
4286
|
+
} : {}
|
|
4287
|
+
);
|
|
4169
4288
|
reset({
|
|
4170
4289
|
addresses: {
|
|
4171
|
-
...
|
|
4172
|
-
|
|
4173
|
-
|
|
4290
|
+
...BLANK_ADDRESS,
|
|
4291
|
+
...englishData,
|
|
4292
|
+
country: (_c = englishData == null ? void 0 : englishData.country) == null ? void 0 : _c.id,
|
|
4293
|
+
state: (_d = englishData == null ? void 0 : englishData.state) == null ? void 0 : _d.id
|
|
4174
4294
|
}
|
|
4175
4295
|
});
|
|
4176
4296
|
}
|
|
4177
4297
|
}, [itemData, reset]);
|
|
4178
4298
|
useEffect(() => {
|
|
4179
4299
|
if (isOpen && !itemData) {
|
|
4300
|
+
setLanguage("en");
|
|
4301
|
+
setDrafts({});
|
|
4180
4302
|
reset({
|
|
4181
4303
|
addresses: {
|
|
4304
|
+
...BLANK_ADDRESS,
|
|
4182
4305
|
address_type: "Office",
|
|
4183
4306
|
contact_name: (prefillData == null ? void 0 : prefillData.contact_name) || "",
|
|
4184
4307
|
mobile: (prefillData == null ? void 0 : prefillData.mobile) || ""
|
|
@@ -4211,216 +4334,231 @@ const AddressModal = ({
|
|
|
4211
4334
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", color: "inherit", weight: "medium", children: t(`accounting.${translationKey}.addressModal.title`) }),
|
|
4212
4335
|
/* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { onClick: handleModalClose, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Close, { fontSize: "small" }) })
|
|
4213
4336
|
] }),
|
|
4214
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
4215
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
4216
|
-
|
|
4217
|
-
{
|
|
4218
|
-
label: t(`accounting.${translationKey}.addressModal.address_type_label`),
|
|
4219
|
-
options: addressTypeOptions,
|
|
4220
|
-
name: "address_type",
|
|
4221
|
-
placeholder: t(`accounting.${translationKey}.addressModal.address_type_placeholder`),
|
|
4222
|
-
fieldArrayName: "addresses",
|
|
4223
|
-
formControl: control,
|
|
4224
|
-
required: true
|
|
4225
|
-
}
|
|
4226
|
-
) }),
|
|
4227
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4228
|
-
DynamicInput,
|
|
4229
|
-
{
|
|
4230
|
-
type: "text",
|
|
4231
|
-
formControl: control,
|
|
4232
|
-
label: t(`accounting.${translationKey}.addressModal.contact_name_label`),
|
|
4233
|
-
name: "contact_name",
|
|
4234
|
-
fieldArrayName: "addresses",
|
|
4235
|
-
placeholder: t(`accounting.${translationKey}.addressModal.contact_name_placeholder`),
|
|
4236
|
-
required: true
|
|
4237
|
-
}
|
|
4238
|
-
) }),
|
|
4239
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4240
|
-
DynamicPhone,
|
|
4241
|
-
{
|
|
4242
|
-
type: "text",
|
|
4243
|
-
formControl: control,
|
|
4244
|
-
label: t(`accounting.${translationKey}.addressModal.mobile_label`),
|
|
4245
|
-
name: "mobile",
|
|
4246
|
-
fieldArrayName: "addresses",
|
|
4247
|
-
setCountryCodeField: (country) => handleSetCountryCodeField(country)
|
|
4248
|
-
}
|
|
4249
|
-
) }),
|
|
4250
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4251
|
-
DynamicInput,
|
|
4252
|
-
{
|
|
4253
|
-
type: "text",
|
|
4254
|
-
formControl: control,
|
|
4255
|
-
label: t(`accounting.${translationKey}.addressModal.address1_label`),
|
|
4256
|
-
name: "street_1",
|
|
4257
|
-
fieldArrayName: "addresses",
|
|
4258
|
-
placeholder: t(`accounting.${translationKey}.addressModal.address1_placeholder`),
|
|
4259
|
-
required: true
|
|
4260
|
-
}
|
|
4261
|
-
) }),
|
|
4262
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4263
|
-
DynamicInput,
|
|
4264
|
-
{
|
|
4265
|
-
type: "text",
|
|
4266
|
-
formControl: control,
|
|
4267
|
-
label: t(`accounting.${translationKey}.addressModal.address2_label`),
|
|
4268
|
-
name: "street_2",
|
|
4269
|
-
fieldArrayName: "addresses",
|
|
4270
|
-
placeholder: t(`accounting.${translationKey}.addressModal.address2_placeholder`)
|
|
4271
|
-
}
|
|
4272
|
-
) }),
|
|
4273
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4274
|
-
DynamicInput,
|
|
4275
|
-
{
|
|
4276
|
-
type: "text",
|
|
4277
|
-
formControl: control,
|
|
4278
|
-
label: t(`accounting.${translationKey}.addressModal.address3_label`),
|
|
4279
|
-
name: "street_3",
|
|
4280
|
-
fieldArrayName: "addresses",
|
|
4281
|
-
placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
|
|
4282
|
-
}
|
|
4283
|
-
) }),
|
|
4284
|
-
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4285
|
-
DynamicInput,
|
|
4337
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { children: [
|
|
4338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4339
|
+
RadioGroup,
|
|
4286
4340
|
{
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4341
|
+
className: "addressModal--LanguageSwitch",
|
|
4342
|
+
row: true,
|
|
4343
|
+
value: language,
|
|
4344
|
+
onChange: (e) => handleLanguageChange(e.target.value),
|
|
4345
|
+
children: [
|
|
4346
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FormControlLabel, { value: "en", control: /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, {}), label: "English" }),
|
|
4347
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FormControlLabel, { value: "ar", control: /* @__PURE__ */ jsxRuntimeExports.jsx(Radio, {}), label: "Arabic" })
|
|
4348
|
+
]
|
|
4293
4349
|
}
|
|
4294
|
-
)
|
|
4295
|
-
|
|
4350
|
+
),
|
|
4351
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Grid, { container: true, rowGap: 1.5, columnSpacing: 3, pt: 3, children: [
|
|
4352
|
+
language === "en" && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4353
|
+
DynamicSearchSelect,
|
|
4354
|
+
{
|
|
4355
|
+
label: t(`accounting.${translationKey}.addressModal.address_type_label`),
|
|
4356
|
+
options: addressTypeOptions,
|
|
4357
|
+
name: "address_type",
|
|
4358
|
+
placeholder: t(`accounting.${translationKey}.addressModal.address_type_placeholder`),
|
|
4359
|
+
fieldArrayName: "addresses",
|
|
4360
|
+
formControl: control,
|
|
4361
|
+
required: true
|
|
4362
|
+
}
|
|
4363
|
+
) }),
|
|
4364
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4365
|
+
DynamicInput,
|
|
4366
|
+
{
|
|
4367
|
+
type: "text",
|
|
4368
|
+
formControl: control,
|
|
4369
|
+
label: t(`accounting.${translationKey}.addressModal.contact_name_label`),
|
|
4370
|
+
name: "contact_name",
|
|
4371
|
+
fieldArrayName: "addresses",
|
|
4372
|
+
placeholder: t(`accounting.${translationKey}.addressModal.contact_name_placeholder`),
|
|
4373
|
+
required: language === "en"
|
|
4374
|
+
}
|
|
4375
|
+
) }),
|
|
4376
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4377
|
+
DynamicPhone,
|
|
4378
|
+
{
|
|
4379
|
+
type: "text",
|
|
4380
|
+
formControl: control,
|
|
4381
|
+
label: t(`accounting.${translationKey}.addressModal.mobile_label`),
|
|
4382
|
+
name: "mobile",
|
|
4383
|
+
fieldArrayName: "addresses",
|
|
4384
|
+
setCountryCodeField: (country) => handleSetCountryCodeField(country)
|
|
4385
|
+
}
|
|
4386
|
+
) }),
|
|
4387
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4388
|
+
DynamicInput,
|
|
4389
|
+
{
|
|
4390
|
+
type: "text",
|
|
4391
|
+
formControl: control,
|
|
4392
|
+
label: t(`accounting.${translationKey}.addressModal.address1_label`),
|
|
4393
|
+
name: "street_1",
|
|
4394
|
+
fieldArrayName: "addresses",
|
|
4395
|
+
placeholder: t(`accounting.${translationKey}.addressModal.address1_placeholder`),
|
|
4396
|
+
required: language === "en"
|
|
4397
|
+
}
|
|
4398
|
+
) }),
|
|
4399
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4400
|
+
DynamicInput,
|
|
4401
|
+
{
|
|
4402
|
+
type: "text",
|
|
4403
|
+
formControl: control,
|
|
4404
|
+
label: t(`accounting.${translationKey}.addressModal.address2_label`),
|
|
4405
|
+
name: "street_2",
|
|
4406
|
+
fieldArrayName: "addresses",
|
|
4407
|
+
placeholder: t(`accounting.${translationKey}.addressModal.address2_placeholder`)
|
|
4408
|
+
}
|
|
4409
|
+
) }),
|
|
4410
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4411
|
+
DynamicInput,
|
|
4412
|
+
{
|
|
4413
|
+
type: "text",
|
|
4414
|
+
formControl: control,
|
|
4415
|
+
label: t(`accounting.${translationKey}.addressModal.address3_label`),
|
|
4416
|
+
name: "street_3",
|
|
4417
|
+
fieldArrayName: "addresses",
|
|
4418
|
+
placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
|
|
4419
|
+
}
|
|
4420
|
+
) }),
|
|
4421
|
+
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4422
|
+
DynamicInput,
|
|
4423
|
+
{
|
|
4424
|
+
type: "text",
|
|
4425
|
+
formControl: control,
|
|
4426
|
+
label: t(`accounting.${translationKey}.addressModal.streetName_label`),
|
|
4427
|
+
name: "street_name",
|
|
4428
|
+
fieldArrayName: "addresses",
|
|
4429
|
+
placeholder: t(`accounting.${translationKey}.addressModal.streetName_placeholder`)
|
|
4430
|
+
}
|
|
4431
|
+
) }),
|
|
4432
|
+
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
4433
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4434
|
+
DynamicInput,
|
|
4435
|
+
{
|
|
4436
|
+
type: "text",
|
|
4437
|
+
formControl: control,
|
|
4438
|
+
label: t(`accounting.${translationKey}.addressModal.buildingNo_label`),
|
|
4439
|
+
name: "building_no",
|
|
4440
|
+
fieldArrayName: "addresses",
|
|
4441
|
+
placeholder: "Enter Building No."
|
|
4442
|
+
}
|
|
4443
|
+
) }),
|
|
4444
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4445
|
+
DynamicInput,
|
|
4446
|
+
{
|
|
4447
|
+
type: "text",
|
|
4448
|
+
formControl: control,
|
|
4449
|
+
label: t(`accounting.${translationKey}.addressModal.additionalNo_label`),
|
|
4450
|
+
name: "additional_no",
|
|
4451
|
+
fieldArrayName: "addresses",
|
|
4452
|
+
placeholder: "Enter Additional No."
|
|
4453
|
+
}
|
|
4454
|
+
) })
|
|
4455
|
+
] }),
|
|
4456
|
+
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4457
|
+
DynamicInput,
|
|
4458
|
+
{
|
|
4459
|
+
type: "text",
|
|
4460
|
+
formControl: control,
|
|
4461
|
+
label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
|
|
4462
|
+
name: "national_address",
|
|
4463
|
+
fieldArrayName: "addresses",
|
|
4464
|
+
placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
|
|
4465
|
+
}
|
|
4466
|
+
) }),
|
|
4296
4467
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4297
4468
|
DynamicInput,
|
|
4298
4469
|
{
|
|
4299
4470
|
type: "text",
|
|
4300
4471
|
formControl: control,
|
|
4301
|
-
label: t(`accounting.${translationKey}.addressModal.
|
|
4302
|
-
name: "
|
|
4472
|
+
label: t(`accounting.${translationKey}.addressModal.zip_code_label`),
|
|
4473
|
+
name: "zip_code",
|
|
4303
4474
|
fieldArrayName: "addresses",
|
|
4304
|
-
placeholder:
|
|
4475
|
+
placeholder: t(`accounting.${translationKey}.addressModal.zip_code_placeholder`),
|
|
4476
|
+
required: !optionalFields.includes("zip_code") && language === "en"
|
|
4477
|
+
}
|
|
4478
|
+
) }),
|
|
4479
|
+
language === "en" && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4480
|
+
DynamicSearchSelect,
|
|
4481
|
+
{
|
|
4482
|
+
label: t(`accounting.${translationKey}.addressModal.country_label`),
|
|
4483
|
+
name: "country",
|
|
4484
|
+
placeholder: t(`accounting.${translationKey}.addressModal.country_placeholder`),
|
|
4485
|
+
fieldArrayName: "addresses",
|
|
4486
|
+
formControl: control,
|
|
4487
|
+
apiType: "countries",
|
|
4488
|
+
getSelectedData: (row) => setDetailsData(row, "country_data"),
|
|
4489
|
+
required: true
|
|
4490
|
+
}
|
|
4491
|
+
) }),
|
|
4492
|
+
language === "en" && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4493
|
+
DynamicSearchSelect,
|
|
4494
|
+
{
|
|
4495
|
+
label: t(`accounting.${translationKey}.addressModal.state_label`),
|
|
4496
|
+
name: "state",
|
|
4497
|
+
placeholder: t(`accounting.${translationKey}.addressModal.state_placeholder`),
|
|
4498
|
+
fieldArrayName: "addresses",
|
|
4499
|
+
formControl: control,
|
|
4500
|
+
apiType: "states",
|
|
4501
|
+
customeFilter: stateFilter,
|
|
4502
|
+
getSelectedData: (row) => setDetailsData(row, "state_data"),
|
|
4503
|
+
required: true
|
|
4305
4504
|
}
|
|
4306
4505
|
) }),
|
|
4307
4506
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4507
|
+
DynamicInput,
|
|
4508
|
+
{
|
|
4509
|
+
label: t(`accounting.${translationKey}.addressModal.city_label`),
|
|
4510
|
+
name: "city",
|
|
4511
|
+
placeholder: t(`accounting.${translationKey}.addressModal.city_placeholder`),
|
|
4512
|
+
fieldArrayName: "addresses",
|
|
4513
|
+
formControl: control
|
|
4514
|
+
}
|
|
4515
|
+
) }),
|
|
4516
|
+
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4308
4517
|
DynamicInput,
|
|
4309
4518
|
{
|
|
4310
4519
|
type: "text",
|
|
4311
4520
|
formControl: control,
|
|
4312
|
-
label: t(`accounting.${translationKey}.addressModal.
|
|
4313
|
-
name: "
|
|
4521
|
+
label: t(`accounting.${translationKey}.addressModal.districtName_label`),
|
|
4522
|
+
name: "district_name",
|
|
4523
|
+
fieldArrayName: "addresses",
|
|
4524
|
+
placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
|
|
4525
|
+
}
|
|
4526
|
+
) }),
|
|
4527
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4528
|
+
DynamicInput,
|
|
4529
|
+
{
|
|
4530
|
+
type: "text",
|
|
4531
|
+
formControl: control,
|
|
4532
|
+
label: t(`accounting.${translationKey}.addressModal.summary_label`),
|
|
4533
|
+
name: "summary",
|
|
4534
|
+
fieldArrayName: "addresses",
|
|
4535
|
+
placeholder: t(`accounting.${translationKey}.addressModal.summary_placeholder`),
|
|
4536
|
+
is_multiline: true,
|
|
4537
|
+
disabled: true
|
|
4538
|
+
}
|
|
4539
|
+
) }),
|
|
4540
|
+
language === "en" && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4541
|
+
DynamicCheckBox,
|
|
4542
|
+
{
|
|
4543
|
+
formControl: control,
|
|
4544
|
+
name: "default_shipping_address",
|
|
4545
|
+
title: t(`accounting.${translationKey}.addressModal.default_shipping_address_label`),
|
|
4546
|
+
fieldArrayName: "addresses",
|
|
4547
|
+
titlePosition: "end"
|
|
4548
|
+
}
|
|
4549
|
+
) }),
|
|
4550
|
+
language === "en" && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4551
|
+
DynamicCheckBox,
|
|
4552
|
+
{
|
|
4553
|
+
formControl: control,
|
|
4554
|
+
name: "default_billing_address",
|
|
4555
|
+
title: t(`accounting.${translationKey}.addressModal.default_billing_address_label`),
|
|
4314
4556
|
fieldArrayName: "addresses",
|
|
4315
|
-
|
|
4557
|
+
titlePosition: "end"
|
|
4316
4558
|
}
|
|
4317
4559
|
) })
|
|
4318
|
-
] })
|
|
4319
|
-
|
|
4320
|
-
DynamicInput,
|
|
4321
|
-
{
|
|
4322
|
-
type: "text",
|
|
4323
|
-
formControl: control,
|
|
4324
|
-
label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
|
|
4325
|
-
name: "national_address",
|
|
4326
|
-
fieldArrayName: "addresses",
|
|
4327
|
-
placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
|
|
4328
|
-
}
|
|
4329
|
-
) }),
|
|
4330
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4331
|
-
DynamicInput,
|
|
4332
|
-
{
|
|
4333
|
-
type: "text",
|
|
4334
|
-
formControl: control,
|
|
4335
|
-
label: t(`accounting.${translationKey}.addressModal.zip_code_label`),
|
|
4336
|
-
name: "zip_code",
|
|
4337
|
-
fieldArrayName: "addresses",
|
|
4338
|
-
placeholder: t(`accounting.${translationKey}.addressModal.zip_code_placeholder`),
|
|
4339
|
-
required: !optionalFields.includes("zip_code")
|
|
4340
|
-
}
|
|
4341
|
-
) }),
|
|
4342
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4343
|
-
DynamicSearchSelect,
|
|
4344
|
-
{
|
|
4345
|
-
label: t(`accounting.${translationKey}.addressModal.country_label`),
|
|
4346
|
-
name: "country",
|
|
4347
|
-
placeholder: t(`accounting.${translationKey}.addressModal.country_placeholder`),
|
|
4348
|
-
fieldArrayName: "addresses",
|
|
4349
|
-
formControl: control,
|
|
4350
|
-
apiType: "countries",
|
|
4351
|
-
getSelectedData: (row) => setDetailsData(row, "country_data"),
|
|
4352
|
-
required: true
|
|
4353
|
-
}
|
|
4354
|
-
) }),
|
|
4355
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4356
|
-
DynamicSearchSelect,
|
|
4357
|
-
{
|
|
4358
|
-
label: t(`accounting.${translationKey}.addressModal.state_label`),
|
|
4359
|
-
name: "state",
|
|
4360
|
-
placeholder: t(`accounting.${translationKey}.addressModal.state_placeholder`),
|
|
4361
|
-
fieldArrayName: "addresses",
|
|
4362
|
-
formControl: control,
|
|
4363
|
-
apiType: "states",
|
|
4364
|
-
customeFilter: stateFilter,
|
|
4365
|
-
getSelectedData: (row) => setDetailsData(row, "state_data"),
|
|
4366
|
-
required: !optionalFields.includes("state")
|
|
4367
|
-
}
|
|
4368
|
-
) }),
|
|
4369
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4370
|
-
DynamicInput,
|
|
4371
|
-
{
|
|
4372
|
-
label: t(`accounting.${translationKey}.addressModal.city_label`),
|
|
4373
|
-
name: "city",
|
|
4374
|
-
placeholder: t(`accounting.${translationKey}.addressModal.city_placeholder`),
|
|
4375
|
-
fieldArrayName: "addresses",
|
|
4376
|
-
formControl: control
|
|
4377
|
-
}
|
|
4378
|
-
) }),
|
|
4379
|
-
isKSA && /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4380
|
-
DynamicInput,
|
|
4381
|
-
{
|
|
4382
|
-
type: "text",
|
|
4383
|
-
formControl: control,
|
|
4384
|
-
label: t(`accounting.${translationKey}.addressModal.districtName_label`),
|
|
4385
|
-
name: "district_name",
|
|
4386
|
-
fieldArrayName: "addresses",
|
|
4387
|
-
placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
|
|
4388
|
-
}
|
|
4389
|
-
) }),
|
|
4390
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4391
|
-
DynamicInput,
|
|
4392
|
-
{
|
|
4393
|
-
type: "text",
|
|
4394
|
-
formControl: control,
|
|
4395
|
-
label: t(`accounting.${translationKey}.addressModal.summary_label`),
|
|
4396
|
-
name: "summary",
|
|
4397
|
-
fieldArrayName: "addresses",
|
|
4398
|
-
placeholder: t(`accounting.${translationKey}.addressModal.summary_placeholder`),
|
|
4399
|
-
is_multiline: true,
|
|
4400
|
-
disabled: true
|
|
4401
|
-
}
|
|
4402
|
-
) }),
|
|
4403
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4404
|
-
DynamicCheckBox,
|
|
4405
|
-
{
|
|
4406
|
-
formControl: control,
|
|
4407
|
-
name: "default_shipping_address",
|
|
4408
|
-
title: t(`accounting.${translationKey}.addressModal.default_shipping_address_label`),
|
|
4409
|
-
fieldArrayName: "addresses",
|
|
4410
|
-
titlePosition: "end"
|
|
4411
|
-
}
|
|
4412
|
-
) }),
|
|
4413
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 12, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
4414
|
-
DynamicCheckBox,
|
|
4415
|
-
{
|
|
4416
|
-
formControl: control,
|
|
4417
|
-
name: "default_billing_address",
|
|
4418
|
-
title: t(`accounting.${translationKey}.addressModal.default_billing_address_label`),
|
|
4419
|
-
fieldArrayName: "addresses",
|
|
4420
|
-
titlePosition: "end"
|
|
4421
|
-
}
|
|
4422
|
-
) })
|
|
4423
|
-
] }) }),
|
|
4560
|
+
] })
|
|
4561
|
+
] }),
|
|
4424
4562
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4425
4563
|
DialogActions,
|
|
4426
4564
|
{
|
|
@@ -17031,4 +17169,4 @@ export {
|
|
|
17031
17169
|
DyanmicTextEditor as y,
|
|
17032
17170
|
DynamicDateRange as z
|
|
17033
17171
|
};
|
|
17034
|
-
//# sourceMappingURL=uom-field-wrapper-
|
|
17172
|
+
//# sourceMappingURL=uom-field-wrapper-_O6BmPp4.esm.js.map
|