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