Skip to content

Commit

Permalink
build: reformat with Prettier 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
maxokorokov committed Nov 14, 2023
1 parent 4e0da1a commit 1dfbd28
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export class NgbdDatepickerAdapter {
model1: string;
model2: string;

constructor(private ngbCalendar: NgbCalendar, private dateAdapter: NgbDateAdapter<string>) {}
constructor(
private ngbCalendar: NgbCalendar,
private dateAdapter: NgbDateAdapter<string>,
) {}

get today() {
return this.dateAdapter.toModel(this.ngbCalendar.getToday())!;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ import { JsonPipe } from '@angular/common';
export class NgbdDatepickerHebrew {
model: NgbDateStruct;

constructor(private calendar: NgbCalendar, public i18n: NgbDatepickerI18n) {
constructor(
private calendar: NgbCalendar,
public i18n: NgbDatepickerI18n,
) {
this.dayTemplateData = this.dayTemplateData.bind(this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export class NgbdDatepickerRangePopup {
fromDate: NgbDate | null;
toDate: NgbDate | null;

constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter) {
constructor(
private calendar: NgbCalendar,
public formatter: NgbDateParserFormatter,
) {
this.fromDate = calendar.getToday();
this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import { DatePipe } from '@angular/common';
<h5>Vacations</h5>
<p>
from
<b>{{ adapter.toModel(fromDate) | date : 'mediumDate' }}</b>
<b>{{ adapter.toModel(fromDate) | date: 'mediumDate' }}</b>
to
<b>{{ adapter.toModel(toDate ? toDate : hoveredDate) | date : 'mediumDate' }}</b>
<b>{{ adapter.toModel(toDate ? toDate : hoveredDate) | date: 'mediumDate' }}</b>
</p>
</div>
Expand Down Expand Up @@ -107,7 +107,10 @@ export class NgbdDatepickerOverviewDemoComponent {
{ month: 12, day: 25, text: 'Christmas Day' },
];

constructor(private calendar: NgbCalendar, public adapter: NgbDateNativeAdapter) {
constructor(
private calendar: NgbCalendar,
public adapter: NgbDateNativeAdapter,
) {
this.markDisabled = this.markDisabled.bind(this);
this.today = calendar.getToday();
this.fromDate = this.getFirstAvailableDate(this.today);
Expand Down
5 changes: 4 additions & 1 deletion demo/src/app/components/modal/demos/config/modal-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { NgbModalConfig, NgbModal } from '@ng-bootstrap/ng-bootstrap';
providers: [NgbModalConfig, NgbModal],
})
export class NgbdModalConfig {
constructor(config: NgbModalConfig, private modalService: NgbModal) {
constructor(
config: NgbModalConfig,
private modalService: NgbModal,
) {
// customize default values of modals used by this component tree
config.backdrop = 'static';
config.keyboard = false;
Expand Down
5 changes: 4 additions & 1 deletion demo/src/app/components/modal/demos/stacked/modal-stacked.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { NgbActiveModal, NgbModal } from '@ng-bootstrap/ng-bootstrap';
`,
})
export class NgbdModal1Content {
constructor(private modalService: NgbModal, public activeModal: NgbActiveModal) {}
constructor(
private modalService: NgbModal,
public activeModal: NgbActiveModal,
) {}

open() {
this.modalService.open(NgbdModal2Content, { size: 'lg' });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { NgbOffcanvasConfig, NgbOffcanvas } from '@ng-bootstrap/ng-bootstrap';
providers: [NgbOffcanvasConfig, NgbOffcanvas],
})
export class NgbdOffcanvasConfig {
constructor(config: NgbOffcanvasConfig, private offcanvasService: NgbOffcanvas) {
constructor(
config: NgbOffcanvasConfig,
private offcanvasService: NgbOffcanvas,
) {
// customize default values of offcanvas used by this component tree
config.position = 'end';
config.backdropClass = 'bg-info';
Expand Down
8 changes: 7 additions & 1 deletion demo/src/style/prism-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
color: #c9d1d9;
font-size: 15px;
text-shadow: none;
font-family: source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace;
font-family:
source-code-pro,
Menlo,
Monaco,
Consolas,
Courier New,
monospace;
direction: ltr;
text-align: left;
white-space: pre;
Expand Down
8 changes: 7 additions & 1 deletion demo/src/style/prism-light.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ code[class*='language-'] {
color: #24292f;
font-size: 15px;
text-shadow: none;
font-family: source-code-pro, Menlo, Monaco, Consolas, Courier New, monospace;
font-family:
source-code-pro,
Menlo,
Monaco,
Consolas,
Courier New,
monospace;
direction: ltr;
text-align: left;
white-space: pre;
Expand Down
5 changes: 4 additions & 1 deletion e2e-app/src/app/modal/autoclose/modal-autoclose.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export class ModalAutoCloseComponent {
reason = '';
options = {};

constructor(private modalService: NgbModal, private cd: ChangeDetectorRef) {}
constructor(
private modalService: NgbModal,
private cd: ChangeDetectorRef,
) {}

openModal(content?: TemplateRef<any>) {
this.modalRef = this.modalService.open(content, this.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export class OffcanvasAutoCloseComponent {
reason = '';
options = {};

constructor(private offcanvasService: NgbOffcanvas, private cd: ChangeDetectorRef) {}
constructor(
private offcanvasService: NgbOffcanvas,
private cd: ChangeDetectorRef,
) {}

openOffcanvas(content?: TemplateRef<any>) {
this.offcanvasRef = this.offcanvasService.open(content, this.options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { NgbModal, NgbModule, NgbOffcanvas } from '@ng-bootstrap/ng-bootstrap';
export class OffcanvasStackConfirmationComponent {
@ViewChild('confirmation', { static: true, read: TemplateRef }) confirmationTpl: TemplateRef<any>;

constructor(private modalService: NgbModal, private offcanvasService: NgbOffcanvas) {}
constructor(
private modalService: NgbModal,
private offcanvasService: NgbOffcanvas,
) {}

openOffcanvas(content: TemplateRef<any>) {
this.offcanvasService.open(content, { beforeDismiss: () => this.modalService.open(this.confirmationTpl).result });
Expand Down
2 changes: 1 addition & 1 deletion e2e-app/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
4 changes: 2 additions & 2 deletions src/modal/modal-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ export class NgbModalStack {
options.container instanceof HTMLElement
? options.container
: isDefined(options.container)
? this._document.querySelector(options.container!)
: this._document.body;
? this._document.querySelector(options.container!)
: this._document.body;

if (!containerEl) {
throw new Error(`The specified modal container "${options.container || 'body'}" was not found in the DOM.`);
Expand Down
4 changes: 2 additions & 2 deletions src/modal/modal-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export class NgbModalWindow implements OnInit, OnDestroy {
return this.fullscreen === true
? ' modal-fullscreen'
: isString(this.fullscreen)
? ` modal-fullscreen-${this.fullscreen}-down`
: '';
? ` modal-fullscreen-${this.fullscreen}-down`
: '';
}

dismiss(reason): void {
Expand Down
4 changes: 2 additions & 2 deletions src/offcanvas/offcanvas-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export class NgbOffcanvasStack {
options.container instanceof HTMLElement
? options.container
: isDefined(options.container)
? this._document.querySelector(options.container!)
: this._document.body;
? this._document.querySelector(options.container!)
: this._document.body;
if (!containerEl) {
throw new Error(`The specified offcanvas container "${options.container || 'body'}" was not found in the DOM.`);
}
Expand Down
12 changes: 9 additions & 3 deletions src/test/test-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,25 @@
.modal.fade .modal-dialog {
transition: -webkit-transform 0.01s ease-out !important;
transition: transform 0.01s ease-out !important;
transition: transform 0.01s ease-out, -webkit-transform 0.01s ease-out !important;
transition:
transform 0.01s ease-out,
-webkit-transform 0.01s ease-out !important;
}

.offcanvas {
transition: -webkit-transform 0.01s ease-out !important;
transition: transform 1s ease-out !important;
transition: transform 0.01s ease-out, -webkit-transform 0.01s ease-out !important;
transition:
transform 0.01s ease-out,
-webkit-transform 0.01s ease-out !important;
}

.carousel-item {
transition: -webkit-transform 0.01s ease-out !important;
transition: transform 0.01s ease-out !important;
transition: transform 0.01s ease-out, -webkit-transform 0.01s ease-out !important;
transition:
transform 0.01s ease-out,
-webkit-transform 0.01s ease-out !important;
}

.ngb-reduce-motion .fade,
Expand Down
6 changes: 5 additions & 1 deletion src/util/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ import { ngbRunTransition } from './transition/ngbTransition';
import { DOCUMENT } from '@angular/common';

export class ContentRef {
constructor(public nodes: Node[][], public viewRef?: ViewRef, public componentRef?: ComponentRef<any>) {}
constructor(
public nodes: Node[][],
public viewRef?: ViewRef,
public componentRef?: ComponentRef<any>,
) {}
}

export class PopupService<T> {
Expand Down
2 changes: 1 addition & 1 deletion ssr-app/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion test-app/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down

0 comments on commit 1dfbd28

Please sign in to comment.