pict-section-form 1.0.165 → 1.0.167
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.
- package/debug/PICTSection-TabularManifests.json +17 -2
- package/debug/TabularManifestCSV.csv +2 -1
- package/debug/data/DefaultFormManifest.json +17 -2
- package/debug/data/MathExampleForm-Reconstituted.csv +3 -2
- package/debug/data/MathExampleForm.json +17 -2
- package/example_applications/complex_table/Complex-Tabular-Application.js +73 -1
- package/package.json +2 -2
- package/source/providers/Pict-Provider-DynamicFormSolverBehaviors.js +62 -0
- package/source/providers/Pict-Provider-MetaLists.js +19 -3
- package/source/views/Pict-View-DynamicForm.js +37 -0
- package/types/source/providers/Pict-Provider-MetaLists.d.ts +15 -4
- package/types/source/providers/Pict-Provider-MetaLists.d.ts.map +1 -1
- package/types/source/providers/Pict-Provider-MetatemplateGenerator.d.ts +1 -1
- package/types/source/providers/Pict-Provider-MetatemplateGenerator.d.ts.map +1 -1
|
@@ -97,6 +97,19 @@
|
|
|
97
97
|
},
|
|
98
98
|
"Default": "50000"
|
|
99
99
|
},
|
|
100
|
+
"Header.BoxRowCount": {
|
|
101
|
+
"Hash": "HeaderBoxRowCount",
|
|
102
|
+
"Name": "Number of Box Styles",
|
|
103
|
+
"DataAddress": "Header.BoxRowCount",
|
|
104
|
+
"DataType": "Number",
|
|
105
|
+
"PictForm": {
|
|
106
|
+
"Row": "5",
|
|
107
|
+
"Width": "12",
|
|
108
|
+
"Section": "Header",
|
|
109
|
+
"Group": "General_Info"
|
|
110
|
+
},
|
|
111
|
+
"Default": "8"
|
|
112
|
+
},
|
|
100
113
|
"BookData.CurrentIDBook": {
|
|
101
114
|
"Hash": "CurrentIDBook",
|
|
102
115
|
"Name": "IDBook",
|
|
@@ -169,7 +182,7 @@
|
|
|
169
182
|
"Section": "Basic_Geometry",
|
|
170
183
|
"Group": "BasicGeoGrp"
|
|
171
184
|
},
|
|
172
|
-
"Default": "
|
|
185
|
+
"Default": "5",
|
|
173
186
|
"AnotherObject": {
|
|
174
187
|
"NotPictForm": {
|
|
175
188
|
"y": 22
|
|
@@ -721,7 +734,9 @@
|
|
|
721
734
|
{
|
|
722
735
|
"Name": "Header",
|
|
723
736
|
"Hash": "Header",
|
|
724
|
-
"Solvers": [
|
|
737
|
+
"Solvers": [
|
|
738
|
+
"BoxRowCountSuccess = SETTABULARROWLENGTH(\"BoxCollSec\", \"BoxCollGrp\", HeaderBoxRowCount, 1)"
|
|
739
|
+
],
|
|
725
740
|
"Groups": [
|
|
726
741
|
{
|
|
727
742
|
"Name": "General Info",
|
|
@@ -7,10 +7,11 @@ MathExampleForm,,,,,,Header,,General Info,,,,,2,12,,,Header.Description,Descript
|
|
|
7
7
|
MathExampleForm,,,,,,Header,,General Info,,,,,3,6,,,Header.Planet,Planet,Planet,,planetary,String,,Option,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
8
8
|
MathExampleForm,,,,,,Header,,General Info,,,,,3,6,,,Header.Universe,Universe,Universe,,planetary,String,,Option,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,15.2,17
|
|
9
9
|
MathExampleForm,,,,,,Header,,General Info,,,,,4,12,,,Header.WarehouseVolume,Warehouse Volume,WarehouseVolume,,,Number,,,,,50000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t,,
|
|
10
|
+
MathExampleForm,,,,,,Header,,General Info,,,,,5,12,,,Header.BoxRowCount,Number of Box Styles,HeaderBoxRowCount,,,Number,,,"BoxRowCountSuccess = SETTABULARROWLENGTH(""BoxCollSec"", ""BoxCollGrp"", HeaderBoxRowCount, 1)",,8,,,,,,,,,,,,,,,,,,,,,,,,,,,,,t,,
|
|
10
11
|
MathExampleForm,,,,,,REST Request,,Book Data,,,,,1,6,,,BookData.CurrentIDBook,IDBook,CurrentIDBook,,,Number,,,,,,,,Book from REST request,Book,IDBook,LoadedBook,,,,,,,,,,,,,,,,,,,,,,,,86,
|
|
11
12
|
MathExampleForm,,,,,,MatheMagic,,Math is Magic,,,,,1,1,,,HelpContent.Math,So Very Magic,MathHelpContent,,,String,,HTML,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
12
13
|
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Width,Width,RectangleWidth,,,Number,,,,,7.25,,,,,,,,,,,,,,,,,,,,,,,,,,,,,y,11,190
|
|
13
|
-
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Height,Height,RectangleHeight,,,Number,,,,,
|
|
14
|
+
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Height,Height,RectangleHeight,,,Number,,,,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,22
|
|
14
15
|
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.Area,Area,RectangleArea,,unrounded,Number,,,RectangleArea = RectangleWidth * RectangleHeight,,,Area of the Rectangle.,,,,,,,,,,,,,,,,,,,,,,,,,,,This is a test for random data injection.,1,,
|
|
15
16
|
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.AreaRoundedDefault,Area Rounded,RectangleAreaRoundedDefault,,default,Number,,,RectangleAreaRoundedDefault = ROUND(RectangleWidth * RectangleHeight),,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,frog,
|
|
16
17
|
MathExampleForm,,,,,,Basic Geometry,,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.AreaRoundedThree,Area Rounded 3,RectangleAreaRoundedThree,,3,Number,,,"RectangleAreaRoundedThree = ROUND((RectangleWidth * RectangleHeight), 3)",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
|
@@ -96,6 +96,19 @@
|
|
|
96
96
|
},
|
|
97
97
|
"Default": "50000"
|
|
98
98
|
},
|
|
99
|
+
"Header.BoxRowCount": {
|
|
100
|
+
"Hash": "HeaderBoxRowCount",
|
|
101
|
+
"Name": "Number of Box Styles",
|
|
102
|
+
"DataAddress": "Header.BoxRowCount",
|
|
103
|
+
"DataType": "Number",
|
|
104
|
+
"PictForm": {
|
|
105
|
+
"Row": "5",
|
|
106
|
+
"Width": "12",
|
|
107
|
+
"Section": "Header",
|
|
108
|
+
"Group": "General_Info"
|
|
109
|
+
},
|
|
110
|
+
"Default": "8"
|
|
111
|
+
},
|
|
99
112
|
"BookData.CurrentIDBook": {
|
|
100
113
|
"Hash": "CurrentIDBook",
|
|
101
114
|
"Name": "IDBook",
|
|
@@ -169,7 +182,7 @@
|
|
|
169
182
|
"Section": "Basic_Geometry",
|
|
170
183
|
"Group": "BasicGeoGrp"
|
|
171
184
|
},
|
|
172
|
-
"Default": "
|
|
185
|
+
"Default": "5",
|
|
173
186
|
"AnotherObject": {
|
|
174
187
|
"NotPictForm": {
|
|
175
188
|
"y": 22
|
|
@@ -870,7 +883,9 @@
|
|
|
870
883
|
{
|
|
871
884
|
"Name": "Header",
|
|
872
885
|
"Hash": "Header",
|
|
873
|
-
"Solvers": [
|
|
886
|
+
"Solvers": [
|
|
887
|
+
"BoxRowCountSuccess = SETTABULARROWLENGTH(\"BoxCollSec\", \"BoxCollGrp\", HeaderBoxRowCount, 1)"
|
|
888
|
+
],
|
|
874
889
|
"Groups": [
|
|
875
890
|
{
|
|
876
891
|
"Name": "General Info",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
Form,Form Name,SubManifest,HideTabularEditingControls,GroupRecordSetAddress,DataOnly,Section Name,Section Hash,Group Name,Group Hash,Group Layout,Group CSS,Group Show Title,Row,Width,Minimum Row Count,Maximum Row Count,Input Address,Input Name,Input Hash,Input Extra,Units,DataType,Decimal Precision,InputType,Equation,Equation Ordinal,Default,Description,Tooltip,Input Notes,Entity,EntityColumnFilter,EntityDestination,SingleRecord,TriggerGroup,TriggerAddress,TriggerAllInputs,MarshalEmptyValues,ChartType,ChartLabelsAddress,ChartLabelsSolver,ChartDatasetsAddress,ChartDatasetsLabel,ChartDatasetsSolvers
|
|
2
|
-
MathExampleForm,Math Example Form,,,,,Header,Header,General Info,General_Info,,,,1,3,,,Header.FirstName,First Name,HeaderFirstName,,,String
|
|
2
|
+
MathExampleForm,Math Example Form,,,,,Header,Header,General Info,General_Info,,,,1,3,,,Header.FirstName,First Name,HeaderFirstName,,,String,,,"BoxRowCountSuccess = SETTABULARROWLENGTH(""BoxCollSec"", ""BoxCollGrp"", HeaderBoxRowCount, 1)",1,,,,,,,,,,,,,,,,,,
|
|
3
3
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,1,3,,,Header.LastName,Last Name,HeaderLastName,,,String,,,,,,,,,,,,,,,,,,,,,,
|
|
4
4
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,1,6,,,Header.JobTitle,Job Title,JobTitle,,,String,,,,,,,,,,,,,,,,,,,,,,
|
|
5
5
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,2,12,,,Header.Description,Description,Description,,,String,,,,,,,,,,,,,,,,,,,,,,
|
|
6
6
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,3,6,,,Header.Planet,Planet,Planet,,planetary,String,,Option,,,,,,,,,,,,,,,,,,,,
|
|
7
7
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,3,6,,,Header.Universe,Universe,Universe,,planetary,String,,Option,,,,,,,,,,,,,,,,,,,,
|
|
8
8
|
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,4,12,,,Header.WarehouseVolume,Warehouse Volume,WarehouseVolume,,,Number,,,,,50000,,,,,,,,,,,,,,,,,
|
|
9
|
+
MathExampleForm,,,,,,Header,Header,General Info,General_Info,,,,5,12,,,Header.BoxRowCount,Number of Box Styles,HeaderBoxRowCount,,,Number,,,,,8,,,,,,,,,,,,,,,,,
|
|
9
10
|
MathExampleForm,,,,,,REST Request,REST_Request,Book Data,Book_Data,,,,1,6,,,BookData.CurrentIDBook,IDBook,CurrentIDBook,,,Number,,,,,,,,Book from REST request,Book,IDBook,LoadedBook,,,,,,,,,,,
|
|
10
11
|
MathExampleForm,,,,,,MatheMagic,MatheMagic,Math is Magic,Math_is_Magic,,,,1,1,,,HelpContent.Math,So Very Magic,MathHelpContent,,,String,,HTML,,,,,,,,,,,,,,,,,,,,
|
|
11
12
|
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Width,Width,RectangleWidth,,,Number,,,RectangleArea = RectangleWidth * RectangleHeight,1,7.25,,,,,,,,,,,,,,,,,
|
|
12
|
-
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Height,Height,RectangleHeight,,,Number,,,RectangleAreaRoundedDefault = ROUND(RectangleWidth * RectangleHeight),1,
|
|
13
|
+
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,1,6,,,Geometry.Rectangle.Height,Height,RectangleHeight,,,Number,,,RectangleAreaRoundedDefault = ROUND(RectangleWidth * RectangleHeight),1,5,,,,,,,,,,,,,,,,,
|
|
13
14
|
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.Area,Area,RectangleArea,,unrounded,Number,,,"RectangleAreaRoundedThree = ROUND((RectangleWidth * RectangleHeight), 3)",1,,Area of the Rectangle.,,,,,,,,,,,,,,,,
|
|
14
15
|
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.AreaRoundedDefault,Area Rounded,RectangleAreaRoundedDefault,,default,Number,,,"RectangleAreaRoundedFive = ROUND(RectangleArea, 5)",1,,,,,,,,,,,,,,,,,,
|
|
15
16
|
MathExampleForm,,,,,,Basic Geometry,Basic_Geometry,Rectangle,BasicGeoGrp,,,,2,3,,,Geometry.Rectangle.AreaRoundedThree,Area Rounded 3,RectangleAreaRoundedThree,,3,Number,,,CircleArea = PI() * CircleRadius^2,1,,,,,,,,,,,,,,,,,,
|
|
@@ -96,6 +96,19 @@
|
|
|
96
96
|
},
|
|
97
97
|
"Default": "50000"
|
|
98
98
|
},
|
|
99
|
+
"Header.BoxRowCount": {
|
|
100
|
+
"Hash": "HeaderBoxRowCount",
|
|
101
|
+
"Name": "Number of Box Styles",
|
|
102
|
+
"DataAddress": "Header.BoxRowCount",
|
|
103
|
+
"DataType": "Number",
|
|
104
|
+
"PictForm": {
|
|
105
|
+
"Row": "5",
|
|
106
|
+
"Width": "12",
|
|
107
|
+
"Section": "Header",
|
|
108
|
+
"Group": "General_Info"
|
|
109
|
+
},
|
|
110
|
+
"Default": "8"
|
|
111
|
+
},
|
|
99
112
|
"BookData.CurrentIDBook": {
|
|
100
113
|
"Hash": "CurrentIDBook",
|
|
101
114
|
"Name": "IDBook",
|
|
@@ -169,7 +182,7 @@
|
|
|
169
182
|
"Section": "Basic_Geometry",
|
|
170
183
|
"Group": "BasicGeoGrp"
|
|
171
184
|
},
|
|
172
|
-
"Default": "
|
|
185
|
+
"Default": "5",
|
|
173
186
|
"AnotherObject": {
|
|
174
187
|
"NotPictForm": {
|
|
175
188
|
"y": 22
|
|
@@ -870,7 +883,9 @@
|
|
|
870
883
|
{
|
|
871
884
|
"Name": "Header",
|
|
872
885
|
"Hash": "Header",
|
|
873
|
-
"Solvers": [
|
|
886
|
+
"Solvers": [
|
|
887
|
+
"BoxRowCountSuccess = SETTABULARROWLENGTH(\"BoxCollSec\", \"BoxCollGrp\", HeaderBoxRowCount, 1)"
|
|
888
|
+
],
|
|
874
889
|
"Groups": [
|
|
875
890
|
{
|
|
876
891
|
"Name": "General Info",
|
|
@@ -2,6 +2,62 @@ const libPictSectionForm = require('../../source/Pict-Section-Form.js');
|
|
|
2
2
|
|
|
3
3
|
const libCustomDataProvider = require('./Complex-Tabular-CustomDataProvider.js');
|
|
4
4
|
|
|
5
|
+
const SelectInputProvider = require('../../source/providers/inputs/Pict-Provider-Input-Select.js');
|
|
6
|
+
|
|
7
|
+
class CustomSelectInputProvider extends SelectInputProvider
|
|
8
|
+
{
|
|
9
|
+
/**
|
|
10
|
+
* Handles events for the Pict-Provider-InputExtension.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} pView - The view object.
|
|
13
|
+
* @param {Object} pInput - The input object.
|
|
14
|
+
* @param {any} pValue - The value from AppData.
|
|
15
|
+
* @param {string} pHTMLSelector - The HTML selector.
|
|
16
|
+
* @param {string} pEvent - The event hash that is expected to be triggered.
|
|
17
|
+
* @param {string} pTransactionGUID - The transaction GUID, if any.
|
|
18
|
+
* @returns {boolean} - Returns true.
|
|
19
|
+
*/
|
|
20
|
+
onEvent(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
|
|
21
|
+
{
|
|
22
|
+
const tmpResult = super.onEvent(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID);
|
|
23
|
+
if (typeof pEvent !== "string")
|
|
24
|
+
{
|
|
25
|
+
return tmpResult;
|
|
26
|
+
}
|
|
27
|
+
const tmpEventParts = pEvent.split(':');
|
|
28
|
+
const tmpEventHash = tmpEventParts[0];
|
|
29
|
+
if (tmpEventHash !== 'GetPickList')
|
|
30
|
+
{
|
|
31
|
+
return tmpResult;
|
|
32
|
+
}
|
|
33
|
+
const tmpListHash = tmpEventParts[1];
|
|
34
|
+
if (tmpListHash !== pInput.PictForm.SelectOptionsPickList)
|
|
35
|
+
{
|
|
36
|
+
return tmpResult;
|
|
37
|
+
}
|
|
38
|
+
const tmpListDataAddress = tmpEventParts[2];
|
|
39
|
+
const tmpEventOptions = JSON.parse(tmpEventParts.slice(3).join(':'));
|
|
40
|
+
this.pict.log.info(`CustomSelectInputProvider received event: ${pEvent} for list ${tmpListHash} with options:`, { tmpEventHash, tmpListHash, tmpListDataAddress, tmpEventOptions });
|
|
41
|
+
const tmpListData = this.pict.manifest.getValueByHash(this.pict, tmpListDataAddress);
|
|
42
|
+
if (!Array.isArray(tmpListData))
|
|
43
|
+
{
|
|
44
|
+
this.pict.log.error(`CustomSelectInputProvider expected array data at address ${tmpListDataAddress} but found:`, { tmpListData });
|
|
45
|
+
return tmpResult;
|
|
46
|
+
}
|
|
47
|
+
if (tmpListData.length > 0)
|
|
48
|
+
{
|
|
49
|
+
return tmpResult;
|
|
50
|
+
}
|
|
51
|
+
for (let i = 0; i < 10; ++i)
|
|
52
|
+
{
|
|
53
|
+
const tmpRandomNumber = Math.floor(Math.random() * 1000);
|
|
54
|
+
tmpListData.push({ id: `random-${tmpRandomNumber}`, text: `${tmpRandomNumber}` });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return tmpResult;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
5
61
|
class ComplexTabularApplication extends libPictSectionForm.PictFormApplication
|
|
6
62
|
{
|
|
7
63
|
constructor(pFable, pOptions, pServiceHash)
|
|
@@ -16,6 +72,12 @@ class ComplexTabularApplication extends libPictSectionForm.PictFormApplication
|
|
|
16
72
|
this.pict.AppData.UI.StatisticsTabState = "FruitStatistics";
|
|
17
73
|
this.pict.addProvider('CustomDataProvider', libCustomDataProvider.default_configuration, libCustomDataProvider);
|
|
18
74
|
}
|
|
75
|
+
|
|
76
|
+
onInitialize()
|
|
77
|
+
{
|
|
78
|
+
this.pict.addProvider('Pict-Input-Select', CustomSelectInputProvider.default_configuration, CustomSelectInputProvider);
|
|
79
|
+
return super.onInitialize();
|
|
80
|
+
}
|
|
19
81
|
}
|
|
20
82
|
|
|
21
83
|
module.exports = ComplexTabularApplication;
|
|
@@ -67,7 +129,11 @@ module.exports.default_configuration.pict_configuration = {
|
|
|
67
129
|
IDTemplate: "{~D:Record.IDBook~}",
|
|
68
130
|
Sorted: true,
|
|
69
131
|
UpdateFrequency: "Always",
|
|
70
|
-
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
Hash: "RandomNumbers",
|
|
135
|
+
Dynamic: true,
|
|
136
|
+
},
|
|
71
137
|
],
|
|
72
138
|
|
|
73
139
|
Sections: [
|
|
@@ -200,6 +266,12 @@ module.exports.default_configuration.pict_configuration = {
|
|
|
200
266
|
],
|
|
201
267
|
|
|
202
268
|
Descriptors: {
|
|
269
|
+
RandomNumber: {
|
|
270
|
+
Name: "Pick a Random Number",
|
|
271
|
+
Hash: "PickRandomNumber",
|
|
272
|
+
DataType: "String",
|
|
273
|
+
PictForm: { Section: "Recipe", Group: "Recipe", Row: 1, InputType: "Option", SelectOptionsPickList: "RandomNumbers" },
|
|
274
|
+
},
|
|
203
275
|
RecipeName: {
|
|
204
276
|
Name: "Recipe Name",
|
|
205
277
|
Hash: "RecipeName",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.167",
|
|
4
4
|
"description": "Pict dynamic form sections",
|
|
5
5
|
"main": "source/Pict-Section-Form.js",
|
|
6
6
|
"directories": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"chart.js": "^4.5.1",
|
|
46
46
|
"fable-serviceproviderbase": "^3.0.15",
|
|
47
47
|
"marked": "^15.0.12",
|
|
48
|
-
"pict-provider": "^1.0.
|
|
48
|
+
"pict-provider": "^1.0.7",
|
|
49
49
|
"pict-section-tuigrid": "^1.0.27",
|
|
50
50
|
"pict-template": "^1.0.13",
|
|
51
51
|
"pict-view": "^1.0.64"
|
|
@@ -91,6 +91,8 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
|
|
|
91
91
|
this.addSolverFunction(pExpressionParser, 'enablesolverordinal', 'fable.providers.DynamicFormSolverBehaviors.enableSolverOrdinal', 'Enables a solver ordinal so that it can run.');
|
|
92
92
|
this.addSolverFunction(pExpressionParser, 'disablesolverordinall', 'fable.providers.DynamicFormSolverBehaviors.disableSolverOrdinal', 'Disables a solver ordinal so that it will not run.');
|
|
93
93
|
|
|
94
|
+
this.addSolverFunction(pExpressionParser, 'settabularrowlength', 'fable.providers.DynamicFormSolverBehaviors.setTabularRowLength', 'Sets the length of a tabular data set.');
|
|
95
|
+
|
|
94
96
|
return false;
|
|
95
97
|
}
|
|
96
98
|
|
|
@@ -241,6 +243,66 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
|
|
|
241
243
|
return true;
|
|
242
244
|
}
|
|
243
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Set the length of a tabular set
|
|
248
|
+
* @param {string} pSectionHash - The hash of the section containing the tabular group
|
|
249
|
+
* @param {string} pGroupHash - The hash of the tabular group
|
|
250
|
+
* @param {number|string} pLength - The desired length of the tabular set
|
|
251
|
+
* @param {boolean|string} pDeleteExtraRows - If true, will delete extra rows from the end if the length is less than current
|
|
252
|
+
* @returns
|
|
253
|
+
*/
|
|
254
|
+
setTabularRowLength(pSectionHash, pGroupHash, pLength, pDeleteExtraRows = false)
|
|
255
|
+
{
|
|
256
|
+
let tmpGroupView = this.pict.views.PictFormMetacontroller.getSectionViewFromHash(pSectionHash)
|
|
257
|
+
if (!tmpGroupView)
|
|
258
|
+
{
|
|
259
|
+
this.log.warn(`PictDynamicFormsInformary: showGroup could not find group with section hash [${pSectionHash}] group [${pGroupHash}].`);
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
let tmpGroupIndex = tmpGroupView.getGroupIndexFromHash(pGroupHash);
|
|
263
|
+
if (tmpGroupIndex < 0)
|
|
264
|
+
{
|
|
265
|
+
this.log.warn(`PictDynamicFormsInformary: setTabularRowLength could not find group with section hash [${pSectionHash}] group [${pGroupHash}].`);
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
let tmpTabularRecordSet = tmpGroupView.getTabularRecordSet(tmpGroupIndex);
|
|
269
|
+
if (!tmpTabularRecordSet || !Array.isArray(tmpTabularRecordSet))
|
|
270
|
+
{
|
|
271
|
+
this.log.warn(`PictDynamicFormsInformary: setTabularRowLength could not find a valid tabular record set with section hash [${pSectionHash}] group [${pGroupHash}].`);
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
let tmpLength = parseInt(pLength.toString());
|
|
276
|
+
if (isNaN(tmpLength) || tmpLength < 0)
|
|
277
|
+
{
|
|
278
|
+
this.log.warn(`PictDynamicFormsInformary: setTabularRowLength was given an invalid length [${pLength}] with section hash [${pSectionHash}] group [${pGroupHash}].`);
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// See if the length is less than what we have
|
|
283
|
+
let tmpCurrentLength = tmpTabularRecordSet.length;
|
|
284
|
+
|
|
285
|
+
let tmpDeleteExtraRows = (pDeleteExtraRows == true || pDeleteExtraRows == '1');
|
|
286
|
+
|
|
287
|
+
if (tmpLength > tmpCurrentLength)
|
|
288
|
+
{
|
|
289
|
+
// Add rows until we are at the expected length
|
|
290
|
+
for (let i = tmpCurrentLength; i < tmpLength; i++)
|
|
291
|
+
{
|
|
292
|
+
tmpGroupView.createDynamicTableRow(tmpGroupIndex);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else if (tmpLength < tmpCurrentLength && tmpDeleteExtraRows)
|
|
296
|
+
{
|
|
297
|
+
// Remove rows from the end until we are at the expected length
|
|
298
|
+
for (let i = tmpCurrentLength - 1; i >= tmpLength; i--)
|
|
299
|
+
{
|
|
300
|
+
tmpGroupView.deleteDynamicTableRow(tmpGroupIndex, i);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
|
|
244
306
|
generateHTMLHexColor(pRed, pGreen, pBlue)
|
|
245
307
|
{
|
|
246
308
|
let tmpRed = (parseInt(pRed) || 0);
|
|
@@ -30,7 +30,7 @@ class PictMetalist extends libPictProvider
|
|
|
30
30
|
|
|
31
31
|
/** @type {any} */
|
|
32
32
|
this.options;
|
|
33
|
-
/** @type {import('pict')} */
|
|
33
|
+
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any, instantiateServiceProviderIfNotExists: (hash: string) => any, TransactionTracking: import('pict/types/source/services/Fable-Service-TransactionTracking') }} */
|
|
34
34
|
this.pict;
|
|
35
35
|
/** @type {import('pict')} */
|
|
36
36
|
this.fable;
|
|
@@ -44,15 +44,31 @@ class PictMetalist extends libPictProvider
|
|
|
44
44
|
this.computedLists = {};
|
|
45
45
|
this.listDefinitions = {};
|
|
46
46
|
}
|
|
47
|
+
/** @typedef {{ id: string, text: string }} PickListItem */
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* Retrieves a list based on the provided view hash and list hash.
|
|
50
51
|
*
|
|
51
52
|
* @param {string} pListHash - The list hash.
|
|
52
|
-
* @
|
|
53
|
+
* @param {Object} [pOptions={}] - (optional) Additional options for retrieving the list. (ex. search term)
|
|
54
|
+
*
|
|
55
|
+
* @returns {Array<PickListItem>} - The retrieved list.
|
|
53
56
|
*/
|
|
54
|
-
getList(pListHash)
|
|
57
|
+
getList(pListHash, pOptions = {})
|
|
55
58
|
{
|
|
59
|
+
if (this.listDefinitions[pListHash].Dynamic)
|
|
60
|
+
{
|
|
61
|
+
const tmpList = [];
|
|
62
|
+
const tmpTransactionGUID = this.pict.getUUID();
|
|
63
|
+
const tmpHash = tmpTransactionGUID.substring(0, 8);
|
|
64
|
+
const tmpAddress = `AppData._MetaLists.${tmpHash}`;
|
|
65
|
+
this.pict.manifest.setValueByHash(this.pict, tmpAddress, tmpList);
|
|
66
|
+
this.pict.TransactionTracking.registerTransaction(tmpTransactionGUID);
|
|
67
|
+
this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(`GetPickList:${pListHash}:${tmpAddress}:${JSON.stringify(pOptions)}`, tmpTransactionGUID);
|
|
68
|
+
this.pict.views.PictFormMetacontroller.finalizeTransaction(tmpTransactionGUID);
|
|
69
|
+
delete this.pict.AppData._MetaLists[tmpHash];
|
|
70
|
+
return tmpList;
|
|
71
|
+
}
|
|
56
72
|
if (pListHash in this.computedLists)
|
|
57
73
|
{
|
|
58
74
|
return this.computedLists[pListHash];
|
|
@@ -902,6 +902,43 @@ class PictViewDynamicForm extends libPictViewClass
|
|
|
902
902
|
this.pict.providers.MetatemplateGenerator.rebuildCustomTemplate(this);
|
|
903
903
|
}
|
|
904
904
|
|
|
905
|
+
/**
|
|
906
|
+
* Returns the index of a group within the sectionDefinition.Groups array that matches the provided hash.
|
|
907
|
+
*
|
|
908
|
+
* @param {string} pGroupHash - The hash value of the group to find.
|
|
909
|
+
* @returns {number} The index of the group if found; otherwise, -1.
|
|
910
|
+
*/
|
|
911
|
+
getGroupIndexFromHash(pGroupHash)
|
|
912
|
+
{
|
|
913
|
+
for (let i = 0; i < this.sectionDefinition.Groups.length; i++)
|
|
914
|
+
{
|
|
915
|
+
if (this.sectionDefinition.Groups[i].Hash === pGroupHash)
|
|
916
|
+
{
|
|
917
|
+
return i;
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
this.log.warn(`PICT View Metatemplate Helper getGroupIndexByHash could not find group with hash [${pGroupHash}].`);
|
|
921
|
+
return -1;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* Get a group by its hash
|
|
926
|
+
* @param {string} pGroupHash - The hash of the group to retrieve.
|
|
927
|
+
* @returns {object|boolean} - The group object if found, or false if the group hash is not found.
|
|
928
|
+
*/
|
|
929
|
+
getGroupFromHash(pGroupHash)
|
|
930
|
+
{
|
|
931
|
+
for (let i = 0; i < this.sectionDefinition.Groups.length; i++)
|
|
932
|
+
{
|
|
933
|
+
if (this.sectionDefinition.Groups[i].Hash === pGroupHash)
|
|
934
|
+
{
|
|
935
|
+
return this.sectionDefinition.Groups[i];
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
this.log.warn(`PICT View Metatemplate Helper getGroupByHash could not find group with hash [${pGroupHash}].`);
|
|
939
|
+
return false;
|
|
940
|
+
}
|
|
941
|
+
|
|
905
942
|
/**
|
|
906
943
|
* Retrieves a group from the PICT View Metatemplate Helper based on the provided group index.
|
|
907
944
|
*
|
|
@@ -5,19 +5,30 @@ export = PictMetalist;
|
|
|
5
5
|
declare class PictMetalist extends libPictProvider {
|
|
6
6
|
/** @type {any} */
|
|
7
7
|
options: any;
|
|
8
|
-
/** @type {import('pict')} */
|
|
9
|
-
pict: import("pict")
|
|
8
|
+
/** @type {import('pict') & { log: any, instantiateServiceProviderWithoutRegistration: (hash: String) => any, instantiateServiceProviderIfNotExists: (hash: string) => any, TransactionTracking: import('pict/types/source/services/Fable-Service-TransactionTracking') }} */
|
|
9
|
+
pict: import("pict") & {
|
|
10
|
+
log: any;
|
|
11
|
+
instantiateServiceProviderWithoutRegistration: (hash: string) => any;
|
|
12
|
+
instantiateServiceProviderIfNotExists: (hash: string) => any;
|
|
13
|
+
TransactionTracking: import("pict/types/source/services/Fable-Service-TransactionTracking");
|
|
14
|
+
};
|
|
10
15
|
/** @type {import('pict')} */
|
|
11
16
|
fable: import("pict");
|
|
12
17
|
computedLists: {};
|
|
13
18
|
listDefinitions: {};
|
|
19
|
+
/** @typedef {{ id: string, text: string }} PickListItem */
|
|
14
20
|
/**
|
|
15
21
|
* Retrieves a list based on the provided view hash and list hash.
|
|
16
22
|
*
|
|
17
23
|
* @param {string} pListHash - The list hash.
|
|
18
|
-
* @
|
|
24
|
+
* @param {Object} [pOptions={}] - (optional) Additional options for retrieving the list. (ex. search term)
|
|
25
|
+
*
|
|
26
|
+
* @returns {Array<PickListItem>} - The retrieved list.
|
|
19
27
|
*/
|
|
20
|
-
getList(pListHash: string):
|
|
28
|
+
getList(pListHash: string, pOptions?: any): Array<{
|
|
29
|
+
id: string;
|
|
30
|
+
text: string;
|
|
31
|
+
}>;
|
|
21
32
|
/**
|
|
22
33
|
* Checks if a list exists in the Pict Provider MetaLists.
|
|
23
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-Provider-MetaLists.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-MetaLists.js"],"names":[],"mappings":";AAaA;;GAEG;AACH;IAcE,kBAAkB;IAClB,SADW,GAAG,CACF;IACZ,
|
|
1
|
+
{"version":3,"file":"Pict-Provider-MetaLists.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-MetaLists.js"],"names":[],"mappings":";AAaA;;GAEG;AACH;IAcE,kBAAkB;IAClB,SADW,GAAG,CACF;IACZ,6QAA6Q;IAC7Q,MADW,OAAO,MAAM,CAAC,GAAG;QAAE,GAAG,EAAE,GAAG,CAAC;QAAC,6CAA6C,EAAE,CAAC,IAAI,QAAQ,KAAK,GAAG,CAAC;QAAC,qCAAqC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;QAAC,mBAAmB,EAAE,OAAO,8DAA8D,CAAC,CAAA;KAAE,CAChQ;IACT,6BAA6B;IAC7B,OADW,OAAO,MAAM,CAAC,CACf;IAQV,kBAAuB;IACvB,oBAAyB;IAE1B,2DAA2D;IAE3D;;;;;;;OAOG;IACH,mBALW,MAAM,mBAGJ,KAAK;YARE,MAAM;cAAQ,MAAM;MAQR,CAsB/B;IAED;;;;;OAKG;IACH,mBAHW,MAAM,GACJ,OAAO,CAKnB;IAED;;;OAGG;IACH,iDAsBC;IAED;;;;OAIG;IACH,6BAFW,MAAM,QAQhB;IAED;;;;OAIG;IACH,qCAwGC;CACD;;;;;AA9OD,kCAAkC;AAClC,6CADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAS3B"}
|
|
@@ -9,7 +9,7 @@ declare class PictMetatemplateGenerator extends libPictProvider {
|
|
|
9
9
|
/** @type {libPictViewDynamicForm} */
|
|
10
10
|
dynamicInputView: libPictViewDynamicForm;
|
|
11
11
|
baseTemplatePrefix: string;
|
|
12
|
-
onInitializeAsync(fCallback: any):
|
|
12
|
+
onInitializeAsync(fCallback: any): void;
|
|
13
13
|
createOnDemandMetatemplateView(): void;
|
|
14
14
|
/**
|
|
15
15
|
* Retrieves the metatemplate template reference in raw format.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-Provider-MetatemplateGenerator.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-MetatemplateGenerator.js"],"names":[],"mappings":";AAkDA;;;GAGG;AACH;IAcE,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IAIT,qCAAqC;IACrC,kBADW,sBAAsB,CACZ;IAErB,2BAAwC;IAGzC,
|
|
1
|
+
{"version":3,"file":"Pict-Provider-MetatemplateGenerator.d.ts","sourceRoot":"","sources":["../../../source/providers/Pict-Provider-MetatemplateGenerator.js"],"names":[],"mappings":";AAkDA;;;GAGG;AACH;IAcE,6BAA6B;IAC7B,MADW,OAAO,MAAM,CAAC,CAChB;IAIT,qCAAqC;IACrC,kBADW,sBAAsB,CACZ;IAErB,2BAAwC;IAGzC,wCAIC;IAED,uCAYC;IAED;;;;;;;OAOG;IACH,kEAJW,MAAM,2BACN,MAAM,GACJ,MAAM,CAmBlB;IAED;;;;;;;OAOG;IACH,+DAJW,MAAM,oBACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;;;;;OAQG;IACH,6DALW,MAAM,cACN,MAAM,oBACN,MAAM,GACJ,MAAM,CA4BlB;IAED;;;;;;;;;;OAUG;IACH,oEAPW,MAAM,cACN,MAAM,oBACN,MAAM,eACN,MAAM,aACN,MAAM,GACJ,MAAM,CAqDlB;IAED;;;;;;;;OAQG;IACH,qEALW,MAAM,cACN,MAAM,oBACN,MAAM,GACJ,MAAM,CA4BlB;IAED;;;;;;OAMG;IACH,qDA2BC;IAED;;;;;;OAMG;IACH,wCA8BC;CACD;;;;;;AA3VD,kCAAkC;AAClC,6CADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAS3B"}
|