@parallelworks/ui 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/ai/adapter/openai/createOpenAIStream.js +3 -2
- package/dist/ai/agent/diff.d.ts +0 -1
- package/dist/ai/agent/diff.js +3 -2
- package/dist/ai/agent/toolfmt.js +2 -3
- package/dist/ai/ai.css +5 -0
- package/dist/ai/components/AllocationSelector.js +3 -2
- package/dist/ai/components/AttachmentManager.js +7 -5
- package/dist/ai/components/AttachmentUpload.js +11 -7
- package/dist/ai/components/BlockedGroupBanner.js +2 -2
- package/dist/ai/components/BranchNavigator.js +8 -5
- package/dist/ai/components/ChatEmptyState.js +8 -5
- package/dist/ai/components/ChatInput.d.ts +2 -5
- package/dist/ai/components/ChatInput.js +16 -11
- package/dist/ai/components/ChatMessage.js +25 -17
- package/dist/ai/components/ChatMessageList.js +4 -3
- package/dist/ai/components/ChatSidebar.d.ts +0 -1
- package/dist/ai/components/ChatSidebar.js +22 -16
- package/dist/ai/components/ChatThread.js +9 -11
- package/dist/ai/components/ComposerChrome.js +2 -2
- package/dist/ai/components/ModelSelector.js +20 -14
- package/dist/ai/components/ShareDialog.js +10 -6
- package/dist/ai/components/SlashMenu.d.ts +0 -1
- package/dist/ai/components/agent/ActivityLine.d.ts +0 -1
- package/dist/ai/components/agent/ActivityLine.js +5 -4
- package/dist/ai/components/agent/AgentMessageParts.d.ts +1 -26
- package/dist/ai/components/agent/AgentMessageParts.js +13 -12
- package/dist/ai/core/ChatProvider.d.ts +2 -6
- package/dist/ai/core/ChatProvider.js +42 -67
- package/dist/ai/core/KeyboardShortcutsProvider.js +1 -1
- package/dist/ai/core/chatReducer.d.ts +0 -6
- package/dist/ai/core/chatReducer.js +1 -15
- package/dist/ai/core/useKeyboardShortcuts.d.ts +3 -1
- package/dist/ai/core/useKeyboardShortcuts.js +9 -11
- package/dist/ai/core/useSSEStream.d.ts +0 -1
- package/dist/ai/core/useSSEStream.js +5 -17
- package/dist/ai/strings.d.ts +0 -1
- package/dist/ai/strings.js +0 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/ai/ui/Avatar.d.ts +1 -2
- package/dist/ai/ui/Avatar.js +7 -18
- package/dist/ai/ui/Dropdown.js +2 -2
- package/dist/ai/ui/Markdown.d.ts +1 -3
- package/dist/ai/ui/Markdown.js +1 -2
- package/dist/ai/ui/Notice.js +5 -3
- package/dist/ai/ui/sidebar.d.ts +0 -1
- package/dist/ai/ui/sidebar.js +5 -3
- package/dist/ai/utils.js +1 -1
- package/dist/components/Avatar.js +4 -2
- package/dist/components/BareModal.js +1 -5
- package/dist/components/Breadcrumbs.js +21 -14
- package/dist/components/Button.js +3 -2
- package/dist/components/Callout.js +4 -3
- package/dist/components/CollapsiblePanel.d.ts +1 -3
- package/dist/components/CollapsiblePanel.js +7 -7
- package/dist/components/CopyToClipboard.js +8 -4
- package/dist/components/CreateModal.js +11 -7
- package/dist/components/Dropdown.d.ts +0 -4
- package/dist/components/Dropdown.js +7 -8
- package/dist/components/Filter.js +2 -2
- package/dist/components/Indicator.js +14 -9
- package/dist/components/Input.js +6 -4
- package/dist/components/Listbox.js +16 -20
- package/dist/components/Loader.js +1 -1
- package/dist/components/MultiSelect.js +5 -8
- package/dist/components/PageHeader.js +10 -7
- package/dist/components/Pagination.js +1 -1
- package/dist/components/Provider.d.ts +0 -8
- package/dist/components/Sort.js +6 -4
- package/dist/components/StatusIcons.d.ts +11 -0
- package/dist/components/StatusIcons.js +20 -0
- package/dist/components/SwitchToggle.js +3 -5
- package/dist/components/Table.d.ts +1 -3
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/dropdownUtils.js +7 -8
- package/dist/components/relativeTime.d.ts +0 -7
- package/dist/components/relativeTime.js +1 -1
- package/dist/duration.js +1 -1
- package/dist/editor/Editor.d.ts +1 -1
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/EditorField.d.ts +0 -1
- package/dist/editor/EditorField.js +8 -8
- package/dist/editor/FormCodePanel.js +20 -23
- package/dist/editor/yamlLanguage.js +2 -2
- package/dist/file-explorer/FileExplorer.js +94 -82
- package/dist/file-explorer/FileExplorerContext.d.ts +1 -2
- package/dist/file-explorer/FileExplorerContext.js +92 -125
- package/dist/file-explorer/FilePreview/Inline.d.ts +1 -2
- package/dist/file-explorer/FilePreview/Inline.js +4 -4
- package/dist/file-explorer/FilePreview/StreamedBadge.js +2 -2
- package/dist/file-explorer/FilePreview/Viewer.js +14 -14
- package/dist/file-explorer/FilePreview/index.d.ts +1 -2
- package/dist/file-explorer/FilePreview/index.js +20 -13
- package/dist/file-explorer/FilePreview/parse.d.ts +2 -1
- package/dist/file-explorer/FilePreview/useObjectBlobUrl.d.ts +5 -4
- package/dist/file-explorer/FilePreview/useObjectBlobUrl.js +23 -36
- package/dist/file-explorer/FilePreview/useObjectText.d.ts +1 -2
- package/dist/file-explorer/FilePreview/useObjectText.js +5 -7
- package/dist/file-explorer/FileRow.js +3 -3
- package/dist/file-explorer/FileRowsWindow.d.ts +5 -12
- package/dist/file-explorer/FileRowsWindow.js +3 -2
- package/dist/file-explorer/FileTable.d.ts +2 -6
- package/dist/file-explorer/LoadMoreRow.d.ts +8 -0
- package/dist/file-explorer/TreeView.d.ts +0 -1
- package/dist/file-explorer/TreeView.js +11 -9
- package/dist/file-explorer/helpers.js +45 -33
- package/dist/file-explorer/lib/fileExplorer.d.ts +0 -2
- package/dist/file-explorer/lib/types.d.ts +0 -1
- package/dist/file-explorer/lib/utils.js +15 -20
- package/dist/file-explorer/toasts.js +54 -45
- package/dist/form/Fields/BooleanField.js +5 -4
- package/dist/form/Fields/CheckboxGroupField.js +5 -4
- package/dist/form/Fields/ColorField.js +5 -4
- package/dist/form/Fields/DropdownField.d.ts +0 -1
- package/dist/form/Fields/DropdownField.js +10 -13
- package/dist/form/Fields/DurationField.js +2 -2
- package/dist/form/Fields/LabelField.js +5 -5
- package/dist/form/Fields/MultiDropdownField.d.ts +1 -1
- package/dist/form/Fields/MultiDropdownField.js +8 -11
- package/dist/form/Fields/NumberField.js +6 -5
- package/dist/form/Fields/ObjectField.d.ts +1 -2
- package/dist/form/Fields/ObjectField.js +22 -21
- package/dist/form/Fields/RadioField.js +4 -3
- package/dist/form/Fields/RangeField.js +7 -6
- package/dist/form/Fields/StringField.js +2 -1
- package/dist/form/Fields/TextAreaField.js +2 -1
- package/dist/form/Form.d.ts +7 -8
- package/dist/form/Form.js +56 -81
- package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -2
- package/dist/form/SpecialTypes/DropdownWrapper.js +1 -3
- package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +1 -3
- package/dist/form/SpecialTypes/FormikCustomDropdown.js +4 -7
- package/dist/form/SpecialTypes/FormikCustomInput.js +16 -13
- package/dist/form/Wizard/WizardContainer.js +8 -25
- package/dist/form/Wizard/WizardNavigation.d.ts +1 -1
- package/dist/form/Wizard/WizardNavigation.js +5 -6
- package/dist/form/Wizard/WizardStepContent.d.ts +1 -1
- package/dist/form/Wizard/WizardStepContent.js +2 -2
- package/dist/form/Wizard/WizardStepIndicator.js +7 -17
- package/dist/form/Wizard/types.d.ts +4 -46
- package/dist/form/Wizard/useWizardState.d.ts +2 -10
- package/dist/form/Wizard/useWizardState.js +42 -92
- package/dist/form/Wizard/utils.js +6 -11
- package/dist/form/lib.js +28 -54
- package/dist/form/types/fieldTypes.d.ts +4 -5
- package/dist/form/utils/dependentOptions.d.ts +6 -0
- package/dist/form/utils/dependentOptions.js +21 -0
- package/dist/form/utils/getParentValue.d.ts +2 -1
- package/dist/form/utils/getParentValue.js +10 -15
- package/dist/form/utils/getValueUsingPath.js +1 -1
- package/dist/graph/AnnotationBanner.d.ts +1 -1
- package/dist/graph/AnnotationBanner.js +10 -6
- package/dist/graph/Collapse.d.ts +3 -3
- package/dist/graph/Collapse.js +3 -8
- package/dist/graph/DependencyGraph.d.ts +5 -4
- package/dist/graph/DependencyGraph.js +178 -226
- package/dist/graph/JobSummary.d.ts +10 -8
- package/dist/graph/JobSummary.js +17 -16
- package/dist/graph/MatrixGroup.d.ts +5 -17
- package/dist/graph/MatrixGroup.js +11 -22
- package/dist/graph/TreeView.d.ts +1 -3
- package/dist/graph/TreeView.js +106 -492
- package/dist/graph/types.d.ts +3 -2
- package/dist/graph/util.d.ts +5 -0
- package/dist/graph/util.js +18 -0
- package/dist/icons/ai/AiOutlineRollback.js +16 -0
- package/dist/icons/bi/BiBell.js +16 -0
- package/dist/icons/bi/BiBellOff.js +16 -0
- package/dist/icons/bi/BiBuildings.js +20 -0
- package/dist/icons/bi/BiError.js +20 -0
- package/dist/icons/bi/BiExpandVertical.js +16 -0
- package/dist/icons/bi/BiPause.js +16 -0
- package/dist/icons/bi/BiPlay.js +16 -0
- package/dist/icons/bi/BiSolidCheckShield.js +16 -0
- package/dist/icons/bi/BiSolidTrashAlt.js +16 -0
- package/dist/icons/bi/BiStop.js +16 -0
- package/dist/icons/bs/BsArrowsCollapse.js +22 -0
- package/dist/icons/bs/BsBank2.js +19 -0
- package/dist/icons/bs/BsBriefcase.js +19 -0
- package/dist/icons/bs/BsBucket.js +19 -0
- package/dist/icons/bs/BsCalendarX.js +23 -0
- package/dist/icons/bs/BsChatLeft.js +19 -0
- package/dist/icons/bs/BsChevronDoubleDown.js +29 -0
- package/dist/icons/bs/BsChevronDoubleUp.js +29 -0
- package/dist/icons/bs/BsClipboardCheck.js +34 -0
- package/dist/icons/bs/BsCurrencyDollar.js +19 -0
- package/dist/icons/bs/BsDash.js +19 -0
- package/dist/icons/bs/BsFileEarmarkZip.js +23 -0
- package/dist/icons/bs/BsFiles.js +19 -0
- package/dist/icons/bs/BsGeoAlt.js +23 -0
- package/dist/icons/bs/BsGrid.js +19 -0
- package/dist/icons/bs/BsLayers.js +19 -0
- package/dist/icons/bs/BsLayoutThreeColumns.js +19 -0
- package/dist/icons/bs/BsListUl.js +22 -0
- package/dist/icons/bs/BsMortarboard.js +23 -0
- package/dist/icons/bs/BsMusicNoteBeamed.js +34 -0
- package/dist/icons/bs/BsOpenai.js +19 -0
- package/dist/icons/bs/BsPersonPlus.js +26 -0
- package/dist/icons/bs/BsSearch.js +19 -0
- package/dist/icons/bs/BsSend.js +19 -0
- package/dist/icons/bs/BsShieldSlash.js +22 -0
- package/dist/icons/bs/BsStar.js +19 -0
- package/dist/icons/bs/BsStarFill.js +19 -0
- package/dist/icons/bs/BsStopCircle.js +23 -0
- package/dist/icons/bs/BsTag.js +23 -0
- package/dist/icons/bs/BsTelephone.js +19 -0
- package/dist/icons/bs/BsTerminal.js +23 -0
- package/dist/icons/bs/BsTerminalFill.js +19 -0
- package/dist/icons/bs/BsThreeDots.js +19 -0
- package/dist/icons/bs/BsThreeDotsVertical.js +19 -0
- package/dist/icons/bs/BsZoomIn.js +37 -0
- package/dist/icons/fa/FaAmazon.js +16 -0
- package/dist/icons/fa/FaAngleDown.js +16 -0
- package/dist/icons/fa/FaAngleLeft.js +16 -0
- package/dist/icons/fa/FaAngleRight.js +16 -0
- package/dist/icons/fa/FaAngleUp.js +16 -0
- package/dist/icons/fa/FaArrowDown.js +16 -0
- package/dist/icons/fa/FaArrowLeft.js +16 -0
- package/dist/icons/fa/FaArrowRight.js +16 -0
- package/dist/icons/fa/FaArrowUp.js +16 -0
- package/dist/icons/fa/FaBalanceScale.js +16 -0
- package/dist/icons/fa/FaCaretDown.js +16 -0
- package/dist/icons/fa/FaCentos.js +16 -0
- package/dist/icons/fa/FaChartLine.js +16 -0
- package/dist/icons/fa/FaChartPie.js +16 -0
- package/dist/icons/fa/FaCheck.js +16 -0
- package/dist/icons/fa/FaChevronDown.js +16 -0
- package/dist/icons/fa/FaChevronUp.js +16 -0
- package/dist/icons/fa/FaChrome.js +16 -0
- package/dist/icons/fa/FaCircleNotch.js +16 -0
- package/dist/icons/fa/FaCloud.js +16 -0
- package/dist/icons/fa/FaCloudDownloadAlt.js +16 -0
- package/dist/icons/fa/FaCog.js +16 -0
- package/dist/icons/fa/FaCogs.js +16 -0
- package/dist/icons/fa/FaComments.js +16 -0
- package/dist/icons/fa/FaCompress.js +16 -0
- package/dist/icons/fa/FaDesktop.js +16 -0
- package/dist/icons/fa/FaDocker.js +16 -0
- package/dist/icons/fa/FaDollarSign.js +16 -0
- package/dist/icons/fa/FaEdge.js +16 -0
- package/dist/icons/fa/FaEdit.js +16 -0
- package/dist/icons/fa/FaExclamationTriangle.js +16 -0
- package/dist/icons/fa/FaExpand.js +16 -0
- package/dist/icons/fa/FaEye.js +16 -0
- package/dist/icons/fa/FaEyeSlash.js +16 -0
- package/dist/icons/fa/FaFile.js +16 -0
- package/dist/icons/fa/FaFilePdf.js +16 -0
- package/dist/icons/fa/FaFilter.js +16 -0
- package/dist/icons/fa/FaFirefoxBrowser.js +16 -0
- package/dist/icons/fa/FaFlask.js +16 -0
- package/dist/icons/fa/FaFolder.js +16 -0
- package/dist/icons/fa/FaGithub.js +16 -0
- package/dist/icons/fa/FaGitlab.js +16 -0
- package/dist/icons/fa/FaGlobe.js +16 -0
- package/dist/icons/fa/FaGlobeAmericas.js +16 -0
- package/dist/icons/fa/FaImage.js +16 -0
- package/dist/icons/fa/FaInfoCircle.js +16 -0
- package/dist/icons/fa/FaKey.js +16 -0
- package/dist/icons/fa/FaLayerGroup.js +16 -0
- package/dist/icons/fa/FaLink.js +16 -0
- package/dist/icons/fa/FaLinkedin.js +16 -0
- package/dist/icons/fa/FaLinux.js +16 -0
- package/dist/icons/fa/FaList.js +16 -0
- package/dist/icons/fa/FaLock.js +16 -0
- package/dist/icons/fa/FaOpenid.js +16 -0
- package/dist/icons/fa/FaOpera.js +16 -0
- package/dist/icons/fa/FaPaperclip.js +16 -0
- package/dist/icons/fa/FaPlus.js +16 -0
- package/dist/icons/fa/FaPowerOff.js +16 -0
- package/dist/icons/fa/FaPrint.js +16 -0
- package/dist/icons/fa/FaQrcode.js +16 -0
- package/dist/icons/fa/FaQuestionCircle.js +16 -0
- package/dist/icons/fa/FaRedhat.js +16 -0
- package/dist/icons/fa/FaRegCircle.js +16 -0
- package/dist/icons/fa/FaRegFileImage.js +16 -0
- package/dist/icons/fa/FaRegFolder.js +16 -0
- package/dist/icons/fa/FaRobot.js +16 -0
- package/dist/icons/fa/FaRocket.js +16 -0
- package/dist/icons/fa/FaRunning.js +16 -0
- package/dist/icons/fa/FaSafari.js +16 -0
- package/dist/icons/fa/FaSave.js +16 -0
- package/dist/icons/fa/FaSearch.js +16 -0
- package/dist/icons/fa/FaShieldAlt.js +16 -0
- package/dist/icons/fa/FaSlack.js +16 -0
- package/dist/icons/fa/FaStar.js +16 -0
- package/dist/icons/fa/FaStop.js +16 -0
- package/dist/icons/fa/FaSuse.js +16 -0
- package/dist/icons/fa/FaTerminal.js +16 -0
- package/dist/icons/fa/FaTimes.js +16 -0
- package/dist/icons/fa/FaUbuntu.js +16 -0
- package/dist/icons/fa/FaUndoAlt.js +16 -0
- package/dist/icons/fa/FaUnlink.js +16 -0
- package/dist/icons/fa/FaUser.js +16 -0
- package/dist/icons/fa/FaUsers.js +16 -0
- package/dist/icons/fa/FaWindows.js +16 -0
- package/dist/icons/fa6/FaApple.js +16 -0
- package/dist/icons/fa6/FaArrowsRotate.js +16 -0
- package/dist/icons/fa6/FaDebian.js +16 -0
- package/dist/icons/fa6/FaFilterCircleXmark.js +16 -0
- package/dist/icons/fa6/FaInbox.js +16 -0
- package/dist/icons/fa6/FaLocationDot.js +16 -0
- package/dist/icons/fa6/FaRegFilePdf.js +16 -0
- package/dist/icons/fa6/FaRegFolderOpen.js +16 -0
- package/dist/icons/fa6/FaUpRightFromSquare.js +16 -0
- package/dist/icons/fa6/FaWandMagicSparkles.js +16 -0
- package/dist/icons/fa6/FaXTwitter.js +16 -0
- package/dist/icons/fi/FiActivity.js +23 -0
- package/dist/icons/fi/FiAlertCircle.js +49 -0
- package/dist/icons/fi/FiChevronDown.js +23 -0
- package/dist/icons/fi/FiClock.js +31 -0
- package/dist/icons/fi/FiCopy.js +34 -0
- package/dist/icons/fi/FiDownload.js +40 -0
- package/dist/icons/fi/FiFile.js +27 -0
- package/dist/icons/fi/FiFileText.js +55 -0
- package/dist/icons/fi/FiHardDrive.js +55 -0
- package/dist/icons/fi/FiRotateCcw.js +27 -0
- package/dist/icons/fi/FiUpload.js +40 -0
- package/dist/icons/fi/FiX.js +37 -0
- package/dist/icons/fi/FiZap.js +23 -0
- package/dist/icons/gi/GiSpy.js +16 -0
- package/dist/icons/go/GoGitCommit.js +16 -0
- package/dist/icons/go/GoGitPullRequest.js +20 -0
- package/dist/icons/go/GoIssueOpened.js +16 -0
- package/dist/icons/go/GoPlus.js +16 -0
- package/dist/icons/go/GoRepoForked.js +28 -0
- package/dist/icons/go/GoSignOut.js +16 -0
- package/dist/icons/go/GoSkip.js +20 -0
- package/dist/icons/go/GoVideo.js +20 -0
- package/dist/icons/gr/GrCloudComputer.js +20 -0
- package/dist/icons/gr/GrInbox.js +20 -0
- package/dist/icons/gr/GrServerCluster.js +20 -0
- package/dist/icons/gr/GrStorage.js +20 -0
- package/dist/icons/gr/GrTasks.js +20 -0
- package/dist/icons/hi/HiCog.js +24 -0
- package/dist/icons/hi/HiDuplicate.js +24 -0
- package/dist/icons/hi/HiOutlineArchive.js +26 -0
- package/dist/icons/hi/HiOutlineClipboardCopy.js +26 -0
- package/dist/icons/hi/HiOutlineHome.js +26 -0
- package/dist/icons/hi/HiQuestionMarkCircle.js +24 -0
- package/dist/icons/hi/HiServer.js +24 -0
- package/dist/icons/hi2/HiMiniCheckCircle.js +24 -0
- package/dist/icons/hi2/HiMiniLanguage.js +28 -0
- package/dist/icons/hi2/HiMiniMinusCircle.js +24 -0
- package/dist/icons/hi2/HiMiniXCircle.js +24 -0
- package/dist/icons/hi2/HiSparkles.js +24 -0
- package/dist/icons/im/ImSpinner5.js +19 -0
- package/dist/icons/io/IoIosNotifications.js +16 -0
- package/dist/icons/io/IoMdBuild.js +16 -0
- package/dist/icons/io/IoMdClose.js +16 -0
- package/dist/icons/io5/IoCloudUploadOutline.js +32 -0
- package/dist/icons/io5/IoDocumentTextOutline.js +31 -0
- package/dist/icons/io5/IoFileTrayFullOutline.js +31 -0
- package/dist/icons/io5/IoHeart.js +16 -0
- package/dist/icons/io5/IoHeartDislike.js +16 -0
- package/dist/icons/io5/IoHeartOutline.js +22 -0
- package/dist/icons/io5/IoInformationCircleOutline.js +50 -0
- package/dist/icons/io5/IoSettingsOutline.js +22 -0
- package/dist/icons/io5/IoWarningOutline.js +40 -0
- package/dist/icons/lu/LuArrowRight.js +27 -0
- package/dist/icons/lu/LuBadgeCheck.js +27 -0
- package/dist/icons/lu/LuBrainCircuit.js +101 -0
- package/dist/icons/lu/LuCalendar.js +46 -0
- package/dist/icons/lu/LuCheck.js +23 -0
- package/dist/icons/lu/LuChevronLeft.js +23 -0
- package/dist/icons/lu/LuChevronRight.js +23 -0
- package/dist/icons/lu/LuExternalLink.js +35 -0
- package/dist/icons/lu/LuEye.js +31 -0
- package/dist/icons/lu/LuEyeOff.js +40 -0
- package/dist/icons/lu/LuFolderTree.js +40 -0
- package/dist/icons/lu/LuIdCard.js +55 -0
- package/dist/icons/lu/LuLogs.js +65 -0
- package/dist/icons/lu/LuMail.js +33 -0
- package/dist/icons/lu/LuMegaphone.js +27 -0
- package/dist/icons/lu/LuMoon.js +23 -0
- package/dist/icons/lu/LuPartyPopper.js +65 -0
- package/dist/icons/lu/LuSettings2.js +48 -0
- package/dist/icons/lu/LuSheet.js +72 -0
- package/dist/icons/lu/LuShield.js +23 -0
- package/dist/icons/lu/LuSun.js +69 -0
- package/dist/icons/lu/LuX.js +27 -0
- package/dist/icons/lu/LuZoomIn.js +59 -0
- package/dist/icons/lu/LuZoomOut.js +49 -0
- package/dist/icons/md/MdClear.js +23 -0
- package/dist/icons/md/MdDragHandle.js +23 -0
- package/dist/icons/md/MdInstallDesktop.js +31 -0
- package/dist/icons/md/MdOutlineAttachMoney.js +23 -0
- package/dist/icons/md/MdOutlineMoneyOff.js +23 -0
- package/dist/icons/md/MdPieChart.js +23 -0
- package/dist/icons/md/MdRefresh.js +23 -0
- package/dist/icons/md/MdReplay.js +23 -0
- package/dist/icons/md/MdSmartphone.js +23 -0
- package/dist/icons/pi/PiArrowBendUpRightBold.js +19 -0
- package/dist/icons/pi/PiPlugsConnectedFill.js +19 -0
- package/dist/icons/pi/PiRectangleDashed.js +19 -0
- package/dist/icons/pi/PiShareBold.js +19 -0
- package/dist/icons/si/SiAnthropic.js +19 -0
- package/dist/icons/si/SiHelm.js +19 -0
- package/dist/icons/si/SiKubernetes.js +19 -0
- package/dist/icons/tb/TbAlertTriangle.js +35 -0
- package/dist/icons/tb/TbAlertTriangleFilled.js +19 -0
- package/dist/icons/tb/TbApi.js +40 -0
- package/dist/icons/tb/TbBrain.js +50 -0
- package/dist/icons/tb/TbBuildingTunnel.js +65 -0
- package/dist/icons/tb/TbEdit.js +35 -0
- package/dist/icons/tb/TbLayoutSidebar.js +27 -0
- package/dist/icons/tb/TbLayoutSidebarLeftCollapse.js +35 -0
- package/dist/icons/tb/TbLayoutSidebarRightCollapse.js +35 -0
- package/dist/icons/tb/TbUser.js +27 -0
- package/dist/icons/tb/TbUserOff.js +35 -0
- package/dist/icons/tb/TbWorldShare.js +55 -0
- package/dist/icons/tb/TbWorldWww.js +65 -0
- package/dist/icons/ti/TiArrowSortedDown.js +20 -0
- package/dist/icons/ti/TiArrowSortedUp.js +20 -0
- package/dist/icons/ti/TiArrowUnsorted.js +20 -0
- package/dist/icons/ti/TiCancel.js +20 -0
- package/dist/icons/vsc/VscChromeMinimize.js +19 -0
- package/dist/icons/vsc/VscJson.js +19 -0
- package/dist/icons/vsc/VscLayoutSidebarLeft.js +19 -0
- package/dist/icons/vsc/VscPass.js +27 -0
- package/dist/icons/vsc/VscSplitHorizontal.js +19 -0
- package/dist/icons/vsc/VscTerminalPowershell.js +19 -0
- package/dist/icons.d.ts +7 -22
- package/dist/icons.js +257 -38
- package/dist/index.d.ts +1 -1
- package/dist/list/ActionToolbar.js +2 -2
- package/dist/list/ListPager.js +4 -3
- package/dist/list/ListTable.js +2 -2
- package/dist/list/ListViewControls.js +29 -42
- package/dist/list/RowContextMenu.js +28 -19
- package/dist/list/listSearch.js +6 -5
- package/dist/logviewer/LogViewer.js +28 -20
- package/dist/logviewer/segments.js +2 -2
- package/dist/styles/theme.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/theme/index.js +5 -5
- package/package.json +28 -30
- package/dist/ai/ui/buttons.d.ts +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LuEye } from "../../icons/lu/LuEye.js";
|
|
2
|
+
import { LuEyeOff } from "../../icons/lu/LuEyeOff.js";
|
|
2
3
|
import { useFieldControlProps, useFieldRequired } from "../fieldContext.js";
|
|
3
4
|
import cx from "classnames";
|
|
4
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { useField, useFormikContext } from "formik";
|
|
7
8
|
//#region src/form/SpecialTypes/FormikCustomInput.tsx
|
|
@@ -19,19 +20,21 @@ function FormikCustomInput({ name, type, step, placeholder, onChange, disabled,
|
|
|
19
20
|
useEffect(() => {
|
|
20
21
|
if (!isFocused.current) setLocalValue(value ?? field.value);
|
|
21
22
|
}, [field.value, value]);
|
|
22
|
-
const
|
|
23
|
-
if (sanitize === void 0) return
|
|
23
|
+
const sanitizeRegexp = useMemo(() => {
|
|
24
|
+
if (sanitize === void 0) return;
|
|
24
25
|
try {
|
|
25
|
-
|
|
26
|
-
if (lowercase) val = val.toLowerCase();
|
|
27
|
-
return val.replace(regexp, "");
|
|
26
|
+
return new RegExp(sanitize, "g");
|
|
28
27
|
} catch {
|
|
29
28
|
console.error("Invalid regex for sanitization:", sanitize);
|
|
29
|
+
return;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
}, [sanitize]);
|
|
32
|
+
const sanitizeName = useCallback((val) => {
|
|
33
|
+
const cased = lowercase ? val.toLowerCase() : val;
|
|
34
|
+
return sanitizeRegexp ? cased.replace(sanitizeRegexp, "") : cased;
|
|
35
|
+
}, [sanitizeRegexp, lowercase]);
|
|
33
36
|
const flushToFormik = useCallback((val) => {
|
|
34
|
-
|
|
37
|
+
onChange?.(val);
|
|
35
38
|
setFieldTouched(name, true);
|
|
36
39
|
setFieldValue(name, val);
|
|
37
40
|
}, [
|
|
@@ -41,11 +44,11 @@ function FormikCustomInput({ name, type, step, placeholder, onChange, disabled,
|
|
|
41
44
|
setFieldValue
|
|
42
45
|
]);
|
|
43
46
|
const handleChange = (e) => {
|
|
44
|
-
const text =
|
|
47
|
+
const text = sanitizeName(e.target.value);
|
|
45
48
|
let val = text;
|
|
46
49
|
if (type === "number") {
|
|
47
50
|
const parsed = parseFloat(text);
|
|
48
|
-
val = isNaN(parsed) ? void 0 : parsed;
|
|
51
|
+
val = Number.isNaN(parsed) ? void 0 : parsed;
|
|
49
52
|
}
|
|
50
53
|
if (type === "password" && val === "") val = defaultValue;
|
|
51
54
|
setLocalValue(val);
|
|
@@ -103,7 +106,7 @@ function FormikCustomInput({ name, type, step, placeholder, onChange, disabled,
|
|
|
103
106
|
disabled,
|
|
104
107
|
tabIndex: -1,
|
|
105
108
|
"aria-label": showPassword ? "Hide value" : "Show value",
|
|
106
|
-
children: showPassword ? /* @__PURE__ */ jsx(
|
|
109
|
+
children: showPassword ? /* @__PURE__ */ jsx(LuEyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(LuEye, { className: "h-4 w-4" })
|
|
107
110
|
})]
|
|
108
111
|
});
|
|
109
112
|
}
|
|
@@ -20,10 +20,7 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
20
20
|
const errors = await validateForm();
|
|
21
21
|
const hasStepErrors = shouldFlatten ? stepFieldNames.some((fieldName) => errors[fieldName]) : stepFieldNames.some((fieldName) => hasNestedError(errors[stepKey], fieldName));
|
|
22
22
|
if (hasStepErrors) {
|
|
23
|
-
const touchedFields = stepFieldNames.
|
|
24
|
-
acc[fieldName] = true;
|
|
25
|
-
return acc;
|
|
26
|
-
}, {});
|
|
23
|
+
const touchedFields = Object.fromEntries(stepFieldNames.map((name) => [name, true]));
|
|
27
24
|
if (shouldFlatten) setTouched({
|
|
28
25
|
...touched,
|
|
29
26
|
...touchedFields
|
|
@@ -47,7 +44,7 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
47
44
|
validateStep: validateCurrentStep
|
|
48
45
|
});
|
|
49
46
|
const currentStepConfig = steps[currentStep];
|
|
50
|
-
const
|
|
47
|
+
const navigation = config.navigation ?? {};
|
|
51
48
|
const handleGoToNext = useCallback(async () => {
|
|
52
49
|
const success = await goToNext();
|
|
53
50
|
if (success) onChange?.(values);
|
|
@@ -57,22 +54,11 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
57
54
|
values,
|
|
58
55
|
onChange
|
|
59
56
|
]);
|
|
60
|
-
const handleJumpToStep = useCallback((stepKey) => {
|
|
61
|
-
if (!config_.allowJump || !visitedSteps.has(stepKey)) return false;
|
|
62
|
-
return jumpToStep(stepKey);
|
|
63
|
-
}, [
|
|
64
|
-
jumpToStep,
|
|
65
|
-
config_.allowJump,
|
|
66
|
-
visitedSteps
|
|
67
|
-
]);
|
|
68
57
|
const handleSubmit = useCallback(async () => {
|
|
69
58
|
if (!isLastStep) return;
|
|
70
59
|
const errors = await validateForm();
|
|
71
60
|
if (Object.keys(errors).length > 0) {
|
|
72
|
-
const touchedFields = Object.keys(values).
|
|
73
|
-
acc[fieldName] = true;
|
|
74
|
-
return acc;
|
|
75
|
-
}, {});
|
|
61
|
+
const touchedFields = Object.fromEntries(Object.keys(values).map((name) => [name, true]));
|
|
76
62
|
setTouched({
|
|
77
63
|
...touched,
|
|
78
64
|
...touchedFields
|
|
@@ -91,15 +77,15 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
91
77
|
return /* @__PURE__ */ jsxs("div", {
|
|
92
78
|
className,
|
|
93
79
|
children: [
|
|
94
|
-
|
|
80
|
+
navigation.showSteps !== false && /* @__PURE__ */ jsx(WizardStepIndicator, {
|
|
95
81
|
stepOrder,
|
|
96
82
|
currentStep,
|
|
97
83
|
steps,
|
|
98
84
|
visitedSteps,
|
|
99
85
|
invalidSteps,
|
|
100
|
-
onStepClick:
|
|
101
|
-
allowJump:
|
|
102
|
-
hideStepNumbers:
|
|
86
|
+
onStepClick: jumpToStep,
|
|
87
|
+
allowJump: navigation.allowJump,
|
|
88
|
+
hideStepNumbers: navigation.hideStepNumbers
|
|
103
89
|
}),
|
|
104
90
|
currentStepConfig && /* @__PURE__ */ jsx("div", {
|
|
105
91
|
className: "mb-4",
|
|
@@ -108,7 +94,6 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
108
94
|
stepConfig: currentStepConfig,
|
|
109
95
|
flatten: config.flatten,
|
|
110
96
|
values,
|
|
111
|
-
onValuesChange: onChange,
|
|
112
97
|
labelPosition,
|
|
113
98
|
missingFields,
|
|
114
99
|
spaceCompact,
|
|
@@ -119,9 +104,7 @@ function WizardContainer({ wizardConfig, values, onChange, onSubmit, className =
|
|
|
119
104
|
})
|
|
120
105
|
}),
|
|
121
106
|
/* @__PURE__ */ jsx(WizardNavigation, {
|
|
122
|
-
|
|
123
|
-
stepOrder,
|
|
124
|
-
canGoToNext: !isLastStep,
|
|
107
|
+
isLastStep,
|
|
125
108
|
canGoBack,
|
|
126
109
|
isCurrentStepValid: !invalidSteps.has(currentStep),
|
|
127
110
|
nextLabel: currentStepConfig?.nextLabel,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { WizardNavigationProps } from './types.js';
|
|
2
|
-
export declare function WizardNavigation({
|
|
2
|
+
export declare function WizardNavigation({ isLastStep, canGoBack, isCurrentStepValid, nextLabel, prevLabel, submitLabel, onNext, onPrevious, onSubmit, }: WizardNavigationProps): import("react").JSX.Element;
|
|
@@ -2,10 +2,9 @@ import Loader from "../../components/Loader.js";
|
|
|
2
2
|
import { useState } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
//#region src/form/Wizard/WizardNavigation.tsx
|
|
5
|
-
function WizardNavigation({
|
|
5
|
+
function WizardNavigation({ isLastStep, canGoBack, isCurrentStepValid, nextLabel, prevLabel, submitLabel = "Submit", onNext, onPrevious, onSubmit }) {
|
|
6
6
|
const [isLoading, setIsLoading] = useState(false);
|
|
7
7
|
const [error, setError] = useState(null);
|
|
8
|
-
const isLastStep = stepOrder.indexOf(currentStep) === stepOrder.length - 1;
|
|
9
8
|
const handleNext = async () => {
|
|
10
9
|
setIsLoading(true);
|
|
11
10
|
setError(null);
|
|
@@ -44,7 +43,7 @@ function WizardNavigation({ currentStep, stepOrder, canGoToNext, canGoBack, isCu
|
|
|
44
43
|
backgroundColor: "var(--theme-app-bg)"
|
|
45
44
|
},
|
|
46
45
|
onMouseEnter: (e) => {
|
|
47
|
-
if (
|
|
46
|
+
if (canGoBack && !isLoading) e.currentTarget.style.backgroundColor = "var(--theme-hover)";
|
|
48
47
|
},
|
|
49
48
|
onMouseLeave: (e) => {
|
|
50
49
|
e.currentTarget.style.backgroundColor = "var(--theme-app-bg)";
|
|
@@ -58,7 +57,7 @@ function WizardNavigation({ currentStep, stepOrder, canGoToNext, canGoBack, isCu
|
|
|
58
57
|
className: "px-8 py-3 rounded-lg font-medium transition-all duration-200 text-white flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",
|
|
59
58
|
style: { backgroundColor: "var(--theme-element)" },
|
|
60
59
|
onMouseEnter: (e) => {
|
|
61
|
-
if (
|
|
60
|
+
if (isCurrentStepValid && !isLoading) e.currentTarget.style.filter = "brightness(0.9)";
|
|
62
61
|
},
|
|
63
62
|
onMouseLeave: (e) => {
|
|
64
63
|
e.currentTarget.style.filter = "brightness(1)";
|
|
@@ -71,11 +70,11 @@ function WizardNavigation({ currentStep, stepOrder, canGoToNext, canGoBack, isCu
|
|
|
71
70
|
}) : /* @__PURE__ */ jsxs("button", {
|
|
72
71
|
type: "button",
|
|
73
72
|
onClick: handleNext,
|
|
74
|
-
disabled:
|
|
73
|
+
disabled: isLoading,
|
|
75
74
|
className: "px-8 py-3 rounded-lg font-medium transition-all duration-200 text-white flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed shadow-md hover:shadow-lg",
|
|
76
75
|
style: { backgroundColor: "var(--theme-element)" },
|
|
77
76
|
onMouseEnter: (e) => {
|
|
78
|
-
if (!
|
|
77
|
+
if (!isLoading) e.currentTarget.style.filter = "brightness(0.9)";
|
|
79
78
|
},
|
|
80
79
|
onMouseLeave: (e) => {
|
|
81
80
|
e.currentTarget.style.filter = "brightness(1)";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TSetFormDirty } from '../Form.js';
|
|
2
2
|
import type { WizardStepContentProps } from './types.js';
|
|
3
|
-
export declare function WizardStepContent({ currentStep, stepConfig, flatten, values,
|
|
3
|
+
export declare function WizardStepContent({ currentStep, stepConfig, flatten, values, setFormDirty, setFieldValue, setFieldTouched, ...fieldsProps }: WizardStepContentProps & {
|
|
4
4
|
setFormDirty: TSetFormDirty;
|
|
5
5
|
setFieldValue: (field: string, value: unknown, shouldValidate?: boolean) => void;
|
|
6
6
|
setFieldTouched: (field: string, touched?: boolean, shouldValidate?: boolean) => void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FieldsFromOptions } from "../Form.js";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/form/Wizard/WizardStepContent.tsx
|
|
4
|
-
function WizardStepContent({ currentStep, stepConfig, flatten = true, values,
|
|
5
|
-
if (!stepConfig
|
|
4
|
+
function WizardStepContent({ currentStep, stepConfig, flatten = true, values, setFormDirty, setFieldValue, setFieldTouched, ...fieldsProps }) {
|
|
5
|
+
if (!stepConfig.options) return null;
|
|
6
6
|
return /* @__PURE__ */ jsxs("div", {
|
|
7
7
|
className: "mb-4 w-full",
|
|
8
8
|
children: [
|
|
@@ -1,46 +1,36 @@
|
|
|
1
1
|
import cx from "classnames";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
//#region src/form/Wizard/WizardStepIndicator.tsx
|
|
5
4
|
function WizardStepIndicator({ stepOrder, currentStep, steps, visitedSteps, invalidSteps, onStepClick, allowJump = false, hideStepNumbers = false }) {
|
|
6
|
-
const currentIndex =
|
|
5
|
+
const currentIndex = stepOrder.indexOf(currentStep);
|
|
7
6
|
const getStepStatus = (stepKey, index) => {
|
|
8
7
|
if (stepKey === currentStep) return "active";
|
|
9
8
|
if (index < currentIndex) return "completed";
|
|
10
9
|
return "upcoming";
|
|
11
10
|
};
|
|
12
|
-
const handleStepClick = (stepKey) => {
|
|
13
|
-
if (!allowJump || !visitedSteps.has(stepKey)) return;
|
|
14
|
-
onStepClick?.(stepKey);
|
|
15
|
-
};
|
|
16
|
-
const isClickable = (stepKey) => {
|
|
17
|
-
return allowJump && visitedSteps.has(stepKey) && stepKey !== currentStep;
|
|
18
|
-
};
|
|
19
11
|
return /* @__PURE__ */ jsx("div", {
|
|
20
12
|
className: "flex items-start justify-between w-full mb-2 gap-4 py-2",
|
|
21
13
|
children: stepOrder.map((stepKey, index) => {
|
|
22
14
|
const stepConfig = steps[stepKey];
|
|
23
15
|
const status = getStepStatus(stepKey, index);
|
|
24
16
|
const isInvalid = invalidSteps.has(stepKey);
|
|
25
|
-
const
|
|
17
|
+
const isClickable = allowJump && visitedSteps.has(stepKey) && stepKey !== currentStep;
|
|
26
18
|
const isDotActive = status === "active";
|
|
27
19
|
const isDotCompleted = status === "completed";
|
|
28
|
-
const isDotUpcoming = status === "upcoming";
|
|
29
20
|
return /* @__PURE__ */ jsxs("div", {
|
|
30
21
|
className: "flex flex-col items-center flex-1 relative",
|
|
31
22
|
children: [
|
|
32
23
|
/* @__PURE__ */ jsxs("button", {
|
|
33
24
|
type: "button",
|
|
34
|
-
onClick: () =>
|
|
35
|
-
disabled: !
|
|
25
|
+
onClick: () => onStepClick(stepKey),
|
|
26
|
+
disabled: !isClickable,
|
|
36
27
|
className: cx("w-12 h-12 rounded-full border-3 flex items-center justify-center font-bold text-base transition-all duration-300 flex-shrink-0 relative", {
|
|
37
|
-
"cursor-pointer":
|
|
38
|
-
"cursor-not-allowed": !
|
|
28
|
+
"cursor-pointer": isClickable,
|
|
29
|
+
"cursor-not-allowed": !isClickable
|
|
39
30
|
}, {
|
|
40
31
|
"text-white": isDotActive,
|
|
41
32
|
"bg-green-500 border-green-600 text-white shadow-md": isDotCompleted && !isInvalid,
|
|
42
|
-
"bg-(--theme-border) theme-border theme-muted-text shadow-sm":
|
|
43
|
-
"bg-(--theme-muted-panel-bg) theme-border theme-muted-text shadow-sm": !isDotActive && !isDotCompleted && !isDotUpcoming && !isInvalid,
|
|
33
|
+
"bg-(--theme-border) theme-border theme-muted-text shadow-sm": status === "upcoming" && !isInvalid,
|
|
44
34
|
"bg-red-50 border-red-500 text-red-600 shadow-sm": isInvalid && status !== "active"
|
|
45
35
|
}),
|
|
46
36
|
style: isDotActive ? {
|
|
@@ -17,8 +17,6 @@ export interface WizardConfig {
|
|
|
17
17
|
navigation?: WizardNavigation;
|
|
18
18
|
/** Label for the final submit button */
|
|
19
19
|
submitLabel?: string;
|
|
20
|
-
/** Use URL-based routing instead of component state */
|
|
21
|
-
urlBased?: boolean;
|
|
22
20
|
/** Flatten step fields into top-level inputs (default: true). Set false to preserve step keys as nested objects. */
|
|
23
21
|
flatten?: boolean;
|
|
24
22
|
}
|
|
@@ -33,39 +31,10 @@ export interface StepFieldConfig {
|
|
|
33
31
|
options: DynamicFormSchema;
|
|
34
32
|
/** Validate current step before proceeding to next (default: true) */
|
|
35
33
|
validateOnNext?: boolean;
|
|
36
|
-
/** Allow skipping this step without validation */
|
|
37
|
-
canSkip?: boolean;
|
|
38
34
|
/** Custom label for next button on this step */
|
|
39
35
|
nextLabel?: string;
|
|
40
36
|
/** Custom label for previous button on this step */
|
|
41
37
|
prevLabel?: string;
|
|
42
|
-
/** Optional tooltip text */
|
|
43
|
-
tooltip?: string | string[];
|
|
44
|
-
/** Hidden field support */
|
|
45
|
-
hidden?: boolean;
|
|
46
|
-
/** Disable this step */
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Internal wizard state managed by useWizardState hook
|
|
51
|
-
*/
|
|
52
|
-
export interface WizardState {
|
|
53
|
-
/** Current step ID/key */
|
|
54
|
-
currentStep: string;
|
|
55
|
-
/** Set of step IDs that have been visited */
|
|
56
|
-
visitedSteps: Set<string>;
|
|
57
|
-
/** Set of step IDs that have validation errors */
|
|
58
|
-
invalidSteps: Set<string>;
|
|
59
|
-
/** List of all step keys in order */
|
|
60
|
-
stepOrder: string[];
|
|
61
|
-
/** Total number of steps */
|
|
62
|
-
totalSteps: number;
|
|
63
|
-
/** Whether the wizard is on the last step */
|
|
64
|
-
isLastStep: boolean;
|
|
65
|
-
/** Whether the wizard can proceed to next step */
|
|
66
|
-
canProceedToNext: boolean;
|
|
67
|
-
/** Whether user can go back */
|
|
68
|
-
canGoBack: boolean;
|
|
69
38
|
}
|
|
70
39
|
/**
|
|
71
40
|
* Extracted wizard configuration and step information
|
|
@@ -77,12 +46,7 @@ export interface ParsedWizardConfig {
|
|
|
77
46
|
steps: Record<string, StepFieldConfig>;
|
|
78
47
|
/** Ordered list of step keys */
|
|
79
48
|
stepOrder: string[];
|
|
80
|
-
/** Schema for non-step fields (should be none in pure wizard) */
|
|
81
|
-
otherFields: Record<string, unknown>;
|
|
82
49
|
}
|
|
83
|
-
/**
|
|
84
|
-
* Wizard navigation parameters
|
|
85
|
-
*/
|
|
86
50
|
/**
|
|
87
51
|
* Props for WizardContainer component
|
|
88
52
|
*/
|
|
@@ -120,8 +84,8 @@ export interface WizardStepIndicatorProps {
|
|
|
120
84
|
visitedSteps: Set<string>;
|
|
121
85
|
/** Set of invalid step keys */
|
|
122
86
|
invalidSteps: Set<string>;
|
|
123
|
-
/** Callback when step is clicked */
|
|
124
|
-
onStepClick
|
|
87
|
+
/** Callback when a step the user may jump to is clicked */
|
|
88
|
+
onStepClick: (stepKey: string) => boolean;
|
|
125
89
|
/** Whether clicking completed steps is allowed */
|
|
126
90
|
allowJump?: boolean | undefined;
|
|
127
91
|
/** Hide step numbers */
|
|
@@ -131,12 +95,8 @@ export interface WizardStepIndicatorProps {
|
|
|
131
95
|
* Props for WizardNavigation component
|
|
132
96
|
*/
|
|
133
97
|
export interface WizardNavigationProps {
|
|
134
|
-
/**
|
|
135
|
-
|
|
136
|
-
/** List of step keys in order */
|
|
137
|
-
stepOrder: string[];
|
|
138
|
-
/** Whether user can go to next step */
|
|
139
|
-
canGoToNext: boolean;
|
|
98
|
+
/** Whether the wizard is on its last step, which submits instead of going next */
|
|
99
|
+
isLastStep: boolean;
|
|
140
100
|
/** Whether user can go back */
|
|
141
101
|
canGoBack: boolean;
|
|
142
102
|
/** Whether current step is valid */
|
|
@@ -164,8 +124,6 @@ export interface WizardStepContentProps {
|
|
|
164
124
|
stepConfig: StepFieldConfig;
|
|
165
125
|
/** Form values */
|
|
166
126
|
values: Record<string, unknown>;
|
|
167
|
-
/** Update form values */
|
|
168
|
-
onValuesChange?: ((values: Record<string, unknown>) => void) | undefined;
|
|
169
127
|
/** Label position for fields */
|
|
170
128
|
labelPosition?: LabelPosition | undefined;
|
|
171
129
|
/** Missing fields list */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StepFieldConfig
|
|
1
|
+
import type { StepFieldConfig } from './types.js';
|
|
2
2
|
interface UseWizardStateProps {
|
|
3
3
|
/** Ordered list of step keys */
|
|
4
4
|
stepOrder: string[];
|
|
@@ -6,23 +6,15 @@ interface UseWizardStateProps {
|
|
|
6
6
|
steps: Record<string, StepFieldConfig>;
|
|
7
7
|
/** Function to validate current step */
|
|
8
8
|
validateStep: (stepKey: string) => Promise<boolean>;
|
|
9
|
-
/** Initial step to start with (default: first step) */
|
|
10
|
-
initialStep?: string;
|
|
11
9
|
}
|
|
12
|
-
export declare function useWizardState({ stepOrder, steps, validateStep
|
|
10
|
+
export declare function useWizardState({ stepOrder, steps, validateStep }: UseWizardStateProps): {
|
|
13
11
|
currentStep: string;
|
|
14
12
|
visitedSteps: Set<string>;
|
|
15
13
|
invalidSteps: Set<string>;
|
|
16
14
|
isLastStep: boolean;
|
|
17
15
|
canGoBack: boolean;
|
|
18
|
-
currentStepIndex: number;
|
|
19
|
-
totalSteps: number;
|
|
20
16
|
goToNext: () => Promise<boolean>;
|
|
21
17
|
goToPrevious: () => void;
|
|
22
18
|
jumpToStep: (stepKey: string) => boolean;
|
|
23
|
-
reset: () => void;
|
|
24
|
-
markStepVisited: (stepKey: string) => void;
|
|
25
|
-
markStepInvalid: (stepKey: string, invalid: boolean) => void;
|
|
26
|
-
getState: () => WizardState;
|
|
27
19
|
};
|
|
28
20
|
export {};
|
|
@@ -1,22 +1,13 @@
|
|
|
1
1
|
import { useCallback, useState } from "react";
|
|
2
2
|
//#region src/form/Wizard/useWizardState.ts
|
|
3
|
-
function useWizardState({ stepOrder, steps, validateStep
|
|
4
|
-
const firstStep =
|
|
3
|
+
function useWizardState({ stepOrder, steps, validateStep }) {
|
|
4
|
+
const firstStep = stepOrder[0] ?? "";
|
|
5
5
|
const [currentStep, setCurrentStep] = useState(firstStep);
|
|
6
6
|
const [visitedSteps, setVisitedSteps] = useState(/* @__PURE__ */ new Set([firstStep]));
|
|
7
7
|
const [invalidSteps, setInvalidSteps] = useState(/* @__PURE__ */ new Set());
|
|
8
8
|
const currentStepIndex = stepOrder.indexOf(currentStep);
|
|
9
9
|
const isLastStep = currentStepIndex === stepOrder.length - 1;
|
|
10
10
|
const canGoBack = currentStepIndex > 0;
|
|
11
|
-
/**
|
|
12
|
-
* Mark step as visited
|
|
13
|
-
*/
|
|
14
|
-
const markStepVisited = useCallback((stepKey) => {
|
|
15
|
-
setVisitedSteps((prev) => /* @__PURE__ */ new Set([...prev, stepKey]));
|
|
16
|
-
}, []);
|
|
17
|
-
/**
|
|
18
|
-
* Mark step as invalid
|
|
19
|
-
*/
|
|
20
11
|
const markStepInvalid = useCallback((stepKey, invalid) => {
|
|
21
12
|
setInvalidSteps((prev) => {
|
|
22
13
|
const next = new Set(prev);
|
|
@@ -25,93 +16,52 @@ function useWizardState({ stepOrder, steps, validateStep, initialStep }) {
|
|
|
25
16
|
return next;
|
|
26
17
|
});
|
|
27
18
|
}, []);
|
|
28
|
-
const goToNext = useCallback(async () => {
|
|
29
|
-
if (isLastStep) return false;
|
|
30
|
-
if (steps[currentStep]?.validateOnNext !== false) {
|
|
31
|
-
if (!await validateStep(currentStep)) {
|
|
32
|
-
markStepInvalid(currentStep, true);
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
markStepInvalid(currentStep, false);
|
|
37
|
-
const nextStepKey = stepOrder[currentStepIndex + 1];
|
|
38
|
-
setCurrentStep(nextStepKey ?? "");
|
|
39
|
-
markStepVisited(nextStepKey ?? "");
|
|
40
|
-
return true;
|
|
41
|
-
}, [
|
|
42
|
-
currentStep,
|
|
43
|
-
currentStepIndex,
|
|
44
|
-
isLastStep,
|
|
45
|
-
steps,
|
|
46
|
-
stepOrder,
|
|
47
|
-
validateStep,
|
|
48
|
-
markStepInvalid,
|
|
49
|
-
markStepVisited
|
|
50
|
-
]);
|
|
51
|
-
const goToPrevious = useCallback(() => {
|
|
52
|
-
if (!canGoBack) return;
|
|
53
|
-
const prevStepKey = stepOrder[currentStepIndex - 1];
|
|
54
|
-
setCurrentStep(prevStepKey ?? "");
|
|
55
|
-
}, [
|
|
56
|
-
canGoBack,
|
|
57
|
-
currentStepIndex,
|
|
58
|
-
stepOrder
|
|
59
|
-
]);
|
|
60
|
-
const jumpToStep = useCallback((stepKey) => {
|
|
61
|
-
if (!stepOrder.includes(stepKey)) return false;
|
|
62
|
-
if (!visitedSteps.has(stepKey) && stepKey !== currentStep) return false;
|
|
63
|
-
setCurrentStep(stepKey);
|
|
64
|
-
return true;
|
|
65
|
-
}, [
|
|
66
|
-
stepOrder,
|
|
67
|
-
visitedSteps,
|
|
68
|
-
currentStep
|
|
69
|
-
]);
|
|
70
|
-
/**
|
|
71
|
-
* Reset wizard to initial state
|
|
72
|
-
*/
|
|
73
|
-
const reset = useCallback(() => {
|
|
74
|
-
setCurrentStep(firstStep);
|
|
75
|
-
setVisitedSteps(/* @__PURE__ */ new Set([firstStep]));
|
|
76
|
-
setInvalidSteps(/* @__PURE__ */ new Set());
|
|
77
|
-
}, [firstStep]);
|
|
78
|
-
/**
|
|
79
|
-
* Get current wizard state
|
|
80
|
-
*/
|
|
81
|
-
const getState = useCallback(() => {
|
|
82
|
-
return {
|
|
83
|
-
currentStep,
|
|
84
|
-
visitedSteps,
|
|
85
|
-
invalidSteps,
|
|
86
|
-
stepOrder,
|
|
87
|
-
totalSteps: stepOrder.length,
|
|
88
|
-
isLastStep,
|
|
89
|
-
canProceedToNext: !isLastStep,
|
|
90
|
-
canGoBack
|
|
91
|
-
};
|
|
92
|
-
}, [
|
|
93
|
-
currentStep,
|
|
94
|
-
visitedSteps,
|
|
95
|
-
invalidSteps,
|
|
96
|
-
stepOrder,
|
|
97
|
-
isLastStep,
|
|
98
|
-
canGoBack
|
|
99
|
-
]);
|
|
100
19
|
return {
|
|
101
20
|
currentStep,
|
|
102
21
|
visitedSteps,
|
|
103
22
|
invalidSteps,
|
|
104
23
|
isLastStep,
|
|
105
24
|
canGoBack,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
25
|
+
goToNext: useCallback(async () => {
|
|
26
|
+
if (isLastStep) return false;
|
|
27
|
+
if (steps[currentStep]?.validateOnNext !== false) {
|
|
28
|
+
if (!await validateStep(currentStep)) {
|
|
29
|
+
markStepInvalid(currentStep, true);
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
markStepInvalid(currentStep, false);
|
|
34
|
+
const nextStepKey = stepOrder[currentStepIndex + 1] ?? "";
|
|
35
|
+
setCurrentStep(nextStepKey);
|
|
36
|
+
setVisitedSteps((prev) => /* @__PURE__ */ new Set([...prev, nextStepKey]));
|
|
37
|
+
return true;
|
|
38
|
+
}, [
|
|
39
|
+
currentStep,
|
|
40
|
+
currentStepIndex,
|
|
41
|
+
isLastStep,
|
|
42
|
+
steps,
|
|
43
|
+
stepOrder,
|
|
44
|
+
validateStep,
|
|
45
|
+
markStepInvalid
|
|
46
|
+
]),
|
|
47
|
+
goToPrevious: useCallback(() => {
|
|
48
|
+
if (!canGoBack) return;
|
|
49
|
+
setCurrentStep(stepOrder[currentStepIndex - 1] ?? "");
|
|
50
|
+
}, [
|
|
51
|
+
canGoBack,
|
|
52
|
+
currentStepIndex,
|
|
53
|
+
stepOrder
|
|
54
|
+
]),
|
|
55
|
+
jumpToStep: useCallback((stepKey) => {
|
|
56
|
+
if (!stepOrder.includes(stepKey)) return false;
|
|
57
|
+
if (!visitedSteps.has(stepKey) && stepKey !== currentStep) return false;
|
|
58
|
+
setCurrentStep(stepKey);
|
|
59
|
+
return true;
|
|
60
|
+
}, [
|
|
61
|
+
stepOrder,
|
|
62
|
+
visitedSteps,
|
|
63
|
+
currentStep
|
|
64
|
+
])
|
|
115
65
|
};
|
|
116
66
|
}
|
|
117
67
|
//#endregion
|
|
@@ -8,17 +8,13 @@ function isStepField(field) {
|
|
|
8
8
|
function parseWizardConfig(options) {
|
|
9
9
|
const meta = options["$meta"];
|
|
10
10
|
const wizardConfig = isWizardMeta(meta) ? meta.wizard : void 0;
|
|
11
|
-
if (
|
|
11
|
+
if (wizardConfig?.mode !== "wizard") return null;
|
|
12
12
|
const steps = {};
|
|
13
13
|
const stepOrder = [];
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
steps[key] = field;
|
|
19
|
-
stepOrder.push(key);
|
|
20
|
-
} else otherFields[key] = field;
|
|
21
|
-
});
|
|
14
|
+
for (const [key, field] of Object.entries(options)) if (key !== "$meta" && isStepField(field)) {
|
|
15
|
+
steps[key] = field;
|
|
16
|
+
stepOrder.push(key);
|
|
17
|
+
}
|
|
22
18
|
if (stepOrder.length === 0) {
|
|
23
19
|
console.warn("Wizard mode enabled but no steps found");
|
|
24
20
|
return null;
|
|
@@ -26,8 +22,7 @@ function parseWizardConfig(options) {
|
|
|
26
22
|
return {
|
|
27
23
|
config: wizardConfig,
|
|
28
24
|
steps,
|
|
29
|
-
stepOrder
|
|
30
|
-
otherFields
|
|
25
|
+
stepOrder
|
|
31
26
|
};
|
|
32
27
|
}
|
|
33
28
|
//#endregion
|