|
1 | | -import { ComponentFactory } from 'redux-autoform-utils'; |
2 | | -import { registerBaseComponents } from './helper/BootstrapComponentFactoryHelper'; |
| 1 | +import ComponentFactory from 'redux-autoform-utils/lib/factory/ComponentFactory'; |
| 2 | +import TextBox from '../components/fieldComponents/TextBox'; |
| 3 | +import Select from '../components/fieldComponents/Select'; |
| 4 | +import TextArea from '../components/fieldComponents/TextArea'; |
| 5 | +import Group from '../components/groupComponents/Group'; |
| 6 | +import ArrayContainer from '../components/fieldComponents/ArrayContainer'; |
| 7 | +import DateTimePicker from '../components/fieldComponents/DateTimePicker'; |
| 8 | +import Lookup from '../components/fieldComponents/Lookup'; |
| 9 | +import Static from '../components/fieldComponents/Static'; |
| 10 | +import FieldGroup from '../components/fieldComponents/FieldGroup'; |
| 11 | +import Checkbox from '../components/fieldComponents/CheckBox'; |
| 12 | +import Radio from '../components/fieldComponents/Radio'; |
3 | 13 |
|
4 | 14 | class BootstrapFactory extends ComponentFactory { |
5 | | - |
6 | 15 | constructor(config) { |
7 | 16 | super(); |
8 | | - registerBaseComponents(this); |
| 17 | + this.setBaseComponents(); |
9 | 18 | this.setDefaultConfiguration(config); |
10 | | - |
11 | 19 | } |
| 20 | + |
| 21 | + setBaseComponents = () => { |
| 22 | + this.registerFieldComponent('TextBox', ['string', 'int', 'float', 'datetime', 'date', 'time'], TextBox); |
| 23 | + this.registerFieldComponent('Select', ['string'], Select); |
| 24 | + this.registerFieldComponent('Radio', ['string'], Radio); |
| 25 | + this.registerFieldComponent('Lookup', ['string'], Lookup); |
| 26 | + this.registerFieldComponent('TextArea', ['string'], TextArea); |
| 27 | + this.registerFieldComponent('ArrayContainer', ['array'], ArrayContainer); |
| 28 | + this.registerFieldComponent('DateTimePicker', ['datetime', 'date', 'time'], DateTimePicker); |
| 29 | + this.registerFieldComponent('Checkbox', ['bool'], Checkbox); |
| 30 | + this.registerFieldComponent('Static', ['string', 'int', 'float', 'datetime', 'date', 'time', 'bool'], Static); |
| 31 | + this.registerFieldComponent('FieldGroup', ['group'], FieldGroup); |
12 | 32 |
|
| 33 | + this.registerGroupComponent('Group', Group); |
| 34 | + }; |
| 35 | + |
13 | 36 | setDefaultConfiguration = (config) => { |
14 | 37 | this.setDefaultFieldComponents(config); |
15 | 38 | this.setDefaultGroupComponent('Group'); |
16 | | - } |
| 39 | + }; |
17 | 40 |
|
18 | 41 | static createComponentFactory(type) { |
19 | 42 | switch (type) { |
|
0 commit comments