Skip to content

Commit 21b9fd3

Browse files
committed
- fix tests
1 parent e007ce8 commit 21b9fd3

File tree

22 files changed

+8904
-13528
lines changed

22 files changed

+8904
-13528
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to npm
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- closed
9+
10+
jobs:
11+
publish:
12+
if: github.event.pull_request.merged == true
13+
name: Publish to npm
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: 'lts/*'
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Build the library
30+
run: npm run build-lib
31+
32+
- name: Publish to npm
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
run: npm publish --access public

angular.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"schematics": {},
1212
"architect": {
1313
"build": {
14-
"builder": "@angular-devkit/build-angular:application",
14+
"builder": "@angular/build:application",
1515
"options": {
1616
"outputPath": {
1717
"base": "dist/angular-mydatepicker-example"
@@ -64,7 +64,7 @@
6464
"defaultConfiguration": ""
6565
},
6666
"serve": {
67-
"builder": "@angular-devkit/build-angular:dev-server",
67+
"builder": "@angular/build:dev-server",
6868
"options": {
6969
"buildTarget": "angular-mydatepicker-example:build"
7070
},
@@ -75,14 +75,15 @@
7575
}
7676
},
7777
"extract-i18n": {
78-
"builder": "@angular-devkit/build-angular:extract-i18n",
78+
"builder": "@angular/build:extract-i18n",
7979
"options": {
8080
"buildTarget": "angular-mydatepicker-example:build"
8181
}
8282
},
8383
"test": {
84-
"builder": "@angular-devkit/build-angular:karma",
84+
"builder": "@angular/build:unit-test",
8585
"options": {
86+
"runner": "karma",
8687
"main": "example/test.ts",
8788
"polyfills": "example/polyfills.ts",
8889
"tsConfig": "example/tsconfig.spec.json",
@@ -106,7 +107,7 @@
106107
"prefix": "lib",
107108
"architect": {
108109
"build": {
109-
"builder": "@angular-devkit/build-angular:ng-packagr",
110+
"builder": "@angular/build:ng-packagr",
110111
"options": {
111112
"tsConfig": "projects/angular-mydatepicker/tsconfig.lib.json",
112113
"project": "projects/angular-mydatepicker/ng-package.json"
@@ -118,7 +119,7 @@
118119
}
119120
},
120121
"test": {
121-
"builder": "@angular-devkit/build-angular:karma",
122+
"builder": "@angular/build:karma",
122123
"options": {
123124
"main": "projects/angular-mydatepicker/src/test.ts",
124125
"tsConfig": "projects/angular-mydatepicker/tsconfig.spec.json",
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<div class="datepickercontainer">
2-
<div class="datepickerelement" name="mydivdate" [(ngModel)]="model" [options]="myDatePickerOptions"
3-
angular-mydatepicker #dp="angular-mydatepicker" [ngClass]="{'placeholdercolor': !dp.isDateValid()}"
4-
(dateChanged)="onDateChanged($event)" (click)="dp.toggleCalendar()"></div>
2+
<div class="datepickerelement" name="mydivdate" [(ngModel)]="model" [options]="myDatePickerOptions"
3+
angular-mydatepicker #dp="angular-mydatepicker" [ngClass]="{'placeholdercolor': !dp.isDateValid()}"
4+
(dateChanged)="onDateChanged($event)" (click)="dp.toggleCalendar()"></div>
55

6-
<div class="closeIconContainer">
7-
<i *ngIf="dp.isDateValid()" class="fa fa-close" (click)="dp.clearDate()"></i>
8-
</div>
6+
<div class="closeIconContainer">
7+
@if (dp.isDateValid()) {
8+
<i class="fa fa-close" (click)="dp.clearDate()"></i>
9+
}
10+
</div>
911
</div>

example/app/date-picker-inline/date-picker-inline.html

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,36 @@
88

99
<div>
1010
<input angular-mydatepicker class="datePicker" type="hidden" [(ngModel)]="model" [options]="myDatePickerOptions"
11-
(dateChanged)="onDateChanged($event)" (calendarViewChanged)="onCalendarViewChanged($event)"
12-
(rangeDateSelection)="onDateRangeSelection($event)" #dp="angular-mydatepicker"/>
13-
</div>
11+
(dateChanged)="onDateChanged($event)" (calendarViewChanged)="onCalendarViewChanged($event)"
12+
(rangeDateSelection)="onDateRangeSelection($event)" #dp="angular-mydatepicker"/>
13+
</div>
1414

15-
<div>
16-
<button type="button" class="submitButton" (click)="onSubmit()">Submit</button>
17-
<button type="button" class="submitButton" (click)="dp.clearDate()">Clear</button>
18-
<button type="button" class="submitButton" (click)="onDisableUntilYesterday()">Disable until yesterday</button>
19-
</div>
15+
<div>
16+
<button type="button" class="submitButton" (click)="onSubmit()">Submit</button>
17+
<button type="button" class="submitButton" (click)="dp.clearDate()">Clear</button>
18+
<button type="button" class="submitButton" (click)="onDisableUntilYesterday()">Disable until yesterday</button>
19+
</div>
2020

21-
<div>
22-
<button *ngIf="myDatePickerOptions.dateRange" type="button" class="submitButton" (click)="onTodayPlus3()">Range today + 3</button>
23-
<button *ngIf="myDatePickerOptions.dateRange" type="button" class="submitButton" (click)="onYesterdayPlus3()">Range yesterday + 3</button>
24-
</div>
21+
<div>
22+
@if (myDatePickerOptions.dateRange) {
23+
<button type="button" class="submitButton" (click)="onTodayPlus3()">Range today + 3</button>
24+
}
25+
@if (myDatePickerOptions.dateRange) {
26+
<button type="button" class="submitButton" (click)="onYesterdayPlus3()">Range yesterday + 3</button>
27+
}
28+
</div>
2529

26-
<div>
27-
<button type="button" class="submitButton" (click)="onInitToPastMonth()">Init to past month</button>
28-
</div>
30+
<div>
31+
<button type="button" class="submitButton" (click)="onInitToPastMonth()">Init to past month</button>
32+
</div>
2933

30-
<div>
31-
<!-- header action method calls -->
32-
<button type="button" class="headerActionButton" (click)="dp.headerAction(1)">Prev</button>
33-
<button type="button" class="headerActionButton" (click)="dp.headerAction(2)">Next</button>
34-
<button type="button" class="headerActionButton" (click)="dp.headerAction(3)">Month</button>
35-
<button type="button" class="headerActionButton" (click)="dp.headerAction(4)">Year</button>
36-
</div>
34+
<div>
35+
<!-- header action method calls -->
36+
<button type="button" class="headerActionButton" (click)="dp.headerAction(1)">Prev</button>
37+
<button type="button" class="headerActionButton" (click)="dp.headerAction(2)">Next</button>
38+
<button type="button" class="headerActionButton" (click)="dp.headerAction(3)">Month</button>
39+
<button type="button" class="headerActionButton" (click)="dp.headerAction(4)">Year</button>
40+
</div>
3741

38-
</div>
42+
</div>
3943

0 commit comments

Comments
 (0)