sales-frontend-components 0.0.154 → 0.0.156
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 +16 -134
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +14 -15
- package/dist/index.esm.js +14 -134
- package/dist/index.esm.js.map +1 -1
- package/package.json +11 -9
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import * as React$1 from 'react';
|
|
|
5
5
|
import React__default from 'react';
|
|
6
6
|
import * as sales_frontend_api_method from 'sales-frontend-api/method';
|
|
7
7
|
import { AddressStandardizationResponseDto, AddressResponseDto, CodeDto, CustomerSearchProps, CustomerDto, NationalityResponseDto, VisaStatusResponseDto, PersonalCustomerProfileResponseDto, EmployeeProfileResponseDto, OccupationResponseDto, OccupationDetailResponseDto, OrganizationProfileResponse, RemoteIdentityVerificationSystemTokenRequestDto, ApiConfig } from 'sales-frontend-api/method';
|
|
8
|
+
import { NxlOneResponse, NxlOneProps } from 'sales-frontend-solution';
|
|
8
9
|
|
|
9
10
|
declare const FormCheckboxButton: <TFormValues extends FieldValues>({ name, control, disabled, children, ...props }: Pick<UseControllerProps<TFormValues>, "name" | "control" | "disabled"> & Omit<CheckboxButtonProps, "id">) => react_jsx_runtime.JSX.Element;
|
|
10
11
|
|
|
@@ -278,6 +279,17 @@ declare function useBankStockSearch({ onSelect }: {
|
|
|
278
279
|
handleSelect: (item: CodeDto) => void;
|
|
279
280
|
};
|
|
280
281
|
|
|
282
|
+
declare const BANK_STOCK_SEARCH_MODAL_TABS: {
|
|
283
|
+
value: string;
|
|
284
|
+
label: string;
|
|
285
|
+
}[];
|
|
286
|
+
declare const BANK_STOCK_ICON_LIST: {
|
|
287
|
+
codeVal: string;
|
|
288
|
+
codeName: string;
|
|
289
|
+
replaceName: string;
|
|
290
|
+
icon: react_jsx_runtime.JSX.Element;
|
|
291
|
+
}[];
|
|
292
|
+
|
|
281
293
|
declare const CustomerSearch: ({ onSelectCustomer, placeholder, rootProps, ...props }: CustomerSearchProps) => react_jsx_runtime.JSX.Element;
|
|
282
294
|
|
|
283
295
|
interface Props$3 {
|
|
@@ -314,19 +326,6 @@ declare const useNationalityComponent: () => {
|
|
|
314
326
|
NationalitySearchComponent: () => react_jsx_runtime.JSX.Element;
|
|
315
327
|
};
|
|
316
328
|
|
|
317
|
-
type NxlOneProps = {
|
|
318
|
-
bizCode: string;
|
|
319
|
-
tmplCode: string;
|
|
320
|
-
ncsrInfoUuid?: string;
|
|
321
|
-
nlcCtfnId?: string;
|
|
322
|
-
t?: string;
|
|
323
|
-
};
|
|
324
|
-
type NxlOneResponse = {
|
|
325
|
-
action?: 'error' | 'close' | 'complete';
|
|
326
|
-
redirectUrl?: string;
|
|
327
|
-
nlcCtfnId?: string;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
329
|
type Step = 'appInit' | 'tabletEformInit' | 'tabletEformRe' | 'tabletEformSubInfo' | 'smartphoneEformSubInfo' | 'smartphoneEformAlimtalkInit' | 'smartphoneEformAlimtalkRe' | 'tabletNewCustomer' | 'tabletNewCustomerLegalRep' | 'tabletCustomerInfoPlanAgreement' | 'tabletCustomerInfoProductAgreement';
|
|
331
330
|
interface CodeSet {
|
|
332
331
|
dev: {
|
|
@@ -619,5 +618,5 @@ declare const useDownloader: () => {
|
|
|
619
618
|
isError: boolean;
|
|
620
619
|
};
|
|
621
620
|
|
|
622
|
-
export { Attachment, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
|
|
623
|
-
export type { AttachedPhoto, AttachmentProps, BankStockSearchModalProps, CodeSet, DownloadProps, DownloadTargetInfo, DownloaderProps, FormSegmentGroupProps,
|
|
621
|
+
export { Attachment, BANK_STOCK_ICON_LIST, BANK_STOCK_SEARCH_MODAL_TABS, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
|
|
622
|
+
export type { AttachedPhoto, AttachmentProps, BankStockSearchModalProps, CodeSet, DownloadProps, DownloadTargetInfo, DownloaderProps, FormSegmentGroupProps, PaintProps, Pen, RemoteIdentityVerificationSuccess, RivUrlParams, Step, StepIndicatorProps, StepItem, UseRemoteIdentityVerificationProps, VerificationResponse, cameraItemType, cameraOptions };
|
package/dist/index.esm.js
CHANGED
|
@@ -8,6 +8,7 @@ import styles from './modal/standard/address-search/select-address.module.scss';
|
|
|
8
8
|
import styles$1 from './modal/standard/bank-stock-search/bank-stock-search-modal.module.scss';
|
|
9
9
|
import styles$2 from './modal/standard/customer-search/customer-search.module.scss';
|
|
10
10
|
import styles$3 from './modal/standard/nationality-search/select-nationality.module.scss';
|
|
11
|
+
import { useNxlOne } from 'sales-frontend-solution';
|
|
11
12
|
import styles$4 from './modal/standard/visa-search/select-visa.module.scss';
|
|
12
13
|
import { useQuery } from '@tanstack/react-query';
|
|
13
14
|
import styles$5 from './modal/pre-standard/dea-customer-search-modal/dea-customer-search-modal.module.scss';
|
|
@@ -630,7 +631,17 @@ const useAddressComponent = () => {
|
|
|
630
631
|
};
|
|
631
632
|
};
|
|
632
633
|
|
|
633
|
-
const
|
|
634
|
+
const BANK_STOCK_SEARCH_MODAL_TABS = [
|
|
635
|
+
{
|
|
636
|
+
value: "bank",
|
|
637
|
+
label: "\uC740\uD589"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
value: "stock",
|
|
641
|
+
label: "\uC99D\uAD8C\uC0AC"
|
|
642
|
+
}
|
|
643
|
+
];
|
|
644
|
+
const BANK_STOCK_ICON_LIST = [
|
|
634
645
|
{
|
|
635
646
|
codeVal: "002",
|
|
636
647
|
codeName: "\uC0B0\uC5C5\uC740\uD589",
|
|
@@ -971,7 +982,7 @@ function BankStockSearchModal({ open, onClose, onSelect }) {
|
|
|
971
982
|
const chunkedList = chunk(list, 5);
|
|
972
983
|
return /* @__PURE__ */ jsx("div", { className: styles$1["list-container"], children: chunkedList.map((chunk2, chunkIndex) => /* @__PURE__ */ jsxs("div", { className: styles$1.row, children: [
|
|
973
984
|
chunk2.map((item) => {
|
|
974
|
-
const findItem =
|
|
985
|
+
const findItem = BANK_STOCK_ICON_LIST.find((icon) => icon.codeVal === item.codeVal);
|
|
975
986
|
const convertedItem = findItem ? findItem : {
|
|
976
987
|
icon: /* @__PURE__ */ jsx(IconGraphicsStockHochulEopsum, {}),
|
|
977
988
|
replaceName: item.codeName
|
|
@@ -1432,32 +1443,6 @@ var getEnvironmentFromHostname = (hostname) => {
|
|
|
1432
1443
|
}
|
|
1433
1444
|
return "prd";
|
|
1434
1445
|
};
|
|
1435
|
-
var isClient = () => {
|
|
1436
|
-
try {
|
|
1437
|
-
return !!window;
|
|
1438
|
-
} catch {
|
|
1439
|
-
return false;
|
|
1440
|
-
}
|
|
1441
|
-
};
|
|
1442
|
-
var getNlcHostFromEnvironment = (hostname) => {
|
|
1443
|
-
if (!isClient()) {
|
|
1444
|
-
return "";
|
|
1445
|
-
}
|
|
1446
|
-
const environment = getEnvironmentFromHostname(location.hostname);
|
|
1447
|
-
switch (environment) {
|
|
1448
|
-
case "local":
|
|
1449
|
-
return `https://nxl-nlc-stg.hanwhalife.com`;
|
|
1450
|
-
case "dev":
|
|
1451
|
-
return `https://nxl-nlc-dev.hanwhalife.com`;
|
|
1452
|
-
case "stg":
|
|
1453
|
-
return `https://nxl-nlc-stg.hanwhalife.com`;
|
|
1454
|
-
case "prd":
|
|
1455
|
-
return `https://nxl-nlc.hanwhalife.com`;
|
|
1456
|
-
default:
|
|
1457
|
-
console.warn("NLC environment is not defined");
|
|
1458
|
-
return "";
|
|
1459
|
-
}
|
|
1460
|
-
};
|
|
1461
1446
|
var _MessageEventManager = class _MessageEventManager2 {
|
|
1462
1447
|
constructor() {
|
|
1463
1448
|
__publicField(this, "handlers", /* @__PURE__ */ new Map());
|
|
@@ -1666,111 +1651,6 @@ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
|
|
|
1666
1651
|
}
|
|
1667
1652
|
}
|
|
1668
1653
|
|
|
1669
|
-
function useNxlOne({ bizCode, tmplCode, ncsrInfoUuid, nlcCtfnId, t = "dp" }) {
|
|
1670
|
-
const buildUrl = useCallback(() => {
|
|
1671
|
-
const baseUrl = getNlcHostFromEnvironment();
|
|
1672
|
-
const targetUrl = new URL("/auth/v1", baseUrl);
|
|
1673
|
-
targetUrl.searchParams.set("bizCode", bizCode);
|
|
1674
|
-
targetUrl.searchParams.set("tmplCode", tmplCode);
|
|
1675
|
-
if (nlcCtfnId) {
|
|
1676
|
-
targetUrl.searchParams.set("nlcCtfnId", nlcCtfnId);
|
|
1677
|
-
}
|
|
1678
|
-
if (t) {
|
|
1679
|
-
targetUrl.searchParams.set("t", t);
|
|
1680
|
-
}
|
|
1681
|
-
if (ncsrInfoUuid) {
|
|
1682
|
-
targetUrl.searchParams.set("ncsrInfoUuid", ncsrInfoUuid);
|
|
1683
|
-
}
|
|
1684
|
-
return targetUrl.toString();
|
|
1685
|
-
}, [bizCode, tmplCode, ncsrInfoUuid, nlcCtfnId, t]);
|
|
1686
|
-
const redirect = () => {
|
|
1687
|
-
const targetUrl = buildUrl();
|
|
1688
|
-
location.href = targetUrl;
|
|
1689
|
-
};
|
|
1690
|
-
const open = async (options) => {
|
|
1691
|
-
return new Promise((resolve, reject) => {
|
|
1692
|
-
const targetUrl = buildUrl();
|
|
1693
|
-
console.log("targetUrl", targetUrl);
|
|
1694
|
-
const width = options && options.popupWidth || 720;
|
|
1695
|
-
const height = options && options.popupHeight || 720;
|
|
1696
|
-
const left = options && options.popupLeft || (window.screen.width - width) / 2;
|
|
1697
|
-
const top = options && options.popupTop || (window.screen.height - height) / 2;
|
|
1698
|
-
const popupFeatures = `width=${width},height=${height},left=${left},top=${top}`;
|
|
1699
|
-
const popup = window.open(targetUrl, options && options.windowName || "_self_cert", popupFeatures);
|
|
1700
|
-
if (!popup) {
|
|
1701
|
-
reject(new Error("\uCC28\uB2E8\uB418\uAC70\uB098 \uC5F4\uB9AC\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4."));
|
|
1702
|
-
return;
|
|
1703
|
-
}
|
|
1704
|
-
const handleMessage = (event) => {
|
|
1705
|
-
console.log("popup message event", event.origin, new URL(targetUrl).origin);
|
|
1706
|
-
if (event.origin !== new URL(targetUrl).origin) {
|
|
1707
|
-
return;
|
|
1708
|
-
}
|
|
1709
|
-
if (event.data) {
|
|
1710
|
-
resolve(event.data);
|
|
1711
|
-
} else {
|
|
1712
|
-
reject(new Error("\uC778\uC99D\uC774 \uCDE8\uC18C\uB418\uAC70\uB098 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4."));
|
|
1713
|
-
}
|
|
1714
|
-
popup.close();
|
|
1715
|
-
window.removeEventListener("message", handleMessage);
|
|
1716
|
-
};
|
|
1717
|
-
window.addEventListener("message", handleMessage);
|
|
1718
|
-
});
|
|
1719
|
-
};
|
|
1720
|
-
const Iframe = function({
|
|
1721
|
-
height = 720,
|
|
1722
|
-
className,
|
|
1723
|
-
style,
|
|
1724
|
-
allow,
|
|
1725
|
-
sandbox = "allow-scripts allow-forms allow-same-origin",
|
|
1726
|
-
onSuccess,
|
|
1727
|
-
onError,
|
|
1728
|
-
onClose,
|
|
1729
|
-
strictOrigin = true
|
|
1730
|
-
}) {
|
|
1731
|
-
const targetUrl = buildUrl();
|
|
1732
|
-
useEffect(() => {
|
|
1733
|
-
if (!onSuccess && !onError) {
|
|
1734
|
-
return;
|
|
1735
|
-
}
|
|
1736
|
-
const handler = (e) => {
|
|
1737
|
-
console.log("message event", e);
|
|
1738
|
-
const d = e.data;
|
|
1739
|
-
if (d) {
|
|
1740
|
-
if (d.action === "close") {
|
|
1741
|
-
onClose?.(d);
|
|
1742
|
-
} else if (d.action === "error") {
|
|
1743
|
-
onError?.(d);
|
|
1744
|
-
} else if (d.action === "complete") {
|
|
1745
|
-
onSuccess?.(d);
|
|
1746
|
-
}
|
|
1747
|
-
} else {
|
|
1748
|
-
onError?.({
|
|
1749
|
-
action: "error",
|
|
1750
|
-
nlcCtfnId: "",
|
|
1751
|
-
redirectUrl: ""
|
|
1752
|
-
});
|
|
1753
|
-
}
|
|
1754
|
-
};
|
|
1755
|
-
window.addEventListener("message", handler);
|
|
1756
|
-
return () => window.removeEventListener("message", handler);
|
|
1757
|
-
}, [onClose, onError, onSuccess, strictOrigin]);
|
|
1758
|
-
return /* @__PURE__ */ jsx(
|
|
1759
|
-
"iframe",
|
|
1760
|
-
{
|
|
1761
|
-
src: targetUrl,
|
|
1762
|
-
width: "100%",
|
|
1763
|
-
height: typeof height === "number" ? `${height}px` : height,
|
|
1764
|
-
style: { border: 0, ...style },
|
|
1765
|
-
className,
|
|
1766
|
-
sandbox,
|
|
1767
|
-
...allow ? { allow } : {}
|
|
1768
|
-
}
|
|
1769
|
-
);
|
|
1770
|
-
};
|
|
1771
|
-
return { open, redirect, Iframe };
|
|
1772
|
-
}
|
|
1773
|
-
|
|
1774
1654
|
const CODES = {
|
|
1775
1655
|
appInit: {
|
|
1776
1656
|
dev: {
|
|
@@ -4546,5 +4426,5 @@ const useDownloader = () => {
|
|
|
4546
4426
|
};
|
|
4547
4427
|
};
|
|
4548
4428
|
|
|
4549
|
-
export { Attachment, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
|
|
4429
|
+
export { Attachment, BANK_STOCK_ICON_LIST, BANK_STOCK_SEARCH_MODAL_TABS, BankStockSearchModal, CODES, CustomerSearch, CustomerSearchModal, DeaCustomerSearchModal, DudDownload, DudUpload, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobVehicleSearchModal, OrganizationSearchModal, RIV_SEARCH_PARAM_MAP, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
|
|
4550
4430
|
//# sourceMappingURL=index.esm.js.map
|