pict-section-form 1.0.10 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/example_applications/Build-Examples.sh +41 -0
  3. package/example_applications/Clean-Examples.sh +10 -0
  4. package/example_applications/Open-Examples.sh +8 -0
  5. package/example_applications/README.md +57 -0
  6. package/example_applications/complex_table/Complex-Tabular-Application.js +219 -0
  7. package/example_applications/complex_table/FruitData.json +695 -0
  8. package/example_applications/complex_table/README-ComplexTable.md +31 -0
  9. package/example_applications/complex_table/html/index.html +13 -0
  10. package/example_applications/complex_table/package.json +26 -0
  11. package/example_applications/gradebook/source/Gradebook-Application.js +2 -1
  12. package/example_applications/gradebook/source/manifests/Assignment-Manifest.json +36 -1
  13. package/example_applications/gradebook/source/manifests/Gradebook-Manifest.js +20 -3
  14. package/example_applications/gradebook/source/manifests/Student-Manifest.json +34 -23
  15. package/example_applications/gradebook/source/views/BasicContent-View-Templates.json +42 -0
  16. package/example_applications/postcard_example/Pict-Application-Postcard.js +15 -0
  17. package/example_applications/postcard_example/providers/PictProvider-BestPostcardTheme.js +19 -46
  18. package/example_applications/postcard_example/providers/PictProvider-Dynamic-Sections-MockServerResponse.json +8 -4
  19. package/example_applications/simple_form/html/index.html +1 -1
  20. package/example_applications/simple_table/FruitData.json +693 -692
  21. package/example_applications/simple_table/Simple-Tabular-Application.js +6 -18
  22. package/example_applications/simple_table_from_object/FruitDataInAnObject.json +692 -2
  23. package/example_applications/simple_table_from_object/MigrateThatFruit.js +2 -2
  24. package/example_applications/simple_table_from_object/Simple-Tabular-Application-FromObject.js +5 -18
  25. package/package.json +3 -2
  26. package/source/Pict-Section-Form.js +6 -10
  27. package/source/{Pict-Section-Form-Application.js → application/Pict-Application-Form.js} +1 -1
  28. package/source/providers/Pict-Provider-DynamicSolver.js +264 -0
  29. package/source/{Pict-Section-Form-Provider-Templates-DefaultFormTemplates.js → providers/Pict-Provider-DynamicTemplates-DefaultFormTemplates.js} +88 -77
  30. package/source/{Pict-Section-Form-Provider-Templates.js → providers/Pict-Provider-DynamicTemplates.js} +4 -1
  31. package/source/{Pict-Service-Informary.js → providers/Pict-Provider-Informary.js} +13 -4
  32. package/source/templates/Pict-Template-Base.js +87 -0
  33. package/source/{Pict-Template-MetacontrollerValueSetWithGroup.js → templates/Pict-Template-Metacontroller-ValueSetWithGroup.js} +1 -1
  34. package/source/{Pict-Section-Form-View-DefaultConfiguration.json → views/Pict-View-DynamicForm-DefaultConfiguration.json} +1 -0
  35. package/source/{Pict-Section-Form-View.js → views/Pict-View-DynamicForm.js} +149 -38
  36. package/source/{Pict-Form-Metacontroller.js → views/Pict-View-Form-Metacontroller.js} +45 -15
  37. /package/source/{Pict-Section-Form-MetatemplateGenerator.js → providers/Pict-Provider-MetatemplateGenerator.js} +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ "workbench.colorTheme": "FreshCut"
3
+ }
@@ -0,0 +1,41 @@
1
+ #!/bin/sh
2
+
3
+ # Building complex_table
4
+ pushd complex_table
5
+ npm run build
6
+ popd
7
+
8
+ # Building gradebook
9
+ pushd gradebook
10
+ npm run build
11
+ popd
12
+
13
+ # Building manifest_testbed
14
+ pushd manifest_testbed
15
+ npm run build
16
+ popd
17
+
18
+ # Building manyfest_editor
19
+ pushd manyfest_editor
20
+ npm run build
21
+ popd
22
+
23
+ # Building postcard_example
24
+ pushd postcard_example
25
+ npm run build
26
+ popd
27
+
28
+ # Building simple_form
29
+ pushd simple_form
30
+ npm run build
31
+ popd
32
+
33
+ # Building simple_table
34
+ pushd simple_table
35
+ npm run build
36
+ popd
37
+
38
+ # Building simple_table_from_object
39
+ pushd simple_table_from_object
40
+ npm run build
41
+ popd
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+
3
+ rm -rf ./complex_table/dist
4
+ rm -rf ./gradebook/dist
5
+ rm -rf ./manifest_testbed/dist
6
+ rm -rf ./manyfest_editor/dist
7
+ rm -rf ./postcard_example/dist
8
+ rm -rf ./simple_form/dist
9
+ rm -rf ./simple_table/dist
10
+ rm -rf ./simple_table_from_object/dist
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+
3
+ open ./complex_table/dist/index.html
4
+ open ./gradebook/dist/index.html
5
+ open ./postcard_example/dist/index.html
6
+ open ./simple_form/dist/index.html
7
+ open ./simple_table/dist/index.html
8
+ open ./simple_table_from_object/dist/index.html
@@ -0,0 +1,57 @@
1
+ # Example Applications
2
+
3
+ These applications exercise the library from very basic to complex.
4
+
5
+ ## The Basics
6
+
7
+ These forms are meant to provide simple configuration-based test
8
+ suites for the framework.
9
+
10
+ ### Simple Form
11
+
12
+ The most basic example. A small one file form with some basic math
13
+ and inputs. No styling, no jquery just a very basic manifest.
14
+
15
+ ### Simple Table
16
+
17
+ A simple example of a tabular form. Loads up some data about fruit
18
+ and shows a few columns. Single file, all configuration.
19
+
20
+ ### Simple Table from Object
21
+
22
+ A simple example of a tabular form pulling rows from a plain old
23
+ javascript object as opposed to an array. Single file, all
24
+ configuration.
25
+
26
+ ### Complex Table
27
+
28
+ A more complex tabular form example that uses the fruit data again
29
+ and performs mathematical solves across each row, and aggregation
30
+ functions down. Single file, all configuration, no code.
31
+
32
+ ## Advanced
33
+
34
+ ### Postcard
35
+
36
+ A silly mock startup example with a form and other views to toggle
37
+ between. Multiple forms sections, shows an example of creating a
38
+ theme.
39
+
40
+ ### Gradebook
41
+
42
+ A full fledged application built in the framework, using the tools
43
+ as intended by design. Multiple grids, math and data persistence
44
+ in the browser.
45
+
46
+ ## Cheat List of Examples for Scripting and Joy
47
+
48
+ ```
49
+ complex_table
50
+ gradebook
51
+ manifest_testbed
52
+ manyfest_editor
53
+ postcard_example
54
+ simple_form
55
+ simple_table
56
+ simple_table_from_object
57
+ ```
@@ -0,0 +1,219 @@
1
+ const libPictSectionForm = require('../../source/Pict-Section-Form.js');
2
+
3
+ module.exports = libPictSectionForm.PictFormApplication;
4
+
5
+ module.exports.default_configuration = libPictSectionForm.PictFormApplication.default_configuration;
6
+ module.exports.default_configuration.pict_configuration = (
7
+ {
8
+ "Product": "SimpleTable",
9
+
10
+ "DefaultAppData": require('./FruitData.json'),
11
+
12
+ "DefaultFormManifest":
13
+ {
14
+ "Scope": "SuperSimpleTabularForm",
15
+
16
+ "Sections": [
17
+ {
18
+ "Hash": "Recipe",
19
+ "Name": "Fruit-based Recipe",
20
+
21
+
22
+ "Solvers":
23
+ [
24
+ "TotalFruitCalories = SUM(FruitNutritionCalories)",
25
+ "AverageFruitCalories = MEAN(FruitNutritionCalories)",
26
+ { "Ordinal": 99, "Expression": "AverageFatPercent = MEAN(FruitPercentTotalFat)"},
27
+ "RecipeCounterSurfaceArea = RecipeCounterWidth * RecipeCounterDepth",
28
+ "RecipeCounterVolume = RecipeCounterSurfaceArea * RecipeVerticalClearance",
29
+ ],
30
+
31
+ "Groups": [
32
+ {
33
+ "Hash": "Recipe",
34
+ "Name": "Recipe",
35
+ },
36
+ {
37
+ "Hash": "Statistics",
38
+ "Name": "Statistics",
39
+ },
40
+ {
41
+ "Hash": "FruitStatistics",
42
+ "Name": "Statistics About the Fruit",
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "Hash": "FruitGrid",
48
+ "Name": "Fruits of the World",
49
+ "Groups": [
50
+ {
51
+
52
+ "Hash": "FruitGrid",
53
+ "Name": "FruitGrid",
54
+
55
+ "Layout": "Tabular",
56
+
57
+ "RecordSetSolvers": [
58
+ {"Ordinal": 0, "Expression": "PercentTotalFat = (Fat * 9) / Calories"}
59
+ ],
60
+ "RecordSetAddress": "FruitData.FruityVice",
61
+ "RecordManifest": "FruitEditor"
62
+ }
63
+ ]
64
+ },
65
+ ],
66
+
67
+ "Descriptors":
68
+ {
69
+ "RecipeName": { "Name": "Recipe Name", "Hash": "RecipeName", "DataType": "String", "PictForm": { "Section": "Recipe", "Group": "Recipe" } },
70
+ "RecipeType": { "Name": "Recipe Type", "Hash": "RecipeType", "DataType": "String", "PictForm": { "Section": "Recipe", "Group": "Recipe" } },
71
+ "RecipeDescription": { "Name": "Description", "Hash": "RecipeDescription", "DataType": "String", "PictForm": { "Section": "Recipe", "Group": "Recipe" } },
72
+ "Inventor": { "Name": "Inventor", "Hash": "Inventor", "DataType": "String", "PictForm": { "Section": "Recipe", "Group": "Recipe" } },
73
+
74
+ "Recipe.Feeds": {
75
+ "Name": "Feeds", "Hash": "RecipeFeeds", "DataType": "PreciseNumber", "Default": "1",
76
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 1, "Width": 1 }
77
+ },
78
+ "Recipe.TotalCalories": {
79
+ "Name": "Calories in the Fruits", "Hash": "RecipeCalories", "DataType": "PreciseNumber", "Default": "1",
80
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 1, "Width": 1 }
81
+ },
82
+
83
+ "Recipe.CounterWidth": {
84
+ "Name": "Counter Prep Width Requirements", "Hash": "RecipeCounterWidth", "DataType": "PreciseNumber", "Default": "10",
85
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 2, "Width": 1 }
86
+ },
87
+ "Recipe.CounterDepth": {
88
+ "Name": "Counter Prep Depth Requirements", "Hash": "RecipeCounterDepth", "DataType": "PreciseNumber", "Default": "5",
89
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 2, "Width": 1 }
90
+ },
91
+ "Recipe.CounterSurfaceArea": {
92
+ "Name": "Required Counter Surface Area", "Hash": "RecipeCounterSurfaceArea", "DataType": "PreciseNumber",
93
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 2, "Width": 1 }
94
+ },
95
+
96
+ "Recipe.VerticalClearance": {
97
+ "Name": "Prep Vertical Clearance", "Hash": "RecipeVerticalClearance", "DataType": "PreciseNumber", "Default": "12",
98
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 3, "Width": 1 }
99
+ },
100
+ "Recipe.PrepVolume": {
101
+ "Name": "Preparation Volume Requirements", "Hash": "RecipeCounterVolume", "DataType": "PreciseNumber",
102
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 3, "Width": 1 }
103
+ },
104
+ "Recipe.MoistureContent": {
105
+ "Name": "Required Moisture Content", "Hash": "RecipeMoistureContent", "DataType": "PreciseNumber",
106
+ "PictForm": { "Section": "Recipe", "Group": "Statistics", "Row": 3, "Width": 1 }
107
+ },
108
+
109
+ "FruitStats.TotalCalories": {
110
+ "Name": "Total Calories in All Fruits", "Hash": "TotalFruitCalories", "DataType": "PreciseNumber",
111
+ "PictForm": { "Section": "Recipe", "Group": "FruitStatistics", "Row": 1, "Width": 1 }
112
+ },
113
+ "FruitStats.AverageCalories": {
114
+ "Name": "Average (mean) Calories in All Fruits", "Hash": "AverageFruitCalories", "DataType": "PreciseNumber",
115
+ "PictForm": { "Section": "Recipe", "Group": "FruitStatistics", "Row": 1, "Width": 1 }
116
+ },
117
+ "FruitStats.AverageFatPercent": {
118
+ "Name": "Average (mean) Fat Percentage in All Fruits", "Hash": "AverageFatPercent", "DataType": "PreciseNumber",
119
+ "PictForm": { "Section": "Recipe", "Group": "FruitStatistics", "Row": 1, "Width": 1 }
120
+ },
121
+
122
+
123
+
124
+ "FruitData.FruityVice":
125
+ {
126
+ "Name": "Fruits of the Earth",
127
+ "Hash": "FruitGrid",
128
+ "DataType": "Array",
129
+ "Default": []
130
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
131
+ },
132
+
133
+ "FruitData.FruityVice[].nutritions.calories":
134
+ {
135
+ "Hash": "FruitNutritionCalories"
136
+ },
137
+ "FruitData.FruityVice[].nutritions.percent_total_fat":
138
+ {
139
+ "Hash": "FruitPercentTotalFat"
140
+ },
141
+ },
142
+
143
+ "ReferenceManifests":
144
+ {
145
+ "FruitEditor":
146
+ {
147
+ "Scope": "FruitEditor",
148
+
149
+ "Descriptors":
150
+ {
151
+ "name":
152
+ {
153
+ "Name": "Fruit Name",
154
+ "Hash": "Name",
155
+ "DataType": "String",
156
+ "Default": "(unnamed fruit)"
157
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
158
+ },
159
+ "family":
160
+ {
161
+ "Name": "Family",
162
+ "Hash": "Family",
163
+ "DataType": "String"
164
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
165
+ },
166
+ "order":
167
+ {
168
+ "Name": "Order",
169
+ "Hash": "Order",
170
+ "DataType": "String"
171
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
172
+ },
173
+ "genus":
174
+ {
175
+ "Name": "Genus",
176
+ "Hash": "Genus",
177
+ "DataType": "String"
178
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
179
+ },
180
+ "nutritions.calories":
181
+ {
182
+ "Name": "Calories",
183
+ "Hash": "Calories",
184
+ "DataType": "Number"
185
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
186
+ },
187
+ "nutritions.fat":
188
+ {
189
+ "Name": "Fat",
190
+ "Hash": "Fat",
191
+ "DataType": "Number"
192
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
193
+ },
194
+ "nutritions.carbohydrates":
195
+ {
196
+ "Name": "Carbohydrates",
197
+ "Hash": "Carbs",
198
+ "DataType": "Number"
199
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
200
+ },
201
+ "nutritions.protein":
202
+ {
203
+ "Name": "Protein",
204
+ "Hash": "Protein",
205
+ "DataType": "Number"
206
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
207
+ },
208
+ "nutritions.percent_total_fat":
209
+ {
210
+ "Name": "PercentTotalFat",
211
+ "Hash": "PercentTotalFat",
212
+ "DataType": "Number"
213
+ , "PictForm": { "Section": "FruitGrid", "Group": "FruitGrid" }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ });