@cratis/components 4.42.1 → 4.42.2
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/compat-manifest.json +11 -11
- package/dist/esm/Canvas/Canvas.d.ts.map +1 -1
- package/dist/esm/Canvas/Canvas.js +16 -109
- package/dist/esm/Canvas/Canvas.js.map +1 -1
- package/dist/esm/Canvas/CanvasWorldLayers.d.ts +22 -0
- package/dist/esm/Canvas/CanvasWorldLayers.d.ts.map +1 -0
- package/dist/esm/Canvas/CanvasWorldLayers.js +27 -0
- package/dist/esm/Canvas/CanvasWorldLayers.js.map +1 -0
- package/dist/esm/Canvas/useCanvasSurface.d.ts +57 -0
- package/dist/esm/Canvas/useCanvasSurface.d.ts.map +1 -0
- package/dist/esm/Canvas/useCanvasSurface.js +112 -0
- package/dist/esm/Canvas/useCanvasSurface.js.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperContent.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandStepperContent.js +31 -119
- package/dist/esm/CommandDialog/CommandStepperContent.js.map +1 -1
- package/dist/esm/CommandDialog/CommandStepperList.d.ts +19 -0
- package/dist/esm/CommandDialog/CommandStepperList.d.ts.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperList.js +20 -0
- package/dist/esm/CommandDialog/CommandStepperList.js.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperNavigation.d.ts +20 -0
- package/dist/esm/CommandDialog/CommandStepperNavigation.d.ts.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperNavigation.js +15 -0
- package/dist/esm/CommandDialog/CommandStepperNavigation.js.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperPanels.d.ts +20 -0
- package/dist/esm/CommandDialog/CommandStepperPanels.d.ts.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperPanels.js +9 -0
- package/dist/esm/CommandDialog/CommandStepperPanels.js.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperStepParts.d.ts +23 -0
- package/dist/esm/CommandDialog/CommandStepperStepParts.d.ts.map +1 -0
- package/dist/esm/CommandDialog/CommandStepperStepParts.js +9 -0
- package/dist/esm/CommandDialog/CommandStepperStepParts.js.map +1 -0
- package/dist/esm/CommandDialog/commandStepperFields.d.ts +6 -0
- package/dist/esm/CommandDialog/commandStepperFields.d.ts.map +1 -0
- package/dist/esm/CommandDialog/commandStepperFields.js +54 -0
- package/dist/esm/CommandDialog/commandStepperFields.js.map +1 -0
- package/dist/esm/CommandDialog/joinClassNames.d.ts +3 -0
- package/dist/esm/CommandDialog/joinClassNames.d.ts.map +1 -0
- package/dist/esm/CommandDialog/joinClassNames.js +4 -0
- package/dist/esm/CommandDialog/joinClassNames.js.map +1 -0
- package/dist/esm/CommandDialog/resolveStepperLabels.d.ts +20 -0
- package/dist/esm/CommandDialog/resolveStepperLabels.d.ts.map +1 -0
- package/dist/esm/CommandDialog/resolveStepperLabels.js +8 -0
- package/dist/esm/CommandDialog/resolveStepperLabels.js.map +1 -0
- package/dist/esm/CommandDialog/useStepValidation.d.ts +7 -0
- package/dist/esm/CommandDialog/useStepValidation.d.ts.map +1 -0
- package/dist/esm/CommandDialog/useStepValidation.js +14 -0
- package/dist/esm/CommandDialog/useStepValidation.js.map +1 -0
- package/dist/esm/CommandDialog/useStepperState.d.ts +30 -0
- package/dist/esm/CommandDialog/useStepperState.d.ts.map +1 -0
- package/dist/esm/CommandDialog/useStepperState.js +37 -0
- package/dist/esm/CommandDialog/useStepperState.js.map +1 -0
- package/dist/esm/CommandForm/fields/ChipsField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.js +7 -39
- package/dist/esm/CommandForm/fields/ChipsField.js.map +1 -1
- package/dist/esm/CommandForm/fields/ChipsInput.d.ts +18 -0
- package/dist/esm/CommandForm/fields/ChipsInput.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/ChipsInput.js +12 -0
- package/dist/esm/CommandForm/fields/ChipsInput.js.map +1 -0
- package/dist/esm/CommandForm/fields/ChipsItem.d.ts +14 -0
- package/dist/esm/CommandForm/fields/ChipsItem.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/ChipsItem.js +14 -0
- package/dist/esm/CommandForm/fields/ChipsItem.js.map +1 -0
- package/dist/esm/CommandForm/fields/useChipsDraft.d.ts +19 -0
- package/dist/esm/CommandForm/fields/useChipsDraft.d.ts.map +1 -0
- package/dist/esm/CommandForm/fields/useChipsDraft.js +19 -0
- package/dist/esm/CommandForm/fields/useChipsDraft.js.map +1 -0
- package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.js +1 -44
- package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
- package/dist/esm/Common/legacyLocaleMessages.d.ts +7 -0
- package/dist/esm/Common/legacyLocaleMessages.d.ts.map +1 -0
- package/dist/esm/Common/legacyLocaleMessages.js +43 -0
- package/dist/esm/Common/legacyLocaleMessages.js.map +1 -0
- package/dist/esm/DataTables/DataTableCore.d.ts +1 -1
- package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableCore.js +12 -66
- package/dist/esm/DataTables/DataTableCore.js.map +1 -1
- package/dist/esm/DataTables/DataTableHead.d.ts +23 -0
- package/dist/esm/DataTables/DataTableHead.d.ts.map +1 -0
- package/dist/esm/DataTables/DataTableHead.js +12 -0
- package/dist/esm/DataTables/DataTableHead.js.map +1 -0
- package/dist/esm/DataTables/DataTableRows.d.ts +19 -0
- package/dist/esm/DataTables/DataTableRows.d.ts.map +1 -0
- package/dist/esm/DataTables/DataTableRows.js +7 -0
- package/dist/esm/DataTables/DataTableRows.js.map +1 -0
- package/dist/esm/DataTables/DataTableTable.d.ts +20 -0
- package/dist/esm/DataTables/DataTableTable.d.ts.map +1 -0
- package/dist/esm/DataTables/DataTableTable.js +10 -0
- package/dist/esm/DataTables/DataTableTable.js.map +1 -0
- package/dist/esm/DataTables/useDataTableRows.d.ts +40 -0
- package/dist/esm/DataTables/useDataTableRows.d.ts.map +1 -0
- package/dist/esm/DataTables/useDataTableRows.js +49 -0
- package/dist/esm/DataTables/useDataTableRows.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
2
|
-
import
|
|
3
|
-
import { Button } from '../Common/Button.js';
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useId } from 'react';
|
|
4
3
|
import 'react-aria-components/I18nProvider';
|
|
5
4
|
import 'react-aria-components';
|
|
6
5
|
import 'ts-deepmerge';
|
|
@@ -8,132 +7,45 @@ import 'react-dom';
|
|
|
8
7
|
import { useCratisComponentsConfig } from '../configuration/CratisComponentsContext.js';
|
|
9
8
|
import '../Notifications/toast.js';
|
|
10
9
|
import '../renderer/RendererContext.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { CommandStepperList } from './CommandStepperList.js';
|
|
11
|
+
import { CommandStepperPanels } from './CommandStepperPanels.js';
|
|
12
|
+
import { CommandStepperNavigation } from './CommandStepperNavigation.js';
|
|
13
|
+
import { resolveStepperLabels } from './resolveStepperLabels.js';
|
|
14
|
+
import { useStepperState } from './useStepperState.js';
|
|
15
|
+
import { joinClassNames } from './joinClassNames.js';
|
|
15
16
|
|
|
16
|
-
const getPropertyName = (accessor) => {
|
|
17
|
-
if (typeof accessor !== 'function')
|
|
18
|
-
return '';
|
|
19
|
-
const fnStr = accessor.toString();
|
|
20
|
-
const match = fnStr.match(/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);
|
|
21
|
-
return match ? match[1] : '';
|
|
22
|
-
};
|
|
23
|
-
const extractFieldNamesFromNode = (nodes) => {
|
|
24
|
-
const names = [];
|
|
25
|
-
React.Children.forEach(nodes, (child) => {
|
|
26
|
-
if (!React.isValidElement(child))
|
|
27
|
-
return;
|
|
28
|
-
const component = child.type;
|
|
29
|
-
if (isCommandFormField(component)) {
|
|
30
|
-
const fieldProps = child.props;
|
|
31
|
-
const name = getPropertyName(fieldProps.value);
|
|
32
|
-
if (name)
|
|
33
|
-
names.push(name);
|
|
34
|
-
}
|
|
35
|
-
const childProps = child.props;
|
|
36
|
-
if (childProps.children != null) {
|
|
37
|
-
names.push(...extractFieldNamesFromNode(childProps.children));
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return names;
|
|
41
|
-
};
|
|
42
|
-
const processChildren = (nodes) => {
|
|
43
|
-
return React.Children.map(nodes, (child) => {
|
|
44
|
-
if (!React.isValidElement(child))
|
|
45
|
-
return child;
|
|
46
|
-
const component = child.type;
|
|
47
|
-
if (isCommandFormField(component)) {
|
|
48
|
-
return jsx(CommandFormFieldWrapper, { field: child });
|
|
49
|
-
}
|
|
50
|
-
const childProps = child.props;
|
|
51
|
-
if (childProps.children != null) {
|
|
52
|
-
return React.cloneElement(child, {
|
|
53
|
-
children: processChildren(childProps.children),
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return child;
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
17
|
const CommandStepperContent = ({ activeStep, visitedSteps, children, onActiveStepChange, onVisitedStepsChange, onStepErrorsChange, getFieldError, showNavigation = true, showSubmit = true, nextLabel, previousLabel, okLabel, isBusy = false, isSubmitting = false, disableFieldsWhileSubmitting = false, isSubmitDisabled = false, onSubmit, linear = true, orientation = 'horizontal', headerPosition = 'top', start, end, onChangeStep, pt, }) => {
|
|
60
18
|
const { messages } = useCratisComponentsConfig();
|
|
61
19
|
const stepperId = useId();
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const stepCount = panels.length;
|
|
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 = useMemo(() => panels.map((panel) => extractFieldNamesFromNode(panel.props.children)), [panels]);
|
|
71
|
-
const stepErrors = useMemo(() => stepFieldNames.map((fields) => fields.some((fieldName) => !!getFieldError?.(fieldName))), [stepFieldNames, getFieldError]);
|
|
72
|
-
useEffect(() => {
|
|
73
|
-
onStepErrorsChange?.(stepErrors);
|
|
74
|
-
}, [onStepErrorsChange, stepErrors]);
|
|
75
|
-
const isCurrentStepInvalid = stepErrors[currentStep] ?? false;
|
|
76
|
-
const hasAnyStepErrors = stepErrors.some((hasError) => hasError);
|
|
77
|
-
const changeStep = (index, fromHeader = false) => transitionStep({
|
|
78
|
-
index,
|
|
79
|
-
currentStep,
|
|
80
|
-
stepCount,
|
|
81
|
-
isCurrentStepInvalid,
|
|
82
|
-
linear,
|
|
83
|
-
fromHeader,
|
|
20
|
+
const labels = resolveStepperLabels(messages, { nextLabel, previousLabel, okLabel });
|
|
21
|
+
const { panels, currentStep, isFirstStep, isLastStep, stepErrors, isCurrentStepInvalid, hasAnyStepErrors, changeStep, } = useStepperState({
|
|
22
|
+
children,
|
|
23
|
+
activeStep,
|
|
84
24
|
visitedSteps,
|
|
25
|
+
linear,
|
|
26
|
+
getFieldError,
|
|
27
|
+
onStepErrorsChange,
|
|
85
28
|
onActiveStepChange,
|
|
86
29
|
onVisitedStepsChange,
|
|
87
30
|
onChangeStep,
|
|
88
31
|
});
|
|
89
32
|
const isStepperBusy = isBusy || isSubmitting;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
pt?.number?.className,
|
|
107
|
-
]
|
|
108
|
-
.filter(Boolean)
|
|
109
|
-
.join(' '), style: pt?.number?.style, "data-cratis-part": 'number', "data-part": 'number', "data-busy": isStepperBusy || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, children: index + 1 }), jsx("span", { ...pt?.title, className: [
|
|
110
|
-
'cratis-command-stepper__title',
|
|
111
|
-
pt?.title?.className,
|
|
112
|
-
]
|
|
113
|
-
.filter(Boolean)
|
|
114
|
-
.join(' '), "data-cratis-part": 'title', "data-part": 'title', "data-busy": isStepperBusy || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, children: panel.props.header })] }), index < stepCount - 1 && (jsx("span", { ...pt?.separator, className: [
|
|
115
|
-
'cratis-command-stepper__separator',
|
|
116
|
-
pt?.separator?.className,
|
|
117
|
-
]
|
|
118
|
-
.filter(Boolean)
|
|
119
|
-
.join(' '), "data-cratis-part": 'separator', "data-part": 'separator', "data-busy": isStepperBusy || undefined, "data-invalid": invalid || undefined, "data-visited": visited || undefined, "aria-hidden": 'true' }))] }, index));
|
|
120
|
-
}) }));
|
|
121
|
-
const stepperPanels = (jsx("div", { ...pt?.panels, className: ['cratis-command-stepper__panels', pt?.panels?.className]
|
|
122
|
-
.filter(Boolean)
|
|
123
|
-
.join(' '), "data-cratis-part": 'panels', "data-part": 'panels', "data-busy": isStepperBusy || undefined, "data-invalid": hasAnyStepErrors || undefined, children: panels.map((panel, index) => (jsx("section", { ...pt?.panel, hidden: index !== currentStep, className: ['cratis-command-stepper__panel', pt?.panel?.className]
|
|
124
|
-
.filter(Boolean)
|
|
125
|
-
.join(' '), "data-cratis-part": 'panel', "data-part": 'panel', "data-busy": isStepperBusy || undefined, "data-invalid": stepErrors[index] || undefined, "data-selected": index === currentStep || undefined, "data-visited": visitedSteps.has(index) || undefined, "aria-label": String(panel.props.header ?? `Step ${index + 1}`), "aria-labelledby": pt?.panel?.['aria-labelledby'] ?? (pt?.header?.id == null ? `${stepperId}-step-${index}` : undefined), children: disableFieldsWhileSubmitting ? (jsx("fieldset", { disabled: isSubmitting, inert: isSubmitting, style: { display: 'contents' }, children: processChildren(panel.props.children) })) : processChildren(panel.props.children) }, index))) }));
|
|
126
|
-
return (jsxs("div", { className: `cratis-command-stepper cratis-command-stepper--${orientation}`, "data-orientation": orientation, children: [start, jsx("div", { ...pt?.root, className: ['cratis-command-stepper__root', pt?.root?.className]
|
|
127
|
-
.filter(Boolean)
|
|
128
|
-
.join(' '), "data-cratis-part": 'root', "data-cratis-component": 'CommandStepper', "data-part": 'root', "data-value": currentStep, "data-orientation": orientation, "data-busy": isStepperBusy || undefined, "data-invalid": hasAnyStepErrors || undefined, children: headerPosition === 'bottom' ? (jsxs(Fragment, { children: [stepperPanels, stepperList] })) : (jsxs(Fragment, { children: [stepperList, stepperPanels] })) }), end, showNavigation && (jsxs("div", { style: {
|
|
129
|
-
display: 'flex',
|
|
130
|
-
alignItems: 'center',
|
|
131
|
-
width: '100%',
|
|
132
|
-
gap: '0.75rem',
|
|
133
|
-
}, children: [!isFirstStep && (jsx(Button, { variant: 'outline', onClick: () => changeStep(currentStep - 1), disabled: isBusy, style: { width: 'auto' }, children: jsx("span", { children: resolvedPreviousLabel }) })), jsx("div", { style: { flex: 1 } }), !isLastStep && (jsx(Button, { onClick: () => changeStep(currentStep + 1), disabled: isBusy || isSubmitting || isCurrentStepInvalid, style: { width: 'auto' }, children: jsx("span", { children: resolvedNextLabel }) })), isLastStep && showSubmit && (jsxs(Button, { onClick: () => void onSubmit?.(), disabled: isBusy ||
|
|
134
|
-
isSubmitting ||
|
|
135
|
-
isSubmitDisabled ||
|
|
136
|
-
hasAnyStepErrors, autoFocus: true, style: { width: 'auto' }, children: [isSubmitting && (jsx("span", { className: 'cratis-dialog__spinner', "aria-hidden": 'true' })), jsx("span", { children: resolvedOkLabel })] }))] }))] }));
|
|
33
|
+
const view = {
|
|
34
|
+
panels,
|
|
35
|
+
currentStep,
|
|
36
|
+
visitedSteps,
|
|
37
|
+
stepErrors,
|
|
38
|
+
stepperId,
|
|
39
|
+
isBusy: isStepperBusy,
|
|
40
|
+
hasAnyStepErrors,
|
|
41
|
+
pt,
|
|
42
|
+
};
|
|
43
|
+
const stepperList = (jsx(CommandStepperList, { ...view, linear: linear, onHeaderClick: (index) => changeStep(index, true) }));
|
|
44
|
+
const stepperPanels = (jsx(CommandStepperPanels, { ...view, disableFieldsWhileSubmitting: disableFieldsWhileSubmitting, isSubmitting: isSubmitting }));
|
|
45
|
+
const [first, second] = headerPosition === 'bottom'
|
|
46
|
+
? [stepperPanels, stepperList]
|
|
47
|
+
: [stepperList, stepperPanels];
|
|
48
|
+
return (jsxs("div", { className: `cratis-command-stepper cratis-command-stepper--${orientation}`, "data-orientation": orientation, children: [start, jsxs("div", { ...pt?.root, className: joinClassNames('cratis-command-stepper__root', pt?.root?.className), "data-cratis-part": 'root', "data-cratis-component": 'CommandStepper', "data-part": 'root', "data-value": currentStep, "data-orientation": orientation, "data-busy": isStepperBusy || undefined, "data-invalid": hasAnyStepErrors || undefined, children: [first, second] }), end, showNavigation && (jsx(CommandStepperNavigation, { isFirstStep: isFirstStep, isLastStep: isLastStep, showSubmit: showSubmit, isBusy: isBusy, isSubmitting: isSubmitting, isSubmitDisabled: isSubmitDisabled, isCurrentStepInvalid: isCurrentStepInvalid, hasAnyStepErrors: hasAnyStepErrors, previousLabel: labels.previous, nextLabel: labels.next, okLabel: labels.ok, onPrevious: () => changeStep(currentStep - 1), onNext: () => changeStep(currentStep + 1), onSubmit: onSubmit }))] }));
|
|
137
49
|
};
|
|
138
50
|
|
|
139
51
|
export { CommandStepperContent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandStepperContent.js","sources":["../../../CommandDialog/CommandStepperContent.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useEffect, useId, useMemo } from 'react';\nimport { Button } from '../Common/Button';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport { CommandFormFieldWrapper } from '@cratis/arc.react/commands';\nimport { isCommandFormField } from '../CommandForm/commandFormMarkers';\nimport type { StepperPanelProps } from './StepperPanel';\nimport { getStepPanels } from './stepChildren';\nimport { transitionStep } from './transitionStep';\nimport type { StepperCustomizationProps } from './CommandStepper';\n\n/**\n * Controlled state and validation props for {@link CommandStepperContent}.\n *\n * @remarks\n * `CommandStepperContent` is a private implementation primitive shared by\n * {@link CommandStepper} and `StepperCommandDialog` — it is deliberately not\n * re-exported from the `./CommandStepper` or `./CommandDialog` package\n * subpaths, so this type is documented for maintainers only.\n */\nexport interface CommandStepperContentProps extends StepperCustomizationProps {\n /** The active step index. */\n activeStep: number;\n /** The indices that have been visited. */\n visitedSteps: Set<number>;\n /** StepperPanel children defining each wizard step. */\n children?: React.ReactNode;\n /** Callback for active step changes. */\n onActiveStepChange?: (stepIndex: number) => void;\n /** Callback for visited step changes. */\n onVisitedStepsChange?: (visitedSteps: Set<number>) => void;\n /** Callback that receives validation state for each step. */\n onStepErrorsChange?: (stepErrors: boolean[]) => void;\n /** Provides validation errors for individual fields. */\n getFieldError?: (fieldName: string) => unknown;\n /** Whether to show built-in previous and next buttons. Defaults to `true`. */\n showNavigation?: boolean;\n /** Whether to show built-in submit on the last step. Defaults to `true`. */\n showSubmit?: boolean;\n /** Label for the next step button. Falls back to the provider's `stepper.next` message, then `'Next'`. */\n nextLabel?: string;\n /** Label for the previous step button. Falls back to the provider's `stepper.previous` message, then `'Previous'`. */\n previousLabel?: string;\n /** Label for the submit button. Falls back to the provider's `stepper.submit` message, then `'Submit'`. */\n okLabel?: string;\n /** Whether navigation controls are busy. */\n isBusy?: boolean;\n /** Whether submit is currently executing. */\n isSubmitting?: boolean;\n /** Locks form fields during a guarded submission without changing unguarded forms. */\n disableFieldsWhileSubmitting?: boolean;\n /** Disables submit regardless of current step state. */\n isSubmitDisabled?: boolean;\n /** Submit callback invoked on the last step. */\n onSubmit?: () => void | Promise<void>;\n}\n\n/** Extracts the property name from an accessor function like `c => c.name`. */\nconst getPropertyName = (accessor: ((obj: unknown) => unknown) | unknown): string => {\n if (typeof accessor !== 'function') return '';\n const fnStr = accessor.toString();\n const match = fnStr.match(/\\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);\n return match ? match[1] : '';\n};\n\n/** Recursively collects all CommandFormField property names from a React node tree. */\nconst extractFieldNamesFromNode = (nodes: React.ReactNode): string[] => {\n const names: string[] = [];\n React.Children.forEach(nodes, (child) => {\n if (!React.isValidElement(child)) return;\n const component = child.type as React.ComponentType<unknown>;\n if (isCommandFormField(component)) {\n const fieldProps = child.props as { value?: (obj: unknown) => unknown };\n const name = getPropertyName(fieldProps.value);\n if (name) names.push(name);\n }\n\n const childProps = child.props as Record<string, unknown>;\n if (childProps.children != null) {\n names.push(\n ...extractFieldNamesFromNode(childProps.children as React.ReactNode),\n );\n }\n });\n return names;\n};\n\nconst processChildren = (nodes: React.ReactNode): React.ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n\n const component = child.type as React.ComponentType<unknown>;\n if (isCommandFormField(component)) {\n type FieldElement = Parameters<typeof CommandFormFieldWrapper>[0]['field'];\n // SAFETY: displayName identifies the Arc command field shape before it reaches the wrapper.\n return <CommandFormFieldWrapper field={child as unknown as FieldElement} />;\n }\n\n const childProps = child.props as Record<string, unknown>;\n if (childProps.children != null) {\n return React.cloneElement(\n child as React.ReactElement<Record<string, unknown>>,\n {\n children: processChildren(childProps.children as React.ReactNode),\n },\n );\n }\n\n return child;\n });\n};\n\n/**\n * @internal Renders the visual stepper body — step headers, panels, and the\n * built-in Previous / Next / Submit navigation — without any Arc\n * `CommandForm` wiring. This is a private implementation primitive shared by\n * {@link CommandStepper} and `StepperCommandDialog`; it is intentionally\n * **not** re-exported from the `./CommandStepper` or `./CommandDialog`\n * package subpaths and may change shape without a major version bump.\n */\nexport const CommandStepperContent = ({\n activeStep,\n visitedSteps,\n children,\n onActiveStepChange,\n onVisitedStepsChange,\n onStepErrorsChange,\n getFieldError,\n showNavigation = true,\n showSubmit = true,\n nextLabel,\n previousLabel,\n okLabel,\n isBusy = false,\n isSubmitting = false,\n disableFieldsWhileSubmitting = false,\n isSubmitDisabled = false,\n onSubmit,\n linear = true,\n orientation = 'horizontal',\n headerPosition = 'top',\n start,\n end,\n onChangeStep,\n pt,\n}: CommandStepperContentProps) => {\n const { messages } = useCratisComponentsConfig();\n const stepperId = useId();\n const resolvedNextLabel = nextLabel ?? messages?.stepper?.next ?? 'Next';\n const resolvedPreviousLabel =\n previousLabel ?? messages?.stepper?.previous ?? 'Previous';\n const resolvedOkLabel = okLabel ?? messages?.stepper?.submit ?? 'Submit';\n\n // The steps that actually render. Conditional steps (`{condition && <StepperPanel/>}`)\n // leave falsy children behind, so the count, the per-step validation state and what the\n // Stepper renders are all derived from this one list — they cannot drift apart.\n const panels = useMemo(\n () => getStepPanels(children) as React.ReactElement<StepperPanelProps>[],\n [children],\n );\n const stepCount = panels.length;\n\n // A conditional step can vanish after the user has advanced past it, which leaves the\n // incoming index pointing at a step that is no longer rendered. Clamp it into the set that\n // is, so the panel shown, the validation state read and the buttons offered all belong to a\n // step that exists.\n const currentStep = Math.min(Math.max(activeStep, 0), Math.max(stepCount - 1, 0));\n const isLastStep = currentStep >= stepCount - 1;\n const isFirstStep = currentStep <= 0;\n\n const stepFieldNames = useMemo(\n () => panels.map((panel) => extractFieldNamesFromNode(panel.props.children)),\n [panels],\n );\n\n const stepErrors = useMemo(\n () =>\n stepFieldNames.map((fields) =>\n fields.some((fieldName) => !!getFieldError?.(fieldName)),\n ),\n [stepFieldNames, getFieldError],\n );\n\n useEffect(() => {\n onStepErrorsChange?.(stepErrors);\n }, [onStepErrorsChange, stepErrors]);\n\n const isCurrentStepInvalid = stepErrors[currentStep] ?? false;\n const hasAnyStepErrors = stepErrors.some((hasError) => hasError);\n\n const changeStep = (index: number, fromHeader = false) => transitionStep({\n index,\n currentStep,\n stepCount,\n isCurrentStepInvalid,\n linear,\n fromHeader,\n visitedSteps,\n onActiveStepChange,\n onVisitedStepsChange,\n onChangeStep,\n });\n\n const isStepperBusy = isBusy || isSubmitting;\n\n const stepperList = (\n <ol\n {...pt?.list}\n className={['cratis-command-stepper__list', pt?.list?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='list'\n data-part='list'\n data-busy={isStepperBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {panels.map((panel, index) => {\n const selected = index === currentStep;\n const visited = visitedSteps.has(index);\n const invalid = stepErrors[index] ?? false;\n const headerDisabled = linear && !selected;\n\n return (\n <li\n key={index}\n {...pt?.step}\n className={['cratis-command-stepper__step', pt?.step?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='step'\n data-part='step'\n data-active={selected || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n data-invalid={invalid || undefined}\n data-busy={isStepperBusy || undefined}\n >\n <button\n {...pt?.header}\n type='button'\n id={pt?.header?.id ?? `${stepperId}-step-${index}`}\n className={[\n 'cratis-command-stepper__header',\n pt?.header?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='header'\n data-part='header'\n data-busy={isStepperBusy || undefined}\n data-disabled={headerDisabled || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n disabled={headerDisabled}\n aria-current={selected ? 'step' : undefined}\n onClick={() => changeStep(index, true)}\n >\n <span\n {...pt?.number}\n className={[\n 'cratis-command-stepper__number',\n pt?.number?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n style={pt?.number?.style}\n data-cratis-part='number'\n data-part='number'\n data-busy={isStepperBusy || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n >\n {index + 1}\n </span>\n <span\n {...pt?.title}\n className={[\n 'cratis-command-stepper__title',\n pt?.title?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='title'\n data-part='title'\n data-busy={isStepperBusy || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n >\n {panel.props.header}\n </span>\n </button>\n {index < stepCount - 1 && (\n <span\n {...pt?.separator}\n className={[\n 'cratis-command-stepper__separator',\n pt?.separator?.className,\n ]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='separator'\n data-part='separator'\n data-busy={isStepperBusy || undefined}\n data-invalid={invalid || undefined}\n data-visited={visited || undefined}\n aria-hidden='true'\n />\n )}\n </li>\n );\n })}\n </ol>\n );\n\n const stepperPanels = (\n <div\n {...pt?.panels}\n className={['cratis-command-stepper__panels', pt?.panels?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='panels'\n data-part='panels'\n data-busy={isStepperBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {panels.map((panel, index) => (\n <section\n key={index}\n {...pt?.panel}\n hidden={index !== currentStep}\n className={['cratis-command-stepper__panel', pt?.panel?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='panel'\n data-part='panel'\n data-busy={isStepperBusy || undefined}\n data-invalid={stepErrors[index] || undefined}\n data-selected={index === currentStep || undefined}\n data-visited={visitedSteps.has(index) || undefined}\n aria-label={String(panel.props.header ?? `Step ${index + 1}`)}\n aria-labelledby={pt?.panel?.['aria-labelledby'] ?? (pt?.header?.id == null ? `${stepperId}-step-${index}` : undefined)}\n >\n {disableFieldsWhileSubmitting ? (\n <fieldset disabled={isSubmitting} inert={isSubmitting} style={{ display: 'contents' }}>\n {processChildren(panel.props.children)}\n </fieldset>\n ) : processChildren(panel.props.children)}\n </section>\n ))}\n </div>\n );\n\n return (\n <div\n className={`cratis-command-stepper cratis-command-stepper--${orientation}`}\n data-orientation={orientation}\n >\n {start}\n <div\n {...pt?.root}\n className={['cratis-command-stepper__root', pt?.root?.className]\n .filter(Boolean)\n .join(' ')}\n data-cratis-part='root'\n data-cratis-component='CommandStepper'\n data-part='root'\n data-value={currentStep}\n data-orientation={orientation}\n data-busy={isStepperBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {headerPosition === 'bottom' ? (\n <>\n {stepperPanels}\n {stepperList}\n </>\n ) : (\n <>\n {stepperList}\n {stepperPanels}\n </>\n )}\n </div>\n {end}\n\n {showNavigation && (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n gap: '0.75rem',\n }}\n >\n {!isFirstStep && (\n <Button\n variant='outline'\n onClick={() => changeStep(currentStep - 1)}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{resolvedPreviousLabel}</span>\n </Button>\n )}\n <div style={{ flex: 1 }} />\n {!isLastStep && (\n <Button\n onClick={() => changeStep(currentStep + 1)}\n disabled={isBusy || isSubmitting || isCurrentStepInvalid}\n style={{ width: 'auto' }}\n >\n <span>{resolvedNextLabel}</span>\n </Button>\n )}\n {isLastStep && showSubmit && (\n <Button\n onClick={() => void onSubmit?.()}\n disabled={\n isBusy ||\n isSubmitting ||\n isSubmitDisabled ||\n hasAnyStepErrors\n }\n autoFocus\n style={{ width: 'auto' }}\n >\n {isSubmitting && (\n <span\n className='cratis-dialog__spinner'\n aria-hidden='true'\n />\n )}\n <span>{resolvedOkLabel}</span>\n </Button>\n )}\n </div>\n )}\n </div>\n );\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;AA4DA,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;AAGD,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,C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A,IAAA,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,CAEvB,YAAY,KACTD,GAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAC,wBAAwB,EAAA,aAAA,EACtB,MAAM,EAAA,CACpB,CACL,EACDA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,eAAe,EAAA,CAAQ,CAAA,EAAA,CACzB,CACZ,CAAA,EAAA,CACC,CACT,CAAA,EAAA,CACC;AAEd;;"}
|
|
1
|
+
{"version":3,"file":"CommandStepperContent.js","sources":["../../../CommandDialog/CommandStepperContent.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React, { useId } from 'react';\nimport { useCratisComponentsConfig } from '../Common/CratisComponentsProvider';\nimport type { StepperCustomizationProps } from './CommandStepper';\nimport { CommandStepperList } from './CommandStepperList';\nimport { CommandStepperPanels } from './CommandStepperPanels';\nimport { CommandStepperNavigation } from './CommandStepperNavigation';\nimport { resolveStepperLabels } from './resolveStepperLabels';\nimport { useStepperState } from './useStepperState';\nimport { joinClassNames } from './joinClassNames';\n\n/**\n * Controlled state and validation props for {@link CommandStepperContent}.\n *\n * @remarks\n * `CommandStepperContent` is a private implementation primitive shared by\n * {@link CommandStepper} and `StepperCommandDialog` — it is deliberately not\n * re-exported from the `./CommandStepper` or `./CommandDialog` package\n * subpaths, so this type is documented for maintainers only.\n */\nexport interface CommandStepperContentProps extends StepperCustomizationProps {\n /** The active step index. */\n activeStep: number;\n /** The indices that have been visited. */\n visitedSteps: Set<number>;\n /** StepperPanel children defining each wizard step. */\n children?: React.ReactNode;\n /** Callback for active step changes. */\n onActiveStepChange?: (stepIndex: number) => void;\n /** Callback for visited step changes. */\n onVisitedStepsChange?: (visitedSteps: Set<number>) => void;\n /** Callback that receives validation state for each step. */\n onStepErrorsChange?: (stepErrors: boolean[]) => void;\n /** Provides validation errors for individual fields. */\n getFieldError?: (fieldName: string) => unknown;\n /** Whether to show built-in previous and next buttons. Defaults to `true`. */\n showNavigation?: boolean;\n /** Whether to show built-in submit on the last step. Defaults to `true`. */\n showSubmit?: boolean;\n /** Label for the next step button. Falls back to the provider's `stepper.next` message, then `'Next'`. */\n nextLabel?: string;\n /** Label for the previous step button. Falls back to the provider's `stepper.previous` message, then `'Previous'`. */\n previousLabel?: string;\n /** Label for the submit button. Falls back to the provider's `stepper.submit` message, then `'Submit'`. */\n okLabel?: string;\n /** Whether navigation controls are busy. */\n isBusy?: boolean;\n /** Whether submit is currently executing. */\n isSubmitting?: boolean;\n /** Locks form fields during a guarded submission without changing unguarded forms. */\n disableFieldsWhileSubmitting?: boolean;\n /** Disables submit regardless of current step state. */\n isSubmitDisabled?: boolean;\n /** Submit callback invoked on the last step. */\n onSubmit?: () => void | Promise<void>;\n}\n\n/**\n * @internal Renders the visual stepper body — step headers, panels, and the\n * built-in Previous / Next / Submit navigation — without any Arc\n * `CommandForm` wiring. This is a private implementation primitive shared by\n * {@link CommandStepper} and `StepperCommandDialog`; it is intentionally\n * **not** re-exported from the `./CommandStepper` or `./CommandDialog`\n * package subpaths and may change shape without a major version bump.\n */\nexport const CommandStepperContent = ({\n activeStep,\n visitedSteps,\n children,\n onActiveStepChange,\n onVisitedStepsChange,\n onStepErrorsChange,\n getFieldError,\n showNavigation = true,\n showSubmit = true,\n nextLabel,\n previousLabel,\n okLabel,\n isBusy = false,\n isSubmitting = false,\n disableFieldsWhileSubmitting = false,\n isSubmitDisabled = false,\n onSubmit,\n linear = true,\n orientation = 'horizontal',\n headerPosition = 'top',\n start,\n end,\n onChangeStep,\n pt,\n}: CommandStepperContentProps) => {\n const { messages } = useCratisComponentsConfig();\n const stepperId = useId();\n const labels = resolveStepperLabels(messages, { nextLabel, previousLabel, okLabel });\n\n const {\n panels,\n currentStep,\n isFirstStep,\n isLastStep,\n stepErrors,\n isCurrentStepInvalid,\n hasAnyStepErrors,\n changeStep,\n } = useStepperState({\n children,\n activeStep,\n visitedSteps,\n linear,\n getFieldError,\n onStepErrorsChange,\n onActiveStepChange,\n onVisitedStepsChange,\n onChangeStep,\n });\n const isStepperBusy = isBusy || isSubmitting;\n\n const view = {\n panels,\n currentStep,\n visitedSteps,\n stepErrors,\n stepperId,\n isBusy: isStepperBusy,\n hasAnyStepErrors,\n pt,\n };\n const stepperList = (\n <CommandStepperList\n {...view}\n linear={linear}\n onHeaderClick={(index) => changeStep(index, true)}\n />\n );\n const stepperPanels = (\n <CommandStepperPanels\n {...view}\n disableFieldsWhileSubmitting={disableFieldsWhileSubmitting}\n isSubmitting={isSubmitting}\n />\n );\n\n const [first, second] = headerPosition === 'bottom'\n ? [stepperPanels, stepperList]\n : [stepperList, stepperPanels];\n\n return (\n <div\n className={`cratis-command-stepper cratis-command-stepper--${orientation}`}\n data-orientation={orientation}\n >\n {start}\n <div\n {...pt?.root}\n className={joinClassNames('cratis-command-stepper__root', pt?.root?.className)}\n data-cratis-part='root'\n data-cratis-component='CommandStepper'\n data-part='root'\n data-value={currentStep}\n data-orientation={orientation}\n data-busy={isStepperBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {first}\n {second}\n </div>\n {end}\n\n {showNavigation && (\n <CommandStepperNavigation\n isFirstStep={isFirstStep}\n isLastStep={isLastStep}\n showSubmit={showSubmit}\n isBusy={isBusy}\n isSubmitting={isSubmitting}\n isSubmitDisabled={isSubmitDisabled}\n isCurrentStepInvalid={isCurrentStepInvalid}\n hasAnyStepErrors={hasAnyStepErrors}\n previousLabel={labels.previous}\n nextLabel={labels.next}\n okLabel={labels.ok}\n onPrevious={() => changeStep(currentStep - 1)}\n onNext={() => changeStep(currentStep + 1)}\n onSubmit={onSubmit}\n />\n )}\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;;;;;;AAmEO,MAAM,qBAAqB,GAAG,CAAC,EAClC,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,kBAAkB,EAClB,oBA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W,GAAG,CAAC,CAAC,EACzC,QAAQ,EAAE,QAAQ,EAAA,CACpB,CACL,CAAA,EAAA,CACC;AAEd;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StepperPanelProps } from './StepperPanel.js';
|
|
3
|
+
import { type StepperPt } from './CommandStepperStepParts.js';
|
|
4
|
+
interface CommandStepperListProps {
|
|
5
|
+
panels: React.ReactElement<StepperPanelProps>[];
|
|
6
|
+
currentStep: number;
|
|
7
|
+
visitedSteps: Set<number>;
|
|
8
|
+
stepErrors: boolean[];
|
|
9
|
+
linear: boolean;
|
|
10
|
+
stepperId: string;
|
|
11
|
+
isBusy: boolean;
|
|
12
|
+
hasAnyStepErrors: boolean;
|
|
13
|
+
pt: StepperPt;
|
|
14
|
+
onHeaderClick: (index: number) => void;
|
|
15
|
+
}
|
|
16
|
+
/** The step header list of the stepper. */
|
|
17
|
+
export declare const CommandStepperList: ({ panels, currentStep, visitedSteps, stepErrors, linear, stepperId, isBusy, hasAnyStepErrors, pt, onHeaderClick, }: CommandStepperListProps) => React.JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=CommandStepperList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperList.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandStepperList.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AAExD,OAAO,EAA4D,KAAK,SAAS,EAAE,MAAM,8BAA2B,CAAC;AAErH,UAAU,uBAAuB;IAC7B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,EAAE,EAAE,SAAS,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AA2DD,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,uHAW5B,uBAAuB,sBA6BzB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { joinClassNames } from './joinClassNames.js';
|
|
3
|
+
import { StepSeparator, StepNumber, StepTitle } from './CommandStepperStepParts.js';
|
|
4
|
+
|
|
5
|
+
const headerIdOf = (pt, stepperId, index) => pt?.header?.id ?? `${stepperId}-step-${index}`;
|
|
6
|
+
const StepHeader = ({ panel, index, headerDisabled, stepperId, onHeaderClick, ...part }) => {
|
|
7
|
+
const { pt, selected, visited, invalid, isBusy } = part;
|
|
8
|
+
return (jsxs("button", { ...pt?.header, type: 'button', id: headerIdOf(pt, stepperId, index), className: joinClassNames('cratis-command-stepper__header', pt?.header?.className), "data-cratis-part": 'header', "data-part": 'header', "data-busy": isBusy || undefined, "data-disabled": headerDisabled || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, disabled: headerDisabled, "aria-current": selected ? 'step' : undefined, onClick: () => onHeaderClick(index), children: [jsx(StepNumber, { ...part, index: index }), jsx(StepTitle, { ...part, header: panel.props.header })] }));
|
|
9
|
+
};
|
|
10
|
+
const CommandStepperStep = ({ isLast, ...header }) => {
|
|
11
|
+
const { pt, selected, visited, invalid, isBusy } = header;
|
|
12
|
+
return (jsxs("li", { ...pt?.step, className: joinClassNames('cratis-command-stepper__step', pt?.step?.className), "data-cratis-part": 'step', "data-part": 'step', "data-active": selected || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, "data-invalid": invalid || undefined, "data-busy": isBusy || undefined, children: [jsx(StepHeader, { ...header }), jsx(StepSeparator, { pt: pt, selected: selected, visited: visited, invalid: invalid, isBusy: isBusy, isLast: isLast })] }));
|
|
13
|
+
};
|
|
14
|
+
const CommandStepperList = ({ panels, currentStep, visitedSteps, stepErrors, linear, stepperId, isBusy, hasAnyStepErrors, pt, onHeaderClick, }) => (jsx("ol", { ...pt?.list, className: joinClassNames('cratis-command-stepper__list', pt?.list?.className), "data-cratis-part": 'list', "data-part": 'list', "data-busy": isBusy || undefined, "data-invalid": hasAnyStepErrors || undefined, children: panels.map((panel, index) => {
|
|
15
|
+
const selected = index === currentStep;
|
|
16
|
+
return (jsx(CommandStepperStep, { panel: panel, index: index, isLast: index >= panels.length - 1, selected: selected, visited: visitedSteps.has(index), invalid: stepErrors[index] ?? false, headerDisabled: linear && !selected, stepperId: stepperId, isBusy: isBusy, pt: pt, onHeaderClick: onHeaderClick }, index));
|
|
17
|
+
}) }));
|
|
18
|
+
|
|
19
|
+
export { CommandStepperList };
|
|
20
|
+
//# sourceMappingURL=CommandStepperList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperList.js","sources":["../../../CommandDialog/CommandStepperList.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport type { StepperPanelProps } from './StepperPanel';\nimport { joinClassNames } from './joinClassNames';\nimport { StepNumber, StepSeparator, StepTitle, type StepPartProps, type StepperPt } from './CommandStepperStepParts';\n\ninterface CommandStepperListProps {\n panels: React.ReactElement<StepperPanelProps>[];\n currentStep: number;\n visitedSteps: Set<number>;\n stepErrors: boolean[];\n linear: boolean;\n stepperId: string;\n isBusy: boolean;\n hasAnyStepErrors: boolean;\n pt: StepperPt;\n onHeaderClick: (index: number) => void;\n}\n\ninterface StepProps extends StepPartProps {\n panel: React.ReactElement<StepperPanelProps>;\n index: number;\n isLast: boolean;\n headerDisabled: boolean;\n stepperId: string;\n onHeaderClick: (index: number) => void;\n}\n\nconst headerIdOf = (pt: StepperPt, stepperId: string, index: number) =>\n pt?.header?.id ?? `${stepperId}-step-${index}`;\n\nconst StepHeader = ({ panel, index, headerDisabled, stepperId, onHeaderClick, ...part }: Omit<StepProps, 'isLast'>) => {\n const { pt, selected, visited, invalid, isBusy } = part;\n return (\n <button\n {...pt?.header}\n type='button'\n id={headerIdOf(pt, stepperId, index)}\n className={joinClassNames('cratis-command-stepper__header', pt?.header?.className)}\n data-cratis-part='header'\n data-part='header'\n data-busy={isBusy || undefined}\n data-disabled={headerDisabled || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n disabled={headerDisabled}\n aria-current={selected ? 'step' : undefined}\n onClick={() => onHeaderClick(index)}\n >\n <StepNumber {...part} index={index} />\n <StepTitle {...part} header={panel.props.header} />\n </button>\n );\n};\n\nconst CommandStepperStep = ({ isLast, ...header }: StepProps) => {\n const { pt, selected, visited, invalid, isBusy } = header;\n return (\n <li\n {...pt?.step}\n className={joinClassNames('cratis-command-stepper__step', pt?.step?.className)}\n data-cratis-part='step'\n data-part='step'\n data-active={selected || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n data-invalid={invalid || undefined}\n data-busy={isBusy || undefined}\n >\n <StepHeader {...header} />\n <StepSeparator pt={pt} selected={selected} visited={visited} invalid={invalid} isBusy={isBusy} isLast={isLast} />\n </li>\n );\n};\n\n/** The step header list of the stepper. */\nexport const CommandStepperList = ({\n panels,\n currentStep,\n visitedSteps,\n stepErrors,\n linear,\n stepperId,\n isBusy,\n hasAnyStepErrors,\n pt,\n onHeaderClick,\n}: CommandStepperListProps) => (\n <ol\n {...pt?.list}\n className={joinClassNames('cratis-command-stepper__list', pt?.list?.className)}\n data-cratis-part='list'\n data-part='list'\n data-busy={isBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {panels.map((panel, index) => {\n const selected = index === currentStep;\n return (\n <CommandStepperStep\n key={index}\n panel={panel}\n index={index}\n isLast={index >= panels.length - 1}\n selected={selected}\n visited={visitedSteps.has(index)}\n invalid={stepErrors[index] ?? false}\n headerDisabled={linear && !selected}\n stepperId={stepperId}\n isBusy={isBusy}\n pt={pt}\n onHeaderClick={onHeaderClick}\n />\n );\n })}\n </ol>\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;;AA8BA,MAAM,UAAU,GAAG,CAAC,EAAa,EAAE,SAAiB,EAAE,KAAa,KAC/D,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,GAAG,SAAS,CAAA,MAAA,EAAS,KAAK,CAAA,CAAE;AAElD,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,IAAI,EAA6B,KAAI;AAClH,IAAA,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IACvD,QACIA,oBACQ,EAAE,EAAE,MAAM,EACd,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,EACpC,SAAS,EAAE,cAAc,CAAC,gCAAgC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAA,kBAAA,EACjE,QAAQ,EAAA,WAAA,EACf,QAAQ,EAAA,WAAA,EACP,MAAM,IAAI,SAAS,EAAA,eAAA,EACf,cAAc,IAAI,SAAS,EAAA,cAAA,EAC5B,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,QAAQ,IAAI,SAAS,kBACtB,OAAO,IAAI,SAAS,EAClC,QAAQ,EAAE,cAAc,EAAA,cAAA,EACV,QAAQ,GAAG,MAAM,GAAG,SAAS,EAC3C,OAAO,EAAE,MAAM,aAAa,CAAC,KAAK,CAAC,aAEnCC,GAAA,CAAC,UAAU,EAAA,EAAA,GAAK,IAAI,EAAE,KAAK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,CAAC,8BAA8B,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC7D,MAAM,eACb,MAAM,EAAA,WAAA,EACL,MAAM,IAAI,SAAS,EAAA,cAAA,EAChB,gBAAgB,IAAI,SAAS,EAAA,QAAA,EAE1C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAI;AACzB,QAAA,MAAM,QAAQ,GAAG,KAAK,KAAK,WAAW;AACtC,QAAA,QACIA,GAAA,CAAC,kBAAkB,EAAA,EAEf,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAClC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAChC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,EACnC,cAAc,EAAE,MAAM,IAAI,CAAC,QAAQ,EACnC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,EAAE,EACN,aAAa,EAAE,aAAa,EAAA,EAXvB,KAAK,CAYZ;IAEV,CAAC,CAAC,EAAA,CACD;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface CommandStepperNavigationProps {
|
|
2
|
+
isFirstStep: boolean;
|
|
3
|
+
isLastStep: boolean;
|
|
4
|
+
showSubmit: boolean;
|
|
5
|
+
isBusy: boolean;
|
|
6
|
+
isSubmitting: boolean;
|
|
7
|
+
isSubmitDisabled: boolean;
|
|
8
|
+
isCurrentStepInvalid: boolean;
|
|
9
|
+
hasAnyStepErrors: boolean;
|
|
10
|
+
previousLabel: string;
|
|
11
|
+
nextLabel: string;
|
|
12
|
+
okLabel: string;
|
|
13
|
+
onPrevious: () => void;
|
|
14
|
+
onNext: () => void;
|
|
15
|
+
onSubmit?: () => void | Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/** The built-in Previous / Next / Submit buttons of the stepper. */
|
|
18
|
+
export declare const CommandStepperNavigation: ({ isFirstStep, isLastStep, showSubmit, isBusy, isSubmitting, isSubmitDisabled, isCurrentStepInvalid, hasAnyStepErrors, previousLabel, nextLabel, okLabel, onPrevious, onNext, onSubmit, }: CommandStepperNavigationProps) => import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=CommandStepperNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperNavigation.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandStepperNavigation.tsx"],"names":[],"mappings":"AAKA,UAAU,6BAA6B;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,oEAAoE;AACpE,eAAO,MAAM,wBAAwB,8LAelC,6BAA6B,gCAmD/B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { Button } from '../Common/Button.js';
|
|
3
|
+
|
|
4
|
+
const CommandStepperNavigation = ({ isFirstStep, isLastStep, showSubmit, isBusy, isSubmitting, isSubmitDisabled, isCurrentStepInvalid, hasAnyStepErrors, previousLabel, nextLabel, okLabel, onPrevious, onNext, onSubmit, }) => (jsxs("div", { style: {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
width: '100%',
|
|
8
|
+
gap: '0.75rem',
|
|
9
|
+
}, children: [!isFirstStep && (jsx(Button, { variant: 'outline', onClick: onPrevious, disabled: isBusy, style: { width: 'auto' }, children: jsx("span", { children: previousLabel }) })), jsx("div", { style: { flex: 1 } }), !isLastStep && (jsx(Button, { onClick: onNext, disabled: isBusy || isSubmitting || isCurrentStepInvalid, style: { width: 'auto' }, children: jsx("span", { children: nextLabel }) })), isLastStep && showSubmit && (jsxs(Button, { onClick: () => void onSubmit?.(), disabled: isBusy ||
|
|
10
|
+
isSubmitting ||
|
|
11
|
+
isSubmitDisabled ||
|
|
12
|
+
hasAnyStepErrors, autoFocus: true, style: { width: 'auto' }, children: [isSubmitting && (jsx("span", { className: 'cratis-dialog__spinner', "aria-hidden": 'true' })), jsx("span", { children: okLabel })] }))] }));
|
|
13
|
+
|
|
14
|
+
export { CommandStepperNavigation };
|
|
15
|
+
//# sourceMappingURL=CommandStepperNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperNavigation.js","sources":["../../../CommandDialog/CommandStepperNavigation.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { Button } from '../Common/Button';\n\ninterface CommandStepperNavigationProps {\n isFirstStep: boolean;\n isLastStep: boolean;\n showSubmit: boolean;\n isBusy: boolean;\n isSubmitting: boolean;\n isSubmitDisabled: boolean;\n isCurrentStepInvalid: boolean;\n hasAnyStepErrors: boolean;\n previousLabel: string;\n nextLabel: string;\n okLabel: string;\n onPrevious: () => void;\n onNext: () => void;\n onSubmit?: () => void | Promise<void>;\n}\n\n/** The built-in Previous / Next / Submit buttons of the stepper. */\nexport const CommandStepperNavigation = ({\n isFirstStep,\n isLastStep,\n showSubmit,\n isBusy,\n isSubmitting,\n isSubmitDisabled,\n isCurrentStepInvalid,\n hasAnyStepErrors,\n previousLabel,\n nextLabel,\n okLabel,\n onPrevious,\n onNext,\n onSubmit,\n}: CommandStepperNavigationProps) => (\n <div\n style={{\n display: 'flex',\n alignItems: 'center',\n width: '100%',\n gap: '0.75rem',\n }}\n >\n {!isFirstStep && (\n <Button\n variant='outline'\n onClick={onPrevious}\n disabled={isBusy}\n style={{ width: 'auto' }}\n >\n <span>{previousLabel}</span>\n </Button>\n )}\n <div style={{ flex: 1 }} />\n {!isLastStep && (\n <Button\n onClick={onNext}\n disabled={isBusy || isSubmitting || isCurrentStepInvalid}\n style={{ width: 'auto' }}\n >\n <span>{nextLabel}</span>\n </Button>\n )}\n {isLastStep && showSubmit && (\n <Button\n onClick={() => void onSubmit?.()}\n disabled={\n isBusy ||\n isSubmitting ||\n isSubmitDisabled ||\n hasAnyStepErrors\n }\n autoFocus\n style={{ width: 'auto' }}\n >\n {isSubmitting && (\n <span\n className='cratis-dialog__spinner'\n aria-hidden='true'\n />\n )}\n <span>{okLabel}</span>\n </Button>\n )}\n </div>\n);\n"],"names":["_jsxs","_jsx"],"mappings":";;;AAuBO,MAAM,wBAAwB,GAAG,CAAC,EACrC,WAAW,EACX,UAAU,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,OAAO,EACP,UAAU,EACV,MAAM,EACN,QAAQ,GACoB,MAC5BA,IAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,GAAG,EAAE,SAAS;KACjB,EAAA,QAAA,EAAA,CAEA,CAAC,WAAW,KACTC,IAAC,MAAM,EAAA,EACH,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAExBA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,aAAa,GAAQ,EAAA,CACvB,CACZ,EACDA,GAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,GAAI,EAC1B,CAAC,UAAU,KACRA,GAAA,CAAC,MAAM,EAAA,EACH,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,IAAI,YAAY,IAAI,oBAAoB,EACxD,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA,QAAA,EAExBA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,SAAS,EAAA,CAAQ,GACnB,CACZ,EACA,UAAU,IAAI,UAAU,KACrBD,IAAA,CAAC,MAAM,EAAA,EACH,OAAO,EAAE,MAAM,KAAK,QAAQ,IAAI,EAChC,QAAQ,EACJ,MAAM;gBACN,YAAY;gBACZ,gBAAgB;AAChB,gBAAA,gBAAgB,EAEpB,SAAS,EAAA,IAAA,EACT,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAA,QAAA,EAAA,CAEvB,YAAY,KACTC,GAAA,CAAA,MAAA,EAAA,EACI,SAAS,EAAC,wBAAwB,EAAA,aAAA,EACtB,MAAM,EAAA,CACpB,CACL,EACDA,GAAA,CAAA,MAAA,EAAA,EAAA,QAAA,EAAO,OAAO,EAAA,CAAQ,CAAA,EAAA,CACjB,CACZ,CAAA,EAAA,CACC;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StepperCustomizationProps } from './CommandStepper.js';
|
|
3
|
+
import type { StepperPanelProps } from './StepperPanel.js';
|
|
4
|
+
type StepperPt = StepperCustomizationProps['pt'];
|
|
5
|
+
interface CommandStepperPanelsProps {
|
|
6
|
+
panels: React.ReactElement<StepperPanelProps>[];
|
|
7
|
+
currentStep: number;
|
|
8
|
+
visitedSteps: Set<number>;
|
|
9
|
+
stepErrors: boolean[];
|
|
10
|
+
stepperId: string;
|
|
11
|
+
isBusy: boolean;
|
|
12
|
+
hasAnyStepErrors: boolean;
|
|
13
|
+
disableFieldsWhileSubmitting: boolean;
|
|
14
|
+
isSubmitting: boolean;
|
|
15
|
+
pt: StepperPt;
|
|
16
|
+
}
|
|
17
|
+
/** The step panels of the stepper — only the current one is not hidden. */
|
|
18
|
+
export declare const CommandStepperPanels: ({ panels, currentStep, visitedSteps, stepErrors, stepperId, isBusy, hasAnyStepErrors, disableFieldsWhileSubmitting, isSubmitting, pt, }: CommandStepperPanelsProps) => React.JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=CommandStepperPanels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperPanels.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandStepperPanels.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AAIxD,KAAK,SAAS,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;AAEjD,UAAU,yBAAyB;IAC/B,MAAM,EAAE,KAAK,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,OAAO,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4BAA4B,EAAE,OAAO,CAAC;IACtC,YAAY,EAAE,OAAO,CAAC;IACtB,EAAE,EAAE,SAAS,CAAC;CACjB;AAcD,2EAA2E;AAC3E,eAAO,MAAM,oBAAoB,4IAW9B,yBAAyB,sBA8B3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { processChildren } from './commandStepperFields.js';
|
|
3
|
+
import { joinClassNames } from './joinClassNames.js';
|
|
4
|
+
|
|
5
|
+
const PanelBody = ({ children, locked, isSubmitting }) => locked ? (jsx("fieldset", { disabled: isSubmitting, inert: isSubmitting, style: { display: 'contents' }, children: processChildren(children) })) : jsx(Fragment, { children: processChildren(children) });
|
|
6
|
+
const CommandStepperPanels = ({ panels, currentStep, visitedSteps, stepErrors, stepperId, isBusy, hasAnyStepErrors, disableFieldsWhileSubmitting, isSubmitting, pt, }) => (jsx("div", { ...pt?.panels, className: joinClassNames('cratis-command-stepper__panels', pt?.panels?.className), "data-cratis-part": 'panels', "data-part": 'panels', "data-busy": isBusy || undefined, "data-invalid": hasAnyStepErrors || undefined, children: panels.map((panel, index) => (jsx("section", { ...pt?.panel, hidden: index !== currentStep, className: joinClassNames('cratis-command-stepper__panel', pt?.panel?.className), "data-cratis-part": 'panel', "data-part": 'panel', "data-busy": isBusy || undefined, "data-invalid": stepErrors[index] || undefined, "data-selected": index === currentStep || undefined, "data-visited": visitedSteps.has(index) || undefined, "aria-label": String(panel.props.header ?? `Step ${index + 1}`), "aria-labelledby": pt?.panel?.['aria-labelledby'] ?? (pt?.header?.id == null ? `${stepperId}-step-${index}` : undefined), children: jsx(PanelBody, { locked: disableFieldsWhileSubmitting, isSubmitting: isSubmitting, children: panel.props.children }) }, index))) }));
|
|
7
|
+
|
|
8
|
+
export { CommandStepperPanels };
|
|
9
|
+
//# sourceMappingURL=CommandStepperPanels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperPanels.js","sources":["../../../CommandDialog/CommandStepperPanels.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport type { StepperCustomizationProps } from './CommandStepper';\nimport type { StepperPanelProps } from './StepperPanel';\nimport { processChildren } from './commandStepperFields';\nimport { joinClassNames } from './joinClassNames';\n\ntype StepperPt = StepperCustomizationProps['pt'];\n\ninterface CommandStepperPanelsProps {\n panels: React.ReactElement<StepperPanelProps>[];\n currentStep: number;\n visitedSteps: Set<number>;\n stepErrors: boolean[];\n stepperId: string;\n isBusy: boolean;\n hasAnyStepErrors: boolean;\n disableFieldsWhileSubmitting: boolean;\n isSubmitting: boolean;\n pt: StepperPt;\n}\n\ninterface PanelBodyProps {\n children: React.ReactNode;\n locked: boolean;\n isSubmitting: boolean;\n}\n\nconst PanelBody = ({ children, locked, isSubmitting }: PanelBodyProps) => locked ? (\n <fieldset disabled={isSubmitting} inert={isSubmitting} style={{ display: 'contents' }}>\n {processChildren(children)}\n </fieldset>\n) : <>{processChildren(children)}</>;\n\n/** The step panels of the stepper — only the current one is not hidden. */\nexport const CommandStepperPanels = ({\n panels,\n currentStep,\n visitedSteps,\n stepErrors,\n stepperId,\n isBusy,\n hasAnyStepErrors,\n disableFieldsWhileSubmitting,\n isSubmitting,\n pt,\n}: CommandStepperPanelsProps) => (\n <div\n {...pt?.panels}\n className={joinClassNames('cratis-command-stepper__panels', pt?.panels?.className)}\n data-cratis-part='panels'\n data-part='panels'\n data-busy={isBusy || undefined}\n data-invalid={hasAnyStepErrors || undefined}\n >\n {panels.map((panel, index) => (\n <section\n key={index}\n {...pt?.panel}\n hidden={index !== currentStep}\n className={joinClassNames('cratis-command-stepper__panel', pt?.panel?.className)}\n data-cratis-part='panel'\n data-part='panel'\n data-busy={isBusy || undefined}\n data-invalid={stepErrors[index] || undefined}\n data-selected={index === currentStep || undefined}\n data-visited={visitedSteps.has(index) || undefined}\n aria-label={String(panel.props.header ?? `Step ${index + 1}`)}\n aria-labelledby={pt?.panel?.['aria-labelledby'] ?? (pt?.header?.id == null ? `${stepperId}-step-${index}` : undefined)}\n >\n <PanelBody locked={disableFieldsWhileSubmitting} isSubmitting={isSubmitting}>\n {panel.props.children}\n </PanelBody>\n </section>\n ))}\n </div>\n);\n"],"names":["_jsx","_Fragment"],"mappings":";;;;AA8BA,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAkB,KAAK,MAAM,IAC5EA,kBAAU,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,EAAA,QAAA,EAChF,eAAe,CAAC,QAAQ,CAAC,EAAA,CACnB,IACXA,GAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAG,eAAe,CAAC,QAAQ,CAAC,EAAA,CAAI;MAGvB,oBAAoB,GAAG,CAAC,EACjC,MAAM,EACN,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,MAAM,EACN,gBAAgB,EAChB,4BAA4B,EAC5B,YAAY,EACZ,EAAE,GACsB,MACxBD,GAAA,CAAA,KAAA,EAAA,EAAA,GACQ,EAAE,EAAE,MAAM,EACd,SAAS,EAAE,cAAc,CAAC,gCAAgC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,sBACjE,QAAQ,EAAA,WAAA,EACf,QAAQ,EAAA,WAAA,EACP,MAAM,IAAI,SAAS,EAAA,cAAA,EAChB,gBAAgB,IAAI,SAAS,YAE1C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,MACrBA,oBAEQ,EAAE,EAAE,KAAK,EACb,MAAM,EAAE,KAAK,KAAK,WAAW,EAC7B,SAAS,EAAE,cAAc,CAAC,+BAA+B,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC/D,OAAO,eACd,OAAO,EAAA,WAAA,EACN,MAAM,IAAI,SAAS,kBAChB,UAAU,CAAC,KAAK,CAAC,IAAI,SAAS,EAAA,eAAA,EAC7B,KAAK,KAAK,WAAW,IAAI,SAAS,EAAA,cAAA,EACnC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,gBACtC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,IAAI,QAAQ,KAAK,GAAG,CAAC,CAAA,CAAE,CAAC,qBAC5C,EAAE,EAAE,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,IAAI,GAAG,CAAA,EAAG,SAAS,SAAS,KAAK,CAAA,CAAE,GAAG,SAAS,CAAC,EAAA,QAAA,EAEtHA,GAAA,CAAC,SAAS,EAAA,EAAC,MAAM,EAAE,4BAA4B,EAAE,YAAY,EAAE,YAAY,YACtE,KAAK,CAAC,KAAK,CAAC,QAAQ,GACb,EAAA,EAfP,KAAK,CAgBJ,CACb,CAAC,EAAA,CACA;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StepperCustomizationProps } from './CommandStepper.js';
|
|
3
|
+
export type StepperPt = StepperCustomizationProps['pt'];
|
|
4
|
+
export interface StepPartProps {
|
|
5
|
+
pt: StepperPt;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
visited: boolean;
|
|
8
|
+
invalid: boolean;
|
|
9
|
+
isBusy: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** The numbered marker of a step. */
|
|
12
|
+
export declare const StepNumber: ({ pt, selected, visited, invalid, isBusy, index }: StepPartProps & {
|
|
13
|
+
index: number;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
/** The title of a step. */
|
|
16
|
+
export declare const StepTitle: ({ pt, selected, visited, invalid, isBusy, header }: StepPartProps & {
|
|
17
|
+
header: React.ReactNode;
|
|
18
|
+
}) => React.JSX.Element;
|
|
19
|
+
/** The connector after a step; absent after the last one. */
|
|
20
|
+
export declare const StepSeparator: ({ pt, visited, invalid, isBusy, isLast }: StepPartProps & {
|
|
21
|
+
isLast: boolean;
|
|
22
|
+
}) => React.JSX.Element | null;
|
|
23
|
+
//# sourceMappingURL=CommandStepperStepParts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperStepParts.d.ts","sourceRoot":"","sources":["../../../CommandDialog/CommandStepperStepParts.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAkB,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;AAExD,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,SAAS,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACnB;AAED,qCAAqC;AACrC,eAAO,MAAM,UAAU,sDAAuD,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,sBAa9G,CAAC;AAEF,2BAA2B;AAC3B,eAAO,MAAM,SAAS,uDAAwD,aAAa,GAAG;IAAE,MAAM,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,sBAaxH,CAAC;AAEF,6DAA6D;AAC7D,eAAO,MAAM,aAAa,6CAA8C,aAAa,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,6BAW1G,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { joinClassNames } from './joinClassNames.js';
|
|
3
|
+
|
|
4
|
+
const StepNumber = ({ pt, selected, visited, invalid, isBusy, index }) => (jsx("span", { ...pt?.number, className: joinClassNames('cratis-command-stepper__number', pt?.number?.className), "data-cratis-part": 'number', "data-part": 'number', "data-busy": isBusy || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, children: index + 1 }));
|
|
5
|
+
const StepTitle = ({ pt, selected, visited, invalid, isBusy, header }) => (jsx("span", { ...pt?.title, className: joinClassNames('cratis-command-stepper__title', pt?.title?.className), "data-cratis-part": 'title', "data-part": 'title', "data-busy": isBusy || undefined, "data-invalid": invalid || undefined, "data-selected": selected || undefined, "data-visited": visited || undefined, children: header }));
|
|
6
|
+
const StepSeparator = ({ pt, visited, invalid, isBusy, isLast }) => isLast ? null : (jsx("span", { ...pt?.separator, className: joinClassNames('cratis-command-stepper__separator', pt?.separator?.className), "data-cratis-part": 'separator', "data-part": 'separator', "data-busy": isBusy || undefined, "data-invalid": invalid || undefined, "data-visited": visited || undefined, "aria-hidden": 'true' }));
|
|
7
|
+
|
|
8
|
+
export { StepNumber, StepSeparator, StepTitle };
|
|
9
|
+
//# sourceMappingURL=CommandStepperStepParts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandStepperStepParts.js","sources":["../../../CommandDialog/CommandStepperStepParts.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport type { StepperCustomizationProps } from './CommandStepper';\nimport { joinClassNames } from './joinClassNames';\n\nexport type StepperPt = StepperCustomizationProps['pt'];\n\nexport interface StepPartProps {\n pt: StepperPt;\n selected: boolean;\n visited: boolean;\n invalid: boolean;\n isBusy: boolean;\n}\n\n/** The numbered marker of a step. */\nexport const StepNumber = ({ pt, selected, visited, invalid, isBusy, index }: StepPartProps & { index: number }) => (\n <span\n {...pt?.number}\n className={joinClassNames('cratis-command-stepper__number', pt?.number?.className)}\n data-cratis-part='number'\n data-part='number'\n data-busy={isBusy || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n >\n {index + 1}\n </span>\n);\n\n/** The title of a step. */\nexport const StepTitle = ({ pt, selected, visited, invalid, isBusy, header }: StepPartProps & { header: React.ReactNode }) => (\n <span\n {...pt?.title}\n className={joinClassNames('cratis-command-stepper__title', pt?.title?.className)}\n data-cratis-part='title'\n data-part='title'\n data-busy={isBusy || undefined}\n data-invalid={invalid || undefined}\n data-selected={selected || undefined}\n data-visited={visited || undefined}\n >\n {header}\n </span>\n);\n\n/** The connector after a step; absent after the last one. */\nexport const StepSeparator = ({ pt, visited, invalid, isBusy, isLast }: StepPartProps & { isLast: boolean }) => isLast ? null : (\n <span\n {...pt?.separator}\n className={joinClassNames('cratis-command-stepper__separator', pt?.separator?.className)}\n data-cratis-part='separator'\n data-part='separator'\n data-busy={isBusy || undefined}\n data-invalid={invalid || undefined}\n data-visited={visited || undefined}\n aria-hidden='true'\n />\n);\n"],"names":["_jsx"],"mappings":";;;AAkBO,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAqC,MAC3GA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,MAAM,EACd,SAAS,EAAE,cAAc,CAAC,gCAAgC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAA,kBAAA,EACjE,QAAQ,EAAA,WAAA,EACf,QAAQ,EAAA,WAAA,EACP,MAAM,IAAI,SAAS,EAAA,cAAA,EAChB,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,QAAQ,IAAI,SAAS,kBACtB,OAAO,IAAI,SAAS,EAAA,QAAA,EAEjC,KAAK,GAAG,CAAC,EAAA,CACP;AAIJ,MAAM,SAAS,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAA+C,MACrHA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,KAAK,EACb,SAAS,EAAE,cAAc,CAAC,+BAA+B,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAA,kBAAA,EAC/D,OAAO,EAAA,WAAA,EACd,OAAO,EAAA,WAAA,EACN,MAAM,IAAI,SAAS,EAAA,cAAA,EAChB,OAAO,IAAI,SAAS,EAAA,eAAA,EACnB,QAAQ,IAAI,SAAS,EAAA,cAAA,EACtB,OAAO,IAAI,SAAS,EAAA,QAAA,EAEjC,MAAM,EAAA,CACJ;AAIJ,MAAM,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAuC,KAAK,MAAM,GAAG,IAAI,IACzHA,GAAA,CAAA,MAAA,EAAA,EAAA,GACQ,EAAE,EAAE,SAAS,EACjB,SAAS,EAAE,cAAc,CAAC,mCAAmC,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,EAAA,kBAAA,EACvE,WAAW,EAAA,WAAA,EAClB,WAAW,EAAA,WAAA,EACV,MAAM,IAAI,SAAS,EAAA,cAAA,EAChB,OAAO,IAAI,SAAS,EAAA,cAAA,EACpB,OAAO,IAAI,SAAS,EAAA,aAAA,EACtB,MAAM,EAAA,CACpB;;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** Recursively collects all CommandFormField property names from a React node tree. */
|
|
3
|
+
export declare const extractFieldNamesFromNode: (nodes: React.ReactNode) => string[];
|
|
4
|
+
/** Wraps every CommandFormField in the tree with the Arc field wrapper. */
|
|
5
|
+
export declare const processChildren: (nodes: React.ReactNode) => React.ReactNode;
|
|
6
|
+
//# sourceMappingURL=commandStepperFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandStepperFields.d.ts","sourceRoot":"","sources":["../../../CommandDialog/commandStepperFields.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,uFAAuF;AACvF,eAAO,MAAM,yBAAyB,UAAW,KAAK,CAAC,SAAS,KAAG,MAAM,EAexE,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,eAAe,UAAW,KAAK,CAAC,SAAS,KAAG,KAAK,CAAC,SAuB9D,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { CommandFormFieldWrapper } from '@cratis/arc.react/commands';
|
|
4
|
+
import { isCommandFormField } from '../CommandForm/commandFormMarkers.js';
|
|
5
|
+
|
|
6
|
+
const getPropertyName = (accessor) => {
|
|
7
|
+
if (typeof accessor !== 'function')
|
|
8
|
+
return '';
|
|
9
|
+
const fnStr = accessor.toString();
|
|
10
|
+
const match = fnStr.match(/\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);
|
|
11
|
+
return match ? match[1] : '';
|
|
12
|
+
};
|
|
13
|
+
const fieldNameOf = (child) => {
|
|
14
|
+
const component = child.type;
|
|
15
|
+
if (!isCommandFormField(component))
|
|
16
|
+
return '';
|
|
17
|
+
const fieldProps = child.props;
|
|
18
|
+
return getPropertyName(fieldProps.value);
|
|
19
|
+
};
|
|
20
|
+
const extractFieldNamesFromNode = (nodes) => {
|
|
21
|
+
const names = [];
|
|
22
|
+
React.Children.forEach(nodes, (child) => {
|
|
23
|
+
if (!React.isValidElement(child))
|
|
24
|
+
return;
|
|
25
|
+
const name = fieldNameOf(child);
|
|
26
|
+
if (name)
|
|
27
|
+
names.push(name);
|
|
28
|
+
const childProps = child.props;
|
|
29
|
+
if (childProps.children != null) {
|
|
30
|
+
names.push(...extractFieldNamesFromNode(childProps.children));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return names;
|
|
34
|
+
};
|
|
35
|
+
const processChildren = (nodes) => {
|
|
36
|
+
return React.Children.map(nodes, (child) => {
|
|
37
|
+
if (!React.isValidElement(child))
|
|
38
|
+
return child;
|
|
39
|
+
const component = child.type;
|
|
40
|
+
if (isCommandFormField(component)) {
|
|
41
|
+
return jsx(CommandFormFieldWrapper, { field: child });
|
|
42
|
+
}
|
|
43
|
+
const childProps = child.props;
|
|
44
|
+
if (childProps.children != null) {
|
|
45
|
+
return React.cloneElement(child, {
|
|
46
|
+
children: processChildren(childProps.children),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return child;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { extractFieldNamesFromNode, processChildren };
|
|
54
|
+
//# sourceMappingURL=commandStepperFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandStepperFields.js","sources":["../../../CommandDialog/commandStepperFields.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport React from 'react';\nimport { CommandFormFieldWrapper } from '@cratis/arc.react/commands';\nimport { isCommandFormField } from '../CommandForm/commandFormMarkers';\n\n/** Extracts the property name from an accessor function like `c => c.name`. */\nconst getPropertyName = (accessor: ((obj: unknown) => unknown) | unknown): string => {\n if (typeof accessor !== 'function') return '';\n const fnStr = accessor.toString();\n const match = fnStr.match(/\\.([a-zA-Z_$][a-zA-Z0-9_$]*)/);\n return match ? match[1] : '';\n};\n\nconst fieldNameOf = (child: React.ReactElement): string => {\n const component = child.type as React.ComponentType<unknown>;\n if (!isCommandFormField(component)) return '';\n const fieldProps = child.props as { value?: (obj: unknown) => unknown };\n return getPropertyName(fieldProps.value);\n};\n\n/** Recursively collects all CommandFormField property names from a React node tree. */\nexport const extractFieldNamesFromNode = (nodes: React.ReactNode): string[] => {\n const names: string[] = [];\n React.Children.forEach(nodes, (child) => {\n if (!React.isValidElement(child)) return;\n const name = fieldNameOf(child);\n if (name) names.push(name);\n\n const childProps = child.props as Record<string, unknown>;\n if (childProps.children != null) {\n names.push(\n ...extractFieldNamesFromNode(childProps.children as React.ReactNode),\n );\n }\n });\n return names;\n};\n\n/** Wraps every CommandFormField in the tree with the Arc field wrapper. */\nexport const processChildren = (nodes: React.ReactNode): React.ReactNode => {\n return React.Children.map(nodes, (child) => {\n if (!React.isValidElement(child)) return child;\n\n const component = child.type as React.ComponentType<unknown>;\n if (isCommandFormField(component)) {\n type FieldElement = Parameters<typeof CommandFormFieldWrapper>[0]['field'];\n // SAFETY: displayName identifies the Arc command field shape before it reaches the wrapper.\n return <CommandFormFieldWrapper field={child as unknown as FieldElement} />;\n }\n\n const childProps = child.props as Record<string, unknown>;\n if (childProps.children != null) {\n return React.cloneElement(\n child as React.ReactElement<Record<string, unknown>>,\n {\n children: processChildren(childProps.children as React.ReactNode),\n },\n );\n }\n\n return child;\n });\n};\n"],"names":["_jsx"],"mappings":";;;;;AAQA,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,MAAM,WAAW,GAAG,CAAC,KAAyB,KAAY;AACtD,IAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAoC;AAC5D,IAAA,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;AAAE,QAAA,OAAO,EAAE;AAC7C,IAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAA8C;AACvE,IAAA,OAAO,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC;AAC5C,CAAC;AAGM,MAAM,yBAAyB,GAAG,CAAC,KAAsB,KAAc;IAC1E,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,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC;AAC/B,QAAA,IAAI,IAAI;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;AAE1B,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAgC;AACzD,QAAA,IAAI,UAAU,CAAC,QAAQ,IAAI,IAAI,EAAE;YAC7B,KAAK,CAAC,IAAI,CACN,GAAG,yBAAyB,CAAC,UAAU,CAAC,QAA2B,CAAC,CACvE;QACL;AACJ,IAAA,CAAC,CAAC;AACF,IAAA,OAAO,KAAK;AAChB;AAGO,MAAM,eAAe,GAAG,CAAC,KAAsB,KAAqB;IACvE,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,KAAK,KAAI;AACvC,QAAA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;AAAE,YAAA,OAAO,KAAK;AAE9C,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAoC;AAC5D,QAAA,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE;AAG/B,YAAA,OAAOA,IAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,KAAgC,GAAI;QAC/E;AAEA,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,KAAgC;AACzD,QAAA,IAAI,UAAU,CAAC,QAAQ,IAAI,IAAI,EAAE;AAC7B,YAAA,OAAO,KAAK,CAAC,YAAY,CACrB,KAAoD,EACpD;AACI,gBAAA,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,QAA2B,CAAC;AACpE,aAAA,CACJ;QACL;AAEA,QAAA,OAAO,KAAK;AAChB,IAAA,CAAC,CAAC;AACN;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinClassNames.d.ts","sourceRoot":"","sources":["../../../CommandDialog/joinClassNames.ts"],"names":[],"mappings":"AAGA,6FAA6F;AAC7F,eAAO,MAAM,cAAc,SAAU,MAAM,UAAU,MAAM,KAAG,MACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"joinClassNames.js","sources":["../../../CommandDialog/joinClassNames.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/** Joins a stable class name with an optional caller-supplied one, skipping empty values. */\nexport const joinClassNames = (base: string, extra?: string): string =>\n [base, extra].filter(Boolean).join(' ');\n"],"names":[],"mappings":"AAIO,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,KAAc,KACvD,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG;;"}
|