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:checkbox,comp:radio): add group vertical props #975

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

tuchg
Copy link
Contributor

@tuchg tuchg commented Jun 23, 2022

refactor(comp:radio,checkbox): props replace to vue proptype

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

What is the current behavior?

What is the new behavior?

RadioGroupProps/CheckBoxGroupProps

名称 说明 类型 默认值 全局配置 备注
vertical 设置组内排列方向 boolean - - 默认为水平排列方向,可设true为垂直排列

Other information

@idux-bot
Copy link

idux-bot bot commented Jun 23, 2022

This preview will be available after the AzureCI is passed.

@tuchg tuchg requested a review from danranVm June 23, 2022 06:45
@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #975 (4402459) into main (d81b99f) will decrease coverage by 0.25%.
The diff coverage is 100.00%.

❗ Current head 4402459 differs from pull request most recent head aabb98a. Consider uploading reports for the commit aabb98a to get more accurate results

@@            Coverage Diff             @@
##             main     #975      +/-   ##
==========================================
- Coverage   92.79%   92.53%   -0.26%     
==========================================
  Files         703      706       +3     
  Lines       68808    69024     +216     
  Branches     8040     8045       +5     
==========================================
+ Hits        63848    63874      +26     
- Misses       4960     5150     +190     
Impacted Files Coverage Δ
packages/components/checkbox/src/CheckboxGroup.tsx 92.64% <100.00%> (+0.22%) ⬆️
packages/components/checkbox/src/types.ts 100.00% <100.00%> (ø)
packages/components/radio/src/RadioGroup.tsx 97.05% <100.00%> (+0.04%) ⬆️
packages/components/radio/src/types.ts 100.00% <100.00%> (ø)
...es/cdk/drag-drop/src/composables/withDragHandle.ts 37.50% <0.00%> (-46.88%) ⬇️
...ages/components/radio/__tests__/radioGroup.spec.ts 82.39% <0.00%> (-17.61%) ⬇️
...omponents/checkbox/__tests__/checkboxGroup.spec.ts 84.84% <0.00%> (-15.16%) ⬇️
packages/components/checkbox/src/Checkbox.tsx 82.95% <0.00%> (-14.78%) ⬇️
packages/components/radio/src/Radio.tsx 82.42% <0.00%> (-10.91%) ⬇️
packages/components/carousel/src/Carousel.tsx 91.95% <0.00%> (-8.05%) ⬇️
... and 14 more

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 d81b99f...aabb98a. Read the comment docs.

@@ -58,7 +59,7 @@ export default defineComponent({
}
return (
<div class={classes.value} style={style.value}>
{children}
<IxSpace vertical={vertical}>{children}</IxSpace>
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
<IxSpace vertical={vertical}>{children}</IxSpace>
{vertical ? <IxSpace vertical={true}>{children}</IxSpace> : {children}}

否则会影响 gap 功能,radio 也这样改下。

'onUpdate:checked': { type: Function as PropType<(checked: CheckValue) => void> },
onChange: { type: Function as PropType<(newChecked: CheckValue, oldChecked: CheckValue) => void> },
onBlur: { type: Function as PropType<(evt: FocusEvent) => void> },
onFocus: { type: Function as PropType<(evt: FocusEvent) => void> },
}
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
}
} as const 一下

radio 也一样

onFocus: IxPropTypes.emit<(evt: FocusEvent) => void>(),
'onUpdate:checked': { type: Function as PropType<(checked: CheckValue) => void> },
onChange: { type: Function as PropType<(newChecked: CheckValue, oldChecked: CheckValue) => void> },
onBlur: { type: Function as PropType<(evt: FocusEvent) => void> },
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
onBlur: { type: Function as PropType<(evt: FocusEvent) => void> },
onBlur: { type: [Function, Array ]as PropType<MaybeArray<(evt: FocusEvent) => void>> },

其他的事件类型也一并改下。

@tuchg tuchg force-pushed the feat/datasource_direction branch from 71af197 to 4402459 Compare June 23, 2022 10:47
@tuchg tuchg closed this Jun 23, 2022
@tuchg tuchg force-pushed the feat/datasource_direction branch from 4402459 to d81b99f Compare June 23, 2022 10:55
@tuchg tuchg reopened this Jun 23, 2022
@danranVm danranVm merged commit d0710d6 into IDuxFE:main Jun 23, 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.

None yet

2 participants