pict-section-form 1.0.14 → 1.0.15

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 (32) hide show
  1. package/eslint.config.mjs +10 -0
  2. package/package.json +9 -3
  3. package/source/application/Pict-Application-Form.js +1 -1
  4. package/source/providers/Pict-Provider-DynamicSolver.js +5 -5
  5. package/source/providers/Pict-Provider-DynamicTemplates-DefaultFormTemplates.js +2 -2
  6. package/source/templates/Pict-Template-Metacontroller-ValueSetWithGroup.js +2 -2
  7. package/source/views/Pict-View-DynamicForm.js +1 -3
  8. package/source/views/Pict-View-Form-Metacontroller.js +1 -1
  9. package/test/PictSectionForm-Basic_tests.js +88 -1
  10. package/tsconfig.json +14 -0
  11. package/types/Pict-Section-Form.d.ts +35 -0
  12. package/types/Pict-Section-Form.d.ts.map +1 -0
  13. package/types/application/Pict-Application-Form.d.ts +18 -0
  14. package/types/application/Pict-Application-Form.d.ts.map +1 -0
  15. package/types/providers/Pict-Provider-DynamicLayout.d.ts +24 -0
  16. package/types/providers/Pict-Provider-DynamicLayout.d.ts.map +1 -0
  17. package/types/providers/Pict-Provider-DynamicSolver.d.ts +97 -0
  18. package/types/providers/Pict-Provider-DynamicSolver.d.ts.map +1 -0
  19. package/types/providers/Pict-Provider-DynamicTemplates-DefaultFormTemplates.d.ts +6 -0
  20. package/types/providers/Pict-Provider-DynamicTemplates-DefaultFormTemplates.d.ts.map +1 -0
  21. package/types/providers/Pict-Provider-DynamicTemplates.d.ts +16 -0
  22. package/types/providers/Pict-Provider-DynamicTemplates.d.ts.map +1 -0
  23. package/types/providers/Pict-Provider-Informary.d.ts +69 -0
  24. package/types/providers/Pict-Provider-Informary.d.ts.map +1 -0
  25. package/types/providers/Pict-Provider-MetatemplateGenerator.d.ts +14 -0
  26. package/types/providers/Pict-Provider-MetatemplateGenerator.d.ts.map +1 -0
  27. package/types/templates/Pict-Template-Metacontroller-ValueSetWithGroup.d.ts +17 -0
  28. package/types/templates/Pict-Template-Metacontroller-ValueSetWithGroup.d.ts.map +1 -0
  29. package/types/views/Pict-View-DynamicForm.d.ts +45 -0
  30. package/types/views/Pict-View-DynamicForm.d.ts.map +1 -0
  31. package/types/views/Pict-View-Form-Metacontroller.d.ts +94 -0
  32. package/types/views/Pict-View-Form-Metacontroller.d.ts.map +1 -0
@@ -0,0 +1,10 @@
1
+ import globals from "globals";
2
+ import pluginJs from "@eslint/js";
3
+
4
+
5
+ export default [
6
+ { files: ["source/**"], languageOptions: { sourceType: "commonjs" } },
7
+ { languageOptions: { globals: { ...globals.browser, ...globals.mocha, } } },
8
+ pluginJs.configs.recommended,
9
+ { rules: { "no-prototype-builtins": "off", "no-unused-vars": "warn", "no-case-declarations": "warn" } },
10
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Pict dynamic form sections",
5
5
  "main": "source/Pict-Section-Form.js",
6
6
  "directories": {
@@ -19,16 +19,22 @@
19
19
  "tests": "npx mocha -u tdd --exit -R spec --grep",
20
20
  "coverage": "npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",
21
21
  "build": "npx quack build",
22
- "test": "npx mocha -u tdd -R spec"
22
+ "test": "npx mocha -u tdd -R spec",
23
+ "lint": "eslint source/**",
24
+ "types": "npx -p typescript tsc -p . --outDir types"
23
25
  },
26
+ "types": "types/Pict-Section-Form.d.ts",
24
27
  "author": "steven velozo <steven@velozo.com>",
25
28
  "license": "MIT",
26
29
  "devDependencies": {
30
+ "@eslint/js": "^9.4.0",
27
31
  "browser-env": "^3.3.0",
32
+ "eslint": "^9.4.0",
28
33
  "jquery": "^3.7.1",
29
34
  "pict": "^1.0.200",
30
35
  "pict-application": "^1.0.18",
31
- "quackage": "^1.0.30"
36
+ "quackage": "^1.0.30",
37
+ "typescript": "^5.4.5"
32
38
  },
33
39
  "dependencies": {
34
40
  "fable-serviceproviderbase": "^3.0.13",
@@ -39,4 +39,4 @@ module.exports.default_configuration = (
39
39
  {
40
40
  "Product": "PictDefaultFormsApp"
41
41
  }
42
- });
42
+ });
@@ -51,7 +51,7 @@ class PictDynamicSolver extends libPictProvider
51
51
  }
52
52
  if (!('Expression' in tmpSolver))
53
53
  {
54
- pView.log.error(`Dynamic View [${pView.UUID}]::[${pView.Hash}] group ${tmpGroup.Hash} solver ${k} is missing the Expression property.`);
54
+ this.pict.log.error(`Dynamic View solver ${pOrdinal} is missing the Expression property.`, { Solver: pSolver });
55
55
  return;
56
56
  }
57
57
  if (!(`Ordinal` in tmpSolver))
@@ -116,7 +116,7 @@ class PictDynamicSolver extends libPictProvider
116
116
  }
117
117
  }
118
118
  }
119
- if (typeof(tmpRecordSet) == 'array')
119
+ if (Array.isArray(tmpRecordSet))
120
120
  {
121
121
  for (let l = 0; l < tmpRecordSet.length; l++)
122
122
  {
@@ -183,12 +183,12 @@ class PictDynamicSolver extends libPictProvider
183
183
  for (let i = 0; i < pViewSolverArray.length; i++)
184
184
  {
185
185
  let tmpSolver = this.checkSolver(pViewSolverArray[i].Solver, tmpFiltered, pOrdinal);
186
- tmpSolver.Hash = `${pViewSolverArray[i].ViewHash}-ViewSolve-${i}`;
187
- tmpSolver.StartTimeStamp = +new Date();
188
186
  if (typeof(tmpSolver) === 'undefined')
189
187
  {
190
188
  continue;
191
189
  }
190
+ tmpSolver.Hash = `${pViewSolverArray[i].ViewHash}-ViewSolve-${i}`;
191
+ tmpSolver.StartTimeStamp = +new Date();
192
192
  if (this.pict.LogNoisiness > 1)
193
193
  {
194
194
  tmpView.log.trace(`Dynamic View [${tmpView.UUID}]::[${tmpView.Hash}] running solve() on view [${pViewSolverArray[i].ViewHash}`);
@@ -320,4 +320,4 @@ class PictDynamicSolver extends libPictProvider
320
320
  }
321
321
 
322
322
  module.exports = PictDynamicSolver;
323
- module.exports.default_configuration = _DefaultProviderConfiguration;
323
+ module.exports.default_configuration = _DefaultProviderConfiguration;
@@ -17,7 +17,7 @@ module.exports = (
17
17
  ;,//;, ,;/
18
18
  o:::::::;;///
19
19
  >::::::::;;\\\
20
- ''\\\\\'" ';\
20
+ ''\\\\'" ';\
21
21
 
22
22
  Glug glug glug Oo... -->
23
23
  <div id="Pict-{~D:Context[0].UUID~}-FormContainer" class="pict-form">`
@@ -341,4 +341,4 @@ Glug glug glug Oo... -->
341
341
  */
342
342
 
343
343
  ]
344
- });
344
+ });
@@ -128,7 +128,7 @@ class PictTemplateMetacontrollerValueSet extends libPictTemplate
128
128
  {
129
129
  for (let i = 0; i < tmpData.length; i++)
130
130
  {
131
- tmpDataValueSet.push({ Value: tmpData[i], Key: i, Group: tmpGroupIndex });
131
+ tmpDataValueSet.push({ Value: tmpData[i], Key: i, });
132
132
  }
133
133
  }
134
134
  else if (typeof (tmpData) === 'object')
@@ -136,7 +136,7 @@ class PictTemplateMetacontrollerValueSet extends libPictTemplate
136
136
  let tmpValueKeys = Object.keys(tmpData);
137
137
  for (let i = 0; i < tmpValueKeys.length; i++)
138
138
  {
139
- tmpDataValueSet.push({ Value: tmpData[tmpValueKeys[i]], Key: tmpValueKeys[i], Group: tmpGroupIndex });
139
+ tmpDataValueSet.push({ Value: tmpData[tmpValueKeys[i]], Key: tmpValueKeys[i] });
140
140
  }
141
141
  }
142
142
  else
@@ -13,12 +13,10 @@ class PictViewDynamicForm extends libPictViewClass
13
13
  if (!tmpOptions.Manifests)
14
14
  {
15
15
  throw new Error('PictSectionForm instantiation attempt without a Manifests in pOptions.Manifest -- cannot instantiate.');
16
- return;
17
16
  }
18
17
  if (!('Section' in tmpOptions.Manifests))
19
18
  {
20
19
  throw new Error('PictSectionForm instantiation attempt without a Section manifest in pOptions.Manifests -- cannot instantiate.');
21
- return;
22
20
  }
23
21
 
24
22
  // Set the default destination address to be based on the section hash if it hasn't been overridden by the manifest section definition
@@ -965,4 +963,4 @@ class PictViewDynamicForm extends libPictViewClass
965
963
  }
966
964
  }
967
965
 
968
- module.exports = PictViewDynamicForm;
966
+ module.exports = PictViewDynamicForm;
@@ -249,7 +249,7 @@ class PictFormMetacontroller extends libPictViewClass
249
249
  }
250
250
  catch(pError)
251
251
  {
252
- this.log.error('getSectionDefinition() failed to parse the section object.');
252
+ this.log.error(`getSectionDefinition() failed to parse the section object with error: ${pError.message || pError}`);
253
253
  return false;
254
254
  }
255
255
  }
@@ -7,6 +7,8 @@
7
7
  const libBrowserEnv = require('browser-env')
8
8
  libBrowserEnv();
9
9
 
10
+ const libPictView = require('pict-view');
11
+
10
12
  const Chai = require('chai');
11
13
  const Expect = Chai.expect;
12
14
 
@@ -16,6 +18,38 @@ const libPictSectionForm = require('../source/Pict-Section-Form.js');
16
18
 
17
19
  const manifestPostcard = require('../example_applications/postcard_example/providers/PictProvider-Dynamic-Sections-MockServerResponse.json');
18
20
 
21
+ class DoNothingApplication extends libPictSectionForm.PictFormApplication
22
+ {
23
+ constructor(pFable, pOptions, pServiceHash)
24
+ {
25
+ super(pFable, pOptions, pServiceHash);
26
+
27
+ this.pict.addView('DoNothingView', {}, DoNothingView);
28
+ }
29
+
30
+ /**
31
+ * @param {function} fDone - Callback that finishes the test
32
+ */
33
+ set testDone(fDone)
34
+ {
35
+ this._testDone = fDone;
36
+ }
37
+
38
+ onAfterInitialize()
39
+ {
40
+ this.solve();
41
+ this._testDone();
42
+ }
43
+ }
44
+
45
+ class DoNothingView extends libPictView
46
+ {
47
+ constructor(pict, configuration)
48
+ {
49
+ super(pict, configuration);
50
+ }
51
+ }
52
+
19
53
  suite
20
54
  (
21
55
  'PictSectionForm Basic',
@@ -50,7 +84,60 @@ suite
50
84
  return fDone();
51
85
  }
52
86
  );
87
+ });
88
+ suite
89
+ (
90
+ 'Solver Tests',
91
+ () =>
92
+ {
93
+ test(
94
+ 'No-Op Solve',
95
+ (fDone) =>
96
+ {
97
+ //NOTE: code is a clone of Pict.safeLoadPictApplication
98
+ let _Pict;
99
+ if (DoNothingApplication && ('default_configuration' in DoNothingApplication) && ('pict_configuration' in DoNothingApplication.default_configuration))
100
+ {
101
+ _Pict = new libPict(DoNothingApplication.default_configuration.pict_configuration);
102
+ }
103
+ else
104
+ {
105
+ _Pict = new libPict();
106
+ }
107
+
108
+ _Pict.LogNoisiness = 1;
109
+
110
+ let tmpApplicationHash = 'DefaultApplication';
111
+ let tmpDefaultConfiguration = {};
112
+
113
+ if ('default_configuration' in DoNothingApplication)
114
+ {
115
+ tmpDefaultConfiguration = DoNothingApplication.default_configuration;
116
+
117
+ if ('Hash' in DoNothingApplication.default_configuration)
118
+ {
119
+ tmpDefaultConfiguration = DoNothingApplication.default_configuration;
120
+ tmpApplicationHash = DoNothingApplication.default_configuration.Hash;
121
+ }
122
+ }
123
+ _Pict.log.info(`Loading the pict application [${tmpApplicationHash}] and associated views.`);
124
+
125
+ _Pict.addApplication(tmpApplicationHash, tmpDefaultConfiguration, DoNothingApplication);
126
+
127
+ _Pict.PictApplication.testDone = fDone;
128
+
129
+ _Pict.PictApplication.initializeAsync(
130
+ function (pError)
131
+ {
132
+ if (pError)
133
+ {
134
+ console.log('Error initializing the pict application: '+pError)
135
+ }
136
+ _Pict.log.info('Loading the Application and associated views.');
137
+ });
138
+ }
139
+ );
53
140
  }
54
141
  );
55
142
  }
56
- );
143
+ );
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "include": ["source/**/*.js"],
3
+ "compilerOptions":
4
+ {
5
+ "target": "es2019",
6
+ "allowJs": true,
7
+ "declaration": true,
8
+ "emitDeclarationOnly": true,
9
+ "outDir": "dist",
10
+ "declarationMap": true,
11
+ "module": "commonjs",
12
+ "resolveJsonModule": true
13
+ }
14
+ }
@@ -0,0 +1,35 @@
1
+ declare const _exports: {
2
+ new (pFable: any, pOptions: any, pServiceHash: any): import("./views/Pict-View-DynamicForm.js");
3
+ default_configuration: {
4
+ AutoRender: boolean;
5
+ AutoSolveWithApp: boolean;
6
+ DefaultRenderable: string;
7
+ DefaultDestinationAddress: string;
8
+ Renderables: any[];
9
+ Templates: any[];
10
+ MacroTemplates: {
11
+ Section: {
12
+ HTMLID: string;
13
+ };
14
+ Group: {
15
+ HTMLID: string;
16
+ TabularCreateRowFunctionCall: string;
17
+ };
18
+ Input: {
19
+ Informary: string;
20
+ InformaryTabular: string;
21
+ HTMLName: string;
22
+ HTMLID: string;
23
+ HTMLForID: string;
24
+ InputFullProperties: string;
25
+ InputChangeHandler: string;
26
+ };
27
+ };
28
+ TargetElementAddress: string;
29
+ };
30
+ PictFormTemplateProvider: typeof import("./providers/Pict-Provider-DynamicTemplates.js");
31
+ PictFormMetacontroller: typeof import("./views/Pict-View-Form-Metacontroller.js");
32
+ PictFormApplication: typeof import("./application/Pict-Application-Form.js");
33
+ };
34
+ export = _exports;
35
+ //# sourceMappingURL=Pict-Section-Form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Section-Form.d.ts","sourceRoot":"","sources":["../source/Pict-Section-Form.js"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ export = PictSectionFormApplication;
2
+ declare class PictSectionFormApplication {
3
+ constructor(pFable: any, pOptions: any, pServiceHash: any);
4
+ marshalDataFromDynamicViewsToAppData(): void;
5
+ marshalDataFromAppDataToDynamicViews(): void;
6
+ }
7
+ declare namespace PictSectionFormApplication {
8
+ export { default_configuration };
9
+ }
10
+ declare namespace default_configuration {
11
+ let Name: string;
12
+ let Hash: string;
13
+ let MainViewportViewIdentifier: string;
14
+ namespace pict_configuration {
15
+ let Product: string;
16
+ }
17
+ }
18
+ //# sourceMappingURL=Pict-Application-Form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Application-Form.d.ts","sourceRoot":"","sources":["../../source/application/Pict-Application-Form.js"],"names":[],"mappings":";AAIA;IAEC,2DASC;IAED,6CAGC;IAED,6CAGC;CACD"}
@@ -0,0 +1,24 @@
1
+ export = PictDynamicLayout;
2
+ /**
3
+ * The PictDynamicLayout class is a provider that generates dynamic layouts based on configuration.
4
+ */
5
+ declare class PictDynamicLayout {
6
+ /**
7
+ * Creates an instance of the PictDynamicLayout class.
8
+ *
9
+ * @param {object} pFable - The fable object.
10
+ * @param {object} pOptions - The options object.
11
+ * @param {object} pServiceHash - The service hash object.
12
+ */
13
+ constructor(pFable: object, pOptions: object, pServiceHash: object);
14
+ }
15
+ declare namespace PictDynamicLayout {
16
+ export { _DefaultProviderConfiguration as default_configuration };
17
+ }
18
+ declare namespace _DefaultProviderConfiguration {
19
+ let ProviderIdentifier: string;
20
+ let AutoInitialize: boolean;
21
+ let AutoInitializeOrdinal: number;
22
+ let AutoSolveWithApp: boolean;
23
+ }
24
+ //# sourceMappingURL=Pict-Provider-DynamicLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-DynamicLayout.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-DynamicLayout.js"],"names":[],"mappings":";AAYA;;GAEG;AACH;IAEC;;;;;;OAMG;IACH,oBAJW,MAAM,YACN,MAAM,gBACN,MAAM,EAMhB;CACD"}
@@ -0,0 +1,97 @@
1
+ export = PictDynamicSolver;
2
+ /**
3
+ * The PictDynamicSolver class is a provider that solves configuration-generated dynamic views.
4
+ */
5
+ declare class PictDynamicSolver {
6
+ /**
7
+ * Creates an instance of the PictDynamicSolver class.
8
+ *
9
+ * @param {object} pFable - The fable object.
10
+ * @param {object} pOptions - The options object.
11
+ * @param {object} pServiceHash - The service hash object.
12
+ */
13
+ constructor(pFable: object, pOptions: object, pServiceHash: object);
14
+ /**
15
+ * Checks the solver and returns the solver object if it passes the checks.
16
+ *
17
+ * Automatically converts string solvers to have an Ordinal of 1.
18
+ *
19
+ * @param {string|object} pSolver - The solver to be checked. It can be either a string or an object.
20
+ * @param {boolean} pFiltered - Indicates whether the solvers should be filtered.
21
+ * @param {number} pOrdinal - The ordinal value to compare with the solver's ordinal value when filtered.
22
+ * @returns {object|undefined} - The solver object if it passes the checks, otherwise undefined.
23
+ */
24
+ checkSolver(pSolver: string | object, pFiltered: boolean, pOrdinal: number): object | undefined;
25
+ /**
26
+ * Runs each RecordSet solver formulae for a dynamic view group at a given ordinal.
27
+ *
28
+ * Or for all ordinals if no ordinal is passed.
29
+ *
30
+ * @param {array} pGroupSolverArray - An array of Solvers from the groups to solve.
31
+ * @param {number} pOrdinal - The ordinal value to filter to. Optional.
32
+ */
33
+ executeGroupSolvers(pGroupSolverArray: any[], pOrdinal: number): void;
34
+ /**
35
+ * Executes the section solvers at a given ordinal (or all if no ordinal is passed).
36
+ *
37
+ * @param {Array} pViewSectionSolverArray - The array of view section solvers.
38
+ * @param {number} pOrdinal - The ordinal value.
39
+ */
40
+ executeSectionSolvers(pViewSectionSolverArray: any[], pOrdinal: number): void;
41
+ /**
42
+ * Executes the view solvers for the given array of view hashes.
43
+ *
44
+ * @param {Array} pViewSolverArray - The array of view solvers to execute.
45
+ * @param {number} pOrdinal - The ordinal value.
46
+ */
47
+ executeViewSolvers(pViewSolverArray: any[], pOrdinal: number): void;
48
+ /**
49
+ * Checks if the given ordinal exists in the provided ordinal set.
50
+ *
51
+ * If not, it adds the ordinal to the set.
52
+ *
53
+ * @param {number} pOrdinal - The ordinal to check.
54
+ * @param {Object} pOrdinalSet - The ordinal set to check against.
55
+ * @returns {Object} - The ordinal object from the ordinal set.
56
+ */
57
+ checkAutoSolveOrdinal(pOrdinal: number, pOrdinalSet: any): any;
58
+ /**
59
+ * Solves the views based on the provided view hashes or all views in pict.
60
+ *
61
+ * If non-dynamic views are also passed in, they are solved as well.
62
+ *
63
+ * This algorithm is particularly complex because it solves views in
64
+ * order across two dimensions:
65
+ *
66
+ * 1. The order of the views in the view hash array.
67
+ * 2. Precedence order (based on Ordinal)
68
+ *
69
+ * The way it manages the precedence order solving is by enumerating the
70
+ * view hash array multiple times until it exhausts the solution set.
71
+ *
72
+ * In dynamic views, when there are collisions in precedence order between
73
+ * Section Solvers and Group RecordSet Solvers, it prefers the RecordSet
74
+ * solvers first. The thinking behind this is that a RecordSet solver is
75
+ * a "tier down" from the core Section it resides within. These are
76
+ * leaves on the tree.
77
+
78
+ * @param {Array|string[]} [pViewHashes] - An optional array of view hashes to solve. If not provided, all views in the fable will be solved.
79
+ */
80
+ solveViews(pViewHashes?: any[] | string[]): void;
81
+ lastSolveOutcome: {
82
+ StartTimeStamp: number;
83
+ ViewHashes: any[];
84
+ SolveOrdinals: {};
85
+ EndTimeStamp: number;
86
+ };
87
+ }
88
+ declare namespace PictDynamicSolver {
89
+ export { _DefaultProviderConfiguration as default_configuration };
90
+ }
91
+ declare namespace _DefaultProviderConfiguration {
92
+ let ProviderIdentifier: string;
93
+ let AutoInitialize: boolean;
94
+ let AutoInitializeOrdinal: number;
95
+ let AutoSolveWithApp: boolean;
96
+ }
97
+ //# sourceMappingURL=Pict-Provider-DynamicSolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-DynamicSolver.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-DynamicSolver.js"],"names":[],"mappings":";AAYA;;GAEG;AACH;IAEC;;;;;;OAMG;IACH,oBAJW,MAAM,YACN,MAAM,gBACN,MAAM,EAMhB;IAED;;;;;;;;;OASG;IACH,qBALW,MAAM,GAAC,MAAM,aACb,OAAO,YACP,MAAM,GACJ,MAAM,GAAC,SAAS,CA8B5B;IAED;;;;;;;OAOG;IACH,wDAFW,MAAM,QAyDhB;IAED;;;;;OAKG;IACH,gEAFW,MAAM,QA+BhB;IAED;;;;;OAKG;IACH,sDAFW,MAAM,QAwBhB;IAED;;;;;;;;OAQG;IACH,gCAJW,MAAM,yBAWhB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,yBAFW,QAAM,MAAM,EAAE,QA8ExB;IADA;;;;;MAAuC;CAExC"}
@@ -0,0 +1,6 @@
1
+ export let TemplatePrefix: string;
2
+ export let Templates: {
3
+ HashPostfix: string;
4
+ Template: string;
5
+ }[];
6
+ //# sourceMappingURL=Pict-Provider-DynamicTemplates-DefaultFormTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-DynamicTemplates-DefaultFormTemplates.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-DynamicTemplates-DefaultFormTemplates.js"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export = PictDynamicFormsTemplates;
2
+ declare class PictDynamicFormsTemplates {
3
+ constructor(pFable: any, pOptions: any, pServiceHash: any);
4
+ formsTemplateSetPrefix: any;
5
+ formsTemplateSet: {};
6
+ }
7
+ declare namespace PictDynamicFormsTemplates {
8
+ export { _DefaultProviderConfiguration as default_configuration };
9
+ }
10
+ declare namespace _DefaultProviderConfiguration {
11
+ let ProviderIdentifier: string;
12
+ let AutoInitialize: boolean;
13
+ let AutoInitializeOrdinal: number;
14
+ let AutoSolveWithApp: boolean;
15
+ }
16
+ //# sourceMappingURL=Pict-Provider-DynamicTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-DynamicTemplates.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-DynamicTemplates.js"],"names":[],"mappings":";AAcA;IAEC,2DAqEC;IAzDA,4BAAgC;IAChC,qBAA0B;CAyD3B"}
@@ -0,0 +1,69 @@
1
+ export = PictDynamicFormsInformary;
2
+ /**
3
+ * Represents a provider for dynamic forms in the PICT system.
4
+ * Extends the `libPictProvider` class.
5
+ */
6
+ declare class PictDynamicFormsInformary {
7
+ /**
8
+ * Creates an instance of the `PictDynamicFormsInformary` class.
9
+ * @param {object} pFable - The fable object.
10
+ * @param {object} pOptions - The options object.
11
+ * @param {object} pServiceHash - The service hash object.
12
+ */
13
+ constructor(pFable: object, pOptions: object, pServiceHash: object);
14
+ genericManifest: any;
15
+ /**
16
+ * Retrieves all form elements for a given form hash.
17
+ *
18
+ * @param {string} pFormHash - The hash of the form.
19
+ * @returns {HTMLElement[]} - An array of HTML elements representing the form elements.
20
+ */
21
+ getFormElements(pFormHash: string): HTMLElement[];
22
+ /**
23
+ * Get a full content browser address based on the form, datum and optionally the container and index.
24
+ *
25
+ * This can be used in getDomElementByAddress or jquery selectors to return the element.
26
+ *
27
+ * @param {string} pFormHash - The form hash.
28
+ * @param {string} pDatumHash - The datum hash.
29
+ * @param {string|null} pContainer - The container (optional).
30
+ * @param {number} pIndex - The index.
31
+ * @returns {string} The content browser address.
32
+ */
33
+ getContentBrowserAddress(pFormHash: string, pDatumHash: string, pContainer: string | null, pIndex: number): string;
34
+ /**
35
+ * Returns the composed container address string for a given container, index, and datum hash.
36
+ *
37
+ * @param {string} pContainer - The container name.
38
+ * @param {number} pIndex - The index of the container.
39
+ * @param {string} pDatumHash - The datum hash.
40
+ * @returns {string} The composed container address.
41
+ */
42
+ getComposedContainerAddress(pContainer: string, pIndex: number, pDatumHash: string): string;
43
+ /**
44
+ * Marshals form data to the provided application state data object using the given form hash and manifest.
45
+ *
46
+ * @param {object} pAppStateData - The application state data object to marshal the form data to.
47
+ * @param {string} pFormHash - The form hash representing the form elements.
48
+ * @param {object} pManifest - The manifest object used to map form data to the application state data.
49
+ */
50
+ marshalFormToData(pAppStateData: object, pFormHash: string, pManifest: object): void;
51
+ /**
52
+ * Marshals data from some application state object to a specific subset of browser form elements.
53
+ *
54
+ * @param {object} pAppStateData - The application state data to marshal into the form. Usually AppData but can be other objects.
55
+ * @param {string} pFormHash - The hash of the form to marshal data into. This is the data-i-form attribute.
56
+ * @param {object} pManifest - The manifest object. If not provided, the generic manifest is used.
57
+ */
58
+ marshalDataToForm(pAppStateData: object, pFormHash: string, pManifest: object): void;
59
+ }
60
+ declare namespace PictDynamicFormsInformary {
61
+ export { _DefaultProviderConfiguration as default_configuration };
62
+ }
63
+ declare namespace _DefaultProviderConfiguration {
64
+ let ProviderIdentifier: string;
65
+ let AutoInitialize: boolean;
66
+ let AutoInitializeOrdinal: number;
67
+ let AutoSolveWithApp: boolean;
68
+ }
69
+ //# sourceMappingURL=Pict-Provider-Informary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-Informary.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-Informary.js"],"names":[],"mappings":";AAaA;;;GAGG;AACH;IAEC;;;;;OAKG;IACH,oBAJW,MAAM,YACN,MAAM,gBACN,MAAM,EAShB;IADA,qBAAwE;IAGzE;;;;;OAKG;IACH,2BAHW,MAAM,GACJ,WAAW,EAAE,CAOzB;IAED;;;;;;;;;;OAUG;IACH,oCANW,MAAM,cACN,MAAM,cACN,MAAM,GAAC,IAAI,UACX,MAAM,GACJ,MAAM,CAalB;IAED;;;;;;;OAOG;IACH,wCALW,MAAM,UACN,MAAM,cACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,aACN,MAAM,aACN,MAAM,QAqChB;IAED;;;;;;OAMG;IACH,iCAJW,MAAM,aACN,MAAM,aACN,MAAM,QA4ChB;CACD"}
@@ -0,0 +1,14 @@
1
+ export = PictSectionFormMetatemplateGenerator;
2
+ declare class PictSectionFormMetatemplateGenerator {
3
+ constructor(pFable: any, pOptions: any, pServiceHash: any);
4
+ }
5
+ declare namespace PictSectionFormMetatemplateGenerator {
6
+ export { _DefaultProviderConfiguration as default_configuration };
7
+ }
8
+ declare namespace _DefaultProviderConfiguration {
9
+ let ProviderIdentifier: string;
10
+ let AutoInitialize: boolean;
11
+ let AutoInitializeOrdinal: number;
12
+ let AutoSolveWithApp: boolean;
13
+ }
14
+ //# sourceMappingURL=Pict-Provider-MetatemplateGenerator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Provider-MetatemplateGenerator.d.ts","sourceRoot":"","sources":["../../source/providers/Pict-Provider-MetatemplateGenerator.js"],"names":[],"mappings":";AAYA;IAEC,2DAKC;CACD"}
@@ -0,0 +1,17 @@
1
+ export = PictTemplateMetacontrollerValueSet;
2
+ /**
3
+ * This is a template that will take a value set and render a template for each value in the set.
4
+ *
5
+ * It passes along additional context (the metacontroller group) for dynamic programming tables.
6
+ */
7
+ declare class PictTemplateMetacontrollerValueSet {
8
+ /**
9
+ * @param {Object} pFable - The Fable Framework instance
10
+ * @param {Object} pOptions - The options for the service
11
+ * @param {String} pServiceHash - The hash of the service
12
+ */
13
+ constructor(pFable: any, pOptions: any, pServiceHash: string);
14
+ render(pTemplateHash: any, pRecord: any, pContextArray: any): any;
15
+ renderAsync(pTemplateHash: any, pRecord: any, fCallback: any, pContextArray: any): any;
16
+ }
17
+ //# sourceMappingURL=Pict-Template-Metacontroller-ValueSetWithGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-Template-Metacontroller-ValueSetWithGroup.d.ts","sourceRoot":"","sources":["../../source/templates/Pict-Template-Metacontroller-ValueSetWithGroup.js"],"names":[],"mappings":";AAEA;;;;GAIG;AACH;IAEC;;;;OAIG;IACH,8DAMC;IAED,kEA8DC;IACD,uFAwFC;CACD"}
@@ -0,0 +1,45 @@
1
+ export = PictViewDynamicForm;
2
+ declare class PictViewDynamicForm {
3
+ constructor(pFable: any, pOptions: any, pServiceHash: any);
4
+ sectionDefinition: any;
5
+ sectionManifest: any;
6
+ sectionSolvers: any[];
7
+ formsTemplateSetPrefix: string;
8
+ defaultTemplatePrefix: string;
9
+ formID: string;
10
+ viewMarshalDestination: boolean;
11
+ renderToPrimary(): void;
12
+ dataChanged(pInputHash: any): void;
13
+ getMarshalDestinationAddress(): any;
14
+ getMarshalDestinationObject(): boolean;
15
+ onMarshalToView(): any;
16
+ onMarshalFromView(): any;
17
+ onSolve(): any;
18
+ initializeFormGroups(): void;
19
+ rebuildMacros(): boolean;
20
+ checkViewSpecificTemplate(pTemplatePostfix: any): boolean;
21
+ checkThemeSpecificTemplate(pTemplatePostfix: any): boolean;
22
+ getMetatemplateTemplateReferenceRaw(pTemplatePostfix: any, pRawTemplateDataAddress: any): string | false;
23
+ getMetatemplateTemplateReference(pTemplatePostfix: any, pViewDataAddress: any): string | false;
24
+ getInputMetatemplateTemplateReference(pDataType: any, pInputType: any, pViewDataAddress: any): string | false;
25
+ getTabularInputMetatemplateTemplateReference(pDataType: any, pInputType: any, pViewDataAddress: any, pRecordSubAddress: any): string;
26
+ rebuildCustomTemplate(): void;
27
+ getTabularRecordInput(pGroupIndex: any, pInputIndex: any): any;
28
+ getTabularRecordData(pGroupIndex: any, pRowIdentifier: any): any;
29
+ getTabularRecordSet(pGroupIndex: any): any;
30
+ getGroup(pGroupIndex: any): any;
31
+ createDynamicTableRow(pGroupIndex: any): void;
32
+ setDynamicTableRowIndex(pGroupIndex: any, pRowIndex: any, pNewRowIndex: any): boolean;
33
+ moveDynamicTableRowDown(pGroupIndex: any, pRowIndex: any): boolean;
34
+ moveDynamicTableRowUp(pGroupIndex: any, pRowIndex: any): boolean;
35
+ deleteDynamicTableRow(pGroupIndex: any, pRowIndex: any): boolean;
36
+ getRow(pGroupIndex: any, pRowIndex: any): any;
37
+ getRowKeyValuePair(pGroupIndex: any, pRowIndex: any): {
38
+ Key: any;
39
+ Value: any;
40
+ Group: any;
41
+ };
42
+ getInput(pGroupIndex: any, pRowIndex: any, pInputIndex: any): any;
43
+ get isPictSectionForm(): boolean;
44
+ }
45
+ //# sourceMappingURL=Pict-View-DynamicForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-View-DynamicForm.d.ts","sourceRoot":"","sources":["../../source/views/Pict-View-DynamicForm.js"],"names":[],"mappings":";AAMA;IAEC,2DA+GC;IApEA,uBAAqC;IAGrC,qBAA2H;IAG3H,sBAAwB;IA8BxB,+BAA6D;IAmB7D,8BAA+C;IAE/C,eAAmD;IAKnD,gCAAmC;IAQpC,wBAMC;IAED,mCAOC;IAED,oCAcC;IAED,uCA6BC;IAED,uBAcC;IAED,yBAaC;IAED,eASC;IAED,6BA0GC;IAED,yBA4EC;IAED,0DAIC;IAED,2DAIC;IAED,yGAiBC;IAED,+FAGC;IAED,8GA0BC;IAED,qIA8CC;IAED,8BAoIC;IAID,+DAeC;IAED,iEAgDC;IAED,2CAUC;IAED,gCAcC;IAED,8CAsBC;IAED,sFA2BC;IAED,mEA0BC;IAED,iEA+BC;IAGD,iEAiCC;IAED,8CAsBC;IAED;;;;MAGC;IAED,kEAsBC;IAED,iCAGC;CACD"}
@@ -0,0 +1,94 @@
1
+ export = PictFormMetacontroller;
2
+ declare class PictFormMetacontroller {
3
+ constructor(pFable: any, pOptions: any, pServiceHash: any);
4
+ serviceType: string;
5
+ viewMarshalDestination: string;
6
+ formTemplatePrefix: string;
7
+ onMarshalFromView(): any;
8
+ onMarshalToView(): any;
9
+ onAfterInitializeAsync(fCallback: any): any;
10
+ onAfterRender(): any;
11
+ onSolve(): any;
12
+ /**
13
+ * Filters the views based on the provided filter and sort functions.
14
+ *
15
+ * By default, filters views based on the provided filter function and sorts them based on the provided sort function.
16
+ *
17
+ * @param {Function} fFilterFunction - The filter function used to determine if a view should be included.
18
+ * @param {Function} fSortFunction - The sort function used to sort the filtered views.
19
+ * @returns {Array} - The filtered and sorted views.
20
+ */
21
+ filterViews(fFilterFunction: Function, fSortFunction: Function): any[];
22
+ /**
23
+ * Renders a specific dynamic form section based on the provided form section hash.
24
+ *
25
+ * For this to work, we need the container for the section to be available on the form.
26
+ *
27
+ * @param {string} pFormSectionHash - The hash of the form section to render.
28
+ * @returns {void}
29
+ */
30
+ renderSpecificFormSection(pFormSectionHash: string): void;
31
+ /**
32
+ * Renders the form sections based on the provided filter and sort functions.
33
+ *
34
+ * If no filter and sort functions are provided, render all form sections.
35
+ *
36
+ * @param {Function} fFilterFunction - The filter function used to filter the views.
37
+ * @param {Function} fSortFunction - The sort function used to sort the views.
38
+ */
39
+ renderFormSections(fFilterFunction: Function, fSortFunction: Function): void;
40
+ /**
41
+ * Regenerates the DyunamicForm section templates based on the provided filter and sort function.
42
+ *
43
+ * @param {Function} fFormSectionFilter - (optional) The filter function used to determine which views to include in the regeneration.
44
+ * @param {Function} fSortFunction - (optional) The sort function used to determine the order of the views in the regeneration.
45
+ */
46
+ regenerateFormSectionTemplates(fFormSectionFilter: Function, fSortFunction: Function): void;
47
+ /**
48
+ * Generates a meta template for the DynamicForm views managed by this Metacontroller.
49
+ *
50
+ * @param {Function} fFormSectionFilter - (optional) The filter function to apply on the form section.
51
+ * @param {Function} fSortFunction - (optional) The sort function to apply on the form section.
52
+ * @returns {void}
53
+ */
54
+ generateMetatemplate(fFormSectionFilter: Function, fSortFunction: Function): void;
55
+ /**
56
+ * Retrieves a safe clone of the section definition for a given manyfest section description object.
57
+ *
58
+ * @param {object} pSectionObject - The section object.
59
+ * @returns {object|boolean} - The section definition if successful, otherwise false.
60
+ */
61
+ getSectionDefinition(pSectionObject: object): object | boolean;
62
+ /**
63
+ * Bootstraps Pict DynamicForm views from a Manyfest description JSON object.
64
+ *
65
+ * @param {Object} pManifestDescription - The manifest description object.
66
+ * @returns {Array} - An array of section definitions.
67
+ */
68
+ bootstrapPictFormViewsFromManifest(pManifestDescription: any): any[];
69
+ get isPictMetacontroller(): boolean;
70
+ }
71
+ declare namespace PictFormMetacontroller {
72
+ export { default_configuration };
73
+ }
74
+ declare namespace default_configuration {
75
+ let AutoRender: boolean;
76
+ let AutoPopulateDefaultObject: boolean;
77
+ let AutoSolveBeforeRender: boolean;
78
+ let AutoPopulateAfterRender: boolean;
79
+ let DefaultRenderable: string;
80
+ let DefaultDestinationAddress: string;
81
+ let AutoMarshalDataOnSolve: boolean;
82
+ let OnlyRenderDynamicSections: boolean;
83
+ let MetaTemplateHash: string;
84
+ let Templates: {
85
+ Hash: string;
86
+ Template: string;
87
+ }[];
88
+ let Renderables: {
89
+ RenderableHash: string;
90
+ TemplateHash: string;
91
+ DestinationAddress: string;
92
+ }[];
93
+ }
94
+ //# sourceMappingURL=Pict-View-Form-Metacontroller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AAYA;IAEC,2DAmBC;IAfA,oBAA2C;IAY3C,+BAAuC;IAEvC,2BAA4C;IAG7C,yBAWC;IAED,uBAWC;IAED,4CAOC;IAED,qBAUC;IAED,eAIC;IAGD;;;;;;;;OAQG;IACH,uEAyBC;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAOhB;IAED;;;;;;;OAOG;IACH,6EAOC;IAED;;;;;OAKG;IACH,4FASC;IAED;;;;;;OAMG;IACH,6EAFa,IAAI,CA0BhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,qEAyGC;IAED,oCAGC;CACD"}