sales-frontend-components 0.0.129 → 0.0.131

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
@@ -355,6 +355,7 @@ interface Props$1 {
355
355
  * 상세업무명 : 상품소개동의갱신 인증
356
356
  */
357
357
  step: Step;
358
+ nxlOneProps?: Partial<NxlOneProps>;
358
359
  }
359
360
  /**
360
361
  * onSuccess, onError, onClose 이벤트 핸들러 구현 필요
@@ -364,8 +365,8 @@ interface Props$1 {
364
365
  * modalSize: 모달 크기 설정 (예: 'small', 'medium', 'large', 'full-screen')
365
366
  * bizCode 및 tmplCode: NXL ONE 서비스에서 제공하는 비즈니스 코드 및 템플릿 코드
366
367
  */
367
- declare function useNxlOneModal({ onSuccess, onError, onClose, modalSize, step, env }: Props$1): {
368
- openNxlOneModal: () => void;
368
+ declare function useNxlOneModal({ onSuccess, onError, onClose, modalSize, step, env, nxlOneProps }: Props$1): {
369
+ openNxlOneModal: (nxlOnePropsState?: Partial<NxlOneProps>) => void;
369
370
  closeNxlOneModal: () => void;
370
371
  isNxlOneModalOpen: boolean;
371
372
  NxlModalComponent: react_jsx_runtime.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -1640,23 +1640,38 @@ function useNxlOneModal({
1640
1640
  },
1641
1641
  modalSize = "medium",
1642
1642
  step = "appInit",
1643
- env = "stg"
1643
+ env = "stg",
1644
+ nxlOneProps = {}
1644
1645
  }) {
1645
1646
  const { isOpen, openModal, closeModal } = useModalState();
1647
+ const [nxlOnePropsState, setNxlOnePropsState] = useState(nxlOneProps);
1646
1648
  const { bizCode, tmplCode } = CODES[step][env];
1647
1649
  const { Iframe, open } = useNxlOne({
1648
- bizCode,
1649
- tmplCode
1650
+ ...nxlOnePropsState,
1651
+ bizCode: nxlOnePropsState.bizCode || bizCode,
1652
+ tmplCode: nxlOnePropsState.tmplCode || tmplCode
1650
1653
  });
1654
+ const openNxlOneModal = () => {
1655
+ const type = isClient() ? window.location.hostname : "";
1656
+ if (type.includes("localhost") || type.includes("local.hanwhalife.com")) {
1657
+ open({ popupWidth: 500, popupHeight: 500 }).then((result) => {
1658
+ onSuccess(result);
1659
+ });
1660
+ } else {
1661
+ openModal();
1662
+ }
1663
+ };
1664
+ useEffect(() => {
1665
+ if (nxlOnePropsState.nlcCtfnId) {
1666
+ openNxlOneModal();
1667
+ }
1668
+ }, [nxlOnePropsState]);
1651
1669
  return {
1652
- openNxlOneModal: () => {
1653
- const type = isClient() ? window.location.hostname : "";
1654
- if (type.includes("localhost") || type.includes("local.hanwhalife.com")) {
1655
- open({ popupWidth: 500, popupHeight: 500 }).then((result) => {
1656
- onSuccess(result);
1657
- });
1670
+ openNxlOneModal: (nxlOnePropsState2) => {
1671
+ if (nxlOnePropsState2) {
1672
+ setNxlOnePropsState(nxlOnePropsState2);
1658
1673
  } else {
1659
- openModal();
1674
+ openNxlOneModal();
1660
1675
  }
1661
1676
  },
1662
1677
  closeNxlOneModal: closeModal,