sales-frontend-components 0.0.79 → 0.0.81
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 +225 -99
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -44
- package/dist/index.esm.js +226 -100
- package/dist/index.esm.js.map +1 -1
- package/dist/modal/pre-standard/job-search-modal/job-search-modal.module.scss +9 -0
- package/dist/modal/standard/address-search/select-address.module.scss +5 -1
- package/package.json +11 -11
package/dist/index.cjs.js
CHANGED
|
@@ -283,6 +283,73 @@ function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
|
|
|
283
283
|
] }) });
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
|
|
287
|
+
const { data: detail } = method.useSearchOccupationDetailQuery({
|
|
288
|
+
occupationIndustryCode,
|
|
289
|
+
occupationIndustryTypeCode: occupationTypeCode
|
|
290
|
+
});
|
|
291
|
+
if (!detail || !detail.data) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
const {
|
|
295
|
+
/** @description 직종해설내용 */
|
|
296
|
+
occupationExplanationContent,
|
|
297
|
+
/** @description 직업예시명 */
|
|
298
|
+
occupationExampleName,
|
|
299
|
+
/** @description 위험등급명 */
|
|
300
|
+
riskGradeName,
|
|
301
|
+
/** @description 위험등급코드 */
|
|
302
|
+
riskGradeCode,
|
|
303
|
+
/** @description 상해위험등급코드명 */
|
|
304
|
+
injuryRiskGradeCodeName,
|
|
305
|
+
/** @description 상해위험등급코드 */
|
|
306
|
+
injuryRiskGradeCode,
|
|
307
|
+
/** @description 입원등급코드명 */
|
|
308
|
+
hospitalizationGradeCodeName,
|
|
309
|
+
/** @description 입원등급코드 */
|
|
310
|
+
hospitalizationGradeCode,
|
|
311
|
+
/** @description 상해직종코드 */
|
|
312
|
+
injuryOccupationCode
|
|
313
|
+
} = detail.data;
|
|
314
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Table, { variant: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsxs("tbody", { children: [
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-small", children: "\uC9C1\uC885 \uD574\uC124" }),
|
|
317
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-small", children: occupationExplanationContent })
|
|
318
|
+
] }),
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-small", children: "\uC9C1\uC885 \uC608\uC2DC" }),
|
|
321
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-small", children: occupationExampleName })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
324
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-small", children: "\uC704\uD5D8 \uB4F1\uAE09" }),
|
|
325
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-small", children: [
|
|
326
|
+
riskGradeName,
|
|
327
|
+
"(",
|
|
328
|
+
riskGradeCode,
|
|
329
|
+
")"
|
|
330
|
+
] })
|
|
331
|
+
] }),
|
|
332
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-small", children: "\uC785\uC6D0 \uB4F1\uAE09" }),
|
|
334
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-small", children: [
|
|
335
|
+
hospitalizationGradeCodeName,
|
|
336
|
+
"(",
|
|
337
|
+
hospitalizationGradeCode,
|
|
338
|
+
")"
|
|
339
|
+
] })
|
|
340
|
+
] }),
|
|
341
|
+
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
342
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-small", children: "\uC0C1\uD574 \uB4F1\uAE09" }),
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-small", children: [
|
|
344
|
+
injuryRiskGradeCodeName,
|
|
345
|
+
"(",
|
|
346
|
+
injuryRiskGradeCode,
|
|
347
|
+
")"
|
|
348
|
+
] })
|
|
349
|
+
] })
|
|
350
|
+
] }) }) });
|
|
351
|
+
}
|
|
352
|
+
|
|
286
353
|
const cx$d = classNames.bind(styles);
|
|
287
354
|
function JobSearchFavorite({ filteredJobs, onJobSelect }) {
|
|
288
355
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$d("popular-jobs"), children: [
|
|
@@ -308,7 +375,13 @@ function JobSearchFavorite({ filteredJobs, onJobSelect }) {
|
|
|
308
375
|
]
|
|
309
376
|
}
|
|
310
377
|
) }),
|
|
311
|
-
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children:
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
|
+
JobSearchDetail,
|
|
380
|
+
{
|
|
381
|
+
occupationTypeCode: job.occupationTypeCode || "",
|
|
382
|
+
occupationIndustryCode: job.occupationIndustryCode
|
|
383
|
+
}
|
|
384
|
+
) })
|
|
312
385
|
]
|
|
313
386
|
},
|
|
314
387
|
`item-${job.occupationIndustryCode}-${index}`
|
|
@@ -341,22 +414,13 @@ function JobSearchResult({ filteredJobs, onJobSelect, searchTerm }) {
|
|
|
341
414
|
children: highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm)
|
|
342
415
|
}
|
|
343
416
|
) }) }),
|
|
344
|
-
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
/* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
352
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "\uD5E4\uB354 2" }),
|
|
353
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "d-flex-center-center", children: [
|
|
354
|
-
"2\uD589 1\uBC88\uC9F8 ",
|
|
355
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
|
|
356
|
-
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
|
|
357
|
-
] }) })
|
|
358
|
-
] })
|
|
359
|
-
] }) }) })
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
418
|
+
JobSearchDetail,
|
|
419
|
+
{
|
|
420
|
+
occupationTypeCode: job.occupationTypeCode || "",
|
|
421
|
+
occupationIndustryCode: job.occupationIndustryCode
|
|
422
|
+
}
|
|
423
|
+
) })
|
|
360
424
|
]
|
|
361
425
|
},
|
|
362
426
|
job.occupationIndustryCode
|
|
@@ -1390,7 +1454,7 @@ const testSignatureBase64Data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA
|
|
|
1390
1454
|
const cx$8 = classNames.bind(styles$3);
|
|
1391
1455
|
const { InputBox: InputBox$1, Input: Input$1 } = salesFrontendDesignSystem.FormCore;
|
|
1392
1456
|
const AddressSearchInitialText = () => {
|
|
1393
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1457
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("search-result-list"), children: [
|
|
1394
1458
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cx$8("guide-title"), children: "\uC774\uB807\uAC8C \uAC80\uC0C9\uD574 \uBCF4\uC138\uC694." }),
|
|
1395
1459
|
/* @__PURE__ */ jsxRuntime.jsxs("ul", { className: cx$8("guide"), children: [
|
|
1396
1460
|
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uB3C4\uB85C\uBA85/\uC9C0\uBA85\uACFC \uAC74\uBB3C\uBC88\uD638\uB97C \uD568\uAED8 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
|
|
@@ -1408,38 +1472,36 @@ const AddressSearchResult = ({
|
|
|
1408
1472
|
searchKeyword,
|
|
1409
1473
|
selectedAddress
|
|
1410
1474
|
}) => {
|
|
1411
|
-
|
|
1412
|
-
React.useEffect(() => {
|
|
1413
|
-
const filterList2 = addressSearchList.filter(
|
|
1414
|
-
(item) => item.address.includes(searchKeyword) || item.oldAddress.includes(searchKeyword)
|
|
1415
|
-
) || [];
|
|
1416
|
-
setFilterList(filterList2);
|
|
1417
|
-
}, [addressSearchList, searchKeyword]);
|
|
1418
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1475
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("search-result-list"), children: [
|
|
1419
1476
|
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$8("guide-title"), children: [
|
|
1420
1477
|
"\uCD1D ",
|
|
1421
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children:
|
|
1478
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: addressSearchList.length }),
|
|
1422
1479
|
"\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
|
|
1423
1480
|
] }),
|
|
1424
|
-
|
|
1481
|
+
addressSearchList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1425
1482
|
salesFrontendDesignSystem.RadioGroup,
|
|
1426
1483
|
{
|
|
1427
|
-
items:
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("
|
|
1432
|
-
" ",
|
|
1433
|
-
|
|
1484
|
+
items: addressSearchList.map((item) => {
|
|
1485
|
+
return {
|
|
1486
|
+
value: JSON.stringify(item),
|
|
1487
|
+
select: item.roadNameBaseAddress === selectedAddress?.roadNameBaseAddress && item.roadNameDetailAddress === selectedAddress?.roadNameDetailAddress && item.mainBuildingName === selectedAddress?.mainBuildingName,
|
|
1488
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("search-result"), children: [
|
|
1489
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("zipcode"), children: highlightOnSearchKeyword$1(`${item.firstPostalCode}${item.secondPostalCode}`, searchKeyword) }),
|
|
1490
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("divider") }),
|
|
1491
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("address-info"), children: [
|
|
1492
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("address"), children: highlightOnSearchKeyword$1(
|
|
1493
|
+
`${item.roadNameBaseAddress} ${item.roadNameDetailAddress} ${item.mainBuildingName}`,
|
|
1494
|
+
searchKeyword
|
|
1495
|
+
) }),
|
|
1496
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("old-address"), children: highlightOnSearchKeyword$1(
|
|
1497
|
+
`${item.landNumberBaseAddress} ${item.landNumberDetailAddress}`,
|
|
1498
|
+
searchKeyword
|
|
1499
|
+
) })
|
|
1500
|
+
] })
|
|
1434
1501
|
] }),
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("old-address"), children: highlightOnSearchKeyword$1(item.oldAddress, searchKeyword) })
|
|
1439
|
-
] })
|
|
1440
|
-
] }),
|
|
1441
|
-
id: item.address
|
|
1442
|
-
})),
|
|
1502
|
+
id: JSON.stringify(item)
|
|
1503
|
+
};
|
|
1504
|
+
}),
|
|
1443
1505
|
className: cx$8("radio-group"),
|
|
1444
1506
|
name: "address-search",
|
|
1445
1507
|
size: "medium",
|
|
@@ -1447,7 +1509,7 @@ const AddressSearchResult = ({
|
|
|
1447
1509
|
onChange
|
|
1448
1510
|
}
|
|
1449
1511
|
),
|
|
1450
|
-
|
|
1512
|
+
addressSearchList.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1451
1513
|
"`",
|
|
1452
1514
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchKeyword }),
|
|
1453
1515
|
"`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
|
|
@@ -1455,30 +1517,52 @@ const AddressSearchResult = ({
|
|
|
1455
1517
|
] });
|
|
1456
1518
|
};
|
|
1457
1519
|
const AddressSearchDetailInput = ({
|
|
1458
|
-
|
|
1520
|
+
addressStandardizationList,
|
|
1459
1521
|
onDetailChange,
|
|
1522
|
+
onStandardizationChange,
|
|
1460
1523
|
step,
|
|
1461
1524
|
detailAddressInput
|
|
1462
1525
|
}) => {
|
|
1463
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1464
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1526
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("search-result-list"), children: [
|
|
1527
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1528
|
+
salesFrontendDesignSystem.RadioGroup,
|
|
1529
|
+
{
|
|
1530
|
+
items: addressStandardizationList.map((item) => {
|
|
1531
|
+
return {
|
|
1532
|
+
value: JSON.stringify(item),
|
|
1533
|
+
select: true,
|
|
1534
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("search-result"), children: [
|
|
1535
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("zipcode"), children: `${item.firstPostalCode}${item.secondPostalCode}` }),
|
|
1536
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$8("divider") }),
|
|
1537
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$8("address-info"), children: [
|
|
1538
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("address"), children: `${item.baseAddress} ${item.detailAddress}` }),
|
|
1539
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$8("old-address"), children: `${item.baseAddress} ${item.detailAddress}` })
|
|
1540
|
+
] })
|
|
1541
|
+
] }),
|
|
1542
|
+
id: JSON.stringify(item)
|
|
1543
|
+
};
|
|
1544
|
+
}),
|
|
1545
|
+
className: cx$8("radio-group"),
|
|
1546
|
+
name: "address-search-standardization",
|
|
1547
|
+
size: "medium",
|
|
1548
|
+
defaultValue: "",
|
|
1549
|
+
onChange: onStandardizationChange
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex gap-medium items-center", children: [
|
|
1475
1553
|
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.FormField.Label, { id: "detail", style: { width: "90px" }, children: "\uC0C1\uC138\uC8FC\uC18C" }),
|
|
1476
1554
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1477
|
-
|
|
1555
|
+
salesFrontendDesignSystem.FormField.TextField,
|
|
1478
1556
|
{
|
|
1557
|
+
rootProps: {
|
|
1558
|
+
style: {
|
|
1559
|
+
display: "flex",
|
|
1560
|
+
flex: 1
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1479
1563
|
placeholder: "\uC0C1\uC138\uC8FC\uC18C \uC785\uB825",
|
|
1480
1564
|
onChange: onDetailChange,
|
|
1481
|
-
size: "
|
|
1565
|
+
size: "small",
|
|
1482
1566
|
value: detailAddressInput,
|
|
1483
1567
|
...step === "detail-input" && { autoFocus: true }
|
|
1484
1568
|
}
|
|
@@ -1501,7 +1585,9 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
1501
1585
|
setDetail,
|
|
1502
1586
|
search,
|
|
1503
1587
|
searchInput,
|
|
1504
|
-
selectedAddress
|
|
1588
|
+
selectedAddress,
|
|
1589
|
+
onStandardizationChange,
|
|
1590
|
+
addressStandardizationList
|
|
1505
1591
|
} = useSearchAddress({
|
|
1506
1592
|
setValue,
|
|
1507
1593
|
onClose,
|
|
@@ -1528,7 +1614,7 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
1528
1614
|
AddressSearchResult,
|
|
1529
1615
|
{
|
|
1530
1616
|
onChange: onSelectChange,
|
|
1531
|
-
addressSearchList
|
|
1617
|
+
addressSearchList,
|
|
1532
1618
|
searchKeyword: addressSearchKeyword,
|
|
1533
1619
|
selectedAddress
|
|
1534
1620
|
}
|
|
@@ -1536,7 +1622,8 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
1536
1622
|
addressSearchStep === "detail-input" && selectedAddress && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1537
1623
|
AddressSearchDetailInput,
|
|
1538
1624
|
{
|
|
1539
|
-
|
|
1625
|
+
addressStandardizationList,
|
|
1626
|
+
onStandardizationChange,
|
|
1540
1627
|
onDetailChange: setDetail,
|
|
1541
1628
|
step: addressSearchStep,
|
|
1542
1629
|
detailAddressInput
|
|
@@ -1565,21 +1652,48 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
1565
1652
|
function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
1566
1653
|
const [searchKeyword, setSearchKeyword] = React.useState("");
|
|
1567
1654
|
const [step, setStep] = React.useState("initial");
|
|
1568
|
-
const [selectedAddress, setSelectedAddress] = React.useState(
|
|
1655
|
+
const [selectedAddress, setSelectedAddress] = React.useState();
|
|
1656
|
+
const [selectedStandardizationAddress, setSelectedStandardizationAddress] = React.useState();
|
|
1569
1657
|
const [searchInput, setSearchInput] = React.useState("");
|
|
1570
1658
|
const [detailAddressInput, setDetailAddressInput] = React.useState("");
|
|
1571
|
-
const
|
|
1659
|
+
const [displayList, setDisplayList] = React.useState([]);
|
|
1660
|
+
const [searchType, setSearchType] = React.useState("address");
|
|
1661
|
+
const [standardizationParams, setStandardizationParams] = React.useState({
|
|
1662
|
+
firstPostalCode: "",
|
|
1663
|
+
secondPostalCode: "",
|
|
1664
|
+
baseAddress: "",
|
|
1665
|
+
detailAddress: "",
|
|
1666
|
+
roadNameYn: "Y"
|
|
1667
|
+
});
|
|
1668
|
+
const { data: addressData } = method.useSearchAddressQuery(
|
|
1669
|
+
{ searchKeyWord: searchKeyword },
|
|
1670
|
+
{ enabled: !!searchKeyword && searchType === "address" }
|
|
1671
|
+
);
|
|
1672
|
+
const { data: postalData } = method.useSearchPostalCodeQuery(
|
|
1673
|
+
{ searchWordName: searchKeyword },
|
|
1674
|
+
{ enabled: !!searchKeyword && searchType === "postalcode" }
|
|
1675
|
+
);
|
|
1676
|
+
const { data: standardizedData } = method.useSearchAddressStandardizationQuery(standardizationParams, {
|
|
1677
|
+
enabled: !!standardizationParams?.baseAddress
|
|
1678
|
+
});
|
|
1572
1679
|
const [nextButtonDisabled, setNextButtonDisabled] = React.useState(false);
|
|
1573
1680
|
const onNext = () => {
|
|
1574
1681
|
if (step === "search-result") {
|
|
1575
1682
|
setStep("detail-input");
|
|
1576
1683
|
setNextButtonDisabled(true);
|
|
1684
|
+
if (selectedAddress) {
|
|
1685
|
+
setStandardizationParams({
|
|
1686
|
+
firstPostalCode: selectedAddress.firstPostalCode,
|
|
1687
|
+
secondPostalCode: selectedAddress.secondPostalCode,
|
|
1688
|
+
baseAddress: selectedAddress.roadNameBaseAddress,
|
|
1689
|
+
detailAddress: selectedAddress.roadNameDetailAddress,
|
|
1690
|
+
roadNameYn: "Y"
|
|
1691
|
+
});
|
|
1692
|
+
}
|
|
1577
1693
|
} else {
|
|
1578
|
-
setValue({
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
zipCode: selectedAddress?.zipCode || "",
|
|
1582
|
-
detail: detailAddressInput || ""
|
|
1694
|
+
selectedStandardizationAddress && setValue({
|
|
1695
|
+
...selectedStandardizationAddress,
|
|
1696
|
+
detailAddressInput
|
|
1583
1697
|
});
|
|
1584
1698
|
onClose();
|
|
1585
1699
|
}
|
|
@@ -1594,9 +1708,11 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1594
1708
|
return;
|
|
1595
1709
|
}
|
|
1596
1710
|
if (searchInput && searchInput.length > 1) {
|
|
1711
|
+
const isNumeric = /^[0-9]+$/.test(searchInput);
|
|
1712
|
+
setSearchType(isNumeric ? "postalcode" : "address");
|
|
1597
1713
|
setSearchKeyword(searchInput);
|
|
1598
1714
|
setStep("search-result");
|
|
1599
|
-
setSelectedAddress(
|
|
1715
|
+
setSelectedAddress(void 0);
|
|
1600
1716
|
setDetailAddressInput("");
|
|
1601
1717
|
setNextButtonDisabled(true);
|
|
1602
1718
|
}
|
|
@@ -1607,19 +1723,23 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1607
1723
|
}
|
|
1608
1724
|
};
|
|
1609
1725
|
const onSelectChange = (e) => {
|
|
1610
|
-
const
|
|
1611
|
-
if (
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1726
|
+
const selected = e.target.value;
|
|
1727
|
+
if (selected) {
|
|
1728
|
+
setSelectedAddress(JSON.parse(selected));
|
|
1729
|
+
setNextButtonDisabled(false);
|
|
1730
|
+
}
|
|
1731
|
+
};
|
|
1732
|
+
const onStandardizationChange = (e) => {
|
|
1733
|
+
const selected = e.target.value;
|
|
1734
|
+
if (selected) {
|
|
1735
|
+
setSelectedStandardizationAddress(JSON.parse(selected));
|
|
1616
1736
|
setNextButtonDisabled(false);
|
|
1617
1737
|
}
|
|
1618
1738
|
};
|
|
1619
1739
|
const onClear = React.useCallback(() => {
|
|
1620
1740
|
setSearchKeyword("");
|
|
1621
1741
|
setSearchInput("");
|
|
1622
|
-
setSelectedAddress(
|
|
1742
|
+
setSelectedAddress(void 0);
|
|
1623
1743
|
setDetailAddressInput("");
|
|
1624
1744
|
setStep("initial");
|
|
1625
1745
|
}, []);
|
|
@@ -1632,19 +1752,39 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1632
1752
|
setNextButtonDisabled(true);
|
|
1633
1753
|
}
|
|
1634
1754
|
};
|
|
1755
|
+
React.useEffect(() => {
|
|
1756
|
+
if (searchType === "address" && addressData?.data?.addressList) {
|
|
1757
|
+
setDisplayList(addressData.data.addressList);
|
|
1758
|
+
} else if (searchType === "postalcode" && postalData?.data?.postalCodeList) {
|
|
1759
|
+
console.log("transformedList", postalData.data.postalCodeList);
|
|
1760
|
+
const transformedList = postalData.data.postalCodeList.map((p) => ({
|
|
1761
|
+
firstPostalCode: p.originalNumber1PostalCode,
|
|
1762
|
+
secondPostalCode: p.originalNumber2PostalCode,
|
|
1763
|
+
roadNameBaseAddress: p.roadNameBaseAddress,
|
|
1764
|
+
roadNameDetailAddress: p.roadNameDetailAddress,
|
|
1765
|
+
landNumberBaseAddress: p.landNumberBaseAddress,
|
|
1766
|
+
landNumberDetailAddress: p.landNumberDetailAddress,
|
|
1767
|
+
mainBuildingName: p.mainBuildingName
|
|
1768
|
+
}));
|
|
1769
|
+
setDisplayList(transformedList);
|
|
1770
|
+
}
|
|
1771
|
+
}, [addressData, postalData, searchType]);
|
|
1635
1772
|
React.useEffect(() => {
|
|
1636
1773
|
if (isOpen) {
|
|
1637
|
-
setSelectedAddress(
|
|
1774
|
+
setSelectedAddress(void 0);
|
|
1638
1775
|
setDetailAddressInput("");
|
|
1639
1776
|
setStep("initial");
|
|
1640
1777
|
setSearchKeyword("");
|
|
1641
1778
|
}
|
|
1642
1779
|
}, [isOpen]);
|
|
1643
1780
|
return {
|
|
1781
|
+
addressStandardizationList: standardizedData?.data?.addressStandardizationList || [],
|
|
1782
|
+
selectedStandardizationAddress,
|
|
1783
|
+
onStandardizationChange,
|
|
1644
1784
|
onAddressSearchClear: onClear,
|
|
1645
1785
|
onAddressSearchNext: onNext,
|
|
1646
1786
|
addressSearchKeyword: searchKeyword,
|
|
1647
|
-
addressSearchList:
|
|
1787
|
+
addressSearchList: displayList,
|
|
1648
1788
|
addressSearchStep: step,
|
|
1649
1789
|
selectedAddress,
|
|
1650
1790
|
addressSearchOnValueChange: onSelectChange,
|
|
@@ -1659,7 +1799,7 @@ function useSearchAddress({ setValue, onClose, isOpen }) {
|
|
|
1659
1799
|
};
|
|
1660
1800
|
}
|
|
1661
1801
|
const useAddressComponent = () => {
|
|
1662
|
-
const [fullAddress, setFullAddress] = React.useState(
|
|
1802
|
+
const [fullAddress, setFullAddress] = React.useState();
|
|
1663
1803
|
const { isOpen, closeModal, openModal } = salesFrontendDesignSystem.useModalState();
|
|
1664
1804
|
const AddressSearchComponent = () => /* @__PURE__ */ jsxRuntime.jsx(AddressComponent, { isOpen, onClose: closeModal, setValue: setFullAddress });
|
|
1665
1805
|
return {
|
|
@@ -2310,34 +2450,20 @@ const JobSearchModal = ({ onClose }) => {
|
|
|
2310
2450
|
] });
|
|
2311
2451
|
};
|
|
2312
2452
|
|
|
2313
|
-
const mockCustomers = [
|
|
2314
|
-
{ customerId: "1", customerName: "\uAE40\uD55C\uD654", birthDate: "1999.01.01", genderCode: "\uB0A8\uC131" },
|
|
2315
|
-
{
|
|
2316
|
-
customerId: "2",
|
|
2317
|
-
customerName: "\uAE40\uD55C\uD654\uC0DD\uBA85",
|
|
2318
|
-
birthDate: "1989.01.01",
|
|
2319
|
-
genderCode: "\uC5EC\uC131",
|
|
2320
|
-
baseAddress: "\uC11C\uC6B8\uC2DC \uB9C8\uD3EC\uAD6C"
|
|
2321
|
-
},
|
|
2322
|
-
{
|
|
2323
|
-
customerId: "3",
|
|
2324
|
-
customerName: "\uAE40\uD55C\uD654\uC190\uD574\uBCF4\uD5D8",
|
|
2325
|
-
birthDate: "1999.01.01",
|
|
2326
|
-
genderCode: "\uB0A8\uC131",
|
|
2327
|
-
baseAddress: "\uC11C\uC6B8\uC2DC \uB9C8\uD3EC\uAD6C"
|
|
2328
|
-
}
|
|
2329
|
-
];
|
|
2330
2453
|
const useCustomerSearch = (onSelect) => {
|
|
2331
2454
|
const { triggerRef, isOpen, setIsOpen, DropDown } = salesFrontendDesignSystem.useDropDown();
|
|
2332
2455
|
const [searchKeyword, setSearchKeyword] = React.useState("");
|
|
2333
2456
|
const [searchInput, setSearchInput] = React.useState("");
|
|
2334
2457
|
const [customerList, setCustomerList] = React.useState([]);
|
|
2335
2458
|
const [selectedCustomer, setSelectedCustomer] = React.useState(null);
|
|
2459
|
+
const { data } = method.useSearchCustomerListQuery({ customerName: searchKeyword });
|
|
2336
2460
|
const search = () => {
|
|
2337
2461
|
if (searchInput.length >= 2) {
|
|
2338
2462
|
setSearchKeyword(searchInput);
|
|
2339
|
-
const filtered =
|
|
2340
|
-
|
|
2463
|
+
const filtered = data?.data?.custList?.filter(
|
|
2464
|
+
(c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase())
|
|
2465
|
+
);
|
|
2466
|
+
setCustomerList(filtered || []);
|
|
2341
2467
|
setIsOpen(true);
|
|
2342
2468
|
} else {
|
|
2343
2469
|
setCustomerList([]);
|