-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: custom formio components not rendering (#1162)
* add formio render custom component fix * remove comment * remove required
- Loading branch information
1 parent
8369ab0
commit 0c54757
Showing
5 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<any> { | ||
@Input() public value: string; | ||
@Input() public disabled = false; | ||
@Input() public required = false; | ||
@Output() public valueChange = new EventEmitter<any>(); | ||
} |
22 changes: 22 additions & 0 deletions
22
projects/valtimo/components/src/lib/components/form-io/form-io-dummy/dummy.formio.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters