@daeryun/dr_components 1.0.25 → 1.0.27

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.
@@ -12,4 +12,5 @@ export interface ITermType {
12
12
  title: string;
13
13
  terms_code: string | null;
14
14
  terms_name: string;
15
+ is_essential?: boolean;
15
16
  }
@@ -12,4 +12,5 @@ export interface ITermType {
12
12
  title: string;
13
13
  terms_code: string | null;
14
14
  terms_name: string;
15
+ is_essential?: boolean;
15
16
  }
@@ -83,12 +83,12 @@ const AiSearch = ({ search }) => {
83
83
  </h3>
84
84
 
85
85
  {isLoading ? (<div className="relative h-2 w-full overflow-hidden rounded bg-gray-300">
86
- <div className="animate-integrate_loading_bar h-full rounded bg-blue-500"/>
86
+ <div className="h-full animate-integrate_loading_bar rounded bg-blue-500"/>
87
87
  </div>) : responseData ? (<AnimatedText text={responseData}/>) : null}
88
88
  </div>
89
89
  <p className="break-keep text-right text-sm max-xl:text-left max-md2:text-[13px]">
90
- &#42;위 답변은 인공지능이 작성한 내용으로 &#39;정보제공을 위한 것&#39;입니다. 위 답변에는 법적효력이
91
- 없으므로 참고자료로만 활용해 주시고 구체적 적용을 위해서는 변호사와 상담을 권해드립니다.
90
+ *이 답변은 인공지능이 제공한 일반정보입니다. 내용에는 오류가 포함될 수 있으며 법적 효력이 없습니다.
91
+ 정확한 적용을 위해서는 변호사와 개별 상담을 권해드립니다.
92
92
  </p>
93
93
  </div>);
94
94
  };
@@ -97,15 +97,15 @@ const AiSearch = ({ search }: SearchProps) => {
97
97
 
98
98
  {isLoading ? (
99
99
  <div className="relative h-2 w-full overflow-hidden rounded bg-gray-300">
100
- <div className="animate-integrate_loading_bar h-full rounded bg-blue-500" />
100
+ <div className="h-full animate-integrate_loading_bar rounded bg-blue-500" />
101
101
  </div>
102
102
  ) : responseData ? (
103
103
  <AnimatedText text={responseData} />
104
104
  ) : null}
105
105
  </div>
106
106
  <p className="break-keep text-right text-sm max-xl:text-left max-md2:text-[13px]">
107
- &#42;위 답변은 인공지능이 작성한 내용으로 &#39;정보제공을 위한 것&#39;입니다. 위 답변에는 법적효력이
108
- 없으므로 참고자료로만 활용해 주시고 구체적 적용을 위해서는 변호사와 상담을 권해드립니다.
107
+ *이 답변은 인공지능이 제공한 일반정보입니다. 내용에는 오류가 포함될 수 있으며 법적 효력이 없습니다.
108
+ 정확한 적용을 위해서는 변호사와 개별 상담을 권해드립니다.
109
109
  </p>
110
110
  </div>
111
111
  );
@@ -91,7 +91,7 @@ const SignContainer = ({ layoutClassName = `mt-[47px] py-[128px] max-lg:mt-[40px
91
91
  termCode: '',
92
92
  contents: ''
93
93
  },
94
- ...((_a = termList === null || termList === void 0 ? void 0 : termList.filter(item => item.idx === 67 || item.idx === 69).map(item => ({
94
+ ...((_a = termList === null || termList === void 0 ? void 0 : termList.filter(item => item === null || item === void 0 ? void 0 : item.is_essential).map(item => ({
95
95
  title: `${item.terms_name} (필수)`,
96
96
  name: 'required',
97
97
  checked: false,
@@ -248,9 +248,6 @@ const SignContainer = ({ layoutClassName = `mt-[47px] py-[128px] max-lg:mt-[40px
248
248
  newUserValidObj.nameValid = isValid;
249
249
  }
250
250
  else if (name === 'phoneNumber') {
251
- const { phoneValue, isValid } = getPhoneValue(value);
252
- newUserObj.phoneNumber = phoneValue;
253
- newUserValidObj.phoneNumberValid = isValid;
254
251
  // 휴대전화 입력값 변경 시 폰 번호 인증이 날린 상태라면 초기화 필요
255
252
  if (userValidObj.phoneSendValid) {
256
253
  newUserValidObj.phoneSendValid = false;
@@ -259,6 +256,9 @@ const SignContainer = ({ layoutClassName = `mt-[47px] py-[128px] max-lg:mt-[40px
259
256
  setTimeLeft(0);
260
257
  setSendApiCount(0);
261
258
  }
259
+ const { phoneValue, isValid } = getPhoneValue(value);
260
+ newUserObj.phoneNumber = phoneValue;
261
+ newUserValidObj.phoneNumberValid = isValid;
262
262
  }
263
263
  else if (name === 'code') {
264
264
  newUserObj.code = onlyNumberFilter(value);
@@ -560,11 +560,11 @@ const SignContainer = ({ layoutClassName = `mt-[47px] py-[128px] max-lg:mt-[40px
560
560
  이름<span className={'text-[#AE0E36]'}>*</span>
561
561
  </p>
562
562
  <LInput placeholder={'이름을 입력해 주세요'} handleInput={handleInput} className={'w-[712px] max-lg:w-full max-sm:w-full'} name={'name'} value={userObj.name}/>
563
- {userObj.name.length >= 1 && !userValidObj.nameValid && (<p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
563
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (<p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
564
564
  *이름은 최소 2자 이상으로 입력해 주세요.
565
565
  </p>)}
566
566
  </div>
567
- {userObj.name.length >= 1 && !userValidObj.nameValid && (<div className={' mt-[12px] flex flex-row items-center gap-[24px] ' +
567
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (<div className={' mt-[12px] flex flex-row items-center gap-[24px] ' +
568
568
  ' 5xl:hidden ' +
569
569
  ' max-lg:gap-[30px] '}>
570
570
  <p className={' w-[188px] flex-shrink-0 ' + ' max-lg:w-[156px] ' + ' max-sm:hidden '}></p>
@@ -144,7 +144,7 @@ const SignContainer = ({
144
144
  contents: ''
145
145
  },
146
146
  ...(termList
147
- ?.filter(item => item.idx === 67 || item.idx === 69)
147
+ ?.filter(item => item?.is_essential) // DB 에 is_essential 칼럼이 추가되어 있어 활용
148
148
  .map(item => ({
149
149
  title: `${item.terms_name} (필수)`,
150
150
  name: 'required',
@@ -332,10 +332,6 @@ const SignContainer = ({
332
332
  newUserObj.name = name;
333
333
  newUserValidObj.nameValid = isValid;
334
334
  } else if (name === 'phoneNumber') {
335
- const { phoneValue, isValid } = getPhoneValue(value);
336
- newUserObj.phoneNumber = phoneValue;
337
- newUserValidObj.phoneNumberValid = isValid;
338
-
339
335
  // 휴대전화 입력값 변경 시 폰 번호 인증이 날린 상태라면 초기화 필요
340
336
  if (userValidObj.phoneSendValid) {
341
337
  newUserValidObj.phoneSendValid = false;
@@ -344,6 +340,9 @@ const SignContainer = ({
344
340
  setTimeLeft(0);
345
341
  setSendApiCount(0);
346
342
  }
343
+ const { phoneValue, isValid } = getPhoneValue(value);
344
+ newUserObj.phoneNumber = phoneValue;
345
+ newUserValidObj.phoneNumberValid = isValid;
347
346
  } else if (name === 'code') {
348
347
  newUserObj.code = onlyNumberFilter(value);
349
348
  }
@@ -740,13 +739,13 @@ const SignContainer = ({
740
739
  name={'name'}
741
740
  value={userObj.name}
742
741
  />
743
- {userObj.name.length >= 1 && !userValidObj.nameValid && (
742
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (
744
743
  <p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
745
744
  *이름은 최소 2자 이상으로 입력해 주세요.
746
745
  </p>
747
746
  )}
748
747
  </div>
749
- {userObj.name.length >= 1 && !userValidObj.nameValid && (
748
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (
750
749
  <div
751
750
  className={
752
751
  ' mt-[12px] flex flex-row items-center gap-[24px] ' +
@@ -223,9 +223,6 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
223
223
  newUserValidObj.nameValid = isValid;
224
224
  }
225
225
  else if (name === 'phoneNumber') {
226
- const { phoneValue, isValid } = getPhoneValue(value);
227
- newUserObj.phoneNumber = phoneValue;
228
- newUserValidObj.phoneNumberValid = isValid;
229
226
  // 휴대전화 입력값 변경 시 폰 번호 인증이 날린 상태라면 초기화 필요
230
227
  if (userValidObj.phoneSendValid) {
231
228
  newUserValidObj.phoneSendValid = false;
@@ -234,6 +231,9 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
234
231
  setTimeLeft(0);
235
232
  setSendApiCount(0);
236
233
  }
234
+ const { phoneValue, isValid } = getPhoneValue(value);
235
+ newUserObj.phoneNumber = phoneValue;
236
+ newUserValidObj.phoneNumberValid = isValid;
237
237
  }
238
238
  else if (name === 'code') {
239
239
  newUserObj.code = onlyNumberFilter(value);
@@ -434,11 +434,11 @@ const Personal = ({ layoutClassName = ` mt-[47px] py-[128px] max-lg:mt-[40px] m
434
434
  이름<span className={'text-[#AE0E36]'}>*</span>
435
435
  </p>
436
436
  <LInput placeholder={'이름을 입력해 주세요'} handleInput={handleInput} name={'name'} value={userObj.name}/>
437
- {userObj.name.length >= 1 && !userValidObj.nameValid && (<p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
437
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (<p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
438
438
  *이름은 최소 2자 이상으로 입력해 주세요.
439
439
  </p>)}
440
440
  </div>
441
- {userObj.name.length >= 1 && !userValidObj.nameValid && (<div className={' mt-[12px] flex flex-row items-center gap-[24px] ' +
441
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (<div className={' mt-[12px] flex flex-row items-center gap-[24px] ' +
442
442
  ' 5xl:hidden ' +
443
443
  ' max-lg:gap-[30px] '}>
444
444
  <p className={' w-[188px] flex-shrink-0 ' + ' max-lg:w-[156px] ' + ' max-sm:hidden '}></p>
@@ -300,10 +300,6 @@ const Personal = ({
300
300
  newUserObj.name = name;
301
301
  newUserValidObj.nameValid = isValid;
302
302
  } else if (name === 'phoneNumber') {
303
- const { phoneValue, isValid } = getPhoneValue(value);
304
- newUserObj.phoneNumber = phoneValue;
305
- newUserValidObj.phoneNumberValid = isValid;
306
-
307
303
  // 휴대전화 입력값 변경 시 폰 번호 인증이 날린 상태라면 초기화 필요
308
304
  if (userValidObj.phoneSendValid) {
309
305
  newUserValidObj.phoneSendValid = false;
@@ -312,6 +308,9 @@ const Personal = ({
312
308
  setTimeLeft(0);
313
309
  setSendApiCount(0);
314
310
  }
311
+ const { phoneValue, isValid } = getPhoneValue(value);
312
+ newUserObj.phoneNumber = phoneValue;
313
+ newUserValidObj.phoneNumberValid = isValid;
315
314
  } else if (name === 'code') {
316
315
  newUserObj.code = onlyNumberFilter(value);
317
316
  }
@@ -576,13 +575,13 @@ const Personal = ({
576
575
  name={'name'}
577
576
  value={userObj.name}
578
577
  />
579
- {userObj.name.length >= 1 && !userValidObj.nameValid && (
578
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (
580
579
  <p className={'block text-[20px] text-[#AE0E36] max-5xl:hidden max-lg:hidden '}>
581
580
  *이름은 최소 2자 이상으로 입력해 주세요.
582
581
  </p>
583
582
  )}
584
583
  </div>
585
- {userObj.name.length >= 1 && !userValidObj.nameValid && (
584
+ {userObj.name.length >= 1 && !userValidObj.nameValid && !(userObj.name.length >= 2) && (
586
585
  <div
587
586
  className={
588
587
  ' mt-[12px] flex flex-row items-center gap-[24px] ' +
@@ -13,4 +13,5 @@ export interface ITermType {
13
13
  terms_code: string | null;
14
14
  terms_name: string;
15
15
  rn: number | null;
16
+ is_essential?: boolean;
16
17
  }
@@ -13,4 +13,5 @@ export interface ITermType {
13
13
  terms_code: string | null;
14
14
  terms_name: string;
15
15
  rn: number | null;
16
+ is_essential?: boolean;
16
17
  }
package/dist/lib/utils.js CHANGED
@@ -397,12 +397,12 @@ export const lawyerCode = [
397
397
  'LY030'
398
398
  ];
399
399
  export const getNameValue = (value) => {
400
- // 한글(초성, 중성 포함) 또는 영어만 허용, 공백 제거
400
+ // 한글(자모 포함) 또는 영어만 허용, 공백 제거
401
401
  const filteredValue = value.replace(/[^a-zA-Z\u3131-\u318E\uAC00-\uD7A3]/g, '');
402
402
  // 영어만 있는지 확인
403
403
  const isOnlyEnglish = /^[a-zA-Z]+$/.test(filteredValue);
404
- // 한글만 있는지 확인
405
- const isOnlyKorean = /^[\uAC00-\uD7A3]+$/.test(filteredValue);
404
+ // 한글만 있는지 확인 (자모 + 완성형 포함)
405
+ const isOnlyKorean = /^[\u3131-\u318E\uAC00-\uD7A3]+$/.test(filteredValue);
406
406
  // 최소 2글자 이상 + 한글 또는 영어 중 하나만 포함
407
407
  const isValid = (isOnlyEnglish || isOnlyKorean) && filteredValue.length >= 2;
408
408
  return { name: filteredValue, isValid };
package/dist/lib/utils.ts CHANGED
@@ -433,13 +433,13 @@ export const lawyerCode = [
433
433
  ];
434
434
 
435
435
  export const getNameValue = (value: string): { name: string; isValid: boolean } => {
436
- // 한글(초성, 중성 포함) 또는 영어만 허용, 공백 제거
436
+ // 한글(자모 포함) 또는 영어만 허용, 공백 제거
437
437
  const filteredValue = value.replace(/[^a-zA-Z\u3131-\u318E\uAC00-\uD7A3]/g, '');
438
438
 
439
439
  // 영어만 있는지 확인
440
440
  const isOnlyEnglish = /^[a-zA-Z]+$/.test(filteredValue);
441
- // 한글만 있는지 확인
442
- const isOnlyKorean = /^[\uAC00-\uD7A3]+$/.test(filteredValue);
441
+ // 한글만 있는지 확인 (자모 + 완성형 포함)
442
+ const isOnlyKorean = /^[\u3131-\u318E\uAC00-\uD7A3]+$/.test(filteredValue);
443
443
 
444
444
  // 최소 2글자 이상 + 한글 또는 영어 중 하나만 포함
445
445
  const isValid = (isOnlyEnglish || isOnlyKorean) && filteredValue.length >= 2;