synapse-react-client 4.0.41 → 4.0.43
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/AccessRequirementList.d.ts +6 -20
- package/dist/components/AccessRequirementList/AccessRequirementList.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementList.js +165 -159
- package/dist/components/AccessRequirementList/AccessRequirementList.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts +3 -2
- package/dist/components/AccessRequirementList/AccessRequirementListItem.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js +23 -22
- package/dist/components/AccessRequirementList/AccessRequirementListItem.js.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts +4 -3
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.js +6 -4
- package/dist/components/AccessRequirementList/AccessRequirementListUtils.js.map +1 -1
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts +22 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js +166 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/JsonSchemaRequestWizard.js.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts +18 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js +91 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/RequesterInformationFields.js.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts +33 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js +49 -0
- package/dist/components/AccessRequirementList/JsonSchemaAccessRequirementRequestFlow/requesterInformation.js.map +1 -0
- 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/CancelRequestDataAccess.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js +26 -42
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/CancelRequestDataAccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/DataAccessRequestAccessorsFilesForm/DataAccessRequestAccessorsFilesForm.js +97 -218
- 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 +177 -78
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/EDucPreviewStep/EDucPreviewStep.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts +4 -3
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.js +15 -15
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementFormWikiWrapper.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 +88 -103
- 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/RequestDataAccessSuccess.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js +14 -30
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestDataAccessSuccess.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.d.ts → RequestableAccessRequirementItem.d.ts} +9 -8
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItem.js → RequestableAccessRequirementItem.js} +16 -16
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItem.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.d.ts → RequestableAccessRequirementItemView.d.ts} +8 -7
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/{ManagedACTAccessRequirementItemView.js → RequestableAccessRequirementItemView.js} +3 -4
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/RequestableAccessRequirementItemView.js.map +1 -0
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js +123 -170
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ResearchProjectForm/ResearchProjectForm.js.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts +2 -2
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.d.ts.map +1 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ReviewDucStep/ReviewDucStep.js +35 -51
- 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 +107 -91
- 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 +12 -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/AccessRequirementList/RequestDataStep.d.ts +34 -0
- package/dist/components/AccessRequirementList/RequestDataStep.d.ts.map +1 -0
- package/dist/components/AccessRequirementList/RequestDataStep.js +37 -0
- package/dist/components/AccessRequirementList/RequestDataStep.js.map +1 -0
- package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.d.ts +1 -1
- package/dist/components/AccessRequirementList/RequirementItem/UnmanagedACTAccessRequirementItem.js.map +1 -1
- 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 +29 -41
- 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/SchemaStepForm.d.ts +21 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.d.ts.map +1 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.js +29 -0
- package/dist/components/JsonSchemaForm/SchemaStepForm.js.map +1 -0
- 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/SetBasicAccessRequirementFields/GovernanceUtils.d.ts +2 -2
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.d.ts.map +1 -1
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js +11 -10
- package/dist/components/SetBasicAccessRequirementFields/GovernanceUtils.js.map +1 -1
- package/dist/components/SynapseForm/SynapseForm.js +28 -28
- 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 +7 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/InFlightEDucSignaturesTable.js.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.d.ts.map +1 -1
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.js +5 -4
- package/dist/components/dataaccess/UserAccessRequestHistory/UserAccessRequestHistoryPlace.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/features/curator/dashboard/CuratorDashboardRouter.d.ts.map +1 -1
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js +15 -15
- package/dist/features/curator/dashboard/CuratorDashboardRouter.js.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.d.ts.map +1 -1
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.js +15 -14
- package/dist/features/entity/metadata-task/components/MetadataTasksPageRouter.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/mockJsonSchemaAccessRequirements.d.ts +7 -0
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.d.ts.map +1 -1
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.js +30 -15
- package/dist/mocks/accessRequirement/mockJsonSchemaAccessRequirements.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/dataaccess/MockDataAccessRequest.d.ts +3 -0
- package/dist/mocks/dataaccess/MockDataAccessRequest.d.ts.map +1 -1
- package/dist/mocks/dataaccess/MockDataAccessRequest.js +24 -12
- package/dist/mocks/dataaccess/MockDataAccessRequest.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 +65 -47
- 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/dataaccess/useGeneratedRequestForm.d.ts +19 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.d.ts.map +1 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js +26 -0
- package/dist/synapse-queries/dataaccess/useGeneratedRequestForm.js.map +1 -0
- 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/hooks/useDetectSSOCode.d.ts.map +1 -1
- package/dist/utils/hooks/useDetectSSOCode.js +31 -26
- package/dist/utils/hooks/useDetectSSOCode.js.map +1 -1
- package/dist/utils/jsonschema/schemaData.d.ts +18 -0
- package/dist/utils/jsonschema/schemaData.d.ts.map +1 -0
- package/dist/utils/jsonschema/schemaData.js +26 -0
- package/dist/utils/jsonschema/schemaData.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
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.d.ts.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItem.js.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.d.ts.map +0 -1
- package/dist/components/AccessRequirementList/ManagedACTAccessRequirementRequestFlow/ManagedACTAccessRequirementItemView.js.map +0 -1
|
@@ -1,79 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { generateDataAccessSchema as e } from "../../utils/jsonschema/generateDataAccessSchema.js";
|
|
2
|
+
import { getStepTitle as t } from "../../utils/jsonschema/schemaData.js";
|
|
3
|
+
import n from "../JsonSchemaForm/SchemaStepForm.js";
|
|
4
|
+
import { useMemo as r, useState as i } from "react";
|
|
5
|
+
import { Box as a, Paper as o, Step as s, StepButton as c, Stepper as l, ToggleButton as u, ToggleButtonGroup as d, Typography as f } from "@mui/material";
|
|
6
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
7
|
import { DataAccessRequestType as h } from "@sage-bionetworks/synapse-client";
|
|
7
8
|
//#region src/components/FormTemplateEditor/FormTemplatePreview.tsx
|
|
8
9
|
function g({ template: g, jsonSchema: _ }) {
|
|
9
|
-
let [v, y] =
|
|
10
|
+
let [v, y] = i(0), [b, x] = i({}), [S, C] = i(h.REQUEST), { steps: w } = r(() => e(g, _, S), [
|
|
10
11
|
g,
|
|
11
12
|
_,
|
|
12
|
-
|
|
13
|
+
S
|
|
13
14
|
]);
|
|
14
|
-
if (
|
|
15
|
+
if (w.length === 0) return /* @__PURE__ */ p(o, {
|
|
15
16
|
variant: "outlined",
|
|
16
17
|
sx: { p: 2 },
|
|
17
|
-
children: /* @__PURE__ */ p(
|
|
18
|
+
children: /* @__PURE__ */ p(a, {
|
|
18
19
|
sx: {
|
|
19
20
|
py: 4,
|
|
20
21
|
textAlign: "center"
|
|
21
22
|
},
|
|
22
|
-
children: /* @__PURE__ */ p(
|
|
23
|
+
children: /* @__PURE__ */ p(f, {
|
|
23
24
|
variant: "body2",
|
|
24
25
|
color: "text.secondary",
|
|
25
26
|
children: "Add at least one step with a bound field to preview the form."
|
|
26
27
|
})
|
|
27
28
|
})
|
|
28
29
|
});
|
|
29
|
-
let
|
|
30
|
-
return /* @__PURE__ */ m(
|
|
30
|
+
let T = Math.min(v, w.length - 1), E = w[T];
|
|
31
|
+
return /* @__PURE__ */ m(o, {
|
|
31
32
|
variant: "outlined",
|
|
32
33
|
sx: { p: 2 },
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */ m(
|
|
35
|
-
value:
|
|
35
|
+
/* @__PURE__ */ m(d, {
|
|
36
|
+
value: S,
|
|
36
37
|
exclusive: !0,
|
|
37
38
|
size: "small",
|
|
38
39
|
onChange: (e, t) => {
|
|
39
|
-
t &&
|
|
40
|
+
t && C(t);
|
|
40
41
|
},
|
|
41
42
|
sx: { mb: 2 },
|
|
42
|
-
children: [/* @__PURE__ */ p(
|
|
43
|
+
children: [/* @__PURE__ */ p(u, {
|
|
43
44
|
value: h.REQUEST,
|
|
44
45
|
children: "Request"
|
|
45
|
-
}), /* @__PURE__ */ p(
|
|
46
|
+
}), /* @__PURE__ */ p(u, {
|
|
46
47
|
value: h.RENEWAL,
|
|
47
48
|
children: "Renewal"
|
|
48
49
|
})]
|
|
49
50
|
}),
|
|
50
|
-
|
|
51
|
-
activeStep:
|
|
51
|
+
w.length > 1 && /* @__PURE__ */ p(l, {
|
|
52
|
+
activeStep: T,
|
|
52
53
|
nonLinear: !0,
|
|
53
54
|
sx: { mb: 2 },
|
|
54
|
-
children:
|
|
55
|
-
onClick: () => y(
|
|
56
|
-
children: e
|
|
57
|
-
}) },
|
|
55
|
+
children: w.map((e, n) => /* @__PURE__ */ p(s, { children: /* @__PURE__ */ p(c, {
|
|
56
|
+
onClick: () => y(n),
|
|
57
|
+
children: t(e, n + 1)
|
|
58
|
+
}) }, n))
|
|
58
59
|
}),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
E && /* @__PURE__ */ p(d, {
|
|
65
|
-
variant: "body2",
|
|
66
|
-
color: "text.secondary",
|
|
67
|
-
sx: { mb: 2 },
|
|
68
|
-
children: E
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ p(e, {
|
|
71
|
-
schema: w.jsonSchema,
|
|
72
|
-
uiSchema: w.uiSchema,
|
|
73
|
-
formContext: { descriptionVariant: "inline" },
|
|
74
|
-
children: /* @__PURE__ */ p(f, {}),
|
|
75
|
-
liveValidate: !1
|
|
76
|
-
})
|
|
60
|
+
/* @__PURE__ */ p(n, {
|
|
61
|
+
step: E,
|
|
62
|
+
schemaData: b,
|
|
63
|
+
onSchemaDataChange: x
|
|
64
|
+
}, T)
|
|
77
65
|
]
|
|
78
66
|
});
|
|
79
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormTemplatePreview.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormTemplatePreview.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"FormTemplatePreview.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FormTemplatePreview.tsx"],"sourcesContent":["import SchemaStepForm from '@/components/JsonSchemaForm/SchemaStepForm'\nimport { generateDataAccessSchema } from '@/utils/jsonschema/generateDataAccessSchema'\nimport { getStepTitle, SchemaData } from '@/utils/jsonschema/schemaData'\nimport {\n DataAccessRequestType,\n FormTemplate,\n} from '@sage-bionetworks/synapse-client'\nimport {\n Box,\n Paper,\n Step,\n StepButton,\n Stepper,\n ToggleButton,\n ToggleButtonGroup,\n Typography,\n} from '@mui/material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useMemo, useState } from 'react'\n\ntype FormTemplatePreviewProps = {\n template: FormTemplate\n jsonSchema: RJSFSchema\n}\n\n/**\n * Renders a live preview of how a FormTemplate + its referenced JSON Schema will appear to a\n * requester. Computed client-side against the unsaved draft, purely to give ACT instant feedback\n * while editing.\n */\nexport function FormTemplatePreview({\n template,\n jsonSchema,\n}: FormTemplatePreviewProps) {\n const [activeStep, setActiveStep] = useState(0)\n // Kept across steps and request types so ACT can see how answers carry through the form\n const [schemaData, setSchemaData] = useState<SchemaData>({})\n const [requestType, setRequestType] = useState<DataAccessRequestType>(\n DataAccessRequestType.REQUEST,\n )\n\n const { steps } = useMemo(\n () => generateDataAccessSchema(template, jsonSchema, requestType),\n [template, jsonSchema, requestType],\n )\n\n if (steps.length === 0) {\n return (\n <Paper variant=\"outlined\" sx={{ p: 2 }}>\n <Box sx={{ py: 4, textAlign: 'center' }}>\n <Typography variant=\"body2\" color=\"text.secondary\">\n Add at least one step with a bound field to preview the form.\n </Typography>\n </Box>\n </Paper>\n )\n }\n\n const safeIndex = Math.min(activeStep, steps.length - 1)\n const currentStep = steps[safeIndex]\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2 }}>\n <ToggleButtonGroup\n value={requestType}\n exclusive\n size=\"small\"\n onChange={(_, next: DataAccessRequestType | null) => {\n if (next) setRequestType(next)\n }}\n sx={{ mb: 2 }}\n >\n <ToggleButton value={DataAccessRequestType.REQUEST}>\n Request\n </ToggleButton>\n <ToggleButton value={DataAccessRequestType.RENEWAL}>\n Renewal\n </ToggleButton>\n </ToggleButtonGroup>\n\n {steps.length > 1 && (\n <Stepper activeStep={safeIndex} nonLinear sx={{ mb: 2 }}>\n {steps.map((step, index) => (\n <Step key={index}>\n <StepButton onClick={() => setActiveStep(index)}>\n {getStepTitle(step, index + 1)}\n </StepButton>\n </Step>\n ))}\n </Stepper>\n )}\n\n <SchemaStepForm\n // Each step is a separate form, as it is for a requester\n key={safeIndex}\n step={currentStep}\n schemaData={schemaData}\n onSchemaDataChange={setSchemaData}\n />\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;AA8BA,SAAgB,EAAoB,EAClC,aACA,iBAC2B;CAC3B,IAAM,CAAC,GAAY,KAAiB,EAAS,CAAC,GAExC,CAAC,GAAY,KAAiB,EAAqB,CAAC,CAAC,GACrD,CAAC,GAAa,KAAkB,EACpC,EAAsB,OACxB,GAEM,EAAE,aAAU,QACV,EAAyB,GAAU,GAAY,CAAW,GAChE;EAAC;EAAU;EAAY;CAAW,CACpC;CAEA,IAAI,EAAM,WAAW,GACnB,OACE,kBAAC,GAAD;EAAO,SAAQ;EAAW,IAAI,EAAE,GAAG,EAAE;YACnC,kBAAC,GAAD;GAAK,IAAI;IAAE,IAAI;IAAG,WAAW;GAAS;aACpC,kBAAC,GAAD;IAAY,SAAQ;IAAQ,OAAM;cAAiB;GAEvC,CAAA;EACT,CAAA;CACA,CAAA;CAIX,IAAM,IAAY,KAAK,IAAI,GAAY,EAAM,SAAS,CAAC,GACjD,IAAc,EAAM;CAE1B,OACE,kBAAC,GAAD;EAAO,SAAQ;EAAW,IAAI,EAAE,GAAG,EAAE;YAArC;GACE,kBAAC,GAAD;IACE,OAAO;IACP,WAAA;IACA,MAAK;IACL,WAAW,GAAG,MAAuC;KACnD,AAAI,KAAM,EAAe,CAAI;IAC/B;IACA,IAAI,EAAE,IAAI,EAAE;cAPd,CASE,kBAAC,GAAD;KAAc,OAAO,EAAsB;eAAS;IAEtC,CAAA,GACd,kBAAC,GAAD;KAAc,OAAO,EAAsB;eAAS;IAEtC,CAAA,CACG;;GAElB,EAAM,SAAS,KACd,kBAAC,GAAD;IAAS,YAAY;IAAW,WAAA;IAAU,IAAI,EAAE,IAAI,EAAE;cACnD,EAAM,KAAK,GAAM,MAChB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;KAAY,eAAe,EAAc,CAAK;eAC3C,EAAa,GAAM,IAAQ,CAAC;IACnB,CAAA,EACR,GAJK,CAIL,CACP;GACM,CAAA;GAGX,kBAAC,GAAD;IAGE,MAAM;IACM;IACZ,oBAAoB;GACrB,GAJM,CAIN;EACI;;AAEX"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormTemplateStep } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
import { ResolvedSchemaProperty } from '@/utils/jsonschema/submissionContext';
|
|
4
|
+
import { EditableFormTemplateStep } from './utils';
|
|
5
|
+
export type StepCardProps = {
|
|
6
|
+
step: EditableFormTemplateStep;
|
|
7
|
+
stepIndex: number;
|
|
8
|
+
isFirst: boolean;
|
|
9
|
+
isLast: boolean;
|
|
10
|
+
/** Properties not yet bound to any step in the template. */
|
|
11
|
+
unboundProperties: ResolvedSchemaProperty[];
|
|
12
|
+
/** The full JSON Schema, used to resolve display labels for slot rows. */
|
|
13
|
+
jsonSchema: RJSFSchema;
|
|
14
|
+
/** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */
|
|
15
|
+
formTemplateId: string | undefined;
|
|
16
|
+
/** If true, render expanded by default (first step). */
|
|
17
|
+
defaultExpanded: boolean;
|
|
18
|
+
onChange: (patch: Partial<FormTemplateStep>) => void;
|
|
19
|
+
onBindField: (propertyKey: string) => void;
|
|
20
|
+
onMoveUp: () => void;
|
|
21
|
+
onMoveDown: () => void;
|
|
22
|
+
onRemove: () => void;
|
|
23
|
+
};
|
|
24
|
+
export declare function StepCard({ step, stepIndex, isFirst, isLast, unboundProperties, jsonSchema, formTemplateId, defaultExpanded, onChange, onBindField, onMoveUp, onMoveDown, onRemove, }: StepCardProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=StepCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepCard.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,gBAAgB,EACjB,MAAM,kCAAkC,CAAA;AAmBzC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,OAAO,EAGL,sBAAsB,EAEvB,MAAM,sCAAsC,CAAA;AAa7C,OAAO,EAAoB,wBAAwB,EAAY,MAAM,SAAS,CAAA;AAS9E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,4DAA4D;IAC5D,iBAAiB,EAAE,sBAAsB,EAAE,CAAA;IAC3C,0EAA0E;IAC1E,UAAU,EAAE,UAAU,CAAA;IACtB,iGAAiG;IACjG,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,wDAAwD;IACxD,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACpD,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,aAAa,2CAoNf"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { moveItem as e } from "../../utils/functions/ArrayUtils.js";
|
|
2
|
+
import { pointerToPropertyKey as t, propertyKeyToPointer as n, resolveSchemaPropertyAtPointer as r } from "../../utils/jsonschema/submissionContext.js";
|
|
3
|
+
import i from "./dragHandle.module.js";
|
|
4
|
+
import { FIELD_DRAG_TYPE as a, SLOT_SORTABLE_TYPE as o, STEP_SORTABLE_GROUP as s, STEP_SORTABLE_TYPE as c, slotGroupId as l, slotSortableId as u, stepSortableId as d } from "./sortableIds.js";
|
|
5
|
+
import f from "./dropTarget.module.js";
|
|
6
|
+
import { StepFieldRow as p } from "./StepFieldRow.js";
|
|
7
|
+
import { BIND_FIELD_LABEL as m } from "./utils.js";
|
|
8
|
+
import { useState as h } from "react";
|
|
9
|
+
import { Box as g, Collapse as _, IconButton as v, MenuItem as y, Paper as b, Stack as ee, TextField as x, Typography as S } from "@mui/material";
|
|
10
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
11
|
+
import { ArrowDownward as T, ArrowUpward as E, Delete as D, DragIndicator as O, ExpandLess as k, ExpandMore as A } from "@mui/icons-material";
|
|
12
|
+
import j from "pluralize";
|
|
13
|
+
import { useDroppable as M } from "@dnd-kit/react";
|
|
14
|
+
import { useSortable as N } from "@dnd-kit/react/sortable";
|
|
15
|
+
//#region src/components/FormTemplateEditor/StepCard.tsx
|
|
16
|
+
var P = 1;
|
|
17
|
+
function F({ step: F, stepIndex: I, isFirst: te, isLast: L, unboundProperties: R, jsonSchema: z, formTemplateId: B, defaultExpanded: V, onChange: H, onBindField: U, onMoveUp: W, onMoveDown: G, onRemove: K }) {
|
|
18
|
+
let [q, J] = h(V), { ref: Y, handleRef: X, isDragging: Z, isDropTarget: Q } = N({
|
|
19
|
+
id: d(F),
|
|
20
|
+
index: I,
|
|
21
|
+
group: s,
|
|
22
|
+
type: c,
|
|
23
|
+
accept: [c, a]
|
|
24
|
+
}), { ref: ne, isDropTarget: re } = M({
|
|
25
|
+
id: l(F),
|
|
26
|
+
accept: o,
|
|
27
|
+
collisionPriority: P
|
|
28
|
+
}), ie = (e, t) => {
|
|
29
|
+
H({ fields: F.fields.map((n, r) => r === e ? {
|
|
30
|
+
...n,
|
|
31
|
+
...t
|
|
32
|
+
} : n) });
|
|
33
|
+
}, $ = (t, n) => {
|
|
34
|
+
H({ fields: e(F.fields, t, n) });
|
|
35
|
+
}, ae = (e) => {
|
|
36
|
+
H({ fields: F.fields.filter((t, n) => n !== e) });
|
|
37
|
+
}, oe = j("field", F.fields.length, !0);
|
|
38
|
+
return /* @__PURE__ */ w(b, {
|
|
39
|
+
ref: Y,
|
|
40
|
+
variant: "outlined",
|
|
41
|
+
className: `${f.dropTarget} ${i.dragSource}`,
|
|
42
|
+
"data-drop-target": Q,
|
|
43
|
+
"data-dragging": Z,
|
|
44
|
+
sx: { p: 1.5 },
|
|
45
|
+
children: [/* @__PURE__ */ w(g, {
|
|
46
|
+
sx: {
|
|
47
|
+
display: "flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
gap: .5
|
|
50
|
+
},
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ C(g, {
|
|
53
|
+
ref: X,
|
|
54
|
+
role: "button",
|
|
55
|
+
tabIndex: 0,
|
|
56
|
+
"aria-label": "Drag to reorder step",
|
|
57
|
+
className: i.dragHandle,
|
|
58
|
+
sx: { color: "text.secondary" },
|
|
59
|
+
children: /* @__PURE__ */ C(O, { fontSize: "small" })
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ C(v, {
|
|
62
|
+
size: "small",
|
|
63
|
+
onClick: () => J((e) => !e),
|
|
64
|
+
"aria-label": q ? "Collapse step" : "Expand step",
|
|
65
|
+
children: C(q ? k : A, { fontSize: "small" })
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ w(g, {
|
|
68
|
+
sx: {
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
minWidth: 0
|
|
71
|
+
},
|
|
72
|
+
children: [/* @__PURE__ */ w(S, {
|
|
73
|
+
variant: "body2",
|
|
74
|
+
fontWeight: 500,
|
|
75
|
+
noWrap: !0,
|
|
76
|
+
children: [
|
|
77
|
+
"Step ",
|
|
78
|
+
I + 1,
|
|
79
|
+
": ",
|
|
80
|
+
F.title || "(untitled)"
|
|
81
|
+
]
|
|
82
|
+
}), /* @__PURE__ */ C(S, {
|
|
83
|
+
variant: "caption",
|
|
84
|
+
color: "text.secondary",
|
|
85
|
+
children: oe
|
|
86
|
+
})]
|
|
87
|
+
}),
|
|
88
|
+
/* @__PURE__ */ C(v, {
|
|
89
|
+
size: "small",
|
|
90
|
+
disabled: te,
|
|
91
|
+
onClick: W,
|
|
92
|
+
"aria-label": "Move step up",
|
|
93
|
+
children: /* @__PURE__ */ C(E, { fontSize: "small" })
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ C(v, {
|
|
96
|
+
size: "small",
|
|
97
|
+
disabled: L,
|
|
98
|
+
onClick: G,
|
|
99
|
+
"aria-label": "Move step down",
|
|
100
|
+
children: /* @__PURE__ */ C(T, { fontSize: "small" })
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ C(v, {
|
|
103
|
+
size: "small",
|
|
104
|
+
onClick: K,
|
|
105
|
+
"aria-label": "Remove step",
|
|
106
|
+
children: /* @__PURE__ */ C(D, { fontSize: "small" })
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
}), /* @__PURE__ */ C(_, {
|
|
110
|
+
in: q,
|
|
111
|
+
unmountOnExit: !0,
|
|
112
|
+
children: /* @__PURE__ */ w(g, {
|
|
113
|
+
sx: { pt: 1.5 },
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ C(x, {
|
|
116
|
+
label: "Title",
|
|
117
|
+
value: F.title,
|
|
118
|
+
onChange: (e) => H({ title: e.target.value }),
|
|
119
|
+
size: "small",
|
|
120
|
+
fullWidth: !0,
|
|
121
|
+
sx: { mb: 1 }
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ C(x, {
|
|
124
|
+
label: "Description",
|
|
125
|
+
value: F.description ?? "",
|
|
126
|
+
onChange: (e) => H({ description: e.target.value }),
|
|
127
|
+
size: "small",
|
|
128
|
+
multiline: !0,
|
|
129
|
+
rows: 2,
|
|
130
|
+
fullWidth: !0,
|
|
131
|
+
sx: { mb: 1.5 }
|
|
132
|
+
}),
|
|
133
|
+
/* @__PURE__ */ C(g, {
|
|
134
|
+
ref: ne,
|
|
135
|
+
className: f.dropTarget,
|
|
136
|
+
"data-drop-target": re,
|
|
137
|
+
sx: {
|
|
138
|
+
display: "flex",
|
|
139
|
+
flexDirection: "column",
|
|
140
|
+
gap: 1,
|
|
141
|
+
mb: 1,
|
|
142
|
+
p: .5,
|
|
143
|
+
borderRadius: 1
|
|
144
|
+
},
|
|
145
|
+
children: F.fields.length === 0 ? /* @__PURE__ */ C(S, {
|
|
146
|
+
variant: "caption",
|
|
147
|
+
color: "text.secondary",
|
|
148
|
+
sx: { p: 1 },
|
|
149
|
+
children: "Drag a field here, or bind one below."
|
|
150
|
+
}) : F.fields.map((e, n) => {
|
|
151
|
+
let i = r(z, e.schemaPath);
|
|
152
|
+
return /* @__PURE__ */ C(p, {
|
|
153
|
+
sortableId: u(e),
|
|
154
|
+
sortableIndex: n,
|
|
155
|
+
sortableGroup: l(F),
|
|
156
|
+
field: e,
|
|
157
|
+
resolvedProperty: i?.subSchema,
|
|
158
|
+
context: i?.context ?? "ALWAYS",
|
|
159
|
+
propertyKey: t(e.schemaPath) ?? e.schemaPath,
|
|
160
|
+
isFirst: n === 0,
|
|
161
|
+
isLast: n === F.fields.length - 1,
|
|
162
|
+
formTemplateId: B,
|
|
163
|
+
onChange: (e) => ie(n, e),
|
|
164
|
+
onMoveUp: () => $(n, -1),
|
|
165
|
+
onMoveDown: () => $(n, 1),
|
|
166
|
+
onRemove: () => ae(n)
|
|
167
|
+
}, e.schemaPath);
|
|
168
|
+
})
|
|
169
|
+
}),
|
|
170
|
+
/* @__PURE__ */ C(ee, {
|
|
171
|
+
spacing: 1,
|
|
172
|
+
children: /* @__PURE__ */ C(x, {
|
|
173
|
+
select: !0,
|
|
174
|
+
size: "small",
|
|
175
|
+
label: m,
|
|
176
|
+
value: "",
|
|
177
|
+
onChange: (e) => {
|
|
178
|
+
e.target.value && U(e.target.value);
|
|
179
|
+
},
|
|
180
|
+
disabled: R.length === 0,
|
|
181
|
+
helperText: R.length === 0 ? "All fields are bound to a step." : "Add a field from the library to this step.",
|
|
182
|
+
children: R.length === 0 ? /* @__PURE__ */ C(y, {
|
|
183
|
+
value: "",
|
|
184
|
+
disabled: !0,
|
|
185
|
+
children: "All fields bound"
|
|
186
|
+
}) : R.map((e) => {
|
|
187
|
+
let t = n(e.propertyKey);
|
|
188
|
+
return /* @__PURE__ */ C(y, {
|
|
189
|
+
value: e.propertyKey,
|
|
190
|
+
children: e.subSchema.title ? `${e.subSchema.title} (${t})` : t
|
|
191
|
+
}, e.propertyKey);
|
|
192
|
+
})
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
})
|
|
197
|
+
})]
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
export { F as StepCard };
|
|
202
|
+
|
|
203
|
+
//# sourceMappingURL=StepCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepCard.js","names":[],"sources":["../../../src/components/FormTemplateEditor/StepCard.tsx"],"sourcesContent":["import { useDroppable } from '@dnd-kit/react'\nimport { useSortable } from '@dnd-kit/react/sortable'\nimport {\n FormTemplateField,\n FormTemplateStep,\n} from '@sage-bionetworks/synapse-client'\nimport {\n Box,\n Collapse,\n IconButton,\n MenuItem,\n Paper,\n Stack,\n TextField,\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 pluralize from 'pluralize'\nimport { useState } from 'react'\nimport {\n pointerToPropertyKey,\n propertyKeyToPointer,\n ResolvedSchemaProperty,\n resolveSchemaPropertyAtPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport dragHandleStyles from './dragHandle.module.scss'\nimport dropTargetStyles from './dropTarget.module.scss'\nimport { StepFieldRow } from './StepFieldRow'\nimport {\n FIELD_DRAG_TYPE,\n slotGroupId,\n SLOT_SORTABLE_TYPE,\n slotSortableId,\n stepSortableId,\n STEP_SORTABLE_GROUP,\n STEP_SORTABLE_TYPE,\n} from './sortableIds'\nimport { BIND_FIELD_LABEL, EditableFormTemplateStep, moveItem } from './utils'\n\n/**\n * The slot list must lose to the slot rows inside it so that dragging over a populated step\n * targets a row (which resolves to a precise insertion index) and only an empty or below-the-last-\n * row region falls through to the list itself.\n */\nconst SLOT_LIST_COLLISION_PRIORITY = 1\n\nexport type StepCardProps = {\n step: EditableFormTemplateStep\n stepIndex: number\n isFirst: boolean\n isLast: boolean\n /** Properties not yet bound to any step in the template. */\n unboundProperties: ResolvedSchemaProperty[]\n /** The full JSON Schema, used to resolve display labels for slot rows. */\n jsonSchema: RJSFSchema\n /** The FormTemplate's id, if it has been saved. Threaded down to file-field template uploads. */\n formTemplateId: string | undefined\n /** If true, render expanded by default (first step). */\n defaultExpanded: boolean\n onChange: (patch: Partial<FormTemplateStep>) => void\n onBindField: (propertyKey: string) => void\n onMoveUp: () => void\n onMoveDown: () => void\n onRemove: () => void\n}\n\nexport function StepCard({\n step,\n stepIndex,\n isFirst,\n isLast,\n unboundProperties,\n jsonSchema,\n formTemplateId,\n defaultExpanded,\n onChange,\n onBindField,\n onMoveUp,\n onMoveDown,\n onRemove,\n}: StepCardProps) {\n const [expanded, setExpanded] = useState(defaultExpanded)\n\n // Step is sortable within its group, and also accepts field drops to bind.\n const { ref, handleRef, isDragging, isDropTarget } = useSortable({\n id: stepSortableId(step),\n index: stepIndex,\n group: STEP_SORTABLE_GROUP,\n type: STEP_SORTABLE_TYPE,\n accept: [STEP_SORTABLE_TYPE, FIELD_DRAG_TYPE],\n })\n\n // The slot list is the drop target for slots dragged in from another step, which is the only\n // way to reach a step whose list is empty and therefore has no slot rows to target.\n const { ref: slotListRef, isDropTarget: isSlotDropTarget } = useDroppable({\n id: slotGroupId(step),\n accept: SLOT_SORTABLE_TYPE,\n collisionPriority: SLOT_LIST_COLLISION_PRIORITY,\n })\n\n const handleFieldChange = (\n fieldIdx: number,\n patch: Partial<FormTemplateField>,\n ) => {\n onChange({\n fields: step.fields.map((f, i) =>\n i === fieldIdx ? { ...f, ...patch } : f,\n ),\n })\n }\n\n const handleFieldMove = (fieldIdx: number, direction: -1 | 1) => {\n onChange({ fields: moveItem(step.fields, fieldIdx, direction) })\n }\n\n const handleFieldRemove = (fieldIdx: number) => {\n onChange({ fields: step.fields.filter((_, i) => i !== fieldIdx) })\n }\n\n const fieldCountLabel = pluralize('field', step.fields.length, true)\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={`${dropTargetStyles.dropTarget} ${dragHandleStyles.dragSource}`}\n data-drop-target={isDropTarget}\n data-dragging={isDragging}\n sx={{ p: 1.5 }}\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 step\"\n className={dragHandleStyles.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 step' : 'Expand step'}\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\" fontWeight={500} noWrap>\n Step {stepIndex + 1}: {step.title || '(untitled)'}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldCountLabel}\n </Typography>\n </Box>\n <IconButton\n size=\"small\"\n disabled={isFirst}\n onClick={onMoveUp}\n aria-label=\"Move step up\"\n >\n <UpIcon fontSize=\"small\" />\n </IconButton>\n <IconButton\n size=\"small\"\n disabled={isLast}\n onClick={onMoveDown}\n aria-label=\"Move step down\"\n >\n <DownIcon fontSize=\"small\" />\n </IconButton>\n <IconButton size=\"small\" onClick={onRemove} aria-label=\"Remove step\">\n <DeleteIcon fontSize=\"small\" />\n </IconButton>\n </Box>\n\n <Collapse in={expanded} unmountOnExit>\n <Box sx={{ pt: 1.5 }}>\n <TextField\n label=\"Title\"\n value={step.title}\n onChange={e => onChange({ title: e.target.value })}\n size=\"small\"\n fullWidth\n sx={{ mb: 1 }}\n />\n <TextField\n label=\"Description\"\n value={step.description ?? ''}\n onChange={e => onChange({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={2}\n fullWidth\n sx={{ mb: 1.5 }}\n />\n\n <Box\n ref={slotListRef}\n className={dropTargetStyles.dropTarget}\n data-drop-target={isSlotDropTarget}\n sx={{\n display: 'flex',\n flexDirection: 'column',\n gap: 1,\n mb: 1,\n p: 0.5,\n borderRadius: 1,\n }}\n >\n {step.fields.length === 0 ? (\n <Typography\n variant=\"caption\"\n color=\"text.secondary\"\n sx={{ p: 1 }}\n >\n Drag a field here, or bind one below.\n </Typography>\n ) : (\n step.fields.map((field, fieldIdx) => {\n const resolved = resolveSchemaPropertyAtPointer(\n jsonSchema,\n field.schemaPath,\n )\n return (\n <StepFieldRow\n key={field.schemaPath}\n sortableId={slotSortableId(field)}\n sortableIndex={fieldIdx}\n sortableGroup={slotGroupId(step)}\n field={field}\n resolvedProperty={resolved?.subSchema}\n context={resolved?.context ?? 'ALWAYS'}\n propertyKey={\n pointerToPropertyKey(field.schemaPath) ?? field.schemaPath\n }\n isFirst={fieldIdx === 0}\n isLast={fieldIdx === step.fields.length - 1}\n formTemplateId={formTemplateId}\n onChange={patch => handleFieldChange(fieldIdx, patch)}\n onMoveUp={() => handleFieldMove(fieldIdx, -1)}\n onMoveDown={() => handleFieldMove(fieldIdx, 1)}\n onRemove={() => handleFieldRemove(fieldIdx)}\n />\n )\n })\n )}\n </Box>\n\n <Stack spacing={1}>\n <TextField\n select\n size=\"small\"\n label={BIND_FIELD_LABEL}\n value=\"\"\n onChange={e => {\n if (e.target.value) onBindField(e.target.value)\n }}\n disabled={unboundProperties.length === 0}\n helperText={\n unboundProperties.length === 0\n ? 'All fields are bound to a step.'\n : 'Add a field from the library to this step.'\n }\n >\n {unboundProperties.length === 0 ? (\n <MenuItem value=\"\" disabled>\n All fields bound\n </MenuItem>\n ) : (\n unboundProperties.map(p => {\n const pointer = propertyKeyToPointer(p.propertyKey)\n return (\n <MenuItem key={p.propertyKey} value={p.propertyKey}>\n {p.subSchema.title\n ? `${p.subSchema.title} (${pointer})`\n : pointer}\n </MenuItem>\n )\n })\n )}\n </TextField>\n </Stack>\n </Box>\n </Collapse>\n </Paper>\n )\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FormTemplateField } from '@sage-bionetworks/synapse-client';
|
|
2
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
3
|
+
import { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext';
|
|
4
|
+
export type StepFieldRowProps = {
|
|
5
|
+
/** Sortable id assigned by parent: `slot:{stepIndex}:{fieldIndex}`. */
|
|
6
|
+
sortableId: string;
|
|
7
|
+
/** Position within its step's fields array. */
|
|
8
|
+
sortableIndex: number;
|
|
9
|
+
/** Sortable group; slots only reorder within the same step. */
|
|
10
|
+
sortableGroup: string;
|
|
11
|
+
field: FormTemplateField;
|
|
12
|
+
/** The schema property this slot resolves to, if it still exists. */
|
|
13
|
+
resolvedProperty: RJSFSchema | undefined;
|
|
14
|
+
/** Which submission context (per the schema's `x-synapse-submissionContext` convention)
|
|
15
|
+
* gates this field, derived from `resolvedProperty`. */
|
|
16
|
+
context: SchemaPropertyContext;
|
|
17
|
+
/** Underlying property key (the segment after `/` in `schemaPath`). */
|
|
18
|
+
propertyKey: string;
|
|
19
|
+
isFirst: boolean;
|
|
20
|
+
isLast: boolean;
|
|
21
|
+
/** The FormTemplate's id, if it has been saved. Used to build the template file download. */
|
|
22
|
+
formTemplateId: string | undefined;
|
|
23
|
+
onChange: (patch: Partial<FormTemplateField>) => void;
|
|
24
|
+
onMoveUp: () => void;
|
|
25
|
+
onMoveDown: () => void;
|
|
26
|
+
onRemove: () => void;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A slot row inside a step. Compact by default — shows the field's display
|
|
30
|
+
* name. Expand to reveal slot-specific config: (for file fields) an
|
|
31
|
+
* optional template file handle. Sortable within its parent step.
|
|
32
|
+
*/
|
|
33
|
+
export declare function StepFieldRow({ sortableId, sortableIndex, sortableGroup, field, resolvedProperty, context, propertyKey, isFirst, isLast, formTemplateId, onChange, onMoveUp, onMoveDown, onRemove, }: StepFieldRowProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=StepFieldRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StepFieldRow.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/StepFieldRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AAmBpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EACL,qBAAqB,EAEtB,MAAM,sCAAsC,CAAA;AAM7C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAA;IAClB,+CAA+C;IAC/C,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,aAAa,EAAE,MAAM,CAAA;IACrB,KAAK,EAAE,iBAAiB,CAAA;IACxB,qEAAqE;IACrE,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAA;IACxC;4DACwD;IACxD,OAAO,EAAE,qBAAqB,CAAA;IAC9B,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,6FAA6F;IAC7F,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACrD,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,aAAa,EACb,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,QAAQ,GACT,EAAE,iBAAiB,2CA4HnB"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { submissionContextLabel as e } from "../../utils/jsonschema/submissionContext.js";
|
|
2
|
+
import { detectFieldType as t, fieldTypeLabel as n } from "./schemaFieldUtils.js";
|
|
3
|
+
import r from "./dragHandle.module.js";
|
|
4
|
+
import { SLOT_SORTABLE_TYPE as i } from "./sortableIds.js";
|
|
5
|
+
import { TemplateFileHandleField as a } from "./TemplateFileHandleField.js";
|
|
6
|
+
import { useState as o } from "react";
|
|
7
|
+
import { Box as s, Checkbox as c, Collapse as l, FormControlLabel as u, IconButton as d, Paper as f, Stack as p, Typography as m } from "@mui/material";
|
|
8
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
|
+
import { ArrowDownward as _, ArrowUpward as v, Delete as y, DragIndicator as b, ExpandLess as x, ExpandMore as S } from "@mui/icons-material";
|
|
10
|
+
import { useSortable as C } from "@dnd-kit/react/sortable";
|
|
11
|
+
//#region src/components/FormTemplateEditor/StepFieldRow.tsx
|
|
12
|
+
function w({ sortableId: w, sortableIndex: T, sortableGroup: E, field: D, resolvedProperty: O, context: k, propertyKey: A, isFirst: j, isLast: M, formTemplateId: N, onChange: P, onMoveUp: F, onMoveDown: I, onRemove: L }) {
|
|
13
|
+
let [R, z] = o(!1), { ref: B, handleRef: V, isDragging: H } = C({
|
|
14
|
+
id: w,
|
|
15
|
+
index: T,
|
|
16
|
+
group: E,
|
|
17
|
+
type: i,
|
|
18
|
+
accept: i
|
|
19
|
+
}), U = O ? t(O) : null, W = O?.title || A, G = U === "file", K = !O, q = `Missing field: ${D.schemaPath}`;
|
|
20
|
+
if (!K) {
|
|
21
|
+
let t = [n(U)];
|
|
22
|
+
k !== "ALWAYS" && t.push(e(k)), D.isPublic && t.push("Public"), q = t.join(" · ");
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ g(f, {
|
|
25
|
+
ref: B,
|
|
26
|
+
variant: "outlined",
|
|
27
|
+
className: r.dragSource,
|
|
28
|
+
"data-dragging": H,
|
|
29
|
+
sx: {
|
|
30
|
+
p: 1,
|
|
31
|
+
backgroundColor: "action.hover",
|
|
32
|
+
borderColor: K ? "error.main" : void 0
|
|
33
|
+
},
|
|
34
|
+
children: [/* @__PURE__ */ g(s, {
|
|
35
|
+
sx: {
|
|
36
|
+
display: "flex",
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
gap: .5
|
|
39
|
+
},
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ h(s, {
|
|
42
|
+
ref: V,
|
|
43
|
+
role: "button",
|
|
44
|
+
tabIndex: 0,
|
|
45
|
+
"aria-label": "Drag to reorder field",
|
|
46
|
+
className: r.dragHandle,
|
|
47
|
+
sx: { color: "text.secondary" },
|
|
48
|
+
children: /* @__PURE__ */ h(b, { fontSize: "small" })
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ h(d, {
|
|
51
|
+
size: "small",
|
|
52
|
+
onClick: () => z((e) => !e),
|
|
53
|
+
"aria-label": R ? "Collapse field" : "Expand field",
|
|
54
|
+
children: h(R ? x : S, { fontSize: "small" })
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ g(s, {
|
|
57
|
+
sx: {
|
|
58
|
+
flexGrow: 1,
|
|
59
|
+
minWidth: 0
|
|
60
|
+
},
|
|
61
|
+
children: [/* @__PURE__ */ h(m, {
|
|
62
|
+
variant: "body2",
|
|
63
|
+
noWrap: !0,
|
|
64
|
+
title: W,
|
|
65
|
+
children: W
|
|
66
|
+
}), /* @__PURE__ */ h(m, {
|
|
67
|
+
variant: "caption",
|
|
68
|
+
color: K ? "error" : "text.secondary",
|
|
69
|
+
children: q
|
|
70
|
+
})]
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ h(d, {
|
|
73
|
+
size: "small",
|
|
74
|
+
disabled: j,
|
|
75
|
+
onClick: F,
|
|
76
|
+
"aria-label": "Move field up",
|
|
77
|
+
children: /* @__PURE__ */ h(v, { fontSize: "small" })
|
|
78
|
+
}),
|
|
79
|
+
/* @__PURE__ */ h(d, {
|
|
80
|
+
size: "small",
|
|
81
|
+
disabled: M,
|
|
82
|
+
onClick: I,
|
|
83
|
+
"aria-label": "Move field down",
|
|
84
|
+
children: /* @__PURE__ */ h(_, { fontSize: "small" })
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ h(d, {
|
|
87
|
+
size: "small",
|
|
88
|
+
onClick: L,
|
|
89
|
+
"aria-label": "Remove field from step",
|
|
90
|
+
children: /* @__PURE__ */ h(y, { fontSize: "small" })
|
|
91
|
+
})
|
|
92
|
+
]
|
|
93
|
+
}), /* @__PURE__ */ h(l, {
|
|
94
|
+
in: R,
|
|
95
|
+
unmountOnExit: !0,
|
|
96
|
+
children: /* @__PURE__ */ g(p, {
|
|
97
|
+
spacing: 1,
|
|
98
|
+
sx: {
|
|
99
|
+
pt: 1,
|
|
100
|
+
pl: 4
|
|
101
|
+
},
|
|
102
|
+
children: [
|
|
103
|
+
G && /* @__PURE__ */ h(a, {
|
|
104
|
+
fileHandleId: D.templateFileHandleId,
|
|
105
|
+
formTemplateId: N,
|
|
106
|
+
onChange: (e) => P({ templateFileHandleId: e })
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ h(u, {
|
|
109
|
+
control: /* @__PURE__ */ h(c, {
|
|
110
|
+
checked: D.isPublic ?? !1,
|
|
111
|
+
onChange: (e) => P({ isPublic: e.target.checked })
|
|
112
|
+
}),
|
|
113
|
+
label: "Publicly viewable after approval"
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ h(m, {
|
|
116
|
+
variant: "caption",
|
|
117
|
+
color: "text.secondary",
|
|
118
|
+
children: "Answers appear in this AR's public submission info once a submission is approved. Snapshotted at submit time."
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { w as StepFieldRow };
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=StepFieldRow.js.map
|
|
@@ -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;KACL,MAAK;KACL,UAAU;KACV,cAAW;KACX,WAAW,EAAO;KAClB,IAAI,EAAE,OAAO,iBAAiB;eAE9B,kBAAC,GAAD,EAAgB,UAAS,QAAS,CAAA;IAC/B,CAAA;IACL,kBAAC,GAAD;KACE,MAAK;KACL,eAAe,GAAY,MAAQ,CAAC,CAAI;KACxC,cAAY,IAAW,mBAAmB;eAGxC,EADD,IACE,IAEA,GAFD,EAAgB,UAAS,QAAS,CAEA;IAE1B,CAAA;IACZ,kBAAC,GAAD;KAAK,IAAI;MAAE,UAAU;MAAG,UAAU;KAAE;eAApC,CACE,kBAAC,GAAD;MAAY,SAAQ;MAAQ,QAAA;MAAO,OAAO;gBACvC;KACS,CAAA,GACZ,kBAAC,GAAD;MACE,SAAQ;MACR,OAAO,IAAe,UAAU;gBAE/B;KACS,CAAA,CACT;;IACL,kBAAC,GAAD;KACE,MAAK;KACL,UAAU;KACV,SAAS;KACT,cAAW;eAEX,kBAAC,GAAD,EAAQ,UAAS,QAAS,CAAA;IAChB,CAAA;IACZ,kBAAC,GAAD;KACE,MAAK;KACL,UAAU;KACV,SAAS;KACT,cAAW;eAEX,kBAAC,GAAD,EAAU,UAAS,QAAS,CAAA;IAClB,CAAA;IACZ,kBAAC,GAAD;KACE,MAAK;KACL,SAAS;KACT,cAAW;eAEX,kBAAC,GAAD,EAAY,UAAS,QAAS,CAAA;IACpB,CAAA;GACT;MAEL,kBAAC,GAAD;GAAU,IAAI;GAAU,eAAA;aACtB,kBAAC,GAAD;IAAO,SAAS;IAAG,IAAI;KAAE,IAAI;KAAG,IAAI;IAAE;cAAtC;KACG,KACC,kBAAC,GAAD;MACE,cAAc,EAAM;MACJ;MAChB,WAAU,MAAQ,EAAS,EAAE,sBAAsB,EAAK,CAAC;KAC1D,CAAA;KAEH,kBAAC,GAAD;MACE,SACE,kBAAC,GAAD;OACE,SAAS,EAAM,YAAY;OAC3B,WAAU,MAAK,EAAS,EAAE,UAAU,EAAE,OAAO,QAAQ,CAAC;MACvD,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"}
|