Skip to content
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: ✨ Input、Textarea在APP-VUE和H5端支持inputmode #771

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

Moonofweisheng
Copy link
Owner

@Moonofweisheng Moonofweisheng commented Dec 9, 2024

Closes: #743

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#743

💡 需求背景和解决方案

Input、Textarea在H5和APP-VUE平台支持inputmode。

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新特性

    • Input 组件和 wd-textarea 组件文档更新,新增 inputmode 属性,支持多种输入类型提示。
    • FormItemRule 结构描述更新,提供更清晰的表单验证规则指导。
    • wd-textarea 组件新增 clearTriggerfocusWhenClearignoreCompositionEvent 属性。
  • 文档

    • 更新了 Inputwd-textarea 组件的文档,增强了对新特性的说明和用法指导。

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 9, 2024 0:56am

Copy link

coderabbitai bot commented Dec 9, 2024

Walkthrough

此次更新主要集中在InputTextarea组件的文档及其实现中,新增了inputmode属性,以支持不同类型的数据输入。文档中详细描述了FormItemRule结构及其验证规则,同时更新了相关事件和插槽信息。代码中引入了新的类型InputMode,并在相应的组件中实现了inputmode属性,增强了输入组件的灵活性和功能性。

Changes

文件路径 变更摘要
docs/component/input.md 更新文档,新增inputmode属性,描述FormItemRule结构,扩展AttributesEvents部分。
docs/component/textarea.md 更新文档,新增inputmodeclearTriggerfocusWhenClearignoreCompositionEvent属性。
src/uni_modules/wot-design-uni/components/wd-input/types.ts 新增类型InputMode,在inputProps中添加inputmode属性。
src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue <input>元素中添加:inputmode属性。
src/uni_modules/wot-design-uni/components/wd-textarea/types.ts 新增inputmode属性,类型为InputMode,并设置默认值为'text'
src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue <textarea>元素中添加inputmode属性。

Assessment against linked issues

Objective Addressed Explanation
希望Input输入框加上与uniapp input相同的inputmode属性 ( #743 )

Possibly related PRs

🐰 在输入框中加上新属性,
让用户体验更顺畅,
虚拟键盘轻松调,
输入模式随心所欲,
组件功能更强大,
文档更新真是妙!
🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Dec 9, 2024

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit 619e500
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/6756e91119e8160008503c49
😎 Deploy Preview https://deploy-preview-771--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@coderabbitai coderabbitai bot left a 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

🧹 Outside diff range and nitpick comments (2)
src/uni_modules/wot-design-uni/components/wd-input/types.ts (1)

187-194: 属性定义规范且文档完整!

inputmode 属性的定义包含了清晰的文档注释,并正确指定了类型和默认值。建议在文档中补充平台兼容性信息。

docs/component/input.md (1)

178-191: 建议添加使用示例!

虽然 InputMode 的可选值说明非常详细,但建议添加每种输入模式的具体使用示例,以帮助开发者更好地理解和使用该特性。

示例代码可以参考如下格式:

<!-- 数字输入示例 -->
<wd-input inputmode="numeric" v-model="value" placeholder="请输入数字" />

<!-- 搜索输入示例 -->
<wd-input inputmode="search" v-model="value" placeholder="请输入搜索关键词" />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b0a2461 and 619e500.

📒 Files selected for processing (6)
  • docs/component/input.md (1 hunks)
  • docs/component/textarea.md (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-input/types.ts (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue (1 hunks)
  • src/uni_modules/wot-design-uni/components/wd-textarea/types.ts (2 hunks)
  • src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue (1 hunks)
🔇 Additional comments (8)
src/uni_modules/wot-design-uni/components/wd-input/types.ts (1)

13-13: 类型定义完整且符合规范!

InputMode 类型定义包含了所有标准的 HTML inputmode 值,有助于提供更好的类型安全性。

src/uni_modules/wot-design-uni/components/wd-textarea/types.ts (2)

4-4: 类型导入合理!

从 wd-input 组件复用 InputMode 类型,保持了类型定义的一致性。


291-298: 属性定义保持一致性!

textarea 组件中的 inputmode 属性定义与 input 组件保持一致,包括类型、文档和默认值。

docs/component/input.md (1)

174-174: 属性文档完整!

inputmode 属性的文档说明清晰,类型和默认值正确。

src/uni_modules/wot-design-uni/components/wd-textarea/wd-textarea.vue (1)

40-40: 代码实现正确!

inputmode 属性的绑定实现简洁明确,符合 Vue 组件开发规范。

src/uni_modules/wot-design-uni/components/wd-input/wd-input.vue (1)

46-46: 实现保持一致性!

inputmode 属性的实现与 textarea 组件保持一致,确保了组件库的统一性。

docs/component/textarea.md (2)

168-170: 兼容性说明清晰完整!

详细说明了 uni-app 版本要求和平台支持情况,有助于开发者理解使用限制。


172-181: 属性值说明详尽!

各个 inputmode 值的说明清晰,用例恰当,便于开发者选择合适的输入模式。

docs/component/textarea.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant