@cratis/components 2.7.0 → 2.7.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/cjs/CommandDialog/CommandStepper.js +23 -15
- package/dist/cjs/CommandDialog/CommandStepper.js.map +1 -1
- package/dist/cjs/CommandDialog/StepperCommandDialog.js +17 -8
- package/dist/cjs/CommandDialog/StepperCommandDialog.js.map +1 -1
- package/dist/cjs/CommandDialog/stepChildren.js +31 -0
- package/dist/cjs/CommandDialog/stepChildren.js.map +1 -0
- package/dist/cjs/DataPage/DataPage.js +54 -10
- package/dist/cjs/DataPage/DataPage.js.map +1 -1
- package/dist/cjs/DataPage/DataPageLayout.js +34 -0
- package/dist/cjs/DataPage/DataPageLayout.js.map +1 -0
- package/dist/cjs/tailwind-utilities.css +3 -0
- package/dist/esm/CommandDialog/CommandStepper.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandStepper.js +23 -15
- package/dist/esm/CommandDialog/CommandStepper.js.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.js +18 -9
- package/dist/esm/CommandDialog/StepperCommandDialog.js.map +1 -1
- package/dist/esm/CommandDialog/stepChildren.d.ts +3 -0
- package/dist/esm/CommandDialog/stepChildren.d.ts.map +1 -0
- package/dist/esm/CommandDialog/stepChildren.js +29 -0
- package/dist/esm/CommandDialog/stepChildren.js.map +1 -0
- package/dist/esm/DataPage/DataPage.d.ts +1 -0
- package/dist/esm/DataPage/DataPage.d.ts.map +1 -1
- package/dist/esm/DataPage/DataPage.js +54 -10
- package/dist/esm/DataPage/DataPage.js.map +1 -1
- package/dist/esm/DataPage/DataPageLayout.d.ts +6 -0
- package/dist/esm/DataPage/DataPageLayout.d.ts.map +1 -0
- package/dist/esm/DataPage/DataPageLayout.js +32 -0
- package/dist/esm/DataPage/DataPageLayout.js.map +1 -0
- package/dist/esm/tailwind-utilities.css +3 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/vite.config.d.ts.map +1 -1
- package/dist/esm/vite.config.js +1 -0
- package/dist/esm/vite.config.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ var stepper = require('primereact/stepper');
|
|
|
6
6
|
var button = require('primereact/button');
|
|
7
7
|
var commands = require('@cratis/arc.react/commands');
|
|
8
8
|
var applyBeforeExecute = require('./applyBeforeExecute.js');
|
|
9
|
+
var stepChildren = require('./stepChildren.js');
|
|
9
10
|
require('./CommandStepper.css');
|
|
10
11
|
|
|
11
12
|
/** Extracts the property name from an accessor function like `c => c.name`. */
|
|
@@ -54,20 +55,27 @@ const processChildren = (nodes) => {
|
|
|
54
55
|
});
|
|
55
56
|
};
|
|
56
57
|
const CommandStepperContent = ({ activeStep, visitedSteps, children, onActiveStepChange, onVisitedStepsChange, onStepErrorsChange, getFieldError, showNavigation = true, showSubmit = true, nextLabel = 'Next', previousLabel = 'Previous', okLabel = 'Submit', isBusy = false, isSubmitting = false, isSubmitDisabled = false, onSubmit, orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, }) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
// The steps that actually render. Conditional steps (`{condition && <StepperPanel/>}`)
|
|
59
|
+
// leave falsy children behind, so the count, the per-step validation state and what the
|
|
60
|
+
// Stepper renders are all derived from this one list — they cannot drift apart.
|
|
61
|
+
const steps = React.useMemo(() => stepChildren.getStepPanels(children), [children]);
|
|
62
|
+
const stepCount = steps.length;
|
|
63
|
+
// A conditional step can vanish after the user has advanced past it, which leaves the
|
|
64
|
+
// incoming index pointing at a step that is no longer rendered. Clamp it into the set that
|
|
65
|
+
// is, so the panel shown, the validation state read and the buttons offered all belong to a
|
|
66
|
+
// step that exists.
|
|
67
|
+
const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));
|
|
68
|
+
const isLastStep = currentStep >= stepCount - 1;
|
|
69
|
+
const isFirstStep = currentStep <= 0;
|
|
70
|
+
const stepFieldNames = React.useMemo(() => steps.map((step) => {
|
|
63
71
|
const stepProps = step.props;
|
|
64
72
|
return extractFieldNamesFromNode(stepProps.children);
|
|
65
|
-
}), [
|
|
73
|
+
}), [steps]);
|
|
66
74
|
const stepErrors = React.useMemo(() => stepFieldNames.map(fields => fields.some(fieldName => !!getFieldError?.(fieldName))), [stepFieldNames, getFieldError]);
|
|
67
75
|
React.useEffect(() => {
|
|
68
76
|
onStepErrorsChange?.(stepErrors);
|
|
69
77
|
}, [onStepErrorsChange, stepErrors]);
|
|
70
|
-
const isCurrentStepInvalid = stepErrors[
|
|
78
|
+
const isCurrentStepInvalid = stepErrors[currentStep] ?? false;
|
|
71
79
|
const hasAnyStepErrors = stepErrors.some(hasError => hasError);
|
|
72
80
|
const stepperPt = React.useMemo(() => {
|
|
73
81
|
const userPt = pt;
|
|
@@ -106,26 +114,26 @@ const CommandStepperContent = ({ activeStep, visitedSteps, children, onActiveSte
|
|
|
106
114
|
onChangeStep?.(event);
|
|
107
115
|
const index = event.index;
|
|
108
116
|
if (typeof index === 'number') {
|
|
109
|
-
if (index >
|
|
117
|
+
if (index > currentStep && isCurrentStepInvalid) {
|
|
110
118
|
return;
|
|
111
119
|
}
|
|
112
|
-
if (index >
|
|
113
|
-
onVisitedStepsChange?.(new Set(visitedSteps).add(
|
|
120
|
+
if (index > currentStep) {
|
|
121
|
+
onVisitedStepsChange?.(new Set(visitedSteps).add(currentStep));
|
|
114
122
|
}
|
|
115
123
|
onActiveStepChange?.(index);
|
|
116
124
|
}
|
|
117
125
|
};
|
|
118
126
|
const handlePrevious = () => {
|
|
119
|
-
onActiveStepChange?.(Math.max(0,
|
|
127
|
+
onActiveStepChange?.(Math.max(0, currentStep - 1));
|
|
120
128
|
};
|
|
121
129
|
const handleNext = () => {
|
|
122
130
|
if (isCurrentStepInvalid) {
|
|
123
131
|
return;
|
|
124
132
|
}
|
|
125
|
-
onVisitedStepsChange?.(new Set(visitedSteps).add(
|
|
126
|
-
onActiveStepChange?.(Math.min(stepCount - 1,
|
|
133
|
+
onVisitedStepsChange?.(new Set(visitedSteps).add(currentStep));
|
|
134
|
+
onActiveStepChange?.(Math.min(stepCount - 1, currentStep + 1));
|
|
127
135
|
};
|
|
128
|
-
return (jsxRuntime.jsxs("div", { className: "cratis-command-stepper", children: [jsxRuntime.jsx(stepper.Stepper, { activeStep:
|
|
136
|
+
return (jsxRuntime.jsxs("div", { className: "cratis-command-stepper", children: [jsxRuntime.jsx(stepper.Stepper, { activeStep: currentStep, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: handleChangeStep, start: start, end: end, pt: stepperPt, ptOptions: ptOptions, unstyled: unstyled, children: processChildren(steps) }), showNavigation && (jsxRuntime.jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', gap: '0.75rem' }, children: [!isFirstStep && (jsxRuntime.jsx(button.Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: handlePrevious, disabled: isBusy, outlined: true, style: { width: 'auto' } })), jsxRuntime.jsx("div", { style: { flex: 1 } }), !isLastStep && (jsxRuntime.jsx(button.Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: handleNext, disabled: isBusy || isSubmitting || isCurrentStepInvalid, style: { width: 'auto' } })), isLastStep && showSubmit && (jsxRuntime.jsx(button.Button, { label: okLabel, icon: "pi pi-check", onClick: () => void onSubmit?.(), loading: isSubmitting, disabled: isBusy || isSubmitting || isSubmitDisabled || hasAnyStepErrors, autoFocus: true, style: { width: 'auto' } }))] }))] }));
|
|
129
137
|
};
|
|
130
138
|
const CommandStepperWrapper = ({ children, onStepErrorsChange, showNavigation, showSubmit, nextLabel, previousLabel, okLabel, isBusy, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, onSuccess, onValidationFailure, onFailed, onBeforeExecute, }) => {
|
|
131
139
|
const { getFieldError, isValid: isCommandFormValid, setCommandValues, setCommandResult } = commands.useCommandFormContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandStepper.js","sources":["../../../CommandDialog/CommandStepper.tsx"],"sourcesContent":[null],"names":["_jsx","CommandFormFieldWrapper","useMemo","useEffect","_jsxs","PrimeStepper","Button","useCommandFormContext","useCommandInstance","useState","applyBeforeExecute","CommandForm"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandStepper.js","sources":["../../../CommandDialog/CommandStepper.tsx"],"sourcesContent":[null],"names":["_jsx","CommandFormFieldWrapper","useMemo","getStepPanels","useEffect","_jsxs","PrimeStepper","Button","useCommandFormContext","useCommandInstance","useState","applyBeforeExecute","CommandForm"],"mappings":";;;;;;;;;;;AAiFA;AACA,MAAM,eAAe,GAAG,CAAC,QAA+C,KAAY;IAChF,IAAI,OAAO,QAAQ,KAAK,UAAU;AAAE,QAAA,OAAO,EAAE;AAC7C,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE;IACjC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,8BAA8B,CAAC;AACzD,IAAA,OAAO,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,EAAE;AAChC,CAAC;AAED;AACA,MAAM,yBAAyB,GAAG,CAAC,KAAsB,KAAc;IACnE,MAAM,KAAK,GAAa,EAAE;IAC1B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,KAAI;AACpC,QAAA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;YAAE;AAClC,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAoC;AAC5D,QAAA,IAAK,SAAsC,CAAC,WAAW,KAAK,kBAAkB,EAAE;AAC5E,YAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAA8C;YACvE,MAAM,IAAI,GAAG,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC;AAC9C,Y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ET,QACIA,eAACY,oBAAW,EAAA,EAAA,GAA0B,gBAAgB,EAAA,QAAA,EAClDZ,cAAA,CAAC,qBAAqB,EAAA,EAClB,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,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,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,eAAe,EAAE,eAAe,YAE/B,QAAQ,EAAA,CACW,EAAA,CACd;AAEtB;;;;;"}
|
|
@@ -8,6 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var commands = require('@cratis/arc.react/commands');
|
|
9
9
|
var CommandStepper = require('./CommandStepper.js');
|
|
10
10
|
var applyBeforeExecute = require('./applyBeforeExecute.js');
|
|
11
|
+
var stepChildren = require('./stepChildren.js');
|
|
11
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
14
|
const { setCommandValues, setCommandResult, isValid: isCommandFormValid, getFieldError } = commands.useCommandFormContext();
|
|
@@ -27,11 +28,19 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
|
|
|
27
28
|
catch {
|
|
28
29
|
contextCloseDialog = undefined;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Only the steps that actually render count. That count is not fixed: a conditional step
|
|
32
|
+
// (`{condition && <StepperPanel/>}`) can disappear after the user has already advanced past
|
|
33
|
+
// it — a late-resolving query or a `currentValues` overlay flipping the condition is enough.
|
|
34
|
+
// The step the wizard is on is therefore clamped into the set that still renders, and the
|
|
35
|
+
// last/first tests are inequalities, so an index left stranded above the end still resolves
|
|
36
|
+
// to the last surviving step instead of a step that is neither last nor navigable. Same
|
|
37
|
+
// shape as CommandStepperContent, which this dialog's body is.
|
|
38
|
+
const stepCount = stepChildren.getStepPanels(children).length;
|
|
39
|
+
const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));
|
|
40
|
+
const isLastStep = currentStep >= stepCount - 1;
|
|
41
|
+
const isFirstStep = currentStep <= 0;
|
|
33
42
|
const isDialogValid = isValid !== false && isCommandFormValid;
|
|
34
|
-
const isCurrentStepInvalid = stepErrors[
|
|
43
|
+
const isCurrentStepInvalid = stepErrors[currentStep] ?? false;
|
|
35
44
|
const handleClose = async (result) => {
|
|
36
45
|
let shouldCloseThroughContext = true;
|
|
37
46
|
if (result === dialogs.DialogResult.Ok || result === dialogs.DialogResult.Yes) {
|
|
@@ -85,11 +94,11 @@ const StepperCommandDialogWrapper = ({ title, visible = true, width = '600px', s
|
|
|
85
94
|
await handleClose(dialogs.DialogResult.Ok);
|
|
86
95
|
};
|
|
87
96
|
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 }) }));
|
|
88
|
-
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(
|
|
89
|
-
setVisitedSteps(prev => new Set(prev).add(
|
|
90
|
-
setActiveStep(
|
|
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: () => {
|
|
98
|
+
setVisitedSteps(prev => new Set(prev).add(currentStep));
|
|
99
|
+
setActiveStep(Math.min(stepCount - 1, currentStep + 1));
|
|
91
100
|
}, disabled: isBusy || isCurrentStepInvalid })), isLastStep && isDialogValid && (jsxRuntime.jsx(button.Button, { label: okLabel, icon: "pi pi-check", onClick: handleSubmit, loading: isBusy, disabled: isBusy, autoFocus: true }))] }));
|
|
92
|
-
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:
|
|
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 }) }));
|
|
93
102
|
};
|
|
94
103
|
/**
|
|
95
104
|
* A multi-step wizard dialog backed by a single Cratis Arc command. Wraps
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StepperCommandDialog.js","sources":["../../../CommandDialog/StepperCommandDialog.tsx"],"sourcesContent":[null],"names":["useCommandFormContext","useCommandInstance","useState","useDialogContext","DialogResult","applyBeforeExecute","_jsx","_jsxs","Button","PrimeDialog","CommandStepperContent","CommandForm"],"mappings":"
|
|
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,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,GAAGA,8BAAqB,EAAY;AAC5H,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,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;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
6
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
7
|
+
/**
|
|
8
|
+
* Gets the step panels a stepper will actually render, in render order.
|
|
9
|
+
*
|
|
10
|
+
* A conditional step is written as `{condition && <StepperPanel/>}` — which yields
|
|
11
|
+
* `false` when the condition does not hold — and explicit `null` / `undefined` children
|
|
12
|
+
* are just as common. `React.Children.count` counts those, so anything deriving a step
|
|
13
|
+
* count from it believes the wizard has more steps than it renders: navigation runs past
|
|
14
|
+
* the last real panel and the per-step validation gate reads off the end of its array.
|
|
15
|
+
*
|
|
16
|
+
* `React.Children.toArray` already drops `null`, `undefined` and booleans; filtering to
|
|
17
|
+
* valid elements additionally drops bare text children, which are not steps either.
|
|
18
|
+
*
|
|
19
|
+
* Fragments are deliberately **not** flattened — a `<>…</>` wrapping several panels stays
|
|
20
|
+
* one entry, which is the behavior the stepper has always had. Supporting fragments as a
|
|
21
|
+
* container for multiple steps is a separate, additive change.
|
|
22
|
+
*
|
|
23
|
+
* @param children - The stepper children to inspect.
|
|
24
|
+
* @returns The child elements that render as steps.
|
|
25
|
+
*/
|
|
26
|
+
function getStepPanels(children) {
|
|
27
|
+
return React.Children.toArray(children).filter((child) => React.isValidElement(child));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.getStepPanels = getStepPanels;
|
|
31
|
+
//# sourceMappingURL=stepChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepChildren.js","sources":["../../../CommandDialog/stepChildren.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;AACA;AAIA;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,aAAa,CAAC,QAAyB,EAAA;IACnD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAkC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AACvH;;;;"}
|
|
@@ -8,16 +8,37 @@ var queries = require('@cratis/arc/queries');
|
|
|
8
8
|
var DataTableForObservableQuery = require('../DataTables/DataTableForObservableQuery.js');
|
|
9
9
|
var DataTableForQuery = require('../DataTables/DataTableForQuery.js');
|
|
10
10
|
var allotment = require('allotment');
|
|
11
|
+
var DataPageLayout = require('./DataPageLayout.js');
|
|
12
|
+
require('allotment/dist/style.css');
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Declarative menu item for use inside `<DataPage.MenuItems>`. Renders nothing
|
|
14
16
|
* directly; the surrounding {@link MenuItems} component reads its props and
|
|
15
17
|
* forwards them to the action `Menubar`.
|
|
16
18
|
*/
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
19
|
const MenuItem = (_) => {
|
|
19
20
|
return null;
|
|
20
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* The action bar is an intrinsically sized item in the page's layout column —
|
|
24
|
+
* it takes the height its menubar needs and never gives any of it up, so the
|
|
25
|
+
* table region below it is the only part that has to adapt to the space left.
|
|
26
|
+
*/
|
|
27
|
+
const actionsStyle = { flexShrink: 0 };
|
|
28
|
+
/**
|
|
29
|
+
* The table region takes every pixel the action bar leaves and no more.
|
|
30
|
+
* `minHeight: 0` is the load-bearing half: without it the region's automatic
|
|
31
|
+
* minimum keeps it at content height, the column grows past the page, and the
|
|
32
|
+
* table's paginator ends up below the clipped edge.
|
|
33
|
+
*/
|
|
34
|
+
const tableRegionStyle = { flexGrow: 1, flexBasis: 0, minHeight: 0 };
|
|
35
|
+
/**
|
|
36
|
+
* The floor a `DataPage` falls back to when its ancestors give it no height at
|
|
37
|
+
* all. A page that renders as an empty sliver is indistinguishable from a
|
|
38
|
+
* broken one, so a contract-violating consumer gets a small but usable page
|
|
39
|
+
* instead of nothing.
|
|
40
|
+
*/
|
|
41
|
+
const pageStyle = { minHeight: '20rem' };
|
|
21
42
|
/**
|
|
22
43
|
* Renders an action `Menubar` at the top of a {@link DataPage}, populated from
|
|
23
44
|
* `<DataPage.MenuItem>` children. Each menu item's `disableOnUnselected` flag
|
|
@@ -43,7 +64,7 @@ const MenuItems = ({ children }) => {
|
|
|
43
64
|
});
|
|
44
65
|
return menuItems;
|
|
45
66
|
}, [children, context.selectedItem]);
|
|
46
|
-
return (jsxRuntime.jsx("div", { className: "px-4 py-2", children: jsxRuntime.jsx(menubar.Menubar, { "aria-label": "Actions", model: items, className: context.menubarClassName, pt: context.menubarPt, ptOptions: context.menubarPtOptions, unstyled: context.menubarUnstyled }) }));
|
|
67
|
+
return (jsxRuntime.jsx("div", { className: "cratis-data-page-actions px-4 py-2", style: actionsStyle, children: jsxRuntime.jsx(menubar.Menubar, { "aria-label": "Actions", model: items, className: context.menubarClassName, pt: context.menubarPt, ptOptions: context.menubarPtOptions, unstyled: context.menubarUnstyled }) }));
|
|
47
68
|
};
|
|
48
69
|
/**
|
|
49
70
|
* Renders the data table at the body of a {@link DataPage}. Automatically
|
|
@@ -56,12 +77,10 @@ const MenuItems = ({ children }) => {
|
|
|
56
77
|
*/
|
|
57
78
|
const Columns = ({ children }) => {
|
|
58
79
|
const context = useDataPageContext();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return (jsxRuntime.jsx(DataTableForObservableQuery.DataTableForObservableQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children }));
|
|
64
|
-
}
|
|
80
|
+
const isSnapshotQuery = context.query.prototype instanceof queries.QueryFor;
|
|
81
|
+
return (jsxRuntime.jsx("div", { className: "cratis-data-page-table", style: tableRegionStyle, children: isSnapshotQuery
|
|
82
|
+
? jsxRuntime.jsx(DataTableForQuery.DataTableForQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children })
|
|
83
|
+
: jsxRuntime.jsx(DataTableForObservableQuery.DataTableForObservableQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children }) }));
|
|
65
84
|
};
|
|
66
85
|
const DataPageContext = React.createContext(null);
|
|
67
86
|
function useDataPageContext() {
|
|
@@ -140,6 +159,29 @@ function useDataPageContext() {
|
|
|
140
159
|
* </DataPage>
|
|
141
160
|
* ```
|
|
142
161
|
*
|
|
162
|
+
* ## Height — `DataPage` needs a bounded ancestor
|
|
163
|
+
*
|
|
164
|
+
* `DataPage` fills the height it is given and divides it between the action
|
|
165
|
+
* bar and the table region, so the table's paginator always sits at the
|
|
166
|
+
* bottom of the page rather than below its edge. It cannot invent that height:
|
|
167
|
+
* every element from the page root down sizes as a percentage of its parent,
|
|
168
|
+
* so **some ancestor has to have a definite height**.
|
|
169
|
+
*
|
|
170
|
+
* ```tsx
|
|
171
|
+
* // ✅ the router outlet, a sized container, or a flex child with min-height
|
|
172
|
+
* <div style={{ height: '100vh' }}>
|
|
173
|
+
* <DataPage … />
|
|
174
|
+
* </div>
|
|
175
|
+
*
|
|
176
|
+
* // ❌ nothing above resolves to a height — the table grows to its content
|
|
177
|
+
* <div>
|
|
178
|
+
* <DataPage … />
|
|
179
|
+
* </div>
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* Without one, the page falls back to a small fixed height so it stays
|
|
183
|
+
* usable instead of collapsing to nothing.
|
|
184
|
+
*
|
|
143
185
|
* ## Styling
|
|
144
186
|
*
|
|
145
187
|
* The inner DataTable and Menubar each have their own per-slot props:
|
|
@@ -162,8 +204,10 @@ const DataPage = (props) => {
|
|
|
162
204
|
}
|
|
163
205
|
};
|
|
164
206
|
const context = { ...props, selectedItem, onSelectionChanged: selectionChanged };
|
|
165
|
-
return (jsxRuntime.jsx(DataPageContext.Provider, { value: context, children: jsxRuntime.jsx(Page.Page, { title: props.title, panel: true,
|
|
166
|
-
|
|
207
|
+
return (jsxRuntime.jsx(DataPageContext.Provider, { value: context, children: jsxRuntime.jsx(Page.Page, { title: props.title, panel: true, style: pageStyle, children: props.detailsComponent
|
|
208
|
+
? jsxRuntime.jsxs(allotment.Allotment, { className: "h-full", proportionalLayout: false, children: [jsxRuntime.jsx(allotment.Allotment.Pane, { children: jsxRuntime.jsx(DataPageLayout.DataPageLayout, { children: props.children }) }), selectedItem &&
|
|
209
|
+
jsxRuntime.jsx(allotment.Allotment.Pane, { preferredSize: "450px", children: jsxRuntime.jsx(props.detailsComponent, { item: selectedItem, onRefresh: props.onRefresh }) })] })
|
|
210
|
+
: jsxRuntime.jsx(DataPageLayout.DataPageLayout, { children: props.children }) }) }));
|
|
167
211
|
};
|
|
168
212
|
DataPage.MenuItems = MenuItems;
|
|
169
213
|
DataPage.Columns = Columns;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataPage.js","sources":["../../../DataPage/DataPage.tsx"],"sourcesContent":[null],"names":["useMemo","_jsx","Menubar","QueryFor","DataTableForQuery","DataTableForObservableQuery","Page","_jsxs","Allotment"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataPage.js","sources":["../../../DataPage/DataPage.tsx"],"sourcesContent":[null],"names":["useMemo","_jsx","Menubar","QueryFor","DataTableForQuery","DataTableForObservableQuery","Page","_j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KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAA,QAAA,EAClD,KAAK,CAAC;kBACDC,eAAA,CAACC,mBAAS,EAAA,EAAC,SAAS,EAAC,QAAQ,EAAC,kBAAkB,EAAE,KAAK,EAAA,QAAA,EAAA,CACrDP,cAAA,CAACO,mBAAS,CAAC,IAAI,EAAA,EAAA,QAAA,EACXP,cAAA,CAACQ,6BAAc,EAAA,EAAA,QAAA,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAkB,EAAA,CACpC,EAChB,YAAY;4BACTR,cAAA,CAACO,mBAAS,CAAC,IAAI,EAAA,EAAC,aAAa,EAAC,OAAO,EAAA,QAAA,EACjCP,cAAA,CAAC,KAAK,CAAC,gBAAgB,IAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAA,CAAI,EAAA,CAC7D,CAAA,EAAA;kBAGvBA,cAAA,CAACQ,6BAAc,EAAA,EAAA,QAAA,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAkB,EAAA,CACpD,EAAA,CACgB;AAEnC;AAEA,QAAQ,CAAC,SAAS,GAAG,SAAS;AAC9B,QAAQ,CAAC,OAAO,GAAG,OAAO;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The layout root's own style. Declared inline rather than in a stylesheet on
|
|
7
|
+
* purpose: a consumer that never imports a stylesheet from this package still
|
|
8
|
+
* has to get a working page out of `DataPage`, and the height allocation is
|
|
9
|
+
* what the whole component depends on.
|
|
10
|
+
*
|
|
11
|
+
* `minHeight: 0` is what lets the column shrink inside the flex parent that
|
|
12
|
+
* `Page` renders — without it the default `min-height: auto` keeps the column
|
|
13
|
+
* at content height and everything below the available space is clipped.
|
|
14
|
+
*/
|
|
15
|
+
const layoutStyle = {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexDirection: 'column',
|
|
18
|
+
height: '100%',
|
|
19
|
+
minHeight: 0
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* The vertical layout inside a `DataPage`'s primary pane.
|
|
23
|
+
*
|
|
24
|
+
* It is a definite-height flex column, so the action bar can be an intrinsic
|
|
25
|
+
* item while the table region absorbs whatever height is left. That is what
|
|
26
|
+
* keeps the table's own paginator inside the page instead of pushing it past
|
|
27
|
+
* the bottom edge, where the surrounding `overflow: hidden` clips it away.
|
|
28
|
+
*
|
|
29
|
+
* @param props - {@link DataPageLayoutProps}.
|
|
30
|
+
*/
|
|
31
|
+
const DataPageLayout = ({ children }) => (jsxRuntime.jsx("div", { className: 'cratis-data-page-layout', style: layoutStyle, children: children }));
|
|
32
|
+
|
|
33
|
+
exports.DataPageLayout = DataPageLayout;
|
|
34
|
+
//# sourceMappingURL=DataPageLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataPageLayout.js","sources":["../../../DataPage/DataPageLayout.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAaA;;;;;;;;;AASG;AACH,MAAM,WAAW,GAAkB;AAC/B,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,SAAS,EAAE;CACd;AAED;;;;;;;;;AASG;AACI,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAuB,MAC5DA,wBAAK,SAAS,EAAC,yBAAyB,EAAC,KAAK,EAAE,WAAW,EAAA,QAAA,EACtD,QAAQ,EAAA,CACP;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandStepper.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandStepper.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAA2B,KAAK,YAA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AE,MAAM,CAAC;IAEnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,MAAM,EAAE,SAAS,GAAG,MAAM,CAC5E,SAAQ,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAC/E,IAAI,CAAC,0BAA0B,EAAE,YAAY,GAAG,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,eAAe,GAAG,cAAc,GAAG,kBAAkB,GAAG,UAAU,CAAC;IAaxL,eAAe,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAElD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B;AAmDD,eAAO,MAAM,qBAAqB,GAAI,+TA0BnC,0BAA0B,sBA8J5B,CAAC;AAmKF,eAAO,MAAM,cAAc,GAAI,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,SAAS,GAAG,MAAM,EAC/E,OAAO,mBAAmB,CAAC,QAAQ,EAAE,SAAS,CAAC,sBAoDlD,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { Stepper } from 'primereact/stepper';
|
|
|
4
4
|
import { Button } from 'primereact/button';
|
|
5
5
|
import { CommandForm, useCommandFormContext, useCommandInstance, CommandFormFieldWrapper } from '@cratis/arc.react/commands';
|
|
6
6
|
import { applyBeforeExecute } from './applyBeforeExecute.js';
|
|
7
|
+
import { getStepPanels } from './stepChildren.js';
|
|
7
8
|
import './CommandStepper.css';
|
|
8
9
|
|
|
9
10
|
/** Extracts the property name from an accessor function like `c => c.name`. */
|
|
@@ -52,20 +53,27 @@ const processChildren = (nodes) => {
|
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
55
|
const CommandStepperContent = ({ activeStep, visitedSteps, children, onActiveStepChange, onVisitedStepsChange, onStepErrorsChange, getFieldError, showNavigation = true, showSubmit = true, nextLabel = 'Next', previousLabel = 'Previous', okLabel = 'Submit', isBusy = false, isSubmitting = false, isSubmitDisabled = false, onSubmit, orientation = 'horizontal', headerPosition, linear = true, onChangeStep, start, end, pt, ptOptions, unstyled, }) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
// The steps that actually render. Conditional steps (`{condition && <StepperPanel/>}`)
|
|
57
|
+
// leave falsy children behind, so the count, the per-step validation state and what the
|
|
58
|
+
// Stepper renders are all derived from this one list — they cannot drift apart.
|
|
59
|
+
const steps = useMemo(() => getStepPanels(children), [children]);
|
|
60
|
+
const stepCount = steps.length;
|
|
61
|
+
// A conditional step can vanish after the user has advanced past it, which leaves the
|
|
62
|
+
// incoming index pointing at a step that is no longer rendered. Clamp it into the set that
|
|
63
|
+
// is, so the panel shown, the validation state read and the buttons offered all belong to a
|
|
64
|
+
// step that exists.
|
|
65
|
+
const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));
|
|
66
|
+
const isLastStep = currentStep >= stepCount - 1;
|
|
67
|
+
const isFirstStep = currentStep <= 0;
|
|
68
|
+
const stepFieldNames = useMemo(() => steps.map((step) => {
|
|
61
69
|
const stepProps = step.props;
|
|
62
70
|
return extractFieldNamesFromNode(stepProps.children);
|
|
63
|
-
}), [
|
|
71
|
+
}), [steps]);
|
|
64
72
|
const stepErrors = useMemo(() => stepFieldNames.map(fields => fields.some(fieldName => !!getFieldError?.(fieldName))), [stepFieldNames, getFieldError]);
|
|
65
73
|
useEffect(() => {
|
|
66
74
|
onStepErrorsChange?.(stepErrors);
|
|
67
75
|
}, [onStepErrorsChange, stepErrors]);
|
|
68
|
-
const isCurrentStepInvalid = stepErrors[
|
|
76
|
+
const isCurrentStepInvalid = stepErrors[currentStep] ?? false;
|
|
69
77
|
const hasAnyStepErrors = stepErrors.some(hasError => hasError);
|
|
70
78
|
const stepperPt = useMemo(() => {
|
|
71
79
|
const userPt = pt;
|
|
@@ -104,26 +112,26 @@ const CommandStepperContent = ({ activeStep, visitedSteps, children, onActiveSte
|
|
|
104
112
|
onChangeStep?.(event);
|
|
105
113
|
const index = event.index;
|
|
106
114
|
if (typeof index === 'number') {
|
|
107
|
-
if (index >
|
|
115
|
+
if (index > currentStep && isCurrentStepInvalid) {
|
|
108
116
|
return;
|
|
109
117
|
}
|
|
110
|
-
if (index >
|
|
111
|
-
onVisitedStepsChange?.(new Set(visitedSteps).add(
|
|
118
|
+
if (index > currentStep) {
|
|
119
|
+
onVisitedStepsChange?.(new Set(visitedSteps).add(currentStep));
|
|
112
120
|
}
|
|
113
121
|
onActiveStepChange?.(index);
|
|
114
122
|
}
|
|
115
123
|
};
|
|
116
124
|
const handlePrevious = () => {
|
|
117
|
-
onActiveStepChange?.(Math.max(0,
|
|
125
|
+
onActiveStepChange?.(Math.max(0, currentStep - 1));
|
|
118
126
|
};
|
|
119
127
|
const handleNext = () => {
|
|
120
128
|
if (isCurrentStepInvalid) {
|
|
121
129
|
return;
|
|
122
130
|
}
|
|
123
|
-
onVisitedStepsChange?.(new Set(visitedSteps).add(
|
|
124
|
-
onActiveStepChange?.(Math.min(stepCount - 1,
|
|
131
|
+
onVisitedStepsChange?.(new Set(visitedSteps).add(currentStep));
|
|
132
|
+
onActiveStepChange?.(Math.min(stepCount - 1, currentStep + 1));
|
|
125
133
|
};
|
|
126
|
-
return (jsxs("div", { className: "cratis-command-stepper", children: [jsx(Stepper, { activeStep:
|
|
134
|
+
return (jsxs("div", { className: "cratis-command-stepper", children: [jsx(Stepper, { activeStep: currentStep, linear: linear, orientation: orientation, headerPosition: headerPosition, onChangeStep: handleChangeStep, start: start, end: end, pt: stepperPt, ptOptions: ptOptions, unstyled: unstyled, children: processChildren(steps) }), showNavigation && (jsxs("div", { style: { display: 'flex', alignItems: 'center', width: '100%', gap: '0.75rem' }, children: [!isFirstStep && (jsx(Button, { label: previousLabel, icon: "pi pi-arrow-left", onClick: handlePrevious, disabled: isBusy, outlined: true, style: { width: 'auto' } })), jsx("div", { style: { flex: 1 } }), !isLastStep && (jsx(Button, { label: nextLabel, icon: "pi pi-arrow-right", iconPos: "right", onClick: handleNext, disabled: isBusy || isSubmitting || isCurrentStepInvalid, style: { width: 'auto' } })), isLastStep && showSubmit && (jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: () => void onSubmit?.(), loading: isSubmitting, disabled: isBusy || isSubmitting || isSubmitDisabled || hasAnyStepErrors, autoFocus: true, style: { width: 'auto' } }))] }))] }));
|
|
127
135
|
};
|
|
128
136
|
const CommandStepperWrapper = ({ children, onStepErrorsChange, showNavigation, showSubmit, nextLabel, previousLabel, okLabel, isBusy, orientation, headerPosition, linear, onChangeStep, start, end, pt, ptOptions, unstyled, onSuccess, onValidationFailure, onFailed, onBeforeExecute, }) => {
|
|
129
137
|
const { getFieldError, isValid: isCommandFormValid, setCommandValues, setCommandResult } = useCommandFormContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandStepper.js","sources":["../../../CommandDialog/CommandStepper.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeStepper"],"mappings":"
|
|
1
|
+
{"version":3,"file":"CommandStepper.js","sources":["../../../CommandDialog/CommandStepper.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","PrimeStepper"],"mappings":";;;;;;;;;AAiFA;AACA,MAAM,eAAe,GAAG,CAAC,QAA+C,KAAY;IAChF,IAAI,OAAO,QAAQ,KAAK,UAAU;AAAE,QAAA,OAAO,EAAE;AAC7C,IAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,EAAE;IACjC,MAAM,KAAK,GAA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
@@ -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;
|
|
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,WAAW,yBAAyB,CAAC,QAAQ,SAAS,MAAM,EAAE,SAAS,GAAG,MAAM,CAClF,SAAQ,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAC/E,yBAAyB;IAa7B,eAAe,CAAC,EAAE,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IAElD,KAAK,EAAE,MAA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