sales-frontend-components 0.0.154 → 0.0.155

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.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
 
@@ -314,19 +315,6 @@ declare const useNationalityComponent: () => {
314
315
  NationalitySearchComponent: () => react_jsx_runtime.JSX.Element;
315
316
  };
316
317
 
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
318
  type Step = 'appInit' | 'tabletEformInit' | 'tabletEformRe' | 'tabletEformSubInfo' | 'smartphoneEformSubInfo' | 'smartphoneEformAlimtalkInit' | 'smartphoneEformAlimtalkRe' | 'tabletNewCustomer' | 'tabletNewCustomerLegalRep' | 'tabletCustomerInfoPlanAgreement' | 'tabletCustomerInfoProductAgreement';
331
319
  interface CodeSet {
332
320
  dev: {
@@ -620,4 +608,4 @@ declare const useDownloader: () => {
620
608
  };
621
609
 
622
610
  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, NxlOneProps, NxlOneResponse, PaintProps, Pen, RemoteIdentityVerificationSuccess, RivUrlParams, Step, StepIndicatorProps, StepItem, UseRemoteIdentityVerificationProps, VerificationResponse, cameraItemType, cameraOptions };
611
+ 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';
@@ -1432,32 +1433,6 @@ var getEnvironmentFromHostname = (hostname) => {
1432
1433
  }
1433
1434
  return "prd";
1434
1435
  };
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
1436
  var _MessageEventManager = class _MessageEventManager2 {
1462
1437
  constructor() {
1463
1438
  __publicField(this, "handlers", /* @__PURE__ */ new Map());
@@ -1666,111 +1641,6 @@ function getE2EDataIDs(ids, onSuccess, onFailure = () => {
1666
1641
  }
1667
1642
  }
1668
1643
 
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
1644
  const CODES = {
1775
1645
  appInit: {
1776
1646
  dev: {