From 896cd9d56c16e318b0cd9d1431647a10930b97c2 Mon Sep 17 00:00:00 2001 From: Tim Sielemann Date: Fri, 27 Sep 2024 12:06:32 +0200 Subject: [PATCH] feat(angular): add formly date element (#573) * feat(angular): add formly date element * feat(angular): fix build --------- Co-authored-by: Tim Sielemann --- .../formly-date/formly-date.component.ts | 35 +++++++++++++++++++ .../src/lib/formly/formly.module.ts | 7 ++++ .../catalyst-formly/src/public-api.ts | 1 + 3 files changed, 43 insertions(+) create mode 100644 angular/projects/catalyst-formly/src/lib/formly/formly-date/formly-date.component.ts diff --git a/angular/projects/catalyst-formly/src/lib/formly/formly-date/formly-date.component.ts b/angular/projects/catalyst-formly/src/lib/formly/formly-date/formly-date.component.ts new file mode 100644 index 000000000..391951c54 --- /dev/null +++ b/angular/projects/catalyst-formly/src/lib/formly/formly-date/formly-date.component.ts @@ -0,0 +1,35 @@ +import { Component } from '@angular/core'; +import { FieldType, FieldTypeConfig } from '@ngx-formly/core'; + +@Component({ + selector: 'formly-date', + template: ` + + + ` +}) +export class CatDateFieldType extends FieldType {} diff --git a/angular/projects/catalyst-formly/src/lib/formly/formly.module.ts b/angular/projects/catalyst-formly/src/lib/formly/formly.module.ts index 779dc819f..8df49a220 100644 --- a/angular/projects/catalyst-formly/src/lib/formly/formly.module.ts +++ b/angular/projects/catalyst-formly/src/lib/formly/formly.module.ts @@ -4,6 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { FormlyModule } from '@ngx-formly/core'; import { CatalystModule } from '@haiilo/catalyst-angular'; import { CatCheckboxFieldType } from './formly-checkbox/formly-checkbox.component'; +import { CatDateFieldType } from './formly-date/formly-date.component'; import { CatDatepickerFieldType } from './formly-datepicker/formly-datepicker.component'; import { CatInputFieldType } from './formly-input/formly-input.component'; import { CatRadioGroupFieldType } from './formly-radio-group/formly-radio-group.component'; @@ -15,6 +16,7 @@ import { CatToggleFieldType } from './formly-toggle/formly-toggle.component'; @NgModule({ declarations: [ CatCheckboxFieldType, + CatDateFieldType, CatDatepickerFieldType, CatInputFieldType, CatRadioFieldType, @@ -60,12 +62,17 @@ import { CatToggleFieldType } from './formly-toggle/formly-toggle.component'; { name: 'cat-select-formly', component: CatSelectFieldType + }, + { + name: 'cat-date-formly', + component: CatDateFieldType } ] }) ], exports: [ CatCheckboxFieldType, + CatDateFieldType, CatDatepickerFieldType, CatInputFieldType, CatRadioFieldType, diff --git a/angular/projects/catalyst-formly/src/public-api.ts b/angular/projects/catalyst-formly/src/public-api.ts index 13e4890e8..cb4c0fe57 100644 --- a/angular/projects/catalyst-formly/src/public-api.ts +++ b/angular/projects/catalyst-formly/src/public-api.ts @@ -7,3 +7,4 @@ export * from './lib/formly/formly-textarea/formly-textarea.component'; export * from './lib/formly/formly-radio-group/formly-radio-group.component'; export * from './lib/formly/formly-datepicker/formly-datepicker.component'; export * from './lib/formly/formly-select/formly-select.component'; +export * from './lib/formly/formly-date/formly-date.component';