sales-frontend-components 0.0.158 → 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 +34 -15
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +34 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +9 -9
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: () =>
|
|
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
|
|
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: () =>
|
|
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: () =>
|
|
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
|
|
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
|
|