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,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Alert as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { Close as
|
|
1
|
+
import { ChoiceOptionsEditor as e } from "./ChoiceOptionsEditor.js";
|
|
2
|
+
import { FIELD_TYPE_OPTIONS as t, applyFieldType as n, choiceOptions as r, detectFieldType as i, sanitizePropertyKey as a } from "./schemaFieldUtils.js";
|
|
3
|
+
import { useState as o } from "react";
|
|
4
|
+
import { Alert as s, Box as c, Button as l, Drawer as u, FormControlLabel as d, IconButton as f, MenuItem as p, Stack as m, Switch as h, TextField as g, Typography as _ } from "@mui/material";
|
|
5
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
6
|
+
import { Close as b, Delete as x } from "@mui/icons-material";
|
|
7
7
|
//#region src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx
|
|
8
|
-
var
|
|
8
|
+
var S = [
|
|
9
9
|
{
|
|
10
10
|
value: "ALWAYS",
|
|
11
11
|
label: "Always"
|
|
@@ -19,23 +19,23 @@ var x = [
|
|
|
19
19
|
label: "Renewal only"
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
|
-
function
|
|
23
|
-
let
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
22
|
+
function C({ open: C, propertyKey: w, existingKeys: T, property: E, isRequired: D, context: O, isUsedInSteps: k, onClose: A, onUpdate: j, onRenameKey: M, onReplace: N, onChangeRequired: P, onChangeContext: F, onRemove: I }) {
|
|
23
|
+
let L = E ? i(E) : null, R = E !== null && L === null, [z, B] = o(null), V = z?.forKey === w ? z.value : w ?? "", H = null;
|
|
24
|
+
V.length === 0 ? H = "Required" : V !== w && T.has(V) && (H = "Already used by another field");
|
|
25
|
+
let U = () => {
|
|
26
|
+
w && !H && V !== w && M(V), B(null);
|
|
27
|
+
}, W = (e) => {
|
|
28
|
+
E && N(n(E, e));
|
|
29
29
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
open:
|
|
32
|
-
onClose:
|
|
30
|
+
return /* @__PURE__ */ v(u, {
|
|
31
|
+
open: C,
|
|
32
|
+
onClose: A,
|
|
33
33
|
anchor: "right",
|
|
34
34
|
slotProps: { paper: { sx: { width: {
|
|
35
35
|
xs: "100%",
|
|
36
36
|
sm: 480
|
|
37
37
|
} } } },
|
|
38
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ y(c, {
|
|
39
39
|
sx: {
|
|
40
40
|
p: 3,
|
|
41
41
|
display: "flex",
|
|
@@ -43,137 +43,140 @@ function S({ open: S, propertyKey: C, existingKeys: w, property: T, isRequired:
|
|
|
43
43
|
height: "100%"
|
|
44
44
|
},
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
46
|
+
/* @__PURE__ */ y(c, {
|
|
47
47
|
sx: {
|
|
48
48
|
display: "flex",
|
|
49
49
|
alignItems: "center",
|
|
50
50
|
mb: 2
|
|
51
51
|
},
|
|
52
|
-
children: [/* @__PURE__ */ _
|
|
52
|
+
children: [/* @__PURE__ */ v(_, {
|
|
53
53
|
variant: "h6",
|
|
54
54
|
sx: { flexGrow: 1 },
|
|
55
55
|
children: "Edit field"
|
|
56
|
-
}), /* @__PURE__ */
|
|
57
|
-
onClick:
|
|
56
|
+
}), /* @__PURE__ */ v(f, {
|
|
57
|
+
onClick: A,
|
|
58
58
|
"aria-label": "Close field editor",
|
|
59
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ v(b, {})
|
|
60
60
|
})]
|
|
61
61
|
}),
|
|
62
|
-
|
|
62
|
+
w && /* @__PURE__ */ v(g, {
|
|
63
63
|
label: "Property key",
|
|
64
|
-
value:
|
|
65
|
-
onChange: (e) =>
|
|
66
|
-
forKey:
|
|
67
|
-
value:
|
|
64
|
+
value: V,
|
|
65
|
+
onChange: (e) => B({
|
|
66
|
+
forKey: w,
|
|
67
|
+
value: a(e.target.value)
|
|
68
68
|
}),
|
|
69
|
-
onBlur:
|
|
69
|
+
onBlur: U,
|
|
70
70
|
onKeyDown: (e) => {
|
|
71
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
71
|
+
e.key === "Enter" && (e.preventDefault(), U());
|
|
72
72
|
},
|
|
73
|
-
error:
|
|
74
|
-
helperText:
|
|
73
|
+
error: H !== null,
|
|
74
|
+
helperText: H ?? "Identifies this field in the JSON Schema and submitted requests.",
|
|
75
75
|
size: "small",
|
|
76
76
|
fullWidth: !0,
|
|
77
77
|
sx: { mb: 2 },
|
|
78
78
|
slotProps: { input: { sx: { fontFamily: "monospace" } } }
|
|
79
79
|
}),
|
|
80
|
-
|
|
80
|
+
E && /* @__PURE__ */ v(g, {
|
|
81
81
|
select: !0,
|
|
82
82
|
label: "Submission context",
|
|
83
|
-
value:
|
|
84
|
-
onChange: (e) =>
|
|
83
|
+
value: O,
|
|
84
|
+
onChange: (e) => F(e.target.value),
|
|
85
85
|
size: "small",
|
|
86
86
|
fullWidth: !0,
|
|
87
87
|
sx: { mb: 2 },
|
|
88
88
|
helperText: "Controls whether requesters are asked this question on an initial request, a renewal, or both.",
|
|
89
|
-
children:
|
|
89
|
+
children: S.map((e) => /* @__PURE__ */ v(p, {
|
|
90
90
|
value: e.value,
|
|
91
91
|
children: e.label
|
|
92
92
|
}, e.value))
|
|
93
93
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ v(c, {
|
|
95
95
|
sx: {
|
|
96
96
|
flexGrow: 1,
|
|
97
97
|
overflow: "auto"
|
|
98
98
|
},
|
|
99
|
-
children:
|
|
99
|
+
children: E ? R ? /* @__PURE__ */ v(s, {
|
|
100
100
|
severity: "warning",
|
|
101
101
|
variant: "outlined",
|
|
102
102
|
children: "This field uses settings not supported by the simple editor. Edit it via the advanced raw JSON Schema view."
|
|
103
|
-
}) : /* @__PURE__ */
|
|
103
|
+
}) : /* @__PURE__ */ y(m, {
|
|
104
104
|
spacing: 2,
|
|
105
105
|
children: [
|
|
106
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ v(g, {
|
|
107
107
|
label: "Question label",
|
|
108
|
-
value:
|
|
109
|
-
onChange: (e) =>
|
|
108
|
+
value: E.title ?? "",
|
|
109
|
+
onChange: (e) => j({ title: e.target.value }),
|
|
110
110
|
size: "small",
|
|
111
111
|
fullWidth: !0
|
|
112
112
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ v(g, {
|
|
114
114
|
label: "Help text",
|
|
115
|
-
value:
|
|
116
|
-
onChange: (e) =>
|
|
115
|
+
value: E.description ?? "",
|
|
116
|
+
onChange: (e) => j({ description: e.target.value }),
|
|
117
117
|
size: "small",
|
|
118
118
|
multiline: !0,
|
|
119
119
|
rows: 3,
|
|
120
120
|
fullWidth: !0,
|
|
121
121
|
helperText: "Shown to the requester below the question."
|
|
122
122
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ y(m, {
|
|
124
124
|
direction: "row",
|
|
125
125
|
spacing: 1,
|
|
126
126
|
alignItems: "center",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ v(g, {
|
|
128
128
|
select: !0,
|
|
129
129
|
label: "Field type",
|
|
130
|
-
value:
|
|
131
|
-
onChange: (e) =>
|
|
130
|
+
value: L,
|
|
131
|
+
onChange: (e) => W(e.target.value),
|
|
132
132
|
size: "small",
|
|
133
133
|
sx: { flexGrow: 1 },
|
|
134
|
-
children:
|
|
134
|
+
children: t.map((e) => /* @__PURE__ */ v(p, {
|
|
135
135
|
value: e.value,
|
|
136
136
|
children: e.label
|
|
137
137
|
}, e.value))
|
|
138
|
-
}), /* @__PURE__ */
|
|
139
|
-
control: /* @__PURE__ */
|
|
140
|
-
checked:
|
|
141
|
-
onChange: (e) =>
|
|
138
|
+
}), /* @__PURE__ */ v(d, {
|
|
139
|
+
control: /* @__PURE__ */ v(h, {
|
|
140
|
+
checked: D,
|
|
141
|
+
onChange: (e) => P(e.target.checked)
|
|
142
142
|
}),
|
|
143
143
|
label: "Required"
|
|
144
144
|
})]
|
|
145
145
|
}),
|
|
146
|
-
|
|
147
|
-
options:
|
|
148
|
-
onChange: (e) =>
|
|
146
|
+
(L === "choice" || L === "multiChoice") && /* @__PURE__ */ v(e, {
|
|
147
|
+
options: r(E),
|
|
148
|
+
onChange: (e) => j(L === "choice" ? { enum: e } : { items: {
|
|
149
|
+
...E.items,
|
|
150
|
+
enum: e
|
|
151
|
+
} })
|
|
149
152
|
}),
|
|
150
|
-
|
|
153
|
+
L === "file" && /* @__PURE__ */ v(s, {
|
|
151
154
|
severity: "info",
|
|
152
155
|
variant: "outlined",
|
|
153
156
|
children: "Requesters will be prompted to upload a file. You can attach a downloadable template to this field on each step that uses it."
|
|
154
157
|
})
|
|
155
158
|
]
|
|
156
|
-
}) : /* @__PURE__ */
|
|
159
|
+
}) : /* @__PURE__ */ v(s, {
|
|
157
160
|
severity: "info",
|
|
158
161
|
children: "No field selected."
|
|
159
162
|
})
|
|
160
163
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ y(c, {
|
|
162
165
|
sx: {
|
|
163
166
|
pt: 2,
|
|
164
167
|
display: "flex",
|
|
165
168
|
justifyContent: "space-between",
|
|
166
169
|
gap: 1
|
|
167
170
|
},
|
|
168
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ v(l, {
|
|
169
172
|
color: "error",
|
|
170
|
-
startIcon: /* @__PURE__ */
|
|
171
|
-
onClick:
|
|
172
|
-
disabled: !
|
|
173
|
-
children:
|
|
174
|
-
}), /* @__PURE__ */
|
|
173
|
+
startIcon: /* @__PURE__ */ v(x, {}),
|
|
174
|
+
onClick: I,
|
|
175
|
+
disabled: !E,
|
|
176
|
+
children: k ? "Delete (will remove from form)" : "Delete field"
|
|
177
|
+
}), /* @__PURE__ */ v(l, {
|
|
175
178
|
variant: "contained",
|
|
176
|
-
onClick:
|
|
179
|
+
onClick: A,
|
|
177
180
|
children: "Done"
|
|
178
181
|
})]
|
|
179
182
|
})
|
|
@@ -182,6 +185,6 @@ function S({ open: S, propertyKey: C, existingKeys: w, property: T, isRequired:
|
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
187
|
//#endregion
|
|
185
|
-
export {
|
|
188
|
+
export { C as FieldDefinitionDrawer };
|
|
186
189
|
|
|
187
190
|
//# sourceMappingURL=FieldDefinitionDrawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldDefinitionDrawer.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n Drawer,\n FormControlLabel,\n IconButton,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Close as CloseIcon, Delete as DeleteIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useState } from 'react'\nimport { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext'\nimport { ChoiceOptionsEditor } from './ChoiceOptionsEditor'\nimport {\n applyFieldType,\n detectFieldType,\n FIELD_TYPE_OPTIONS,\n sanitizePropertyKey,\n SimpleFieldType,\n} from './schemaFieldUtils'\n\nconst SUBMISSION_CONTEXT_OPTIONS: {\n value: SchemaPropertyContext\n label: string\n}[] = [\n { value: 'ALWAYS', label: 'Always' },\n { value: 'REQUEST_ONLY', label: 'Initial request only' },\n { value: 'RENEWAL_ONLY', label: 'Renewal only' },\n]\n\nexport type FieldDefinitionDrawerProps = {\n open: boolean\n propertyKey: string | null\n /** All property keys currently defined in the schema, including this one. */\n existingKeys: Set<string>\n property: RJSFSchema | null\n isRequired: boolean\n /**\n * Which submission context this property applies to (per the schema's\n * `x-synapse-submissionContext` `allOf` convention). Editable here via a guided select box.\n * This component only calls `onChangeContext`; a container elsewhere in the authoring flow is\n * responsible for moving the property's definition between the schema's top-level `properties`\n * and the matching `allOf` branch so ACT never has to hand-edit `allOf` for the common case.\n */\n context: SchemaPropertyContext\n /** True when this field is bound to one or more steps. Affects delete affordance. */\n isUsedInSteps: boolean\n onClose: () => void\n onUpdate: (patch: Partial<RJSFSchema>) => void\n onRenameKey: (newKey: string) => void\n onReplace: (next: RJSFSchema) => void\n onChangeRequired: (isRequired: boolean) => void\n onChangeContext: (context: SchemaPropertyContext) => void\n onRemove: () => void\n}\n\n/**\n * Slide-in drawer for editing a single field's JSON Schema definition (label, help text, type,\n * required, submission context, choice options, file format).\n */\nexport function FieldDefinitionDrawer({\n open,\n propertyKey,\n existingKeys,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClose,\n onUpdate,\n onRenameKey,\n onReplace,\n onChangeRequired,\n onChangeContext,\n onRemove,\n}: FieldDefinitionDrawerProps) {\n const type = property ? detectFieldType(property) : null\n const isAdvanced = property !== null && type === null\n\n // The draft exists only while the key is being edited, and is tagged with the key it was started\n // from. When `propertyKey` changes underneath it (switching fields, or the container re-slugging\n // the key from the label) the draft no longer applies and the prop is shown again.\n const [keyDraft, setKeyDraft] = useState<{\n forKey: string | null\n value: string\n } | null>(null)\n const displayedKey =\n keyDraft?.forKey === propertyKey ? keyDraft.value : (propertyKey ?? '')\n\n let keyError: string | null = null\n if (displayedKey.length === 0) {\n keyError = 'Required'\n } else if (displayedKey !== propertyKey && existingKeys.has(displayedKey)) {\n keyError = 'Already used by another field'\n }\n\n const commitKeyDraft = () => {\n if (propertyKey && !keyError && displayedKey !== propertyKey) {\n onRenameKey(displayedKey)\n }\n setKeyDraft(null)\n }\n\n const handleChangeType = (next: SimpleFieldType) => {\n if (!property) return\n onReplace(applyFieldType(property, next))\n }\n\n return (\n <Drawer\n open={open}\n onClose={onClose}\n anchor=\"right\"\n slotProps={{ paper: { sx: { width: { xs: '100%', sm: 480 } } } }}\n >\n <Box\n sx={{ p: 3, display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>\n <Typography variant=\"h6\" sx={{ flexGrow: 1 }}>\n Edit field\n </Typography>\n <IconButton onClick={onClose} aria-label=\"Close field editor\">\n <CloseIcon />\n </IconButton>\n </Box>\n\n {propertyKey && (\n <TextField\n label=\"Property key\"\n value={displayedKey}\n onChange={e =>\n setKeyDraft({\n forKey: propertyKey,\n value: sanitizePropertyKey(e.target.value),\n })\n }\n onBlur={commitKeyDraft}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n e.preventDefault()\n commitKeyDraft()\n }\n }}\n error={keyError !== null}\n helperText={\n keyError ??\n 'Identifies this field in the JSON Schema and submitted requests.'\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n slotProps={{ input: { sx: { fontFamily: 'monospace' } } }}\n />\n )}\n\n {property && (\n <TextField\n select\n label=\"Submission context\"\n value={context}\n onChange={e =>\n onChangeContext(e.target.value as SchemaPropertyContext)\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n helperText=\"Controls whether requesters are asked this question on an initial request, a renewal, or both.\"\n >\n {SUBMISSION_CONTEXT_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n\n <Box sx={{ flexGrow: 1, overflow: 'auto' }}>\n {!property ? (\n <Alert severity=\"info\">No field selected.</Alert>\n ) : isAdvanced ? (\n <Alert severity=\"warning\" variant=\"outlined\">\n This field uses settings not supported by the simple editor. Edit\n it via the advanced raw JSON Schema view.\n </Alert>\n ) : (\n <Stack spacing={2}>\n <TextField\n label=\"Question label\"\n value={property.title ?? ''}\n onChange={e => onUpdate({ title: e.target.value })}\n size=\"small\"\n fullWidth\n />\n <TextField\n label=\"Help text\"\n value={property.description ?? ''}\n onChange={e => onUpdate({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={3}\n fullWidth\n helperText=\"Shown to the requester below the question.\"\n />\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n select\n label=\"Field type\"\n value={type}\n onChange={e =>\n handleChangeType(e.target.value as SimpleFieldType)\n }\n size=\"small\"\n sx={{ flexGrow: 1 }}\n >\n {FIELD_TYPE_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n <FormControlLabel\n control={\n <Switch\n checked={isRequired}\n onChange={e => onChangeRequired(e.target.checked)}\n />\n }\n label=\"Required\"\n />\n </Stack>\n\n {type === 'choice' && (\n <ChoiceOptionsEditor\n options={(property.enum as string[] | undefined) ?? []}\n onChange={next => onUpdate({ enum: next })}\n />\n )}\n\n {type === 'file' && (\n <Alert severity=\"info\" variant=\"outlined\">\n Requesters will be prompted to upload a file. You can attach a\n downloadable template to this field on each step that uses it.\n </Alert>\n )}\n </Stack>\n )}\n </Box>\n\n <Box\n sx={{\n pt: 2,\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n }}\n >\n <Button\n color=\"error\"\n startIcon={<DeleteIcon />}\n onClick={onRemove}\n disabled={!property}\n >\n {isUsedInSteps ? 'Delete (will unbind from steps)' : 'Delete field'}\n </Button>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </Box>\n </Box>\n </Drawer>\n )\n}\n"],"mappings":";;;;;;;AA0BA,IAAM,IAGA;CACJ;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAgB,OAAO;CAAuB;CACvD;EAAE,OAAO;EAAgB,OAAO;CAAe;AACjD;AAgCA,SAAgB,EAAsB,EACpC,SACA,gBACA,iBACA,aACA,eACA,YACA,kBACA,YACA,aACA,gBACA,cACA,qBACA,oBACA,eAC6B;CAC7B,IAAM,IAAO,IAAW,EAAgB,CAAQ,IAAI,MAC9C,IAAa,MAAa,QAAQ,MAAS,MAK3C,CAAC,GAAU,K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ACE,SAAU,EAAS,QAAiC,CAAC;QACrD,WAAU,MAAQ,EAAS,EAAE,MAAM,EAAK,CAAC;OAC1C,CAAA;OAGF,MAAS,UACR,kBAAC,GAAD;QAAO,UAAS;QAAO,SAAQ;kBAAW;OAGnC,CAAA;MAEJ;UAlEP,kBAAC,GAAD;MAAO,UAAS;gBAAO;KAAyB,CAAA;IAoE/C,CAAA;IAEL,kBAAC,GAAD;KACE,IAAI;MACF,IAAI;MACJ,SAAS;MACT,gBAAgB;MAChB,KAAK;KACP;eANF,CAQE,kBAAC,GAAD;MACE,OAAM;MACN,WAAW,kBAAC,GAAD,CAAa,CAAA;MACxB,SAAS;MACT,UAAU,CAAC;gBAEV,IAAgB,oCAAoC;KAC/C,CAAA,GACR,kBAAC,GAAD;MAAQ,SAAQ;MAAY,SAAS;gBAAS;KAEtC,CAAA,CACL;;GACF;;CACC,CAAA;AAEZ"}
|
|
1
|
+
{"version":3,"file":"FieldDefinitionDrawer.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldDefinitionDrawer.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n Drawer,\n FormControlLabel,\n IconButton,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Close as CloseIcon, Delete as DeleteIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { useState } from 'react'\nimport { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext'\nimport { ChoiceOptionsEditor } from './ChoiceOptionsEditor'\nimport {\n applyFieldType,\n choiceOptions,\n detectFieldType,\n FIELD_TYPE_OPTIONS,\n sanitizePropertyKey,\n SimpleFieldType,\n} from './schemaFieldUtils'\n\nconst SUBMISSION_CONTEXT_OPTIONS: {\n value: SchemaPropertyContext\n label: string\n}[] = [\n { value: 'ALWAYS', label: 'Always' },\n { value: 'REQUEST_ONLY', label: 'Initial request only' },\n { value: 'RENEWAL_ONLY', label: 'Renewal only' },\n]\n\nexport type FieldDefinitionDrawerProps = {\n open: boolean\n propertyKey: string | null\n /** All property keys currently defined in the schema, including this one. */\n existingKeys: Set<string>\n property: RJSFSchema | null\n isRequired: boolean\n /**\n * Which submission context this property applies to (per the schema's\n * `x-synapse-submissionContext` `allOf` convention). Editable here via a guided select box.\n * This component only calls `onChangeContext`; a container elsewhere in the authoring flow is\n * responsible for moving the property's definition between the schema's top-level `properties`\n * and the matching `allOf` branch so ACT never has to hand-edit `allOf` for the common case.\n */\n context: SchemaPropertyContext\n /** True when this field is bound to one or more steps. Affects delete affordance. */\n isUsedInSteps: boolean\n onClose: () => void\n onUpdate: (patch: Partial<RJSFSchema>) => void\n onRenameKey: (newKey: string) => void\n onReplace: (next: RJSFSchema) => void\n onChangeRequired: (isRequired: boolean) => void\n onChangeContext: (context: SchemaPropertyContext) => void\n onRemove: () => void\n}\n\n/**\n * Slide-in drawer for editing a single field's JSON Schema definition (label, help text, type,\n * required, submission context, choice options, file format).\n */\nexport function FieldDefinitionDrawer({\n open,\n propertyKey,\n existingKeys,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClose,\n onUpdate,\n onRenameKey,\n onReplace,\n onChangeRequired,\n onChangeContext,\n onRemove,\n}: FieldDefinitionDrawerProps) {\n const type = property ? detectFieldType(property) : null\n const isAdvanced = property !== null && type === null\n\n // The draft exists only while the key is being edited, and is tagged with the key it was started\n // from. When `propertyKey` changes underneath it (switching fields, or the container re-slugging\n // the key from the label) the draft no longer applies and the prop is shown again.\n const [keyDraft, setKeyDraft] = useState<{\n forKey: string | null\n value: string\n } | null>(null)\n const displayedKey =\n keyDraft?.forKey === propertyKey ? keyDraft.value : (propertyKey ?? '')\n\n let keyError: string | null = null\n if (displayedKey.length === 0) {\n keyError = 'Required'\n } else if (displayedKey !== propertyKey && existingKeys.has(displayedKey)) {\n keyError = 'Already used by another field'\n }\n\n const commitKeyDraft = () => {\n if (propertyKey && !keyError && displayedKey !== propertyKey) {\n onRenameKey(displayedKey)\n }\n setKeyDraft(null)\n }\n\n const handleChangeType = (next: SimpleFieldType) => {\n if (!property) return\n onReplace(applyFieldType(property, next))\n }\n\n return (\n <Drawer\n open={open}\n onClose={onClose}\n anchor=\"right\"\n slotProps={{ paper: { sx: { width: { xs: '100%', sm: 480 } } } }}\n >\n <Box\n sx={{ p: 3, display: 'flex', flexDirection: 'column', height: '100%' }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', mb: 2 }}>\n <Typography variant=\"h6\" sx={{ flexGrow: 1 }}>\n Edit field\n </Typography>\n <IconButton onClick={onClose} aria-label=\"Close field editor\">\n <CloseIcon />\n </IconButton>\n </Box>\n\n {propertyKey && (\n <TextField\n label=\"Property key\"\n value={displayedKey}\n onChange={e =>\n setKeyDraft({\n forKey: propertyKey,\n value: sanitizePropertyKey(e.target.value),\n })\n }\n onBlur={commitKeyDraft}\n onKeyDown={e => {\n if (e.key === 'Enter') {\n e.preventDefault()\n commitKeyDraft()\n }\n }}\n error={keyError !== null}\n helperText={\n keyError ??\n 'Identifies this field in the JSON Schema and submitted requests.'\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n slotProps={{ input: { sx: { fontFamily: 'monospace' } } }}\n />\n )}\n\n {property && (\n <TextField\n select\n label=\"Submission context\"\n value={context}\n onChange={e =>\n onChangeContext(e.target.value as SchemaPropertyContext)\n }\n size=\"small\"\n fullWidth\n sx={{ mb: 2 }}\n helperText=\"Controls whether requesters are asked this question on an initial request, a renewal, or both.\"\n >\n {SUBMISSION_CONTEXT_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n )}\n\n <Box sx={{ flexGrow: 1, overflow: 'auto' }}>\n {!property ? (\n <Alert severity=\"info\">No field selected.</Alert>\n ) : isAdvanced ? (\n <Alert severity=\"warning\" variant=\"outlined\">\n This field uses settings not supported by the simple editor. Edit\n it via the advanced raw JSON Schema view.\n </Alert>\n ) : (\n <Stack spacing={2}>\n <TextField\n label=\"Question label\"\n value={property.title ?? ''}\n onChange={e => onUpdate({ title: e.target.value })}\n size=\"small\"\n fullWidth\n />\n <TextField\n label=\"Help text\"\n value={property.description ?? ''}\n onChange={e => onUpdate({ description: e.target.value })}\n size=\"small\"\n multiline\n rows={3}\n fullWidth\n helperText=\"Shown to the requester below the question.\"\n />\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n select\n label=\"Field type\"\n value={type}\n onChange={e =>\n handleChangeType(e.target.value as SimpleFieldType)\n }\n size=\"small\"\n sx={{ flexGrow: 1 }}\n >\n {FIELD_TYPE_OPTIONS.map(opt => (\n <MenuItem key={opt.value} value={opt.value}>\n {opt.label}\n </MenuItem>\n ))}\n </TextField>\n <FormControlLabel\n control={\n <Switch\n checked={isRequired}\n onChange={e => onChangeRequired(e.target.checked)}\n />\n }\n label=\"Required\"\n />\n </Stack>\n\n {(type === 'choice' || type === 'multiChoice') && (\n <ChoiceOptionsEditor\n options={choiceOptions(property)}\n onChange={next =>\n type === 'choice'\n ? onUpdate({ enum: next })\n : onUpdate({\n items: {\n ...(property.items as RJSFSchema),\n enum: next,\n },\n })\n }\n />\n )}\n\n {type === 'file' && (\n <Alert severity=\"info\" variant=\"outlined\">\n Requesters will be prompted to upload a file. You can attach a\n downloadable template to this field on each step that uses it.\n </Alert>\n )}\n </Stack>\n )}\n </Box>\n\n <Box\n sx={{\n pt: 2,\n display: 'flex',\n justifyContent: 'space-between',\n gap: 1,\n }}\n >\n <Button\n color=\"error\"\n startIcon={<DeleteIcon />}\n onClick={onRemove}\n disabled={!property}\n >\n {isUsedInSteps ? 'Delete (will remove from form)' : 'Delete field'}\n </Button>\n <Button variant=\"contained\" onClick={onClose}>\n Done\n </Button>\n </Box>\n </Box>\n </Drawer>\n )\n}\n"],"mappings":";;;;;;;AA2BA,IAAM,IAGA;CACJ;EAAE,OAAO;EAAU,OAAO;CAAS;CACnC;EAAE,OAAO;EAAgB,OAAO;CAAuB;CACvD;EAAE,OAAO;EAAgB,OAAO;CAAe;A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AI;SACG,GAFK,EAAI,KAET,CACX;QACQ,CAAA,GACX,kBAAC,GAAD;SACE,SACE,kBAAC,GAAD;UACE,SAAS;UACT,WAAU,MAAK,EAAiB,EAAE,OAAO,OAAO;SACjD,CAAA;SAEH,OAAM;QACP,CAAA,CACI;;QAEL,MAAS,YAAY,MAAS,kBAC9B,kBAAC,GAAD;QACE,SAAS,EAAc,CAAQ;QAC/B,WAAU,MAEJ,EADJ,MAAS,WACI,EAAE,MAAM,EAAK,IACb,EACP,OAAO;SACL,GAAI,EAAS;SACb,MAAM;QACR,EACF,CAAC;OAER,CAAA;OAGF,MAAS,UACR,kBAAC,GAAD;QAAO,UAAS;QAAO,SAAQ;kBAAW;OAGnC,CAAA;MAEJ;UA3EP,kBAAC,GAAD;MAAO,UAAS;gBAAO;KAAyB,CAAA;IA6E/C,CAAA;IAEL,kBAAC,GAAD;KACE,IAAI;MACF,IAAI;MACJ,SAAS;MACT,gBAAgB;MAChB,KAAK;KACP;eANF,CAQE,kBAAC,GAAD;MACE,OAAM;MACN,WAAW,kBAAC,GAAD,CAAa,CAAA;MACxB,SAAS;MACT,UAAU,CAAC;gBAEV,IAAgB,mCAAmC;KAC9C,CAAA,GACR,kBAAC,GAAD;MAAQ,SAAQ;MAAY,SAAS;gBAAS;KAEtC,CAAA,CACL;;GACF;;CACC,CAAA;AAEZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._selectedRow_4haeg_1{outline-offset:-2px;border-radius:4px;outline:2px solid #0000}._selectedRow_4haeg_1[data-selected=true]{outline-color:var(--synapse-primary-action-color)}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
export type FieldLibraryProps = {
|
|
3
|
+
jsonSchema: RJSFSchema;
|
|
4
|
+
/** Set of JSON pointers (e.g. `/institution`) currently bound to a step. */
|
|
5
|
+
usedPaths: Set<string>;
|
|
6
|
+
selectedPropertyKey: string | null;
|
|
7
|
+
onSelectField: (propertyKey: string) => void;
|
|
8
|
+
onCreateField: () => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Left pane: a compact list of all schema properties (the "fields" the form
|
|
12
|
+
* collects) -- both unconditional and any gated behind an
|
|
13
|
+
* `x-synapse-submissionContext` conditional. Each row is clickable and opens
|
|
14
|
+
* the field definition drawer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function FieldLibrary({ jsonSchema, usedPaths, selectedPropertyKey, onSelectField, onCreateField, }: FieldLibraryProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=FieldLibrary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AASxC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,UAAU,EAAE,UAAU,CAAA;IACtB,4EAA4E;IAC5E,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACtB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,aAAa,EAAE,MAAM,IAAI,CAAA;CAC1B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,aAAa,GACd,EAAE,iBAAiB,2CA4FnB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { listResolvedSchemaProperties as e, propertyKeyToPointer as t } from "../../utils/jsonschema/submissionContext.js";
|
|
2
|
+
import { FieldLibraryRow as n } from "./FieldLibraryRow.js";
|
|
3
|
+
import r from "./FieldLibrary.module.js";
|
|
4
|
+
import { useMemo as i, useState as a } from "react";
|
|
5
|
+
import { Alert as o, Box as s, Button as c, InputAdornment as l, Paper as u, Stack as d, TextField as f, Typography as p } from "@mui/material";
|
|
6
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
|
+
import { Add as g, Search as _ } from "@mui/icons-material";
|
|
8
|
+
//#region src/components/FormTemplateEditor/FieldLibrary.tsx
|
|
9
|
+
function v({ jsonSchema: v, usedPaths: y, selectedPropertyKey: b, onSelectField: x, onCreateField: S }) {
|
|
10
|
+
let [C, w] = a(""), T = i(() => e(v), [v]), E = i(() => {
|
|
11
|
+
if (!C) return T;
|
|
12
|
+
let e = C.toLowerCase();
|
|
13
|
+
return T.filter((t) => `${t.propertyKey} ${t.subSchema.title ?? ""}`.toLowerCase().includes(e));
|
|
14
|
+
}, [T, C]), D;
|
|
15
|
+
return D = T.length === 0 ? /* @__PURE__ */ m(o, {
|
|
16
|
+
severity: "info",
|
|
17
|
+
children: "No fields yet. Click \"New\" to start collecting information."
|
|
18
|
+
}) : E.length === 0 ? /* @__PURE__ */ h(o, {
|
|
19
|
+
severity: "info",
|
|
20
|
+
children: [
|
|
21
|
+
"No fields match \"",
|
|
22
|
+
C,
|
|
23
|
+
"\"."
|
|
24
|
+
]
|
|
25
|
+
}) : /* @__PURE__ */ m(d, {
|
|
26
|
+
spacing: .75,
|
|
27
|
+
children: E.map((e) => /* @__PURE__ */ m(s, {
|
|
28
|
+
className: r.selectedRow,
|
|
29
|
+
"data-selected": b === e.propertyKey,
|
|
30
|
+
children: /* @__PURE__ */ m(n, {
|
|
31
|
+
propertyKey: e.propertyKey,
|
|
32
|
+
property: e.subSchema,
|
|
33
|
+
isRequired: e.isRequired,
|
|
34
|
+
context: e.context,
|
|
35
|
+
isUsedInSteps: y.has(t(e.propertyKey)),
|
|
36
|
+
onClick: () => x(e.propertyKey)
|
|
37
|
+
})
|
|
38
|
+
}, e.propertyKey))
|
|
39
|
+
}), /* @__PURE__ */ h(u, {
|
|
40
|
+
variant: "outlined",
|
|
41
|
+
sx: {
|
|
42
|
+
p: 2,
|
|
43
|
+
height: "100%"
|
|
44
|
+
},
|
|
45
|
+
children: [/* @__PURE__ */ h(s, {
|
|
46
|
+
sx: { mb: 1 },
|
|
47
|
+
children: [/* @__PURE__ */ m(p, {
|
|
48
|
+
variant: "subtitle2",
|
|
49
|
+
children: "Fields"
|
|
50
|
+
}), /* @__PURE__ */ m(p, {
|
|
51
|
+
variant: "caption",
|
|
52
|
+
color: "text.secondary",
|
|
53
|
+
children: "Define the data you want to collect. Click a field to edit it."
|
|
54
|
+
})]
|
|
55
|
+
}), /* @__PURE__ */ h(d, {
|
|
56
|
+
spacing: 1.5,
|
|
57
|
+
children: [/* @__PURE__ */ h(d, {
|
|
58
|
+
direction: "row",
|
|
59
|
+
spacing: 1,
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
children: [/* @__PURE__ */ m(f, {
|
|
62
|
+
placeholder: "Search fields…",
|
|
63
|
+
value: C,
|
|
64
|
+
onChange: (e) => w(e.target.value),
|
|
65
|
+
size: "small",
|
|
66
|
+
fullWidth: !0,
|
|
67
|
+
slotProps: {
|
|
68
|
+
input: { startAdornment: /* @__PURE__ */ m(l, {
|
|
69
|
+
position: "start",
|
|
70
|
+
children: /* @__PURE__ */ m(_, { fontSize: "small" })
|
|
71
|
+
}) },
|
|
72
|
+
htmlInput: { "aria-label": "Search fields" }
|
|
73
|
+
}
|
|
74
|
+
}), /* @__PURE__ */ m(c, {
|
|
75
|
+
size: "small",
|
|
76
|
+
variant: "outlined",
|
|
77
|
+
startIcon: /* @__PURE__ */ m(g, {}),
|
|
78
|
+
onClick: S,
|
|
79
|
+
children: "New"
|
|
80
|
+
})]
|
|
81
|
+
}), D]
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
export { v as FieldLibrary };
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=FieldLibrary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLibrary.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibrary.tsx"],"sourcesContent":["import {\n Alert,\n Box,\n Button,\n InputAdornment,\n Paper,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { Add as AddIcon, Search as SearchIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport { ReactNode, useMemo, useState } from 'react'\nimport {\n listResolvedSchemaProperties,\n propertyKeyToPointer,\n} from '@/utils/jsonschema/submissionContext'\nimport { FieldLibraryRow } from './FieldLibraryRow'\nimport fieldLibraryStyles from './FieldLibrary.module.scss'\n\nexport type FieldLibraryProps = {\n jsonSchema: RJSFSchema\n /** Set of JSON pointers (e.g. `/institution`) currently bound to a step. */\n usedPaths: Set<string>\n selectedPropertyKey: string | null\n onSelectField: (propertyKey: string) => void\n onCreateField: () => void\n}\n\n/**\n * Left pane: a compact list of all schema properties (the \"fields\" the form\n * collects) -- both unconditional and any gated behind an\n * `x-synapse-submissionContext` conditional. Each row is clickable and opens\n * the field definition drawer.\n */\nexport function FieldLibrary({\n jsonSchema,\n usedPaths,\n selectedPropertyKey,\n onSelectField,\n onCreateField,\n}: FieldLibraryProps) {\n const [search, setSearch] = useState('')\n\n const resolvedProperties = useMemo(\n () => listResolvedSchemaProperties(jsonSchema),\n [jsonSchema],\n )\n\n const filtered = useMemo(() => {\n if (!search) return resolvedProperties\n const searchTerm = search.toLowerCase()\n return resolvedProperties.filter(p => {\n const entryAsString =\n `${p.propertyKey} ${p.subSchema.title ?? ''}`.toLowerCase()\n return entryAsString.includes(searchTerm)\n })\n }, [resolvedProperties, search])\n\n let fieldList: ReactNode\n if (resolvedProperties.length === 0) {\n fieldList = (\n <Alert severity=\"info\">\n No fields yet. Click \"New\" to start collecting information.\n </Alert>\n )\n } else if (filtered.length === 0) {\n fieldList = <Alert severity=\"info\">No fields match \"{search}\".</Alert>\n } else {\n fieldList = (\n <Stack spacing={0.75}>\n {filtered.map(p => (\n <Box\n key={p.propertyKey}\n className={fieldLibraryStyles.selectedRow}\n data-selected={selectedPropertyKey === p.propertyKey}\n >\n <FieldLibraryRow\n propertyKey={p.propertyKey}\n property={p.subSchema}\n isRequired={p.isRequired}\n context={p.context}\n isUsedInSteps={usedPaths.has(propertyKeyToPointer(p.propertyKey))}\n onClick={() => onSelectField(p.propertyKey)}\n />\n </Box>\n ))}\n </Stack>\n )\n }\n\n return (\n <Paper variant=\"outlined\" sx={{ p: 2, height: '100%' }}>\n <Box sx={{ mb: 1 }}>\n <Typography variant=\"subtitle2\">Fields</Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Define the data you want to collect. Click a field to edit it.\n </Typography>\n </Box>\n\n <Stack spacing={1.5}>\n <Stack direction=\"row\" spacing={1} alignItems=\"center\">\n <TextField\n placeholder=\"Search fields…\"\n value={search}\n onChange={e => setSearch(e.target.value)}\n size=\"small\"\n fullWidth\n slotProps={{\n input: {\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon fontSize=\"small\" />\n </InputAdornment>\n ),\n },\n htmlInput: { 'aria-label': 'Search fields' },\n }}\n />\n <Button\n size=\"small\"\n variant=\"outlined\"\n startIcon={<AddIcon />}\n onClick={onCreateField}\n >\n New\n </Button>\n </Stack>\n\n {fieldList}\n </Stack>\n </Paper>\n )\n}\n"],"mappings":";;;;;;;;AAmCA,SAAgB,EAAa,EAC3B,eACA,cACA,wBACA,kBACA,oBACoB;CACpB,IAAM,CAAC,GAAQ,KAAa,EAAS,EAAE,GAEjC,IAAqB,QACnB,EAA6B,CAAU,GAC7C,CAAC,CAAU,CACb,GAEM,IAAW,QAAc;EAC7B,IAAI,CAAC,GAAQ,OAAO;EACpB,IAAM,IAAa,EAAO,YAAY;EACtC,OAAO,EAAmB,QAAO,MAE7B,GAAG,EAAE,YAAY,GAAG,EAAE,UAAU,SAAS,KAAK,YACzC,EAAc,SAAS,CAAU,CACzC;CACH,GAAG,CAAC,GAAoB,CAAM,CAAC,GAE3B;CAgCJ,OA/BA,AASE,IATE,EAAmB,WAAW,IA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EX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLibrary.module.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibrary.module.scss"],"sourcesContent":["// Highlight for the field-library row matching the currently selected property.\n// Toggled with `data-selected` so the component only reports state and the look lives here,\n// matching the pattern used by dropTarget.module.scss.\n.selectedRow {\n outline: 2px solid transparent;\n outline-offset: -2px;\n border-radius: 4px;\n\n &[data-selected='true'] {\n outline-color: var(--synapse-primary-action-color);\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Highlight for the field-library row matching the currently selected property.
|
|
2
|
+
// Toggled with `data-selected` so the component only reports state and the look lives here,
|
|
3
|
+
// matching the pattern used by dropTarget.module.scss.
|
|
4
|
+
.selectedRow {
|
|
5
|
+
outline: 2px solid transparent;
|
|
6
|
+
outline-offset: -2px;
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
|
|
9
|
+
&[data-selected='true'] {
|
|
10
|
+
outline-color: var(--synapse-primary-action-color);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RJSFSchema } from '@rjsf/utils';
|
|
2
|
+
import { SchemaPropertyContext } from '@/utils/jsonschema/submissionContext';
|
|
3
|
+
export type FieldLibraryRowProps = {
|
|
4
|
+
propertyKey: string;
|
|
5
|
+
property: RJSFSchema;
|
|
6
|
+
isRequired: boolean;
|
|
7
|
+
/** Which submission context (per the schema's `x-synapse-submissionContext` convention)
|
|
8
|
+
* gates this property. `ALWAYS` properties show no badge. */
|
|
9
|
+
context: SchemaPropertyContext;
|
|
10
|
+
isUsedInSteps: boolean;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A compact row in the field library. Click anywhere to edit the field's
|
|
15
|
+
* definition; grab the drag indicator on the left to bind it to a step.
|
|
16
|
+
* Rows already bound to a step are non-draggable.
|
|
17
|
+
*/
|
|
18
|
+
export declare function FieldLibraryRow({ propertyKey, property, isRequired, context, isUsedInSteps, onClick, }: FieldLibraryRowProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=FieldLibraryRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLibraryRow.d.ts","sourceRoot":"","sources":["../../../src/components/FormTemplateEditor/FieldLibraryRow.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EACL,qBAAqB,EAEtB,MAAM,sCAAsC,CAAA;AAK7C,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,UAAU,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB;iEAC6D;IAC7D,OAAO,EAAE,qBAAqB,CAAA;IAC9B,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,QAAQ,EACR,UAAU,EACV,OAAO,EACP,aAAa,EACb,OAAO,GACR,EAAE,oBAAoB,2CA6GtB"}
|
|
@@ -0,0 +1,115 @@
|
|
|
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 { FIELD_DRAG_TYPE as i, fieldDragData as a } from "./sortableIds.js";
|
|
5
|
+
import { Box as o, Chip as s, Paper as c, Stack as l, Typography as u } from "@mui/material";
|
|
6
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { DragIndicator as m } from "@mui/icons-material";
|
|
8
|
+
import { useDraggable as h } from "@dnd-kit/react";
|
|
9
|
+
//#region src/components/FormTemplateEditor/FieldLibraryRow.tsx
|
|
10
|
+
function g({ propertyKey: g, property: _, isRequired: v, context: y, isUsedInSteps: b, onClick: x }) {
|
|
11
|
+
let S = t(_), C = _.title || g, { ref: w, handleRef: T, isDragging: E } = h({
|
|
12
|
+
id: `field:${g}`,
|
|
13
|
+
type: i,
|
|
14
|
+
data: a(g),
|
|
15
|
+
disabled: b
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ f(c, {
|
|
18
|
+
ref: w,
|
|
19
|
+
variant: "outlined",
|
|
20
|
+
className: r.dragSource,
|
|
21
|
+
"data-dragging": E,
|
|
22
|
+
sx: { p: 1.25 },
|
|
23
|
+
children: /* @__PURE__ */ p(o, {
|
|
24
|
+
sx: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
gap: .5
|
|
28
|
+
},
|
|
29
|
+
children: [/* @__PURE__ */ f(o, {
|
|
30
|
+
ref: T,
|
|
31
|
+
role: "button",
|
|
32
|
+
tabIndex: b ? -1 : 0,
|
|
33
|
+
"aria-label": b ? "Already in a form step" : "Drag to add to a step",
|
|
34
|
+
className: r.dragHandle,
|
|
35
|
+
sx: {
|
|
36
|
+
color: b ? "text.disabled" : "text.secondary",
|
|
37
|
+
cursor: b ? "not-allowed" : void 0
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ f(m, { fontSize: "small" })
|
|
40
|
+
}), /* @__PURE__ */ p(o, {
|
|
41
|
+
role: "button",
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
"aria-label": `Edit ${C}`,
|
|
44
|
+
onClick: x,
|
|
45
|
+
onKeyDown: (e) => {
|
|
46
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), x());
|
|
47
|
+
},
|
|
48
|
+
sx: {
|
|
49
|
+
flexGrow: 1,
|
|
50
|
+
minWidth: 0,
|
|
51
|
+
display: "flex",
|
|
52
|
+
alignItems: "center",
|
|
53
|
+
gap: .5,
|
|
54
|
+
cursor: "pointer",
|
|
55
|
+
borderRadius: 1,
|
|
56
|
+
p: .5,
|
|
57
|
+
m: -.5,
|
|
58
|
+
"&:hover": { backgroundColor: "action.hover" }
|
|
59
|
+
},
|
|
60
|
+
children: [/* @__PURE__ */ p(o, {
|
|
61
|
+
sx: {
|
|
62
|
+
flexGrow: 1,
|
|
63
|
+
minWidth: 0
|
|
64
|
+
},
|
|
65
|
+
children: [/* @__PURE__ */ f(u, {
|
|
66
|
+
variant: "body2",
|
|
67
|
+
fontWeight: 500,
|
|
68
|
+
noWrap: !0,
|
|
69
|
+
title: C,
|
|
70
|
+
children: C
|
|
71
|
+
}), /* @__PURE__ */ p(l, {
|
|
72
|
+
direction: "row",
|
|
73
|
+
spacing: .5,
|
|
74
|
+
alignItems: "center",
|
|
75
|
+
sx: { mt: .25 },
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ f(u, {
|
|
78
|
+
variant: "caption",
|
|
79
|
+
color: "text.secondary",
|
|
80
|
+
children: n(S)
|
|
81
|
+
}),
|
|
82
|
+
v && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(u, {
|
|
83
|
+
variant: "caption",
|
|
84
|
+
color: "text.secondary",
|
|
85
|
+
children: "·"
|
|
86
|
+
}), /* @__PURE__ */ f(u, {
|
|
87
|
+
variant: "caption",
|
|
88
|
+
color: "text.secondary",
|
|
89
|
+
children: "Required"
|
|
90
|
+
})] }),
|
|
91
|
+
y !== "ALWAYS" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(u, {
|
|
92
|
+
variant: "caption",
|
|
93
|
+
color: "text.secondary",
|
|
94
|
+
children: "·"
|
|
95
|
+
}), /* @__PURE__ */ f(u, {
|
|
96
|
+
variant: "caption",
|
|
97
|
+
color: "text.secondary",
|
|
98
|
+
children: e(y)
|
|
99
|
+
})] })
|
|
100
|
+
]
|
|
101
|
+
})]
|
|
102
|
+
}), /* @__PURE__ */ f(s, {
|
|
103
|
+
label: b ? "In form" : "Not in form",
|
|
104
|
+
size: "small",
|
|
105
|
+
color: b ? "success" : "warning",
|
|
106
|
+
variant: "outlined"
|
|
107
|
+
})]
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { g as FieldLibraryRow };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=FieldLibraryRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldLibraryRow.js","names":[],"sources":["../../../src/components/FormTemplateEditor/FieldLibraryRow.tsx"],"sourcesContent":["import { useDraggable } from '@dnd-kit/react'\nimport { Box, Chip, Paper, Stack, Typography } from '@mui/material'\nimport { DragIndicator as DragHandleIcon } from '@mui/icons-material'\nimport { RJSFSchema } from '@rjsf/utils'\nimport {\n SchemaPropertyContext,\n submissionContextLabel,\n} from '@/utils/jsonschema/submissionContext'\nimport styles from './dragHandle.module.scss'\nimport { detectFieldType, fieldTypeLabel } from './schemaFieldUtils'\nimport { FIELD_DRAG_TYPE, fieldDragData } from './sortableIds'\n\nexport type FieldLibraryRowProps = {\n propertyKey: string\n property: RJSFSchema\n isRequired: boolean\n /** Which submission context (per the schema's `x-synapse-submissionContext` convention)\n * gates this property. `ALWAYS` properties show no badge. */\n context: SchemaPropertyContext\n isUsedInSteps: boolean\n onClick: () => void\n}\n\n/**\n * A compact row in the field library. Click anywhere to edit the field's\n * definition; grab the drag indicator on the left to bind it to a step.\n * Rows already bound to a step are non-draggable.\n */\nexport function FieldLibraryRow({\n propertyKey,\n property,\n isRequired,\n context,\n isUsedInSteps,\n onClick,\n}: FieldLibraryRowProps) {\n const type = detectFieldType(property)\n const displayLabel = property.title || propertyKey\n\n const { ref, handleRef, isDragging } = useDraggable({\n id: `field:${propertyKey}`,\n type: FIELD_DRAG_TYPE,\n data: fieldDragData(propertyKey),\n disabled: isUsedInSteps,\n })\n\n return (\n <Paper\n ref={ref}\n variant=\"outlined\"\n className={styles.dragSource}\n data-dragging={isDragging}\n sx={{ p: 1.25 }}\n >\n <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5 }}>\n <Box\n ref={handleRef}\n role=\"button\"\n tabIndex={isUsedInSteps ? -1 : 0}\n aria-label={\n isUsedInSteps ? 'Already in a form step' : 'Drag to add to a step'\n }\n className={styles.dragHandle}\n sx={{\n color: isUsedInSteps ? 'text.disabled' : 'text.secondary',\n cursor: isUsedInSteps ? 'not-allowed' : undefined,\n }}\n >\n <DragHandleIcon fontSize=\"small\" />\n </Box>\n <Box\n role=\"button\"\n tabIndex={0}\n aria-label={`Edit ${displayLabel}`}\n onClick={onClick}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onClick()\n }\n }}\n sx={{\n flexGrow: 1,\n minWidth: 0,\n display: 'flex',\n alignItems: 'center',\n gap: 0.5,\n cursor: 'pointer',\n borderRadius: 1,\n p: 0.5,\n m: -0.5,\n '&:hover': { backgroundColor: 'action.hover' },\n }}\n >\n <Box sx={{ flexGrow: 1, minWidth: 0 }}>\n <Typography\n variant=\"body2\"\n fontWeight={500}\n noWrap\n title={displayLabel}\n >\n {displayLabel}\n </Typography>\n <Stack\n direction=\"row\"\n spacing={0.5}\n alignItems=\"center\"\n sx={{ mt: 0.25 }}\n >\n <Typography variant=\"caption\" color=\"text.secondary\">\n {fieldTypeLabel(type)}\n </Typography>\n {isRequired && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n Required\n </Typography>\n </>\n )}\n {context !== 'ALWAYS' && (\n <>\n <Typography variant=\"caption\" color=\"text.secondary\">\n ·\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {submissionContextLabel(context)}\n </Typography>\n </>\n )}\n </Stack>\n </Box>\n <Chip\n label={isUsedInSteps ? 'In form' : 'Not in form'}\n size=\"small\"\n color={isUsedInSteps ? 'success' : 'warning'}\n variant=\"outlined\"\n />\n </Box>\n </Box>\n </Pa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