jsf.js_next_gen 4.0.1-beta.2 → 4.0.1-beta.4

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 (121) hide show
  1. package/README.md +6 -0
  2. package/dist/docs/assets/search.js +1 -1
  3. package/dist/docs/functions/myfaces.ab.html +1 -1
  4. package/dist/docs/functions/{myfaces.onOnDomReady.html → myfaces.onDomReady.html} +5 -5
  5. package/dist/docs/index.html +9 -0
  6. package/dist/docs/modules/myfaces.html +2 -2
  7. package/dist/docs/variables/myfaces.oam.html +1 -1
  8. package/dist/window/faces-development.js +1292 -1296
  9. package/dist/window/faces-development.js.br +0 -0
  10. package/dist/window/faces-development.js.gz +0 -0
  11. package/dist/window/faces-development.js.map +1 -1
  12. package/dist/window/faces.js +1 -1
  13. package/dist/window/faces.js.br +0 -0
  14. package/dist/window/faces.js.gz +0 -0
  15. package/dist/window/faces.js.map +1 -1
  16. package/dist/window/jsf-development.js +1292 -1296
  17. package/dist/window/jsf-development.js.br +0 -0
  18. package/dist/window/jsf-development.js.gz +0 -0
  19. package/dist/window/jsf-development.js.map +1 -1
  20. package/dist/window/jsf.js +1 -1
  21. package/dist/window/jsf.js.br +0 -0
  22. package/dist/window/jsf.js.gz +0 -0
  23. package/dist/window/jsf.js.map +1 -1
  24. package/package.json +5 -5
  25. package/plans for 4.0.1.txt +8 -0
  26. package/src/main/typescript/api/_api.ts +1 -1
  27. package/src/main/typescript/impl/AjaxImpl.ts +63 -47
  28. package/src/main/typescript/impl/core/Const.ts +5 -2
  29. package/src/main/typescript/impl/util/AsyncRunnable.ts +81 -6
  30. package/src/main/typescript/impl/util/ExtDomQuery.ts +7 -9
  31. package/src/main/typescript/impl/util/FileUtils.ts +26 -22
  32. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +7 -3
  33. package/src/main/typescript/impl/util/Lang.ts +62 -4
  34. package/src/main/typescript/impl/util/XhrQueueController.ts +112 -0
  35. package/src/main/typescript/impl/xhrCore/EventData.ts +3 -3
  36. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +12 -10
  37. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +33 -19
  38. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +51 -72
  39. package/src/main/typescript/myfaces/OamSubmit.ts +6 -6
  40. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +179 -40
  41. package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +4 -4
  42. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/blank.css +0 -0
  43. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +921 -0
  44. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +108 -0
  45. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +3 -2
  46. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/jakarta.faces.resource/faces.js.jsf +0 -0
  47. package/src/main/typescript/test/impl/ImplTest.spec.ts +24 -6
  48. package/src/main/typescript/test/myfaces/OnLoadSpec.ts +52 -0
  49. package/src/main/typescript/test/queue/AsynchronousProbe.ts +5 -5
  50. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -3
  51. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +28 -22
  52. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +9 -1
  53. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +13 -5
  54. package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +9 -2
  55. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +2 -2
  56. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +89 -8
  57. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +6 -1
  58. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +32 -24
  59. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +9 -1
  60. package/src/main/typescript/test/xhrCore/WebsocketTest.ts +10 -3
  61. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +9 -2
  62. package/target/api/_api.js +2 -2
  63. package/target/api/_api.js.map +1 -1
  64. package/target/impl/AjaxImpl.js +51 -41
  65. package/target/impl/AjaxImpl.js.map +1 -1
  66. package/target/impl/core/Const.js +7 -5
  67. package/target/impl/core/Const.js.map +1 -1
  68. package/target/impl/util/AsyncRunnable.js +60 -0
  69. package/target/impl/util/AsyncRunnable.js.map +1 -1
  70. package/target/impl/util/ExtDomQuery.js +8 -8
  71. package/target/impl/util/ExtDomQuery.js.map +1 -1
  72. package/target/impl/util/FileUtils.js +21 -19
  73. package/target/impl/util/FileUtils.js.map +1 -1
  74. package/target/impl/util/HiddenInputBuilder.js +7 -3
  75. package/target/impl/util/HiddenInputBuilder.js.map +1 -1
  76. package/target/impl/util/Lang.js +53 -1
  77. package/target/impl/util/Lang.js.map +1 -1
  78. package/target/impl/xhrCore/EventData.js +2 -2
  79. package/target/impl/xhrCore/EventData.js.map +1 -1
  80. package/target/impl/xhrCore/ResponseProcessor.js +9 -7
  81. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  82. package/target/impl/xhrCore/XhrFormData.js +30 -15
  83. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  84. package/target/impl/xhrCore/XhrRequest.js +43 -64
  85. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  86. package/target/myfaces/OamSubmit.js +5 -3
  87. package/target/myfaces/OamSubmit.js.map +1 -1
  88. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +138 -37
  89. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  90. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +4 -4
  91. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  92. package/target/test/frameworkBase/_ext/shared/StandardInits.js +3 -2
  93. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  94. package/target/test/impl/ImplTest.spec.js +19 -1
  95. package/target/test/impl/ImplTest.spec.js.map +1 -1
  96. package/target/test/queue/AsynchronousQueueTest.spec.js +3 -3
  97. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  98. package/target/test/xhrCore/EventTests.spec.js +26 -19
  99. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  100. package/target/test/xhrCore/FileUploadTest.spec.js +8 -0
  101. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  102. package/target/test/xhrCore/NamespacesRequestTest.spec.js +11 -3
  103. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
  104. package/target/test/xhrCore/OamSubmitTest.spec.js +8 -0
  105. package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -1
  106. package/target/test/xhrCore/RequestParamsTest.spec.js +1 -1
  107. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  108. package/target/test/xhrCore/RequestTest.spec.js +81 -4
  109. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  110. package/target/test/xhrCore/RequestTest_23.spec.js +6 -0
  111. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  112. package/target/test/xhrCore/ResponseTest.spec.js +30 -15
  113. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  114. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +8 -0
  115. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -1
  116. package/target/test/xhrCore/WebsocketTest.js +9 -0
  117. package/target/test/xhrCore/WebsocketTest.js.map +1 -1
  118. package/target/test/xhrCore/XhrFormDataTest.spec.js +8 -0
  119. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  120. package/src/main/typescript/impl/util/AsyncQueue.ts +0 -133
  121. package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +0 -231
@@ -15,10 +15,11 @@
15
15
  *
16
16
  */
17
17
 
18
- import {Lang as LangBase, Config, Optional, DomQuery, DQ, Stream} from "mona-dish";
18
+ import {Lang as LangBase, Config, Optional, DomQuery, DQ} from "mona-dish";
19
19
  import {Messages} from "../i18n/Messages";
20
20
  import {EMPTY_STR, HTML_TAG_FORM} from "../core/Const";
21
21
  import {getEventTarget} from "../xhrCore/RequestDataResolver";
22
+ import {Es2019Array} from "mona-dish";
22
23
 
23
24
 
24
25
  export module ExtLang {
@@ -85,10 +86,10 @@ export module ExtLang {
85
86
  installedLocale = installedLocale ?? new Messages();
86
87
 
87
88
  let msg = installedLocale[key] ?? defaultMessage ?? key;
88
-
89
- Stream.of(...templateParams).each((param, cnt) => {
89
+ templateParams.forEach((param, cnt) => {
90
90
  msg = msg.replace(new RegExp(["\\{", cnt, "\\}"].join(EMPTY_STR), "g"), param);
91
- });
91
+ })
92
+
92
93
 
93
94
  return msg;
94
95
  }
@@ -202,6 +203,61 @@ export module ExtLang {
202
203
  defaultValue;
203
204
  }
204
205
 
206
+ /**
207
+ * expands an associative array into an array of key value tuples
208
+ * @param value
209
+ */
210
+ export function ofAssoc(value: {[key: string]: any}) {
211
+ return new Es2019Array(...Object.keys(value))
212
+ .map(key => [key, value[key]]);
213
+ }
214
+
215
+ export function collectAssoc(target: any, item: any) {
216
+ target[item[0]] = item[1];
217
+ return target;
218
+ }
219
+
220
+ /**
221
+ * The active timeout for the "debounce".
222
+ * Since we only use it in the XhrController
223
+ * we can use a local module variable here
224
+ */
225
+ let activeTimeouts = {};
226
+
227
+
228
+
229
+
230
+ /**
231
+ * a simple debounce function
232
+ * which waits until a timeout is reached and
233
+ * if something comes in in between debounces
234
+ *
235
+ * @param runnable a runnable which should go under debounce control
236
+ * @param timeout a timeout for the debounce window
237
+ */
238
+ export function debounce(key, runnable, timeout) {
239
+ function clearActiveTimeout() {
240
+ clearTimeout(activeTimeouts[key]);
241
+ delete activeTimeouts[key];
242
+ }
243
+
244
+ if (!!(activeTimeouts?.[key])) {
245
+ clearActiveTimeout();
246
+ }
247
+ if (timeout > 0) {
248
+ activeTimeouts[key] = setTimeout(() => {
249
+ try {
250
+ runnable();
251
+ } finally {
252
+ clearActiveTimeout();
253
+ }
254
+ }, timeout);
255
+ } else {
256
+ runnable();
257
+ }
258
+ }
259
+
260
+
205
261
  /**
206
262
  * assert that the form exists and throw an exception in the case it does not
207
263
  *
@@ -212,4 +268,6 @@ export module ExtLang {
212
268
  throw makeException(new Error(), null, null, "Impl", "getForm", getMessage("ERR_FORM"));
213
269
  }
214
270
  }
271
+
272
+
215
273
  }
@@ -0,0 +1,112 @@
1
+ import {IAsyncRunnable} from "./AsyncRunnable";
2
+ import {ExtLang} from "./Lang";
3
+ import debounce = ExtLang.debounce;
4
+
5
+ /**
6
+ * A simple XHR queue controller
7
+ * following the async op -> next pattern
8
+ * Faces enforces for the XHR handling
9
+ */
10
+ export class XhrQueueController<T extends IAsyncRunnable<any>> {
11
+ queue = [];
12
+ taskRunning = false;
13
+
14
+ constructor() {
15
+ }
16
+
17
+ /**
18
+ * executes or enqueues an element
19
+ * @param runnable the runnable (request) to be enqueued
20
+ * @param timeOut timeout if > 0 which defers the execution
21
+ * until the debounce window for the timeout is closed.
22
+ */
23
+ enqueue(runnable: T, timeOut: number = 0) {
24
+ debounce("xhrQueue", () => {
25
+ const requestHandler = this.enrichRunnable(runnable);
26
+ if (!this.taskRunning) {
27
+ this.signalTaskRunning();
28
+ requestHandler.start();
29
+ } else {
30
+ this.queue.push(requestHandler);
31
+ }
32
+ }, timeOut);
33
+ }
34
+
35
+ /**
36
+ * trigger the next element in the queue
37
+ * to be started!
38
+ */
39
+ next() {
40
+ this.updateTaskRunning();
41
+ const next = this.queue.shift();
42
+ next?.start();
43
+ }
44
+
45
+ /**
46
+ * clears and resets the queue
47
+ */
48
+ clear() {
49
+ this.queue.length = 0;
50
+ this.updateTaskRunning();
51
+ }
52
+
53
+ /**
54
+ * true if queue is empty
55
+ */
56
+ get isEmpty(): boolean {
57
+ return !this.queue.length;
58
+ }
59
+
60
+ /**
61
+ * Enriches the incoming async asyncRunnable
62
+ * with the error and next handling
63
+ * (aka: asyncRunnable is done -> next
64
+ * error -> clear queue
65
+ * @param asyncRunnable the async runnable which needs enrichment
66
+ * @private
67
+ */
68
+ private enrichRunnable(asyncRunnable: T) {
69
+ /**
70
+ * we can use the Promise pattern asyncrunnable uses
71
+ * to trigger queue control callbacks of next element
72
+ * and clear the queue (theoretically this
73
+ * would work with any promise)
74
+ */
75
+ try {
76
+ return asyncRunnable
77
+ .then(() => this.next())
78
+ .catch((e) => this.handleError(e));
79
+ } catch (e) {
80
+ this.handleError(e);
81
+ }
82
+ }
83
+
84
+
85
+ /**
86
+ * alerts the queue that a task is running
87
+ *
88
+ * @private
89
+ */
90
+ private signalTaskRunning() {
91
+ this.taskRunning = true;
92
+ }
93
+
94
+ /**
95
+ * updates the task running status according to the current queue
96
+ * @private
97
+ */
98
+ private updateTaskRunning() {
99
+ this.taskRunning = !this.isEmpty;
100
+ }
101
+
102
+ /**
103
+ * standard error handling
104
+ * we clear the queue and then bomb out
105
+ * @param e
106
+ * @private
107
+ */
108
+ private handleError(e) {
109
+ this.clear();
110
+ throw e;
111
+ }
112
+ }
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import {Config, DQ} from "mona-dish";
17
- import {BEGIN, CTX_PARAM_REQ_PASS_THR, EVENT, P_PARTIAL_SOURCE, SOURCE} from "../core/Const";
17
+ import {BEGIN, CTX_PARAM_REQ_PASS_THR, EVENT, P_AJAX_SOURCE, SOURCE} from "../core/Const";
18
18
 
19
19
  export class EventData implements IEventData{
20
20
  type: string;
@@ -32,8 +32,8 @@ export class EventData implements IEventData{
32
32
  eventData.status = name;
33
33
 
34
34
  let sourceId: string = context.getIf(SOURCE)
35
- .orElseLazy(() => context.getIf(P_PARTIAL_SOURCE).value)
36
- .orElseLazy(() => context.getIf(CTX_PARAM_REQ_PASS_THR, P_PARTIAL_SOURCE).value)
35
+ .orElseLazy(() => context.getIf(P_AJAX_SOURCE).value)
36
+ .orElseLazy(() => context.getIf(CTX_PARAM_REQ_PASS_THR, P_AJAX_SOURCE).value)
37
37
  .value;
38
38
  if (sourceId) {
39
39
  eventData.source = DQ.byId(sourceId, true).first().value.value;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import {Config, DomQuery, DomQueryCollector, DQ, DQ$, Lang, LazyStream, Stream, XMLQuery} from "mona-dish";
17
+ import {Config, DomQuery, DomQueryCollector, DQ, DQ$, Lang, XMLQuery} from "mona-dish";
18
18
  import {Implementation} from "../AjaxImpl";
19
19
  import {Assertions} from "../util/Assertions";
20
20
  import {IResponseProcessor} from "./IResponseProcessor";
@@ -46,7 +46,7 @@ import {
46
46
  ON_EVENT,
47
47
  P_CLIENT_WINDOW,
48
48
  P_EXECUTE,
49
- P_PARTIAL_SOURCE,
49
+ P_AJAX_SOURCE,
50
50
  P_RENDER,
51
51
  P_RENDER_OVERRIDE,
52
52
  P_VIEWSTATE,
@@ -65,6 +65,8 @@ import {
65
65
  import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
66
66
  import {HiddenInputBuilder} from "../util/HiddenInputBuilder";
67
67
  import trim = Lang.trim;
68
+ import {ExtLang} from "../util/Lang";
69
+ import ofAssoc = ExtLang.ofAssoc;
68
70
 
69
71
 
70
72
  /**
@@ -174,7 +176,7 @@ export class ResponseProcessor implements IResponseProcessor {
174
176
  */
175
177
 
176
178
  const mergedErrorData = new ExtConfig({});
177
- mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_PARTIAL_SOURCE).get(0).value;
179
+ mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_AJAX_SOURCE).get(0).value;
178
180
  mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);
179
181
  mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;
180
182
 
@@ -346,15 +348,15 @@ export class ResponseProcessor implements IResponseProcessor {
346
348
  * as last lifecycle step, before going into the next request.
347
349
  */
348
350
  fixViewStates() {
349
- Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
350
- .each(([, value]) => {
351
+ ofAssoc(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
352
+ .forEach(([, value]) => {
351
353
  const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
352
354
  const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value
353
355
  const affectedForms = this.getContainerForms(namingContainerId)
354
356
  .filter(affectedForm => this.isInExecuteOrRender(affectedForm));
355
357
 
356
358
  this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
357
- });
359
+ })
358
360
  }
359
361
 
360
362
 
@@ -364,8 +366,8 @@ export class ResponseProcessor implements IResponseProcessor {
364
366
  * is done.
365
367
  */
366
368
  fixClientWindow() {
367
- Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
368
- .each(([, value]) => {
369
+ ofAssoc(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
370
+ .forEach(([, value]) => {
369
371
  const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
370
372
  const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
371
373
  const affectedForms = this.getContainerForms(namingContainerId)
@@ -522,7 +524,7 @@ export class ResponseProcessor implements IResponseProcessor {
522
524
  .orElseLazy(() => this.externalContext.getIf($nsp(P_RENDER)).value)
523
525
  .orElse(IDENT_NONE).value.split(/\s+/gi);
524
526
  const executeAndRenders = executes.concat(...renders);
525
- return LazyStream.of(...executeAndRenders).filter(nameOrId => {
527
+ return [...executeAndRenders].filter(nameOrId => {
526
528
  if ([IDENT_ALL, IDENT_NONE].indexOf(nameOrId) != -1) {
527
529
  return true;
528
530
  }
@@ -532,7 +534,7 @@ export class ResponseProcessor implements IResponseProcessor {
532
534
  return affectedForm.matchesSelector(NAME_OR_ID) ||
533
535
  affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
534
536
  affectedForm.firstParent(NAME_OR_ID).isPresent();
535
- }).first().isPresent();
537
+ }).length > 0;
536
538
  }
537
539
 
538
540
  /**
@@ -13,19 +13,21 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import {Config, DQ, FormDataCollector, Stream} from "mona-dish";
16
+ import {Config, DQ} from "mona-dish";
17
17
  import {$nsp, EMPTY_STR, IDENT_NONE, P_VIEWSTATE} from "../core/Const";
18
18
 
19
19
  import {
20
20
  encodeFormData,
21
- fixEmmptyParameters, getFormInputsAsStream
21
+ fixEmptyParameters, getFormInputsAsArr
22
22
  } from "../util/FileUtils";
23
+ import {ExtLang} from "../util/Lang";
24
+ import ofAssoc = ExtLang.ofAssoc;
25
+ import {Es2019Array} from "mona-dish";
23
26
 
24
27
 
25
28
  type ParamsMapper<V, K> = (key: V, item: K) => [V, K];
26
29
  const defaultParamsMapper: ParamsMapper<string, any> = (key, item) => [key, item];
27
30
 
28
-
29
31
  /**
30
32
  * A unified form data class
31
33
  * which builds upon our configuration.
@@ -76,13 +78,17 @@ export class XhrFormData extends Config {
76
78
  */
77
79
  toFormData(): FormData {
78
80
  /*
79
- * expands key: [item1, item2]
80
- * to: [{key: key, value: item1}, {key: key, value: item2}]
81
- */
82
- let expandAssocArray = ([key, item]) =>
83
- Stream.of(...(item as Array<any>)).map(value => {
84
- return {key, value};
85
- });
81
+ * expands key: [item1, item2]
82
+ * to: [{key: key, value: item1}, {key: key, value: item2}]
83
+ */
84
+ let expandValueArrays = ([key, item]) => {
85
+ if (Array.isArray(item)) {
86
+ return new Es2019Array(...item).map(value => {
87
+ return {key, value}
88
+ })
89
+ }
90
+ return [{key, value: item}]
91
+ }
86
92
 
87
93
  /*
88
94
  * remaps the incoming {key, value} tuples
@@ -96,10 +102,13 @@ export class XhrFormData extends Config {
96
102
  /*
97
103
  * collects everything into a FormData object
98
104
  */
99
- return Stream.ofAssoc(this.value)
100
- .flatMap(expandAssocArray)
105
+ return ofAssoc(this.value)
106
+ .flatMap(expandValueArrays)
101
107
  .map(remapForNamingContainer)
102
- .collect(new FormDataCollector() as any);
108
+ .reduce((formData: FormData, {key, value}: any) => {
109
+ formData.append(key, value);
110
+ return formData;
111
+ }, new FormData()) as FormData;
103
112
  }
104
113
 
105
114
  /**
@@ -113,6 +122,7 @@ export class XhrFormData extends Config {
113
122
 
114
123
  /**
115
124
  * generic post init code, for now, this performs some post assign data post-processing
125
+ * @param rootElement the root element which knows the request type (usually a form)
116
126
  * @param executes the executable dom nodes which need to be processed into the form data, which we can send
117
127
  * in our ajax request
118
128
  */
@@ -139,20 +149,24 @@ export class XhrFormData extends Config {
139
149
 
140
150
  /**
141
151
  * determines fields to submit
142
- * @param {Object} targetBuf - the target form buffer receiving the data
143
152
  * @param {Node} parentItem - form element item is nested in
144
153
  * @param {Array} partialIds - ids fo PPS
145
154
  */
146
- private encodeSubmittableFields(parentItem: DQ, partialIds ?: string[]) {
155
+ private encodeSubmittableFields(parentItem: DQ, partialIds: string[] = []) {
147
156
 
148
- const formInputs = getFormInputsAsStream(parentItem);
149
157
  const mergeIntoThis = ([key, value]) => this.append(key).value = value;
150
158
  const namingContainerRemap = ([key, value]) => this.paramsMapper(key as string, value);
151
159
 
152
- formInputs
153
- .map(fixEmmptyParameters)
160
+ const remappedPartialIds = partialIds.map(partialId => this.remapKeyForNamingContainer(partialId));
161
+ const partialIdsFilter = ([key, value]) => (!remappedPartialIds.length || key.indexOf("@") == 0) ? true :
162
+ remappedPartialIds.indexOf(key) != -1;
163
+
164
+ let inputs = getFormInputsAsArr(parentItem);
165
+ inputs
166
+ .map(fixEmptyParameters)
154
167
  .map(namingContainerRemap)
155
- .each(mergeIntoThis);
168
+ .filter(partialIdsFilter)
169
+ .forEach(mergeIntoThis);
156
170
  }
157
171
 
158
172
  private remapKeyForNamingContainer(key: string): string {