TypeHandler.js 364 B

1234567891011121314151617
  1. import Library from 'trapilib/dist/lib';
  2. import Editors from './index.js';
  3. let Types = Library.DataTypes.Types;
  4. export default function(Type) {
  5. switch(Type.type) {
  6. case Types.Text:
  7. if(Type.isColor)
  8. return Editors.ColorEditor;
  9. return Editors.TextEditor;
  10. case Types.Number:
  11. return Editors.Numbers;
  12. default:
  13. return Editors.TextEditor;
  14. }
  15. }