sales-frontend-components 0.0.187 → 0.0.189

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
@@ -146,6 +146,16 @@ var isClient = () => {
146
146
  return false;
147
147
  }
148
148
  };
149
+ var getBusinessWorkDivisionCode = () => {
150
+ return location.pathname.split("/")[1] ?? "";
151
+ };
152
+ var getServicePath = () => {
153
+ if (typeof window.isStorybookEnv === "boolean") {
154
+ return "";
155
+ } else {
156
+ return `/${getBusinessWorkDivisionCode()}`;
157
+ }
158
+ };
149
159
  var isAndroidDevice = () => {
150
160
  if (isClient() === false) {
151
161
  return false;
@@ -3004,53 +3014,64 @@ function useJobSearchModal() {
3004
3014
  openModal();
3005
3015
  };
3006
3016
  const closeModalWithCheck = () => {
3007
- setIsConfirmed(true);
3008
3017
  if (!selectedJob) {
3009
3018
  salesFrontendDesignSystem.ModalUtils.alert("\uC9C1\uC885\uC744 \uC120\uD0DD\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uC9C1\uC885 \uC120\uD0DD \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574\uC8FC\uC138\uC694.", "\uC9C1\uC885\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694.", {
3010
3019
  modalId: "job-search-alert-no-selected"
3011
3020
  });
3012
3021
  return;
3013
3022
  }
3023
+ setIsConfirmed(true);
3014
3024
  closeModal();
3015
3025
  };
3016
3026
  return {
3017
- JobSearchModal: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
3018
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
3019
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
3020
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885 \uAC80\uC0C9", showCloseButton: true }),
3021
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { raw: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3022
- JobSearch,
3023
- {
3024
- firstCategory,
3025
- firstCategoryList,
3026
- secondCategoryList,
3027
- setFirstCategory,
3028
- secondCategory,
3029
- activeTab,
3030
- onTabChange,
3031
- searchTerm,
3032
- setSearchInput,
3033
- filteredJobs: filteredJobs || [],
3034
- onJobSelect: handleJobSelect,
3035
- searchInput,
3036
- setSearchTerm,
3037
- setSecondCategory,
3038
- isLoading
3039
- }
3040
- ) }),
3041
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(
3042
- salesFrontendDesignSystem.Button,
3043
- {
3044
- variant: "primary",
3045
- size: "medium",
3046
- appearance: "filled",
3047
- width: "full",
3048
- onClick: closeModalWithCheck,
3049
- children: "\uD655\uC778"
3050
- }
3051
- ) })
3052
- ] })
3053
- ] }),
3027
+ JobSearchModal: /* @__PURE__ */ jsxRuntime.jsxs(
3028
+ salesFrontendDesignSystem.Modal.Root,
3029
+ {
3030
+ isOpen,
3031
+ onClose: () => {
3032
+ closeModal();
3033
+ setIsConfirmed(false);
3034
+ },
3035
+ modalSize: "xlarge",
3036
+ children: [
3037
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
3038
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
3039
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885 \uAC80\uC0C9", showCloseButton: true }),
3040
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { raw: true, children: /* @__PURE__ */ jsxRuntime.jsx(
3041
+ JobSearch,
3042
+ {
3043
+ firstCategory,
3044
+ firstCategoryList,
3045
+ secondCategoryList,
3046
+ setFirstCategory,
3047
+ secondCategory,
3048
+ activeTab,
3049
+ onTabChange,
3050
+ searchTerm,
3051
+ setSearchInput,
3052
+ filteredJobs: filteredJobs || [],
3053
+ onJobSelect: handleJobSelect,
3054
+ searchInput,
3055
+ setSearchTerm,
3056
+ setSecondCategory,
3057
+ isLoading
3058
+ }
3059
+ ) }),
3060
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { children: /* @__PURE__ */ jsxRuntime.jsx(
3061
+ salesFrontendDesignSystem.Button,
3062
+ {
3063
+ variant: "primary",
3064
+ size: "medium",
3065
+ appearance: "filled",
3066
+ width: "full",
3067
+ onClick: closeModalWithCheck,
3068
+ children: "\uD655\uC778"
3069
+ }
3070
+ ) })
3071
+ ] })
3072
+ ]
3073
+ }
3074
+ ),
3054
3075
  JobSearchComponent: /* @__PURE__ */ jsxRuntime.jsx(
3055
3076
  JobSearch,
3056
3077
  {
@@ -3263,57 +3284,78 @@ function useJobVehicleSearchModal() {
3263
3284
  setIsConfirmed,
3264
3285
  openJobVehicleModal: openInitModal,
3265
3286
  closeJobVehicleModal: closeModal,
3266
- JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
3267
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
3268
- /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
3269
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885\xB7\uC6B4\uC804\uCC28\uC885 \uAC80\uC0C9", showCloseButton: true }),
3270
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { className: cx$5("job-vehicle-search-modal"), raw: true, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3271
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("left-panel"), children: [
3272
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-section"), children: [
3273
- /* @__PURE__ */ jsxRuntime.jsxs(
3274
- "div",
3275
- {
3276
- className: cx$5("card-menu", { "card-selected": rightPanelView === "jobSearch" }),
3277
- onClick: () => setRightPanelView("jobSearch"),
3278
- children: [
3279
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-title"), children: [
3280
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconIllustJob, { className: cx$5("card-icon") }),
3281
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$5("card-text", "typo-title5", "text-body"), children: "\uC9C1\uC885" }),
3282
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconSubUiArrowRight, {})
3283
- ] }),
3284
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typo-body2 text-body_2", children: selectedJob ? selectedJob.occupationIndustryName : "\uBBF8\uC120\uD0DD" })
3285
- ]
3286
- }
3287
- ),
3288
- /* @__PURE__ */ jsxRuntime.jsxs(
3289
- "div",
3290
- {
3291
- className: cx$5("card-menu", { "card-selected": rightPanelView === "vehicleSelection" }),
3292
- onClick: () => setRightPanelView("vehicleSelection"),
3293
- children: [
3294
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-title"), children: [
3295
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconIllustVehicle, { className: cx$5("card-icon") }),
3296
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$5("card-text", "typo-title5", "text-body"), children: "\uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885" }),
3297
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconSubUiArrowRight, {})
3298
- ] }),
3299
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "typo-body2 text-body_2", children: [
3300
- selectedVehicle?.integrationCodeValueName,
3301
- selectedVehicle?.integrationCodeValue || "\uBBF8\uC120\uD0DD"
3302
- ] })
3303
- ]
3304
- }
3305
- )
3306
- ] }),
3307
- /* @__PURE__ */ jsxRuntime.jsx(JobVehicleSearchGrade, { riskGrade, hospitalizationGrade })
3308
- ] }),
3309
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$5("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
3310
- ] }) }),
3311
- /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Button, { variant: "primary", size: "medium", appearance: "filled", width: "full", onClick: () => {
3312
- validate();
3313
- setIsConfirmed(true);
3314
- }, children: "\uD655\uC778" }) })
3315
- ] })
3316
- ] })
3287
+ JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(
3288
+ salesFrontendDesignSystem.Modal.Root,
3289
+ {
3290
+ isOpen,
3291
+ onClose: () => {
3292
+ closeModal();
3293
+ setIsConfirmed(false);
3294
+ },
3295
+ modalSize: "xlarge",
3296
+ children: [
3297
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
3298
+ /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { style: { height: "697px" }, children: [
3299
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC9C1\uC885\xB7\uC6B4\uC804\uCC28\uC885 \uAC80\uC0C9", showCloseButton: true }),
3300
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Body, { className: cx$5("job-vehicle-search-modal"), raw: true, children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3301
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("left-panel"), children: [
3302
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-section"), children: [
3303
+ /* @__PURE__ */ jsxRuntime.jsxs(
3304
+ "div",
3305
+ {
3306
+ className: cx$5("card-menu", { "card-selected": rightPanelView === "jobSearch" }),
3307
+ onClick: () => setRightPanelView("jobSearch"),
3308
+ children: [
3309
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-title"), children: [
3310
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconIllustJob, { className: cx$5("card-icon") }),
3311
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$5("card-text", "typo-title5", "text-body"), children: "\uC9C1\uC885" }),
3312
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconSubUiArrowRight, {})
3313
+ ] }),
3314
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "typo-body2 text-body_2", children: selectedJob ? selectedJob.occupationIndustryName : "\uBBF8\uC120\uD0DD" })
3315
+ ]
3316
+ }
3317
+ ),
3318
+ /* @__PURE__ */ jsxRuntime.jsxs(
3319
+ "div",
3320
+ {
3321
+ className: cx$5("card-menu", { "card-selected": rightPanelView === "vehicleSelection" }),
3322
+ onClick: () => setRightPanelView("vehicleSelection"),
3323
+ children: [
3324
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$5("card-title"), children: [
3325
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconIllustVehicle, { className: cx$5("card-icon") }),
3326
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$5("card-text", "typo-title5", "text-body"), children: "\uC6B4\uC804 \uC5EC\uBD80\xB7\uCC28\uC885" }),
3327
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconSubUiArrowRight, {})
3328
+ ] }),
3329
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "typo-body2 text-body_2", children: [
3330
+ selectedVehicle?.integrationCodeValueName,
3331
+ selectedVehicle?.integrationCodeValue || "\uBBF8\uC120\uD0DD"
3332
+ ] })
3333
+ ]
3334
+ }
3335
+ )
3336
+ ] }),
3337
+ /* @__PURE__ */ jsxRuntime.jsx(JobVehicleSearchGrade, { riskGrade, hospitalizationGrade })
3338
+ ] }),
3339
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$5("right-panel"), children: rightPanelView === "jobSearch" ? JobSearch : VehicleSearch })
3340
+ ] }) }),
3341
+ /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Footer, { style: { marginTop: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
3342
+ salesFrontendDesignSystem.Button,
3343
+ {
3344
+ variant: "primary",
3345
+ size: "medium",
3346
+ appearance: "filled",
3347
+ width: "full",
3348
+ onClick: () => {
3349
+ validate();
3350
+ setIsConfirmed(true);
3351
+ },
3352
+ children: "\uD655\uC778"
3353
+ }
3354
+ ) })
3355
+ ] })
3356
+ ]
3357
+ }
3358
+ )
3317
3359
  };
3318
3360
  }
3319
3361
 
@@ -4557,26 +4599,9 @@ const useDownloader = () => {
4557
4599
  const [isLoading, setIsLoading] = React.useState(false);
4558
4600
  const downloadFile = async (url, fileName) => {
4559
4601
  try {
4560
- let downloadUrl = "";
4561
- if (url.startsWith("http")) {
4562
- const response = await fetch(url);
4563
- if (!response.ok) {
4564
- throw new Error(`Failed to download ${url}`);
4565
- }
4566
- const blob = await response.blob();
4567
- downloadUrl = window.URL.createObjectURL(blob);
4568
- } else if (url.startsWith("blob")) {
4569
- downloadUrl = url;
4570
- } else {
4571
- throw new Error(`unknown type : ${url}`);
4572
- }
4573
- const a = document.createElement("a");
4574
- a.href = downloadUrl;
4575
- a.download = fileName || url.split("/").pop() || "download";
4576
- document.body.appendChild(a);
4577
- a.click();
4578
- a.remove();
4579
- window.URL.revokeObjectURL(downloadUrl);
4602
+ const servicePath = getServicePath();
4603
+ const downloadUrl = `${servicePath}/internal/api/download?filename=${encodeURIComponent(fileName)}&filepath=${encodeURIComponent(url)}`;
4604
+ window.location.href = downloadUrl;
4580
4605
  } catch (e) {
4581
4606
  console.error(e);
4582
4607
  throw e;