@cratis/components 2.7.2 → 2.8.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.
@@ -10,7 +10,7 @@ var CommandStepper = require('./CommandStepper.js');
10
10
  var applyBeforeExecute = require('./applyBeforeExecute.js');
11
11
  var stepChildren = require('./stepChildren.js');
12
12
 
13
- const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onBeforeExecute, okLabel = 'Submit', nextLabel = 'Next', previousLabel = 'Previous', orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children }) => {
13
+ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onBeforeExecute, okLabel = 'Submit', nextLabel = 'Next', previousLabel = 'Previous', showCancel = false, cancelLabel = 'Cancel', orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children }) => {
14
14
  const { setCommandValues, setCommandResult, isValid: isCommandFormValid, getFieldError } = commands.useCommandFormContext();
15
15
  const commandInstance = commands.useCommandInstance();
16
16
  const [isBusy, setIsBusy] = React.useState(false);
@@ -67,14 +67,21 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
67
67
  contextCloseDialog?.(result);
68
68
  }
69
69
  };
70
+ // Busy is set before anything is awaited, not just around execute(). `onBeforeExecute` may be
71
+ // async, and from the moment Submit is pressed the dialog is committed to running the command -
72
+ // so every dismissal has to be withdrawn for the whole window, not only for the part of it the
73
+ // request is in flight. Setting it after the transform would leave Cancel live while the command
74
+ // is already on its way: the operator cancels, the dialog closes reporting cancellation, the
75
+ // transform resolves, and the command executes anyway. The `finally` is what releases it, so the
76
+ // flag is cleared on the failure paths and on a transform that throws just as it is on success.
70
77
  const handleSubmit = async () => {
71
- if (onBeforeExecute) {
72
- const applied = applyBeforeExecute.applyBeforeExecute(onBeforeExecute, commandInstance);
73
- setCommandValues(applied instanceof Promise ? await applied : applied);
74
- }
75
78
  setIsBusy(true);
76
79
  let result;
77
80
  try {
81
+ if (onBeforeExecute) {
82
+ const applied = applyBeforeExecute.applyBeforeExecute(onBeforeExecute, commandInstance);
83
+ setCommandValues(applied instanceof Promise ? await applied : applied);
84
+ }
78
85
  result = await commandInstance.execute();
79
86
  }
80
87
  finally {
@@ -94,11 +101,15 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
94
101
  await handleClose(dialogs.DialogResult.Ok);
95
102
  };
96
103
  const headerElement = (jsxRuntime.jsx("div", { className: "inline-flex items-center justify-center gap-2", children: jsxRuntime.jsx("span", { className: "font-bold whitespace-nowrap", children: title }) }));
97
- const footer = (jsxRuntime.jsxs("div", { className: "flex items-center w-full gap-3", children: [!isFirstStep && (jsxRuntime.jsx(button.Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: () => setActiveStep(Math.max(0, currentStep - 1)), disabled: isBusy, outlined: true })), jsxRuntime.jsx("div", { className: "flex-1" }), !isLastStep && (jsxRuntime.jsx(button.Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: () => {
104
+ const footer = (jsxRuntime.jsxs("div", { className: "flex items-center w-full gap-3", children: [showCancel && (jsxRuntime.jsx(button.Button, { label: cancelLabel, icon: "pi pi-times", onClick: () => handleClose(dialogs.DialogResult.Cancelled), disabled: isBusy, outlined: true })), !isFirstStep && (jsxRuntime.jsx(button.Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: () => setActiveStep(Math.max(0, currentStep - 1)), disabled: isBusy, outlined: true })), jsxRuntime.jsx("div", { className: "flex-1" }), !isLastStep && (jsxRuntime.jsx(button.Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: () => {
98
105
  setVisitedSteps(prev => new Set(prev).add(currentStep));
99
106
  setActiveStep(Math.min(stepCount - 1, currentStep + 1));
100
107
  }, disabled: isBusy || isCurrentStepInvalid })), isLastStep && isDialogValid && (jsxRuntime.jsx(button.Button, { label: okLabel, icon: "pi pi-check", onClick: handleSubmit, loading: isBusy, disabled: isBusy, autoFocus: true }))] }));
101
- return (jsxRuntime.jsx(dialog.Dialog, { header: headerElement, modal: true, footer: footer, onHide: () => handleClose(dialogs.DialogResult.Cancelled), visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: true, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsxRuntime.jsx(CommandStepper.CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
108
+ // The header X and the Escape key are withdrawn on the same flag as the footer Cancel. A
109
+ // dismissal that still worked mid-flight would close the dialog and then let onSuccess fire on a
110
+ // dialog that is already gone. PrimeReact gates Escape behind `closable` too, so `closeOnEscape`
111
+ // is stated rather than load-bearing - it keeps the Escape path guarded on its own terms.
112
+ return (jsxRuntime.jsx(dialog.Dialog, { header: headerElement, modal: true, footer: footer, onHide: () => handleClose(dialogs.DialogResult.Cancelled), visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: !isBusy, closeOnEscape: !isBusy, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsxRuntime.jsx(CommandStepper.CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
102
113
  };
103
114
  /**
104
115
  * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps
@@ -187,8 +198,8 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
187
198
  * @param props - {@link StepperCommandDialogProps}.
188
199
  */
189
200
  const StepperCommandDialogComponent = (props) => {
190
- const { title, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, okLabel, nextLabel, previousLabel, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
191
- return (jsxRuntime.jsx(commands.CommandForm, { ...commandFormProps, children: jsxRuntime.jsx(StepperCommandDialogWrapper, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onBeforeExecute: onBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, orientation: orientation, headerPosition: headerPosition, linear: linear, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
201
+ const { title, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, okLabel, nextLabel, previousLabel, showCancel, cancelLabel, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
202
+ return (jsxRuntime.jsx(commands.CommandForm, { ...commandFormProps, children: jsxRuntime.jsx(StepperCommandDialogWrapper, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onBeforeExecute: onBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, showCancel: showCancel, cancelLabel: cancelLabel, orientation: orientation, headerPosition: headerPosition, linear: linear, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
192
203
  };
193
204
  const StepperCommandDialog = StepperCommandDialogComponent;
194
205
 
@@ -1 +1 @@
1
- {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":[null],"names":["useCommandFormContext","useCommandInstance","useState","useDialogContext","getStepPanels","DialogResult","applyBeforeExecute","_jsx","_jsxs","Button","PrimeDialog","CommandStepperContent","CommandForm"],"mappings":";;;;;;;;;;;;AAwFA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,MAAM,EAClB,aAAa,GAAG,UAAU,EAC1B,WAAW,GAAG,YAAY,EAC1B,cAAc,EACd,MAAM,GAAG,IAAI,EACb,YAAY,EACZ,KAAK,EACL,GAAG,EACH,EAAE,EACF,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EAwBiB,KAAI;AAC7B,IAAA,MAAM,EAAE,gBAAgB,EA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AAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAAA,QAAA,EAE7B,QAAQ,EAAA,CACiB,EAAA,CACpB;AAEtB,CAAC;AAEM,MAAM,oBAAoB,GAAG;;;;"}
1
+ {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":[null],"names":["useCommandFormContext","useCommandInstance","useState","useDialogContext","getStepPanels","DialogResult","applyBeforeExecute","_jsx","_jsxs","Button","PrimeDialog","CommandStepperContent","CommandForm"],"mappings":";;;;;;;;;;;;AAqGA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,MAAM,EAClB,aAAa,GAAG,UAAU,EAC1B,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,QAAQ,EACtB,WAAW,GAAG,YAAY,EAC1B,cAAc,EACd,MAAM,GAAG,IAAI,EACb,YAAY,EACZ,KAAK,EACL,GAAG,EACH,EAAE,EACF,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EA0BiB,KAAI;AAC7B,IAAA,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAGA,8BAAqB,EAAY;AAC5H,IAAA,MAAM,eAAe,GAAGC,2BAAkB,EAAY;IAC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AAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAAA,QAAA,EAE7B,QAAQ,EAAA,CACiB,EAAA,CACpB;AAEtB,CAAC;AAEM,MAAM,oBAAoB,GAAG;;;;"}
@@ -19,6 +19,8 @@ export interface StepperCommandDialogProps<TCommand extends object, TResponse =
19
19
  okLabel?: string;
20
20
  nextLabel?: string;
21
21
  previousLabel?: string;
22
+ showCancel?: boolean;
23
+ cancelLabel?: string;
22
24
  dialogClassName?: string;
23
25
  dialogPt?: PrimeDialogProps['pt'];
24
26
  dialogPtOptions?: PrimeDialogProps['ptOptions'];
@@ -1 +1 @@
1
- {"version":3,"file":"StepperCommandDialog.d.ts","sourceRoot":"","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAyB,KAAK,WAAW,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhG,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAIH,KAAK,gBAAgB,EACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAyB,KAAK,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EAAsB,KAAK,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAetF,MAAM,WAA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EzB,QAAQ,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAElC,eAAe,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAEhD,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAoaD,eAAO,MAAM,oBAAoB,GA/EM,QAAQ,SAAS,MAAM,WAAW,SAAS,kBACvE,yBAAyB,CAAC,QAAQ,EAAE,SAAS,CAAC,sBA8EQ,CAAC"}
@@ -8,7 +8,7 @@ import { CommandStepperContent } from './CommandStepper.js';
8
8
  import { applyBeforeExecute } from './applyBeforeExecute.js';
9
9
  import { getStepPanels } from './stepChildren.js';
10
10
 
11
- const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onBeforeExecute, okLabel = 'Submit', nextLabel = 'Next', previousLabel = 'Previous', orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children }) => {
11
+ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', style, contentStyle, resizable = false, isValid, onClose, onConfirm, onCancel, onSuccess, onValidationFailure, onFailed, onBeforeExecute, okLabel = 'Submit', nextLabel = 'Next', previousLabel = 'Previous', showCancel = false, cancelLabel = 'Cancel', orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children }) => {
12
12
  const { setCommandValues, setCommandResult, isValid: isCommandFormValid, getFieldError } = useCommandFormContext();
13
13
  const commandInstance = useCommandInstance();
14
14
  const [isBusy, setIsBusy] = useState(false);
@@ -65,14 +65,21 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
65
65
  contextCloseDialog?.(result);
66
66
  }
67
67
  };
68
+ // Busy is set before anything is awaited, not just around execute(). `onBeforeExecute` may be
69
+ // async, and from the moment Submit is pressed the dialog is committed to running the command -
70
+ // so every dismissal has to be withdrawn for the whole window, not only for the part of it the
71
+ // request is in flight. Setting it after the transform would leave Cancel live while the command
72
+ // is already on its way: the operator cancels, the dialog closes reporting cancellation, the
73
+ // transform resolves, and the command executes anyway. The `finally` is what releases it, so the
74
+ // flag is cleared on the failure paths and on a transform that throws just as it is on success.
68
75
  const handleSubmit = async () => {
69
- if (onBeforeExecute) {
70
- const applied = applyBeforeExecute(onBeforeExecute, commandInstance);
71
- setCommandValues(applied instanceof Promise ? await applied : applied);
72
- }
73
76
  setIsBusy(true);
74
77
  let result;
75
78
  try {
79
+ if (onBeforeExecute) {
80
+ const applied = applyBeforeExecute(onBeforeExecute, commandInstance);
81
+ setCommandValues(applied instanceof Promise ? await applied : applied);
82
+ }
76
83
  result = await commandInstance.execute();
77
84
  }
78
85
  finally {
@@ -92,11 +99,15 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
92
99
  await handleClose(DialogResult.Ok);
93
100
  };
94
101
  const headerElement = (jsx("div", { className: "inline-flex items-center justify-center gap-2", children: jsx("span", { className: "font-bold whitespace-nowrap", children: title }) }));
95
- const footer = (jsxs("div", { className: "flex items-center w-full gap-3", children: [!isFirstStep && (jsx(Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: () => setActiveStep(Math.max(0, currentStep - 1)), disabled: isBusy, outlined: true })), jsx("div", { className: "flex-1" }), !isLastStep && (jsx(Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: () => {
102
+ const footer = (jsxs("div", { className: "flex items-center w-full gap-3", children: [showCancel && (jsx(Button, { label: cancelLabel, icon: "pi pi-times", onClick: () => handleClose(DialogResult.Cancelled), disabled: isBusy, outlined: true })), !isFirstStep && (jsx(Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: () => setActiveStep(Math.max(0, currentStep - 1)), disabled: isBusy, outlined: true })), jsx("div", { className: "flex-1" }), !isLastStep && (jsx(Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: () => {
96
103
  setVisitedSteps(prev => new Set(prev).add(currentStep));
97
104
  setActiveStep(Math.min(stepCount - 1, currentStep + 1));
98
105
  }, disabled: isBusy || isCurrentStepInvalid })), isLastStep && isDialogValid && (jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: handleSubmit, loading: isBusy, disabled: isBusy, autoFocus: true }))] }));
99
- return (jsx(Dialog, { header: headerElement, modal: true, footer: footer, onHide: () => handleClose(DialogResult.Cancelled), visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: true, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsx(CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
106
+ // The header X and the Escape key are withdrawn on the same flag as the footer Cancel. A
107
+ // dismissal that still worked mid-flight would close the dialog and then let onSuccess fire on a
108
+ // dialog that is already gone. PrimeReact gates Escape behind `closable` too, so `closeOnEscape`
109
+ // is stated rather than load-bearing - it keeps the Escape path guarded on its own terms.
110
+ return (jsx(Dialog, { header: headerElement, modal: true, footer: footer, onHide: () => handleClose(DialogResult.Cancelled), visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: !isBusy, closeOnEscape: !isBusy, className: dialogClassName, pt: dialogPt, ptOptions: dialogPtOptions, unstyled: dialogUnstyled, children: jsx(CommandStepperContent, { activeStep: currentStep, visitedSteps: visitedSteps, getFieldError: getFieldError, onActiveStepChange: setActiveStep, onVisitedStepsChange: setVisitedSteps, onStepErrorsChange: setStepErrors, showNavigation: false, showSubmit: false, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }) }));
100
111
  };
101
112
  /**
102
113
  * A multi-step wizard dialog backed by a single Cratis Arc command. Wraps
@@ -185,8 +196,8 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
185
196
  * @param props - {@link StepperCommandDialogProps}.
186
197
  */
187
198
  const StepperCommandDialogComponent = (props) => {
188
- const { title, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, okLabel, nextLabel, previousLabel, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
189
- return (jsx(CommandForm, { ...commandFormProps, children: jsx(StepperCommandDialogWrapper, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onBeforeExecute: onBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, orientation: orientation, headerPosition: headerPosition, linear: linear, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
199
+ const { title, visible, width, style, contentStyle, resizable, isValid, onClose, onConfirm, onCancel, onBeforeExecute, okLabel, nextLabel, previousLabel, showCancel, cancelLabel, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, dialogClassName, dialogPt, dialogPtOptions, dialogUnstyled, children, ...commandFormProps } = props;
200
+ return (jsx(CommandForm, { ...commandFormProps, children: jsx(StepperCommandDialogWrapper, { title: title, visible: visible, width: width, style: style, contentStyle: contentStyle, resizable: resizable, isValid: isValid, onClose: onClose, onConfirm: onConfirm, onCancel: onCancel, onSuccess: props.onSuccess, onValidationFailure: props.onValidationFailure, onFailed: props.onFailed, onBeforeExecute: onBeforeExecute, okLabel: okLabel, nextLabel: nextLabel, previousLabel: previousLabel, showCancel: showCancel, cancelLabel: cancelLabel, orientation: orientation, headerPosition: headerPosition, linear: linear, onChangeStep: onChangeStep, start: start, end: end, pt: pt, ptOptions: ptOptions, unstyled: unstyled, dialogClassName: dialogClassName, dialogPt: dialogPt, dialogPtOptions: dialogPtOptions, dialogUnstyled: dialogUnstyled, children: children }) }));
190
201
  };
191
202
  const StepperCommandDialog = StepperCommandDialogComponent;
192
203
 
@@ -1 +1 @@
1
- {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeDialog"],"mappings":";;;;;;;;;;AAwFA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,MAAM,EAClB,aAAa,GAAG,UAAU,EAC1B,WAAW,GAAG,YAAY,EAC1B,cAAc,EACd,MAAM,GAAG,IAAI,EACb,YAAY,EACZ,KAAK,EACL,GAAG,EACH,EAAE,EACF,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EAwBiB,KAAI;AAC7B,IAAA,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,qBAAqB,EAAY;AAC5H,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAY;IACtD,MAAM,CAAC,MAAM,E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EAAE,eAAe,EAChC,cAAc,EAAE,cAAc,EAAA,QAAA,EAE7B,QAAQ,EAAA,CACiB,EAAA,CACpB;AAEtB,CAAC;AAEM,MAAM,oBAAoB,GAAG;;;;"}
1
+ {"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeDialog"],"mappings":";;;;;;;;;;AAqGA,MAAM,2BAA2B,GAAG,CAA8C,EAC9E,KAAK,EACL,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,MAAM,EAClB,aAAa,GAAG,UAAU,EAC1B,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,QAAQ,EACtB,WAAW,GAAG,YAAY,EAC1B,cAAc,EACd,MAAM,GAAG,IAAI,EACb,YAAY,EACZ,KAAK,EACL,GAAG,EACH,EAAE,EACF,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EA0BiB,KAAI;AAC7B,IAAA,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAG,qBAAqB,EAAY;AAC5H,IAAA,MAAM,eAAe,GAAG,kBAAkB,EAAY;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC3C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;AAC/C,IAAA,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAc,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,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