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

refactor(select): rename native select and custom select and provide schematics #INFR-10691 #3029

Closed

Conversation

minlovehua
Copy link
Contributor

@minlovehua minlovehua commented Feb 22, 2024

一、原生select组件的调整

  • <thy-select --> <thy-native-select
  • </thy-select> --> </thy-native-select>
  • ThySelectComponent --> ThyNativeSelectComponent
  • 文件重命名 native-select
  • 单元测试修复
  • 示例检查
  • 备注:样式类名 .thy-select 不改。它属于 select 模块,不只是属于 thy-native-select组件。

二、自定义select组件的调整

  • <thy-custom-select --> <thy-select
  • </thy-custom-select> --> </thy-select>
  • ThySelectCustomComponent --> ThySelectComponent
  • ThyCustomSelectTriggerType --> ThySelectTriggerType
  • examples 文件中样式 thy-custom-select --> thy-select,相关命名调整去掉 custom、Custom,示例检查。
  • 单元测试修复

三、提供 schematics 迁移规则

Copy link

vercel bot commented Feb 22, 2024

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

Name Status Preview Comments Updated (UTC)
tethys ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 0:34am

},
{
replace: '</thy-custom-select>',
replaceWith: '</thy-select>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V17 的 Schematics 迁移不能放在之前的 data 文件夹,之前那个是 V16 的 Schematics 迁移,我为了让做 V17 Schematics 的人参考没有删除, 所以需要在 V17 update 中单独定义 elementSelectors 并追加到 V17 的 update 中去 @luxiaobei 应该是这样吧

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里既然加了 Schematics 最好写测试验证一下

* @name thy-select
* @order 20
* @order 10
*/
@Component({
selector: 'thy-select',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的 Custom Select 位置可以不用改,放在之前的 custom-select 文件夹下也可以,但是要记住选择器保持兼容,两个都支持一下

@minlovehua minlovehua marked this pull request as draft February 23, 2024 03:03
@minlovehua minlovehua closed this Feb 23, 2024
@minlovehua minlovehua deleted the minlovehua/rename-native-custom-select branch February 23, 2024 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants