pict-section-form 1.0.122 → 1.0.124

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 (56) hide show
  1. package/example_applications/Build-Examples.sh +5 -0
  2. package/example_applications/Clean-Examples.sh +2 -1
  3. package/example_applications/Open-Examples.sh +2 -1
  4. package/example_applications/postcard_example/providers/PictProvider-PostKardInputExtension.js +38 -7
  5. package/package.json +2 -2
  6. package/source/providers/Pict-Provider-DynamicFormSolverBehaviors.js +28 -6
  7. package/source/providers/Pict-Provider-DynamicInputEvents.js +26 -4
  8. package/source/providers/Pict-Provider-DynamicSolver.js +1 -1
  9. package/source/providers/Pict-Provider-InputExtension.js +49 -8
  10. package/source/providers/inputs/Pict-Provider-Input-AutofillTriggerGroup.js +43 -15
  11. package/source/providers/inputs/Pict-Provider-Input-DateTime.js +6 -4
  12. package/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.js +35 -18
  13. package/source/providers/inputs/Pict-Provider-Input-HTML.js +12 -8
  14. package/source/providers/inputs/Pict-Provider-Input-Link.js +6 -4
  15. package/source/providers/inputs/Pict-Provider-Input-Markdown.js +12 -8
  16. package/source/providers/inputs/Pict-Provider-Input-PreciseNumber.js +6 -4
  17. package/source/providers/inputs/Pict-Provider-Input-Select.js +25 -20
  18. package/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.js +3 -2
  19. package/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.js +3 -2
  20. package/source/providers/inputs/Pict-Provider-Input-TemplatedEntityLookup.js +12 -8
  21. package/source/views/Pict-View-DynamicForm.js +205 -29
  22. package/source/views/Pict-View-Form-Metacontroller.js +12 -2
  23. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts +10 -1
  24. package/types/source/providers/Pict-Provider-DynamicFormSolverBehaviors.d.ts.map +1 -1
  25. package/types/source/providers/Pict-Provider-DynamicInputEvents.d.ts +4 -2
  26. package/types/source/providers/Pict-Provider-DynamicInputEvents.d.ts.map +1 -1
  27. package/types/source/providers/Pict-Provider-DynamicSolver.d.ts +2 -1
  28. package/types/source/providers/Pict-Provider-DynamicSolver.d.ts.map +1 -1
  29. package/types/source/providers/Pict-Provider-InputExtension.d.ts +41 -8
  30. package/types/source/providers/Pict-Provider-InputExtension.d.ts.map +1 -1
  31. package/types/source/providers/inputs/Pict-Provider-Input-AutofillTriggerGroup.d.ts +4 -4
  32. package/types/source/providers/inputs/Pict-Provider-Input-AutofillTriggerGroup.d.ts.map +1 -1
  33. package/types/source/providers/inputs/Pict-Provider-Input-DateTime.d.ts +4 -2
  34. package/types/source/providers/inputs/Pict-Provider-Input-DateTime.d.ts.map +1 -1
  35. package/types/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.d.ts +13 -7
  36. package/types/source/providers/inputs/Pict-Provider-Input-EntityBundleRequest.d.ts.map +1 -1
  37. package/types/source/providers/inputs/Pict-Provider-Input-HTML.d.ts +6 -3
  38. package/types/source/providers/inputs/Pict-Provider-Input-HTML.d.ts.map +1 -1
  39. package/types/source/providers/inputs/Pict-Provider-Input-Link.d.ts +4 -2
  40. package/types/source/providers/inputs/Pict-Provider-Input-Link.d.ts.map +1 -1
  41. package/types/source/providers/inputs/Pict-Provider-Input-Markdown.d.ts +6 -3
  42. package/types/source/providers/inputs/Pict-Provider-Input-Markdown.d.ts.map +1 -1
  43. package/types/source/providers/inputs/Pict-Provider-Input-PreciseNumber.d.ts +4 -2
  44. package/types/source/providers/inputs/Pict-Provider-Input-PreciseNumber.d.ts.map +1 -1
  45. package/types/source/providers/inputs/Pict-Provider-Input-Select.d.ts +11 -6
  46. package/types/source/providers/inputs/Pict-Provider-Input-Select.d.ts.map +1 -1
  47. package/types/source/providers/inputs/Pict-Provider-Input-TabGroupSelector.d.ts.map +1 -1
  48. package/types/source/providers/inputs/Pict-Provider-Input-TabSectionSelector.d.ts.map +1 -1
  49. package/types/source/providers/inputs/Pict-Provider-Input-TemplatedEntityLookup.d.ts +6 -3
  50. package/types/source/providers/inputs/Pict-Provider-Input-TemplatedEntityLookup.d.ts.map +1 -1
  51. package/types/source/views/Pict-View-DynamicForm.d.ts +39 -7
  52. package/types/source/views/Pict-View-DynamicForm.d.ts.map +1 -1
  53. package/types/source/views/Pict-View-Form-Metacontroller.d.ts +2 -1
  54. package/types/source/views/Pict-View-Form-Metacontroller.d.ts.map +1 -1
  55. package/utility/csvparser/ParseCSV-Command-BuildDistilling.js +3 -3
  56. package/utility/csvparser/ParseCSV-Command-Inject.js +3 -1
@@ -30,6 +30,11 @@ pushd simple_form
30
30
  npm install && npm run build
31
31
  popd
32
32
 
33
+ # Building simple_distill
34
+ pushd simple_distill
35
+ npm install && npm run build
36
+ popd
37
+
33
38
  # Building simple_table
34
39
  pushd simple_table
35
40
  npm install && npm run build
@@ -5,5 +5,6 @@ rm -rf ./complex_tuigrid/dist
5
5
  rm -rf ./gradebook/dist
6
6
  rm -rf ./manyfest_editor/dist
7
7
  rm -rf ./postcard_example/dist
8
+ rm -rf ./simple_distill/dist
8
9
  rm -rf ./simple_form/dist
9
- rm -rf ./simple_table/dist
10
+ rm -rf ./simple_table/dist
@@ -4,5 +4,6 @@ open ./complex_table/dist/index.html
4
4
  open ./complex_tuigrid/dist/index.html
5
5
  open ./gradebook/dist/index.html
6
6
  open ./postcard_example/dist/index.html
7
+ open ./simple_distill/dist/index.html
7
8
  open ./simple_form/dist/index.html
8
- open ./simple_table/dist/index.html
9
+ open ./simple_table/dist/index.html
@@ -7,17 +7,48 @@ class CustomInputHandler extends libPictFormSection.PictInputExtensionProvider
7
7
  super(pFable, pOptions, pServiceHash);
8
8
  }
9
9
 
10
- onEvent(pView, pInput, pValue, pHTMLSelector, pEvent)
10
+ /**
11
+ * @param {import('../../../source/views/Pict-View-DynamicForm.js')} pView
12
+ * @param {Object} pInput
13
+ * @param {any} pValue
14
+ * @param {string} pHTMLSelector
15
+ * @param {string} pEvent
16
+ * @param {string} pTransactionGUID
17
+ */
18
+ onEvent(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
11
19
  {
12
- console.log(`Alert alert event happened for ${pInput}: ${pEvent}`);
13
- return super.onEvent(pView, pInput, pValue, pHTMLSelector, pEvent);
20
+ console.log(`Alert alert event happened for ${pInput}: ${pEvent} [${pTransactionGUID}]`);
21
+ pView.registerEventTransactionAsyncOperation(pTransactionGUID, 'testAsyncOp');
22
+ pView.registerOnTransactionCompleteCallback(pTransactionGUID, () =>
23
+ {
24
+ this.pict.log.info(`Transaction ${pTransactionGUID} is complete!`);
25
+ });
26
+ setTimeout(() =>
27
+ {
28
+ pView.eventTransactionAsyncOperationComplete(pTransactionGUID, 'testAsyncOp');
29
+ }, 5000);
30
+ return super.onEvent(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID);
14
31
  }
15
32
 
16
- onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent)
33
+ /**
34
+ * @param {import('../../../source/views/Pict-View-DynamicForm.js')} pView
35
+ * @param {Object} pInput
36
+ * @param {any} pValue
37
+ * @param {string} pHTMLSelector
38
+ * @param {string} pEvent
39
+ * @param {string} pTransactionGUID
40
+ */
41
+ onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
17
42
  {
18
- console.log(`Alert alert event happened for ${pInput} row ${pRowIndex}: ${pEvent}`);
19
- return super.onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent);
43
+ this.pict.log.info(`After event completion for ${pInput}: ${pEvent} [${pTransactionGUID}]`);
44
+ super.onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID);
45
+ }
46
+
47
+ onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID)
48
+ {
49
+ console.log(`Alert alert event happened for ${pInput} row ${pRowIndex}: ${pEvent} [${pTransactionGUID}]`);
50
+ return super.onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID);
20
51
  }
21
52
  }
22
53
 
23
- module.exports = CustomInputHandler;
54
+ module.exports = CustomInputHandler;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pict-section-form",
3
- "version": "1.0.122",
3
+ "version": "1.0.124",
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.36.0",
33
33
  "jquery": "^3.7.1",
34
- "pict": "^1.0.307",
34
+ "pict": "^1.0.308",
35
35
  "pict-application": "^1.0.29",
36
36
  "pict-service-commandlineutility": "^1.0.15",
37
37
  "quackage": "^1.0.42",
@@ -264,7 +264,7 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
264
264
  }
265
265
 
266
266
  let tmpElementSet = this.pict.ContentAssignment.getElement(this.getGroupSelector(tmpGroupView.formID, pGroupHash));
267
-
267
+
268
268
  if (tmpElementSet.length < 1)
269
269
  {
270
270
  this.log.warn(`PictDynamicFormsInformary: colorGroup could not find group element with section hash [${pSectionHash}] group [${pGroupHash}] selector [${this.getGroupSelector(tmpGroupView.formID, pGroupHash)}].`);
@@ -277,7 +277,16 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
277
277
  return true;
278
278
  }
279
279
 
280
- colorInputBackground(pSectionHash, pInputHash, pColor, pApplyChange)
280
+ /**
281
+ * Colors an input background or its container with a HTML hex color (e.g. #FF0000 for red).
282
+ * @param {string} pSectionHash - The hash of the section containing the input.
283
+ * @param {string} pInputHash - The hash of the input to color.
284
+ * @param {string} pColor - The HTML hex color to apply (e.g. #FF0000 for red).
285
+ * @param {string} pApplyChange - If "0", the change will not be applied.
286
+ * @param {string} [pClassTarget] - Optional. If provided, the color will be applied to the closest element with this class instead of the input itself.
287
+ * @returns {boolean} - Returns true if the color was applied successfully or if the change was skipped for pApplyChange equal to "0", false otherwise.
288
+ */
289
+ colorInputBackground(pSectionHash, pInputHash, pColor, pApplyChange, pClassTarget)
281
290
  {
282
291
  if (pApplyChange == "0")
283
292
  {
@@ -308,12 +317,25 @@ class PictDynamicFormsSolverBehaviors extends libPictProvider
308
317
  return false;
309
318
  }
310
319
 
311
- // if there's a parent element, use that instead and we can color the whole input container area
312
- if (tmpElementSet[0].parentElement)
320
+ let tmpElement = tmpElementSet[0];
321
+
322
+ // if we passed a class target, find the closest element with that class and apply the color to it
323
+ // otherwise, just apply it to the input element itself
324
+ if (pClassTarget)
313
325
  {
314
- tmpElementSet = [ tmpElementSet[0].parentElement ];
326
+ // find closest target by class name and if we find it, immediately break out of the loop
327
+ for (let i = 0; i < tmpElementSet.length; i++)
328
+ {
329
+ const element = tmpElementSet[i];
330
+ const closest = element.closest(`.${pClassTarget}`);
331
+ if (closest)
332
+ {
333
+ tmpElement = closest;
334
+ break;
335
+ }
336
+ }
315
337
  }
316
- let tmpElement = tmpElementSet[0];
338
+
317
339
  tmpElement.style.backgroundColor = pColor;
318
340
 
319
341
  return true;
@@ -75,9 +75,11 @@ class PictDynamicInputEvents extends libPictProvider
75
75
  * @param {Object} pView - The view object.
76
76
  * @param {string} pInputHash - The input hash.
77
77
  * @param {string} pEvent - The input event.
78
+ * @param {string} [pTransactionGUID] - (optional) The active transaction GUID.
78
79
  */
79
- inputEvent(pView, pInputHash, pEvent)
80
+ inputEvent(pView, pInputHash, pEvent, pTransactionGUID)
80
81
  {
82
+ const tmpTransactionGUID = (pTransactionGUID && typeof pTransactionGUID === 'string') ? pTransactionGUID : this.pict.getUUID();
81
83
  let tmpInput = pView.getInputFromHash(pInputHash);
82
84
  if (pInputHash)
83
85
  {
@@ -94,7 +96,11 @@ class PictDynamicInputEvents extends libPictProvider
94
96
  // we may find uninitialized inputs here, so we do not send events to those
95
97
  if (tmpInput.Macro)
96
98
  {
97
- pView.pict.providers[tmpInputProviderList[i]].onEvent(pView, tmpInput, tmpValue, tmpInput.Macro.HTMLSelector, pEvent);
99
+ pView.pict.providers[tmpInputProviderList[i]].onEvent(pView, tmpInput, tmpValue, tmpInput.Macro.HTMLSelector, pEvent, tmpTransactionGUID);
100
+ pView.registerOnTransactionCompleteCallback(tmpTransactionGUID, () =>
101
+ {
102
+ pView.pict.providers[tmpInputProviderList[i]].onAfterEventCompletion(pView, tmpInput, tmpValue, tmpInput.Macro.HTMLSelector, pEvent, tmpTransactionGUID);
103
+ });
98
104
  }
99
105
  }
100
106
  else
@@ -102,6 +108,11 @@ class PictDynamicInputEvents extends libPictProvider
102
108
  pView.log.error(`Dynamic form [${pView.Hash}]::[${pView.UUID}] inputEvent ${pEvent} cannot find embedded provider [${tmpInputProviderList[i]}] for input [${tmpInput.Hash}].`);
103
109
  }
104
110
  }
111
+ if (pTransactionGUID !== tmpTransactionGUID)
112
+ {
113
+ // since we synthesized this transaction, finalize it
114
+ pView.finalizeTransaction(tmpTransactionGUID);
115
+ }
105
116
  }
106
117
  catch (pError)
107
118
  {
@@ -171,9 +182,11 @@ class PictDynamicInputEvents extends libPictProvider
171
182
  * @param {number} pInputIndex - The index of the input.
172
183
  * @param {number} pRowIndex - The index of the row.
173
184
  * @param {string} pEvent - The input event.
185
+ * @param {string} [pTransactionGUID] - (optional) The active transaction GUID.
174
186
  */
175
- inputEventTabular(pView, pGroupIndex, pInputIndex, pRowIndex, pEvent)
187
+ inputEventTabular(pView, pGroupIndex, pInputIndex, pRowIndex, pEvent, pTransactionGUID)
176
188
  {
189
+ const tmpTransactionGUID = (pTransactionGUID && typeof pTransactionGUID === 'string') ? pTransactionGUID : this.pict.getUUID();
177
190
  let tmpInput = pView.getTabularRecordInput(pGroupIndex, pInputIndex);
178
191
  if (pGroupIndex != null && pInputIndex != null && pRowIndex != null && tmpInput)
179
192
  {
@@ -191,13 +204,22 @@ class PictDynamicInputEvents extends libPictProvider
191
204
  {
192
205
  if (pView.pict.providers[tmpInputProviderList[i]])
193
206
  {
194
- pView.pict.providers[tmpInputProviderList[i]].onEventTabular(pView, tmpInput, tmpValue, tmpVirtualInformaryHTMLSelector, pRowIndex, pEvent);
207
+ pView.pict.providers[tmpInputProviderList[i]].onEventTabular(pView, tmpInput, tmpValue, tmpVirtualInformaryHTMLSelector, pRowIndex, pEvent, tmpTransactionGUID);
208
+ pView.registerOnTransactionCompleteCallback(tmpTransactionGUID, () =>
209
+ {
210
+ pView.pict.providers[tmpInputProviderList[i]].onAfterEventTabularCompletion(pView, tmpInput, tmpValue, tmpVirtualInformaryHTMLSelector, pRowIndex, pEvent, tmpTransactionGUID);
211
+ });
195
212
  }
196
213
  else
197
214
  {
198
215
  pView.log.error(`Dynamic form [${pView.Hash}]::[${pView.UUID}] cannot find embedded provider [${tmpInputProviderList[i]}] for input [${tmpInput.Hash}] row ${pRowIndex} calling inputEvent ${pEvent}.`);
199
216
  }
200
217
  }
218
+ if (pTransactionGUID !== tmpTransactionGUID)
219
+ {
220
+ // since we synthesized this transaction, finalize it
221
+ pView.finalizeTransaction(tmpTransactionGUID);
222
+ }
201
223
  }
202
224
  catch (pError)
203
225
  {
@@ -47,7 +47,7 @@ class PictDynamicSolver extends libPictProvider
47
47
 
48
48
  /** @type {import('pict')} */
49
49
  this.pict;
50
- /** @type {import('pict') & { instantiateServiceProviderIfNotExists: (hash: string) => any }} */
50
+ /** @type {import('pict') & { instantiateServiceProviderIfNotExists: (hash: string) => any, ExpressionParser: any }} */
51
51
  this.fable;
52
52
  /** @type {any} */
53
53
  this.log;
@@ -65,9 +65,10 @@ class PictInputExtensionProvider extends libPictProvider
65
65
  * @param {Object} pRow - The Row index.
66
66
  * @param {Object} pInput - The input object.
67
67
  * @param {any} pValue - The value of the input object
68
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
68
69
  * @param {string} pHTMLSelector - The HTML selector for the input object
69
70
  */
70
- onInputInitialize(pView, pGroup, pRow, pInput, pValue, pHTMLSelector)
71
+ onInputInitialize(pView, pGroup, pRow, pInput, pValue, pHTMLSelector, pTransactionGUID)
71
72
  {
72
73
  return true;
73
74
  }
@@ -82,9 +83,10 @@ class PictInputExtensionProvider extends libPictProvider
82
83
  * @param {Object} pInput - The input object.
83
84
  * @param {any} pValue - The value of the input object
84
85
  * @param {string} pHTMLSelector - The HTML selector for the input object (it will return an array).
86
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
85
87
  * @param {number} pRowIndex - The row index of the tabular data
86
88
  */
87
- onInputInitializeTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex)
89
+ onInputInitializeTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID)
88
90
  {
89
91
  return true;
90
92
  }
@@ -98,8 +100,9 @@ class PictInputExtensionProvider extends libPictProvider
98
100
  * @param {Object} pInput - The input object.
99
101
  * @param {any} pValue - The new value of the input object
100
102
  * @param {string} pHTMLSelector - The HTML selector for the input object
103
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
101
104
  */
102
- onDataChange(pView, pInput, pValue, pHTMLSelector)
105
+ onDataChange(pView, pInput, pValue, pHTMLSelector, pTransactionGUID)
103
106
  {
104
107
  return true;
105
108
  }
@@ -112,8 +115,9 @@ class PictInputExtensionProvider extends libPictProvider
112
115
  * @param {any} pValue - The new value of the input object
113
116
  * @param {string} pHTMLSelector - The HTML selector for the input object
114
117
  * @param {number} pRowIndex - The row index of the tabular data
118
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
115
119
  */
116
- onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex)
120
+ onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID)
117
121
  {
118
122
  return true;
119
123
  }
@@ -127,9 +131,10 @@ class PictInputExtensionProvider extends libPictProvider
127
131
  * @param {Object} pInput - The input object.
128
132
  * @param {any} pValue - The value to marshal.
129
133
  * @param {string} pHTMLSelector - The HTML selector.
134
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
130
135
  * @returns {boolean} - Returns true if the data was successfully marshaled to the form.
131
136
  */
132
- onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector)
137
+ onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector, pTransactionGUID)
133
138
  {
134
139
  return true;
135
140
  }
@@ -143,9 +148,10 @@ class PictInputExtensionProvider extends libPictProvider
143
148
  * @param {any} pValue - The value to marshal.
144
149
  * @param {string} pHTMLSelector - The HTML selector.
145
150
  * @param {number} pRowIndex - The index of the input in the row columns.
151
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
146
152
  * @returns {boolean} - Returns true if the data was successfully marshaled to the form.
147
153
  */
148
- onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex)
154
+ onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID)
149
155
  {
150
156
  return true;
151
157
  }
@@ -188,9 +194,43 @@ class PictInputExtensionProvider extends libPictProvider
188
194
  * @param {any} pValue - The value from AppData.
189
195
  * @param {string} pHTMLSelector - The HTML selector.
190
196
  * @param {string} pEvent - The event hash that is expected to be triggered.
197
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
191
198
  * @returns {boolean} - Returns true.
192
199
  */
193
- onEvent(pView, pInput, pValue, pHTMLSelector, pEvent)
200
+ onEvent(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
201
+ {
202
+ return true;
203
+ }
204
+
205
+ /**
206
+ * Handles events for the Pict-Provider-InputExtension.
207
+ *
208
+ * @param {Object} pView - The view object.
209
+ * @param {Object} pInput - The input object.
210
+ * @param {any} pValue - The value from AppData.
211
+ * @param {string} pHTMLSelector - The HTML selector.
212
+ * @param {string} pEvent - The event hash that is expected to be triggered.
213
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
214
+ * @returns {boolean} - Returns true.
215
+ */
216
+ onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
217
+ {
218
+ return true;
219
+ }
220
+
221
+ /**
222
+ * Handles events for the Pict-Provider-InputExtension.
223
+ *
224
+ * @param {Object} pView - The view object.
225
+ * @param {Object} pInput - The input object.
226
+ * @param {any} pValue - The value from AppData.
227
+ * @param {string} pHTMLSelector - The HTML selector.
228
+ * @param {number} pRowIndex - The row index of the tabular data.
229
+ * @param {string} pEvent - The event hash that is expected to be triggered.
230
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
231
+ * @returns {boolean} - Returns true.
232
+ */
233
+ onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID)
194
234
  {
195
235
  return true;
196
236
  }
@@ -204,9 +244,10 @@ class PictInputExtensionProvider extends libPictProvider
204
244
  * @param {string} pHTMLSelector - The HTML selector.
205
245
  * @param {number} pRowIndex - The row index of the tabular data.
206
246
  * @param {string} pEvent - The event hash that is expected to be triggered.
247
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
207
248
  * @returns {boolean} - Returns true.
208
249
  */
209
- onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent)
250
+ onAfterEventTabularCompletion(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID)
210
251
  {
211
252
  return true;
212
253
  }
@@ -113,9 +113,10 @@ class CustomInputHandler extends libPictSectionInputExtension
113
113
  * @param {Object} pInput - The input object.
114
114
  * @param {any} pValue - The new value of the input.
115
115
  * @param {string} pHTMLSelector - The HTML selector of the input.
116
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
116
117
  * @returns {any} - The result of the super.onDataChange method.
117
118
  */
118
- onDataChange(pView, pInput, pValue, pHTMLSelector)
119
+ onDataChange(pView, pInput, pValue, pHTMLSelector, pTransactionGUID)
119
120
  {
120
121
  let tmpTriggerGroupConfigurations = this.getTriggerGroupConfigurationArray(pInput);
121
122
  if (Array.isArray(tmpTriggerGroupConfigurations) && this.pict.views.PictFormMetacontroller)
@@ -125,11 +126,13 @@ class CustomInputHandler extends libPictSectionInputExtension
125
126
  const tmpGroupConfig = tmpTriggerGroupConfigurations[i];
126
127
  if (tmpGroupConfig.TriggerAllInputs)
127
128
  {
128
- this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(`TriggerGroup:${tmpGroupConfig.TriggerGroupHash}:DataChange:${pInput.Hash || pInput.DataAddress}:${this.pict.getUUID()}`);
129
+ this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(
130
+ `TriggerGroup:${tmpGroupConfig.TriggerGroupHash}:DataChange:${pInput.Hash || pInput.DataAddress}:${this.pict.getUUID()}`,
131
+ pTransactionGUID);
129
132
  }
130
133
  }
131
134
  }
132
- return super.onDataChange(pView, pInput, pValue, pHTMLSelector);
135
+ return super.onDataChange(pView, pInput, pValue, pHTMLSelector, pTransactionGUID);
133
136
  }
134
137
 
135
138
  /**
@@ -140,9 +143,10 @@ class CustomInputHandler extends libPictSectionInputExtension
140
143
  * @param {any} pValue - The new value.
141
144
  * @param {string} pHTMLSelector - The HTML selector.
142
145
  * @param {number} pRowIndex - The index of the row.
146
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
143
147
  * @returns {any} - The result of the super method.
144
148
  */
145
- onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex)
149
+ onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID)
146
150
  {
147
151
  let tmpTriggerGroupConfigurations = this.getTriggerGroupConfigurationArray(pInput);
148
152
  if (Array.isArray(tmpTriggerGroupConfigurations) && this.pict.views.PictFormMetacontroller)
@@ -152,17 +156,29 @@ class CustomInputHandler extends libPictSectionInputExtension
152
156
  const tmpGroupConfig = tmpTriggerGroupConfigurations[i];
153
157
  if (tmpGroupConfig.TriggerAllInputs)
154
158
  {
155
- this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(`TriggerGroup:${tmpGroupConfig.TriggerGroupHash}:DataChange:${pInput.Hash || pInput.DataAddress}:${this.pict.getUUID()}`);
159
+ this.pict.views.PictFormMetacontroller.triggerGlobalInputEvent(
160
+ `TriggerGroup:${tmpGroupConfig.TriggerGroupHash}:DataChange:${pInput.Hash || pInput.DataAddress}:${this.pict.getUUID()}`,
161
+ pTransactionGUID);
156
162
  }
157
163
  }
158
164
  }
159
- return super.onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex);
165
+ return super.onDataChangeTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID);
160
166
  }
161
167
 
162
- // This input extension only responds to events
163
- onEvent(pView, pInput, pValue, pHTMLSelector, pEvent)
168
+ /**
169
+ * This input extension only responds to events
170
+ *
171
+ * @param {Object} pView - The view object.
172
+ * @param {Object} pInput - The input object.
173
+ * @param {any} pValue - The value from AppData.
174
+ * @param {string} pHTMLSelector - The HTML selector.
175
+ * @param {string} pEvent - The event hash that is expected to be triggered.
176
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
177
+ * @returns {boolean} - Returns true.
178
+ */
179
+ onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID)
164
180
  {
165
- const tmpPayload = typeof pValue === 'string' ? pEvent : '';
181
+ const tmpPayload = typeof pEvent === 'string' ? pEvent : '';
166
182
  let [ tmpType, tmpGroupHash, tmpEvent, tmpInputHash, tmpEventGUID ] = tmpPayload.split(':');
167
183
  if (!tmpEventGUID)
168
184
  {
@@ -172,7 +188,7 @@ class CustomInputHandler extends libPictSectionInputExtension
172
188
  let tmpAutoFillTriggerGroups = pInput.PictForm.AutofillTriggerGroup;
173
189
  if (!tmpAutoFillTriggerGroups || tmpType !== 'TriggerGroup' || (pInput.Hash || pInput.DataAddress) == tmpInputHash)
174
190
  {
175
- return super.onEvent(pView, pInput, pValue, pHTMLSelector, pEvent);
191
+ return super.onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID);
176
192
  }
177
193
  if (!Array.isArray(tmpAutoFillTriggerGroups))
178
194
  {
@@ -204,12 +220,24 @@ class CustomInputHandler extends libPictSectionInputExtension
204
220
  }
205
221
  }
206
222
 
207
- return super.onEvent(pView, pInput, pValue, pHTMLSelector, pEvent);
223
+ return super.onAfterEventCompletion(pView, pInput, pValue, pHTMLSelector, pEvent, pTransactionGUID);
208
224
  }
209
225
 
210
- onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent)
226
+ /**
227
+ * Handles events for the Pict-Provider-InputExtension.
228
+ *
229
+ * @param {Object} pView - The view object.
230
+ * @param {Object} pInput - The input object.
231
+ * @param {any} pValue - The value from AppData.
232
+ * @param {string} pHTMLSelector - The HTML selector.
233
+ * @param {number} pRowIndex - The row index of the tabular data.
234
+ * @param {string} pEvent - The event hash that is expected to be triggered.
235
+ * @param {string} pTransactionGUID - The transaction GUID, if any.
236
+ * @returns {boolean} - Returns true.
237
+ */
238
+ onAfterEventTabularCompletion(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID)
211
239
  {
212
- const tmpPayload = typeof pValue === 'string' ? pEvent : '';
240
+ const tmpPayload = typeof pEvent === 'string' ? pEvent : '';
213
241
  let [ tmpType, tmpGroupHash, tmpEvent, tmpInputHash, tmpEventGUID ] = tmpPayload.split(':');
214
242
  if (!tmpEventGUID)
215
243
  {
@@ -219,7 +247,7 @@ class CustomInputHandler extends libPictSectionInputExtension
219
247
  if (!pInput.PictForm.AutofillTriggerGroup || tmpType !== 'TriggerGroup' || (pInput.Hash || pInput.DataAddress) == tmpInputHash)
220
248
  {
221
249
  // Do nothing for now -- this is the triggering element
222
- return super.onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent);
250
+ return super.onAfterEventTabularCompletion(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID);
223
251
  }
224
252
  let tmpAutoFillTriggerGroups = pInput.PictForm.AutofillTriggerGroup;
225
253
  if (!Array.isArray(tmpAutoFillTriggerGroups))
@@ -254,7 +282,7 @@ class CustomInputHandler extends libPictSectionInputExtension
254
282
  }
255
283
  }
256
284
 
257
- return super.onEventTabular(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent);
285
+ return super.onAfterEventTabularCompletion(pView, pInput, pValue, pHTMLSelector, pRowIndex, pEvent, pTransactionGUID);
258
286
  }
259
287
  }
260
288
 
@@ -63,12 +63,13 @@ class CustomInputHandler extends libPictSectionInputExtension
63
63
  * @param {Object} pInput - The input object.
64
64
  * @param {any} pValue - The value to be assigned.
65
65
  * @param {string} pHTMLSelector - The HTML selector.
66
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
66
67
  * @returns {any} - The result of the super method call.
67
68
  */
68
- onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector)
69
+ onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector, pTransactionGUID)
69
70
  {
70
71
  this.pict.ContentAssignment.assignContent(this.getDateTimeInputHTMLID(pInput.Macro.RawHTMLID), pValue);
71
- return super.onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector);
72
+ return super.onDataMarshalToForm(pView, pGroup, pRow, pInput, pValue, pHTMLSelector, pTransactionGUID);
72
73
  }
73
74
 
74
75
  /**
@@ -80,12 +81,13 @@ class CustomInputHandler extends libPictSectionInputExtension
80
81
  * @param {any} pValue - The value to be assigned.
81
82
  * @param {string} pHTMLSelector - The HTML selector.
82
83
  * @param {number} pRowIndex - The index of the row.
84
+ * @param {string} pTransactionGUID - The transaction GUID for the event dispatch.
83
85
  * @returns {any} - The result of the data marshaling.
84
86
  */
85
- onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex)
87
+ onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID)
86
88
  {
87
89
  this.pict.ContentAssignment.assignContent(this.getTabularDateTimeInputHTMLID(pInput.Macro.RawHTMLID, pRowIndex), pValue);
88
- return super.onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex);
90
+ return super.onDataMarshalToFormTabular(pView, pGroup, pInput, pValue, pHTMLSelector, pRowIndex, pTransactionGUID);
89
91
  }
90
92
 
91
93
  /**