sales-frontend-components 0.0.104 → 0.0.106
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 +1 -129
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -21
- package/dist/index.esm.js +4 -130
- package/dist/index.esm.js.map +1 -1
- package/package.json +16 -16
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,
|
|
@@ -2804,6 +2802,7 @@ function useJobVehicleSearchModal() {
|
|
|
2804
2802
|
selectedVehicle,
|
|
2805
2803
|
riskGrade,
|
|
2806
2804
|
hospitalizationGrade,
|
|
2805
|
+
isOpenJobVehicleModal: isOpen,
|
|
2807
2806
|
openJobVehicleModal: openInitModal,
|
|
2808
2807
|
closeJobVehicleModal: closeModal,
|
|
2809
2808
|
JobVehicleSearchModalComponent: /* @__PURE__ */ jsxRuntime.jsxs(salesFrontendDesignSystem.Modal.Root, { isOpen, onClose: closeModal, modalSize: "xlarge", children: [
|
|
@@ -3980,135 +3979,9 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
3980
3979
|
};
|
|
3981
3980
|
};
|
|
3982
3981
|
|
|
3983
|
-
const getFormFactor = () => {
|
|
3984
|
-
const { pathname } = location;
|
|
3985
|
-
if (pathname) {
|
|
3986
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
3987
|
-
if (segments.length >= 2) {
|
|
3988
|
-
const secondSegment = segments[1]?.toLowerCase();
|
|
3989
|
-
if (secondSegment === "mobile") {
|
|
3990
|
-
return "phone";
|
|
3991
|
-
}
|
|
3992
|
-
if (secondSegment === "tablet") {
|
|
3993
|
-
return "tablet";
|
|
3994
|
-
}
|
|
3995
|
-
if (secondSegment === "pc") {
|
|
3996
|
-
return "pc";
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3999
|
-
}
|
|
4000
|
-
return salesFrontendUtils.getFormFactorFromUserAgent(navigator.userAgent);
|
|
4001
|
-
};
|
|
4002
|
-
const createPureWebClientSession = async () => {
|
|
4003
|
-
const hasAccessToken = !!salesFrontendUtils.getCookie("accessToken");
|
|
4004
|
-
return {
|
|
4005
|
-
isInitialized: true,
|
|
4006
|
-
isLoggedIn: hasAccessToken,
|
|
4007
|
-
isWebView: false,
|
|
4008
|
-
acceptLanguage: navigator.language || "ko",
|
|
4009
|
-
formFactor: getFormFactor(),
|
|
4010
|
-
deviceId: salesFrontendUtils.getOrCreateDeviceId(),
|
|
4011
|
-
appVersion: salesFrontendUtils.getBrowserVersion(navigator.userAgent),
|
|
4012
|
-
loginType: "web-login",
|
|
4013
|
-
platformName: salesFrontendUtils.getOSName(navigator.userAgent),
|
|
4014
|
-
platformVersion: salesFrontendUtils.getOSVersion(navigator.userAgent),
|
|
4015
|
-
deviceModel: salesFrontendUtils.getDeviceModel(),
|
|
4016
|
-
loginChannel: salesFrontendUtils.isSalesPortal() ? "HMP" : "ETC"
|
|
4017
|
-
};
|
|
4018
|
-
};
|
|
4019
|
-
const createWebviewClientSession = async () => {
|
|
4020
|
-
let appInfo = null;
|
|
4021
|
-
try {
|
|
4022
|
-
appInfo = await salesFrontendBridge.Bridge.native.getAppInfo();
|
|
4023
|
-
} catch (error) {
|
|
4024
|
-
console.warn("[createWebviewClientSession] getAppInfo \uC2E4\uD328, \uCFE0\uD0A4 \uAC12\uC73C\uB85C fallback:", error);
|
|
4025
|
-
}
|
|
4026
|
-
const isLoggedIn = salesFrontendUtils.isFpPlannerApp() ? !!salesFrontendUtils.getCookie("accessToken") : !!(await salesFrontendBridge.Bridge.native.getAccessToken()).accessToken;
|
|
4027
|
-
const formFactor = appInfo?.["X-Channel-FormFactor"]?.toLowerCase() ?? salesFrontendUtils.getCookie("formFactor")?.toLowerCase() ?? getFormFactor();
|
|
4028
|
-
const loginChannel = appInfo?.["X-Channel-LoginChannel"] ?? salesFrontendUtils.getCookie("loginChannel") ?? "DSP";
|
|
4029
|
-
return {
|
|
4030
|
-
isInitialized: true,
|
|
4031
|
-
isLoggedIn,
|
|
4032
|
-
isWebView: true,
|
|
4033
|
-
acceptLanguage: appInfo?.["Accept-Language"] ?? "ko",
|
|
4034
|
-
formFactor,
|
|
4035
|
-
deviceId: appInfo?.["X-Channel-DeviceId"] ?? salesFrontendUtils.getCookie("deviceId"),
|
|
4036
|
-
appVersion: appInfo?.["X-Channel-AppVersion"] ?? salesFrontendUtils.getCookie("appVersion"),
|
|
4037
|
-
loginType: appInfo?.["X-Channel-LoginType"] ?? salesFrontendUtils.getCookie("loginType"),
|
|
4038
|
-
platformName: appInfo?.["X-Channel-PlatformName"] ?? salesFrontendUtils.getCookie("platformName"),
|
|
4039
|
-
platformVersion: appInfo?.["X-Channel-PlatformVersion"] ?? salesFrontendUtils.getCookie("platformVersion"),
|
|
4040
|
-
deviceModel: appInfo?.["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
3982
|
exports.Attachment = Attachment;
|
|
4109
3983
|
exports.BankStockSearchModal = BankStockSearchModal;
|
|
4110
3984
|
exports.CODES = CODES;
|
|
4111
|
-
exports.ClientSessionProvider = ClientSessionProvider;
|
|
4112
3985
|
exports.CustomerSearch = CustomerSearch;
|
|
4113
3986
|
exports.DeaCustomerSearchModal = DeaCustomerSearchModal;
|
|
4114
3987
|
exports.EmployeeSearchModal = EmployeeSearchModal;
|
|
@@ -4139,6 +4012,5 @@ exports.useRemoteIdentityVerificationPopup = useRemoteIdentityVerificationPopup;
|
|
|
4139
4012
|
exports.useSearchAddress = useSearchAddress;
|
|
4140
4013
|
exports.useSearchNationality = useSearchNationality;
|
|
4141
4014
|
exports.useSearchVisa = useSearchVisa;
|
|
4142
|
-
exports.useSetupClientSession = useSetupClientSession;
|
|
4143
4015
|
exports.useVisaComponent = useVisaComponent;
|
|
4144
4016
|
//# sourceMappingURL=index.cjs.js.map
|