@daeryun/dr_components 0.3.16 → 0.3.18
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/page/Login/Login.jsx +3 -3
- package/dist/components/page/Login/Login.tsx +3 -3
- package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.d.ts +10 -0
- package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.jsx +41 -0
- package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.tsx +91 -0
- package/dist/components/page/Login/LoginComp/Sign/OptionalCheckBox.d.ts +2 -6
- package/dist/components/page/Login/LoginComp/Sign/OptionalCheckBox.tsx +3 -6
- package/dist/components/page/Login/LoginComp/Sign/RequiredCheckBox.jsx +8 -8
- package/dist/components/page/Login/LoginComp/Sign/RequiredCheckBox.tsx +81 -81
- package/dist/components/page/Login/Sign.d.ts +27 -0
- package/dist/components/page/Login/Sign.jsx +614 -0
- package/dist/components/page/Login/Sign.tsx +941 -0
- package/dist/components/page/Login/_api/completeUser.d.ts +7 -0
- package/dist/components/page/Login/_api/completeUser.js +23 -0
- package/dist/components/page/Login/_api/completeUser.ts +18 -0
- package/dist/components/page/Login/_api/confirmNumber.d.ts +5 -0
- package/dist/components/page/Login/_api/confirmNumber.js +23 -0
- package/dist/components/page/Login/_api/confirmNumber.ts +14 -0
- package/dist/components/page/Login/_api/getLoginStatus.d.ts +12 -0
- package/dist/components/page/Login/_api/getLoginStatus.js +48 -0
- package/dist/components/page/Login/_api/getLoginStatus.ts +42 -0
- package/dist/components/page/Login/_api/logout.d.ts +1 -0
- package/dist/components/page/Login/_api/logout.js +29 -0
- package/dist/components/page/Login/_api/logout.ts +18 -0
- package/dist/components/page/Login/_api/optionalTermAgree.d.ts +6 -0
- package/dist/components/page/Login/_api/optionalTermAgree.js +27 -0
- package/dist/components/page/Login/_api/optionalTermAgree.ts +23 -0
- package/dist/components/page/Login/_api/sendNumber.d.ts +5 -0
- package/dist/components/page/Login/_api/sendNumber.js +24 -0
- package/dist/components/page/Login/_api/sendNumber.ts +15 -0
- package/dist/components/page/Login/_api/token.d.ts +2 -0
- package/dist/components/page/Login/_api/token.js +33 -0
- package/dist/components/page/Login/_api/token.ts +25 -0
- package/dist/components/page/Login/_api/updateUserInfo.d.ts +6 -0
- package/dist/components/page/Login/_api/updateUserInfo.js +26 -0
- package/dist/components/page/Login/_api/updateUserInfo.ts +17 -0
- package/dist/components/page/Login/_api/withdraw.d.ts +5 -0
- package/dist/components/page/Login/_api/withdraw.js +23 -0
- package/dist/components/page/Login/_api/withdraw.ts +14 -0
- package/dist/components/page/Login/_fetch/fetch.d.ts +2 -0
- package/dist/components/page/Login/_fetch/fetch.js +54 -0
- package/dist/components/page/Login/_fetch/fetch.ts +58 -0
- package/dist/components/page/Login/_fetch/serverFetch.d.ts +2 -0
- package/dist/components/page/Login/_fetch/serverFetch.js +37 -0
- package/dist/components/page/Login/_fetch/serverFetch.ts +43 -0
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.jsx +3 -3
- package/dist/components/page/MyCase/[id]/MyCaseDetailPage.tsx +3 -3
- package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.jsx +7 -3
- package/dist/components/page/MyCase/[id]/_component/_caseInquiry/CaseInquiry.tsx +7 -3
- package/dist/components/page/MyCase/_component/_layout/IntroWrapper.jsx +1 -1
- package/dist/components/page/MyCase/_component/_layout/IntroWrapper.tsx +5 -1
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.js +1 -0
- package/dist/components/page/index.ts +1 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/lib/utils.js +31 -0
- package/dist/lib/utils.ts +42 -0
- package/dist/styles/globals.css +304 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
- /package/dist/components/page/Login/LoginComp/{ConfirmModal.d.ts → Modal/ConfirmModal.d.ts} +0 -0
- /package/dist/components/page/Login/LoginComp/{ConfirmModal.jsx → Modal/ConfirmModal.jsx} +0 -0
- /package/dist/components/page/Login/LoginComp/{ConfirmModal.tsx → Modal/ConfirmModal.tsx} +0 -0
- /package/dist/components/page/Login/LoginComp/{TermModal.d.ts → Modal/TermModal.d.ts} +0 -0
- /package/dist/components/page/Login/LoginComp/{TermModal.jsx → Modal/TermModal.jsx} +0 -0
- /package/dist/components/page/Login/LoginComp/{TermModal.tsx → Modal/TermModal.tsx} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { deleteToken } from '../_api/token';
|
|
11
|
+
const ServerFetch = (url_1, ...args_1) => __awaiter(void 0, [url_1, ...args_1], void 0, function* (url, options = {}, cookies) {
|
|
12
|
+
options = Object.assign(Object.assign({}, options), { credentials: 'include' });
|
|
13
|
+
options.headers = Object.assign(Object.assign(Object.assign({}, options.headers), { Accept: 'application/json;charset=UTF-8' }), (cookies ? { Cookie: cookies } : {}));
|
|
14
|
+
if ((options === null || options === void 0 ? void 0 : options.method) === 'POST' && options.type !== 'form') {
|
|
15
|
+
options.headers['Content-Type'] = 'application/json;charset=UTF-8';
|
|
16
|
+
}
|
|
17
|
+
else if ((options === null || options === void 0 ? void 0 : options.method) === 'PATCH') {
|
|
18
|
+
options.headers['Content-Type'] = 'application/json';
|
|
19
|
+
}
|
|
20
|
+
const fullUrl = `${process.env.NEXT_PUBLIC_LAWFIRM_API}${url}`;
|
|
21
|
+
try {
|
|
22
|
+
const response = yield fetch(fullUrl, options);
|
|
23
|
+
const result = yield response.json();
|
|
24
|
+
if (result.message === 'Expired JWT' || result.message === 'Invalid JWT') {
|
|
25
|
+
yield deleteToken();
|
|
26
|
+
// getServerSideProps 에서 사용 시 전달 받은 값에서 nextUrl 이 존재하면 반환 시켜야함
|
|
27
|
+
return Object.assign(Object.assign({}, result), { nextUrl: '/' // 이 정보는 호출한 곳에서 보고 리다이렉트할 수 있음
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
}
|
|
32
|
+
catch (e) {
|
|
33
|
+
console.log('ServerFetch Error:', e);
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export default ServerFetch;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { deleteToken } from '../_api/token';
|
|
2
|
+
|
|
3
|
+
const ServerFetch = async (url: string, options: any = {}, cookies?: any) => {
|
|
4
|
+
options = {
|
|
5
|
+
...options,
|
|
6
|
+
credentials: 'include'
|
|
7
|
+
};
|
|
8
|
+
options.headers = {
|
|
9
|
+
...options.headers,
|
|
10
|
+
Accept: 'application/json;charset=UTF-8',
|
|
11
|
+
...(cookies ? { Cookie: cookies } : {})
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
if (options?.method === 'POST' && options.type !== 'form') {
|
|
15
|
+
options.headers['Content-Type'] = 'application/json;charset=UTF-8';
|
|
16
|
+
} else if (options?.method === 'PATCH') {
|
|
17
|
+
options.headers['Content-Type'] = 'application/json';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const fullUrl = `${process.env.NEXT_PUBLIC_LAWFIRM_API}${url}`;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const response = await fetch(fullUrl, options);
|
|
24
|
+
const result = await response.json();
|
|
25
|
+
|
|
26
|
+
if (result.message === 'Expired JWT' || result.message === 'Invalid JWT') {
|
|
27
|
+
await deleteToken();
|
|
28
|
+
|
|
29
|
+
// getServerSideProps 에서 사용 시 전달 받은 값에서 nextUrl 이 존재하면 반환 시켜야함
|
|
30
|
+
return {
|
|
31
|
+
...result,
|
|
32
|
+
nextUrl: '/' // 이 정보는 호출한 곳에서 보고 리다이렉트할 수 있음
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return result;
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.log('ServerFetch Error:', e);
|
|
39
|
+
throw e;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default ServerFetch;
|
|
@@ -36,7 +36,7 @@ const MyCaseDetailPage = ({ jwt }) => {
|
|
|
36
36
|
{/*header 크기 -> 115px max-lg2:90px max-xs:83px*/}
|
|
37
37
|
<HeaderLayout>
|
|
38
38
|
<div className="sm-top:mt-[283px] mt-[210px] lg:mt-[302px] ">
|
|
39
|
-
<div className="
|
|
39
|
+
<div className="sm-top:gap-[32px] flex items-center justify-center gap-[16px] max-[415px]:hidden lg:gap-[28px]">
|
|
40
40
|
<SubMenuButton title="사건 정보" isSelected={selected === '사건 정보'} onClick={() => setSelected('사건 정보')}/>
|
|
41
41
|
<SubMenuButton title="사건 타임라인" isSelected={selected === '사건 타임라인'} onClick={() => setSelected('사건 타임라인')}/>
|
|
42
42
|
{/* <SubMenuButton
|
|
@@ -47,8 +47,8 @@ const MyCaseDetailPage = ({ jwt }) => {
|
|
|
47
47
|
<SubMenuButton title="계약정보" isSelected={selected === '계약정보'} onClick={() => setSelected('계약정보')}/>
|
|
48
48
|
<SubMenuButton title="사건문의" isSelected={selected === '사건문의'} onClick={() => setSelected('사건문의')}/>
|
|
49
49
|
</div>
|
|
50
|
-
<div className="
|
|
51
|
-
<CaseTabSwiper id="case-tab-swiper3" scrollClassName="max-[
|
|
50
|
+
<div className="hidden max-[415px]:block 2sm:pl-[40px]">
|
|
51
|
+
<CaseTabSwiper id="case-tab-swiper3" scrollClassName="max-[415px]:!block">
|
|
52
52
|
<SubMenuButton title="사건 정보" isSelected={selected === '사건 정보'} onClick={() => setSelected('사건 정보')} outerClassName="ml-[20px]"/>
|
|
53
53
|
<SubMenuButton title="사건 타임라인" isSelected={selected === '사건 타임라인'} onClick={() => setSelected('사건 타임라인')}/>
|
|
54
54
|
{/* <SubMenuButton
|
|
@@ -55,7 +55,7 @@ const MyCaseDetailPage = ({ jwt }: { jwt?: string }) => {
|
|
|
55
55
|
{/*header 크기 -> 115px max-lg2:90px max-xs:83px*/}
|
|
56
56
|
<HeaderLayout>
|
|
57
57
|
<div className="sm-top:mt-[283px] mt-[210px] lg:mt-[302px] ">
|
|
58
|
-
<div className="
|
|
58
|
+
<div className="sm-top:gap-[32px] flex items-center justify-center gap-[16px] max-[415px]:hidden lg:gap-[28px]">
|
|
59
59
|
<SubMenuButton
|
|
60
60
|
title="사건 정보"
|
|
61
61
|
isSelected={selected === '사건 정보'}
|
|
@@ -82,8 +82,8 @@ const MyCaseDetailPage = ({ jwt }: { jwt?: string }) => {
|
|
|
82
82
|
onClick={() => setSelected('사건문의')}
|
|
83
83
|
/>
|
|
84
84
|
</div>
|
|
85
|
-
<div className="
|
|
86
|
-
<CaseTabSwiper id="case-tab-swiper3" scrollClassName="max-[
|
|
85
|
+
<div className="hidden max-[415px]:block 2sm:pl-[40px]">
|
|
86
|
+
<CaseTabSwiper id="case-tab-swiper3" scrollClassName="max-[415px]:!block">
|
|
87
87
|
<SubMenuButton
|
|
88
88
|
title="사건 정보"
|
|
89
89
|
isSelected={selected === '사건 정보'}
|
|
@@ -24,7 +24,9 @@ const AnswerBox = ({ item, isOpen, openId, setOpenId }) => {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}}>
|
|
27
|
-
<div className={`bg-grayScale7 sm-top:px-[40px] sm-top:py-[28px] flex flex-row items-center p-[20px] lg:px-[48px] lg:py-[36px] ${isOpen
|
|
27
|
+
<div className={`bg-grayScale7 sm-top:px-[40px] sm-top:py-[28px] flex flex-row items-center p-[20px] lg:px-[48px] lg:py-[36px] ${isOpen
|
|
28
|
+
? 'rounded-x-[8px] sm-top:rounded-x-[12px] lg:rounded-x-[20px] sm-top:rounded-t-[12px] rounded-t-[8px] lg:rounded-t-[20px] '
|
|
29
|
+
: 'lg:rounded-x-[20px] sm-top:rounded-[12px] rounded-[8px] '}`}>
|
|
28
30
|
<Image src={client} alt="client" width={60} height={60} className="sm-top:mr-[28px] sm-top:h-[52px] sm-top:w-[52px] mr-[12px] h-[40px] w-[40px] flex-shrink-0 lg:mr-[32px] lg:h-[60px] lg:w-[60px]"/>
|
|
29
31
|
<div className="w-full">
|
|
30
32
|
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale2">
|
|
@@ -33,7 +35,7 @@ const AnswerBox = ({ item, isOpen, openId, setOpenId }) => {
|
|
|
33
35
|
<p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1 mt-[4px] text-black lg:mt-[5px]">
|
|
34
36
|
{item.content}
|
|
35
37
|
</p>
|
|
36
|
-
<div className={`sm-top:mt-[12px] sm-top:justify-between mt-[8px] flex flex-row items-center
|
|
38
|
+
<div className={`max-sm-top:gap-[8px] sm-top:mt-[12px] sm-top:justify-between mt-[8px] flex flex-row items-center lg:mt-[20px] `}>
|
|
37
39
|
<p className={`body_small2_mo sm-top:body_small2_tb lg:body_small2 max-sm-top:h-[18px] ${(item === null || item === void 0 ? void 0 : item.answer) ? 'text-subColor04' : 'text-mycaseMainColor'}`}>
|
|
38
40
|
{(item === null || item === void 0 ? void 0 : item.answer) ? '답변' : '미답변'}
|
|
39
41
|
</p>
|
|
@@ -45,7 +47,9 @@ const AnswerBox = ({ item, isOpen, openId, setOpenId }) => {
|
|
|
45
47
|
<div className={`border-grayScale7 sm-top:px-[40px] flex flex-row overflow-hidden rounded-b-[20px] border-x-[2px] border-b-[2px] border-solid px-[20px] transition-all duration-500 lg:px-[48px] ${isOpen ? 'sm-top:py-[28px] h-full py-[20px] opacity-100 lg:py-[36px]' : 'h-0 opacity-0'}`}>
|
|
46
48
|
<div className="sm-top:mr-[28px] sm-top:gap-[4px] mr-[12px] flex flex-shrink-0 flex-col items-center justify-center lg:mr-[32px] lg:gap-[12px]">
|
|
47
49
|
<Image src={daeryun} alt="client" width={60} height={60} className="sm-top:h-[52px] sm-top:w-[52px] h-[40px] w-[40px] flex-shrink-0 lg:h-[60px] lg:w-[60px]"/>
|
|
48
|
-
<p className=" sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor max-sm:hidden"
|
|
50
|
+
<p className=" sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor max-sm-top:hidden">
|
|
51
|
+
담당자
|
|
52
|
+
</p>
|
|
49
53
|
</div>
|
|
50
54
|
<div className="flex flex-col justify-center">
|
|
51
55
|
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale2">
|
|
@@ -42,7 +42,9 @@ const AnswerBox = ({
|
|
|
42
42
|
>
|
|
43
43
|
<div
|
|
44
44
|
className={`bg-grayScale7 sm-top:px-[40px] sm-top:py-[28px] flex flex-row items-center p-[20px] lg:px-[48px] lg:py-[36px] ${
|
|
45
|
-
isOpen
|
|
45
|
+
isOpen
|
|
46
|
+
? 'rounded-x-[8px] sm-top:rounded-x-[12px] lg:rounded-x-[20px] sm-top:rounded-t-[12px] rounded-t-[8px] lg:rounded-t-[20px] '
|
|
47
|
+
: 'lg:rounded-x-[20px] sm-top:rounded-[12px] rounded-[8px] '
|
|
46
48
|
}`}
|
|
47
49
|
>
|
|
48
50
|
<Image
|
|
@@ -60,7 +62,7 @@ const AnswerBox = ({
|
|
|
60
62
|
{item.content}
|
|
61
63
|
</p>
|
|
62
64
|
<div
|
|
63
|
-
className={`sm-top:mt-[12px] sm-top:justify-between mt-[8px] flex flex-row items-center
|
|
65
|
+
className={`max-sm-top:gap-[8px] sm-top:mt-[12px] sm-top:justify-between mt-[8px] flex flex-row items-center lg:mt-[20px] `}
|
|
64
66
|
>
|
|
65
67
|
<p
|
|
66
68
|
className={`body_small2_mo sm-top:body_small2_tb lg:body_small2 max-sm-top:h-[18px] ${
|
|
@@ -99,7 +101,9 @@ const AnswerBox = ({
|
|
|
99
101
|
height={60}
|
|
100
102
|
className="sm-top:h-[52px] sm-top:w-[52px] h-[40px] w-[40px] flex-shrink-0 lg:h-[60px] lg:w-[60px]"
|
|
101
103
|
/>
|
|
102
|
-
<p className=" sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor max-sm:hidden"
|
|
104
|
+
<p className=" sm-top:body_small2_tb lg:body_small2 text-mycaseMainColor max-sm-top:hidden">
|
|
105
|
+
담당자
|
|
106
|
+
</p>
|
|
103
107
|
</div>
|
|
104
108
|
<div className="flex flex-col justify-center">
|
|
105
109
|
<p className="body_small2_mo sm-top:body_small2_tb lg:body_small2 text-grayScale2">
|
|
@@ -20,7 +20,7 @@ const IntroWrapper = ({ backgroundImage, backgroundTbImage, backgroundMoImage, o
|
|
|
20
20
|
<CaseWrapper>
|
|
21
21
|
<div className={'relative w-full '}>
|
|
22
22
|
<p className={'title_large_mo sm-top:title_large_tb lg:title_large '}>{title}</p>
|
|
23
|
-
<p className={'title_small_mo sm-top:title_small_tb lg:title_small max-sm-top:mt-[8px] '}>
|
|
23
|
+
<p className={'title_small_mo sm-top:title_small_tb lg:title_small max-sm-top:mt-[8px] sm-top:mt-[12px] '}>
|
|
24
24
|
{subTitle}
|
|
25
25
|
</p>
|
|
26
26
|
</div>
|
|
@@ -59,7 +59,11 @@ const IntroWrapper = ({
|
|
|
59
59
|
<CaseWrapper>
|
|
60
60
|
<div className={'relative w-full '}>
|
|
61
61
|
<p className={'title_large_mo sm-top:title_large_tb lg:title_large '}>{title}</p>
|
|
62
|
-
<p
|
|
62
|
+
<p
|
|
63
|
+
className={
|
|
64
|
+
'title_small_mo sm-top:title_small_tb lg:title_small max-sm-top:mt-[8px] sm-top:mt-[12px] '
|
|
65
|
+
}
|
|
66
|
+
>
|
|
63
67
|
{subTitle}
|
|
64
68
|
</p>
|
|
65
69
|
</div>
|
|
@@ -4,3 +4,4 @@ export { default as Strength } from './Strength/Strength';
|
|
|
4
4
|
export { default as MyCasePage } from './MyCase/MyCasePage';
|
|
5
5
|
export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
|
|
6
6
|
export { default as Login } from './Login/Login';
|
|
7
|
+
export { default as Sign } from './Login/Sign';
|
|
@@ -6,3 +6,4 @@ export { default as MyCasePage } from './MyCase/MyCasePage';
|
|
|
6
6
|
// export { default as MyCaseDetailApp } from './MyCase/[id]/MyCaseDetailApp';
|
|
7
7
|
export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
|
|
8
8
|
export { default as Login } from './Login/Login';
|
|
9
|
+
export { default as Sign } from './Login/Sign';
|
|
@@ -6,3 +6,4 @@ export { default as MyCasePage } from './MyCase/MyCasePage';
|
|
|
6
6
|
// export { default as MyCaseDetailApp } from './MyCase/[id]/MyCaseDetailApp';
|
|
7
7
|
export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
|
|
8
8
|
export { default as Login } from './Login/Login';
|
|
9
|
+
export { default as Sign } from './Login/Sign';
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -27,6 +27,16 @@ export declare const getDomainHandler: (centerCode: string, subDomain: string) =
|
|
|
27
27
|
export declare const replaceInitialData: (str: string, initialData: IInitialDataTypes) => string;
|
|
28
28
|
export declare const getSeoTemplateSearchTitle: (str: string) => string[];
|
|
29
29
|
export declare const lawyerCode: string[];
|
|
30
|
+
export declare const getNameValue: (value: string) => {
|
|
31
|
+
name: string;
|
|
32
|
+
isValid: boolean;
|
|
33
|
+
};
|
|
34
|
+
export declare const onlyNumberFilter: (value: string) => string;
|
|
35
|
+
export declare const getPhoneValue: (value: string) => {
|
|
36
|
+
phoneValue: string;
|
|
37
|
+
isValid: boolean;
|
|
38
|
+
};
|
|
39
|
+
export declare const formatTime: (time: number) => string;
|
|
30
40
|
export declare const setCookie: ({ key, value, days }: {
|
|
31
41
|
key: string;
|
|
32
42
|
value: string;
|
package/dist/lib/utils.js
CHANGED
|
@@ -385,6 +385,37 @@ export const lawyerCode = [
|
|
|
385
385
|
'LY007',
|
|
386
386
|
'LY024'
|
|
387
387
|
];
|
|
388
|
+
export const getNameValue = (value) => {
|
|
389
|
+
// 한글(초성, 중성 포함) 또는 영어만 허용, 공백 제거
|
|
390
|
+
const filteredValue = value.replace(/[^a-zA-Z\u3131-\u318E\uAC00-\uD7A3]/g, '');
|
|
391
|
+
// 영어만 있는지 확인
|
|
392
|
+
const isOnlyEnglish = /^[a-zA-Z]+$/.test(filteredValue);
|
|
393
|
+
// 한글만 있는지 확인
|
|
394
|
+
const isOnlyKorean = /^[\uAC00-\uD7A3]+$/.test(filteredValue);
|
|
395
|
+
// 최소 2글자 이상 + 한글 또는 영어 중 하나만 포함
|
|
396
|
+
const isValid = (isOnlyEnglish || isOnlyKorean) && filteredValue.length >= 2;
|
|
397
|
+
return { name: filteredValue, isValid };
|
|
398
|
+
};
|
|
399
|
+
// 공백 제거 및 숫자만 남기기
|
|
400
|
+
export const onlyNumberFilter = (value) => {
|
|
401
|
+
return value.replace(/\s/g, '').replace(/\D/g, '');
|
|
402
|
+
};
|
|
403
|
+
export const getPhoneValue = (value) => {
|
|
404
|
+
// 공백 제거 및 숫자만 남기기
|
|
405
|
+
const phoneValue = onlyNumberFilter(value);
|
|
406
|
+
// 10~11자리인지 확인
|
|
407
|
+
const isValidLength = phoneValue.length === 10 || phoneValue.length === 11;
|
|
408
|
+
// 010~019로 시작하는지 확인
|
|
409
|
+
const isValidPrefix = /^(010|011|016|017|018|019)/.test(phoneValue);
|
|
410
|
+
// 최종 유효성 검사 (자리수 & 시작번호)
|
|
411
|
+
const isValid = isValidLength && isValidPrefix;
|
|
412
|
+
return { phoneValue, isValid };
|
|
413
|
+
};
|
|
414
|
+
export const formatTime = (time) => {
|
|
415
|
+
const minutes = Math.floor(time / 60);
|
|
416
|
+
const seconds = time % 60;
|
|
417
|
+
return `${minutes}:${seconds.toString().padStart(2, '0')}`; // 0을 채워 두 자리 유지
|
|
418
|
+
};
|
|
388
419
|
export const setCookie = ({ key, value, days = 0.03 }) => {
|
|
389
420
|
if (typeof document === 'undefined')
|
|
390
421
|
return '';
|
package/dist/lib/utils.ts
CHANGED
|
@@ -421,6 +421,48 @@ export const lawyerCode = [
|
|
|
421
421
|
'LY024'
|
|
422
422
|
];
|
|
423
423
|
|
|
424
|
+
export const getNameValue = (value: string): { name: string; isValid: boolean } => {
|
|
425
|
+
// 한글(초성, 중성 포함) 또는 영어만 허용, 공백 제거
|
|
426
|
+
const filteredValue = value.replace(/[^a-zA-Z\u3131-\u318E\uAC00-\uD7A3]/g, '');
|
|
427
|
+
|
|
428
|
+
// 영어만 있는지 확인
|
|
429
|
+
const isOnlyEnglish = /^[a-zA-Z]+$/.test(filteredValue);
|
|
430
|
+
// 한글만 있는지 확인
|
|
431
|
+
const isOnlyKorean = /^[\uAC00-\uD7A3]+$/.test(filteredValue);
|
|
432
|
+
|
|
433
|
+
// 최소 2글자 이상 + 한글 또는 영어 중 하나만 포함
|
|
434
|
+
const isValid = (isOnlyEnglish || isOnlyKorean) && filteredValue.length >= 2;
|
|
435
|
+
|
|
436
|
+
return { name: filteredValue, isValid };
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
// 공백 제거 및 숫자만 남기기
|
|
440
|
+
export const onlyNumberFilter = (value: string) => {
|
|
441
|
+
return value.replace(/\s/g, '').replace(/\D/g, '');
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export const getPhoneValue = (value: string): { phoneValue: string; isValid: boolean } => {
|
|
445
|
+
// 공백 제거 및 숫자만 남기기
|
|
446
|
+
const phoneValue = onlyNumberFilter(value);
|
|
447
|
+
|
|
448
|
+
// 10~11자리인지 확인
|
|
449
|
+
const isValidLength = phoneValue.length === 10 || phoneValue.length === 11;
|
|
450
|
+
|
|
451
|
+
// 010~019로 시작하는지 확인
|
|
452
|
+
const isValidPrefix = /^(010|011|016|017|018|019)/.test(phoneValue);
|
|
453
|
+
|
|
454
|
+
// 최종 유효성 검사 (자리수 & 시작번호)
|
|
455
|
+
const isValid = isValidLength && isValidPrefix;
|
|
456
|
+
|
|
457
|
+
return { phoneValue, isValid };
|
|
458
|
+
};
|
|
459
|
+
|
|
460
|
+
export const formatTime = (time: number) => {
|
|
461
|
+
const minutes = Math.floor(time / 60);
|
|
462
|
+
const seconds = time % 60;
|
|
463
|
+
return `${minutes}:${seconds.toString().padStart(2, '0')}`; // 0을 채워 두 자리 유지
|
|
464
|
+
};
|
|
465
|
+
|
|
424
466
|
export const setCookie = ({ key, value, days = 0.03 }: { key: string; value: string; days?: number }) => {
|
|
425
467
|
if (typeof document === 'undefined') return '';
|
|
426
468
|
|