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: table support resize column width #533

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

igauch
Copy link
Contributor

@igauch igauch commented Dec 15, 2023

close #541

Copy link

changeset-bot bot commented Dec 15, 2023

🦋 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
Copy link
Member

@JounQin JounQin left a comment

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.

src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-col-resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
stories/table/basic.component.ts Outdated Show resolved Hide resolved
@fengtianze
Copy link
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
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-col-resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-col-resizable.directive.ts Outdated Show resolved Hide resolved
@igauch igauch force-pushed the feat/table-resizeable branch 2 times, most recently from 53e74ec to e41e310 Compare January 2, 2024 06:07
scripts/build.js Outdated Show resolved Hide resolved
scripts/build.js Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-header-cell.directive.ts Outdated Show resolved Hide resolved
src/table/table-scroll.directive.ts Outdated Show resolved Hide resolved
src/table/table.spec.ts Outdated Show resolved Hide resolved
@igauch igauch force-pushed the feat/table-resizeable branch from e41e310 to e30c12e Compare January 3, 2024 03:11
scripts/build.js Outdated Show resolved Hide resolved
scripts/build.js Outdated Show resolved Hide resolved
@igauch igauch force-pushed the feat/table-resizeable branch from e30c12e to 51a3266 Compare January 3, 2024 04:20
angular.json Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-col-resizable.directive.ts Outdated Show resolved Hide resolved
@igauch igauch force-pushed the feat/table-resizeable branch 2 times, most recently from f3017e6 to 19f56c9 Compare January 3, 2024 08:02
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/table/table-col-resizable.directive.ts Outdated Show resolved Hide resolved
@igauch igauch force-pushed the feat/table-resizeable branch from 19f56c9 to 068f7ca Compare January 4, 2024 02:13
@JounQin
Copy link
Member

JounQin commented Jan 4, 2024

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

src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
stories/resizable/basic.component.ts Outdated Show resolved Hide resolved
src/resizable/resizable.directive.ts Outdated Show resolved Hide resolved
@fengtianze fengtianze force-pushed the feat/table-resizeable branch 9 times, most recently from 0fc75e3 to 787e639 Compare January 17, 2024 16:22
@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
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
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
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
this.renderer2.setStyle(
markLine,
'left',
offset - markLineWidth + 'px',
Copy link
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
6 of 7 checks passed
@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