summaryrefslogtreecommitdiff
path: root/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx')
-rw-r--r--lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx b/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx
index 28aebd54..74ebc05a 100644
--- a/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx
+++ b/lib/docu-list-rule/code-groups/table/code-groups-edit-sheet.tsx
@@ -19,6 +19,7 @@ import {
import {
Form,
FormControl,
+ FormDescription,
FormField,
FormItem,
FormLabel,
@@ -41,8 +42,8 @@ const updateCodeGroupSchema = z.object({
description: z.string().min(1, "Description은 필수입니다."),
codeFormat: z.string().optional().refine((val) => {
if (!val) return true; // 빈 값은 허용
- return /^[AN]*$/.test(val);
- }, "Code Format은 A(영어 대문자) 또는 N(숫자)만 입력 가능합니다."),
+ return /^[ANX]*$/.test(val);
+ }, "Code Format은 A(영어 대문자), N(숫자), X(영어/숫자)만 입력 가능합니다."),
controlType: z.string().min(1, "Control Type은 필수입니다."),
isActive: z.boolean().default(true),
})
@@ -92,6 +93,8 @@ export function CodeGroupsEditSheet({
expression += `[A-Z]{${count}}`
} else if (currentChar === 'N') {
expression += `[0-9]{${count}}`
+ } else if (currentChar === 'X') {
+ expression += `[A-Z0-9]{${count}}`
}
currentChar = codeFormat[i]
count = 1
@@ -103,6 +106,8 @@ export function CodeGroupsEditSheet({
expression += `[A-Z]{${count}}`
} else if (currentChar === 'N') {
expression += `[0-9]{${count}}`
+ } else if (currentChar === 'X') {
+ expression += `[A-Z0-9]{${count}}`
}
expression += '$'
@@ -183,11 +188,14 @@ export function CodeGroupsEditSheet({
<FormLabel>Code Format</FormLabel>
<FormControl>
<Input
- placeholder="예: AANNN (A:영어대문자, N:숫자)"
+ placeholder="예: AANNN (A:영어대문자, N:숫자, X:영어/숫자)"
{...field}
onBlur={() => form.trigger('codeFormat')}
/>
</FormControl>
+ <FormDescription>
+ A: 영어 대문자, N: 숫자, X: 영어 대문자 또는 숫자
+ </FormDescription>
<FormMessage />
</FormItem>
)}