Skip to content

Commit

Permalink
Add boolean toggle to control options example
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-koehler committed Feb 16, 2021
1 parent 133538d commit bae0cc1
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/examples/src/control-options.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
Copyright (c) 2017-2021 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down Expand Up @@ -137,6 +137,10 @@ export const extendedSchema = {
hideRequiredAsterisk: {
type: 'string',
description: 'Hides the "*" symbol, when the field is required',
},
toggle: {
type: 'boolean',
description: 'The "toggle" option renders boolean values as a toggle.'
}
},
required: ['hideRequiredAsterisk', 'restrictText']
Expand Down Expand Up @@ -186,6 +190,14 @@ export const extendedUischema = {
options: {
hideRequiredAsterisk: true
}
},
{
type: 'Control',
scope: '#/properties/toggle',
label: 'Boolean as Toggle',
options: {
toggle: true
}
}
]
};
Expand All @@ -194,7 +206,8 @@ export const extendedData = {
multilineString: 'Multi-\nline\nexample',
slider: 4,
trimText: 'abcdefg',
restrictText: 'abcde'
restrictText: 'abcde',
toggle: false
};

const combinedSchema = {
Expand Down

0 comments on commit bae0cc1

Please sign in to comment.