sales-frontend-components 0.0.221 → 0.0.223
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/index.cjs.js +182 -136
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +64 -18
- package/dist/index.esm.js.map +1 -1
- package/package.json +17 -16
package/dist/index.cjs.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var reactHookForm = require('react-hook-form');
|
|
5
5
|
var salesFrontendDesignSystem = require('sales-frontend-design-system');
|
|
6
|
-
var
|
|
6
|
+
var React9 = require('react');
|
|
7
7
|
var method = require('sales-frontend-api/method');
|
|
8
8
|
var salesFrontendAssets = require('sales-frontend-assets');
|
|
9
9
|
var styles = require('./modal/standard/address-search/select-address.module.scss');
|
|
@@ -23,6 +23,7 @@ var styles$b = require('./modal/pre-standard/organization-search-modal/organizat
|
|
|
23
23
|
var styles$c = require('./step-indicator/step-indicator.module.scss');
|
|
24
24
|
var salesFrontendBridge = require('sales-frontend-bridge');
|
|
25
25
|
var styles$d = require('./camera/camera.module.scss');
|
|
26
|
+
require('sales-frontend-stores');
|
|
26
27
|
|
|
27
28
|
const FormCheckboxButton = ({
|
|
28
29
|
name,
|
|
@@ -103,8 +104,8 @@ var customParseFormat = /*@__PURE__*/getDefaultExportFromCjs(customParseFormatEx
|
|
|
103
104
|
var __defProp = Object.defineProperty;
|
|
104
105
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
105
106
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
106
|
-
var getCookie = (name) => {
|
|
107
|
-
if (!isClient()) {
|
|
107
|
+
var getCookie$1 = (name) => {
|
|
108
|
+
if (!isClient$1()) {
|
|
108
109
|
return "";
|
|
109
110
|
}
|
|
110
111
|
if (typeof document === "undefined") {
|
|
@@ -124,8 +125,8 @@ var getSubdomain = (hostname) => {
|
|
|
124
125
|
return parts[0] ?? "";
|
|
125
126
|
};
|
|
126
127
|
var getEnvironmentFromHostname = (hostname) => {
|
|
127
|
-
if (isClient()) {
|
|
128
|
-
const debugModeEnv = getCookie("dsp-debug-mode-env")?.toLowerCase();
|
|
128
|
+
if (isClient$1()) {
|
|
129
|
+
const debugModeEnv = getCookie$1("dsp-debug-mode-env")?.toLowerCase();
|
|
129
130
|
if (debugModeEnv) {
|
|
130
131
|
return debugModeEnv;
|
|
131
132
|
}
|
|
@@ -142,7 +143,7 @@ var getEnvironmentFromHostname = (hostname) => {
|
|
|
142
143
|
}
|
|
143
144
|
return "prd";
|
|
144
145
|
};
|
|
145
|
-
var isClient = () => {
|
|
146
|
+
var isClient$1 = () => {
|
|
146
147
|
try {
|
|
147
148
|
return !!window;
|
|
148
149
|
} catch {
|
|
@@ -150,7 +151,7 @@ var isClient = () => {
|
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
var isAndroidDevice = () => {
|
|
153
|
-
if (isClient() === false) {
|
|
154
|
+
if (isClient$1() === false) {
|
|
154
155
|
return false;
|
|
155
156
|
}
|
|
156
157
|
return /Android/i.test(navigator.userAgent);
|
|
@@ -292,7 +293,7 @@ async function imageUrlToFileFetch(imageUrl) {
|
|
|
292
293
|
}
|
|
293
294
|
async function imageUrlToFile(imageUrl) {
|
|
294
295
|
const fileConvertTypeCookieKey = "dsp-debug-mode-file-convert-type";
|
|
295
|
-
const fileConvertType = getCookie(fileConvertTypeCookieKey);
|
|
296
|
+
const fileConvertType = getCookie$1(fileConvertTypeCookieKey);
|
|
296
297
|
if (fileConvertType === "fetch") {
|
|
297
298
|
return await imageUrlToFileFetch(imageUrl);
|
|
298
299
|
}
|
|
@@ -485,7 +486,16 @@ var GENDER_LABEL_MAP = {
|
|
|
485
486
|
var getGenderName = (genderCode) => {
|
|
486
487
|
return genderCode ? GENDER_LABEL_MAP[genderCode] : "";
|
|
487
488
|
};
|
|
489
|
+
var filterNameCookieKey$1 = "dsp-debug-mode-filter-name";
|
|
490
|
+
function isDebugByFilterName$1(name) {
|
|
491
|
+
const filterNames = getCookie$1(filterNameCookieKey$1)?.split(",");
|
|
492
|
+
return filterNames?.includes(name) || false;
|
|
493
|
+
}
|
|
494
|
+
var isDownloaderFilter = () => isDebugByFilterName$1("downloader");
|
|
488
495
|
var getBlobUrl = async (url) => {
|
|
496
|
+
if (isDownloaderFilter()) {
|
|
497
|
+
alert(`[debug filter:downloader] getBlobUrl \uD638\uCD9C- ${url}`);
|
|
498
|
+
}
|
|
489
499
|
let downloadUrl = "";
|
|
490
500
|
if (url.startsWith("http")) {
|
|
491
501
|
const response = await fetch(url);
|
|
@@ -507,6 +517,9 @@ var downloadFromNewWindow = async (url, fileName) => {
|
|
|
507
517
|
try {
|
|
508
518
|
const aTag = document.createElement("a");
|
|
509
519
|
const downloadUrl = await getBlobUrl(url);
|
|
520
|
+
if (isDownloaderFilter()) {
|
|
521
|
+
alert(`[debug filter:downloader] downloadFromNewWindow \uD638\uCD9C- ${downloadUrl}`);
|
|
522
|
+
}
|
|
510
523
|
aTag.href = downloadUrl;
|
|
511
524
|
aTag.download = fileName;
|
|
512
525
|
const newWin = window.open();
|
|
@@ -523,6 +536,9 @@ var downloadFromCurrentWindow = async (url, fileName) => {
|
|
|
523
536
|
try {
|
|
524
537
|
const a = document.createElement("a");
|
|
525
538
|
const downloadUrl = await getBlobUrl(url);
|
|
539
|
+
if (isDownloaderFilter()) {
|
|
540
|
+
alert(`[debug filter:downloader] downloadFromCurrentWindow \uD638\uCD9C- ${downloadUrl}`);
|
|
541
|
+
}
|
|
526
542
|
a.href = downloadUrl;
|
|
527
543
|
a.download = fileName;
|
|
528
544
|
document.body.appendChild(a);
|
|
@@ -543,8 +559,8 @@ const FormDatePicker = ({
|
|
|
543
559
|
...props
|
|
544
560
|
}) => {
|
|
545
561
|
const { field, fieldState } = reactHookForm.useController({ name, control, disabled, defaultValue });
|
|
546
|
-
const [selected, setSelected] =
|
|
547
|
-
|
|
562
|
+
const [selected, setSelected] = React9.useState();
|
|
563
|
+
React9.useEffect(() => {
|
|
548
564
|
if (isDate(field.value) && field.value !== selected) {
|
|
549
565
|
setSelected(field.value);
|
|
550
566
|
}
|
|
@@ -578,8 +594,8 @@ const FormDateRangePicker = ({
|
|
|
578
594
|
disabled,
|
|
579
595
|
defaultValue
|
|
580
596
|
});
|
|
581
|
-
const [selected, setSelected] =
|
|
582
|
-
|
|
597
|
+
const [selected, setSelected] = React9.useState();
|
|
598
|
+
React9.useEffect(() => {
|
|
583
599
|
const fieldValue = field.value;
|
|
584
600
|
if (!fieldValue) {
|
|
585
601
|
setSelected(void 0);
|
|
@@ -916,15 +932,15 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
916
932
|
}
|
|
917
933
|
|
|
918
934
|
function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
919
|
-
const [searchKeyword, setSearchKeyword] =
|
|
920
|
-
const [step, setStep] =
|
|
921
|
-
const [selectedAddress, setSelectedAddress] =
|
|
922
|
-
const [selectedStandardizationAddress, setSelectedStandardizationAddress] =
|
|
923
|
-
const [searchInput, setSearchInput] =
|
|
924
|
-
const [detailAddressInput, setDetailAddressInput] =
|
|
925
|
-
const [displayList, setDisplayList] =
|
|
926
|
-
const [searchType, setSearchType] =
|
|
927
|
-
const [standardizationParams, setStandardizationParams] =
|
|
935
|
+
const [searchKeyword, setSearchKeyword] = React9.useState("");
|
|
936
|
+
const [step, setStep] = React9.useState("initial");
|
|
937
|
+
const [selectedAddress, setSelectedAddress] = React9.useState();
|
|
938
|
+
const [selectedStandardizationAddress, setSelectedStandardizationAddress] = React9.useState();
|
|
939
|
+
const [searchInput, setSearchInput] = React9.useState("");
|
|
940
|
+
const [detailAddressInput, setDetailAddressInput] = React9.useState("");
|
|
941
|
+
const [displayList, setDisplayList] = React9.useState([]);
|
|
942
|
+
const [searchType, setSearchType] = React9.useState("address");
|
|
943
|
+
const [standardizationParams, setStandardizationParams] = React9.useState({
|
|
928
944
|
firstPostalCode: "",
|
|
929
945
|
secondPostalCode: "",
|
|
930
946
|
thirdPostalCode: "",
|
|
@@ -943,7 +959,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
943
959
|
const { data: standardizedData } = method.useSearchAddressStandardizationQuery(standardizationParams, {
|
|
944
960
|
enabled: !!standardizationParams?.baseAddress
|
|
945
961
|
});
|
|
946
|
-
const [nextButtonDisabled, setNextButtonDisabled] =
|
|
962
|
+
const [nextButtonDisabled, setNextButtonDisabled] = React9.useState(false);
|
|
947
963
|
const onNext = () => {
|
|
948
964
|
if (step === "search-result" && nextButtonDisabled) {
|
|
949
965
|
salesFrontendDesignSystem.ModalUtils.alert(
|
|
@@ -1014,7 +1030,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1014
1030
|
setNextButtonDisabled(false);
|
|
1015
1031
|
}
|
|
1016
1032
|
};
|
|
1017
|
-
const onClear =
|
|
1033
|
+
const onClear = React9.useCallback(() => {
|
|
1018
1034
|
setSearchKeyword("");
|
|
1019
1035
|
setSearchInput("");
|
|
1020
1036
|
setSelectedAddress(void 0);
|
|
@@ -1030,7 +1046,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1030
1046
|
setNextButtonDisabled(true);
|
|
1031
1047
|
}
|
|
1032
1048
|
};
|
|
1033
|
-
|
|
1049
|
+
React9.useEffect(() => {
|
|
1034
1050
|
if (searchType === "address" && addressData?.data?.addressList) {
|
|
1035
1051
|
setDisplayList(addressData.data.addressList);
|
|
1036
1052
|
} else if (searchType === "postalcode" && postalData?.data?.postalCodeList) {
|
|
@@ -1048,7 +1064,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1048
1064
|
setDisplayList(transformedList);
|
|
1049
1065
|
}
|
|
1050
1066
|
}, [addressData, postalData, searchType]);
|
|
1051
|
-
|
|
1067
|
+
React9.useEffect(() => {
|
|
1052
1068
|
if (isOpen) {
|
|
1053
1069
|
setSelectedAddress(void 0);
|
|
1054
1070
|
setDetailAddressInput("");
|
|
@@ -1056,7 +1072,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1056
1072
|
setSearchKeyword("");
|
|
1057
1073
|
}
|
|
1058
1074
|
}, [isOpen]);
|
|
1059
|
-
|
|
1075
|
+
React9.useEffect(() => {
|
|
1060
1076
|
const road = standardizedData?.data?.addressStandardizationList[1];
|
|
1061
1077
|
const land = standardizedData?.data?.addressStandardizationList[2];
|
|
1062
1078
|
if (road && land) {
|
|
@@ -1088,7 +1104,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1088
1104
|
};
|
|
1089
1105
|
}
|
|
1090
1106
|
const useAddressComponent = () => {
|
|
1091
|
-
const [fullAddress, setFullAddress] =
|
|
1107
|
+
const [fullAddress, setFullAddress] = React9.useState();
|
|
1092
1108
|
const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
|
|
1093
1109
|
const AddressSearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(AddressComponent, { isOpen, onClose: closeModal, setValue: setFullAddress });
|
|
1094
1110
|
return {
|
|
@@ -1195,7 +1211,7 @@ const BANK_STOCK_ICON_LIST = [
|
|
|
1195
1211
|
replaceName: "\uD55C\uAD6D\uC528\uD2F0",
|
|
1196
1212
|
icon: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconGraphicsBankHankookCity, {}),
|
|
1197
1213
|
className: "dsp-icons-graphics-bank-hankook-city",
|
|
1198
|
-
iconName: "bank/\uD55C\uAD6D\
|
|
1214
|
+
iconName: "bank/\uD55C\uAD6D\uC528\uD2F0"
|
|
1199
1215
|
},
|
|
1200
1216
|
{
|
|
1201
1217
|
codeVal: "031",
|
|
@@ -1283,7 +1299,7 @@ const BANK_STOCK_ICON_LIST = [
|
|
|
1283
1299
|
replaceName: "\uC5D0\uC774\uBE44\uC5D4\uC554\uB85C",
|
|
1284
1300
|
icon: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconGraphicsBankABNAMRO, {}),
|
|
1285
1301
|
className: "dsp-icons-graphics-bank-abn-amro",
|
|
1286
|
-
iconName: "bank
|
|
1302
|
+
iconName: "bank/ABN-AMRO"
|
|
1287
1303
|
},
|
|
1288
1304
|
{
|
|
1289
1305
|
codeVal: "064",
|
|
@@ -1593,10 +1609,10 @@ const useCustomerSearch = (onSelect, options) => {
|
|
|
1593
1609
|
width: dropDownWidth,
|
|
1594
1610
|
className: dropDownClassName
|
|
1595
1611
|
});
|
|
1596
|
-
const [searchKeyword, setSearchKeyword] =
|
|
1597
|
-
const [searchInput, setSearchInput] =
|
|
1598
|
-
const [customerList, setCustomerList] =
|
|
1599
|
-
const [selectedCustomer, setSelectedCustomer] =
|
|
1612
|
+
const [searchKeyword, setSearchKeyword] = React9.useState("");
|
|
1613
|
+
const [searchInput, setSearchInput] = React9.useState("");
|
|
1614
|
+
const [customerList, setCustomerList] = React9.useState([]);
|
|
1615
|
+
const [selectedCustomer, setSelectedCustomer] = React9.useState(null);
|
|
1600
1616
|
const { data } = method.useSearchCustomerListQuery({ customerName: searchKeyword });
|
|
1601
1617
|
const search = () => {
|
|
1602
1618
|
if (searchInput.length >= 2) {
|
|
@@ -1633,7 +1649,7 @@ const useCustomerSearch = (onSelect, options) => {
|
|
|
1633
1649
|
onSelect(customer);
|
|
1634
1650
|
}
|
|
1635
1651
|
};
|
|
1636
|
-
|
|
1652
|
+
React9.useEffect(() => {
|
|
1637
1653
|
const filtered = data?.data?.custList?.filter(
|
|
1638
1654
|
(c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase())
|
|
1639
1655
|
);
|
|
@@ -1867,8 +1883,8 @@ const NationalitySearchInitialText = ({
|
|
|
1867
1883
|
] });
|
|
1868
1884
|
};
|
|
1869
1885
|
const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect, onConfirm }) => {
|
|
1870
|
-
const [filterList, setFilterList] =
|
|
1871
|
-
|
|
1886
|
+
const [filterList, setFilterList] = React9.useState([]);
|
|
1887
|
+
React9.useEffect(() => {
|
|
1872
1888
|
const filterList2 = nationalityList.filter((item) => item.nationalityCodeName.includes(searchKeyWord)) || [];
|
|
1873
1889
|
setFilterList(filterList2);
|
|
1874
1890
|
}, [nationalityList, searchKeyWord]);
|
|
@@ -1940,9 +1956,9 @@ function NationalityComponent({ isOpen, onClose, setValue, onConfirm }) {
|
|
|
1940
1956
|
}
|
|
1941
1957
|
|
|
1942
1958
|
function useSearchNationality({ setValue, onClose, isOpen }) {
|
|
1943
|
-
const [searchKeyWord, setSearchKeyword] =
|
|
1944
|
-
const [selectedNationality, setSelectedNationality] =
|
|
1945
|
-
const [searchInput, setSearchInput] =
|
|
1959
|
+
const [searchKeyWord, setSearchKeyword] = React9.useState("");
|
|
1960
|
+
const [selectedNationality, setSelectedNationality] = React9.useState();
|
|
1961
|
+
const [searchInput, setSearchInput] = React9.useState("");
|
|
1946
1962
|
const { data } = method.useSearchNationalityQuery({ searchKeyWord });
|
|
1947
1963
|
const searchList = data?.data.nationalityList || [];
|
|
1948
1964
|
const onSearch = (e) => {
|
|
@@ -1965,7 +1981,7 @@ function useSearchNationality({ setValue, onClose, isOpen }) {
|
|
|
1965
1981
|
search();
|
|
1966
1982
|
}
|
|
1967
1983
|
};
|
|
1968
|
-
const onClear =
|
|
1984
|
+
const onClear = React9.useCallback(() => {
|
|
1969
1985
|
setSearchKeyword("");
|
|
1970
1986
|
setSearchInput("");
|
|
1971
1987
|
setSelectedNationality("");
|
|
@@ -1976,7 +1992,7 @@ function useSearchNationality({ setValue, onClose, isOpen }) {
|
|
|
1976
1992
|
value && setValue(value);
|
|
1977
1993
|
onClose();
|
|
1978
1994
|
};
|
|
1979
|
-
|
|
1995
|
+
React9.useEffect(() => {
|
|
1980
1996
|
if (isOpen) {
|
|
1981
1997
|
setSelectedNationality("");
|
|
1982
1998
|
setSearchKeyword("");
|
|
@@ -1997,9 +2013,9 @@ function useSearchNationality({ setValue, onClose, isOpen }) {
|
|
|
1997
2013
|
};
|
|
1998
2014
|
}
|
|
1999
2015
|
const useNationalityComponent = () => {
|
|
2000
|
-
const [nationality, setNationality] =
|
|
2016
|
+
const [nationality, setNationality] = React9.useState();
|
|
2001
2017
|
const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
|
|
2002
|
-
const [isConfirmed, setIsConfirmed] =
|
|
2018
|
+
const [isConfirmed, setIsConfirmed] = React9.useState(false);
|
|
2003
2019
|
const onConfirm = () => {
|
|
2004
2020
|
setIsConfirmed(true);
|
|
2005
2021
|
};
|
|
@@ -2204,8 +2220,8 @@ function useNxlOneModal({
|
|
|
2204
2220
|
nxlOneProps = {}
|
|
2205
2221
|
}) {
|
|
2206
2222
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
2207
|
-
const [isIframeShow, setIsIframeShow] =
|
|
2208
|
-
const [nxlOnePropsState, setNxlOnePropsState] =
|
|
2223
|
+
const [isIframeShow, setIsIframeShow] = React9.useState(true);
|
|
2224
|
+
const [nxlOnePropsState, setNxlOnePropsState] = React9.useState(nxlOneProps);
|
|
2209
2225
|
const { bizCode, tmplCode } = AUTH_TEMPLATE_CODES[step][env];
|
|
2210
2226
|
const { Iframe, open } = salesFrontendSolution.useNxlOne({
|
|
2211
2227
|
...nxlOnePropsState,
|
|
@@ -2223,7 +2239,7 @@ function useNxlOneModal({
|
|
|
2223
2239
|
openModal();
|
|
2224
2240
|
}
|
|
2225
2241
|
};
|
|
2226
|
-
|
|
2242
|
+
React9.useEffect(() => {
|
|
2227
2243
|
if (nxlOnePropsState.nlcCtfnId) {
|
|
2228
2244
|
openNxlOneModal();
|
|
2229
2245
|
}
|
|
@@ -2274,8 +2290,8 @@ const VisaSearchInitialText = ({ visaList, onSelect, onConfirm }) => {
|
|
|
2274
2290
|
}) }) });
|
|
2275
2291
|
};
|
|
2276
2292
|
const VisaSearchResult = ({ visaList, searchKeyword, onSelect, onConfirm }) => {
|
|
2277
|
-
const [filterList, setFilterList] =
|
|
2278
|
-
|
|
2293
|
+
const [filterList, setFilterList] = React9.useState([]);
|
|
2294
|
+
React9.useEffect(() => {
|
|
2279
2295
|
const filterList2 = visaList.filter((item) => item.integrationCodeValueName?.includes(searchKeyword)) || [];
|
|
2280
2296
|
setFilterList(filterList2);
|
|
2281
2297
|
}, [visaList, searchKeyword]);
|
|
@@ -2336,9 +2352,9 @@ function VisaComponent({ isOpen, onClose, setValue, onConfirm }) {
|
|
|
2336
2352
|
}
|
|
2337
2353
|
|
|
2338
2354
|
function useSearchVisa({ setValue, onClose, isOpen }) {
|
|
2339
|
-
const [searchKeyword, setSearchKeyword] =
|
|
2340
|
-
const [selectedVisa, setSelectedVisa] =
|
|
2341
|
-
const [searchInput, setSearchInput] =
|
|
2355
|
+
const [searchKeyword, setSearchKeyword] = React9.useState("");
|
|
2356
|
+
const [selectedVisa, setSelectedVisa] = React9.useState();
|
|
2357
|
+
const [searchInput, setSearchInput] = React9.useState("");
|
|
2342
2358
|
const { data: visaList } = method.useSearchVisaQuery({
|
|
2343
2359
|
staleTime: Infinity,
|
|
2344
2360
|
gcTime: Infinity
|
|
@@ -2363,7 +2379,7 @@ function useSearchVisa({ setValue, onClose, isOpen }) {
|
|
|
2363
2379
|
search();
|
|
2364
2380
|
}
|
|
2365
2381
|
};
|
|
2366
|
-
const onClear =
|
|
2382
|
+
const onClear = React9.useCallback(() => {
|
|
2367
2383
|
setSearchKeyword("");
|
|
2368
2384
|
setSearchInput("");
|
|
2369
2385
|
setSelectedVisa(void 0);
|
|
@@ -2373,7 +2389,7 @@ function useSearchVisa({ setValue, onClose, isOpen }) {
|
|
|
2373
2389
|
setValue(visa);
|
|
2374
2390
|
onClose();
|
|
2375
2391
|
};
|
|
2376
|
-
|
|
2392
|
+
React9.useEffect(() => {
|
|
2377
2393
|
if (isOpen) {
|
|
2378
2394
|
setSelectedVisa(void 0);
|
|
2379
2395
|
setSearchKeyword("");
|
|
@@ -2394,8 +2410,8 @@ function useSearchVisa({ setValue, onClose, isOpen }) {
|
|
|
2394
2410
|
};
|
|
2395
2411
|
}
|
|
2396
2412
|
const useVisaComponent = () => {
|
|
2397
|
-
const [visa, setVisa] =
|
|
2398
|
-
const [isConfirmed, setIsConfirmed] =
|
|
2413
|
+
const [visa, setVisa] = React9.useState();
|
|
2414
|
+
const [isConfirmed, setIsConfirmed] = React9.useState(false);
|
|
2399
2415
|
const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
|
|
2400
2416
|
const onConfirm = () => {
|
|
2401
2417
|
setIsConfirmed(true);
|
|
@@ -2474,8 +2490,8 @@ function DeaCustomerSearch({
|
|
|
2474
2490
|
selectedCustomer,
|
|
2475
2491
|
initSearchParams
|
|
2476
2492
|
}) {
|
|
2477
|
-
const [residentNumberFront, setResidentNumberFront] =
|
|
2478
|
-
const [residentNumberBack, setResidentNumberBack] =
|
|
2493
|
+
const [residentNumberFront, setResidentNumberFront] = React9.useState(initSearchParams?.residentNumberFront || "");
|
|
2494
|
+
const [residentNumberBack, setResidentNumberBack] = React9.useState(initSearchParams?.residentNumberBack || "");
|
|
2479
2495
|
const handleSearch = () => {
|
|
2480
2496
|
getE2EDataIDs(["residentNumberBack"], (e2edata) => {
|
|
2481
2497
|
setSearchParams({
|
|
@@ -2500,11 +2516,11 @@ function DeaCustomerSearch({
|
|
|
2500
2516
|
e.preventDefault();
|
|
2501
2517
|
}
|
|
2502
2518
|
};
|
|
2503
|
-
|
|
2519
|
+
React9.useEffect(() => {
|
|
2504
2520
|
const el = document.getElementById("residentNumberBack");
|
|
2505
2521
|
addE2EObject(el);
|
|
2506
2522
|
});
|
|
2507
|
-
|
|
2523
|
+
React9.useEffect(() => {
|
|
2508
2524
|
if (initSearchParams) {
|
|
2509
2525
|
setSearchParams(initSearchParams);
|
|
2510
2526
|
}
|
|
@@ -2581,30 +2597,30 @@ const DeaCustomerSearchModal = ({
|
|
|
2581
2597
|
clear = true,
|
|
2582
2598
|
initSearchParams
|
|
2583
2599
|
}) => {
|
|
2584
|
-
const [selectedCustomer, setSelectedCustomer] =
|
|
2585
|
-
const [searchParams, setSearchParams] =
|
|
2600
|
+
const [selectedCustomer, setSelectedCustomer] = React9.useState(null);
|
|
2601
|
+
const [searchParams, setSearchParams] = React9.useState(initSearchParams);
|
|
2586
2602
|
const { data, isFetching } = reactQuery.useQuery({
|
|
2587
2603
|
queryKey: ["deaCustomerSearch", searchParams],
|
|
2588
2604
|
queryFn: () => method.getDspCustomerListMethod(searchParams),
|
|
2589
2605
|
enabled: !!searchParams?.e2edata && !!searchParams?.residentNumberFront,
|
|
2590
2606
|
retry: false
|
|
2591
2607
|
});
|
|
2592
|
-
const [customerList, setCustomerList] =
|
|
2608
|
+
const [customerList, setCustomerList] = React9.useState([]);
|
|
2593
2609
|
loadScript();
|
|
2594
|
-
|
|
2610
|
+
React9.useEffect(() => {
|
|
2595
2611
|
if (data?.data) {
|
|
2596
2612
|
setCustomerList(data.data);
|
|
2597
2613
|
} else {
|
|
2598
2614
|
setCustomerList([]);
|
|
2599
2615
|
}
|
|
2600
2616
|
}, [data]);
|
|
2601
|
-
|
|
2617
|
+
React9.useEffect(() => {
|
|
2602
2618
|
setSelectedCustomer(null);
|
|
2603
2619
|
}, [customerList]);
|
|
2604
|
-
|
|
2620
|
+
React9.useEffect(() => {
|
|
2605
2621
|
initASTX2();
|
|
2606
2622
|
}, []);
|
|
2607
|
-
|
|
2623
|
+
React9.useEffect(() => {
|
|
2608
2624
|
if (clear) {
|
|
2609
2625
|
setSearchParams(void 0);
|
|
2610
2626
|
setCustomerList([]);
|
|
@@ -2783,23 +2799,23 @@ const EmployeeSearchModal = ({
|
|
|
2783
2799
|
clear,
|
|
2784
2800
|
initSearchKeyword
|
|
2785
2801
|
}) => {
|
|
2786
|
-
const [activeTab, setActiveTab] =
|
|
2787
|
-
const [selectedEmployee, setSelectedEmployee] =
|
|
2788
|
-
const [searchTerm, setSearchTerm] =
|
|
2789
|
-
const [searchInput, setSearchInput] =
|
|
2802
|
+
const [activeTab, setActiveTab] = React9.useState("WHOL");
|
|
2803
|
+
const [selectedEmployee, setSelectedEmployee] = React9.useState(null);
|
|
2804
|
+
const [searchTerm, setSearchTerm] = React9.useState(initSearchKeyword);
|
|
2805
|
+
const [searchInput, setSearchInput] = React9.useState(initSearchKeyword);
|
|
2790
2806
|
const { data } = method.useSearchEmployeeProfileQuery({
|
|
2791
2807
|
searchWord: searchTerm,
|
|
2792
2808
|
employeeDivisionCode: activeTab
|
|
2793
2809
|
});
|
|
2794
|
-
const [employeeList, setEmployeeList] =
|
|
2795
|
-
|
|
2810
|
+
const [employeeList, setEmployeeList] = React9.useState([]);
|
|
2811
|
+
React9.useEffect(() => {
|
|
2796
2812
|
if (data?.data) {
|
|
2797
2813
|
setEmployeeList(data.data);
|
|
2798
2814
|
} else {
|
|
2799
2815
|
setEmployeeList([]);
|
|
2800
2816
|
}
|
|
2801
2817
|
}, [data]);
|
|
2802
|
-
|
|
2818
|
+
React9.useEffect(() => {
|
|
2803
2819
|
if (!clear) {
|
|
2804
2820
|
return;
|
|
2805
2821
|
}
|
|
@@ -3187,18 +3203,18 @@ const initData = [
|
|
|
3187
3203
|
}
|
|
3188
3204
|
];
|
|
3189
3205
|
const useJobSearch = () => {
|
|
3190
|
-
const [activeTab, setActiveTab] =
|
|
3191
|
-
const [selectedJob, setSelectedJob] =
|
|
3192
|
-
const [searchTerm, setSearchTerm] =
|
|
3193
|
-
const [searchInput, setSearchInput] =
|
|
3206
|
+
const [activeTab, setActiveTab] = React9.useState(JOB_SEARCH_TABS[0]?.value ?? "");
|
|
3207
|
+
const [selectedJob, setSelectedJob] = React9.useState(null);
|
|
3208
|
+
const [searchTerm, setSearchTerm] = React9.useState("");
|
|
3209
|
+
const [searchInput, setSearchInput] = React9.useState("");
|
|
3194
3210
|
const handleJobSelect = (job) => {
|
|
3195
3211
|
setSelectedJob(job);
|
|
3196
3212
|
};
|
|
3197
|
-
const [firstCategory, setFirstCategory] =
|
|
3198
|
-
const [secondCategory, setSecondCategory] =
|
|
3199
|
-
const [jobList, setJobList] =
|
|
3200
|
-
const [firstCategoryList, setFirstCategoryList] =
|
|
3201
|
-
const [secondCategoryList, setSecondCategoryList] =
|
|
3213
|
+
const [firstCategory, setFirstCategory] = React9.useState("");
|
|
3214
|
+
const [secondCategory, setSecondCategory] = React9.useState("");
|
|
3215
|
+
const [jobList, setJobList] = React9.useState(initData);
|
|
3216
|
+
const [firstCategoryList, setFirstCategoryList] = React9.useState([]);
|
|
3217
|
+
const [secondCategoryList, setSecondCategoryList] = React9.useState([]);
|
|
3202
3218
|
const { data: detail } = method.useSearchOccupationDetailQuery({
|
|
3203
3219
|
occupationIndustryCode: selectedJob?.occupationIndustryCode || "",
|
|
3204
3220
|
occupationIndustryTypeCode: "1"
|
|
@@ -3228,10 +3244,10 @@ const useJobSearch = () => {
|
|
|
3228
3244
|
setFirstCategory("");
|
|
3229
3245
|
setSecondCategory("");
|
|
3230
3246
|
};
|
|
3231
|
-
|
|
3247
|
+
React9.useEffect(() => {
|
|
3232
3248
|
reset();
|
|
3233
3249
|
}, [activeTab]);
|
|
3234
|
-
|
|
3250
|
+
React9.useEffect(() => {
|
|
3235
3251
|
setSelectedJob(null);
|
|
3236
3252
|
if (data && searchTerm && activeTab === "jobName") {
|
|
3237
3253
|
const filteredJobs = data.data.occupationList.filter((job) => job.occupationIndustryName.includes(searchTerm));
|
|
@@ -3244,12 +3260,12 @@ const useJobSearch = () => {
|
|
|
3244
3260
|
setJobList(data?.data.occupationList || []);
|
|
3245
3261
|
}
|
|
3246
3262
|
}, [searchTerm, data, firstCategory, secondCategory, secondCategoryData, activeTab]);
|
|
3247
|
-
|
|
3263
|
+
React9.useEffect(() => {
|
|
3248
3264
|
if (firstCategoryData) {
|
|
3249
3265
|
setFirstCategoryList(firstCategoryData.data.occupationList);
|
|
3250
3266
|
}
|
|
3251
3267
|
}, [firstCategoryData]);
|
|
3252
|
-
|
|
3268
|
+
React9.useEffect(() => {
|
|
3253
3269
|
if (secondCategoryData) {
|
|
3254
3270
|
setSecondCategoryList(secondCategoryData.data.occupationList);
|
|
3255
3271
|
}
|
|
@@ -3299,7 +3315,7 @@ function useJobSearchModal() {
|
|
|
3299
3315
|
isLoading
|
|
3300
3316
|
} = useJobSearch();
|
|
3301
3317
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
3302
|
-
const [isConfirmed, setIsConfirmed] =
|
|
3318
|
+
const [isConfirmed, setIsConfirmed] = React9.useState(false);
|
|
3303
3319
|
const onTabChange = (value) => {
|
|
3304
3320
|
reset();
|
|
3305
3321
|
setActiveTab(value);
|
|
@@ -3463,7 +3479,7 @@ function VehicleSearch({ vehicles, onVehicleSelect, selectedVehicle }) {
|
|
|
3463
3479
|
}
|
|
3464
3480
|
|
|
3465
3481
|
const useVehicleSearch = () => {
|
|
3466
|
-
const [selectedVehicle, setSelectedVehicle] =
|
|
3482
|
+
const [selectedVehicle, setSelectedVehicle] = React9.useState();
|
|
3467
3483
|
const { data } = method.useSearchVehicleQuery();
|
|
3468
3484
|
return {
|
|
3469
3485
|
VehicleSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3481,9 +3497,9 @@ const useVehicleSearch = () => {
|
|
|
3481
3497
|
};
|
|
3482
3498
|
|
|
3483
3499
|
const useJobVehicleSearch = () => {
|
|
3484
|
-
const [rightPanelView, setRightPanelView] =
|
|
3485
|
-
const [riskGrade, setRiskGrade] =
|
|
3486
|
-
const [hospitalizationGrade, setHospitalizationGrade] =
|
|
3500
|
+
const [rightPanelView, setRightPanelView] = React9.useState("jobSearch");
|
|
3501
|
+
const [riskGrade, setRiskGrade] = React9.useState("");
|
|
3502
|
+
const [hospitalizationGrade, setHospitalizationGrade] = React9.useState("");
|
|
3487
3503
|
const { selectedJob, JobSearchComponent, selectedJobDetail, resetJobSearch, setSelectedJob } = useJobSearchModal();
|
|
3488
3504
|
const { selectedVehicle, VehicleSearchComponent, setSelectedVehicle } = useVehicleSearch();
|
|
3489
3505
|
const { data: riskGradeData } = method.useSearchRiskGradeQuery(
|
|
@@ -3502,7 +3518,7 @@ const useJobVehicleSearch = () => {
|
|
|
3502
3518
|
setRiskGrade("");
|
|
3503
3519
|
setHospitalizationGrade("");
|
|
3504
3520
|
};
|
|
3505
|
-
|
|
3521
|
+
React9.useEffect(() => {
|
|
3506
3522
|
if (selectedJob && selectedVehicle && riskGradeData) {
|
|
3507
3523
|
const { riskGradeCode, riskGradeName } = riskGradeData.data;
|
|
3508
3524
|
setRiskGrade(`${riskGradeName}(${riskGradeCode})`);
|
|
@@ -3542,7 +3558,7 @@ function useJobVehicleSearchModal() {
|
|
|
3542
3558
|
selectedJobDetail
|
|
3543
3559
|
} = useJobVehicleSearch();
|
|
3544
3560
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
3545
|
-
const [isConfirmed, setIsConfirmed] =
|
|
3561
|
+
const [isConfirmed, setIsConfirmed] = React9.useState(false);
|
|
3546
3562
|
const validate = () => {
|
|
3547
3563
|
if (!selectedJob && !selectedVehicle) {
|
|
3548
3564
|
return salesFrontendDesignSystem.ModalUtils.alert(
|
|
@@ -3765,10 +3781,10 @@ const OrganizationSearchModal = ({
|
|
|
3765
3781
|
clear,
|
|
3766
3782
|
initSearchKeyword
|
|
3767
3783
|
}) => {
|
|
3768
|
-
const [selectedOrganization, setSelectedOrganization] =
|
|
3769
|
-
const [organizationList, setOrganizationList] =
|
|
3770
|
-
const [searchTerm, setSearchTerm] =
|
|
3771
|
-
const [searchInput, setSearchInput] =
|
|
3784
|
+
const [selectedOrganization, setSelectedOrganization] = React9.useState(null);
|
|
3785
|
+
const [organizationList, setOrganizationList] = React9.useState([]);
|
|
3786
|
+
const [searchTerm, setSearchTerm] = React9.useState(initSearchKeyword);
|
|
3787
|
+
const [searchInput, setSearchInput] = React9.useState(initSearchKeyword);
|
|
3772
3788
|
const { data } = method.useSearchOrganizationQuery(
|
|
3773
3789
|
{
|
|
3774
3790
|
searchWord: searchTerm
|
|
@@ -3777,14 +3793,14 @@ const OrganizationSearchModal = ({
|
|
|
3777
3793
|
enabled: !!initSearchKeyword
|
|
3778
3794
|
}
|
|
3779
3795
|
);
|
|
3780
|
-
|
|
3796
|
+
React9.useEffect(() => {
|
|
3781
3797
|
if (data?.data) {
|
|
3782
3798
|
setOrganizationList(data.data);
|
|
3783
3799
|
} else {
|
|
3784
3800
|
setOrganizationList([]);
|
|
3785
3801
|
}
|
|
3786
3802
|
}, [data]);
|
|
3787
|
-
|
|
3803
|
+
React9.useEffect(() => {
|
|
3788
3804
|
if (!clear) {
|
|
3789
3805
|
return;
|
|
3790
3806
|
}
|
|
@@ -3861,10 +3877,10 @@ const FormSearchJobField = ({
|
|
|
3861
3877
|
defaultValue,
|
|
3862
3878
|
...props
|
|
3863
3879
|
}) => {
|
|
3864
|
-
const [selected, setSelected] =
|
|
3880
|
+
const [selected, setSelected] = React9.useState(defaultValue);
|
|
3865
3881
|
const { field, fieldState } = reactHookForm.useController({ name, control, disabled });
|
|
3866
3882
|
const { JobSearchModal, openJobSearchModal, selectedJob } = useJobSearchModal();
|
|
3867
|
-
|
|
3883
|
+
React9.useEffect(() => {
|
|
3868
3884
|
if (selectedJob) {
|
|
3869
3885
|
field.onChange(selectedJob.occupationIndustryName);
|
|
3870
3886
|
setSelected({ label: selectedJob.occupationIndustryName, value: selectedJob.occupationIndustryCode });
|
|
@@ -4017,11 +4033,11 @@ const StepIndicator = ({
|
|
|
4017
4033
|
dotCount = 3,
|
|
4018
4034
|
isLoading
|
|
4019
4035
|
}) => {
|
|
4020
|
-
const [steps, setSteps] =
|
|
4036
|
+
const [steps, setSteps] = React9.useState(
|
|
4021
4037
|
Array.from({ length: 10 }).map(() => ({ label: "-", value: "" }))
|
|
4022
4038
|
);
|
|
4023
|
-
const [current, setCurrent] =
|
|
4024
|
-
|
|
4039
|
+
const [current, setCurrent] = React9.useState(currentIndex);
|
|
4040
|
+
React9.useEffect(() => {
|
|
4025
4041
|
if (items.length > 0) {
|
|
4026
4042
|
setSteps(items);
|
|
4027
4043
|
items.map((item, idx) => {
|
|
@@ -4044,7 +4060,7 @@ const StepIndicator = ({
|
|
|
4044
4060
|
}
|
|
4045
4061
|
};
|
|
4046
4062
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$1("stepper-layout", { loading: isLoading }), children: [
|
|
4047
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$1("stepper"), children: steps.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4063
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$1("stepper"), children: steps.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React9.Fragment, { children: [
|
|
4048
4064
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4049
4065
|
"div",
|
|
4050
4066
|
{
|
|
@@ -4250,7 +4266,7 @@ function useCamera({
|
|
|
4250
4266
|
responseFileType
|
|
4251
4267
|
} = {}) {
|
|
4252
4268
|
const convertedInitData = initData?.map((data, index) => ({ ...data, id: String(index + 1) }));
|
|
4253
|
-
const [attachedPhotos, setAttachedPhotos] =
|
|
4269
|
+
const [attachedPhotos, setAttachedPhotos] = React9.useState(convertedInitData || []);
|
|
4254
4270
|
const findImage = (imageId) => {
|
|
4255
4271
|
return attachedPhotos.find((image) => image.id === imageId);
|
|
4256
4272
|
};
|
|
@@ -4332,7 +4348,7 @@ function useCamera({
|
|
|
4332
4348
|
buttonText
|
|
4333
4349
|
}
|
|
4334
4350
|
);
|
|
4335
|
-
|
|
4351
|
+
React9.useEffect(() => {
|
|
4336
4352
|
return () => {
|
|
4337
4353
|
attachedPhotos.forEach((image) => {
|
|
4338
4354
|
URL.revokeObjectURL(image.src);
|
|
@@ -4378,12 +4394,12 @@ const DEFAULT_DOWNLOAD_PROPS = {
|
|
|
4378
4394
|
};
|
|
4379
4395
|
function useCanvasPaint(paintProps = {}) {
|
|
4380
4396
|
const { pen = { strokeWeight: 5, strokeColor: "black" }, onChange, onStart, onEnd } = paintProps;
|
|
4381
|
-
const [canvasRefState, setCanvasRefState] =
|
|
4382
|
-
const contextRef =
|
|
4383
|
-
const [isPainting, setIsPainting] =
|
|
4384
|
-
const [history, setHistory] =
|
|
4385
|
-
const [historyIndex, setHistoryIndex] =
|
|
4386
|
-
const saveState =
|
|
4397
|
+
const [canvasRefState, setCanvasRefState] = React9.useState(null);
|
|
4398
|
+
const contextRef = React9.useRef(null);
|
|
4399
|
+
const [isPainting, setIsPainting] = React9.useState(false);
|
|
4400
|
+
const [history, setHistory] = React9.useState([]);
|
|
4401
|
+
const [historyIndex, setHistoryIndex] = React9.useState(-1);
|
|
4402
|
+
const saveState = React9.useCallback(() => {
|
|
4387
4403
|
if (!canvasRefState) {
|
|
4388
4404
|
return;
|
|
4389
4405
|
}
|
|
@@ -4397,7 +4413,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4397
4413
|
setHistoryIndex(newHistory.length - 1);
|
|
4398
4414
|
onChange && onChange();
|
|
4399
4415
|
}, [history, historyIndex, onChange, canvasRefState]);
|
|
4400
|
-
const restoreState =
|
|
4416
|
+
const restoreState = React9.useCallback(
|
|
4401
4417
|
(index) => {
|
|
4402
4418
|
const context = contextRef.current;
|
|
4403
4419
|
if (!canvasRefState || !context || !history[index]) {
|
|
@@ -4414,7 +4430,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4414
4430
|
},
|
|
4415
4431
|
[history, onChange, canvasRefState]
|
|
4416
4432
|
);
|
|
4417
|
-
|
|
4433
|
+
React9.useEffect(() => {
|
|
4418
4434
|
if (!canvasRefState) {
|
|
4419
4435
|
return;
|
|
4420
4436
|
}
|
|
@@ -4427,14 +4443,14 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4427
4443
|
setHistory([initialDataUrl]);
|
|
4428
4444
|
setHistoryIndex(0);
|
|
4429
4445
|
}, [canvasRefState]);
|
|
4430
|
-
|
|
4446
|
+
React9.useEffect(() => {
|
|
4431
4447
|
const context = contextRef.current;
|
|
4432
4448
|
if (context) {
|
|
4433
4449
|
context.lineWidth = pen.strokeWeight;
|
|
4434
4450
|
context.strokeStyle = pen.strokeColor;
|
|
4435
4451
|
}
|
|
4436
4452
|
}, [pen]);
|
|
4437
|
-
const getEventPosition =
|
|
4453
|
+
const getEventPosition = React9.useCallback(
|
|
4438
4454
|
(event) => {
|
|
4439
4455
|
if (!canvasRefState) {
|
|
4440
4456
|
return null;
|
|
@@ -4463,7 +4479,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4463
4479
|
},
|
|
4464
4480
|
[canvasRefState]
|
|
4465
4481
|
);
|
|
4466
|
-
const startPainting =
|
|
4482
|
+
const startPainting = React9.useCallback(
|
|
4467
4483
|
(event) => {
|
|
4468
4484
|
event.preventDefault();
|
|
4469
4485
|
const context = contextRef.current;
|
|
@@ -4482,7 +4498,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4482
4498
|
},
|
|
4483
4499
|
[onStart, getEventPosition]
|
|
4484
4500
|
);
|
|
4485
|
-
const stopPainting =
|
|
4501
|
+
const stopPainting = React9.useCallback(() => {
|
|
4486
4502
|
const context = contextRef.current;
|
|
4487
4503
|
if (!context || !isPainting) {
|
|
4488
4504
|
return;
|
|
@@ -4492,7 +4508,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4492
4508
|
onEnd && onEnd();
|
|
4493
4509
|
saveState();
|
|
4494
4510
|
}, [isPainting, onEnd, saveState]);
|
|
4495
|
-
const paint =
|
|
4511
|
+
const paint = React9.useCallback(
|
|
4496
4512
|
(event) => {
|
|
4497
4513
|
event.preventDefault();
|
|
4498
4514
|
if (!isPainting || !contextRef.current) {
|
|
@@ -4508,7 +4524,7 @@ function useCanvasPaint(paintProps = {}) {
|
|
|
4508
4524
|
},
|
|
4509
4525
|
[isPainting, getEventPosition]
|
|
4510
4526
|
);
|
|
4511
|
-
|
|
4527
|
+
React9.useEffect(() => {
|
|
4512
4528
|
if (!canvasRefState) {
|
|
4513
4529
|
return;
|
|
4514
4530
|
}
|
|
@@ -4737,10 +4753,10 @@ const useRemoteIdentityVerification = ({
|
|
|
4737
4753
|
const useRemoteIdentityVerificationIframe = (config) => {
|
|
4738
4754
|
const { createMessageHandler, createRemoteIdentityVerificationUrl } = useRemoteIdentityVerification(config);
|
|
4739
4755
|
const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
|
|
4740
|
-
const [remoteIdentityVerificationUrl, setRemoteIdentityVerificationUrl] =
|
|
4741
|
-
const [rivsRequestId, setRivsRequestId] =
|
|
4742
|
-
const [isCreatingUrl, setIsCreatingUrl] =
|
|
4743
|
-
const [isIframeLoaded, setIsIframeLoaded] =
|
|
4756
|
+
const [remoteIdentityVerificationUrl, setRemoteIdentityVerificationUrl] = React9.useState("");
|
|
4757
|
+
const [rivsRequestId, setRivsRequestId] = React9.useState("");
|
|
4758
|
+
const [isCreatingUrl, setIsCreatingUrl] = React9.useState(false);
|
|
4759
|
+
const [isIframeLoaded, setIsIframeLoaded] = React9.useState(false);
|
|
4744
4760
|
const createIframeUrl = async () => {
|
|
4745
4761
|
if (remoteIdentityVerificationUrl || isCreatingUrl) {
|
|
4746
4762
|
return;
|
|
@@ -4780,7 +4796,7 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
4780
4796
|
setIsIframeLoaded(false);
|
|
4781
4797
|
closeModal();
|
|
4782
4798
|
};
|
|
4783
|
-
|
|
4799
|
+
React9.useEffect(() => {
|
|
4784
4800
|
if (!remoteIdentityVerificationUrl) {
|
|
4785
4801
|
return;
|
|
4786
4802
|
}
|
|
@@ -4844,9 +4860,9 @@ const useRemoteIdentityVerificationIframe = (config) => {
|
|
|
4844
4860
|
};
|
|
4845
4861
|
const useRemoteIdentityVerificationPopup = (config) => {
|
|
4846
4862
|
const { createRemoteIdentityVerificationUrl, createMessageHandler } = useRemoteIdentityVerification(config);
|
|
4847
|
-
const [isCreatingUrl, setIsCreatingUrl] =
|
|
4848
|
-
const [rivsRequestId, setRivsRequestId] =
|
|
4849
|
-
const popupRef =
|
|
4863
|
+
const [isCreatingUrl, setIsCreatingUrl] = React9.useState(false);
|
|
4864
|
+
const [rivsRequestId, setRivsRequestId] = React9.useState("");
|
|
4865
|
+
const popupRef = React9.useRef(null);
|
|
4850
4866
|
const openPopup = async (target = "_blank", features) => {
|
|
4851
4867
|
if (popupRef.current && !popupRef.current.closed) {
|
|
4852
4868
|
popupRef.current.close();
|
|
@@ -4871,7 +4887,7 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
4871
4887
|
const cleanPopup = () => {
|
|
4872
4888
|
popupRef.current = null;
|
|
4873
4889
|
};
|
|
4874
|
-
|
|
4890
|
+
React9.useEffect(() => {
|
|
4875
4891
|
const messageHandler = createMessageHandler({ rivsRequestId }, cleanPopup);
|
|
4876
4892
|
MessageEventManager.getInstance().registerHandler("riv-popup-handler", messageHandler);
|
|
4877
4893
|
return () => MessageEventManager.getInstance().unregisterHandler("riv-popup-handler");
|
|
@@ -4883,7 +4899,7 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
4883
4899
|
};
|
|
4884
4900
|
|
|
4885
4901
|
function DudUpload() {
|
|
4886
|
-
const [test, setTest] =
|
|
4902
|
+
const [test, setTest] = React9.useState();
|
|
4887
4903
|
const { mutateAsync, data } = method.useDudExternalFileUploadMutation();
|
|
4888
4904
|
const up = async () => {
|
|
4889
4905
|
const b = await fileToBase64(test.target.files[0]);
|
|
@@ -4904,8 +4920,8 @@ function DudUpload() {
|
|
|
4904
4920
|
}
|
|
4905
4921
|
|
|
4906
4922
|
function DudDownload() {
|
|
4907
|
-
const [fileId, setFileId] =
|
|
4908
|
-
const [enabled, setEnable] =
|
|
4923
|
+
const [fileId, setFileId] = React9.useState("");
|
|
4924
|
+
const [enabled, setEnable] = React9.useState(false);
|
|
4909
4925
|
const { data, isError, isSuccess } = method.useDudExternalFileDownloadQuery(
|
|
4910
4926
|
{
|
|
4911
4927
|
fileMgmtId: fileId,
|
|
@@ -4915,7 +4931,7 @@ function DudDownload() {
|
|
|
4915
4931
|
enabled
|
|
4916
4932
|
}
|
|
4917
4933
|
);
|
|
4918
|
-
|
|
4934
|
+
React9.useEffect(() => {
|
|
4919
4935
|
console.log("data", data, data instanceof Blob, data instanceof File);
|
|
4920
4936
|
if (data instanceof Blob) {
|
|
4921
4937
|
downloadBlob(data, "test");
|
|
@@ -4931,9 +4947,33 @@ function DudDownload() {
|
|
|
4931
4947
|
] });
|
|
4932
4948
|
}
|
|
4933
4949
|
|
|
4950
|
+
var isClient = () => {
|
|
4951
|
+
try {
|
|
4952
|
+
return !!window;
|
|
4953
|
+
} catch {
|
|
4954
|
+
return false;
|
|
4955
|
+
}
|
|
4956
|
+
};
|
|
4957
|
+
var getCookie = (name) => {
|
|
4958
|
+
if (!isClient()) {
|
|
4959
|
+
return "";
|
|
4960
|
+
}
|
|
4961
|
+
if (typeof document === "undefined") {
|
|
4962
|
+
return "";
|
|
4963
|
+
}
|
|
4964
|
+
const match = document.cookie.match(new RegExp(`(^|; *)${name}=([^;]*)`));
|
|
4965
|
+
return match ? decodeURIComponent(match[2] || "") : "";
|
|
4966
|
+
};
|
|
4967
|
+
|
|
4968
|
+
var filterNameCookieKey = "dsp-debug-mode-filter-name";
|
|
4969
|
+
function isDebugByFilterName(name) {
|
|
4970
|
+
const filterNames = getCookie(filterNameCookieKey)?.split(",");
|
|
4971
|
+
return filterNames?.includes(name) || false;
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4934
4974
|
const useDownloader = () => {
|
|
4935
|
-
const [isError, setIsError] =
|
|
4936
|
-
const [isLoading, setIsLoading] =
|
|
4975
|
+
const [isError, setIsError] = React9.useState(false);
|
|
4976
|
+
const [isLoading, setIsLoading] = React9.useState(false);
|
|
4937
4977
|
const onClick = async (downloaderProps) => {
|
|
4938
4978
|
const { downloadTargetInfo, onAllSuccess, onAnyError, startIndex = 0 } = downloaderProps;
|
|
4939
4979
|
setIsLoading(true);
|
|
@@ -4967,8 +5007,14 @@ const useDownloader = () => {
|
|
|
4967
5007
|
throw new Error("Download URL is empty");
|
|
4968
5008
|
}
|
|
4969
5009
|
if (info.isOpenNewWindow) {
|
|
5010
|
+
if (isDebugByFilterName("downloader")) {
|
|
5011
|
+
alert("[debug filter:downloader] \uC0C8\uCC3D\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC \uC2DC\uB3C4\uD569\uB2C8\uB2E4");
|
|
5012
|
+
}
|
|
4970
5013
|
await downloadFromNewWindow(url, info.fileName);
|
|
4971
5014
|
} else {
|
|
5015
|
+
if (isDebugByFilterName("downloader")) {
|
|
5016
|
+
alert("[debug filter:downloader] \uD604\uC7AC\uCC3D\uC5D0\uC11C \uB2E4\uC6B4\uB85C\uB4DC \uC2DC\uB3C4\uD569\uB2C8\uB2E4");
|
|
5017
|
+
}
|
|
4972
5018
|
await downloadFromCurrentWindow(url, info.fileName);
|
|
4973
5019
|
}
|
|
4974
5020
|
info.onSuccess?.();
|