This repository has been archived on 2026-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
todo/client/node_modules/.cache/babel-loader/c62f9bc736d5c514b9e2b4c68af04742fc1503a1a7b4962cd8f53a71fdc9b318.json

1 line
17 KiB
JSON
Raw Normal View History

2025-06-13 06:04:40 +00:00
{"ast":null,"code":"var _jsxFileName = \"D:\\\\aiproject\\\\goAgent\\\\todo\\\\client\\\\src\\\\components\\\\TodoItem.js\";\nimport React from 'react';\nimport styled from 'styled-components';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst ItemContainer = styled.div`\n display: flex;\n align-items: center;\n padding: 20px;\n background: ${props => props.completed ? '#f8f9fa' : 'white'};\n border: 2px solid ${props => props.completed ? '#e9ecef' : '#f0f0f0'};\n border-radius: 16px;\n transition: all 0.3s ease;\n cursor: ${props => props.isHistory ? 'default' : 'pointer'};\n opacity: ${props => props.completed ? 0.7 : 1};\n\n &:hover {\n border-color: ${props => props.completed ? '#e9ecef' : props.isHistory ? '#f0f0f0' : '#667eea'};\n box-shadow: ${props => props.completed || props.isHistory ? 'none' : '0 6px 16px rgba(102, 126, 234, 0.15)'};\n transform: ${props => props.completed || props.isHistory ? 'none' : 'translateY(-2px)'};\n }\n`;\n_c = ItemContainer;\nconst PriorityIndicator = styled.div`\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: ${props => props.color};\n margin-right: 20px;\n flex-shrink: 0;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n`;\n_c2 = PriorityIndicator;\nconst TodoContent = styled.div`\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 6px;\n`;\n_c3 = TodoContent;\nconst TodoTitle = styled.span`\n font-size: 17px;\n color: ${props => props.completed ? '#6c757d' : '#333'};\n text-decoration: ${props => props.completed ? 'line-through' : 'none'};\n font-weight: 500;\n line-height: 1.4;\n`;\n_c4 = TodoTitle;\nconst PriorityLabel = styled.span`\n font-size: 13px;\n color: ${props => props.color};\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n`;\n_c5 = PriorityLabel;\nconst ActionButtons = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n_c6 = ActionButtons;\nconst CheckButton = styled.button`\n width: 28px;\n height: 28px;\n border-radius: 50%;\n border: 2px solid ${props => props.completed ? '#28a745' : '#dee2e6'};\n background: ${props => props.completed ? '#28a745' : 'white'};\n cursor: ${props => props.isHistory ? 'default' : 'pointer'};\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n opacity: ${props => props.isHistory ? 0.6 : 1};\n\n &:hover {\n border-color: ${props => props.isHistory ? props.completed ? '#28a745' : '#dee2e6' : '#28a745'};\n background: ${props => props.completed ? '#28a745' : props.isHistory ? 'white' : 'rgba(40, 167, 69, 0.1)'};\n transform: ${props => props.isHistory ? 'none' : 'scale(1.1)'};\n }\n\n &::after {\n content: '';\n color: white;\n font-size: 16px;\n font-weight: bold;\n opacity: ${props => props.completed ? 1 : 0};\n transition: opacity 0.3s ease;\n }\n`;\n_c7 = CheckButton;\nconst DeleteButton = styled.button`\n width: 28px;\n height: 28px;\n border-radius: 50%;\n border: 2px solid #e74c3c;\n background: white;\n cursor: pointer;\n transition: all 0.3s ease;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n\n &:hover {\n background: #e74c3c;\n transform: scale(1.1);\n }\n\n &::after {\n content: '×';\n color: #e74c3c;\n font-size: 18px;\n font-weight: bold;\n transition: color 0.3s ease;\n }\n\n &:hover::after {\n color: white;\n }\n`;\n_c8 = DeleteButton;\nconst priorityConfig = {\n low: {\n color: '#95a5a6',\n label: ''\n },\n medium: {\n color: '#3498db',\n label: ''\n },\n high: {\n color: '#e67e22',\n label: ''\n },\n urgent: {\n color: '#e74c3c',\n label: ''\n }\n};\nfunction TodoItem({\n todo,\n onToggle,\n onDelete,\n isHistory = false,\n isToday = false\n}) {\n const priority = priorityConfig[todo.priority] || priorityConfig.medium;\n const handleClick = e => {\n // 如果点击的是删除按钮不触发toggle\n if (e.target.closest('button[data-acti