sales-frontend-components 0.0.87 → 0.0.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -258,11 +258,17 @@ declare function useJobVehicleSearchModal(): {
258
258
  JobVehicleSearchModalComponent: react_jsx_runtime.JSX.Element;
259
259
  };
260
260
 
261
- interface JobSearchModalProps {
262
- isOpen: boolean;
263
- onClose: () => void;
264
- }
265
- declare const JobSearchModal: React__default.FC<JobSearchModalProps>;
261
+ declare function useJobSearchModal(): {
262
+ JobSearchModal: react_jsx_runtime.JSX.Element;
263
+ JobSearchComponent: react_jsx_runtime.JSX.Element;
264
+ isJobSearchOpen: boolean;
265
+ openJobSearchModal: () => void;
266
+ closeJobSearchModal: () => void;
267
+ selectedJob: OccupationResponseDto | null;
268
+ selectedJobDetail: any;
269
+ resetJobSearch: () => void;
270
+ setSelectedJob: React$1.Dispatch<React$1.SetStateAction<OccupationResponseDto | null>>;
271
+ };
266
272
 
267
273
  declare const CustomerSearch: ({ onSelect }: CustomerSearchProps) => react_jsx_runtime.JSX.Element;
268
274
 
@@ -339,5 +345,5 @@ declare const useRemoteIdentityVerificationPopup: (config: UseRemoteIdentityVeri
339
345
  isCreatingUrl: boolean;
340
346
  };
341
347
 
342
- export { Attachment, BankStockSearchModal, CustomerSearch, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobSearchModal, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobVehicleSearchModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress };
348
+ export { Attachment, BankStockSearchModal, CustomerSearch, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobSearchModal, useJobVehicleSearchModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress };
343
349
  export type { AttachedPhoto, AttachmentProps, BankStockItem, BankStockSearchModalProps, DownloadProps, PaintProps, Pen, RemoteIdentityVerificationSuccess, RivUrlParams, StepIndicatorProps, StepItem, UseRemoteIdentityVerificationProps, VerificationResponse, cameraItemType, cameraOptions };
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useController } from 'react-hook-form';
3
- import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Accordion, Radio, Table, Button, FormField, Select, Tab, useModalState, Modal, SegmentGroup, ModalUtils, FormCore, RadioGroup, useDropDown, List, ListItem, Loading } from 'sales-frontend-design-system';
3
+ import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Table, Accordion, Radio, FormField, Select, Tab, useModalState, Modal, Button, SegmentGroup, ModalUtils, FormCore, RadioGroup, useDropDown, List, ListItem, Loading } from 'sales-frontend-design-system';
4
4
  import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
5
- import { useSearchOccupationDetailQuery, useSearchOccupationQuery, useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchOrganizationQuery, useSearchEmployeeProfileQuery, useSearchVehicleQuery, useSearchCustomerListQuery, getRemoteIdentityVerificationSystemToken } from 'sales-frontend-api/method';
5
+ import { useSearchOccupationDetailQuery, useSearchOccupationQuery, useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchOrganizationQuery, useSearchEmployeeProfileQuery, useSearchVehicleQuery, useSearchRiskGradeQuery, useSearchCustomerListQuery, getRemoteIdentityVerificationSystemToken } from 'sales-frontend-api/method';
6
6
  import { IconMainUiSearch, IconIllustCamera, IconGraphicsBankHsbc, IconGraphicsBankKebHana, IconGraphicsBankScJeil, IconGraphicsBankGyeongnam, IconGraphicsBankGwangju, IconGraphicsBankKukmin, IconGraphicsBankKiup, IconGraphicsBankJiyeokNonghyeop, IconGraphicsBankNhNonghyeop, IconGraphicsBankDaegu, IconGraphicsBankBusan, IconGraphicsBankSanlim, IconGraphicsBankSaneop, IconGraphicsBankSaemaulGeumgo, IconGraphicsBankSuhyeop, IconGraphicsBankSinhan, IconGraphicsBankSinhyeop, IconGraphicsBankOehwan, IconGraphicsBankWoori, IconGraphicsBankPost, IconGraphicsBankJeochuk, IconGraphicsBankJeonbuk, IconGraphicsBankJeju, IconGraphicsBankKakaoBank, IconGraphicsBankKBank, IconGraphicsBankHankookCity, IconGraphicsStockDbGeumyungTujajeungkwon, IconGraphicsStockKbJeungkwon, IconGraphicsStockNhWooriTujajeungkwon, IconGraphicsStockNhTujajeungkwon, IconGraphicsStockSkJeungkwon, IconGraphicsStockGyoboJeungkwon, IconGraphicsStockDaesinJeungkwon, IconGraphicsStockMeritzJeungkwon, IconGraphicsStockMiraeAssetJeungkwon, IconGraphicsStockBugukJeungkwon, IconGraphicsStockSamsungJeungkwon, IconGraphicsStockSinyeongJeungkwon, IconGraphicsStockSinhanTujajeungkwon, IconGraphicsStockYuantaJeungkwon, IconGraphicsStockYujinTujajeungkwon, IconGraphicsStockKiwoomJeungkwon, IconGraphicsStockHanaGeumyungTujajeungkwon, IconGraphicsStockHiTujajeungkwon, IconGraphicsStockHankookJeungkwonGeumyung, IconGraphicsStockHankookTujajeungkwon, IconGraphicsStockHanwhaTujajeungkwon, IconGraphicsStockHyundaiChaJeungkwon, IconGraphicsStockHochulEopsum, IconGraphicsFeedbackEmpty, IconIllustGrade, IconIllustJob, IconSubUiArrowRight, IconIllustVehicle } from 'sales-frontend-assets';
7
7
  import styles from './modal/pre-standard/job-search-modal/job-search-modal.module.scss';
8
8
  import styles$1 from './step-indicator/step-indicator.module.scss';
@@ -61,11 +61,6 @@ const FormDatePicker = ({
61
61
  }) => {
62
62
  const { field, fieldState } = useController({ name, control, disabled, defaultValue });
63
63
  const [selected, setSelected] = React.useState();
64
- React.useEffect(() => {
65
- if (field.value) {
66
- setSelected(field.value);
67
- }
68
- }, [defaultValue]);
69
64
  React.useEffect(() => {
70
65
  if (field.value !== selected) {
71
66
  setSelected(field.value);
@@ -94,18 +89,25 @@ const FormDateRangePicker = ({
94
89
  defaultValue,
95
90
  ...props
96
91
  }) => {
97
- const { field, fieldState } = useController({ name, control, disabled, defaultValue });
92
+ const { field, fieldState } = useController({
93
+ name,
94
+ control,
95
+ disabled,
96
+ defaultValue
97
+ });
98
98
  const [selected, setSelected] = React.useState();
99
99
  React.useEffect(() => {
100
- if (field.value) {
100
+ if (field.value && !selected) {
101
101
  setSelected(field.value);
102
102
  }
103
- }, [defaultValue]);
104
- React.useEffect(() => {
105
- if (selected && field.value.startDate.getTime() === selected.startDate?.getTime() && field.value.endDate.getTime() === selected.endDate?.getTime()) {
106
- return;
103
+ try {
104
+ if (field.value && selected && (field.value.startDate.getTime() !== selected.startDate?.getTime() || field.value.endDate.getTime() !== selected.endDate?.getTime())) {
105
+ setSelected(field.value);
106
+ console.warn(field.value, selected);
107
+ }
108
+ } catch (e) {
109
+ console.log(e);
107
110
  }
108
- setSelected(field.value);
109
111
  }, [field.value]);
110
112
  return /* @__PURE__ */ jsx(
111
113
  DateRangePicker,
@@ -234,58 +236,10 @@ const highlightOnSearchKeyword$1 = (originalText, targetString) => {
234
236
  return originalText;
235
237
  };
236
238
 
237
- const cx$e = classNames.bind(styles);
238
- function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
239
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cx$e("category-section"), children: [
240
- /* @__PURE__ */ jsxs("p", { className: cx$e("result-title"), children: [
241
- "\uCD1D ",
242
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: filteredJobs.length }),
243
- "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
244
- ] }),
245
- /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsx(Radio.Root, { name: "job-selection", size: "small", className: cx$e("job-radio-root"), onToggle: () => {
246
- }, children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxs(
247
- Accordion.Item,
248
- {
249
- id: `item-${job.occupationIndustryCode}-${index}-accordion`,
250
- children: [
251
- /* @__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: [
252
- highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm),
253
- "(",
254
- job.occupationIndustryCode,
255
- ")"
256
- ] }) }) }),
257
- /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx(Table, { variant: "horizontal", children: /* @__PURE__ */ jsxs("tbody", { children: [
258
- /* @__PURE__ */ jsxs("tr", { children: [
259
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 1" }),
260
- /* @__PURE__ */ jsx("td", { className: "px-24", children: "1\uD589 1\uBC88\uC9F8" }),
261
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 1-2" }),
262
- /* @__PURE__ */ jsx("td", { className: "px-24 ", children: "1\uD589 2\uBC88\uC9F8" })
263
- ] }),
264
- /* @__PURE__ */ jsxs("tr", { children: [
265
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 2" }),
266
- /* @__PURE__ */ jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxs("p", { className: "d-flex-center-center", children: [
267
- "2\uD589 1\uBC88\uC9F8 ",
268
- /* @__PURE__ */ jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
269
- /* @__PURE__ */ jsx(Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
270
- ] }) })
271
- ] })
272
- ] }) }) })
273
- ]
274
- },
275
- `item-${job.occupationIndustryCode}-${index}`
276
- )) }) }),
277
- filteredJobs.length === 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
278
- "`",
279
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchTerm }),
280
- "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
281
- ] })
282
- ] }) });
283
- }
284
-
285
239
  function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
286
240
  const { data: detail } = useSearchOccupationDetailQuery({
287
241
  occupationIndustryCode,
288
- occupationIndustryTypeCode: occupationTypeCode
242
+ occupationIndustryTypeCode: occupationTypeCode || "1"
289
243
  });
290
244
  if (!detail || !detail.data) {
291
245
  return null;
@@ -349,6 +303,45 @@ function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
349
303
  ] }) }) });
350
304
  }
351
305
 
306
+ const cx$e = classNames.bind(styles);
307
+ function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
308
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cx$e("category-section"), children: [
309
+ /* @__PURE__ */ jsxs("p", { className: cx$e("result-title"), children: [
310
+ "\uCD1D ",
311
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: filteredJobs.length }),
312
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
313
+ ] }),
314
+ /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsx(Radio.Root, { name: "job-selection", size: "small", className: cx$e("job-radio-root"), onToggle: () => {
315
+ }, children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxs(
316
+ Accordion.Item,
317
+ {
318
+ id: `item-${job.occupationIndustryCode}-${index}-accordion`,
319
+ children: [
320
+ /* @__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: [
321
+ highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm),
322
+ "(",
323
+ job.occupationIndustryCode,
324
+ ")"
325
+ ] }) }) }),
326
+ /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx(
327
+ JobSearchDetail,
328
+ {
329
+ occupationTypeCode: job.occupationTypeCode || "",
330
+ occupationIndustryCode: job.occupationIndustryCode
331
+ }
332
+ ) })
333
+ ]
334
+ },
335
+ `item-${job.occupationIndustryCode}-${index}`
336
+ )) }) }),
337
+ filteredJobs.length === 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
338
+ "`",
339
+ /* @__PURE__ */ jsx("span", { className: "text-primary", children: searchTerm }),
340
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
341
+ ] })
342
+ ] }) });
343
+ }
344
+
352
345
  const cx$d = classNames.bind(styles);
353
346
  function JobSearchFavorite({ filteredJobs, onJobSelect }) {
354
347
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cx$d("popular-jobs"), children: [
@@ -449,7 +442,8 @@ function JobSearch({
449
442
  secondCategory,
450
443
  setSecondCategory,
451
444
  firstCategoryList,
452
- secondCategoryList
445
+ secondCategoryList,
446
+ isLoading
453
447
  }) {
454
448
  const onKeyUp = (e) => {
455
449
  if (e.key === "Enter") {
@@ -490,7 +484,7 @@ function JobSearch({
490
484
  }
491
485
  ),
492
486
  !searchTerm && /* @__PURE__ */ jsx(JobSearchFavorite, { filteredJobs, onJobSelect }),
493
- searchTerm && /* @__PURE__ */ jsx(JobSearchResult, { filteredJobs, onJobSelect, searchTerm })
487
+ searchTerm && !isLoading && /* @__PURE__ */ jsx(JobSearchResult, { filteredJobs, onJobSelect, searchTerm })
494
488
  ] }),
495
489
  activeTab === "jobCode" && /* @__PURE__ */ jsxs("div", { className: cx$b("select-jobs-section"), children: [
496
490
  /* @__PURE__ */ jsxs("div", { className: cx$b("category-section"), children: [
@@ -531,7 +525,7 @@ function JobSearch({
531
525
  }
532
526
  )
533
527
  ] }),
534
- firstCategory && secondCategory && /* @__PURE__ */ jsx(JobSearchCategory, { filteredJobs, onJobSelect, searchTerm })
528
+ firstCategory && secondCategory && !isLoading && /* @__PURE__ */ jsx(JobSearchCategory, { filteredJobs, onJobSelect, searchTerm })
535
529
  ] })
536
530
  ] })
537
531
  ] });
@@ -582,7 +576,12 @@ const useJobSearch = () => {
582
576
  const [jobList, setJobList] = useState(initData);
583
577
  const [firstCategoryList, setFirstCategoryList] = useState([]);
584
578
  const [secondCategoryList, setSecondCategoryList] = useState([]);
585
- const { data } = useSearchOccupationQuery({
579
+ const { data: detail } = useSearchOccupationDetailQuery({
580
+ occupationIndustryCode: selectedJob?.occupationIndustryCode || "",
581
+ occupationIndustryTypeCode: "1"
582
+ });
583
+ const selectedJobDetail = detail?.data;
584
+ const { data, isLoading } = useSearchOccupationQuery({
586
585
  occupationMajorCategoryCode: firstCategory,
587
586
  occupationSearchTypeCode: searchTerm ? "4" : "3",
588
587
  occupationSubCategoryCode: secondCategory,
@@ -600,7 +599,17 @@ const useJobSearch = () => {
600
599
  occupationSubCategoryCode: "",
601
600
  searchOccupationIndustryName: ""
602
601
  });
602
+ const reset = () => {
603
+ setSearchInput("");
604
+ setSearchTerm("");
605
+ setFirstCategory("");
606
+ setSecondCategory("");
607
+ };
603
608
  useEffect(() => {
609
+ reset();
610
+ }, [activeTab]);
611
+ useEffect(() => {
612
+ setSelectedJob(null);
604
613
  if (data && searchTerm && activeTab === "jobName") {
605
614
  const filteredJobs = data.data.occupationList.filter((job) => job.occupationIndustryName.includes(searchTerm));
606
615
  setJobList(filteredJobs);
@@ -612,9 +621,6 @@ const useJobSearch = () => {
612
621
  setJobList(data?.data.occupationList || []);
613
622
  }
614
623
  }, [searchTerm, data, firstCategory, secondCategory, secondCategoryData, activeTab]);
615
- useEffect(() => {
616
- console.log("jobList", jobList);
617
- }, [jobList]);
618
624
  useEffect(() => {
619
625
  if (firstCategoryData) {
620
626
  setFirstCategoryList(firstCategoryData.data.occupationList);
@@ -629,6 +635,7 @@ const useJobSearch = () => {
629
635
  activeTab,
630
636
  setActiveTab,
631
637
  selectedJob,
638
+ setSelectedJob,
632
639
  searchTerm,
633
640
  setSearchTerm,
634
641
  handleJobSelect,
@@ -640,7 +647,10 @@ const useJobSearch = () => {
640
647
  secondCategory,
641
648
  setSecondCategory,
642
649
  secondCategoryList,
643
- firstCategoryList
650
+ firstCategoryList,
651
+ reset,
652
+ isLoading,
653
+ selectedJobDetail
644
654
  };
645
655
  };
646
656
  function useJobSearchModal() {
@@ -659,15 +669,23 @@ function useJobSearchModal() {
659
669
  secondCategory,
660
670
  setSecondCategory,
661
671
  firstCategoryList,
662
- secondCategoryList
672
+ secondCategoryList,
673
+ setSelectedJob,
674
+ selectedJobDetail,
675
+ reset,
676
+ isLoading
663
677
  } = useJobSearch();
664
678
  const { isOpen, openModal, closeModal } = useModalState();
665
679
  const onTabChange = (value) => {
666
- setSearchTerm("");
667
- setFirstCategory("");
668
- setSecondCategory("");
680
+ reset();
669
681
  setActiveTab(value);
670
682
  };
683
+ const openInitModal = () => {
684
+ reset();
685
+ setSelectedJob(null);
686
+ setActiveTab("jobName");
687
+ openModal();
688
+ };
671
689
  return {
672
690
  JobSearchModal: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
673
691
  /* @__PURE__ */ jsx(Modal.Overlay, {}),
@@ -689,10 +707,22 @@ function useJobSearchModal() {
689
707
  onJobSelect: handleJobSelect,
690
708
  searchInput,
691
709
  setSearchTerm,
692
- setSecondCategory
710
+ setSecondCategory,
711
+ isLoading
693
712
  }
694
713
  ) }),
695
- /* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsx(Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: closeModal, children: "\uD655\uC778" }) })
714
+ /* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsx(
715
+ Button,
716
+ {
717
+ variant: "primary",
718
+ size: "medium",
719
+ appearance: "filled",
720
+ width: "full",
721
+ onClick: closeModal,
722
+ disabled: !selectedJob,
723
+ children: "\uD655\uC778"
724
+ }
725
+ ) })
696
726
  ] })
697
727
  ] }),
698
728
  JobSearchComponent: /* @__PURE__ */ jsx(
@@ -711,13 +741,17 @@ function useJobSearchModal() {
711
741
  filteredJobs: filteredJobs || [],
712
742
  onJobSelect: handleJobSelect,
713
743
  searchInput,
714
- setSearchTerm
744
+ setSearchTerm,
745
+ isLoading
715
746
  }
716
747
  ),
717
748
  isJobSearchOpen: isOpen,
718
- openJobSearchModal: openModal,
749
+ openJobSearchModal: openInitModal,
719
750
  closeJobSearchModal: closeModal,
720
- selectedJob
751
+ selectedJob,
752
+ selectedJobDetail,
753
+ resetJobSearch: reset,
754
+ setSelectedJob
721
755
  };
722
756
  }
723
757
 
@@ -2279,33 +2313,41 @@ const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2279
2313
  };
2280
2314
 
2281
2315
  const cx$2 = classNames.bind(styles$8);
2282
- function VehicleSearch({ vehicles, onVehicleSelect }) {
2316
+ function VehicleSearch({ vehicles, onVehicleSelect, selectedVehicle }) {
2283
2317
  return /* @__PURE__ */ jsxs("div", { className: cx$2("vehicle-search-section"), children: [
2284
2318
  /* @__PURE__ */ jsx("p", { children: "\uC6B4\uC804 \uCC28\uC885" }),
2285
- /* @__PURE__ */ jsx(Radio.Root, { name: "vehicle-selection", size: "small", className: cx$2("vehicle-radio-root"), children: vehicles.map((vehicle, index) => /* @__PURE__ */ jsxs(
2286
- Radio.Item,
2319
+ /* @__PURE__ */ jsx(
2320
+ Radio.Root,
2287
2321
  {
2288
- id: `item-${vehicle.integrationCodeValue}`,
2322
+ name: "vehicle-selection",
2289
2323
  size: "small",
2290
- value: vehicle.integrationCodeValue || "",
2291
- onChange: (e) => {
2292
- const { value } = e.target;
2293
- console.log(e.target.value);
2294
- const selected = vehicles.find((v) => v.integrationCodeValue === value);
2295
- if (selected) {
2296
- onVehicleSelect(selected);
2297
- }
2298
- },
2299
- className: cx$2("item"),
2300
- children: [
2301
- vehicle.integrationCodeValueName,
2302
- "(",
2303
- vehicle.integrationCodeValue,
2304
- ")"
2305
- ]
2306
- },
2307
- `item-${vehicle.integrationCodeValue}-${index}`
2308
- )) })
2324
+ className: cx$2("vehicle-radio-root"),
2325
+ defaultValue: selectedVehicle?.integrationCodeValue || "",
2326
+ children: vehicles.map((vehicle, index) => /* @__PURE__ */ jsxs(
2327
+ Radio.Item,
2328
+ {
2329
+ id: `item-${vehicle.integrationCodeValue}`,
2330
+ size: "small",
2331
+ value: vehicle.integrationCodeValue || "",
2332
+ onChange: (e) => {
2333
+ const { value } = e.target;
2334
+ const selected = vehicles.find((v) => v.integrationCodeValue === value);
2335
+ if (selected) {
2336
+ onVehicleSelect(selected);
2337
+ }
2338
+ },
2339
+ className: cx$2("item"),
2340
+ children: [
2341
+ vehicle.integrationCodeValueName,
2342
+ "(",
2343
+ vehicle.integrationCodeValue,
2344
+ ")"
2345
+ ]
2346
+ },
2347
+ `item-${vehicle.integrationCodeValue}-${index}`
2348
+ ))
2349
+ }
2350
+ )
2309
2351
  ] });
2310
2352
  }
2311
2353
 
@@ -2313,7 +2355,14 @@ const useVehicleSearch = () => {
2313
2355
  const [selectedVehicle, setSelectedVehicle] = useState();
2314
2356
  const { data } = useSearchVehicleQuery();
2315
2357
  return {
2316
- VehicleSearchComponent: /* @__PURE__ */ jsx(VehicleSearch, { vehicles: data?.data?.vehicleTypeList || [], onVehicleSelect: setSelectedVehicle }),
2358
+ VehicleSearchComponent: /* @__PURE__ */ jsx(
2359
+ VehicleSearch,
2360
+ {
2361
+ vehicles: data?.data?.vehicleTypeList || [],
2362
+ onVehicleSelect: setSelectedVehicle,
2363
+ selectedVehicle
2364
+ }
2365
+ ),
2317
2366
  selectedVehicle,
2318
2367
  setSelectedVehicle,
2319
2368
  vehicleList: data
@@ -2324,14 +2373,33 @@ const useJobVehicleSearch = () => {
2324
2373
  const [rightPanelView, setRightPanelView] = useState("jobSearch");
2325
2374
  const [riskGrade, setRiskGrade] = useState("");
2326
2375
  const [hospitalizationGrade, setHospitalizationGrade] = useState("");
2327
- const { selectedJob, JobSearchComponent } = useJobSearchModal();
2328
- const { selectedVehicle, VehicleSearchComponent } = useVehicleSearch();
2376
+ const { selectedJob, JobSearchComponent, selectedJobDetail, resetJobSearch, setSelectedJob } = useJobSearchModal();
2377
+ const { selectedVehicle, VehicleSearchComponent, setSelectedVehicle } = useVehicleSearch();
2378
+ const { data: riskGradeData } = useSearchRiskGradeQuery(
2379
+ {
2380
+ occupationIndustryCode: selectedJob?.occupationIndustryCode || "",
2381
+ vehicleTypeCode: selectedVehicle?.integrationCodeValue || ""
2382
+ },
2383
+ {
2384
+ enabled: !!selectedJob && !!selectedVehicle
2385
+ }
2386
+ );
2387
+ const reset = () => {
2388
+ setSelectedJob(null);
2389
+ resetJobSearch();
2390
+ setSelectedVehicle(void 0);
2391
+ setRiskGrade("");
2392
+ setHospitalizationGrade("");
2393
+ };
2329
2394
  useEffect(() => {
2330
- if (selectedJob && selectedVehicle) {
2331
- setRiskGrade("\uC77C\uBC18(\uBE44\uC704\uD5D8\uC9C1)(0)");
2332
- setHospitalizationGrade("\uC77C\uBC18\uC785\uC6D0(\uBE44\uC704\uD5D8\uC9C1)(0)");
2395
+ if (selectedJob && selectedVehicle && riskGradeData) {
2396
+ const { riskGradeCode, riskGradeName } = riskGradeData.data;
2397
+ setRiskGrade(`${riskGradeName}(${riskGradeCode})`);
2398
+ setHospitalizationGrade(
2399
+ `${selectedJobDetail?.hospitalizationGradeCodeName}(${selectedJobDetail?.hospitalizationGradeCode})`
2400
+ );
2333
2401
  }
2334
- }, [selectedJob, selectedVehicle]);
2402
+ }, [selectedJob, selectedVehicle, riskGradeData, selectedJobDetail]);
2335
2403
  return {
2336
2404
  selectedVehicle,
2337
2405
  rightPanelView,
@@ -2340,7 +2408,8 @@ const useJobVehicleSearch = () => {
2340
2408
  JobSearch: JobSearchComponent,
2341
2409
  VehicleSearch: VehicleSearchComponent,
2342
2410
  riskGrade,
2343
- hospitalizationGrade
2411
+ hospitalizationGrade,
2412
+ resetJobVehicleSearch: reset
2344
2413
  };
2345
2414
  };
2346
2415
 
@@ -2354,11 +2423,11 @@ function useJobVehicleSearchModal() {
2354
2423
  JobSearch,
2355
2424
  VehicleSearch,
2356
2425
  riskGrade,
2357
- hospitalizationGrade
2426
+ hospitalizationGrade,
2427
+ resetJobVehicleSearch
2358
2428
  } = useJobVehicleSearch();
2359
2429
  const { isOpen, openModal, closeModal } = useModalState({ initialValue: true });
2360
2430
  const validate = () => {
2361
- console.log({ selectedJob, selectedVehicle });
2362
2431
  if (!selectedJob && !selectedVehicle) {
2363
2432
  return ModalUtils.alert(
2364
2433
  "\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.",
@@ -2380,12 +2449,16 @@ function useJobVehicleSearchModal() {
2380
2449
  }
2381
2450
  closeModal();
2382
2451
  };
2452
+ const openInitModal = () => {
2453
+ resetJobVehicleSearch();
2454
+ openModal();
2455
+ };
2383
2456
  return {
2384
2457
  selectedJob,
2385
2458
  selectedVehicle,
2386
2459
  riskGrade,
2387
2460
  hospitalizationGrade,
2388
- openJobVehicleModal: openModal,
2461
+ openJobVehicleModal: openInitModal,
2389
2462
  JobVehicleSearchModalComponent: /* @__PURE__ */ jsxs(Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
2390
2463
  /* @__PURE__ */ jsx(Modal.Overlay, {}),
2391
2464
  /* @__PURE__ */ jsxs(Modal.Content, { style: { height: "697px" }, children: [
@@ -2437,18 +2510,6 @@ function useJobVehicleSearchModal() {
2437
2510
  };
2438
2511
  }
2439
2512
 
2440
- const JobSearchModal = ({ onClose }) => {
2441
- const { JobSearchComponent } = useJobSearchModal();
2442
- return /* @__PURE__ */ jsxs(Modal.Root, { isOpen: true, onClose, modalSize: "xlarge", children: [
2443
- /* @__PURE__ */ jsx(Modal.Overlay, {}),
2444
- /* @__PURE__ */ jsxs(Modal.Content, { style: { height: "697px" }, children: [
2445
- /* @__PURE__ */ jsx(Modal.Header, { headerTitle: "\uC9C1\uC885 \uAC80\uC0C9", showCloseButton: true }),
2446
- /* @__PURE__ */ jsx(Modal.Body, { raw: true, children: JobSearchComponent }),
2447
- /* @__PURE__ */ jsx(Modal.Footer, { children: /* @__PURE__ */ jsx(Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: onClose, children: "\uD655\uC778" }) })
2448
- ] })
2449
- ] });
2450
- };
2451
-
2452
2513
  const useCustomerSearch = (onSelect) => {
2453
2514
  const { triggerRef, isOpen, setIsOpen, DropDown } = useDropDown();
2454
2515
  const [searchKeyword, setSearchKeyword] = useState("");
@@ -2788,5 +2849,5 @@ const useRemoteIdentityVerificationPopup = (config) => {
2788
2849
  };
2789
2850
  };
2790
2851
 
2791
- export { Attachment, BankStockSearchModal, CustomerSearch, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobSearchModal, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobVehicleSearchModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress };
2852
+ export { Attachment, BankStockSearchModal, CustomerSearch, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobSearchModal, useJobVehicleSearchModal, useRemoteIdentityVerification, useRemoteIdentityVerificationIframe, useRemoteIdentityVerificationPopup, useSearchAddress };
2792
2853
  //# sourceMappingURL=index.esm.js.map