sales-frontend-components 0.0.65 → 0.0.67

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
@@ -10,6 +10,11 @@ var styles$2 = require('./debug-tool/debug-tool.module.scss');
10
10
  var salesFrontendUtils = require('sales-frontend-utils');
11
11
  var salesFrontendApi = require('sales-frontend-api');
12
12
  var styles$3 = require('./debug-tool/features/network-log/network-log.module.scss');
13
+ var method = require('sales-frontend-api/method');
14
+ var styles$4 = require('./modal/standard/address-search/select-address.module.scss');
15
+ var styles$5 = require('./modal/pre-standard/job-vehicle-search-modal/job-vehicle-search-modal.module.scss');
16
+ var styles$6 = require('./modal/pre-standard/job-search-modal/job-search-modal.module.scss');
17
+ var styles$7 = require('./modal/pre-standard/vehicle-search-modal/vehicle-search-modal.module.scss');
13
18
 
14
19
  const FormCheckboxButton = ({
15
20
  name,
@@ -256,7 +261,7 @@ function requireBind () {
256
261
  var bindExports = requireBind();
257
262
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(bindExports);
258
263
 
259
- const cx$1 = classNames.bind(styles);
264
+ const cx$9 = classNames.bind(styles);
260
265
  const StepIndicator = ({
261
266
  items,
262
267
  onClickItem,
@@ -272,23 +277,23 @@ const StepIndicator = ({
272
277
  }
273
278
  });
274
279
  }, [items, defaultValue]);
275
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$1("stepper-layout"), children: [
276
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$1("stepper"), children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
280
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$9("stepper-layout"), children: [
281
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$9("stepper"), children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
277
282
  /* @__PURE__ */ jsxRuntime.jsx(
278
283
  "div",
279
284
  {
280
- className: cx$1("circle", (defaultValue === item.value || current === idx) && "active"),
285
+ className: cx$9("circle", (defaultValue === item.value || current === idx) && "active"),
281
286
  onClick: () => onClickItem?.(item),
282
- children: item.isCompleted || idx < current ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$1("completed") }) : ++idx
287
+ children: item.isCompleted || idx < current ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$9("completed") }) : ++idx
283
288
  }
284
289
  ),
285
- idx < items.length && Array.from({ length: dotCount }).map((_, dotIdx) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$1("dot") }, `dot-${idx}-${dotIdx}`))
290
+ idx < items.length && Array.from({ length: dotCount }).map((_, dotIdx) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$9("dot") }, `dot-${idx}-${dotIdx}`))
286
291
  ] }, `num-${idx}`)) }),
287
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$1("step-labels"), children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: cx$1((defaultValue === item.value || current === idx) && "active"), children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label ?? item.value }) }, `label-${idx}`)) })
292
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx$9("step-labels"), children: items.map((item, idx) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: cx$9((defaultValue === item.value || current === idx) && "active"), children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: item.label ?? item.value }) }, `label-${idx}`)) })
288
293
  ] });
289
294
  };
290
295
 
291
- const cx = classNames.bind(styles$1);
296
+ const cx$8 = classNames.bind(styles$1);
292
297
  function Attachment({
293
298
  photos,
294
299
  onAddPhoto,
@@ -305,14 +310,14 @@ function Attachment({
305
310
  };
306
311
  const renderPhotoSingle = () => {
307
312
  if (photos.length === 0) {
308
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("single-photo-item", "add-photo-item"), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: cx("add-photo-button-single"), onClick: handleAddPhoto, children: [
313
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("single-photo-item", "add-photo-item"), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: cx$8("add-photo-button-single"), onClick: handleAddPhoto, children: [
309
314
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "illust/camera" }),
310
315
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: buttonText || "\uC0AC\uC9C4 \uCCA8\uBD80\uD558\uAE30" })
311
316
  ] }) });
312
317
  }
313
- return photos.map((photo) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("single-photo-item"), children: [
314
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("photo-placeholder"), children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: photo.src, alt: photo.name, className: cx("photo-image") }) }),
315
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: cx("remove-button"), onClick: () => handleRemovePhoto(photo.id), "aria-label": "\uC0AC\uC9C4 \uC0AD\uC81C", children: "\xD7" })
318
+ return photos.map((photo) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("single-photo-item"), children: [
319
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("photo-placeholder"), children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: photo.src, alt: photo.name, className: cx$8("photo-image") }) }),
320
+ /* @__PURE__ */ jsxRuntime.jsx("button", { className: cx$8("remove-button"), onClick: () => handleRemovePhoto(photo.id), "aria-label": "\uC0AC\uC9C4 \uC0AD\uC81C", children: "\xD7" })
316
321
  ] }, photo.id));
317
322
  };
318
323
  const renderPhotoGrid = () => {
@@ -320,12 +325,12 @@ function Attachment({
320
325
  const gridItems = [];
321
326
  if (photos.length < maxPhotos) {
322
327
  gridItems.push(
323
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("photo-item", "add-photo-item"), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: cx("add-photo-button"), onClick: handleAddPhoto, children: [
328
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("photo-item", "add-photo-item"), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { className: cx$8("add-photo-button"), onClick: handleAddPhoto, children: [
324
329
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "illust/camera" }),
325
330
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: buttonText || "\uCCA8\uBD80\uD558\uAE30" }),
326
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx("photo-count"), children: [
331
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx$8("photo-count"), children: [
327
332
  "(",
328
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("photo-count-number"), children: photos.length }),
333
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("photo-count-number"), children: photos.length }),
329
334
  "/",
330
335
  maxPhotos,
331
336
  ")"
@@ -335,9 +340,9 @@ function Attachment({
335
340
  }
336
341
  photos.forEach((photo) => {
337
342
  gridItems.push(
338
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("photo-item"), children: [
339
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("photo-placeholder"), children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: photo.src, alt: photo.name, className: cx("photo-image") }) }),
340
- /* @__PURE__ */ jsxRuntime.jsx("button", { className: cx("remove-button"), onClick: () => handleRemovePhoto(photo.id), "aria-label": "\uC0AC\uC9C4 \uC0AD\uC81C", children: "\xD7" })
343
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("photo-item"), children: [
344
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("photo-placeholder"), children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: photo.src, alt: photo.name, className: cx$8("photo-image") }) }),
345
+ /* @__PURE__ */ jsxRuntime.jsx("button", { className: cx$8("remove-button"), onClick: () => handleRemovePhoto(photo.id), "aria-label": "\uC0AC\uC9C4 \uC0AD\uC81C", children: "\xD7" })
341
346
  ] }, photo.id)
342
347
  );
343
348
  });
@@ -348,9 +353,9 @@ function Attachment({
348
353
  return null;
349
354
  }
350
355
  if (type === "single") {
351
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("photo-single"), children: renderPhotoSingle() });
356
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("photo-single"), children: renderPhotoSingle() });
352
357
  }
353
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("photo-grid", { linear: type === "linear" }), children: renderPhotoGrid() });
358
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("photo-grid", { linear: type === "linear" }), children: renderPhotoGrid() });
354
359
  }
355
360
 
356
361
  const maxImageSize = 3 * 1024 * 1024;
@@ -1548,6 +1553,919 @@ const DebugTool = ({ onLogin, envOverride, menuItemsOverride }) => {
1548
1553
  ] });
1549
1554
  };
1550
1555
 
1556
+ const highlightOnSearchKeyword = (originalText, targetString) => {
1557
+ if (originalText?.includes(targetString)) {
1558
+ const replacedText = [];
1559
+ const splitText = originalText.split(targetString);
1560
+ for (let i = 0; i < splitText.length; i++) {
1561
+ replacedText.push(splitText[i]);
1562
+ if (i !== splitText.length - 1) {
1563
+ replacedText.push(/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: targetString }));
1564
+ }
1565
+ }
1566
+ return replacedText;
1567
+ }
1568
+ return originalText;
1569
+ };
1570
+
1571
+ const cx$7 = classNames.bind(styles$4);
1572
+ const { InputBox, Input } = salesFrontendDesignSystem.FormCore;
1573
+ const AddressSearchInitialText = () => {
1574
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1575
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: cx$7("guide-title"), children: "\uC774\uB807\uAC8C \uAC80\uC0C9\uD574 \uBCF4\uC138\uC694." }),
1576
+ /* @__PURE__ */ jsxRuntime.jsxs("ul", { className: cx$7("guide"), children: [
1577
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uB3C4\uB85C\uBA85/\uC9C0\uBA85\uACFC \uAC74\uBB3C\uBC88\uD638\uB97C \uD568\uAED8 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
1578
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC608) 63\uB85C 50, \uC5EC\uC758\uB3C4\uB3D9 60" }),
1579
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC9C0\uBA85\uC740 \uB3D9/\uC74D/\uBA74/\uB9AC\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
1580
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC608) \uC5EC\uC758\uB3C4\uB3D9, \uC5ED\uC0BC\uB3D9" }),
1581
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC6B0\uD3B8\uBC88\uD638 \uB2E4\uC12F\uC790\uB9AC\uB97C \uBAA8\uB450 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
1582
+ /* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC608) 07345, 06232" })
1583
+ ] })
1584
+ ] });
1585
+ };
1586
+ const AddressSearchResult = ({
1587
+ addressSearchList,
1588
+ onChange,
1589
+ searchKeyword,
1590
+ selectedAddress
1591
+ }) => {
1592
+ const [filterList, setFilterList] = React.useState([]);
1593
+ React.useEffect(() => {
1594
+ const filterList2 = addressSearchList.filter(
1595
+ (item) => item.address.includes(searchKeyword) || item.oldAddress.includes(searchKeyword)
1596
+ ) || [];
1597
+ setFilterList(filterList2);
1598
+ }, [addressSearchList, searchKeyword]);
1599
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1600
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$7("guide-title"), children: [
1601
+ "\uCD1D ",
1602
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: filterList.length }),
1603
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1604
+ ] }),
1605
+ filterList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
1606
+ salesFrontendDesignSystem.RadioGroup,
1607
+ {
1608
+ items: filterList.map((item) => ({
1609
+ value: item.address,
1610
+ select: item.address === selectedAddress?.address && item.zipCode === selectedAddress?.zipCode,
1611
+ label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$7("search-result"), children: [
1612
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$7("zipcode"), children: [
1613
+ " ",
1614
+ highlightOnSearchKeyword(item.zipCode, searchKeyword)
1615
+ ] }),
1616
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$7("divider") }),
1617
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$7("address-info"), children: [
1618
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$7("address"), children: highlightOnSearchKeyword(item.address, searchKeyword) }),
1619
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$7("old-address"), children: highlightOnSearchKeyword(item.oldAddress, searchKeyword) })
1620
+ ] })
1621
+ ] }),
1622
+ id: item.address
1623
+ })),
1624
+ className: cx$7("radio-group"),
1625
+ name: "address-search",
1626
+ size: "medium",
1627
+ defaultValue: "",
1628
+ onChange
1629
+ }
1630
+ ),
1631
+ filterList.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1632
+ "`",
1633
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchKeyword }),
1634
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1635
+ ] })
1636
+ ] });
1637
+ };
1638
+ const AddressSearchDetailInput = ({
1639
+ selectedAddress,
1640
+ onDetailChange,
1641
+ step,
1642
+ detailAddressInput
1643
+ }) => {
1644
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1645
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1646
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1647
+ " ",
1648
+ selectedAddress.zipCode
1649
+ ] }),
1650
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1651
+ "|",
1652
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: `${selectedAddress.address}` })
1653
+ ] })
1654
+ ] }),
1655
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1656
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.FormField.Label, { id: "detail", style: { width: "90px" }, children: "\uC0C1\uC138\uC8FC\uC18C" }),
1657
+ /* @__PURE__ */ jsxRuntime.jsx(
1658
+ Input,
1659
+ {
1660
+ placeholder: "\uC0C1\uC138\uC8FC\uC18C \uC785\uB825",
1661
+ onChange: onDetailChange,
1662
+ size: "large",
1663
+ value: detailAddressInput,
1664
+ ...step === "detail-input" && { autoFocus: true }
1665
+ }
1666
+ )
1667
+ ] })
1668
+ ] });
1669
+ };
1670
+ function AddressComponent({ isOpen, onClose, setValue }) {
1671
+ const {
1672
+ onAddressSearchClear,
1673
+ addressSearchKeyword,
1674
+ addressSearchStep,
1675
+ onAddressSearchNext,
1676
+ nextButtonDisabled,
1677
+ detailAddressInput,
1678
+ addressSearchList,
1679
+ onSearch,
1680
+ onKeyUp,
1681
+ onSelectChange,
1682
+ setDetail,
1683
+ search,
1684
+ searchInput,
1685
+ selectedAddress
1686
+ } = useSearchAddress({
1687
+ setValue,
1688
+ onClose,
1689
+ isOpen
1690
+ });
1691
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose, modalSize: "full-screen", children: [
1692
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
1693
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
1694
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC8FC\uC18C \uAC80\uC0C9", showCloseButton: true }),
1695
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
1696
+ /* @__PURE__ */ jsxRuntime.jsx(
1697
+ InputBox,
1698
+ {
1699
+ clearable: true,
1700
+ endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "sub-ui/search", onClick: search }),
1701
+ onClear: onAddressSearchClear,
1702
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1703
+ Input,
1704
+ {
1705
+ ...addressSearchStep !== "detail-input" && { autoFocus: true },
1706
+ onChange: onSearch,
1707
+ onKeyUp,
1708
+ value: searchInput,
1709
+ placeholder: "\uC9C0\uBC88, \uB3C4\uB85C\uBA85, \uAC74\uBB3C\uBA85, \uC6B0\uD3B8\uBC88\uD638 \uC785\uB825",
1710
+ size: "large"
1711
+ }
1712
+ )
1713
+ }
1714
+ ),
1715
+ addressSearchStep === "initial" && /* @__PURE__ */ jsxRuntime.jsx(AddressSearchInitialText, {}),
1716
+ addressSearchStep === "search-result" && /* @__PURE__ */ jsxRuntime.jsx(
1717
+ AddressSearchResult,
1718
+ {
1719
+ onChange: onSelectChange,
1720
+ addressSearchList: addressSearchList || [],
1721
+ searchKeyword: addressSearchKeyword,
1722
+ selectedAddress
1723
+ }
1724
+ ),
1725
+ addressSearchStep === "detail-input" && selectedAddress && /* @__PURE__ */ jsxRuntime.jsx(
1726
+ AddressSearchDetailInput,
1727
+ {
1728
+ selectedAddress,
1729
+ onDetailChange: setDetail,
1730
+ step: addressSearchStep,
1731
+ detailAddressInput
1732
+ }
1733
+ )
1734
+ ] }),
1735
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: addressSearchStep !== "initial" && /* @__PURE__ */ jsxRuntime.jsxs(
1736
+ salesFrontendDesignSystem.Button,
1737
+ {
1738
+ onClick: onAddressSearchNext,
1739
+ variant: "primary",
1740
+ size: "medium",
1741
+ appearance: "filled",
1742
+ width: "full",
1743
+ disabled: nextButtonDisabled,
1744
+ children: [
1745
+ addressSearchStep === "search-result" && "\uB2E4\uC74C(1/2)",
1746
+ addressSearchStep === "detail-input" && "\uD655\uC778(2/2)"
1747
+ ]
1748
+ }
1749
+ ) })
1750
+ ] })
1751
+ ] }) });
1752
+ }
1753
+
1754
+ function useSearchAddress({ setValue, onClose, isOpen }) {
1755
+ const [searchKeyword, setSearchKeyword] = React.useState("");
1756
+ const [step, setStep] = React.useState("initial");
1757
+ const [selectedAddress, setSelectedAddress] = React.useState(null);
1758
+ const [searchInput, setSearchInput] = React.useState("");
1759
+ const [detailAddressInput, setDetailAddressInput] = React.useState("");
1760
+ const { data: addressList } = method.useSearchModalAddressQuery({ searchKeyword });
1761
+ const [nextButtonDisabled, setNextButtonDisabled] = React.useState(false);
1762
+ const onNext = () => {
1763
+ if (step === "search-result") {
1764
+ setStep("detail-input");
1765
+ setNextButtonDisabled(true);
1766
+ } else {
1767
+ setValue({
1768
+ address: selectedAddress?.address || "",
1769
+ oldAddress: selectedAddress?.oldAddress || "",
1770
+ zipCode: selectedAddress?.zipCode || "",
1771
+ detail: detailAddressInput || ""
1772
+ });
1773
+ onClose();
1774
+ }
1775
+ };
1776
+ const onSearch = (e) => {
1777
+ const typeStr = e.target.value;
1778
+ setSearchInput(typeStr);
1779
+ };
1780
+ const search = () => {
1781
+ if (searchInput === "") {
1782
+ onClear();
1783
+ return;
1784
+ }
1785
+ if (searchInput && searchInput.length > 1) {
1786
+ setSearchKeyword(searchInput);
1787
+ setStep("search-result");
1788
+ setSelectedAddress(null);
1789
+ setDetailAddressInput("");
1790
+ setNextButtonDisabled(true);
1791
+ }
1792
+ };
1793
+ const onKeyUp = (e) => {
1794
+ if (e.key === "Enter") {
1795
+ search();
1796
+ }
1797
+ };
1798
+ const onSelectChange = (e) => {
1799
+ const selectedAddress2 = e.target.value;
1800
+ if (selectedAddress2) {
1801
+ const adr = addressList?.find((addr) => {
1802
+ return addr.address === selectedAddress2;
1803
+ });
1804
+ setSelectedAddress(adr || null);
1805
+ setNextButtonDisabled(false);
1806
+ }
1807
+ };
1808
+ const onClear = React.useCallback(() => {
1809
+ setSearchKeyword("");
1810
+ setSearchInput("");
1811
+ setSelectedAddress(null);
1812
+ setDetailAddressInput("");
1813
+ setStep("initial");
1814
+ }, []);
1815
+ const setDetail = (e) => {
1816
+ const detail = e.target.value;
1817
+ setDetailAddressInput(detail);
1818
+ if (detail) {
1819
+ setNextButtonDisabled(false);
1820
+ } else {
1821
+ setNextButtonDisabled(true);
1822
+ }
1823
+ };
1824
+ React.useEffect(() => {
1825
+ if (isOpen) {
1826
+ setSelectedAddress(null);
1827
+ setDetailAddressInput("");
1828
+ setStep("initial");
1829
+ setSearchKeyword("");
1830
+ }
1831
+ }, [isOpen]);
1832
+ return {
1833
+ onAddressSearchClear: onClear,
1834
+ onAddressSearchNext: onNext,
1835
+ addressSearchKeyword: searchKeyword,
1836
+ addressSearchList: addressList,
1837
+ addressSearchStep: step,
1838
+ selectedAddress,
1839
+ addressSearchOnValueChange: onSelectChange,
1840
+ nextButtonDisabled,
1841
+ detailAddressInput,
1842
+ onSearch,
1843
+ onKeyUp,
1844
+ onSelectChange,
1845
+ setDetail,
1846
+ search,
1847
+ searchInput
1848
+ };
1849
+ }
1850
+ const useAddressComponent = () => {
1851
+ const [fullAddress, setFullAddress] = React.useState(null);
1852
+ const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
1853
+ const AddressSearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(AddressComponent, { isOpen, onClose: closeModal, setValue: setFullAddress });
1854
+ return {
1855
+ fullAddress,
1856
+ openModal,
1857
+ AddressSearchComponent
1858
+ };
1859
+ };
1860
+
1861
+ const cx$6 = classNames.bind(styles$5);
1862
+ const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
1863
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$6("grade-section"), children: [
1864
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$6("icon-title"), children: [
1865
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "illust/grade" }),
1866
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "typo-title5 text-body", children: "\uB4F1\uAE09" })
1867
+ ] }),
1868
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "typo-body2 text-body_3", children: "\uC9C1\uC885, \uC6B4\uC804 \uC5EC\uBD80 \uC120\uD0DD\uC2DC \uC790\uB3D9\uC73C\uB85C \uC0B0\uC815\uB429\uB2C8\uB2E4." }),
1869
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$6("grade-list"), children: [
1870
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$6("grade"), children: [
1871
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\uC704\uD5D8\uB4F1\uAE09" }),
1872
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary typo-subtitle3", children: riskGrade || "-" })
1873
+ ] }),
1874
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$6("grade"), children: [
1875
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "\uC785\uC6D0\uB4F1\uAE09" }),
1876
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary typo-subtitle3", children: hospitalizationGrade || "-" })
1877
+ ] })
1878
+ ] })
1879
+ ] });
1880
+ };
1881
+
1882
+ const JOB_SEARCH_TABS = [
1883
+ { value: "jobName", label: "\uC9C1\uC885\uBA85 \uAC80\uC0C9" },
1884
+ { value: "jobCode", label: "\uBD84\uB958\uB85C \uAC80\uC0C9" }
1885
+ ];
1886
+
1887
+ const cx$5 = classNames.bind(styles$6);
1888
+ function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
1889
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("category-section"), children: [
1890
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$5("result-title"), children: [
1891
+ "\uCD1D ",
1892
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: filteredJobs.length }),
1893
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1894
+ ] }),
1895
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "job-selection", size: "small", className: cx$5("job-radio-root"), onToggle: () => {
1896
+ }, children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1897
+ salesFrontendDesignSystem.Accordion.Item,
1898
+ {
1899
+ id: `item-${job.occupationIndustryCode}-${index}-accordion`,
1900
+ children: [
1901
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.HeaderDiv, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Radio.Item, { size: "small", value: job.occupationIndustryCode, onChange: () => onJobSelect(job), children: [
1902
+ highlightOnSearchKeyword(job.occupationIndustryName, searchTerm),
1903
+ "(",
1904
+ job.occupationIndustryCode,
1905
+ ")"
1906
+ ] }) }) }),
1907
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Table, { variant: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
1908
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1909
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1" }),
1910
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24", children: "1\uD589 1\uBC88\uC9F8" }),
1911
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1-2" }),
1912
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24 ", children: "1\uD589 2\uBC88\uC9F8" })
1913
+ ] }),
1914
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1915
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 2" }),
1916
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "d-flex-center-center", children: [
1917
+ "2\uD589 1\uBC88\uC9F8 ",
1918
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
1919
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
1920
+ ] }) })
1921
+ ] })
1922
+ ] }) }) })
1923
+ ]
1924
+ },
1925
+ `item-${job.occupationIndustryCode}-${index}`
1926
+ )) }) }),
1927
+ filteredJobs.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1928
+ "`",
1929
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchTerm }),
1930
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
1931
+ ] })
1932
+ ] }) });
1933
+ }
1934
+
1935
+ const cx$4 = classNames.bind(styles$6);
1936
+ function JobSearchFavorite({ filteredJobs, onJobSelect }) {
1937
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$4("popular-jobs"), children: [
1938
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "\uB9CE\uC774 \uCC3E\uB294 \uC9C1\uC885" }),
1939
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "job-selection", size: "small", className: cx$4("job-radio-root"), children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxRuntime.jsxs(
1940
+ salesFrontendDesignSystem.Accordion.Item,
1941
+ {
1942
+ id: `item-${job.occupationIndustryCode}-${index}`,
1943
+ className: cx$4("accordion-item"),
1944
+ children: [
1945
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.HeaderDiv, { className: cx$4("accordion-header-item"), children: /* @__PURE__ */ jsxRuntime.jsxs(
1946
+ salesFrontendDesignSystem.Radio.Item,
1947
+ {
1948
+ size: "small",
1949
+ value: job.occupationIndustryCode,
1950
+ onChange: () => onJobSelect(job),
1951
+ className: cx$4("radio-item"),
1952
+ children: [
1953
+ job.occupationIndustryName,
1954
+ "(",
1955
+ job.occupationIndustryCode,
1956
+ ")"
1957
+ ]
1958
+ }
1959
+ ) }),
1960
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: "\uD56D\uBAA9 1 \uB0B4\uC6A9" })
1961
+ ]
1962
+ },
1963
+ `item-${job.occupationIndustryCode}-${index}`
1964
+ )) }) })
1965
+ ] }) });
1966
+ }
1967
+
1968
+ const cx$3 = classNames.bind(styles$6);
1969
+ function JobSearchResult({ filteredJobs, onJobSelect, searchTerm }) {
1970
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$3("popular-jobs"), children: [
1971
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$3("result-title"), children: [
1972
+ "\uCD1D ",
1973
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: filteredJobs.length }),
1974
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
1975
+ ] }),
1976
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "job-selection", size: "small", className: cx$3("job-radio-root"), children: filteredJobs.map((job) => /* @__PURE__ */ jsxRuntime.jsxs(
1977
+ salesFrontendDesignSystem.Accordion.Item,
1978
+ {
1979
+ id: `item-${job.occupationIndustryCode}`,
1980
+ children: [
1981
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.HeaderDiv, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ jsxRuntime.jsx(
1982
+ salesFrontendDesignSystem.Radio.Item,
1983
+ {
1984
+ id: `item-${job.occupationIndustryCode}`,
1985
+ size: "small",
1986
+ value: job.occupationIndustryCode,
1987
+ onChange: () => {
1988
+ onJobSelect(job);
1989
+ },
1990
+ children: highlightOnSearchKeyword(job.occupationIndustryName, searchTerm)
1991
+ }
1992
+ ) }) }),
1993
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Table, { variant: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
1994
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
1995
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1" }),
1996
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24", children: "1\uD589 1\uBC88\uC9F8" }),
1997
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1-2" }),
1998
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24 ", children: "1\uD589 2\uBC88\uC9F8" })
1999
+ ] }),
2000
+ /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
2001
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 2" }),
2002
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "d-flex-center-center", children: [
2003
+ "2\uD589 1\uBC88\uC9F8 ",
2004
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
2005
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
2006
+ ] }) })
2007
+ ] })
2008
+ ] }) }) })
2009
+ ]
2010
+ },
2011
+ job.occupationIndustryCode
2012
+ )) }) }),
2013
+ filteredJobs.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2014
+ "`",
2015
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchTerm }),
2016
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
2017
+ ] })
2018
+ ] }) });
2019
+ }
2020
+
2021
+ const { TextField } = salesFrontendDesignSystem.FormField;
2022
+ const cx$2 = classNames.bind(styles$6);
2023
+ const { Option } = salesFrontendDesignSystem.Select;
2024
+ function JobSearch({
2025
+ activeTab,
2026
+ onTabChange,
2027
+ searchTerm,
2028
+ setSearchInput,
2029
+ filteredJobs,
2030
+ onJobSelect,
2031
+ setSearchTerm,
2032
+ searchInput,
2033
+ firstCategory,
2034
+ setFirstCategory,
2035
+ secondCategory,
2036
+ setSecondCategory,
2037
+ firstCategoryList,
2038
+ secondCategoryList
2039
+ }) {
2040
+ const onKeyUp = (e) => {
2041
+ if (e.key === "Enter") {
2042
+ setSearchTerm(searchInput);
2043
+ }
2044
+ };
2045
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2046
+ /* @__PURE__ */ jsxRuntime.jsx(
2047
+ salesFrontendDesignSystem.Tab.Root,
2048
+ {
2049
+ defaultValue: activeTab,
2050
+ onValueChange: onTabChange,
2051
+ scroll: "fixed",
2052
+ size: "small",
2053
+ variant: "sub",
2054
+ style: { gap: 0, overflow: "visible" },
2055
+ children: JOB_SEARCH_TABS.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Tab.Item, { value: tab.value, children: tab.label }, tab.value))
2056
+ }
2057
+ ),
2058
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2059
+ activeTab === "jobName" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("favorite-jobs-section"), children: [
2060
+ /* @__PURE__ */ jsxRuntime.jsx(
2061
+ TextField,
2062
+ {
2063
+ placeholder: "\uC9C1\uC885\uBA85 \uAC80\uC0C9",
2064
+ value: searchInput,
2065
+ onKeyUp,
2066
+ onChange: (e) => setSearchInput(e.target.value),
2067
+ className: styles$6.searchInput,
2068
+ size: "medium",
2069
+ rootProps: {
2070
+ endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "sub-ui/search", onClick: () => setSearchTerm(searchInput) }),
2071
+ onClear: () => {
2072
+ setSearchTerm("");
2073
+ setSearchInput("");
2074
+ }
2075
+ }
2076
+ }
2077
+ ),
2078
+ !searchTerm && /* @__PURE__ */ jsxRuntime.jsx(JobSearchFavorite, { filteredJobs, onJobSelect }),
2079
+ searchTerm && /* @__PURE__ */ jsxRuntime.jsx(JobSearchResult, { filteredJobs, onJobSelect, searchTerm })
2080
+ ] }),
2081
+ activeTab === "jobCode" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("select-jobs-section"), children: [
2082
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("category-section"), children: [
2083
+ /* @__PURE__ */ jsxRuntime.jsx(
2084
+ salesFrontendDesignSystem.Select,
2085
+ {
2086
+ name: "first_category",
2087
+ onChange: (value) => {
2088
+ setFirstCategory(value);
2089
+ setSecondCategory("");
2090
+ },
2091
+ placeholder: "\uB300\uBD84\uB958 \uC120\uD0DD",
2092
+ rootProps: {
2093
+ style: {
2094
+ // width: '300px'
2095
+ }
2096
+ },
2097
+ size: "large",
2098
+ value: firstCategory,
2099
+ children: firstCategoryList.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(Option, { value: option.occupationIndustryCode, children: option.occupationIndustryName }, `${index}-${option.occupationIndustryCode}`))
2100
+ }
2101
+ ),
2102
+ /* @__PURE__ */ jsxRuntime.jsx(
2103
+ salesFrontendDesignSystem.Select,
2104
+ {
2105
+ name: "second_category",
2106
+ onChange: setSecondCategory,
2107
+ placeholder: "\uC911\uBD84\uB958 \uC120\uD0DD",
2108
+ rootProps: {
2109
+ style: {
2110
+ // width: '300px'
2111
+ }
2112
+ },
2113
+ size: "large",
2114
+ value: secondCategory,
2115
+ disabled: !firstCategory,
2116
+ children: secondCategoryList.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(Option, { value: option.occupationIndustryCode, children: option.occupationIndustryName }, `${index}-${option.occupationIndustryCode}`))
2117
+ }
2118
+ )
2119
+ ] }),
2120
+ firstCategory && secondCategory && /* @__PURE__ */ jsxRuntime.jsx(JobSearchCategory, { filteredJobs, onJobSelect, searchTerm })
2121
+ ] })
2122
+ ] })
2123
+ ] });
2124
+ }
2125
+
2126
+ const initData = [
2127
+ {
2128
+ occupationIndustryCode: "430101",
2129
+ occupationIndustryName: "\uD68C\uC0AC \uC0AC\uBB34\uC9C1 \uC885\uC0AC\uC790",
2130
+ occupationTypeCode: null,
2131
+ historySequence: 0
2132
+ },
2133
+ {
2134
+ occupationIndustryCode: "400301",
2135
+ occupationIndustryName: "\uACBD\uC601\uC9C0\uC6D0 \uC0AC\uBB34\uC9C1 \uAD00\uB9AC\uC790",
2136
+ occupationTypeCode: null,
2137
+ historySequence: 0
2138
+ },
2139
+ {
2140
+ occupationIndustryCode: "510201",
2141
+ occupationIndustryName: "\uC804\uC5C5\uC8FC\uBD80",
2142
+ occupationTypeCode: null,
2143
+ historySequence: 0
2144
+ },
2145
+ {
2146
+ occupationIndustryCode: "442501",
2147
+ occupationIndustryName: "\uC8FC\uBC29\uC7A5 \uBC0F \uC870\uB9AC\uC0AC(\uC120\uBC15 \uC870\uB9AC\uC0AC \uC81C\uC678)",
2148
+ occupationTypeCode: null,
2149
+ historySequence: 0
2150
+ },
2151
+ {
2152
+ occupationIndustryCode: "450303",
2153
+ occupationIndustryName: "\uBCF4\uD5D8\uC124\uACC4\uC0AC(\uB2F9\uC0AC)",
2154
+ occupationTypeCode: null,
2155
+ historySequence: 0
2156
+ }
2157
+ ];
2158
+ const useJobSearch = () => {
2159
+ const [activeTab, setActiveTab] = React.useState(JOB_SEARCH_TABS[0]?.value ?? "");
2160
+ const [selectedJob, setSelectedJob] = React.useState(null);
2161
+ const [searchTerm, setSearchTerm] = React.useState("");
2162
+ const [searchInput, setSearchInput] = React.useState("");
2163
+ const handleJobSelect = (job) => {
2164
+ setSelectedJob(job);
2165
+ };
2166
+ const [firstCategory, setFirstCategory] = React.useState("");
2167
+ const [secondCategory, setSecondCategory] = React.useState("");
2168
+ const [jobList, setJobList] = React.useState(initData);
2169
+ const [firstCategoryList, setFirstCategoryList] = React.useState([]);
2170
+ const [secondCategoryList, setSecondCategoryList] = React.useState([]);
2171
+ const { data } = method.useSearchOccupationQuery({
2172
+ occupationMajorCategoryCode: firstCategory,
2173
+ occupationSearchTypeCode: searchTerm ? "4" : "3",
2174
+ occupationSubCategoryCode: secondCategory,
2175
+ searchOccupationIndustryName: searchTerm
2176
+ });
2177
+ const { data: firstCategoryData } = method.useSearchOccupationQuery({
2178
+ occupationMajorCategoryCode: "",
2179
+ occupationSearchTypeCode: "1",
2180
+ occupationSubCategoryCode: "",
2181
+ searchOccupationIndustryName: ""
2182
+ });
2183
+ const { data: secondCategoryData } = method.useSearchOccupationQuery({
2184
+ occupationMajorCategoryCode: firstCategory,
2185
+ occupationSearchTypeCode: "2",
2186
+ occupationSubCategoryCode: "",
2187
+ searchOccupationIndustryName: ""
2188
+ });
2189
+ React.useEffect(() => {
2190
+ if (data && searchTerm && activeTab === "jobName") {
2191
+ const filteredJobs = data.data.occupationList.filter((job) => job.occupationIndustryName.includes(searchTerm));
2192
+ setJobList(filteredJobs);
2193
+ } else if (!data && searchTerm && activeTab === "jobName") {
2194
+ setJobList([]);
2195
+ } else if (!searchTerm && activeTab === "jobName") {
2196
+ setJobList(initData);
2197
+ } else if (activeTab === "jobCode" && firstCategory && secondCategory) {
2198
+ setJobList(data?.data.occupationList || []);
2199
+ }
2200
+ }, [searchTerm, data, firstCategory, secondCategory, secondCategoryData, activeTab]);
2201
+ React.useEffect(() => {
2202
+ console.log("jobList", jobList);
2203
+ }, [jobList]);
2204
+ React.useEffect(() => {
2205
+ if (firstCategoryData) {
2206
+ setFirstCategoryList(firstCategoryData.data.occupationList);
2207
+ }
2208
+ }, [firstCategoryData]);
2209
+ React.useEffect(() => {
2210
+ if (secondCategoryData) {
2211
+ setSecondCategoryList(secondCategoryData.data.occupationList);
2212
+ }
2213
+ }, [secondCategoryData]);
2214
+ return {
2215
+ activeTab,
2216
+ setActiveTab,
2217
+ selectedJob,
2218
+ searchTerm,
2219
+ setSearchTerm,
2220
+ handleJobSelect,
2221
+ filteredJobs: jobList,
2222
+ searchInput,
2223
+ setSearchInput,
2224
+ firstCategory,
2225
+ setFirstCategory,
2226
+ secondCategory,
2227
+ setSecondCategory,
2228
+ secondCategoryList,
2229
+ firstCategoryList
2230
+ };
2231
+ };
2232
+ function useJobSearchModal() {
2233
+ const {
2234
+ activeTab,
2235
+ setActiveTab,
2236
+ searchTerm,
2237
+ setSearchTerm,
2238
+ filteredJobs,
2239
+ handleJobSelect,
2240
+ selectedJob,
2241
+ searchInput,
2242
+ setSearchInput,
2243
+ firstCategory,
2244
+ setFirstCategory,
2245
+ secondCategory,
2246
+ setSecondCategory,
2247
+ firstCategoryList,
2248
+ secondCategoryList
2249
+ } = useJobSearch();
2250
+ const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
2251
+ const onTabChange = (value) => {
2252
+ setSearchTerm("");
2253
+ setFirstCategory("");
2254
+ setSecondCategory("");
2255
+ setActiveTab(value);
2256
+ };
2257
+ return {
2258
+ JobSearchModal: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
2259
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
2260
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
2261
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885 \uAC80\uC0C9", showCloseButton: true }),
2262
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { raw: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2263
+ JobSearch,
2264
+ {
2265
+ firstCategory,
2266
+ firstCategoryList,
2267
+ secondCategoryList,
2268
+ setFirstCategory,
2269
+ secondCategory,
2270
+ activeTab,
2271
+ onTabChange,
2272
+ searchTerm,
2273
+ setSearchInput,
2274
+ filteredJobs: filteredJobs || [],
2275
+ onJobSelect: handleJobSelect,
2276
+ searchInput,
2277
+ setSearchTerm,
2278
+ setSecondCategory
2279
+ }
2280
+ ) }),
2281
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: closeModal, children: "\uD655\uC778" }) })
2282
+ ] })
2283
+ ] }),
2284
+ JobSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(
2285
+ JobSearch,
2286
+ {
2287
+ firstCategoryList,
2288
+ secondCategoryList,
2289
+ firstCategory,
2290
+ setFirstCategory,
2291
+ secondCategory,
2292
+ setSecondCategory,
2293
+ activeTab,
2294
+ onTabChange,
2295
+ searchTerm,
2296
+ setSearchInput,
2297
+ filteredJobs: filteredJobs || [],
2298
+ onJobSelect: handleJobSelect,
2299
+ searchInput,
2300
+ setSearchTerm
2301
+ }
2302
+ ),
2303
+ isJobSearchOpen: isOpen,
2304
+ openJobSearchModal: openModal,
2305
+ closeJobSearchModal: closeModal,
2306
+ selectedJob
2307
+ };
2308
+ }
2309
+
2310
+ const cx$1 = classNames.bind(styles$7);
2311
+ function VehicleSearch({ vehicles, onVehicleSelect }) {
2312
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$1("vehicle-search-section"), children: [
2313
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "\uC6B4\uC804 \uCC28\uC885" }),
2314
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "vehicle-selection", size: "small", className: cx$1("vehicle-radio-root"), children: vehicles.map((vehicle, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2315
+ salesFrontendDesignSystem.Radio.Item,
2316
+ {
2317
+ id: `item-${vehicle.integrationCodeValue}`,
2318
+ size: "small",
2319
+ value: vehicle.integrationCodeValue || "",
2320
+ onChange: (e) => {
2321
+ const { value } = e.target;
2322
+ console.log(e.target.value);
2323
+ const selected = vehicles.find((v) => v.integrationCodeValue === value);
2324
+ if (selected) {
2325
+ onVehicleSelect(selected);
2326
+ }
2327
+ },
2328
+ className: cx$1("item"),
2329
+ children: [
2330
+ vehicle.integrationCodeValueName,
2331
+ "(",
2332
+ vehicle.integrationCodeValue,
2333
+ ")"
2334
+ ]
2335
+ },
2336
+ `item-${vehicle.integrationCodeValue}-${index}`
2337
+ )) })
2338
+ ] });
2339
+ }
2340
+
2341
+ const useVehicleSearch = () => {
2342
+ const [selectedVehicle, setSelectedVehicle] = React.useState();
2343
+ const { data } = method.useSearchVehicleQuery();
2344
+ return {
2345
+ VehicleSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(VehicleSearch, { vehicles: data?.data?.vehicleTypeList || [], onVehicleSelect: setSelectedVehicle }),
2346
+ selectedVehicle,
2347
+ setSelectedVehicle,
2348
+ vehicleList: data
2349
+ };
2350
+ };
2351
+
2352
+ const useJobVehicleSearch = () => {
2353
+ const [rightPanelView, setRightPanelView] = React.useState("jobSearch");
2354
+ const [riskGrade, setRiskGrade] = React.useState("");
2355
+ const [hospitalizationGrade, setHospitalizationGrade] = React.useState("");
2356
+ const { selectedJob, JobSearchComponent } = useJobSearchModal();
2357
+ const { selectedVehicle, VehicleSearchComponent } = useVehicleSearch();
2358
+ React.useEffect(() => {
2359
+ if (selectedJob && selectedVehicle) {
2360
+ setRiskGrade("\uC77C\uBC18(\uBE44\uC704\uD5D8\uC9C1)(0)");
2361
+ setHospitalizationGrade("\uC77C\uBC18\uC785\uC6D0(\uBE44\uC704\uD5D8\uC9C1)(0)");
2362
+ }
2363
+ }, [selectedJob, selectedVehicle]);
2364
+ return {
2365
+ selectedVehicle,
2366
+ rightPanelView,
2367
+ setRightPanelView,
2368
+ selectedJob,
2369
+ JobSearch: JobSearchComponent,
2370
+ VehicleSearch: VehicleSearchComponent,
2371
+ riskGrade,
2372
+ hospitalizationGrade
2373
+ };
2374
+ };
2375
+
2376
+ const cx = classNames.bind(styles$5);
2377
+ function useJobVehicleSearchModal() {
2378
+ const {
2379
+ selectedVehicle,
2380
+ rightPanelView,
2381
+ setRightPanelView,
2382
+ selectedJob,
2383
+ JobSearch,
2384
+ VehicleSearch,
2385
+ riskGrade,
2386
+ hospitalizationGrade
2387
+ } = useJobVehicleSearch();
2388
+ const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState({ initialValue: true });
2389
+ const validate = () => {
2390
+ console.log({ selectedJob, selectedVehicle });
2391
+ if (!selectedJob && !selectedVehicle) {
2392
+ return salesFrontendDesignSystem.ModalUtils.alert(
2393
+ "\uC9C1\uC885\uACFC \uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885\uC744 \uBAA8\uB450 \uC120\uD0DD\uD574\uC57C \uB4F1\uAE09 \uC0B0\uC815\uC774 \uAC00\uB2A5\uD569\uB2C8\uB2E4.",
2394
+ "\uC9C1\uC885\uACFC \uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694",
2395
+ {
2396
+ modalSize: "small"
2397
+ }
2398
+ );
2399
+ }
2400
+ if (!selectedJob) {
2401
+ return salesFrontendDesignSystem.ModalUtils.alert("\uC9C1\uC885\uC744 \uC120\uD0DD\uD574\uC57C \uB4F1\uAE09 \uC0B0\uC815\uC774 \uAC00\uB2A5\uD569\uB2C8\uB2E4.", "\uC9C1\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694", {
2402
+ modalSize: "small"
2403
+ });
2404
+ }
2405
+ if (!selectedVehicle) {
2406
+ return salesFrontendDesignSystem.ModalUtils.alert("\uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885\uC744 \uC120\uD0DD\uD574\uC57C \uB4F1\uAE09 \uC0B0\uC815\uC774 \uAC00\uB2A5\uD569\uB2C8\uB2E4.", "\uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694", {
2407
+ modalSize: "small"
2408
+ });
2409
+ }
2410
+ closeModal();
2411
+ };
2412
+ return {
2413
+ selectedJob,
2414
+ selectedVehicle,
2415
+ riskGrade,
2416
+ hospitalizationGrade,
2417
+ openJobVehicleModal: openModal,
2418
+ JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
2419
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
2420
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
2421
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885\xB7\uC6B4\uC804\uCC28\uC885 \uAC80\uC0C9", showCloseButton: true }),
2422
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { className: cx("job-vehicle-search-modal"), raw: true, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2423
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("left-panel"), children: [
2424
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("card-section"), children: [
2425
+ /* @__PURE__ */ jsxRuntime.jsxs(
2426
+ "div",
2427
+ {
2428
+ className: cx("card-menu", { "card-selected": rightPanelView === "jobSearch" }),
2429
+ onClick: () => setRightPanelView("jobSearch"),
2430
+ children: [
2431
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("card-title"), children: [
2432
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "illust/job", className: cx("card-icon") }),
2433
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("card-text", "typo-title5", "text-body"), children: "\uC9C1\uC885" }),
2434
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "sub-ui/arrow/right" })
2435
+ ] }),
2436
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typo-body2 text-body_2", children: selectedJob ? selectedJob.occupationIndustryName : "\uBBF8\uC120\uD0DD" })
2437
+ ]
2438
+ }
2439
+ ),
2440
+ /* @__PURE__ */ jsxRuntime.jsxs(
2441
+ "div",
2442
+ {
2443
+ className: cx("card-menu", { "card-selected": rightPanelView === "vehicleSelection" }),
2444
+ onClick: () => setRightPanelView("vehicleSelection"),
2445
+ children: [
2446
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("card-title"), children: [
2447
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "illust/vehicle", className: cx("card-icon") }),
2448
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("card-text", "typo-title5", "text-body"), children: "\uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885" }),
2449
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Icon, { name: "sub-ui/arrow/right" })
2450
+ ] }),
2451
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "typo-body2 text-body_2", children: [
2452
+ selectedVehicle?.integrationCodeValueName,
2453
+ selectedVehicle?.integrationCodeValue || "\uBBF8\uC120\uD0DD"
2454
+ ] })
2455
+ ]
2456
+ }
2457
+ )
2458
+ ] }),
2459
+ /* @__PURE__ */ jsxRuntime.jsx(JobVehicleSearchGrade, { riskGrade, hospitalizationGrade })
2460
+ ] }),
2461
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
2462
+ ] }) }),
2463
+ /* @__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" }) })
2464
+ ] })
2465
+ ] })
2466
+ };
2467
+ }
2468
+
1551
2469
  exports.Attachment = Attachment;
1552
2470
  exports.DebugTool = DebugTool;
1553
2471
  exports.FormCheckbox = FormCheckbox;
@@ -1559,6 +2477,9 @@ exports.FormTextField = FormTextField;
1559
2477
  exports.StepIndicator = StepIndicator;
1560
2478
  exports.resize = resize;
1561
2479
  exports.testSignatureBase64Data = testSignatureBase64Data;
2480
+ exports.useAddressComponent = useAddressComponent;
1562
2481
  exports.useCamera = useCamera;
1563
2482
  exports.useCanvasPaint = useCanvasPaint;
2483
+ exports.useJobVehicleSearchModal = useJobVehicleSearchModal;
2484
+ exports.useSearchAddress = useSearchAddress;
1564
2485
  //# sourceMappingURL=index.cjs.js.map