sales-frontend-components 0.0.80 → 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.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { FieldValues, UseControllerProps } from 'react-hook-form';
3
3
  import { CheckboxButtonProps, CheckboxProps, DatePickerSingleHtmlProps, DatePickerRangeHtmlProps, FormField, SegmentGroupHtmlProps, SelectProps, OptionProps } from 'sales-frontend-design-system';
4
4
  import * as sales_frontend_api_method from 'sales-frontend-api/method';
5
- import { OccupationResponseDto, AddressStandardizationResponseDto, AddressResponseDto, OrganizationProfileResponse, EmployeeProfileResponseDto, Pagination } from 'sales-frontend-api/method';
5
+ import { OccupationResponseDto, AddressStandardizationResponseDto, AddressResponseDto, OrganizationProfileResponse, EmployeeProfileResponseDto, CustomerSearchProps } from 'sales-frontend-api/method';
6
6
  import * as React$1 from 'react';
7
7
  import React__default from 'react';
8
8
 
@@ -264,42 +264,7 @@ interface JobSearchModalProps {
264
264
  }
265
265
  declare const JobSearchModal: React__default.FC<JobSearchModalProps>;
266
266
 
267
- interface DspResponseCustomerListResponseDto {
268
- /** @description 성공여부 */
269
- isSuccess?: boolean;
270
- /** @description 코드 */
271
- code?: string;
272
- /** @description 메시지 */
273
- message?: string;
274
- data?: CustomerListResponseDto;
275
- pagination?: Pagination;
276
- }
277
- interface CustomerListResponseDto {
278
- /** @description 고객목록 */
279
- custList?: CustomerDto[];
280
- /** @description 총 건수 */
281
- totalCount?: string;
282
- }
283
- /** @description 고객정보 */
284
- interface CustomerDto {
285
- /** @description 고객ID */
286
- customerId?: string;
287
- /** @description 고객명 */
288
- customerName?: string;
289
- /** @description 기본주소 */
290
- baseAddress?: string;
291
- /** @description 상세주소 */
292
- detailAddress?: string;
293
- /** @description 생년월일(YYYYMMDD) */
294
- birthDate?: string;
295
- /** @description 성별코드 */
296
- genderCode?: string;
297
- }
298
- interface CustomerSearchProps {
299
- onSelect?: (customer: CustomerDto) => void;
300
- }
301
-
302
267
  declare const CustomerSearch: ({ onSelect }: CustomerSearchProps) => react_jsx_runtime.JSX.Element;
303
268
 
304
269
  export { Attachment, BankStockSearchModal, CustomerSearch, EmployeeSearchModal, FormCheckbox, FormCheckboxButton, FormDatePicker, FormDateRangePicker, FormSearchJobField, FormSegmentGroup, FormSelect, FormTextField, JobSearchModal, OrganizationSearchModal, StepIndicator, resize, testSignatureBase64Data, useAddressComponent, useBankStockSearch, useCamera, useCanvasPaint, useJobVehicleSearchModal, useSearchAddress };
305
- export type { AttachedPhoto, AttachmentProps, BankStockItem, BankStockSearchModalProps, CustomerDto, CustomerListResponseDto, CustomerSearchProps, DownloadProps, DspResponseCustomerListResponseDto, PaintProps, Pen, StepIndicatorProps, StepItem, cameraItemType, cameraOptions };
270
+ export type { AttachedPhoto, AttachmentProps, BankStockItem, BankStockSearchModalProps, DownloadProps, PaintProps, Pen, StepIndicatorProps, StepItem, cameraItemType, cameraOptions };
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useController } from 'react-hook-form';
3
3
  import { CheckboxButton, Checkbox, DatePicker, DateRangePicker, Accordion, Radio, Table, Button, FormField, Select, Tab, useModalState, Modal, SegmentGroup, ModalUtils, FormCore, RadioGroup, useDropDown, List, ListItem } from 'sales-frontend-design-system';
4
4
  import React, { useState, useEffect, useRef, useCallback, useMemo } from 'react';
5
- import { useSearchOccupationQuery, useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchOrganizationQuery, useSearchEmployeeProfileQuery, useSearchVehicleQuery } from 'sales-frontend-api/method';
5
+ import { useSearchOccupationDetailQuery, useSearchOccupationQuery, useSearchAddressQuery, useSearchPostalCodeQuery, useSearchAddressStandardizationQuery, useSearchOrganizationQuery, useSearchEmployeeProfileQuery, useSearchVehicleQuery, useSearchCustomerListQuery } 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';
@@ -281,6 +281,73 @@ function JobSearchCategory({ filteredJobs, onJobSelect, searchTerm }) {
281
281
  ] }) });
282
282
  }
283
283
 
284
+ function JobSearchDetail({ occupationTypeCode, occupationIndustryCode }) {
285
+ const { data: detail } = useSearchOccupationDetailQuery({
286
+ occupationIndustryCode,
287
+ occupationIndustryTypeCode: occupationTypeCode
288
+ });
289
+ if (!detail || !detail.data) {
290
+ return null;
291
+ }
292
+ const {
293
+ /** @description 직종해설내용 */
294
+ occupationExplanationContent,
295
+ /** @description 직업예시명 */
296
+ occupationExampleName,
297
+ /** @description 위험등급명 */
298
+ riskGradeName,
299
+ /** @description 위험등급코드 */
300
+ riskGradeCode,
301
+ /** @description 상해위험등급코드명 */
302
+ injuryRiskGradeCodeName,
303
+ /** @description 상해위험등급코드 */
304
+ injuryRiskGradeCode,
305
+ /** @description 입원등급코드명 */
306
+ hospitalizationGradeCodeName,
307
+ /** @description 입원등급코드 */
308
+ hospitalizationGradeCode,
309
+ /** @description 상해직종코드 */
310
+ injuryOccupationCode
311
+ } = detail.data;
312
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Table, { variant: "horizontal", children: /* @__PURE__ */ jsxs("tbody", { children: [
313
+ /* @__PURE__ */ jsxs("tr", { children: [
314
+ /* @__PURE__ */ jsx("th", { className: "px-small", children: "\uC9C1\uC885 \uD574\uC124" }),
315
+ /* @__PURE__ */ jsx("td", { className: "px-small", children: occupationExplanationContent })
316
+ ] }),
317
+ /* @__PURE__ */ jsxs("tr", { children: [
318
+ /* @__PURE__ */ jsx("th", { className: "px-small", children: "\uC9C1\uC885 \uC608\uC2DC" }),
319
+ /* @__PURE__ */ jsx("td", { className: "px-small", children: occupationExampleName })
320
+ ] }),
321
+ /* @__PURE__ */ jsxs("tr", { children: [
322
+ /* @__PURE__ */ jsx("th", { className: "px-small", children: "\uC704\uD5D8 \uB4F1\uAE09" }),
323
+ /* @__PURE__ */ jsxs("td", { className: "px-small", children: [
324
+ riskGradeName,
325
+ "(",
326
+ riskGradeCode,
327
+ ")"
328
+ ] })
329
+ ] }),
330
+ /* @__PURE__ */ jsxs("tr", { children: [
331
+ /* @__PURE__ */ jsx("th", { className: "px-small", children: "\uC785\uC6D0 \uB4F1\uAE09" }),
332
+ /* @__PURE__ */ jsxs("td", { className: "px-small", children: [
333
+ hospitalizationGradeCodeName,
334
+ "(",
335
+ hospitalizationGradeCode,
336
+ ")"
337
+ ] })
338
+ ] }),
339
+ /* @__PURE__ */ jsxs("tr", { children: [
340
+ /* @__PURE__ */ jsx("th", { className: "px-small", children: "\uC0C1\uD574 \uB4F1\uAE09" }),
341
+ /* @__PURE__ */ jsxs("td", { className: "px-small", children: [
342
+ injuryRiskGradeCodeName,
343
+ "(",
344
+ injuryRiskGradeCode,
345
+ ")"
346
+ ] })
347
+ ] })
348
+ ] }) }) });
349
+ }
350
+
284
351
  const cx$d = classNames.bind(styles);
285
352
  function JobSearchFavorite({ filteredJobs, onJobSelect }) {
286
353
  return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("div", { className: cx$d("popular-jobs"), children: [
@@ -306,7 +373,13 @@ function JobSearchFavorite({ filteredJobs, onJobSelect }) {
306
373
  ]
307
374
  }
308
375
  ) }),
309
- /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: "\uD56D\uBAA9 1 \uB0B4\uC6A9" })
376
+ /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx(
377
+ JobSearchDetail,
378
+ {
379
+ occupationTypeCode: job.occupationTypeCode || "",
380
+ occupationIndustryCode: job.occupationIndustryCode
381
+ }
382
+ ) })
310
383
  ]
311
384
  },
312
385
  `item-${job.occupationIndustryCode}-${index}`
@@ -339,22 +412,13 @@ function JobSearchResult({ filteredJobs, onJobSelect, searchTerm }) {
339
412
  children: highlightOnSearchKeyword$1(job.occupationIndustryName, searchTerm)
340
413
  }
341
414
  ) }) }),
342
- /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx(Table, { variant: "horizontal", children: /* @__PURE__ */ jsxs("tbody", { children: [
343
- /* @__PURE__ */ jsxs("tr", { children: [
344
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 1" }),
345
- /* @__PURE__ */ jsx("td", { className: "px-24", children: "1\uD589 1\uBC88\uC9F8" }),
346
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 1-2" }),
347
- /* @__PURE__ */ jsx("td", { className: "px-24 ", children: "1\uD589 2\uBC88\uC9F8" })
348
- ] }),
349
- /* @__PURE__ */ jsxs("tr", { children: [
350
- /* @__PURE__ */ jsx("th", { children: "\uD5E4\uB354 2" }),
351
- /* @__PURE__ */ jsx("td", { className: "pl-24 pr-16", colSpan: 3, children: /* @__PURE__ */ jsxs("p", { className: "d-flex-center-center", children: [
352
- "2\uD589 1\uBC88\uC9F8 ",
353
- /* @__PURE__ */ jsx("span", { className: "flex-1 pipe-left", children: "\uC11C\uBE0C\uD14D\uC2A4\uD2B8" }),
354
- /* @__PURE__ */ jsx(Button, { variant: "neutral", size: "xsmall", appearance: "outline", children: "\uBC84\uD2BC\uBA85" })
355
- ] }) })
356
- ] })
357
- ] }) }) })
415
+ /* @__PURE__ */ jsx(Accordion.Content, { variant: "text", children: /* @__PURE__ */ jsx(
416
+ JobSearchDetail,
417
+ {
418
+ occupationTypeCode: job.occupationTypeCode || "",
419
+ occupationIndustryCode: job.occupationIndustryCode
420
+ }
421
+ ) })
358
422
  ]
359
423
  },
360
424
  job.occupationIndustryCode
@@ -2384,34 +2448,20 @@ const JobSearchModal = ({ onClose }) => {
2384
2448
  ] });
2385
2449
  };
2386
2450
 
2387
- const mockCustomers = [
2388
- { customerId: "1", customerName: "\uAE40\uD55C\uD654", birthDate: "1999.01.01", genderCode: "\uB0A8\uC131" },
2389
- {
2390
- customerId: "2",
2391
- customerName: "\uAE40\uD55C\uD654\uC0DD\uBA85",
2392
- birthDate: "1989.01.01",
2393
- genderCode: "\uC5EC\uC131",
2394
- baseAddress: "\uC11C\uC6B8\uC2DC \uB9C8\uD3EC\uAD6C"
2395
- },
2396
- {
2397
- customerId: "3",
2398
- customerName: "\uAE40\uD55C\uD654\uC190\uD574\uBCF4\uD5D8",
2399
- birthDate: "1999.01.01",
2400
- genderCode: "\uB0A8\uC131",
2401
- baseAddress: "\uC11C\uC6B8\uC2DC \uB9C8\uD3EC\uAD6C"
2402
- }
2403
- ];
2404
2451
  const useCustomerSearch = (onSelect) => {
2405
2452
  const { triggerRef, isOpen, setIsOpen, DropDown } = useDropDown();
2406
2453
  const [searchKeyword, setSearchKeyword] = useState("");
2407
2454
  const [searchInput, setSearchInput] = useState("");
2408
2455
  const [customerList, setCustomerList] = useState([]);
2409
2456
  const [selectedCustomer, setSelectedCustomer] = useState(null);
2457
+ const { data } = useSearchCustomerListQuery({ customerName: searchKeyword });
2410
2458
  const search = () => {
2411
2459
  if (searchInput.length >= 2) {
2412
2460
  setSearchKeyword(searchInput);
2413
- const filtered = mockCustomers.filter((c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase()));
2414
- setCustomerList(filtered);
2461
+ const filtered = data?.data?.custList?.filter(
2462
+ (c) => c.customerName?.toLowerCase().includes(searchInput.toLowerCase())
2463
+ );
2464
+ setCustomerList(filtered || []);
2415
2465
  setIsOpen(true);
2416
2466
  } else {
2417
2467
  setCustomerList([]);