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.cjs.js CHANGED
@@ -63,11 +63,6 @@ const FormDatePicker = ({
63
63
  }) => {
64
64
  const { field, fieldState } = reactHookForm.useController({ name, control, disabled, defaultValue });
65
65
  const [selected, setSelected] = React.useState();
66
- React.useEffect(() => {
67
- if (field.value) {
68
- setSelected(field.value);
69
- }
70
- }, [defaultValue]);
71
66
  React.useEffect(() => {
72
67
  if (field.value !== selected) {
73
68
  setSelected(field.value);
@@ -96,18 +91,25 @@ const FormDateRangePicker = ({
96
91
  defaultValue,
97
92
  ...props
98
93
  }) => {
99
- const { field, fieldState } = reactHookForm.useController({ name, control, disabled, defaultValue });
94
+ const { field, fieldState } = reactHookForm.useController({
95
+ name,
96
+ control,
97
+ disabled,
98
+ defaultValue
99
+ });
100
100
  const [selected, setSelected] = React.useState();
101
101
  React.useEffect(() => {
102
- if (field.value) {
102
+ if (field.value && !selected) {
103
103
  setSelected(field.value);
104
104
  }
105
- }, [defaultValue]);
106
- React.useEffect(() => {
107
- if (selected && field.value.startDate.getTime() === selected.startDate?.getTime() && field.value.endDate.getTime() === selected.endDate?.getTime()) {
108
- return;
105
+ try {
106
+ if (field.value && selected && (field.value.startDate.getTime() !== selected.startDate?.getTime() || field.value.endDate.getTime() !== selected.endDate?.getTime())) {
107
+ setSelected(field.value);
108
+ console.warn(field.value, selected);
109
+ }
110
+ } catch (e) {
111
+ console.log(e);
109
112
  }
110
- setSelected(field.value);
111
113
  }, [field.value]);
112
114
  return /* @__PURE__ */ jsxRuntime.jsx(
113
115
  salesFrontendDesignSystem.DateRangePicker,
@@ -236,58 +238,10 @@ const highlightOnSearchKeyword$1 = (originalText, targetString) => {
236
238
  return originalText;
237
239
  };
238
240
 
239
- const cx$e = classNames.bind(styles);
240
- function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
241
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$e("category-section"), children: [
242
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$e("result-title"), children: [
243
- "\uCD1D ",
244
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: filteredJobs.length }),
245
- "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
246
- ] }),
247
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "job-selection", size: "small", className: cx$e("job-radio-root"), onToggle: () => {
248
- }, children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxRuntime.jsxs(
249
- salesFrontendDesignSystem.Accordion.Item,
250
- {
251
- id: `item-${job.occupationIndustryCode}-${index}-accordion`,
252
- children: [
253
- /* @__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: [
254
- highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm),
255
- "(",
256
- job.occupationIndustryCode,
257
- ")"
258
- ] }) }) }),
259
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Table, { variant: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
260
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
261
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1" }),
262
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24", children: "1\uD589 1\uBC88\uC9F8" }),
263
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 1-2" }),
264
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-24 ", children: "1\uD589 2\uBC88\uC9F8" })
265
- ] }),
266
- /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
267
- /* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 2" }),
268
- /* @__PURE__ */ jsxRuntime.jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "d-flex-center-center", children: [
269
- "2\uD589 1\uBC88\uC9F8 ",
270
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
271
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
272
- ] }) })
273
- ] })
274
- ] }) }) })
275
- ]
276
- },
277
- `item-${job.occupationIndustryCode}-${index}`
278
- )) }) }),
279
- filteredJobs.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
280
- "`",
281
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchTerm }),
282
- "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
283
- ] })
284
- ] }) });
285
- }
286
-
287
241
  function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
288
242
  const { data: detail } = method.useSearchOccupationDetailQuery({
289
243
  occupationIndustryCode,
290
- occupationIndustryTypeCode: occupationTypeCode
244
+ occupationIndustryTypeCode: occupationTypeCode || "1"
291
245
  });
292
246
  if (!detail || !detail.data) {
293
247
  return null;
@@ -351,6 +305,45 @@ function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
351
305
  ] }) }) });
352
306
  }
353
307
 
308
+ const cx$e = classNames.bind(styles);
309
+ function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
310
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$e("category-section"), children: [
311
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$e("result-title"), children: [
312
+ "\uCD1D ",
313
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: filteredJobs.length }),
314
+ "\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
315
+ ] }),
316
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "job-selection", size: "small", className: cx$e("job-radio-root"), onToggle: () => {
317
+ }, children: filteredJobs.map((job, index) => /* @__PURE__ */ jsxRuntime.jsxs(
318
+ salesFrontendDesignSystem.Accordion.Item,
319
+ {
320
+ id: `item-${job.occupationIndustryCode}-${index}-accordion`,
321
+ children: [
322
+ /* @__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: [
323
+ highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm),
324
+ "(",
325
+ job.occupationIndustryCode,
326
+ ")"
327
+ ] }) }) }),
328
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(
329
+ JobSearchDetail,
330
+ {
331
+ occupationTypeCode: job.occupationTypeCode || "",
332
+ occupationIndustryCode: job.occupationIndustryCode
333
+ }
334
+ ) })
335
+ ]
336
+ },
337
+ `item-${job.occupationIndustryCode}-${index}`
338
+ )) }) }),
339
+ filteredJobs.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
340
+ "`",
341
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchTerm }),
342
+ "`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
343
+ ] })
344
+ ] }) });
345
+ }
346
+
354
347
  const cx$d = classNames.bind(styles);
355
348
  function JobSearchFavorite({ filteredJobs, onJobSelect }) {
356
349
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$d("popular-jobs"), children: [
@@ -451,7 +444,8 @@ function JobSearch({
451
444
  secondCategory,
452
445
  setSecondCategory,
453
446
  firstCategoryList,
454
- secondCategoryList
447
+ secondCategoryList,
448
+ isLoading
455
449
  }) {
456
450
  const onKeyUp = (e) => {
457
451
  if (e.key === "Enter") {
@@ -492,7 +486,7 @@ function JobSearch({
492
486
  }
493
487
  ),
494
488
  !searchTerm && /* @__PURE__ */ jsxRuntime.jsx(JobSearchFavorite, { filteredJobs, onJobSelect }),
495
- searchTerm && /* @__PURE__ */ jsxRuntime.jsx(JobSearchResult, { filteredJobs, onJobSelect, searchTerm })
489
+ searchTerm && !isLoading && /* @__PURE__ */ jsxRuntime.jsx(JobSearchResult, { filteredJobs, onJobSelect, searchTerm })
496
490
  ] }),
497
491
  activeTab === "jobCode" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$b("select-jobs-section"), children: [
498
492
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$b("category-section"), children: [
@@ -533,7 +527,7 @@ function JobSearch({
533
527
  }
534
528
  )
535
529
  ] }),
536
- firstCategory && secondCategory && /* @__PURE__ */ jsxRuntime.jsx(JobSearchCategory, { filteredJobs, onJobSelect, searchTerm })
530
+ firstCategory && secondCategory && !isLoading && /* @__PURE__ */ jsxRuntime.jsx(JobSearchCategory, { filteredJobs, onJobSelect, searchTerm })
537
531
  ] })
538
532
  ] })
539
533
  ] });
@@ -584,7 +578,12 @@ const useJobSearch = () => {
584
578
  const [jobList, setJobList] = React.useState(initData);
585
579
  const [firstCategoryList, setFirstCategoryList] = React.useState([]);
586
580
  const [secondCategoryList, setSecondCategoryList] = React.useState([]);
587
- const { data } = method.useSearchOccupationQuery({
581
+ const { data: detail } = method.useSearchOccupationDetailQuery({
582
+ occupationIndustryCode: selectedJob?.occupationIndustryCode || "",
583
+ occupationIndustryTypeCode: "1"
584
+ });
585
+ const selectedJobDetail = detail?.data;
586
+ const { data, isLoading } = method.useSearchOccupationQuery({
588
587
  occupationMajorCategoryCode: firstCategory,
589
588
  occupationSearchTypeCode: searchTerm ? "4" : "3",
590
589
  occupationSubCategoryCode: secondCategory,
@@ -602,7 +601,17 @@ const useJobSearch = () => {
602
601
  occupationSubCategoryCode: "",
603
602
  searchOccupationIndustryName: ""
604
603
  });
604
+ const reset = () => {
605
+ setSearchInput("");
606
+ setSearchTerm("");
607
+ setFirstCategory("");
608
+ setSecondCategory("");
609
+ };
605
610
  React.useEffect(() => {
611
+ reset();
612
+ }, [activeTab]);
613
+ React.useEffect(() => {
614
+ setSelectedJob(null);
606
615
  if (data && searchTerm && activeTab === "jobName") {
607
616
  const filteredJobs = data.data.occupationList.filter((job) => job.occupationIndustryName.includes(searchTerm));
608
617
  setJobList(filteredJobs);
@@ -614,9 +623,6 @@ const useJobSearch = () => {
614
623
  setJobList(data?.data.occupationList || []);
615
624
  }
616
625
  }, [searchTerm, data, firstCategory, secondCategory, secondCategoryData, activeTab]);
617
- React.useEffect(() => {
618
- console.log("jobList", jobList);
619
- }, [jobList]);
620
626
  React.useEffect(() => {
621
627
  if (firstCategoryData) {
622
628
  setFirstCategoryList(firstCategoryData.data.occupationList);
@@ -631,6 +637,7 @@ const useJobSearch = () => {
631
637
  activeTab,
632
638
  setActiveTab,
633
639
  selectedJob,
640
+ setSelectedJob,
634
641
  searchTerm,
635
642
  setSearchTerm,
636
643
  handleJobSelect,
@@ -642,7 +649,10 @@ const useJobSearch = () => {
642
649
  secondCategory,
643
650
  setSecondCategory,
644
651
  secondCategoryList,
645
- firstCategoryList
652
+ firstCategoryList,
653
+ reset,
654
+ isLoading,
655
+ selectedJobDetail
646
656
  };
647
657
  };
648
658
  function useJobSearchModal() {
@@ -661,15 +671,23 @@ function useJobSearchModal() {
661
671
  secondCategory,
662
672
  setSecondCategory,
663
673
  firstCategoryList,
664
- secondCategoryList
674
+ secondCategoryList,
675
+ setSelectedJob,
676
+ selectedJobDetail,
677
+ reset,
678
+ isLoading
665
679
  } = useJobSearch();
666
680
  const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState();
667
681
  const onTabChange = (value) => {
668
- setSearchTerm("");
669
- setFirstCategory("");
670
- setSecondCategory("");
682
+ reset();
671
683
  setActiveTab(value);
672
684
  };
685
+ const openInitModal = () => {
686
+ reset();
687
+ setSelectedJob(null);
688
+ setActiveTab("jobName");
689
+ openModal();
690
+ };
673
691
  return {
674
692
  JobSearchModal: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
675
693
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
@@ -691,10 +709,22 @@ function useJobSearchModal() {
691
709
  onJobSelect: handleJobSelect,
692
710
  searchInput,
693
711
  setSearchTerm,
694
- setSecondCategory
712
+ setSecondCategory,
713
+ isLoading
695
714
  }
696
715
  ) }),
697
- /* @__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" }) })
716
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(
717
+ salesFrontendDesignSystem.Button,
718
+ {
719
+ variant: "primary",
720
+ size: "medium",
721
+ appearance: "filled",
722
+ width: "full",
723
+ onClick: closeModal,
724
+ disabled: !selectedJob,
725
+ children: "\uD655\uC778"
726
+ }
727
+ ) })
698
728
  ] })
699
729
  ] }),
700
730
  JobSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(
@@ -713,13 +743,17 @@ function useJobSearchModal() {
713
743
  filteredJobs: filteredJobs || [],
714
744
  onJobSelect: handleJobSelect,
715
745
  searchInput,
716
- setSearchTerm
746
+ setSearchTerm,
747
+ isLoading
717
748
  }
718
749
  ),
719
750
  isJobSearchOpen: isOpen,
720
- openJobSearchModal: openModal,
751
+ openJobSearchModal: openInitModal,
721
752
  closeJobSearchModal: closeModal,
722
- selectedJob
753
+ selectedJob,
754
+ selectedJobDetail,
755
+ resetJobSearch: reset,
756
+ setSelectedJob
723
757
  };
724
758
  }
725
759
 
@@ -2281,33 +2315,41 @@ const JobVehicleSearchGrade = ({ riskGrade, hospitalizationGrade }) => {
2281
2315
  };
2282
2316
 
2283
2317
  const cx$2 = classNames.bind(styles$8);
2284
- function VehicleSearch({ vehicles, onVehicleSelect }) {
2318
+ function VehicleSearch({ vehicles, onVehicleSelect, selectedVehicle }) {
2285
2319
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$2("vehicle-search-section"), children: [
2286
2320
  /* @__PURE__ */ jsxRuntime.jsx("p", { children: "\uC6B4\uC804 \uCC28\uC885" }),
2287
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Radio.Root, { name: "vehicle-selection", size: "small", className: cx$2("vehicle-radio-root"), children: vehicles.map((vehicle, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2288
- salesFrontendDesignSystem.Radio.Item,
2321
+ /* @__PURE__ */ jsxRuntime.jsx(
2322
+ salesFrontendDesignSystem.Radio.Root,
2289
2323
  {
2290
- id: `item-${vehicle.integrationCodeValue}`,
2324
+ name: "vehicle-selection",
2291
2325
  size: "small",
2292
- value: vehicle.integrationCodeValue || "",
2293
- onChange: (e) => {
2294
- const { value } = e.target;
2295
- console.log(e.target.value);
2296
- const selected = vehicles.find((v) => v.integrationCodeValue === value);
2297
- if (selected) {
2298
- onVehicleSelect(selected);
2299
- }
2300
- },
2301
- className: cx$2("item"),
2302
- children: [
2303
- vehicle.integrationCodeValueName,
2304
- "(",
2305
- vehicle.integrationCodeValue,
2306
- ")"
2307
- ]
2308
- },
2309
- `item-${vehicle.integrationCodeValue}-${index}`
2310
- )) })
2326
+ className: cx$2("vehicle-radio-root"),
2327
+ defaultValue: selectedVehicle?.integrationCodeValue || "",
2328
+ children: vehicles.map((vehicle, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2329
+ salesFrontendDesignSystem.Radio.Item,
2330
+ {
2331
+ id: `item-${vehicle.integrationCodeValue}`,
2332
+ size: "small",
2333
+ value: vehicle.integrationCodeValue || "",
2334
+ onChange: (e) => {
2335
+ const { value } = e.target;
2336
+ const selected = vehicles.find((v) => v.integrationCodeValue === value);
2337
+ if (selected) {
2338
+ onVehicleSelect(selected);
2339
+ }
2340
+ },
2341
+ className: cx$2("item"),
2342
+ children: [
2343
+ vehicle.integrationCodeValueName,
2344
+ "(",
2345
+ vehicle.integrationCodeValue,
2346
+ ")"
2347
+ ]
2348
+ },
2349
+ `item-${vehicle.integrationCodeValue}-${index}`
2350
+ ))
2351
+ }
2352
+ )
2311
2353
  ] });
2312
2354
  }
2313
2355
 
@@ -2315,7 +2357,14 @@ const useVehicleSearch = () => {
2315
2357
  const [selectedVehicle, setSelectedVehicle] = React.useState();
2316
2358
  const { data } = method.useSearchVehicleQuery();
2317
2359
  return {
2318
- VehicleSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(VehicleSearch, { vehicles: data?.data?.vehicleTypeList || [], onVehicleSelect: setSelectedVehicle }),
2360
+ VehicleSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(
2361
+ VehicleSearch,
2362
+ {
2363
+ vehicles: data?.data?.vehicleTypeList || [],
2364
+ onVehicleSelect: setSelectedVehicle,
2365
+ selectedVehicle
2366
+ }
2367
+ ),
2319
2368
  selectedVehicle,
2320
2369
  setSelectedVehicle,
2321
2370
  vehicleList: data
@@ -2326,14 +2375,33 @@ const useJobVehicleSearch = () => {
2326
2375
  const [rightPanelView, setRightPanelView] = React.useState("jobSearch");
2327
2376
  const [riskGrade, setRiskGrade] = React.useState("");
2328
2377
  const [hospitalizationGrade, setHospitalizationGrade] = React.useState("");
2329
- const { selectedJob, JobSearchComponent } = useJobSearchModal();
2330
- const { selectedVehicle, VehicleSearchComponent } = useVehicleSearch();
2378
+ const { selectedJob, JobSearchComponent, selectedJobDetail, resetJobSearch, setSelectedJob } = useJobSearchModal();
2379
+ const { selectedVehicle, VehicleSearchComponent, setSelectedVehicle } = useVehicleSearch();
2380
+ const { data: riskGradeData } = method.useSearchRiskGradeQuery(
2381
+ {
2382
+ occupationIndustryCode: selectedJob?.occupationIndustryCode || "",
2383
+ vehicleTypeCode: selectedVehicle?.integrationCodeValue || ""
2384
+ },
2385
+ {
2386
+ enabled: !!selectedJob && !!selectedVehicle
2387
+ }
2388
+ );
2389
+ const reset = () => {
2390
+ setSelectedJob(null);
2391
+ resetJobSearch();
2392
+ setSelectedVehicle(void 0);
2393
+ setRiskGrade("");
2394
+ setHospitalizationGrade("");
2395
+ };
2331
2396
  React.useEffect(() => {
2332
- if (selectedJob && selectedVehicle) {
2333
- setRiskGrade("\uC77C\uBC18(\uBE44\uC704\uD5D8\uC9C1)(0)");
2334
- setHospitalizationGrade("\uC77C\uBC18\uC785\uC6D0(\uBE44\uC704\uD5D8\uC9C1)(0)");
2397
+ if (selectedJob && selectedVehicle && riskGradeData) {
2398
+ const { riskGradeCode, riskGradeName } = riskGradeData.data;
2399
+ setRiskGrade(`${riskGradeName}(${riskGradeCode})`);
2400
+ setHospitalizationGrade(
2401
+ `${selectedJobDetail?.hospitalizationGradeCodeName}(${selectedJobDetail?.hospitalizationGradeCode})`
2402
+ );
2335
2403
  }
2336
- }, [selectedJob, selectedVehicle]);
2404
+ }, [selectedJob, selectedVehicle, riskGradeData, selectedJobDetail]);
2337
2405
  return {
2338
2406
  selectedVehicle,
2339
2407
  rightPanelView,
@@ -2342,7 +2410,8 @@ const useJobVehicleSearch = () => {
2342
2410
  JobSearch: JobSearchComponent,
2343
2411
  VehicleSearch: VehicleSearchComponent,
2344
2412
  riskGrade,
2345
- hospitalizationGrade
2413
+ hospitalizationGrade,
2414
+ resetJobVehicleSearch: reset
2346
2415
  };
2347
2416
  };
2348
2417
 
@@ -2356,11 +2425,11 @@ function useJobVehicleSearchModal() {
2356
2425
  JobSearch,
2357
2426
  VehicleSearch,
2358
2427
  riskGrade,
2359
- hospitalizationGrade
2428
+ hospitalizationGrade,
2429
+ resetJobVehicleSearch
2360
2430
  } = useJobVehicleSearch();
2361
2431
  const { isOpen, openModal, closeModal } = salesFrontendDesignSystem.useModalState({ initialValue: true });
2362
2432
  const validate = () => {
2363
- console.log({ selectedJob, selectedVehicle });
2364
2433
  if (!selectedJob && !selectedVehicle) {
2365
2434
  return salesFrontendDesignSystem.ModalUtils.alert(
2366
2435
  "\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.",
@@ -2382,12 +2451,16 @@ function useJobVehicleSearchModal() {
2382
2451
  }
2383
2452
  closeModal();
2384
2453
  };
2454
+ const openInitModal = () => {
2455
+ resetJobVehicleSearch();
2456
+ openModal();
2457
+ };
2385
2458
  return {
2386
2459
  selectedJob,
2387
2460
  selectedVehicle,
2388
2461
  riskGrade,
2389
2462
  hospitalizationGrade,
2390
- openJobVehicleModal: openModal,
2463
+ openJobVehicleModal: openInitModal,
2391
2464
  JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
2392
2465
  /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
2393
2466
  /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
@@ -2439,18 +2512,6 @@ function useJobVehicleSearchModal() {
2439
2512
  };
2440
2513
  }
2441
2514
 
2442
- const JobSearchModal = ({ onClose }) => {
2443
- const { JobSearchComponent } = useJobSearchModal();
2444
- return /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen: true, onClose, modalSize: "xlarge", children: [
2445
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
2446
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
2447
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885 \uAC80\uC0C9", showCloseButton: true }),
2448
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { raw: true, children: JobSearchComponent }),
2449
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: onClose, children: "\uD655\uC778" }) })
2450
- ] })
2451
- ] });
2452
- };
2453
-
2454
2515
  const useCustomerSearch = (onSelect) => {
2455
2516
  const { triggerRef, isOpen, setIsOpen, DropDown } = salesFrontendDesignSystem.useDropDown();
2456
2517
  const [searchKeyword, setSearchKeyword] = React.useState("");
@@ -2802,7 +2863,6 @@ exports.FormSearchJobField = FormSearchJobField;
2802
2863
  exports.FormSegmentGroup = FormSegmentGroup;
2803
2864
  exports.FormSelect = FormSelect;
2804
2865
  exports.FormTextField = FormTextField;
2805
- exports.JobSearchModal = JobSearchModal;
2806
2866
  exports.OrganizationSearchModal = OrganizationSearchModal;
2807
2867
  exports.StepIndicator = StepIndicator;
2808
2868
  exports.resize = resize;
@@ -2811,6 +2871,7 @@ exports.useAddressComponent = useAddressComponent;
2811
2871
  exports.useBankStockSearch = useBankStockSearch;
2812
2872
  exports.useCamera = useCamera;
2813
2873
  exports.useCanvasPaint = useCanvasPaint;
2874
+ exports.useJobSearchModal = useJobSearchModal;
2814
2875
  exports.useJobVehicleSearchModal = useJobVehicleSearchModal;
2815
2876
  exports.useRemoteIdentityVerification = useRemoteIdentityVerification;
2816
2877
  exports.useRemoteIdentityVerificationIframe = useRemoteIdentityVerificationIframe;