pict-section-form 1.1.8 → 1.2.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 (61) hide show
  1. package/README.md +1 -1
  2. package/docs/Configuration.md +1 -0
  3. package/docs/Layouts.md +60 -0
  4. package/docs/_version.json +3 -3
  5. package/docs/examples/README.md +1 -1
  6. package/docs/examples/change_tracking/change_tracking.js +322 -20
  7. package/docs/examples/diagram_form/diagram_form_example.min.js +2 -2
  8. package/docs/examples/dynamic_analysis/dynamic_analysis_application.js +301 -20
  9. package/docs/examples/gradebook/README.md +43 -1
  10. package/docs/examples/gradebook/gradebook_application.min.js +2 -2
  11. package/docs/examples/ndt_field_test/ndt_field_test.js +322 -20
  12. package/docs/examples/richtext_form/richtext_form_example.min.js +2 -3
  13. package/docs/examples/scope_mathematics/scope_mathematics.js +322 -20
  14. package/docs/examples/simple_table/README.md +1 -0
  15. package/docs/examples/simple_table/simple_tabular_application.min.js +2 -2
  16. package/docs/examples/superhero_studio/superhero_studio_example.min.js +2 -3
  17. package/docs/index.html +2 -2
  18. package/docs/retold-catalog.json +1 -1
  19. package/docs/retold-keyword-index.json +10252 -9612
  20. package/example_applications/complex_table/Complex-Tabular-Application.js +5 -0
  21. package/example_applications/gradebook/Gradebook-Application.js +19 -4
  22. package/example_applications/gradebook/package.json +2 -2
  23. package/example_applications/simple_table/README-SimpleTable.md +9 -0
  24. package/example_applications/simple_table/Simple-Tabular-Application.js +6 -1
  25. package/package.json +4 -4
  26. package/source/global.d.ts +1 -0
  27. package/source/providers/inputs/Pict-Provider-Input-AutofillTriggerGroup.js +30 -0
  28. package/source/providers/inputs/Pict-Provider-Input-Diagram.js +87 -0
  29. package/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.js +11 -1
  30. package/source/providers/layouts/Pict-Layout-Tabular.js +639 -1
  31. package/source/views/Pict-View-Form-Metacontroller.js +59 -0
  32. package/test/Pict-View-Form-Metacontroller-Marshal_tests.js +100 -0
  33. package/test/PictSectionForm-Tabular-Features_tests.js +293 -0
  34. package/types/source/Pict-Section-Form.d.ts +3 -0
  35. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts +115 -0
  36. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts.map +1 -1
  37. package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts +24 -0
  38. package/types/source/providers/Pict-Provider-DynamicTabularData.d.ts.map +1 -1
  39. package/types/source/providers/Pict-Provider-DynamicTemplates.d.ts.map +1 -1
  40. package/types/source/providers/inputs/Pict-Provider-Input-AutofillTriggerGroup.d.ts.map +1 -1
  41. package/types/source/providers/inputs/Pict-Provider-Input-Diagram-CSS.d.ts +3 -0
  42. package/types/source/providers/inputs/Pict-Provider-Input-Diagram-CSS.d.ts.map +1 -0
  43. package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts +125 -0
  44. package/types/source/providers/inputs/Pict-Provider-Input-Diagram.d.ts.map +1 -0
  45. package/types/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.d.ts.map +1 -1
  46. package/types/source/providers/inputs/Pict-Provider-Input-RichText-CSS.d.ts +3 -0
  47. package/types/source/providers/inputs/Pict-Provider-Input-RichText-CSS.d.ts.map +1 -0
  48. package/types/source/providers/inputs/Pict-Provider-Input-RichText.d.ts +41 -0
  49. package/types/source/providers/inputs/Pict-Provider-Input-RichText.d.ts.map +1 -0
  50. package/types/source/providers/inputs/util/Themeify-SVG.d.ts +48 -0
  51. package/types/source/providers/inputs/util/Themeify-SVG.d.ts.map +1 -0
  52. package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts +200 -0
  53. package/types/source/providers/layouts/Pict-Layout-Tabular.d.ts.map +1 -1
  54. package/types/source/services/ManifestFactory.d.ts +29 -0
  55. package/types/source/services/ManifestFactory.d.ts.map +1 -1
  56. package/types/source/templates/Pict-Template-TabularEditingControls.d.ts +26 -0
  57. package/types/source/templates/Pict-Template-TabularEditingControls.d.ts.map +1 -0
  58. package/types/source/templates/Pict-Template-TabularRowLabels.d.ts +28 -0
  59. package/types/source/templates/Pict-Template-TabularRowLabels.d.ts.map +1 -0
  60. package/types/source/views/Pict-View-Form-Metacontroller.d.ts +22 -0
  61. package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
package/README.md CHANGED
@@ -291,7 +291,7 @@ Live, runnable example applications - click to open one in your browser:
291
291
  | Example | Description |
292
292
  |---------|-------------|
293
293
  | [Simple Table](https://fable-retold.github.io/pict-section-form/examples/simple_table/) | Tabular layout, reference manifests, and dot-notation access into nested data |
294
- | [Gradebook](https://fable-retold.github.io/pict-section-form/examples/gradebook/) | Stacked headers, row labels, dynamic columns, row/column selection, and sorting |
294
+ | [Gradebook](https://fable-retold.github.io/pict-section-form/examples/gradebook/) | Stacked headers, row labels, dynamic columns, row/column selection, sorting, and the persistent column chooser |
295
295
  | [Scope Mathematics](https://fable-retold.github.io/pict-section-form/examples/scope_mathematics/) | Solvers that reach across sections and the global form scope |
296
296
  | [Change Tracking](https://fable-retold.github.io/pict-section-form/examples/change_tracking/) | A change-detecting solver state machine with bidirectional recompute |
297
297
  | [NDT Field Test](https://fable-retold.github.io/pict-section-form/examples/ndt_field_test/) | Offline persistence, pick lists, pass/fail row solvers, and charts |
@@ -101,6 +101,7 @@ See [Layouts](Layouts.md) for full details and examples.
101
101
  | `RowSelection` | boolean/object | Add row checkboxes; selection persists in form data |
102
102
  | `ColumnSelection` | boolean/object | Add column checkboxes; selection persists in form data |
103
103
  | `ColumnSorting` | boolean | Add clickable sort controls to the prime header cells (default off) |
104
+ | `ColumnChooser` | boolean/object | Opt-in "Columns" menu to hide/show columns; the hidden set persists in form data |
104
105
 
105
106
  ### Layout Types
106
107
 
package/docs/Layouts.md CHANGED
@@ -330,6 +330,66 @@ works for both static and dynamic columns (dynamic columns sort by their
330
330
  `InformaryDataAddress` value). Values that parse as numbers sort numerically;
331
331
  others sort lexically.
332
332
 
333
+ ### Column Chooser
334
+
335
+ `ColumnChooser` (off by default - the feature is strictly **opt-in**) puts a
336
+ right-aligned **Columns** button above the table. Clicking it opens a menu of
337
+ checkboxes, one per column; unchecking a column hides it, checking it brings
338
+ it back. When columns are hidden the button reads `Columns (n hidden)` so the
339
+ user always knows part of the table is tucked away.
340
+
341
+ The hidden set is **stored in the form data** as an array of column hashes
342
+ (default address `<GroupHash>_HiddenColumns`), so - exactly like
343
+ `RowSelection` state - it round-trips with save / load: reload the saved form
344
+ data and the table comes back with the same columns hidden. When a host loads
345
+ form data carrying a different hidden set than the table was rendered with,
346
+ the layout detects the difference on marshal and rebuilds automatically.
347
+
348
+ Set it to `true` for defaults, or to an object:
349
+
350
+ | Property | Type | Description |
351
+ |----------|------|-------------|
352
+ | `Enabled` | boolean | Set `false` to disable (same as omitting) |
353
+ | `DataAddress` | string | Where the hidden-column-hash array is stored (default `<GroupHash>_HiddenColumns`) |
354
+ | `ButtonLabel` | string | Trigger button text (default `"Columns"`) |
355
+ | `DefaultHiddenColumns` | array | Column hashes hidden until the user changes visibility |
356
+
357
+ ```json
358
+ {
359
+ "Layout": "Tabular",
360
+ "RecordSetAddress": "Assignments",
361
+ "ColumnChooser": true
362
+ }
363
+ ```
364
+
365
+ A column can also start hidden via its descriptor: set
366
+ `PictForm.TabularDefaultHidden: true` and the column renders hidden until the
367
+ user shows it through the menu. Defaults (both forms) apply only while the
368
+ user has made **no** choice - they never write to the form data on their own.
369
+ The first checkbox the user toggles persists the full hidden set explicitly,
370
+ and the menu's **Reset to defaults** button writes the configured default set
371
+ back.
372
+
373
+ Behavioral guarantees:
374
+
375
+ - **Hiding never touches record data.** A hidden column's values stay in the
376
+ record set (same non-destructive invariant as `DynamicColumns`) and reappear
377
+ when the column is shown again.
378
+ - **The last visible column cannot be hidden** - the checkbox snaps back.
379
+ - **Stacked headers stay aligned.** User-supplied `Headers` rows shrink their
380
+ `ColumnSpan` past hidden columns (cells covering only hidden columns drop
381
+ out), and `HeaderGroupTemplate` super-headers re-cluster over the visible
382
+ columns.
383
+ - **Dynamic columns are choosable too** and persist by their generated hash,
384
+ so a hidden dynamic column stays hidden across data reloads that regenerate
385
+ it.
386
+ - **Statically hidden columns** (`PictForm.TabularHidden`) never appear in the
387
+ menu - they are configuration, not user preference.
388
+
389
+ The chooser composes with `ColumnSorting`, `RowSelection` / `ColumnSelection`,
390
+ `Headers`, `RowLabels`, and `DynamicColumns`; the gradebook example
391
+ application exercises all of them together.
392
+
333
393
  ## RecordSet Layout
334
394
 
335
395
  Similar to tabular but renders each record as a full form section rather
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "Name": "pict-section-form",
3
- "Version": "1.1.3",
3
+ "Version": "1.2.0",
4
4
  "Description": "Pict dynamic form sections",
5
- "GeneratedAt": "2026-06-05T01:24:25.804Z",
6
- "GitCommit": "14a5854"
5
+ "GeneratedAt": "2026-06-12T03:16:33.010Z",
6
+ "GitCommit": "877094e"
7
7
  }
@@ -101,7 +101,7 @@ node ServeExamples.js
101
101
  | [Change Tracking](change%5Ftracking/README.md) | Intermediate | Demonstrates the multi-input evaluate-on-change solver pattern for reacting to several fields at once. | [Launch](examples/change%5Ftracking/index.html) |
102
102
  | [Diagram Form Input](diagram%5Fform/README.md) | Intermediate | A pict-section-form field whose InputType is Diagram — boots in view mode (inline SVG, theme-recolorable), toggles into edit mode (Excalidraw) on demand. Demonstrates the themeify pipeline: change the --diagram-* CSS variables and the view-mode SVG visibly re-colors without a re-render. | [Launch](examples/diagram%5Fform/index.html) |
103
103
  | [Dynamic Analysis](dynamic%5Fanalysis/README.md) | Advanced | A fruit-nutrition analysis lab with dynamic section injection, solver rewriting, charts, and histograms. | [Launch](examples/dynamic%5Fanalysis/index.html) |
104
- | [Gradebook](gradebook/README.md) | Intermediate | An advanced tabular recordset with stacked headers, row labels, dynamic columns, row/column selection, and column sorting — built purely from manifest configuration. | [Launch](examples/gradebook/index.html) |
104
+ | [Gradebook](gradebook/README.md) | Intermediate | An advanced tabular recordset with stacked headers, row labels, dynamic columns, row/column selection, column sorting, and a persistent column chooser — built purely from manifest configuration. | [Launch](examples/gradebook/index.html) |
105
105
  | [NDT Field Test](ndt%5Ffield%5Ftest/README.md) | Advanced | A nuclear-density-testing field data-collection form with offline persistence and charted results. | [Launch](examples/ndt%5Ffield%5Ftest/index.html) |
106
106
  | [RichText Form Input](richtext%5Fform/README.md) | Intermediate | A pict-section-form field whose InputType is RichText — boots in view mode (rendered markdown), toggles into edit mode (CodeMirror) on demand. Demonstrates the AllowImages knob and the pluggable ImageUploader override. | [Launch](examples/richtext%5Fform/index.html) |
107
107
  | [Scope Mathematics](scope%5Fmathematics/README.md) | Intermediate | Shows solvers reaching across scopes to read and combine data from other sections of the form. | [Launch](examples/scope%5Fmathematics/index.html) |