diff --git a/.run/build-lib.run.xml b/.run/build.run.xml
similarity index 86%
rename from .run/build-lib.run.xml
rename to .run/build.run.xml
index 4527a58..02f4c43 100644
--- a/.run/build-lib.run.xml
+++ b/.run/build.run.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/.run/install.run.xml b/.run/install.run.xml
index 760296a..e30b554 100644
--- a/.run/install.run.xml
+++ b/.run/install.run.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/.run/outdated.run.xml b/.run/outdated.run.xml
index 3fbe714..2703b43 100644
--- a/.run/outdated.run.xml
+++ b/.run/outdated.run.xml
@@ -5,7 +5,7 @@
-
+
diff --git a/.run/update.run.xml b/.run/update.run.xml
index 569718e..da62079 100644
--- a/.run/update.run.xml
+++ b/.run/update.run.xml
@@ -2,7 +2,7 @@
-
+
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 77b3745..0409dbe 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,4 +1,6 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
- "recommendations": ["angular.ng-template"]
+ "recommendations": [
+ "angular.ng-template"
+ ]
}
diff --git a/LICENSE b/LICENSE
index 46a9cc5..47feb80 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 Open Template Hub
+Copyright (c) 2023 Open Template Hub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 2102d3e..f1492ee 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
-Open Template Hub - Countdown UI Component v4
+Open Template Hub - Countdown UI Component v5
[![Version](https://img.shields.io/npm/v/@open-template-hub/countdown?color=CB3837&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@open-template-hub/countdown)
diff --git a/dependency-checker.ts b/dependency-checker.ts
index bfdc37c..54399aa 100644
--- a/dependency-checker.ts
+++ b/dependency-checker.ts
@@ -5,6 +5,8 @@ const lines = outdatedCmd.stdout.toString().split( '\n' );
const columnIndexes = [ 0, 0, 0, 0 ];
+let indexOfDependedBy = -1;
+
console.log(
'\n' +
' \n' +
@@ -14,7 +16,7 @@ console.log(
'\n' +
'\n' +
'\n' +
- 'Open Template Hub - Countdown UI Component v4\n' +
+ 'Open Template Hub - Countdown UI Component v5\n' +
'
\n' +
'(outdated packages)\n' +
'
\n' +
@@ -41,7 +43,17 @@ for ( const line of lines ) {
modifiedLine += '| ';
- for ( let part of stringParts ) {
+ for ( let i = 0; i < stringParts.length; ++i ) {
+ const part = stringParts[ i ];
+
+ if ( lines.indexOf( line ) === 0 && i < stringParts.length - 1 && stringParts[ i + 1 ] === 'Depended' ) {
+ indexOfDependedBy = i;
+ }
+
+ if ( indexOfDependedBy !== -1 && i >= indexOfDependedBy ) {
+ continue;
+ }
+
if ( part.match( /\s+/ ) ) {
modifiedLine += ' | ';
} else {
@@ -63,5 +75,5 @@ for ( const line of lines ) {
console.log(
'\n' +
- '
| Open Template Hub © 2021 |
\n'
+ ' | Open Template Hub © 2023 |
\n'
);
diff --git a/docs/OUTDATED.md b/docs/OUTDATED.md
index 37c56e4..bfd6545 100644
--- a/docs/OUTDATED.md
+++ b/docs/OUTDATED.md
@@ -6,13 +6,16 @@
-Open Template Hub - Countdown UI Component v4
+Open Template Hub - Countdown UI Component v5
(outdated packages)
Following packages are not updated in the develop branch yet. So, if you want to update outdated packages on your own risk, update the package.json and install dependencies.
+| Package | Current | Wanted | Latest | Location |
+| --- | --- | --- | --- | --- |
+| typescript | 4.8.4 | 4.8.4 | 4.9.4 | node_modules/typescript |
- | Open Template Hub © 2021 |
+ | Open Template Hub © 2023 |
diff --git a/package.json b/package.json
index 8baab32..fc21036 100644
--- a/package.json
+++ b/package.json
@@ -11,31 +11,31 @@
},
"private": true,
"dependencies": {
- "@angular/animations": "^14.0.1",
- "@angular/common": "^14.0.1",
- "@angular/compiler": "^14.0.1",
- "@angular/core": "^14.0.1",
- "@angular/forms": "^14.0.1",
- "@angular/platform-browser": "^14.0.1",
- "@angular/platform-browser-dynamic": "^14.0.1",
- "@angular/router": "^14.0.1",
- "rxjs": "~7.5.0",
+ "@angular/animations": "^15.0.4",
+ "@angular/common": "^15.0.4",
+ "@angular/compiler": "^15.0.4",
+ "@angular/core": "^15.0.4",
+ "@angular/forms": "^15.0.4",
+ "@angular/platform-browser": "^15.0.4",
+ "@angular/platform-browser-dynamic": "^15.0.4",
+ "@angular/router": "^15.0.4",
+ "rxjs": "~7.8.0",
"tslib": "^2.4.0",
- "zone.js": "~0.11.4"
+ "zone.js": "~0.12.0"
},
"devDependencies": {
- "@angular-devkit/build-angular": "^14.0.1",
- "@angular/cli": "^14.0.1",
- "@angular/compiler-cli": "^14.0.1",
+ "@angular-devkit/build-angular": "^15.0.4",
+ "@angular/cli": "^15.0.4",
+ "@angular/compiler-cli": "^15.0.4",
"@types/jasmine": "^4.0.3",
- "@types/node": "^17.0.33",
+ "@types/node": "^18.0.4",
"jasmine-core": "^4.1.1",
"karma": "^6.3.20",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "^2.2.0",
"karma-jasmine": "^5.0.1",
"karma-jasmine-html-reporter": "^2.0.0",
- "ng-packagr": "^14.0.1",
- "typescript": "^4.7.3"
+ "ng-packagr": "^15.0.3",
+ "typescript": "~4.8.4"
}
}
diff --git a/projects/countdown/LICENSE b/projects/countdown/LICENSE
index 46a9cc5..47feb80 100644
--- a/projects/countdown/LICENSE
+++ b/projects/countdown/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2022 Open Template Hub
+Copyright (c) 2023 Open Template Hub
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/projects/countdown/README.md b/projects/countdown/README.md
index 54d879e..c12275c 100644
--- a/projects/countdown/README.md
+++ b/projects/countdown/README.md
@@ -5,7 +5,7 @@
-Open Template Hub - Countdown UI Component v4
+Open Template Hub - Countdown UI Component v5
[![GitHubRepo](https://img.shields.io/badge/GitHub-Repository-24292e.svg?style=for-the-badge&logo=github)](https://github.com/open-template-hub/countdown)
diff --git a/projects/countdown/karma.conf.js b/projects/countdown/karma.conf.js
index 40f8904..42746dc 100644
--- a/projects/countdown/karma.conf.js
+++ b/projects/countdown/karma.conf.js
@@ -1,16 +1,16 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
-module.exports = function (config) {
- config.set({
- basePath: '',
- frameworks: ['jasmine', '@angular-devkit/build-angular'],
+module.exports = function ( config ) {
+ config.set( {
+ basePath: "",
+ frameworks: [ "jasmine", "@angular-devkit/build-angular" ],
plugins: [
- require('karma-jasmine'),
- require('karma-chrome-launcher'),
- require('karma-jasmine-html-reporter'),
- require('karma-coverage'),
- require('@angular-devkit/build-angular/plugins/karma')
+ require( "karma-jasmine" ),
+ require( "karma-chrome-launcher" ),
+ require( "karma-jasmine-html-reporter" ),
+ require( "karma-coverage" ),
+ require( "@angular-devkit/build-angular/plugins/karma" )
],
client: {
jasmine: {
@@ -25,20 +25,20 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
- dir: require('path').join(__dirname, '../../coverage/countdown'),
- subdir: '.',
+ dir: require( "path" ).join( __dirname, "../../coverage/countdown" ),
+ subdir: ".",
reporters: [
- { type: 'html' },
- { type: 'text-summary' }
+ { type: "html" },
+ { type: "text-summary" }
]
},
- reporters: ['progress', 'kjhtml'],
+ reporters: [ "progress", "kjhtml" ],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
- browsers: ['Chrome'],
+ browsers: [ "Chrome" ],
singleRun: false,
restartOnFileChange: true
- });
+ } );
};
diff --git a/projects/countdown/package.json b/projects/countdown/package.json
index 6f5b2c9..fc47b56 100644
--- a/projects/countdown/package.json
+++ b/projects/countdown/package.json
@@ -1,11 +1,11 @@
{
"name": "@open-template-hub/countdown",
"description": "This library contains countdown ui component for UI Templates on Open Template Hub",
- "version": "4.0.5",
+ "version": "5.0.0",
"license": "MIT",
"peerDependencies": {
- "@angular/common": ">=14.0.1",
- "@angular/core": ">=14.0.1"
+ "@angular/common": ">=15.0.1",
+ "@angular/core": ">=15.0.1"
},
"dependencies": {
"tslib": "^2.3.0"
diff --git a/projects/countdown/src/lib/component/countdown/countdown.component.ts b/projects/countdown/src/lib/component/countdown/countdown.component.ts
index 6c62dc8..4b1e1d7 100644
--- a/projects/countdown/src/lib/component/countdown/countdown.component.ts
+++ b/projects/countdown/src/lib/component/countdown/countdown.component.ts
@@ -27,7 +27,7 @@ export class CountdownComponent implements OnChanges {
ngOnChanges( _: SimpleChanges ): void {
if ( !this.warningThreshold || !this.errorThreshold ) {
- this.warningThreshold = ( this.totalTime ?? 1) * 2 / 3;
+ this.warningThreshold = ( this.totalTime ?? 1 ) * 2 / 3;
this.errorThreshold = ( this.totalTime ?? 1 ) / 3;
}
@@ -36,8 +36,8 @@ export class CountdownComponent implements OnChanges {
}
setRemainingPathColor( timeLeft?: number ) {
- if( !timeLeft) {
- return
+ if ( !timeLeft ) {
+ return;
}
const { error, warning, success } = this.colorCodes;
@@ -51,8 +51,8 @@ export class CountdownComponent implements OnChanges {
}
calculateTimeFraction() {
- const rawTimeFraction = ( this.timeLeft ?? 1) / ( this.totalTime ?? 1 );
- return rawTimeFraction === 0 ? 0 : rawTimeFraction - ( 1 / ( this.totalTime ?? 1) ) * ( 1 - rawTimeFraction );
+ const rawTimeFraction = ( this.timeLeft ?? 1 ) / ( this.totalTime ?? 1 );
+ return rawTimeFraction === 0 ? 0 : rawTimeFraction - ( 1 / ( this.totalTime ?? 1 ) ) * ( 1 - rawTimeFraction );
}
setCircleDasharray() {
diff --git a/projects/countdown/src/lib/countdown.module.ts b/projects/countdown/src/lib/countdown.module.ts
index e7cd111..8d87acb 100644
--- a/projects/countdown/src/lib/countdown.module.ts
+++ b/projects/countdown/src/lib/countdown.module.ts
@@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { CountdownComponent } from './component/countdown/countdown.component';
-@NgModule({
+@NgModule( {
declarations: [
CountdownComponent
],
@@ -12,5 +12,6 @@ import { CountdownComponent } from './component/countdown/countdown.component';
exports: [
CountdownComponent
]
-})
-export class CountdownModule { }
+} )
+export class CountdownModule {
+}
diff --git a/projects/countdown/src/test.ts b/projects/countdown/src/test.ts
index bcca659..9d5998a 100644
--- a/projects/countdown/src/test.ts
+++ b/projects/countdown/src/test.ts
@@ -1,27 +1,24 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
+import { getTestBed } from '@angular/core/testing';
+import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
import 'zone.js';
import 'zone.js/testing';
-import { getTestBed } from '@angular/core/testing';
-import {
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
declare const require: {
- context(path: string, deep?: boolean, filter?: RegExp): {
- (id: string): T;
+ context( path: string, deep?: boolean, filter?: RegExp ): {
+ ( id: string ): T;
keys(): string[];
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
- BrowserDynamicTestingModule,
- platformBrowserDynamicTesting(),
+ BrowserDynamicTestingModule,
+ platformBrowserDynamicTesting(),
);
// Then we find all the tests.
-const context = require.context('./', true, /\.spec\.ts$/);
+const context = require.context( './', true, /\.spec\.ts$/ );
// And load the modules.
-context.keys().map(context);
+context.keys().map( context );