sales-frontend-components 0.0.105 → 0.0.107
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 +109 -162
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +11 -24
- package/dist/index.esm.js +111 -163
- package/dist/index.esm.js.map +1 -1
- package/package.json +15 -15
package/dist/index.cjs.js
CHANGED
|
@@ -21,8 +21,6 @@ var styles$9 = require('./modal/pre-standard/vehicle-search-modal/vehicle-search
|
|
|
21
21
|
var styles$a = require('./modal/pre-standard/organization-search-modal/organization-search-modal.module.scss');
|
|
22
22
|
var styles$b = require('./step-indicator/step-indicator.module.scss');
|
|
23
23
|
var styles$c = require('./camera/camera.module.scss');
|
|
24
|
-
var salesFrontendStores = require('sales-frontend-stores');
|
|
25
|
-
var salesFrontendBridge = require('sales-frontend-bridge');
|
|
26
24
|
|
|
27
25
|
const FormCheckboxButton = ({
|
|
28
26
|
name,
|
|
@@ -238,12 +236,12 @@ const highlightOnSearchKeyword$1 = (originalText, targetString) => {
|
|
|
238
236
|
return originalText;
|
|
239
237
|
};
|
|
240
238
|
|
|
241
|
-
const cx$
|
|
242
|
-
const { InputBox: InputBox$
|
|
239
|
+
const cx$k = classNames.bind(styles);
|
|
240
|
+
const { InputBox: InputBox$4, Input: Input$4 } = salesFrontendDesignSystem.FormCore;
|
|
243
241
|
const AddressSearchInitialText = () => {
|
|
244
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
245
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cx$
|
|
246
|
-
/* @__PURE__ */ jsxRuntime.jsxs("ul", { className: cx$
|
|
242
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("search-result-list"), children: [
|
|
243
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: cx$k("guide-title"), children: "\uC774\uB807\uAC8C \uAC80\uC0C9\uD574 \uBCF4\uC138\uC694." }),
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsxs("ul", { className: cx$k("guide"), children: [
|
|
247
245
|
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uB3C4\uB85C\uBA85/\uC9C0\uBA85\uACFC \uAC74\uBB3C\uBC88\uD638\uB97C \uD568\uAED8 \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
|
|
248
246
|
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC608) 63\uB85C 50, \uC5EC\uC758\uB3C4\uB3D9 60" }),
|
|
249
247
|
/* @__PURE__ */ jsxRuntime.jsx("li", { children: "\uC9C0\uBA85\uC740 \uB3D9/\uC74D/\uBA74/\uB9AC\uB85C \uC785\uB825\uD574\uC8FC\uC138\uC694" }),
|
|
@@ -259,8 +257,8 @@ const AddressSearchResult = ({
|
|
|
259
257
|
searchKeyword,
|
|
260
258
|
selectedAddress
|
|
261
259
|
}) => {
|
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
263
|
-
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$
|
|
260
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("search-result-list"), children: [
|
|
261
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$k("guide-title"), children: [
|
|
264
262
|
"\uCD1D ",
|
|
265
263
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: addressSearchList.length }),
|
|
266
264
|
"\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
|
|
@@ -272,15 +270,15 @@ const AddressSearchResult = ({
|
|
|
272
270
|
return {
|
|
273
271
|
value: JSON.stringify(item),
|
|
274
272
|
select: item.roadNameBaseAddress === selectedAddress?.roadNameBaseAddress && item.roadNameDetailAddress === selectedAddress?.roadNameDetailAddress && item.mainBuildingName === selectedAddress?.mainBuildingName,
|
|
275
|
-
label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
276
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
277
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
278
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
279
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
273
|
+
label: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("search-result"), children: [
|
|
274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$k("zipcode"), children: highlightOnSearchKeyword$1(`${item.firstPostalCode}${item.secondPostalCode}`, searchKeyword) }),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$k("divider") }),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("address-info"), children: [
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$k("address"), children: highlightOnSearchKeyword$1(
|
|
280
278
|
`${item.roadNameBaseAddress} ${item.roadNameDetailAddress} ${item.mainBuildingName}`,
|
|
281
279
|
searchKeyword
|
|
282
280
|
) }),
|
|
283
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
281
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$k("old-address"), children: highlightOnSearchKeyword$1(
|
|
284
282
|
`${item.landNumberBaseAddress} ${item.landNumberDetailAddress}`,
|
|
285
283
|
searchKeyword
|
|
286
284
|
) })
|
|
@@ -289,7 +287,7 @@ const AddressSearchResult = ({
|
|
|
289
287
|
id: JSON.stringify(item)
|
|
290
288
|
};
|
|
291
289
|
}),
|
|
292
|
-
className: cx$
|
|
290
|
+
className: cx$k("radio-group"),
|
|
293
291
|
name: "address-search",
|
|
294
292
|
size: "medium",
|
|
295
293
|
defaultValue: "",
|
|
@@ -311,7 +309,7 @@ const AddressSearchDetailInput = ({
|
|
|
311
309
|
detailAddressInput
|
|
312
310
|
}) => {
|
|
313
311
|
const { land, road } = selectedStandardizationAddress;
|
|
314
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
312
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("search-result-list"), children: [
|
|
315
313
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
316
314
|
salesFrontendDesignSystem.Radio.Root,
|
|
317
315
|
{
|
|
@@ -321,21 +319,21 @@ const AddressSearchDetailInput = ({
|
|
|
321
319
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
322
320
|
salesFrontendDesignSystem.Radio.Item,
|
|
323
321
|
{
|
|
324
|
-
className: cx$
|
|
322
|
+
className: cx$k("radio-group"),
|
|
325
323
|
value: JSON.stringify(selectedStandardizationAddress),
|
|
326
324
|
onChange: onStandardizationChange,
|
|
327
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
325
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("search-result"), children: [
|
|
328
326
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
329
327
|
"div",
|
|
330
328
|
{
|
|
331
|
-
className: cx$
|
|
329
|
+
className: cx$k("zipcode"),
|
|
332
330
|
children: `${selectedStandardizationAddress.land?.firstPostalCode}${land?.secondPostalCode}`
|
|
333
331
|
}
|
|
334
332
|
),
|
|
335
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
336
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
337
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
338
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$k("divider") }),
|
|
334
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$k("address-info"), children: [
|
|
335
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$k("address"), children: `${road?.baseAddress} ${road?.detailAddress}` }),
|
|
336
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$k("old-address"), children: `${land?.baseAddress} ${land?.detailAddress}` })
|
|
339
337
|
] })
|
|
340
338
|
] })
|
|
341
339
|
}
|
|
@@ -392,8 +390,8 @@ function AddressComponent({ isOpen, onClose, setValue }) {
|
|
|
392
390
|
/* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
|
|
393
391
|
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uC8FC\uC18C \uAC80\uC0C9", showCloseButton: true }),
|
|
394
392
|
/* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
|
|
395
|
-
/* @__PURE__ */ jsxRuntime.jsx(InputBox$
|
|
396
|
-
Input$
|
|
393
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputBox$4, { clearable: true, endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear: onAddressSearchClear, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
394
|
+
Input$4,
|
|
397
395
|
{
|
|
398
396
|
...addressSearchStep !== "detail-input" && { autoFocus: true },
|
|
399
397
|
onChange: onSearch,
|
|
@@ -1065,7 +1063,7 @@ const useCustomerSearch = (onSelect) => {
|
|
|
1065
1063
|
};
|
|
1066
1064
|
};
|
|
1067
1065
|
|
|
1068
|
-
const cx$
|
|
1066
|
+
const cx$j = classNames.bind(styles$2);
|
|
1069
1067
|
const highlightOnSearchKeyword = (originalText, targetString) => {
|
|
1070
1068
|
if (!targetString || !originalText?.includes(targetString)) {
|
|
1071
1069
|
return originalText;
|
|
@@ -1082,7 +1080,7 @@ const highlightOnSearchKeyword = (originalText, targetString) => {
|
|
|
1082
1080
|
}
|
|
1083
1081
|
return replacedText;
|
|
1084
1082
|
};
|
|
1085
|
-
const { InputBox: InputBox$
|
|
1083
|
+
const { InputBox: InputBox$3, Input: Input$3 } = salesFrontendDesignSystem.FormCore;
|
|
1086
1084
|
const CustomerSearch = ({ onSelect }) => {
|
|
1087
1085
|
const {
|
|
1088
1086
|
triggerRef,
|
|
@@ -1097,9 +1095,9 @@ const CustomerSearch = ({ onSelect }) => {
|
|
|
1097
1095
|
onClear,
|
|
1098
1096
|
handleSelectItem
|
|
1099
1097
|
} = useCustomerSearch(onSelect);
|
|
1100
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
1101
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
1102
|
-
Input$
|
|
1098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$j("container"), children: [
|
|
1099
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$j("search-bar"), children: /* @__PURE__ */ jsxRuntime.jsx(InputBox$3, { endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1100
|
+
Input$3,
|
|
1103
1101
|
{
|
|
1104
1102
|
onChange: onSearchInputChange,
|
|
1105
1103
|
onKeyUp,
|
|
@@ -1109,14 +1107,14 @@ const CustomerSearch = ({ onSelect }) => {
|
|
|
1109
1107
|
ref: triggerRef
|
|
1110
1108
|
}
|
|
1111
1109
|
) }) }),
|
|
1112
|
-
isOpen && customerList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(DropDown, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
1113
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$
|
|
1114
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$
|
|
1110
|
+
isOpen && customerList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(DropDown, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$j("result-container"), children: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.List, { children: customerList.map((customer) => /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.ListItem, { onClick: () => handleSelectItem(customer), selectable: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$j("customer-item"), children: [
|
|
1111
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$j("name"), children: highlightOnSearchKeyword(customer.customerName || "", searchKeyword) }),
|
|
1112
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$j("details"), children: [
|
|
1115
1113
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.birthDate }),
|
|
1116
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
1114
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$j("separator"), children: "|" }),
|
|
1117
1115
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.genderCode }),
|
|
1118
1116
|
customer.baseAddress && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1119
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$
|
|
1117
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$j("separator"), children: "|" }),
|
|
1120
1118
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.baseAddress })
|
|
1121
1119
|
] })
|
|
1122
1120
|
] })
|
|
@@ -1124,6 +1122,80 @@ const CustomerSearch = ({ onSelect }) => {
|
|
|
1124
1122
|
] });
|
|
1125
1123
|
};
|
|
1126
1124
|
|
|
1125
|
+
const cx$i = classNames.bind(styles$2);
|
|
1126
|
+
const { InputBox: InputBox$2, Input: Input$2 } = salesFrontendDesignSystem.FormCore;
|
|
1127
|
+
function CustomerSearchModal({ isOpen, closeModal, onSelect }) {
|
|
1128
|
+
const {
|
|
1129
|
+
triggerRef,
|
|
1130
|
+
searchInput,
|
|
1131
|
+
customerList,
|
|
1132
|
+
searchKeyword,
|
|
1133
|
+
onSearchInputChange,
|
|
1134
|
+
setSearchKeyword,
|
|
1135
|
+
setSearchInput,
|
|
1136
|
+
setCustomerList,
|
|
1137
|
+
onKeyUp,
|
|
1138
|
+
search,
|
|
1139
|
+
onClear,
|
|
1140
|
+
handleSelectItem
|
|
1141
|
+
} = useCustomerSearch(onSelect);
|
|
1142
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "full-screen", children: [
|
|
1143
|
+
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Overlay, {}),
|
|
1144
|
+
/* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Content, { children: [
|
|
1145
|
+
/* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.Modal.Header, { headerTitle: "\uACE0\uAC1D \uAC80\uC0C9", showCloseButton: true }),
|
|
1146
|
+
/* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Body, { children: [
|
|
1147
|
+
/* @__PURE__ */ jsxRuntime.jsx(InputBox$2, { endElement: /* @__PURE__ */ jsxRuntime.jsx(salesFrontendAssets.IconMainUiSearch, { onClick: search }), onClear, clearable: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1148
|
+
Input$2,
|
|
1149
|
+
{
|
|
1150
|
+
onChange: onSearchInputChange,
|
|
1151
|
+
onKeyUp,
|
|
1152
|
+
value: searchInput,
|
|
1153
|
+
placeholder: "\uACE0\uAC1D\uBA85\uC744 \uB450 \uAE00\uC790 \uC774\uC0C1 \uC785\uB825\uD574\uC8FC\uC138\uC694.",
|
|
1154
|
+
size: "large",
|
|
1155
|
+
ref: triggerRef
|
|
1156
|
+
}
|
|
1157
|
+
) }),
|
|
1158
|
+
searchKeyword && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cx$i("result-count"), children: [
|
|
1159
|
+
"\uCD1D ",
|
|
1160
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: customerList.length }),
|
|
1161
|
+
"\uAC74\uC758 \uAC80\uC0C9\uACB0\uACFC"
|
|
1162
|
+
] }),
|
|
1163
|
+
searchKeyword && customerList.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$i("search-result"), children: [
|
|
1164
|
+
"`",
|
|
1165
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: searchKeyword }),
|
|
1166
|
+
"`\uC5D0 \uB300\uD55C \uAC80\uC0C9\uACB0\uACFC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."
|
|
1167
|
+
] }),
|
|
1168
|
+
searchKeyword && customerList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: customerList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(salesFrontendDesignSystem.List, { rootProps: { style: { width: "100%" } }, children: customerList.map((customer) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1169
|
+
salesFrontendDesignSystem.ListItem,
|
|
1170
|
+
{
|
|
1171
|
+
onClick: () => {
|
|
1172
|
+
handleSelectItem(customer);
|
|
1173
|
+
setSearchKeyword("");
|
|
1174
|
+
setSearchInput("");
|
|
1175
|
+
setCustomerList([]);
|
|
1176
|
+
closeModal();
|
|
1177
|
+
},
|
|
1178
|
+
selectable: true,
|
|
1179
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$i("customer-item", "modal"), children: [
|
|
1180
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx$i("name"), children: highlightOnSearchKeyword$1(customer.customerName || "", searchKeyword) }),
|
|
1181
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx$i("details", "modal"), children: [
|
|
1182
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.birthDate }),
|
|
1183
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$i("separator"), children: "|" }),
|
|
1184
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.genderCode }),
|
|
1185
|
+
customer.baseAddress && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1186
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx$i("separator"), children: "|" }),
|
|
1187
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: customer.baseAddress })
|
|
1188
|
+
] })
|
|
1189
|
+
] })
|
|
1190
|
+
] })
|
|
1191
|
+
},
|
|
1192
|
+
customer.customerId
|
|
1193
|
+
)) }) })
|
|
1194
|
+
] })
|
|
1195
|
+
] })
|
|
1196
|
+
] });
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1127
1199
|
const cx$h = classNames.bind(styles$3);
|
|
1128
1200
|
const { InputBox: InputBox$1, Input: Input$1 } = salesFrontendDesignSystem.FormCore;
|
|
1129
1201
|
const favoriteList = [
|
|
@@ -3981,135 +4053,11 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
3981
4053
|
};
|
|
3982
4054
|
};
|
|
3983
4055
|
|
|
3984
|
-
const getFormFactor = () => {
|
|
3985
|
-
const { pathname } = location;
|
|
3986
|
-
if (pathname) {
|
|
3987
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
3988
|
-
if (segments.length >= 2) {
|
|
3989
|
-
const secondSegment = segments[1]?.toLowerCase();
|
|
3990
|
-
if (secondSegment === "mobile") {
|
|
3991
|
-
return "phone";
|
|
3992
|
-
}
|
|
3993
|
-
if (secondSegment === "tablet") {
|
|
3994
|
-
return "tablet";
|
|
3995
|
-
}
|
|
3996
|
-
if (secondSegment === "pc") {
|
|
3997
|
-
return "pc";
|
|
3998
|
-
}
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
return salesFrontendUtils.getFormFactorFromUserAgent(navigator.userAgent);
|
|
4002
|
-
};
|
|
4003
|
-
const createPureWebClientSession = async () => {
|
|
4004
|
-
const hasAccessToken = !!salesFrontendUtils.getCookie("accessToken");
|
|
4005
|
-
return {
|
|
4006
|
-
isInitialized: true,
|
|
4007
|
-
isLoggedIn: hasAccessToken,
|
|
4008
|
-
isWebView: false,
|
|
4009
|
-
acceptLanguage: navigator.language || "ko",
|
|
4010
|
-
formFactor: getFormFactor(),
|
|
4011
|
-
deviceId: salesFrontendUtils.getOrCreateDeviceId(),
|
|
4012
|
-
appVersion: `${salesFrontendUtils.getBrowserName(navigator.userAgent)} ${salesFrontendUtils.getBrowserVersion(navigator.userAgent)}`,
|
|
4013
|
-
loginType: "web-login",
|
|
4014
|
-
platformName: salesFrontendUtils.getOSName(navigator.userAgent),
|
|
4015
|
-
platformVersion: salesFrontendUtils.getOSVersion(navigator.userAgent),
|
|
4016
|
-
deviceModel: salesFrontendUtils.getDeviceModel(),
|
|
4017
|
-
loginChannel: salesFrontendUtils.isSalesPortal() ? "HMP" : "ETC"
|
|
4018
|
-
};
|
|
4019
|
-
};
|
|
4020
|
-
const createWebviewClientSession = async () => {
|
|
4021
|
-
const [appInfo, accessToken] = await Promise.allSettled([
|
|
4022
|
-
salesFrontendBridge.Bridge.native.getAppInfo(),
|
|
4023
|
-
salesFrontendUtils.isFpPlannerApp() ? Promise.resolve(salesFrontendUtils.getCookie("accessToken")) : salesFrontendBridge.Bridge.native.getAccessToken().then((res) => res.accessToken)
|
|
4024
|
-
]);
|
|
4025
|
-
const appInfoData = appInfo.status === "fulfilled" ? appInfo.value : null;
|
|
4026
|
-
const isLoggedIn = accessToken.status === "fulfilled" ? !!accessToken.value : false;
|
|
4027
|
-
const formFactor = appInfoData?.["X-Channel-FormFactor"]?.toLowerCase() ?? salesFrontendUtils.getCookie("formFactor")?.toLowerCase() ?? getFormFactor();
|
|
4028
|
-
const loginChannel = appInfoData?.["X-Channel-LoginChannel"] ?? salesFrontendUtils.getCookie("loginChannel") ?? "DSP";
|
|
4029
|
-
return {
|
|
4030
|
-
isInitialized: true,
|
|
4031
|
-
isLoggedIn,
|
|
4032
|
-
isWebView: true,
|
|
4033
|
-
acceptLanguage: appInfoData?.["Accept-Language"] ?? "ko",
|
|
4034
|
-
formFactor,
|
|
4035
|
-
deviceId: appInfoData?.["X-Channel-DeviceId"] ?? salesFrontendUtils.getCookie("deviceId"),
|
|
4036
|
-
appVersion: appInfoData?.["X-Channel-AppVersion"] ?? salesFrontendUtils.getCookie("appVersion"),
|
|
4037
|
-
loginType: appInfoData?.["X-Channel-LoginType"] ?? salesFrontendUtils.getCookie("loginType"),
|
|
4038
|
-
platformName: appInfoData?.["X-Channel-PlatformName"] ?? salesFrontendUtils.getCookie("platformName"),
|
|
4039
|
-
platformVersion: appInfoData?.["X-Channel-PlatformVersion"] ?? salesFrontendUtils.getCookie("platformVersion"),
|
|
4040
|
-
deviceModel: appInfoData?.["X-Channel-DeviceModel"] ?? salesFrontendUtils.getCookie("deviceModel"),
|
|
4041
|
-
loginChannel
|
|
4042
|
-
};
|
|
4043
|
-
};
|
|
4044
|
-
const getLoginUserInfo = async () => {
|
|
4045
|
-
try {
|
|
4046
|
-
const { isSuccess, data } = await method.getUserProfile();
|
|
4047
|
-
if (isSuccess && data) {
|
|
4048
|
-
console.log("[useSetupClientSession] \uD504\uB85C\uD544 \uB85C\uB4DC \uC131\uACF5");
|
|
4049
|
-
return data;
|
|
4050
|
-
}
|
|
4051
|
-
console.warn("[getLoginUserInfo] \uD504\uB85C\uD544 \uB85C\uB4DC \uC2E4\uD328: \uC751\uB2F5 \uC5C6\uC74C");
|
|
4052
|
-
return null;
|
|
4053
|
-
} catch (error) {
|
|
4054
|
-
console.error("[getLoginUserInfo] \uD504\uB85C\uD544 \uB85C\uB4DC \uC2E4\uD328:", error);
|
|
4055
|
-
return null;
|
|
4056
|
-
}
|
|
4057
|
-
};
|
|
4058
|
-
|
|
4059
|
-
const useSetupClientSession = () => {
|
|
4060
|
-
const { isInitialized, isLoggedIn } = salesFrontendStores.useClientSession();
|
|
4061
|
-
const setClientSession = salesFrontendStores.useSetClientSession();
|
|
4062
|
-
React.useEffect(() => {
|
|
4063
|
-
if (isInitialized) {
|
|
4064
|
-
console.log("[useSetupClientSession] Already initialized");
|
|
4065
|
-
return;
|
|
4066
|
-
}
|
|
4067
|
-
const initialize = async () => {
|
|
4068
|
-
try {
|
|
4069
|
-
console.log("[useSetupClientSession] \uCD08\uAE30\uD654 \uC2DC\uC791...");
|
|
4070
|
-
if (salesFrontendUtils.isWebView()) {
|
|
4071
|
-
console.log("[useSetupClientSession] \uC6F9\uBDF0 \uD658\uACBD \uAC10\uC9C0");
|
|
4072
|
-
setClientSession(await createWebviewClientSession());
|
|
4073
|
-
} else {
|
|
4074
|
-
console.log("[useSetupClientSession] \uC21C\uC218 \uC6F9 \uD658\uACBD \uAC10\uC9C0");
|
|
4075
|
-
setClientSession(await createPureWebClientSession());
|
|
4076
|
-
}
|
|
4077
|
-
console.log("[useSetupClientSession] \uAE30\uBCF8 \uC138\uC158 \uC124\uC815 \uC644\uB8CC");
|
|
4078
|
-
} catch (error) {
|
|
4079
|
-
console.error("[useSetupClientSession] \uCD08\uAE30\uD654 \uC2E4\uD328:", error);
|
|
4080
|
-
}
|
|
4081
|
-
};
|
|
4082
|
-
initialize();
|
|
4083
|
-
}, [isInitialized, setClientSession]);
|
|
4084
|
-
React.useEffect(() => {
|
|
4085
|
-
if (!isInitialized || !isLoggedIn) {
|
|
4086
|
-
return;
|
|
4087
|
-
}
|
|
4088
|
-
const loadUserInfo = async () => {
|
|
4089
|
-
console.log("[useSetupClientSession] \uC0AC\uC6A9\uC790 \uD504\uB85C\uD544 \uB85C\uB4DC \uC2DC\uC791...");
|
|
4090
|
-
const userInfo = await getLoginUserInfo();
|
|
4091
|
-
if (userInfo) {
|
|
4092
|
-
setClientSession(userInfo);
|
|
4093
|
-
}
|
|
4094
|
-
};
|
|
4095
|
-
loadUserInfo();
|
|
4096
|
-
}, [isInitialized, isLoggedIn, setClientSession]);
|
|
4097
|
-
return isInitialized ?? false;
|
|
4098
|
-
};
|
|
4099
|
-
|
|
4100
|
-
const ClientSessionProvider = ({ children, loadingComponent = null }) => {
|
|
4101
|
-
const isInitialized = useSetupClientSession();
|
|
4102
|
-
if (!isInitialized) {
|
|
4103
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent });
|
|
4104
|
-
}
|
|
4105
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
4106
|
-
};
|
|
4107
|
-
|
|
4108
4056
|
exports.Attachment = Attachment;
|
|
4109
4057
|
exports.BankStockSearchModal = BankStockSearchModal;
|
|
4110
4058
|
exports.CODES = CODES;
|
|
4111
|
-
exports.ClientSessionProvider = ClientSessionProvider;
|
|
4112
4059
|
exports.CustomerSearch = CustomerSearch;
|
|
4060
|
+
exports.CustomerSearchModal = CustomerSearchModal;
|
|
4113
4061
|
exports.DeaCustomerSearchModal = DeaCustomerSearchModal;
|
|
4114
4062
|
exports.EmployeeSearchModal = EmployeeSearchModal;
|
|
4115
4063
|
exports.FormCheckbox = FormCheckbox;
|
|
@@ -4139,6 +4087,5 @@ exports.useRemoteIdentityVerificationPopup = useRemoteIdentityVerificationPopup;
|
|
|
4139
4087
|
exports.useSearchAddress = useSearchAddress;
|
|
4140
4088
|
exports.useSearchNationality = useSearchNationality;
|
|
4141
4089
|
exports.useSearchVisa = useSearchVisa;
|
|
4142
|
-
exports.useSetupClientSession = useSetupClientSession;
|
|
4143
4090
|
exports.useVisaComponent = useVisaComponent;
|
|
4144
4091
|
//# sourceMappingURL=index.cjs.js.map
|