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(NumberPicker): The hackChrome function lacks the conditional proc… #4999

Open
wants to merge 9 commits into
base: next
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ gemini-report/
*.log
.DS_Store
src/core-temp

# tests snapshots diff
components/**/__tests__/snapshots/__diff__/**
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Change Log

## [1.27.30](https://github.com/alibaba-fusion/next/compare/1.27.28...1.27.30) (2024-12-06)


### Bug Fixes

* **Badge:** set alignment by use transform ([fbda649](https://github.com/alibaba-fusion/next/commit/fbda649d53fe8bdf080b5cea51e2841233afa34c))
* **Balloon:** v2 default offset adjustment ([3f5f818](https://github.com/alibaba-fusion/next/commit/3f5f81882963f8dbfb716c77a75622d001803b6e))
* **CascaderSelect:** The value of the menuProps attribute is passed by props ([7a33369](https://github.com/alibaba-fusion/next/commit/7a33369dc01195edf5da7b15f7b9f2d45aa94ceb))
* **Collapse:** Internal elements need to apply the radius configuration of external elements, close [#3277](https://github.com/alibaba-fusion/next/issues/3277) ([936c429](https://github.com/alibaba-fusion/next/commit/936c429ae74a2568d835b5f4c57b7abd94a6194c))
* **DatePicker2:** support defaultValue & value for quarter, close [#3006](https://github.com/alibaba-fusion/next/issues/3006) ([9760278](https://github.com/alibaba-fusion/next/commit/97602785374fe6bdedfb8f5a97639b85d0fc32d2))
* **Select:** Fix select doc ([af1c2e7](https://github.com/alibaba-fusion/next/commit/af1c2e7943be7f40e197cac0cd0b9db3fd5d44b0))


### Code Refactoring

* **ConfigProvider:** static reference to moment ([e74c307](https://github.com/alibaba-fusion/next/commit/e74c30744907d3c4e712c90c28e31bdf972bd160))


## [1.27.29](https://github.com/alibaba-fusion/next/compare/1.27.28...1.27.29) (2024-11-12)


Expand Down
14 changes: 12 additions & 2 deletions LATESTLOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# Latest Log

## [1.27.29](https://github.com/alibaba-fusion/next/compare/1.27.28...1.27.29) (2024-11-12)
## [1.27.30](https://github.com/alibaba-fusion/next/compare/1.27.28...1.27.30) (2024-12-06)


### Bug Fixes

* **Slider:** correct typo and improve types definition ([9d4f0f7](https://github.com/alibaba-fusion/next/commit/9d4f0f79efb48e0ab657862bef17d0b3040e6709))
* **Badge:** set alignment by use transform ([fbda649](https://github.com/alibaba-fusion/next/commit/fbda649d53fe8bdf080b5cea51e2841233afa34c))
* **Balloon:** v2 default offset adjustment ([3f5f818](https://github.com/alibaba-fusion/next/commit/3f5f81882963f8dbfb716c77a75622d001803b6e))
* **CascaderSelect:** The value of the menuProps attribute is passed by props ([7a33369](https://github.com/alibaba-fusion/next/commit/7a33369dc01195edf5da7b15f7b9f2d45aa94ceb))
* **Collapse:** Internal elements need to apply the radius configuration of external elements, close [#3277](https://github.com/alibaba-fusion/next/issues/3277) ([936c429](https://github.com/alibaba-fusion/next/commit/936c429ae74a2568d835b5f4c57b7abd94a6194c))
* **DatePicker2:** support defaultValue & value for quarter, close [#3006](https://github.com/alibaba-fusion/next/issues/3006) ([9760278](https://github.com/alibaba-fusion/next/commit/97602785374fe6bdedfb8f5a97639b85d0fc32d2))
* **Select:** Fix select doc ([af1c2e7](https://github.com/alibaba-fusion/next/commit/af1c2e7943be7f40e197cac0cd0b9db3fd5d44b0))


### Code Refactoring

* **ConfigProvider:** static reference to moment ([e74c307](https://github.com/alibaba-fusion/next/commit/e74c30744907d3c4e712c90c28e31bdf972bd160))

33 changes: 33 additions & 0 deletions components/badge/__tests__/index-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,37 @@ describe('Badge', () => {
cy.mount(<Badge count={0} showZero />);
cy.get('.next-badge-count.next-badge-scroll-number');
});

it('should on right when children is block', () => {
cy.mount(
<Badge count={1}>
<div
style={{
width: '200px',
height: '40px',
display: 'block',
background: 'blue',
}}
></div>
</Badge>
);
cy.get('.next-badge-count').then($el => {
$el.css({
transition: 'none',
animation: 'none',
});
});
cy.get('.next-badge-count').then($el => {
const targetRect = $el[0].getBoundingClientRect();
const badgeRect = document.querySelector('.next-badge')!.getBoundingClientRect();
const position = {
left: Math.round(targetRect.left),
top: Math.round(targetRect.top),
};
expect(position).to.deep.equal({
left: Math.round(badgeRect.left + badgeRect.width - targetRect.width / 2),
top: Math.round(badgeRect.top - 4),
});
});
});
});
2 changes: 2 additions & 0 deletions components/badge/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
z-index: 10;
overflow: hidden;
transform-origin: left center;
transform: translateX(50%);
right: 0;
}

&-scroll-number-only {
Expand Down
46 changes: 46 additions & 0 deletions components/balloon/__tests__/balloon-v2-spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,5 +407,51 @@ describe('Balloon v2', () => {
);
cy.get('span').should('have.length', 1);
});

it('default offset should be 12px', () => {
const trigger = (
<div className="trigger" style={{ margin: '200px', display: 'inline-block' }}>
trigger
</div>
);
cy.mount(
<Balloon v2 visible trigger={trigger}>
trigger
</Balloon>
).as('Demo');
cy.get('.trigger').then($el => {
const triggerRect = $el[0].getBoundingClientRect();
expect(Math.round(triggerRect.bottom + 12)).to.equal(
Math.round(document.querySelector('.next-balloon')!.getBoundingClientRect().top)
);
});
cy.rerender('Demo', { align: 't' });
cy.get('.trigger').then($el => {
const triggerRect = $el[0].getBoundingClientRect();
expect(Math.round(triggerRect.top - 12)).to.equal(
Math.round(
document.querySelector('.next-balloon')!.getBoundingClientRect().bottom
)
);
});
cy.rerender('Demo', { align: 'l' });
cy.get('.trigger').then($el => {
const triggerRect = $el[0].getBoundingClientRect();
expect(Math.round(triggerRect.left - 12)).to.equal(
Math.round(
document.querySelector('.next-balloon')!.getBoundingClientRect().right
)
);
});
cy.rerender('Demo', { align: 'r' });
cy.get('.trigger').then($el => {
const triggerRect = $el[0].getBoundingClientRect();
expect(Math.round(triggerRect.right + 12)).to.equal(
Math.round(
document.querySelector('.next-balloon')!.getBoundingClientRect().left
)
);
});
});
});
});
2 changes: 1 addition & 1 deletion components/balloon/balloon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class Balloon extends React.Component<BalloonProps, BalloonState> {

Object.assign(otherProps, {
placement: align,
placementOffset: placementOffset + 12,
placementOffset: placementOffset,
v2: true,
beforePosition: this.beforePosition,
autoAdjust,
Expand Down
Loading
Loading