pict-section-form 1.0.31 → 1.0.33

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 (51) hide show
  1. package/debug/PICTSection-TabularManifests.json +14 -18
  2. package/debug/ParseCSV-CustomManifestCSVFactory.js +27 -0
  3. package/debug/ParseCSV.js +2 -1
  4. package/debug/TabularManifestCSV.csv +20 -20
  5. package/debug/data/ExampleForm.json +14 -18
  6. package/package.json +3 -3
  7. package/source/application/Pict-Application-Form.js +14 -1
  8. package/source/providers/Pict-Provider-DynamicInput.js +20 -0
  9. package/source/providers/Pict-Provider-DynamicInputEvents.js +30 -0
  10. package/source/providers/Pict-Provider-DynamicLayout.js +7 -0
  11. package/source/providers/Pict-Provider-DynamicRecordSet.js +35 -0
  12. package/source/providers/Pict-Provider-DynamicTabularData.js +62 -0
  13. package/source/providers/Pict-Provider-MetaLists.js +19 -0
  14. package/source/providers/Pict-Provider-MetatemplateGenerator.js +63 -5
  15. package/source/providers/Pict-Provider-MetatemplateMacros.js +16 -0
  16. package/source/providers/layouts/Pict-Layout-TuiGrid.js +57 -1
  17. package/source/services/ManifestFactory.js +26 -9
  18. package/source/templates/Pict-Template-Metacontroller-ValueSetWithGroup.js +17 -0
  19. package/source/views/Pict-View-DynamicForm.js +289 -36
  20. package/source/views/Pict-View-Form-Metacontroller.js +39 -1
  21. package/types/application/Pict-Application-Form.d.ts +14 -0
  22. package/types/application/Pict-Application-Form.d.ts.map +1 -1
  23. package/types/providers/Pict-Provider-DynamicInput.d.ts +23 -3
  24. package/types/providers/Pict-Provider-DynamicInput.d.ts.map +1 -1
  25. package/types/providers/Pict-Provider-DynamicInputEvents.d.ts +34 -4
  26. package/types/providers/Pict-Provider-DynamicInputEvents.d.ts.map +1 -1
  27. package/types/providers/Pict-Provider-DynamicLayout.d.ts +8 -1
  28. package/types/providers/Pict-Provider-DynamicLayout.d.ts.map +1 -1
  29. package/types/providers/Pict-Provider-DynamicRecordSet.d.ts +40 -5
  30. package/types/providers/Pict-Provider-DynamicRecordSet.d.ts.map +1 -1
  31. package/types/providers/Pict-Provider-DynamicTabularData.d.ts +70 -8
  32. package/types/providers/Pict-Provider-DynamicTabularData.d.ts.map +1 -1
  33. package/types/providers/Pict-Provider-MetaLists.d.ts +22 -3
  34. package/types/providers/Pict-Provider-MetaLists.d.ts.map +1 -1
  35. package/types/providers/Pict-Provider-MetatemplateGenerator.d.ts +67 -5
  36. package/types/providers/Pict-Provider-MetatemplateGenerator.d.ts.map +1 -1
  37. package/types/providers/Pict-Provider-MetatemplateMacros.d.ts +16 -0
  38. package/types/providers/Pict-Provider-MetatemplateMacros.d.ts.map +1 -1
  39. package/types/providers/layouts/Pict-Layout-TuiGrid.d.ts +54 -7
  40. package/types/providers/layouts/Pict-Layout-TuiGrid.d.ts.map +1 -1
  41. package/types/services/ManifestFactory.d.ts +16 -0
  42. package/types/services/ManifestFactory.d.ts.map +1 -1
  43. package/types/templates/Pict-Template-Metacontroller-ValueSetWithGroup.d.ts +18 -2
  44. package/types/templates/Pict-Template-Metacontroller-ValueSetWithGroup.d.ts.map +1 -1
  45. package/types/views/Pict-View-DynamicForm.d.ts +279 -34
  46. package/types/views/Pict-View-DynamicForm.d.ts.map +1 -1
  47. package/types/views/Pict-View-Form-Metacontroller.d.ts +44 -2
  48. package/types/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
  49. package/debug/data/ExampleFormTest.js +0 -4
  50. package/debug/data/html/index.html +0 -13
  51. package/debug/data/package.json +0 -27
@@ -59,7 +59,6 @@
59
59
  "InputType": "Option",
60
60
  "Row": "3",
61
61
  "Width": "1",
62
- "Units": "planetary",
63
62
  "SelectOptions": [
64
63
  {
65
64
  "id": "Earth",
@@ -79,7 +78,9 @@
79
78
  }
80
79
  ],
81
80
  "Section": "Header",
82
- "Group": "General_Info"
81
+ "Group": "General_Info",
82
+ "Units": "planetary",
83
+ "New": "Y"
83
84
  }
84
85
  },
85
86
  "Header.Location.Address": {
@@ -91,7 +92,8 @@
91
92
  "Row": "1",
92
93
  "Width": "1",
93
94
  "Section": "Header",
94
- "Group": "Address"
95
+ "Group": "Address",
96
+ "ExternalDatabaseID": "A-001"
95
97
  }
96
98
  },
97
99
  "Header.Location.City": {
@@ -127,7 +129,8 @@
127
129
  "Row": "2",
128
130
  "Width": "1",
129
131
  "Section": "Header",
130
- "Group": "Address"
132
+ "Group": "Address",
133
+ "ExternalDatabaseID": "A-003"
131
134
  }
132
135
  },
133
136
  "Header.Location.Country": {
@@ -158,14 +161,7 @@
158
161
  "Hash": "PackageAddress",
159
162
  "Name": "PackageAddress",
160
163
  "DataAddress": "Inventory.Packages",
161
- "DataType": "Array",
162
- "PictForm": {
163
- "InputType": "TabularAddress",
164
- "Row": "1",
165
- "Width": "3",
166
- "Section": "Package_Dimensions",
167
- "Group": "Size"
168
- }
164
+ "DataType": "Array"
169
165
  },
170
166
  "Packages[].Area": {
171
167
  "Hash": "AreaSet",
@@ -283,9 +279,9 @@
283
279
  "PictForm": {
284
280
  "Row": "2",
285
281
  "Width": "1",
286
- "Units": "inches",
287
282
  "Section": "Package_Dimensions",
288
- "Group": "Size"
283
+ "Group": "Size",
284
+ "Units": "inches"
289
285
  },
290
286
  "IsTabular": true
291
287
  },
@@ -297,9 +293,9 @@
297
293
  "PictForm": {
298
294
  "Row": "2",
299
295
  "Width": "1",
300
- "Units": "inches",
301
296
  "Section": "Package_Dimensions",
302
- "Group": "Size"
297
+ "Group": "Size",
298
+ "Units": "inches"
303
299
  },
304
300
  "IsTabular": true
305
301
  },
@@ -311,9 +307,9 @@
311
307
  "PictForm": {
312
308
  "Row": "3",
313
309
  "Width": "2",
314
- "Units": "square inches",
315
310
  "Section": "Package_Dimensions",
316
- "Group": "Size"
311
+ "Group": "Size",
312
+ "Units": "square inches"
317
313
  },
318
314
  "IsTabular": true
319
315
  }
@@ -0,0 +1,27 @@
1
+ const libManifestFactory = require('../source/services/ManifestFactory.js');
2
+
3
+ class CustomManifestCSVFactory extends libManifestFactory
4
+ {
5
+ constructor(pFable, pSettings, pServiceHash)
6
+ {
7
+ super(pFable, pSettings, pServiceHash);
8
+ }
9
+
10
+ onTabularRowAddDescriptor(pIncomingDescriptor, pSection, pGroup, pNewDescriptor)
11
+ {
12
+ if (pIncomingDescriptor.Units)
13
+ {
14
+ pNewDescriptor.PictForm.Units = pIncomingDescriptor.Units;
15
+ }
16
+ if (pIncomingDescriptor['External Database ID'])
17
+ {
18
+ pNewDescriptor.PictForm.ExternalDatabaseID = pIncomingDescriptor['External Database ID'];
19
+ }
20
+ if (pIncomingDescriptor['New'])
21
+ {
22
+ pNewDescriptor.PictForm.New = pIncomingDescriptor['New'];
23
+ }
24
+ }
25
+ }
26
+
27
+ module.exports = CustomManifestCSVFactory;
package/debug/ParseCSV.js CHANGED
@@ -43,7 +43,8 @@ class ImportCSVCommand extends libPictCommandLineUtility.ServiceCommandLineComma
43
43
  }
44
44
 
45
45
  // The ManifestFactory gives us a programmatic way to manage Manifest config consistently
46
- this.fable.addAndInstantiateServiceType('ManifestFactory', require('../source/services/ManifestFactory.js'));
46
+ this.fable.addAndInstantiateServiceType('ManifestFactory', require('./ParseCSV-CustomManifestCSVFactory.js'));
47
+ //this.fable.addAndInstantiateServiceType('ManifestFactory', require('../source/services/ManifestFactory.js'));
47
48
  // Initialize the CSV parser
48
49
  this.fable.instantiateServiceProvider('CSVParser');
49
50
  this.fable.instantiateServiceProvider('FilePersistence');
@@ -1,20 +1,20 @@
1
- Form,Form Name,SubManifest,DataOnly,Section Name,Group Name,Row,Width,Input Address,Input Name,Input Hash,Input Extra,Units,DataType,InputType,Equation,Default,Description,Tooltiup,Input Notes
2
- ExampleForm,Example Form,,,Header,General Info,1,1,Header.FirstName,First Name,HeaderFirstName,,,String,,,,,,
3
- ExampleForm,,,,Header,General Info,1,1,Header.LastName,Last Name,HeaderLastName,,,String,,,,,,
4
- ExampleForm,,,,Header,General Info,1,2,Header.JobTitle,Job Title,JobTitle,,,String,,,,,,
5
- ExampleForm,,,,Header,General Info,2,4,Header.Description,Description,Description,,,String,,,,,,
6
- ExampleForm,,,,Header,General Info,3,1,Header.Planet,Planet,Planet,"Earth,Mars,Saturn,Jupiter",planetary,String,Option,,,,,
7
- ExampleForm,,,,Header,Address,1,1,Header.Location.Address,Address,Address,,,String,,,,,,
8
- ExampleForm,,,,Header,Address,2,2,Header.Location.City,City,City,,,String,,,,,,
9
- ExampleForm,,,,Header,Address,2,2,Header.Location.State,State,State,,,String,,,,,,
10
- ExampleForm,,,,Header,Address,2,1,Header.Location.Zip,Zip,Zip,,,String,,,,,,
11
- ExampleForm,,,,Header,Address,3,1,Header.Location.Country,Country,Country,,,String,,,,,,
12
- ExampleForm,,,,Header,Address,3,1,Header.Location.Phone,Phone,Phone,,,String,,,,,,
13
- ExampleForm,,Packages,1,Package Dimensions,Size,1,3,Inventory.Packages,PackageAddress,PackageAddress,,,Array,TabularAddress,,,,,
14
- ExampleForm,,Packages,,Package Dimensions,Size,1,3,Name,Package Name,PackageName,,,String,,,,,,
15
- ExampleForm,,Packages,,Package Dimensions,Size,1,1,ReceiveDate,Receive Date,ReceiveDate,,,DateTime,,,,,,
16
- ExampleForm,,Packages,,Package Dimensions,Size,2,1,Width,Width,Width,,inches,Number,,,,,,
17
- ExampleForm,,Packages,,Package Dimensions,Size,2,1,Height,Height,Height,,inches,Number,,,,,,
18
- ExampleForm,,Packages,,Package Dimensions,Size,3,2,Area,Area,Area,,square inches,Number,,Area = Width * Height,,,,
19
- ExampleForm,,,,Totals,Aggregate Data,1,1,Packages[].Area,AreaSet,AreaSet,,,Number,Ignored,,,,,
20
- ExampleForm,,,,Totals,Aggregate Data,1,1,Aggregate.StorageVolume,Storage Volume Required,StorageVolume,,,Number,,,,,,
1
+ Form,Form Name,SubManifest,DataOnly,Section Name,Group Name,Row,Width,Input Address,Input Name,Input Hash,Input Extra,Units,External Database ID,New,DataType,InputType,Equation,Default,Description,Tooltiup,Input Notes
2
+ ExampleForm,Example Form,,,Header,General Info,1,1,Header.FirstName,First Name,HeaderFirstName,,,,,String,,,,,,
3
+ ExampleForm,,,,Header,General Info,1,1,Header.LastName,Last Name,HeaderLastName,,,,,String,,,,,,
4
+ ExampleForm,,,,Header,General Info,1,2,Header.JobTitle,Job Title,JobTitle,,,,,String,,,,,,
5
+ ExampleForm,,,,Header,General Info,2,4,Header.Description,Description,Description,,,,,String,,,,,,
6
+ ExampleForm,,,,Header,General Info,3,1,Header.Planet,Planet,Planet,"Earth,Mars,Saturn,Jupiter",planetary,,Y,String,Option,,,,,
7
+ ExampleForm,,,,Header,Address,1,1,Header.Location.Address,Address,Address,,,A-001,,String,,,,,,
8
+ ExampleForm,,,,Header,Address,2,2,Header.Location.City,City,City,,,,,String,,,,,,
9
+ ExampleForm,,,,Header,Address,2,2,Header.Location.State,State,State,,,,,String,,,,,,
10
+ ExampleForm,,,,Header,Address,2,1,Header.Location.Zip,Zip,Zip,,,A-003,,String,,,,,,
11
+ ExampleForm,,,,Header,Address,3,1,Header.Location.Country,Country,Country,,,,,String,,,,,,
12
+ ExampleForm,,,,Header,Address,3,1,Header.Location.Phone,Phone,Phone,,,,,String,,,,,,
13
+ ExampleForm,,Packages,1,Package Dimensions,Size,1,3,Inventory.Packages,PackageAddress,PackageAddress,,,X-11,,Array,TabularAddress,,,,,
14
+ ExampleForm,,Packages,,Package Dimensions,Size,1,3,Name,Package Name,PackageName,,,,,String,,,,,,
15
+ ExampleForm,,Packages,,Package Dimensions,Size,1,1,ReceiveDate,Receive Date,ReceiveDate,,,,,DateTime,,,,,,
16
+ ExampleForm,,Packages,,Package Dimensions,Size,2,1,Width,Width,Width,,inches,,,Number,,,,,,
17
+ ExampleForm,,Packages,,Package Dimensions,Size,2,1,Height,Height,Height,,inches,,,Number,,,,,,
18
+ ExampleForm,,Packages,,Package Dimensions,Size,3,2,Area,Area,Area,,square inches,,,Number,,Area = Width * Height,,,,
19
+ ExampleForm,,,,Totals,Aggregate Data,1,1,Packages[].Area,AreaSet,AreaSet,,,,,Number,Ignored,,,,,
20
+ ExampleForm,,,,Totals,Aggregate Data,1,1,Aggregate.StorageVolume,Storage Volume Required,StorageVolume,,,,,Number,,,,,,
@@ -58,7 +58,6 @@
58
58
  "InputType": "Option",
59
59
  "Row": "3",
60
60
  "Width": "1",
61
- "Units": "planetary",
62
61
  "SelectOptions": [
63
62
  {
64
63
  "id": "Earth",
@@ -78,7 +77,9 @@
78
77
  }
79
78
  ],
80
79
  "Section": "Header",
81
- "Group": "General_Info"
80
+ "Group": "General_Info",
81
+ "Units": "planetary",
82
+ "New": "Y"
82
83
  }
83
84
  },
84
85
  "Header.Location.Address": {
@@ -90,7 +91,8 @@
90
91
  "Row": "1",
91
92
  "Width": "1",
92
93
  "Section": "Header",
93
- "Group": "Address"
94
+ "Group": "Address",
95
+ "ExternalDatabaseID": "A-001"
94
96
  }
95
97
  },
96
98
  "Header.Location.City": {
@@ -126,7 +128,8 @@
126
128
  "Row": "2",
127
129
  "Width": "1",
128
130
  "Section": "Header",
129
- "Group": "Address"
131
+ "Group": "Address",
132
+ "ExternalDatabaseID": "A-003"
130
133
  }
131
134
  },
132
135
  "Header.Location.Country": {
@@ -157,14 +160,7 @@
157
160
  "Hash": "PackageAddress",
158
161
  "Name": "PackageAddress",
159
162
  "DataAddress": "Inventory.Packages",
160
- "DataType": "Array",
161
- "PictForm": {
162
- "InputType": "TabularAddress",
163
- "Row": "1",
164
- "Width": "3",
165
- "Section": "Package_Dimensions",
166
- "Group": "Size"
167
- }
163
+ "DataType": "Array"
168
164
  },
169
165
  "Packages[].Area": {
170
166
  "Hash": "AreaSet",
@@ -282,9 +278,9 @@
282
278
  "PictForm": {
283
279
  "Row": "2",
284
280
  "Width": "1",
285
- "Units": "inches",
286
281
  "Section": "Package_Dimensions",
287
- "Group": "Size"
282
+ "Group": "Size",
283
+ "Units": "inches"
288
284
  },
289
285
  "IsTabular": true
290
286
  },
@@ -296,9 +292,9 @@
296
292
  "PictForm": {
297
293
  "Row": "2",
298
294
  "Width": "1",
299
- "Units": "inches",
300
295
  "Section": "Package_Dimensions",
301
- "Group": "Size"
296
+ "Group": "Size",
297
+ "Units": "inches"
302
298
  },
303
299
  "IsTabular": true
304
300
  },
@@ -310,9 +306,9 @@
310
306
  "PictForm": {
311
307
  "Row": "3",
312
308
  "Width": "2",
313
- "Units": "square inches",
314
309
  "Section": "Package_Dimensions",
315
- "Group": "Size"
310
+ "Group": "Size",
311
+ "Units": "square inches"
316
312
  },
317
313
  "IsTabular": true
318
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -27,9 +27,9 @@
27
27
  "author": "steven velozo <steven@velozo.com>",
28
28
  "license": "MIT",
29
29
  "devDependencies": {
30
- "@eslint/js": "^9.8.0",
30
+ "@eslint/js": "^9.9.0",
31
31
  "browser-env": "^3.3.0",
32
- "eslint": "^9.8.0",
32
+ "eslint": "^9.9.0",
33
33
  "jquery": "^3.7.1",
34
34
  "pict": "^1.0.214",
35
35
  "pict-application": "^1.0.20",
@@ -1,8 +1,15 @@
1
1
  const libPictApplication = require('pict-application');
2
- //const libPictApplication = require('../../../pict-application/source/Pict-Application.js');
3
2
 
4
3
  const libPictSectionForm = require('../Pict-Section-Form.js');
5
4
 
5
+ /**
6
+ * Represents a PictSectionFormApplication.
7
+ *
8
+ * This is the automagic controller for a dyncamic form application.
9
+ *
10
+ * @class
11
+ * @extends libPictApplication
12
+ */
6
13
  class PictSectionFormApplication extends libPictApplication
7
14
  {
8
15
  constructor(pFable, pOptions, pServiceHash)
@@ -16,11 +23,17 @@ class PictSectionFormApplication extends libPictApplication
16
23
  this.pict.addView('PictFormMetacontroller', {}, libPictSectionForm.PictFormMetacontroller);
17
24
  }
18
25
 
26
+ /**
27
+ * Marshals data from any rendered dynamic views to application data.
28
+ */
19
29
  marshalDataFromDynamicViewsToAppData()
20
30
  {
21
31
  this.pict.views.PictFormMetacontroller.marshalFromView();
22
32
  }
23
33
 
34
+ /**
35
+ * Marshals data from the application data to any rendered dynamic views.
36
+ */
24
37
  marshalDataFromAppDataToDynamicViews()
25
38
  {
26
39
  this.pict.views.PictFormMetacontroller.marshalToView();
@@ -30,6 +30,13 @@ class PictDynamicInput extends libPictProvider
30
30
  this.templateProviderMap = {};
31
31
  }
32
32
 
33
+ /**
34
+ * Retrieves the template hash for the input based on the provided view and input.
35
+ *
36
+ * @param {View} pView - The view object.
37
+ * @param {Input} pInput - The input object.
38
+ * @returns {string|boolean} - The template hash if found, otherwise false.
39
+ */
33
40
  getInputTemplateHash(pView, pInput)
34
41
  {
35
42
  if (pInput.IsTabular)
@@ -80,6 +87,12 @@ class PictDynamicInput extends libPictProvider
80
87
  return false;
81
88
  }
82
89
 
90
+ /**
91
+ * Adds a default input provider for a given template full hash.
92
+ *
93
+ * @param {string} pTemplateFullHash - The full hash of the template.
94
+ * @param {any} pProvider - The provider to be added.
95
+ */
83
96
  addDefaultInputProvider(pTemplateFullHash, pProvider)
84
97
  {
85
98
  if (!(pTemplateFullHash in this.templateProviderMap))
@@ -92,6 +105,13 @@ class PictDynamicInput extends libPictProvider
92
105
  }
93
106
  }
94
107
 
108
+ /**
109
+ * Retrieves the default input providers based on the given view and input.
110
+ *
111
+ * @param {string} pView - The view to retrieve input providers for.
112
+ * @param {string} pInput - The input to retrieve input providers for.
113
+ * @returns {Array} An array of default input providers.
114
+ */
95
115
  getDefaultInputProviders(pView, pInput)
96
116
  {
97
117
  let tmpTemplateHash = this.getInputTemplateHash(pView, pInput);
@@ -28,6 +28,12 @@ class PictDynamicInputEvents extends libPictProvider
28
28
  super(pFable, tmpOptions, pServiceHash);
29
29
  }
30
30
 
31
+ /**
32
+ * Requests input data from the view based on the provided input hash.
33
+ *
34
+ * @param {Object} pView - The view object.
35
+ * @param {string} pInputHash - The input hash.
36
+ */
31
37
  inputDataRequest(pView, pInputHash)
32
38
  {
33
39
  let tmpInput = pView.getInputFromHash(pInputHash);
@@ -62,6 +68,13 @@ class PictDynamicInputEvents extends libPictProvider
62
68
  }
63
69
  }
64
70
 
71
+ /**
72
+ * Handles the input event for a dynamic form.
73
+ *
74
+ * @param {Object} pView - The view object.
75
+ * @param {string} pInputHash - The input hash.
76
+ * @param {string} pEvent - The input event.
77
+ */
65
78
  inputEvent(pView, pInputHash, pEvent)
66
79
  {
67
80
  let tmpInput = pView.getInputFromHash(pInputHash);
@@ -96,6 +109,14 @@ class PictDynamicInputEvents extends libPictProvider
96
109
  }
97
110
  }
98
111
 
112
+ /**
113
+ * Requests input data for a tabular record.
114
+ *
115
+ * @param {Object} pView - The view object.
116
+ * @param {number} pGroupIndex - The index of the group.
117
+ * @param {number} pInputIndex - The index of the input.
118
+ * @param {number} pRowIndex - The index of the row.
119
+ */
99
120
  inputDataRequestTabular(pView, pGroupIndex, pInputIndex, pRowIndex)
100
121
  {
101
122
  let tmpInput = pView.getTabularRecordInput(pGroupIndex, pInputIndex);
@@ -137,6 +158,15 @@ class PictDynamicInputEvents extends libPictProvider
137
158
  pView.marshalToView();
138
159
  }
139
160
 
161
+ /**
162
+ * Handles the tabular input event.
163
+ *
164
+ * @param {Object} pView - The view object.
165
+ * @param {number} pGroupIndex - The index of the group.
166
+ * @param {number} pInputIndex - The index of the input.
167
+ * @param {number} pRowIndex - The index of the row.
168
+ * @param {string} pEvent - The input event.
169
+ */
140
170
  inputEventTabular(pView, pGroupIndex, pInputIndex, pRowIndex, pEvent)
141
171
  {
142
172
  let tmpInput = pView.getTabularRecordInput(pGroupIndex, pInputIndex);
@@ -53,6 +53,13 @@ class PictDynamicLayout extends libPictProvider
53
53
  return true;
54
54
  }
55
55
 
56
+ /**
57
+ * This fires after data has been marshaled to the form from the model.
58
+ *
59
+ * @param {object} pView - The view to initialize the newly rendered control for
60
+ * @param {object} pGroup - The group to initialize the newly rendered control for
61
+ * @returns {boolean}
62
+ */
56
63
  onDataMarshalToForm(pView, pGroup)
57
64
  {
58
65
  return true;
@@ -33,26 +33,61 @@ class PictRecordSet extends libPictProvider
33
33
  this.recordProviders = {};
34
34
  }
35
35
 
36
+ /**
37
+ * Returns the count for a specific dynamic record set.
38
+ *
39
+ * @param {Object} pFilter - The filter object.
40
+ * @param {Function} fCallback - The callback function to be called after the count is returned.
41
+ * @returns {any} - The result of the callback function.
42
+ */
36
43
  count(pFilter, fCallback)
37
44
  {
38
45
  return fCallback();
39
46
  }
40
47
 
48
+ /**
49
+ * Reads a record list.
50
+ *
51
+ * @param {Object} pFilter - The filter object.
52
+ * @param {Function} fCallback - The callback function to be called after the record list is read.
53
+ * @returns {any} - The result of the callback function.
54
+ */
41
55
  readRecordList(pFilter, fCallback)
42
56
  {
43
57
  return fCallback();
44
58
  }
45
59
 
60
+ /**
61
+ * Reads a record.
62
+ *
63
+ * @param {Object} pFilter - The filter object.
64
+ * @param {Function} fCallback - The callback function to be called after the record is read.
65
+ * @returns {any} - The result of the callback function.
66
+ */
46
67
  readRecord(pFilter, fCallback)
47
68
  {
48
69
  return fCallback();
49
70
  }
50
71
 
72
+ /**
73
+ * Writes a record.
74
+ *
75
+ * @param {Object} pRecord - The record to be written.
76
+ * @param {Function} fCallback - The callback function to be called after the record is written.
77
+ * @returns {any} - The result of the callback function.
78
+ */
51
79
  writeRecord(pRecord, fCallback)
52
80
  {
53
81
  return fCallback();
54
82
  }
55
83
 
84
+ /**
85
+ * Deletes a record.
86
+ *
87
+ * @param {Object} pRecord - The record to be deleted.
88
+ * @param {Function} fCallback - The callback function to be called after the record is deleted.
89
+ * @returns {any} - The result of the callback function.
90
+ */
56
91
  deleteRecord(pRecord, fCallback)
57
92
  {
58
93
  return fCallback();
@@ -28,6 +28,13 @@ class DynamicTabularData extends libPictProvider
28
28
  super(pFable, tmpOptions, pServiceHash);
29
29
  }
30
30
 
31
+ /**
32
+ * Retrieves the tabular record set from the specified view and group index.
33
+ *
34
+ * @param {Object} pView - The view object.
35
+ * @param {number} pGroupIndex - The index of the group.
36
+ * @returns {Array|Object|boolean} - The tabular record set if it exists, otherwise false.
37
+ */
31
38
  getTabularRecordSet(pView, pGroupIndex)
32
39
  {
33
40
  // The neat thing about how the tabular groups work is that we can make it clever about whether it's an object or an array.
@@ -40,6 +47,14 @@ class DynamicTabularData extends libPictProvider
40
47
  return pView.sectionManifest.getValueByHash(pView.getMarshalDestinationObject(), tmpGroup.RecordSetAddress);
41
48
  }
42
49
 
50
+ /**
51
+ * Retrieves the tabular record input from the specified view, group, and input indexes.
52
+ *
53
+ * @param {Object} pView - The view object.
54
+ * @param {number} pGroupIndex - The index of the group.
55
+ * @param {number} pInputIndex - The index of the input.
56
+ * @returns {ElementDescriptor|boolean} The tabular record input or false if the group is invalid.
57
+ */
43
58
  getTabularRecordInput(pView, pGroupIndex, pInputIndex)
44
59
  {
45
60
  // The neat thing about how the tabular groups work is that we can make it clever about whether it's an object or an array.
@@ -57,6 +72,14 @@ class DynamicTabularData extends libPictProvider
57
72
  return tmpGroup.supportingManifest.elementDescriptors[tmpSupportingManifestHash];
58
73
  }
59
74
 
75
+ /**
76
+ * Retrieves tabular record data based on the provided parameters.
77
+ *
78
+ * @param {Object} pView - The view object.
79
+ * @param {number} pGroupIndex - The index of the group.
80
+ * @param {string} pRowIdentifier - The identifier of the row.
81
+ * @returns {boolean|Object} - The tabular record data or false if not found.
82
+ */
60
83
  getTabularRecordData(pView, pGroupIndex, pRowIdentifier)
61
84
  {
62
85
  // The neat thing about how the tabular groups work is that we can make it clever about whether it's an object or an array.
@@ -107,6 +130,12 @@ class DynamicTabularData extends libPictProvider
107
130
  }
108
131
  }
109
132
 
133
+ /**
134
+ * Creates a dynamic table row for the given view and group index.
135
+ *
136
+ * @param {Object} pView - The view object.
137
+ * @param {number} pGroupIndex - The index of the group.
138
+ */
110
139
  createDynamicTableRow(pView, pGroupIndex)
111
140
  {
112
141
  let tmpGroup = pView.getGroup(pGroupIndex);
@@ -131,6 +160,15 @@ class DynamicTabularData extends libPictProvider
131
160
  }
132
161
  }
133
162
 
163
+ /**
164
+ * Sets the index of a dynamic table row in a view.
165
+ *
166
+ * @param {Object} pView - The view object.
167
+ * @param {number} pGroupIndex - The index of the group.
168
+ * @param {number} pRowIndex - The current index of the row.
169
+ * @param {number} pNewRowIndex - The new index to move the row to.
170
+ * @returns {boolean} - Returns false if the index is out of bounds, otherwise returns undefined.
171
+ */
134
172
  setDynamicTableRowIndex(pView, pGroupIndex, pRowIndex, pNewRowIndex)
135
173
  {
136
174
  let tmpGroup = pView.getGroup(pGroupIndex);
@@ -160,6 +198,14 @@ class DynamicTabularData extends libPictProvider
160
198
  }
161
199
  }
162
200
 
201
+ /**
202
+ * Moves a dynamic table row down within a view.
203
+ *
204
+ * @param {Object} pView - The view containing the dynamic table.
205
+ * @param {number} pGroupIndex - The index of the group containing the row.
206
+ * @param {number} pRowIndex - The index of the row to be moved.
207
+ * @returns {boolean} - Returns true if the row was successfully moved, false otherwise.
208
+ */
163
209
  moveDynamicTableRowDown(pView, pGroupIndex, pRowIndex)
164
210
  {
165
211
  let tmpGroup = pView.getGroup(pGroupIndex);
@@ -188,6 +234,14 @@ class DynamicTabularData extends libPictProvider
188
234
  }
189
235
  }
190
236
 
237
+ /**
238
+ * Moves a dynamic table row up.
239
+ *
240
+ * @param {Object} pView - The view object.
241
+ * @param {number} pGroupIndex - The index of the group.
242
+ * @param {number} pRowIndex - The index of the row to be moved.
243
+ * @returns {boolean} Returns true if the row was moved successfully, false otherwise.
244
+ */
191
245
  moveDynamicTableRowUp(pView, pGroupIndex, pRowIndex)
192
246
  {
193
247
  let tmpGroup = pView.getGroup(pGroupIndex);
@@ -222,6 +276,14 @@ class DynamicTabularData extends libPictProvider
222
276
  }
223
277
 
224
278
 
279
+ /**
280
+ * Deletes a dynamic table row from the specified view.
281
+ *
282
+ * @param {Object} pView - The view from which to delete the row.
283
+ * @param {number} pGroupIndex - The index of the group containing the row.
284
+ * @param {number|string} pRowIndex - The index or key of the row to delete.
285
+ * @returns {boolean} - Returns true if the row was successfully deleted, false otherwise.
286
+ */
225
287
  deleteDynamicTableRow(pView, pGroupIndex, pRowIndex)
226
288
  {
227
289
  let tmpGroup = pView.getGroup(pGroupIndex);
@@ -31,6 +31,13 @@ class PictMetalist extends libPictProvider
31
31
  this.globalLists = {};
32
32
  }
33
33
 
34
+ /**
35
+ * Retrieves a list based on the provided view hash and list hash.
36
+ *
37
+ * @param {string} pViewHash - The view hash.
38
+ * @param {string} pListHash - The list hash.
39
+ * @returns {Array} - The retrieved list.
40
+ */
34
41
  getList(pViewHash, pListHash)
35
42
  {
36
43
  if ((pViewHash in this.computedLists) && (pListHash in this.computedLists[pViewHash]))
@@ -44,11 +51,23 @@ class PictMetalist extends libPictProvider
44
51
  return [];
45
52
  }
46
53
 
54
+ /**
55
+ * Checks if a list exists in the Pict Provider MetaLists.
56
+ *
57
+ * @param {string} pViewHash - The hash of the view.
58
+ * @param {string} pListHash - The hash of the list.
59
+ * @returns {boolean} - Returns true if the list exists, otherwise false.
60
+ */
47
61
  hasList(pViewHash, pListHash)
48
62
  {
49
63
  return ((pViewHash in this.computedLists) && (pListHash in this.computedLists[pViewHash])) || (pListHash in this.globalLists);
50
64
  }
51
65
 
66
+ /**
67
+ * Builds meta lists for the Pict provider.
68
+ *
69
+ * @param {Array|string} pViewHashes - The view hashes to build meta lists for.
70
+ */
52
71
  buildLists(pViewHashes)
53
72
  {
54
73
  // this.log.trace(`Dynamic MetaList Provider [${this.UUID}]::[${this.Hash}] pulling Metalists.`);