-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(module:all): Add RTL support to all ng-zorro-antd #4703
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4703 +/- ##
==========================================
- Coverage 89.84% 89.82% -0.02%
==========================================
Files 468 469 +1
Lines 14262 14948 +686
Branches 2242 2273 +31
==========================================
+ Hits 12813 13427 +614
- Misses 894 935 +41
- Partials 555 586 +31
Continue to review full report at Codecov.
|
Hi @saeedrahimi |
Hi @saeedrahimi |
Hi @vthinkxie, @saeedrahimi |
@@ -0,0 +1 @@ | |||
node-options=--max-old-space-size=14000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ No, it's for my local development
|
||
ngOnInit(): void { | ||
this.dir = this.directionality.value; | ||
this.directionality.change.subscribe((direction: Direction) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need pipe(takeUntil(this.destroy$))
here
Thank for your contribution, it looks sufficiently great now. We would like to mention your contribution in the release log, so could you please tell us your twitter IDs? |
@@ -65,6 +66,7 @@ export type NzDatePickerSizeType = 'large' | 'default' | 'small'; | |||
[placeholder]="nzPlaceHolder" | |||
style="display: inherit; align-items: center; width: 100%;" | |||
[dropdownClassName]="nzDropdownClassName" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add [dir]="dir"
[style.left]="datePickerService?.arrowLeft" | ||
[style.right]="datePickerService?.arrowRight" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[style.left]="datePickerService?.arrowLeft" | |
[style.right]="datePickerService?.arrowRight" | |
[ngStyle]="activeBarStyle" |
|
||
if (this.dir === 'rtl') { | ||
this.datePickerService.arrowRight = | ||
this.datePickerService.activeInput === 'right' ? this.inputWidth + this.separatorElement?.nativeElement.offsetWidth || 0 : 0; | ||
this.datePickerService.arrowLeft = 'auto'; | ||
} else { | ||
this.datePickerService.arrowLeft = | ||
this.datePickerService.activeInput === 'left' ? 0 : this.inputWidth + this.separatorElement?.nativeElement.offsetWidth || 0; | ||
this.datePickerService.arrowRight = 'auto'; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (this.dir === 'rtl') { | |
this.datePickerService.arrowRight = | |
this.datePickerService.activeInput === 'right' ? this.inputWidth + this.separatorElement?.nativeElement.offsetWidth || 0 : 0; | |
this.datePickerService.arrowLeft = 'auto'; | |
} else { | |
this.datePickerService.arrowLeft = | |
this.datePickerService.activeInput === 'left' ? 0 : this.inputWidth + this.separatorElement?.nativeElement.offsetWidth || 0; | |
this.datePickerService.arrowRight = 'auto'; | |
} | |
const baseStyle = { position: 'absolute', width: `${this.inputWidth}px` }; | |
this.datePickerService.arrowLeft = this.datePickerService.activeInput === 'left' ? 0 : this.inputWidth + this.separatorElement?.nativeElement.offsetWidth || 0; | |
if (this.dir === 'rtl') { | |
this.activeBarStyle = { ...baseStyle, right: `${this.datePickerService.arrowLeft}px` }; | |
} else { | |
this.activeBarStyle = { ...baseStyle, left: `${this.datePickerService.arrowLeft}px` }; | |
} | |
also need to define activeBarStyle
.
arrowLeft: string = 'auto'; | ||
arrowRight: string = 'auto'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrowLeft: string = 'auto'; | |
arrowRight: string = 'auto'; | |
arrowLeft: number = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the active bar in range picker cannot work, need some changes.
I'm glad I could help. |
Thank you guys for making this happen |
Someone missed to mention. |
Certainly. We value all your contribution very much. Please also provide his Twitter id. By the way, do you have @hdm91 's Twitter id? |
Co-authored-by: Wenqi Chen <[email protected]>
Co-authored-by: Wenqi Chen <[email protected]>
Hi guys , thanks for your consideration and helping to make RTL feature on great ng zorro , I wish I would have enough time to help you in future |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #4704 #1762
What is the new behavior?
All components will be displayed correctly in RTL direction.
Does this PR introduce a breaking change?
Other information