pict-section-form 1.0.192 → 1.0.194

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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "Executions":
3
+ {
4
+ "default":
5
+ {
6
+ "Browsers": "since 2022"
7
+ }
8
+ }
9
+ }
@@ -0,0 +1,406 @@
1
+ const libPictSectionForm = require('../../source/Pict-Section-Form.js');
2
+ //const libPictSectionForm = require('pict-section-form');
3
+
4
+ /**
5
+ * Authortopia Example Application
6
+ *
7
+ * Demonstrates both global and tabular trigger groups working together:
8
+ *
9
+ * 1. Global TriggerGroup (top section):
10
+ * - A "Featured Author" selector that fetches author data and fills
11
+ * related fields across the form using EntityBundleRequest +
12
+ * AutofillTriggerGroup (the traditional global pattern).
13
+ *
14
+ * 2. Tabular TriggerGroup (book assignment grid):
15
+ * - Each row has an Author selector that fetches author data and
16
+ * fills only that row's fields using TabularTriggerGroup.
17
+ * - Changing the author in row 3 only affects row 3.
18
+ *
19
+ * @class
20
+ * @extends libPictSectionForm.PictFormApplication
21
+ */
22
+ class AuthortopiaApplication extends libPictSectionForm.PictFormApplication
23
+ {
24
+ constructor(pFable, pOptions, pServiceHash)
25
+ {
26
+ super(pFable, pOptions, pServiceHash);
27
+ }
28
+ }
29
+
30
+ module.exports = AuthortopiaApplication;
31
+
32
+ module.exports.default_configuration = libPictSectionForm.PictFormApplication.default_configuration;
33
+
34
+ module.exports.default_configuration.pict_configuration = (
35
+ {
36
+ "Product": "Authortopia",
37
+
38
+ "DefaultFormManifest":
39
+ {
40
+ "Scope": "AuthortopiaForm",
41
+
42
+ "PickLists":
43
+ [
44
+ {
45
+ "Hash": "AuthorList",
46
+ "ListAddress": "AppData.AuthorPickList",
47
+ "ListSourceAddress": "AllAuthors[]",
48
+ "TextTemplate": "{~D:Record.Name~}",
49
+ "IDTemplate": "{~D:Record.IDAuthor~}",
50
+ "Sorted": true,
51
+ "UpdateFrequency": "Always"
52
+ },
53
+ {
54
+ "Hash": "FeaturedBooks",
55
+ "ListAddress": "AppData.FeaturedAuthorBookPickList",
56
+ "ListSourceAddress": "FeaturedAuthorBooks[]",
57
+ "TextTemplate": "{~D:Record.Title~} ({~D:Record.PublicationYear~})",
58
+ "IDTemplate": "{~D:Record.IDBook~}",
59
+ "Sorted": true,
60
+ "UpdateFrequency": "Always"
61
+ }
62
+ ],
63
+
64
+ "Sections":
65
+ [
66
+ {
67
+ "Hash": "FeaturedAuthor",
68
+ "Name": "Featured Author (Global Trigger Group)",
69
+ "Description": "Select a featured author. This uses the traditional global EntityBundleRequest + AutofillTriggerGroup pattern. Changing the author updates ALL fields that listen to the FeaturedAuthorGroup.",
70
+
71
+ "Groups":
72
+ [
73
+ {
74
+ "Hash": "FeaturedAuthorSelector",
75
+ "Name": "Select Featured Author"
76
+ },
77
+ {
78
+ "Hash": "FeaturedAuthorDetails",
79
+ "Name": "Featured Author Details"
80
+ }
81
+ ]
82
+ },
83
+ {
84
+ "Hash": "BookAssignments",
85
+ "Name": "Book Assignments (Tabular Trigger Group)",
86
+ "Description": "Each row has its own Author selector. Changing the author in one row fills ONLY that row with the author data. This uses the new TabularTriggerGroup provider.",
87
+
88
+ "Groups":
89
+ [
90
+ {
91
+ "Hash": "BookAssignmentGrid",
92
+ "Name": "Book Assignment Grid",
93
+
94
+ "Layout": "Tabular",
95
+
96
+ "RecordSetAddress": "BookAssignments",
97
+ "RecordManifest": "BookAssignmentEditor"
98
+ }
99
+ ]
100
+ }
101
+ ],
102
+
103
+ "Descriptors":
104
+ {
105
+ // ---- Hidden loader: fetches all authors on startup ----
106
+ "AuthorDataLoader":
107
+ {
108
+ "Name": "Author Data Loader",
109
+ "Hash": "AuthorDataLoader",
110
+ "DataType": "String",
111
+ "PictForm":
112
+ {
113
+ "Section": "FeaturedAuthor",
114
+ "Group": "FeaturedAuthorSelector",
115
+ "Row": 0,
116
+ "InputType": "Hidden",
117
+ "Providers": ["Pict-Input-EntityBundleRequest"],
118
+ "EntitiesBundle":
119
+ [
120
+ {
121
+ "Entity": "Author",
122
+ "Filter": "FBV~IDAuthor~GE~0",
123
+ "Destination": "AppData.AllAuthors"
124
+ }
125
+ ],
126
+ "EntityBundleTriggerGroup": "AuthorDataLoaded",
127
+ "EntityBundleTriggerOnInitialize": true,
128
+ "EntityBundleTriggerWithoutValue": true,
129
+ "EntityBundleTriggerOnDataChange": false
130
+ }
131
+ },
132
+
133
+ // ---- Global Trigger Group Section ----
134
+
135
+ "FeaturedAuthor.IDAuthor":
136
+ {
137
+ "Name": "Featured Author",
138
+ "Hash": "FeaturedIDAuthor",
139
+ "DataType": "Number",
140
+ "PictForm":
141
+ {
142
+ "Section": "FeaturedAuthor",
143
+ "Group": "FeaturedAuthorSelector",
144
+ "Row": 1,
145
+ "Width": 2,
146
+ "InputType": "Option",
147
+ "SelectOptionsPickList": "AuthorList",
148
+ // Fetch author data + books when selection changes
149
+ "Providers": ["Pict-Input-Select", "Pict-Input-EntityBundleRequest", "Pict-Input-AutofillTriggerGroup"],
150
+ "EntitiesBundle":
151
+ [
152
+ {
153
+ "Entity": "Author",
154
+ "Filter": "FBV~IDAuthor~EQ~{~D:Record.Value~}",
155
+ "Destination": "AppData.FeaturedAuthor",
156
+ "SingleRecord": true
157
+ },
158
+ {
159
+ "Entity": "BookAuthorJoin",
160
+ "Filter": "FBV~IDAuthor~EQ~{~D:AppData.FeaturedAuthor.IDAuthor~}",
161
+ "Destination": "AppData.FeaturedAuthorJoins"
162
+ },
163
+ {
164
+ "Entity": "Book",
165
+ "Filter": "FBL~IDBook~INN~{~PJU:,^IDBook^AppData.FeaturedAuthorJoins~}",
166
+ "Destination": "AppData.FeaturedAuthorBooks"
167
+ }
168
+ ],
169
+ "EntityBundleTriggerGroup": "FeaturedAuthorGroup",
170
+ "EntityBundleTriggerOnInitialize": false,
171
+ "AutofillTriggerGroup":
172
+ [
173
+ {
174
+ "TriggerGroupHash": "FeaturedAuthorGroup",
175
+ "PostSolvers": [ 'runSolvers()' ]
176
+ },
177
+ {
178
+ "TriggerGroupHash": "AuthorDataLoaded",
179
+ "SelectOptionsRefresh": true
180
+ }
181
+ ]
182
+ }
183
+ },
184
+
185
+ "FeaturedAuthor.Name":
186
+ {
187
+ "Name": "Author Name",
188
+ "Hash": "FeaturedAuthorName",
189
+ "DataType": "String",
190
+ "PictForm":
191
+ {
192
+ "Section": "FeaturedAuthor",
193
+ "Group": "FeaturedAuthorDetails",
194
+ "Row": 1,
195
+ "Width": 2,
196
+ "Providers": ["Pict-Input-AutofillTriggerGroup"],
197
+ "AutofillTriggerGroup":
198
+ {
199
+ "TriggerGroupHash": "FeaturedAuthorGroup",
200
+ "TriggerAddress": "AppData.FeaturedAuthor.Name",
201
+ "MarshalEmptyValues": true
202
+ }
203
+ }
204
+ },
205
+
206
+ "FeaturedAuthor.GUID":
207
+ {
208
+ "Name": "Author GUID",
209
+ "Hash": "FeaturedAuthorGUID",
210
+ "DataType": "String",
211
+ "PictForm":
212
+ {
213
+ "Section": "FeaturedAuthor",
214
+ "Group": "FeaturedAuthorDetails",
215
+ "Row": 1,
216
+ "Width": 2,
217
+ "Providers": ["Pict-Input-AutofillTriggerGroup"],
218
+ "AutofillTriggerGroup":
219
+ {
220
+ "TriggerGroupHash": "FeaturedAuthorGroup",
221
+ "TriggerAddress": "AppData.FeaturedAuthor.GUIDAuthor",
222
+ "MarshalEmptyValues": true
223
+ }
224
+ }
225
+ },
226
+
227
+ "FeaturedAuthor.BookCount":
228
+ {
229
+ "Name": "Number of Books",
230
+ "Hash": "FeaturedAuthorBookCount",
231
+ "DataType": "String",
232
+ "PictForm":
233
+ {
234
+ "Section": "FeaturedAuthor",
235
+ "Group": "FeaturedAuthorDetails",
236
+ "Row": 2,
237
+ "Width": 1,
238
+ "InputType": "ReadOnly"
239
+ }
240
+ },
241
+
242
+ "FeaturedAuthor.SelectedBook":
243
+ {
244
+ "Name": "Select a Book by this Author",
245
+ "Hash": "FeaturedAuthorSelectedBook",
246
+ "DataType": "Number",
247
+ "PictForm":
248
+ {
249
+ "Section": "FeaturedAuthor",
250
+ "Group": "FeaturedAuthorDetails",
251
+ "Row": 2,
252
+ "Width": 2,
253
+ "InputType": "Option",
254
+ "SelectOptionsPickList": "FeaturedBooks",
255
+ "Providers": ["Pict-Input-Select", "Pict-Input-AutofillTriggerGroup"],
256
+ "AutofillTriggerGroup":
257
+ {
258
+ "TriggerGroupHash": "FeaturedAuthorGroup",
259
+ "SelectOptionsRefresh": true
260
+ }
261
+ }
262
+ },
263
+
264
+ // ---- Hidden array descriptor for the tabular section ----
265
+ "BookAssignments":
266
+ {
267
+ "Name": "Book Assignments",
268
+ "Hash": "BookAssignments",
269
+ "DataType": "Array",
270
+ "Default": []
271
+ }
272
+ },
273
+
274
+ "ReferenceManifests":
275
+ {
276
+ "BookAssignmentEditor":
277
+ {
278
+ "Scope": "BookAssignmentEditor",
279
+ "Descriptors":
280
+ {
281
+ "BookTitle":
282
+ {
283
+ "Name": "Book Title",
284
+ "Hash": "BookTitle",
285
+ "DataType": "String",
286
+ "Default": "",
287
+ "PictForm":
288
+ {
289
+ "Row": "1",
290
+ "Section": "BookAssignments",
291
+ "Group": "BookAssignmentGrid"
292
+ }
293
+ },
294
+ "IDAuthor":
295
+ {
296
+ "Name": "Author",
297
+ "Hash": "IDAuthor",
298
+ "DataType": "Number",
299
+ "PictForm":
300
+ {
301
+ "Row": "1",
302
+ "Section": "BookAssignments",
303
+ "Group": "BookAssignmentGrid",
304
+ "InputType": "Option",
305
+ "SelectOptionsPickList": "AuthorList",
306
+ // TabularTriggerGroup: this is the TRIGGERING input
307
+ // AutofillTriggerGroup: refreshes picklist when AuthorDataLoaded fires
308
+ "Providers": ["Pict-Input-Select", "Pict-Input-TabularTriggerGroup", "Pict-Input-AutofillTriggerGroup"],
309
+ "TabularTriggerGroup":
310
+ {
311
+ "TriggerGroupHash": "AuthorRowTrigger",
312
+ "TriggerAllInputs": true,
313
+ "EntitiesBundle":
314
+ [
315
+ {
316
+ "Entity": "Author",
317
+ "Filter": "FBV~IDAuthor~EQ~{~D:Record.Value~}",
318
+ "Destination": "SelectedAuthor",
319
+ "SingleRecord": true
320
+ }
321
+ ]
322
+ },
323
+ "AutofillTriggerGroup":
324
+ {
325
+ "TriggerGroupHash": "AuthorDataLoaded",
326
+ "SelectOptionsRefresh": true
327
+ }
328
+ }
329
+ },
330
+ "AuthorName":
331
+ {
332
+ "Name": "Author Name (auto-filled)",
333
+ "Hash": "AuthorName",
334
+ "DataType": "String",
335
+ "Default": "",
336
+ "PictForm":
337
+ {
338
+ "Row": "1",
339
+ "Section": "BookAssignments",
340
+ "Group": "BookAssignmentGrid",
341
+ // TabularTriggerGroup: this is a RECEIVING input
342
+ "Providers": ["Pict-Input-TabularTriggerGroup"],
343
+ "TabularTriggerGroup":
344
+ {
345
+ "TriggerGroupHash": "AuthorRowTrigger",
346
+ "TriggerAddress": "SelectedAuthor.Name",
347
+ "MarshalEmptyValues": true
348
+ }
349
+ }
350
+ },
351
+ "AuthorGUID":
352
+ {
353
+ "Name": "Author GUID (auto-filled)",
354
+ "Hash": "AuthorGUID",
355
+ "DataType": "String",
356
+ "Default": "",
357
+ "PictForm":
358
+ {
359
+ "Row": "1",
360
+ "Section": "BookAssignments",
361
+ "Group": "BookAssignmentGrid",
362
+ // TabularTriggerGroup: this is a RECEIVING input
363
+ "Providers": ["Pict-Input-TabularTriggerGroup"],
364
+ "TabularTriggerGroup":
365
+ {
366
+ "TriggerGroupHash": "AuthorRowTrigger",
367
+ "TriggerAddress": "SelectedAuthor.GUIDAuthor",
368
+ "MarshalEmptyValues": true
369
+ }
370
+ }
371
+ },
372
+ "Notes":
373
+ {
374
+ "Name": "Notes",
375
+ "Hash": "Notes",
376
+ "DataType": "String",
377
+ "Default": "",
378
+ "PictForm":
379
+ {
380
+ "Row": "1",
381
+ "Section": "BookAssignments",
382
+ "Group": "BookAssignmentGrid"
383
+ }
384
+ }
385
+ }
386
+ }
387
+ }
388
+ },
389
+
390
+ "DefaultAppData":
391
+ {
392
+ "AllAuthors": [],
393
+ "FeaturedAuthor": {},
394
+ "FeaturedAuthorJoins": [],
395
+ "FeaturedAuthorBooks": [],
396
+ "BookAssignments":
397
+ [
398
+ { "BookTitle": "The Shining", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "A classic horror novel" },
399
+ { "BookTitle": "Foundation", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "Epic science fiction" },
400
+ { "BookTitle": "A Wizard of Earthsea", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "Fantasy masterpiece" },
401
+ { "BookTitle": "Kindred", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "Time travel and history" },
402
+ { "BookTitle": "Guards! Guards!", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "Discworld humor" },
403
+ { "BookTitle": "Harry Potter and the Philosopher's Stone", "IDAuthor": "", "AuthorName": "", "AuthorGUID": "", "Notes": "Wizarding world begins" }
404
+ ]
405
+ }
406
+ });