@factorialco/f0-react 14.23.1 → 14.24.0

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.
@@ -4,7 +4,7 @@ import { useCallback as i, useEffect as a, useRef as o, useState as s } from "re
4
4
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
5
  //#region \0virtual:f0-component-status-data
6
6
  var u = {
7
- generatedAt: "2026-11-17T12:24:11.844Z",
7
+ generatedAt: "2026-11-17T13:31:19.083Z",
8
8
  stats: {
9
9
  total: 314,
10
10
  byStatus: {
package/dist/f0.d.ts CHANGED
@@ -2191,6 +2191,23 @@ type SurveyFormSubmitResult = {
2191
2191
  errors?: Record<string, string>;
2192
2192
  };
2193
2193
  type SurveyAnsweringFormMode = "stepped" | "all-questions";
2194
+ /**
2195
+ * Lets the respondent keep unfinished answers. The answers are not validated,
2196
+ * so required questions may be empty, and the dialog stays open after a save.
2197
+ */
2198
+ interface SurveyAnsweringFormSaveDraft {
2199
+ /**
2200
+ * The button label. It comes from the host, which knows whether a draft
2201
+ * already exists ("Save draft" or "Update draft") and translates it.
2202
+ */
2203
+ label: string;
2204
+ /**
2205
+ * Receives every question's answer, the same keys as `onSubmit`, including
2206
+ * steps not visited yet (from `defaultValues` or the question's default).
2207
+ * The host reports the outcome, errors included: a rejection is only logged.
2208
+ */
2209
+ onSave: (answers: SurveySubmitAnswers) => Promise<void> | void;
2210
+ }
2194
2211
  interface SurveyAnsweringFormModule {
2195
2212
  id: ModuleId;
2196
2213
  label: string;
@@ -2243,14 +2260,17 @@ interface SurveyAnsweringFormInlineProps extends SurveyAnsweringFormSharedProps
2243
2260
  type SurveyAnsweringFormDefaultProps = SurveyAnsweringFormDialogProps & {
2244
2261
  preview?: false;
2245
2262
  onSubmit: (answers: SurveySubmitAnswers) => Promise<SurveyFormSubmitResult> | SurveyFormSubmitResult;
2263
+ saveDraft?: SurveyAnsweringFormSaveDraft;
2246
2264
  };
2247
2265
  type SurveyAnsweringFormPreviewProps = SurveyAnsweringFormDialogProps & {
2248
2266
  preview: true;
2249
2267
  onSubmit?: never;
2268
+ saveDraft?: never;
2250
2269
  };
2251
2270
  type SurveyAnsweringFormInlineReadonlyProps = SurveyAnsweringFormInlineProps & {
2252
2271
  preview?: never;
2253
2272
  onSubmit?: never;
2273
+ saveDraft?: never;
2254
2274
  };
2255
2275
  type SurveyAnsweringFormProps = SurveyAnsweringFormDefaultProps | SurveyAnsweringFormPreviewProps | SurveyAnsweringFormInlineReadonlyProps;
2256
2276
  interface FlatQuestion {