pict-section-form 1.0.80 → 1.0.83
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/simple_distill/.quackage.json +9 -0
- package/example_applications/simple_distill/Simple-Form-Application.js +116 -0
- package/example_applications/simple_distill/html/index.html +13 -0
- package/example_applications/simple_distill/package.json +27 -0
- package/package.json +2 -2
- package/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.js +19 -4
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
const libPictSectionForm = require('../../source/Pict-Section-Form.js');
|
|
2
|
+
//const libPictSectionForm = require('pict-section-form');
|
|
3
|
+
|
|
4
|
+
module.exports = libPictSectionForm.PictFormApplication;
|
|
5
|
+
|
|
6
|
+
module.exports.default_configuration.pict_configuration = (
|
|
7
|
+
{
|
|
8
|
+
"Product": "SimpleDistill",
|
|
9
|
+
"DefaultFormManifest": {
|
|
10
|
+
"Scope": "SuperSimpleForm",
|
|
11
|
+
|
|
12
|
+
"Sections": [
|
|
13
|
+
{
|
|
14
|
+
"Hash": "Book",
|
|
15
|
+
|
|
16
|
+
"Name": "Book Data Distillation Roundup",
|
|
17
|
+
"Description": "Prefetch Book Data",
|
|
18
|
+
|
|
19
|
+
"Solvers":
|
|
20
|
+
[
|
|
21
|
+
],
|
|
22
|
+
"MetaTemplates":
|
|
23
|
+
[
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
|
|
28
|
+
"Descriptors":
|
|
29
|
+
{
|
|
30
|
+
"Author.IDAuthor": {
|
|
31
|
+
Name: "Author ID",
|
|
32
|
+
Hash: "IDAuthor",
|
|
33
|
+
Default: 100,
|
|
34
|
+
DataType: "Number",
|
|
35
|
+
PictForm: {
|
|
36
|
+
Section: "Book", Group: "Author", Row: 1, Width: 1,
|
|
37
|
+
// This performs an entity bundle request whenever a value is selected.
|
|
38
|
+
Providers: ["Pict-Input-EntityBundleRequest", "Pict-Input-AutofillTriggerGroup"],
|
|
39
|
+
EntitiesBundle: [
|
|
40
|
+
{
|
|
41
|
+
"Entity": "Author",
|
|
42
|
+
"Filter": "FBV~IDAuthor~EQ~{~D:Record.Value~}",
|
|
43
|
+
"Destination": "AppData.CurrentAuthor",
|
|
44
|
+
// This marshals a single record
|
|
45
|
+
"SingleRecord": true
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"Entity": "BookAuthorJoin",
|
|
49
|
+
"Filter": "FBV~IDAuthor~EQ~{~D:AppData.CurrentAuthor.IDAuthor~}",
|
|
50
|
+
"Destination": "AppData.BookAuthorJoins"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"Entity": "Book",
|
|
54
|
+
"Filter": "FBL~IDBook~INN~{~PJU:,^IDBook^AppData.BookAuthorJoins~}",
|
|
55
|
+
"Destination": "AppData.Books"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
EntityBundleTriggerGroup: "BookTriggerGroup",
|
|
59
|
+
EntityBundleTriggerMetacontrollerSolve: true,
|
|
60
|
+
EntityBundleTriggerMetacontrollerRender: true,
|
|
61
|
+
EntityBundleTriggerOnInitialize: true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"Author.Name": {
|
|
65
|
+
Name: "Author Name",
|
|
66
|
+
Hash: "AuthorName",
|
|
67
|
+
DataType: "String",
|
|
68
|
+
PictForm: {
|
|
69
|
+
Section: "Book", Group: "Author", Row: 1, Width: 1,
|
|
70
|
+
// This performs an entity bundle request whenever a value is selected.
|
|
71
|
+
Providers: ["Pict-Input-AutofillTriggerGroup"],
|
|
72
|
+
AutofillTriggerGroup:
|
|
73
|
+
{
|
|
74
|
+
TriggerGroupName: "BookTriggerGroup",
|
|
75
|
+
TriggerAddress: "AppData.CurrentAuthor.Name",
|
|
76
|
+
MarshalEmptyValues: true
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
"Books": {
|
|
82
|
+
Name: "Authors Book List",
|
|
83
|
+
Hash: "Books",
|
|
84
|
+
DataType: "Array",
|
|
85
|
+
Default: []
|
|
86
|
+
},
|
|
87
|
+
"Book.IDBook": {
|
|
88
|
+
Name: "Specific Book",
|
|
89
|
+
Hash: "SpecificIDBook",
|
|
90
|
+
DataType: "Number",
|
|
91
|
+
PictForm: {
|
|
92
|
+
Section: "Book",
|
|
93
|
+
Group: "Book",
|
|
94
|
+
Row: 1, Width: 1,
|
|
95
|
+
InputType: "Option",
|
|
96
|
+
SelectOptionsPickList: "Books",
|
|
97
|
+
// This performs an entity bundle request whenever a value is selected.
|
|
98
|
+
Providers: ["Pict-Input-Select", "Pict-Input-AutofillTriggerGroup"],
|
|
99
|
+
AutofillTriggerGroup:
|
|
100
|
+
{
|
|
101
|
+
TriggerGroupName: "BookTriggerGroup",
|
|
102
|
+
SelectOptionsRefresh: true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"Book.Title": {
|
|
107
|
+
Name: "Book Title",
|
|
108
|
+
Hash: "BookTitle",
|
|
109
|
+
DataType: "String",
|
|
110
|
+
PictForm: {
|
|
111
|
+
Section: "Book", Group: "Book", Row: 1, Width: 1
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Simple.</title>
|
|
5
|
+
<style id="PICT-CSS"></style>
|
|
6
|
+
<script src="./pict.min.js" type="text/javascript"></script>
|
|
7
|
+
<script type="text/javascript">Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(SimpleApplication, 1)});</script>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="Pict-Form-Container"></div>
|
|
11
|
+
<script src="./simple_application.min.js" type="text/javascript"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simple_application",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The most basic forms application ever!",
|
|
5
|
+
"main": "Simple-Form-Application.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node Simple-Form-Application.js",
|
|
8
|
+
"build": "npx quack build && npx quack copy"
|
|
9
|
+
},
|
|
10
|
+
"author": "steven",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
},
|
|
14
|
+
"copyFilesSettings": {
|
|
15
|
+
"whenFileExists": "overwrite"
|
|
16
|
+
},
|
|
17
|
+
"copyFiles": [
|
|
18
|
+
{
|
|
19
|
+
"from": "./html/*",
|
|
20
|
+
"to": "./dist/"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"from": "../../node_modules/pict/dist/*",
|
|
24
|
+
"to": "./dist/"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pict-section-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.83",
|
|
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.21.0",
|
|
33
33
|
"jquery": "^3.7.1",
|
|
34
|
-
"pict": "^1.0.
|
|
34
|
+
"pict": "^1.0.243",
|
|
35
35
|
"pict-application": "^1.0.25",
|
|
36
36
|
"pict-service-commandlineutility": "^1.0.15",
|
|
37
37
|
"quackage": "^1.0.41",
|
|
@@ -134,7 +134,7 @@ class CustomInputHandler extends libPictSectionInputExtension
|
|
|
134
134
|
* @param {any} pValue - The value of the input.
|
|
135
135
|
* @param {string} pHTMLSelector - The HTML selector.
|
|
136
136
|
*
|
|
137
|
-
* @return {Promise<
|
|
137
|
+
* @return {Promise<any>} - Returns a promise that resolves when the data has been gathered.
|
|
138
138
|
*/
|
|
139
139
|
async gatherDataFromServer(pView, pInput, pValue, pHTMLSelector)
|
|
140
140
|
{
|
|
@@ -176,10 +176,20 @@ class CustomInputHandler extends libPictSectionInputExtension
|
|
|
176
176
|
// Trigger the autofill global event
|
|
177
177
|
this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(`AutoFill-${tmpInput.PictForm.EntityBundleTriggerGroup}`);
|
|
178
178
|
}
|
|
179
|
+
if (tmpInput.PictForm.EntityBundleTriggerMetacontrollerSolve)
|
|
180
|
+
{
|
|
181
|
+
// Trigger the solve global event
|
|
182
|
+
this.pict.views.PictFormMetacontroller.solve();
|
|
183
|
+
}
|
|
184
|
+
if (tmpInput.PictForm.EntityBundleTriggerMetacontrollerRender)
|
|
185
|
+
{
|
|
186
|
+
// Trigger the render
|
|
187
|
+
this.pict.views.PictFormMetacontroller.render();
|
|
188
|
+
}
|
|
179
189
|
fNext();
|
|
180
190
|
});
|
|
181
191
|
|
|
182
|
-
return new Promise((
|
|
192
|
+
return new Promise((pResolve, pReject) =>
|
|
183
193
|
{
|
|
184
194
|
// Now fire the "autofilldata" event for the groups.
|
|
185
195
|
tmpAnticipate.wait(
|
|
@@ -190,8 +200,8 @@ class CustomInputHandler extends libPictSectionInputExtension
|
|
|
190
200
|
{
|
|
191
201
|
this.log.error(`EntityBundleRequest error gathering entity set: ${pError}`, pError);
|
|
192
202
|
}
|
|
193
|
-
|
|
194
|
-
return
|
|
203
|
+
|
|
204
|
+
return pResolve(pError);
|
|
195
205
|
});
|
|
196
206
|
});
|
|
197
207
|
}
|
|
@@ -210,6 +220,11 @@ class CustomInputHandler extends libPictSectionInputExtension
|
|
|
210
220
|
onInputInitialize(pView, pGroup, pRow, pInput, pValue, pHTMLSelector)
|
|
211
221
|
{
|
|
212
222
|
// Try to get the input element
|
|
223
|
+
if (pValue && pInput.PictForm && pInput.PictForm.EntityBundleTriggerOnInitialize)
|
|
224
|
+
{
|
|
225
|
+
// This is a request on initial load
|
|
226
|
+
this.gatherDataFromServer(pView, pInput, pValue, pHTMLSelector);
|
|
227
|
+
}
|
|
213
228
|
// This is in case we need to do a request on initial load!
|
|
214
229
|
return super.onInputInitialize(pView, pGroup, pRow, pInput, pValue, pHTMLSelector);
|
|
215
230
|
}
|