@notmrabhi/flowforge 0.1.34 → 0.1.36
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/README.md +52 -0
- package/dist/{SchemaBuilderDrawer-BbkOK4Xc.js → SchemaBuilderDrawer-CUzYWGCN.js} +2 -2
- package/dist/{SchemaBuilderDrawer-BbkOK4Xc.js.map → SchemaBuilderDrawer-CUzYWGCN.js.map} +1 -1
- package/dist/{SchemaBuilderDrawer-BcaULxqB.js → SchemaBuilderDrawer-CiSdfXzJ.js} +2 -2
- package/dist/{SchemaBuilderDrawer-BcaULxqB.js.map → SchemaBuilderDrawer-CiSdfXzJ.js.map} +1 -1
- package/dist/canvas.cjs +1 -1
- package/dist/canvas.d.ts +101 -0
- package/dist/canvas.js +1 -1
- package/dist/core.d.ts +61 -0
- package/dist/form.cjs +1 -1
- package/dist/form.d.ts +12 -0
- package/dist/form.js +2 -2
- package/dist/{index-CEg1wTCw.js → index-B74jTc2b.js} +869 -862
- package/dist/{index-CEg1wTCw.js.map → index-B74jTc2b.js.map} +1 -1
- package/dist/{index-CYdDPwd2.js → index-B8-KKaH_.js} +2 -2
- package/dist/{index-CYdDPwd2.js.map → index-B8-KKaH_.js.map} +1 -1
- package/dist/{index-dhI8qsmP.js → index-Buv1ylwP.js} +2 -2
- package/dist/{index-dhI8qsmP.js.map → index-Buv1ylwP.js.map} +1 -1
- package/dist/{index-fcb3uyVA.js → index-CiU9_8f1.js} +2 -2
- package/dist/{index-fcb3uyVA.js.map → index-CiU9_8f1.js.map} +1 -1
- package/dist/{index-x1DrmceO.js → index-CqMPyOkL.js} +5 -5
- package/dist/{index-x1DrmceO.js.map → index-CqMPyOkL.js.map} +1 -1
- package/dist/{index-B9W10Fvn.js → index-DjKhaaWf.js} +2 -2
- package/dist/{index-B9W10Fvn.js.map → index-DjKhaaWf.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +61 -0
- package/dist/index.js +3 -3
- package/dist/nodeRegistry.d.ts +18 -0
- package/dist/templateRegistry.cjs +1 -1
- package/dist/templateRegistry.cjs.map +1 -1
- package/dist/templateRegistry.d.ts +49 -0
- package/dist/templateRegistry.js +63 -20
- package/dist/templateRegistry.js.map +1 -1
- package/dist/{templateSkeletons-CY4tkEp2.js → templateSkeletons-BTC2fk5u.js} +2 -2
- package/dist/{templateSkeletons-CY4tkEp2.js.map → templateSkeletons-BTC2fk5u.js.map} +1 -1
- package/dist/{templateSkeletons-BPIZ_EHv.js → templateSkeletons-DCvfog6-.js} +2 -2
- package/dist/{templateSkeletons-BPIZ_EHv.js.map → templateSkeletons-DCvfog6-.js.map} +1 -1
- package/package.json +1 -1
package/dist/canvas.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./templateSkeletons-BTC2fk5u.js"),t=require("./messages-O9Tw_XXR.js"),r=require("./bpmn-CcuE2X_Q.js"),e=require("./GatewayBranchEdge-9YF32wwN.js");exports.FlowForgeCanvas=o.FlowForgeCanvas;exports.SubWorkflowPreviewDrawer=o.SubWorkflowPreviewDrawer;exports.WorkflowCanvas=o.FlowForgeCanvas;exports.WorkflowExecutionHistory=o.WorkflowExecutionHistory;exports.WorkflowTemplateLibrary=o.WorkflowTemplateLibrary;exports.accessRequestSkeleton=o.accessRequestSkeleton;exports.offboardingSkeleton=o.offboardingSkeleton;exports.userOnboardingSkeleton=o.userOnboardingSkeleton;exports.webhookIntegrationSkeleton=o.webhookIntegrationSkeleton;exports.defaultFlowForgeMessages=t.defaultFlowForgeMessages;exports.loadWorkflowFromBpmn=r.loadWorkflowFromBpmn;exports.saveWorkflowToBpmn=r.saveWorkflowToBpmn;exports.ActionNode=e.ActionNode;exports.ApprovalNode=e.ApprovalNode;exports.EdgeWithPlusLabel=e.EdgeWithPlusLabel;exports.EndNode=e.EndNode;exports.FilterNode=e.FilterNode;exports.RestApiNode=e.RestApiNode;exports.StartNode=e.StartNode;exports.TriggerNode=e.TriggerNode;exports.WebhookTriggerNode=e.WebhookTriggerNode;exports.builtInNodeTypes=e.builtInNodeTypes;
|
|
2
2
|
//# sourceMappingURL=canvas.cjs.map
|
package/dist/canvas.d.ts
CHANGED
|
@@ -24,6 +24,38 @@ export declare interface AddStepContext {
|
|
|
24
24
|
branch?: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Wire shape the backend `/api/v1/workflow-template` endpoint is expected
|
|
29
|
+
* to return. Top-level fields mirror the persistence model; everything
|
|
30
|
+
* UI-related lives under `templateUI`. Use with `templateRegistry.registerFromApi(list)`.
|
|
31
|
+
*/
|
|
32
|
+
export declare interface ApiWorkflowTemplate {
|
|
33
|
+
key: string;
|
|
34
|
+
name: string;
|
|
35
|
+
state?: string;
|
|
36
|
+
description?: string;
|
|
37
|
+
allowedTasks?: string[];
|
|
38
|
+
allowedSources?: string[];
|
|
39
|
+
configuration?: Record<string, unknown>;
|
|
40
|
+
templateUI?: Partial<Omit<WorkflowTemplate, 'triggerKey' | 'label' | 'description' | 'availableTasks'>>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Wire shape the backend `/api/v1/workflow-template` endpoint is expected
|
|
45
|
+
* to return. Top-level fields mirror the persistence model; everything
|
|
46
|
+
* UI-related lives under `templateUI`. Use with `templateRegistry.registerFromApi(list)`.
|
|
47
|
+
*/
|
|
48
|
+
declare interface ApiWorkflowTemplate_2 {
|
|
49
|
+
key: string;
|
|
50
|
+
name: string;
|
|
51
|
+
state?: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
allowedTasks?: string[];
|
|
54
|
+
allowedSources?: string[];
|
|
55
|
+
configuration?: Record<string, unknown>;
|
|
56
|
+
templateUI?: Partial<Omit<WorkflowTemplate_3, 'triggerKey' | 'label' | 'description' | 'availableTasks'>>;
|
|
57
|
+
}
|
|
58
|
+
|
|
27
59
|
export declare const ApprovalNode: ({ id, data }: NodeProps) => JSX_2.Element;
|
|
28
60
|
|
|
29
61
|
export declare interface BpmnElement {
|
|
@@ -284,6 +316,18 @@ declare interface FieldDescriptor {
|
|
|
284
316
|
shouldHide?: (ctx: FieldContext) => boolean;
|
|
285
317
|
shouldDisable?: (ctx: FieldContext) => boolean;
|
|
286
318
|
shouldRequire?: (ctx: FieldContext) => boolean;
|
|
319
|
+
/**
|
|
320
|
+
* When true, the field's value is auto-cleared (reset to `defaultValue`,
|
|
321
|
+
* or removed if no default) any time `shouldHide` evaluates to true —
|
|
322
|
+
* including on mount when the saved data has orphan values from a prior
|
|
323
|
+
* configuration. Default: false (values persist while hidden, preserving
|
|
324
|
+
* legacy behavior).
|
|
325
|
+
*
|
|
326
|
+
* Use this on conditional fields where stale data would corrupt the
|
|
327
|
+
* payload (e.g. `template` should be empty when `valueSource !== 'template'`).
|
|
328
|
+
*/
|
|
329
|
+
clearOnHide?: boolean;
|
|
330
|
+
defaultValue?: unknown;
|
|
287
331
|
compute?: (ctx: FieldContext) => unknown;
|
|
288
332
|
transform?: FieldTransform;
|
|
289
333
|
onChange?: (value: unknown, ctx: FieldContext & {
|
|
@@ -320,6 +364,18 @@ declare interface FieldDescriptor_2 {
|
|
|
320
364
|
shouldHide?: (ctx: FieldContext_2) => boolean;
|
|
321
365
|
shouldDisable?: (ctx: FieldContext_2) => boolean;
|
|
322
366
|
shouldRequire?: (ctx: FieldContext_2) => boolean;
|
|
367
|
+
/**
|
|
368
|
+
* When true, the field's value is auto-cleared (reset to `defaultValue`,
|
|
369
|
+
* or removed if no default) any time `shouldHide` evaluates to true —
|
|
370
|
+
* including on mount when the saved data has orphan values from a prior
|
|
371
|
+
* configuration. Default: false (values persist while hidden, preserving
|
|
372
|
+
* legacy behavior).
|
|
373
|
+
*
|
|
374
|
+
* Use this on conditional fields where stale data would corrupt the
|
|
375
|
+
* payload (e.g. `template` should be empty when `valueSource !== 'template'`).
|
|
376
|
+
*/
|
|
377
|
+
clearOnHide?: boolean;
|
|
378
|
+
defaultValue?: unknown;
|
|
323
379
|
compute?: (ctx: FieldContext_2) => unknown;
|
|
324
380
|
transform?: FieldTransform_2;
|
|
325
381
|
onChange?: (value: unknown, ctx: FieldContext_2 & {
|
|
@@ -703,13 +759,40 @@ declare interface SubWorkflowPreviewDrawerProps {
|
|
|
703
759
|
|
|
704
760
|
declare class TemplateRegistry {
|
|
705
761
|
private templates;
|
|
762
|
+
/**
|
|
763
|
+
* Register a template. Normalises `allowedTasks` (the backend's name) →
|
|
764
|
+
* `availableTasks` (FlowForge's canonical name) so consumers can pass
|
|
765
|
+
* either without rewriting.
|
|
766
|
+
*/
|
|
706
767
|
register(template: WorkflowTemplate_3): this;
|
|
768
|
+
/**
|
|
769
|
+
* Register a list of templates fetched from `GET /api/v1/workflow-template`.
|
|
770
|
+
*
|
|
771
|
+
* The API shape is:
|
|
772
|
+
* {
|
|
773
|
+
* key, name, description, allowedTasks, allowedSources,
|
|
774
|
+
* configuration, // runtime BPMN — ignored by the canvas
|
|
775
|
+
* templateUI: { // ← UI bag, spread onto the template
|
|
776
|
+
* triggerCategory, icon, tags, category, author, popularity,
|
|
777
|
+
* source, product, taskLabels, maxTasks, skeletonState, …
|
|
778
|
+
* }
|
|
779
|
+
* }
|
|
780
|
+
*
|
|
781
|
+
* Anything in `templateUI` overrides the top-level shorthand where there's
|
|
782
|
+
* an overlap. Bad rows (missing `key`) are skipped with a DEV warning
|
|
783
|
+
* rather than throwing, so one broken template doesn't blank the picker.
|
|
784
|
+
*
|
|
785
|
+
* Returns `this` for chaining and the count of templates registered.
|
|
786
|
+
*/
|
|
787
|
+
registerFromApi(list: ApiWorkflowTemplate_2[]): this;
|
|
707
788
|
lookup(triggerKey: string): WorkflowTemplate_3 | undefined;
|
|
708
789
|
list(): WorkflowTemplate_3[];
|
|
709
790
|
listByCategory(category: string): WorkflowTemplate_3[];
|
|
710
791
|
listByTag(tag: string): WorkflowTemplate_3[];
|
|
711
792
|
search(query: string): WorkflowTemplate_3[];
|
|
712
793
|
categories(): string[];
|
|
794
|
+
/** Remove every template — useful before re-loading from backend. */
|
|
795
|
+
clear(): this;
|
|
713
796
|
}
|
|
714
797
|
|
|
715
798
|
export declare const TriggerNode: ({ data }: NodeProps) => JSX_2.Element;
|
|
@@ -752,7 +835,13 @@ export declare interface WorkflowTemplate {
|
|
|
752
835
|
description?: string;
|
|
753
836
|
icon?: ReactNode;
|
|
754
837
|
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
838
|
+
/**
|
|
839
|
+
* Task IDs (descriptor types) that can be inserted into this workflow.
|
|
840
|
+
* `allowedTasks` is accepted as an alias for backend payloads that use
|
|
841
|
+
* that name — TemplateRegistry.register() normalises them.
|
|
842
|
+
*/
|
|
755
843
|
availableTasks?: string[];
|
|
844
|
+
allowedTasks?: string[];
|
|
756
845
|
maxTasks?: number;
|
|
757
846
|
taskLabels?: Record<string, string>;
|
|
758
847
|
fixedNodes?: FixedNode_3[];
|
|
@@ -778,7 +867,13 @@ declare interface WorkflowTemplate_2 {
|
|
|
778
867
|
description?: string;
|
|
779
868
|
icon?: ReactNode;
|
|
780
869
|
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
870
|
+
/**
|
|
871
|
+
* Task IDs (descriptor types) that can be inserted into this workflow.
|
|
872
|
+
* `allowedTasks` is accepted as an alias for backend payloads that use
|
|
873
|
+
* that name — TemplateRegistry.register() normalises them.
|
|
874
|
+
*/
|
|
781
875
|
availableTasks?: string[];
|
|
876
|
+
allowedTasks?: string[];
|
|
782
877
|
maxTasks?: number;
|
|
783
878
|
taskLabels?: Record<string, string>;
|
|
784
879
|
fixedNodes?: FixedNode[];
|
|
@@ -804,7 +899,13 @@ declare interface WorkflowTemplate_3 {
|
|
|
804
899
|
description?: string;
|
|
805
900
|
icon?: ReactNode;
|
|
806
901
|
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
902
|
+
/**
|
|
903
|
+
* Task IDs (descriptor types) that can be inserted into this workflow.
|
|
904
|
+
* `allowedTasks` is accepted as an alias for backend payloads that use
|
|
905
|
+
* that name — TemplateRegistry.register() normalises them.
|
|
906
|
+
*/
|
|
807
907
|
availableTasks?: string[];
|
|
908
|
+
allowedTasks?: string[];
|
|
808
909
|
maxTasks?: number;
|
|
809
910
|
taskLabels?: Record<string, string>;
|
|
810
911
|
fixedNodes?: FixedNode_2[];
|
package/dist/canvas.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-
|
|
1
|
+
import { F as a, S as s, F as r, W as t, a as l, b as n, o as d, u as i, w as f } from "./templateSkeletons-DCvfog6-.js";
|
|
2
2
|
import { d as w } from "./messages-CO299wPN.js";
|
|
3
3
|
import { l as p, s as b } from "./bpmn-CtfWDaOY.js";
|
|
4
4
|
import { A as F, b as N, E as m, c as u, F as S, R as T, S as c, T as v, W as x, e as A } from "./GatewayBranchEdge-Dxoy5B1A.js";
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { AnySchema } from 'yup';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Wire shape the backend `/api/v1/workflow-template` endpoint is expected
|
|
6
|
+
* to return. Top-level fields mirror the persistence model; everything
|
|
7
|
+
* UI-related lives under `templateUI`. Use with `templateRegistry.registerFromApi(list)`.
|
|
8
|
+
*/
|
|
9
|
+
export declare interface ApiWorkflowTemplate {
|
|
10
|
+
key: string;
|
|
11
|
+
name: string;
|
|
12
|
+
state?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
allowedTasks?: string[];
|
|
15
|
+
allowedSources?: string[];
|
|
16
|
+
configuration?: Record<string, unknown>;
|
|
17
|
+
templateUI?: Partial<Omit<WorkflowTemplate, 'triggerKey' | 'label' | 'description' | 'availableTasks'>>;
|
|
18
|
+
}
|
|
19
|
+
|
|
4
20
|
/**
|
|
5
21
|
* Base defaults shared by every node descriptor. A new node only has to specify
|
|
6
22
|
* what makes it different — these fill in the rest.
|
|
@@ -156,6 +172,18 @@ declare interface FieldDescriptor {
|
|
|
156
172
|
shouldHide?: (ctx: FieldContext) => boolean;
|
|
157
173
|
shouldDisable?: (ctx: FieldContext) => boolean;
|
|
158
174
|
shouldRequire?: (ctx: FieldContext) => boolean;
|
|
175
|
+
/**
|
|
176
|
+
* When true, the field's value is auto-cleared (reset to `defaultValue`,
|
|
177
|
+
* or removed if no default) any time `shouldHide` evaluates to true —
|
|
178
|
+
* including on mount when the saved data has orphan values from a prior
|
|
179
|
+
* configuration. Default: false (values persist while hidden, preserving
|
|
180
|
+
* legacy behavior).
|
|
181
|
+
*
|
|
182
|
+
* Use this on conditional fields where stale data would corrupt the
|
|
183
|
+
* payload (e.g. `template` should be empty when `valueSource !== 'template'`).
|
|
184
|
+
*/
|
|
185
|
+
clearOnHide?: boolean;
|
|
186
|
+
defaultValue?: unknown;
|
|
159
187
|
compute?: (ctx: FieldContext) => unknown;
|
|
160
188
|
transform?: FieldTransform;
|
|
161
189
|
onChange?: (value: unknown, ctx: FieldContext & {
|
|
@@ -338,13 +366,40 @@ export declare interface SubWorkflowDescriptorOptions {
|
|
|
338
366
|
|
|
339
367
|
export declare class TemplateRegistry {
|
|
340
368
|
private templates;
|
|
369
|
+
/**
|
|
370
|
+
* Register a template. Normalises `allowedTasks` (the backend's name) →
|
|
371
|
+
* `availableTasks` (FlowForge's canonical name) so consumers can pass
|
|
372
|
+
* either without rewriting.
|
|
373
|
+
*/
|
|
341
374
|
register(template: WorkflowTemplate): this;
|
|
375
|
+
/**
|
|
376
|
+
* Register a list of templates fetched from `GET /api/v1/workflow-template`.
|
|
377
|
+
*
|
|
378
|
+
* The API shape is:
|
|
379
|
+
* {
|
|
380
|
+
* key, name, description, allowedTasks, allowedSources,
|
|
381
|
+
* configuration, // runtime BPMN — ignored by the canvas
|
|
382
|
+
* templateUI: { // ← UI bag, spread onto the template
|
|
383
|
+
* triggerCategory, icon, tags, category, author, popularity,
|
|
384
|
+
* source, product, taskLabels, maxTasks, skeletonState, …
|
|
385
|
+
* }
|
|
386
|
+
* }
|
|
387
|
+
*
|
|
388
|
+
* Anything in `templateUI` overrides the top-level shorthand where there's
|
|
389
|
+
* an overlap. Bad rows (missing `key`) are skipped with a DEV warning
|
|
390
|
+
* rather than throwing, so one broken template doesn't blank the picker.
|
|
391
|
+
*
|
|
392
|
+
* Returns `this` for chaining and the count of templates registered.
|
|
393
|
+
*/
|
|
394
|
+
registerFromApi(list: ApiWorkflowTemplate[]): this;
|
|
342
395
|
lookup(triggerKey: string): WorkflowTemplate | undefined;
|
|
343
396
|
list(): WorkflowTemplate[];
|
|
344
397
|
listByCategory(category: string): WorkflowTemplate[];
|
|
345
398
|
listByTag(tag: string): WorkflowTemplate[];
|
|
346
399
|
search(query: string): WorkflowTemplate[];
|
|
347
400
|
categories(): string[];
|
|
401
|
+
/** Remove every template — useful before re-loading from backend. */
|
|
402
|
+
clear(): this;
|
|
348
403
|
}
|
|
349
404
|
|
|
350
405
|
export declare const templateRegistry: TemplateRegistry;
|
|
@@ -364,7 +419,13 @@ export declare interface WorkflowTemplate {
|
|
|
364
419
|
description?: string;
|
|
365
420
|
icon?: ReactNode;
|
|
366
421
|
triggerCategory?: 'event' | 'scheduler' | 'webhook' | string;
|
|
422
|
+
/**
|
|
423
|
+
* Task IDs (descriptor types) that can be inserted into this workflow.
|
|
424
|
+
* `allowedTasks` is accepted as an alias for backend payloads that use
|
|
425
|
+
* that name — TemplateRegistry.register() normalises them.
|
|
426
|
+
*/
|
|
367
427
|
availableTasks?: string[];
|
|
428
|
+
allowedTasks?: string[];
|
|
368
429
|
maxTasks?: number;
|
|
369
430
|
taskLabels?: Record<string, string>;
|
|
370
431
|
fixedNodes?: FixedNode[];
|
package/dist/form.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CqMPyOkL.js"),r=require("./SchemaBuilderDrawer-CiSdfXzJ.js");require("react/jsx-runtime");require("react");require("@mui/material");require("react-icons/md");exports.DynamicFormRenderer=e.DynamicFormRenderer;exports.FF=e.FF;exports.FlowForgeRegistry=e.FlowForgeRegistry;exports.FlowForm=e.FlowForm;exports.FormulaInput=e.FormulaInput;exports.InfiniteSelectField=e.InfiniteSelectField;exports.TablePickerField=e.TablePickerField;exports.VariablePicker=e.VariablePicker;exports.VariablePickerProvider=e.VariablePickerProvider;exports.astHasRefs=e.astHasRefs;exports.astToTokens=e.astToTokens;exports.buildEvaluationPayload=e.buildEvaluationPayload;exports.buildFieldConfig=e.buildFieldConfig;exports.buildFormulaPath=e.buildFormulaPath;exports.buildSelectStyles=e.buildSelectStyles;exports.buildValidationSchema=e.buildValidationSchema;exports.errorTextStyle=e.errorTextStyle;exports.extractLabel=e.extractLabel;exports.fieldRegistry=e.fieldRegistry;exports.hasFormulaTokens=e.hasFormulaTokens;exports.helperTextStyle=e.helperTextStyle;exports.inputStyle=e.inputStyle;exports.isFormula=e.isFormula;exports.parseToAST=e.parseToAST;exports.serializeAST=e.serializeAST;exports.serializeASTAsConfig=e.serializeASTAsConfig;exports.serializeConditionExpressions=e.serializeConditionExpressions;exports.stripFormulaTokens=e.stripFormulaTokens;exports.tokenize=e.tokenize;exports.unwrapFormula=e.unwrapFormula;exports.useVariablePickerContext=e.useVariablePickerContext;exports.wrapFormula=e.wrapFormula;exports.FIELD_TYPE_OPTIONS=r.FIELD_TYPE_OPTIONS;exports.SchemaBuilder=r.SchemaBuilder;exports.SchemaBuilderDrawer=r.SchemaBuilderDrawer;exports.useFlowForm=r.useFlowForm;
|
|
2
2
|
//# sourceMappingURL=form.cjs.map
|
package/dist/form.d.ts
CHANGED
|
@@ -339,6 +339,18 @@ export declare interface FieldDescriptor {
|
|
|
339
339
|
shouldHide?: (ctx: FieldContext) => boolean;
|
|
340
340
|
shouldDisable?: (ctx: FieldContext) => boolean;
|
|
341
341
|
shouldRequire?: (ctx: FieldContext) => boolean;
|
|
342
|
+
/**
|
|
343
|
+
* When true, the field's value is auto-cleared (reset to `defaultValue`,
|
|
344
|
+
* or removed if no default) any time `shouldHide` evaluates to true —
|
|
345
|
+
* including on mount when the saved data has orphan values from a prior
|
|
346
|
+
* configuration. Default: false (values persist while hidden, preserving
|
|
347
|
+
* legacy behavior).
|
|
348
|
+
*
|
|
349
|
+
* Use this on conditional fields where stale data would corrupt the
|
|
350
|
+
* payload (e.g. `template` should be empty when `valueSource !== 'template'`).
|
|
351
|
+
*/
|
|
352
|
+
clearOnHide?: boolean;
|
|
353
|
+
defaultValue?: unknown;
|
|
342
354
|
compute?: (ctx: FieldContext) => unknown;
|
|
343
355
|
transform?: FieldTransform;
|
|
344
356
|
onChange?: (value: unknown, ctx: FieldContext & {
|
package/dist/form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as o, F as t, a as u, b as F, c as m, I as n, T as d, V as p, d as S, e as T, f as c, g as b, h as k, i as y, j as P, k as f, l as x, m as h, n as w, o as g, p as z, q as A, r as I, s as V, t as C, u as D, v as E, w as R, x as v, y as B, z as L, A as O } from "./index-
|
|
2
|
-
import { F as j, S as q, a as H, u as N } from "./SchemaBuilderDrawer-
|
|
1
|
+
import { D as o, F as t, a as u, b as F, c as m, I as n, T as d, V as p, d as S, e as T, f as c, g as b, h as k, i as y, j as P, k as f, l as x, m as h, n as w, o as g, p as z, q as A, r as I, s as V, t as C, u as D, v as E, w as R, x as v, y as B, z as L, A as O } from "./index-B74jTc2b.js";
|
|
2
|
+
import { F as j, S as q, a as H, u as N } from "./SchemaBuilderDrawer-CUzYWGCN.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material";
|