Skip to content

Commit e88ac0c

Browse files
committed
Update demo.
1 parent 745307a commit e88ac0c

12 files changed

+109
-64
lines changed

src/demo/app/demo.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
</button>
3030
<md-menu #exampleMenu="mdMenu" class="example-menu">
3131
<button md-menu-item class="mat-medium"
32-
*ngFor="let example of examples.ng2jsf.schemas"
33-
(click)="loadSelectedExample('ng2jsf', '', example.file, example.name)">
32+
*ngFor="let example of examples['ng-jsf'].schemas"
33+
(click)="loadSelectedExample('ng-jsf', '', example.file, example.name)">
3434
{{example.name}}
3535
</button>
3636
<button md-menu-item class="mat-medium"

src/demo/app/demo.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ export class DemoComponent implements OnInit {
3131
'bootstrap-3': 'Bootstrap 3 framework',
3232
'no-framework': 'No Framework (plain HTML controls)',
3333
};
34-
selectedSet: string = 'ng2jsf';
34+
selectedSet: string = 'ng-jsf';
3535
selectedSetName: string = '';
36-
selectedExample: string = 'ng2jsf-flex-layout';
36+
selectedExample: string = 'ng-jsf-flex-layout';
3737
selectedExampleName: string = 'Flexbox layout';
3838
selectedFramework: string = 'material-design';
3939
visible: { [item: string]: boolean } = {
@@ -79,10 +79,10 @@ export class DemoComponent implements OnInit {
7979
if (params['set']) {
8080
this.selectedSet = params['set'];
8181
this.selectedSetName = ({
82-
ng2jsf: '',
83-
asf: 'Angular Schema Form:',
84-
rsf: 'React Schema Form:',
85-
jsf: 'JSONForm:'
82+
'ng-jsf': '',
83+
'asf': 'Angular Schema Form:',
84+
'rsf': 'React Schema Form:',
85+
'jsf': 'JSONForm:'
8686
})[this.selectedSet];
8787
}
8888
if (params['example']) {

src/demo/app/example-schemas.model.ts

Lines changed: 99 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Sources:
22
//
3-
// Angular JSON Schema Form examples ('ng2jsf-...') are original
3+
// Angular JSON Schema Form examples ('ng-jsf-...') are original
44
//
55
// Angular Schema Form (AngularJS) examples ('asf-...') are from
66
// http://schemaform.io/examples/bootstrap-example.html
@@ -14,16 +14,16 @@
1414
//
1515

1616
export const Examples: any = {
17-
'ng2jsf': {
17+
'ng-jsf': {
1818
name: 'Angular JSON Schema Form examples',
1919
schemas: [
20-
{ name: 'Flexbox layout', file: 'ng2jsf-flex-layout', },
21-
{ name: 'Simple Array', file: 'ng2jsf-simple-array', },
22-
{ name: 'Data Only (no Schema or Layout)', file: 'ng2jsf-data-only', },
23-
// { name: 'Layout Only (no Schema or Data)', file: 'ng2jsf-layout-only', },
24-
// { name: 'JSON Meta-Schema - Version 6', file: 'ng2jsf-json-schema-draft06', },
25-
{ name: 'JSON Meta-Schema - Version 4', file: 'ng2jsf-json-schema-draft04', },
26-
{ name: 'JSON Meta-Schema - Version 3', file: 'ng2jsf-json-schema-draft03', },
20+
{ name: 'Flexbox layout', file: 'ng-jsf-flex-layout', },
21+
{ name: 'Simple Array', file: 'ng-jsf-simple-array', },
22+
{ name: 'Data Only (no Schema or Layout)', file: 'ng-jsf-data-only', },
23+
// { name: 'Layout Only (no Schema or Data)', file: 'ng-jsf-layout-only', },
24+
// { name: 'JSON Meta-Schema - Version 6', file: 'ng-jsf-json-schema-draft06', },
25+
{ name: 'JSON Meta-Schema - Version 4', file: 'ng-jsf-json-schema-draft04', },
26+
{ name: 'JSON Meta-Schema - Version 3', file: 'ng-jsf-json-schema-draft03', },
2727
]
2828
},
2929
'asf': {
@@ -64,51 +64,96 @@ export const Examples: any = {
6464
name: 'JSONForm (jQuery) examples',
6565
url: 'http://ulion.github.io/jsonform/playground/',
6666
schemas: [
67-
{ name: 'Getting started', file: 'jsf-gettingstarted', urlParameters: '?example=gettingstarted' },
68-
{ name: 'JSON Schema - A basic example', file: 'jsf-schema-basic', urlParameters: '?example=schema-basic', },
69-
{ name: 'JSON Schema - Slightly more complex example', file: 'jsf-schema-morecomplex', urlParameters: '?example=schema-morecomplex', },
70-
{ name: 'JSON Schema - Arrays', file: 'jsf-schema-array', urlParameters: '?example=schema-array', },
71-
{ name: 'JSON Schema - Required field', file: 'jsf-schema-required', urlParameters: '?example=schema-required', },
72-
{ name: 'JSON Schema - Default values', file: 'jsf-schema-default', urlParameters: '?example=schema-default', },
73-
{ name: 'JSON Schema - Inline $ref to definitions', file: 'jsf-schema-inlineref', urlParameters: '?example=schema-inlineref', },
74-
{ name: 'Fields - Common properties', file: 'jsf-fields-common', urlParameters: '?example=fields-common', },
75-
{ name: 'Fields - Gathering secrets: the password type', file: 'jsf-fields-password', urlParameters: '?example=fields-password', },
76-
{ name: 'Fields - Large text: the textarea type', file: 'jsf-fields-textarea', urlParameters: '?example=fields-textarea', },
77-
{ name: 'Fields - text field with jquery-ui autocomplete', file: 'jsf-fields-autocomplete', urlParameters: '?example=fields-autocomplete', },
78-
{ name: 'Fields - Code (JavaScript, JSON...): the ace type', file: 'jsf-fields-ace', urlParameters: '?example=fields-ace', },
79-
{ name: 'Fields - Color picker: the color type', file: 'jsf-fields-color', urlParameters: '?example=fields-color', },
80-
{ name: 'Fields - Boolean flag: the checkbox type', file: 'jsf-fields-checkbox', urlParameters: '?example=fields-checkbox', },
81-
{ name: 'Fields - Multiple options: the checkboxes type', file: 'jsf-fields-checkboxes', urlParameters: '?example=fields-checkboxes', },
82-
{ name: 'Fields - Selection list: the select type', file: 'jsf-fields-select', urlParameters: '?example=fields-select', },
83-
{ name: 'Fields - A list of radio buttons: the radios type', file: 'jsf-fields-radios', urlParameters: '?example=fields-radios', },
84-
{ name: 'Fields - Radio buttons as real buttons: the radio buttons type', file: 'jsf-fields-radiobuttons', urlParameters: '?example=fields-radiobuttons', },
85-
{ name: 'Fields - Checkbox buttons: the checkbox buttons type', file: 'jsf-fields-checkboxbuttons', urlParameters: '?example=fields-checkboxbuttons', },
86-
{ name: 'Fields - Number: the range type', file: 'jsf-fields-range', urlParameters: '?example=fields-range', },
87-
{ name: 'Fields - Image selector: the imageselect type', file: 'jsf-fields-imageselect', urlParameters: '?example=fields-imageselect', },
88-
{ name: 'Fields - Icon selector: the iconselect type', file: 'jsf-fields-iconselect', urlParameters: '?example=fields-iconselect', },
89-
{ name: 'Fields - Grouping: the fieldset type', file: 'jsf-fields-fieldset', urlParameters: '?example=fields-fieldset', },
90-
{ name: 'Fields - Advanced options section: the advancedfieldset type', file: 'jsf-fields-advancedfieldset', urlParameters: '?example=fields-advancedfieldset', },
91-
{ name: 'Fields - Authentication settings section: the authfieldset type', file: 'jsf-fields-authfieldset', urlParameters: '?example=fields-authfieldset', },
92-
{ name: 'Fields - Generic group: the section type', file: 'jsf-fields-section', urlParameters: '?example=fields-section', },
93-
{ name: 'Fields - Group of buttons: the actions type', file: 'jsf-fields-actions', urlParameters: '?example=fields-actions', },
94-
{ name: 'Fields - Generic array: the array type (complex)', file: 'jsf-fields-array', urlParameters: '?example=fields-array', },
95-
{ name: 'Fields - Generic array: the array type (simple)', file: 'jsf-fields-array-simple', urlParameters: '?example=fields-array-simple', },
96-
{ name: 'Fields - Arrays with tabs: the tabarray type', file: 'jsf-fields-tabarray', urlParameters: '?example=fields-tabarray', },
97-
{ name: 'Fields - Arrays with tabs: the tabarray type w/ maxItems', file: 'jsf-fields-tabarray-maxitems', urlParameters: '?example=fields-tabarray-maxitems', },
98-
{ name: 'Fields - Arrays with tabs: the tabarray type w/ default & legend', file: 'jsf-fields-tabarray-value', urlParameters: '?example=fields-tabarray-value', },
99-
{ name: 'Fields - Alternative: the selectfieldset type', file: 'jsf-fields-selectfieldset', urlParameters: '?example=fields-selectfieldset', },
100-
{ name: 'Fields - Alternative with schema key', file: 'jsf-fields-selectfieldset-key', urlParameters: '?example=fields-selectfieldset-key', },
101-
{ name: 'Fields - Submit the form: the submit type', file: 'jsf-fields-submit', urlParameters: '?example=fields-submit', },
102-
{ name: 'Fields - Guide users: the help type', file: 'jsf-fields-help', urlParameters: '?example=fields-help', },
103-
{ name: 'Fields - Hidden form values: the hidden type', file: 'jsf-fields-hidden', urlParameters: '?example=fields-hidden', },
104-
{ name: 'Fields - Series of questions: the questions type', file: 'jsf-fields-questions', urlParameters: '?example=fields-questions', },
105-
{ name: 'Templating - item index with idx', file: 'jsf-templating-idx', urlParameters: '?example=templating-idx', },
106-
{ name: 'Templating - tab legend with value and valueInLegend', file: 'jsf-templating-value', urlParameters: '?example=templating-value', },
107-
{ name: 'Templating - values.xxx to reference another field', file: 'jsf-templating-values', urlParameters: '?example=templating-values', },
108-
{ name: 'Templating - Using the tpldata property', file: 'jsf-templating-tpldata', urlParameters: '?example=templating-tpldata', },
109-
{ name: 'Using event handlers', file: 'jsf-events', urlParameters: '?example=events', },
110-
{ name: 'Using previously submitted values', file: 'jsf-previousvalues', urlParameters: '?example=previousvalues', },
111-
{ name: 'Using previously submitted values - Multidimensional arrays', file: 'jsf-previousvalues-multidimensional', urlParameters: '?example=previousvalues-multidimensional', },
67+
{ name: 'Getting started',
68+
file: 'jsf-gettingstarted', urlParameters: '?example=gettingstarted' },
69+
{ name: 'JSON Schema - A basic example',
70+
file: 'jsf-schema-basic', urlParameters: '?example=schema-basic', },
71+
{ name: 'JSON Schema - Slightly more complex example',
72+
file: 'jsf-schema-morecomplex', urlParameters: '?example=schema-morecomplex', },
73+
{ name: 'JSON Schema - Arrays',
74+
file: 'jsf-schema-array', urlParameters: '?example=schema-array', },
75+
{ name: 'JSON Schema - Required field',
76+
file: 'jsf-schema-required', urlParameters: '?example=schema-required', },
77+
{ name: 'JSON Schema - Default values',
78+
file: 'jsf-schema-default', urlParameters: '?example=schema-default', },
79+
{ name: 'JSON Schema - Inline $ref to definitions',
80+
file: 'jsf-schema-inlineref', urlParameters: '?example=schema-inlineref', },
81+
{ name: 'Fields - Common properties',
82+
file: 'jsf-fields-common', urlParameters: '?example=fields-common', },
83+
{ name: 'Fields - Gathering secrets: the password type',
84+
file: 'jsf-fields-password', urlParameters: '?example=fields-password', },
85+
{ name: 'Fields - Large text: the textarea type',
86+
file: 'jsf-fields-textarea', urlParameters: '?example=fields-textarea', },
87+
{ name: 'Fields - text field with jquery-ui autocomplete',
88+
file: 'jsf-fields-autocomplete', urlParameters: '?example=fields-autocomplete', },
89+
{ name: 'Fields - Code (JavaScript, JSON...): the ace type',
90+
file: 'jsf-fields-ace', urlParameters: '?example=fields-ace', },
91+
{ name: 'Fields - Color picker: the color type',
92+
file: 'jsf-fields-color', urlParameters: '?example=fields-color', },
93+
{ name: 'Fields - Boolean flag: the checkbox type',
94+
file: 'jsf-fields-checkbox', urlParameters: '?example=fields-checkbox', },
95+
{ name: 'Fields - Multiple options: the checkboxes type',
96+
file: 'jsf-fields-checkboxes', urlParameters: '?example=fields-checkboxes', },
97+
{ name: 'Fields - Selection list: the select type',
98+
file: 'jsf-fields-select', urlParameters: '?example=fields-select', },
99+
{ name: 'Fields - A list of radio buttons: the radios type',
100+
file: 'jsf-fields-radios', urlParameters: '?example=fields-radios', },
101+
{ name: 'Fields - Radio buttons as real buttons: the radio buttons type',
102+
file: 'jsf-fields-radiobuttons', urlParameters: '?example=fields-radiobuttons', },
103+
{ name: 'Fields - Checkbox buttons: the checkbox buttons type',
104+
file: 'jsf-fields-checkboxbuttons', urlParameters: '?example=fields-checkboxbuttons', },
105+
{ name: 'Fields - Number: the range type',
106+
file: 'jsf-fields-range', urlParameters: '?example=fields-range', },
107+
{ name: 'Fields - Image selector: the imageselect type',
108+
file: 'jsf-fields-imageselect', urlParameters: '?example=fields-imageselect', },
109+
{ name: 'Fields - Icon selector: the iconselect type',
110+
file: 'jsf-fields-iconselect', urlParameters: '?example=fields-iconselect', },
111+
{ name: 'Fields - Grouping: the fieldset type',
112+
file: 'jsf-fields-fieldset', urlParameters: '?example=fields-fieldset', },
113+
{ name: 'Fields - Advanced options section: the advancedfieldset type',
114+
file: 'jsf-fields-advancedfieldset', urlParameters: '?example=fields-advancedfieldset', },
115+
{ name: 'Fields - Authentication settings section: the authfieldset type',
116+
file: 'jsf-fields-authfieldset', urlParameters: '?example=fields-authfieldset', },
117+
{ name: 'Fields - Generic group: the section type',
118+
file: 'jsf-fields-section', urlParameters: '?example=fields-section', },
119+
{ name: 'Fields - Group of buttons: the actions type',
120+
file: 'jsf-fields-actions', urlParameters: '?example=fields-actions', },
121+
{ name: 'Fields - Generic array: the array type (complex)',
122+
file: 'jsf-fields-array', urlParameters: '?example=fields-array', },
123+
{ name: 'Fields - Generic array: the array type (simple)',
124+
file: 'jsf-fields-array-simple', urlParameters: '?example=fields-array-simple', },
125+
{ name: 'Fields - Arrays with tabs: the tabarray type',
126+
file: 'jsf-fields-tabarray', urlParameters: '?example=fields-tabarray', },
127+
{ name: 'Fields - Arrays with tabs: the tabarray type w/ maxItems',
128+
file: 'jsf-fields-tabarray-maxitems', urlParameters: '?example=fields-tabarray-maxitems', },
129+
{ name: 'Fields - Arrays with tabs: the tabarray type w/ default & legend',
130+
file: 'jsf-fields-tabarray-value', urlParameters: '?example=fields-tabarray-value', },
131+
{ name: 'Fields - Alternative: the selectfieldset type',
132+
file: 'jsf-fields-selectfieldset', urlParameters: '?example=fields-selectfieldset', },
133+
{ name: 'Fields - Alternative with schema key',
134+
file: 'jsf-fields-selectfieldset-key', urlParameters: '?example=fields-selectfieldset-key', },
135+
{ name: 'Fields - Submit the form: the submit type',
136+
file: 'jsf-fields-submit', urlParameters: '?example=fields-submit', },
137+
{ name: 'Fields - Guide users: the help type',
138+
file: 'jsf-fields-help', urlParameters: '?example=fields-help', },
139+
{ name: 'Fields - Hidden form values: the hidden type',
140+
file: 'jsf-fields-hidden', urlParameters: '?example=fields-hidden', },
141+
{ name: 'Fields - Series of questions: the questions type',
142+
file: 'jsf-fields-questions', urlParameters: '?example=fields-questions', },
143+
{ name: 'Templating - item index with idx',
144+
file: 'jsf-templating-idx', urlParameters: '?example=templating-idx', },
145+
{ name: 'Templating - tab legend with value and valueInLegend',
146+
file: 'jsf-templating-value', urlParameters: '?example=templating-value', },
147+
{ name: 'Templating - values.xxx to reference another field',
148+
file: 'jsf-templating-values', urlParameters: '?example=templating-values', },
149+
{ name: 'Templating - Using the tpldata property',
150+
file: 'jsf-templating-tpldata', urlParameters: '?example=templating-tpldata', },
151+
{ name: 'Using event handlers',
152+
file: 'jsf-events', urlParameters: '?example=events', },
153+
{ name: 'Using previously submitted values',
154+
file: 'jsf-previousvalues', urlParameters: '?example=previousvalues', },
155+
{ name: 'Using previously submitted values - Multidimensional arrays',
156+
file: 'jsf-previousvalues-multidimensional', urlParameters: '?example=previousvalues-multidimensional', },
112157
]
113158
}
114159
};

src/demo/assets/example-schemas/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Sources:
22

3+
* ng-jsf-...json files are new examples created for angular2-json-schema-form
4+
35
* asf-...json files are Angular Schema Form compatibility examples,
46
[available here](http://schemaform.io/examples/bootstrap-example.html)
57

6-
* ng2jsf-...json files are new examples created for angular2-json-schema-form
7-
88
* jsf-...json files are JSONForm compatibility examples,
99
[available here](http://ulion.github.io/jsonform/playground/)
1010

0 commit comments

Comments
 (0)