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: custom tree indent width option #1538

Merged
merged 3 commits into from
Dec 30, 2021
Merged

Conversation

jajugoguma
Copy link
Contributor

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

  • Added option to set custom indent width.

Default

With option

 const grid = new tui.Grid({
  // ...
  treeColumnOptions: {
    // ...
    indentWidth: 50
  },
  // ...
});


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

Copy link

@jwlee1108 jwlee1108 left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다.

Copy link

@adhrinae adhrinae left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다.
함수에 전달해야하는 인자 갯수가 좀 늘어나는 모양새를 보니 슬슬 변경된 함수들은 객체를 인자로 받도록 변경하는게 더 낫지 않을까 싶네요.

@@ -250,7 +250,9 @@ export function createViewRow(id: number, row: Row, rawData: Row[], column: Colu
rowSpanMap,
valueMap,
__unobserveFns__,
...(treeColumnName && { treeInfo: createTreeCellInfo(rawData, row, treeIcon) }),
...(treeColumnName && {

Choose a reason for hiding this comment

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

위에 보니까 treeColumnName 의 기본값이 '' 인데 조건문에서 활용을 하고 있네요.
개인적으로 이 라인은 JS의 불명확한 Falsy 값을 활용하는 예라는 생각이 들어서 차라리 212라인의 treeColumnName 의 기본값 설정을 없애버리는게 더 낫지 않을까 하는 생각이 듭니다.

Copy link

@lja1018 lja1018 left a comment

Choose a reason for hiding this comment

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

리뷰 완료합니다.

@jajugoguma jajugoguma merged commit b4f41c7 into master Dec 30, 2021
@jajugoguma jajugoguma deleted the feat/custom-tree-indent branch December 30, 2021 05:11
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.

4 participants