diff --git a/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.component.ts b/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.component.ts new file mode 100644 index 000000000..5b39db96a --- /dev/null +++ b/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.component.ts @@ -0,0 +1,13 @@ +import {Component, EventEmitter, Input, Output} from '@angular/core'; +import {FormioCustomComponent} from '../../../modules'; + +@Component({ + selector: 'valtimo-dummy', + template: '', +}) +export class FormioDummyComponent implements FormioCustomComponent { + @Input() public value: string; + @Input() public disabled = false; + @Input() public required = false; + @Output() public valueChange = new EventEmitter(); +} diff --git a/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.formio.ts b/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.formio.ts new file mode 100644 index 000000000..0c46172ca --- /dev/null +++ b/projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.formio.ts @@ -0,0 +1,22 @@ +import {Injector} from '@angular/core'; +import {FormioCustomComponentInfo, registerCustomFormioComponent} from '../../../modules'; +import {FormioDummyComponent} from './dummy.component'; + +const COMPONENT_OPTIONS: FormioCustomComponentInfo = { + type: 'dummy', + selector: 'valtimo-dummy', + title: 'Dummy', + group: 'none', + icon: 'bank', + schema: { + hidden: true, + label: 'Dummy component', + key: 'dummy', + hideLabel: false, + tableView: true, + }, +}; + +export function enableCustomFormioComponents(injector: Injector) { + registerCustomFormioComponent(COMPONENT_OPTIONS, FormioDummyComponent, injector); +} diff --git a/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts b/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts index edd9ca6d4..95fbe5d96 100644 --- a/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts +++ b/projects/valtimo/components/src/lib/components/form-io/form-io.module.ts @@ -33,6 +33,7 @@ import {ConfigService} from '@valtimo/config'; import {FormIoIbanComponent} from './form-io-iban/iban.component'; import {ReactiveFormsModule} from '@angular/forms'; import {FormioValueResolverSelectorComponent} from './formio-value-resolver-selector/formio-value-resolver-selector.component'; +import {FormioDummyComponent} from './form-io-dummy/dummy.component'; @NgModule({ imports: [ @@ -53,6 +54,7 @@ import {FormioValueResolverSelectorComponent} from './formio-value-resolver-sele FormIoUploaderComponent, FormIoCurrentUserComponent, FormIoIbanComponent, + FormioDummyComponent, ], exports: [ FormioComponent, @@ -60,6 +62,7 @@ import {FormioValueResolverSelectorComponent} from './formio-value-resolver-sele FormIoUploaderComponent, FormIoCurrentUserComponent, FormIoIbanComponent, + FormioDummyComponent, ], providers: [ FormIoDomService, diff --git a/projects/valtimo/components/src/public_api.ts b/projects/valtimo/components/src/public_api.ts index 1f7c1018c..b95d5740c 100644 --- a/projects/valtimo/components/src/public_api.ts +++ b/projects/valtimo/components/src/public_api.ts @@ -262,3 +262,6 @@ export * from './lib/components/value-path-selector/value-path-selector.componen // formio value resoler selector export * from './lib/components/form-io/formio-value-resolver-selector/formio-value-resolver-selector.formio'; export * from './lib/components/form-io/formio-value-resolver-selector/formio-value-resolver-selector.component'; +// formio dummy +export * from './lib/components/form-io/form-io-dummy/dummy.component'; +export * from './lib/components/form-io/form-io-dummy/dummy.formio'; diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d1dc1a950..fa8349cb0 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -27,6 +27,7 @@ import {SecurityModule} from '@valtimo/security'; import { BpmnJsDiagramModule, CardModule, + enableCustomFormioComponents, FormIoModule, MenuModule, registerFormioCurrentUserComponent, @@ -283,6 +284,7 @@ export function tabsFactory() { }) export class AppModule { constructor(injector: Injector) { + enableCustomFormioComponents(injector); registerFormioCurrentUserComponent(injector); registerFormioUploadComponent(injector); registerFormioFileSelectorComponent(injector);