synapse-react-client 4.0.40 → 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.d.ts +1 -0
- package/dist/SWC.index.d.ts.map +1 -1
- package/dist/SWC.index.js +2 -1
- package/dist/SWC.index.js.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts +1 -0
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.d.ts.map +1 -1
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js +12 -12
- package/dist/components/AccessRequirement/ImposeRestrictionDialog/ImposeRestrictionDialog.js.map +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/Aridhia/AridhiaAccessStatus.d.ts.map +1 -1
- package/dist/components/Aridhia/AridhiaAccessStatus.js +51 -48
- package/dist/components/Aridhia/AridhiaAccessStatus.js.map +1 -1
- package/dist/components/Authentication/Constants.d.ts +4 -0
- package/dist/components/Authentication/Constants.d.ts.map +1 -1
- package/dist/components/Authentication/Constants.js +5 -2
- package/dist/components/Authentication/Constants.js.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.d.ts.map +1 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js +8 -1
- package/dist/components/Authentication/RecoveryCodeGrid.js.map +1 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js +4 -1
- package/dist/components/Authentication/RegenerateBackupCodesWarning.js.map +1 -1
- package/dist/components/Authentication/TOTPForm.d.ts.map +1 -1
- package/dist/components/Authentication/TOTPForm.js +20 -18
- package/dist/components/Authentication/TOTPForm.js.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.d.ts.map +1 -1
- package/dist/components/Authentication/TwoFactorBackupCodes.js +41 -12
- 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 +90 -77
- 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 +52 -54
- 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/ChoiceOptionsEditor.d.ts +11 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js +61 -0
- package/dist/components/FormTemplateEditor/ChoiceOptionsEditor.js.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts +33 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js +190 -0
- package/dist/components/FormTemplateEditor/FieldDefinitionDrawer.js.map +1 -0
- 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 +14 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js +72 -0
- package/dist/components/FormTemplateEditor/FormTemplatePreview.js.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts +13 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js +33 -0
- package/dist/components/FormTemplateEditor/JsonSchemaBodyEditor.js.map +1 -0
- 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/formTemplateValidation.d.ts +32 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js +75 -0
- package/dist/components/FormTemplateEditor/formTemplateValidation.js.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts +27 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js +84 -0
- package/dist/components/FormTemplateEditor/schemaFieldUtils.js.map +1 -0
- 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 +28 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js +54 -0
- package/dist/components/FormTemplateEditor/useSaveFormTemplate.js.map +1 -0
- package/dist/components/FormTemplateEditor/utils.d.ts +21 -0
- package/dist/components/FormTemplateEditor/utils.d.ts.map +1 -0
- package/dist/components/FormTemplateEditor/utils.js +24 -0
- package/dist/components/FormTemplateEditor/utils.js.map +1 -0
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts +1 -1
- package/dist/components/JsonSchemaForm/CustomFormContext.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.css +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.js.map +1 -1
- package/dist/components/JsonSchemaForm/JsonSchemaForm.module.scss +6 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.d.ts.map +1 -1
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.js +4 -0
- package/dist/components/JsonSchemaForm/templates/RJSFInputLabel.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.css +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts +3 -0
- package/dist/components/QueryBuilder/FilterConditionRow.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.js +123 -123
- package/dist/components/QueryBuilder/FilterConditionRow.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.js +10 -11
- package/dist/components/QueryBuilder/FilterConditionRow.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterConditionRow.module.scss +0 -5
- package/dist/components/QueryBuilder/FilterGroupNode.css +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts +4 -0
- package/dist/components/QueryBuilder/FilterGroupNode.d.ts.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.js +85 -51
- package/dist/components/QueryBuilder/FilterGroupNode.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.js +10 -9
- package/dist/components/QueryBuilder/FilterGroupNode.module.js.map +1 -1
- package/dist/components/QueryBuilder/FilterGroupNode.module.scss +9 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts +10 -0
- package/dist/components/QueryBuilder/QBDragHandle.d.ts.map +1 -0
- package/dist/components/QueryBuilder/QBDragHandle.js +22 -0
- package/dist/components/QueryBuilder/QBDragHandle.js.map +1 -0
- package/dist/components/QueryBuilder/QueryBuilderControls.d.ts.map +1 -1
- package/dist/components/QueryBuilder/QueryBuilderControls.js +120 -108
- 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 +25 -21
- package/dist/components/QueryBuilder/qbTreeToReadable.js.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts +27 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.d.ts.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js +41 -0
- package/dist/components/QueryBuilder/queryBuilderDnd.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.css +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js +8 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.js.map +1 -0
- package/dist/components/QueryBuilder/queryBuilderDrag.module.scss +12 -0
- 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/queryBuilderOperations.d.ts +13 -0
- package/dist/components/QueryBuilder/queryBuilderOperations.d.ts.map +1 -1
- package/dist/components/QueryBuilder/queryBuilderOperations.js +39 -36
- package/dist/components/QueryBuilder/queryBuilderOperations.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/QueryWrapperPlotNav/QueryWrapperPlotNav.d.ts.map +1 -1
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js +46 -47
- package/dist/components/QueryWrapperPlotNav/QueryWrapperPlotNav.js.map +1 -1
- 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/entity/page/title_bar/EntityPageTitleBar.d.ts +0 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.d.ts.map +1 -1
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js +35 -36
- package/dist/components/entity/page/title_bar/EntityPageTitleBar.js.map +1 -1
- package/dist/components/styled/LeftRightPanel.d.ts.map +1 -1
- package/dist/components/styled/LeftRightPanel.js +19 -2
- package/dist/components/styled/LeftRightPanel.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 +4 -2
- package/dist/mocks/accessRequirement/mockFormTemplates.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockFormTemplates.js +13 -14
- package/dist/mocks/accessRequirement/mockFormTemplates.js.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts +4 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemas.js +24 -17
- package/dist/mocks/accessRequirement/mockJsonSchemas.js.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts +41 -14
- package/dist/mocks/msw/handlers/asyncJobHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/asyncJobHandlers.js +53 -44
- package/dist/mocks/msw/handlers/asyncJobHandlers.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/chatHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/chatHandlers.js +19 -13
- package/dist/mocks/msw/handlers/chatHandlers.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 +10 -1
- package/dist/mocks/msw/handlers/schemaHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/schemaHandlers.js +30 -7
- package/dist/mocks/msw/handlers/schemaHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/searchQueryHandlers.js +24 -18
- package/dist/mocks/msw/handlers/searchQueryHandlers.js.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.d.ts.map +1 -1
- package/dist/mocks/msw/handlers/tableQueryHandlers.js +35 -16
- package/dist/mocks/msw/handlers/tableQueryHandlers.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 +9 -3
- package/dist/synapse-queries/KeyFactory.d.ts.map +1 -1
- package/dist/synapse-queries/KeyFactory.js +17 -7
- 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.d.ts +0 -1
- package/dist/synapse-queries/dataaccess/index.d.ts.map +1 -1
- package/dist/synapse-queries/dataaccess/index.js +3 -4
- 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 -257
- package/dist/synapse-queries/jsonschema/index.js +2 -2
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts +9 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.d.ts.map +1 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js +22 -0
- package/dist/synapse-queries/jsonschema/useCreateJsonSchema.js.map +1 -0
- 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/testutils/vitest.setup.js +18 -9
- package/dist/testutils/vitest.setup.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/APIConstants.d.ts +2 -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/appendFinalQueryParamKey.d.ts.map +1 -1
- package/dist/utils/appendFinalQueryParamKey.js +4 -1
- package/dist/utils/appendFinalQueryParamKey.js.map +1 -1
- package/dist/utils/featureflag/FeatureFlags.d.ts +2 -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/ArrayUtils.d.ts +3 -0
- package/dist/utils/functions/ArrayUtils.d.ts.map +1 -1
- package/dist/utils/functions/ArrayUtils.js +7 -1
- package/dist/utils/functions/ArrayUtils.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/generateDataAccessSchema.d.ts +26 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.d.ts.map +1 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js +28 -0
- package/dist/utils/jsonschema/generateDataAccessSchema.js.map +1 -0
- package/dist/utils/jsonschema/submissionContext.d.ts +91 -0
- package/dist/utils/jsonschema/submissionContext.d.ts.map +1 -0
- package/dist/utils/jsonschema/submissionContext.js +178 -0
- package/dist/utils/jsonschema/submissionContext.js.map +1 -0
- package/package.json +13 -10
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts +0 -6
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.d.ts.map +0 -1
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js +0 -32
- package/dist/components/AccessRequirement/AddConditionsForUseButton/AddConditionsForUseButton.js.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts +0 -9
- package/dist/components/entity/page/title_bar/TitleBarProperties.d.ts.map +0 -1
- package/dist/components/entity/page/title_bar/TitleBarProperties.js +0 -24
- package/dist/components/entity/page/title_bar/TitleBarProperties.js.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts +0 -21
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.d.ts.map +0 -1
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js +0 -34
- package/dist/synapse-queries/dataaccess/useGenerateDataAccessSchema.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepFieldRow.js","names":[],"sources":["../../../src/components/FormTemplateEditor/StepFieldRow.tsx"],"sourcesContent":["import { useSortable } from '@dnd-kit/react/sortable'\nimport { FormTemplateField } from '@sage-bionetworks/synapse-client'\nimport {\n Box,\n Checkbox,\n Collapse,\n FormControlLabel,\n IconButton,\n Paper,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n ArrowDownward as DownIcon,\n Delete as DeleteIcon,\n DragIndicator as DragHandleIcon,\n ExpandLess as ExpandLessIcon,\n ExpandMore as ExpandMoreIcon,\n ArrowUpward as UpIcon,\n} from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useState } from 'react'\nimport {\n SchemaPropertyContext,\n submissionContextLabel,\n} from '@/utils/jsonschema/submissionContext'\nimport styles from './dragHandle.module.scss'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport { SLOT_SORTABLE_TYPE } from './sortableIds'\nimport { TemplateFileHandleField } from './TemplateFileHandleField'\n\nexport type StepFieldRowProps = {\n /** Sortable id assigned by parent: `slot:{stepIndex}:{fieldIndex}`. */\n sortableId: string\n /** Position within its step's fields array. */\n sortableIndex: number\n /** Sortable group; slots only reorder within the same step. */\n sortableGroup: string\n field: FormTemplateField\n /** The schema property this slot resolves to, if it still exists. */\n resolvedProperty: RJSFSchema | undefined\n /** Which submission context (per the schema's `x-synapse-submissionContext` convention)\n * gates this field, derived from `resolvedProperty`. */\n context: SchemaPropertyContext\n /** Underlying property key (the segment after `/` in `schemaPath`). */\n propertyKey: string\n isFirst: boolean\n isLast: boolean\n /** The FormTemplate's id, if it has been saved. Used to build the template file download. */\n formTemplateId: string | undefined\n onChange: (patch: Partial<FormTemplateField>) => void\n onMoveUp: () => void\n onMoveDown: () => void\n onRemove: () => void\n}\n\n/**\n * A slot row inside a step. Compact by default — shows the field's display\n * name. Expand to reveal slot-specific config: (for file fields) an\n * optional template file handle. Sortable within its parent step.\n */\nexport function StepFieldRow({\n sortableId,\n sortableIndex,\n sortableGroup,\n field,\n resolvedProperty,\n context,\n propertyKey,\n isFirst,\n isLast,\n formTemplateId,\n onChange,\n onMoveUp,\n onMoveDown,\n onRemove,\n}: StepFieldRowProps) {\n const [expanded, setExpanded] = useState(false)\n\n const { ref, handleRef, isDragging } = useSortable({\n id: sortableId,\n index: sortableIndex,\n group: sortableGroup,\n type: SLOT_SORTABLE_TYPE,\n accept: SLOT_SORTABLE_TYPE,\n })\n\n const type = resolvedProperty ? detectFieldType(resolvedProperty) : null\n const displayLabel = resolvedProperty?.title || propertyKey\n const isFileField = type === 'file'\n const isUnresolved = !resolvedProperty\n\n let caption = `Missing field: ${field.schemaPath}`\n if (!isUnresolved) {\n const captionParts = [fieldTypeLabel(type)]\n if (context !== 'ALWAYS') {\n captionParts.push(submissionContextLabel(context))\n }\n if (field.isPublic) {\n captionParts.push('Public')\n }\n caption = captionParts.join(' · ')\n }\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={styles.dragSource}\n data-dragging={isDragging}\n sx={{\n p: 1,\n backgroundColor: 'action.hover',\n borderColor: isUnresolved ? 'error.main' : undefined,\n }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={0}\n aria-label=\"Drag to reorder field\"\n className={styles.dragHandle}\n sx={{ color: 'text.secondary' }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <IconButton\n size=\"small\"\n onClick={() => setExpanded(prev => !prev)}\n aria-label={expanded ? 'Collapse field' : 'Expand field'}\n >\n {expanded ? (\n <ExpandLessIcon fontSize=\"small\" />\n ) : (\n <ExpandMoreIcon fontSize=\"small\" />\n )}\n </IconButton>\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography variant=\"body2\" noWrap title={displayLabel}>\n {displayLabel}\n </Typography>\n <Typography\n variant=\"caption\"\n color={isUnresolved ? 'error' : 'text.secondary'}\n >\n {caption}\n </Typography>\n </Box>\n <IconButton\n size=\"small\"\n disabled={isFirst}\n onClick={onMoveUp}\n aria-label=\"Move field up\"\n >\n <UpIcon fontSize=\"small\" />\n </IconButton>\n <IconButton\n size=\"small\"\n disabled={isLast}\n onClick={onMoveDown}\n aria-label=\"Move field down\"\n >\n <DownIcon fontSize=\"small\" />\n </IconButton>\n <IconButton\n size=\"small\"\n onClick={onRemove}\n aria-label=\"Remove field from step\"\n >\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n\n <Collapse in={expanded} unmountOnExit>\n <Stack spacing={1} sx={{ pt: 1, pl: 4 }}>\n {isFileField && (\n <TemplateFileHandleField\n fileHandleId={field.templateFileHandleId}\n formTemplateId={formTemplateId}\n onChange={next => onChange({ templateFileHandleId: next })}\n />\n )}\n <FormControlLabel\n control={\n <Checkbox\n checked={field.isPublic ?? false}\n onChange={e => onChange({ isPublic: e.target.checked })}\n />\n }\n label=\"Publicly viewable after approval\"\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n Answers appear in this AR's public submission info once a submission\n is approved. Snapshotted at submit time.\n </Typography>\n </Stack>\n </Collapse>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;;;;AA6DA,SAAgB,EAAa,EAC3B,eACA,kBACA,kBACA,UACA,qBACA,YACA,gBACA,YACA,WACA,mBACA,aACA,aACA,eACA,eACoB;CACpB,IAAM,CAAC,GAAU,KAAe,EAAS,EAAK,GAExC,EAAE,QAAK,cAAW,kBAAe,EAAY;EACjD,IAAI;EACJ,OAAO;EACP,OAAO;EACP,MAAM;EACN,QAAQ;CACV,CAAC,GAEK,IAAO,IAAmB,EAAgB,CAAgB,IAAI,MAC9D,IAAe,GAAkB,SAAS,GAC1C,IAAc,MAAS,QACvB,IAAe,CAAC,GAElB,IAAU,kBAAkB,EAAM;CACtC,IAAI,CAAC,GAAc;EACjB,IAAM,IAAe,CAAC,EAAe,CAAI,CAAC;EAO1C,AANI,MAAY,YACd,EAAa,KAAK,EAAuB,CAAO,CAAC,GAE/C,EAAM,YACR,EAAa,KAAK,QAAQ,GAE5B,IAAU,EAAa,KAAK,KAAK;CACnC;CAEA,OACE,kBAAC,GAAD;EACO;EACL,SAAQ;EACR,WAAW,EAAO;EAClB,iBAAe;EACf,IAAI;GACF,GAAG;GACH,iBAAiB;GACjB,aAAa,IAAe,eAAe,KAAA;EAC7C;YATF,CAWE,kBAAC,GAAD;GAAK,IAAI;IAAE,SAAS;IAAQ,YAAY;IAAU,KAAK;GAAI;aAA3D;IACE,kBAAC,GAAD;KACE,KAAK;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ACvD,CAAA;MAEH,OAAM;KACP,CAAA;KACD,kBAAC,GAAD;MAAY,SAAQ;MAAU,OAAM;gBAAiB;KAGzC,CAAA;IACP;;EACC,CAAA,CACL;;AAEX"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type TemplateFileHandleFieldProps = {
|
|
2
|
+
/** The slot's `templateFileHandleId`, if one is attached. */
|
|
3
|
+
fileHandleId: string | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* The FormTemplate's id, used to build the download association. Undefined for a template
|
|
6
|
+
* that has not been saved yet (a brand-new draft), in which case the file is downloaded
|
|
7
|
+
* directly as a file handle the current user uploaded.
|
|
8
|
+
*/
|
|
9
|
+
formTemplateId: string | undefined;
|
|
10
|
+
onChange: (fileHandleId: string | undefined) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Upload/download control for a file field's optional template attachment
|
|
14
|
+
* (`FormTemplateField.templateFileHandleId`) — e.g. a fillable document requesters must
|
|
15
|
+
* download, complete, and re-upload to answer this slot. Uploads immediately via
|
|
16
|
+
* `BasicFileHandleUpload` in a dialog; download reuses `FileHandleLink`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function TemplateFileHandleField({ fileHandleId, formTemplateId, onChange, }: TemplateFileHandleFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=TemplateFileHandleField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateFileHandleField.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/TemplateFileHandleField.tsx"],"names":[],"mappings":"AAwBA,MAAM,MAAM,4BAA4B,GAAG;IACzC,6DAA6D;IAC7D,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC;;;;OAIG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAA;CACrD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,YAAY,EACZ,cAAc,EACd,QAAQ,GACT,EAAE,4BAA4B,2CA+F9B"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { DialogBase as e } from "../DialogBase.js";
|
|
2
|
+
import { FileHandleLink as t } from "../widgets/FileHandleLink.js";
|
|
3
|
+
import { BasicFileHandleUpload as n } from "../file/upload/BasicFileHandleUpload.js";
|
|
4
|
+
import { useMemo as r, useRef as i, useState as a } from "react";
|
|
5
|
+
import { Alert as o, Box as s, Button as c, IconButton as l, Stack as u, Typography as d } from "@mui/material";
|
|
6
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
|
+
import { FileHandleAssociateType as h } from "@sage-bionetworks/synapse-types";
|
|
8
|
+
import { Close as g, UploadFile as _ } from "@mui/icons-material";
|
|
9
|
+
//#region src/components/FormTemplateEditor/TemplateFileHandleField.tsx
|
|
10
|
+
function v({ fileHandleId: v, formTemplateId: y, onChange: b }) {
|
|
11
|
+
let [x, S] = a(!1), [C, w] = a(null), T = i(null), E = r(() => v && y ? {
|
|
12
|
+
fileHandleId: v,
|
|
13
|
+
associateObjectType: h.AccessRequirementAttachment,
|
|
14
|
+
associateObjectId: y
|
|
15
|
+
} : void 0, [v, y]);
|
|
16
|
+
return /* @__PURE__ */ m(s, { children: [
|
|
17
|
+
/* @__PURE__ */ p(d, {
|
|
18
|
+
variant: "caption",
|
|
19
|
+
color: "text.secondary",
|
|
20
|
+
component: "div",
|
|
21
|
+
children: "Template file"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ m(u, {
|
|
24
|
+
direction: "row",
|
|
25
|
+
spacing: 1,
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
children: [v ? /* @__PURE__ */ m(f, { children: [E ? /* @__PURE__ */ p(t, {
|
|
28
|
+
fileHandleAssociation: E,
|
|
29
|
+
showDownloadIcon: !0
|
|
30
|
+
}) : /* @__PURE__ */ p(t, {
|
|
31
|
+
creatorFileHandleId: v,
|
|
32
|
+
showDownloadIcon: !0
|
|
33
|
+
}), /* @__PURE__ */ p(l, {
|
|
34
|
+
size: "small",
|
|
35
|
+
onClick: () => b(void 0),
|
|
36
|
+
"aria-label": "Remove template file",
|
|
37
|
+
children: /* @__PURE__ */ p(g, { fontSize: "small" })
|
|
38
|
+
})] }) : /* @__PURE__ */ p(d, {
|
|
39
|
+
variant: "body2",
|
|
40
|
+
color: "text.secondary",
|
|
41
|
+
children: "None"
|
|
42
|
+
}), /* @__PURE__ */ p(c, {
|
|
43
|
+
size: "small",
|
|
44
|
+
startIcon: /* @__PURE__ */ p(_, { fontSize: "small" }),
|
|
45
|
+
onClick: () => S(!0),
|
|
46
|
+
children: v ? "Replace" : "Upload"
|
|
47
|
+
})]
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ p(e, {
|
|
50
|
+
open: x,
|
|
51
|
+
onCancel: () => S(!1),
|
|
52
|
+
title: "Upload template file",
|
|
53
|
+
maxWidth: "sm",
|
|
54
|
+
content: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(n, {
|
|
55
|
+
ref: T,
|
|
56
|
+
allowMultipleUpload: !1,
|
|
57
|
+
disableDragAndDrop: !0,
|
|
58
|
+
onValidationError: w,
|
|
59
|
+
onFileUploadComplete: (e) => {
|
|
60
|
+
b(e), S(!1);
|
|
61
|
+
}
|
|
62
|
+
}), C && /* @__PURE__ */ p(o, {
|
|
63
|
+
severity: "error",
|
|
64
|
+
sx: { mt: 2 },
|
|
65
|
+
children: C
|
|
66
|
+
})] }),
|
|
67
|
+
actions: /* @__PURE__ */ p(c, {
|
|
68
|
+
variant: "outlined",
|
|
69
|
+
onClick: () => S(!1),
|
|
70
|
+
children: "Cancel"
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { v as TemplateFileHandleField };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=TemplateFileHandleField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateFileHandleField.js","names":[],"sources":["../../../src/components/FormTemplateEditor/TemplateFileHandleField.tsx"],"sourcesContent":["import { DialogBase } from '@/components/DialogBase'\nimport {\n BasicFileHandleUpload,\n FileUploadHandle,\n} from '@/components/file/upload/BasicFileHandleUpload'\nimport { FileHandleLink } from '@/components/widgets/FileHandleLink'\nimport {\n Close as RemoveIcon,\n UploadFile as UploadIcon,\n} from '@mui/icons-material'\nimport {\n Alert,\n Box,\n Button,\n IconButton,\n Stack,\n Typography,\n} from '@mui/material'\nimport {\n FileHandleAssociateType,\n FileHandleAssociation,\n} from '@sage-bionetworks/synapse-types'\nimport { useMemo, useRef, useState } from 'react'\n\nexport type TemplateFileHandleFieldProps = {\n /** The slot's `templateFileHandleId`, if one is attached. */\n fileHandleId: string | undefined\n /**\n * The FormTemplate's id, used to build the download association. Undefined for a template\n * that has not been saved yet (a brand-new draft), in which case the file is downloaded\n * directly as a file handle the current user uploaded.\n */\n formTemplateId: string | undefined\n onChange: (fileHandleId: string | undefined) => void\n}\n\n/**\n * Upload/download control for a file field's optional template attachment\n * (`FormTemplateField.templateFileHandleId`) — e.g. a fillable document requesters must\n * download, complete, and re-upload to answer this slot. Uploads immediately via\n * `BasicFileHandleUpload` in a dialog; download reuses `FileHandleLink`.\n */\nexport function TemplateFileHandleField({\n fileHandleId,\n formTemplateId,\n onChange,\n}: TemplateFileHandleFieldProps) {\n const [dialogOpen, setDialogOpen] = useState(false)\n const [validationError, setValidationError] = useState<string | null>(null)\n const uploadRef = useRef<FileUploadHandle | null>(null)\n // FileHandleLink refetches whenever the association's identity changes.\n const fileHandleAssociation = useMemo<FileHandleAssociation | undefined>(\n () =>\n fileHandleId && formTemplateId\n ? {\n fileHandleId,\n // AccessRequirementAttachment is a stand-in: a FormTemplate is not an\n // AccessRequirement, so the server may not authorize this download.\n // Supported FormTemplate template-file downloads are tracked in PLFM-10013.\n associateObjectType:\n FileHandleAssociateType.AccessRequirementAttachment,\n associateObjectId: formTemplateId,\n }\n : undefined,\n [fileHandleId, formTemplateId],\n )\n\n return (\n <Box>\n <Typography variant=\"caption\" color=\"text.secondary\" component=\"div\">\n Template file\n </Typography>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n {fileHandleId ? (\n <>\n {/* A template that has not been saved yet can only reference a file handle that the current user uploaded, so it is downloaded directly. */}\n {fileHandleAssociation ? (\n <FileHandleLink\n fileHandleAssociation={fileHandleAssociation}\n showDownloadIcon\n />\n ) : (\n <FileHandleLink\n creatorFileHandleId={fileHandleId}\n showDownloadIcon\n />\n )}\n <IconButton\n size=\"small\"\n onClick={() => onChange(undefined)}\n aria-label=\"Remove template file\"\n >\n <RemoveIcon fontSize=\"small\" />\n </IconButton>\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n None\n </Typography>\n )}\n <Button\n size=\"small\"\n startIcon={<UploadIcon fontSize=\"small\" />}\n onClick={() => setDialogOpen(true)}\n >\n {fileHandleId ? 'Replace' : 'Upload'}\n </Button>\n </Stack>\n\n <DialogBase\n open={dialogOpen}\n onCancel={() => setDialogOpen(false)}\n title=\"Upload template file\"\n maxWidth=\"sm\"\n content={\n <>\n <BasicFileHandleUpload\n ref={uploadRef}\n allowMultipleUpload={false}\n disableDragAndDrop={true}\n onValidationError={setValidationError}\n onFileUploadComplete={newFileHandleId => {\n onChange(newFileHandleId)\n setDialogOpen(false)\n }}\n />\n {validationError && (\n <Alert severity=\"error\" sx={{ mt: 2 }}>\n {validationError}\n </Alert>\n )}\n </>\n }\n actions={\n <Button variant=\"outlined\" onClick={() => setDialogOpen(false)}>\n Cancel\n </Button>\n }\n />\n </Box>\n )\n}\n"],"mappings":";;;;;;;;;AA0CA,SAAgB,EAAwB,EACtC,iBACA,mBACA,eAC+B;CAC/B,IAAM,CAAC,GAAY,KAAiB,EAAS,EAAK,GAC5C,CAAC,GAAiB,KA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AAQ;IAAW,eAAe,EAAc,EAAK;cAAG;GAExD,CAAA;EAEX,CAAA;CACE,EAAA,CAAA;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dragHandle_9lwpq_1{touch-action:none;cursor:grab;align-items:center;display:flex}._dragHandle_9lwpq_1:active{cursor:grabbing}._dragSource_9lwpq_11{transition:opacity .12s}._dragSource_9lwpq_11[data-dragging=true]{opacity:var(--synapse-drag-source-opacity)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dragHandle.module.js","names":[],"sources":["../../../src/components/FormTemplateEditor/dragHandle.module.scss"],"sourcesContent":["// Shared layout for the drag-indicator handles in FieldLibraryRow and StepFieldRow. Per-instance\n// color/cursor variations (e.g. disabled state) are layered on top via `sx`.\n.dragHandle {\n display: flex;\n align-items: center;\n touch-action: none;\n cursor: grab;\n\n &:active {\n cursor: grabbing;\n }\n}\n\n// Shared fade for the draggable item itself while it is the active drag source. Toggled with\n// `data-dragging` so each usage only reports state and the transition lives here once.\n.dragSource {\n transition: opacity 120ms;\n\n &[data-dragging='true'] {\n opacity: var(--synapse-drag-source-opacity);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Shared layout for the drag-indicator handles in FieldLibraryRow and StepFieldRow. Per-instance
|
|
2
|
+
// color/cursor variations (e.g. disabled state) are layered on top via `sx`.
|
|
3
|
+
.dragHandle {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
touch-action: none;
|
|
7
|
+
cursor: grab;
|
|
8
|
+
|
|
9
|
+
&:active {
|
|
10
|
+
cursor: grabbing;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Shared fade for the draggable item itself while it is the active drag source. Toggled with
|
|
15
|
+
// `data-dragging` so each usage only reports state and the transition lives here once.
|
|
16
|
+
.dragSource {
|
|
17
|
+
transition: opacity 120ms;
|
|
18
|
+
|
|
19
|
+
&[data-dragging='true'] {
|
|
20
|
+
opacity: var(--synapse-drag-source-opacity);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._dropTarget_f4wz1_1{outline-offset:-2px;outline:2px dashed #0000;transition:outline-color .12s,background-color .12s}._dropTarget_f4wz1_1[data-drop-target=true]{outline-color:var(--synapse-primary-action-color);background-color:var(--synapse-primary-action-color-alpha-4)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropTarget.module.js","names":[],"sources":["../../../src/components/FormTemplateEditor/dropTarget.module.scss"],"sourcesContent":["// Shared highlight for the step card and its slot list while a compatible drag hovers over them.\n// Toggled with `data-drop-target` so the component only reports state and the look lives here.\n.dropTarget {\n outline: 2px dashed transparent;\n outline-offset: -2px;\n transition:\n outline-color 120ms,\n background-color 120ms;\n\n &[data-drop-target='true'] {\n outline-color: var(--synapse-primary-action-color);\n background-color: var(--synapse-primary-action-color-alpha-4);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Shared highlight for the step card and its slot list while a compatible drag hovers over them.
|
|
2
|
+
// Toggled with `data-drop-target` so the component only reports state and the look lives here.
|
|
3
|
+
.dropTarget {
|
|
4
|
+
outline: 2px dashed transparent;
|
|
5
|
+
outline-offset: -2px;
|
|
6
|
+
transition:
|
|
7
|
+
outline-color 120ms,
|
|
8
|
+
background-color 120ms;
|
|
9
|
+
|
|
10
|
+
&[data-drop-target='true'] {
|
|
11
|
+
outline-color: var(--synapse-primary-action-color);
|
|
12
|
+
background-color: var(--synapse-primary-action-color-alpha-4);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { ResolvedSchemaProperty, SchemaPropertyContext } from '@/utils/jsonschema/submissionContext';
|
|
3
|
+
import { EditableFormTemplateStep } from './utils';
|
|
4
|
+
export type FormTemplateDraftState = {
|
|
5
|
+
jsonSchema: RJSFSchema;
|
|
6
|
+
steps: EditableFormTemplateStep[];
|
|
7
|
+
/** The property open in the field definition drawer, if any. */
|
|
8
|
+
editingPropertyKey: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const NEW_FIELD_TITLE = "New field";
|
|
11
|
+
export declare function schemaPropertyKeys(jsonSchema: RJSFSchema): Set<string>;
|
|
12
|
+
/** The `schemaPath` of every field bound to a step. */
|
|
13
|
+
export declare function boundSchemaPaths(steps: EditableFormTemplateStep[]): Set<string>;
|
|
14
|
+
/** Schema properties that no step binds yet, in schema order. */
|
|
15
|
+
export declare function listUnboundProperties(jsonSchema: RJSFSchema, steps: EditableFormTemplateStep[]): ResolvedSchemaProperty[];
|
|
16
|
+
/** Add an unbound text property with a generated key and open it for editing. */
|
|
17
|
+
export declare function createField(state: FormTemplateDraftState): FormTemplateDraftState;
|
|
18
|
+
/**
|
|
19
|
+
* Rename a property's key everywhere it's referenced: the schema, every step field bound to it, and
|
|
20
|
+
* the drawer editing it. A no-op if `oldKey` doesn't exist or `newKey` is already taken.
|
|
21
|
+
*/
|
|
22
|
+
export declare function renamePropertyKey(state: FormTemplateDraftState, oldKey: string, newKey: string): FormTemplateDraftState;
|
|
23
|
+
/**
|
|
24
|
+
* Merge `patch` into a property's definition. While the key still matches what the old title
|
|
25
|
+
* generates, a title change renames the key to follow it, like a slug; once the key has been
|
|
26
|
+
* edited by hand it stays put.
|
|
27
|
+
*/
|
|
28
|
+
export declare function updateProperty(state: FormTemplateDraftState, key: string, patch: Partial<RJSFSchema>): FormTemplateDraftState;
|
|
29
|
+
/** Replace a property's whole definition, keeping its context and required-ness. */
|
|
30
|
+
export declare function replaceProperty(state: FormTemplateDraftState, key: string, next: RJSFSchema): FormTemplateDraftState;
|
|
31
|
+
export declare function changeRequired(state: FormTemplateDraftState, key: string, isRequired: boolean): FormTemplateDraftState;
|
|
32
|
+
export declare function changeContext(state: FormTemplateDraftState, key: string, context: SchemaPropertyContext): FormTemplateDraftState;
|
|
33
|
+
/** Remove a property from the schema, unbind it from every step, and close its drawer. */
|
|
34
|
+
export declare function removeProperty(state: FormTemplateDraftState, key: string): FormTemplateDraftState;
|
|
35
|
+
/** Move the step at `fromIndex` so it ends up at `toIndex`. A no-op for out-of-range indices. */
|
|
36
|
+
export declare function moveStep(state: FormTemplateDraftState, fromIndex: number, toIndex: number): FormTemplateDraftState;
|
|
37
|
+
/**
|
|
38
|
+
* Move the field bound to `schemaPath` into the step identified by `toStepKey` so it ends up at
|
|
39
|
+
* `toIndex` there (clamped to the end), whether or not that is the step it came from. A no-op if
|
|
40
|
+
* no step binds `schemaPath` or no step has `toStepKey`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function moveSlot(state: FormTemplateDraftState, schemaPath: string, toStepKey: string, toIndex: number): FormTemplateDraftState;
|
|
43
|
+
/**
|
|
44
|
+
* Append a field bound to `propertyKey` to the step identified by `stepKey`. A no-op if that
|
|
45
|
+
* property is already bound to any step (a property binds at most once) or no step has `stepKey`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function bindField(state: FormTemplateDraftState, propertyKey: string, stepKey: string): FormTemplateDraftState;
|
|
48
|
+
//# sourceMappingURL=formTemplateDraftState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplateDraftState.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/formTemplateDraftState.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAML,sBAAsB,EAEtB,qBAAqB,EAItB,MAAM,sCAAsC,CAAA;AAE7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,UAAU,CAAA;IACtB,KAAK,EAAE,wBAAwB,EAAE,CAAA;IACjC,gEAAgE;IAChE,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,CAAA;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EAAE,sBAAsB,EAC7B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,sBAAsB,CASxB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,sBAAsB,EAC7B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,sBAAsB,CAiBxB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,sBAAsB,EAC7B,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,sBAAsB,CAsBxB"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { listResolvedSchemaProperties as e, propertyKeyToPointer as t, removeSchemaProperty as n, renameSchemaProperty as r, replaceSchemaPropertyDefinition as i, resolveSchemaPropertyAtPointer as a, setSchemaProperty as o, setSchemaPropertyContext as s, setSchemaPropertyRequired as c } from "../../utils/jsonschema/submissionContext.js";
|
|
2
|
+
import { generatePropertyKey as l } from "./schemaFieldUtils.js";
|
|
3
|
+
//#region src/components/FormTemplateEditor/formTemplateDraftState.ts
|
|
4
|
+
var u = "New field";
|
|
5
|
+
function d(t) {
|
|
6
|
+
return new Set(e(t).map((e) => e.propertyKey));
|
|
7
|
+
}
|
|
8
|
+
function f(e) {
|
|
9
|
+
return new Set(e.flatMap((e) => e.fields.map((e) => e.schemaPath)));
|
|
10
|
+
}
|
|
11
|
+
function p(n, r) {
|
|
12
|
+
let i = f(r);
|
|
13
|
+
return e(n).filter((e) => !i.has(t(e.propertyKey)));
|
|
14
|
+
}
|
|
15
|
+
function m(e) {
|
|
16
|
+
let t = l(u, d(e.jsonSchema));
|
|
17
|
+
return {
|
|
18
|
+
...e,
|
|
19
|
+
jsonSchema: o(e.jsonSchema, t, {
|
|
20
|
+
type: "string",
|
|
21
|
+
title: u,
|
|
22
|
+
description: ""
|
|
23
|
+
}, "ALWAYS"),
|
|
24
|
+
editingPropertyKey: t
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function h(e, n, i) {
|
|
28
|
+
let a = d(e.jsonSchema);
|
|
29
|
+
if (i === n || !a.has(n) || a.has(i)) return e;
|
|
30
|
+
let o = t(n), s = t(i);
|
|
31
|
+
return {
|
|
32
|
+
jsonSchema: r(e.jsonSchema, n, i),
|
|
33
|
+
steps: e.steps.map((e) => ({
|
|
34
|
+
...e,
|
|
35
|
+
fields: e.fields.map((e) => e.schemaPath === o ? {
|
|
36
|
+
...e,
|
|
37
|
+
schemaPath: s
|
|
38
|
+
} : e)
|
|
39
|
+
})),
|
|
40
|
+
editingPropertyKey: e.editingPropertyKey === n ? i : e.editingPropertyKey
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function g(e, n, r) {
|
|
44
|
+
let o = a(e.jsonSchema, t(n));
|
|
45
|
+
if (!o) return e;
|
|
46
|
+
let s = {
|
|
47
|
+
...e,
|
|
48
|
+
jsonSchema: i(e.jsonSchema, n, {
|
|
49
|
+
...o.subSchema,
|
|
50
|
+
...r
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
if (typeof r.title != "string") return s;
|
|
54
|
+
let c = d(e.jsonSchema);
|
|
55
|
+
return c.delete(n), l(o.subSchema.title ?? "", c) === n ? h(s, n, l(r.title, c)) : s;
|
|
56
|
+
}
|
|
57
|
+
function _(e, t, n) {
|
|
58
|
+
return {
|
|
59
|
+
...e,
|
|
60
|
+
jsonSchema: i(e.jsonSchema, t, n)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function v(e, n, r) {
|
|
64
|
+
let i = a(e.jsonSchema, t(n))?.context ?? "ALWAYS";
|
|
65
|
+
return {
|
|
66
|
+
...e,
|
|
67
|
+
jsonSchema: c(e.jsonSchema, n, i, r)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function y(e, t, n) {
|
|
71
|
+
return {
|
|
72
|
+
...e,
|
|
73
|
+
jsonSchema: s(e.jsonSchema, t, n)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function b(e, r) {
|
|
77
|
+
let i = t(r);
|
|
78
|
+
return {
|
|
79
|
+
jsonSchema: n(e.jsonSchema, r),
|
|
80
|
+
steps: e.steps.map((e) => ({
|
|
81
|
+
...e,
|
|
82
|
+
fields: e.fields.filter((e) => e.schemaPath !== i)
|
|
83
|
+
})),
|
|
84
|
+
editingPropertyKey: e.editingPropertyKey === r ? null : e.editingPropertyKey
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function x(e, t, n) {
|
|
88
|
+
let { steps: r } = e, i = (e) => e >= 0 && e < r.length;
|
|
89
|
+
if (t === n || !i(t) || !i(n)) return e;
|
|
90
|
+
let a = r.slice();
|
|
91
|
+
return a.splice(n, 0, ...a.splice(t, 1)), {
|
|
92
|
+
...e,
|
|
93
|
+
steps: a
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function S(e, t, n, r) {
|
|
97
|
+
let i = e.steps.flatMap((e) => e.fields).find((e) => e.schemaPath === t);
|
|
98
|
+
return !i || !e.steps.some((e) => e.uiKey === n) ? e : {
|
|
99
|
+
...e,
|
|
100
|
+
steps: e.steps.map((e) => {
|
|
101
|
+
let a = e.fields.filter((e) => e.schemaPath !== t);
|
|
102
|
+
return e.uiKey === n && a.splice(Math.max(0, r), 0, i), {
|
|
103
|
+
...e,
|
|
104
|
+
fields: a
|
|
105
|
+
};
|
|
106
|
+
})
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function C(e, n, r) {
|
|
110
|
+
let i = t(n);
|
|
111
|
+
return f(e.steps).has(i) || !e.steps.some((e) => e.uiKey === r) ? e : {
|
|
112
|
+
...e,
|
|
113
|
+
steps: e.steps.map((e) => e.uiKey === r ? {
|
|
114
|
+
...e,
|
|
115
|
+
fields: [...e.fields, {
|
|
116
|
+
schemaPath: i,
|
|
117
|
+
uiDefinition: {},
|
|
118
|
+
isPublic: !1
|
|
119
|
+
}]
|
|
120
|
+
} : e)
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { u as NEW_FIELD_TITLE, C as bindField, f as boundSchemaPaths, y as changeContext, v as changeRequired, m as createField, p as listUnboundProperties, S as moveSlot, x as moveStep, b as removeProperty, h as renamePropertyKey, _ as replaceProperty, d as schemaPropertyKeys, g as updateProperty };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=formTemplateDraftState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplateDraftState.js","names":[],"sources":["../../../src/components/FormTemplateEditor/formTemplateDraftState.ts"],"sourcesContent":["/*\n * Pure transitions over a FormTemplate draft: the in-progress JSON Schema body, the step structure,\n * and the property open for editing. Every transition keeps the three in sync (renaming a property\n * key rewrites every step field bound to it, removing a property unbinds it from every step, etc).\n */\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n listResolvedSchemaProperties,\n propertyKeyToPointer,\n removeSchemaProperty,\n renameSchemaProperty,\n replaceSchemaPropertyDefinition,\n ResolvedSchemaProperty,\n resolveSchemaPropertyAtPointer,\n SchemaPropertyContext,\n setSchemaProperty,\n setSchemaPropertyContext,\n setSchemaPropertyRequired,\n} from '@/utils/jsonschema/submissionContext'\nimport { generatePropertyKey } from './schemaFieldUtils'\nimport { EditableFormTemplateStep } from './utils'\n\nexport type FormTemplateDraftState = {\n jsonSchema: RJSFSchema\n steps: EditableFormTemplateStep[]\n /** The property open in the field definition drawer, if any. */\n editingPropertyKey: string | null\n}\n\nexport const NEW_FIELD_TITLE = 'New field'\n\nexport function schemaPropertyKeys(jsonSchema: RJSFSchema): Set<string> {\n return new Set(\n listResolvedSchemaProperties(jsonSchema).map(p => p.propertyKey),\n )\n}\n\n/** The `schemaPath` of every field bound to a step. */\nexport function boundSchemaPaths(\n steps: EditableFormTemplateStep[],\n): Set<string> {\n return new Set(steps.flatMap(step => step.fields.map(f => f.schemaPath)))\n}\n\n/** Schema properties that no step binds yet, in schema order. */\nexport function listUnboundProperties(\n jsonSchema: RJSFSchema,\n steps: EditableFormTemplateStep[],\n): ResolvedSchemaProperty[] {\n const bound = boundSchemaPaths(steps)\n return listResolvedSchemaProperties(jsonSchema).filter(\n p => !bound.has(propertyKeyToPointer(p.propertyKey)),\n )\n}\n\n/** Add an unbound text property with a generated key and open it for editing. */\nexport function createField(\n state: FormTemplateDraftState,\n): FormTemplateDraftState {\n const key = generatePropertyKey(\n NEW_FIELD_TITLE,\n schemaPropertyKeys(state.jsonSchema),\n )\n return {\n ...state,\n jsonSchema: setSchemaProperty(\n state.jsonSchema,\n key,\n { type: 'string', title: NEW_FIELD_TITLE, description: '' },\n 'ALWAYS',\n ),\n editingPropertyKey: key,\n }\n}\n\n/**\n * Rename a property's key everywhere it's referenced: the schema, every step field bound to it, and\n * the drawer editing it. A no-op if `oldKey` doesn't exist or `newKey` is already taken.\n */\nexport function renamePropertyKey(\n state: FormTemplateDraftState,\n oldKey: string,\n newKey: string,\n): FormTemplateDraftState {\n const keys = schemaPropertyKeys(state.jsonSchema)\n if (newKey === oldKey || !keys.has(oldKey) || keys.has(newKey)) return state\n const oldPath = propertyKeyToPointer(oldKey)\n const newPath = propertyKeyToPointer(newKey)\n return {\n jsonSchema: renameSchemaProperty(state.jsonSchema, oldKey, newKey),\n steps: state.steps.map(step => ({\n ...step,\n fields: step.fields.map(f =>\n f.schemaPath === oldPath ? { ...f, schemaPath: newPath } : f,\n ),\n })),\n editingPropertyKey:\n state.editingPropertyKey === oldKey ? newKey : state.editingPropertyKey,\n }\n}\n\n/**\n * Merge `patch` into a property's definition. While the key still matches what the old title\n * generates, a title change renames the key to follow it, like a slug; once the key has been\n * edited by hand it stays put.\n */\nexport function updateProperty(\n state: FormTemplateDraftState,\n key: string,\n patch: Partial<RJSFSchema>,\n): FormTemplateDraftState {\n const resolved = resolveSchemaPropertyAtPointer(\n state.jsonSchema,\n propertyKeyToPointer(key),\n )\n if (!resolved) return state\n const updated: FormTemplateDraftState = {\n ...state,\n jsonSchema: replaceSchemaPropertyDefinition(state.jsonSchema, key, {\n ...resolved.subSchema,\n ...patch,\n }),\n }\n if (typeof patch.title !== 'string') return updated\n\n const otherKeys = schemaPropertyKeys(state.jsonSchema)\n otherKeys.delete(key)\n const keyFollowsTitle =\n generatePropertyKey(resolved.subSchema.title ?? '', otherKeys) === key\n return keyFollowsTitle\n ? renamePropertyKey(\n updated,\n key,\n generatePropertyKey(patch.title, otherKeys),\n )\n : updated\n}\n\n/** Replace a property's whole definition, keeping its context and required-ness. */\nexport function replaceProperty(\n state: FormTemplateDraftState,\n key: string,\n next: RJSFSchema,\n): FormTemplateDraftState {\n return {\n ...state,\n jsonSchema: replaceSchemaPropertyDefinition(state.jsonSchema, key, next),\n }\n}\n\nexport function changeRequired(\n state: FormTemplateDraftState,\n key: string,\n isRequired: boolean,\n): FormTemplateDraftState {\n const context =\n resolveSchemaPropertyAtPointer(state.jsonSchema, propertyKeyToPointer(key))\n ?.context ?? 'ALWAYS'\n return {\n ...state,\n jsonSchema: setSchemaPropertyRequired(\n state.jsonSchema,\n key,\n context,\n isRequired,\n ),\n }\n}\n\nexport function changeContext(\n state: FormTemplateDraftState,\n key: string,\n context: SchemaPropertyContext,\n): FormTemplateDraftState {\n return {\n ...state,\n jsonSchema: setSchemaPropertyContext(state.jsonSchema, key, context),\n }\n}\n\n/** Remove a property from the schema, unbind it from every step, and close its drawer. */\nexport function removeProperty(\n state: FormTemplateDraftState,\n key: string,\n): FormTemplateDraftState {\n const path = propertyKeyToPointer(key)\n return {\n jsonSchema: removeSchemaProperty(state.jsonSchema, key),\n steps: state.steps.map(step => ({\n ...step,\n fields: step.fields.filter(f => f.schemaPath !== path),\n })),\n editingPropertyKey:\n state.editingPropertyKey === key ? null : state.editingPropertyKey,\n }\n}\n\n/** Move the step at `fromIndex` so it ends up at `toIndex`. A no-op for out-of-range indices. */\nexport function moveStep(\n state: FormTemplateDraftState,\n fromIndex: number,\n toIndex: number,\n): FormTemplateDraftState {\n const { steps } = state\n const inRange = (i: number) => i >= 0 && i < steps.length\n if (fromIndex === toIndex || !inRange(fromIndex) || !inRange(toIndex)) {\n return state\n }\n const next = steps.slice()\n next.splice(toIndex, 0, ...next.splice(fromIndex, 1))\n return { ...state, steps: next }\n}\n\n/**\n * Move the field bound to `schemaPath` into the step identified by `toStepKey` so it ends up at\n * `toIndex` there (clamped to the end), whether or not that is the step it came from. A no-op if\n * no step binds `schemaPath` or no step has `toStepKey`.\n */\nexport function moveSlot(\n state: FormTemplateDraftState,\n schemaPath: string,\n toStepKey: string,\n toIndex: number,\n): FormTemplateDraftState {\n const field = state.steps\n .flatMap(step => step.fields)\n .find(f => f.schemaPath === schemaPath)\n if (!field || !state.steps.some(step => step.uiKey === toStepKey)) {\n return state\n }\n return {\n ...state,\n steps: state.steps.map(step => {\n const fields = step.fields.filter(f => f.schemaPath !== schemaPath)\n if (step.uiKey === toStepKey) {\n fields.splice(Math.max(0, toIndex), 0, field)\n }\n return { ...step, fields }\n }),\n }\n}\n\n/**\n * Append a field bound to `propertyKey` to the step identified by `stepKey`. A no-op if that\n * property is already bound to any step (a property binds at most once) or no step has `stepKey`.\n */\nexport function bindField(\n state: FormTemplateDraftState,\n propertyKey: string,\n stepKey: string,\n): FormTemplateDraftState {\n const path = propertyKeyToPointer(propertyKey)\n if (\n boundSchemaPaths(state.steps).has(path) ||\n !state.steps.some(step => step.uiKey === stepKey)\n ) {\n return state\n }\n return {\n ...state,\n steps: state.steps.map(step =>\n step.uiKey === stepKey\n ? {\n ...step,\n fields: [\n ...step.fields,\n { schemaPath: path, uiDefinition: {}, isPublic: false },\n ],\n }\n : step,\n ),\n }\n}\n"],"mappings":";;;AA6BA,IAAa,IAAkB;AAE/B,SAAgB,EAAmB,GAAqC;CACtE,OAAO,IAAI,IACT,EAA6B,CAAU,EAAE,KAAI,MAAK,EAAE,WAAW,CACjE;AACF;AAGA,SAAgB,EACd,GACa;CACb,OAAO,IAAI,IAAI,EAAM,SAAQ,MAAQ,EAAK,OAAO,KAAI,MAAK,EAA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;CAIxC,OAHI,CAAC,KAAS,CAAC,EAAM,MAAM,MAAK,MAAQ,EAAK,UAAU,CAAS,IACvD,IAEF;EACL,GAAG;EACH,OAAO,EAAM,MAAM,KAAI,MAAQ;GAC7B,IAAM,IAAS,EAAK,OAAO,QAAO,MAAK,EAAE,eAAe,CAAU;GAIlE,OAHI,EAAK,UAAU,KACjB,EAAO,OAAO,KAAK,IAAI,GAAG,CAAO,GAAG,GAAG,CAAK,GAEvC;IAAE,GAAG;IAAM;GAAO;EAC3B,CAAC;CACH;AACF;AAMA,SAAgB,EACd,GACA,GACA,GACwB;CACxB,IAAM,IAAO,EAAqB,CAAW;CAO7C,OALE,EAAiB,EAAM,KAAK,EAAE,IAAI,CAAI,KACtC,CAAC,EAAM,MAAM,MAAK,MAAQ,EAAK,UAAU,CAAO,IAEzC,IAEF;EACL,GAAG;EACH,OAAO,EAAM,MAAM,KAAI,MACrB,EAAK,UAAU,IACX;GACE,GAAG;GACH,QAAQ,CACN,GAAG,EAAK,QACR;IAAE,YAAY;IAAM,cAAc,CAAC;IAAG,UAAU;GAAM,CACxD;EACF,IACA,CACN;CACF;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { JsonSchemaVersionInfo } from '@sage-bionetworks/synapse-client';
|
|
3
|
+
/**
|
|
4
|
+
* The registered schema every FormTemplate schema extends. It declares the reserved
|
|
5
|
+
* `x-synapse-submissionContext` property. The version is pinned: moving to a newer base schema
|
|
6
|
+
* requires deciding how templates that reference this version are migrated.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ACCESS_REQUIREMENT_BASE_SCHEMA_ID = "org.sagebionetworks-AccessRequirementBaseSchema-1.0.0";
|
|
9
|
+
/** The JSON Schema organization that FormTemplate schemas are registered under. */
|
|
10
|
+
export declare const FORM_TEMPLATE_SCHEMA_ORGANIZATION = "org.sagebionetworks.act";
|
|
11
|
+
/** A registered schema's name, qualified by its organization; every version shares it. */
|
|
12
|
+
export type SchemaName = {
|
|
13
|
+
organizationName: string;
|
|
14
|
+
schemaName: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The organization and schema name that a template's schema versions are registered under.
|
|
18
|
+
* An existing template keeps those of the schema it already references, so renaming the
|
|
19
|
+
* template does not start registering under a new schema name. A new template derives the
|
|
20
|
+
* schema name from its name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveFormTemplateSchemaName(templateName: string, existingSchema$id?: string): SchemaName;
|
|
23
|
+
/**
|
|
24
|
+
* The `$id` of a schema version: `<organization>-<schemaName>-<version>`. Without a version,
|
|
25
|
+
* the unversioned `<organization>-<schemaName>` prefix shared by every version.
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatSchema$id(name: SchemaName, version?: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* The version to register next under a schema name: one major version above the highest
|
|
30
|
+
* registered version, or `1.0.0` when none is registered yet.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getNextSchemaVersion(registeredVersions: JsonSchemaVersionInfo[]): string;
|
|
33
|
+
/** The schema a new FormTemplate starts from: no fields beyond those of the base schema. */
|
|
34
|
+
export declare function createNewFormTemplateSchema(): RJSFSchema;
|
|
35
|
+
//# sourceMappingURL=formTemplateSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplateSchema.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/formTemplateSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAExE;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,0DACW,CAAA;AAEzD,mFAAmF;AACnF,eAAO,MAAM,iCAAiC,4BAA4B,CAAA;AAI1E,0FAA0F;AAC1F,MAAM,MAAM,UAAU,GAAG;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAA;AAEzE;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,iBAAiB,CAAC,EAAE,MAAM,GACzB,UAAU,CAeZ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,UAGjE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,kBAAkB,EAAE,qBAAqB,EAAE,GAC1C,MAAM,CAQR;AAED,4FAA4F;AAC5F,wBAAgB,2BAA2B,IAAI,UAAU,CAMxD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { toPascalCase as e } from "../../utils/functions/toPascalCase.js";
|
|
2
|
+
//#region src/components/FormTemplateEditor/formTemplateSchema.ts
|
|
3
|
+
var t = "org.sagebionetworks-AccessRequirementBaseSchema-1.0.0", n = "org.sagebionetworks.act", r = "FormTemplate";
|
|
4
|
+
function i(t, i) {
|
|
5
|
+
if (i) {
|
|
6
|
+
let [e, t] = i.split("-");
|
|
7
|
+
return {
|
|
8
|
+
organizationName: e,
|
|
9
|
+
schemaName: t
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
let a = e(t);
|
|
13
|
+
return {
|
|
14
|
+
organizationName: n,
|
|
15
|
+
schemaName: /^[A-Za-z]/.test(a) ? a : `${r}${a}`
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function a(e, t) {
|
|
19
|
+
let n = `${e.organizationName}-${e.schemaName}`;
|
|
20
|
+
return t ? `${n}-${t}` : n;
|
|
21
|
+
}
|
|
22
|
+
function o(e) {
|
|
23
|
+
return `${Math.max(0, ...e.map((e) => Number.parseInt(e.semanticVersion?.split(".")[0] ?? "0", 10))) + 1}.0.0`;
|
|
24
|
+
}
|
|
25
|
+
function s() {
|
|
26
|
+
return {
|
|
27
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
28
|
+
type: "object",
|
|
29
|
+
allOf: [{ $ref: t }]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { t as ACCESS_REQUIREMENT_BASE_SCHEMA_ID, n as FORM_TEMPLATE_SCHEMA_ORGANIZATION, s as createNewFormTemplateSchema, a as formatSchema$id, o as getNextSchemaVersion, i as resolveFormTemplateSchemaName };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=formTemplateSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplateSchema.js","names":[],"sources":["../../../src/components/FormTemplateEditor/formTemplateSchema.ts"],"sourcesContent":["import { RJSFSchema } from '@rjsf/utils'\nimport { toPascalCase } from '@/utils/functions/toPascalCase'\nimport { JsonSchemaVersionInfo } from '@sage-bionetworks/synapse-client'\n\n/**\n * The registered schema every FormTemplate schema extends. It declares the reserved\n * `x-synapse-submissionContext` property. The version is pinned: moving to a newer base schema\n * requires deciding how templates that reference this version are migrated.\n */\nexport const ACCESS_REQUIREMENT_BASE_SCHEMA_ID =\n 'org.sagebionetworks-AccessRequirementBaseSchema-1.0.0'\n\n/** The JSON Schema organization that FormTemplate schemas are registered under. */\nexport const FORM_TEMPLATE_SCHEMA_ORGANIZATION = 'org.sagebionetworks.act'\n\nconst FALLBACK_SCHEMA_NAME = 'FormTemplate'\n\n/** A registered schema's name, qualified by its organization; every version shares it. */\nexport type SchemaName = { organizationName: string; schemaName: string }\n\n/**\n * The organization and schema name that a template's schema versions are registered under.\n * An existing template keeps those of the schema it already references, so renaming the\n * template does not start registering under a new schema name. A new template derives the\n * schema name from its name.\n */\nexport function resolveFormTemplateSchemaName(\n templateName: string,\n existingSchema$id?: string,\n): SchemaName {\n if (existingSchema$id) {\n // A schema $id is `<organization>-<schemaName>-<version>`; neither of the first two may\n // contain a dash.\n const [organizationName, schemaName] = existingSchema$id.split('-')\n return { organizationName, schemaName }\n }\n // Schema names only allow letters and digits and must start with a letter.\n const pascalCase = toPascalCase(templateName)\n return {\n organizationName: FORM_TEMPLATE_SCHEMA_ORGANIZATION,\n schemaName: /^[A-Za-z]/.test(pascalCase)\n ? pascalCase\n : `${FALLBACK_SCHEMA_NAME}${pascalCase}`,\n }\n}\n\n/**\n * The `$id` of a schema version: `<organization>-<schemaName>-<version>`. Without a version,\n * the unversioned `<organization>-<schemaName>` prefix shared by every version.\n */\nexport function formatSchema$id(name: SchemaName, version?: string) {\n const unversioned$id = `${name.organizationName}-${name.schemaName}`\n return version ? `${unversioned$id}-${version}` : unversioned$id\n}\n\n/**\n * The version to register next under a schema name: one major version above the highest\n * registered version, or `1.0.0` when none is registered yet.\n */\nexport function getNextSchemaVersion(\n registeredVersions: JsonSchemaVersionInfo[],\n): string {\n const highestMajor = Math.max(\n 0,\n ...registeredVersions.map(v =>\n Number.parseInt(v.semanticVersion?.split('.')[0] ?? '0', 10),\n ),\n )\n return `${highestMajor + 1}.0.0`\n}\n\n/** The schema a new FormTemplate starts from: no fields beyond those of the base schema. */\nexport function createNewFormTemplateSchema(): RJSFSchema {\n return {\n $schema: 'http://json-schema.org/draft-07/schema#',\n type: 'object',\n allOf: [{ $ref: ACCESS_REQUIREMENT_BASE_SCHEMA_ID }],\n }\n}\n"],"mappings":";;AASA,IAAa,IACX,yDAGW,IAAoC,2BAE3C,IAAuB;AAW7B,SAAgB,EACd,GACA,GACY;CACZ,IAAI,GAAmB;EAGrB,IAAM,CAAC,GAAkB,KAAc,EAAkB,MAAM,GAAG;EAClE,OAAO;GAAE;GAAkB;EAAW;CACxC;CAEA,IAAM,IAAa,EAAa,CAAY;CAC5C,OAAO;EACL,kBAAkB;EAClB,YAAY,YAAY,KAAK,CAAU,IACnC,IACA,GAAG,IAAuB;CAChC;AACF;AAMA,SAAgB,EAAgB,GAAkB,GAAkB;CAClE,IAAM,IAAiB,GAAG,EAAK,iBAAiB,GAAG,EAAK;CACxD,OAAO,IAAU,GAAG,EAAe,GAAG,MAAY;AACpD;AAMA,SAAgB,EACd,GACQ;CAOR,OAAO,GANc,KAAK,IACxB,GACA,GAAG,EAAmB,KAAI,MACxB,OAAO,SAAS,EAAE,iBAAiB,MAAM,GAAG,EAAE,MAAM,KAAK,EAAE,CAC7D,CAEQ,IAAe,EAAE;AAC7B;AAGA,SAAgB,IAA0C;CACxD,OAAO;EACL,SAAS;EACT,MAAM;EACN,OAAO,CAAC,EAAE,MAAM,EAAkC,CAAC;CACrD;AACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { FormTemplateStep } from '@sage-bionetworks/synapse-client';
|
|
3
|
+
/**
|
|
4
|
+
* A property is a "leaf" — the only kind a `FormTemplateField.schemaPath` may address — when it
|
|
5
|
+
* is not itself a nested object schema with its own `properties`. The simple editor only ever
|
|
6
|
+
* authors leaves, but the raw JSON Schema escape hatch can produce a nested object.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isLeafSchemaProperty(subSchema: RJSFSchema): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether a field's `uiDefinition` (an RJSF `UiSchema` fragment) declares a `ui:widget`
|
|
11
|
+
* incompatible with the resolved property's type/format. An empty or widget-less `uiDefinition`
|
|
12
|
+
* is always compatible — there is nothing to conflict with.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isUiHintCompatible(subSchema: RJSFSchema, uiDefinition: unknown): boolean;
|
|
15
|
+
export type FormTemplateFieldValidationError = {
|
|
16
|
+
/** Index of the step/field slot this error is anchored to. Omitted for an error against a
|
|
17
|
+
* schema-required property that isn't bound to any field -- there is no slot to anchor it to. */
|
|
18
|
+
stepIndex?: number;
|
|
19
|
+
fieldIndex?: number;
|
|
20
|
+
schemaPath: string;
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Replicates the three rules the server enforces on `FormTemplateField` at create/update time
|
|
25
|
+
* (see the `FormTemplateField` doc comment), so the editor can block save and point the error at
|
|
26
|
+
* the offending field before ever reaching the server: the server only returns a flat,
|
|
27
|
+
* concatenated message, not per-field errors. Also flags a schema property the server will
|
|
28
|
+
* require (per its resolved submission context) that no field in the template binds to -- the
|
|
29
|
+
* server accepts this silently, but the requester would then be unable to satisfy it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function validateFormTemplateFields(steps: FormTemplateStep[], jsonSchema: RJSFSchema): FormTemplateFieldValidationError[];
|
|
32
|
+
//# sourceMappingURL=formTemplateValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formTemplateValidation.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/formTemplateValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAEL,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAQzC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEnE;AAiBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,UAAU,EACrB,YAAY,EAAE,OAAO,GACpB,OAAO,CAOT;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C;qGACiG;IACjG,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,gBAAgB,EAAE,EACzB,UAAU,EAAE,UAAU,GACrB,gCAAgC,EAAE,CAoEpC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { listResolvedSchemaProperties as e, pointerToPropertyKey as t, propertyKeyToPointer as n, resolveSchemaPropertyAtPointer as r } from "../../utils/jsonschema/submissionContext.js";
|
|
2
|
+
//#region src/components/FormTemplateEditor/formTemplateValidation.ts
|
|
3
|
+
function i(e) {
|
|
4
|
+
return !(e.type === "object" && e.properties != null);
|
|
5
|
+
}
|
|
6
|
+
var a = {
|
|
7
|
+
textarea: (e) => e.type === "string" && !e.enum,
|
|
8
|
+
password: (e) => e.type === "string" && !e.enum,
|
|
9
|
+
radio: (e) => (e.type === "string" || e.type === "boolean") && !!e.enum || e.type === "boolean",
|
|
10
|
+
select: (e) => e.type === "string" && !!e.enum,
|
|
11
|
+
checkboxes: (e) => e.type === "array",
|
|
12
|
+
checkbox: (e) => e.type === "boolean",
|
|
13
|
+
updown: (e) => e.type === "number" || e.type === "integer",
|
|
14
|
+
range: (e) => e.type === "number" || e.type === "integer"
|
|
15
|
+
};
|
|
16
|
+
function o(e, t) {
|
|
17
|
+
let n = t?.["ui:widget"];
|
|
18
|
+
if (typeof n != "string") return !0;
|
|
19
|
+
let r = a[n];
|
|
20
|
+
return r ? r(e) : !0;
|
|
21
|
+
}
|
|
22
|
+
function s(a, s) {
|
|
23
|
+
let c = [], l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
24
|
+
a.forEach((e, n) => {
|
|
25
|
+
e.fields.forEach((e, a) => {
|
|
26
|
+
let { schemaPath: d } = e;
|
|
27
|
+
if (l.has(d)) {
|
|
28
|
+
c.push({
|
|
29
|
+
stepIndex: n,
|
|
30
|
+
fieldIndex: a,
|
|
31
|
+
schemaPath: d,
|
|
32
|
+
message: `"${d}" is already bound to another field in this template.`
|
|
33
|
+
});
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
l.add(d);
|
|
37
|
+
let f = t(d);
|
|
38
|
+
f && u.add(f);
|
|
39
|
+
let p = r(s, d)?.subSchema;
|
|
40
|
+
if (!p) {
|
|
41
|
+
c.push({
|
|
42
|
+
stepIndex: n,
|
|
43
|
+
fieldIndex: a,
|
|
44
|
+
schemaPath: d,
|
|
45
|
+
message: `"${d}" does not resolve to a property in the schema.`
|
|
46
|
+
});
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (!i(p)) {
|
|
50
|
+
c.push({
|
|
51
|
+
stepIndex: n,
|
|
52
|
+
fieldIndex: a,
|
|
53
|
+
schemaPath: d,
|
|
54
|
+
message: `"${d}" is a nested object, not a single field.`
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
o(p, e.uiDefinition) || c.push({
|
|
59
|
+
stepIndex: n,
|
|
60
|
+
fieldIndex: a,
|
|
61
|
+
schemaPath: d,
|
|
62
|
+
message: `The UI hint for "${d}" is incompatible with its property type.`
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
for (let t of e(s)) t.isRequired && !u.has(t.propertyKey) && c.push({
|
|
67
|
+
schemaPath: n(t.propertyKey),
|
|
68
|
+
message: `"${t.propertyKey}" is required by the schema but is not bound to any field in this template.`
|
|
69
|
+
});
|
|
70
|
+
return c;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
export { i as isLeafSchemaProperty, o as isUiHintCompatible, s as validateFormTemplateFields };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=formTemplateValidation.js.map
|