-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace ngx-bootstrap w/ ng-bootstrap
ng-bootstrap seems to be better maintained, uses standalone components, and better supports dark mode in Bootstrap 5.
- Loading branch information
Showing
44 changed files
with
363 additions
and
186 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/app/common/datepicker/datepicker-range-popup/datepicker-range-popup.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<div class="dp-hidden position-absolute"> | ||
<input | ||
class="form-control" | ||
name="datepicker" | ||
autoClose="outside" | ||
ngbDatepicker | ||
outsideDays="hidden" | ||
tabindex="-1" | ||
#datepicker="ngbDatepicker" | ||
[dayTemplate]="t" | ||
[displayMonths]="2" | ||
[startDate]="fromDate()!" | ||
(dateSelect)="onDateSelection($event)" | ||
/> | ||
<ng-template let-date let-focused="focused" #t> | ||
<span | ||
class="custom-day" | ||
[class.faded]="isHovered(date) || isInside(date)" | ||
[class.focused]="focused" | ||
[class.range]="isRange(date)" | ||
(mouseenter)="hoveredDate.set(date)" | ||
(mouseleave)="hoveredDate.set(null)" | ||
> | ||
{{ date.day }} | ||
</span> | ||
</ng-template> | ||
</div> | ||
<div class="input-group"> | ||
<input | ||
class="form-control" | ||
name="dpFromDate" | ||
[value]="fromDateString()" | ||
autocomplete="off" | ||
placeholder="yyyy-mm-dd" | ||
#dpFromDate | ||
[disabled]="disabled()" | ||
(input)="fromDate.set(validateInput(fromDate(), dpFromDate.value))" | ||
/> | ||
<span class="input-group-text">-</span> | ||
<input | ||
class="form-control" | ||
name="dpToDate" | ||
[value]="toDateString()" | ||
autocomplete="off" | ||
placeholder="yyyy-mm-dd" | ||
#dpToDate | ||
[disabled]="disabled()" | ||
(input)="toDate.set(validateInput(toDate(), dpToDate.value))" | ||
/> | ||
<button | ||
class="btn btn-outline-secondary" | ||
type="button" | ||
[disabled]="disabled()" | ||
(click)="datepicker.toggle()" | ||
> | ||
<span class="fa-solid fa-calendar-days"></span> | ||
</button> | ||
</div> |
31 changes: 31 additions & 0 deletions
31
src/app/common/datepicker/datepicker-range-popup/datepicker-range-popup.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.dp-hidden { | ||
width: 0; | ||
margin: 0; | ||
border: none; | ||
padding: 0; | ||
} | ||
|
||
.custom-day { | ||
text-align: center; | ||
padding: 0.25rem; | ||
display: inline-block; | ||
height: 2rem; | ||
width: 2rem; | ||
} | ||
|
||
.custom-day.focused { | ||
background-color: var(--bs-primary); | ||
color: white; | ||
} | ||
|
||
.custom-day.range, | ||
.custom-day:hover { | ||
background-color: var(--bs-primary); | ||
color: white; | ||
} | ||
|
||
.custom-day.faded { | ||
background-color: var(--bs-primary-bg-subtle); | ||
color: var(--bs-body-color); | ||
} | ||
|
22 changes: 22 additions & 0 deletions
22
src/app/common/datepicker/datepicker-range-popup/datepicker-range-popup.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { DatepickerRangePopupComponent } from './datepicker-range-popup.component'; | ||
|
||
describe('DatepickerRangePopupComponent', () => { | ||
let component: DatepickerRangePopupComponent; | ||
let fixture: ComponentFixture<DatepickerRangePopupComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [DatepickerRangePopupComponent] | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(DatepickerRangePopupComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.