sales-frontend-components 0.0.157 → 0.0.159

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
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { FieldValues, UseControllerProps } from 'react-hook-form';
3
- import { CheckboxButtonProps, CheckboxProps, DatePickerSingleHtmlProps, DatePickerRangeHtmlProps, FormField, SegmentItems, SegmentGroupHtmlProps, SelectProps, OptionProps } from 'sales-frontend-design-system';
3
+ import { CheckboxButtonProps, CheckboxProps, DatePickerSingleHtmlProps, DatePickerRangeHtmlProps, FormField, SegmentItems, SegmentGroupHtmlProps, SelectProps, OptionProps, useDropDown } from 'sales-frontend-design-system';
4
4
  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';
@@ -302,6 +302,26 @@ interface Props$3 {
302
302
  }
303
303
  declare function CustomerSearchModal({ isOpen, closeModal, onSelect, onSearchClear }: Props$3): react_jsx_runtime.JSX.Element;
304
304
 
305
+ interface UseCustomerSearchReturn {
306
+ triggerRef: ReturnType<typeof useDropDown>['triggerRef'];
307
+ isOpen: ReturnType<typeof useDropDown>['isOpen'];
308
+ setIsOpen: ReturnType<typeof useDropDown>['setIsOpen'];
309
+ DropDown: ReturnType<typeof useDropDown>['DropDown'];
310
+ searchInput: string;
311
+ customerList: CustomerDto[];
312
+ searchKeyword: string;
313
+ onSearchInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
314
+ onKeyUp: (e: React.KeyboardEvent<HTMLInputElement>) => void;
315
+ search: () => void;
316
+ onClear: () => void;
317
+ handleSelectItem: (customer: CustomerDto) => void;
318
+ selectedCustomer: CustomerDto | null;
319
+ setSearchInput: (searchInput: string) => void;
320
+ setCustomerList: (customerList: CustomerDto[]) => void;
321
+ setSearchKeyword: (searchKeyword: string) => void;
322
+ }
323
+ declare const useCustomerSearch: (onSelect?: (customer: CustomerDto) => void) => UseCustomerSearchReturn;
324
+
305
325
  interface Props$2 {
306
326
  setValue: (nationality: NationalityResponseDto) => void;
307
327
  onClose: () => void;
@@ -327,6 +347,7 @@ declare const useNationalityComponent: () => {
327
347
  nationality: NationalityResponseDto | undefined;
328
348
  openModal: () => void;
329
349
  NationalitySearchComponent: () => react_jsx_runtime.JSX.Element;
350
+ isConfirmed: boolean;
330
351
  };
331
352
 
332
353
  type Step = 'appInit' | 'tabletEformInit' | 'tabletEformRe' | 'tabletEformSubInfo' | 'smartphoneEformSubInfo' | 'smartphoneEformAlimtalkInit' | 'smartphoneEformAlimtalkRe' | 'tabletNewCustomer' | 'tabletNewCustomerLegalRep' | 'tabletCustomerInfoPlanAgreement' | 'tabletCustomerInfoProductAgreement';
@@ -439,6 +460,7 @@ declare const useVisaComponent: () => {
439
460
  isOpen: boolean;
440
461
  closeModal: () => void;
441
462
  setVisa: React__default.Dispatch<React__default.SetStateAction<VisaStatusResponseDto | undefined>>;
463
+ isConfirmed: boolean;
442
464
  };
443
465
 
444
466
  interface DeaCustomerSearchModalProps {
@@ -459,6 +481,7 @@ declare function useJobSearchModal(): {
459
481
  JobSearchModal: react_jsx_runtime.JSX.Element;
460
482
  JobSearchComponent: react_jsx_runtime.JSX.Element;
461
483
  isJobSearchOpen: boolean;
484
+ isConfirmed: boolean;
462
485
  openJobSearchModal: () => void;
463
486
  closeJobSearchModal: () => void;
464
487
  selectedJob: OccupationResponseDto | null;
@@ -474,6 +497,7 @@ declare function useJobVehicleSearchModal(): {
474
497
  riskGrade: string;
475
498
  hospitalizationGrade: string;
476
499
  isOpenJobVehicleModal: boolean;
500
+ isConfirmed: boolean;
477
501
  openJobVehicleModal: () => void;
478
502
  closeJobVehicleModal: () => void;
479
503
  JobVehicleSearchModalComponent: react_jsx_runtime.JSX.Element;
@@ -621,5 +645,5 @@ declare const useDownloader: () => {
621
645
  isError: boolean;
622
646
  };
623
647
 
624
- 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 };
648
+ 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, useCustomerSearch, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
625
649
  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
@@ -1273,7 +1273,7 @@ const NationalitySearchInitialText = ({
1273
1273
  /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: favoriteList.map((item, index) => /* @__PURE__ */ jsx("li", { onClick: () => set(item.nationalityCodeName), children: /* @__PURE__ */ jsx("button", { children: item.nationalityCodeName }) }, `${item.nationalityCode}-${index}`)) })
1274
1274
  ] });
1275
1275
  };
1276
- const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) => {
1276
+ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect, onConfirm }) => {
1277
1277
  const [filterList, setFilterList] = useState([]);
1278
1278
  useEffect(() => {
1279
1279
  const filterList2 = nationalityList.filter((item) => item.nationalityCodeName.includes(searchKeyWord)) || [];
@@ -1286,7 +1286,10 @@ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) =
1286
1286
  "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1287
1287
  ] }),
1288
1288
  /* @__PURE__ */ jsx("ul", { className: cx$h("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1289
- return /* @__PURE__ */ jsx("li", { onClick: () => onSelect(item.nationalityCodeName), children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1289
+ return /* @__PURE__ */ jsx("li", { onClick: () => {
1290
+ onSelect(item.nationalityCodeName);
1291
+ onConfirm();
1292
+ }, children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1290
1293
  }) }),
1291
1294
  filterList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$h("search-result"), children: [
1292
1295
  "`",
@@ -1295,7 +1298,7 @@ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) =
1295
1298
  ] })
1296
1299
  ] });
1297
1300
  };
1298
- function NationalityComponent({ isOpen, onClose, setValue }) {
1301
+ function NationalityComponent({ isOpen, onClose, setValue, onConfirm }) {
1299
1302
  const {
1300
1303
  search,
1301
1304
  onClear,
@@ -1337,7 +1340,7 @@ function NationalityComponent({ isOpen, onClose, setValue }) {
1337
1340
  }
1338
1341
  ),
1339
1342
  !searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchInitialText, { setSearchInput, setSearchKeyword }),
1340
- searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect })
1343
+ searchKeyWord && /* @__PURE__ */ jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect, onConfirm })
1341
1344
  ] })
1342
1345
  ] })
1343
1346
  ] }) });
@@ -1403,14 +1406,19 @@ function useSearchNationality({ setValue, onClose, isOpen }) {
1403
1406
  const useNationalityComponent = () => {
1404
1407
  const [nationality, setNationality] = useState();
1405
1408
  const { isOpen, closeModal, openModal } = useModalState();
1406
- const NationalitySearchComponent = () => /* @__PURE__ */ jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality });
1409
+ const [isConfirmed, setIsConfirmed] = useState(false);
1410
+ const onConfirm = () => {
1411
+ setIsConfirmed(true);
1412
+ };
1413
+ const NationalitySearchComponent = () => /* @__PURE__ */ jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality, onConfirm });
1407
1414
  return {
1408
1415
  isOpen,
1409
1416
  closeModal,
1410
1417
  setNationality,
1411
1418
  nationality,
1412
1419
  openModal,
1413
- NationalitySearchComponent
1420
+ NationalitySearchComponent,
1421
+ isConfirmed
1414
1422
  };
1415
1423
  };
1416
1424
 
@@ -1838,12 +1846,15 @@ function useNxlOneModal({
1838
1846
 
1839
1847
  const cx$g = classNames.bind(styles$4);
1840
1848
  const { InputBox, Input } = FormCore;
1841
- const VisaSearchInitialText = ({ visaList, onSelect }) => {
1849
+ const VisaSearchInitialText = ({ visaList, onSelect, onConfirm }) => {
1842
1850
  return /* @__PURE__ */ jsx("div", { className: cx$g("favorite-container"), children: /* @__PURE__ */ jsx("ul", { className: cx$g("favorite"), children: visaList.map((item, index) => {
1843
- return /* @__PURE__ */ jsx("li", { onClick: () => onSelect(item), children: /* @__PURE__ */ jsx("button", { children: item.integrationCodeValueName }) }, `${index}-${item.integrationCodeValueName}`);
1851
+ return /* @__PURE__ */ jsx("li", { onClick: () => {
1852
+ onSelect(item);
1853
+ onConfirm();
1854
+ }, children: /* @__PURE__ */ jsx("button", { children: item.integrationCodeValueName }) }, `${index}-${item.integrationCodeValueName}`);
1844
1855
  }) }) });
1845
1856
  };
1846
- const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1857
+ const VisaSearchResult = ({ visaList, searchKeyword, onSelect, onConfirm }) => {
1847
1858
  const [filterList, setFilterList] = useState([]);
1848
1859
  useEffect(() => {
1849
1860
  const filterList2 = visaList.filter((item) => item.integrationCodeValueName?.includes(searchKeyword)) || [];
@@ -1856,7 +1867,10 @@ const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1856
1867
  "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1857
1868
  ] }),
1858
1869
  /* @__PURE__ */ jsx("ul", { className: cx$g("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1859
- return /* @__PURE__ */ jsx("li", { onClick: () => onSelect(item), children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(`${item.integrationCodeValueName}`, searchKeyword) }) }, `${index}-${item.integrationCodeValueName}`);
1870
+ return /* @__PURE__ */ jsx("li", { onClick: () => {
1871
+ onSelect(item);
1872
+ onConfirm();
1873
+ }, children: /* @__PURE__ */ jsx("button", { children: highlightOnSearchKeyword(`${item.integrationCodeValueName}`, searchKeyword) }) }, `${index}-${item.integrationCodeValueName}`);
1860
1874
  }) }),
1861
1875
  filterList.length === 0 && /* @__PURE__ */ jsxs("div", { className: cx$g("search-result"), children: [
1862
1876
  "`",
@@ -1865,7 +1879,7 @@ const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1865
1879
  ] })
1866
1880
  ] });
1867
1881
  };
1868
- function VisaComponent({ isOpen, onClose, setValue }) {
1882
+ function VisaComponent({ isOpen, onClose, setValue, onConfirm }) {
1869
1883
  const { search, onClear, searchKeyword, onKeyUp, onSearch, searchList, searchInput, onSelect } = useSearchVisa({
1870
1884
  setValue,
1871
1885
  onClose,
@@ -1895,8 +1909,8 @@ function VisaComponent({ isOpen, onClose, setValue }) {
1895
1909
  )
1896
1910
  }
1897
1911
  ),
1898
- !searchKeyword && /* @__PURE__ */ jsx(VisaSearchInitialText, { visaList: searchList, onSelect }),
1899
- searchKeyword && /* @__PURE__ */ jsx(VisaSearchResult, { visaList: searchList, searchKeyword, onSelect })
1912
+ !searchKeyword && /* @__PURE__ */ jsx(VisaSearchInitialText, { visaList: searchList, onSelect, onConfirm }),
1913
+ searchKeyword && /* @__PURE__ */ jsx(VisaSearchResult, { visaList: searchList, searchKeyword, onSelect, onConfirm })
1900
1914
  ] })
1901
1915
  ] })
1902
1916
  ] }) });
@@ -1959,15 +1973,20 @@ function useSearchVisa({ setValue, onClose, isOpen }) {
1959
1973
  }
1960
1974
  const useVisaComponent = () => {
1961
1975
  const [visa, setVisa] = useState();
1976
+ const [isConfirmed, setIsConfirmed] = useState(false);
1962
1977
  const { isOpen, closeModal, openModal } = useModalState();
1963
- const VisaSearchComponent = () => /* @__PURE__ */ jsx(VisaComponent, { isOpen, onClose: closeModal, setValue: setVisa });
1978
+ const onConfirm = () => {
1979
+ setIsConfirmed(true);
1980
+ };
1981
+ const VisaSearchComponent = () => /* @__PURE__ */ jsx(VisaComponent, { isOpen, onClose: closeModal, setValue: setVisa, onConfirm });
1964
1982
  return {
1965
1983
  visa,
1966
1984
  openModal,
1967
1985
  VisaSearchComponent,
1968
1986
  isOpen,
1969
1987
  closeModal,
1970
- setVisa
1988
+ setVisa,
1989
+ isConfirmed
1971
1990
  };
1972
1991
  };
1973
1992
 
@@ -2818,6 +2837,7 @@ function useJobSearchModal() {
2818
2837
  isLoading
2819
2838
  } = useJobSearch();
2820
2839
  const { isOpen, openModal, closeModal } = useModalState();
2840
+ const [isConfirmed, setIsConfirmed] = useState(false);
2821
2841
  const onTabChange = (value) => {
2822
2842
  reset();
2823
2843
  setActiveTab(value);
@@ -2829,6 +2849,7 @@ function useJobSearchModal() {
2829
2849
  openModal();
2830
2850
  };
2831
2851
  const closeModalWithCheck = () => {
2852
+ setIsConfirmed(true);
2832
2853
  if (!selectedJob) {
2833
2854
  ModalUtils.alert("\uC9C1\uC885\uC744 \uC120\uD0DD\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uC9C1\uC885 \uC120\uD0DD \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.", "\uC9C1\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.", {
2834
2855
  modalId: "job-search-alert-no-selected"
@@ -2896,6 +2917,7 @@ function useJobSearchModal() {
2896
2917
  }
2897
2918
  ),
2898
2919
  isJobSearchOpen: isOpen,
2920
+ isConfirmed,
2899
2921
  openJobSearchModal: openInitModal,
2900
2922
  closeJobSearchModal: closeModal,
2901
2923
  selectedJob,
@@ -3043,6 +3065,7 @@ function useJobVehicleSearchModal() {
3043
3065
  selectedJobDetail
3044
3066
  } = useJobVehicleSearch();
3045
3067
  const { isOpen, openModal, closeModal } = useModalState();
3068
+ const [isConfirmed, setIsConfirmed] = useState(false);
3046
3069
  const validate = () => {
3047
3070
  if (!selectedJob && !selectedVehicle) {
3048
3071
  return ModalUtils.alert(
@@ -3076,6 +3099,7 @@ function useJobVehicleSearchModal() {
3076
3099
  riskGrade,
3077
3100
  hospitalizationGrade,
3078
3101
  isOpenJobVehicleModal: isOpen,
3102
+ isConfirmed,
3079
3103
  openJobVehicleModal: openInitModal,
3080
3104
  closeJobVehicleModal: closeModal,
3081
3105
  JobVehicleSearchModalComponent: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
@@ -3123,7 +3147,10 @@ function useJobVehicleSearchModal() {
3123
3147
  ] }),
3124
3148
  /* @__PURE__ */ jsx("div", { className: cx$5("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
3125
3149
  ] }) }),
3126
- /* @__PURE__ */ jsx(Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsx(Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: validate, children: "\uD655\uC778" }) })
3150
+ /* @__PURE__ */ jsx(Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsx(Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: () => {
3151
+ validate();
3152
+ setIsConfirmed(true);
3153
+ }, children: "\uD655\uC778" }) })
3127
3154
  ] })
3128
3155
  ] })
3129
3156
  };
@@ -4434,5 +4461,5 @@ const useDownloader = () => {
4434
4461
  };
4435
4462
  };
4436
4463
 
4437
- 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 };
4464
+ 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, useCustomerSearch, useDownloader, useJobSearchModal, useJobVehicleSearchModal, useNationalityComponent, useNxlOneModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress, useSearchNationality, useSearchVisa, useVisaComponent };
4438
4465
  //# sourceMappingURL=index.esm.js.map