@parallelworks/ui 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +348 -25
- package/dist/ai/agent/diff.d.ts +2 -1
- package/dist/ai/agent/diff.js +4 -12
- package/dist/ai/agent/diffHighlight.d.ts +1 -1
- package/dist/ai/agent/diffHighlight.js +4 -3
- package/dist/ai/agent/index.d.ts +2 -1
- package/dist/ai/agent/toolStrings.d.ts +37 -0
- package/dist/ai/agent/toolStrings.js +35 -0
- package/dist/ai/agent/toolfmt.d.ts +8 -3
- package/dist/ai/agent/toolfmt.js +50 -65
- package/dist/ai/ai.css +18 -31
- package/dist/ai/components/AllocationSelector.js +2 -2
- package/dist/ai/components/AttachmentManager.js +28 -29
- package/dist/ai/components/AttachmentUpload.js +25 -30
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +3 -4
- package/dist/ai/components/ChatEmptyState.js +8 -7
- package/dist/ai/components/ChatInput.js +10 -12
- package/dist/ai/components/ChatLayout.js +3 -3
- package/dist/ai/components/ChatMessage.js +49 -61
- package/dist/ai/components/ChatMessageList.js +46 -42
- package/dist/ai/components/ChatSidebar.js +26 -34
- package/dist/ai/components/ChatStage.js +1 -1
- package/dist/ai/components/ComposerChrome.js +3 -4
- package/dist/ai/components/DragOverlay.js +6 -4
- package/dist/ai/components/ModelSelector.js +14 -15
- package/dist/ai/components/PastedText.js +18 -14
- package/dist/ai/components/ProviderIssueBanner.js +3 -4
- package/dist/ai/components/Reasoning.d.ts +12 -6
- package/dist/ai/components/Reasoning.js +31 -18
- package/dist/ai/components/ShareDialog.js +25 -28
- package/dist/ai/components/SlashMenu.js +3 -3
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -5
- package/dist/ai/components/agent/ActivityLine.js +17 -54
- package/dist/ai/components/agent/AgentMessageParts.js +139 -149
- package/dist/ai/components/conversationActions.js +16 -16
- package/dist/ai/core/ChatProvider.d.ts +2 -4
- package/dist/ai/core/ChatProvider.js +25 -38
- package/dist/ai/core/exportConversation.js +4 -4
- package/dist/ai/core/sidebarState.d.ts +8 -6
- package/dist/ai/core/sidebarState.js +21 -28
- package/dist/ai/core/useKeyboardShortcuts.js +14 -5
- package/dist/ai/index.d.ts +4 -5
- package/dist/ai/index.js +7 -7
- package/dist/ai/strings.d.ts +14 -31
- package/dist/ai/strings.js +19 -39
- package/dist/ai/types.d.ts +0 -5
- package/dist/ai/ui/ConversationSidebar.d.ts +12 -9
- package/dist/ai/ui/ConversationSidebar.js +43 -87
- package/dist/ai/ui/Markdown.d.ts +3 -6
- package/dist/ai/ui/Markdown.js +6 -73
- package/dist/ai/ui/Notice.js +10 -12
- package/dist/ai/ui/chip.d.ts +2 -2
- package/dist/ai/ui/chip.js +1 -1
- package/dist/ai/ui/sidebar.d.ts +4 -20
- package/dist/ai/ui/sidebar.js +30 -67
- package/dist/ai/utils.d.ts +0 -1
- package/dist/ai/utils.js +1 -14
- package/dist/brandIcons.d.ts +51 -0
- package/dist/brandIcons.js +75 -0
- package/dist/components/Avatar.d.ts +3 -1
- package/dist/components/Avatar.js +34 -28
- package/dist/components/Button.d.ts +12 -7
- package/dist/components/Button.js +39 -44
- package/dist/components/Callout.js +18 -12
- package/dist/components/Card.d.ts +18 -8
- package/dist/components/Card.js +17 -6
- package/dist/components/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox.js +30 -0
- package/dist/components/Combobox.d.ts +9 -1
- package/dist/components/Combobox.js +71 -44
- package/dist/components/ConfirmModal.js +11 -11
- package/dist/components/ContextMenu.d.ts +2 -8
- package/dist/components/ContextMenu.js +2 -29
- package/dist/components/CopyToClipboard.js +17 -36
- package/dist/components/CreateModal.d.ts +3 -24
- package/dist/components/CreateModal.js +46 -113
- package/dist/components/DatePicker.d.ts +31 -0
- package/dist/components/DatePicker.js +191 -0
- package/dist/components/DescriptionList.js +4 -4
- package/dist/components/Disclosure.d.ts +34 -0
- package/dist/components/Disclosure.js +46 -0
- package/dist/components/Drawer.d.ts +47 -0
- package/dist/components/Drawer.js +120 -0
- package/dist/components/EmptyState.d.ts +15 -10
- package/dist/components/EmptyState.js +13 -8
- package/dist/components/ExternalLink.d.ts +8 -0
- package/dist/components/ExternalLink.js +29 -0
- package/dist/components/Field.d.ts +70 -0
- package/dist/components/Field.js +159 -0
- package/dist/components/HoverCard.js +11 -14
- package/dist/components/IconButton.d.ts +16 -13
- package/dist/components/IconButton.js +27 -18
- package/dist/components/InfoTip.js +16 -23
- package/dist/components/Input.d.ts +10 -9
- package/dist/components/Input.js +54 -96
- package/dist/components/LetterBadge.js +2 -2
- package/dist/components/Loader.d.ts +15 -8
- package/dist/components/Loader.js +29 -19
- package/dist/components/Markdown.d.ts +7 -1
- package/dist/components/Markdown.js +2 -0
- package/dist/components/MarkdownImpl.d.ts +1 -1
- package/dist/components/MarkdownImpl.js +55 -14
- package/dist/components/Menu.js +13 -15
- package/dist/components/MenuEntries.js +11 -16
- package/dist/components/Meter.d.ts +48 -0
- package/dist/components/Meter.js +94 -0
- package/dist/components/Modal.js +11 -14
- package/dist/components/NumberInput.d.ts +25 -0
- package/dist/components/NumberInput.js +55 -0
- package/dist/components/Overview.js +12 -10
- package/dist/components/PageHeader.d.ts +2 -3
- package/dist/components/PageHeader.js +30 -21
- package/dist/components/Pagination.d.ts +27 -14
- package/dist/components/Pagination.js +86 -25
- package/dist/components/Popover.d.ts +47 -0
- package/dist/components/Popover.js +63 -0
- package/dist/components/Provider.d.ts +197 -80
- package/dist/components/Provider.js +200 -118
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/Radio.js +4 -4
- package/dist/components/RefreshButton.d.ts +15 -0
- package/dist/components/RefreshButton.js +53 -0
- package/dist/components/RunStatusIcon.d.ts +12 -0
- package/dist/components/RunStatusIcon.js +84 -0
- package/dist/components/SearchInput.d.ts +16 -0
- package/dist/components/SearchInput.js +52 -0
- package/dist/components/Section.d.ts +28 -0
- package/dist/components/Section.js +76 -0
- package/dist/components/SegmentedControl.d.ts +7 -11
- package/dist/components/SegmentedControl.js +25 -56
- package/dist/components/Select.d.ts +5 -1
- package/dist/components/Select.js +43 -44
- package/dist/components/SettingModeOption.d.ts +3 -5
- package/dist/components/SettingModeOption.js +5 -6
- package/dist/components/SettingsCard.d.ts +32 -19
- package/dist/components/SettingsCard.js +40 -13
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +34 -0
- package/dist/components/Slider.d.ts +16 -0
- package/dist/components/Slider.js +30 -0
- package/dist/components/Sort.js +4 -6
- package/dist/components/StatusBadge.d.ts +3 -1
- package/dist/components/StatusBadge.js +9 -32
- package/dist/components/StatusIcons.d.ts +0 -4
- package/dist/components/StatusIcons.js +5 -13
- package/dist/components/Switch.d.ts +5 -1
- package/dist/components/Switch.js +23 -6
- package/dist/components/Table.js +13 -20
- package/dist/components/Tabs.d.ts +52 -0
- package/dist/components/Tabs.js +75 -0
- package/dist/components/ThemeEditor.d.ts +29 -0
- package/dist/components/ThemeEditor.js +397 -0
- package/dist/components/Toast.d.ts +57 -0
- package/dist/components/Toast.js +203 -0
- package/dist/components/Tooltip.js +12 -15
- package/dist/components/buttonClasses.d.ts +18 -0
- package/dist/components/buttonClasses.js +31 -0
- package/dist/components/codeTheme.d.ts +5 -0
- package/dist/components/codeTheme.js +93 -0
- package/dist/components/fieldBox.d.ts +14 -0
- package/dist/components/fieldBox.js +29 -0
- package/dist/components/floating.d.ts +26 -5
- package/dist/components/floating.js +31 -9
- package/dist/{ai/ui/codeBreaks.js → components/markdownCodeBreaks.js} +1 -1
- package/dist/components/persistedState.d.ts +2 -0
- package/dist/components/persistedState.js +63 -0
- package/dist/components/relativeTime.d.ts +36 -8
- package/dist/components/relativeTime.js +106 -23
- package/dist/components/segmented.d.ts +17 -0
- package/dist/components/segmented.js +27 -0
- package/dist/components/shortcutKey.d.ts +4 -0
- package/dist/components/shortcutKey.js +27 -0
- package/dist/components/splitter.d.ts +26 -0
- package/dist/components/splitter.js +69 -0
- package/dist/components/tone.d.ts +9 -0
- package/dist/components/tone.js +30 -0
- package/dist/components/useCopy.d.ts +14 -0
- package/dist/components/useCopy.js +31 -0
- package/dist/components/useCssIsDark.d.ts +2 -0
- package/dist/components/useCssIsDark.js +2 -1
- package/dist/components/useTheme.d.ts +10 -0
- package/dist/components/useTheme.js +40 -0
- package/dist/cx.d.ts +5 -0
- package/dist/cx.js +11 -0
- package/dist/editor/Editor.js +2 -2
- package/dist/editor/EditorField.js +7 -10
- package/dist/editor/FormCodePanel.js +10 -23
- package/dist/editor/Monaco.js +7 -4
- package/dist/editor/index.d.ts +1 -1
- package/dist/editor/index.js +2 -2
- package/dist/editor/themes.d.ts +4 -0
- package/dist/editor/themes.js +75 -76
- package/dist/file-explorer/FileExplorer.js +180 -187
- package/dist/file-explorer/FileExplorerContext.js +36 -58
- package/dist/file-explorer/FilePreview/CodePreviewEditor.js +2 -1
- package/dist/file-explorer/FilePreview/Inline.js +9 -7
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +32 -34
- package/dist/file-explorer/FilePreview/index.js +60 -92
- package/dist/file-explorer/FileRow.js +10 -15
- package/dist/file-explorer/FileRowsWindow.js +2 -6
- package/dist/file-explorer/FileTable.js +2 -2
- package/dist/file-explorer/FileTableHeaders.js +8 -11
- package/dist/file-explorer/LoadMoreRow.js +8 -9
- package/dist/file-explorer/TreeView.js +16 -16
- package/dist/file-explorer/helpers.d.ts +1 -4
- package/dist/file-explorer/helpers.js +101 -114
- package/dist/file-explorer/lib/utils.d.ts +0 -2
- package/dist/file-explorer/lib/utils.js +1 -25
- package/dist/file-explorer/toasts.js +104 -185
- package/dist/form/Fields/BooleanField.js +12 -14
- package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
- package/dist/form/Fields/CheckboxGroupField.js +16 -18
- package/dist/form/Fields/ColorField.js +11 -11
- package/dist/form/Fields/DropdownField.d.ts +1 -1
- package/dist/form/Fields/DropdownField.js +20 -36
- package/dist/form/Fields/DurationField.d.ts +1 -1
- package/dist/form/Fields/DurationField.js +36 -50
- package/dist/form/Fields/LabelField.js +2 -2
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +9 -14
- package/dist/form/Fields/NumberField.d.ts +1 -1
- package/dist/form/Fields/NumberField.js +13 -48
- package/dist/form/Fields/ObjectField.js +3 -3
- package/dist/form/Fields/RadioField.d.ts +1 -1
- package/dist/form/Fields/RadioField.js +15 -18
- package/dist/form/Fields/RangeField.js +34 -35
- package/dist/form/Fields/StringField.d.ts +1 -1
- package/dist/form/Fields/StringField.js +15 -25
- package/dist/form/Fields/TextAreaField.js +10 -15
- package/dist/form/Form.d.ts +7 -2
- package/dist/form/Form.js +144 -49
- package/dist/form/FormLayout.js +18 -12
- package/dist/form/Wizard/WizardContainer.js +44 -18
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +31 -56
- package/dist/form/Wizard/WizardStepIndicator.d.ts +3 -0
- package/dist/form/Wizard/WizardStepIndicator.js +98 -114
- package/dist/form/Wizard/types.d.ts +2 -2
- package/dist/form/fieldFrame.d.ts +7 -0
- package/dist/form/fieldFrame.js +19 -0
- package/dist/form/index.d.ts +5 -5
- package/dist/form/index.js +4 -6
- package/dist/form/layoutCSS.js +5 -4
- package/dist/form/types/fieldComponentTypes.d.ts +5 -3
- package/dist/form/useChoiceField.js +2 -3
- package/dist/form/useFieldValue.d.ts +3 -0
- package/dist/form/useFieldValue.js +24 -7
- package/dist/form/utils/duration.d.ts +2 -2
- package/dist/form/utils/duration.js +3 -3
- package/dist/form/utils/fieldPath.d.ts +5 -3
- package/dist/form/utils/fieldPath.js +18 -3
- package/dist/form/utils/secondaryField.d.ts +0 -7
- package/dist/form/utils/secondaryField.js +1 -12
- package/dist/form/validation.d.ts +29 -0
- package/dist/form/validation.js +14 -0
- package/dist/format.d.ts +28 -0
- package/dist/format.js +64 -0
- package/dist/graph/AnnotationBanner.js +20 -31
- package/dist/graph/Connectors.js +1 -1
- package/dist/graph/DependencyGraph.js +51 -65
- package/dist/graph/GraphEditor.js +24 -28
- package/dist/graph/GraphEditorDialogs.js +239 -245
- package/dist/graph/InputDialog.js +93 -112
- package/dist/graph/InputsEditor.js +83 -84
- package/dist/graph/JobSummary.js +10 -11
- package/dist/graph/MatrixGroup.js +3 -3
- package/dist/graph/ProblemsButton.js +9 -10
- package/dist/graph/ShortcutsButton.js +12 -17
- package/dist/graph/SuggestionInput.d.ts +1 -2
- package/dist/graph/SuggestionInput.js +1 -3
- package/dist/graph/TreeView.js +47 -45
- package/dist/graph/WorkflowSettingsDialog.js +97 -102
- package/dist/graph/editorChrome.js +10 -12
- package/dist/graph/editorFields.d.ts +19 -16
- package/dist/graph/editorFields.js +97 -135
- package/dist/graph/editorPrimitives.js +2 -2
- package/dist/graph/editorRows.js +22 -25
- package/dist/graph/editorStrings.d.ts +16 -19
- package/dist/graph/editorStrings.js +11 -23
- package/dist/graph/fieldProblems.js +2 -2
- package/dist/graph/graphEditorState.d.ts +4 -4
- package/dist/graph/inputRefs.d.ts +0 -13
- package/dist/graph/inputRefs.js +121 -159
- package/dist/graph/settingsViews.js +5 -3
- package/dist/graph/stepWith.js +100 -100
- package/dist/graph/toolbarPanel.d.ts +8 -0
- package/dist/graph/toolbarPanel.js +11 -0
- package/dist/icons.d.ts +234 -23
- package/dist/icons.js +249 -264
- package/dist/index.d.ts +38 -21
- package/dist/index.js +42 -21
- package/dist/list/ActionToolbar.d.ts +1 -5
- package/dist/list/ActionToolbar.js +21 -20
- package/dist/list/ListPage.js +7 -7
- package/dist/list/ListTable.d.ts +3 -2
- package/dist/list/ListTable.js +33 -29
- package/dist/list/ListViewControls.d.ts +0 -17
- package/dist/list/ListViewControls.js +50 -118
- package/dist/list/UserHoverCard.js +24 -32
- package/dist/list/index.d.ts +2 -4
- package/dist/list/index.js +3 -5
- package/dist/list/listSearch.d.ts +1 -1
- package/dist/list/listSearch.js +19 -14
- package/dist/list/rowMenu.js +20 -26
- package/dist/logviewer/LogViewer.js +268 -382
- package/dist/logviewer/logviewer.css +53 -41
- package/dist/styles/base.css +16 -40
- package/dist/styles/theme.css +75 -106
- package/dist/styles.css +1 -1
- package/dist/theme/color.d.ts +40 -0
- package/dist/theme/color.js +228 -0
- package/dist/theme/contrast.d.ts +42 -0
- package/dist/theme/contrast.js +145 -0
- package/dist/theme/derive.d.ts +25 -0
- package/dist/theme/derive.js +475 -0
- package/dist/theme/fit.d.ts +35 -0
- package/dist/theme/fit.js +185 -0
- package/dist/theme/index.d.ts +14 -29
- package/dist/theme/index.js +20 -279
- package/dist/theme/model.d.ts +64 -0
- package/dist/theme/model.js +219 -0
- package/package.json +9 -5
- package/dist/ai/ui/Avatar.d.ts +0 -7
- package/dist/ai/ui/Avatar.js +0 -24
- package/dist/components/Filter.d.ts +0 -15
- package/dist/components/Filter.js +0 -32
- package/dist/components/FilterPill.d.ts +0 -7
- package/dist/components/FilterPill.js +0 -14
- package/dist/components/Indicator.d.ts +0 -4
- package/dist/components/Indicator.js +0 -44
- package/dist/components/SectionHeader.d.ts +0 -8
- package/dist/components/SectionHeader.js +0 -11
- package/dist/components/SettingRow.d.ts +0 -18
- package/dist/components/SettingRow.js +0 -35
- package/dist/components/SettingsGroup.d.ts +0 -8
- package/dist/components/SettingsGroup.js +0 -17
- package/dist/components/ghostButton.d.ts +0 -4
- package/dist/components/ghostButton.js +0 -7
- package/dist/components/inputClasses.d.ts +0 -1
- package/dist/components/inputClasses.js +0 -4
- package/dist/duration.d.ts +0 -3
- package/dist/duration.js +0 -17
- package/dist/form/FieldGroup.d.ts +0 -11
- package/dist/form/FieldGroup.js +0 -36
- package/dist/form/FieldWrapper.d.ts +0 -16
- package/dist/form/FieldWrapper.js +0 -55
- package/dist/form/fieldContext.d.ts +0 -19
- package/dist/form/fieldContext.js +0 -26
- package/dist/graph/Collapse.d.ts +0 -7
- package/dist/graph/Collapse.js +0 -15
- package/dist/graph/ToolbarPopover.d.ts +0 -13
- package/dist/graph/ToolbarPopover.js +0 -39
- package/dist/icons/ai/AiOutlineRollback.js +0 -16
- package/dist/icons/bi/BiBell.js +0 -16
- package/dist/icons/bi/BiBellOff.js +0 -16
- package/dist/icons/bi/BiBuildings.js +0 -20
- package/dist/icons/bi/BiError.js +0 -20
- package/dist/icons/bi/BiExpandVertical.js +0 -16
- package/dist/icons/bi/BiPause.js +0 -16
- package/dist/icons/bi/BiPlay.js +0 -16
- package/dist/icons/bi/BiRedo.js +0 -16
- package/dist/icons/bi/BiSolidCheckShield.js +0 -16
- package/dist/icons/bi/BiSolidTrashAlt.js +0 -16
- package/dist/icons/bi/BiStop.js +0 -16
- package/dist/icons/bi/BiUndo.js +0 -16
- package/dist/icons/bs/BsArrowsCollapse.js +0 -22
- package/dist/icons/bs/BsBank2.js +0 -19
- package/dist/icons/bs/BsBriefcase.js +0 -19
- package/dist/icons/bs/BsBucket.js +0 -19
- package/dist/icons/bs/BsCalendarX.js +0 -23
- package/dist/icons/bs/BsChatLeft.js +0 -19
- package/dist/icons/bs/BsChevronDoubleDown.js +0 -29
- package/dist/icons/bs/BsChevronDoubleUp.js +0 -29
- package/dist/icons/bs/BsClipboardCheck.js +0 -34
- package/dist/icons/bs/BsCurrencyDollar.js +0 -19
- package/dist/icons/bs/BsDash.js +0 -19
- package/dist/icons/bs/BsFileEarmarkZip.js +0 -23
- package/dist/icons/bs/BsFiles.js +0 -19
- package/dist/icons/bs/BsGeoAlt.js +0 -23
- package/dist/icons/bs/BsGrid.js +0 -19
- package/dist/icons/bs/BsLayers.js +0 -19
- package/dist/icons/bs/BsLayoutThreeColumns.js +0 -19
- package/dist/icons/bs/BsListUl.js +0 -22
- package/dist/icons/bs/BsMortarboard.js +0 -23
- package/dist/icons/bs/BsMusicNoteBeamed.js +0 -34
- package/dist/icons/bs/BsOpenai.js +0 -19
- package/dist/icons/bs/BsPersonPlus.js +0 -26
- package/dist/icons/bs/BsSearch.js +0 -19
- package/dist/icons/bs/BsSend.js +0 -19
- package/dist/icons/bs/BsShieldSlash.js +0 -22
- package/dist/icons/bs/BsStar.js +0 -19
- package/dist/icons/bs/BsStarFill.js +0 -19
- package/dist/icons/bs/BsStopCircle.js +0 -23
- package/dist/icons/bs/BsTag.js +0 -23
- package/dist/icons/bs/BsTelephone.js +0 -19
- package/dist/icons/bs/BsTerminal.js +0 -23
- package/dist/icons/bs/BsTerminalFill.js +0 -19
- package/dist/icons/bs/BsThreeDots.js +0 -19
- package/dist/icons/bs/BsThreeDotsVertical.js +0 -19
- package/dist/icons/bs/BsZoomIn.js +0 -37
- package/dist/icons/fa/FaAmazon.js +0 -16
- package/dist/icons/fa/FaAngleDown.js +0 -16
- package/dist/icons/fa/FaAngleLeft.js +0 -16
- package/dist/icons/fa/FaAngleRight.js +0 -16
- package/dist/icons/fa/FaAngleUp.js +0 -16
- package/dist/icons/fa/FaArrowDown.js +0 -16
- package/dist/icons/fa/FaArrowLeft.js +0 -16
- package/dist/icons/fa/FaArrowRight.js +0 -16
- package/dist/icons/fa/FaArrowUp.js +0 -16
- package/dist/icons/fa/FaBalanceScale.js +0 -16
- package/dist/icons/fa/FaCaretDown.js +0 -16
- package/dist/icons/fa/FaCentos.js +0 -16
- package/dist/icons/fa/FaChartLine.js +0 -16
- package/dist/icons/fa/FaChartPie.js +0 -16
- package/dist/icons/fa/FaCheck.js +0 -16
- package/dist/icons/fa/FaChevronDown.js +0 -16
- package/dist/icons/fa/FaChevronUp.js +0 -16
- package/dist/icons/fa/FaChrome.js +0 -16
- package/dist/icons/fa/FaCircleNotch.js +0 -16
- package/dist/icons/fa/FaCloud.js +0 -16
- package/dist/icons/fa/FaCloudDownloadAlt.js +0 -16
- package/dist/icons/fa/FaCog.js +0 -16
- package/dist/icons/fa/FaCogs.js +0 -16
- package/dist/icons/fa/FaComments.js +0 -16
- package/dist/icons/fa/FaCompress.js +0 -16
- package/dist/icons/fa/FaDesktop.js +0 -16
- package/dist/icons/fa/FaDocker.js +0 -16
- package/dist/icons/fa/FaDollarSign.js +0 -16
- package/dist/icons/fa/FaEdge.js +0 -16
- package/dist/icons/fa/FaEdit.js +0 -16
- package/dist/icons/fa/FaExclamationTriangle.js +0 -16
- package/dist/icons/fa/FaExpand.js +0 -16
- package/dist/icons/fa/FaEye.js +0 -16
- package/dist/icons/fa/FaEyeSlash.js +0 -16
- package/dist/icons/fa/FaFile.js +0 -16
- package/dist/icons/fa/FaFilePdf.js +0 -16
- package/dist/icons/fa/FaFilter.js +0 -16
- package/dist/icons/fa/FaFirefoxBrowser.js +0 -16
- package/dist/icons/fa/FaFlask.js +0 -16
- package/dist/icons/fa/FaFolder.js +0 -16
- package/dist/icons/fa/FaGithub.js +0 -16
- package/dist/icons/fa/FaGitlab.js +0 -16
- package/dist/icons/fa/FaGlobe.js +0 -16
- package/dist/icons/fa/FaGlobeAmericas.js +0 -16
- package/dist/icons/fa/FaImage.js +0 -16
- package/dist/icons/fa/FaInfoCircle.js +0 -16
- package/dist/icons/fa/FaKey.js +0 -16
- package/dist/icons/fa/FaLayerGroup.js +0 -16
- package/dist/icons/fa/FaLink.js +0 -16
- package/dist/icons/fa/FaLinkedin.js +0 -16
- package/dist/icons/fa/FaLinux.js +0 -16
- package/dist/icons/fa/FaList.js +0 -16
- package/dist/icons/fa/FaLock.js +0 -16
- package/dist/icons/fa/FaOpenid.js +0 -16
- package/dist/icons/fa/FaOpera.js +0 -16
- package/dist/icons/fa/FaPaperclip.js +0 -16
- package/dist/icons/fa/FaPlus.js +0 -16
- package/dist/icons/fa/FaPowerOff.js +0 -16
- package/dist/icons/fa/FaPrint.js +0 -16
- package/dist/icons/fa/FaQrcode.js +0 -16
- package/dist/icons/fa/FaQuestionCircle.js +0 -16
- package/dist/icons/fa/FaRedhat.js +0 -16
- package/dist/icons/fa/FaRegCircle.js +0 -16
- package/dist/icons/fa/FaRegFileImage.js +0 -16
- package/dist/icons/fa/FaRegFolder.js +0 -16
- package/dist/icons/fa/FaRobot.js +0 -16
- package/dist/icons/fa/FaRocket.js +0 -16
- package/dist/icons/fa/FaRunning.js +0 -16
- package/dist/icons/fa/FaSafari.js +0 -16
- package/dist/icons/fa/FaSave.js +0 -16
- package/dist/icons/fa/FaSearch.js +0 -16
- package/dist/icons/fa/FaShieldAlt.js +0 -16
- package/dist/icons/fa/FaSlack.js +0 -16
- package/dist/icons/fa/FaStar.js +0 -16
- package/dist/icons/fa/FaStop.js +0 -16
- package/dist/icons/fa/FaSuse.js +0 -16
- package/dist/icons/fa/FaTerminal.js +0 -16
- package/dist/icons/fa/FaTimes.js +0 -16
- package/dist/icons/fa/FaUbuntu.js +0 -16
- package/dist/icons/fa/FaUndoAlt.js +0 -16
- package/dist/icons/fa/FaUnlink.js +0 -16
- package/dist/icons/fa/FaUser.js +0 -16
- package/dist/icons/fa/FaUsers.js +0 -16
- package/dist/icons/fa/FaWindows.js +0 -16
- package/dist/icons/fa6/FaApple.js +0 -16
- package/dist/icons/fa6/FaArrowsRotate.js +0 -16
- package/dist/icons/fa6/FaDebian.js +0 -16
- package/dist/icons/fa6/FaFilterCircleXmark.js +0 -16
- package/dist/icons/fa6/FaInbox.js +0 -16
- package/dist/icons/fa6/FaLocationDot.js +0 -16
- package/dist/icons/fa6/FaRegFilePdf.js +0 -16
- package/dist/icons/fa6/FaRegFolderOpen.js +0 -16
- package/dist/icons/fa6/FaUpRightFromSquare.js +0 -16
- package/dist/icons/fa6/FaWandMagicSparkles.js +0 -16
- package/dist/icons/fa6/FaXTwitter.js +0 -16
- package/dist/icons/fi/FiActivity.js +0 -23
- package/dist/icons/fi/FiAlertCircle.js +0 -49
- package/dist/icons/fi/FiChevronDown.js +0 -23
- package/dist/icons/fi/FiClock.js +0 -31
- package/dist/icons/fi/FiCopy.js +0 -34
- package/dist/icons/fi/FiDownload.js +0 -40
- package/dist/icons/fi/FiFile.js +0 -27
- package/dist/icons/fi/FiFileText.js +0 -55
- package/dist/icons/fi/FiHardDrive.js +0 -55
- package/dist/icons/fi/FiRotateCcw.js +0 -27
- package/dist/icons/fi/FiUpload.js +0 -40
- package/dist/icons/fi/FiX.js +0 -37
- package/dist/icons/fi/FiZap.js +0 -23
- package/dist/icons/gi/GiSpy.js +0 -16
- package/dist/icons/go/GoGitCommit.js +0 -16
- package/dist/icons/go/GoGitPullRequest.js +0 -20
- package/dist/icons/go/GoIssueOpened.js +0 -16
- package/dist/icons/go/GoPlus.js +0 -16
- package/dist/icons/go/GoRepoForked.js +0 -28
- package/dist/icons/go/GoSignOut.js +0 -16
- package/dist/icons/go/GoSkip.js +0 -20
- package/dist/icons/go/GoVideo.js +0 -20
- package/dist/icons/gr/GrCloudComputer.js +0 -20
- package/dist/icons/gr/GrInbox.js +0 -20
- package/dist/icons/gr/GrServerCluster.js +0 -20
- package/dist/icons/gr/GrStorage.js +0 -20
- package/dist/icons/gr/GrTasks.js +0 -20
- package/dist/icons/hi/HiCog.js +0 -24
- package/dist/icons/hi/HiDuplicate.js +0 -24
- package/dist/icons/hi/HiOutlineArchive.js +0 -26
- package/dist/icons/hi/HiOutlineClipboardCopy.js +0 -26
- package/dist/icons/hi/HiOutlineHome.js +0 -26
- package/dist/icons/hi/HiQuestionMarkCircle.js +0 -24
- package/dist/icons/hi/HiServer.js +0 -24
- package/dist/icons/hi2/HiMiniCheckCircle.js +0 -24
- package/dist/icons/hi2/HiMiniLanguage.js +0 -28
- package/dist/icons/hi2/HiMiniMinusCircle.js +0 -24
- package/dist/icons/hi2/HiMiniXCircle.js +0 -24
- package/dist/icons/hi2/HiSparkles.js +0 -24
- package/dist/icons/im/ImSpinner5.js +0 -19
- package/dist/icons/io/IoIosNotifications.js +0 -16
- package/dist/icons/io/IoMdBuild.js +0 -16
- package/dist/icons/io/IoMdClose.js +0 -16
- package/dist/icons/io5/IoCloudUploadOutline.js +0 -32
- package/dist/icons/io5/IoDocumentTextOutline.js +0 -31
- package/dist/icons/io5/IoFileTrayFullOutline.js +0 -31
- package/dist/icons/io5/IoHeart.js +0 -16
- package/dist/icons/io5/IoHeartDislike.js +0 -16
- package/dist/icons/io5/IoHeartOutline.js +0 -22
- package/dist/icons/io5/IoInformationCircleOutline.js +0 -50
- package/dist/icons/io5/IoSettingsOutline.js +0 -22
- package/dist/icons/io5/IoWarningOutline.js +0 -40
- package/dist/icons/lu/LuArrowRight.js +0 -27
- package/dist/icons/lu/LuBadgeCheck.js +0 -27
- package/dist/icons/lu/LuBraces.js +0 -27
- package/dist/icons/lu/LuBrainCircuit.js +0 -101
- package/dist/icons/lu/LuCalendar.js +0 -46
- package/dist/icons/lu/LuCheck.js +0 -23
- package/dist/icons/lu/LuChevronLeft.js +0 -23
- package/dist/icons/lu/LuChevronRight.js +0 -23
- package/dist/icons/lu/LuCode.js +0 -27
- package/dist/icons/lu/LuExternalLink.js +0 -35
- package/dist/icons/lu/LuEye.js +0 -31
- package/dist/icons/lu/LuEyeOff.js +0 -40
- package/dist/icons/lu/LuFolderTree.js +0 -40
- package/dist/icons/lu/LuIdCard.js +0 -55
- package/dist/icons/lu/LuKeyboard.js +0 -71
- package/dist/icons/lu/LuLogs.js +0 -65
- package/dist/icons/lu/LuMail.js +0 -33
- package/dist/icons/lu/LuMegaphone.js +0 -27
- package/dist/icons/lu/LuMoon.js +0 -23
- package/dist/icons/lu/LuNetwork.js +0 -63
- package/dist/icons/lu/LuPartyPopper.js +0 -65
- package/dist/icons/lu/LuSettings2.js +0 -48
- package/dist/icons/lu/LuSheet.js +0 -72
- package/dist/icons/lu/LuShield.js +0 -23
- package/dist/icons/lu/LuSun.js +0 -69
- package/dist/icons/lu/LuTextCursorInput.js +0 -45
- package/dist/icons/lu/LuX.js +0 -27
- package/dist/icons/lu/LuZoomIn.js +0 -59
- package/dist/icons/lu/LuZoomOut.js +0 -49
- package/dist/icons/md/MdClear.js +0 -23
- package/dist/icons/md/MdDragHandle.js +0 -23
- package/dist/icons/md/MdInstallDesktop.js +0 -31
- package/dist/icons/md/MdOutlineAttachMoney.js +0 -23
- package/dist/icons/md/MdOutlineMoneyOff.js +0 -23
- package/dist/icons/md/MdPieChart.js +0 -23
- package/dist/icons/md/MdRefresh.js +0 -23
- package/dist/icons/md/MdReplay.js +0 -23
- package/dist/icons/md/MdSmartphone.js +0 -23
- package/dist/icons/pi/PiArrowBendUpRightBold.js +0 -19
- package/dist/icons/pi/PiPlugsConnectedFill.js +0 -19
- package/dist/icons/pi/PiRectangleDashed.js +0 -19
- package/dist/icons/pi/PiShareBold.js +0 -19
- package/dist/icons/si/SiAnthropic.js +0 -19
- package/dist/icons/si/SiHelm.js +0 -19
- package/dist/icons/si/SiKubernetes.js +0 -19
- package/dist/icons/tb/TbAlertTriangle.js +0 -35
- package/dist/icons/tb/TbAlertTriangleFilled.js +0 -19
- package/dist/icons/tb/TbApi.js +0 -40
- package/dist/icons/tb/TbBrain.js +0 -50
- package/dist/icons/tb/TbBuildingTunnel.js +0 -65
- package/dist/icons/tb/TbEdit.js +0 -35
- package/dist/icons/tb/TbLayoutSidebar.js +0 -27
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +0 -35
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +0 -35
- package/dist/icons/tb/TbUser.js +0 -27
- package/dist/icons/tb/TbUserOff.js +0 -35
- package/dist/icons/tb/TbWorldShare.js +0 -55
- package/dist/icons/tb/TbWorldWww.js +0 -65
- package/dist/icons/ti/TiArrowSortedDown.js +0 -20
- package/dist/icons/ti/TiArrowSortedUp.js +0 -20
- package/dist/icons/ti/TiArrowUnsorted.js +0 -20
- package/dist/icons/ti/TiCancel.js +0 -20
- package/dist/icons/vsc/VscChromeMinimize.js +0 -19
- package/dist/icons/vsc/VscJson.js +0 -19
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +0 -19
- package/dist/icons/vsc/VscPass.js +0 -27
- package/dist/icons/vsc/VscSplitHorizontal.js +0 -19
- package/dist/icons/vsc/VscTerminalPowershell.js +0 -19
- package/dist/list/ListPager.d.ts +0 -14
- package/dist/list/ListPager.js +0 -62
- package/dist/list/textEntry.d.ts +0 -2
- package/dist/list/textEntry.js +0 -10
- /package/dist/{ai/ui/codeBreaks.d.ts → components/markdownCodeBreaks.d.ts} +0 -0
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../../cx.js";
|
|
2
|
+
import { fieldBox } from "../../components/fieldBox.js";
|
|
3
|
+
import { Field } from "../../components/Field.js";
|
|
4
|
+
import { fieldFrame } from "../fieldFrame.js";
|
|
2
5
|
import { useFieldValue } from "../useFieldValue.js";
|
|
3
6
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
4
|
-
import { clsx } from "clsx";
|
|
5
7
|
import { jsx } from "react/jsx-runtime";
|
|
6
8
|
//#region src/form/Fields/TextAreaField.tsx
|
|
7
9
|
function TextAreaField(props) {
|
|
8
|
-
const { field,
|
|
10
|
+
const { field, disabled, onChange } = props;
|
|
9
11
|
const [value, change] = useFieldValue(field.name ?? "");
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
labelPosition,
|
|
16
|
-
spaceCompact,
|
|
17
|
-
children: ({ id, describedBy }) => /* @__PURE__ */ jsx("textarea", {
|
|
18
|
-
className: clsx("theme-input h-[82px] w-full rounded leading-4 overflow-y-scroll", disabled && "disabled", missing && "border-red-600 focus:border-red-600 focus:ring-red-500"),
|
|
19
|
-
id,
|
|
20
|
-
"aria-describedby": describedBy,
|
|
21
|
-
"aria-required": field.optional ? void 0 : true,
|
|
12
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
13
|
+
...fieldFrame(props),
|
|
14
|
+
children: (control) => /* @__PURE__ */ jsx("textarea", {
|
|
15
|
+
...control,
|
|
16
|
+
className: cx(fieldBox({ multiline: true }), "h-20 resize-y"),
|
|
22
17
|
name: field.name,
|
|
23
18
|
value: value ?? "",
|
|
24
19
|
placeholder: getPlaceholder(field.placeholder, field.default),
|
package/dist/form/Form.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type UseFormReturn } from 'react-hook-form';
|
|
2
2
|
import type { WorkflowVariables } from '../engine.js';
|
|
3
3
|
import { type FieldComponent } from './fieldRegistry.js';
|
|
4
|
+
import { type ServerError } from './validation.js';
|
|
4
5
|
interface FormMeta {
|
|
5
6
|
labelPosition?: 'left' | 'top' | undefined;
|
|
6
7
|
spaceCompact?: boolean | undefined;
|
|
@@ -66,8 +67,12 @@ export interface DynamicFormProps {
|
|
|
66
67
|
/** Every change to the form's values, as it happens. */
|
|
67
68
|
onValuesChange?: (values: FormValues) => void;
|
|
68
69
|
labelPosition?: 'left' | 'top';
|
|
69
|
-
/**
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Fields the server rejected, each shown under its field until the person changes it. They never
|
|
72
|
+
* hold back Next or a submit, since the server checks again, and a wizard turns to the first page
|
|
73
|
+
* holding one. `useFieldMessages` from the problem package gives them from a problem response.
|
|
74
|
+
*/
|
|
75
|
+
serverErrors?: readonly ServerError[] | undefined;
|
|
71
76
|
spaceCompact?: boolean;
|
|
72
77
|
organizationVariables?: WorkflowVariables | undefined;
|
|
73
78
|
/** A remote workflow's repo/branch/yaml, so `${{ remote.* }}` resolves the same here as it does on the run. */
|
package/dist/form/Form.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { Loader } from "../components/Loader.js";
|
|
3
|
+
import { useStrings, useWorkflowEngine } from "../components/Provider.js";
|
|
4
|
+
import { Button } from "../components/Button.js";
|
|
2
5
|
import { InfoTip } from "../components/InfoTip.js";
|
|
3
|
-
import
|
|
6
|
+
import { FieldRowContext } from "../components/Field.js";
|
|
7
|
+
import { Section } from "../components/Section.js";
|
|
4
8
|
import { parseWizardConfig } from "./Wizard/utils.js";
|
|
5
9
|
import { inputWidth, resolvedFlag } from "./lib.js";
|
|
6
|
-
import { FieldGroup } from "./FieldGroup.js";
|
|
7
10
|
import { resolveFormLayout } from "./layout.js";
|
|
8
11
|
import { FormLayout, LayoutCSSContext } from "./FormLayout.js";
|
|
12
|
+
import { FormChecksContext, RequiredFieldContext } from "./validation.js";
|
|
9
13
|
import { FieldRegistryContext, Registry } from "./fieldRegistry.js";
|
|
10
14
|
import { EditingScope, useFormEditing } from "./formEditing.js";
|
|
11
15
|
import { shareEqual } from "./utils/shareEqual.js";
|
|
@@ -14,9 +18,8 @@ import { atIndex, fieldPath, rowIndexOf } from "./utils/fieldPath.js";
|
|
|
14
18
|
import { getValueUsingPath } from "./utils/getValueUsingPath.js";
|
|
15
19
|
import { getParentValue } from "./utils/getParentValue.js";
|
|
16
20
|
import { WizardContainer } from "./Wizard/WizardContainer.js";
|
|
17
|
-
import { clsx } from "clsx";
|
|
18
21
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
|
-
import { createContext, memo, useContext, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
22
|
+
import { createContext, memo, useCallback, useContext, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
20
23
|
import { dequal } from "dequal";
|
|
21
24
|
import { FormProvider, get, useForm, useFormContext, useFormState, useWatch } from "react-hook-form";
|
|
22
25
|
//#region src/form/Form.tsx
|
|
@@ -268,11 +271,13 @@ function readField(field, values, index, workflowForm) {
|
|
|
268
271
|
}
|
|
269
272
|
/**
|
|
270
273
|
* One field of the schema. It renders again only when what it reads changes: an input its expressions
|
|
271
|
-
* or conditions read, or
|
|
274
|
+
* or conditions read, or the error the form shows under it. Its own value is its input's business.
|
|
272
275
|
*/
|
|
273
276
|
var FormField = memo(function FormField({ fieldName, optionsField, nested, fieldNamePrefix, arrayIndex, computeOn, onRowChange, labelPosition, spaceCompact }) {
|
|
274
277
|
const { control, getValues, setValue, unregister } = useFormContext();
|
|
275
278
|
const { workflowForm } = useContext(FormOptionsContext);
|
|
279
|
+
const { form: strings } = useStrings();
|
|
280
|
+
const inRow = useContext(FieldRowContext);
|
|
276
281
|
const editing = useFormEditing();
|
|
277
282
|
const parse = useFieldParse(optionsField, nested ? arrayIndex : void 0);
|
|
278
283
|
const index = nested ? arrayIndex ?? rowIndexOf(fieldNamePrefix) : void 0;
|
|
@@ -336,18 +341,21 @@ var FormField = memo(function FormField({ fieldName, optionsField, nested, field
|
|
|
336
341
|
} : void 0;
|
|
337
342
|
if (field.type === "group") {
|
|
338
343
|
const meta = resolveMetaOverrides(field.options, labelPosition, spaceCompact);
|
|
339
|
-
const group = /* @__PURE__ */ jsx(
|
|
344
|
+
const group = /* @__PURE__ */ jsx(Section, {
|
|
340
345
|
title: field.label,
|
|
341
346
|
collapsible: !field.noCollapse,
|
|
342
347
|
defaultOpen: !field.collapsed,
|
|
343
348
|
children: /* @__PURE__ */ jsx(EditingScope, {
|
|
344
349
|
editing,
|
|
345
350
|
path,
|
|
346
|
-
children: /* @__PURE__ */ jsx(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
+
children: /* @__PURE__ */ jsx(FieldRowContext, {
|
|
352
|
+
value: false,
|
|
353
|
+
children: /* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
354
|
+
options: field.options ?? {},
|
|
355
|
+
parentInfo,
|
|
356
|
+
labelPosition: meta.labelPosition,
|
|
357
|
+
spaceCompact: meta.spaceCompact
|
|
358
|
+
})
|
|
351
359
|
})
|
|
352
360
|
})
|
|
353
361
|
});
|
|
@@ -383,18 +391,25 @@ var FormField = memo(function FormField({ fieldName, optionsField, nested, field
|
|
|
383
391
|
const fieldOptions = fieldObj.options;
|
|
384
392
|
onChange = (val) => onRowChange(fieldName, arrayIndex ?? 0, flagValue(fieldOptions?.["offOption"], false), flagValue(fieldOptions?.["onOption"], true), val);
|
|
385
393
|
}
|
|
394
|
+
const required = !fieldObj.optional && !fieldObj.disabled && fieldObj.type !== "boolean" && !editing;
|
|
386
395
|
const input = /* @__PURE__ */ jsx("div", {
|
|
387
|
-
className:
|
|
388
|
-
children: /* @__PURE__ */ jsx(
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
className: inRow ? "grid grid-rows-subgrid [&>:not([data-field-row])]:row-span-2" : cx("flex w-full", labelPosition === "left" ? "mb-[15px]" : "mb-[5px]"),
|
|
397
|
+
children: /* @__PURE__ */ jsx(RequiredFieldContext, {
|
|
398
|
+
value: required ? {
|
|
399
|
+
name,
|
|
400
|
+
message: strings.required
|
|
401
|
+
} : null,
|
|
402
|
+
children: /* @__PURE__ */ jsx(Registry, {
|
|
403
|
+
field: fieldObj,
|
|
404
|
+
label: fieldObj.label ?? "",
|
|
405
|
+
labelPosition,
|
|
406
|
+
error: errorMessage(get(errors, name), strings),
|
|
407
|
+
onChange,
|
|
408
|
+
disabled: Boolean(fieldObj.disabled),
|
|
409
|
+
computeOn: computeOn || fieldObj.computeOn,
|
|
410
|
+
spaceCompact,
|
|
411
|
+
tooltipComponent
|
|
412
|
+
})
|
|
398
413
|
})
|
|
399
414
|
});
|
|
400
415
|
if (!editing || !path) return input;
|
|
@@ -409,6 +424,13 @@ var FormField = memo(function FormField({ fieldName, optionsField, nested, field
|
|
|
409
424
|
})
|
|
410
425
|
});
|
|
411
426
|
});
|
|
427
|
+
/** The message under a field for its error, if it has one of its own rather than errors in fields
|
|
428
|
+
* inside it. */
|
|
429
|
+
function errorMessage(error, strings) {
|
|
430
|
+
if (typeof error?.type !== "string") return;
|
|
431
|
+
if (typeof error.message === "string" && error.message !== "") return error.message;
|
|
432
|
+
return error.type === "server" ? strings.checkValue : strings.required;
|
|
433
|
+
}
|
|
412
434
|
/** Renders a schema's fields. Inside another field, `parentInfo` says where their values sit. */
|
|
413
435
|
function FieldsFromOptions({ options = {}, parentInfo, labelPosition = "left", spaceCompact = false }) {
|
|
414
436
|
const editing = useFormEditing();
|
|
@@ -543,16 +565,16 @@ function DynamicFormContent({ options, labelPosition, spaceCompact, organization
|
|
|
543
565
|
options: opts
|
|
544
566
|
}), onSubmit !== void 0 && !workflowForm && /* @__PURE__ */ jsx("div", {
|
|
545
567
|
className: "mt-4",
|
|
546
|
-
children: /* @__PURE__ */ jsx(
|
|
568
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
547
569
|
type: "submit",
|
|
548
|
-
|
|
549
|
-
|
|
570
|
+
variant: "primary",
|
|
571
|
+
children: submitLabel
|
|
550
572
|
})
|
|
551
573
|
})] })]
|
|
552
574
|
});
|
|
553
575
|
}
|
|
554
576
|
var NO_FIELDS = {};
|
|
555
|
-
var
|
|
577
|
+
var NO_SERVER_ERRORS = [];
|
|
556
578
|
/** A form drawn from a workflow's schema. */
|
|
557
579
|
function DynamicForm({ form, ...props }) {
|
|
558
580
|
return form ? /* @__PURE__ */ jsx(DynamicFormBody, {
|
|
@@ -567,7 +589,8 @@ function OwnForm(props) {
|
|
|
567
589
|
form
|
|
568
590
|
});
|
|
569
591
|
}
|
|
570
|
-
function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false, initialValues, onValuesChange, labelPosition = "left",
|
|
592
|
+
function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false, initialValues, onValuesChange, labelPosition = "left", serverErrors = NO_SERVER_ERRORS, spaceCompact = false, organizationVariables, remoteVars, needsOrganizationVariables = false, onSubmit, submitLabel, className = "w-full", workflowForm = false, contextKey, skipValueParse = false, fields = NO_FIELDS, allowLayoutCSS = false }) {
|
|
593
|
+
const { common } = useStrings();
|
|
571
594
|
const engine = useWorkflowEngine();
|
|
572
595
|
const [parseReady, setParseReady] = useState(() => engine.isReady());
|
|
573
596
|
useEffect(() => {
|
|
@@ -610,17 +633,7 @@ function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false,
|
|
|
610
633
|
callback: ({ values }) => report(values)
|
|
611
634
|
}), [form]);
|
|
612
635
|
const formOptions = useMemo(() => ({ workflowForm }), [workflowForm]);
|
|
613
|
-
const
|
|
614
|
-
useEffect(() => {
|
|
615
|
-
if (!missing || loaded === void 0) return;
|
|
616
|
-
const names = missing.split("\n").map(fieldPath);
|
|
617
|
-
for (const name of names) form.setError(name, { type: "required" });
|
|
618
|
-
return () => form.clearErrors(names);
|
|
619
|
-
}, [
|
|
620
|
-
form,
|
|
621
|
-
missing,
|
|
622
|
-
loaded
|
|
623
|
-
]);
|
|
636
|
+
const checks = useServerErrors(form, serverErrors, loaded !== void 0);
|
|
624
637
|
return /* @__PURE__ */ jsx(FieldRegistryContext.Provider, {
|
|
625
638
|
value: fields,
|
|
626
639
|
children: /* @__PURE__ */ jsx(LayoutCSSContext.Provider, {
|
|
@@ -633,16 +646,19 @@ function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false,
|
|
|
633
646
|
...form,
|
|
634
647
|
children: /* @__PURE__ */ jsx("form", {
|
|
635
648
|
className: "w-full text-[13px]",
|
|
636
|
-
onSubmit: form.handleSubmit((values) => onSubmit?.(values)),
|
|
637
|
-
children: /* @__PURE__ */ jsx(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
649
|
+
onSubmit: (event) => checks.check(() => form.handleSubmit((values) => onSubmit?.(values))(event)),
|
|
650
|
+
children: /* @__PURE__ */ jsx(FormChecksContext, {
|
|
651
|
+
value: checks,
|
|
652
|
+
children: /* @__PURE__ */ jsx(DynamicFormContent, {
|
|
653
|
+
options,
|
|
654
|
+
labelPosition,
|
|
655
|
+
spaceCompact,
|
|
656
|
+
organizationVariables,
|
|
657
|
+
remoteVars,
|
|
658
|
+
onSubmit,
|
|
659
|
+
submitLabel: submitLabel ?? common.submit,
|
|
660
|
+
contextKey
|
|
661
|
+
})
|
|
646
662
|
})
|
|
647
663
|
})
|
|
648
664
|
})
|
|
@@ -651,5 +667,84 @@ function DynamicFormBody({ form, formJSONs: options = {}, reinitialize = false,
|
|
|
651
667
|
})
|
|
652
668
|
});
|
|
653
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* The server's errors on the form: each is set on its field until the person changes the field's
|
|
672
|
+
* value, and set again whenever the host reports a new set. A check of the form sets them aside while
|
|
673
|
+
* it runs, so they never hold the person back.
|
|
674
|
+
*/
|
|
675
|
+
function useServerErrors(form, serverErrors, loaded) {
|
|
676
|
+
const key = JSON.stringify(serverErrors.map((error) => [fieldPath(error.path), error.message ?? ""]).filter(([path]) => path !== ""));
|
|
677
|
+
const [given, setGiven] = useState({
|
|
678
|
+
key,
|
|
679
|
+
open: openErrors(key)
|
|
680
|
+
});
|
|
681
|
+
let open = given.open;
|
|
682
|
+
if (given.key !== key) {
|
|
683
|
+
open = openErrors(key);
|
|
684
|
+
setGiven({
|
|
685
|
+
key,
|
|
686
|
+
open
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
const latest = useRef(open);
|
|
690
|
+
useEffect(() => {
|
|
691
|
+
latest.current = open;
|
|
692
|
+
if (!loaded || open.size === 0) return;
|
|
693
|
+
const paths = [...open.keys()];
|
|
694
|
+
const read = (values, path) => JSON.stringify(getValueUsingPath(values, path));
|
|
695
|
+
const before = new Map(paths.map((path) => [path, read(form.getValues(), path)]));
|
|
696
|
+
for (const [path, message] of open) setServerError(form, path, message);
|
|
697
|
+
const unsubscribe = form.subscribe({
|
|
698
|
+
formState: { values: true },
|
|
699
|
+
callback: ({ values }) => {
|
|
700
|
+
const changed = paths.filter((path) => read(values, path) !== before.get(path));
|
|
701
|
+
if (changed.length > 0) setGiven((current) => ({
|
|
702
|
+
key: current.key,
|
|
703
|
+
open: new Map([...current.open].filter(([path]) => !changed.includes(path)))
|
|
704
|
+
}));
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
return () => {
|
|
708
|
+
unsubscribe();
|
|
709
|
+
clearServerErrors(form, paths);
|
|
710
|
+
};
|
|
711
|
+
}, [
|
|
712
|
+
form,
|
|
713
|
+
open,
|
|
714
|
+
loaded
|
|
715
|
+
]);
|
|
716
|
+
const check = useCallback(async (run) => {
|
|
717
|
+
const kept = latest.current;
|
|
718
|
+
clearServerErrors(form, kept.keys());
|
|
719
|
+
try {
|
|
720
|
+
return await run();
|
|
721
|
+
} finally {
|
|
722
|
+
for (const [path, message] of kept) if (!form.getFieldState(path).error) setServerError(form, path, message);
|
|
723
|
+
}
|
|
724
|
+
}, [form]);
|
|
725
|
+
return useMemo(() => ({
|
|
726
|
+
serverErrors: new Set(open.keys()),
|
|
727
|
+
serverErrorsKey: key,
|
|
728
|
+
check
|
|
729
|
+
}), [
|
|
730
|
+
open,
|
|
731
|
+
key,
|
|
732
|
+
check
|
|
733
|
+
]);
|
|
734
|
+
}
|
|
735
|
+
/** The server's errors in a set, by store path, to the message each gives, if any. */
|
|
736
|
+
function openErrors(key) {
|
|
737
|
+
return new Map(JSON.parse(key));
|
|
738
|
+
}
|
|
739
|
+
function setServerError(form, path, message) {
|
|
740
|
+
form.setError(path, message ? {
|
|
741
|
+
type: "server",
|
|
742
|
+
message
|
|
743
|
+
} : { type: "server" });
|
|
744
|
+
}
|
|
745
|
+
/** Clears the server's errors at these paths, leaving any error the form's own check set there. */
|
|
746
|
+
function clearServerErrors(form, paths) {
|
|
747
|
+
for (const path of paths) if (form.getFieldState(path).error?.type === "server") form.clearErrors(path);
|
|
748
|
+
}
|
|
654
749
|
//#endregion
|
|
655
750
|
export { DynamicDefaultsSync, DynamicForm, FieldsFromOptions, collectFieldsWithDefaults, defaultReferencesField, findSelfReferencingFieldNames, listLengthsSignature, resolveMetaOverrides, useDynamicDefaultsSync };
|
package/dist/form/FormLayout.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { cx } from "../cx.js";
|
|
2
|
+
import { FieldRowContext } from "../components/Field.js";
|
|
1
3
|
import { layoutBreakpoints, responsiveLayoutValues } from "./layout.js";
|
|
2
4
|
import { resolveLayoutCSS } from "./layoutCSS.js";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { createContext, useContext, useId, useMemo } from "react";
|
|
6
7
|
//#region src/form/FormLayout.tsx
|
|
@@ -20,26 +21,30 @@ function FormLayout({ layout, renderField }) {
|
|
|
20
21
|
const allowCSS = useContext(LayoutCSSContext);
|
|
21
22
|
return /* @__PURE__ */ jsx("div", {
|
|
22
23
|
"data-layout-boundary": true,
|
|
23
|
-
className:
|
|
24
|
+
className: cx("min-w-0 max-w-full", allowCSS && "isolate [contain:paint] p-0.5"),
|
|
24
25
|
children: /* @__PURE__ */ jsx(LayoutNode, {
|
|
25
26
|
node: layout,
|
|
26
27
|
renderField
|
|
27
28
|
})
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
function LayoutNode({ node, renderField, sharedRows }) {
|
|
31
|
+
function LayoutNode({ node, renderField, sharedRows, inRow = false }) {
|
|
31
32
|
const labelId = useId();
|
|
32
33
|
const descriptionId = useId();
|
|
33
34
|
const allowCSS = useContext(LayoutCSSContext);
|
|
34
35
|
const customStyle = useMemo(() => allowCSS ? resolveLayoutCSS(node.css).style : {}, [allowCSS, node.css]);
|
|
35
36
|
if (node.type === "field") return /* @__PURE__ */ jsx("div", {
|
|
36
37
|
"data-layout-field": node.field,
|
|
37
|
-
className: "min-w-0 max-w-full empty:hidden [&>div]:mb-0",
|
|
38
|
+
className: cx("min-w-0 max-w-full empty:hidden [&>div]:mb-0", inRow && "contents [&>*]:row-span-2"),
|
|
38
39
|
style: customStyle,
|
|
39
|
-
children:
|
|
40
|
+
children: /* @__PURE__ */ jsx(FieldRowContext, {
|
|
41
|
+
value: inRow,
|
|
42
|
+
children: renderField(node.field)
|
|
43
|
+
})
|
|
40
44
|
});
|
|
41
45
|
const columns = responsiveLayoutValues(node.type === "grid" ? node.columns : 1, 1);
|
|
42
46
|
const alignRows = node.type === "grid" && node.align === "rows";
|
|
47
|
+
const alignFields = node.type === "grid" && !alignRows;
|
|
43
48
|
const childSharedRows = alignRows ? Object.fromEntries(layoutBreakpoints.map((key) => [key, trackCount(columns[key]) > 1])) : void 0;
|
|
44
49
|
const rowCount = alignRows ? Math.max(0, ...node.children.map((child) => child.type === "section" ? child.children.length : 0)) + 1 : 1;
|
|
45
50
|
const children = node.children.map((child, index) => {
|
|
@@ -47,12 +52,13 @@ function LayoutNode({ node, renderField, sharedRows }) {
|
|
|
47
52
|
const style = Object.fromEntries(layoutBreakpoints.flatMap((key) => [[`--layout-span-${key}`, Math.min(spans[key], trackCount(columns[key]))], [`--layout-slot-${key}`, sharedRows?.[key] ? index + 2 : "auto"]]));
|
|
48
53
|
return /* @__PURE__ */ jsx("div", {
|
|
49
54
|
"data-layout-item": true,
|
|
50
|
-
className:
|
|
55
|
+
className: cx("min-w-0 text-sm", visible, sharedRows && slotClass, alignRows && sharedRowsClass, alignFields && (child.type === "field" ? "row-span-2 grid grid-rows-subgrid gap-y-1.5" : "row-span-2 self-start"), node.type === "grid" && "col-span-(--layout-span-base) @min-[24rem]/layout:col-span-(--layout-span-sm) @min-[40rem]/layout:col-span-(--layout-span-md) @min-[64rem]/layout:col-span-(--layout-span-lg)"),
|
|
51
56
|
style,
|
|
52
57
|
children: /* @__PURE__ */ jsx(LayoutNode, {
|
|
53
58
|
node: child,
|
|
54
59
|
renderField,
|
|
55
|
-
sharedRows: childSharedRows
|
|
60
|
+
sharedRows: childSharedRows,
|
|
61
|
+
inRow: alignFields
|
|
56
62
|
})
|
|
57
63
|
}, child.type === "field" ? `field:${child.field}` : `container:${index}`);
|
|
58
64
|
});
|
|
@@ -75,9 +81,9 @@ function LayoutNode({ node, renderField, sharedRows }) {
|
|
|
75
81
|
};
|
|
76
82
|
return /* @__PURE__ */ jsx("div", {
|
|
77
83
|
"data-layout-grid": true,
|
|
78
|
-
className:
|
|
84
|
+
className: cx("@container/layout min-w-0 max-w-full", visible),
|
|
79
85
|
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
-
className:
|
|
86
|
+
className: cx("grid gap-(--layout-gap) grid-cols-(--layout-columns-base) @min-[24rem]/layout:grid-cols-(--layout-columns-sm) @min-[40rem]/layout:grid-cols-(--layout-columns-md) @min-[64rem]/layout:grid-cols-(--layout-columns-lg)"),
|
|
81
87
|
style,
|
|
82
88
|
children
|
|
83
89
|
})
|
|
@@ -88,7 +94,7 @@ function LayoutNode({ node, renderField, sharedRows }) {
|
|
|
88
94
|
"aria-labelledby": labelId,
|
|
89
95
|
"aria-describedby": node.description ? descriptionId : void 0,
|
|
90
96
|
"data-layout-section": true,
|
|
91
|
-
className:
|
|
97
|
+
className: cx("min-w-0 max-w-full text-sm gap-(--layout-gap)", sharedRowsClass, visible),
|
|
92
98
|
style: customStyle,
|
|
93
99
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
94
100
|
"data-layout-header": true,
|
|
@@ -118,7 +124,7 @@ function LayoutNode({ node, renderField, sharedRows }) {
|
|
|
118
124
|
});
|
|
119
125
|
if (node.type === "section") return /* @__PURE__ */ jsxs("fieldset", {
|
|
120
126
|
"data-layout-section": true,
|
|
121
|
-
className:
|
|
127
|
+
className: cx("min-w-0 max-w-full border-0 p-0", visible),
|
|
122
128
|
"aria-describedby": node.description ? descriptionId : void 0,
|
|
123
129
|
style: customStyle,
|
|
124
130
|
children: [/* @__PURE__ */ jsx("legend", {
|
|
@@ -136,7 +142,7 @@ function LayoutNode({ node, renderField, sharedRows }) {
|
|
|
136
142
|
});
|
|
137
143
|
return /* @__PURE__ */ jsx("div", {
|
|
138
144
|
"data-layout-stack": true,
|
|
139
|
-
className:
|
|
145
|
+
className: cx("min-w-0 max-w-full", visible),
|
|
140
146
|
children: body
|
|
141
147
|
});
|
|
142
148
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useStrings, useWorkflowEngine } from "../../components/Provider.js";
|
|
2
|
+
import { Button } from "../../components/Button.js";
|
|
2
3
|
import { copyBounds, stepText } from "./utils.js";
|
|
3
4
|
import { initializeValues } from "../lib.js";
|
|
5
|
+
import { FormChecksContext } from "../validation.js";
|
|
4
6
|
import { useFormEditing } from "../formEditing.js";
|
|
5
7
|
import { fieldPath } from "../utils/fieldPath.js";
|
|
6
8
|
import { getValueUsingPath } from "../utils/getValueUsingPath.js";
|
|
@@ -10,12 +12,13 @@ import { WizardStepContent } from "./WizardStepContent.js";
|
|
|
10
12
|
import { WizardStepIndicator } from "./WizardStepIndicator.js";
|
|
11
13
|
import { WizardPagesContext } from "./wizardPages.js";
|
|
12
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
15
|
+
import { useCallback, useContext, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
14
16
|
import { useFormContext, useWatch } from "react-hook-form";
|
|
15
17
|
//#region src/form/Wizard/WizardContainer.tsx
|
|
16
18
|
function WizardContainer({ wizardConfig, onSubmit, className = "", labelPosition = "left", spaceCompact = false, nested = false, fieldNamePrefix = "" }) {
|
|
17
19
|
const form = useFormContext();
|
|
18
|
-
const { control, getValues,
|
|
20
|
+
const { control, getValues, trigger, subscribe } = form;
|
|
21
|
+
const { check, serverErrors, serverErrorsKey } = useContext(FormChecksContext);
|
|
19
22
|
const editing = useFormEditing();
|
|
20
23
|
const pages = useContext(WizardPagesContext);
|
|
21
24
|
const [ownPage, setOwnPage] = useState(0);
|
|
@@ -162,35 +165,51 @@ function WizardContainer({ wizardConfig, onSubmit, className = "", labelPosition
|
|
|
162
165
|
setFieldValue
|
|
163
166
|
]);
|
|
164
167
|
const configs = useMemo(() => Object.fromEntries(Object.entries(shown.byKey).map(([key, page]) => [key, page.config])), [shown]);
|
|
165
|
-
const
|
|
168
|
+
const pagePaths = useCallback((pageKey) => {
|
|
166
169
|
const page = shown.byKey[pageKey];
|
|
167
|
-
if (!page?.config.options) return
|
|
170
|
+
if (!page?.config.options) return [];
|
|
168
171
|
const stepPrefix = page.copy !== void 0 ? `${fieldNamePrefix}${page.step}[${page.copy}].` : config.flatten !== false ? fieldNamePrefix : `${fieldNamePrefix}${page.step}.`;
|
|
169
|
-
return
|
|
172
|
+
return fieldsOf(page.config.options).map((name) => fieldPath(`${stepPrefix}${name}`));
|
|
170
173
|
}, [
|
|
171
174
|
shown,
|
|
172
175
|
config,
|
|
173
|
-
fieldNamePrefix
|
|
174
|
-
|
|
176
|
+
fieldNamePrefix
|
|
177
|
+
]);
|
|
178
|
+
const validateCurrentStep = useCallback(async (pageKey) => {
|
|
179
|
+
const paths = pagePaths(pageKey);
|
|
180
|
+
return paths.length === 0 || check(() => trigger(paths));
|
|
181
|
+
}, [
|
|
182
|
+
pagePaths,
|
|
183
|
+
check,
|
|
184
|
+
trigger
|
|
175
185
|
]);
|
|
176
186
|
const { currentStep, visitedSteps, invalidSteps, isLastStep, canGoBack, goToNext, goToPrevious, jumpToStep, showStep } = useWizardState({
|
|
177
187
|
stepOrder: shown.order,
|
|
178
188
|
steps: configs,
|
|
179
189
|
validateStep: validateCurrentStep
|
|
180
190
|
});
|
|
191
|
+
const turnToServerError = useEffectEvent(() => {
|
|
192
|
+
if (editing || serverErrors.size === 0) return;
|
|
193
|
+
const holds = (path) => [...serverErrors].some((error) => error === path || error.startsWith(`${path}.`));
|
|
194
|
+
const key = shown.order.find((pageKey) => pagePaths(pageKey).some(holds));
|
|
195
|
+
if (key !== void 0 && key !== currentStep) showStep(key);
|
|
196
|
+
});
|
|
197
|
+
useEffect(() => turnToServerError(), [serverErrorsKey]);
|
|
181
198
|
const navigation = config.navigation ?? {};
|
|
182
199
|
const handleSubmit = useCallback(async () => {
|
|
183
200
|
if (!isLastStep) return;
|
|
184
201
|
let submitted = false;
|
|
185
|
-
await form.handleSubmit(async (values) => {
|
|
202
|
+
await check(() => form.handleSubmit(async (values) => {
|
|
186
203
|
submitted = true;
|
|
187
204
|
await onSubmit?.(values);
|
|
188
|
-
})();
|
|
189
|
-
if (!submitted) throw new Error(
|
|
205
|
+
})());
|
|
206
|
+
if (!submitted) throw new Error(strings.fixErrorsToContinue);
|
|
190
207
|
}, [
|
|
191
208
|
isLastStep,
|
|
192
209
|
form,
|
|
193
|
-
|
|
210
|
+
check,
|
|
211
|
+
onSubmit,
|
|
212
|
+
strings
|
|
194
213
|
]);
|
|
195
214
|
const last = Math.max(shown.order.length - 1, 0);
|
|
196
215
|
const wizardKey = editing ? JSON.stringify(editing.parent) : "";
|
|
@@ -251,15 +270,15 @@ function WizardContainer({ wizardConfig, onSubmit, className = "", labelPosition
|
|
|
251
270
|
const addTitle = titledPerCopy && page?.count !== void 0 ? perCopy(rawTitle, page.count, true) : stepText(rawTitle);
|
|
252
271
|
const copies = page?.count !== void 0 && (page.canAdd || page.canRemove) ? /* @__PURE__ */ jsxs("div", {
|
|
253
272
|
className: "mb-4 flex items-center justify-between gap-3",
|
|
254
|
-
children: [page.canRemove ? /* @__PURE__ */ jsx(
|
|
255
|
-
|
|
273
|
+
children: [page.canRemove ? /* @__PURE__ */ jsx(Button, {
|
|
274
|
+
size: "sm",
|
|
275
|
+
variant: "ghost",
|
|
256
276
|
onClick: () => removeCopy(page),
|
|
257
|
-
className: "rounded-lg border theme-border px-4 py-2 text-sm theme-muted-text hover:text-(--theme-app)",
|
|
258
277
|
children: strings.removeCopy(removeTitle)
|
|
259
|
-
}) : /* @__PURE__ */ jsx("span", {}), page.canAdd && (page.copy === void 0 || page.copy === page.count - 1) && /* @__PURE__ */ jsx(
|
|
260
|
-
|
|
278
|
+
}) : /* @__PURE__ */ jsx("span", {}), page.canAdd && (page.copy === void 0 || page.copy === page.count - 1) && /* @__PURE__ */ jsx(Button, {
|
|
279
|
+
size: "sm",
|
|
280
|
+
variant: "secondary",
|
|
261
281
|
onClick: () => addCopy(page),
|
|
262
|
-
className: "rounded-lg bg-(--theme-element) px-4 py-2 font-medium text-(--theme-element-text) text-sm",
|
|
263
282
|
children: strings.addCopy(addTitle)
|
|
264
283
|
})]
|
|
265
284
|
}) : null;
|
|
@@ -298,7 +317,7 @@ function WizardContainer({ wizardConfig, onSubmit, className = "", labelPosition
|
|
|
298
317
|
isCurrentStepValid: true,
|
|
299
318
|
nextLabel: page?.config.nextLabel,
|
|
300
319
|
prevLabel: page?.config.prevLabel,
|
|
301
|
-
submitLabel: config.submitLabel ||
|
|
320
|
+
submitLabel: config.submitLabel || strings.runWizard,
|
|
302
321
|
onNext: async () => {
|
|
303
322
|
turn(editIndex + 1);
|
|
304
323
|
return true;
|
|
@@ -356,5 +375,12 @@ function takeAside(aside, index) {
|
|
|
356
375
|
delete aside[index];
|
|
357
376
|
return row;
|
|
358
377
|
}
|
|
378
|
+
/** A page's fields by name, through its groups, whose fields keep their values beside the group's. */
|
|
379
|
+
function fieldsOf(options) {
|
|
380
|
+
return Object.entries(options).flatMap(([name, field]) => {
|
|
381
|
+
const { type, options: inner } = field ?? {};
|
|
382
|
+
return type === "group" && inner && typeof inner === "object" ? fieldsOf(inner) : [name];
|
|
383
|
+
});
|
|
384
|
+
}
|
|
359
385
|
//#endregion
|
|
360
386
|
export { WizardContainer };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { WizardNavigationProps } from './types.js';
|
|
2
|
-
export declare function WizardNavigation({ isLastStep, canGoBack, isCurrentStepValid, nextLabel, prevLabel, submitLabel, onNext, onPrevious, onSubmit, }: WizardNavigationProps): import("react").JSX.Element;
|
|
2
|
+
export declare function WizardNavigation({ isLastStep, canGoBack, isCurrentStepValid, nextLabel, prevLabel, submitLabel: submitLabelProp, onNext, onPrevious, onSubmit, }: WizardNavigationProps): import("react").JSX.Element;
|