Sitelet https://github.com/alauda/ui/pull/533
Skip to content

feat: table support resize column width - #533

Merged
fengtianze merged 1 commit into
masterfrom
feat/table-resizeable
Jan 18, 2024
Merged

fengtianze merged 1 commit into
masterfrom
feat/table-resizeable

Conversation

@igauch

@igauch igauch commented Dec 15, 2023 •

Copy link
Copy Markdown
Contributor

close #541

@changeset-bot

changeset-bot Bot commented Dec 15, 2023 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6b036ca

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alauda/ui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@igauch
igauch requested a review from fengtianze December 15, 2023 08:48
Comment thread .changeset/fifty-hounds-stare.md Outdated

@JounQin JounQin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Need more discussion about the necessary of this feature.

Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread stories/table/basic.component.ts Outdated
@fengtianze

Copy link
Copy Markdown
Collaborator

CleanShot 2023-12-15 at 17 48 56@2x
demo异常

@igauch
igauch force-pushed the feat/table-resizeable branch from e9c66f5 to 02593b3 Compare December 29, 2023 03:40
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
@igauch
igauch force-pushed the feat/table-resizeable branch 2 times, most recently from 53e74ec to e41e310 Compare January 2, 2024 06:07
Comment thread scripts/build.js Outdated
Comment thread scripts/build.js Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-header-cell.directive.ts Outdated
Comment thread src/table/table-scroll.directive.ts Outdated
Comment thread src/table/table.spec.ts Outdated
@igauch
igauch force-pushed the feat/table-resizeable branch from e41e310 to e30c12e Compare January 3, 2024 03:11
Comment thread scripts/build.js Outdated
Comment thread scripts/build.js Outdated
@igauch
igauch force-pushed the feat/table-resizeable branch from e30c12e to 51a3266 Compare January 3, 2024 04:20
Comment thread angular.json Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
@igauch
igauch force-pushed the feat/table-resizeable branch 2 times, most recently from f3017e6 to 19f56c9 Compare January 3, 2024 08:02
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
@igauch
igauch force-pushed the feat/table-resizeable branch from 19f56c9 to 068f7ca Compare January 4, 2024 02:13
@JounQin

JounQin commented Jan 4, 2024 •

Copy link
Copy Markdown
Member

不要总是用 amend + force push,每次 push 都要重新 review 完整的 PR?应该分 commit 更方便 review ,也能保留修改历史

Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread stories/resizable/basic.component.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/resizable/resizable.directive.ts Outdated
Comment thread src/table/table-col-resizable.directive.ts Outdated
Comment thread stories/resizable/basic.stories.ts Outdated
@fengtianze
fengtianze force-pushed the feat/table-resizeable branch 9 times, most recently from 0fc75e3 to 787e639 Compare January 17, 2024 16:22
Comment thread src/table/table-column-resizable.directive.ts Outdated
Comment thread src/table/table-column-resizable.directive.ts
@fengtianze
fengtianze force-pushed the feat/table-resizeable branch from 787e639 to 6ce37cd Compare January 18, 2024 02:11
@fengtianze fengtianze changed the title feat: add resizable directive feat: table support resize column width Jan 18, 2024
@fengtianze
fengtianze force-pushed the feat/table-resizeable branch from 6ce37cd to ce26bce Compare January 18, 2024 02:48
cleanup(): void {
if (this.styleSheet) {
const i = document.adoptedStyleSheets.indexOf(this.styleSheet);
document.adoptedStyleSheets.splice(i, 1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

这个提过,用 filter 吧,i 万一 是 -1 怎么办?

);
}
if (width.endsWith('px')) {
return parseInt(width.slice(0, -2));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return parseInt(width.slice(0, -2));
return Number.parseFloat(width.slice(0, -2));

怎么感觉被恢复成最开始的代码了?所有 review 后的变更都没了。。。

if (width.endsWith('px')) {
return parseInt(width.slice(0, -2));
}
return parseInt(width);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
return parseInt(width);
return Number.parseFloat(width);

@fengtianze
fengtianze force-pushed the feat/table-resizeable branch from ce26bce to b67106f Compare January 18, 2024 03:04
Comment thread src/table/table-column-resizable.directive.ts Outdated
Comment thread src/table/table-column-resizable.directive.ts
Comment thread src/table/table-column-resizable.directive.ts Outdated
this.renderer2.setStyle(
markLine,
'left',
offset - markLineWidth + 'px',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

handlePixel

@fengtianze
fengtianze force-pushed the feat/table-resizeable branch from b67106f to 6b036ca Compare January 18, 2024 03:32
@fengtianze
fengtianze merged commit b4a96de into master Jan 18, 2024
@fengtianze
fengtianze deleted the feat/table-resizeable branch January 18, 2024 03:33
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.

【table】支持拖拽调整列宽

5 participants