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

fix: allow use value control selections; #317

Merged
merged 3 commits into from
Oct 15, 2020

Conversation

zzt1224
Copy link
Collaborator

@zzt1224 zzt1224 commented Oct 15, 2020

affects: @gio-design/components, website

Related issue link

需要list支持value受控 #250
#303
#278

Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

Self check

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

affects: @gio-design/components, website
@zzt1224 zzt1224 requested review from gh2049, phyzess and iahu and removed request for phyzess October 15, 2020 07:09
@azure-pipelines
Copy link

Deploy preview for gio-design failed.

affects: @gio-design/components
@zzt1224 zzt1224 requested a review from phyzess October 15, 2020 07:30
@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #317 into master will decrease coverage by 0.08%.
The diff coverage is 3.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
- Coverage   56.68%   56.59%   -0.09%     
==========================================
  Files         105      105              
  Lines        3315     3320       +5     
  Branches      796      799       +3     
==========================================
  Hits         1879     1879              
- Misses       1432     1437       +5     
  Partials        4        4              
Impacted Files Coverage Δ
...ckages/components/src/components/select/Select.tsx 0.00% <0.00%> (ø)
...nts/src/components/date-picker/dateRangePicker.tsx 16.90% <25.00%> (-0.49%) ⬇️

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 29fe745...242b94f. Read the comment docs.

@azure-pipelines
Copy link

Deploy preview for ready! ✅ https://deploy-preview-317--gio-design.surge.sh

packages/components/src/components/select/Select.tsx Outdated Show resolved Hide resolved
const [selection, _setSelection] = useState(
new Set(Array.isArray(defaultSelection) ? defaultSelection : [defaultSelection])
);
const [_selection, _setSelection] = useState(new Set(concat<string>([], defaultValues)));
Copy link
Contributor

Choose a reason for hiding this comment

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

建议直接使用 es6 的 展开运行符 [... defaultValues]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

传入值是 string | string[] 没办法直接展开吧 这里是逻辑是把string转换成 string[]

Copy link
Contributor

Choose a reason for hiding this comment

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

了解了。好多地方都有同样的逻辑,我们应该可以提供一个通用的方法

@@ -123,6 +123,7 @@
display: inline-block;
width: auto;
max-width: 100%;
height: auto !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

为啥为加 !important

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

被别的组件里 .gio-input覆盖了 input的坑

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

有的组件没封装 我这个封在这个组件的scope里了

@azure-pipelines
Copy link

Deploy preview for ready! ✅ https://deploy-preview-317--gio-design.surge.sh

@zzt1224 zzt1224 added add to next version 🐛 bug Something isn't working labels Oct 15, 2020
@zzt1224 zzt1224 merged commit 9da017b into growingio:master Oct 15, 2020
itiiss pushed a commit that referenced this pull request Oct 26, 2020
* feat: add grid

* feat: add test cases

affects: @gio-design/components, website

* fix: make ts happy again

* chore: revert yarn.lock file

* chore: remove package-lock.json

* fix: typo

* feat: time-picker (#292)

* update: style

* chore: time-picker

* fix: clear log

Co-authored-by: chen_gh <chenguanghao@growingio.com>

* feat(searchbar): add placeholder prop (#290)

affects: @gio-design/components

* refactor(table): define when dataSource update, pagination behaviour (#295)

affects: @gio-design/components

* feat(date-picker): add rengePicker feature (#296)

affects: @gio-design/components, website

add rangePicker adds a new parameter for the renderExtraFooter method to return a React.ReactNode to
add a custion footer.fix rangePicker change the date or the date displayed in the year does not
change. fix rangePicker onSelect method is invalid

* docs: @gio-design/components 20.10.0 change log (#306)

* docs: @gio-design/components 20.10.0 change log

* docs: @gio-design/components 20.10.0 change log

* docs: @gio-design/components 20.10.1 change log (#309)

affects: @gio-design/components, @gio-design/icons, @gio-design/tokens, website

fix changelog and version numbers;

* docs: @gio-design/components 20.10.2 change log

affects: @gio-design/components, @gio-design/icons, website

* docs: update version number

affects: website

* fix: time-picker style (#307)

Co-authored-by: chen_gh <chenguanghao@growingio.com>

* feat(date-picker): add dateRangePicker disabledDate methods (#314)

affects: @gio-design/components, website

daa dateRangePicker disabledDate methods and fix props.value change is not change Input value

ISSUES CLOSED: #304

* fix: allow use value control selections; (#317)

* fix: allow use value control selections;

affects: @gio-design/components, website

* fix: fix type bug

affects: @gio-design/components

* fix: modify defaultSelection as default value of defaultValue

affects: @gio-design/components

* style(form): 根据stylelint的提示,修改了form组件中index.less中部分属性的顺序 (#318)

affects: @gio-design/components

根据stylelint的提示,修改了form组件中index.less中部分属性的顺序

* fix select text overflow and add icons (#319)

* fix: fix overflow text elips

affects: @gio-design/components

* fix: add iconns

affects: @gio-design/icons

* docs: @gio-design/components 20.10.3 change log (#320)

affects: @gio-design/components, @gio-design/icons, website

* docs: @gio-designs/components release-20.10.4 change log (#322)

affects: @gio-design/components, @gio-design/icons, website

replace 20.10.3 empty package

* feat: add grid

* feat: add test cases

affects: @gio-design/components, website

* fix: make ts happy again

* chore: revert yarn.lock file

* chore: remove package-lock.json

* fix: typo

* fix(upload): upload组件增加一个可选参数isBorder,控制图片上传成功后边框是否显示 (#331)

affects: @gio-design/components, website

Upload组件增加一个可选参数isBorder,控制图片上传成功后边框是否显示,默认为false

* chore: create release pull request template

* chore: delete old pull request template

* chore: create feature or fix pull request template

* fix(dropdown): 修复Dropdown组件中placement方向的问题,由12个方向改为只有上下6个方向可选,默认方向为下 (#333)

affects: @gio-design/components, website

修复Dropdown组件中placement方向的问题,由12个方向改为只有上下6个方向可选,默认方向为下

* style(select): 定义了select组件中input选择框内的文字尺寸 (#337)

affects: @gio-design/components

定义了select组件中input选择框内的文字尺寸

* test(alert): unit test of alert component is added (#339)

affects: @gio-design/components

Unit test of alert component is added

* fix(components): change folder name from camel case to kebab case (#329)

* fix(components): change folder name from camel case to kebab case

affects: @gio-design/components

* fix(components): fix tab-nav folder name

affects: @gio-design/components, website

* fix: index time-picker

Co-authored-by: G_H <gh_c@qq.com>
Co-authored-by: chen_gh <chenguanghao@growingio.com>
Co-authored-by: Lee Hon <lihang@growingio.com>
Co-authored-by: cnsummer <31471551+cnsummer@users.noreply.github.com>
Co-authored-by: zhaoting zhou <zhouzhaoting@growingio.com>
Co-authored-by: WORLDI <66404428+WORLDI@users.noreply.github.com>
Co-authored-by: Jack <panjie@growingio.com>
Co-authored-by: phyzess <phyzess@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
2 participants