123456789101112131415161718192021222324 |
- import Library from 'trapilib/dist/lib';
- import Editors from './index.js';
- let Types = Library.DataTypes.Types;
- export default function(Type) {
- switch(Type.type) {
- case Types.Array:
- return Editors.FormEditor;
- case Types.Text:
- if(Type.isColor)
- return Editors.ColorEditor;
- return Editors.TextEditor;
- case Types.Number:
- case Types.Integer:
- return Editors.Numbers;
- case Types.Boolean:
- return Editors.BoolEditor;
- case Types.Action:
- return Editors.ActionEditor;
- default:
- return Editors.TextEditor;
- }
- }
|