@leav/ui 0.4.0-049caba → 0.4.0-11bc990
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/__mocks__/common/value.d.ts +1 -2
- package/dist/__mocks__/common/value.js +0 -11
- package/dist/__mocks__/common/value.js.map +1 -1
- package/dist/_gqlTypes/index.d.ts +8 -0
- package/dist/_gqlTypes/index.js +2 -0
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
- package/dist/components/ErrorBoundary/ErrorBoundaryContent/ErrorBoundaryContent.d.ts +2 -2
- package/dist/components/ErrorBoundary/ErrorBoundaryContent/ErrorBoundaryContent.js +4 -3
- package/dist/components/ErrorBoundary/ErrorBoundaryContent/ErrorBoundaryContent.js.map +1 -1
- package/dist/components/Explorer/DataView.js +17 -4
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +1 -0
- package/dist/components/Explorer/Explorer.js +7 -4
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/TableCell.js +3 -3
- package/dist/components/Explorer/TableCell.js.map +1 -1
- package/dist/components/Explorer/TableTagGroup.d.ts +0 -1
- package/dist/components/Explorer/TableTagGroup.js +3 -16
- package/dist/components/Explorer/TableTagGroup.js.map +1 -1
- package/dist/components/Explorer/_constants.d.ts +3 -0
- package/dist/components/Explorer/_constants.js +3 -0
- package/dist/components/Explorer/_constants.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +1 -0
- package/dist/components/Explorer/actions-item/useEditItemAction.d.ts +2 -1
- package/dist/components/Explorer/actions-item/useEditItemAction.js +4 -2
- package/dist/components/Explorer/actions-item/useEditItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +3 -3
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +2 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +4 -2
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +19 -3
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.js +2 -1
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/useColumnWidth.js +2 -1
- package/dist/components/Explorer/useColumnWidth.js.map +1 -1
- package/dist/components/Explorer/usePagination.d.ts +2 -1
- package/dist/components/Explorer/usePagination.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.d.ts +3 -1
- package/dist/components/Explorer/useSearchInput.js +2 -1
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.d.ts +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.js +30 -16
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js +1 -1
- package/dist/components/ImportModal/ImportModalConfigStep/ImportModalConfigStep.js.map +1 -1
- package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js +1 -0
- package/dist/components/LibraryItemsList/CreateNewRecordButton/CreateNewRecordButton.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.d.ts +4 -0
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.js +4 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +24 -13
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +3 -3
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +5 -0
- package/dist/components/RecordEdition/EditRecordContent/_types.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/formConstants.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordContent/formConstants.js +1 -0
- package/dist/components/RecordEdition/EditRecordContent/formConstants.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Container/Container.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.d.ts +7 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +100 -92
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.d.ts +5 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js +39 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.d.ts +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js +23 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.d.ts +9 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js +23 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.d.ts +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js +26 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.d.ts +12 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js +24 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.d.ts +19 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js +103 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.d.ts +22 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js +104 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecords.d.ts +22 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecords.js +85 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.d.ts +26 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js +105 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.d.ts +265 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.js +13 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/ExplorerWrapper.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.d.ts +9 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js +15 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.d.ts +4 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js +22 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +34 -47
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSBooleanWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +2 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.d.ts +2 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js +2 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/StandardFieldValue.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js +2 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/DSListSelect.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/_types.d.ts +1 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +67 -215
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.d.ts +265 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.js +13 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.d.ts +10 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +51 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.d.ts +11 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +15 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +44 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +23 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +145 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/{StandardField → shared}/ComputeIndicator.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/DeleteAllValuesButton.d.ts +8 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/{StandardField → shared}/DeleteAllValuesButton.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/DeleteAllValuesButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/calculatedInheritedFlags.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.d.ts +17 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js +76 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.d.ts +1 -0
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +55 -50
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +6 -3
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +6 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js +3 -0
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.js.map +1 -1
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +2 -2
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +22 -3
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js.map +1 -1
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.d.ts +1 -1
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js +3 -3
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.js.map +1 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +1 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +3 -3
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +3 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.js +4 -4
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +3 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +14 -6
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContentSkeleton.d.ts +2 -0
- package/dist/components/SelectTreeNode/SelectTreeNodeContentSkeleton.js +17 -0
- package/dist/components/SelectTreeNode/SelectTreeNodeContentSkeleton.js.map +1 -0
- package/dist/components/SelectTreeNode/TreeNodeTitle.d.ts +9 -0
- package/dist/components/SelectTreeNode/TreeNodeTitle.js +8 -0
- package/dist/components/SelectTreeNode/TreeNodeTitle.js.map +1 -0
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js +1 -1
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundaryContent/SimpleErrorBoundaryContent.d.ts +2 -2
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundaryContent/SimpleErrorBoundaryContent.js +6 -3
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundaryContent/SimpleErrorBoundaryContent.js.map +1 -1
- package/dist/components/UploadFiles/UploadFiles.js +1 -1
- package/dist/components/UploadFiles/UploadFiles.js.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/hooks/useAppLang/useAppLang.js.map +1 -1
- package/dist/locales/en/shared.json +5 -1
- package/dist/locales/fr/shared.json +5 -1
- package/dist/types/trees.d.ts +1 -0
- package/package.json +3 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/FloatingMenuHandler.d.ts +0 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/FloatingMenuHandler.js +0 -29
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/FloatingMenuHandler.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/FloatingMenuHandler/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.d.ts +0 -20
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js +0 -53
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/useGetOptionsQuery.d.ts +0 -19
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/useGetOptionsQuery.js +0 -111
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/useGetOptionsQuery.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.d.ts +0 -20
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js +0 -71
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/MultiValueSelect.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/useGetOptionsQuery.d.ts +0 -14
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/useGetOptionsQuery.js +0 -58
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/MultiValueSelect/useGetOptionsQuery.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/RecordIdentityCell.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/RecordIdentityCell.js +0 -11
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/RecordIdentityCell.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/RecordIdentityCell/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/QuickSearch.d.ts +0 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/QuickSearch.js +0 -50
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/QuickSearch.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/QuickSearch/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/ValuesAdd.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/ValuesAdd.js +0 -215
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/ValuesAdd.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/ValuesAdd/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/ComputeIndicator.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.d.ts +0 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/DeleteAllValuesButton.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/calculatedInheritedFlags.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/TreeFieldValue.d.ts +0 -10
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/TreeFieldValue.js +0 -50
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/TreeFieldValue.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeFieldValue/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js +0 -106
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/ValuesAdd.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/ValuesAdd/index.js.map +0 -1
- /package/dist/components/RecordEdition/EditRecordContent/uiElements/{StandardField → shared}/ComputeIndicator.js +0 -0
- /package/dist/components/RecordEdition/EditRecordContent/uiElements/{StandardField → shared}/calculatedInheritedFlags.d.ts +0 -0
- /package/dist/components/RecordEdition/EditRecordContent/uiElements/{StandardField → shared}/calculatedInheritedFlags.js +0 -0
|
@@ -2,9 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
-
import { Modal } from 'antd';
|
|
6
5
|
import { useRef, useState } from 'react';
|
|
7
|
-
import { KitButton, KitSpace, KitTypography } from 'aristid-ds';
|
|
6
|
+
import { KitButton, KitModal, KitSpace, KitTypography } from 'aristid-ds';
|
|
8
7
|
import styled from 'styled-components';
|
|
9
8
|
import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
10
9
|
import { EditRecord } from '../EditRecord';
|
|
@@ -13,61 +12,59 @@ import { faXmark, faRotateRight, faLayerGroup } from '@fortawesome/free-solid-sv
|
|
|
13
12
|
import { useGetSubmitButtons } from '../hooks/useGetSubmitButtons';
|
|
14
13
|
import { useForm } from 'antd/lib/form/Form';
|
|
15
14
|
import { useCreateCancelConfirm } from '../hooks/useCreateCancelConfirm';
|
|
16
|
-
|
|
17
|
-
const
|
|
15
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
16
|
+
const MODAL_HEIGHT = '80vh';
|
|
17
|
+
const MODAL_WIDTH = '90vw';
|
|
18
|
+
const MODAL_MAX_WIDTH = '1200px';
|
|
19
|
+
const KitModalStyled = styled(KitModal) `
|
|
18
20
|
&& {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
& > div {
|
|
22
|
+
max-width: ${MODAL_MAX_WIDTH};
|
|
23
|
+
|
|
24
|
+
.kit-modal-header {
|
|
25
|
+
border-bottom: 1px solid var(--general-utilities-border);
|
|
26
|
+
|
|
27
|
+
.kit-modal-title {
|
|
28
|
+
padding-right: calc(var(--general-spacing-xs) * 1px);
|
|
29
|
+
|
|
30
|
+
.ant-space {
|
|
31
|
+
width: 100%;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.kit-modal-content-wrapper {
|
|
38
|
+
padding: 0;
|
|
22
39
|
|
|
23
|
-
|
|
24
|
-
|
|
40
|
+
.kit-modal-content {
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
& > div {
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
25
48
|
}
|
|
26
49
|
}
|
|
27
50
|
`;
|
|
28
|
-
const
|
|
29
|
-
height: 3.5rem;
|
|
30
|
-
grid-area: title;
|
|
31
|
-
align-self: center;
|
|
32
|
-
font-size: 1rem;
|
|
33
|
-
padding: 10px 50px 10px 10px;
|
|
34
|
-
border-bottom: 1px solid var(--general-utilities-border);
|
|
35
|
-
display: flex;
|
|
36
|
-
justify-content: space-between;
|
|
37
|
-
align-items: center;
|
|
38
|
-
`;
|
|
39
|
-
const ModalFooter = styled.div `
|
|
40
|
-
display: flex;
|
|
41
|
-
justify-content: flex-end;
|
|
42
|
-
padding: 0.5rem 1rem;
|
|
43
|
-
border-top: 1px solid var(--general-utilities-border);
|
|
44
|
-
`;
|
|
45
|
-
export const EditRecordModal = ({ open, record, creationFormId, editionFormId, library, onClose, onCreate, onCreateAndEdit, submitButtons = ['create'], valuesVersion, withInfoButton = true }) => {
|
|
51
|
+
export const EditRecordModal = ({ className, open, record, creationFormId, editionFormId, library, onClose, onCreate, onCreateAndEdit, valuesVersion, submitButtons = ['create'], withInfoButton = true }) => {
|
|
46
52
|
const { t } = useSharedTranslation();
|
|
47
|
-
const
|
|
53
|
+
const [antdForm] = useForm();
|
|
48
54
|
const [currentRecord, setCurrentRecord] = useState(record);
|
|
49
55
|
const [clickedSubmitButton, setClickedSubmitButton] = useState(null);
|
|
50
|
-
const isCreation = !currentRecord;
|
|
51
|
-
const _handleClickSubmit = (button) => {
|
|
52
|
-
setClickedSubmitButton(button);
|
|
53
|
-
};
|
|
54
|
-
const displayedSubmitButtons = useGetSubmitButtons(submitButtons, isCreation, _handleClickSubmit);
|
|
55
|
-
const [antdForm] = useForm();
|
|
56
|
-
const _handleClose = () => {
|
|
57
|
-
if (isCreation && antdForm.isFieldsTouched()) {
|
|
58
|
-
return showCancelConfirm();
|
|
59
|
-
}
|
|
60
|
-
return onClose();
|
|
61
|
-
};
|
|
62
56
|
// Create refs for the buttons to pass them to the EditRecord component
|
|
63
57
|
const refreshButtonRef = useRef(null);
|
|
64
58
|
const valuesVersionsButtonRef = useRef(null);
|
|
59
|
+
const formElementId = useRef(uuidv4());
|
|
60
|
+
const isCreation = !currentRecord;
|
|
65
61
|
const closeButtonLabel = isCreation ? t('global.cancel') : t('global.close');
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
62
|
+
const formId = isCreation ? creationFormId : editionFormId;
|
|
63
|
+
const _handleClickSubmit = (button) => {
|
|
64
|
+
setClickedSubmitButton(button);
|
|
65
|
+
};
|
|
66
|
+
const showCancelConfirm = useCreateCancelConfirm(onClose);
|
|
67
|
+
const displayedSubmitButtons = useGetSubmitButtons(submitButtons, formElementId.current, isCreation, _handleClickSubmit);
|
|
71
68
|
const _handleCreate = (newRecord) => {
|
|
72
69
|
setCurrentRecord(newRecord);
|
|
73
70
|
if (onCreateAndEdit && clickedSubmitButton === 'createAndEdit') {
|
|
@@ -79,10 +76,18 @@ export const EditRecordModal = ({ open, record, creationFormId, editionFormId, l
|
|
|
79
76
|
return;
|
|
80
77
|
}
|
|
81
78
|
};
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
const _handleClose = () => {
|
|
80
|
+
if (isCreation && antdForm.isFieldsTouched()) {
|
|
81
|
+
return showCancelConfirm();
|
|
82
|
+
}
|
|
83
|
+
return onClose();
|
|
84
|
+
};
|
|
85
|
+
return (_jsx(KitModalStyled, { className: className, height: MODAL_HEIGHT, width: MODAL_WIDTH, isOpen: open, close: _handleClose, title: _jsxs(KitSpace, { children: [_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') }), _jsxs(KitSpace, { size: "xxs", children: [_jsx(KitButton, { ref: valuesVersionsButtonRef, type: "tertiary", icon: _jsx(FontAwesomeIcon, { icon: faLayerGroup }) }), _jsx(KitButton, { ref: refreshButtonRef, type: "tertiary", icon: _jsx(FontAwesomeIcon, { icon: faRotateRight }) })] })] }), footer: _jsx(KitSpace, { children: [
|
|
86
|
+
_jsx(KitButton, { "aria-label": closeButtonLabel, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), onClick: _handleClose, children: closeButtonLabel }, "close"),
|
|
87
|
+
...displayedSubmitButtons
|
|
88
|
+
] }), closeIcon: _jsx(FontAwesomeIcon, { icon: faXmark }), showCloseIcon: true, destroyOnClose: true, children: _jsx(EditRecord, { antdForm: antdForm, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, onCreate: _handleCreate, valuesVersion: valuesVersion, buttonsRefs: {
|
|
89
|
+
refresh: refreshButtonRef,
|
|
90
|
+
valuesVersions: valuesVersionsButtonRef
|
|
91
|
+
}, showSidebar: true, withInfoButton: withInfoButton }) }));
|
|
87
92
|
};
|
|
88
93
|
//# sourceMappingURL=EditRecordModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordModal/EditRecordModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,
|
|
1
|
+
{"version":3,"file":"EditRecordModal.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordModal/EditRecordModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACxE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAGpE,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAEvF,OAAO,EAAC,mBAAmB,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAC,sBAAsB,EAAC,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAC,EAAE,IAAI,MAAM,EAAC,MAAM,MAAM,CAAC;AAiBlC,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,MAAM,eAAe,GAAG,QAAQ,CAAC;AAEjC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAA;;;yBAGd,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BvC,CAAC;AAEF,MAAM,CAAC,MA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S,kBACM,gBAAgB,EAE5B,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EACxC,OAAO,EAAE,YAAY,YAEpB,gBAAgB,IAJb,OAAO,CAKH;gBACZ,GAAG,sBAAsB;aAC5B,GACM,EAEf,SAAS,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EAC7C,aAAa,QACb,cAAc,kBAEd,KAAC,UAAU,IACP,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,CAAC,OAAO,EACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,aAAa,EACvB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE;gBACT,OAAO,EAAE,gBAAgB;gBACzB,cAAc,EAAE,uBAAuB;aAC1C,EACD,WAAW,QACX,cAAc,EAAE,cAAc,GAChC,GACW,CACpB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -13,8 +13,9 @@ interface IEditRecordPageProps {
|
|
|
13
13
|
submitButtons?: possibleSubmitButtons;
|
|
14
14
|
valuesVersion?: IValueVersion;
|
|
15
15
|
showRefreshButton?: boolean;
|
|
16
|
+
showHeader?: boolean;
|
|
16
17
|
withInfoButton?: boolean;
|
|
17
|
-
onClose
|
|
18
|
+
onClose?: () => void;
|
|
18
19
|
showSidebar?: boolean;
|
|
19
20
|
sidebarContainer?: HTMLElement;
|
|
20
21
|
}
|
|
@@ -12,6 +12,7 @@ import { faXmark, faRotateRight } from '@fortawesome/free-solid-svg-icons';
|
|
|
12
12
|
import { useGetSubmitButtons } from '../hooks/useGetSubmitButtons';
|
|
13
13
|
import { useForm } from 'antd/lib/form/Form';
|
|
14
14
|
import { useCreateCancelConfirm } from '../hooks/useCreateCancelConfirm';
|
|
15
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
16
|
const Header = styled.div `
|
|
16
17
|
grid-area: title;
|
|
17
18
|
align-self: center;
|
|
@@ -22,16 +23,18 @@ const Header = styled.div `
|
|
|
22
23
|
justify-content: space-between;
|
|
23
24
|
align-items: center;
|
|
24
25
|
`;
|
|
25
|
-
|
|
26
|
+
const emptyFunction = () => null;
|
|
27
|
+
export const EditRecordPage = ({ record, library, creationFormId, editionFormId, onCreate, onCreateAndEdit, valuesVersion, title, showRefreshButton = true, showHeader = true, submitButtons = ['create'], withInfoButton, onClose = emptyFunction, showSidebar, sidebarContainer }) => {
|
|
26
28
|
const { t } = useSharedTranslation();
|
|
27
29
|
const [currentRecord, setCurrentRecord] = useState(record);
|
|
28
30
|
const [clickedSubmitButton, setClickedSubmitButton] = useState(null);
|
|
29
31
|
const showCancelConfirm = useCreateCancelConfirm(onClose);
|
|
32
|
+
const formElementId = useRef(uuidv4());
|
|
30
33
|
const isCreation = !currentRecord;
|
|
31
34
|
const _handleClickSubmit = (button) => {
|
|
32
35
|
setClickedSubmitButton(button);
|
|
33
36
|
};
|
|
34
|
-
const displayedSubmitButtons = useGetSubmitButtons(submitButtons, isCreation, _handleClickSubmit);
|
|
37
|
+
const displayedSubmitButtons = useGetSubmitButtons(submitButtons, formElementId.current, isCreation, _handleClickSubmit);
|
|
35
38
|
const [antdForm] = useForm();
|
|
36
39
|
const _handleClose = () => {
|
|
37
40
|
if (isCreation && antdForm.isFieldsTouched()) {
|
|
@@ -54,6 +57,6 @@ export const EditRecordPage = ({ record, library, creationFormId, editionFormId,
|
|
|
54
57
|
}
|
|
55
58
|
};
|
|
56
59
|
const formId = isCreation ? creationFormId : editionFormId;
|
|
57
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Header, { children: [title !== undefined ? (title) : (_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') })), _jsxs(KitSpace, { children: [showRefreshButton && (_jsx(KitButton, { ref: refreshButtonRef, "aria-label": "refresh", type: "tertiary", icon: _jsx(FontAwesomeIcon, { icon: faRotateRight }) })), _jsx(KitButton, { onClick: _handleClose, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), children: closeButtonLabel }), _jsx(KitSpace, { children: displayedSubmitButtons })] })] }), _jsx(KitDivider, { noMargin: true, color: "lightGrey" }), _jsx(EditRecord, { antdForm: antdForm, formId: formId, record: currentRecord, library: library, valuesVersion: valuesVersion, onCreate: _handleCreate, buttonsRefs: { refresh: refreshButtonRef }, containerStyle: { height: 'calc(100% - 82px)' }, withInfoButton: withInfoButton, showSidebar: showSidebar, sidebarContainer: sidebarContainer })] }));
|
|
60
|
+
return (_jsxs(_Fragment, { children: [showHeader && (_jsxs(_Fragment, { children: [_jsxs(Header, { children: [title !== undefined ? (title) : (_jsx(KitTypography.Title, { level: "h2", style: { margin: 0 }, children: currentRecord?.label ?? t('record_edition.new_record') })), _jsxs(KitSpace, { children: [showRefreshButton && (_jsx(KitButton, { ref: refreshButtonRef, "aria-label": "refresh", type: "tertiary", icon: _jsx(FontAwesomeIcon, { icon: faRotateRight }) })), _jsx(KitButton, { onClick: _handleClose, icon: _jsx(FontAwesomeIcon, { icon: faXmark }), children: closeButtonLabel }), _jsx(KitSpace, { children: displayedSubmitButtons })] })] }), _jsx(KitDivider, { noMargin: true, color: "lightGrey" })] })), _jsx(EditRecord, { antdForm: antdForm, formId: formId, formElementId: formElementId.current, record: currentRecord, library: library, valuesVersion: valuesVersion, onCreate: _handleCreate, buttonsRefs: { refresh: refreshButtonRef }, containerStyle: { height: 'calc(100% - 82px)' }, withInfoButton: withInfoButton, showSidebar: showSidebar, sidebarContainer: sidebarContainer })] }));
|
|
58
61
|
};
|
|
59
62
|
//# sourceMappingURL=EditRecordPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordPage.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordPage/EditRecordPage.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA+B,MAAM,EAAE,QAAQ,EAAC,MAAM,O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S,IAAC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,YACrE,gBAAgB,GACT,EACZ,KAAC,QAAQ,cAAE,sBAAsB,GAAY,IACtC,IACN,EACT,KAAC,UAAU,IAAC,QAAQ,QAAC,KAAK,EAAC,WAAW,GAAG,IAC1C,CACN,EACD,KAAC,UAAU,IACP,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,CAAC,OAAO,EACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,EAAC,OAAO,EAAE,gBAAgB,EAAC,EACxC,cAAc,EAAE,EAAC,MAAM,EAAE,mBAAmB,EAAC,EAC7C,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,GACpC,IACH,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -15,6 +15,8 @@ import Breadcrumb from './Breacrumb';
|
|
|
15
15
|
import AttributeSummary from './AttributeSummary';
|
|
16
16
|
import ValuesSummary from './ValuesSummary';
|
|
17
17
|
import styled from 'styled-components';
|
|
18
|
+
import { useLang } from '../../../hooks';
|
|
19
|
+
import { localizedTranslation } from '@leav/utils';
|
|
18
20
|
const _getRecordSidebarContent = (state, onMetadataSubmit) => {
|
|
19
21
|
// TODO: ValuesVersions should be removed or refactored later
|
|
20
22
|
switch (state.sidebarContent) {
|
|
@@ -36,9 +38,12 @@ const StyledKitSidePanel = styled(KitSidePanel) `
|
|
|
36
38
|
`;
|
|
37
39
|
export const EditRecordSidebar = ({ onMetadataSubmit, open, sidebarContainer }) => {
|
|
38
40
|
const { t } = useSharedTranslation();
|
|
41
|
+
const { lang } = useLang();
|
|
39
42
|
const { state, dispatch } = useEditRecordReducer();
|
|
40
43
|
const sidePanelRef = useRef(null);
|
|
41
|
-
const sidePanelTitle = state.
|
|
44
|
+
const sidePanelTitle = state.sidebarContent === 'valueDetails'
|
|
45
|
+
? localizedTranslation(state.activeAttribute?.attribute.label, lang)
|
|
46
|
+
: (state.record?.label ?? state.record?.id ?? t('record_summary.new_record'));
|
|
42
47
|
const editRecordSidebarContent = (_jsx(StyledKitSidePanel, { ref: sidePanelRef, initialOpen: open, idCardProps: { title: sidePanelTitle }, id: EDIT_RECORD_SIDEBAR_ID, headerExtra: _jsx(Breadcrumb, {}), "$hideBoxShadow": !sidebarContainer, children: _getRecordSidebarContent(state, onMetadataSubmit) }));
|
|
43
48
|
useEffect(() => {
|
|
44
49
|
if (sidePanelRef.current) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditRecordSidebar.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2CAA2C,CAAC;AAC/E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,6BAA6B,EAA0B,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"EditRecordSidebar.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,2CAA2C,CAAC;AAC/E,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAC,6BAA6B,EAA0B,MAAM,wCAAwC,CAAC;AAC9G,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAQjD,MAAM,wBAAwB,GAAG,CAAC,KAA8B,EAAE,gBAAyC,EAAE,EAAE;IAC3G,6DAA6D;IAC7D,QAAQ,KAAK,CAAC,cAAc,EAAE,CAAC;QAC3B,KAAK,MAAM;YACP,OAAO,IAAI,CAAC;QAChB,KAAK,cAAc;YACf,OAAO,CACH,MAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,GAAG,EAAC,KAAK,EAAE,EAAC,KAAK,EAAE,MAAM,EAAC,aAC1D,KAAC,gBAAgB,IAAC,SAAS,EAAE,KAA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EACpC,EAAE,EAAE,sBAAsB,EAC1B,WAAW,EAAE,KAAC,UAAU,KAAG,oBACX,CAAC,gBAAgB,YAEhC,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,CAAC,GACjC,CACxB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACvB,IAAI,IAAI,EAAE,CAAC;gBACP,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;gBAE5B,QAAQ,CAAC;oBACL,IAAI,EAAE,6BAA6B,CAAC,mBAAmB;oBACvD,OAAO,EAAE,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc;iBAC9E,CAAC,CAAC;YACP,CAAC;iBAAM,CAAC;gBACJ,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,CAAC;QACL,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,gBAAgB,KAAK,SAAS;QACjC,CAAC,CAAC,wBAAwB;QAC1B,CAAC,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -20,6 +20,9 @@ export const ValuesSummary = ({ globalValues = [], calculatedValue }) => {
|
|
|
20
20
|
if (typeof value === 'string') {
|
|
21
21
|
return stripHtml(value);
|
|
22
22
|
}
|
|
23
|
+
if (typeof value === 'boolean') {
|
|
24
|
+
return value ? t('global.yes') : t('global.no');
|
|
25
|
+
}
|
|
23
26
|
if (_isDateRangeValue(value)) {
|
|
24
27
|
return t('record_edition.date_range_value', {
|
|
25
28
|
from: value.from,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValuesSummary.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.tsx"],"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wCACf,UAAU,EAAE,QAAQ;wCACpB,cAAc,EAAE,eAAe;qCAClC,aAED,2BACI,KAAC,YAAY,KAAG,OAAE,CAAC,CAAC,uBAAuB,CAAC,IACzC,EACP,KAAC,QAAQ,IAAC,KAAK,EAAE,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAC,SAAS,GAAG,IAC7D,CACT;gCACD,QAAQ,EACJ,mBAAmB,CAAC,MAAM,GAAG,CAAC;oCAC1B,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;wCACvC,GAAG,EAAE,GAAG,cAAc,IAAI,KAAK,EAAE;wCACjC,KAAK,EAAE,KAAK;qCACf,CAAC,CAAC;oCACL,CAAC,CAAC;wCACI;4CACI,GAAG,EAAE,GAAG,cAAc,IAAI,CAAC,EAAE;4CAC7B,KAAK,EAAE,sBAAI,CAAC,CAAC,yBAAyB,CAAC,GAAK;yCAC/C;qCACJ;6BACd;yBACJ,GACH,GACgB,CACzB;aACJ;SACJ,GACH,CACL,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"ValuesSummary.js","sourceRoot":"","sources":["../../../../../src/components/RecordEdition/EditRecordSidebar/ValuesSummary/ValuesSummary.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACtD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAErC,CAAC;AAOF,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,8FAA8F;AAC9F,MAAM,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,mBAAmB,CAAC,MAAM,GAAG,CAAC;oCAC1B,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;wCACvC,GAAG,EAAE,GAAG,cAAc,IAAI,KAAK,EAAE;wCACjC,KAAK,EAAE,KAAK;qCACf,CAAC,CAAC;oCACL,CAAC,CAAC;wCACI;4CACI,GAAG,EAAE,GAAG,cAAc,IAAI,CAAC,EAAE;4CAC7B,KAAK,EAAE,sBAAI,CAAC,CAAC,yBAAyB,CAAC,GAAK;yCAC/C;qCACJ;6BACd;yBACJ,GACH,GACgB,CACzB;aACJ;SACJ,GACH,CACL,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IRecordIdentityWhoAmI } from '../../../types/records';
|
|
2
2
|
import { IValueVersion } from '../../../types/values';
|
|
3
3
|
import { RecordFormAttributeFragment, RecordUpdateSubscription, ValueDetailsFragment } from '../../../_gqlTypes';
|
|
4
|
-
import { RecordFormElementsValueStandardValue } from '../../../hooks/useGetRecordForm';
|
|
4
|
+
import { RecordFormElementsValueLinkValue, RecordFormElementsValueStandardValue, RecordFormElementsValueTreeValue } from '../../../hooks/useGetRecordForm';
|
|
5
5
|
import { SystemTranslation } from '../../../types';
|
|
6
6
|
export interface IRecordPropertyWithAttribute {
|
|
7
7
|
attribute: RecordFormAttributeFragment;
|
|
@@ -46,7 +46,7 @@ export type IEditRecordReducerActions = {
|
|
|
46
46
|
} | {
|
|
47
47
|
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE;
|
|
48
48
|
attribute?: IEditRecordReducerState['activeAttribute']['attribute'];
|
|
49
|
-
values?: RecordFormElementsValueStandardValue[];
|
|
49
|
+
values?: RecordFormElementsValueStandardValue[] | RecordFormElementsValueLinkValue[] | RecordFormElementsValueTreeValue[];
|
|
50
50
|
} | {
|
|
51
51
|
type: EditRecordReducerActionsTypes.SET_SIDEBAR_CONTENT;
|
|
52
52
|
content: IEditRecordReducerState['sidebarContent'];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TypeGuards } from '../../../components/LibraryItemsList/LibraryItemsListTable/Cell/typeGuards';
|
|
1
2
|
export var EditRecordReducerActionsTypes;
|
|
2
3
|
(function (EditRecordReducerActionsTypes) {
|
|
3
4
|
EditRecordReducerActionsTypes["SET_RECORD"] = "SET_RECORD";
|
|
@@ -40,9 +41,27 @@ const editRecordReducer = (state, action) => {
|
|
|
40
41
|
attribute: action.attribute ?? state.activeAttribute?.attribute ?? null,
|
|
41
42
|
globalValues: action.values
|
|
42
43
|
?.filter(value => !value.isCalculated && !value.isInherited)
|
|
43
|
-
.map(value =>
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
.map(value => {
|
|
45
|
+
if (TypeGuards.isRecordFormElementsValuesLinkValue(value)) {
|
|
46
|
+
return value.linkValue.whoAmI.label ?? value.linkValue.whoAmI.id;
|
|
47
|
+
}
|
|
48
|
+
if (TypeGuards.isRecordFormElementsValuesTreeValue(value)) {
|
|
49
|
+
return value.treeValue.record.whoAmI.label ?? value.treeValue.record.whoAmI.id;
|
|
50
|
+
}
|
|
51
|
+
return value?.payload;
|
|
52
|
+
}),
|
|
53
|
+
calculatedValue: (() => {
|
|
54
|
+
const calculatedOrInheritedValue = action.values?.filter(value => value.isCalculated || value.isInherited)?.[0];
|
|
55
|
+
if (TypeGuards.isRecordFormElementsValuesLinkValue(calculatedOrInheritedValue)) {
|
|
56
|
+
return (calculatedOrInheritedValue.linkValue.whoAmI.label ??
|
|
57
|
+
calculatedOrInheritedValue.linkValue.whoAmI.id);
|
|
58
|
+
}
|
|
59
|
+
if (TypeGuards.isRecordFormElementsValuesTreeValue(calculatedOrInheritedValue)) {
|
|
60
|
+
return (calculatedOrInheritedValue.treeValue.record.whoAmI.label ??
|
|
61
|
+
calculatedOrInheritedValue.treeValue.record.whoAmI.id);
|
|
62
|
+
}
|
|
63
|
+
return calculatedOrInheritedValue?.payload;
|
|
64
|
+
})()
|
|
46
65
|
},
|
|
47
66
|
sidebarContent: newSidebarContent
|
|
48
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editRecordReducer.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/editRecordReducer/editRecordReducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editRecordReducer.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/editRecordReducer/editRecordReducer.ts"],"names":[],"mappings":"AAYA,OAAO,EAAC,UAAU,EAAC,MAAM,uEAAuE,CAAC;AA2BjG,MAAM,CAAN,IAAY,6BAUX;AAVD,WAAY,6BAA6B;IACrC,0DAAyB,CAAA;IACzB,wEAAuC,CAAA;IACvC,sEAAqC,CAAA;IACrC,4EAA2C,CAAA;IAC3C,0EAAyC,CAAA;IACzC,oEAAmC,CAAA;IACnC,8DAA6B,CAAA;IAC7B,4EAA2C,CAAA;IAC3C,gFAA+C,CAAA;AACnD,CAAC,EAVW,6BAA6B,KAA7B,6BAA6B,QAUxC;AA4CD,MAAM,CAAC,MAAM,YAAY,GAA4B;IACjD,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,YAAY,EAAE,IAAI;IAClB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,SAAS;IACzB,oBAAoB,EAAE,KAAK;IAC3B,aAAa,EAAE,IAAI;IACnB,mBAAmB,EAAE,IAAI;IACzB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE;QACZ,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,EAAE;KACpB;IACD,cAAc,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,iBAAiB,GAAG,CACtB,KAA8B,EAC9B,MAAiC,EACV,EAAE;IACzB,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,6BAA6B,CAAC,UAAU;YACzC,OAAO,EAAC,GAAG,KAAK,EAAE,MAAM,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,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACvF,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,IAAI,EAAE,CAAC;gBAC5C,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;YAEvE,MAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CACzC,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC;gBACpB,GAAG,GAAG;gBACN,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;oBACtB,GAAG,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;oBAC5D,YAAY,CAAC,KAAK;iBACrB;aACJ,CAAC,EACF,EAAE,CACL,CAAC;YAEF,QAAQ,CAAC,cAAc,GAAG;gBACtB,SAAS,EAAE,YAAY;gBACvB,aAAa,EAAE,EAAC,GAAG,CAAC,KAAK,CAAC,cAAc,EAAE,aAAa,IAAI,EAAE,CAAC,EAAE,GAAG,SAAS,EAAC;aAChF,CAAC;YAEF,OAAO,QAAQ,CAAC;QACpB,KAAK,6BAA6B,CAAC,qBAAqB;YACpD,OAAO,EAAC,GAAG,KAAK,EAAE,cAAc,EAAE,EAAC,GAAG,YAAY,CAAC,cAAc,EAAC,EAAC,CAAC;QACxE;YACI,OAAO,KAAK,CAAC;IACrB,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { possibleSubmitButtons, submitButtonsName } from '../_types';
|
|
2
|
-
export declare const useGetSubmitButtons: (buttons: possibleSubmitButtons, isInCreateMode: boolean, onClickSubmit: (button: submitButtonsName) => void) => any[];
|
|
2
|
+
export declare const useGetSubmitButtons: (buttons: possibleSubmitButtons, id: string, isInCreateMode: boolean, onClickSubmit: (button: submitButtonsName) => void) => any[];
|
|
@@ -7,17 +7,17 @@ import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
|
|
|
7
7
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
8
8
|
import { faPenToSquare, faCheck } from '@fortawesome/free-solid-svg-icons';
|
|
9
9
|
import { EDIT_OR_CREATE_RECORD_FORM_ID } from '../EditRecordContent/formConstants';
|
|
10
|
-
export const useGetSubmitButtons = (buttons, isInCreateMode, onClickSubmit) => {
|
|
10
|
+
export const useGetSubmitButtons = (buttons, id, isInCreateMode, onClickSubmit) => {
|
|
11
11
|
const { t } = useSharedTranslation();
|
|
12
12
|
const headerSubmitButtons = [];
|
|
13
13
|
if (!isInCreateMode) {
|
|
14
14
|
return [];
|
|
15
15
|
}
|
|
16
16
|
if (buttons.includes('create')) {
|
|
17
|
-
headerSubmitButtons.push(_jsx(KitButton, { form: EDIT_OR_CREATE_RECORD_FORM_ID, type: !buttons.includes('createAndEdit') ? 'primary' : 'secondary', htmlType: "submit", icon: _jsx(FontAwesomeIcon, { icon: faCheck }), onClick: () => onClickSubmit('create'), children: t('record_edition.create') }, "create"));
|
|
17
|
+
headerSubmitButtons.push(_jsx(KitButton, { form: id ?? EDIT_OR_CREATE_RECORD_FORM_ID, type: !buttons.includes('createAndEdit') ? 'primary' : 'secondary', htmlType: "submit", icon: _jsx(FontAwesomeIcon, { icon: faCheck }), onClick: () => onClickSubmit('create'), children: t('record_edition.create') }, "create"));
|
|
18
18
|
}
|
|
19
19
|
if (buttons.includes('createAndEdit')) {
|
|
20
|
-
headerSubmitButtons.push(_jsx(KitButton, { form: EDIT_OR_CREATE_RECORD_FORM_ID, type: "primary", htmlType: "submit", icon: _jsx(FontAwesomeIcon, { icon: faPenToSquare }), onClick: () => onClickSubmit('createAndEdit'), children: t('record_edition.create_and_edit') }, "createAndEdit"));
|
|
20
|
+
headerSubmitButtons.push(_jsx(KitButton, { form: id ?? EDIT_OR_CREATE_RECORD_FORM_ID, type: "primary", htmlType: "submit", icon: _jsx(FontAwesomeIcon, { icon: faPenToSquare }), onClick: () => onClickSubmit('createAndEdit'), children: t('record_edition.create_and_edit') }, "createAndEdit"));
|
|
21
21
|
}
|
|
22
22
|
return headerSubmitButtons;
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetSubmitButtons.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/hooks/useGetSubmitButtons.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAE,OAAO,EAAC,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAC,6BAA6B,EAAC,MAAM,oCAAoC,CAAC;AAEjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAC/B,OAA8B,EAC9B,cAAuB,EACvB,aAAkD,EACpD,EAAE;IACA,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,mBAAmB,GAAG,EAAE,CAAC;IAE/B,IAAI,CAAC,cAAc,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,mBAAmB,CAAC,IAAI,CACpB,KAAC,SAAS,IAEN,IAAI,EAAE,6BAA6B,
|
|
1
|
+
{"version":3,"file":"useGetSubmitButtons.js","sourceRoot":"","sources":["../../../../src/components/RecordEdition/hooks/useGetSubmitButtons.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,O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e,IAAC,IAAI,EAAE,aAAa,GAAI,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,YAE5C,CAAC,CAAC,gCAAgC,CAAC,IAPhC,eAAe,CAQX,CACf,CAAC;IACN,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { ComponentProps, FunctionComponent } from 'react';
|
|
|
2
2
|
import { ExplorerSelectionIdsQuery } from '../../_gqlTypes';
|
|
3
3
|
import { Explorer } from '../../components/Explorer';
|
|
4
4
|
interface ISelectRecordForLinkModalProps {
|
|
5
|
+
className?: string;
|
|
5
6
|
open: boolean;
|
|
6
7
|
childLibraryId: string;
|
|
7
8
|
replacementMode: boolean;
|
|
@@ -47,7 +47,7 @@ const ModalMainStyledDiv = styled.div `
|
|
|
47
47
|
height: 100%;
|
|
48
48
|
position: relative;
|
|
49
49
|
`;
|
|
50
|
-
export const SelectRecordForLinkModal = ({ open, childLibraryId, replacementMode, selectionMode, hideSelectAllAction, onSelectionCompleted, onClose }) => {
|
|
50
|
+
export const SelectRecordForLinkModal = ({ className, open, childLibraryId, replacementMode, selectionMode, hideSelectAllAction, onSelectionCompleted, onClose }) => {
|
|
51
51
|
const { t } = useSharedTranslation();
|
|
52
52
|
const explorerContainerRef = useRef(null);
|
|
53
53
|
const _handleClose = () => {
|
|
@@ -60,7 +60,7 @@ export const SelectRecordForLinkModal = ({ open, childLibraryId, replacementMode
|
|
|
60
60
|
fetchPolicy: 'no-cache',
|
|
61
61
|
onCompleted: onSelectionCompleted
|
|
62
62
|
});
|
|
63
|
-
return (_jsx(StyledModal, { open: open, onCancel: _handleClose, destroyOnClose: true, closable: false, cancelText: t('global.cancel'), width: "90vw", centered: true, footer: _footer, children: _jsx(ModalMainStyledDiv, { ref: explorerContainerRef, children: _jsx(Explorer.EditSettingsContextProvider, { panelElement: () => explorerContainerRef.current ?? document.body, children: _jsx(Explorer, { entrypoint: {
|
|
63
|
+
return (_jsx(StyledModal, { className: className, open: open, onCancel: _handleClose, destroyOnClose: true, closable: false, cancelText: t('global.cancel'), width: "90vw", centered: true, footer: _footer, children: _jsx(ModalMainStyledDiv, { ref: explorerContainerRef, children: _jsx(Explorer.EditSettingsContextProvider, { panelElement: () => explorerContainerRef.current ?? document.body, children: _jsx(Explorer, { entrypoint: {
|
|
64
64
|
type: 'library',
|
|
65
65
|
libraryId: childLibraryId
|
|
66
66
|
}, selectionMode: selectionMode, hideSelectAllAction: hideSelectAllAction, massActions: [
|
|
@@ -78,6 +78,6 @@ export const SelectRecordForLinkModal = ({ open, childLibraryId, replacementMode
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
], primaryActions: [], defaultActionsForItem: [], defaultMassActions: [], itemActions: [], defaultPrimaryActions: [] }) }) }) }));
|
|
81
|
+
], primaryActions: [], defaultActionsForItem: [], defaultMassActions: [], itemActions: [], defaultPrimaryActions: [], showSearch: true }) }) }) }));
|
|
82
82
|
};
|
|
83
83
|
//# sourceMappingURL=SelectRecordForLinkModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectRecordForLinkModal.js","sourceRoot":"","sources":["../../../src/components/SelectRecordForLinkModal/SelectRecordForLinkModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoC,MAAM,EAAC,MAAM,OAAO,CAAC;AAChE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAC3E,+BAA+B;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACrD,OAA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,IAAC,GAAG,EAAE,oBAAoB,YACzC,KAAC,QAAQ,CAAC,2BAA2B,IACjC,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,YAEjE,KAAC,QAAQ,IACL,UAAU,EAAE;wBACR,IAAI,EAAE,SAAS;wBACf,SAAS,EAAE,cAAc;qBAC5B,EACD,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE;wBACT;4BACI,KAAK,EAAE,eAAe;gCAClB,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC;gCACvC,CAAC,CAAC,CAAC,CAAC,8BAA8B,CAAC;4BACvC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,KAAC,aAAa,KAAG,CAAC,CAAC,CAAC,KAAC,MAAM,KAAG;4BACtD,QAAQ,EAAE,KAAK,EAAC,mBAAmB,EAAC,EAAE;gCAClC,MAAM,uBAAuB,CAAC;oCAC1B,SAAS,EAAE;wCACP,SAAS,EAAE,cAAc;wCACzB,OAAO,EAAE,mBAAmB;qCAC/B;iCACJ,CAAC,CAAC;4BACP,CAAC;yBACJ;qBACJ,EACD,cAAc,EAAE,EAAE,EAClB,qBAAqB,EAAE,EAAE,EACzB,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,EAAE,EACf,qBAAqB,EAAE,EAAE,EACzB,UAAU,SACZ,GAEiC,GACtB,GACX,CACjB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -2,10 +2,12 @@ import { FunctionComponent } from 'react';
|
|
|
2
2
|
import { ITreeNodeWithRecord } from '../../types/trees';
|
|
3
3
|
interface ISelectTreeNodeProps {
|
|
4
4
|
treeId: string;
|
|
5
|
-
|
|
5
|
+
selectedNodes?: string[];
|
|
6
|
+
disabledNodes?: string[];
|
|
6
7
|
onSelect: (node: ITreeNodeWithRecord, selected: boolean) => void;
|
|
7
8
|
onCheck?: (selection: ITreeNodeWithRecord[]) => void;
|
|
8
9
|
multiple?: boolean;
|
|
10
|
+
checkable?: boolean;
|
|
9
11
|
canSelectRoot?: boolean;
|
|
10
12
|
selectableLibraries?: string[];
|
|
11
13
|
}
|
|
@@ -8,15 +8,15 @@ import { useTreeDataQueryQuery } from '../../_gqlTypes';
|
|
|
8
8
|
import { ErrorDisplay } from '../..';
|
|
9
9
|
import useLang from '../../hooks/useLang';
|
|
10
10
|
import { SelectTreeNodeContent } from './SelectTreeNodeContent';
|
|
11
|
-
import {
|
|
12
|
-
export const SelectTreeNode = ({ treeId, onSelect, onCheck,
|
|
11
|
+
import { SelectTreeNodeContentSkeleton } from './SelectTreeNodeContentSkeleton';
|
|
12
|
+
export const SelectTreeNode = ({ treeId, onSelect, onCheck, selectedNodes, disabledNodes, multiple = false, checkable = false, canSelectRoot = false, selectableLibraries }) => {
|
|
13
13
|
const { lang } = useLang();
|
|
14
14
|
const { t } = useSharedTranslation();
|
|
15
15
|
const { loading, error, data } = useTreeDataQueryQuery({
|
|
16
16
|
variables: { treeId }
|
|
17
17
|
});
|
|
18
18
|
if (loading) {
|
|
19
|
-
return _jsx(
|
|
19
|
+
return _jsx(SelectTreeNodeContentSkeleton, {});
|
|
20
20
|
}
|
|
21
21
|
if (error) {
|
|
22
22
|
return _jsx(ErrorDisplay, { message: error.message });
|
|
@@ -25,6 +25,6 @@ export const SelectTreeNode = ({ treeId, onSelect, onCheck, selectedNode, multip
|
|
|
25
25
|
return _jsx(ErrorDisplay, { message: t('error.unknown_tree', { treeId }) });
|
|
26
26
|
}
|
|
27
27
|
const label = localizedTranslation(data.trees.list[0].label, lang) || treeId;
|
|
28
|
-
return (_jsx(SelectTreeNodeContent, { treeData: { id: treeId, label }, onCheck: onCheck, onSelect: onSelect, multiple: multiple,
|
|
28
|
+
return (_jsx(SelectTreeNodeContent, { treeData: { id: treeId, label }, onCheck: onCheck, onSelect: onSelect, multiple: multiple, checkable: checkable, selectedNodes: selectedNodes, disabledNodes: disabledNodes, canSelectRoot: canSelectRoot, selectableLibraries: selectableLibraries }));
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=SelectTreeNode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectTreeNode.js","sourceRoot":"","sources":["../../../src/components/SelectTreeNode/SelectTreeNode.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"SelectTreeNode.js","sourceRoot":"","sources":["../../../src/components/SelectTreeNode/SelectTreeNode.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAC,YAAY,EAAC,MAAM,OAAO,CAAC;AACnC,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAE1C,OAAO,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,6BAA6B,EAAC,MAAM,iCAAiC,CAAC;AAc9E,MAAM,CAAC,MAAM,cAAc,GAA4C,CAAC,EACpE,MAAM,EACN,QAAQ,EACR,OAAO,EACP,aAAa,EACb,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,aAAa,GAAG,KAAK,EAC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|
-
|
|
8
|
+
selectedNodes?: string[];
|
|
9
|
+
disabledNodes?: string[];
|
|
9
10
|
onSelect: (node: ITreeNodeWithRecord, selected: boolean) => void;
|
|
10
11
|
onCheck?: (selection: ITreeNodeWithRecord[]) => void;
|
|
11
12
|
multiple?: boolean;
|
|
13
|
+
checkable?: boolean;
|
|
12
14
|
canSelectRoot?: boolean;
|
|
13
15
|
selectableLibraries?: string[];
|
|
14
16
|
}
|
|
@@ -8,6 +8,7 @@ import { useSharedTranslation } from '../../hooks/useSharedTranslation';
|
|
|
8
8
|
import { useTreeNodeChildrenLazyQuery } from '../../_gqlTypes';
|
|
9
9
|
import { defaultPaginationPageSize, ErrorDisplay } from '../..';
|
|
10
10
|
import { KitTree } from 'aristid-ds';
|
|
11
|
+
import { TreeNodeTitle } from './TreeNodeTitle';
|
|
11
12
|
const _isObjectSelection = (selection) => 'checked' in selection && 'halfChecked' in selection;
|
|
12
13
|
const _constructTreeContent = (data) => data.map(e => ({
|
|
13
14
|
record: e.record,
|
|
@@ -17,7 +18,7 @@ const _constructTreeContent = (data) => data.map(e => ({
|
|
|
17
18
|
isLeaf: !e.childrenCount,
|
|
18
19
|
children: []
|
|
19
20
|
}));
|
|
20
|
-
export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck,
|
|
21
|
+
export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck, selectedNodes: initSelectedNodes, disabledNodes, multiple = false, checkable = false, canSelectRoot = false, selectableLibraries }) => {
|
|
21
22
|
const { t } = useSharedTranslation();
|
|
22
23
|
const rootNode = {
|
|
23
24
|
title: tree.label,
|
|
@@ -33,7 +34,7 @@ export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck, selec
|
|
|
33
34
|
const [treeMap, setTreeMap] = useState({
|
|
34
35
|
[tree.id]: rootNode
|
|
35
36
|
});
|
|
36
|
-
const [
|
|
37
|
+
const [selectedNodes, setSelectedNodes] = useState(initSelectedNodes);
|
|
37
38
|
const [fetchError, setFetchError] = useState();
|
|
38
39
|
const [loadTreeContent, { error, called }] = useTreeNodeChildrenLazyQuery();
|
|
39
40
|
const _fetchTreeContent = async (parentNodeKey, offset = 0) => {
|
|
@@ -56,7 +57,11 @@ export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck, selec
|
|
|
56
57
|
const showMoreKey = '__showMore' + parentMapKey + offset;
|
|
57
58
|
parentElement.children = parentElement.children.filter(child => !child.key.match(`__showMore${parentMapKey}`));
|
|
58
59
|
for (const node of formattedNodes) {
|
|
59
|
-
const nodeForTreeMap = {
|
|
60
|
+
const nodeForTreeMap = {
|
|
61
|
+
...node,
|
|
62
|
+
paginationOffset: 0,
|
|
63
|
+
disabled: disabledNodes?.includes(node.id)
|
|
64
|
+
};
|
|
60
65
|
newTreeMap[nodeForTreeMap.key] = nodeForTreeMap;
|
|
61
66
|
parentElement.paginationOffset = offset;
|
|
62
67
|
parentElement.children.push(nodeForTreeMap);
|
|
@@ -83,8 +88,8 @@ export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck, selec
|
|
|
83
88
|
}
|
|
84
89
|
};
|
|
85
90
|
useEffect(() => {
|
|
86
|
-
|
|
87
|
-
}, [
|
|
91
|
+
setSelectedNodes(initSelectedNodes);
|
|
92
|
+
}, [initSelectedNodes]);
|
|
88
93
|
useEffect(() => {
|
|
89
94
|
// Load root
|
|
90
95
|
_fetchTreeContent();
|
|
@@ -125,6 +130,9 @@ export const SelectTreeNodeContent = ({ treeData: tree, onSelect, onCheck, selec
|
|
|
125
130
|
return _jsx(ErrorDisplay, { message: error?.message ?? fetchError });
|
|
126
131
|
}
|
|
127
132
|
const treeData = [treeMap[rootNode.key]];
|
|
128
|
-
return (_jsx(KitTree, { defaultExpandedKeys: [tree.id], multiple: multiple,
|
|
133
|
+
return (_jsx(KitTree, { defaultExpandedKeys: [tree.id], multiple: multiple, selectedKeys: selectedNodes, checkedKeys: selectedNodes, titleRender: node => {
|
|
134
|
+
const dataNode = node;
|
|
135
|
+
return (_jsx(TreeNodeTitle, { title: dataNode.title, checkable: checkable, isSelected: selectedNodes?.includes(dataNode.id), isDisabled: disabledNodes?.includes(dataNode.id) }));
|
|
136
|
+
}, onSelect: _handleSelect, onCheck: _handleCheck, treeData: treeData, loadData: _handleLoadData, checkStrictly: true, checkable: checkable }));
|
|
129
137
|
};
|
|
130
138
|
//# sourceMappingURL=SelectTreeNodeContent.js.map
|