Code Monkey home page Code Monkey logo

json-forms's Introduction

json-forms

bower version Build Status

org.brutusin:json-forms is a javascript library that generates HTML forms from JSON Schemas.

Status

I am currently not having time to maintain this project, so first of all my apologies if some issues have been unresponded. Branch v2 contains a completely new rearchitecture of the project, that I started several months ago but left unfinished. If someone is interested in continuing my work I will be happy to guide them


Table of Contents:

Features

  • Dynamic schemas support
  • Extensible and customizable
  • No external libraries needed
  • Validation
  • Multiple forms per document supported

Usage

Include the main library dependencies:

<link rel="stylesheet" href='dist/css/brutusin-json-forms.min.css'/>
<script src="dist/js/brutusin-json-forms.min.js"></script>

Optionally, include the bootstrap extension (requires bootstrap):

<script src="dist/js/brutusin-json-forms-bootstrap.min.js"></script>

Create the javascript BrutusinForms instance, schema being a javascript object representing the schema structure:

var schema = {"type": "boolean"}
var BrutusinForms = brutusin["json-forms"];
var bf = BrutusinForms.create(schema);

And finally render the form inside a container with optional preloaded JSON initial data, data:

var container = document.getElementById('container');
bf.render(container, data);

Demo

demo http://brutusin.org/json-forms/

Dynamic schemas

This library supports dynamic schemas, that is, subschemas that can change depending on the value of other parts of the data.

This lets creating dynamic forms that vary their shape depending on the values entered by the user. This is extremely useful for big autogenerated schemas, that aggregates lots of subschemas and have functional bindings, given that it allows to show the user a simpler, non-error-prone form, also avoiding asking for unneeded data.

Dynamic schemas are built upon two main blocks:

dependsOn schema extension

Dynamic schema resolution

API

Static members:

Member Description
BrutusinForms.create(schema) BrutusinForms factory method
BrutusinForms.addDecorator(f(htmlElement, schema)) Register a callback function to be notified after an HTML element has been rendered (passed as parameter). See brutusin-json-forms-bootstrap.js for an example of bootstrap decorator.
BrutusinForms.postRender(instance) Callback function to be notified after a BrutusinForms instance has been rendered (passed as parameter)
BrutusinForms.instances Array containing all the BrutusinForms instances created in the document by the factory method.

Instance members:

Member Description
bf.render(container, data) Renders the form inside the the container, with the specified data preloaded
bf.validate() Returns true if the input data entered by the user passes validation
bf.getData() Returns the javascript object with the data entered by the user
bf.schemaResolver(schemaIdArray, data) Schema resolver for dynamic schemas

CDN

http://www.jsdelivr.com/projects/brutusin.json-forms

Support bugs and requests

https://github.com/brutusin/json-forms/issues

Authors

Contributions are always welcome and greatly appreciated!

License

Apache License, Version 2.0

json-forms's People

Contributors

dnault avatar e110c0 avatar felix-last avatar fuhrysteve avatar graciano avatar idelvall avatar madsmtm avatar nagarajanchinnasamy avatar opleban avatar shadow-identity avatar vincentmorneau avatar volt220 avatar zamicol avatar zevero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

json-forms's Issues

Some suggestions about Brutusin json form

Hi guys,
I recently found your very great works, Json form, it is so flexible and easy to use.
It is very suitable for me, but I think if something will be enhanced(or just I don't know how to use it correctly), it could be much flexible. Many thanks to Mr. Ignacio del Valle Alles and all that contribute to the project.

  1. More clear documents to be supported, I will offer some code as example I guess.
  2. How to externally set a value by column on Schema Resolver module and customized error message to a certain column of form properties and user defined validation function on submition?
    Ex.
bf.schemaResolver = function (names, data, cb) {
    var schemas = new Object();
    var schema = new Object();
    if (data.user_password1 != '' && data.user_password2 != '' && data.user_password1 === data.user_password2) {
    } else {
        BrutusinForms.user_password.addError("Re-enter password, please!"); // Sample
    }
	schema.title = "Confirm Password";
	schema.type = "string";
	schema.value = data.user_password1; // Failed
	schema.readOnly = true; // Failed
	schema.required = true; // Failed
	schema.value = "TEST"; // Failed        
	schemas[names] = schema;
	setTimeout(function(){cb(schemas)},100); // in order to show asynchrony
};    
  1. I made some modification to your code, and I feedback to you as the attachment.
    a. Seperate each enum item to {'value':'dog', 'text': 'Dog'}
    b. Some multilingual issues.
    c. provide zh_CN(Simplified Chinese) and zh_TW (Traditional Chinese) language files.
    brutusin-json-forms-bootstrap.js.txt
    brutusin-json-forms-bootstrap.js.txt
    brutusin-json-forms-lang-en_US.js.txt
    brutusin-json-forms-lang-zh_TW.js.txt
    brutusin-json-forms-lang-zh_CN.js.txt
    brutusin-json-forms.js.txt

Enum support for array type

Currently this schema displays empty rows

traits: {
  type: 'array',
  items: {
    enum: [ 'gate', 'video', 'automated' ]
  },
  uniqueItems: true
},
facilities: {
  type: 'array',
  items: {
    enum: [ 'carwash', 'charging' ]
  },
  uniqueItems: true
},

how to style the form?

I want to style the form using bootstrap form style, the out of the box form is pretty standard and not styled. I want to make it similar to the demo version, how can I style it?

Thanks

Required Fields (draft 3 vs draft 4)

First, thank you so much for this project. It is so much simpler than the alternatives like json-schema-form and others that all use angular and react (why?).

I noticed one thing about required fields, you have them listed as a boolean property within the field.

image

JSON Schema draft 4 has the required property listed as an array, after the objects themselves. Example:

image

Are you following JSON Schema draft 3? Any plan to move to the current draft 4?

NPM and Bower Submission

Thank you for this excellent library. What about adding module loading support and publishing it to npm and bower?

Textarea input type

How can I use a normal HTML textarea in my form? In the schema I can use the "any" type and it renders a tertarea but the value part is JSON and not string.

Return multi array

Hello, what you need to create a scheme to return a json?

{
"type": [
        "small", 
        "big"
    ]
}

Angular 2.0 Integration

Could you please provide a way to integrate with Angular 2.0. Basically our requirement is to include the dynamic form only for few pages and static for few. Could you please let us know how we can leverage this using the json-forms

Static Property

Can we have support to add static properties in the schema such that it's replicated into the data.

// schema.json
// code before this
    "someKey": {
      "type": "array",
      "items": {
         "someInnerKey": {
         },
         "someStaticKey": {
         },
      },
    },
// code after this

And the resulting data would look like this, where the contents of someStaticKey is the same for all array elements of someKey.

// data before this
    "someKey": [
         {
           "someInnerKey": {
             // InnerKeyData1
           },
           "someStaticKey": {
             // StaticData
           }, 
         },
         {
           "someInnerKey": {
             // InnerKeyData2
           },
           "someStaticKey": {
             // StaticData
           }, 
         },
    ],
// data after this

Form with list of dynamic combo-box inputs, showing input instead of combo

Current form's schema:

{"type": "object","name": "OPHTHALMOgenics Pipeline","description": "Pipeline aimed at helping the molecular diagnosis of cancer. It is aimed specifically at identifying all the genetic alterations that may influence susceptibility or resistance to approved drugs for clinical use . Pipeline analyzes DNA sequence of the genes and the presence/absence of clinically relevant rearrangements specified in selected probe.","properties": {"Parameters":{"description": "Pipeline execution global parameters","type": "object","properties": {"referenceGenomeVersion":{"description": ""Reference genome" (http://en.wikipedia.org/wiki/Reference_genome) version","required": true ,"title": "Reference Genome Version","default": "human/19/GRCh37","type":"string","enum":["human/19/GRCh37","human/19/LifeTechnologies","human/19/contigs","human/GRCh38/chr_contigs","human/GRCh38/chr_no_contigs","human/GRCh38/contigs","human/GRCh38/no_contigs","human/RNAseq/human/19/Ensembl/GRCh37/Annotation/NoPseudogenes","human/RNAseq/human/19/Ensembl/GRCh37/Annotation/SelectedBiotypes","human/RNAseq/human/19/Ensembl/GRCh37/Annotation/rRNA","human/RNAseq/human/19/Ensembl/GRCh37/Sequence/Bowtie2Index"]},"adapterSequences":{"description": "Adapter sequences used for DNA library generation in Trimmomatic (http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf) (fastaWithAdaptersEtc option)","required": true ,"title": "Adapter Sequences","default": "../param/adapters/Illumina/HiSeq-MiSeq/TruSeq3-PE.fa","type":"string","format":"dreampipe-file"},"reportProbeVersion":{"description": "Probe version (enrichment probes) used in bam statistics, callability and distance to probe annotation","required": false ,"title": "Report Probe Version","default": "OPHTHALMOgenics/V1-1","type":"string","enum":["OPHTHALMOgenics/V1","OPHTHALMOgenics/V1-1","OPHTHALMOgenics/V2_design","OPHTHALMOgenics/V2_report"]},"ensemblVersion":{"description": "Ensembl (http://www.ensembl.org/index.html) version","required": false ,"title": "Ensembl Version","default": "human/75-4","type":"string","enum":["ensembl/ensembl/human/75-2","ensembl/ensembl/human/79","ensembl/ensembl/human/BRCA1.BRCA2.TP53.v75","ensembl/human/75-2","ensembl/human/75-3","ensembl/human/75-4","ensembl/human/79","ensembl/human/BRCA1.BRCA2.TP53.v75","ensembl/human/BRCA1.BRCA2.TP53.v75-2","ensembl/mus-musculus/79-1","ensembl/saccharomyces-cerevisiae/75","human/72","human/75","human/75-1","human/75-2","human/75-3","human/75-4","human/79","human/BRCA1.BRCA2.TP53/V75_1","human/BRCA1.BRCA2.TP53/V75_2","mus-musculus/79","saccharomyces-cerevisiae/75"]},"distanceToProbeVersions":{"description": "Versions of the probes, used in the annotation step, for the calculation of the distance to probe","required": false ,"title": "Distance To Probe Versions","default": ["OPHTHALMOgenics/V1-1"],"type":"array","items":{"type":"string"},"enum":["Agilent/Agilent50MB","Agilent/Agilent50MB_extended200","Agilent/AgilentV4","Agilent/AgilentV4_UTR","Agilent/AgilentV5","Agilent/AgilentV5_UTR","Agilent/Agilent_SureSelect_ClinicalExome","Agilent/Agilent_humanallexon_V2_merged_extended200","Agilent/Agilent_humanallexon_V2_merged_nochr/data","Alejandro/data","AmpliSeqExome","HUCA/ITAV/V1","Haloplex_Clinic_v072013","ICGC_exome","ICGC_exome_extended200","IlluminaConfidentRegions","Illumina_ConfidentRegions_TruSight_One_V1_3","Illumina_TruSight_One/V1_1","Illumina_TruSight_One/V1_2","Illumina_TruSight_One/V1_3","Mouse_all_Exome/V1","NIST","Nimblegen/SeqCapExome/V3","OPHTHALMOgenics/V1","OPHTHALMOgenics/V1-1","OPHTHALMOgenics/V2_design","OPHTHALMOgenics/V2_report","OTOgenics/Homologs/V1","OTOgenics/OTOgenics/V1_design","OTOgenics/OTOgenics/V1_report","OTOgenics/OTOgenics/V2_design","OTOgenics/OTOgenics/V2_report","Oncogenics/Easy/V1","Oncogenics/Easy/V1_Homologs","Oncogenics/Easy/V1_covered","Oncogenics/Easy/V2_covered","Oncogenics/Easy/V5","Oncogenics/Germline/V4","Oncogenics/Germline/V5","Oncogenics/Germline/V5_report","Oncogenics/Homologous/Easy/V1","Oncogenics/Homologous/Germline/V1","Oncogenics/Oncogenics/V1_covered","Oncogenics/Oncogenics/V2_covered","Oncogenics/Oncogenics/V3_covered","Oncogenics/Oncogenics/V3_extended100","Oncogenics/Oncogenics/V3_extended50","Oncogenics/Oncogenics/V3_merged","Oncogenics/Oncogenics/V4_covered","Oncogenics/Oncogenics/V5","PMS2","Tusie_transcripts_BRCA1_BRCA2_TP53_EXTENDED/V1_0","colon_genes","dbSNP/144","nimblegen_SeqCap_EZ_Exome_v2_tiled","nimblegen_SeqCap_EZ_Exome_v2_tiled_extended200","uniovi/ONCOEPIC/V1"]},"positionGenomicDatabases":{"description": "Genomic databases used in annotation by position","required": false ,"title": "Position Genomic Databases","default": ["1000genomes/phase3-2","dbnsfp/3.0-1","cosmic/71-2","dbscSNV/20150107-1","dbsnp/all/142-2","dbsnp/clinvar/20150929-1","esp/6500-3","exac/0.3-2","hgmd/2015.1-3","icgc/19-1"],"type":"array","items":{"type":"string"},"enum":["1000genomes/phase3-1","1000genomes/phase3-2","bic/hg19","cll/20140217-3","cosmic/68-1","cosmic/71-1","cosmic/71-2","dbnsfp/2.8-2","dbnsfp/2.9-1","dbnsfp/3.0-1","dbscSNV/20150107-1","dbsnp/all/138-1","dbsnp/all/141-1","dbsnp/all/142-1","dbsnp/all/142-2","dbsnp/all/144-1","dbsnp/clinvar/20140303-1","dbsnp/clinvar/20150115-1","dbsnp/clinvar/20150305-1","dbsnp/clinvar/20150305-2","dbsnp/clinvar/20150629-1","dbsnp/clinvar/20150901-1","dbsnp/clinvar/20150929-1","dbsnp/common/137-1","dbsnp/oncogenicsV4/20150525-1","dgva/20140603-1","dlbcl-shm/20121012-3","esp/6500-1","esp/6500-2","esp/6500-3","exac/0.3-1","exac/0.3-2","hgmd/2014.1-2","hgmd/2014.1-3","hgmd/2015-2","hgmd/2015.1-3","icgc/17-1","icgc/18-1","icgc/19-1","repeat-masker/20140516-1","telcent/hg19-1","telcent/saccharomyces-cerevisiae/R64-1-1"]},"overlappingGenomicDatabases":{"description": "Genomic databases used in annotation by overlapping","required": false ,"title": "Overlapping Genomic Databases","default": ["pfam/20140516-1"],"type":"array","items":{"type":"string"},"enum":["1000genomes/phase3-1","bic/hg19","cll/20140217-3","cosmic/68-1","cosmic/71-1","dbnsfp/2.8-2","dbnsfp/2.9-1","dbsnp/all/138-1","dbsnp/all/141-1","dbsnp/all/142-1","dbsnp/all/144-1","dbsnp/clinvar/20140303-1","dbsnp/clinvar/20150115-1","dbsnp/clinvar/20150305-1","dbsnp/clinvar/20150305-2","dbsnp/clinvar/20150629-1","dbsnp/clinvar/20150901-1","dbsnp/common/137-1","dbsnp/oncogenicsV4/20150525-1","dgva/20140603-1","dlbcl-shm/20121012-3","esp/6500-1","esp/6500-2","exac/0.3-1","hgmd/2014.1-2","hgmd/2014.1-3","hgmd/2015-2","icgc/17-1","icgc/18-1","pfam/20140516-1","repeat-masker/20140516-1","telcent/hg19-1","telcent/saccharomyces-cerevisiae/R64-1-1"]},"minVarFreq":{"description": "Minimun mutation frequency (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Min Var Freq","default": 0.15,"type":"number"},"md5ChecksumsFile":{"description": "One file containing all checksums for all input fastqs","required": false ,"title": "Md 5 Checksums File","type":"string","format":"dreampipe-file"},"threads":{"description": "Number of threads used in trimming and alignment","required": false ,"title": "Threads","default": 4,"type":"integer"},"mismatchesThreshold":{"description": "Maximum mismatches allowed in adapter in Trimmomatic (http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf) (seedMismatches option)","required": true ,"title": "Mismatches Threshold","default": 3,"type":"integer"},"palindromeThreshold":{"description": "Match accuracy between adapter-ligated reads in Trimmomatic (http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf) (palindromeClipThreshold option)","required": true ,"title": "Palindrome Threshold","default": 30,"type":"integer"},"simpleThreshold":{"description": "Match accuracy between adapter and read in Trimmomatic (http://www.usadellab.org/cms/uploads/supplementary/Trimmomatic/TrimmomaticManual_V0.32.pdf) (simpleClipThreshold option)","required": true ,"title": "Simple Threshold","default": 10,"type":"integer"},"headCrop":{"description": "commons.trimming.PairedEndScriptTask.headCrop","required": true ,"title": "Head Crop","default": 0,"type":"integer"},"aligner":{"description": "Aligner to be used. Choose between Bowtie2 (http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#what-is-bowtie-2), BWA (http://bio-bwa.sourceforge.net/bwa.shtml) or BWA_MEM (http://bio-bwa.sourceforge.net/bwa.shtml). Default is BWA_MEM","required": true ,"title": "Aligner","default": "bwa_mem","type":"string","enum":["bowtie2","bwa","bwa_mem"]},"gapOpen":{"description": "Maximum number of gap opens for aln command in BWA (http://bio-bwa.sourceforge.net/bwa.shtml) (-o option)","required": true ,"title": "Gap Open","default": 1,"type":"integer"},"mismatch":{"description": "Mismatch penalty for aln command in BWA (http://bio-bwa.sourceforge.net/bwa.shtml) (-M option)","required": true ,"title": "Mismatch","default": 3,"type":"integer"},"distance":{"description": "Fraction of allowed mismatches if the value is float, or maximum mismatches allowed if the value is an integer for aln command in BWA (http://bio-bwa.sourceforge.net/bwa.shtml) (-n option)","required": true ,"title": "Distance","default": 0.04,"type":"number"},"trim":{"description": "Minimum base quality for read trimming for aln command in BWA (http://bio-bwa.sourceforge.net/bwa.shtml) (-q option)","required": true ,"title": "Trim","default": 0,"type":"integer"},"clippingPenalty":{"description": "When performing SW extension, BWA-MEM keeps track of the best score reaching the end of query. If this score is larger than the best SW score minus the clipping penalty, clipping will not be applied.","required": false ,"title": "Clipping Penalty","default": 5,"type":"integer"},"homologousProbe":{"description": "Probe to use in homologous variant calling","required": false ,"title": "Homologous Probe","type":"string","enum":["Agilent/Agilent50MB","Agilent/Agilent50MB_extended200","Agilent/AgilentV4","Agilent/AgilentV4_UTR","Agilent/AgilentV5","Agilent/AgilentV5_UTR","Agilent/Agilent_SureSelect_ClinicalExome","Agilent/Agilent_humanallexon_V2_merged_extended200","Agilent/Agilent_humanallexon_V2_merged_nochr/data","Alejandro/data","AmpliSeqExome","HUCA/ITAV/V1","Haloplex_Clinic_v072013","ICGC_exome","ICGC_exome_extended200","IlluminaConfidentRegions","Illumina_ConfidentRegions_TruSight_One_V1_3","Illumina_TruSight_One/V1_1","Illumina_TruSight_One/V1_2","Illumina_TruSight_One/V1_3","Mouse_all_Exome/V1","NIST","Nimblegen/SeqCapExome/V3","OPHTHALMOgenics/V1","OPHTHALMOgenics/V1-1","OPHTHALMOgenics/V2_design","OPHTHALMOgenics/V2_report","OTOgenics/Homologs/V1","OTOgenics/OTOgenics/V1_design","OTOgenics/OTOgenics/V1_report","OTOgenics/OTOgenics/V2_design","OTOgenics/OTOgenics/V2_report","Oncogenics/Easy/V1","Oncogenics/Easy/V1_Homologs","Oncogenics/Easy/V1_covered","Oncogenics/Easy/V2_covered","Oncogenics/Easy/V5","Oncogenics/Germline/V4","Oncogenics/Germline/V5","Oncogenics/Germline/V5_report","Oncogenics/Homologous/Easy/V1","Oncogenics/Homologous/Germline/V1","Oncogenics/Oncogenics/V1_covered","Oncogenics/Oncogenics/V2_covered","Oncogenics/Oncogenics/V3_covered","Oncogenics/Oncogenics/V3_extended100","Oncogenics/Oncogenics/V3_extended50","Oncogenics/Oncogenics/V3_merged","Oncogenics/Oncogenics/V4_covered","Oncogenics/Oncogenics/V5","PMS2","Tusie_transcripts_BRCA1_BRCA2_TP53_EXTENDED/V1_0","colon_genes","dbSNP/144","nimblegen_SeqCap_EZ_Exome_v2_tiled","nimblegen_SeqCap_EZ_Exome_v2_tiled_extended200","uniovi/ONCOEPIC/V1"]},"rpkmFiles":{"description": "Set of rpkm files that will be used as background to do cnv calling ","required": false ,"title": "Rpkm Files","type":"array","items":{"type":"string"},"enum":["background","background_wey","tusie_rpkm_50_67","tusie_rpkm_samples","tusie_rpkm_samples_0","tusie_rpkm_samples_filtered","tusie_rpkm_samples_filtered_orginal","tussie_rpkm_23_49_filtered","ADN105_S1_ADN106_S2_rpkm.txt","ADN107_S1_rpkm.txt","HCE-10.P45_rpkm.txt","HCE-11.P46_rpkm.txt","HCE-12.P47_rpkm.txt","HCE-13.P48_rpkm.txt","HCE-14.P55_rpkm.txt","HCE-15.P58_rpkm.txt","HCE-16.P61_rpkm.txt","HCE-17.P3_rpkm.txt","HCE-18.P42_rpkm.txt","HCE-19.P44_rpkm.txt","HCE-20.P49E_rpkm.txt","HCE-21.P56_rpkm.txt","HCE-22.P60_rpkm.txt","HCE-23_filtered_rpkm.txt","HCE-24_filtered_rpkm.txt","HCE-25_filtered_rpkm.txt","HCE-26_filtered_rpkm.txt","HCE-27_filtered_rpkm.txt","HCE-28_filtered_rpkm.txt","HCE-29_filtered_rpkm.txt","HCE-30_filtered_rpkm.txt","HCE-31_filtered_rpkm.txt","HCE-32_filtered_rpkm.txt","HCE-33_filtered_rpkm.txt","HCE-34_filtered_rpkm.txt","HCE-35_filtered_rpkm.txt","HCE-36_filtered_rpkm.txt","HCE-37_filtered_rpkm.txt","HCE-38_filtered_rpkm.txt","HCE-39_filtered_rpkm.txt","HCE-40_filtered_rpkm.txt","HCE-41_filtered_rpkm.txt","HCE-42_filtered_rpkm.txt","HCE-43_filtered_rpkm.txt","HCE-44_filtered_rpkm.txt","HCE-45_filtered_rpkm.txt","HCE-46_filtered_rpkm.txt","HCE-47_filtered_rpkm.txt","HCE-48_filtered_rpkm.txt","HCE-49_filtered_rpkm.txt","HCE-50_rpkm.txt","HCE-51_rpkm.txt","HCE-52_rpkm.txt","HCE-53_rpkm.txt","HCE-54_rpkm.txt","HCE-55_rpkm.txt","HCE-56_rpkm.txt","HCE-57_rpkm.txt","HCE-58_rpkm.txt","HCE-59_rpkm.txt","HCE-6.P61_rpkm.txt","HCE-60_rpkm.txt","HCE-61_rpkm.txt","HCE-62_rpkm.txt","HCE-63_rpkm.txt","HCE-64_rpkm.txt","HCE-65_rpkm.txt","HCE-66_rpkm.txt","HCE-67_rpkm.txt","HCE-8.P4_rpkm.txt","HCE-9.P43_rpkm.txt","ONCOE.001_P01105_S1_rpkm.txt","ONCOE.001_P01105_filtered.txt","ONCOE.002_P01154_S1_rpkm.txt","ONCOE.002_P01154_filtered.txt","ONCOE.003_P01243_filtered.txt","ONCOE.004_P01273_filtered.txt","ONCOE.005_P01331_filtered.txt","ONCOE.006_P01351_filtered.txt","ONCOG.001_P01209_rpkm.txt","ONCOG.002_P01210_rpkm.txt","ONCOG.003_P01211_rpkm.txt","ONCOG.004_P01212_rpkm.txt","ONCOG.005_P01255_rpkm.txt","ONCOG.006_P00713_rpkm.txt","ONCOG.007_P00303_rpkm.txt","ONCOG.008_P00993_rpkm.txt","ONCOG.009_P01352.txt","ONCOG.009_P01352_rpkm.txt","ONCOG.010_P01256_filtered.txt","ONCOG.011_P01427_filtered.txt","ONCOG.012_P01440_filtered.txt","ONCOG.013_P01477_filtered.txt","P00303_rpkm.txt","P00492_S1_rpkm.txt","P00713_rpkm.txt","P00993_rpkm.txt","P01105_S1_rpkm.txt","P01154_S1_rpkm.txt","P01209_rpkm.txt","P01210_rpkm.txt","P01211_rpkm.txt","P01212_rpkm.txt","P01255_P01243_rpkm.txt","P01352.txt","pool_ADN105_S1_ADN106_S2_rpkm.txt","snp_array_ADN107_S1_rpkm.txt","snp_array_P00492_S1_rpkm.txt"]},"svd":{"description": "Number of SVD components to remove (zero). See below for more on this subject.","required": true ,"title": "Svd","default": 2,"type":"integer"},"threshold":{"description": "Threshold used in cnvs calling","required": true ,"title": "Threshold","default": 1,"type":"number"},"designProbeVersion":{"description": "Only if experiments design was ran with a different probe than the reports one, then this will be used in bams statistics, and annotation by distance to probe ","required": false ,"title": "Design Probe Version","default": "","type":"string","enum":["Agilent/Agilent50MB","Agilent/Agilent50MB_extended200","Agilent/AgilentV4","Agilent/AgilentV4_UTR","Agilent/AgilentV5","Agilent/AgilentV5_UTR","Agilent/Agilent_SureSelect_ClinicalExome","Agilent/Agilent_humanallexon_V2_merged_extended200","Agilent/Agilent_humanallexon_V2_merged_nochr/data","Alejandro/data","AmpliSeqExome","HUCA/ITAV/V1","Haloplex_Clinic_v072013","ICGC_exome","ICGC_exome_extended200","IlluminaConfidentRegions","Illumina_ConfidentRegions_TruSight_One_V1_3","Illumina_TruSight_One/V1_1","Illumina_TruSight_One/V1_2","Illumina_TruSight_One/V1_3","Mouse_all_Exome/V1","NIST","Nimblegen/SeqCapExome/V3","OPHTHALMOgenics/V1","OPHTHALMOgenics/V1-1","OPHTHALMOgenics/V2_design","OPHTHALMOgenics/V2_report","OTOgenics/Homologs/V1","OTOgenics/OTOgenics/V1_design","OTOgenics/OTOgenics/V1_report","OTOgenics/OTOgenics/V2_design","OTOgenics/OTOgenics/V2_report","Oncogenics/Easy/V1","Oncogenics/Easy/V1_Homologs","Oncogenics/Easy/V1_covered","Oncogenics/Easy/V2_covered","Oncogenics/Easy/V5","Oncogenics/Germline/V4","Oncogenics/Germline/V5","Oncogenics/Germline/V5_report","Oncogenics/Homologous/Easy/V1","Oncogenics/Homologous/Germline/V1","Oncogenics/Oncogenics/V1_covered","Oncogenics/Oncogenics/V2_covered","Oncogenics/Oncogenics/V3_covered","Oncogenics/Oncogenics/V3_extended100","Oncogenics/Oncogenics/V3_extended50","Oncogenics/Oncogenics/V3_merged","Oncogenics/Oncogenics/V4_covered","Oncogenics/Oncogenics/V5","PMS2","Tusie_transcripts_BRCA1_BRCA2_TP53_EXTENDED/V1_0","colon_genes","dbSNP/144","nimblegen_SeqCap_EZ_Exome_v2_tiled","nimblegen_SeqCap_EZ_Exome_v2_tiled_extended200","uniovi/ONCOEPIC/V1"]},"probeFile":{"description": "Other probes BED (http://www.ensembl.org/info/website/upload/bed.html#required) file not present in probes catalog","required": false ,"title": "Probe File","type":"string","format":"dreampipe-file"},"mapQual":{"description": "Minimum mapping quality (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Map Qual","default": 20,"type":"integer"},"baseQual":{"description": "Minimum base quality (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Base Qual","default": 10,"type":"integer"},"callabilityStatus":{"description": "Callability status of each probe region to be included in the output callabilityBed. Common used values are: All, Callable or LowCoverage","required": true ,"title": "Callability Status","default": "LowCoverage","type":"string","enum":["All","Callable","Uncallable","Strand","LowCoverage","Out"]},"subsamplePercent":{"description": "Percent to extract a random subsample of reads from the BAM (http://samtools.github.io/hts-specs/SAMv1.pdf) file","required": true ,"title": "Subsample Percent","default": 0.01,"type":"number"},"caller":{"description": "Variants caller. Choose between VarScan or DGCaller (DREAMgenics variant caller implementation)","required": false ,"title": "Caller","default": "VarScan","type":"string","enum":["DGCaller","VarScan"]},"BAQcomputation":{"description": "Base Alignment Quality computation (BAQ, is the Phred(http://en.wikipedia.org/wiki/Phred_quality_score)-scaled probability of a read base being misaligned) mode for mpileup command in Samtools (http://samtools.sourceforge.net/samtools.shtml). Set it to [-B, -E or -N]. Which means BAQ computation to be disable, extended or normal respectively","required": true ,"title": "BA Qcomputation","default": "-E","type":"string"},"downgrading":{"description": "Coefficient for downgrading mapping quality of reads containing excessive mismatches (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Downgrading","default": 50,"type":"integer"},"maxCoverage":{"description": "Max per-BAM depth to avoid excessive memory usage","required": true ,"title": "Max Coverage","default": 100000,"type":"integer"},"minCoverage":{"description": "Minimum read depth at a position to make call variants(http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Min Coverage","default": 6,"type":"integer"},"minAltCount":{"description": "Minimum supporting reads at a position to call variants (http://samtools.sourceforge.net/samtools.shtml) and variant context stats annotation","required": true ,"title": "Min Alt Count","default": 3,"type":"integer"},"minAvgQual":{"description": "Minimum base quality at a position to count a read (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Min Avg Qual","default": 15,"type":"integer"},"minFreqHomoz":{"description": "Minimum frequency to call homozygote (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Min Freq Homoz","default": 0.75,"type":"number"},"callerPValue":{"description": "P-value threshold for calling variants (http://samtools.sourceforge.net/samtools.shtml)","required": true ,"title": "Caller P Value","default": 0.05,"type":"number"},"adjVarFreq":{"description": "VarScan adj-var-freq param (Trio calling mode)","required": true ,"title": "Adj Var Freq","default": 0.1,"type":"number"},"adjPValue":{"description": "VarScan adj-p-value param (Trio calling mode)","required": true ,"title": "Adj P Value","default": 0.05,"type":"number"},"callerMode":{"description": "Caller mode: normal or trio","required": false ,"title": "Caller Mode","default": "Normal","type":"string","enum":["Normal","Trio"]},"dgCallerGenomicDatabases":{"description": "Genomic databases used to find matches by DGCaller","required": false ,"title": "Dg Caller Genomic Databases","type":"array","items":{"type":"string"},"enum":["1000genomes/phase3-1","1000genomes/phase3-2","bic/hg19","cll/20140217-3","cosmic/68-1","cosmic/71-1","cosmic/71-2","dbnsfp/2.8-2","dbnsfp/2.9-1","dbnsfp/3.0-1","dbscSNV/20150107-1","dbsnp/all/138-1","dbsnp/all/141-1","dbsnp/all/142-1","dbsnp/all/142-2","dbsnp/all/144-1","dbsnp/clinvar/20140303-1","dbsnp/clinvar/20150115-1","dbsnp/clinvar/20150305-1","dbsnp/clinvar/20150305-2","dbsnp/clinvar/20150629-1","dbsnp/clinvar/20150901-1","dbsnp/clinvar/20150929-1","dbsnp/common/137-1","dbsnp/oncogenicsV4/20150525-1","dgva/20140603-1","dlbcl-shm/20121012-3","esp/6500-1","esp/6500-2","esp/6500-3","exac/0.3-1","exac/0.3-2","hgmd/2014.1-2","hgmd/2014.1-3","hgmd/2015-2","hgmd/2015.1-3","icgc/17-1","icgc/18-1","icgc/19-1","pfam/20140516-1","repeat-masker/20140516-1","telcent/hg19-1","telcent/saccharomyces-cerevisiae/R64-1-1"]},"minCoverageTumor":{"description": "Min coverage for tumour in somatic mode (DGCaller)","required": true ,"title": "Min Coverage Tumor","default": 6,"type":"integer"},"minVariantMedianMQ":{"description": "Min variant median MQ (DGCaller)","required": true ,"title": "Min Variant Median MQ","default": 30,"type":"number"},"minVariantMedianBq":{"description": "Min variant median BQ (DGCaller)","required": true ,"title": "Min Variant Median Bq","default": 20,"type":"number"},"hpSeekExtension":{"description": "Maximun homopolymer base threshold for variant context stats annotation","required": true ,"title": "Hp Seek Extension","default": 8,"type":"integer"},"maxMismatchRatio":{"description": "Max mismatch ratio (DGCaller)","required": true ,"title": "Max Mismatch Ratio","default": 0.035,"type":"number"},"minMarginalFreq":{"description": "Min variant marginal frequency (DGCaller)","required": true ,"title": "Min Marginal Freq","default": 0.4,"type":"number"},"maxClipRatio":{"description": "Maximun clipping ratio per read for variant context stats annotation","required": true ,"title": "Max Clip Ratio","default": 0.5,"type":"number"},"strandPValue":{"description": "Maximun p-value for strand bias for variant context stats annotation","required": true ,"title": "Strand P Value","default": 0.000001,"type":"number"},"maxIndelDisagree":{"description": "Maximun INDEL (http://en.wikipedia.org/wiki/Indel) disagreement ratio at a position for variant context stats annotation","required": true ,"title": "Max Indel Disagree","default": 0.15,"type":"number"},"maxLimitCloseness":{"description": "Variants distance threshold to end of the reads","required": true ,"title": "Max Limit Closeness","default": 3,"type":"number"},"maxWindowContaminationRatio":{"description": "Max window contamination threshold","required": true ,"title": "Max Window Contamination Ratio","default": 0.2,"type":"number"},"pollutionWindowSize":{"description": "Pollution window size (DGCaller)","required": true ,"title": "Pollution Window Size","default": 9,"type":"integer"},"variantPvalue":{"description": "Variant p-value based on Fisher Exact Test","required": true ,"title": "Variant Pvalue","default": 0.05,"type":"number"},"tandemRepeatThreshold":{"description": "Maximun tandem repeat cluster threshold in variant context stats annotation","required": true ,"title": "Tandem Repeat Threshold","default": 8,"type":"integer"},"doProbeDistanceFiltering":{"description": "If checked, do probe distance variant filtering in annotation step ","required": true ,"title": "Do Probe Distance Filtering","default": false,"type":"boolean"},"probeDistanceFilteringValue":{"description": "If flag checked determines the maximum probe distance to keep a variant in annotation step","required": true ,"title": "Probe Distance Filtering Value","default": 50,"type":"integer"},"minClippedBases":{"description": "Minimum number of clipped bases to be keeped","required": true ,"title": "Min Clipped Bases","default": 20,"type":"integer"},"minSdInsertSize":{"description": "Minimun standard deviation","required": true ,"title": "Min Sd Insert Size","default": 10,"type":"number"},"rearrangementsMaxMismatch":{"description": "Max mismatch ratio in rearrangements","required": true ,"title": "Rearrangements Max Mismatch","default": 0.03,"type":"number"},"minSliding":{"description": "Min read sliding to compute internal read duplicates in rearrangements","required": true ,"title": "Min Sliding","default": 10,"type":"integer"},"minSupportingReads":{"description": "Min supporting reads in rearrangements","required": true ,"title": "Min Supporting Reads","default": 8,"type":"integer"},"rearrangementsCallerCoverage":{"description": "Minimum "read coverage" to call rearrangements candidates","required": true ,"title": "Rearrangements Caller Coverage","default": 10,"type":"integer"},"overlappingExtraBases":{"description": "Number of bases around each region to consider overlapping against probe","required": true ,"title": "Overlapping Extra Bases","default": 50,"type":"integer"},"doParallelAnnotation":{"description": "commons.annotation.AnnotationAndIndexationWorkFlow.doParallelAnnotation","required": true ,"title": "Do Parallel Annotation","default": true,"type":"boolean"},"refSeqVersion":{"description": "commons.annotation.AnnotationTask.refSeqVersion","required": false ,"title": "Ref Seq Version","type":"string","enum":["20150611","hg18/20150515","hg19/20150611","hg38/20150511"]},"overlappingRatio":{"description": "Region overlapping ratio for matching used in annotation by overlapping","required": true ,"title": "Overlapping Ratio","default": 0,"type":"number"},"ensemblTranscriptsFile":{"description": "File containing Ensembl transcripts ids. Functional annotation will be applied only over these transcripts","required": false ,"title": "Ensembl Transcripts File","type":"string","format":"dreampipe-file"},"refSeqTranscriptsFile":{"description": "File containing RefSeq transcripts ids. Functional annotation will be applied only over these transcripts","required": false ,"title": "Ref Seq Transcripts File","type":"string","format":"dreampipe-file"},"onlyRelevantTranscripts":{"description": "Limit annotations to only relevant transcripts (CCDS transcripts or longest transcript with biotype miRNA, protein_coding, lincRNA, snRNA, snoRNA, Mt_rRNA, misc_RNA, rRNA, IG_C_gene,IG_D_gene, IG_J_gene, IG_V_gene, TR_C_gene, TR_D_gene, TR_J_gene, TR_V_gene)","required": true ,"title": "Only Relevant Transcripts","default": false,"type":"boolean"},"minQualityRatio":{"description": "Minimun ratio of high quality reads for variant context stats annotation","required": true ,"title": "Min Quality Ratio","default": 0.2,"type":"number"},"maxMismatch":{"description": "Maximun mismatches per read in variant context stats annotation","required": true ,"title": "Max Mismatch","default": 2,"type":"integer"},"maxClusters":{"description": "Maximun number of clusters per window in variant context stats annotation","required": true ,"title": "Max Clusters","default": 2,"type":"integer"},"baseQualFault":{"description": "Minimun "base quality" (http://en.wikipedia.org/wiki/Phred_quality_score) at a position for variant context stats annotation","required": true ,"title": "Base Qual Fault","default": 20,"type":"integer"},"geneSeekWindow":{"description": "If a variant does not fall within a gene, the number of bases in front and behind the variant in which the closest gene is sought","required": true ,"title": "Gene Seek Window","default": 10000,"type":"integer"},"minMedianBq":{"description": "Minimun median base quality per read in variant context stats annotation","required": true ,"title": "Min Median Bq","default": 20,"type":"integer"},"minIndelMarginalFreq":{"description": "Minimun INDEL (http://en.wikipedia.org/wiki/Indel) marginal frequency for variant context stats annotation","required": true ,"title": "Min Indel Marginal Freq","default": 0.75,"type":"number"},"minSnvMarginalFreq":{"description": "Minimun SNV (http://en.wikipedia.org/wiki/Single-nucleotide_polymorphism) marginal frequency for variant context stats annotation","required": true ,"title": "Min Snv Marginal Freq","default": 0.4,"type":"number"},"minEndDist":{"description": "Minimun median distance to the ends of the read for variant context stats annotation","required": true ,"title": "Min End Dist","default": 4.9,"type":"number"},"minVarSd":{"description": "Minimun mutation distribution in the reads (measured as standard deviation (sd)) for variant context stats annotation","required": true ,"title": "Min Var Sd","default": 3,"type":"integer"},"maxAltFoldDiff":{"description": "Maximun strand fold difference for strand bias in variant context stats annotation","required": true ,"title": "Max Alt Fold Diff","default": 5,"type":"number"},"doContextStatsFiltering":{"description": "If checked, discards those variantes with values below params: Min Var Freq, Min Alt Count, Min Coverage","required": false ,"title": "Do Context Stats Filtering","default": false,"type":"boolean"},"doFaultSummaryFiltering":{"description": "If checked, discards variants with faultSumary, wich means that some problems were detected during sequencing or alignment steps (Only if VarScan is used as caller)","required": false ,"title": "Do Fault Summary Filtering","default": false,"type":"boolean"}}},"Inputs":{"description": "Pipeline execution inputs","type": "object","properties": {"dataFolder":{"description": "Root folder containing input data for pipeline. It can contains bcl data structure, fastq files or subfolders (one per sample if is multisample pipeline) containnig fasta files","required": false ,"title": "Data Folder","type":"string","format":"dreampipe-file"},"sample":{"description": "Sample: sampleId and 1 to n pairs of FASTQ (http://en.wikipedia.org/wiki/FASTQ_format) files or a BAM (http://samtools.github.io/hts-specs/SAMv1.pdf)","required": true ,"title": "Sample","type":"object","properties":{"sampleId":{"type":"string"},"fastqPairs":{"type":"array","items":{"type":"object","properties":{"file2":{"type":"string","format":"dreampipe-file"},"file1":{"type":"string","format":"dreampipe-file"}}}},"bam":{"type":"string","format":"dreampipe-file"}}},"trimming":{"description": "If flag is marked, trimming (Trimmomatic - http://www.usadellab.org/cms/?page=trimmomatic) for FASTQ (http://en.wikipedia.org/wiki/FASTQ_format) files is done","required": true ,"title": "Trimming","default": true,"type":"boolean"},"removeDuplicates":{"description": "If flag is marked, removing/marking "PCR duplicates" (http://www.cureffi.org/2012/12/11/how-pcr-duplicates-arise-in-next-generation-sequencing/) from BAM (http://samtools.github.io/hts-specs/SAMv1.pdf) is done","required": true ,"title": "Remove Duplicates","default": true,"type":"boolean"},"doStructural":{"description": "If flag is marked structural variants workflow is done","required": true ,"title": "Do Structural","default": false,"type":"boolean"},"bamStats":{"description": "If flag is marked, provides statistics regarding reads and MQ per Read Group. Bed file or probe version with regions of interest can be provided optionally","required": true ,"title": "Bam Stats","default": true,"type":"boolean"},"zeroBased":{"description": "If flag is marked, probes file is considered to be zero based","required": true ,"title": "Zero Based","default": false,"type":"boolean"},"coverage":{"description": "Minimum "read coverage" (http://en.wikipedia.org/wiki/Deep_sequencing) to compute Callability (Measure of a genotypes position confidence based on "mapping quality" (http://genome.sph.umich.edu/wiki/Mapping_Quality_Scores), "base quality" (http://en.wikipedia.org/wiki/Phred_quality_score) and "read coverage" (http://en.wikipedia.org/wiki/Deep_sequencing) thresholds) ","required": true ,"title": "Coverage","default": [10,20,50,100,200,500,1000],"type":"array","items":{"type":"integer"}},"callabilityStatusCoverage":{"description": "Coverage that will be used to create a bed file containing all regions whose callability status matches the desired in paramter callabilityStatus","required": false ,"title": "Callability Status Coverage","default": 20,"type":"integer"}}},"Tags":{"description": "Execution tags. Categorizes the execution", "type":"array","items":{"type":"string"}},"Emails":{"description": "Email addresses to be notified of execution events", "type":"array","items":{"type":"string"}}}}

Is brutusin JSON schema a standard one?

README in the projects need a link to express your stadard adoption, example

... JSON Schema to HTML form generator ...

otherwise is ambiguous and the reader will lost time checking if it is a "brutusin JSON schema".

Can not access input value with javascript

Hello, i try to access a value of a timestamp in the json-forms. I want to convert that value to a readable value.

How is it possible to access the value of an input field?

With the jquery way i get no value:
var timestamp = $( "input[data-cip-id='BrutusinForms#0_11']" ).attr('value');

Best regards

Missing example how to "extend and customize"

Hello,
it would be nice to provide some example how to customize and extend this library (since it is titled to be extendable and customizable).
Eg. if someone wants a different layout for editing "patternProperties" or for editing arrays, or want to add a new plugin for a type.

Integer default values

When we have an integer with default value 0 the component does not inform the field.
In addition when we inform it with 0 validation fails.

validating parts of an object for the oneOf component.

A oneOf element defines an object that validates against exactly one alternative in a list of definitions.

So to generate a preloaded form with a oneOf element, you need to validate that branch of the object against each alternative and select the right one to preload the form with the right elements.

On my own branch, I have each alternative identify itself with an element that's defined to have an enum with one member. But for general use, we need to be able to validate sub-tree against the right list of sub-schemas to get preloading done right.

Can I use this in Angular2?

Is there a way to use this in angular2?

I tried doing something like var Brutusin = require('json-form') but not sure if this is how I can import it in my application.

Thanks,

Rendering in DIVs not Tables

Is it possible to configure json-forms to reder forms in DIVS or another container instead of a table? Thanks

Support for readonly field

It would be useful when ID field has to be shown. Currently user can change the field and it saves a new object to database.

id: {
  "type": "string",
  "readonly": true
},

Disabled form fields wont be returned, just adding disabled wont work I guess :(

Support for optional booleans

Currently if the schema has a boolean property, the generated form is the same regardless of whether the property is marked as required: false, and the data from the form always has the boolean property with a value of either true or false.

What I'd like is for there to be a way to specify that a boolean is optional (nullable), such that the user can opt not to set a value.

One possible solution for optional booleans would be to use a menu with ("(blank)", "true", "false") instead of a checkbox.

Does it support $ref?

I have $refs in my data though some are nested, just wondering if the plugin does support $ref : { #/defintion/obj } even if some are nested (data is coming from Swagger)? If so can you tell me how its being done or its processing it automatically?

I'm doing an ajax call to my swagger json to grab the schema.

Sample JSON

{
  "Name": {
    "type": "string"
  },
  "Number": {
    "format": "int32",
    "type": "integer"
  },
  "PointInTime": {
    "format": "date-time",
    "type": "string"
  },
  "Url": {
    "type": "string"
  },
  "Children": {
    "type": "array",
    "items": {
      "$ref": "#/definitions/TestSimpleInputChild"
    }
  },
  "CustomData": {
    "type": "object",
    "additionalProperties": {
      "type": "array",
      "items": {
        "type": "object"
      }
    }
  }
}`

Support for optional Objects

Currently if the schema has an object property, the form data always contains the object even if it's marked as "required": false.

It would be great if the user could opt out of setting a value for the object.

Possible solution would be for optional objects to have an "Add Item" button similar to the one for arrays (but of course limited to one item).

For example here's a form schema with an optional "widget" object. Desired behavior is that if the user does not specify a widget, the data is {} instead of {"widget":{}}.

{
  "$schema": "http://json-schema.org/draft-03/schema#",
  "type": "object",
  "properties": {
    "widget": {
      "type": "object",
      "id": "urn:jsonschema:com:example:Widget",
      "required": false,
      "properties": {
        "name": {
          "type": "string"
        }
      }
    }
  }
}

Is there support for textareas?

I couldn't find any example in the demo of a field that is rendered as a textarea. If there isn't, can I try to add it?

PS.: this is awesome. Congratulations, I loved this package.

How to use dynamic schemas for multiple fields

I am just wondering, how to add multiple fields based on one other field using the schemaResolver.

Lets say, I have a selectbox "type" with 2 options type1 and type2. Depending on this selectbox, I want to show 2 different sets of additional fields. I have tried the following:

var typeSchemas = {
    "type1": {
        "title": {
            "type": "string",
            "title": "Title 1"
        },
        "gender": {
            "type": "string",
            "title": "Gender",
            "enum": [
                "m",
                "f"
             ],
        },
    },
    "type2": {
        "title": {
            "type": "string",
            "title": "Title 2"
        },
        "otherfield": {
            "type": "string",
            "title": "Some other otherfield"
        },
    }
};
var myDiv = document.getElementById("#myDiv");
var bf = brutusin["json-forms"].create({
    "$schema": "http://json-schema.org/draft-03/schema#",
    "type": "object",
    "properties": properties = {
    "type": {
        "type": "string",
        "title": "Plugin-Typ",
        "description": "Choose the type of the next formfields",
        "required": true,
        "enum": [
            "type1",
            "type2"
        ]
    },
    "nextfields": {
        "dependsOn": [
            "type"
        ]
    }
}
});
bf.schemaResolver = function (names, data, cb) {
    var schemas = new Object();

    schemas["$.data"] = typeSchemas[data.type];
    setTimeout(function(){cb(schemas)},500);
};
bf.render(myDiv);

But thats not working, since the schemas["$.data"] has to be a single property and not an set of properties. Is there any possibility to solve this?

label form if objects are in array

Hi,

Is there a way to show labels if the object is an array? Also doesn't render this array as well, this array is coming from a GET request.

{
[
   {
      "name":"id",
      "in":"query",
      "required":false,
      "type":"array",
      "items":{
         "type":"integer",
         "format":"int32"
      },
      "collectionFormat":"multi"
   },
   {
      "name":"sku",
      "in":"query",
      "required":false,
      "type":"array",
      "items":{
         "type":"string"
      },
      "collectionFormat":"multi"
   },
   {
      "name":"code",
      "in":"query",
      "required":false,
      "type":"array",
      "items":{
         "type":"string"
      },
      "collectionFormat":"multi"
   }
]
}

Support for html5 date datatype

For instance this valid JSON Schema:

"start": {
    "format": "date",
    "title": "end_date",
    "type": "string"
}

Should render something along the lines of:

<input type="date" name="start">

What browsers does this support?

I didn't notice any mention of browser support in the read.me or the source file. I assume Chrome, Firefox, Edge and Safari are supported, but what's the minimum version of IE this library is expected to work with?
Thanks.

Cannot read property 'definitions' of undefined

I'm trying out many of the json schema form generators out there and yours looks like the most flexible.
Just testing out your demo page I am getting errors in generating a form based on my following schema:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "typeName": "OutgoingFileIODto",
  "additionalProperties": false,
  "required": [
    "Title",
    "Comment",
    "OwnerBoxId",
    "Status",
    "EndPoint"
  ],
  "properties": {
    "ChannelTypeName": {
      "type": "string",
      "readOnly": true
    },
    "ChannelTypeInfo": {
      "type": "string",
      "readOnly": true
    },
    "Title": {
      "type": "string"
    },
    "Comment": {
      "type": "string",
      "format": "textarea"
    },
    "Status": {
      "oneOf": [
        {
          "$ref": "#/definitions/ChannelState"
        }
      ]
    },
    "EndPoint": {
      "type": "string"
    },
    "Overwrite": {
      "type": "boolean"
    },
    "Interval": {
      "type": "integer"
    },
    "IntervalUnit": {
      "oneOf": [
        {
          "$ref": "#/definitions/TimeUnit"
        }
      ]
    },
    "DateTimeStart": {
      "type": "string",
      "format": "datetime-local"
    },
    "DateTimeStop": {
      "type": "string",
      "format": "datetime-local"
    },
    "DateTimeCreated": {
      "type": "string",
      "format": "datetime-local",
      "readOnly": true
    },
    "DateTimeLastChanged": {
      "type": "string",
      "format": "datetime-local",
      "readOnly": true
    },
    "TemporaryFolderName": {
      "type": "string",
      "readOnly": true
    },
    "OwnerBoxId": {
      "type": "integer",
      "readOnly": true
    },
    "ID": {
      "type": "integer",
      "readOnly": true
    }
  },
  "definitions": {
    "ChannelState": {
      "type": "string",
      "typeName": "ChannelState",
      "enumNames": [
        "Disabled",
        "Enabled",
        "Paused",
        "Errored"
      ],
      "enum": [
        "Disabled",
        "Enabled",
        "Paused",
        "Errored"
      ],
      "description": ""
    },
    "TimeUnit": {
      "type": "string",
      "typeName": "TimeUnit",
      "enumNames": [
        "Seconds",
        "Minutes",
        "Hours",
        "Days",
        "Weeks",
        "Months",
        "Years"
      ],
      "enum": [
        "Seconds",
        "Minutes",
        "Hours",
        "Days",
        "Weeks",
        "Months",
        "Years"
      ],
      "description": ""
    }
  }
}

the schema itself is validated as a valid json4 schema by http://jsonschemalint.com/draft4/#

Do you not fully support Json4 schemas?

Also, do you support loading externally referenced schemas using ajax and $ref?

$ref?

$ref should do an ajax call (with id of the schema?)

but actually :
function getDefinition(path) {
var parts = path.split('/');
var def = root;
for (var p in parts) {
if (p === "0")
continue;
def = def[parts[p]];

        }
        return def;
    }

i dont understand well what that's doing !
how that's work ? sorry it is more a question than an "issue" perhaps, feel free to close it.

selects render "undefined" when bound to a oneOf definition

for the following schema:

    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "typeName": "IncomingFileIODto",
    "additionalProperties": false,
    "required": [
        "EndPoint",
        "Title",
        "Comment",
        "Status",
        "OwnerBoxId"
    ],
    "properties": {
        "ChannelTypeName": {
            "type": "string",
            "readOnly": true
        },
        "ChannelTypeInfo": {
            "type": "string",
            "readOnly": true
        },
        "Title": {
            "type": "string"
        },
        "Comment": {
            "type": "string",
            "format": "textarea"
        },
        "Status": {
            "default": "Enabled",
            "oneOf": [
                {
                    "$ref": "#/definitions/ChannelState"
                }
            ]
        },
        "EndPoint": {
            "type": "string"
        },
        "Interval": {
            "type": "integer"
        },
        "IntervalUnit": {
            "oneOf": [
                {
                    "$ref": "#/definitions/TimeUnit"
                }
            ]
        },
        "DateTimeStart": {
            "type": "string",
            "format": "datetime-local"
        },
        "DateTimeStop": {
            "type": "string",
            "format": "datetime-local"
        },
        "DateTimeCreated": {
            "type": "string",
            "format": "datetime-local",
            "readOnly": true
        },
        "DateTimeLastChanged": {
            "type": "string",
            "format": "datetime-local",
            "readOnly": true
        },
        "TemporaryFolderName": {
            "type": "string",
            "readOnly": true
        },
        "ID": {
            "type": "string",
            "readOnly": true
        },
        "OwnerBoxId": {
            "type": "integer",
            "readOnly": true
        }
    },
    "definitions": {
        "ChannelState": {
            "type": "string",
            "typeName": "ChannelState",
            "enumNames": [
                "Disabled",
                "Enabled",
                "Paused",
                "Errored"
            ],
            "enum": [
                "Disabled",
                "Enabled",
                "Paused",
                "Errored"
            ],
            "description": ""
        },
        "TimeUnit": {
            "type": "string",
            "typeName": "TimeUnit",
            "enumNames": [
                "Seconds",
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months",
                "Years"
            ],
            "enum": [
                "Seconds",
                "Minutes",
                "Hours",
                "Days",
                "Weeks",
                "Months",
                "Years"
            ],
            "description": ""
        }
    }
}

the select boxes rendered for the TimeUnit and Status types render a select box with only "undefined" as the available choice.
When selecting this undefined value, a new Select is immediately rendered beneath it which contains the correct options as defined in the schema.

When the bootstrap-select renderer is used, the behaviour is different. The select box renders no options and no drop down is displayed on click.

Is it possible to set an enum from an external source or load on demand (without dependsOn)?

I want to set a select object to have a set of Text/Values as per an HTML class. The saved value should be the value of the select and the display just the Name e.g.

<select> 
<option value="file1.json">Peter</option>
<option value="file2.json">Mary</option>
</select>

Enums don't seem to offer this and I was thinking about creating an on the fly schema, but it wouldn't give the array structure as far as I can tell.

Idea is that when the data is saved you get

{
    "FileName":"file1.json"
}

rather than

{
    "FileName":"Peter"
}

or

{
    "Name":"Peter",
    "FileName":"file1.json"
}

Integer/number field validation message

You get the following validation message if you write a non number data in a number type (integer, number) input field: "This field is required". It would be better a message about the conversation error.

Don't see the form on IE 11

Hi,

Just wondering if the plugin supports IE 11? I'm not seeing the form on IE 11 at all however it works on the browsers including Edge. Also I get an error which I'm not sure if its part of it.

image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.