pict-section-form 1.0.103 → 1.0.105
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/example_applications/postcard_example/Pict-Application-Postcard.js +1 -0
- package/package.json +2 -2
- package/source/Pict-Section-Form.js +1 -1
- package/source/providers/Pict-Provider-MetaLists.js +1 -1
- package/source/services/{Pict-Service-DynamicApplication.js → Pict-Service-DynamicFormDependencyManager.js} +3 -3
- package/source/views/Pict-View-DynamicForm.js +1 -1
- package/source/views/Pict-View-Form-Metacontroller.js +13 -26
- package/test/PictSectionForm-Basic_tests.js +1 -1
- package/types/source/Pict-Section-Form.d.ts +1 -1
- package/types/source/services/{Pict-Service-DynamicApplication.d.ts → Pict-Service-DynamicFormDependencyManager.d.ts} +4 -4
- package/types/source/services/Pict-Service-DynamicFormDependencyManager.d.ts.map +1 -0
- package/types/source/views/Pict-View-Form-Metacontroller.d.ts +2 -12
- package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
- package/types/source/services/Pict-Service-DynamicApplication.d.ts.map +0 -1
|
@@ -76,6 +76,7 @@ class PostcardApplication extends libPictApplication
|
|
|
76
76
|
|
|
77
77
|
// Set a custom address for all the views to marshal to.
|
|
78
78
|
// This can also be set on specific views (same property)
|
|
79
|
+
this.pict.AppData.PostKard = { };
|
|
79
80
|
this.pict.views.PictFormMetacontroller.viewMarshalDestination = 'AppData.PostKard';
|
|
80
81
|
|
|
81
82
|
this.pict.views.PostcardNavigation.render()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.105",
|
|
4
4
|
"description": "Pict dynamic form sections",
|
|
5
5
|
"main": "source/Pict-Section-Form.js",
|
|
6
6
|
"directories": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"browser-env": "^3.3.0",
|
|
32
32
|
"eslint": "^9.26.0",
|
|
33
33
|
"jquery": "^3.7.1",
|
|
34
|
-
"pict": "^1.0.
|
|
34
|
+
"pict": "^1.0.281",
|
|
35
35
|
"pict-application": "^1.0.27",
|
|
36
36
|
"pict-service-commandlineutility": "^1.0.15",
|
|
37
37
|
"quackage": "^1.0.42",
|
|
@@ -5,7 +5,7 @@ module.exports = require('./views/Pict-View-DynamicForm.js');
|
|
|
5
5
|
//module.exports.default_configuration = require('./views/Pict-View-DynamicForm-DefaultConfiguration.json');
|
|
6
6
|
|
|
7
7
|
// The dynamic application dependencies
|
|
8
|
-
module.exports.
|
|
8
|
+
module.exports.PictDynamicFormDependencyManager = require('./services/Pict-Service-DynamicFormDependencyManager.js');
|
|
9
9
|
|
|
10
10
|
// The base provider class for form section templates; meant to be subclassed
|
|
11
11
|
module.exports.PictFormTemplateProvider = require('./providers/Pict-Provider-DynamicTemplates.js');
|
|
@@ -176,7 +176,7 @@ class PictMetalist extends libPictProvider
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
// Now try to fetch the list data
|
|
179
|
-
let tmpListData = this.pict.
|
|
179
|
+
let tmpListData = this.pict.providers.DataBroker.getValueByHash(pListObject.ListSourceAddress);
|
|
180
180
|
if (!tmpListData)
|
|
181
181
|
{
|
|
182
182
|
//this.log.warn(`Dynamic MetaList Provider [${this.UUID}]::[${this.Hash}] failed to fetch the list data for PickList [${pListObject.Hash}]. Skipping.`);
|
|
@@ -23,7 +23,7 @@ const libPictLayoutCustom = require('../providers/layouts/Pict-Layout-Custom.js'
|
|
|
23
23
|
|
|
24
24
|
const libInformary = require('../providers/Pict-Provider-Informary.js');
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class PictDynamicFormDependencyManager extends libFableServiceProviderBase
|
|
27
27
|
{
|
|
28
28
|
constructor(pFable, pOptions, pServiceHash)
|
|
29
29
|
{
|
|
@@ -63,7 +63,7 @@ class PictDynamicApplication extends libFableServiceProviderBase
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
module.exports =
|
|
66
|
+
module.exports = PictDynamicFormDependencyManager;
|
|
67
67
|
|
|
68
68
|
/** @type {Record<string, any>} */
|
|
69
|
-
|
|
69
|
+
PictDynamicFormDependencyManager.default_configuration = { };
|
|
@@ -63,7 +63,7 @@ class PictViewDynamicForm extends libPictViewClass
|
|
|
63
63
|
/** @type {import('pict') & { PictApplication: import('pict-application'), log: any; instantiateServiceProviderWithoutRegistration: (hash: string) => any; }} */
|
|
64
64
|
this.pict;
|
|
65
65
|
|
|
66
|
-
if (!this.fable.
|
|
66
|
+
if (!this.fable.PictDynamicFormDependencyManager)
|
|
67
67
|
{
|
|
68
68
|
throw new Error('PictSectionForm instantiation attempt without a PictDynamicApplication service in fable -- cannot instantiate.');
|
|
69
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const libPictViewClass = require('pict-view');
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const libPictDynamicFormDependencyManager = require(`../services/Pict-Service-DynamicFormDependencyManager.js`);
|
|
4
4
|
const libPictViewDynamicForm = require('./Pict-View-DynamicForm.js');
|
|
5
5
|
|
|
6
6
|
// TODO: Potentially create an internalized list of views for this to manage, separate from the pict.views object
|
|
@@ -26,9 +26,7 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
26
26
|
this.serviceType = 'PictFormMetacontroller';
|
|
27
27
|
|
|
28
28
|
// Load the dynamic application dependencies if they don't exist
|
|
29
|
-
this.fable.addAndInstantiateSingletonService('
|
|
30
|
-
|
|
31
|
-
this.viewMarshalDestination = 'AppData';
|
|
29
|
+
this.fable.addAndInstantiateSingletonService('PictDynamicFormDependencyManager', libPictDynamicFormDependencyManager.default_configuration, libPictDynamicFormDependencyManager);
|
|
32
30
|
|
|
33
31
|
this.lastRenderedViews = [];
|
|
34
32
|
|
|
@@ -37,6 +35,16 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
37
35
|
this.manifest = this.pict.manifest;
|
|
38
36
|
}
|
|
39
37
|
|
|
38
|
+
get viewMarshalDestination()
|
|
39
|
+
{
|
|
40
|
+
return this.pict.providers.DataBroker.marshalDestination;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
set viewMarshalDestination(pValue)
|
|
44
|
+
{
|
|
45
|
+
this.pict.providers.DataBroker.marshalDestination = pValue;
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
/**
|
|
41
49
|
* Marshals data from the view to the model, usually AppData (or configured data store).
|
|
42
50
|
*
|
|
@@ -73,25 +81,6 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
73
81
|
return super.onMarshalToView();
|
|
74
82
|
}
|
|
75
83
|
|
|
76
|
-
/**
|
|
77
|
-
* Retrieves the marshal destination object. This is where the model data is stored.
|
|
78
|
-
*
|
|
79
|
-
* @returns {Object} The marshal destination object.
|
|
80
|
-
*/
|
|
81
|
-
getMarshalDestinationObject()
|
|
82
|
-
{
|
|
83
|
-
return this.manifest.getValueByHash(this, this.viewMarshalDestination);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Gets a value by hash address.
|
|
88
|
-
* @param {string} pHashAddress
|
|
89
|
-
*/
|
|
90
|
-
getValueByHash(pHashAddress)
|
|
91
|
-
{
|
|
92
|
-
return this.manifest.getValueByHash(this.getMarshalDestinationObject(), pHashAddress);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
84
|
gatherInitialBundle(fCallback)
|
|
96
85
|
{
|
|
97
86
|
if (this.manifestDescription && this.manifestDescription.InitialBundle)
|
|
@@ -517,7 +506,7 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
517
506
|
if (this.options.AutoPopulateDefaultObject)
|
|
518
507
|
{
|
|
519
508
|
// Fill out the defaults at the marshal location if it doesn't exist
|
|
520
|
-
|
|
509
|
+
const tmpMarshalDestinationObject = this.pict.providers.DataBroker.marshalDestinationObject;
|
|
521
510
|
if (typeof(tmpMarshalDestinationObject) === 'object')
|
|
522
511
|
{
|
|
523
512
|
tmpManifest.populateDefaults(tmpMarshalDestinationObject);
|
|
@@ -605,8 +594,6 @@ class PictFormMetacontroller extends libPictViewClass
|
|
|
605
594
|
}
|
|
606
595
|
}
|
|
607
596
|
|
|
608
|
-
this.manifest = tmpManifest;
|
|
609
|
-
|
|
610
597
|
// Now see if there is custom CSS
|
|
611
598
|
for (let i = 0; i < tmpSectionList.length; i++)
|
|
612
599
|
{
|
|
@@ -78,7 +78,7 @@ suite
|
|
|
78
78
|
|
|
79
79
|
tmpViewConfiguration.Manifests = { Section: manifestPostcard };
|
|
80
80
|
|
|
81
|
-
_Pict.addAndInstantiateSingletonService('
|
|
81
|
+
_Pict.addAndInstantiateSingletonService('PictDynamicFormDependencyManager', libPictSectionForm.PictDynamicFormDependencyManager.default_configuration, libPictSectionForm.PictDynamicFormDependencyManager);
|
|
82
82
|
|
|
83
83
|
let _PictSectionForm = _Pict.addView(tmpViewHash, tmpViewConfiguration, libPictSectionForm);
|
|
84
84
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _exports: {
|
|
2
2
|
new (pFable: any, pOptions: any, pServiceHash: any): import("./views/Pict-View-DynamicForm.js");
|
|
3
3
|
default_configuration: Record<string, any>;
|
|
4
|
-
|
|
4
|
+
PictDynamicFormDependencyManager: typeof import("./services/Pict-Service-DynamicFormDependencyManager.js");
|
|
5
5
|
PictFormTemplateProvider: typeof import("./providers/Pict-Provider-DynamicTemplates.js");
|
|
6
6
|
PictInputExtensionProvider: typeof import("./providers/Pict-Provider-InputExtension.js");
|
|
7
7
|
PictFormMetacontroller: typeof import("./views/Pict-View-Form-Metacontroller.js");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export =
|
|
2
|
-
declare class
|
|
1
|
+
export = PictDynamicFormDependencyManager;
|
|
2
|
+
declare class PictDynamicFormDependencyManager {
|
|
3
3
|
constructor(pFable: any, pOptions: any, pServiceHash: any);
|
|
4
4
|
/** @type {import('pict') & { addAndInstantiateSingletonService: (hash: string, options: any, prototype: any) => any }} */
|
|
5
5
|
fable: import("pict") & {
|
|
@@ -10,7 +10,7 @@ declare class PictDynamicApplication {
|
|
|
10
10
|
/** @type {string} */
|
|
11
11
|
UUID: string;
|
|
12
12
|
}
|
|
13
|
-
declare namespace
|
|
13
|
+
declare namespace PictDynamicFormDependencyManager {
|
|
14
14
|
let default_configuration: Record<string, any>;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=Pict-Service-
|
|
16
|
+
//# sourceMappingURL=Pict-Service-DynamicFormDependencyManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pict-Service-DynamicFormDependencyManager.d.ts","sourceRoot":"","sources":["../../../source/services/Pict-Service-DynamicFormDependencyManager.js"],"names":[],"mappings":";AAyBA;IAEC,2DAmCC;IA7BA,0HAA0H;IAC1H,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,iCAAiC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,GAAG,CAAA;KAAE,CAC5G;IACV,kBAAkB;IAClB,KADW,GAAG,CACN;IACR,qBAAqB;IACrB,MADW,MAAM,CACR;CAyBV;;+BAIU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC"}
|
|
@@ -11,10 +11,11 @@ export = PictFormMetacontroller;
|
|
|
11
11
|
*/
|
|
12
12
|
declare class PictFormMetacontroller extends libPictViewClass {
|
|
13
13
|
constructor(pFable: any, pOptions: any, pServiceHash: any);
|
|
14
|
-
viewMarshalDestination: string;
|
|
15
14
|
lastRenderedViews: any[];
|
|
16
15
|
formTemplatePrefix: any;
|
|
17
16
|
manifest: any;
|
|
17
|
+
set viewMarshalDestination(pValue: any);
|
|
18
|
+
get viewMarshalDestination(): any;
|
|
18
19
|
/**
|
|
19
20
|
* Marshals data from the view to the model, usually AppData (or configured data store).
|
|
20
21
|
*
|
|
@@ -27,17 +28,6 @@ declare class PictFormMetacontroller extends libPictViewClass {
|
|
|
27
28
|
* @returns {any} The result of the super.onMarshalToView() method.
|
|
28
29
|
*/
|
|
29
30
|
onMarshalToView(): any;
|
|
30
|
-
/**
|
|
31
|
-
* Retrieves the marshal destination object. This is where the model data is stored.
|
|
32
|
-
*
|
|
33
|
-
* @returns {Object} The marshal destination object.
|
|
34
|
-
*/
|
|
35
|
-
getMarshalDestinationObject(): any;
|
|
36
|
-
/**
|
|
37
|
-
* Gets a value by hash address.
|
|
38
|
-
* @param {string} pHashAddress
|
|
39
|
-
*/
|
|
40
|
-
getValueByHash(pHashAddress: string): any;
|
|
41
31
|
gatherInitialBundle(fCallback: any): any;
|
|
42
32
|
/**
|
|
43
33
|
* Executes after the initialization of the object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,
|
|
1
|
+
{"version":3,"file":"Pict-View-Form-Metacontroller.d.ts","sourceRoot":"","sources":["../../../source/views/Pict-View-Form-Metacontroller.js"],"names":[],"mappings":";AASA;;GAEG;AAEH;;;;;;GAMG;AACH;IAEC,2DAaC;IALA,yBAA2B;IAE3B,wBAAsF;IAEtF,cAAkC;IAQnC,wCAGC;IARD,kCAGC;IAOD;;;;OAIG;IACH,qBAFa,GAAG,CAaf;IAED;;;;OAIG;IACH,mBAFa,GAAG,CAaf;IAED,yCAYC;IAED;;;;;OAKG;IACH,kCAHW,aAAa,GACX,IAAI,CAsBhB;IA2BD;;;;OAIG;IACH,WAFa,GAAG,CAMf;IAED,gDAGC;IAED,+CAGC;IAED;;;;;;;;OAQG;IACH,wDAHW,YAAY,SAmHtB;IAED;;;;;;;OAOG;IACH,4CAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;OAIG;IACH,6BAFa,IAAI,CAQhB;IAED;;;;;;;OAOG;IACH,+DAFW,YAAY,QAatB;IAED;;;;;OAKG;IACH,8EAFW,YAAY,QAmBtB;IAED;;;;;;OAMG;IACH,oEAHW,YAAY,GACV,IAAI,CAkDhB;IAED;;;;;OAKG;IACH,qCAHW,MAAM,GACJ,MAAM,GAAC,OAAO,CA2C1B;IAED;;;;;OAKG;IACH,qEA6HC;IAzGA,yBAAiD;IA2GlD;;;OAGG;IACH,gCAFW,MAAM,QAgBhB;IAED;;;;OAIG;IACH,4BAFa,OAAO,CAKnB;CACD;;;;;qCAGU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;oBAvnBjB,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,MAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Pict-Service-DynamicApplication.d.ts","sourceRoot":"","sources":["../../../source/services/Pict-Service-DynamicApplication.js"],"names":[],"mappings":";AAyBA;IAEC,2DAmCC;IA7BA,0HAA0H;IAC1H,OADW,OAAO,MAAM,CAAC,GAAG;QAAE,iCAAiC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,KAAK,GAAG,CAAA;KAAE,CAC5G;IACV,kBAAkB;IAClB,KADW,GAAG,CACN;IACR,qBAAqB;IACrB,MADW,MAAM,CACR;CAyBV;;+BAIU,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC"}
|