import { registerExamples } from '../register' ; export const schema = { type : 'object' , properties : { firstName : { type : 'string' , minLength : 3 , description : 'Please enter your first name' } , secondName : { type : 'string' , minLength : 3 , description : 'Please enter your second name' } , vegetarian : { type : 'boolean' } , birthDate : { type : 'string' , format : 'date' , description : 'Please enter your birth date.' } , nationality : { type : 'string' , enum : [ 'DE' , 'IT' , 'JP' , 'US' , 'RU' , 'Other' ] } , provideAddress : { type : 'boolean' } , address : { type : 'object' , properties : { street : { type : 'string' } , streetNumber : { type : 'string' } , city : { type : 'string' } , postalCode : { type : 'string' , maxLength : 5 } , } } , vegetarianOptions : { type : 'object' , properties : { vegan : { type : 'boolean' } , favoriteVegetable : { type : 'string' , enum : [ 'Tomato' , 'Potato' , 'Salad' , 'Aubergine' , 'Cucumber' , 'Other' ] } , otherFavoriteVegetable : { type : 'string' } } } } , } ; export const uischema = { type : 'Categorization' , elements : [ { type : 'Category' , label : 'Basic Information' , elements : [ { type : 'HorizontalLayout' , elements : [ { type : 'Control' , scope : '#/properties/firstName' } , { type : 'Control' , scope : '#/properties/secondName' } ] } , { type : 'HorizontalLayout' , elements : [ { type : 'Control' , scope : '#/properties/birthDate' } , { type : 'Control' , scope : '#/properties/nationality' } ] } , { type : 'Control' , scope : '#/properties/provideAddress' } , { type : 'Control' , scope : '#/properties/vegetarian' } ] } , { type : 'Category' , label : 'Address' , elements : [ { type : 'HorizontalLayout' , elements : [ { type : 'Control' , scope : '#/properties/address/properties/street' } , { type : 'Control' , scope : '#/properties/address/properties/streetNumber' } , ] } , { type : 'HorizontalLayout' , elements : [ { type : 'Control' , scope : '#/properties/address/properties/city' } , { type : 'Control' , scope : '#/properties/address/properties/postalCode' } ] } , ] , rule : { effect : 'SHOW' , condition : { scope : '#/properties/provideAddress' , schema : { const : true } } } } , { type : 'Category' , label : 'Additional' , elements : [ { type : 'Control' , scope : '#/properties/vegetarianOptions/properties/vegan' } , { type : 'Control' , scope : '#/properties/vegetarianOptions/properties/favoriteVegetable' } , { type : 'Control' , scope : '#/properties/vegetarianOptions/properties/otherFavoriteVegetable' , rule : { effect : 'SHOW' , condition : { scope : '#/properties/vegetarianOptions/properties/favoriteVegetable' , schema : { const : 'Other' } } } } , ] , rule : { effect : 'SHOW' , condition : { scope : '#/properties/vegetarian' , schema : { const : true } } } } ] } ; export const data = { provideAddress : true , vegetarian : false } ; const schema_1713 = { "type" : "object" , "properties" : { "experiments" : { "type" : "array" , "items" : { "type" : "object" , "properties" : { "ID" : { "type" : "string" } } , "additionalProperties" : false , "additionalItems" : false } } } , "required" : [ "experiments" ] } ; const uischema_1713 = { "type" : "Categorization" , "elements" : [ { "type" : "Category" , "label" : "Experiments" , "elements" : [ { "type" : "ListWithDetail" , "scope" : "#/properties/experiments" , "options" : { "labelRef" : "#/items/properties/ID" , "detail" : { "type" : "VerticalLayout" , "elements" : [ { "type" : "HorizontalLayout" , "elements" : [ { "type" : "Control" , "scope" : "#/properties/ID" } ] } , { "type" : "Categorization" , "elements" : [ { "type" : "Category" , "label" : "Sequential" , "elements" : [ { "type" : "VerticalLayout" , "elements" : [ { "type" : "Control" , "scope" : "#/properties/ID" } ] } ] } ] } ] } } } ] } ] } ; registerExamples ( [ { name : 'categorization' , label : 'Categorization' , data , schema , uischema } , { name : '1713' , label : 'Bug 1713' , data , schema : schema_1713 , uischema : uischema_1713 } ] ) ;