From 4d0bec00d49c4dd71fc681e6ad11b1ecea2e6696 Mon Sep 17 00:00:00 2001 From: AndyKIron Date: Thu, 2 Nov 2023 13:43:16 +0200 Subject: [PATCH 1/6] fix(isct-98): fix datepicker v1 --- package-lock.json | 4 +- .../datepicker-docs.component.html | 11 ++++++ .../datepicker-docs.component.ts | 39 +++++++++++++++++++ .../datepicker-docs/datepicker-docs.module.ts | 6 ++- .../src/app/pages/docs/docs.component.html | 14 ++++--- .../src/app/pages/docs/docs.module.ts | 20 +++++----- .../datepicker/v1/datepicker.component.ts | 10 +++-- projects/fusion-ui/utils/functions.ts | 2 +- 8 files changed, 82 insertions(+), 24 deletions(-) diff --git a/package-lock.json b/package-lock.json index 10452029a..3fcdec751 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "fusion-ui", - "version": "6.1.1", + "version": "6.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "fusion-ui", - "version": "6.1.1", + "version": "6.2.0", "license": "MIT", "dependencies": { "@angular-devkit/architect": "^0.1402.1", diff --git a/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.component.html b/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.component.html index 55d4b3fa6..85d187a89 100644 --- a/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.component.html +++ b/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.component.html @@ -5,6 +5,17 @@
Type
+ + { console.log('Form Controls changes>', val); diff --git a/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.module.ts b/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.module.ts index ad9676867..fdf89211b 100644 --- a/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.module.ts +++ b/projects/fusion-docs/src/app/pages/components/datepicker-docs/datepicker-docs.module.ts @@ -7,14 +7,16 @@ import {ExampleBlockModule} from '../../../components/example-block/example-bloc import {CodeBlockModule} from '../../../components/code-block/code-block.module'; import {DocsMenuModule} from '../../../components/docs-menu/docs-menu.module'; import {ReactiveFormsModule} from '@angular/forms'; -import {DatepickerModule} from '@ironsource/fusion-ui/components/datepicker/v3'; +import {DatepickerModule} from '@ironsource/fusion-ui/components/datepicker/v1'; import {IconModule} from '@ironsource/fusion-ui/components/icon/v1'; -import {DaterangeModule} from '@ironsource/fusion-ui/components/daterange/v3'; +import {DaterangeModule} from '@ironsource/fusion-ui/components/daterange/v1'; +import {GenericPipe} from '@ironsource/fusion-ui'; @NgModule({ declarations: [DatepickerDocsComponent], imports: [ CommonModule, + GenericPipe, IconModule, DatepickerDocsRoutingModule, ExampleBlockModule, diff --git a/projects/fusion-docs/src/app/pages/docs/docs.component.html b/projects/fusion-docs/src/app/pages/docs/docs.component.html index 17151cdff..6e14778c9 100644 --- a/projects/fusion-docs/src/app/pages/docs/docs.component.html +++ b/projects/fusion-docs/src/app/pages/docs/docs.component.html @@ -1,9 +1,11 @@ + - + - + +–> - +--> diff --git a/projects/fusion-docs/src/app/pages/docs/docs.module.ts b/projects/fusion-docs/src/app/pages/docs/docs.module.ts index 3b5f0be33..8f21dcedf 100644 --- a/projects/fusion-docs/src/app/pages/docs/docs.module.ts +++ b/projects/fusion-docs/src/app/pages/docs/docs.module.ts @@ -9,25 +9,25 @@ import {StyleVersionButtonModule} from '../../components/style-version-button/st import {MenuItemExampleModule} from '../../components/menu-item-example/menu-item-example.module'; // for layout v4 -import {LayoutComponent} from '@ironsource/fusion-ui/components/layout/v4'; -import {TopFilterIncludeExcludeComponent} from '@ironsource/fusion-ui/components/top-filter-include-exclude'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; +// import {LayoutComponent} from '@ironsource/fusion-ui/components/layout/v4'; +// import {TopFilterIncludeExcludeComponent} from '@ironsource/fusion-ui/components/top-filter-include-exclude'; +// import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @NgModule({ declarations: [DocsComponent], imports: [ CommonModule, - FormsModule, - ReactiveFormsModule, + // FormsModule, + // ReactiveFormsModule, DocsRoutingModule, // for layout v4 - LayoutComponent, - TopFilterIncludeExcludeComponent + // LayoutComponent, + // TopFilterIncludeExcludeComponent // ---- end of layout v4: for layout v1 and v2 ---- - // LayoutV1Module.forRoot({svgOptions: {assetsPath: environment.assetsPath}}), + LayoutV1Module.forRoot({svgOptions: {assetsPath: environment.assetsPath}}), // LayoutModule.forRoot({svgOptions: {assetsPath: environment.assetsPath}}), - // StyleVersionButtonModule, - // MenuItemExampleModule + StyleVersionButtonModule, + MenuItemExampleModule ] }) export class DocsModule {} diff --git a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts index 90cec9b0a..b796e7884 100644 --- a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts +++ b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts @@ -114,9 +114,13 @@ export class DatepickerComponent implements OnInit, OnDestroy, OnChanges, AfterV ngOnChanges(changes) { if ( - this.selectedDate && - ((changes.minDate && changes.minDate.currentValue !== changes.minDate.previousValue) || - (changes.maxDate && changes.maxDate.currentValue !== changes.maxDate.previousValue)) + (this.selectedDate && + isDate(changes?.minDate?.currentValue) && + isDate(changes?.minDate?.previousValue) && + !this.isDatesEqual(changes?.minDate?.currentValue, changes?.minDate?.previousValue, 'day')) || + (isDate(changes?.maxDate?.currentValue) && + isDate(changes?.maxDate?.previousValue) && + !this.isDatesEqual(changes?.maxDate?.currentValue, changes?.maxDate?.previousValue, 'day')) ) { this.setWeeks(this.selectedDate.date ? this.selectedDate.date : this.today); } diff --git a/projects/fusion-ui/utils/functions.ts b/projects/fusion-ui/utils/functions.ts index ccd94ce24..6cc905aa4 100644 --- a/projects/fusion-ui/utils/functions.ts +++ b/projects/fusion-ui/utils/functions.ts @@ -7,7 +7,7 @@ export function isRegExp(object: any) { } export function isDate(object: any): boolean { - return object instanceof Date; + return object instanceof Date && isFinite(+object); } export function isError(object: any): boolean { From 915d378641d0d95b2917dc7ccb9b8e3fb118e63e Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Nov 2023 11:50:23 +0000 Subject: [PATCH 2/6] chore(release): 6.2.1-rc.0 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- projects/fusion-ui/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d948e0abe..d4cb44892 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +### [6.2.1-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.2.0...v6.2.1-rc.0) (2023-11-02) + + +### Bug Fixes + +* **isct-98:** fix datepicker v1 ([4d0bec0](https://github.com/ironSource/fusion-ui/commit/4d0bec00d49c4dd71fc681e6ad11b1ecea2e6696)) + ## [6.2.0](https://github.com/ironSource/fusion-ui/compare/v6.2.0-rc.0...v6.2.0) (2023-10-30) ## [6.2.0-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.1.1...v6.2.0-rc.0) (2023-10-16) diff --git a/package.json b/package.json index 4c2501e13..ad1c3b18e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fusion-ui", - "version": "6.2.0", + "version": "6.2.1-rc.0", "description": "UI library created by ironSource", "license": "MIT", "repository": { diff --git a/projects/fusion-ui/package.json b/projects/fusion-ui/package.json index aab7e19f3..43f354b7b 100644 --- a/projects/fusion-ui/package.json +++ b/projects/fusion-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ironsource/fusion-ui", - "version": "6.2.0", + "version": "6.2.1-rc.0", "dependencies": { "chart.js": "^3.5.1", "@floating-ui/dom": "^1.0.9", From 3bbc30821463c524410c0c240d0f98597f391897 Mon Sep 17 00:00:00 2001 From: AndyKIron Date: Thu, 2 Nov 2023 16:17:46 +0200 Subject: [PATCH 3/6] chore(isct-98): fix datepicker v1 in case update min or max date --- .../datepicker/v1/datepicker.component.ts | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts index b796e7884..9c8e18efa 100644 --- a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts +++ b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts @@ -43,6 +43,7 @@ export class DatepickerComponent implements OnInit, OnDestroy, OnChanges, AfterV @Input() set isOpened(value: boolean) { this.isOpen$.next(!isNullOrUndefined(value) ? value : false); } + @Input() isTimePicker = false; @Input() isTimeZonePicker = false; @Input() isDisabled = false; @@ -114,12 +115,8 @@ export class DatepickerComponent implements OnInit, OnDestroy, OnChanges, AfterV ngOnChanges(changes) { if ( - (this.selectedDate && - isDate(changes?.minDate?.currentValue) && - isDate(changes?.minDate?.previousValue) && - !this.isDatesEqual(changes?.minDate?.currentValue, changes?.minDate?.previousValue, 'day')) || - (isDate(changes?.maxDate?.currentValue) && - isDate(changes?.maxDate?.previousValue) && + this.selectedDate && + (!this.isDatesEqual(changes?.minDate?.currentValue, changes?.minDate?.previousValue, 'day') || !this.isDatesEqual(changes?.maxDate?.currentValue, changes?.maxDate?.previousValue, 'day')) ) { this.setWeeks(this.selectedDate.date ? this.selectedDate.date : this.today); @@ -317,14 +314,22 @@ export class DatepickerComponent implements OnInit, OnDestroy, OnChanges, AfterV } private isDatesEqual(dateA: Date, dateB: Date, granularity: 'month' | 'day'): boolean { - dateA = new Date(dateA); - dateB = new Date(dateB); - dateA.setHours(0, 0, 0, 0); - dateB.setHours(0, 0, 0, 0); - if (granularity === 'day') { - return dateA.getTime() === dateB.getTime(); - } else if (granularity === 'month') { - return new Date(dateA.getFullYear(), dateA.getMonth()).getTime() === new Date(dateB.getFullYear(), dateB.getMonth()).getTime(); + if (isDate(dateA) && isDate(dateB)) { + dateA = new Date(dateA); + dateB = new Date(dateB); + dateA.setHours(0, 0, 0, 0); + dateB.setHours(0, 0, 0, 0); + if (granularity === 'day') { + return dateA.getTime() === dateB.getTime(); + } else if (granularity === 'month') { + return ( + new Date(dateA.getFullYear(), dateA.getMonth()).getTime() === new Date(dateB.getFullYear(), dateB.getMonth()).getTime() + ); + } + } else if (isDate(dateA) || isDate(dateB)) { + return false; + } else { + return true; } } From 7ebc0dd9d8b156cc75b8cf65ed6be3dccde48f8c Mon Sep 17 00:00:00 2001 From: AndyKIron Date: Thu, 2 Nov 2023 16:19:51 +0200 Subject: [PATCH 4/6] chore(isct-98): fix datepicker v1 in case update min or max date --- .../fusion-ui/components/datepicker/v1/datepicker.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts index 9c8e18efa..9249ca5d7 100644 --- a/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts +++ b/projects/fusion-ui/components/datepicker/v1/datepicker.component.ts @@ -326,7 +326,7 @@ export class DatepickerComponent implements OnInit, OnDestroy, OnChanges, AfterV new Date(dateA.getFullYear(), dateA.getMonth()).getTime() === new Date(dateB.getFullYear(), dateB.getMonth()).getTime() ); } - } else if (isDate(dateA) || isDate(dateB)) { + } else if ((!isDate(dateA) && isDate(dateB)) || (isDate(dateA) && !isDate(dateB))) { return false; } else { return true; From 7efe675140228740ac60f8d17b5896c985cf22cc Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 2 Nov 2023 14:21:51 +0000 Subject: [PATCH 5/6] chore(release): 6.2.1-rc.1 --- CHANGELOG.md | 2 ++ package.json | 2 +- projects/fusion-ui/package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4cb44892..68a60a8dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +### [6.2.1-rc.1](https://github.com/ironSource/fusion-ui/compare/v6.2.1-rc.0...v6.2.1-rc.1) (2023-11-02) + ### [6.2.1-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.2.0...v6.2.1-rc.0) (2023-11-02) diff --git a/package.json b/package.json index ad1c3b18e..6ab5f3e66 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fusion-ui", - "version": "6.2.1-rc.0", + "version": "6.2.1-rc.1", "description": "UI library created by ironSource", "license": "MIT", "repository": { diff --git a/projects/fusion-ui/package.json b/projects/fusion-ui/package.json index 43f354b7b..c4e54ee47 100644 --- a/projects/fusion-ui/package.json +++ b/projects/fusion-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ironsource/fusion-ui", - "version": "6.2.1-rc.0", + "version": "6.2.1-rc.1", "dependencies": { "chart.js": "^3.5.1", "@floating-ui/dom": "^1.0.9", From a06c2c2d589d4c3d6bb7e0afb2c5b3df88e0eadf Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 5 Nov 2023 10:58:04 +0000 Subject: [PATCH 6/6] chore(release): 6.2.1 --- CHANGELOG.md | 2 ++ package.json | 2 +- projects/fusion-ui/package.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68a60a8dd..57b1c30ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +### [6.2.1](https://github.com/ironSource/fusion-ui/compare/v6.2.1-rc.1...v6.2.1) (2023-11-05) + ### [6.2.1-rc.1](https://github.com/ironSource/fusion-ui/compare/v6.2.1-rc.0...v6.2.1-rc.1) (2023-11-02) ### [6.2.1-rc.0](https://github.com/ironSource/fusion-ui/compare/v6.2.0...v6.2.1-rc.0) (2023-11-02) diff --git a/package.json b/package.json index 6ab5f3e66..5c68f6efb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fusion-ui", - "version": "6.2.1-rc.1", + "version": "6.2.1", "description": "UI library created by ironSource", "license": "MIT", "repository": { diff --git a/projects/fusion-ui/package.json b/projects/fusion-ui/package.json index c4e54ee47..4035e4e15 100644 --- a/projects/fusion-ui/package.json +++ b/projects/fusion-ui/package.json @@ -1,6 +1,6 @@ { "name": "@ironsource/fusion-ui", - "version": "6.2.1-rc.1", + "version": "6.2.1", "dependencies": { "chart.js": "^3.5.1", "@floating-ui/dom": "^1.0.9",