synapse-react-client 4.0.41 → 4.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SWC.index.js +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts +7 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js +30 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/AccessorRequirementHelpText.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +138 -244
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts +13 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js +60 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DucUploadSection.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts +8 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js +179 -63
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +2 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +13 -13
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManualUploadDucStep/ManualUploadDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js +50 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/PrincipalInvestigatorFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +112 -143
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +4 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +8 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts +3 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js +79 -47
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SignatureStatusStep/SignatureStatusStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js +51 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/SigningOfficialFields.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts +12 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js +24 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/eDucSignatureUtils.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts +11 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/requestFlowTypes.js +0 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts +22 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js +32 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/useInitializeRequestAccessors.js.map +1 -0
- package/dist/components/AclEditor/AclEditor.js +20 -20
- package/dist/components/Authentication/TwoFactorBackupCodes.js +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js +79 -69
- package/dist/components/Authentication/TwoFactorEnrollmentForm.js.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/SynapseGrid.js +244 -246
- package/dist/components/DataGrid/SynapseGrid.js.map +1 -1
- package/dist/components/DataGrid/components/GridLoadingState.d.ts +23 -0
- package/dist/components/DataGrid/components/GridLoadingState.d.ts.map +1 -0
- package/dist/components/DataGrid/components/GridLoadingState.js +64 -0
- package/dist/components/DataGrid/components/GridLoadingState.js.map +1 -0
- package/dist/components/DataGrid/components/ReorderColumnsDialog.d.ts.map +1 -1
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js +30 -29
- package/dist/components/DataGrid/components/ReorderColumnsDialog.js.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts +60 -6
- package/dist/components/DataGrid/useDataGridWebsocket.d.ts.map +1 -1
- package/dist/components/DataGrid/useDataGridWebsocket.js +71 -60
- package/dist/components/DataGrid/useDataGridWebsocket.js.map +1 -1
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts +11 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.d.ts.map +1 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js +8 -0
- package/dist/components/DataGrid/utils/getNamedColumnIndices.js.map +1 -0
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts +6 -2
- package/dist/components/FilePreview/FileHandleContentRenderer.d.ts.map +1 -1
- package/dist/components/FilePreview/FileHandleContentRenderer.js +27 -14
- package/dist/components/FilePreview/FileHandleContentRenderer.js.map +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts +1 -1
- package/dist/components/FilePreview/PdfPreview.d.ts.map +1 -1
- package/dist/components/FilePreview/PdfPreview.js +15 -16
- package/dist/components/FilePreview/PdfPreview.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +71 -68
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -1
- package/dist/components/FormTemplateEditor/FieldLibrary.css +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts +17 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js +88 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibrary.module.scss +12 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts +19 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js +115 -0
- package/dist/components/FormTemplateEditor/FieldLibraryRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.css +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts +9 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js +18 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js +5 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldValidationErrorAlert.module.scss +4 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts +21 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js +108 -0
- package/dist/components/FormTemplateEditor/FormStructurePanel.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts +10 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js +31 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts +15 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js +234 -0
- package/dist/components/FormTemplateEditor/FormTemplateEditorForm.js.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +1 -12
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -1
- package/dist/components/FormTemplateEditor/StepCard.d.ts +25 -0
- package/dist/components/FormTemplateEditor/StepCard.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepCard.js +203 -0
- package/dist/components/FormTemplateEditor/StepCard.js.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts +34 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js +128 -0
- package/dist/components/FormTemplateEditor/StepFieldRow.js.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts +19 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js +78 -0
- package/dist/components/FormTemplateEditor/TemplateFileHandleField.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.css +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js +8 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dragHandle.module.scss +22 -0
- package/dist/components/FormTemplateEditor/dropTarget.css +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js +5 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.js.map +1 -0
- package/dist/components/FormTemplateEditor/dropTarget.module.scss +14 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts +48 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js +126 -0
- package/dist/components/FormTemplateEditor/formTemplateDraftState.js.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js +35 -0
- package/dist/components/FormTemplateEditor/formTemplateSchema.js.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +3 -1
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +26 -8
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -1
- package/dist/components/FormTemplateEditor/sortableIds.d.ts +23 -0
- package/dist/components/FormTemplateEditor/sortableIds.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/sortableIds.js +24 -0
- package/dist/components/FormTemplateEditor/sortableIds.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts +33 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js +59 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDraft.js.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts +9 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js +66 -0
- package/dist/components/FormTemplateEditor/useFormTemplateDrag.js.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +34 -19
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -1
- package/dist/components/FormTemplateEditor/utils.d.ts +2 -2
- package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -1
- package/dist/components/FormTemplateEditor/utils.js +7 -10
- package/dist/components/FormTemplateEditor/utils.js.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts +11 -0
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js +28 -19
- package/dist/components/JsonSchemaForm/widgets/SelectWidget.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +1 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.js +102 -105
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.js +6 -6
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.js +88 -81
- package/dist/components/QueryBuilder/QueryBuilderControls.js.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts +7 -0
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderInternalContext.js.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts +2 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.d.ts.map +1 -1
- package/dist/components/QueryBuilder/qbTreeToReadable.js +24 -20
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -1
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js +2 -2
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +1 -1
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts +16 -0
- package/dist/components/QueryBuilder/queryBuilderMetadata.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderMetadata.js +13 -5
- package/dist/components/QueryBuilder/queryBuilderMetadata.js.map +1 -1
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts +18 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.d.ts.map +1 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js +64 -0
- package/dist/components/QueryBuilder/useQBValueDisplayName.js.map +1 -0
- package/dist/components/SynapseTable/RowSelection/RowSelectionControls.js +6 -6
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts +1 -0
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.d.ts.map +1 -1
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js +13 -11
- package/dist/components/SynapseTable/RowSelection/RowSelectionUI.js.map +1 -1
- package/dist/components/SynapseTable/SearchV2.js +4 -4
- package/dist/components/ToastMessage/ToastMessage.d.ts.map +1 -1
- package/dist/components/ToastMessage/ToastMessage.js +25 -22
- package/dist/components/ToastMessage/ToastMessage.js.map +1 -1
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts +7 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js +26 -0
- package/dist/components/dataaccess/FormTemplateEditorRoute.js.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts +10 -0
- package/dist/components/dataaccess/FormTemplateTable.d.ts.map +1 -0
- package/dist/components/dataaccess/FormTemplateTable.js +124 -0
- package/dist/components/dataaccess/FormTemplateTable.js.map +1 -0
- package/dist/components/dataaccess/ReviewerDashboard.d.ts.map +1 -1
- package/dist/components/dataaccess/ReviewerDashboard.js +80 -50
- package/dist/components/dataaccess/ReviewerDashboard.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js +2 -0
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/widgets/FileHandleLink.d.ts +12 -2
- package/dist/components/widgets/FileHandleLink.d.ts.map +1 -1
- package/dist/components/widgets/FileHandleLink.js +25 -29
- package/dist/components/widgets/FileHandleLink.js.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts +2 -0
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.js +8 -2
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +17 -31
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.d.ts +1 -0
- package/dist/mocks/msw/handlers/authHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/authHandlers.js +6 -2
- package/dist/mocks/msw/handlers/authHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts +2 -0
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js +52 -46
- package/dist/mocks/msw/handlers/dataAccessRequestHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/fileHandlers.js +25 -21
- package/dist/mocks/msw/handlers/fileHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts +2 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/formTemplateHandlers.js +18 -18
- package/dist/mocks/msw/handlers/formTemplateHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts +8 -0
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +20 -3
- package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts +8 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.d.ts.map +1 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js +19 -0
- package/dist/mocks/msw/handlers/twoFactorEnrollmentHandlers.js.map +1 -0
- package/dist/style/abstracts/_cssVariables.scss +13 -0
- package/dist/style/components/_toasts.scss +10 -1
- package/dist/style/main.css +1 -1
- package/dist/synapse-queries/KeyFactory.d.ts +8 -1
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +17 -4
- package/dist/synapse-queries/KeyFactory.js.map +1 -1
- package/dist/synapse-queries/auth/index.d.ts +1 -0
- package/dist/synapse-queries/auth/index.d.ts.map +1 -1
- package/dist/synapse-queries/auth/index.js +2 -1
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts +11 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.d.ts.map +1 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js +19 -0
- package/dist/synapse-queries/auth/useUnbindOAuthProviderIdentity.js.map +1 -0
- package/dist/synapse-queries/dataaccess/index.js +5 -5
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts +18 -0
- package/dist/synapse-queries/dataaccess/useEDuc.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js +33 -1
- package/dist/synapse-queries/dataaccess/useEDuc.js.map +1 -1
- package/dist/synapse-queries/file/useDirectUploadToS3.js +6 -6
- package/dist/synapse-queries/file/useFileHandle.d.ts +8 -0
- package/dist/synapse-queries/file/useFileHandle.d.ts.map +1 -1
- package/dist/synapse-queries/file/useFileHandle.js +15 -6
- package/dist/synapse-queries/file/useFileHandle.js.map +1 -1
- package/dist/synapse-queries/index.js +260 -253
- package/dist/synapse-queries/jsonschema/index.js +2 -2
- package/dist/synapse-queries/jsonschema/useSchema.d.ts +5 -0
- package/dist/synapse-queries/jsonschema/useSchema.d.ts.map +1 -1
- package/dist/synapse-queries/jsonschema/useSchema.js +9 -1
- package/dist/synapse-queries/jsonschema/useSchema.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +1 -0
- package/dist/utils/APIConstants.d.ts.map +1 -1
- package/dist/utils/APIConstants.js +2 -2
- package/dist/utils/APIConstants.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +1 -0
- package/dist/utils/featureflag/FeatureFlags.d.ts.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.js +1 -1
- package/dist/utils/featureflag/FeatureFlags.js.map +1 -1
- package/dist/utils/functions/toPascalCase.d.ts +6 -0
- package/dist/utils/functions/toPascalCase.d.ts.map +1 -0
- package/dist/utils/functions/toPascalCase.js +8 -0
- package/dist/utils/functions/toPascalCase.js.map +1 -0
- package/dist/utils/jsonschema/submissionContext.d.ts +5 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -1
- package/dist/utils/jsonschema/submissionContext.js +22 -30
- package/dist/utils/jsonschema/submissionContext.js.map +1 -1
- package/package.json +10 -9
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { readFieldDragData as e, slotGroupId as t, slotSortableId as n, stepSortableId as r } from "./sortableIds.js";
|
|
2
|
+
import { useCallback as i, useMemo as a, useRef as o } from "react";
|
|
3
|
+
import { move as s } from "@dnd-kit/helpers";
|
|
4
|
+
//#region src/components/FormTemplateEditor/useFormTemplateDrag.ts
|
|
5
|
+
function c(e, r, i) {
|
|
6
|
+
let a = Object.fromEntries(e.map((e) => [t(e), e.fields.map(n)])), o = s(a, r);
|
|
7
|
+
if (o === a) return null;
|
|
8
|
+
for (let n of e) {
|
|
9
|
+
let e = o[t(n)]?.indexOf(i) ?? -1;
|
|
10
|
+
if (e !== -1) return {
|
|
11
|
+
stepKey: n.uiKey,
|
|
12
|
+
index: e
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function l({ steps: t, setSteps: l, moveStep: u, moveSlot: d, bindField: f }) {
|
|
18
|
+
let p = o(null), m = i(() => {
|
|
19
|
+
p.current = t;
|
|
20
|
+
}, [t]), h = i((e) => {
|
|
21
|
+
let { source: i } = e.operation;
|
|
22
|
+
if (!i) return;
|
|
23
|
+
let a = String(i.id);
|
|
24
|
+
if (i.type === "step") {
|
|
25
|
+
let n = t.map(r), i = s(n, e);
|
|
26
|
+
if (i === n) return;
|
|
27
|
+
u(n.indexOf(a), i.indexOf(a));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (i.type === "slot") {
|
|
31
|
+
let r = t.flatMap((e) => e.fields).find((e) => n(e) === a), i = c(t, e, a);
|
|
32
|
+
r && i && d(r.schemaPath, i.stepKey, i.index);
|
|
33
|
+
}
|
|
34
|
+
}, [
|
|
35
|
+
t,
|
|
36
|
+
u,
|
|
37
|
+
d
|
|
38
|
+
]), g = i((n) => {
|
|
39
|
+
let i = p.current;
|
|
40
|
+
if (p.current = null, n.canceled) {
|
|
41
|
+
i && l(i);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
let { source: a, target: o } = n.operation;
|
|
45
|
+
if (a?.type !== "field" || o?.type !== "step") return;
|
|
46
|
+
let s = e(a.data), c = t.find((e) => r(e) === String(o.id));
|
|
47
|
+
s && c && f(s, c.uiKey);
|
|
48
|
+
}, [
|
|
49
|
+
t,
|
|
50
|
+
l,
|
|
51
|
+
f
|
|
52
|
+
]);
|
|
53
|
+
return a(() => ({
|
|
54
|
+
onDragStart: m,
|
|
55
|
+
onDragOver: h,
|
|
56
|
+
onDragEnd: g
|
|
57
|
+
}), [
|
|
58
|
+
m,
|
|
59
|
+
h,
|
|
60
|
+
g
|
|
61
|
+
]);
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
64
|
+
export { l as useFormTemplateDrag };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=useFormTemplateDrag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormTemplateDrag.js","names":[],"sources":["../../../src/components/FormTemplateEditor/useFormTemplateDrag.ts"],"sourcesContent":["/*\n * Drag-and-drop for the FormTemplateEditor, as handlers for `DragDropProvider`. Translates dnd-kit\n * events into the draft's intent-level moves; the geometry of where a drag lands is left to\n * `@dnd-kit/helpers`' `move`, applied to id projections of the draft.\n */\nimport { move } from '@dnd-kit/helpers'\nimport { DragEndEvent, DragOverEvent } from '@dnd-kit/react'\nimport { useCallback, useMemo, useRef } from 'react'\nimport {\n FIELD_DRAG_TYPE,\n readFieldDragData,\n slotGroupId,\n SLOT_SORTABLE_TYPE,\n slotSortableId,\n stepSortableId,\n STEP_SORTABLE_TYPE,\n} from './sortableIds'\nimport { FormTemplateDraft } from './useFormTemplateDraft'\nimport { EditableFormTemplateStep } from './utils'\n\nexport type FormTemplateDragHandlers = {\n onDragStart: () => void\n onDragOver: (event: DragOverEvent) => void\n onDragEnd: (event: DragEndEvent) => void\n}\n\n/**\n * The step a slot sortable ends up in after `move`, and its index there. `move` over the\n * `Record<slotGroupId, slotSortableId[]>` projection is what resolves a drag across steps,\n * including onto an empty step's slot list.\n */\nfunction projectSlotMove(\n steps: EditableFormTemplateStep[],\n event: DragOverEvent,\n slotId: string,\n): { stepKey: string; index: number } | null {\n const groups: Record<string, string[]> = Object.fromEntries(\n steps.map(step => [slotGroupId(step), step.fields.map(slotSortableId)]),\n )\n const moved = move(groups, event)\n if (moved === groups) return null\n for (const step of steps) {\n const index = moved[slotGroupId(step)]?.indexOf(slotId) ?? -1\n if (index !== -1) return { stepKey: step.uiKey, index }\n }\n return null\n}\n\nexport function useFormTemplateDrag({\n steps,\n setSteps,\n moveStep,\n moveSlot,\n bindField,\n}: Pick<\n FormTemplateDraft,\n 'steps' | 'setSteps' | 'moveStep' | 'moveSlot' | 'bindField'\n>): FormTemplateDragHandlers {\n // The steps as they stood before the in-flight drag. `onDragOver` rewrites the steps as the\n // pointer moves, so this snapshot is the only way back if the gesture is canceled — dnd-kit\n // reverts its own state, never ours.\n const stepsBeforeDrag = useRef<EditableFormTemplateStep[] | null>(null)\n\n const onDragStart = useCallback(() => {\n stepsBeforeDrag.current = steps\n }, [steps])\n\n // Reordering is applied while dragging rather than on drop. `useSortable` ships with\n // `OptimisticSortingPlugin`, which reorders the dragged element in the DOM behind React's back\n // unless the draft already reflects the new order by the time the drag-over render commits.\n // Letting it win moves a slot's element into another step's list while React still believes it\n // belongs to the old one, which strands the node and throws on the next removal.\n const onDragOver = useCallback(\n (event: DragOverEvent) => {\n const { source } = event.operation\n if (!source) return\n const sourceId = String(source.id)\n\n if (source.type === STEP_SORTABLE_TYPE) {\n const stepIds = steps.map(stepSortableId)\n const moved = move(stepIds, event)\n if (moved === stepIds) return\n moveStep(stepIds.indexOf(sourceId), moved.indexOf(sourceId))\n return\n }\n\n if (source.type === SLOT_SORTABLE_TYPE) {\n const field = steps\n .flatMap(step => step.fields)\n .find(f => slotSortableId(f) === sourceId)\n const destination = projectSlotMove(steps, event, sourceId)\n if (field && destination) {\n moveSlot(field.schemaPath, destination.stepKey, destination.index)\n }\n }\n },\n [steps, moveStep, moveSlot],\n )\n\n // Binding a library field to a step is the one drag that is not a reorder, so it has no\n // optimistic counterpart to keep in sync and only takes effect once the field is dropped.\n const onDragEnd = useCallback(\n (event: DragEndEvent) => {\n const snapshot = stepsBeforeDrag.current\n stepsBeforeDrag.current = null\n if (event.canceled) {\n if (snapshot) setSteps(snapshot)\n return\n }\n\n const { source, target } = event.operation\n if (\n source?.type !== FIELD_DRAG_TYPE ||\n target?.type !== STEP_SORTABLE_TYPE\n ) {\n return\n }\n const propertyKey = readFieldDragData(source.data)\n const step = steps.find(s => stepSortableId(s) === String(target.id))\n if (propertyKey && step) bindField(propertyKey, step.uiKey)\n },\n [steps, setSteps, bindField],\n )\n\n return useMemo(\n () => ({ onDragStart, onDragOver, onDragEnd }),\n [onDragStart, onDragOver, onDragEnd],\n )\n}\n"],"mappings":";;;;AA+BA,SAAS,EACP,GACA,GACA,GAC2C;CAC3C,IAAM,IAAmC,OAAO,YAC9C,EAAM,KAAI,MAAQ,CAAC,EAAY,CAAI,GAAG,EAAK,OAAO,IAAI,CAAc,CAAC,CAAC,CACxE,GACM,IAAQ,EAAK,GAAQ,CAAK;CAChC,IAAI,MAAU,GAAQ,OAAO;CAC7B,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAM,IAAQ,EAAM,EAAY,CAAI,IAAI,QAAQ,CAAM,KAAK;EAC3D,IAAI,MAAU,IAAI,OAAO;GAAE,SAAS,EAAK;GAAO;EAAM;CACxD;CACA,OAAO;AACT;AAEA,SAAgB,EAAoB,EAClC,UACA,aACA,aACA,aACA,gBAI2B;CAI3B,IAAM,IAAkB,EAA0C,IAAI,GAEhE,IAAc,QAAkB;EACpC,EAAgB,UAAU;CAC5B,GAAG,CAAC,CAAK,CAAC,GAOJ,IAAa,GAChB,MAAyB;EACxB,IAAM,EAAE,cAAW,EAAM;EACzB,IAAI,CAAC,GAAQ;EACb,IAAM,IAAW,OAAO,EAAO,EAAE;EAEjC,IAAI,EAAO,SAAA,QAA6B;GACtC,IAAM,IAAU,EAAM,IAAI,CAAc,GAClC,IAAQ,EAAK,GAAS,CAAK;GACjC,IAAI,MAAU,GAAS;GACvB,EAAS,EAAQ,QAAQ,CAAQ,GAAG,EAAM,QAAQ,CAAQ,CAAC;GAC3D;EACF;EAEA,IAAI,EAAO,SAAA,QAA6B;GACtC,IAAM,IAAQ,EACX,SAAQ,MAAQ,EAAK,MAAM,EAC3B,MAAK,MAAK,EAAe,CAAC,MAAM,CAAQ,GACrC,IAAc,EAAgB,GAAO,GAAO,CAAQ;GAC1D,AAAI,KAAS,KACX,EAAS,EAAM,YAAY,EAAY,SAAS,EAAY,KAAK;EAErE;CACF,GACA;EAAC;EAAO;EAAU;CAAQ,CAC5B,GAIM,IAAY,GACf,MAAwB;EACvB,IAAM,IAAW,EAAgB;EAEjC,IADA,EAAgB,UAAU,MACtB,EAAM,UAAU;GAClB,AAAI,KAAU,EAAS,CAAQ;GAC/B;EACF;EAEA,IAAM,EAAE,WAAQ,cAAW,EAAM;EACjC,IACE,GAAQ,SAAA,WACR,GAAQ,SAAA,QAER;EAEF,IAAM,IAAc,EAAkB,EAAO,IAAI,GAC3C,IAAO,EAAM,MAAK,MAAK,EAAe,CAAC,MAAM,OAAO,EAAO,EAAE,CAAC;EACpE,AAAI,KAAe,KAAM,EAAU,GAAa,EAAK,KAAK;CAC5D,GACA;EAAC;EAAO;EAAU;CAAS,CAC7B;CAEA,OAAO,SACE;EAAE;EAAa;EAAY;CAAU,IAC5C;EAAC;EAAa;EAAY;CAAS,CACrC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveFormTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/useSaveFormTemplate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSaveFormTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/useSaveFormTemplate.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,YAAY,EAAc,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAA;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAEL,kBAAkB,EAEnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,wBAAwB,EAAuB,MAAM,SAAS,CAAA;AAMvE,OAAO,EACL,gCAAgC,EAEjC,MAAM,0BAA0B,CAAA;AAEjC,MAAM,MAAM,2BAA2B,GAAG;IACxC,eAAe,CAAC,EAAE,YAAY,CAAA;IAC9B,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,wBAAwB,EAAE,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,gBAAgB,EAAE,gCAAgC,EAAE,CAAA;CAAE,CAAA;AAEvE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,CAAC,EAAE,IAAI,CACZ,kBAAkB,CAChB,2BAA2B,EAC3B,kBAAkB,EAClB,2BAA2B,CAC5B,EACD,YAAY,CACb,4IA2EF"}
|
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { useSynapseContext as e } from "../../utils/context/SynapseContext.js";
|
|
2
|
+
import { useCreateFormTemplate as t, useUpdateFormTemplate as n } from "../../synapse-queries/dataaccess/useFormTemplate.js";
|
|
3
|
+
import { getJsonSchemaVersionsQuery as r } from "../../synapse-queries/jsonschema/useListJsonSchemaVersions.js";
|
|
4
|
+
import { useCreateJsonSchema as i } from "../../synapse-queries/jsonschema/useCreateJsonSchema.js";
|
|
5
|
+
import { formatSchema$id as a, getNextSchemaVersion as o, resolveFormTemplateSchemaName as s } from "./formTemplateSchema.js";
|
|
6
|
+
import { toFormTemplateSteps as c } from "./utils.js";
|
|
7
|
+
import { validateFormTemplateFields as l } from "./formTemplateValidation.js";
|
|
8
|
+
import { useMutation as u, useQueryClient as d } from "@tanstack/react-query";
|
|
9
|
+
import f from "lodash-es/isEqual";
|
|
7
10
|
//#region src/components/FormTemplateEditor/useSaveFormTemplate.ts
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
return
|
|
11
|
-
...
|
|
11
|
+
function p(p) {
|
|
12
|
+
let m = d(), { synapseClient: h, keyFactory: g } = e(), _ = i(), v = t(), y = n();
|
|
13
|
+
return u({
|
|
14
|
+
...p,
|
|
12
15
|
mutationFn: async (e) => {
|
|
13
|
-
let t =
|
|
16
|
+
let t = c(e.steps), n = l(t, e.jsonSchema);
|
|
14
17
|
if (n.length > 0) return {
|
|
15
18
|
ok: !1,
|
|
16
19
|
validationErrors: n
|
|
17
20
|
};
|
|
18
|
-
let
|
|
19
|
-
(!
|
|
20
|
-
|
|
21
|
+
let i = e.initialTemplate?.schema$id ?? "";
|
|
22
|
+
if (!f(e.jsonSchema, e.initialJsonSchema) || !i) {
|
|
23
|
+
let t = s(e.name, e.initialTemplate?.schema$id), n = await m.fetchQuery({
|
|
24
|
+
...r(t.organizationName, t.schemaName, {
|
|
25
|
+
synapseClient: h,
|
|
26
|
+
keyFactory: g
|
|
27
|
+
}),
|
|
28
|
+
staleTime: 0
|
|
29
|
+
});
|
|
30
|
+
i = (await _.mutateAsync({
|
|
31
|
+
...e.jsonSchema,
|
|
32
|
+
$id: a(t, o(n))
|
|
33
|
+
})).newVersionInfo.$id;
|
|
34
|
+
}
|
|
35
|
+
let u = {
|
|
21
36
|
...e.initialTemplate,
|
|
22
37
|
name: e.name,
|
|
23
|
-
schema$id:
|
|
38
|
+
schema$id: i,
|
|
24
39
|
steps: t
|
|
25
40
|
};
|
|
26
41
|
return {
|
|
27
42
|
ok: !0,
|
|
28
|
-
template: e.initialTemplate?.id ? await
|
|
43
|
+
template: e.initialTemplate?.id ? await y.mutateAsync({
|
|
29
44
|
templateId: e.initialTemplate.id,
|
|
30
|
-
formTemplate:
|
|
31
|
-
}) : await
|
|
45
|
+
formTemplate: u
|
|
46
|
+
}) : await v.mutateAsync(u)
|
|
32
47
|
};
|
|
33
48
|
}
|
|
34
49
|
});
|
|
35
50
|
}
|
|
36
51
|
//#endregion
|
|
37
|
-
export {
|
|
52
|
+
export { p as useSaveFormTemplate };
|
|
38
53
|
|
|
39
54
|
//# sourceMappingURL=useSaveFormTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSaveFormTemplate.js","names":[],"sources":["../../../src/components/FormTemplateEditor/useSaveFormTemplate.ts"],"sourcesContent":["/*\n * Network orchestration for saving a FormTemplate draft: pre-flight client-side validation\n * (mirroring the server's per-field rules, since the server only returns a flat message),\n * registering a new JSON Schema version when the schema body changed, and creating or updating\n * the FormTemplate against that schema version.\n */\nimport { useCreateJsonSchema } from '@/synapse-queries/jsonschema/useCreateJsonSchema'\nimport {\n useCreateFormTemplate,\n useUpdateFormTemplate,\n} from '@/synapse-queries/dataaccess/useFormTemplate'\nimport { FormTemplate, JsonSchema } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { RJSFSchema } from '@rjsf/utils'\nimport isEqual from 'lodash-es/isEqual'\nimport {
|
|
1
|
+
{"version":3,"file":"useSaveFormTemplate.js","names":[],"sources":["../../../src/components/FormTemplateEditor/useSaveFormTemplate.ts"],"sourcesContent":["/*\n * Network orchestration for saving a FormTemplate draft: pre-flight client-side validation\n * (mirroring the server's per-field rules, since the server only returns a flat message),\n * registering a new JSON Schema version when the schema body changed, and creating or updating\n * the FormTemplate against that schema version.\n */\nimport { getJsonSchemaVersionsQuery } from '@/synapse-queries/jsonschema/useListJsonSchemaVersions'\nimport { useCreateJsonSchema } from '@/synapse-queries/jsonschema/useCreateJsonSchema'\nimport {\n useCreateFormTemplate,\n useUpdateFormTemplate,\n} from '@/synapse-queries/dataaccess/useFormTemplate'\nimport { FormTemplate, JsonSchema } from '@sage-bionetworks/synapse-client'\nimport { SynapseClientError } from '@sage-bionetworks/synapse-client/util/SynapseClientError'\nimport { RJSFSchema } from '@rjsf/utils'\nimport isEqual from 'lodash-es/isEqual'\nimport {\n useMutation,\n UseMutationOptions,\n useQueryClient,\n} from '@tanstack/react-query'\nimport { useSynapseContext } from '@/utils/context/SynapseContext'\nimport { EditableFormTemplateStep, toFormTemplateSteps } from './utils'\nimport {\n formatSchema$id,\n getNextSchemaVersion,\n resolveFormTemplateSchemaName,\n} from './formTemplateSchema'\nimport {\n FormTemplateFieldValidationError,\n validateFormTemplateFields,\n} from './formTemplateValidation'\n\nexport type SaveFormTemplateDraftParams = {\n initialTemplate?: FormTemplate\n initialJsonSchema?: RJSFSchema\n name: string\n jsonSchema: RJSFSchema\n steps: EditableFormTemplateStep[]\n}\n\nexport type SaveFormTemplateDraftResult =\n | { ok: true; template: FormTemplate }\n | { ok: false; validationErrors: FormTemplateFieldValidationError[] }\n\n/**\n * Owns the create-schema, create-template, and update-template mutations, and sequences them\n * into a single save mutation. A validation failure resolves as `{ ok: false, validationErrors }`\n * rather than rejecting; a network failure (including a 412 conflict from a concurrent edit)\n * rejects normally, surfaced via the returned mutation's `error`.\n */\nexport function useSaveFormTemplate(\n options?: Omit<\n UseMutationOptions<\n SaveFormTemplateDraftResult,\n SynapseClientError,\n SaveFormTemplateDraftParams\n >,\n 'mutationFn'\n >,\n) {\n const queryClient = useQueryClient()\n const { synapseClient, keyFactory } = useSynapseContext()\n const createSchema = useCreateJsonSchema()\n const createTemplate = useCreateFormTemplate()\n const updateTemplate = useUpdateFormTemplate()\n\n return useMutation<\n SaveFormTemplateDraftResult,\n SynapseClientError,\n SaveFormTemplateDraftParams\n >({\n ...options,\n mutationFn: async params => {\n const formTemplateSteps = toFormTemplateSteps(params.steps)\n\n const validationErrors = validateFormTemplateFields(\n formTemplateSteps,\n params.jsonSchema,\n )\n if (validationErrors.length > 0) {\n return { ok: false, validationErrors }\n }\n\n // The schema registry has no update operation — every save that changed the schema body\n // registers a fresh, immutable version. Re-registering an unchanged body would still create\n // an unnecessary version, so skip it when the draft's schema matches what was last resolved.\n let schema$id = params.initialTemplate?.schema$id ?? ''\n const schemaChanged = !isEqual(\n params.jsonSchema,\n params.initialJsonSchema,\n )\n if (schemaChanged || !schema$id) {\n const templateSchemaName = resolveFormTemplateSchemaName(\n params.name,\n params.initialTemplate?.schema$id,\n )\n // Registered versions are immutable, so the list is read fresh on every save to pick a\n // version that does not exist yet.\n const registeredVersions = await queryClient.fetchQuery({\n ...getJsonSchemaVersionsQuery(\n templateSchemaName.organizationName,\n templateSchemaName.schemaName,\n { synapseClient, keyFactory },\n ),\n staleTime: 0,\n })\n const response = await createSchema.mutateAsync({\n ...params.jsonSchema,\n $id: formatSchema$id(\n templateSchemaName,\n getNextSchemaVersion(registeredVersions),\n ),\n } as JsonSchema)\n schema$id = response.newVersionInfo!.$id!\n }\n\n const formTemplate: FormTemplate = {\n ...params.initialTemplate,\n name: params.name,\n schema$id,\n steps: formTemplateSteps,\n }\n\n const template = params.initialTemplate?.id\n ? await updateTemplate.mutateAsync({\n templateId: params.initialTemplate.id,\n formTemplate,\n })\n : await createTemplate.mutateAsync(formTemplate)\n\n return { ok: true, template }\n },\n })\n}\n"],"mappings":";;;;;;;;;;AAmDA,SAAgB,EACd,GAQA;CACA,IAAM,IAAc,EAAe,GAC7B,EAAE,kBAAe,kBAAe,EAAkB,GAClD,IAAe,EAAoB,GACnC,IAAiB,EAAsB,GACvC,IAAiB,EAAsB;CAE7C,OAAO,EAIL;EACA,GAAG;EACH,YAAY,OAAM,MAAU;GAC1B,IAAM,IAAoB,EAAoB,EAAO,KAAK,GAEpD,IAAmB,EACvB,GACA,EAAO,UACT;GACA,IAAI,EAAiB,SAAS,GAC5B,OAAO;IAAE,IAAI;IAAO;GAAiB;GAMvC,IAAI,IAAY,EAAO,iBAAiB,aAAa;GAKrD,IAAI,CAJmB,EACrB,EAAO,YACP,EAAO,iBACT,KACqB,CAAC,GAAW;IAC/B,IAAM,IAAqB,EACzB,EAAO,MACP,EAAO,iBAAiB,SAC1B,GAGM,IAAqB,MAAM,EAAY,WAAW;KACtD,GAAG,EACD,EAAmB,kBACnB,EAAmB,YACnB;MAAE;MAAe;KAAW,CAC9B;KACA,WAAW;IACb,CAAC;IAQD,KAAY,MAPW,EAAa,YAAY;KAC9C,GAAG,EAAO;KACV,KAAK,EACH,GACA,EAAqB,CAAkB,CACzC;IACF,CAAe,GACM,eAAgB;GACvC;GAEA,IAAM,IAA6B;IACjC,GAAG,EAAO;IACV,MAAM,EAAO;IACb;IACA,OAAO;GACT;GASA,OAAO;IAAE,IAAI;IAAM,UAPF,EAAO,iBAAiB,KACrC,MAAM,EAAe,YAAY;KAC/B,YAAY,EAAO,gBAAgB;KACnC;IACF,CAAC,IACD,MAAM,EAAe,YAAY,CAAY;GAErB;EAC9B;CACF,CAAC;AACH"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FormTemplateStep } from '@sage-bionetworks/synapse-client';
|
|
2
2
|
export { moveItem } from '@/utils/functions/ArrayUtils';
|
|
3
|
+
/** Label for the per-step control that binds an unbound field into that step. */
|
|
4
|
+
export declare const BIND_FIELD_LABEL = "Bind field";
|
|
3
5
|
/**
|
|
4
6
|
* A `FormTemplateStep` with a client-only stable identity, used as a React
|
|
5
7
|
* key and drag-and-drop sortable id. Steps have no natural unique field
|
|
@@ -16,6 +18,4 @@ export declare function createEditableStep(): EditableFormTemplateStep;
|
|
|
16
18
|
export declare function toEditableSteps(steps: FormTemplateStep[]): EditableFormTemplateStep[];
|
|
17
19
|
/** Strip the client-only identity before handing steps back to a caller. */
|
|
18
20
|
export declare function toFormTemplateSteps(steps: EditableFormTemplateStep[]): FormTemplateStep[];
|
|
19
|
-
/** Normalize a JSON pointer (ensure leading slash). */
|
|
20
|
-
export declare function normalizePointer(p: string): string;
|
|
21
21
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEvD,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,eAAe,CAAA;AAI5C;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3E,qDAAqD;AACrD,wBAAgB,kBAAkB,IAAI,wBAAwB,CAO7D;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAC7B,KAAK,EAAE,gBAAgB,EAAE,GACxB,wBAAwB,EAAE,CAE5B;AAED,4EAA4E;AAC5E,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,EAAE,GAChC,gBAAgB,EAAE,CAEpB"}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import { moveItem as e } from "../../utils/functions/ArrayUtils.js";
|
|
2
2
|
//#region src/components/FormTemplateEditor/utils.ts
|
|
3
|
-
var t = 0;
|
|
4
|
-
function
|
|
3
|
+
var t = "Bind field", n = 0;
|
|
4
|
+
function r() {
|
|
5
5
|
return {
|
|
6
6
|
title: "New Step",
|
|
7
7
|
description: "",
|
|
8
8
|
fields: [],
|
|
9
|
-
uiKey: `step-${
|
|
9
|
+
uiKey: `step-${n++}`
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function i(e) {
|
|
13
13
|
return e.map((e) => ({
|
|
14
14
|
...e,
|
|
15
|
-
uiKey: `step-${
|
|
15
|
+
uiKey: `step-${n++}`
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
18
|
-
function i(e) {
|
|
19
|
-
return e.map(({ uiKey: e, ...t }) => t);
|
|
20
|
-
}
|
|
21
18
|
function a(e) {
|
|
22
|
-
return e
|
|
19
|
+
return e.map(({ uiKey: e, ...t }) => t);
|
|
23
20
|
}
|
|
24
21
|
//#endregion
|
|
25
|
-
export {
|
|
22
|
+
export { t as BIND_FIELD_LABEL, r as createEditableStep, e as moveItem, i as toEditableSteps, a as toFormTemplateSteps };
|
|
26
23
|
|
|
27
24
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/FormTemplateEditor/utils.ts"],"sourcesContent":["import { FormTemplateStep } from '@sage-bionetworks/synapse-client'\n\nexport { moveItem } from '@/utils/functions/ArrayUtils'\n\nlet nextUiKeySeq = 0\n\n/**\n * A `FormTemplateStep` with a client-only stable identity, used as a React\n * key and drag-and-drop sortable id. Steps have no natural unique field\n * (unlike fields, whose identity is their `schemaPath`), so the editor\n * tracks one here. `uiKey` never leaves this component tree — strip it with\n * `toFormTemplateSteps` before handing steps back to a caller.\n */\nexport type EditableFormTemplateStep = FormTemplateStep & { uiKey: string }\n\n/** Create a new empty step with a fresh identity. */\nexport function createEditableStep(): EditableFormTemplateStep {\n return {\n title: 'New Step',\n description: '',\n fields: [],\n uiKey: `step-${nextUiKeySeq++}`,\n }\n}\n\n/** Attach a fresh identity to each step loaded from outside the editor. */\nexport function toEditableSteps(\n steps: FormTemplateStep[],\n): EditableFormTemplateStep[] {\n return steps.map(step => ({ ...step, uiKey: `step-${nextUiKeySeq++}` }))\n}\n\n/** Strip the client-only identity before handing steps back to a caller. */\nexport function toFormTemplateSteps(\n steps: EditableFormTemplateStep[],\n): FormTemplateStep[] {\n return steps.map(({ uiKey: _uiKey, ...rest }) => rest)\n}\n
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/FormTemplateEditor/utils.ts"],"sourcesContent":["import { FormTemplateStep } from '@sage-bionetworks/synapse-client'\n\nexport { moveItem } from '@/utils/functions/ArrayUtils'\n\n/** Label for the per-step control that binds an unbound field into that step. */\nexport const BIND_FIELD_LABEL = 'Bind field'\n\nlet nextUiKeySeq = 0\n\n/**\n * A `FormTemplateStep` with a client-only stable identity, used as a React\n * key and drag-and-drop sortable id. Steps have no natural unique field\n * (unlike fields, whose identity is their `schemaPath`), so the editor\n * tracks one here. `uiKey` never leaves this component tree — strip it with\n * `toFormTemplateSteps` before handing steps back to a caller.\n */\nexport type EditableFormTemplateStep = FormTemplateStep & { uiKey: string }\n\n/** Create a new empty step with a fresh identity. */\nexport function createEditableStep(): EditableFormTemplateStep {\n return {\n title: 'New Step',\n description: '',\n fields: [],\n uiKey: `step-${nextUiKeySeq++}`,\n }\n}\n\n/** Attach a fresh identity to each step loaded from outside the editor. */\nexport function toEditableSteps(\n steps: FormTemplateStep[],\n): EditableFormTemplateStep[] {\n return steps.map(step => ({ ...step, uiKey: `step-${nextUiKeySeq++}` }))\n}\n\n/** Strip the client-only identity before handing steps back to a caller. */\nexport function toFormTemplateSteps(\n steps: EditableFormTemplateStep[],\n): FormTemplateStep[] {\n return steps.map(({ uiKey: _uiKey, ...rest }) => rest)\n}\n"],"mappings":";;AAKA,IAAa,IAAmB,cAE5B,IAAe;AAYnB,SAAgB,IAA+C;CAC7D,OAAO;EACL,OAAO;EACP,aAAa;EACb,QAAQ,CAAC;EACT,OAAO,QAAQ;CACjB;AACF;AAGA,SAAgB,EACd,GAC4B;CAC5B,OAAO,EAAM,KAAI,OAAS;EAAE,GAAG;EAAM,OAAO,QAAQ;CAAiB,EAAE;AACzE;AAGA,SAAgB,EACd,GACoB;CACpB,OAAO,EAAM,KAAK,EAAE,OAAO,GAAQ,GAAG,QAAW,CAAI;AACvD"}
|
|
@@ -6,6 +6,17 @@ import { Widget, EnumOptionsType } from '@rjsf/utils';
|
|
|
6
6
|
* where the label and value are set to the provided value.
|
|
7
7
|
*/
|
|
8
8
|
export declare function findValueOption(value: string | null | undefined, options: EnumOptionsType[]): EnumOptionsType | string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Maps a multi-select form value (an array of enum values) to the Autocomplete option objects it
|
|
11
|
+
* selects. Values with no matching option (e.g. free-solo input) become `{ value, label: value }`.
|
|
12
|
+
* A non-array value selects nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare function toMultipleAutocompleteValue(value: unknown, options: EnumOptionsType[]): EnumOptionsType[];
|
|
15
|
+
/**
|
|
16
|
+
* Maps a multi-select Autocomplete selection (option objects and/or free-solo strings) back to the
|
|
17
|
+
* array of enum values stored in the form data.
|
|
18
|
+
*/
|
|
19
|
+
export declare function fromMultipleAutocompleteValue(newValue: unknown): unknown[];
|
|
9
20
|
/**
|
|
10
21
|
* Select widget compatible with react-jsonschema-form enumerations
|
|
11
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.d.ts","sourceRoot":"","sources":["../../../../src/components/JsonSchemaForm/widgets/SelectWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,eAAe,EAAE,MAAM,aAAa,CAAA;AAOlE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,GAAG,MAAM,GAAG,IAAI,CAWjC;AAMD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"SelectWidget.d.ts","sourceRoot":"","sources":["../../../../src/components/JsonSchemaForm/widgets/SelectWidget.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,eAAe,EAAE,MAAM,aAAa,CAAA;AAOlE;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,GAAG,MAAM,GAAG,IAAI,CAWjC;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAWnB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,EAAE,CAO1E;AAMD;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAgG1B,CAAA"}
|
|
@@ -12,36 +12,45 @@ function o(e, t) {
|
|
|
12
12
|
label: e
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
function s(e, t) {
|
|
16
|
+
return Array.isArray(e) ? e.map((e) => t.find((t) => t.value === e) ?? {
|
|
17
|
+
value: e,
|
|
18
|
+
label: String(e)
|
|
19
|
+
}) : [];
|
|
20
|
+
}
|
|
21
|
+
function c(t) {
|
|
22
|
+
return Array.isArray(t) ? t.map((t) => e(t) && "value" in t ? t.value : t) : [];
|
|
23
|
+
}
|
|
24
|
+
var l = (i) => {
|
|
25
|
+
let { id: l, options: u, value: d, required: f, disabled: p, readonly: m, multiple: h, autofocus: g, onChange: _, onBlur: v, onFocus: y, placeholder: b, isClearable: x = !0, rawErrors: S, registry: C } = i, { enumOptions: w } = u, T = ["__oneof_select", "__anyof_select"].some((e) => l.includes(e)), E = !T && !!C.formContext.allowFreeSoloEnum, D = x && !T;
|
|
17
26
|
return /* @__PURE__ */ r(t, {
|
|
18
|
-
id:
|
|
19
|
-
value: o(
|
|
20
|
-
freeSolo:
|
|
27
|
+
id: l,
|
|
28
|
+
value: h ? s(d, w) : o(d, w),
|
|
29
|
+
freeSolo: E,
|
|
21
30
|
forcePopupIcon: !0,
|
|
22
31
|
selectOnFocus: !0,
|
|
23
32
|
clearOnBlur: !0,
|
|
24
33
|
handleHomeEndKeys: !0,
|
|
25
|
-
options:
|
|
26
|
-
readOnly:
|
|
27
|
-
disabled:
|
|
28
|
-
multiple:
|
|
29
|
-
disableClearable: !
|
|
34
|
+
options: w,
|
|
35
|
+
readOnly: m,
|
|
36
|
+
disabled: p,
|
|
37
|
+
multiple: h,
|
|
38
|
+
disableClearable: !D,
|
|
30
39
|
onChange: (t, n) => {
|
|
31
|
-
e(n) && "inputValue" in n ?
|
|
40
|
+
h ? _(c(n)) : e(n) && "inputValue" in n ? _(n.inputValue) : e(n) && "value" in n ? _(n.value) : _(n);
|
|
32
41
|
},
|
|
33
42
|
renderInput: (e) => /* @__PURE__ */ r(n, {
|
|
34
43
|
...e,
|
|
35
|
-
required:
|
|
36
|
-
placeholder:
|
|
37
|
-
error:
|
|
38
|
-
autoFocus:
|
|
39
|
-
onFocus:
|
|
40
|
-
onBlur:
|
|
44
|
+
required: f,
|
|
45
|
+
placeholder: b,
|
|
46
|
+
error: S && S.length > 0,
|
|
47
|
+
autoFocus: g,
|
|
48
|
+
onFocus: y && (() => y(l, d?.value)),
|
|
49
|
+
onBlur: v && (() => v(l, d?.value))
|
|
41
50
|
}),
|
|
42
51
|
filterOptions: (e, t) => {
|
|
43
52
|
let n = a(e, t), { inputValue: r } = t, i = e.some((e) => r === e.label);
|
|
44
|
-
return
|
|
53
|
+
return E && r !== "" && !i && n.push({
|
|
45
54
|
value: r,
|
|
46
55
|
label: `Set to custom value "${r}"`
|
|
47
56
|
}), n;
|
|
@@ -49,6 +58,6 @@ var s = (i) => {
|
|
|
49
58
|
});
|
|
50
59
|
};
|
|
51
60
|
//#endregion
|
|
52
|
-
export {
|
|
61
|
+
export { l as SelectWidget, o as findValueOption, c as fromMultipleAutocompleteValue, s as toMultipleAutocompleteValue };
|
|
53
62
|
|
|
54
63
|
//# sourceMappingURL=SelectWidget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectWidget.js","names":[],"sources":["../../../../src/components/JsonSchemaForm/widgets/SelectWidget.tsx"],"sourcesContent":["import { CustomFormContext } from '@/components/JsonSchemaForm/CustomFormContext'\nimport { Widget, WidgetProps, EnumOptionsType } from '@rjsf/utils'\nimport { Autocomplete, TextField } from '@mui/material'\nimport { createFilterOptions } from '@mui/material/Autocomplete'\nimport { isObject } from 'lodash-es'\n\nconst filter = createFilterOptions<EnumOptionsType>()\n\n/**\n * This function finds the enum option that has the corresponding value and returns it.\n *\n * If value is nullish, this fn returns null. If there is no corresponding option, then a new object is returned\n * where the label and value are set to the provided value.\n */\nexport function findValueOption(\n value: string | null | undefined,\n options: EnumOptionsType[],\n): EnumOptionsType | string | null {\n if (value == null) {\n return null\n }\n\n const correspondingOption = options.filter(option => option.value === value)\n if (correspondingOption.length > 0) {\n return correspondingOption[0]\n } else {\n return { value: value, label: value }\n }\n}\n\ntype SelectWidgetProps = WidgetProps & {\n isClearable?: boolean\n}\n\n/**\n * Select widget compatible with react-jsonschema-form enumerations\n */\nexport const SelectWidget: Widget = (props: SelectWidgetProps) => {\n const {\n id,\n options,\n value,\n required,\n disabled,\n readonly,\n multiple,\n autofocus,\n onChange,\n onBlur,\n onFocus,\n placeholder,\n isClearable: _isClearable = true,\n rawErrors,\n registry,\n } = props\n\n const { enumOptions } = options as {\n enumOptions: EnumOptionsType[]\n }\n\n // If the ID includes one of these, then this is a widget used to select a schema in `oneOf` or `anyOf`.\n // In these cases, we should not allow free solo input.\n const isAnyOrOneOfOption = ['__oneof_select', '__anyof_select'].some(\n multiSchemaTag => id.includes(multiSchemaTag),\n )\n\n const allowFreeSolo =\n !isAnyOrOneOfOption &&\n Boolean((registry.formContext as CustomFormContext).allowFreeSoloEnum)\n\n // any/oneOf options should not be clearable\n const isClearable = _isClearable && !isAnyOrOneOfOption\n\n return (\n <Autocomplete\n id={id}\n value={findValueOption(value, enumOptions)}\n freeSolo={allowFreeSolo}\n forcePopupIcon\n selectOnFocus\n clearOnBlur\n handleHomeEndKeys\n options={enumOptions}\n readOnly={readonly}\n disabled={disabled}\n multiple={multiple}\n disableClearable={!isClearable}\n onChange={(event, newValue) => {\n if (isObject(newValue) && 'inputValue' in newValue) {\n // Create a new value from the user input\n onChange(newValue.inputValue)\n } else if (isObject(newValue) && 'value' in newValue) {\n onChange(newValue.value)\n } else if (typeof newValue === 'string') {\n onChange(newValue)\n } else {\n onChange(newValue)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n required={required}\n placeholder={placeholder}\n error={rawErrors && rawErrors.length > 0}\n autoFocus={autofocus}\n onFocus={onFocus && (() => onFocus(id, value?.value))}\n onBlur={onBlur && (() => onBlur(id, value?.value))}\n />\n )}\n filterOptions={(options, params) => {\n const filtered = filter(options, params)\n\n const { inputValue } = params\n // Suggest the creation of a new value\n const isExisting = options.some(option => inputValue === option.label)\n if (allowFreeSolo && inputValue !== '' && !isExisting) {\n filtered.push({\n value: inputValue,\n label: `Set to custom value \"${inputValue}\"`,\n })\n }\n\n return filtered\n }}\n />\n )\n}\n"],"mappings":";;;;;AAMA,IAAM,IAAS,EAAqC;AAQpD,SAAgB,EACd,GACA,GACiC;CACjC,IAAI,KAAS,MACX,OAAO;CAGT,IAAM,IAAsB,EAAQ,QAAO,MAAU,EAAO,UAAU,CAAK;CAIzE,OAHE,EAAoB,SAAS,IACxB,EAAoB,KAEpB;EAAS;EAAO,OAAO;CAAM;AAExC;AASA,IAAa,KAAwB,MAA6B;CAChE,IAAM,EACJ,OACA,YACA,UACA,aACA,aACA,aACA,aACA,cACA,aACA,WACA,YACA,gBACA,aAAa,IAAe,IAC5B,cACA,gBACE,GAEE,EAAE,mBAAgB,GAMlB,IAAqB,CAAC,kBAAkB,gBAAgB,EAAE,MAC9D,MAAkB,EAAG,SAAS,CAAc,CAC9C,GAEM,IACJ,CAAC,KACD,EAAS,EAAS,YAAkC,mBAGhD,IAAc,KAAgB,CAAC;CAErC,OACE,kBAAC,GAAD;EACM;EACJ,
|
|
1
|
+
{"version":3,"file":"SelectWidget.js","names":[],"sources":["../../../../src/components/JsonSchemaForm/widgets/SelectWidget.tsx"],"sourcesContent":["import { CustomFormContext } from '@/components/JsonSchemaForm/CustomFormContext'\nimport { Widget, WidgetProps, EnumOptionsType } from '@rjsf/utils'\nimport { Autocomplete, TextField } from '@mui/material'\nimport { createFilterOptions } from '@mui/material/Autocomplete'\nimport { isObject } from 'lodash-es'\n\nconst filter = createFilterOptions<EnumOptionsType>()\n\n/**\n * This function finds the enum option that has the corresponding value and returns it.\n *\n * If value is nullish, this fn returns null. If there is no corresponding option, then a new object is returned\n * where the label and value are set to the provided value.\n */\nexport function findValueOption(\n value: string | null | undefined,\n options: EnumOptionsType[],\n): EnumOptionsType | string | null {\n if (value == null) {\n return null\n }\n\n const correspondingOption = options.filter(option => option.value === value)\n if (correspondingOption.length > 0) {\n return correspondingOption[0]\n } else {\n return { value: value, label: value }\n }\n}\n\n/**\n * Maps a multi-select form value (an array of enum values) to the Autocomplete option objects it\n * selects. Values with no matching option (e.g. free-solo input) become `{ value, label: value }`.\n * A non-array value selects nothing.\n */\nexport function toMultipleAutocompleteValue(\n value: unknown,\n options: EnumOptionsType[],\n): EnumOptionsType[] {\n if (!Array.isArray(value)) {\n return []\n }\n return value.map(\n v =>\n options.find(option => option.value === v) ?? {\n value: v,\n label: String(v),\n },\n )\n}\n\n/**\n * Maps a multi-select Autocomplete selection (option objects and/or free-solo strings) back to the\n * array of enum values stored in the form data.\n */\nexport function fromMultipleAutocompleteValue(newValue: unknown): unknown[] {\n if (!Array.isArray(newValue)) {\n return []\n }\n return newValue.map((v: unknown) =>\n isObject(v) && 'value' in v ? v.value : v,\n )\n}\n\ntype SelectWidgetProps = WidgetProps & {\n isClearable?: boolean\n}\n\n/**\n * Select widget compatible with react-jsonschema-form enumerations\n */\nexport const SelectWidget: Widget = (props: SelectWidgetProps) => {\n const {\n id,\n options,\n value,\n required,\n disabled,\n readonly,\n multiple,\n autofocus,\n onChange,\n onBlur,\n onFocus,\n placeholder,\n isClearable: _isClearable = true,\n rawErrors,\n registry,\n } = props\n\n const { enumOptions } = options as {\n enumOptions: EnumOptionsType[]\n }\n\n // If the ID includes one of these, then this is a widget used to select a schema in `oneOf` or `anyOf`.\n // In these cases, we should not allow free solo input.\n const isAnyOrOneOfOption = ['__oneof_select', '__anyof_select'].some(\n multiSchemaTag => id.includes(multiSchemaTag),\n )\n\n const allowFreeSolo =\n !isAnyOrOneOfOption &&\n Boolean((registry.formContext as CustomFormContext).allowFreeSoloEnum)\n\n // any/oneOf options should not be clearable\n const isClearable = _isClearable && !isAnyOrOneOfOption\n\n return (\n <Autocomplete\n id={id}\n value={\n multiple\n ? toMultipleAutocompleteValue(value, enumOptions)\n : findValueOption(value, enumOptions)\n }\n freeSolo={allowFreeSolo}\n forcePopupIcon\n selectOnFocus\n clearOnBlur\n handleHomeEndKeys\n options={enumOptions}\n readOnly={readonly}\n disabled={disabled}\n multiple={multiple}\n disableClearable={!isClearable}\n onChange={(event, newValue) => {\n if (multiple) {\n onChange(fromMultipleAutocompleteValue(newValue))\n } else if (isObject(newValue) && 'inputValue' in newValue) {\n // Create a new value from the user input\n onChange(newValue.inputValue)\n } else if (isObject(newValue) && 'value' in newValue) {\n onChange(newValue.value)\n } else if (typeof newValue === 'string') {\n onChange(newValue)\n } else {\n onChange(newValue)\n }\n }}\n renderInput={params => (\n <TextField\n {...params}\n required={required}\n placeholder={placeholder}\n error={rawErrors && rawErrors.length > 0}\n autoFocus={autofocus}\n onFocus={onFocus && (() => onFocus(id, value?.value))}\n onBlur={onBlur && (() => onBlur(id, value?.value))}\n />\n )}\n filterOptions={(options, params) => {\n const filtered = filter(options, params)\n\n const { inputValue } = params\n // Suggest the creation of a new value\n const isExisting = options.some(option => inputValue === option.label)\n if (allowFreeSolo && inputValue !== '' && !isExisting) {\n filtered.push({\n value: inputValue,\n label: `Set to custom value \"${inputValue}\"`,\n })\n }\n\n return filtered\n }}\n />\n )\n}\n"],"mappings":";;;;;AAMA,IAAM,IAAS,EAAqC;AAQpD,SAAgB,EACd,GACA,GACiC;CACjC,IAAI,KAAS,MACX,OAAO;CAGT,IAAM,IAAsB,EAAQ,QAAO,MAAU,EAAO,UAAU,CAAK;CAIzE,OAHE,EAAoB,SAAS,IACxB,EAAoB,KAEpB;EAAS;EAAO,OAAO;CAAM;AAExC;AAOA,SAAgB,EACd,GACA,GACmB;CAInB,OAHK,MAAM,QAAQ,CAAK,IAGjB,EAAM,KACX,MACE,EAAQ,MAAK,MAAU,EAAO,UAAU,CAAC,KAAK;EAC5C,OAAO;EACP,OAAO,OAAO,CAAC;CACjB,CACJ,IARS,CAAC;AASZ;AAMA,SAAgB,EAA8B,GAA8B;CAI1E,OAHK,MAAM,QAAQ,CAAQ,IAGpB,EAAS,KAAK,MACnB,EAAS,CAAC,KAAK,WAAW,IAAI,EAAE,QAAQ,CAC1C,IAJS,CAAC;AAKZ;AASA,IAAa,KAAwB,MAA6B;CAChE,IAAM,EACJ,OACA,YACA,UACA,aACA,aACA,aACA,aACA,cACA,aACA,WACA,YACA,gBACA,aAAa,IAAe,IAC5B,cACA,gBACE,GAEE,EAAE,mBAAgB,GAMlB,IAAqB,CAAC,kBAAkB,gBAAgB,EAAE,MAC9D,MAAkB,EAAG,SAAS,CAAc,CAC9C,GAEM,IACJ,CAAC,KACD,EAAS,EAAS,YAAkC,mBAGhD,IAAc,KAAgB,CAAC;CAErC,OACE,kBAAC,GAAD;EACM;EACJ,OACE,IACI,EAA4B,GAAO,CAAW,IAC9C,EAAgB,GAAO,CAAW;EAExC,UAAU;EACV,gBAAA;EACA,eAAA;EACA,aAAA;EACA,mBAAA;EACA,SAAS;EACT,UAAU;EACA;EACA;EACV,kBAAkB,CAAC;EACnB,WAAW,GAAO,MAAa;GAC7B,AAAI,IACF,EAAS,EAA8B,CAAQ,CAAC,IACvC,EAAS,CAAQ,KAAK,gBAAgB,IAE/C,EAAS,EAAS,UAAU,IACnB,EAAS,CAAQ,KAAK,WAAW,IAC1C,EAAS,EAAS,KAAK,IAEvB,EAAS,CAEQ;EAErB;EACA,cAAa,MACX,kBAAC,GAAD;GACE,GAAI;GACM;GACG;GACb,OAAO,KAAa,EAAU,SAAS;GACvC,WAAW;GACX,SAAS,YAAkB,EAAQ,GAAI,GAAO,KAAK;GACnD,QAAQ,YAAiB,EAAO,GAAI,GAAO,KAAK;EACjD,CAAA;EAEH,gBAAgB,GAAS,MAAW;GAClC,IAAM,IAAW,EAAO,GAAS,CAAM,GAEjC,EAAE,kBAAe,GAEjB,IAAa,EAAQ,MAAK,MAAU,MAAe,EAAO,KAAK;GAQrE,OAPI,KAAiB,MAAe,MAAM,CAAC,KACzC,EAAS,KAAK;IACZ,OAAO;IACP,OAAO,wBAAwB,EAAW;GAC5C,CAAC,GAGI;EACT;CACD,CAAA;AAEL"}
|
|
@@ -5,4 +5,5 @@ export type FilterConditionRowProps = {
|
|
|
5
5
|
index: number;
|
|
6
6
|
};
|
|
7
7
|
export declare function FilterConditionRow(props: FilterConditionRowProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const PILL_FILTER_THRESHOLD = 40;
|
|
8
9
|
//# sourceMappingURL=FilterConditionRow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterConditionRow.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/FilterConditionRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterConditionRow.d.ts","sourceRoot":"","sources":["../../../src/components/QueryBuilder/FilterConditionRow.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,WAAW,EAAiB,MAAM,qBAAqB,CAAA;AAEhE,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,WAAW,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CAmKhE;AAuJD,eAAO,MAAM,qBAAqB,KAAK,CAAA"}
|