@tipp/ui 2.1.29 → 3.0.0
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/app/index.cjs +5 -2
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +53 -53
- package/dist/app/platform/coach-question-list.js +26 -26
- package/dist/app/platform/contents-card.js +26 -26
- package/dist/app/platform/curriculum-card.js +2 -2
- package/dist/app/platform/edit-coaching-time.cjs +5 -2
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +41 -41
- package/dist/app/platform/edit-service-type.cjs +5 -2
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +40 -40
- package/dist/app/platform/goal-manage-card-edit.cjs +5 -2
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +41 -41
- package/dist/app/platform/goal-manage-card-read.js +26 -26
- package/dist/app/platform/on-offline-radio-card.cjs +5 -2
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +40 -40
- package/dist/app/platform/report-card.js +26 -26
- package/dist/app/platform/reservation-card.cjs +5 -2
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +41 -41
- package/dist/app/platform/session-card.cjs +5 -2
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +42 -42
- package/dist/app/platform/session-review-simple-read.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +28 -28
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +26 -26
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +25 -25
- package/dist/app/platform/userInfos/session-user-info-detail.js +25 -25
- package/dist/app/platform/userInfos/utils.js +25 -25
- package/dist/atoms/index.js +61 -61
- package/dist/chunk-26D5QIDQ.js +174 -0
- package/dist/chunk-26D5QIDQ.js.map +1 -0
- package/dist/chunk-2GLHYOET.js +144 -0
- package/dist/chunk-2GLHYOET.js.map +1 -0
- package/dist/chunk-2TXMPG5S.js +145 -0
- package/dist/chunk-2TXMPG5S.js.map +1 -0
- package/dist/chunk-3QM2WUAX.js +281 -0
- package/dist/chunk-3QM2WUAX.js.map +1 -0
- package/dist/chunk-5DJ2LHPL.js +144 -0
- package/dist/chunk-5DJ2LHPL.js.map +1 -0
- package/dist/chunk-5K4VOWNF.js +84 -0
- package/dist/chunk-5K4VOWNF.js.map +1 -0
- package/dist/chunk-6327I3ZH.js +196 -0
- package/dist/chunk-6327I3ZH.js.map +1 -0
- package/dist/chunk-6D5RCEOQ.js +281 -0
- package/dist/chunk-6D5RCEOQ.js.map +1 -0
- package/dist/chunk-6KZBQD4O.js +231 -0
- package/dist/chunk-6KZBQD4O.js.map +1 -0
- package/dist/chunk-6Q6OHG2C.js +74 -0
- package/dist/chunk-6Q6OHG2C.js.map +1 -0
- package/dist/chunk-7S2RDGXN.js +101 -0
- package/dist/chunk-7S2RDGXN.js.map +1 -0
- package/dist/chunk-7SAWHUJA.js +89 -0
- package/dist/chunk-7SAWHUJA.js.map +1 -0
- package/dist/chunk-7WEVW6IN.js +28 -0
- package/dist/chunk-7WEVW6IN.js.map +1 -0
- package/dist/chunk-A4ZOVTFX.js +117 -0
- package/dist/chunk-A4ZOVTFX.js.map +1 -0
- package/dist/chunk-A75LCRKO.js +45 -0
- package/dist/chunk-A75LCRKO.js.map +1 -0
- package/dist/chunk-AJRM2CRN.js +281 -0
- package/dist/chunk-AJRM2CRN.js.map +1 -0
- package/dist/chunk-AY2MOPIM.js +64 -0
- package/dist/chunk-AY2MOPIM.js.map +1 -0
- package/dist/chunk-AZXDKQTU.js +49 -0
- package/dist/chunk-AZXDKQTU.js.map +1 -0
- package/dist/chunk-B35ENQ53.js +174 -0
- package/dist/chunk-B35ENQ53.js.map +1 -0
- package/dist/chunk-BMVBU4ZS.js +192 -0
- package/dist/chunk-BMVBU4ZS.js.map +1 -0
- package/dist/chunk-BQ2C4JPD.js +231 -0
- package/dist/chunk-BQ2C4JPD.js.map +1 -0
- package/dist/chunk-BQ4YWXRL.js +51 -0
- package/dist/chunk-BQ4YWXRL.js.map +1 -0
- package/dist/chunk-BUU2P46X.js +145 -0
- package/dist/chunk-BUU2P46X.js.map +1 -0
- package/dist/chunk-C4IWE6EG.js +169 -0
- package/dist/chunk-C4IWE6EG.js.map +1 -0
- package/dist/chunk-C7HMJBJA.js +53 -0
- package/dist/chunk-C7HMJBJA.js.map +1 -0
- package/dist/chunk-D4GJM3C3.js +69 -0
- package/dist/chunk-D4GJM3C3.js.map +1 -0
- package/dist/chunk-DE6WTN3Q.js +144 -0
- package/dist/chunk-DE6WTN3Q.js.map +1 -0
- package/dist/chunk-DOA3BJLX.js +144 -0
- package/dist/chunk-DOA3BJLX.js.map +1 -0
- package/dist/chunk-EL53KVY4.js +144 -0
- package/dist/chunk-EL53KVY4.js.map +1 -0
- package/dist/chunk-ERXU77DA.js +281 -0
- package/dist/chunk-ERXU77DA.js.map +1 -0
- package/dist/chunk-EWFUZOWN.js +281 -0
- package/dist/chunk-EWFUZOWN.js.map +1 -0
- package/dist/chunk-FAZOROOU.js +68 -0
- package/dist/chunk-FAZOROOU.js.map +1 -0
- package/dist/chunk-FENPJ55R.js +230 -0
- package/dist/chunk-FENPJ55R.js.map +1 -0
- package/dist/chunk-FNV6FVQA.js +61 -0
- package/dist/chunk-FNV6FVQA.js.map +1 -0
- package/dist/chunk-FWRJFBQW.js +57 -0
- package/dist/chunk-FWRJFBQW.js.map +1 -0
- package/dist/chunk-FY47YMFM.js +145 -0
- package/dist/chunk-FY47YMFM.js.map +1 -0
- package/dist/chunk-GWJMQBPR.js +231 -0
- package/dist/chunk-GWJMQBPR.js.map +1 -0
- package/dist/chunk-H2NGLG6A.js +363 -0
- package/dist/chunk-H2NGLG6A.js.map +1 -0
- package/dist/chunk-H5UOKPYZ.js +79 -0
- package/dist/chunk-H5UOKPYZ.js.map +1 -0
- package/dist/chunk-HPEQBAHB.js +165 -0
- package/dist/chunk-HPEQBAHB.js.map +1 -0
- package/dist/chunk-I3CMYMBL.js +233 -0
- package/dist/chunk-I3CMYMBL.js.map +1 -0
- package/dist/chunk-IME3WMKT.js +63 -0
- package/dist/chunk-IME3WMKT.js.map +1 -0
- package/dist/chunk-IPF2UOFH.js +63 -0
- package/dist/chunk-IPF2UOFH.js.map +1 -0
- package/dist/chunk-ITUS6SKB.js +64 -0
- package/dist/chunk-ITUS6SKB.js.map +1 -0
- package/dist/chunk-IZHU33JE.js +174 -0
- package/dist/chunk-IZHU33JE.js.map +1 -0
- package/dist/chunk-JEO4YX65.js +63 -0
- package/dist/chunk-JEO4YX65.js.map +1 -0
- package/dist/chunk-JSOXMJ6K.js +43 -0
- package/dist/chunk-JSOXMJ6K.js.map +1 -0
- package/dist/chunk-KO66SUJN.js +174 -0
- package/dist/chunk-KO66SUJN.js.map +1 -0
- package/dist/chunk-KTCFIAAM.js +281 -0
- package/dist/chunk-KTCFIAAM.js.map +1 -0
- package/dist/chunk-LEUTTEBC.js +63 -0
- package/dist/chunk-LEUTTEBC.js.map +1 -0
- package/dist/chunk-M2SQB6ZY.js +23 -0
- package/dist/chunk-M2SQB6ZY.js.map +1 -0
- package/dist/chunk-NVNCLLYC.js +63 -0
- package/dist/chunk-NVNCLLYC.js.map +1 -0
- package/dist/chunk-OV5F3JZH.js +54 -0
- package/dist/chunk-OV5F3JZH.js.map +1 -0
- package/dist/chunk-P2VBB4C5.js +65 -0
- package/dist/chunk-P2VBB4C5.js.map +1 -0
- package/dist/chunk-P5ARB7KK.js +174 -0
- package/dist/chunk-P5ARB7KK.js.map +1 -0
- package/dist/chunk-PKZ4JCB2.js +231 -0
- package/dist/chunk-PKZ4JCB2.js.map +1 -0
- package/dist/chunk-QQ4ZK4BW.js +37 -0
- package/dist/chunk-QQ4ZK4BW.js.map +1 -0
- package/dist/chunk-QTVX2ERL.js +99 -0
- package/dist/chunk-QTVX2ERL.js.map +1 -0
- package/dist/chunk-QZJHGU4X.js +145 -0
- package/dist/chunk-QZJHGU4X.js.map +1 -0
- package/dist/chunk-R77BOAW5.js +151 -0
- package/dist/chunk-R77BOAW5.js.map +1 -0
- package/dist/chunk-RPCKPFRL.js +145 -0
- package/dist/chunk-RPCKPFRL.js.map +1 -0
- package/dist/chunk-RTVZMGDC.js +144 -0
- package/dist/chunk-RTVZMGDC.js.map +1 -0
- package/dist/chunk-SLBSIRB6.js +58 -0
- package/dist/chunk-SLBSIRB6.js.map +1 -0
- package/dist/chunk-UIGZ3PK5.js +63 -0
- package/dist/chunk-UIGZ3PK5.js.map +1 -0
- package/dist/chunk-UKKISPC5.js +145 -0
- package/dist/chunk-UKKISPC5.js.map +1 -0
- package/dist/chunk-UPZMRMK7.js +29 -0
- package/dist/chunk-UPZMRMK7.js.map +1 -0
- package/dist/chunk-UXOYDVHH.js +63 -0
- package/dist/chunk-UXOYDVHH.js.map +1 -0
- package/dist/chunk-UZUQQLTU.js +63 -0
- package/dist/chunk-UZUQQLTU.js.map +1 -0
- package/dist/chunk-VBLQSRLF.js +63 -0
- package/dist/chunk-VBLQSRLF.js.map +1 -0
- package/dist/chunk-VDKHCZHN.js +63 -0
- package/dist/chunk-VDKHCZHN.js.map +1 -0
- package/dist/chunk-VE737SXT.js +30 -0
- package/dist/chunk-VE737SXT.js.map +1 -0
- package/dist/chunk-VL652LU6.js +281 -0
- package/dist/chunk-VL652LU6.js.map +1 -0
- package/dist/chunk-VO7GWTGE.js +163 -0
- package/dist/chunk-VO7GWTGE.js.map +1 -0
- package/dist/chunk-W3DLS557.js +144 -0
- package/dist/chunk-W3DLS557.js.map +1 -0
- package/dist/chunk-WB2EZAD2.js +87 -0
- package/dist/chunk-WB2EZAD2.js.map +1 -0
- package/dist/chunk-WEBCXOO7.js +30 -0
- package/dist/chunk-WEBCXOO7.js.map +1 -0
- package/dist/chunk-WZM6EE5T.js +174 -0
- package/dist/chunk-WZM6EE5T.js.map +1 -0
- package/dist/chunk-X2AK6LTW.js +174 -0
- package/dist/chunk-X2AK6LTW.js.map +1 -0
- package/dist/chunk-X4R5GV7Q.js +125 -0
- package/dist/chunk-X4R5GV7Q.js.map +1 -0
- package/dist/chunk-YL5EYCRV.js +233 -0
- package/dist/chunk-YL5EYCRV.js.map +1 -0
- package/dist/chunk-YOIAYFQM.js +39 -0
- package/dist/chunk-YOIAYFQM.js.map +1 -0
- package/dist/chunk-Z4YM6RFE.js +70 -0
- package/dist/chunk-Z4YM6RFE.js.map +1 -0
- package/dist/chunk-Z5TVNR2U.js +145 -0
- package/dist/chunk-Z5TVNR2U.js.map +1 -0
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +101 -101
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/index.js +30 -30
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-comp.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-body.js +29 -29
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-footer.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-header.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-layout.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-radio.js +26 -26
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-option.js +26 -26
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-satisfaction-text.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/ReviewQuestion/review-question-text.js +26 -26
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/complete-review.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/index.js +32 -32
- package/dist/molecules/curriculumV2/CurriculumContents/CurriculumReviewSteps/start-review.js +26 -26
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-ai-traning.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-review.js +33 -33
- package/dist/molecules/curriculumV2/CurriculumContents/curriculum-video.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumContents/index.js +34 -34
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-item-title.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/curriculum-sidebar-item-wrapper.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-item.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumSidebar/Items/section-title.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumSidebar/index.js +25 -25
- package/dist/molecules/curriculumV2/CurriculumSidebar/sidebar-item.js +25 -25
- package/dist/molecules/curriculumV2/curriculum-sub-nav.js +25 -25
- package/dist/molecules/curriculumV2/curriculum-v2-layout.js +25 -25
- package/dist/molecules/curriculumV2/index.js +34 -34
- package/dist/molecules/date-picker/date-picker-button.cjs +5 -2
- package/dist/molecules/date-picker/date-picker-button.cjs.map +1 -1
- package/dist/molecules/date-picker/date-picker-button.js +27 -27
- package/dist/molecules/date-picker/index.cjs +5 -2
- package/dist/molecules/date-picker/index.cjs.map +1 -1
- package/dist/molecules/date-picker/index.js +26 -26
- package/dist/molecules/expand-table/index.js +25 -25
- package/dist/molecules/expand-table/row.js +25 -25
- package/dist/molecules/index.cjs +5 -2
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +42 -42
- package/dist/molecules/learning-post.js +2 -2
- package/dist/molecules/navigation.js +25 -25
- package/dist/molecules/radio-button-card.js +25 -25
- package/dist/molecules/stepper.js +2 -2
- package/dist/molecules/tag-selector.js +26 -26
- package/dist/molecules/time-select.js +25 -25
- package/package.json +3 -3
- package/src/molecules/date-picker/index.tsx +8 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/goal-manage-card-read.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from 'react';\nimport { format, startOfDay } from 'date-fns';\nimport type { BadgeProps } from '../../atoms';\nimport {\n Box,\n Button,\n Card,\n Collapse,\n Flex,\n Heading,\n Badge,\n Typo,\n Popover,\n Grid,\n Separator,\n IconButton,\n} from '../../atoms';\nimport {\n ChevronDownIcon,\n ChevronUpIcon,\n Pencil1Icon,\n RocketIcon,\n TrashIcon,\n} from '../../icon';\n\nexport interface GoalManageCardProps {\n defaultOpen?: boolean;\n title?: string;\n dueDate?: Date;\n completed?: boolean;\n expectedEffect?: string;\n huddle?: string;\n onClickDelete?: () => void;\n onClickEdit?: () => void;\n onClickComplete?: () => void;\n onClickIncomplete?: () => void;\n}\n\nexport function GoalManageCardRead(\n props: GoalManageCardProps\n): React.ReactNode {\n const {\n title,\n dueDate,\n completed,\n expectedEffect,\n huddle,\n onClickDelete,\n onClickEdit,\n defaultOpen,\n onClickIncomplete,\n onClickComplete,\n } = props;\n const [open, setOpen] = useState<boolean>(Boolean(defaultOpen));\n const onClickOpen = useCallback(() => {\n setOpen((p) => !p);\n }, []);\n\n const icon = open ? <ChevronUpIcon /> : <ChevronDownIcon />;\n\n const badgeMeta = useMemo<BadgeProps | null>(() => {\n if (!completed && dueDate) {\n if (dueDate >= startOfDay(new Date()))\n return {\n color: 'success',\n children: '진행 중',\n } as const;\n return { color: 'error', children: '미달성' };\n }\n return null;\n }, [completed, dueDate]);\n\n const renderSubTitle = useCallback((subTitle: string) => {\n return (\n <Heading mb=\"2\" variant=\"heading5\">\n {subTitle}\n </Heading>\n );\n }, []);\n\n const renderSubContent = useCallback((content?: string) => {\n return (\n <Typo as=\"p\" color=\"gray\">\n {content}\n </Typo>\n );\n }, []);\n\n const renderCompleteButton = useCallback(() => {\n if (completed) {\n return (\n <Button onClick={onClickIncomplete} size=\"small\" variant=\"surface\">\n 진행중인 과제로 돌려놓기\n </Button>\n );\n }\n\n return (\n <Popover.Root>\n <Popover.Trigger>\n <Button size=\"small\">\n <RocketIcon />\n 달성하기\n </Button>\n </Popover.Trigger>\n <Popover.Content>\n <Typo color=\"gray\">목표를 달성하시겠습니까?</Typo>\n <Flex gap=\"3\" justify=\"end\" mt=\"3\">\n <Popover.Close>\n <Button color=\"gray\" size=\"small\" variant=\"outline\">\n 아니요\n </Button>\n </Popover.Close>\n <Popover.Close>\n <Button onClick={onClickComplete} size=\"small\">\n 예\n </Button>\n </Popover.Close>\n </Flex>\n </Popover.Content>\n </Popover.Root>\n );\n }, [completed, onClickIncomplete, onClickComplete]);\n\n return (\n <Card>\n <Grid align=\"center\" columns=\"auto 1fr\" gapX=\"3\">\n <IconButton onClick={onClickOpen} variant=\"ghost\">\n {icon}\n </IconButton>\n <Heading variant=\"heading4\">{title}</Heading>\n\n <Flex align=\"center\" gridColumnStart=\"2\" justify=\"between\" mt=\"2\">\n <Flex align=\"center\" gap=\"3\">\n {badgeMeta ? <Badge {...badgeMeta} /> : null}\n <Typo color=\"gray\">\n {dueDate ? format(dueDate, 'yyyy년 MM월 dd일') : null}\n </Typo>\n </Flex>\n {renderCompleteButton()}\n </Flex>\n {open ? (\n <Separator\n mb=\"4\"\n mt=\"4\"\n size=\"4\"\n style={{ gridColumnStart: 'span 2' }}\n />\n ) : null}\n <Box gridColumnStart=\"2\" p=\"0\">\n <Collapse open={open}>\n <Flex direction=\"column\" gap=\"5\">\n <Box>\n {renderSubTitle(\n '해당 목표를 달성하면, 아래와 같은 결과를 얻을 수 있습니다'\n )}\n {renderSubContent(expectedEffect)}\n </Box>\n <Box>\n {renderSubTitle(\n '목표를 이루기까지 방해가 될 수 있는 요소들은 다음과 같습니다'\n )}\n {renderSubContent(huddle)}\n </Box>\n </Flex>\n <Flex align=\"center\" gap=\"3\" justify=\"end\" mt=\"3\">\n <Popover.Root>\n <Popover.Trigger>\n <Button color=\"gray\" size=\"small\" variant=\"ghost\">\n <TrashIcon />\n 삭제하기\n </Button>\n </Popover.Trigger>\n <Popover.Content>\n <Typo color=\"gray\">목표를 삭제하시겠습니까?</Typo>\n <Flex gap=\"3\" justify=\"end\" mt=\"3\">\n <Popover.Close>\n <Button color=\"gray\" size=\"small\" variant=\"outline\">\n 아니요\n </Button>\n </Popover.Close>\n <Popover.Close>\n <Button onClick={onClickDelete} size=\"small\">\n 예\n </Button>\n </Popover.Close>\n </Flex>\n </Popover.Content>\n </Popover.Root>\n <Button onClick={onClickEdit} size=\"small\" variant=\"surface\">\n <Pencil1Icon />\n 수정하기\n </Button>\n </Flex>\n </Collapse>\n </Box>\n </Grid>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,aAAa,SAAS,gBAAgB;AACtD,SAAS,QAAQ,kBAAkB;AAyDb,cA0CZ,YA1CY;AApBf,SAAS,mBACd,OACiB;AACjB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,CAAC,MAAM,OAAO,IAAI,SAAkB,QAAQ,WAAW,CAAC;AAC9D,QAAM,cAAc,YAAY,MAAM;AACpC,YAAQ,CAAC,MAAM,CAAC,CAAC;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,OAAO,OAAO,oBAAC,iBAAc,IAAK,oBAAC,mBAAgB;AAEzD,QAAM,YAAY,QAA2B,MAAM;AACjD,QAAI,CAAC,aAAa,SAAS;AACzB,UAAI,WAAW,WAAW,oBAAI,KAAK,CAAC;AAClC,eAAO;AAAA,UACL,OAAO;AAAA,UACP,UAAU;AAAA,QACZ;AACF,aAAO,EAAE,OAAO,SAAS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C,GACF;AAAA,eACF;AAAA,aACF;AAAA,WACF;AAAA,QACA,qBAAC,UAAO,SAAS,aAAa,MAAK,SAAQ,SAAQ,WACjD;AAAA,8BAAC,eAAY;AAAA,UAAE;AAAA,WAEjB;AAAA,SACF;AAAA,OACF,GACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover
|
|
3
|
+
} from "./chunk-5AVBYDPB.js";
|
|
4
|
+
import {
|
|
5
|
+
Heading
|
|
6
|
+
} from "./chunk-34OQDUQR.js";
|
|
7
|
+
import {
|
|
8
|
+
IconButton
|
|
9
|
+
} from "./chunk-O3DNDMV3.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Flex
|
|
15
|
+
} from "./chunk-25HMMI7R.js";
|
|
16
|
+
import {
|
|
17
|
+
Typo
|
|
18
|
+
} from "./chunk-PARGQUJB.js";
|
|
19
|
+
import {
|
|
20
|
+
Button
|
|
21
|
+
} from "./chunk-AFPH32MF.js";
|
|
22
|
+
import {
|
|
23
|
+
ChevronLeftIcon,
|
|
24
|
+
ChevronRightIcon
|
|
25
|
+
} from "./chunk-V5XKNSCK.js";
|
|
26
|
+
import {
|
|
27
|
+
__objRest,
|
|
28
|
+
__spreadProps,
|
|
29
|
+
__spreadValues
|
|
30
|
+
} from "./chunk-2NMEKWO5.js";
|
|
31
|
+
|
|
32
|
+
// src/molecules/date-picker/index.tsx
|
|
33
|
+
import { forwardRef, useMemo, useState, useEffect, useRef } from "react";
|
|
34
|
+
import ReactDatePicker from "react-datepicker";
|
|
35
|
+
import { ko } from "date-fns/locale";
|
|
36
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
37
|
+
var weekDays = ["\uC77C", "\uC6D4", "\uD654", "\uC218", "\uBAA9", "\uAE08", "\uD1A0"];
|
|
38
|
+
var DatePicker = forwardRef(
|
|
39
|
+
(props, ref) => {
|
|
40
|
+
const _a = props, { fullWidth } = _a, rest = __objRest(_a, ["fullWidth"]);
|
|
41
|
+
const fullWidthClassName = fullWidth ? "full-width" : "";
|
|
42
|
+
const [isYearDropdownOpen, setIsYearDropdownOpen] = useState(false);
|
|
43
|
+
const [isMonthDropdownOpen, setIsMonthDropdownOpen] = useState(false);
|
|
44
|
+
const renderCustomHeader = useMemo(() => {
|
|
45
|
+
const getYears = () => {
|
|
46
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
47
|
+
return Array.from(
|
|
48
|
+
{ length: currentYear + 5 - 1920 },
|
|
49
|
+
(_, index) => 1920 + index
|
|
50
|
+
).filter((year) => {
|
|
51
|
+
if (props.minDate && year < props.minDate.getFullYear()) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (props.maxDate && year > props.maxDate.getFullYear()) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
return getRenderCustomHeader(__spreadProps(__spreadValues({}, props), {
|
|
61
|
+
years: getYears(),
|
|
62
|
+
isYearDropdownOpen,
|
|
63
|
+
setIsYearDropdownOpen,
|
|
64
|
+
isMonthDropdownOpen,
|
|
65
|
+
setIsMonthDropdownOpen
|
|
66
|
+
}));
|
|
67
|
+
}, [isMonthDropdownOpen, isYearDropdownOpen, props]);
|
|
68
|
+
return /* @__PURE__ */ jsx(Flex, { p: "0", width: "100%", children: /* @__PURE__ */ jsx(
|
|
69
|
+
ReactDatePicker,
|
|
70
|
+
__spreadProps(__spreadValues({
|
|
71
|
+
dateFormat: "yyyy/MM/dd h:mm aa",
|
|
72
|
+
formatWeekDay: (nameOfDay) => {
|
|
73
|
+
console.log(nameOfDay);
|
|
74
|
+
return weekDays[0];
|
|
75
|
+
},
|
|
76
|
+
locale: ko,
|
|
77
|
+
nextMonthButtonLabel: "\uB2E4\uC74C \uB2EC",
|
|
78
|
+
placeholderText: "YYYY/MM/DD hh:mm AM/PM",
|
|
79
|
+
popperProps: { strategy: "fixed" },
|
|
80
|
+
previousMonthButtonLabel: "\uC774\uC804 \uB2EC",
|
|
81
|
+
ref,
|
|
82
|
+
renderCustomHeader,
|
|
83
|
+
showPopperArrow: false,
|
|
84
|
+
timeCaption: "\uC2DC\uAC04",
|
|
85
|
+
timeFormat: "h:mm aa",
|
|
86
|
+
timeIntervals: 10
|
|
87
|
+
}, rest), {
|
|
88
|
+
calendarClassName: `tipp_datePicker_calendar ${rest.calendarClassName || ""}`,
|
|
89
|
+
wrapperClassName: `tipp_datePicker ${fullWidthClassName} ${rest.wrapperClassName || ""}`
|
|
90
|
+
})
|
|
91
|
+
) });
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
DatePicker.displayName = "DatePicker";
|
|
95
|
+
function DropdownSelector({
|
|
96
|
+
isOpen,
|
|
97
|
+
onOpenChange,
|
|
98
|
+
onSelect,
|
|
99
|
+
options,
|
|
100
|
+
selectedValue,
|
|
101
|
+
suffix
|
|
102
|
+
}) {
|
|
103
|
+
const scrollContainerRef = useRef(null);
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (isOpen) {
|
|
106
|
+
queueMicrotask(() => {
|
|
107
|
+
var _a;
|
|
108
|
+
const item = (_a = scrollContainerRef.current) == null ? void 0 : _a.querySelector(
|
|
109
|
+
`[data-year-month-dropdown-tiem="${selectedValue}"]`
|
|
110
|
+
);
|
|
111
|
+
if (item) {
|
|
112
|
+
item.scrollIntoView({ behavior: "instant" });
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}, [isOpen]);
|
|
117
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { onOpenChange, open: isOpen, modal: true, children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(Button, { variant: "ghost", children: /* @__PURE__ */ jsxs(Heading, { variant: "heading4", weight: "regular", children: [
|
|
119
|
+
selectedValue,
|
|
120
|
+
suffix
|
|
121
|
+
] }) }) }),
|
|
122
|
+
/* @__PURE__ */ jsx(Popover.Content, { side: "bottom", children: /* @__PURE__ */ jsx(
|
|
123
|
+
Box,
|
|
124
|
+
{
|
|
125
|
+
maxHeight: "200px",
|
|
126
|
+
overflowY: "auto",
|
|
127
|
+
ref: scrollContainerRef,
|
|
128
|
+
style: { scrollbarWidth: "none" },
|
|
129
|
+
children: /* @__PURE__ */ jsx(Flex, { direction: "column", gap: "1", children: options.map((item) => /* @__PURE__ */ jsx(
|
|
130
|
+
Button,
|
|
131
|
+
{
|
|
132
|
+
color: "gray",
|
|
133
|
+
"data-year-month-dropdown-tiem": item,
|
|
134
|
+
className: "react-datepicker_dropdown_item",
|
|
135
|
+
onMouseDown: (e) => {
|
|
136
|
+
e.stopPropagation();
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
},
|
|
139
|
+
onClick: () => {
|
|
140
|
+
onSelect(item);
|
|
141
|
+
},
|
|
142
|
+
variant: "transparent",
|
|
143
|
+
children: /* @__PURE__ */ jsxs(Typo, { weight: item === selectedValue ? "bold" : void 0, children: [
|
|
144
|
+
item,
|
|
145
|
+
suffix
|
|
146
|
+
] })
|
|
147
|
+
},
|
|
148
|
+
item
|
|
149
|
+
)) })
|
|
150
|
+
}
|
|
151
|
+
) })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
var getRenderCustomHeader = (props) => {
|
|
155
|
+
const renderer = (renderCustomHeaderProps) => {
|
|
156
|
+
const {
|
|
157
|
+
date,
|
|
158
|
+
decreaseMonth,
|
|
159
|
+
increaseMonth,
|
|
160
|
+
prevMonthButtonDisabled,
|
|
161
|
+
nextMonthButtonDisabled,
|
|
162
|
+
changeYear,
|
|
163
|
+
changeMonth
|
|
164
|
+
} = renderCustomHeaderProps;
|
|
165
|
+
const {
|
|
166
|
+
years,
|
|
167
|
+
isYearDropdownOpen,
|
|
168
|
+
setIsYearDropdownOpen,
|
|
169
|
+
isMonthDropdownOpen,
|
|
170
|
+
setIsMonthDropdownOpen
|
|
171
|
+
} = props;
|
|
172
|
+
const year = date ? new Date(date).getFullYear() : "-";
|
|
173
|
+
const month = date ? new Date(date).getMonth() + 1 : "-";
|
|
174
|
+
return /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "between", pl: "2", pr: "2", children: [
|
|
175
|
+
/* @__PURE__ */ jsx(
|
|
176
|
+
IconButton,
|
|
177
|
+
{
|
|
178
|
+
disabled: prevMonthButtonDisabled,
|
|
179
|
+
onClick: decreaseMonth,
|
|
180
|
+
type: "button",
|
|
181
|
+
variant: "ghost",
|
|
182
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", children: [
|
|
186
|
+
/* @__PURE__ */ jsx(
|
|
187
|
+
DropdownSelector,
|
|
188
|
+
{
|
|
189
|
+
isOpen: isYearDropdownOpen,
|
|
190
|
+
onOpenChange: setIsYearDropdownOpen,
|
|
191
|
+
onSelect: (value) => {
|
|
192
|
+
changeYear(value);
|
|
193
|
+
setIsYearDropdownOpen(false);
|
|
194
|
+
},
|
|
195
|
+
options: years,
|
|
196
|
+
selectedValue: year,
|
|
197
|
+
suffix: "\uB144"
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
DropdownSelector,
|
|
202
|
+
{
|
|
203
|
+
isOpen: isMonthDropdownOpen,
|
|
204
|
+
onOpenChange: setIsMonthDropdownOpen,
|
|
205
|
+
onSelect: (value) => {
|
|
206
|
+
changeMonth(value - 1);
|
|
207
|
+
setIsMonthDropdownOpen(false);
|
|
208
|
+
},
|
|
209
|
+
options: Array.from({ length: 12 }, (_, index) => index + 1),
|
|
210
|
+
selectedValue: month,
|
|
211
|
+
suffix: "\uC6D4"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ jsx(
|
|
216
|
+
IconButton,
|
|
217
|
+
{
|
|
218
|
+
disabled: nextMonthButtonDisabled,
|
|
219
|
+
onClick: increaseMonth,
|
|
220
|
+
type: "button",
|
|
221
|
+
variant: "ghost",
|
|
222
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
223
|
+
}
|
|
224
|
+
)
|
|
225
|
+
] });
|
|
226
|
+
};
|
|
227
|
+
return renderer;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export {
|
|
231
|
+
DatePicker
|
|
232
|
+
};
|
|
233
|
+
//# sourceMappingURL=chunk-I3CMYMBL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/date-picker/index.tsx"],"sourcesContent":["import type { ElementRef } from 'react';\nimport React, { forwardRef, useMemo, useState, useEffect, useRef } from 'react';\nimport type { DatePickerProps as ReactDatePickerProps } from 'react-datepicker';\nimport ReactDatePicker from 'react-datepicker';\nimport { ko } from 'date-fns/locale';\nimport { Box, Button, Popover, Typo } from '@/atoms';\nimport { IconButton } from '../../atoms/icon-button';\nimport { Flex } from '../../atoms/flex';\nimport { ChevronLeftIcon, ChevronRightIcon } from '../../icon';\nimport { Heading } from '../../atoms/heading';\n\nexport type DatePickerProps = ReactDatePickerProps & {\n fullWidth?: boolean;\n};\ntype DatePickerRef = ElementRef<typeof ReactDatePicker>;\nconst weekDays = [\"일\", \"월\", \"화\", \"수\", \"목\", \"금\", \"토\"];\n\nexport const DatePicker = forwardRef<DatePickerRef, DatePickerProps>(\n (props, ref): React.ReactNode => {\n const { fullWidth, ...rest } = props;\n const fullWidthClassName = fullWidth ? 'full-width' : '';\n const [isYearDropdownOpen, setIsYearDropdownOpen] = useState(false);\n const [isMonthDropdownOpen, setIsMonthDropdownOpen] = useState(false);\n\n const renderCustomHeader = useMemo(() => {\n const getYears = (): number[] => {\n const currentYear = new Date().getFullYear();\n return Array.from(\n { length: currentYear + 5 - 1920 },\n (_, index) => 1920 + index\n ).filter((year) => {\n if (props.minDate && year < props.minDate.getFullYear()) {\n return false;\n }\n if (props.maxDate && year > props.maxDate.getFullYear()) {\n return false;\n }\n return true;\n });\n };\n\n return getRenderCustomHeader({\n ...props,\n years: getYears(),\n isYearDropdownOpen,\n setIsYearDropdownOpen,\n isMonthDropdownOpen,\n setIsMonthDropdownOpen,\n });\n }, [isMonthDropdownOpen, isYearDropdownOpen, props]);\n\n return (\n <Flex p=\"0\" width=\"100%\">\n <ReactDatePicker\n dateFormat=\"yyyy/MM/dd h:mm aa\"\n formatWeekDay={(nameOfDay) => {\n console.log(nameOfDay);\n return weekDays[0];\n }}\n locale={ko}\n nextMonthButtonLabel=\"다음 달\"\n placeholderText=\"YYYY/MM/DD hh:mm AM/PM\"\n popperProps={{ strategy: 'fixed' }}\n previousMonthButtonLabel=\"이전 달\"\n ref={ref}\n renderCustomHeader={renderCustomHeader}\n showPopperArrow={false}\n timeCaption=\"시간\"\n timeFormat=\"h:mm aa\"\n timeIntervals={10} \n {...rest}\n calendarClassName={`tipp_datePicker_calendar ${rest.calendarClassName || ''}`}\n wrapperClassName={`tipp_datePicker ${fullWidthClassName} ${rest.wrapperClassName || ''}`}\n />\n </Flex>\n );\n }\n);\n\nDatePicker.displayName = 'DatePicker';\n\ninterface DropdownSelectorProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n onSelect: (value: number) => void;\n options: number[];\n selectedValue: number | string;\n suffix: string;\n}\n\nfunction DropdownSelector({\n isOpen,\n onOpenChange,\n onSelect,\n options,\n selectedValue,\n suffix,\n}: DropdownSelectorProps): React.JSX.Element {\n\n const scrollContainerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (isOpen) { \n queueMicrotask(() => {\n const item = scrollContainerRef.current?.querySelector(\n `[data-year-month-dropdown-tiem=\"${selectedValue}\"]`\n );\n if (item) {\n item.scrollIntoView({ behavior: 'instant' });\n }\n });\n }\n }, [isOpen]);\n \n\n return (\n <Popover.Root onOpenChange={onOpenChange} open={isOpen} modal>\n <Popover.Trigger>\n <Button variant=\"ghost\">\n <Heading variant=\"heading4\" weight=\"regular\">\n {selectedValue}\n {suffix}\n </Heading>\n </Button>\n </Popover.Trigger>\n <Popover.Content side=\"bottom\">\n <Box\n maxHeight=\"200px\"\n overflowY=\"auto\"\n ref={scrollContainerRef}\n style={{ scrollbarWidth: 'none' }}\n >\n <Flex direction=\"column\" gap=\"1\">\n {options.map((item: number) => (\n <Button\n color=\"gray\"\n data-year-month-dropdown-tiem={item}\n key={item}\n className={'react-datepicker_dropdown_item'}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n onClick={() => {\n onSelect(item);\n }}\n variant=\"transparent\"\n >\n <Typo weight= {item === selectedValue ? 'bold' : undefined}>\n {item}\n {suffix}\n </Typo>\n </Button>\n ))}\n </Flex>\n </Box>\n </Popover.Content>\n </Popover.Root>\n );\n}\n\nconst getRenderCustomHeader: (\n props: ReactDatePickerProps & {\n years: number[];\n isYearDropdownOpen: boolean;\n setIsYearDropdownOpen: (show: boolean) => void;\n isMonthDropdownOpen: boolean;\n setIsMonthDropdownOpen: (show: boolean) => void;\n }\n) => ReactDatePickerProps['renderCustomHeader'] = (props) => {\n const renderer: ReactDatePickerProps['renderCustomHeader'] = (\n renderCustomHeaderProps\n ) => {\n const {\n date,\n decreaseMonth,\n increaseMonth,\n prevMonthButtonDisabled,\n nextMonthButtonDisabled,\n changeYear,\n changeMonth,\n } = renderCustomHeaderProps;\n const {\n years,\n isYearDropdownOpen,\n setIsYearDropdownOpen,\n isMonthDropdownOpen,\n setIsMonthDropdownOpen,\n } = props;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- date가 undefined일 수 있음\n const year = date ? new Date(date).getFullYear() : '-';\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- date가 undefined일 수 있음\n const month = date ? new Date(date).getMonth() + 1 : '-';\n\n return (\n <Flex align=\"center\" justify=\"between\" pl=\"2\" pr=\"2\">\n <IconButton\n disabled={prevMonthButtonDisabled}\n onClick={decreaseMonth}\n type=\"button\"\n variant=\"ghost\"\n >\n <ChevronLeftIcon />\n </IconButton>\n <Flex gap=\"3\">\n <DropdownSelector\n isOpen={isYearDropdownOpen}\n onOpenChange={setIsYearDropdownOpen}\n onSelect={(value) => {\n changeYear(value);\n setIsYearDropdownOpen(false);\n }}\n options={years}\n selectedValue={year}\n suffix=\"년\"\n />\n <DropdownSelector\n isOpen={isMonthDropdownOpen}\n onOpenChange={setIsMonthDropdownOpen}\n onSelect={(value) => {\n changeMonth(value - 1);\n setIsMonthDropdownOpen(false);\n }}\n options={Array.from({ length: 12 }, (_, index) => index + 1)}\n selectedValue={month}\n suffix=\"월\"\n />\n </Flex>\n\n <IconButton\n disabled={nextMonthButtonDisabled}\n onClick={increaseMonth}\n type=\"button\"\n variant=\"ghost\"\n >\n <ChevronRightIcon />\n </IconButton>\n </Flex>\n );\n };\n return renderer;\n};\n\n// DatePicker.displayName = 'DatePicker';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAgB,YAAY,SAAS,UAAU,WAAW,cAAc;AAExE,OAAO,qBAAqB;AAC5B,SAAS,UAAU;AAiDX,cAiEE,YAjEF;AAtCR,IAAM,WAAW,CAAC,UAAK,UAAK,UAAK,UAAK,UAAK,UAAK,QAAG;AAE5C,IAAM,aAAa;AAAA,EACxB,CAAC,OAAO,QAAyB;AAC/B,UAA+B,YAAvB,YAnBZ,IAmBmC,IAAT,iBAAS,IAAT,CAAd;AACR,UAAM,qBAAqB,YAAY,eAAe;AACtD,UAAM,CAAC,oBAAoB,qBAAqB,IAAI,SAAS,KAAK;AAClE,UAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AAEpE,UAAM,qBAAqB,QAAQ,MAAM;AACvC,YAAM,WAAW,MAAgB;AAC/B,cAAM,eAAc,oBAAI,KAAK,GAAE,YAAY;AAC3C,eAAO,MAAM;AAAA,U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
+
} from "./chunk-34OQDUQR.js";
|
|
4
|
+
import {
|
|
5
|
+
Card
|
|
6
|
+
} from "./chunk-HEDMSFPW.js";
|
|
7
|
+
import {
|
|
8
|
+
Badge
|
|
9
|
+
} from "./chunk-FCIHNIOH.js";
|
|
10
|
+
import {
|
|
11
|
+
Box
|
|
12
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
13
|
+
import {
|
|
14
|
+
Flex
|
|
15
|
+
} from "./chunk-25HMMI7R.js";
|
|
16
|
+
import {
|
|
17
|
+
Typo
|
|
18
|
+
} from "./chunk-PARGQUJB.js";
|
|
19
|
+
|
|
20
|
+
// src/app/platform/session-review-simple-read.tsx
|
|
21
|
+
import { useMemo } from "react";
|
|
22
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
function SubTitleWrapper({
|
|
24
|
+
children,
|
|
25
|
+
title
|
|
26
|
+
}) {
|
|
27
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "2", children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Heading, { mb: "2", variant: "heading5", weight: "regular", children: title }),
|
|
29
|
+
/* @__PURE__ */ jsx(Box, { children })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function SessionReviewSimpleRead({
|
|
33
|
+
helpfulness,
|
|
34
|
+
review
|
|
35
|
+
}) {
|
|
36
|
+
const helpfulnessMeta = useMemo(() => {
|
|
37
|
+
if (helpfulness) {
|
|
38
|
+
return {
|
|
39
|
+
text: "\uB124",
|
|
40
|
+
color: "success"
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (typeof helpfulness === "undefined") {
|
|
44
|
+
return {
|
|
45
|
+
text: "-",
|
|
46
|
+
color: "neutral"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
text: "\uC544\uB2C8\uC694",
|
|
51
|
+
color: "error"
|
|
52
|
+
};
|
|
53
|
+
}, [helpfulness]);
|
|
54
|
+
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "5", children: [
|
|
55
|
+
/* @__PURE__ */ jsx(SubTitleWrapper, { title: "\uC774\uBC88 \uCF54\uCE6D\uC774 \uBAA9\uD45C \uB2EC\uC131\uC5D0 \uB3C4\uC6C0\uC774 \uB418\uC5C8\uB098\uC694?", children: /* @__PURE__ */ jsx(Badge, { color: helpfulnessMeta.color, children: helpfulnessMeta.text }) }),
|
|
56
|
+
/* @__PURE__ */ jsx(SubTitleWrapper, { title: "\uC138\uC158 \uD6C4\uAE30", children: /* @__PURE__ */ jsx(Card, { children: review ? /* @__PURE__ */ jsx(Typo, { as: "p", children: review }) : /* @__PURE__ */ jsx(Typo, { color: "gray", children: "\uC785\uB825\uB41C \uD6C4\uAE30\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4." }) }) })
|
|
57
|
+
] }) });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
SessionReviewSimpleRead
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-IME3WMKT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/app/platform/session-review-simple-read.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport type { BadgeProps } from '../../atoms';\nimport { Badge, Box, Card, Flex, Heading, Typo } from '../../atoms';\n\nexport interface SessionReviewSimpleReadProps {\n helpfulness?: boolean;\n review?: string;\n}\n\nfunction SubTitleWrapper({\n children,\n title,\n}: {\n children: React.ReactNode;\n title: string;\n}): React.ReactNode {\n return (\n <Flex direction=\"column\" gap=\"2\">\n <Heading mb=\"2\" variant=\"heading5\" weight=\"regular\">\n {title}\n </Heading>\n\n <Box>{children}</Box>\n </Flex>\n );\n}\n\nexport function SessionReviewSimpleRead({\n helpfulness,\n review,\n}: SessionReviewSimpleReadProps): React.ReactNode {\n const helpfulnessMeta = useMemo<{\n text: string;\n color: BadgeProps['color'];\n }>(() => {\n if (helpfulness) {\n return {\n text: '네',\n color: 'success',\n };\n }\n if (typeof helpfulness === 'undefined') {\n return {\n text: '-',\n color: 'neutral',\n };\n }\n return {\n text: '아니요',\n color: 'error',\n };\n }, [helpfulness]);\n\n return (\n <Box>\n <Flex direction=\"column\" gap=\"5\">\n <SubTitleWrapper title=\"이번 코칭이 목표 달성에 도움이 되었나요?\">\n <Badge color={helpfulnessMeta.color}>{helpfulnessMeta.text}</Badge>\n </SubTitleWrapper>\n <SubTitleWrapper title=\"세션 후기\">\n <Card>\n {review ? (\n <Typo as=\"p\">{review}</Typo>\n ) : (\n <Typo color=\"gray\">입력된 후기가 없습니다.</Typo>\n )}\n </Card>\n </SubTitleWrapper>\n </Flex>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAe;AAiB3B,SACE,KADF;AARJ,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AACF,GAGoB;AAClB,SACE,qBAAC,QAAK,WAAU,UAAS,KAAI,KAC3B;AAAA,wBAAC,WAAQ,IAAG,KAAI,SAAQ,YAAW,QAAO,WACvC,iBACH;AAAA,IAEA,oBAAC,OAAK,UAAS;AAAA,KACjB;AAEJ;AAEO,SAAS,wBAAwB;AAAA,EACtC;AAAA,EACA;AACF,GAAkD;AAChD,QAAM,kBAAkB,QAGrB,MAAM;AACP,QAAI,aAAa;AACf,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF;AACA,QAAI,OAAO,gBAAgB,aAAa;AACtC,aAAO;AAAA,QACL,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF,GAAG,CAAC,WAAW,CAAC;AAEhB,SACE,oBAAC,OACC,+BAAC,QAAK,WAAU,UAAS,KAAI,KAC3B;AAAA,wBAAC,mBAAgB,OAAM,gHACrB,8BAAC,SAAM,OAAO,gBAAgB,OAAQ,0BAAgB,MAAK,GAC7D;AAAA,IACA,oBAAC,mBAAgB,OAAM,6BACrB,8BAAC,QACE,mBACC,oBAAC,QAAK,IAAG,KAAK,kBAAO,IAErB,oBAAC,QAAK,OAAM,QAAO,6EAAa,GAEpC,GACF;AAAA,KACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DatePicker
|
|
3
|
+
} from "./chunk-GWJMQBPR.js";
|
|
4
|
+
import {
|
|
5
|
+
Box
|
|
6
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
7
|
+
import {
|
|
8
|
+
Flex
|
|
9
|
+
} from "./chunk-25HMMI7R.js";
|
|
10
|
+
import {
|
|
11
|
+
Button
|
|
12
|
+
} from "./chunk-AFPH32MF.js";
|
|
13
|
+
import {
|
|
14
|
+
CalendarIcon
|
|
15
|
+
} from "./chunk-V5XKNSCK.js";
|
|
16
|
+
import {
|
|
17
|
+
__objRest,
|
|
18
|
+
__spreadProps,
|
|
19
|
+
__spreadValues
|
|
20
|
+
} from "./chunk-2NMEKWO5.js";
|
|
21
|
+
|
|
22
|
+
// src/molecules/date-picker/date-picker-button.tsx
|
|
23
|
+
import { useMemo } from "react";
|
|
24
|
+
import { format } from "date-fns";
|
|
25
|
+
import { clsx } from "clsx";
|
|
26
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
27
|
+
function DatePickerButton(props) {
|
|
28
|
+
const _a = props, { size, placeholder, format: formatProps, disabled } = _a, rest = __objRest(_a, ["size", "placeholder", "format", "disabled"]);
|
|
29
|
+
const buttonProps = useMemo(() => {
|
|
30
|
+
const variant = "outline";
|
|
31
|
+
const color = "gray";
|
|
32
|
+
return { size, color, variant, disabled };
|
|
33
|
+
}, [disabled, size]);
|
|
34
|
+
const selectFormat = useMemo(() => {
|
|
35
|
+
if (formatProps) return formatProps;
|
|
36
|
+
return (date) => {
|
|
37
|
+
return date ? format(date, "yyyy\uB144 MM\uC6D4 dd\uC77C") : placeholder;
|
|
38
|
+
};
|
|
39
|
+
}, [formatProps, placeholder]);
|
|
40
|
+
const className = useMemo(() => {
|
|
41
|
+
return clsx(
|
|
42
|
+
"date-picker-button",
|
|
43
|
+
(disabled || props.readOnly) && "disabled"
|
|
44
|
+
);
|
|
45
|
+
}, [disabled, props.readOnly]);
|
|
46
|
+
return /* @__PURE__ */ jsx(Box, { p: "0", width: "100%", children: /* @__PURE__ */ jsx(
|
|
47
|
+
DatePicker,
|
|
48
|
+
__spreadProps(__spreadValues({
|
|
49
|
+
customInput: /* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({ className, type: "button" }, buttonProps), { children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "3", justify: "between", width: "100%", children: [
|
|
50
|
+
rest.selected ? selectFormat(rest.selected) : placeholder,
|
|
51
|
+
/* @__PURE__ */ jsx(CalendarIcon, {})
|
|
52
|
+
] }) })),
|
|
53
|
+
wrapperClassName: "full-width"
|
|
54
|
+
}, rest), {
|
|
55
|
+
disabled
|
|
56
|
+
})
|
|
57
|
+
) });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export {
|
|
61
|
+
DatePickerButton
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=chunk-IPF2UOFH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/date-picker/date-picker-button.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { format } from 'date-fns';\nimport { clsx } from 'clsx';\nimport type { ButtonProps } from '../../atoms';\nimport { Box, Button, Flex } from '../../atoms';\nimport { CalendarIcon } from '../../icon';\nimport type { DatePickerProps } from '.';\nimport { DatePicker } from '.';\n\nexport type DatePickerButtonProps = DatePickerProps & {\n placeholder?: React.ReactNode;\n format?: (date: Date) => string;\n size?: ButtonProps['size'];\n};\n\nexport function DatePickerButton(\n props: DatePickerButtonProps\n): React.ReactNode {\n const { size, placeholder, format: formatProps, disabled, ...rest } = props;\n\n const buttonProps = useMemo(() => {\n const variant: ButtonProps['variant'] = 'outline';\n const color: ButtonProps['color'] = 'gray';\n return { size, color, variant, disabled };\n }, [disabled, size]);\n\n const selectFormat = useMemo(() => {\n if (formatProps) return formatProps;\n return (date?: Date) => {\n return date ? format(date, 'yyyy년 MM월 dd일') : placeholder;\n };\n }, [formatProps, placeholder]);\n\n const className = useMemo(() => {\n return clsx(\n 'date-picker-button',\n (disabled || props.readOnly) && 'disabled'\n );\n }, [disabled, props.readOnly]);\n\n return (\n <Box p=\"0\" width=\"100%\">\n <DatePicker\n customInput={\n <Button className={className} type=\"button\" {...buttonProps}>\n <Flex align=\"center\" gap=\"3\" justify=\"between\" width=\"100%\">\n {rest.selected ? selectFormat(rest.selected) : placeholder}\n <CalendarIcon />\n </Flex>\n </Button>\n }\n wrapperClassName=\"full-width\"\n {...rest}\n disabled={disabled}\n />\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAe;AAC/B,SAAS,cAAc;AACvB,SAAS,YAAY;AA2CT,SAEE,KAFF;AA9BL,SAAS,iBACd,OACiB;AACjB,QAAsE,YAA9D,QAAM,aAAa,QAAQ,aAAa,SAlBlD,IAkBwE,IAAT,iBAAS,IAAT,CAArD,QAAM,eAAa,UAAqB;AAEhD,QAAM,cAAc,QAAQ,MAAM;AAChC,UAAM,UAAkC;AACxC,UAAM,QAA8B;AACpC,WAAO,EAAE,MAAM,OAAO,SAAS,SAAS;AAAA,EAC1C,GAAG,CAAC,UAAU,IAAI,CAAC;AAEnB,QAAM,eAAe,QAAQ,MAAM;AACjC,QAAI,YAAa,QAAO;AACxB,WAAO,CAAC,SAAgB;AACtB,aAAO,OAAO,OAAO,MAAM,8BAAe,IAAI;AAAA,IAChD;AAAA,EACF,GAAG,CAAC,aAAa,WAAW,CAAC;AAE7B,QAAM,YAAY,QAAQ,MAAM;AAC9B,WAAO;AAAA,MACL;AAAA,OACC,YAAY,MAAM,aAAa;AAAA,IAClC;AAAA,EACF,GAAG,CAAC,UAAU,MAAM,QAAQ,CAAC;AAE7B,SACE,oBAAC,OAAI,GAAE,KAAI,OAAM,QACf;AAAA,IAAC;AAAA;AAAA,MACC,aACE,oBAAC,uCAAO,WAAsB,MAAK,YAAa,cAA/C,EACC,+BAAC,QAAK,OAAM,UAAS,KAAI,KAAI,SAAQ,WAAU,OAAM,QAClD;AAAA,aAAK,WAAW,aAAa,KAAK,QAAQ,IAAI;AAAA,QAC/C,oBAAC,gBAAa;AAAA,SAChB,IACF;AAAA,MAEF,kBAAiB;AAAA,OACb,OAVL;AAAA,MAWC;AAAA;AAAA,EACF,GACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import {
|
|
2
|
+
curriculum_ai_traning_default
|
|
3
|
+
} from "./chunk-EFCQZTUA.js";
|
|
4
|
+
import {
|
|
5
|
+
curriculum_review_default
|
|
6
|
+
} from "./chunk-OICCEZIQ.js";
|
|
7
|
+
import {
|
|
8
|
+
curriculum_video_default
|
|
9
|
+
} from "./chunk-HYMGXDPL.js";
|
|
10
|
+
import {
|
|
11
|
+
useCurriculumContext
|
|
12
|
+
} from "./chunk-IYQJIEVM.js";
|
|
13
|
+
import {
|
|
14
|
+
Typo
|
|
15
|
+
} from "./chunk-PARGQUJB.js";
|
|
16
|
+
import {
|
|
17
|
+
Flex
|
|
18
|
+
} from "./chunk-25HMMI7R.js";
|
|
19
|
+
import {
|
|
20
|
+
InfoCircledIcon
|
|
21
|
+
} from "./chunk-V5XKNSCK.js";
|
|
22
|
+
|
|
23
|
+
// src/molecules/curriculumV2/CurriculumContents/index.tsx
|
|
24
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
function CurriculumBody() {
|
|
26
|
+
const { selectedItem, selectedSectionTitle } = useCurriculumContext();
|
|
27
|
+
switch (selectedItem.type) {
|
|
28
|
+
case "video":
|
|
29
|
+
return /* @__PURE__ */ jsx(curriculum_video_default, { item: selectedItem });
|
|
30
|
+
case "review":
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
curriculum_review_default,
|
|
33
|
+
{
|
|
34
|
+
item: selectedItem,
|
|
35
|
+
sectionTitle: selectedSectionTitle == null ? void 0 : selectedSectionTitle.title
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
case "aiTraining":
|
|
39
|
+
return /* @__PURE__ */ jsx(curriculum_ai_traning_default, { item: selectedItem });
|
|
40
|
+
default:
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
Flex,
|
|
43
|
+
{
|
|
44
|
+
align: "center",
|
|
45
|
+
direction: "column",
|
|
46
|
+
gap: "2",
|
|
47
|
+
height: "100%",
|
|
48
|
+
justify: "center",
|
|
49
|
+
width: "100%",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(InfoCircledIcon, { height: 24, width: 24 }),
|
|
52
|
+
/* @__PURE__ */ jsx(Typo, { children: "\uCEE8\uD150\uCE20\uB97C \uB85C\uB529 \uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" }),
|
|
53
|
+
/* @__PURE__ */ jsx(Typo, { align: "center", color: "gray", variant: "caption", children: `[debug info]
|
|
54
|
+
${JSON.stringify(selectedItem)}` })
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
CurriculumBody
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=chunk-ITUS6SKB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/molecules/curriculumV2/CurriculumContents/index.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex, Typo } from '@/atoms';\nimport { InfoCircledIcon } from '@/icon';\nimport { useCurriculumContext } from '../curriculum-context';\nimport CurriculumVideo from './curriculum-video';\nimport CurriculumReview from './curriculum-review';\nimport CurriculumAiTraning from './curriculum-ai-traning';\n\nexport function CurriculumBody(): React.ReactNode {\n const { selectedItem, selectedSectionTitle } = useCurriculumContext();\n\n switch (selectedItem.type) {\n case 'video':\n return <CurriculumVideo item={selectedItem} />;\n case 'review':\n return (\n <CurriculumReview\n item={selectedItem}\n sectionTitle={selectedSectionTitle?.title}\n />\n );\n case 'aiTraining':\n return <CurriculumAiTraning item={selectedItem}/>\n default:\n return (\n <Flex\n align=\"center\"\n direction=\"column\"\n gap=\"2\"\n height=\"100%\"\n justify=\"center\"\n width=\"100%\"\n >\n <InfoCircledIcon height={24} width={24} />\n <Typo>컨텐츠를 로딩 할 수 없습니다</Typo>\n <Typo align=\"center\" color=\"gray\" variant=\"caption\">\n {`[debug info]\n ${JSON.stringify(selectedItem)}`}\n </Typo>\n </Flex>\n );\n }\n} "],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaa,cAYL,YAZK;AALN,SAAS,iBAAkC;AAChD,QAAM,EAAE,cAAc,qBAAqB,IAAI,qBAAqB;AAEpE,UAAQ,aAAa,MAAM;AAAA,IACzB,KAAK;AACH,aAAO,oBAAC,4BAAgB,MAAM,cAAc;AAAA,IAC9C,KAAK;AACH,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,cAAc,6DAAsB;AAAA;AAAA,MACtC;AAAA,IAEF,KAAK;AACH,aAAO,oBAAC,iCAAoB,MAAM,cAAa;AAAA,IACnD;AACE,aACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAM;AAAA,UACN,WAAU;AAAA,UACV,KAAI;AAAA,UACJ,QAAO;AAAA,UACP,SAAQ;AAAA,UACR,OAAM;AAAA,UAEN;AAAA,gCAAC,mBAAgB,QAAQ,IAAI,OAAO,IAAI;AAAA,YACxC,oBAAC,QAAK,0FAAgB;AAAA,YACtB,oBAAC,QAAK,OAAM,UAAS,OAAM,QAAO,SAAQ,WACvC;AAAA,cACC,KAAK,UAAU,YAAY,CAAC,IAChC;AAAA;AAAA;AAAA,MACF;AAAA,EAEN;AACF;","names":[]}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DatePickerButton
|
|
3
|
+
} from "./chunk-NVNCLLYC.js";
|
|
4
|
+
import {
|
|
5
|
+
TimeSelect
|
|
6
|
+
} from "./chunk-5VWEW4M2.js";
|
|
7
|
+
import {
|
|
8
|
+
getTimeOption,
|
|
9
|
+
parseTimeOption
|
|
10
|
+
} from "./chunk-NWJSLIQ3.js";
|
|
11
|
+
import {
|
|
12
|
+
Form
|
|
13
|
+
} from "./chunk-A5S42XBJ.js";
|
|
14
|
+
import {
|
|
15
|
+
toast
|
|
16
|
+
} from "./chunk-26ZU5KUR.js";
|
|
17
|
+
import {
|
|
18
|
+
Grid
|
|
19
|
+
} from "./chunk-EGEQY3KT.js";
|
|
20
|
+
import {
|
|
21
|
+
Dialog
|
|
22
|
+
} from "./chunk-2ADFW76N.js";
|
|
23
|
+
import {
|
|
24
|
+
Separator
|
|
25
|
+
} from "./chunk-HYITAA4J.js";
|
|
26
|
+
import {
|
|
27
|
+
Box
|
|
28
|
+
} from "./chunk-4Y5BEXVN.js";
|
|
29
|
+
import {
|
|
30
|
+
Flex
|
|
31
|
+
} from "./chunk-25HMMI7R.js";
|
|
32
|
+
import {
|
|
33
|
+
Button
|
|
34
|
+
} from "./chunk-AFPH32MF.js";
|
|
35
|
+
import {
|
|
36
|
+
__spreadProps,
|
|
37
|
+
__spreadValues
|
|
38
|
+
} from "./chunk-2NMEKWO5.js";
|
|
39
|
+
|
|
40
|
+
// src/app/platform/edit-coaching-time.tsx
|
|
41
|
+
import { useCallback, useState } from "react";
|
|
42
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
+
var getValueFromDefaultValue = (args) => {
|
|
44
|
+
return {
|
|
45
|
+
startTime: args.startAt ? getTimeOption(args.startAt) : "00:00",
|
|
46
|
+
endTime: args.endAt ? getTimeOption(args.endAt) : "00:00",
|
|
47
|
+
date: args.startAt || /* @__PURE__ */ new Date()
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
var getDateFromValue = (date, time) => {
|
|
51
|
+
const { hour, minute } = parseTimeOption(time);
|
|
52
|
+
return new Date(
|
|
53
|
+
date.getFullYear(),
|
|
54
|
+
date.getMonth(),
|
|
55
|
+
date.getDate(),
|
|
56
|
+
hour,
|
|
57
|
+
minute
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
function EditCoachingTime(props) {
|
|
61
|
+
const { defaultEndAt, defaultStartAt, onClickCancel } = props;
|
|
62
|
+
const [values, setValues] = useState(() => {
|
|
63
|
+
return getValueFromDefaultValue({
|
|
64
|
+
startAt: defaultStartAt,
|
|
65
|
+
endAt: defaultEndAt
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const [timeError, setTimeError] = useState("");
|
|
69
|
+
const checkTimeError = useCallback(
|
|
70
|
+
(startTime, endTime) => {
|
|
71
|
+
const error = startTime >= endTime ? "\uC2DC\uC791\uC2DC\uAC04\uC744 \uC885\uB8CC\uC2DC\uAC04\uBCF4\uB2E4 \uBE60\uB974\uAC8C \uC120\uD0DD\uD574\uC8FC\uC138\uC694." : "";
|
|
72
|
+
if (error) {
|
|
73
|
+
setTimeError(error);
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
},
|
|
78
|
+
[]
|
|
79
|
+
);
|
|
80
|
+
const onChangeStartTime = useCallback(
|
|
81
|
+
(v) => {
|
|
82
|
+
checkTimeError(v, values.endTime);
|
|
83
|
+
setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
84
|
+
startTime: v
|
|
85
|
+
}));
|
|
86
|
+
},
|
|
87
|
+
[checkTimeError, values.endTime]
|
|
88
|
+
);
|
|
89
|
+
const onChangeEndTime = useCallback(
|
|
90
|
+
(v) => {
|
|
91
|
+
checkTimeError(values.startTime, v);
|
|
92
|
+
setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
93
|
+
endTime: v
|
|
94
|
+
}));
|
|
95
|
+
},
|
|
96
|
+
[checkTimeError, values.startTime]
|
|
97
|
+
);
|
|
98
|
+
const onChangeDate = useCallback((date) => {
|
|
99
|
+
date && setValues((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
100
|
+
date
|
|
101
|
+
}));
|
|
102
|
+
}, []);
|
|
103
|
+
const onClickSave = useCallback(() => {
|
|
104
|
+
if (checkTimeError(values.startTime, values.endTime)) {
|
|
105
|
+
const startAt = getDateFromValue(values.date, values.startTime);
|
|
106
|
+
const endAt = getDateFromValue(values.date, values.endTime);
|
|
107
|
+
props.onClickSave && props.onClickSave(startAt, endAt);
|
|
108
|
+
} else {
|
|
109
|
+
toast.error("\uC785\uB825 \uAC12\uC774 \uC720\uD6A8\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.");
|
|
110
|
+
}
|
|
111
|
+
}, [checkTimeError, props, values.date, values.endTime, values.startTime]);
|
|
112
|
+
return /* @__PURE__ */ jsx(Box, { width: { initial: "100%" }, children: /* @__PURE__ */ jsxs(Form.Root, { children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(Form.Field, { name: "date", children: [
|
|
114
|
+
/* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uB0A0\uC9DC" }),
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
DatePickerButton,
|
|
117
|
+
{
|
|
118
|
+
maxDate: /* @__PURE__ */ new Date(),
|
|
119
|
+
onChange: onChangeDate,
|
|
120
|
+
selected: values.date,
|
|
121
|
+
size: { initial: "large", xs: "medium" }
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ jsxs(
|
|
126
|
+
Grid,
|
|
127
|
+
{
|
|
128
|
+
align: "center",
|
|
129
|
+
columns: {
|
|
130
|
+
initial: "1fr 0 1fr",
|
|
131
|
+
xs: "1fr auto 1fr"
|
|
132
|
+
},
|
|
133
|
+
gapX: "3",
|
|
134
|
+
gapY: "2",
|
|
135
|
+
justify: "center",
|
|
136
|
+
mb: { initial: "5", xs: "4" },
|
|
137
|
+
mt: "5",
|
|
138
|
+
width: "100%",
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "startTime", children: /* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uC2DC\uC791 \uC2DC\uAC04" }) }),
|
|
141
|
+
/* @__PURE__ */ jsx("div", {}),
|
|
142
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "endTime", children: /* @__PURE__ */ jsx(Form.Label, { variant: "caption", children: "\uC885\uB8CC \uC2DC\uAC04" }) }),
|
|
143
|
+
/* @__PURE__ */ jsx(
|
|
144
|
+
TimeSelect,
|
|
145
|
+
{
|
|
146
|
+
onValueChange: onChangeStartTime,
|
|
147
|
+
size: { initial: "3", xs: "2" },
|
|
148
|
+
value: values.startTime
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
/* @__PURE__ */ jsx(Box, { overflow: "hidden", children: /* @__PURE__ */ jsx(Separator, {}) }),
|
|
152
|
+
/* @__PURE__ */ jsx(
|
|
153
|
+
TimeSelect,
|
|
154
|
+
{
|
|
155
|
+
onValueChange: onChangeEndTime,
|
|
156
|
+
size: { initial: "3", xs: "2" },
|
|
157
|
+
value: values.endTime
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ jsx(Form.Field, { name: "startEndTime", style: { gridColumn: "1/span 3" }, children: /* @__PURE__ */ jsx(Form.Message, { forceMatch: Boolean(timeError), children: timeError }) })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
/* @__PURE__ */ jsxs(Flex, { gap: "3", justify: "end", children: [
|
|
165
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { onClick: onClickCancel, type: "button", variant: "outline", children: "\uCDE8\uC18C\uD558\uAE30" }) }),
|
|
166
|
+
/* @__PURE__ */ jsx(Dialog.Close, { children: /* @__PURE__ */ jsx(Button, { onClick: onClickSave, type: "button", children: "\uC800\uC7A5\uD558\uAE30" }) })
|
|
167
|
+
] })
|
|
168
|
+
] }) });
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export {
|
|
172
|
+
EditCoachingTime
|
|
173
|
+
};
|
|
174
|
+
//# sourceMappingURL=chunk-IZHU33JE.js.map
|