@bwg-ui/core 1.2.30 → 1.2.31
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceCodeContext.d.ts","sourceRoot":"","sources":["../../../src/provider/contexts/ServiceCodeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ServiceCodeContext.d.ts","sourceRoot":"","sources":["../../../src/provider/contexts/ServiceCodeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EACF,SAAS,EAGV,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,cAAc,EAEf,MAAM,2BAA2B,CAAC;AAGnC,UAAU,sBAAsB;IAC9B,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;IACtD,cAAc,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,MAAM,CAAC;CACjD;AAMD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC,wBAAwB,CA2C5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,QAAO,sBAMjC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,cAAc,KAAG,MAGzD,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,QAAO,MAAM,CAAC,cAAc,EAAE,MAAM,CASlE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,QAAO,IAU1C,CAAC;AAGF,YAAY,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/provider/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),O=require("../stores/index.cjs"),l=require("react/jsx-runtime"),V=require("antd"),y=require("../utils/index.cjs"),F=r.createContext(null),_=({children:e,serviceCodes:t={}})=>{y.setServiceCodeOverrides(t),r.useLayoutEffect(()=>{y.setServiceCodeOverrides(t)},[t]);const i={serviceCodes:t,getServiceCode:n=>t[n]&&t[n].trim()!==""?t[n]:y.DEFAULT_SERVICE_CODES[n]};return l.jsx(F.Provider,{value:i,children:e})},P=()=>{const e=r.useContext(F);if(!e)throw new Error("useServiceCode must be used within a ServiceCodeProvider");return e},U=e=>{const{getServiceCode:t}=P();return t(e)},q=()=>{const{getServiceCode:e}=P(),t={};for(const o of Object.keys(y.DEFAULT_SERVICE_CODES))t[o]=e(o);return t},G=()=>{const{getServiceCode:e}=P();console.log("🔧 bwg-core 서비스코드 설정:"),console.log("📋 Provider 설정 > 기본값 순서로 확인");for(const t of Object.keys(y.DEFAULT_SERVICE_CODES)){const o=e(t);console.log(` ${t}: ${o}`)}},A=r.createContext(null),M=({children:e})=>{const t=r.useRef(null),C={searchBoxRef:t,getFormData:()=>t.current?.getFormData()||{},setFormData:a=>{t.current?.setFormData(a)},resetForm:()=>{t.current?.resetForm()},validateForm:async()=>await t.current?.validateForm()||{success:!1,error:null}};return l.jsx(A.Provider,{value:C,children:e})},W=()=>{const e=r.useContext(A);if(!e)throw new Error("useSearchBox must be used within a SearchBoxProvider");return e},$=()=>{const{popups:e,activePopupId:t,setActivePopup:o,closePopup:i,openPopup:n,openCorePopup:u}=O.usePopupStore(),C=r.useCallback(async(h,v,s)=>{try{await n(h,v,s)}catch(c){throw console.error("팝업 열기 실패:",c),c}},[n]),a=r.useCallback((h,v)=>{try{u(h,v)}catch(s){throw console.error("로컬 팝업 열기 실패:",s),s}},[u]);return{popups:e,activePopupId:t,setActivePopup:o,closePopup:i,showPopup:C,openCorePopup:a,isPopup:e.length>0}},I=r.createContext(null),z=()=>{const e=r.useContext(I);if(!e)throw new Error("useAuth must be used within AuthProvider");return e},J=({children:e})=>{const[t,o]=r.useState(!1),[i,n]=r.useState(!1),u=async s=>{const c=(await s.text()).trim().toLowerCase();try{const d=JSON.parse(c);if(typeof d=="object"&&d&&(d.ok===!0||d.success===!0))return!0}catch{}return!!["true","ok","1","y"].includes(c)},C=async s=>{n(!0);try{const c=await fetch("/serviceEndpoint/sso_check.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"token="+encodeURIComponent(s)}),d=c.ok&&await u(c);return o(d),d}catch{return!1}finally{n(!1)}},a=async s=>{n(!0);try{const c=await fetch("/serviceEndpoint/sso_reauth.jsp",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"pin="+encodeURIComponent(s)});return c.ok&&await u(c)?(o(!0),!0):!1}catch{return!1}finally{n(!1)}},h=()=>{o(!1)},v=r.useMemo(()=>({authed:t,busy:i,verifyWithToken:C,reauthWithPin:a,logout:h}),[t,i]);return l.jsx(I.Provider,{value:v,children:e})},B=r.createContext(void 0),H=({children:e})=>{const{codeData:t,isLoading:o,error:i,lastUpdated:n,getCodeList:u,getCodeListByOption:C,getCodeName:a,getCodeColor:h,getCodeByOption:v,getAvailableGroupCodes:s,getGridLookup:c,fetchCommonCodes:d}=O.useCodeStore(),L={codeData:t,isLoading:o,error:i,lastUpdated:n,getCodeList:u,getCodeListByOption:C,getCodeName:a,getCodeColor:h,getCodeByOption:v,getAvailableGroupCodes:s,getGridLookup:c,refreshCodes:d};return l.jsx(B.Provider,{value:L,children:e})},f=()=>{const e=r.useContext(B);if(e===void 0)throw new Error("useCommonCode must be used within a CommonCodeProvider");return e},Q=()=>{const{getCodeList:e,isLoading:t,error:o}=f();return{getCodeList:e,isLoading:t,error:o}},X=()=>{const{getCodeName:e,isLoading:t,error:o}=f();return{getCodeName:e,isLoading:t,error:o}},Y=()=>{const{getCodeColor:e,isLoading:t,error:o}=f();return{getCodeColor:e,isLoading:t,error:o}},Z=()=>{const{getCodeListByOption:e,isLoading:t,error:o}=f();return{getCodeListByOption:e,isLoading:t,error:o}},K=()=>{const{getGridLookup:e,isLoading:t,error:o}=f();return{getGridLookup:e,isLoading:t,error:o}},D=r.createContext(null),ee=()=>{const e=r.useContext(D);if(!e)throw new Error("useLock must be used within ScreenProtectProvider");return e},te=({children:e,idleMs:t=1e4,onUnlock:o,persistLocked:i=!0,storageKey:n="inactivityLocked",eventTarget:u,overlayScope:C="global",overlayId:a="lock-overlay-root",overlayPosition:h="fixed"})=>{const v=i&&typeof window<"u"&&window.localStorage.getItem(n)==="1",[s,c]=r.useState(v),[d,L]=r.useState(t),k=Number.isFinite(d)&&d>0,w=r.useRef(null),T=()=>{try{i&&window.localStorage.setItem(n,"1")}catch{}c(!0)},b=async m=>{if(!(o&&!await o(m))){try{i&&window.localStorage.removeItem(n)}catch{}c(!1),k&&E()}},N=()=>{try{i&&window.localStorage.setItem(n,"1")}catch{}c(!0)},E=()=>{k&&(w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{N()},d))};r.useEffect(()=>{if(!k)return;const m=()=>{s||E()},x={passive:!0},g=["pointermove","pointerdown","keydown","wheel","touchstart"],S=u??window;return g.forEach(p=>S.addEventListener(p,m,x)),E(),()=>{w.current&&window.clearTimeout(w.current),g.forEach(p=>S.removeEventListener(p,m))}},[d,s,u,k]),r.useEffect(()=>{if(!s)return;const m=p=>{const j=document.getElementById(a);j&&j.contains(p.target)||(p.stopPropagation(),p.preventDefault())},x={capture:!0},g=["pointerdown","pointerup","pointermove","click","wheel","keydown","keyup","touchstart","touchmove"],S=C==="scoped"?u??window:window;return g.forEach(p=>S.addEventListener(p,m,x)),()=>g.forEach(p=>S.removeEventListener(p,m,x))},[s,C,a,u]);const R=r.useMemo(()=>({locked:s,lock:T,unlock:b,setIdleMs:L}),[s]);return l.jsxs(D.Provider,{value:R,children:[l.jsx("div",{style:{width:"100%",height:"100%"},...s?{inert:""}:{},...s?{"aria-hidden":!0}:{},children:e}),s&&l.jsx(oe,{onUnlock:b,overlayId:a,overlayPosition:h})]})},oe=({onUnlock:e,overlayId:t="lock-overlay-root",overlayPosition:o="fixed"})=>{const[i]=r.useState(4),[n,u]=r.useState("");return l.jsx("div",{id:t,"aria-modal":"true",role:"dialog","aria-label":"Locked screen",style:{position:o,inset:0,background:"rgba(12, 14, 18, 0.85)",backdropFilter:"blur(4px)",display:"grid",placeItems:"center",zIndex:9999},children:l.jsxs("div",{className:"lockscreen-form",style:{width:420,maxWidth:"92vw"},children:[l.jsx("div",{className:"lock-icon-wrap",children:l.jsx("span",{className:"lock-icon-box"})}),l.jsx("h2",{children:"잠금됨"}),l.jsx("p",{children:"PIN 번호를 입력하세요"}),l.jsx("div",{className:"lock-ipt-wrap",style:{display:"flex",justifyContent:"center"},children:l.jsx(V.Input.OTP,{mask:"*",autoFocus:!0,length:i,value:n,onChange:C=>{const a=(C??"").replace(/\D/g,"").slice(0,i);u(a),a.length===i&&e(a)}})})]})})};exports.AuthProvider=J;exports.CommonCodeProvider=H;exports.ScreenProtectProvider=te;exports.SearchBoxProvider=M;exports.ServiceCodeProvider=_;exports.useAllServiceCodes=q;exports.useAuth=z;exports.useCodeColor=Y;exports.useCodeList=Q;exports.useCodeListByOption=Z;exports.useCodeName=X;exports.useCommonCode=f;exports.useGridLookup=K;exports.useLock=ee;exports.useLogServiceCodeConfig=G;exports.usePopup=$;exports.useSearchBox=W;exports.useServiceCode=P;exports.useServiceCodeValue=U;
|
package/dist/provider/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { usePopupStore as
|
|
3
|
-
import { jsx as d, jsxs as
|
|
4
|
-
import { Input as
|
|
5
|
-
import { setServiceCodeOverrides as
|
|
6
|
-
const
|
|
1
|
+
import { useLayoutEffect as z, createContext as k, useContext as x, useRef as N, useCallback as B, useState as w, useMemo as j, useEffect as A } from "react";
|
|
2
|
+
import { usePopupStore as J, useCodeStore as q } from "../stores/index.js";
|
|
3
|
+
import { jsx as d, jsxs as T } from "react/jsx-runtime";
|
|
4
|
+
import { Input as H } from "antd";
|
|
5
|
+
import { setServiceCodeOverrides as D, DEFAULT_SERVICE_CODES as E } from "../utils/index.js";
|
|
6
|
+
const V = k(null), te = ({
|
|
7
7
|
children: e,
|
|
8
8
|
serviceCodes: t = {}
|
|
9
9
|
}) => {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
D(t), z(() => {
|
|
11
|
+
D(t);
|
|
12
12
|
}, [t]);
|
|
13
13
|
const c = {
|
|
14
14
|
serviceCodes: t,
|
|
15
|
-
getServiceCode: (r) => t[r] && t[r].trim() !== "" ? t[r] :
|
|
15
|
+
getServiceCode: (r) => t[r] && t[r].trim() !== "" ? t[r] : E[r]
|
|
16
16
|
};
|
|
17
|
-
return /* @__PURE__ */ d(
|
|
18
|
-
},
|
|
19
|
-
const e = x(
|
|
17
|
+
return /* @__PURE__ */ d(V.Provider, { value: c, children: e });
|
|
18
|
+
}, F = () => {
|
|
19
|
+
const e = x(V);
|
|
20
20
|
if (!e)
|
|
21
21
|
throw new Error("useServiceCode must be used within a ServiceCodeProvider");
|
|
22
22
|
return e;
|
|
23
|
-
},
|
|
24
|
-
const { getServiceCode: t } =
|
|
23
|
+
}, oe = (e) => {
|
|
24
|
+
const { getServiceCode: t } = F();
|
|
25
25
|
return t(e);
|
|
26
|
-
},
|
|
27
|
-
const { getServiceCode: e } =
|
|
28
|
-
for (const o of Object.keys(
|
|
26
|
+
}, re = () => {
|
|
27
|
+
const { getServiceCode: e } = F(), t = {};
|
|
28
|
+
for (const o of Object.keys(E))
|
|
29
29
|
t[o] = e(o);
|
|
30
30
|
return t;
|
|
31
|
-
},
|
|
32
|
-
const { getServiceCode: e } =
|
|
31
|
+
}, ne = () => {
|
|
32
|
+
const { getServiceCode: e } = F();
|
|
33
33
|
console.log("🔧 bwg-core 서비스코드 설정:"), console.log("📋 Provider 설정 > 기본값 순서로 확인");
|
|
34
|
-
for (const t of Object.keys(
|
|
34
|
+
for (const t of Object.keys(E)) {
|
|
35
35
|
const o = e(t);
|
|
36
36
|
console.log(` ${t}: ${o}`);
|
|
37
37
|
}
|
|
38
|
-
},
|
|
39
|
-
const t =
|
|
38
|
+
}, R = k(null), se = ({ children: e }) => {
|
|
39
|
+
const t = N(null), l = {
|
|
40
40
|
searchBoxRef: t,
|
|
41
41
|
getFormData: () => t.current?.getFormData() || {},
|
|
42
42
|
setFormData: (u) => {
|
|
@@ -50,13 +50,13 @@ const T = k(null), ee = ({
|
|
|
50
50
|
error: null
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
-
return /* @__PURE__ */ d(
|
|
54
|
-
},
|
|
55
|
-
const e = x(
|
|
53
|
+
return /* @__PURE__ */ d(R.Provider, { value: l, children: e });
|
|
54
|
+
}, ce = () => {
|
|
55
|
+
const e = x(R);
|
|
56
56
|
if (!e)
|
|
57
57
|
throw new Error("useSearchBox must be used within a SearchBoxProvider");
|
|
58
58
|
return e;
|
|
59
|
-
},
|
|
59
|
+
}, ie = () => {
|
|
60
60
|
const {
|
|
61
61
|
popups: e,
|
|
62
62
|
activePopupId: t,
|
|
@@ -64,19 +64,19 @@ const T = k(null), ee = ({
|
|
|
64
64
|
closePopup: c,
|
|
65
65
|
openPopup: r,
|
|
66
66
|
openCorePopup: i
|
|
67
|
-
} =
|
|
68
|
-
async (m,
|
|
67
|
+
} = J(), l = B(
|
|
68
|
+
async (m, f, n) => {
|
|
69
69
|
try {
|
|
70
|
-
await r(m,
|
|
70
|
+
await r(m, f, n);
|
|
71
71
|
} catch (s) {
|
|
72
72
|
throw console.error("팝업 열기 실패:", s), s;
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
[r]
|
|
76
|
-
), u =
|
|
77
|
-
(m,
|
|
76
|
+
), u = B(
|
|
77
|
+
(m, f) => {
|
|
78
78
|
try {
|
|
79
|
-
i(m,
|
|
79
|
+
i(m, f);
|
|
80
80
|
} catch (n) {
|
|
81
81
|
throw console.error("로컬 팝업 열기 실패:", n), n;
|
|
82
82
|
}
|
|
@@ -92,11 +92,11 @@ const T = k(null), ee = ({
|
|
|
92
92
|
openCorePopup: u,
|
|
93
93
|
isPopup: e.length > 0
|
|
94
94
|
};
|
|
95
|
-
},
|
|
96
|
-
const e = x(
|
|
95
|
+
}, G = k(null), ue = () => {
|
|
96
|
+
const e = x(G);
|
|
97
97
|
if (!e) throw new Error("useAuth must be used within AuthProvider");
|
|
98
98
|
return e;
|
|
99
|
-
},
|
|
99
|
+
}, ae = ({ children: e }) => {
|
|
100
100
|
const [t, o] = w(!1), [c, r] = w(!1), i = async (n) => {
|
|
101
101
|
const s = (await n.text()).trim().toLowerCase();
|
|
102
102
|
try {
|
|
@@ -136,14 +136,14 @@ const T = k(null), ee = ({
|
|
|
136
136
|
}
|
|
137
137
|
}, m = () => {
|
|
138
138
|
o(!1);
|
|
139
|
-
},
|
|
139
|
+
}, f = j(
|
|
140
140
|
() => ({ authed: t, busy: c, verifyWithToken: l, reauthWithPin: u, logout: m }),
|
|
141
141
|
[t, c]
|
|
142
142
|
);
|
|
143
|
-
return /* @__PURE__ */ d(
|
|
144
|
-
},
|
|
143
|
+
return /* @__PURE__ */ d(G.Provider, { value: f, children: e });
|
|
144
|
+
}, U = k(
|
|
145
145
|
void 0
|
|
146
|
-
),
|
|
146
|
+
), de = ({
|
|
147
147
|
children: e
|
|
148
148
|
}) => {
|
|
149
149
|
const {
|
|
@@ -155,11 +155,11 @@ const T = k(null), ee = ({
|
|
|
155
155
|
getCodeListByOption: l,
|
|
156
156
|
getCodeName: u,
|
|
157
157
|
getCodeColor: m,
|
|
158
|
-
getCodeByOption:
|
|
158
|
+
getCodeByOption: f,
|
|
159
159
|
getAvailableGroupCodes: n,
|
|
160
160
|
getGridLookup: s,
|
|
161
161
|
fetchCommonCodes: a
|
|
162
|
-
} =
|
|
162
|
+
} = q(), L = {
|
|
163
163
|
codeData: t,
|
|
164
164
|
isLoading: o,
|
|
165
165
|
error: c,
|
|
@@ -168,39 +168,39 @@ const T = k(null), ee = ({
|
|
|
168
168
|
getCodeListByOption: l,
|
|
169
169
|
getCodeName: u,
|
|
170
170
|
getCodeColor: m,
|
|
171
|
-
getCodeByOption:
|
|
171
|
+
getCodeByOption: f,
|
|
172
172
|
getAvailableGroupCodes: n,
|
|
173
173
|
getGridLookup: s,
|
|
174
174
|
refreshCodes: a
|
|
175
175
|
};
|
|
176
|
-
return /* @__PURE__ */ d(
|
|
176
|
+
return /* @__PURE__ */ d(U.Provider, { value: L, children: e });
|
|
177
177
|
}, P = () => {
|
|
178
|
-
const e = x(
|
|
178
|
+
const e = x(U);
|
|
179
179
|
if (e === void 0)
|
|
180
180
|
throw new Error("useCommonCode must be used within a CommonCodeProvider");
|
|
181
181
|
return e;
|
|
182
|
-
},
|
|
182
|
+
}, le = () => {
|
|
183
183
|
const { getCodeList: e, isLoading: t, error: o } = P();
|
|
184
184
|
return {
|
|
185
185
|
getCodeList: e,
|
|
186
186
|
isLoading: t,
|
|
187
187
|
error: o
|
|
188
188
|
};
|
|
189
|
-
},
|
|
189
|
+
}, pe = () => {
|
|
190
190
|
const { getCodeName: e, isLoading: t, error: o } = P();
|
|
191
191
|
return {
|
|
192
192
|
getCodeName: e,
|
|
193
193
|
isLoading: t,
|
|
194
194
|
error: o
|
|
195
195
|
};
|
|
196
|
-
},
|
|
196
|
+
}, me = () => {
|
|
197
197
|
const { getCodeColor: e, isLoading: t, error: o } = P();
|
|
198
198
|
return {
|
|
199
199
|
getCodeColor: e,
|
|
200
200
|
isLoading: t,
|
|
201
201
|
error: o
|
|
202
202
|
};
|
|
203
|
-
},
|
|
203
|
+
}, fe = () => {
|
|
204
204
|
const { getCodeListByOption: e, isLoading: t, error: o } = P();
|
|
205
205
|
return {
|
|
206
206
|
getCodeListByOption: e,
|
|
@@ -214,12 +214,12 @@ const T = k(null), ee = ({
|
|
|
214
214
|
isLoading: t,
|
|
215
215
|
error: o
|
|
216
216
|
};
|
|
217
|
-
},
|
|
218
|
-
const e = x(
|
|
217
|
+
}, _ = k(null), we = () => {
|
|
218
|
+
const e = x(_);
|
|
219
219
|
if (!e)
|
|
220
220
|
throw new Error("useLock must be used within ScreenProtectProvider");
|
|
221
221
|
return e;
|
|
222
|
-
},
|
|
222
|
+
}, ve = ({
|
|
223
223
|
children: e,
|
|
224
224
|
idleMs: t = 1e4,
|
|
225
225
|
onUnlock: o,
|
|
@@ -230,21 +230,21 @@ const T = k(null), ee = ({
|
|
|
230
230
|
overlayId: u = "lock-overlay-root",
|
|
231
231
|
overlayPosition: m = "fixed"
|
|
232
232
|
}) => {
|
|
233
|
-
const
|
|
233
|
+
const f = c && typeof window < "u" && window.localStorage.getItem(r) === "1", [n, s] = w(f), [a, L] = w(t), S = Number.isFinite(a) && a > 0, v = N(null), W = () => {
|
|
234
234
|
try {
|
|
235
235
|
c && window.localStorage.setItem(r, "1");
|
|
236
236
|
} catch {
|
|
237
237
|
}
|
|
238
238
|
s(!0);
|
|
239
|
-
},
|
|
240
|
-
if (!(o && !await o(
|
|
239
|
+
}, I = async (h) => {
|
|
240
|
+
if (!(o && !await o(h))) {
|
|
241
241
|
try {
|
|
242
242
|
c && window.localStorage.removeItem(r);
|
|
243
243
|
} catch {
|
|
244
244
|
}
|
|
245
245
|
s(!1), S && b();
|
|
246
246
|
}
|
|
247
|
-
},
|
|
247
|
+
}, M = () => {
|
|
248
248
|
try {
|
|
249
249
|
c && window.localStorage.setItem(r, "1");
|
|
250
250
|
} catch {
|
|
@@ -252,12 +252,12 @@ const T = k(null), ee = ({
|
|
|
252
252
|
s(!0);
|
|
253
253
|
}, b = () => {
|
|
254
254
|
S && (v.current && window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
255
|
-
|
|
255
|
+
M();
|
|
256
256
|
}, a));
|
|
257
257
|
};
|
|
258
|
-
|
|
258
|
+
A(() => {
|
|
259
259
|
if (!S) return;
|
|
260
|
-
const
|
|
260
|
+
const h = () => {
|
|
261
261
|
n || b();
|
|
262
262
|
}, C = { passive: !0 }, g = [
|
|
263
263
|
"pointermove",
|
|
@@ -266,14 +266,14 @@ const T = k(null), ee = ({
|
|
|
266
266
|
"wheel",
|
|
267
267
|
"touchstart"
|
|
268
268
|
], y = i ?? window;
|
|
269
|
-
return g.forEach((p) => y.addEventListener(p,
|
|
270
|
-
v.current && window.clearTimeout(v.current), g.forEach((p) => y.removeEventListener(p,
|
|
269
|
+
return g.forEach((p) => y.addEventListener(p, h, C)), b(), () => {
|
|
270
|
+
v.current && window.clearTimeout(v.current), g.forEach((p) => y.removeEventListener(p, h));
|
|
271
271
|
};
|
|
272
|
-
}, [a, n, i, S]),
|
|
272
|
+
}, [a, n, i, S]), A(() => {
|
|
273
273
|
if (!n) return;
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
|
|
274
|
+
const h = (p) => {
|
|
275
|
+
const O = document.getElementById(u);
|
|
276
|
+
O && O.contains(p.target) || (p.stopPropagation(), p.preventDefault());
|
|
277
277
|
}, C = { capture: !0 }, g = [
|
|
278
278
|
"pointerdown",
|
|
279
279
|
"pointerup",
|
|
@@ -285,13 +285,13 @@ const T = k(null), ee = ({
|
|
|
285
285
|
"touchstart",
|
|
286
286
|
"touchmove"
|
|
287
287
|
], y = l === "scoped" ? i ?? window : window;
|
|
288
|
-
return g.forEach((p) => y.addEventListener(p,
|
|
288
|
+
return g.forEach((p) => y.addEventListener(p, h, C)), () => g.forEach((p) => y.removeEventListener(p, h, C));
|
|
289
289
|
}, [n, l, u, i]);
|
|
290
|
-
const
|
|
291
|
-
() => ({ locked: n, lock:
|
|
290
|
+
const $ = j(
|
|
291
|
+
() => ({ locked: n, lock: W, unlock: I, setIdleMs: L }),
|
|
292
292
|
[n]
|
|
293
293
|
);
|
|
294
|
-
return /* @__PURE__ */
|
|
294
|
+
return /* @__PURE__ */ T(_.Provider, { value: $, children: [
|
|
295
295
|
/* @__PURE__ */ d(
|
|
296
296
|
"div",
|
|
297
297
|
{
|
|
@@ -302,15 +302,15 @@ const T = k(null), ee = ({
|
|
|
302
302
|
}
|
|
303
303
|
),
|
|
304
304
|
n && /* @__PURE__ */ d(
|
|
305
|
-
|
|
305
|
+
Q,
|
|
306
306
|
{
|
|
307
|
-
onUnlock:
|
|
307
|
+
onUnlock: I,
|
|
308
308
|
overlayId: u,
|
|
309
309
|
overlayPosition: m
|
|
310
310
|
}
|
|
311
311
|
)
|
|
312
312
|
] });
|
|
313
|
-
},
|
|
313
|
+
}, Q = ({
|
|
314
314
|
onUnlock: e,
|
|
315
315
|
overlayId: t = "lock-overlay-root",
|
|
316
316
|
overlayPosition: o = "fixed"
|
|
@@ -332,7 +332,7 @@ const T = k(null), ee = ({
|
|
|
332
332
|
placeItems: "center",
|
|
333
333
|
zIndex: 9999
|
|
334
334
|
},
|
|
335
|
-
children: /* @__PURE__ */
|
|
335
|
+
children: /* @__PURE__ */ T("div", { className: "lockscreen-form", style: { width: 420, maxWidth: "92vw" }, children: [
|
|
336
336
|
/* @__PURE__ */ d("div", { className: "lock-icon-wrap", children: /* @__PURE__ */ d("span", { className: "lock-icon-box" }) }),
|
|
337
337
|
/* @__PURE__ */ d("h2", { children: "잠금됨" }),
|
|
338
338
|
/* @__PURE__ */ d("p", { children: "PIN 번호를 입력하세요" }),
|
|
@@ -342,7 +342,7 @@ const T = k(null), ee = ({
|
|
|
342
342
|
className: "lock-ipt-wrap",
|
|
343
343
|
style: { display: "flex", justifyContent: "center" },
|
|
344
344
|
children: /* @__PURE__ */ d(
|
|
345
|
-
|
|
345
|
+
H.OTP,
|
|
346
346
|
{
|
|
347
347
|
mask: "*",
|
|
348
348
|
autoFocus: !0,
|
|
@@ -361,23 +361,23 @@ const T = k(null), ee = ({
|
|
|
361
361
|
);
|
|
362
362
|
};
|
|
363
363
|
export {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
364
|
+
ae as AuthProvider,
|
|
365
|
+
de as CommonCodeProvider,
|
|
366
|
+
ve as ScreenProtectProvider,
|
|
367
|
+
se as SearchBoxProvider,
|
|
368
|
+
te as ServiceCodeProvider,
|
|
369
|
+
re as useAllServiceCodes,
|
|
370
|
+
ue as useAuth,
|
|
371
|
+
me as useCodeColor,
|
|
372
|
+
le as useCodeList,
|
|
373
|
+
fe as useCodeListByOption,
|
|
374
|
+
pe as useCodeName,
|
|
375
375
|
P as useCommonCode,
|
|
376
376
|
he as useGridLookup,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
377
|
+
we as useLock,
|
|
378
|
+
ne as useLogServiceCodeConfig,
|
|
379
|
+
ie as usePopup,
|
|
380
|
+
ce as useSearchBox,
|
|
381
|
+
F as useServiceCode,
|
|
382
|
+
oe as useServiceCodeValue
|
|
383
383
|
};
|