- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 478
feat: support semantic for baseSelect #1133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support semantic for baseSelect #1133
Conversation
| The latest updates on your projects. Learn more about Vercel for Git ↗︎ 
 | 
| Walkthrough本次更新对  Changes
 Sequence Diagram(s)sequenceDiagram
    participant BS as BaseSelect
    participant SC as SelectContext
    participant TB as TransBtn
    participant SEL as Selector
    BS->>BS: 从 props 中提取 classNames 与 styles
    BS->>SC: 获取上下文中的 classNames 与 styles
    SC-->>BS: 返回上下文默认值
    BS->>BS: 使用空值合并确定最终样式与类名
    BS->>TB: 将样式与类名传递给 TransBtn
    BS->>SEL: 将样式与类名传递给 Selector
sequenceDiagram
    participant I as Input组件
    participant UB as useBaseProps Hook
    I->>UB: 调用 useBaseProps 获取基本属性
    I->>I: 使用空值合并操作确定最终样式与类名
    I->>I: 渲染 Input 元素
Possibly related PRs
 Poem
 Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
 src/BaseSelect/index.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js 
 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
 🧰 Additional context used🧬 Code Definitions (1)src/BaseSelect/index.tsx (1)
 🔇 Additional comments (11)
 ✨ Finishing Touches
 🪧 TipsChatThere are 3 ways to chat with CodeRabbit: 
 Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
 Other keywords and placeholders
 CodeRabbit Configuration File ( | 
| Codecov ReportAll modified and coverable lines are covered by tests ✅ 
 Additional details and impacted files@@            Coverage Diff             @@
##           master    #1133      +/-   ##
==========================================
- Coverage   98.26%   98.26%   -0.01%     
==========================================
  Files          39       39              
  Lines        1501     1500       -1     
  Branches      454      425      -29     
==========================================
- Hits         1475     1474       -1     
  Misses         26       26              ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
        
          
                src/Selector/Input.tsx
              
                Outdated
          
        
      | React.useContext(SelectContext) || {}; | ||
| const { classNames: baseSelectClassNames, styles: baseSelectStyles } = useBaseProps() || {}; | ||
| const contextClassNames = selectClassNames ?? baseSelectClassNames; | ||
| const contextStyles = selectStyles ?? baseSelectStyles; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个是 ?? 关系?是不需要合并的么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
- tests/Select.test.tsx(2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
tests/Select.test.tsx (1)
src/index.ts (1) (1)
BaseSelect(9-9)
🪛 GitHub Actions: ✅ test
tests/Select.test.tsx
[error] 2496-2496: error TS2741: Property '$$typeof' is missing in type '() => React.JSX.Element' but required in type 'ForwardRefExoticComponent<Omit<any, "ref"> & RefAttributes>'.
Summary by CodeRabbit
新功能
maxCount属性,允许用户设置选择项的最大数量。重构
测试