Skip to content

Releases: gcanti/tcomb-form-native

v0.3.2

03 Dec 17:03
Compare
Choose a tag to compare
  • Polish
    • Map value to enum, fix #56

v0.3.1

25 Nov 16:54
Compare
Choose a tag to compare
  • New Feature

    • default templates are now split in standalone files, so you can cherry pick which ones to load
    • ability to customize templates, stylesheets and i18n without loading the default ones (improved docs)
    • porting of tcomb-form getValidationErrorMessage feature
    var Age = t.refinement(t.Number, function (n) { return n >= 18; });
    
    // if you define a getValidationErrorMessage function, it will be called on validation errors
    Age.getValidationErrorMessage = function (value) {
      return 'bad age ' + value;
    };
    
    var Schema = t.struct({
      age: Age
    });
    • add support for nested forms, fix #43

      • add proper support for struct refinements
      • add support for struct label (bootstrap templates)

      Example

      var Account = t.struct({
        email: t.String,
        profile: t.struct({
          name: t.String,
          surname: t.String
        })
      });
      
      var options = {
        label: <Text style={{fontSize: 30}}>Account</Text>,
        fields: {
          profile: {
            label: <Text style={{fontSize: 20}}>Profile</Text>
          }
        }
      };
      • add support for struct error (bootstrap templates)
  • Experimental

    • add support for maybe structs

    Example

    var Account = t.struct({
      email: t.String,
      profile: t.maybe(t.struct({
        name: t.String,
        surname: t.String
      }))
    });
    
    // user enters email: 'aaa', => result { email: 'aaa', profile: null }
    // user enters email: 'aaa', name: 'bbb' => validation error for surname
    // user enters email: 'aaa', name: 'bbb', surname: 'ccc' => result { email: 'aaa', profile: { name: 'bbb', surname: 'ccc' } }

v0.3.0

04 Nov 17:23
Compare
Choose a tag to compare
  • Breaking Change

    • Upgrade tcomb-validation to v2, fix #68

      Do not worry: the migration path should be seamless since the major version bump was caused by dropping the support for bower (i.e. types and combinators are the same).
      Just notice that the short type alias (t.Str, t.Num, ...) are deprecated in favour of the long ones (t.String, t.Number, ...) and the subtype combinator has now a more descriptive alias refinement.

  • Bug Fix

    • amend struct onChange, fix #70

    the previous code would lead to bugs regarding error messages when the
    type is a subtype of a struct, gcanti/tcomb-form#235

  • Internal

    • move peer dependencies to dependencies

v0.2.8

21 Oct 16:31
Compare
Choose a tag to compare
  • New Feature
    • Pass in config options to custom template through options, fix #63

v0.2.7

21 Sep 07:53
Compare
Choose a tag to compare
  • Internal
    • support react-native versions greater than 0.9

v0.2.6

30 Aug 08:15
Compare
Choose a tag to compare
  • Internal
    • pin react-native version to 0.9

v0.2.5

24 Aug 13:43
Compare
Choose a tag to compare
  • New Feature
    • Add required field to i18n, fix #46
  • Internal
    • upgrade to react-native v0.9

v0.2.4

29 Jul 14:56
Compare
Choose a tag to compare
  • Bug Fix
    • the default date for DatePicker is reflected in the UI but not in the getValue() API #42

v0.2.3

23 Jul 16:24
Compare
Choose a tag to compare
  • New Feature
    • add auto option override for specific field #41

v0.2.2

26 Jun 12:05
Compare
Choose a tag to compare
  • Internal
    • Recommend making peerDependencies more flexible #30