@daeryun/dr_components 0.3.17 → 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.
Files changed (79) hide show
  1. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  2. package/dist/components/Layout/PageWrapper.d.ts +8 -0
  3. package/dist/components/Layout/PageWrapper.jsx +31 -0
  4. package/dist/components/Layout/PageWrapper.tsx +35 -0
  5. package/dist/components/page/Login/Login.d.ts +6 -0
  6. package/dist/components/page/Login/Login.jsx +112 -0
  7. package/dist/components/page/Login/Login.stories.d.ts +6 -0
  8. package/dist/components/page/Login/Login.stories.jsx +13 -0
  9. package/dist/components/page/Login/Login.stories.tsx +21 -0
  10. package/dist/components/page/Login/Login.tsx +167 -0
  11. package/dist/components/page/Login/LoginComp/LButton.d.ts +9 -0
  12. package/dist/components/page/Login/LoginComp/LButton.jsx +14 -0
  13. package/dist/components/page/Login/LoginComp/LButton.tsx +36 -0
  14. package/dist/components/page/Login/LoginComp/Linput.d.ts +11 -0
  15. package/dist/components/page/Login/LoginComp/Linput.jsx +10 -0
  16. package/dist/components/page/Login/LoginComp/Linput.tsx +40 -0
  17. package/dist/components/page/Login/LoginComp/LoginBreadCrumb.d.ts +6 -0
  18. package/dist/components/page/Login/LoginComp/LoginBreadCrumb.jsx +18 -0
  19. package/dist/components/page/Login/LoginComp/LoginBreadCrumb.tsx +40 -0
  20. package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.d.ts +10 -0
  21. package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.jsx +41 -0
  22. package/dist/components/page/Login/LoginComp/Modal/AlertConfirmModal.tsx +91 -0
  23. package/dist/components/page/Login/LoginComp/Modal/ConfirmModal.d.ts +10 -0
  24. package/dist/components/page/Login/LoginComp/Modal/ConfirmModal.jsx +37 -0
  25. package/dist/components/page/Login/LoginComp/Modal/ConfirmModal.tsx +83 -0
  26. package/dist/components/page/Login/LoginComp/Modal/TermModal.d.ts +9 -0
  27. package/dist/components/page/Login/LoginComp/Modal/TermModal.jsx +39 -0
  28. package/dist/components/page/Login/LoginComp/Modal/TermModal.tsx +70 -0
  29. package/dist/components/page/Login/LoginComp/Sign/OptionalCheckBox.d.ts +14 -0
  30. package/dist/components/page/Login/LoginComp/Sign/OptionalCheckBox.jsx +61 -0
  31. package/dist/components/page/Login/LoginComp/Sign/OptionalCheckBox.tsx +160 -0
  32. package/dist/components/page/Login/LoginComp/Sign/RequiredCheckBox.d.ts +12 -0
  33. package/dist/components/page/Login/LoginComp/Sign/RequiredCheckBox.jsx +32 -0
  34. package/dist/components/page/Login/LoginComp/Sign/RequiredCheckBox.tsx +94 -0
  35. package/dist/components/page/Login/Sign.d.ts +27 -0
  36. package/dist/components/page/Login/Sign.jsx +614 -0
  37. package/dist/components/page/Login/Sign.tsx +941 -0
  38. package/dist/components/page/Login/_api/completeUser.d.ts +7 -0
  39. package/dist/components/page/Login/_api/completeUser.js +23 -0
  40. package/dist/components/page/Login/_api/completeUser.ts +18 -0
  41. package/dist/components/page/Login/_api/confirmNumber.d.ts +5 -0
  42. package/dist/components/page/Login/_api/confirmNumber.js +23 -0
  43. package/dist/components/page/Login/_api/confirmNumber.ts +14 -0
  44. package/dist/components/page/Login/_api/getLoginStatus.d.ts +12 -0
  45. package/dist/components/page/Login/_api/getLoginStatus.js +48 -0
  46. package/dist/components/page/Login/_api/getLoginStatus.ts +42 -0
  47. package/dist/components/page/Login/_api/logout.d.ts +1 -0
  48. package/dist/components/page/Login/_api/logout.js +29 -0
  49. package/dist/components/page/Login/_api/logout.ts +18 -0
  50. package/dist/components/page/Login/_api/optionalTermAgree.d.ts +6 -0
  51. package/dist/components/page/Login/_api/optionalTermAgree.js +27 -0
  52. package/dist/components/page/Login/_api/optionalTermAgree.ts +23 -0
  53. package/dist/components/page/Login/_api/sendNumber.d.ts +5 -0
  54. package/dist/components/page/Login/_api/sendNumber.js +24 -0
  55. package/dist/components/page/Login/_api/sendNumber.ts +15 -0
  56. package/dist/components/page/Login/_api/token.d.ts +2 -0
  57. package/dist/components/page/Login/_api/token.js +33 -0
  58. package/dist/components/page/Login/_api/token.ts +25 -0
  59. package/dist/components/page/Login/_api/updateUserInfo.d.ts +6 -0
  60. package/dist/components/page/Login/_api/updateUserInfo.js +26 -0
  61. package/dist/components/page/Login/_api/updateUserInfo.ts +17 -0
  62. package/dist/components/page/Login/_api/withdraw.d.ts +5 -0
  63. package/dist/components/page/Login/_api/withdraw.js +23 -0
  64. package/dist/components/page/Login/_api/withdraw.ts +14 -0
  65. package/dist/components/page/Login/_fetch/fetch.d.ts +2 -0
  66. package/dist/components/page/Login/_fetch/fetch.js +54 -0
  67. package/dist/components/page/Login/_fetch/fetch.ts +58 -0
  68. package/dist/components/page/Login/_fetch/serverFetch.d.ts +2 -0
  69. package/dist/components/page/Login/_fetch/serverFetch.js +37 -0
  70. package/dist/components/page/Login/_fetch/serverFetch.ts +43 -0
  71. package/dist/components/page/index.d.ts +2 -0
  72. package/dist/components/page/index.js +2 -0
  73. package/dist/components/page/index.ts +2 -0
  74. package/dist/lib/utils.d.ts +16 -0
  75. package/dist/lib/utils.js +50 -0
  76. package/dist/lib/utils.ts +63 -0
  77. package/dist/styles/globals.css +1200 -31
  78. package/dist/tsconfig.tsbuildinfo +1 -1
  79. package/package.json +2 -1
@@ -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;
@@ -3,3 +3,5 @@ export { default as Consulting } from './Consulting/Consulting';
3
3
  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
+ export { default as Login } from './Login/Login';
7
+ export { default as Sign } from './Login/Sign';
@@ -5,3 +5,5 @@ export { default as Strength } from './Strength/Strength';
5
5
  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
+ export { default as Login } from './Login/Login';
9
+ export { default as Sign } from './Login/Sign';
@@ -5,3 +5,5 @@ export { default as Strength } from './Strength/Strength';
5
5
  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
+ export { default as Login } from './Login/Login';
9
+ export { default as Sign } from './Login/Sign';
@@ -27,3 +27,19 @@ 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;
40
+ export declare const setCookie: ({ key, value, days }: {
41
+ key: string;
42
+ value: string;
43
+ days?: number;
44
+ }) => "" | undefined;
45
+ export declare const getCookie: (key: string) => string;
package/dist/lib/utils.js CHANGED
@@ -385,3 +385,53 @@ 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
+ };
419
+ export const setCookie = ({ key, value, days = 0.03 }) => {
420
+ if (typeof document === 'undefined')
421
+ return '';
422
+ const expires = new Date();
423
+ expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000);
424
+ document.cookie = `${key}=${value};expires=${expires.toUTCString()};path=/`;
425
+ };
426
+ export const getCookie = (key) => {
427
+ if (typeof document === 'undefined')
428
+ return '';
429
+ const cookies = document.cookie.split(';');
430
+ for (const cookie of cookies) {
431
+ const [k, v] = cookie.trim().split('=');
432
+ if (k === key) {
433
+ return v;
434
+ }
435
+ }
436
+ return '';
437
+ };
package/dist/lib/utils.ts CHANGED
@@ -420,3 +420,66 @@ export const lawyerCode = [
420
420
  'LY007',
421
421
  'LY024'
422
422
  ];
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
+
466
+ export const setCookie = ({ key, value, days = 0.03 }: { key: string; value: string; days?: number }) => {
467
+ if (typeof document === 'undefined') return '';
468
+
469
+ const expires = new Date();
470
+ expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000);
471
+ document.cookie = `${key}=${value};expires=${expires.toUTCString()};path=/`;
472
+ };
473
+
474
+ export const getCookie = (key: string) => {
475
+ if (typeof document === 'undefined') return '';
476
+
477
+ const cookies = document.cookie.split(';');
478
+ for (const cookie of cookies) {
479
+ const [k, v] = cookie.trim().split('=');
480
+ if (k === key) {
481
+ return v;
482
+ }
483
+ }
484
+ return '';
485
+ };