-
Notifications
You must be signed in to change notification settings - Fork 8
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(popover): set default Radix values #189
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; | ||
import { CdkConnectedOverlay, Overlay } from '@angular/cdk/overlay'; | ||
import { | ||
booleanAttribute, | ||
computed, | ||
DestroyRef, | ||
Directive, | ||
effect, | ||
inject, | ||
input, | ||
numberAttribute, | ||
OnInit, | ||
output, | ||
SimpleChange, | ||
|
@@ -45,7 +48,7 @@ export class RdxPopoverContentDirective implements OnInit { | |
/** | ||
* The distance in pixels from the trigger. | ||
*/ | ||
readonly sideOffset = input<number | undefined>(void 0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is intentional to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because the offsets are calculated as a fallback later on unless any number value is provided. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
readonly sideOffset = input<number, NumberInput>(0, { transform: numberAttribute }); | ||
|
||
/** | ||
* The preferred alignment against the trigger. May change when collisions occur. | ||
|
@@ -54,12 +57,12 @@ export class RdxPopoverContentDirective implements OnInit { | |
/** | ||
* An offset in pixels from the "start" or "end" alignment options. | ||
*/ | ||
readonly alignOffset = input<number | undefined>(void 0); | ||
readonly alignOffset = input<number, NumberInput>(0, { transform: numberAttribute }); | ||
|
||
/** | ||
* Whether to add some alternate positions of the content. | ||
*/ | ||
readonly disableAlternatePositions = input(false); | ||
readonly disableAlternatePositions = input<boolean, BooleanInput>(false, { transform: booleanAttribute }); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no point in having that transformer here - unnecessary code that brings no value imho |
||
|
||
/** @ingore */ | ||
readonly positions = computed(() => { | ||
|
@@ -83,6 +86,7 @@ export class RdxPopoverContentDirective implements OnInit { | |
* Alternate positions for better user experience along the X/Y axis (e.g. vertical/horizontal scrolling) | ||
*/ | ||
const allPossibleConnectedPositions = getAllPossibleConnectedPositions(); | ||
|
||
allPossibleConnectedPositions.forEach((_, key) => { | ||
const sideAndAlignArray = key.split('|'); | ||
if ( | ||
|
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 not necessary. I've never seen the usage of it before for such cases.
Angular inputs are typed, there is no point in having that transformer here :)