pict-section-formeditor 1.0.0

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 (178) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -0
  3. package/docs/.nojekyll +0 -0
  4. package/docs/README.md +162 -0
  5. package/docs/_sidebar.md +23 -0
  6. package/docs/_topbar.md +5 -0
  7. package/docs/cover.md +12 -0
  8. package/docs/css/docuserve.css +73 -0
  9. package/docs/index.html +39 -0
  10. package/docs/retold-catalog.json +224 -0
  11. package/docs/retold-keyword-index.json +46846 -0
  12. package/example_applications/form_editor/.quackage.json +10 -0
  13. package/example_applications/form_editor/FormEditor-Example-Application.js +226 -0
  14. package/example_applications/form_editor/html/icon-chooser.html +375 -0
  15. package/example_applications/form_editor/html/index.html +54 -0
  16. package/example_applications/form_editor/package.json +50 -0
  17. package/package.json +55 -0
  18. package/sample_manifests/Complex-Table.json +974 -0
  19. package/sample_manifests/Distill-Example.json +200 -0
  20. package/sample_manifests/Gradebook-Assignment.json +38 -0
  21. package/sample_manifests/Gradebook-Student.json +40 -0
  22. package/sample_manifests/Manyfest-Editor.json +347 -0
  23. package/sample_manifests/Simple-Form.json +232 -0
  24. package/sample_manifests/Simple-Table.json +79 -0
  25. package/source/Pict-Section-FormEditor-DefaultConfiguration.js +3321 -0
  26. package/source/Pict-Section-FormEditor.js +35 -0
  27. package/source/providers/Pict-Provider-ChildPictManager-Application.js +40 -0
  28. package/source/providers/Pict-Provider-ChildPictManager.js +238 -0
  29. package/source/providers/Pict-Provider-FormEditorDocumentation.js +356 -0
  30. package/source/providers/Pict-Provider-FormEditorDragDrop.js +535 -0
  31. package/source/providers/Pict-Provider-FormEditorIconography.js +1002 -0
  32. package/source/providers/Pict-Provider-FormEditorManifestOps.js +1443 -0
  33. package/source/providers/Pict-Provider-FormEditorRendering.js +730 -0
  34. package/source/providers/Pict-Provider-FormEditorUtilities.js +862 -0
  35. package/source/providers/Pict-Provider-PreviewCSS.js +42 -0
  36. package/source/views/PictView-FormEditor-InlineEditing.js +309 -0
  37. package/source/views/PictView-FormEditor-InputTypePicker.js +532 -0
  38. package/source/views/PictView-FormEditor-PropertiesPanel.js +7730 -0
  39. package/source/views/PictView-FormEditor.js +681 -0
  40. package/test/Pict-Section-FormEditor_tests.js +4102 -0
  41. package/user-documentation/.pict_documentation_topics.json +695 -0
  42. package/user-documentation/Getting-Started.md +32 -0
  43. package/user-documentation/Groups.md +52 -0
  44. package/user-documentation/Inputs.md +98 -0
  45. package/user-documentation/Sections.md +36 -0
  46. package/user-documentation/Shortcuts.md +44 -0
  47. package/user-documentation/Solver-Expression-Walkthrough.md +176 -0
  48. package/user-documentation/Solver-Expressions-Advanced.md +344 -0
  49. package/user-documentation/Solver-Functions.md +213 -0
  50. package/user-documentation/Solvers.md +81 -0
  51. package/user-documentation/ToC.md +18 -0
  52. package/user-documentation/solverfunctions/abs.md +84 -0
  53. package/user-documentation/solverfunctions/aggregationhistogram.md +83 -0
  54. package/user-documentation/solverfunctions/aggregationhistogrambyobject.md +64 -0
  55. package/user-documentation/solverfunctions/arrayconcat.md +64 -0
  56. package/user-documentation/solverfunctions/avg.md +81 -0
  57. package/user-documentation/solverfunctions/bucketset.md +69 -0
  58. package/user-documentation/solverfunctions/ceil.md +70 -0
  59. package/user-documentation/solverfunctions/cleanvaluearray.md +66 -0
  60. package/user-documentation/solverfunctions/cleanvalueobject.md +68 -0
  61. package/user-documentation/solverfunctions/colorgroupbackground.md +60 -0
  62. package/user-documentation/solverfunctions/colorinputbackground.md +62 -0
  63. package/user-documentation/solverfunctions/colorinputbackgroundtabular.md +64 -0
  64. package/user-documentation/solverfunctions/colorsectionbackground.md +59 -0
  65. package/user-documentation/solverfunctions/compare.md +72 -0
  66. package/user-documentation/solverfunctions/concat.md +73 -0
  67. package/user-documentation/solverfunctions/concatraw.md +73 -0
  68. package/user-documentation/solverfunctions/cos.md +75 -0
  69. package/user-documentation/solverfunctions/count.md +73 -0
  70. package/user-documentation/solverfunctions/countset.md +65 -0
  71. package/user-documentation/solverfunctions/countsetelements.md +63 -0
  72. package/user-documentation/solverfunctions/createarrayfromabsolutevalues.md +63 -0
  73. package/user-documentation/solverfunctions/createvalueobjectbyhashes.md +69 -0
  74. package/user-documentation/solverfunctions/cumulativesummation.md +96 -0
  75. package/user-documentation/solverfunctions/dateadddays.md +79 -0
  76. package/user-documentation/solverfunctions/dateaddhours.md +74 -0
  77. package/user-documentation/solverfunctions/dateaddmilliseconds.md +65 -0
  78. package/user-documentation/solverfunctions/dateaddminutes.md +72 -0
  79. package/user-documentation/solverfunctions/dateaddmonths.md +74 -0
  80. package/user-documentation/solverfunctions/dateaddseconds.md +66 -0
  81. package/user-documentation/solverfunctions/dateaddweeks.md +73 -0
  82. package/user-documentation/solverfunctions/dateaddyears.md +74 -0
  83. package/user-documentation/solverfunctions/datedaydifference.md +84 -0
  84. package/user-documentation/solverfunctions/datefromparts.md +81 -0
  85. package/user-documentation/solverfunctions/datehourdifference.md +64 -0
  86. package/user-documentation/solverfunctions/datemathadd.md +72 -0
  87. package/user-documentation/solverfunctions/datemilliseconddifference.md +64 -0
  88. package/user-documentation/solverfunctions/dateminutedifference.md +64 -0
  89. package/user-documentation/solverfunctions/datemonthdifference.md +66 -0
  90. package/user-documentation/solverfunctions/dateseconddifference.md +64 -0
  91. package/user-documentation/solverfunctions/dateweekdifference.md +65 -0
  92. package/user-documentation/solverfunctions/dateyeardifference.md +64 -0
  93. package/user-documentation/solverfunctions/differencearrays.md +59 -0
  94. package/user-documentation/solverfunctions/disablesolverordinal.md +58 -0
  95. package/user-documentation/solverfunctions/distributionhistogram.md +96 -0
  96. package/user-documentation/solverfunctions/distributionhistogrambyobject.md +64 -0
  97. package/user-documentation/solverfunctions/enablesolverordinal.md +57 -0
  98. package/user-documentation/solverfunctions/entryinset.md +72 -0
  99. package/user-documentation/solverfunctions/euler.md +77 -0
  100. package/user-documentation/solverfunctions/exp.md +74 -0
  101. package/user-documentation/solverfunctions/findfirstvaluebyexactmatch.md +67 -0
  102. package/user-documentation/solverfunctions/findfirstvaluebystringincludes.md +67 -0
  103. package/user-documentation/solverfunctions/flatten.md +76 -0
  104. package/user-documentation/solverfunctions/floor.md +70 -0
  105. package/user-documentation/solverfunctions/gaussianelimination.md +75 -0
  106. package/user-documentation/solverfunctions/generatearrayofobjectsfromsets.md +70 -0
  107. package/user-documentation/solverfunctions/generatehtmlhexcolor.md +67 -0
  108. package/user-documentation/solverfunctions/getvalue.md +90 -0
  109. package/user-documentation/solverfunctions/getvaluearray.md +64 -0
  110. package/user-documentation/solverfunctions/getvalueobject.md +67 -0
  111. package/user-documentation/solverfunctions/hidesections.md +58 -0
  112. package/user-documentation/solverfunctions/if.md +109 -0
  113. package/user-documentation/solverfunctions/iterativeseries.md +107 -0
  114. package/user-documentation/solverfunctions/join.md +75 -0
  115. package/user-documentation/solverfunctions/joinraw.md +64 -0
  116. package/user-documentation/solverfunctions/largestinset.md +63 -0
  117. package/user-documentation/solverfunctions/leastsquares.md +66 -0
  118. package/user-documentation/solverfunctions/linest.md +58 -0
  119. package/user-documentation/solverfunctions/log.md +74 -0
  120. package/user-documentation/solverfunctions/logvalues.md +65 -0
  121. package/user-documentation/solverfunctions/match.md +71 -0
  122. package/user-documentation/solverfunctions/matrixinverse.md +67 -0
  123. package/user-documentation/solverfunctions/matrixmultiply.md +71 -0
  124. package/user-documentation/solverfunctions/matrixtranspose.md +72 -0
  125. package/user-documentation/solverfunctions/matrixvectormultiply.md +69 -0
  126. package/user-documentation/solverfunctions/max.md +73 -0
  127. package/user-documentation/solverfunctions/mean.md +63 -0
  128. package/user-documentation/solverfunctions/median.md +79 -0
  129. package/user-documentation/solverfunctions/min.md +73 -0
  130. package/user-documentation/solverfunctions/mode.md +66 -0
  131. package/user-documentation/solverfunctions/objectkeystoarray.md +66 -0
  132. package/user-documentation/solverfunctions/objectvaluessortbyexternalobjectarray.md +65 -0
  133. package/user-documentation/solverfunctions/objectvaluestoarray.md +67 -0
  134. package/user-documentation/solverfunctions/percent.md +75 -0
  135. package/user-documentation/solverfunctions/pi.md +77 -0
  136. package/user-documentation/solverfunctions/polynomialregression.md +69 -0
  137. package/user-documentation/solverfunctions/predict.md +71 -0
  138. package/user-documentation/solverfunctions/rad.md +85 -0
  139. package/user-documentation/solverfunctions/randomfloat.md +63 -0
  140. package/user-documentation/solverfunctions/randomfloatbetween.md +72 -0
  141. package/user-documentation/solverfunctions/randomfloatupto.md +65 -0
  142. package/user-documentation/solverfunctions/randominteger.md +56 -0
  143. package/user-documentation/solverfunctions/randomintegerbetween.md +72 -0
  144. package/user-documentation/solverfunctions/randomintegerupto.md +64 -0
  145. package/user-documentation/solverfunctions/refreshtabularsection.md +57 -0
  146. package/user-documentation/solverfunctions/resolvehtmlentities.md +64 -0
  147. package/user-documentation/solverfunctions/round.md +111 -0
  148. package/user-documentation/solverfunctions/runsolvers.md +49 -0
  149. package/user-documentation/solverfunctions/setconcatenate.md +64 -0
  150. package/user-documentation/solverfunctions/setgroupvisibility.md +60 -0
  151. package/user-documentation/solverfunctions/setsectionvisibility.md +59 -0
  152. package/user-documentation/solverfunctions/setsolverordinalenabled.md +59 -0
  153. package/user-documentation/solverfunctions/settabularrowlength.md +57 -0
  154. package/user-documentation/solverfunctions/setvalue.md +65 -0
  155. package/user-documentation/solverfunctions/showsections.md +58 -0
  156. package/user-documentation/solverfunctions/sin.md +83 -0
  157. package/user-documentation/solverfunctions/slice.md +80 -0
  158. package/user-documentation/solverfunctions/smallestinset.md +63 -0
  159. package/user-documentation/solverfunctions/sortarray.md +58 -0
  160. package/user-documentation/solverfunctions/sorthistogram.md +70 -0
  161. package/user-documentation/solverfunctions/sorthistogrambykeys.md +69 -0
  162. package/user-documentation/solverfunctions/sortset.md +75 -0
  163. package/user-documentation/solverfunctions/sqrt.md +85 -0
  164. package/user-documentation/solverfunctions/stdev.md +81 -0
  165. package/user-documentation/solverfunctions/stdeva.md +58 -0
  166. package/user-documentation/solverfunctions/stdevp.md +83 -0
  167. package/user-documentation/solverfunctions/stringcountsegments.md +66 -0
  168. package/user-documentation/solverfunctions/stringgetsegments.md +74 -0
  169. package/user-documentation/solverfunctions/subtractingsummation.md +66 -0
  170. package/user-documentation/solverfunctions/sum.md +78 -0
  171. package/user-documentation/solverfunctions/tan.md +78 -0
  172. package/user-documentation/solverfunctions/tofixed.md +75 -0
  173. package/user-documentation/solverfunctions/unionarrays.md +59 -0
  174. package/user-documentation/solverfunctions/uniquearray.md +58 -0
  175. package/user-documentation/solverfunctions/var.md +67 -0
  176. package/user-documentation/solverfunctions/vara.md +58 -0
  177. package/user-documentation/solverfunctions/varp.md +66 -0
  178. package/user-documentation/solverfunctions/when.md +98 -0
@@ -0,0 +1,49 @@
1
+ # runsolvers
2
+
3
+ Triggers a re-execution of all solver expressions across all form views.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ runsolvers()
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ This function takes no parameters.
14
+
15
+ ## Returns
16
+
17
+ Void. This function does not return a value.
18
+
19
+ ## Description
20
+
21
+ The `runsolvers` function triggers a complete re-execution of all active solver expressions across all form views. This forces a full recalculation pass, which can be necessary after programmatic changes to form state that would not otherwise trigger solver execution. Use this function with caution, as calling it from within a solver can create infinite loops if not properly controlled with ordinal gating.
22
+
23
+ ## Examples
24
+
25
+ ### Triggering a solver re-run
26
+
27
+ ```expression
28
+ runsolvers()
29
+ // Triggers re-execution of all active solver expressions
30
+ ```
31
+
32
+ ## Use Cases
33
+
34
+ - **Forcing recalculation**: Trigger a full solver pass after programmatically modifying application state
35
+ - **Synchronization**: Ensure all calculated values are up to date after bulk data changes
36
+ - **Chain reactions**: Propagate changes that require multiple solver passes to fully resolve
37
+
38
+ ## Related Functions
39
+
40
+ - [setsolverordinalenabled](./setsolverordinalenabled.md) - Enables or disables solvers with a specific ordinal
41
+ - [enablesolverordinal](./enablesolverordinal.md) - Enables all solvers with the specified ordinal
42
+ - [disablesolverordinal](./disablesolverordinal.md) - Disables all solvers with the specified ordinal
43
+
44
+ ## Notes
45
+
46
+ - Use with caution: calling `runsolvers()` from within a solver expression can create infinite loops
47
+ - Protect against infinite loops by using ordinal gating (disable the calling ordinal before invoking `runsolvers`)
48
+ - All active (enabled) solver ordinals will execute in order
49
+ - Disabled ordinals are skipped during the re-execution
@@ -0,0 +1,64 @@
1
+ # setconcatenate
2
+
3
+ Concatenates two arrays into one.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ setconcatenate(array1, array2)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `array1` | Array | First array |
16
+ | `array2` | Array | Second array |
17
+
18
+ ## Returns
19
+
20
+ Array - Combined array with elements from both inputs.
21
+
22
+ ## Description
23
+
24
+ The `setconcatenate` function combines two arrays into a single array by appending the second array to the first.
25
+
26
+ ## Examples
27
+
28
+ ### Basic Usage
29
+
30
+ ```expression
31
+ Result = SETCONCATENATE([1, 2, 3], [4, 5, 6])
32
+ // Result: [1, 2, 3, 4, 5, 6]
33
+ ```
34
+
35
+ ### Combining Data
36
+
37
+ ```expression
38
+ AllItems = SETCONCATENATE(Category1Items, Category2Items)
39
+ ```
40
+
41
+ ### Multiple Concatenations
42
+
43
+ ```expression
44
+ Combined = SETCONCATENATE(SETCONCATENATE(Set1, Set2), Set3)
45
+ ```
46
+
47
+ ## Use Cases
48
+
49
+ - **Data merging**: Combine datasets
50
+ - **Aggregation**: Collect from multiple sources
51
+ - **Array building**: Build arrays incrementally
52
+ - **Set union**: Combine sets (may have duplicates)
53
+
54
+ ## Related Functions
55
+
56
+ - [arrayconcat](./arrayconcat.md) - Alternative concatenation
57
+ - [flatten](./flatten.md) - Flatten nested arrays
58
+ - [countset](./countset.md) - Count combined elements
59
+
60
+ ## Notes
61
+
62
+ - Does not remove duplicates
63
+ - Order is preserved (array1 then array2)
64
+ - Uses the Math service's `setConcatenate` method
@@ -0,0 +1,60 @@
1
+ # setgroupvisibility
2
+
3
+ Sets a specific group's visibility within a section.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ setgroupvisibility(sectionHash, groupHash, visible)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `sectionHash` | String | The hash identifier of the section containing the group |
16
+ | `groupHash` | String | The hash identifier of the group |
17
+ | `visible` | Boolean | `true` to show the group, `false` to hide it |
18
+
19
+ ## Returns
20
+
21
+ Void. This function does not return a value.
22
+
23
+ ## Description
24
+
25
+ The `setgroupvisibility` function controls the visibility of a specific group within a form section. Groups are subdivisions within sections that contain one or more form inputs. This function allows fine-grained control over which groups of inputs are visible, enabling more detailed conditional display logic than section-level visibility alone.
26
+
27
+ ## Examples
28
+
29
+ ### Toggling a group based on a condition
30
+
31
+ ```expression
32
+ setgroupvisibility("S1", "S1_G2", ShowDetails)
33
+ // If ShowDetails is true, group S1_G2 within section S1 is shown
34
+ // If ShowDetails is false, group S1_G2 within section S1 is hidden
35
+ ```
36
+
37
+ ### Hiding a group
38
+
39
+ ```expression
40
+ setgroupvisibility("ContactInfo", "AlternateAddress", false)
41
+ // Hides the AlternateAddress group within the ContactInfo section
42
+ ```
43
+
44
+ ## Use Cases
45
+
46
+ - **Fine-grained visibility**: Show or hide individual groups of inputs within a section
47
+ - **Conditional fields**: Display additional input groups based on user selections
48
+ - **Progressive disclosure**: Reveal groups of related fields as the user provides information
49
+
50
+ ## Related Functions
51
+
52
+ - [setsectionvisibility](./setsectionvisibility.md) - Sets a specific section's visibility
53
+ - [showsections](./showsections.md) - Makes the specified form sections visible
54
+ - [hidesections](./hidesections.md) - Hides the specified form sections
55
+
56
+ ## Notes
57
+
58
+ - Both the section hash and group hash must match hashes defined in the form configuration
59
+ - The group retains its data in the application state regardless of visibility
60
+ - The parent section must be visible for group visibility changes to have a visual effect
@@ -0,0 +1,59 @@
1
+ # setsectionvisibility
2
+
3
+ Sets a specific section's visibility.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ setsectionvisibility(sectionHash, visible)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `sectionHash` | String | The hash identifier of the section |
16
+ | `visible` | Boolean or String | `true`/`false` or `"1"`/`"0"` to set visibility |
17
+
18
+ ## Returns
19
+
20
+ Void. This function does not return a value.
21
+
22
+ ## Description
23
+
24
+ The `setsectionvisibility` function sets the visibility of a single form section based on a boolean or string value. Unlike `showsections` and `hidesections` which operate on lists, this function targets one section and accepts a dynamic visibility value. This makes it ideal for binding section visibility directly to a calculated or user-driven boolean expression.
25
+
26
+ ## Examples
27
+
28
+ ### Toggling visibility based on a flag
29
+
30
+ ```expression
31
+ setsectionvisibility("AdvancedOptions", ShowAdvanced)
32
+ // If ShowAdvanced is true, the AdvancedOptions section is shown
33
+ // If ShowAdvanced is false, the AdvancedOptions section is hidden
34
+ ```
35
+
36
+ ### Using a string value
37
+
38
+ ```expression
39
+ setsectionvisibility("ExtraFields", "1")
40
+ // Shows the ExtraFields section
41
+ ```
42
+
43
+ ## Use Cases
44
+
45
+ - **Dynamic visibility**: Bind a section's visibility to a checkbox or toggle input
46
+ - **Calculated visibility**: Show or hide a section based on the result of a solver expression
47
+ - **Conditional display**: Control section visibility using any boolean-producing expression
48
+
49
+ ## Related Functions
50
+
51
+ - [showsections](./showsections.md) - Makes the specified form sections visible
52
+ - [hidesections](./hidesections.md) - Hides the specified form sections
53
+ - [setgroupvisibility](./setgroupvisibility.md) - Sets a specific group's visibility within a section
54
+
55
+ ## Notes
56
+
57
+ - The `visible` parameter accepts boolean values (`true`/`false`) or string equivalents (`"1"`/`"0"`)
58
+ - The section hash must match a hash defined in the form configuration
59
+ - The section retains its data in the application state regardless of visibility
@@ -0,0 +1,59 @@
1
+ # setsolverordinalenabled
2
+
3
+ Enables or disables all solvers with the specified ordinal number.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ setsolverordinalenabled(ordinal, enabled)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `ordinal` | Integer | The ordinal number of the solver group to enable or disable |
16
+ | `enabled` | Boolean | `true` to enable the solvers, `false` to disable them |
17
+
18
+ ## Returns
19
+
20
+ Void. This function does not return a value.
21
+
22
+ ## Description
23
+
24
+ The `setsolverordinalenabled` function controls whether all solvers assigned to a specific ordinal number are executed during solver runs. Solvers are organized by ordinal numbers that determine their execution order. By disabling an ordinal, all solvers at that ordinal are skipped during execution. This enables conditional execution of entire groups of solver expressions based on form state, user input, or other conditions.
25
+
26
+ ## Examples
27
+
28
+ ### Toggling solvers based on a mode flag
29
+
30
+ ```expression
31
+ setsolverordinalenabled(2, IsAdvancedMode)
32
+ // If IsAdvancedMode is true, ordinal 2 solvers run; otherwise they are skipped
33
+ ```
34
+
35
+ ### Disabling a solver group
36
+
37
+ ```expression
38
+ setsolverordinalenabled(5, false)
39
+ // Disables all solvers with ordinal 5
40
+ ```
41
+
42
+ ## Use Cases
43
+
44
+ - **Conditional solver execution**: Enable or disable groups of solvers based on form state
45
+ - **Performance optimization**: Skip unnecessary solver calculations when they are not relevant
46
+ - **Mode switching**: Enable different sets of solvers for different form modes (e.g., basic vs. advanced)
47
+
48
+ ## Related Functions
49
+
50
+ - [enablesolverordinal](./enablesolverordinal.md) - Enables all solvers with the specified ordinal
51
+ - [disablesolverordinal](./disablesolverordinal.md) - Disables all solvers with the specified ordinal
52
+ - [runsolvers](./runsolvers.md) - Triggers re-execution of all solver expressions
53
+
54
+ ## Notes
55
+
56
+ - Disabled ordinals skip execution entirely during solver runs
57
+ - Used for conditional execution of entire groups of solvers
58
+ - The ordinal number must correspond to an ordinal defined in the solver configuration
59
+ - Changes take effect on the next solver run
@@ -0,0 +1,57 @@
1
+ # settabularrowlength
2
+
3
+ Sets the number of rows in a tabular data group.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ settabularrowlength(sectionHash, groupHash, length)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `sectionHash` | String | The hash identifier of the section containing the tabular group |
16
+ | `groupHash` | String | The hash identifier of the tabular group |
17
+ | `length` | Integer | The desired number of rows |
18
+
19
+ ## Returns
20
+
21
+ Void. This function does not return a value.
22
+
23
+ ## Description
24
+
25
+ The `settabularrowlength` function sets the number of rows in a tabular data group to the specified length. If the current number of rows is less than the specified length, new rows are added. If the current number is greater, excess rows may be removed depending on the optional fourth parameter. This function is useful for programmatically controlling the size of tabular data sections based on external data or user input.
26
+
27
+ ## Examples
28
+
29
+ ### Setting a table to 10 rows
30
+
31
+ ```expression
32
+ settabularrowlength("DataSection", "DataGroup", 10)
33
+ // Sets the DataGroup table in DataSection to have exactly 10 rows
34
+ ```
35
+
36
+ ### Setting row count with deletion of extra rows
37
+
38
+ ```expression
39
+ settabularrowlength("Orders", "LineItems", RequiredRows, true)
40
+ // Sets the row count and deletes any extra rows beyond RequiredRows
41
+ ```
42
+
43
+ ## Use Cases
44
+
45
+ - **Data loading**: Set the correct number of rows when loading external data into a tabular group
46
+ - **Dynamic row management**: Adjust the number of rows based on a calculated value or user selection
47
+ - **Initialization**: Pre-populate a tabular section with a specific number of empty rows
48
+
49
+ ## Related Functions
50
+
51
+ - [refreshtabularsection](./refreshtabularsection.md) - Forces a tabular section to re-render its display
52
+
53
+ ## Notes
54
+
55
+ - Optional fourth parameter is a boolean that controls whether extra rows are deleted when reducing the row count
56
+ - The section and group hashes must match hashes defined in the form configuration
57
+ - Adding rows creates empty rows with default values
@@ -0,0 +1,65 @@
1
+ # setvalue
2
+
3
+ Sets a value in the application state at the specified path.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ setvalue(address, value)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `address` | String | Dot-notation path to the state location (must be quoted) |
16
+ | `value` | Any | The value to set at the specified path |
17
+
18
+ ## Returns
19
+
20
+ Void. This function does not return a value.
21
+
22
+ ## Description
23
+
24
+ The `setvalue` function writes a value into the application state at the location specified by the address parameter. The address uses dot-notation to identify the path within the state object. This function is essential for solver expressions that need to store calculated results, update form fields, or modify application state based on computed values. The address parameter must be a quoted string.
25
+
26
+ ## Examples
27
+
28
+ ### Setting a calculated total
29
+
30
+ ```expression
31
+ setvalue("AppData.TotalPrice", Price * Quantity)
32
+ // Sets the TotalPrice field in AppData to the product of Price and Quantity
33
+ ```
34
+
35
+ ### Setting a status flag
36
+
37
+ ```expression
38
+ setvalue("FormState.IsComplete", true)
39
+ // Sets the IsComplete flag to true
40
+ ```
41
+
42
+ ### Setting a nested value
43
+
44
+ ```expression
45
+ setvalue("Order.Summary.GrandTotal", Subtotal + Tax + Shipping)
46
+ // Sets a deeply nested value in the application state
47
+ ```
48
+
49
+ ## Use Cases
50
+
51
+ - **Storing calculations**: Write the results of solver calculations back into the application state
52
+ - **Updating form fields**: Programmatically set the value of form inputs
53
+ - **Managing state flags**: Set boolean flags or status values based on form conditions
54
+ - **Cross-section data sharing**: Write values that can be read by other sections or solvers
55
+
56
+ ## Related Functions
57
+
58
+ - [logvalues](./logvalues.md) - Logs values to the browser console for debugging
59
+
60
+ ## Notes
61
+
62
+ - The address must be a quoted string using dot-notation (e.g., `"AppData.Field"`)
63
+ - The value can be any type: string, number, boolean, array, or object
64
+ - Setting a value does not automatically trigger a solver re-run
65
+ - The path will be created if it does not already exist in the state
@@ -0,0 +1,58 @@
1
+ # showsections
2
+
3
+ Makes the specified form sections visible.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ showsections(sectionHashes)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `sectionHashes` | Array or String | An array of section hash strings, or a single section hash string |
16
+
17
+ ## Returns
18
+
19
+ Void. This function does not return a value.
20
+
21
+ ## Description
22
+
23
+ The `showsections` function makes one or more form sections visible on the page. You can pass either an array of section hash strings to show multiple sections at once, or a single string to show one section. This is commonly used in conjunction with solver logic to conditionally display parts of a form based on user input or other state.
24
+
25
+ ## Examples
26
+
27
+ ### Showing multiple sections from an array
28
+
29
+ ```expression
30
+ showsections(VisibleSectionList)
31
+ // Where VisibleSectionList is an array like ["S1", "S3"]
32
+ // Makes sections S1 and S3 visible
33
+ ```
34
+
35
+ ### Showing a single section
36
+
37
+ ```expression
38
+ showsections("AdvancedOptions")
39
+ // Makes the AdvancedOptions section visible
40
+ ```
41
+
42
+ ## Use Cases
43
+
44
+ - **Conditional form display**: Show sections of a form based on user selections or calculated state
45
+ - **Progressive disclosure**: Reveal additional form sections as the user completes earlier sections
46
+ - **Role-based visibility**: Show different sections depending on user role or permissions
47
+
48
+ ## Related Functions
49
+
50
+ - [hidesections](./hidesections.md) - Hides the specified form sections
51
+ - [setsectionvisibility](./setsectionvisibility.md) - Sets a specific section's visibility with a boolean
52
+ - [setgroupvisibility](./setgroupvisibility.md) - Sets a specific group's visibility within a section
53
+
54
+ ## Notes
55
+
56
+ - Accepts either an array of section hash strings or a single string
57
+ - Section hashes must match the hashes defined in the form configuration
58
+ - Does not affect the visibility of groups within the sections
@@ -0,0 +1,83 @@
1
+ # sin
2
+
3
+ Calculates the sine of an angle (in radians).
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ sin(radians)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `radians` | Number/String | The angle in radians |
16
+
17
+ ## Returns
18
+
19
+ String - The sine of the angle.
20
+
21
+ ## Description
22
+
23
+ The `sin` function calculates the sine of an angle. The input must be in radians. Use the `rad()` function to convert degrees to radians if needed.
24
+
25
+ ## Examples
26
+
27
+ ### Basic Usage
28
+
29
+ ```expression
30
+ Result = sin(0)
31
+ // Result: "0"
32
+
33
+ Result = sin(1.5707963267948966) // π/2
34
+ // Result: "1" (approximately)
35
+ ```
36
+
37
+ ### Converting from Degrees
38
+
39
+ ```expression
40
+ // Sine of 60 degrees
41
+ Result = sin(rad(60))
42
+ // Result: "0.8660254037844386"
43
+
44
+ // Sine of 90 degrees
45
+ Result = sin(rad(90))
46
+ // Result: "1"
47
+ ```
48
+
49
+ ### In Complex Expressions
50
+
51
+ ```expression
52
+ // From unit tests
53
+ Result = sqrt(100 * (C + 30)) + sin(Depth - Width) / 10
54
+ // With C=-13, Depth=100.203, Width=10.5
55
+ // Result: "41.32965489638783839821"
56
+ ```
57
+
58
+ ### Waveform Calculations
59
+
60
+ ```expression
61
+ // Simple harmonic motion
62
+ Position = Amplitude * sin(Frequency * Time + Phase)
63
+ ```
64
+
65
+ ## Use Cases
66
+
67
+ - **Trigonometry**: Triangle calculations
68
+ - **Physics**: Wave motion, oscillations, projectile motion
69
+ - **Graphics**: Rotation, animation
70
+ - **Engineering**: Signal processing, vibration analysis
71
+
72
+ ## Related Functions
73
+
74
+ - [cos](./cos.md) - Cosine
75
+ - [tan](./tan.md) - Tangent
76
+ - [rad](./rad.md) - Convert degrees to radians
77
+ - [pi](./pi.md) - Pi constant
78
+
79
+ ## Notes
80
+
81
+ - Input must be in radians, not degrees
82
+ - Use `rad(degrees)` to convert from degrees
83
+ - Uses JavaScript's `Math.sin()` internally
@@ -0,0 +1,80 @@
1
+ # slice
2
+
3
+ Extracts a portion of an array.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ slice(array, start)
9
+ slice(array, start, end)
10
+ ```
11
+
12
+ ## Parameters
13
+
14
+ | Parameter | Type | Description |
15
+ |-----------|------|-------------|
16
+ | `array` | Array | The array to slice |
17
+ | `start` | Number | Starting index (0-based) |
18
+ | `end` | Number | Ending index (optional, exclusive) |
19
+
20
+ ## Returns
21
+
22
+ Array - A new array containing the extracted elements.
23
+
24
+ ## Description
25
+
26
+ The `slice` function extracts a section of an array and returns it as a new array. The original array is not modified.
27
+
28
+ ## Examples
29
+
30
+ ### Basic Usage
31
+
32
+ ```expression
33
+ Result = SLICE([1, 2, 3, 4, 5], 1, 4)
34
+ // Result: [2, 3, 4]
35
+ ```
36
+
37
+ ### From Start Index to End
38
+
39
+ ```expression
40
+ // Get everything from index 2 onwards
41
+ Result = SLICE([1, 2, 3, 4, 5], 2)
42
+ // Result: [3, 4, 5]
43
+ ```
44
+
45
+ ### First N Elements
46
+
47
+ ```expression
48
+ // Get first 3 elements
49
+ TopThree = SLICE(SortedScores, 0, 3)
50
+ ```
51
+
52
+ ### Pagination
53
+
54
+ ```expression
55
+ // Get page of results
56
+ PageSize = 10
57
+ PageStart = (PageNumber - 1) * PageSize
58
+ PageData = SLICE(AllData, PageStart, PageStart + PageSize)
59
+ ```
60
+
61
+ ## Use Cases
62
+
63
+ - **Pagination**: Extract page of results
64
+ - **Top N**: Get first N elements
65
+ - **Data sampling**: Extract subset of data
66
+ - **Range selection**: Select specific range
67
+
68
+ ## Related Functions
69
+
70
+ - [sortset](./sortset.md) - Sort before slicing
71
+ - [flatten](./flatten.md) - Flatten before slicing
72
+ - [count](./count.md) - Get array length
73
+
74
+ ## Notes
75
+
76
+ - Start index is 0-based
77
+ - End index is exclusive
78
+ - Negative indices may not be supported
79
+ - Does not modify original array
80
+ - Uses JavaScript array slice behavior
@@ -0,0 +1,63 @@
1
+ # smallestinset
2
+
3
+ Returns the smallest value from a set/array.
4
+
5
+ ## Syntax
6
+
7
+ ```
8
+ smallestinset(set)
9
+ ```
10
+
11
+ ## Parameters
12
+
13
+ | Parameter | Type | Description |
14
+ |-----------|------|-------------|
15
+ | `set` | Array | The array of values |
16
+
17
+ ## Returns
18
+
19
+ String - The smallest value in the set.
20
+
21
+ ## Description
22
+
23
+ The `smallestinset` function finds and returns the smallest (minimum) value from an array. This is an alternative to the `min` function specifically designed for set operations.
24
+
25
+ ## Examples
26
+
27
+ ### Basic Usage
28
+
29
+ ```expression
30
+ Result = SMALLESTINSET([5, 2, 8, 1, 9])
31
+ // Result: "1"
32
+ ```
33
+
34
+ ### With Data
35
+
36
+ ```expression
37
+ LowestPrice = SMALLESTINSET(FLATTEN(AppData.Products.price))
38
+ ```
39
+
40
+ ### Temperature Data
41
+
42
+ ```expression
43
+ MinTemp = SMALLESTINSET(DailyTemperatures)
44
+ ```
45
+
46
+ ## Use Cases
47
+
48
+ - **Analysis**: Find minimum values
49
+ - **Thresholds**: Determine lower bounds
50
+ - **Comparisons**: Find lowest in category
51
+ - **Validation**: Check minimum constraints
52
+
53
+ ## Related Functions
54
+
55
+ - [largestinset](./largestinset.md) - Find maximum value
56
+ - [min](./min.md) - Alternative minimum function
57
+ - [sortset](./sortset.md) - Sort to find extremes
58
+
59
+ ## Notes
60
+
61
+ - Returns result as string
62
+ - Works with numeric values
63
+ - Uses the Math service's `smallestInSet` method