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(comp:tag-group): add tagGroup component #836

Merged
merged 1 commit into from
Apr 10, 2022

Conversation

brenner8023
Copy link
Member

fix #826

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Component style update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

What is the new behavior?

Other information

@idux-bot
Copy link

idux-bot bot commented Apr 5, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #836 (0481e4f) into main (39239be) will increase coverage by 0.02%.
The diff coverage is 99.61%.

@@            Coverage Diff             @@
##             main     #836      +/-   ##
==========================================
+ Coverage   93.26%   93.28%   +0.02%     
==========================================
  Files         633      635       +2     
  Lines       60502    60758     +256     
  Branches     7229     7266      +37     
==========================================
+ Hits        56426    56681     +255     
- Misses       4076     4077       +1     
Impacted Files Coverage Δ
packages/components/tag/index.ts 96.29% <92.85%> (-3.71%) ⬇️
packages/components/config/src/defaultConfig.ts 100.00% <100.00%> (ø)
packages/components/config/src/types.ts 100.00% <100.00%> (ø)
packages/components/tag/__tests__/tagGroup.spec.ts 100.00% <100.00%> (ø)
packages/components/tag/src/Tag.tsx 100.00% <100.00%> (ø)
packages/components/tag/src/TagGroup.tsx 100.00% <100.00%> (ø)
packages/components/tag/src/types.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 39239be...0481e4f. Read the comment docs.

packages/components/tag/src/TagGroup.tsx Outdated Show resolved Hide resolved
packages/components/tag/src/types.ts Outdated Show resolved Hide resolved

import { type TagGapSize, tagGroupProps } from './types'

const defaultGapMap = {
Copy link
Member

Choose a reason for hiding this comment

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

这个干掉吧,这种只给一个 number 或者 string 的类型就算了,不给这种预设的值了。

@@ -271,6 +271,10 @@ export const defaultConfig: GlobalConfig = {
},
},
tag: {},
tagGroup: {
gap: 'sm',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
gap: 'sm',
gap: 8,

@@ -417,6 +418,11 @@ export interface TagConfig {
shape?: TagShape
}

export interface TagGroupConfig {
gap: number | [number | string, number | string] | TagGapSize
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
gap: number | [number | string, number | string] | TagGapSize
gap: number | string

closable: IxPropTypes.bool.def(false),
closeIcon: IxPropTypes.string.def('close'),
dataSource: IxPropTypes.array<TagData>(),
gap: IxPropTypes.oneOfType([Number, String, IxPropTypes.array<string | number>()]),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
gap: IxPropTypes.oneOfType([Number, String, IxPropTypes.array<string | number>()]),
gap: IxPropTypes.oneOfType([Number, String),

简单一点,不需要支持纵向的场景。

@danranVm
Copy link
Member

danranVm commented Apr 9, 2022

另外需要修改一下 test, 切换到 vitest 了。

@brenner8023 brenner8023 force-pushed the feat-taggroup branch 2 times, most recently from a6dacf6 to 7730a98 Compare April 9, 2022 14:50
Copy link
Member

@danranVm danranVm left a comment

Choose a reason for hiding this comment

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

LGTM

@danranVm danranVm merged commit b365f3e into IDuxFE:main Apr 10, 2022
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.

[comp:tag] 新增 tag group 组件
2 participants