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.cjs.js CHANGED
@@ -1275,7 +1275,7 @@ const NationalitySearchInitialText = ({
1275
1275
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$h("favorite"), children: favoriteList.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => set(item.nationalityCodeName), children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: item.nationalityCodeName }) }, `${item.nationalityCode}-${index}`)) })
1276
1276
  ] });
1277
1277
  };
1278
- const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) => {
1278
+ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect, onConfirm }) => {
1279
1279
  const [filterList, setFilterList] = React.useState([]);
1280
1280
  React.useEffect(() => {
1281
1281
  const filterList2 = nationalityList.filter((item) => item.nationalityCodeName.includes(searchKeyWord)) || [];
@@ -1288,7 +1288,10 @@ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) =
1288
1288
  "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1289
1289
  ] }),
1290
1290
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$h("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1291
- return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => onSelect(item.nationalityCodeName), children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1291
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => {
1292
+ onSelect(item.nationalityCodeName);
1293
+ onConfirm();
1294
+ }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: highlightOnSearchKeyword(item.nationalityCodeName, searchKeyWord) }) }, `${index}-${item.nationalityCode}`);
1292
1295
  }) }),
1293
1296
  filterList.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$h("search-result"), children: [
1294
1297
  "`",
@@ -1297,7 +1300,7 @@ const NationalitySearchResult = ({ nationalityList, searchKeyWord, onSelect }) =
1297
1300
  ] })
1298
1301
  ] });
1299
1302
  };
1300
- function NationalityComponent({ isOpen, onClose, setValue }) {
1303
+ function NationalityComponent({ isOpen, onClose, setValue, onConfirm }) {
1301
1304
  const {
1302
1305
  search,
1303
1306
  onClear,
@@ -1339,7 +1342,7 @@ function NationalityComponent({ isOpen, onClose, setValue }) {
1339
1342
  }
1340
1343
  ),
1341
1344
  !searchKeyWord && /* @__PURE__ */ jsxRuntime.jsx(NationalitySearchInitialText, { setSearchInput, setSearchKeyword }),
1342
- searchKeyWord && /* @__PURE__ */ jsxRuntime.jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect })
1345
+ searchKeyWord && /* @__PURE__ */ jsxRuntime.jsx(NationalitySearchResult, { nationalityList: searchList, searchKeyWord, onSelect, onConfirm })
1343
1346
  ] })
1344
1347
  ] })
1345
1348
  ] }) });
@@ -1405,14 +1408,19 @@ function useSearchNationality({ setValue, onClose, isOpen }) {
1405
1408
  const useNationalityComponent = () => {
1406
1409
  const [nationality, setNationality] = React.useState();
1407
1410
  const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
1408
- const NationalitySearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality });
1411
+ const [isConfirmed, setIsConfirmed] = React.useState(false);
1412
+ const onConfirm = () => {
1413
+ setIsConfirmed(true);
1414
+ };
1415
+ const NationalitySearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(NationalityComponent, { isOpen, onClose: closeModal, setValue: setNationality, onConfirm });
1409
1416
  return {
1410
1417
  isOpen,
1411
1418
  closeModal,
1412
1419
  setNationality,
1413
1420
  nationality,
1414
1421
  openModal,
1415
- NationalitySearchComponent
1422
+ NationalitySearchComponent,
1423
+ isConfirmed
1416
1424
  };
1417
1425
  };
1418
1426
 
@@ -1840,12 +1848,15 @@ function useNxlOneModal({
1840
1848
 
1841
1849
  const cx$g = classNames.bind(styles$4);
1842
1850
  const { InputBox, Input } = salesFrontendDesignSystem.FormCore;
1843
- const VisaSearchInitialText = ({ visaList, onSelect }) => {
1851
+ const VisaSearchInitialText = ({ visaList, onSelect, onConfirm }) => {
1844
1852
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$g("favorite-container"), children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$g("favorite"), children: visaList.map((item, index) => {
1845
- return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => onSelect(item), children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: item.integrationCodeValueName }) }, `${index}-${item.integrationCodeValueName}`);
1853
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => {
1854
+ onSelect(item);
1855
+ onConfirm();
1856
+ }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: item.integrationCodeValueName }) }, `${index}-${item.integrationCodeValueName}`);
1846
1857
  }) }) });
1847
1858
  };
1848
- const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1859
+ const VisaSearchResult = ({ visaList, searchKeyword, onSelect, onConfirm }) => {
1849
1860
  const [filterList, setFilterList] = React.useState([]);
1850
1861
  React.useEffect(() => {
1851
1862
  const filterList2 = visaList.filter((item) => item.integrationCodeValueName?.includes(searchKeyword)) || [];
@@ -1858,7 +1869,10 @@ const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1858
1869
  "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1859
1870
  ] }),
1860
1871
  /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$g("favorite"), children: filterList.length > 0 && filterList.map((item, index) => {
1861
- return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => onSelect(item), children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: highlightOnSearchKeyword(`${item.integrationCodeValueName}`, searchKeyword) }) }, `${index}-${item.integrationCodeValueName}`);
1872
+ return /* @__PURE__ */ jsxRuntime.jsx("li", { onClick: () => {
1873
+ onSelect(item);
1874
+ onConfirm();
1875
+ }, children: /* @__PURE__ */ jsxRuntime.jsx("button", { children: highlightOnSearchKeyword(`${item.integrationCodeValueName}`, searchKeyword) }) }, `${index}-${item.integrationCodeValueName}`);
1862
1876
  }) }),
1863
1877
  filterList.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$g("search-result"), children: [
1864
1878
  "`",
@@ -1867,7 +1881,7 @@ const VisaSearchResult = ({ visaList, searchKeyword, onSelect }) => {
1867
1881
  ] })
1868
1882
  ] });
1869
1883
  };
1870
- function VisaComponent({ isOpen, onClose, setValue }) {
1884
+ function VisaComponent({ isOpen, onClose, setValue, onConfirm }) {
1871
1885
  const { search, onClear, searchKeyword, onKeyUp, onSearch, searchList, searchInput, onSelect } = useSearchVisa({
1872
1886
  setValue,
1873
1887
  onClose,
@@ -1897,8 +1911,8 @@ function VisaComponent({ isOpen, onClose, setValue }) {
1897
1911
  )
1898
1912
  }
1899
1913
  ),
1900
- !searchKeyword && /* @__PURE__ */ jsxRuntime.jsx(VisaSearchInitialText, { visaList: searchList, onSelect }),
1901
- searchKeyword && /* @__PURE__ */ jsxRuntime.jsx(VisaSearchResult, { visaList: searchList, searchKeyword, onSelect })
1914
+ !searchKeyword && /* @__PURE__ */ jsxRuntime.jsx(VisaSearchInitialText, { visaList: searchList, onSelect, onConfirm }),
1915
+ searchKeyword && /* @__PURE__ */ jsxRuntime.jsx(VisaSearchResult, { visaList: searchList, searchKeyword, onSelect, onConfirm })
1902
1916
  ] })
1903
1917
  ] })
1904
1918
  ] }) });
@@ -1961,15 +1975,20 @@ function useSearchVisa({ setValue, onClose, isOpen }) {
1961
1975
  }
1962
1976
  const useVisaComponent = () => {
1963
1977
  const [visa, setVisa] = React.useState();
1978
+ const [isConfirmed, setIsConfirmed] = React.useState(false);
1964
1979
  const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
1965
- const VisaSearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(VisaComponent, { isOpen, onClose: closeModal, setValue: setVisa });
1980
+ const onConfirm = () => {
1981
+ setIsConfirmed(true);
1982
+ };
1983
+ const VisaSearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(VisaComponent, { isOpen, onClose: closeModal, setValue: setVisa, onConfirm });
1966
1984
  return {
1967
1985
  visa,
1968
1986
  openModal,
1969
1987
  VisaSearchComponent,
1970
1988
  isOpen,
1971
1989
  closeModal,
1972
- setVisa
1990
+ setVisa,
1991
+ isConfirmed
1973
1992
  };
1974
1993
  };
1975
1994
 
@@ -2820,6 +2839,7 @@ function useJobSearchModal() {
2820
2839
  isLoading
2821
2840
  } = useJobSearch();
2822
2841
  const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
2842
+ const [isConfirmed, setIsConfirmed] = React.useState(false);
2823
2843
  const onTabChange = (value) => {
2824
2844
  reset();
2825
2845
  setActiveTab(value);
@@ -2831,6 +2851,7 @@ function useJobSearchModal() {
2831
2851
  openModal();
2832
2852
  };
2833
2853
  const closeModalWithCheck = () => {
2854
+ setIsConfirmed(true);
2834
2855
  if (!selectedJob) {
2835
2856
  salesFrontendDesignSystem.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.", {
2836
2857
  modalId: "job-search-alert-no-selected"
@@ -2898,6 +2919,7 @@ function useJobSearchModal() {
2898
2919
  }
2899
2920
  ),
2900
2921
  isJobSearchOpen: isOpen,
2922
+ isConfirmed,
2901
2923
  openJobSearchModal: openInitModal,
2902
2924
  closeJobSearchModal: closeModal,
2903
2925
  selectedJob,
@@ -3045,6 +3067,7 @@ function useJobVehicleSearchModal() {
3045
3067
  selectedJobDetail
3046
3068
  } = useJobVehicleSearch();
3047
3069
  const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
3070
+ const [isConfirmed, setIsConfirmed] = React.useState(false);
3048
3071
  const validate = () => {
3049
3072
  if (!selectedJob && !selectedVehicle) {
3050
3073
  return salesFrontendDesignSystem.ModalUtils.alert(
@@ -3078,6 +3101,7 @@ function useJobVehicleSearchModal() {
3078
3101
  riskGrade,
3079
3102
  hospitalizationGrade,
3080
3103
  isOpenJobVehicleModal: isOpen,
3104
+ isConfirmed,
3081
3105
  openJobVehicleModal: openInitModal,
3082
3106
  closeJobVehicleModal: closeModal,
3083
3107
  JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
@@ -3125,7 +3149,10 @@ function useJobVehicleSearchModal() {
3125
3149
  ] }),
3126
3150
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$5("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
3127
3151
  ] }) }),
3128
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: validate, children: "\uD655\uC778" }) })
3152
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: () => {
3153
+ validate();
3154
+ setIsConfirmed(true);
3155
+ }, children: "\uD655\uC778" }) })
3129
3156
  ] })
3130
3157
  ] })
3131
3158
  };
@@ -4465,6 +4492,7 @@ exports.useAddressComponent = useAddressComponent;
4465
4492
  exports.useBankStockSearch = useBankStockSearch;
4466
4493
  exports.useCamera = useCamera;
4467
4494
  exports.useCanvasPaint = useCanvasPaint;
4495
+ exports.useCustomerSearch = useCustomerSearch;
4468
4496
  exports.useDownloader = useDownloader;
4469
4497
  exports.useJobSearchModal = useJobSearchModal;
4470
4498
  exports.useJobVehicleSearchModal = useJobVehicleSearchModal;