2016-09-11 23:08:18 +02:00
|
|
|
import registry from '../lib/registry';
|
2016-07-13 17:19:26 -03:00
|
|
|
import UnknownControl from './Widgets/UnknownControl';
|
|
|
|
import UnknownPreview from './Widgets/UnknownPreview';
|
|
|
|
import StringControl from './Widgets/StringControl';
|
|
|
|
import StringPreview from './Widgets/StringPreview';
|
2016-10-28 04:51:37 +02:00
|
|
|
import NumberControl from './Widgets/NumberControl';
|
|
|
|
import NumberPreview from './Widgets/NumberPreview';
|
2016-10-21 20:42:14 -02:00
|
|
|
import ListControl from './Widgets/ListControl';
|
|
|
|
import ListPreview from './Widgets/ListPreview';
|
2016-09-12 11:14:21 +02:00
|
|
|
import TextControl from './Widgets/TextControl';
|
|
|
|
import TextPreview from './Widgets/TextPreview';
|
2017-06-23 14:42:40 -04:00
|
|
|
import MarkdownControl from './Widgets/Markdown/MarkdownControl';
|
|
|
|
import MarkdownPreview from './Widgets/Markdown/MarkdownPreview';
|
2016-07-13 17:19:26 -03:00
|
|
|
import ImageControl from './Widgets/ImageControl';
|
|
|
|
import ImagePreview from './Widgets/ImagePreview';
|
2017-01-10 22:23:22 -02:00
|
|
|
import FileControl from './Widgets/FileControl';
|
|
|
|
import FilePreview from './Widgets/FilePreview';
|
2016-11-17 04:08:37 -08:00
|
|
|
import DateControl from './Widgets/DateControl';
|
|
|
|
import DatePreview from './Widgets/DatePreview';
|
2016-09-11 23:08:18 +02:00
|
|
|
import DateTimeControl from './Widgets/DateTimeControl';
|
|
|
|
import DateTimePreview from './Widgets/DateTimePreview';
|
2016-11-17 04:08:37 -08:00
|
|
|
import SelectControl from './Widgets/SelectControl';
|
|
|
|
import SelectPreview from './Widgets/SelectPreview';
|
2016-10-28 04:51:37 +02:00
|
|
|
import ObjectControl from './Widgets/ObjectControl';
|
|
|
|
import ObjectPreview from './Widgets/ObjectPreview';
|
2016-12-07 15:44:07 -02:00
|
|
|
import RelationControl from './Widgets/RelationControl';
|
|
|
|
import RelationPreview from './Widgets/RelationPreview';
|
2017-05-18 10:37:41 -04:00
|
|
|
import BooleanControl from './Widgets/BooleanControl';
|
2016-12-07 15:44:07 -02:00
|
|
|
|
2016-05-30 16:55:32 -07:00
|
|
|
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('string', StringControl, StringPreview);
|
2016-09-12 11:14:21 +02:00
|
|
|
registry.registerWidget('text', TextControl, TextPreview);
|
2016-10-28 04:51:37 +02:00
|
|
|
registry.registerWidget('number', NumberControl, NumberPreview);
|
2016-10-21 20:42:14 -02:00
|
|
|
registry.registerWidget('list', ListControl, ListPreview);
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('markdown', MarkdownControl, MarkdownPreview);
|
|
|
|
registry.registerWidget('image', ImageControl, ImagePreview);
|
2017-01-10 22:23:22 -02:00
|
|
|
registry.registerWidget('file', FileControl, FilePreview);
|
2016-11-17 04:08:37 -08:00
|
|
|
registry.registerWidget('date', DateControl, DatePreview);
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('datetime', DateTimeControl, DateTimePreview);
|
2016-11-17 04:08:37 -08:00
|
|
|
registry.registerWidget('select', SelectControl, SelectPreview);
|
2016-10-28 04:51:37 +02:00
|
|
|
registry.registerWidget('object', ObjectControl, ObjectPreview);
|
2016-12-07 15:44:07 -02:00
|
|
|
registry.registerWidget('relation', RelationControl, RelationPreview);
|
2017-05-18 10:37:41 -04:00
|
|
|
registry.registerWidget('boolean', BooleanControl);
|
2016-10-26 19:51:50 +02:00
|
|
|
registry.registerWidget('unknown', UnknownControl, UnknownPreview);
|
2016-05-30 16:55:32 -07:00
|
|
|
|
2016-11-17 04:08:37 -08:00
|
|
|
export function resolveWidget(name) { // eslint-disable-line
|
|
|
|
return registry.getWidget(name || 'string') || registry.getWidget('unknown');
|
2016-09-11 23:08:18 +02:00
|
|
|
}
|