Skip to content

Commit

Permalink
Merge pull request #96 from tonysamperi/v17
Browse files Browse the repository at this point in the history
v17.0.2
  • Loading branch information
tonysamperi authored Dec 11, 2023
2 parents b984230 + f662736 commit 74a28dc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 21 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#17.0.2
* Fix time not preserved in picker when "appendToInput" is true (fixes [#93](https://github.com/tonysamperi/ngx-mat-timepicker/issues/93))

#17.0.1
* Fix disabled clock buttons appearance (fixes [#94](https://github.com/tonysamperi/ngx-mat-timepicker/issues/94))

#17.0.0
* Update for Angular 17! 🎉

#16.1.3
* Fix time not preserved in picker when "appendToInput" is true (fixes [#93](https://github.com/tonysamperi/ngx-mat-timepicker/issues/93))

#16.1.2
* Fix weird behaviours caused by multiple pickers in same page (fixes [#29](https://github.com/tonysamperi/ngx-mat-timepicker/issues/29))

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mat-timepicker-repo",
"version": "17.0.1",
"version": "17.0.2",
"build": 0,
"license": "MIT",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ <h2>Append to input</h2>
[format]="24"
[(ngModel)]="selectedTimes.D"
[ngxMatTimepicker]="pickerD"
[defaultValue]="selectedTimes.D"
placeholder="23:59"
readonly />
<mat-icon matSuffix
Expand All @@ -329,7 +328,6 @@ <h2>Append to input</h2>
<small>ngx-mat-timepicker is here</small>
<ngx-mat-timepicker color="accent"
appendToInput

#pickerD></ngx-mat-timepicker>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion projects/ngx-mat-timepicker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-mat-timepicker",
"version": "17.0.1",
"version": "17.0.2",
"license": "MIT",
"description": "ngx-mat-timepicker is an Angular material 9+ extension to add time pickers!",
"homepage": "https://tonysamperi.github.io/ngx-mat-timepicker",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class NgxMatTimepickerStandaloneComponent extends NgxMatTimepickerBaseDir
timepickerSrv: NgxMatTimepickerService,
eventSrv: NgxMatTimepickerEventService,
timepickerLocaleSrv: NgxMatTimepickerLocaleService) {

console.info("DEBUG", data);
super(timepickerSrv, eventSrv, timepickerLocaleSrv, data);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,42 @@
import {coerceBooleanProperty} from "@angular/cdk/coercion";
import {Component, EventEmitter, HostBinding, Input, Output, TemplateRef} from "@angular/core";
import { CdkOverlayOrigin, ConnectedPosition, Overlay, OverlayRef, CdkConnectedOverlay } from "@angular/cdk/overlay";
import {CdkOverlayOrigin, ConnectedPosition, OverlayRef, CdkConnectedOverlay} from "@angular/cdk/overlay";
import {MatDialog, MatDialogRef} from "@angular/material/dialog";
import {ThemePalette} from "@angular/material/core";
//
import {NgxMatTimepickerConfig} from "../../models/ngx-mat-timepicker-config.interface";
import {NgxMatTimepickerFormatType} from "../../models/ngx-mat-timepicker-format.type";
import {NgxMatTimepickerAdapter} from "../../services/ngx-mat-timepicker-adapter";
import {NgxMatTimepickerEventService} from "../../services/ngx-mat-timepicker-event.service";
import {NgxMatTimepickerDirective} from "../../directives/ngx-mat-timepicker.directive";
import {NgxMatTimepickerRef} from "../../models/ngx-mat-timepicker-ref.interface";
import {NgxMatTimepickerDialogComponent} from "../ngx-mat-timepicker-dialog/ngx-mat-timepicker-dialog.component";
import {NGX_MAT_TIMEPICKER_CONFIG} from "../../tokens/ngx-mat-timepicker-config.token";
//
import {DateTime} from "ts-luxon";
import {BehaviorSubject} from "rxjs";
import { NgxMatTimepickerStandaloneComponent } from "../ngx-mat-timepicker-standalone/ngx-mat-timepicker-standalone.component";
import {
NgxMatTimepickerStandaloneComponent
} from "../ngx-mat-timepicker-standalone/ngx-mat-timepicker-standalone.component";

let config: NgxMatTimepickerConfig;

@Component({
selector: "ngx-mat-timepicker-provider",
template: `<ngx-mat-timepicker-standalone></ngx-mat-timepicker-standalone>`,
standalone: true,
providers: [
{
provide: NGX_MAT_TIMEPICKER_CONFIG,
useFactory() {
return config;
}
}
],
imports: [NgxMatTimepickerStandaloneComponent]
})
export class NgxMatTimepickerProvider {
}

@Component({
selector: "ngx-mat-timepicker",
template: `
Expand All @@ -30,17 +48,11 @@ let config: NgxMatTimepickerConfig;
(backdropClick)="close()"
[cdkConnectedOverlayOrigin]="overlayOrigin"
[cdkConnectedOverlayOpen]="showPicker">
<ngx-mat-timepicker-standalone></ngx-mat-timepicker-standalone>
</ng-template>`,
providers: [
{
provide: NGX_MAT_TIMEPICKER_CONFIG, useFactory() {
return config;
}
}
],
<ngx-mat-timepicker-provider></ngx-mat-timepicker-provider>
</ng-template>
`,
standalone: true,
imports: [CdkConnectedOverlay, NgxMatTimepickerStandaloneComponent]
imports: [CdkConnectedOverlay, NgxMatTimepickerStandaloneComponent, NgxMatTimepickerProvider]
})
export class NgxMatTimepickerComponent implements NgxMatTimepickerRef {

Expand Down Expand Up @@ -160,9 +172,7 @@ export class NgxMatTimepickerComponent implements NgxMatTimepickerRef {
private _overlayRef: OverlayRef;
private _timepickerInput: NgxMatTimepickerDirective;

constructor(private _eventService: NgxMatTimepickerEventService,
private _dialog: MatDialog,
private _overlay: Overlay) {
constructor(private _dialog: MatDialog) {
}

close(): void {
Expand Down

0 comments on commit 74a28dc

Please sign in to comment.