@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,14 +1,32 @@
|
|
|
1
1
|
import { ControlledCollapsiblePanel } from "../../components/CollapsiblePanel.js";
|
|
2
2
|
import { FieldsFromOptions, GroupHeader, resolveMetaOverrides } from "../Form.js";
|
|
3
|
-
import
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useFormikContext } from "formik";
|
|
6
6
|
//#region src/form/Fields/ObjectField.tsx
|
|
7
7
|
function ObjectField({ field, label, tooltipComponent, missingFields, setFormDirty, workflowForm, labelPosition, spaceCompact }) {
|
|
8
|
+
const fieldName = field.name ?? "";
|
|
8
9
|
const [open, setOpen] = useState(field.collapsed !== void 0 ? !field.collapsed : true);
|
|
9
10
|
const { values, setFieldValue, setFieldTouched } = useFormikContext();
|
|
10
11
|
const meta = resolveMetaOverrides(field.options, labelPosition, spaceCompact ?? false);
|
|
11
|
-
const
|
|
12
|
+
const body = /* @__PURE__ */ jsx("div", {
|
|
13
|
+
className: "w-full",
|
|
14
|
+
children: /* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
15
|
+
options: field.options,
|
|
16
|
+
values,
|
|
17
|
+
setFormDirty,
|
|
18
|
+
setFieldValue,
|
|
19
|
+
setFieldTouched,
|
|
20
|
+
missingFields,
|
|
21
|
+
workflowForm,
|
|
22
|
+
labelPosition: meta.labelPosition,
|
|
23
|
+
spaceCompact: meta.spaceCompact,
|
|
24
|
+
parentInfo: {
|
|
25
|
+
parentName: fieldName,
|
|
26
|
+
fieldNamePrefix: `${fieldName}.`
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
});
|
|
12
30
|
return /* @__PURE__ */ jsxs("div", {
|
|
13
31
|
className: "flex flex-col w-full",
|
|
14
32
|
children: [field.noCollapse && /* @__PURE__ */ jsx("div", {
|
|
@@ -21,7 +39,7 @@ function ObjectField({ field, label, tooltipComponent, missingFields, setFormDir
|
|
|
21
39
|
tooltipComponent
|
|
22
40
|
]
|
|
23
41
|
})
|
|
24
|
-
}), /* @__PURE__ */ jsx(
|
|
42
|
+
}), field.noCollapse ? body : /* @__PURE__ */ jsx(ControlledCollapsiblePanel, {
|
|
25
43
|
open,
|
|
26
44
|
setOpen,
|
|
27
45
|
title: /* @__PURE__ */ jsx(GroupHeader, {
|
|
@@ -29,24 +47,7 @@ function ObjectField({ field, label, tooltipComponent, missingFields, setFormDir
|
|
|
29
47
|
setOpen,
|
|
30
48
|
title: field.label || label
|
|
31
49
|
}),
|
|
32
|
-
children:
|
|
33
|
-
className: "w-full",
|
|
34
|
-
children: /* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
35
|
-
options: field.options,
|
|
36
|
-
values,
|
|
37
|
-
setFormDirty,
|
|
38
|
-
setFieldValue,
|
|
39
|
-
setFieldTouched,
|
|
40
|
-
missingFields,
|
|
41
|
-
workflowForm,
|
|
42
|
-
labelPosition: meta.labelPosition,
|
|
43
|
-
spaceCompact: meta.spaceCompact,
|
|
44
|
-
parentInfo: {
|
|
45
|
-
parentName: field.name,
|
|
46
|
-
fieldNamePrefix: `${field.name}.`
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
+
children: body
|
|
50
51
|
})]
|
|
51
52
|
});
|
|
52
53
|
}
|
|
@@ -6,13 +6,14 @@ import { Field, useFormikContext } from "formik";
|
|
|
6
6
|
//#region src/form/Fields/RadioField.tsx
|
|
7
7
|
function RadioField(props) {
|
|
8
8
|
const { field, label, labelPosition, missing, disabled, onChange, tooltipComponent, spaceCompact, setFormDirty } = props;
|
|
9
|
+
const fieldName = field.name ?? "";
|
|
9
10
|
const uid = useId();
|
|
10
11
|
const { setFieldValue, setFieldTouched } = useFormikContext();
|
|
11
12
|
const handleChange = (val) => {
|
|
12
13
|
if (disabled) return;
|
|
13
|
-
|
|
14
|
-
setFieldTouched(
|
|
15
|
-
setFieldValue(
|
|
14
|
+
onChange?.(val);
|
|
15
|
+
setFieldTouched(fieldName, true);
|
|
16
|
+
setFieldValue(fieldName, val);
|
|
16
17
|
setFormDirty(true);
|
|
17
18
|
};
|
|
18
19
|
return /* @__PURE__ */ jsx(FieldWrapper, {
|
|
@@ -5,20 +5,21 @@ import { Field, useField, useFormikContext } from "formik";
|
|
|
5
5
|
//#region src/form/Fields/RangeField.tsx
|
|
6
6
|
function RangeField(props) {
|
|
7
7
|
const { field, label, labelPosition, disabled, onChange, tooltipComponent, spaceCompact, setFormDirty } = props;
|
|
8
|
-
const
|
|
8
|
+
const fieldName = field.name ?? "";
|
|
9
|
+
const [fieldState] = useField(fieldName);
|
|
9
10
|
const { setFieldValue, setFieldTouched } = useFormikContext();
|
|
10
11
|
const handleChange = (e) => {
|
|
11
12
|
let val = e.target.valueAsNumber;
|
|
12
|
-
if (!isNaN(val)) {
|
|
13
|
+
if (!Number.isNaN(val)) {
|
|
13
14
|
val = Math.max(field.min, Math.min(field.max, val));
|
|
14
|
-
setFieldValue(
|
|
15
|
-
|
|
16
|
-
setFieldTouched(
|
|
15
|
+
setFieldValue(fieldName, val);
|
|
16
|
+
onChange?.(val);
|
|
17
|
+
setFieldTouched(fieldName, true);
|
|
17
18
|
setFormDirty(true);
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
const seedValue = field.default ?? field.min;
|
|
21
|
-
if ((fieldState.value === void 0 || fieldState.value === null) && seedValue !== void 0) setFieldValue(
|
|
22
|
+
if ((fieldState.value === void 0 || fieldState.value === null) && seedValue !== void 0) setFieldValue(fieldName, seedValue);
|
|
22
23
|
const currentValue = fieldState.value !== void 0 ? fieldState.value : seedValue;
|
|
23
24
|
return /* @__PURE__ */ jsx(FieldWrapper, {
|
|
24
25
|
optional: field.optional,
|
|
@@ -6,6 +6,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
//#region src/form/Fields/StringField.tsx
|
|
7
7
|
var StringField_default = memo(function StringField(props) {
|
|
8
8
|
const { field, label, labelPosition, missing, disabled, onChange, tooltipComponent, spaceCompact, currentValue } = props;
|
|
9
|
+
const fieldName = field.name ?? "";
|
|
9
10
|
const value = field.prefillDefault ? currentValue : void 0;
|
|
10
11
|
return /* @__PURE__ */ jsx(FieldWrapper, {
|
|
11
12
|
optional: field.optional,
|
|
@@ -16,7 +17,7 @@ var StringField_default = memo(function StringField(props) {
|
|
|
16
17
|
spaceCompact,
|
|
17
18
|
children: /* @__PURE__ */ jsx(FormikCustomInput, {
|
|
18
19
|
invalid: missing,
|
|
19
|
-
name:
|
|
20
|
+
name: fieldName,
|
|
20
21
|
type: field.type,
|
|
21
22
|
lowercase: field.lowercase,
|
|
22
23
|
placeholder: field.type === "password" && field.placeholder === void 0 ? "•".repeat((field.default ?? "").toString().length > 0 ? 16 : 0) : getPlaceholder(field.placeholder, field.default),
|
|
@@ -6,6 +6,7 @@ import { Field } from "formik";
|
|
|
6
6
|
//#region src/form/Fields/TextAreaField.tsx
|
|
7
7
|
function TextAreaField(props) {
|
|
8
8
|
const { field, label, labelPosition, missing, disabled, onChange, tooltipComponent, spaceCompact } = props;
|
|
9
|
+
const fieldName = field.name ?? "";
|
|
9
10
|
return /* @__PURE__ */ jsx(FieldWrapper, {
|
|
10
11
|
optional: field.optional,
|
|
11
12
|
label,
|
|
@@ -19,7 +20,7 @@ function TextAreaField(props) {
|
|
|
19
20
|
id,
|
|
20
21
|
"aria-describedby": describedBy,
|
|
21
22
|
"aria-required": field.optional ? void 0 : true,
|
|
22
|
-
name:
|
|
23
|
+
name: fieldName,
|
|
23
24
|
type: "search",
|
|
24
25
|
placeholder: getPlaceholder(field.placeholder, field.default),
|
|
25
26
|
disabled,
|
package/dist/form/Form.d.ts
CHANGED
|
@@ -41,21 +41,20 @@ export declare function GroupHeader({ children, open, setOpen, title, }: {
|
|
|
41
41
|
title: React.ReactNode;
|
|
42
42
|
}): React.JSX.Element;
|
|
43
43
|
export type TSetFormDirty = (dirty: boolean) => void;
|
|
44
|
+
interface MultiSelectOption {
|
|
45
|
+
label: string;
|
|
46
|
+
secondaryLabel?: string;
|
|
47
|
+
value: string | boolean | number;
|
|
48
|
+
selected?: boolean;
|
|
49
|
+
}
|
|
44
50
|
export declare function MultiSelectionDropdown({ name, label, invalid, options: initialOptions, setFormDirty, onChange, parentValue, }: {
|
|
45
51
|
name: string;
|
|
46
52
|
label: string;
|
|
47
53
|
invalid?: boolean;
|
|
48
|
-
options?:
|
|
49
|
-
label: string;
|
|
50
|
-
secondaryLabel?: string;
|
|
51
|
-
value: string;
|
|
52
|
-
selected: boolean;
|
|
53
|
-
}[];
|
|
54
|
+
options?: (string | MultiSelectOption)[];
|
|
54
55
|
setFormDirty: TSetFormDirty;
|
|
55
56
|
onChange?: ((val: unknown) => void) | undefined;
|
|
56
57
|
parentValue?: unknown;
|
|
57
|
-
className?: string;
|
|
58
|
-
secondaryField?: string | undefined;
|
|
59
58
|
}): React.JSX.Element;
|
|
60
59
|
export declare function FieldsFromOptions({ options, values, setFormDirty, setFieldValue, setFieldTouched, parentInfo, labelPosition, missingFields, spaceCompact, workflowForm, }: {
|
|
61
60
|
options: Record<string, unknown>;
|
package/dist/form/Form.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useStrings, useWorkflowEngine } from "../components/Provider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
|
|
3
|
+
import { FaAngleRight } from "../icons/fa/FaAngleRight.js";
|
|
3
4
|
import { TooltipInfo } from "../components/Tooltip.js";
|
|
4
5
|
import { UncontrolledCollapsiblePanel } from "../components/CollapsiblePanel.js";
|
|
5
6
|
import CustomListbox from "../components/Listbox.js";
|
|
@@ -8,10 +9,10 @@ import SectionHeader from "../components/SectionHeader.js";
|
|
|
8
9
|
import { Table } from "../components/Table.js";
|
|
9
10
|
import { useFieldControlProps, useFieldRequired } from "./fieldContext.js";
|
|
10
11
|
import { resolvedFlag } from "./lib.js";
|
|
12
|
+
import { getValueUsingPath } from "./utils/getValueUsingPath.js";
|
|
11
13
|
import { FieldRegistryContext, Registry } from "./fieldRegistry.js";
|
|
12
14
|
import { useParsedOpts } from "./useParsedOpts.js";
|
|
13
15
|
import { usePrevious } from "./usePrevious.js";
|
|
14
|
-
import { getValueUsingPath } from "./utils/getValueUsingPath.js";
|
|
15
16
|
import { getParentValue } from "./utils/getParentValue.js";
|
|
16
17
|
import { parseWizardConfig } from "./Wizard/utils.js";
|
|
17
18
|
import { WizardContainer } from "./Wizard/WizardContainer.js";
|
|
@@ -71,8 +72,7 @@ function collectFieldsWithDefaults(options, values = {}, prefix = "") {
|
|
|
71
72
|
if (!options || typeof options !== "object") return result;
|
|
72
73
|
for (const [fieldName, rawField] of Object.entries(options)) {
|
|
73
74
|
const field = asSchemaField(rawField);
|
|
74
|
-
if (!field) continue;
|
|
75
|
-
if (fieldName === "$meta") continue;
|
|
75
|
+
if (fieldName === "$meta" || !field) continue;
|
|
76
76
|
const fullName = prefix ? `${prefix}${fieldName}` : fieldName;
|
|
77
77
|
if (field.type === "group") {
|
|
78
78
|
const groupItems = field.items || field.options;
|
|
@@ -200,9 +200,9 @@ function GroupHeader({ children, open, setOpen, title }) {
|
|
|
200
200
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
201
201
|
type: "button",
|
|
202
202
|
"aria-expanded": open,
|
|
203
|
-
className:
|
|
203
|
+
className: "w-full flex items-center text-left transform ease-in transition cursor-pointer",
|
|
204
204
|
onClick: () => setOpen((open) => !open),
|
|
205
|
-
children: [/* @__PURE__ */ jsx(
|
|
205
|
+
children: [/* @__PURE__ */ jsx(FaAngleRight, { className: cx(open && "transform rotate-90 ", "px-1 text-[1.25rem] transition ease-in ") }), /* @__PURE__ */ jsx("span", { children: title })]
|
|
206
206
|
}), children]
|
|
207
207
|
});
|
|
208
208
|
}
|
|
@@ -224,7 +224,7 @@ function getClosestParentIndex(parentPath) {
|
|
|
224
224
|
for (let i = parentPath.length - 1; i >= 0; i--) if (parentPath[i] === "]") {
|
|
225
225
|
let j = i - 1;
|
|
226
226
|
while (j >= 0 && parentPath[j] !== "[") j--;
|
|
227
|
-
return parseInt(parentPath.slice(j + 1, i));
|
|
227
|
+
return parseInt(parentPath.slice(j + 1, i), 10);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
function MultiSelectionDropdown({ name, label = "", invalid = false, options: initialOptions = [], setFormDirty, onChange, parentValue }) {
|
|
@@ -232,30 +232,25 @@ function MultiSelectionDropdown({ name, label = "", invalid = false, options: in
|
|
|
232
232
|
const required = useFieldRequired();
|
|
233
233
|
const controlProps = useFieldControlProps();
|
|
234
234
|
const { setFieldValue } = useFormikContext();
|
|
235
|
-
const options = useMemo(() => {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}, [initialOptions, field.value]);
|
|
235
|
+
const options = useMemo(() => initialOptions.map((option) => {
|
|
236
|
+
const op = typeof option === "string" ? {
|
|
237
|
+
label: option,
|
|
238
|
+
value: option
|
|
239
|
+
} : option;
|
|
240
|
+
return {
|
|
241
|
+
...op,
|
|
242
|
+
selected: !!field.value?.includes(op.value) || !!op.selected
|
|
243
|
+
};
|
|
244
|
+
}), [initialOptions, field.value]);
|
|
246
245
|
const handleOptionSelected = (selectedValue) => {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
selected.push(selectedValue);
|
|
250
|
-
setFieldValue(name, selected);
|
|
251
|
-
if (onChange) onChange(options);
|
|
246
|
+
setFieldValue(name, [...field.value ?? [], selectedValue]);
|
|
247
|
+
onChange?.(options);
|
|
252
248
|
setFormDirty(true);
|
|
253
249
|
};
|
|
254
250
|
const t = useStrings().common;
|
|
255
251
|
const handleRemoveOption = (key) => {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
if (onChange) onChange(options);
|
|
252
|
+
setFieldValue(name, field.value.filter((item) => item !== key));
|
|
253
|
+
onChange?.(options);
|
|
259
254
|
setFormDirty(true);
|
|
260
255
|
};
|
|
261
256
|
const prevParent = usePrevious(parentValue);
|
|
@@ -279,13 +274,13 @@ function MultiSelectionDropdown({ name, label = "", invalid = false, options: in
|
|
|
279
274
|
}), /* @__PURE__ */ jsx(Table, { children: field.value && field.value.length > 0 ? options.filter((option) => option.selected).map((option) => {
|
|
280
275
|
return /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx(Table.Item, {
|
|
281
276
|
className: "w-full",
|
|
282
|
-
children: option
|
|
277
|
+
children: option.label
|
|
283
278
|
}), /* @__PURE__ */ jsx(Table.Item, { children: /* @__PURE__ */ jsx("button", {
|
|
284
279
|
type: "button",
|
|
285
280
|
"aria-label": t.remove,
|
|
286
281
|
className: "inline-flex bg-transparent p-0 cursor-pointer",
|
|
287
282
|
onClick: () => handleRemoveOption(option.value),
|
|
288
|
-
children: /* @__PURE__ */ jsx(
|
|
283
|
+
children: /* @__PURE__ */ jsx(BiSolidTrashAlt, { className: "link mr-4" })
|
|
289
284
|
}) })] }, String(option.value));
|
|
290
285
|
}) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs(Table.Item, { children: [
|
|
291
286
|
"No ",
|
|
@@ -296,9 +291,8 @@ function MultiSelectionDropdown({ name, label = "", invalid = false, options: in
|
|
|
296
291
|
var InputField = React.memo(function InputField({ label, field, setFormDirty, onChange, disabled = false, labelPosition = "left", missingFields = [], computeOn, spaceCompact = false, workflowForm = false, setFieldValue, setFieldTouched, values, currentValue }) {
|
|
297
292
|
const prevField = useRef(field);
|
|
298
293
|
const fieldObj = useMemo(() => {
|
|
299
|
-
if (deepEqual(prevField.current, field))
|
|
300
|
-
prevField.current
|
|
301
|
-
return { ...field };
|
|
294
|
+
if (!deepEqual(prevField.current, field)) prevField.current = field;
|
|
295
|
+
return prevField.current;
|
|
302
296
|
}, [field]);
|
|
303
297
|
const tooltipComponent = useMemo(() => {
|
|
304
298
|
if (!fieldObj.tooltip) return null;
|
|
@@ -340,7 +334,7 @@ function FormikStateBridge({ onChange }) {
|
|
|
340
334
|
const prevEmitted = useRef(null);
|
|
341
335
|
useEffect(() => {
|
|
342
336
|
const { editorKeyPostfix: _, ...next } = values;
|
|
343
|
-
if (prevEmitted.current !== null &&
|
|
337
|
+
if (prevEmitted.current !== null && deepEqual(prevEmitted.current, next)) return;
|
|
344
338
|
prevEmitted.current = next;
|
|
345
339
|
onChange(next);
|
|
346
340
|
}, [values, onChange]);
|
|
@@ -374,18 +368,8 @@ function useFieldParse(optionsField, values, arrayIndex) {
|
|
|
374
368
|
c.result = null;
|
|
375
369
|
}
|
|
376
370
|
if (!c.hasExpressions) return optionsField;
|
|
377
|
-
if (c.inputDeps.size === 0) {
|
|
378
|
-
if (c.result !== null) return c.result;
|
|
379
|
-
}
|
|
380
371
|
if (c.result !== null) {
|
|
381
|
-
|
|
382
|
-
if (!changed) {
|
|
383
|
-
for (const key of c.inputDeps) if (!deepEqual(values[key], c.lastRelevant[key])) {
|
|
384
|
-
changed = true;
|
|
385
|
-
break;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
if (!changed) return c.result;
|
|
372
|
+
if (c.inputDeps.size === 0 || arrayIndex === c.lastIndex && [...c.inputDeps].every((key) => deepEqual(values[key], c.lastRelevant[key]))) return c.result;
|
|
389
373
|
}
|
|
390
374
|
c.result = engine.evaluate({
|
|
391
375
|
inputs: values,
|
|
@@ -398,7 +382,7 @@ function useFieldParse(optionsField, values, arrayIndex) {
|
|
|
398
382
|
for (const key of c.inputDeps) c.lastRelevant[key] = values[key];
|
|
399
383
|
return c.result;
|
|
400
384
|
}
|
|
401
|
-
var FormField = React.memo(function FormField({
|
|
385
|
+
var FormField = React.memo(function FormField({ optionsField, fieldName, values, setFormDirty, setFieldValue, setFieldTouched, parentInfo, labelPosition = "left", missingFields = [], spaceCompact = false, workflowForm = false }) {
|
|
402
386
|
const parsedField = useFieldParse(optionsField, values, parentInfo?.arrayIndex);
|
|
403
387
|
const field = asSchemaField(parentInfo ? parsedField : optionsField);
|
|
404
388
|
if (field === null) return null;
|
|
@@ -409,41 +393,34 @@ var FormField = React.memo(function FormField({ id, optionsField, fieldName, val
|
|
|
409
393
|
name: fieldNamePrefix + fieldName,
|
|
410
394
|
optional: resolvedFlag(field.optional) ?? field.default !== void 0
|
|
411
395
|
};
|
|
412
|
-
if (!fieldObj
|
|
396
|
+
if (!fieldObj.name || fieldName === "v3") return null;
|
|
413
397
|
if (field.hidden === true || !field.type) {
|
|
414
|
-
if (resolvedFlag(field.ignore) && !workflowForm) deleteFieldByPath(values, fieldObj
|
|
398
|
+
if (resolvedFlag(field.ignore) && !workflowForm) deleteFieldByPath(values, fieldObj.name);
|
|
415
399
|
return null;
|
|
416
400
|
}
|
|
417
|
-
if (!field.type && field.options) fieldObj["type"] = "dropdown";
|
|
418
401
|
let onChange;
|
|
419
402
|
if (field.one_must_be_true && parentInfo?.onChange) {
|
|
420
403
|
const parentOnChange = parentInfo.onChange;
|
|
421
404
|
const parentArrayIndex = parentInfo.arrayIndex ?? 0;
|
|
422
|
-
const fieldOptions = fieldObj
|
|
405
|
+
const fieldOptions = fieldObj.options;
|
|
423
406
|
onChange = (val) => parentOnChange(fieldName, parentArrayIndex, flagValue(fieldOptions?.["offOption"], false), flagValue(fieldOptions?.["onOption"], true), val);
|
|
424
407
|
}
|
|
425
408
|
if (field.show_if !== void 0 || field.show_if_not !== void 0) {
|
|
426
|
-
|
|
427
|
-
if (parentInfo) {
|
|
428
|
-
if (!parentInfo?.arrayIndex) index = getClosestParentIndex(parentInfo.fieldNamePrefix);
|
|
429
|
-
else index = parentInfo.arrayIndex;
|
|
430
|
-
}
|
|
409
|
+
const index = parentInfo ? parentInfo.arrayIndex || getClosestParentIndex(parentInfo.fieldNamePrefix) : void 0;
|
|
431
410
|
let shouldShowField = true;
|
|
432
|
-
if (field.show_if !== void 0) shouldShowField = !!getParentValue(index, field.show_if, values,
|
|
433
|
-
if (shouldShowField && field.show_if_not !== void 0) shouldShowField = !getParentValue(index, field.show_if_not, values,
|
|
411
|
+
if (field.show_if !== void 0) shouldShowField = !!getParentValue(index, field.show_if, values, field);
|
|
412
|
+
if (shouldShowField && field.show_if_not !== void 0) shouldShowField = !getParentValue(index, field.show_if_not, values, field);
|
|
434
413
|
if (!shouldShowField) {
|
|
435
|
-
if (!workflowForm) deleteFieldByPath(values, fieldObj
|
|
414
|
+
if (!workflowForm) deleteFieldByPath(values, fieldObj.name);
|
|
436
415
|
return null;
|
|
437
416
|
}
|
|
438
417
|
}
|
|
439
|
-
if (field.depends_on) {
|
|
440
|
-
if (parentInfo?.arrayIndex !== void 0) fieldObj["depends_on"] = field.depends_on.replace("[index]", `[${parentInfo.arrayIndex}]`);
|
|
441
|
-
}
|
|
418
|
+
if (field.depends_on && parentInfo?.arrayIndex !== void 0) fieldObj.depends_on = field.depends_on.replace("[index]", `[${parentInfo.arrayIndex}]`);
|
|
442
419
|
if (field.enable_if && field.disabled === false) {
|
|
443
420
|
if (typeof field.enable_if === "string") {
|
|
444
421
|
let path = field.enable_if;
|
|
445
422
|
if (parentInfo?.arrayIndex !== void 0) path = field.enable_if.replace("[index]", `[${parentInfo.arrayIndex}]`);
|
|
446
|
-
if (getValueUsingPath(values, path) === false) fieldObj
|
|
423
|
+
if (getValueUsingPath(values, path) === false) fieldObj.disabled = true;
|
|
447
424
|
}
|
|
448
425
|
}
|
|
449
426
|
if (field.type === "group") {
|
|
@@ -477,51 +454,51 @@ var FormField = React.memo(function FormField({ id, optionsField, fieldName, val
|
|
|
477
454
|
})
|
|
478
455
|
})
|
|
479
456
|
})
|
|
480
|
-
}
|
|
457
|
+
});
|
|
481
458
|
}
|
|
482
459
|
if (typeof field.type === "object" && field.depends_on) {
|
|
483
460
|
const parentValue = getValueUsingPath(values, field.depends_on);
|
|
484
461
|
const resolvedType = field.type[String(parentValue)];
|
|
485
462
|
if (!resolvedType) return null;
|
|
486
|
-
fieldObj
|
|
463
|
+
fieldObj.type = resolvedType;
|
|
487
464
|
}
|
|
488
465
|
if (field.type === "range" && field.depends_on) {
|
|
489
466
|
const parentValue = getValueUsingPath(values, field.depends_on);
|
|
490
467
|
const { min, max } = field;
|
|
491
468
|
if (typeof min === "object" && typeof max === "object") {
|
|
492
|
-
fieldObj
|
|
493
|
-
fieldObj
|
|
469
|
+
fieldObj.min = min[String(parentValue)];
|
|
470
|
+
fieldObj.max = max[String(parentValue)];
|
|
494
471
|
}
|
|
495
472
|
}
|
|
496
473
|
if (field.resetOnChange) {
|
|
497
474
|
const parentValue = getValueUsingPath(values, field.resetOnChange);
|
|
498
475
|
const prevParentValue = field.prevParentValue;
|
|
499
|
-
if (prevParentValue !== void 0 && prevParentValue !== parentValue) deleteFieldByPath(values, fieldObj
|
|
476
|
+
if (prevParentValue !== void 0 && prevParentValue !== parentValue) deleteFieldByPath(values, fieldObj.name);
|
|
500
477
|
field.prevParentValue = parentValue;
|
|
501
478
|
}
|
|
502
479
|
if (field.secondaryField) {
|
|
503
|
-
if (Array.isArray(field.secondaryField)) fieldObj
|
|
504
|
-
else fieldObj
|
|
480
|
+
if (Array.isArray(field.secondaryField)) fieldObj.secondaryField = field.secondaryField.map((secondaryField) => fieldNamePrefix + secondaryField);
|
|
481
|
+
else fieldObj.secondaryField = fieldNamePrefix + field.secondaryField;
|
|
505
482
|
}
|
|
506
483
|
return /* @__PURE__ */ jsx("div", {
|
|
507
484
|
className: cx("flex w-full", labelPosition === "left" ? "mb-[15px]" : "mb-[5px]"),
|
|
508
485
|
children: /* @__PURE__ */ jsx(InputField, {
|
|
509
486
|
field: fieldObj,
|
|
510
|
-
label: fieldObj
|
|
487
|
+
label: fieldObj.label,
|
|
511
488
|
setFormDirty,
|
|
512
489
|
setFieldValue,
|
|
513
490
|
setFieldTouched,
|
|
514
491
|
values,
|
|
515
|
-
currentValue: getValueUsingPath(values, fieldObj
|
|
492
|
+
currentValue: getValueUsingPath(values, fieldObj.name),
|
|
516
493
|
onChange,
|
|
517
|
-
disabled: Boolean(fieldObj
|
|
518
|
-
computeOn: parentInfo?.computeOn || fieldObj
|
|
494
|
+
disabled: Boolean(fieldObj.disabled),
|
|
495
|
+
computeOn: parentInfo?.computeOn || fieldObj.computeOn,
|
|
519
496
|
labelPosition,
|
|
520
497
|
missingFields,
|
|
521
498
|
spaceCompact,
|
|
522
499
|
workflowForm
|
|
523
500
|
})
|
|
524
|
-
}
|
|
501
|
+
});
|
|
525
502
|
}, (prev, next) => {
|
|
526
503
|
if (!deepEqual(prev.optionsField, next.optionsField)) return false;
|
|
527
504
|
if (prev.values !== next.values) return false;
|
|
@@ -533,8 +510,7 @@ var FormField = React.memo(function FormField({ id, optionsField, fieldName, val
|
|
|
533
510
|
return true;
|
|
534
511
|
});
|
|
535
512
|
function FieldsFromOptions({ options = {}, values, setFormDirty, setFieldValue, setFieldTouched, parentInfo, labelPosition = "left", missingFields = [], spaceCompact = false, workflowForm = false }) {
|
|
536
|
-
return Object.keys(options).map((fieldName
|
|
537
|
-
id: idx,
|
|
513
|
+
return Object.keys(options).map((fieldName) => /* @__PURE__ */ jsx(FormField, {
|
|
538
514
|
optionsField: options[fieldName],
|
|
539
515
|
fieldName,
|
|
540
516
|
values,
|
|
@@ -552,27 +528,26 @@ var noop = () => {};
|
|
|
552
528
|
function DynamicFormContent({ options, setValues, setFormDirty, labelPosition, missingFields, spaceCompact, organizationVariables, remoteVars, workflowForm, onSubmit, submitLabel, values, contextKey }) {
|
|
553
529
|
const { setFieldValue, setFieldTouched } = useFormikContext();
|
|
554
530
|
const opts = useParsedOpts(options, values, organizationVariables, void 0, void 0, remoteVars);
|
|
555
|
-
const handleChange = useCallback((state) =>
|
|
556
|
-
if (setValues) setValues(state);
|
|
557
|
-
}, [setValues]);
|
|
531
|
+
const handleChange = useCallback((state) => setValues?.(state), [setValues]);
|
|
558
532
|
const wizardConfig = parseWizardConfig(opts);
|
|
533
|
+
const meta = resolveMetaOverrides(options, labelPosition, spaceCompact);
|
|
559
534
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
560
535
|
/* @__PURE__ */ jsx(DirtyStateBridge, { setFormDirty }),
|
|
561
536
|
/* @__PURE__ */ jsx(FormikStateBridge, { onChange: handleChange }),
|
|
562
537
|
/* @__PURE__ */ jsx(DynamicDefaultsSync, { options: opts }, contextKey ?? ""),
|
|
563
|
-
wizardConfig
|
|
538
|
+
wizardConfig ? /* @__PURE__ */ jsx(WizardContainer, {
|
|
564
539
|
wizardConfig,
|
|
565
540
|
values,
|
|
566
541
|
onChange: handleChange,
|
|
567
542
|
onSubmit,
|
|
568
543
|
className: "w-full",
|
|
569
|
-
...
|
|
544
|
+
...meta,
|
|
570
545
|
missingFields,
|
|
571
546
|
workflowForm,
|
|
572
547
|
setFieldValue,
|
|
573
548
|
setFieldTouched
|
|
574
549
|
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FieldsFromOptions, {
|
|
575
|
-
...
|
|
550
|
+
...meta,
|
|
576
551
|
options: opts,
|
|
577
552
|
values,
|
|
578
553
|
setFormDirty,
|
|
@@ -591,7 +566,7 @@ function DynamicFormContent({ options, setValues, setFormDirty, labelPosition, m
|
|
|
591
566
|
] });
|
|
592
567
|
}
|
|
593
568
|
var NO_FIELDS = {};
|
|
594
|
-
function DynamicForm({ formJSONs: options = {}, reinitialize = false, initialValues, setValues, setFormDirty = noop, formikRef, labelPosition = "left", missingFields = [], spaceCompact = false, organizationVariables, remoteVars, needsOrganizationVariables = false, onSubmit
|
|
569
|
+
function DynamicForm({ formJSONs: options = {}, reinitialize = false, initialValues, setValues, setFormDirty = noop, formikRef, labelPosition = "left", missingFields = [], spaceCompact = false, organizationVariables, remoteVars, needsOrganizationVariables = false, onSubmit, submitLabel = "Submit", className = "w-full", workflowForm = false, contextKey, skipValueParse = false, fields = NO_FIELDS }) {
|
|
595
570
|
const engine = useWorkflowEngine();
|
|
596
571
|
const [parseReady, setParseReady] = useState(() => engine.isReady());
|
|
597
572
|
useEffect(() => {
|
|
@@ -8,9 +8,7 @@ export default function DropdownWrapper({ options, onChange, fieldObj, setFormDi
|
|
|
8
8
|
disabled?: boolean | string | undefined;
|
|
9
9
|
placeholder?: string | undefined;
|
|
10
10
|
default?: unknown;
|
|
11
|
-
parentValue?: unknown;
|
|
12
11
|
secondaryField?: string | string[] | undefined;
|
|
13
|
-
resetOnChange?: string | boolean | undefined;
|
|
14
12
|
value?: string | undefined;
|
|
15
13
|
autoselect?: boolean | string | Record<string, unknown> | undefined;
|
|
16
14
|
allowCustomValue?: boolean | undefined;
|
|
@@ -2,7 +2,7 @@ import FormikCustomDropdown_default from "./FormikCustomDropdown.js";
|
|
|
2
2
|
import { getPlaceholder } from "../utils/getPlaceholder.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/form/SpecialTypes/DropdownWrapper.tsx
|
|
5
|
-
function DropdownWrapper({ options, onChange, fieldObj, setFormDirty, invalid = false, loading = false, disabled
|
|
5
|
+
function DropdownWrapper({ options, onChange, fieldObj, setFormDirty, invalid = false, loading = false, disabled, allowCustomValue, currentValue, setFieldValue, setFieldTouched }) {
|
|
6
6
|
return /* @__PURE__ */ jsx(FormikCustomDropdown_default, {
|
|
7
7
|
invalid,
|
|
8
8
|
className: "w-full",
|
|
@@ -14,9 +14,7 @@ function DropdownWrapper({ options, onChange, fieldObj, setFormDirty, invalid =
|
|
|
14
14
|
placeholder: getPlaceholder(fieldObj.placeholder, typeof fieldObj.default === "string" ? fieldObj.default : void 0),
|
|
15
15
|
name: fieldObj.name ?? "",
|
|
16
16
|
ariaLabel: fieldObj.label,
|
|
17
|
-
parentValue: fieldObj.parentValue,
|
|
18
17
|
secondaryField: fieldObj.secondaryField,
|
|
19
|
-
resetOnChange: fieldObj.resetOnChange,
|
|
20
18
|
value: fieldObj.value,
|
|
21
19
|
autoselect: fieldObj.autoselect === void 0 ? void 0 : Boolean(fieldObj.autoselect),
|
|
22
20
|
allowCustomValue: allowCustomValue ?? fieldObj.allowCustomValue,
|
|
@@ -30,11 +30,9 @@ type FormikCustomDropdownProps = {
|
|
|
30
30
|
options: React.ComponentProps<typeof Dropdown>['options'];
|
|
31
31
|
setFormDirty: TSetFormDirty;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
|
-
parentValue?: unknown;
|
|
34
33
|
className?: string;
|
|
35
34
|
secondaryField?: string | string[] | undefined;
|
|
36
35
|
disabled?: boolean;
|
|
37
|
-
resetOnChange?: string | boolean | undefined;
|
|
38
36
|
loading?: boolean;
|
|
39
37
|
invalid?: boolean;
|
|
40
38
|
autoselect?: boolean | undefined;
|
|
@@ -46,7 +44,7 @@ type FormikCustomDropdownProps = {
|
|
|
46
44
|
setFieldValue: (field: string, value: unknown, shouldValidate?: boolean) => void;
|
|
47
45
|
setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => void;
|
|
48
46
|
};
|
|
49
|
-
declare const _default: import("react").MemoExoticComponent<({ name, ariaLabel, options, setFormDirty, onChange,
|
|
47
|
+
declare const _default: import("react").MemoExoticComponent<({ name, ariaLabel, options, setFormDirty, onChange, className, secondaryField, disabled, loading, invalid, autoselect, value, allowCustomValue, customValueLabel, placeholder, currentValue, setFieldValue, setFieldTouched, }: FormikCustomDropdownProps) => import("react").JSX.Element>;
|
|
50
48
|
export default _default;
|
|
51
49
|
export declare const Testables: {
|
|
52
50
|
toComparableOptions: typeof toComparableOptions;
|
|
@@ -41,23 +41,19 @@ function arePropsEqual(prev, next) {
|
|
|
41
41
|
} else if (prev[key] !== next[key]) return false;
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
|
-
var FormikCustomDropdown_default = memo(function FormikCustomDropdown({ name, ariaLabel, options, setFormDirty, onChange,
|
|
44
|
+
var FormikCustomDropdown_default = memo(function FormikCustomDropdown({ name, ariaLabel, options, setFormDirty, onChange, className, secondaryField, disabled = false, loading = false, invalid = false, autoselect, value, allowCustomValue = false, customValueLabel, placeholder, currentValue, setFieldValue, setFieldTouched }) {
|
|
45
45
|
const required = useFieldRequired();
|
|
46
46
|
const controlProps = useFieldControlProps();
|
|
47
|
-
const prevParentRef = useRef(parentValue);
|
|
48
47
|
const handleChange = (val) => {
|
|
49
48
|
if (secondaryField && typeof options[0] !== "string") {
|
|
50
49
|
const option = findSecondaryOption(options, val);
|
|
51
50
|
if (option) applySecondaryField(secondaryField, option.secondaryValue, setFieldValue);
|
|
52
51
|
}
|
|
53
|
-
|
|
52
|
+
onChange?.(val);
|
|
54
53
|
setFieldValue(name, val);
|
|
55
54
|
setFieldTouched(name, true);
|
|
56
55
|
setFormDirty(true);
|
|
57
56
|
};
|
|
58
|
-
useEffect(() => {
|
|
59
|
-
prevParentRef.current = parentValue;
|
|
60
|
-
});
|
|
61
57
|
const prevOptions = useRef(null);
|
|
62
58
|
const syncAutoselect = useEffectEvent((options, autoselect) => {
|
|
63
59
|
if (deepEqual(prevOptions.current, toComparableOptions(options))) return;
|
|
@@ -68,7 +64,8 @@ var FormikCustomDropdown_default = memo(function FormikCustomDropdown({ name, ar
|
|
|
68
64
|
prevOptions.current = toComparableOptions(options);
|
|
69
65
|
if (autoselect === false || !options?.length) return;
|
|
70
66
|
if (autoselect === void 0) {
|
|
71
|
-
|
|
67
|
+
const [first] = options;
|
|
68
|
+
if (first && isCategory(first)) {
|
|
72
69
|
let optionCount = 0;
|
|
73
70
|
for (const category of options) {
|
|
74
71
|
if (isCategory(category)) optionCount += category.options.length;
|