Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion projects/angular-ui/src/lib/modal/modal-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
private _overlayRef: OverlayRef,
public _containerInstance: _BaoModalContainerBase,
/** Id of the modal. */
readonly id: string = `bao-modal-${uniqueId++}`

Check warning on line 56 in projects/angular-ui/src/lib/modal/modal-ref.ts

View workflow job for this annotation

GitHub Actions / Build, Lint and Test Project

Type string trivially inferred from a string literal, remove type annotation
) {
// Pass the id along to the container.
_containerInstance._id = id;
Expand Down Expand Up @@ -105,7 +105,7 @@
_closeModalVia(this, 'keyboard');
});

_overlayRef.backdropClick().subscribe(async () => {

Check warning on line 108 in projects/angular-ui/src/lib/modal/modal-ref.ts

View workflow job for this annotation

GitHub Actions / Build, Lint and Test Project

Promise returned in function argument where a void return was expected
if (this.disableClose) {
await this._containerInstance._recaptureFocus();
} else {
Expand Down Expand Up @@ -138,7 +138,7 @@
// vast majority of cases the timeout will have been cleared before it has the chance to fire.
this._closeFallbackTimeout = setTimeout(
() => this._finishModalClose(),
(event.totalTime as number) + 100

Check warning on line 141 in projects/angular-ui/src/lib/modal/modal-ref.ts

View workflow job for this annotation

GitHub Actions / Build, Lint and Test Project

This assertion is unnecessary since it does not change the type of the expression
);
});

Expand Down Expand Up @@ -192,12 +192,14 @@
const strategy = this._getPositionStrategy();

if (position && (position.left || position.right)) {
// Here we will set the horizontal position of the modal (left or right).
this.applyPositionStrategy(position, strategy, 'horizontal');
} else {
strategy.centerHorizontally();
}

if (position && (position.top || position.bottom)) {
// Here we will set the vertical position of the modal (top or bottom).
this.applyPositionStrategy(position, strategy, 'vertical');
} else {
strategy.centerVertically();
Expand Down Expand Up @@ -251,9 +253,14 @@

/**
* Applies the position strategy to the overlay.
*
* This method sets the position of the modal based on the provided `position` configuration.
* It determines whether to apply the position to the vertical or horizontal axis based on the
* `axis` parameter.
*
* @param position The position configuration for the modal.
* @param strategy The position strategy to be applied.
* @param axis The axis to apply the position ('horizontal' | 'vertical')
* @param axis The axis to apply the position (`'horizontal' | 'vertical'`)
*/
private applyPositionStrategy(
position: ModalPosition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ export const baoFileIntl: StoryFn = args => ({
<div style="max-width:50rem;">
<p> By default, the File Input component displays its texts in french. To display text in another language, here are the steps to follow:
<ol>
<li> In your <b>app.module.ts</b>, import <b>BaoFileIntl</b> and <b>BaoFileIntlEnglish</b> for texts in english from @villedemontreal/angular-ui. </li>
<li> In your <b>app.module.ts</b>, import <b>BaoFileIntl</b> and <b>BaoFileIntlEnglish</b> for texts in english from &#64;villedemontreal/angular-ui. </li>
<li> If you need to use the component in a different language, you can declare your own class that extends BaoFileIntl and contains texts in your prefered language. It should look like this:
<p>
<code>@Injectable()<br>
<code>&#64;Injectable()<br>
class BaoFileIntlEnglish extends BaoFileIntl {{ '{' }}
<div style="margin-left:1rem;font-family:inherit;font-size:inherit;">
dropzoneButtonLabel = 'Browse';<br>
Expand Down
Loading