@dynamicforms/vue-forms 0.17.0 → 0.17.1

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/dist/index.d.ts CHANGED
@@ -7,7 +7,8 @@ import { Ref } from 'vue';
7
7
  /**
8
8
  * Thrown from a handler to end the run it is in. What the trigger answers with is the exception itself rather than
9
9
  * `null`, so a caller can tell a run a handler ended from one that reached no handler at all - and the setters
10
- * that ask a `*Changing*` handler read it as a refusal and write nothing.
10
+ * that ask a `*Changing*` handler read it as a refusal and write nothing. The answer carries it directly where the
11
+ * chain ran synchronously, and as what the answered promise resolves to where a handler in it was asynchronous.
11
12
  */
12
13
  export declare class AbortEventHandlingException extends Error {
13
14
  }
@@ -45,7 +46,8 @@ export declare class Action<T extends ActionValue = ActionValue, X extends objec
45
46
  *
46
47
  * The answer is a promise whatever the handler returns, so a handler that throws rejects it rather than throwing
47
48
  * out of this call: a caller that does not await the answer and does not attach a catch handler leaves that
48
- * rejection unhandled.
49
+ * rejection unhandled. An `AbortEventHandlingException` is the one exception that does not reject: the answer
50
+ * resolves with it, in a synchronous chain as in an asynchronous one.
49
51
  */
50
52
  execute(params?: any): Promise<any>;
51
53
  }
@@ -103,10 +105,24 @@ export declare class ActionsMap {
103
105
  bindTo(owner: FieldBase): void;
104
106
  /** True where no eager action of `identifier` stands after `index`, which makes `index` the group's entry. */
105
107
  private static outermostEager;
108
+ /**
109
+ * True where `value` is a promise, which is what a walk through an asynchronous handler answers with. The test is
110
+ * the type rather than a `then` member: a handler may answer with a value object that carries one, and calling
111
+ * `then` on such an object replaces the answer with whatever that call returns.
112
+ */
113
+ private static isPromise;
114
+ /**
115
+ * Answers an abort with itself on the asynchronous path as well. Where a handler in the chain is asynchronous, the
116
+ * walk answers with a promise and the abort raised under it arrives as that promise's rejection; this turns it back
117
+ * into the value the caller receives, so a promise the trigger answers with resolves to the exception instead of
118
+ * rejecting with it. Anything else keeps rejecting.
119
+ */
120
+ private static answerAbort;
106
121
  /**
107
122
  * Enters a group at its outermost action. An abort ends the run and is answered with rather than raised: the
108
- * exception is what the caller receives, so a run a handler ended is told apart from one that reached no handler
109
- * and from one whose handler answered null.
123
+ * exception is what the caller receives - directly where the chain ran synchronously, as what the answered promise
124
+ * resolves to where it did not - so a run a handler ended is told apart from one that reached no handler and from
125
+ * one whose handler answered null.
110
126
  */
111
127
  private run;
112
128
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dynamicforms/vue-forms",
3
3
  "private": false,
4
- "version": "0.17.0",
4
+ "version": "0.17.1",
5
5
  "type": "module",
6
6
  "description": "A lightweight Vue.js library for form state management with built-in validation, conditional logic, nested structures, and a rich event system. UI-agnostic and TypeScript-first.",
7
7
  "author": "Jure Erzno\u017enik",