@leav/ui 0.4.0-80a4e22 → 0.4.0-8a31349
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/form.js +5 -1
- package/dist/__mocks__/common/form.js.map +1 -1
- 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 +200 -0
- package/dist/_gqlTypes/index.js +93 -0
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordFormQuery.js +4 -0
- package/dist/_queries/records/getRecordFormQuery.js.map +1 -1
- package/dist/components/CreateDirectory/CreateDirectory.js +4 -4
- package/dist/components/CreateDirectory/CreateDirectory.js.map +1 -1
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/DeleteButton/DeleteButton.js +3 -2
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/DeleteButton/DeleteButton.js.map +1 -1
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js +8 -1
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.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 +24 -7
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +3 -1
- package/dist/components/Explorer/Explorer.js +21 -8
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/IdCard.js +1 -1
- package/dist/components/Explorer/IdCard.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/_queries/useExplorerData.d.ts +1 -0
- package/dist/components/Explorer/_queries/useExplorerData.js +16 -10
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +7 -1
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-item/useEditItemAction.d.ts +2 -1
- package/dist/components/Explorer/actions-item/useEditItemAction.js +6 -4
- package/dist/components/Explorer/actions-item/useEditItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-item/useRemoveItemAction.d.ts +3 -1
- package/dist/components/Explorer/actions-item/useRemoveItemAction.js +12 -2
- package/dist/components/Explorer/actions-item/useRemoveItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +21 -0
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js +42 -0
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.d.ts +2 -1
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +12 -3
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +5 -5
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +2 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +10 -3
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +5 -2
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +20 -4
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.d.ts +2 -0
- package/dist/components/Explorer/link-item/LinkModal.js +14 -4
- package/dist/components/Explorer/link-item/LinkModal.js.map +1 -1
- package/dist/components/Explorer/link-item/{useLinkMassAction.d.ts → useAddLinkMassAction.d.ts} +1 -1
- package/dist/components/Explorer/link-item/{useLinkMassAction.js → useAddLinkMassAction.js} +2 -2
- package/dist/components/Explorer/link-item/useAddLinkMassAction.js.map +1 -0
- package/dist/components/Explorer/link-item/useReplaceLinkMassAction.d.ts +23 -0
- package/dist/components/Explorer/link-item/useReplaceLinkMassAction.js +35 -0
- package/dist/components/Explorer/link-item/useReplaceLinkMassAction.js.map +1 -0
- package/dist/components/Explorer/list-saved-views/SavedViews.js +32 -42
- package/dist/components/Explorer/list-saved-views/SavedViews.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js +11 -9
- package/dist/components/Explorer/manage-view-settings/_shared/useAttributeDetailsData.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.d.ts +4 -0
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.d.ts +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/EditSettingsContext.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js +2 -2
- package/dist/components/Explorer/manage-view-settings/open-view-settings/useOpenViewSettings.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/LabelViewFormModal.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.d.ts +5 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js +47 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useDeleteView.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.d.ts +5 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js +48 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useEditLabelView.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.d.ts +1 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +3 -2
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.d.ts +8 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +30 -0
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.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/useLoadView.js +4 -2
- package/dist/components/Explorer/useLoadView.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 +37 -17
- 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/FiltersPanel/Filter/Filter.js +2 -2
- package/dist/components/LibraryItemsList/FiltersPanel/Filter/Filter.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/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js +3 -3
- package/dist/components/LibraryItemsList/shared/DeactivateRecordBtn/DeactivateRecordBtn.js.map +1 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.d.ts +2 -4
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +37 -39
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.js +43 -0
- package/dist/components/RecordEdition/EditRecordButtons/EditRecordButtons.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.d.ts +2 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js +25 -0
- package/dist/components/RecordEdition/EditRecordButtons/SidebarButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordButtons/index.d.ts +2 -0
- package/dist/components/RecordEdition/{EditRecordContent/uiElements/TreeField/TreeFieldValue → EditRecordButtons}/index.js +2 -2
- package/dist/components/RecordEdition/EditRecordButtons/index.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +3 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +12 -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/Frame/Frame.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js +39 -11
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.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 +3 -0
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +51 -51
- 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 +9 -7
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/Breacrumb/Breadcrumb.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.d.ts +0 -1
- package/dist/components/RecordEdition/EditRecordSidebar/EditRecordSidebar.js +18 -12
- 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/EditRecordSidebar/ValuesVersions/ValuesVersions.js +2 -2
- package/dist/components/RecordEdition/EditRecordSidebar/ValuesVersions/ValuesVersions.js.map +1 -1
- package/dist/components/RecordEdition/constants.d.ts +2 -0
- package/dist/components/RecordEdition/constants.js +6 -0
- package/dist/components/RecordEdition/constants.js.map +1 -0
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.d.ts +29 -3
- package/dist/components/RecordEdition/editRecordReducer/editRecordReducer.js +65 -5
- 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 +2 -0
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +8 -6
- 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/SimpleErrorBoundary.d.ts +1 -1
- package/dist/components/SimpleErrorBoundary/SimpleErrorBoundary.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 +4 -4
- 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 +27 -12
- package/dist/locales/fr/shared.json +27 -12
- package/dist/types/trees.d.ts +1 -0
- package/package.json +4 -4
- package/dist/components/Explorer/link-item/useLinkMassAction.js.map +0 -1
- 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.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
|
@@ -1,103 +1,111 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, 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
5
|
import { localizedTranslation } from '@leav/utils';
|
|
6
|
-
import {
|
|
7
|
-
import CreationErrorContext from '../../../../../components/RecordEdition/EditRecord/creationErrorContext';
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
8
7
|
import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
|
|
9
|
-
import {
|
|
10
|
-
import { arrayValueVersionToObject } from '../../../../../_utils';
|
|
11
|
-
import getActiveFieldValues from '../../helpers/getActiveFieldValues';
|
|
12
|
-
import { useRecordEditionContext } from '../../hooks/useRecordEditionContext';
|
|
13
|
-
import linkFieldReducer from '../../reducers/linkFieldReducer';
|
|
14
|
-
import { computeInitialState, LinkFieldReducerActionsType } from '../../reducers/linkFieldReducer/linkFieldReducer';
|
|
15
|
-
import { APICallStatus } from '../../_types';
|
|
16
|
-
import { MonoValueSelect } from '../../../../../components/RecordEdition/EditRecordContent/uiElements/LinkField/MonoValueSelect/MonoValueSelect';
|
|
17
|
-
import { AntForm } from 'aristid-ds';
|
|
18
|
-
import { MultiValueSelect } from './MultiValueSelect/MultiValueSelect';
|
|
8
|
+
import { AntForm, KitInputWrapper } from 'aristid-ds';
|
|
19
9
|
import { useLang } from '../../../../../hooks';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
errorMessage: creationErrors[attribute.id].map(err => err.message).join(' ')
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}, [creationErrors, attribute.id]);
|
|
43
|
-
const _handleDeleteValue = async (value) => {
|
|
44
|
-
const deleteRes = await onValueDelete({ payload: value.linkValue.id, id_value: value.id_value }, attribute.id);
|
|
45
|
-
if (deleteRes.status === APICallStatus.SUCCESS) {
|
|
46
|
-
dispatch({
|
|
47
|
-
type: LinkFieldReducerActionsType.DELETE_VALUE,
|
|
48
|
-
idValue: value.id_value
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const _handleUpdateValueSubmit = async (values) => {
|
|
53
|
-
const valuesToSave = values.map(value => ({
|
|
54
|
-
attribute,
|
|
55
|
-
idValue: value.idValue,
|
|
56
|
-
value: value.value
|
|
57
|
-
}));
|
|
58
|
-
const res = await onValueSubmit(valuesToSave, activeVersion);
|
|
59
|
-
if (res.status === APICallStatus.ERROR) {
|
|
60
|
-
dispatch({
|
|
61
|
-
type: LinkFieldReducerActionsType.SET_ERROR_MESSAGE,
|
|
62
|
-
errorMessage: res.error
|
|
63
|
-
});
|
|
10
|
+
import styled from 'styled-components';
|
|
11
|
+
import { LINK_FIELD_ID_PREFIX } from '../../../../../constants';
|
|
12
|
+
import { computeCalculatedFlags, computeInheritedFlags } from '../shared/calculatedInheritedFlags';
|
|
13
|
+
import { ComputeIndicator } from '../shared/ComputeIndicator';
|
|
14
|
+
import { useOutsideInteractionDetector } from '../shared/useOutsideInteractionDetector';
|
|
15
|
+
import { useLinkRecordsInCreation } from './link-record-in-creation/useLinkRecordsInCreation';
|
|
16
|
+
import { useLinkRecordsInEdition } from './link-record-in-edition/useLinkRecordsInEdition';
|
|
17
|
+
import { CREATE_RECORD_MODAL_CLASSNAME, EDIT_RECORD_MODAL_CLASSNAME, LINK_RECORDS_MODAL_CLASSNAME } from '../../../../../components/Explorer/_constants';
|
|
18
|
+
const Wrapper = styled.div `
|
|
19
|
+
margin-bottom: ${props => (props.$metadataEdit ? 0 : '1.5em')};
|
|
20
|
+
`;
|
|
21
|
+
const KitInputExtraAlignLeft = styled.div `
|
|
22
|
+
margin-right: auto;
|
|
23
|
+
line-height: 12px;
|
|
24
|
+
`;
|
|
25
|
+
const KitInputWrapperStyled = styled(KitInputWrapper) `
|
|
26
|
+
&.disabled {
|
|
27
|
+
.kit-input-wrapper-content {
|
|
28
|
+
background-color: var(--general-utilities-neutral-light);
|
|
64
29
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
...metadata,
|
|
71
|
-
value: {
|
|
72
|
-
...metadata.value,
|
|
73
|
-
version: arrayValueVersionToObject(metadata.value?.version ?? [])
|
|
74
|
-
}
|
|
75
|
-
}))
|
|
76
|
-
}));
|
|
77
|
-
dispatch({
|
|
78
|
-
type: LinkFieldReducerActionsType.ADD_VALUES,
|
|
79
|
-
values: formattedValues
|
|
80
|
-
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.error:not(.disabled) {
|
|
33
|
+
.kit-input-wrapper-content {
|
|
34
|
+
background-color: var(--general-utilities-error-light);
|
|
81
35
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ant-empty-image,
|
|
39
|
+
.ant-empty-description {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
const LinkField = ({ element, readonly, formIdToLoad, pendingValues, onDeleteMultipleValues, onValueSubmit, onValueDelete, metadataEdit = false }) => {
|
|
44
|
+
const { state, dispatch } = useEditRecordReducer();
|
|
45
|
+
const { lang } = useLang();
|
|
46
|
+
const { settings, attribute } = element;
|
|
47
|
+
const attributesPendingDefaultValues = pendingValues?.[attribute.id]
|
|
48
|
+
? Object.values(pendingValues?.[attribute.id])
|
|
49
|
+
: [];
|
|
50
|
+
const [attributePendingValues, setAttributePendingValues] = useState(attributesPendingDefaultValues);
|
|
51
|
+
const [backendValues, setBackendValues] = useState(element.values);
|
|
52
|
+
const calculatedFlags = computeCalculatedFlags(backendValues);
|
|
53
|
+
const inheritedFlags = computeInheritedFlags(backendValues);
|
|
54
|
+
const form = AntForm.useFormInstance();
|
|
55
|
+
const label = localizedTranslation(settings.label, lang);
|
|
56
|
+
const fieldErrors = form.getFieldError(attribute.id);
|
|
57
|
+
const columnsToDisplay = settings.columns?.map(({ id }) => id);
|
|
58
|
+
const isReadOnly = attribute.readonly || readonly;
|
|
59
|
+
const isFieldInError = fieldErrors.length > 0;
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
setAttributePendingValues(pendingValues?.[attribute.id]
|
|
62
|
+
? Object.values(pendingValues?.[attribute.id])
|
|
63
|
+
: []);
|
|
64
|
+
}, [pendingValues, attribute.id]);
|
|
65
|
+
useOutsideInteractionDetector({
|
|
66
|
+
attribute,
|
|
67
|
+
activeAttribute: state.activeAttribute,
|
|
68
|
+
attributePrefix: LINK_FIELD_ID_PREFIX,
|
|
69
|
+
dispatch,
|
|
70
|
+
formIdToLoad,
|
|
71
|
+
backendValues,
|
|
72
|
+
pendingValues: attributePendingValues,
|
|
73
|
+
allowedSelectors: [
|
|
74
|
+
'div[role="status"]:has(.kit-snackbar-message)',
|
|
75
|
+
'.kit-modal-wrapper',
|
|
76
|
+
`.${CREATE_RECORD_MODAL_CLASSNAME}`,
|
|
77
|
+
`.${LINK_RECORDS_MODAL_CLASSNAME}`,
|
|
78
|
+
`.${EDIT_RECORD_MODAL_CLASSNAME}`
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
const { UnlinkAllRecordsInCreation, LinkRecordsInCreation } = useLinkRecordsInCreation({
|
|
82
|
+
attribute,
|
|
83
|
+
libraryId: attribute.linked_library.id,
|
|
84
|
+
pendingValues: attributePendingValues,
|
|
85
|
+
activeAttribute: state.activeAttribute,
|
|
86
|
+
dispatch,
|
|
87
|
+
isHookUsed: formIdToLoad === 'creation',
|
|
88
|
+
isReadOnly,
|
|
89
|
+
isFieldInError,
|
|
90
|
+
onValueSubmit,
|
|
91
|
+
onValueDelete
|
|
92
|
+
});
|
|
93
|
+
const { UnlinkAllRecordsInEdition, LinkRecordsInEditionExplorer } = useLinkRecordsInEdition({
|
|
94
|
+
libraryId: state.libraryId,
|
|
95
|
+
recordId: state.record?.id,
|
|
96
|
+
attribute,
|
|
97
|
+
columnsToDisplay,
|
|
98
|
+
backendValues,
|
|
99
|
+
setBackendValues,
|
|
100
|
+
activeAttribute: state.activeAttribute,
|
|
101
|
+
dispatch,
|
|
102
|
+
isHookUsed: formIdToLoad !== 'creation',
|
|
103
|
+
isReadOnly,
|
|
104
|
+
isFieldInError,
|
|
105
|
+
hasNoValue: backendValues.length === 0,
|
|
106
|
+
onDeleteMultipleValues
|
|
107
|
+
});
|
|
108
|
+
return (_jsx(Wrapper, { "$metadataEdit": metadataEdit, children: _jsx(AntForm.Item, { name: attribute.id, noStyle: true, children: _jsx(KitInputWrapperStyled, { id: LINK_FIELD_ID_PREFIX + attribute.id, label: label, required: attribute.required, bordered: true, disabled: isReadOnly, status: isFieldInError ? 'error' : undefined, helper: isFieldInError ? String(fieldErrors[0]) : undefined, extra: _jsxs(_Fragment, { children: [_jsx(KitInputExtraAlignLeft, { children: _jsx(ComputeIndicator, { calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags }) }), formIdToLoad === 'creation' ? UnlinkAllRecordsInCreation : UnlinkAllRecordsInEdition] }), children: formIdToLoad === 'creation' ? LinkRecordsInCreation : LinkRecordsInEditionExplorer }) }) }));
|
|
101
109
|
};
|
|
102
110
|
export default LinkField;
|
|
103
111
|
//# sourceMappingURL=LinkField.js.map
|
package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAwB,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"LinkField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAwB,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAoB,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qEAAqE,CAAC;AAKzG,OAAO,EAAC,OAAO,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AACpD,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACjG,OAAO,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,wBAAwB,EAAC,MAAM,oDAAoD,CAAC;AAC5F,OAAO,EAAC,uBAAuB,EAAC,MAAM,kDAAkD,CAAC;AACzF,OAAO,EACH,6BAA6B,EAC7B,2BAA2B,EAC3B,4BAA4B,EAC/B,MAAM,oCAAoC,CAAC;AAI5C,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAA0B;qBAC/B,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;CAChE,CAAC;AAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGxC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B;QAChB,aAAa;QACb,gBAAgB;QAChB,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,QAAQ;QACR,UAAU,EAAE,YAAY,KAAK,UAAU;QACvC,UAAU;QACV,cAAc;QACd,UAAU,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC;QACtC,sBAAsB;KACzB,CAAC,CAAC;IAEH,OAAO,CACH,KAAC,OAAO,qBAAgB,YAAY,YAChC,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,OAAO,kBACrC,KAAC,qBAAqB,IAClB,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAAC,EAAE,EACvC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAC5B,QAAQ,QACR,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC5C,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAC3D,KAAK,EACD,8BACI,KAAC,sBAAsB,cACnB,KAAC,gBAAgB,IAAC,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,GAAI,GACjE,EACxB,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,yBAAyB,IACtF,YAGN,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,4BAA4B,GAC/D,GACb,GACT,CACb,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { EditRecordModal } from '../../../../../../components/RecordEdition/EditRecordModal';
|
|
7
|
+
import { RecordFilterCondition, useExplorerLibraryDataLazyQuery } from '../../../../../../_gqlTypes';
|
|
8
|
+
import { EDIT_RECORD_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
|
|
9
|
+
export const useEditRecord = () => {
|
|
10
|
+
const [editingItem, setEditingItem] = useState(null);
|
|
11
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
12
|
+
const [refreshItem] = useExplorerLibraryDataLazyQuery({ fetchPolicy: 'network-only' });
|
|
13
|
+
const openModal = (item) => {
|
|
14
|
+
setEditingItem(item);
|
|
15
|
+
setIsModalVisible(true);
|
|
16
|
+
};
|
|
17
|
+
const _handleEditModalClose = (item) => {
|
|
18
|
+
refreshItem({
|
|
19
|
+
variables: {
|
|
20
|
+
libraryId: item.libraryId,
|
|
21
|
+
attributeIds: ['id'],
|
|
22
|
+
pagination: { limit: 1 },
|
|
23
|
+
filters: [
|
|
24
|
+
{
|
|
25
|
+
condition: RecordFilterCondition.EQUAL,
|
|
26
|
+
field: 'id',
|
|
27
|
+
value: item.itemId
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
setEditingItem(null);
|
|
33
|
+
};
|
|
34
|
+
return {
|
|
35
|
+
openModal,
|
|
36
|
+
EditRecordModal: isModalVisible && editingItem !== null ? (_jsx(EditRecordModal, { className: EDIT_RECORD_MODAL_CLASSNAME, open: true, record: editingItem.whoAmI, library: editingItem.libraryId, onClose: () => _handleEditModalClose(editingItem) })) : null
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useEditRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEditRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item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AI,CAAC,CAAC,CAAC,CACrC,KAAC,eAAe,IACZ,SAAS,EAAE,2BAA2B,EACtC,IAAI,QACJ,MAAM,EAAE,WAAW,CAAC,MAAM,EAC1B,OAAO,EAAE,WAAW,CAAC,SAAS,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAqB,CAAC,WAAW,CAAC,GACnD,CACL,CAAC,CAAC,CAAC,IAAI;KACf,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IItemData } from '../../../../../../components/Explorer/_types';
|
|
2
|
+
interface IUnselectRecordProps {
|
|
3
|
+
unlinkRecords: (recordIds: string[]) => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const useUnselectRecord: ({ unlinkRecords }: IUnselectRecordProps) => {
|
|
6
|
+
callback: (item: IItemData) => void;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { KitModal } from 'aristid-ds';
|
|
5
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
6
|
+
export const useUnselectRecord = ({ unlinkRecords }) => {
|
|
7
|
+
const { t } = useSharedTranslation();
|
|
8
|
+
return {
|
|
9
|
+
callback: (item) => {
|
|
10
|
+
KitModal.confirm({
|
|
11
|
+
type: 'confirm',
|
|
12
|
+
dangerConfirm: true,
|
|
13
|
+
content: t('record_edition.delete_link_confirm'),
|
|
14
|
+
okText: t('global.submit') ?? undefined,
|
|
15
|
+
cancelText: t('global.cancel') ?? undefined,
|
|
16
|
+
onOk: async () => {
|
|
17
|
+
unlinkRecords([item.itemId]);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useUnselectRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnselectRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAOpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAC,aAAa,EAAuB,EAAE,EAAE;IACvE,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO;QACH,QAAQ,EAAE,CAAC,IAAe,EAAE,EAAE;YAC1B,QAAQ,CAAC,OAAO,CAAC;gBACb,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,CAAC,oCAAoC,CAAC;gBAChD,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBACvC,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;oBACb,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;gBACjC,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MassSelection } from '../../../../../../components/Explorer/_types';
|
|
2
|
+
import { RecordFilterInput } from '../../../../../../_gqlTypes';
|
|
3
|
+
interface IUnselectAllRecordsProps {
|
|
4
|
+
unlinkRecords: (recordIds: string[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useUnselectAllRecords: ({ unlinkRecords }: IUnselectAllRecordsProps) => {
|
|
7
|
+
callback: (massSelectionFilter: RecordFilterInput[], _massSelection: MassSelection) => void;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
2
|
+
// This file is released under LGPL V3
|
|
3
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
|
+
import { KitModal } from 'aristid-ds';
|
|
5
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
6
|
+
export const useUnselectAllRecords = ({ unlinkRecords }) => {
|
|
7
|
+
const { t } = useSharedTranslation();
|
|
8
|
+
return {
|
|
9
|
+
callback: (massSelectionFilter, _massSelection) => {
|
|
10
|
+
KitModal.confirm({
|
|
11
|
+
type: 'confirm',
|
|
12
|
+
dangerConfirm: true,
|
|
13
|
+
content: t('record_edition.delete_links_confirm'),
|
|
14
|
+
okText: t('global.submit') ?? undefined,
|
|
15
|
+
cancelText: t('global.cancel') ?? undefined,
|
|
16
|
+
onOk: async () => {
|
|
17
|
+
unlinkRecords(massSelectionFilter.map(filter => filter.value));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=useUnselectAllRecords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnselectAllRecords.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAQpE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAC,aAAa,EAA2B,EAAE,EAAE;IAC/E,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO;QACH,QAAQ,EAAE,CAAC,mBAAwC,EAAE,cAA6B,EAAE,EAAE;YAClF,QAAQ,CAAC,OAAO,CAAC;gBACb,IAAI,EAAE,SAAS;gBACf,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,CAAC,CAAC,qCAAqC,CAAC;gBACjD,MAAM,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBACvC,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC,IAAI,SAAS;gBAC3C,IAAI,EAAE,KAAK,IAAI,EAAE;oBACb,aAAa,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;gBACnE,CAAC;aACJ,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface IUseCreateRecordProps {
|
|
2
|
+
linkRecords: (recordIds: string[]) => void;
|
|
3
|
+
}
|
|
4
|
+
export declare const useCreateRecord: ({ linkRecords }: IUseCreateRecordProps) => {
|
|
5
|
+
openModal: (libraryIdParam: string) => void;
|
|
6
|
+
CreateRecordModal: JSX.Element;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { EditRecordModal } from '../../../../../../components/RecordEdition/EditRecordModal';
|
|
7
|
+
import { CREATE_RECORD_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
|
|
8
|
+
export const useCreateRecord = ({ linkRecords }) => {
|
|
9
|
+
const [libraryId, setLibraryId] = useState(null);
|
|
10
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
11
|
+
const openModal = (libraryIdParam) => {
|
|
12
|
+
setLibraryId(libraryIdParam);
|
|
13
|
+
setIsModalVisible(true);
|
|
14
|
+
};
|
|
15
|
+
const closeModal = () => {
|
|
16
|
+
setIsModalVisible(false);
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
openModal,
|
|
20
|
+
CreateRecordModal: isModalVisible && libraryId !== null ? (_jsx(EditRecordModal, { className: CREATE_RECORD_MODAL_CLASSNAME, open: true, record: null, library: libraryId, onClose: closeModal, onCreate: newRecord => {
|
|
21
|
+
linkRecords([newRecord.id]);
|
|
22
|
+
closeModal();
|
|
23
|
+
}, submitButtons: ['create'] })) : null
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useCreateRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCreateRecord.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,eAAe,EAAC,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAC,6BAA6B,EAAC,MAAM,oCAAoC,CAAC;AAMjF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAC,WAAW,EAAwB,EAAE,EAAE;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,CAAC,cAAsB,EAAE,EAAE;QACzC,YAAY,CAAC,cAAc,CAAC,CAAC;QAC7B,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;QACH,SAAS;QACT,iBAAiB,EACb,cAAc,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,CACnC,KAAC,eAAe,IACZ,SAAS,EAAE,6BAA6B,EACxC,IAAI,QACJ,MAAM,EAAE,IAAI,EACZ,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,SAAS,CAAC,EAAE;gBAClB,WAAW,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC5B,UAAU,EAAE,CAAC;YACjB,CAAC,EACD,aAAa,EAAE,CAAC,QAAQ,CAAC,GAC3B,CACL,CAAC,CAAC,CAAC,IAAI;KACf,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type SelectionMode = 'simple' | 'multiple';
|
|
2
|
+
interface IUseRecordSelectorProps {
|
|
3
|
+
libraryId: string;
|
|
4
|
+
selectionMode: SelectionMode;
|
|
5
|
+
isReplacementMode: boolean;
|
|
6
|
+
linkRecords: (recordIds: string[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useRecordSelector: ({ libraryId, selectionMode, isReplacementMode, linkRecords }: IUseRecordSelectorProps) => {
|
|
9
|
+
openModal: () => void;
|
|
10
|
+
RecordSelectorModal: JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
|
+
// This file is released under LGPL V3
|
|
4
|
+
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { SelectRecordForLinkModal } from '../../../../../../components/SelectRecordForLinkModal';
|
|
7
|
+
import { LINK_RECORDS_MODAL_CLASSNAME } from '../../../../../../components/Explorer/_constants';
|
|
8
|
+
export const useRecordSelector = ({ libraryId, selectionMode, isReplacementMode, linkRecords }) => {
|
|
9
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
10
|
+
const openModal = () => {
|
|
11
|
+
setIsModalVisible(true);
|
|
12
|
+
};
|
|
13
|
+
const closeModal = () => {
|
|
14
|
+
setIsModalVisible(false);
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
openModal,
|
|
18
|
+
RecordSelectorModal: isModalVisible ? (_jsx(SelectRecordForLinkModal, { className: LINK_RECORDS_MODAL_CLASSNAME, open: true, replacementMode: isReplacementMode, childLibraryId: libraryId, selectionMode: selectionMode, hideSelectAllAction: selectionMode !== 'multiple', onSelectionCompleted: data => {
|
|
19
|
+
linkRecords(data.records.list.map(record => record.id));
|
|
20
|
+
closeModal();
|
|
21
|
+
}, onClose: closeModal })) : null
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useRecordSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecordSelector.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAC,wBAAwB,EAAC,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAC,4BAA4B,EAAC,MAAM,oCAAoC,CAAC;AAWhF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAC9B,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,WAAW,EACW,EAAE,EAAE;IAC1B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,GAAG,EAAE;QACnB,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,EAAE;QACpB,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;QACH,SAAS;QACT,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC,CAClC,KAAC,wBAAwB,IACrB,SAAS,EAAE,4BAA4B,EACvC,IAAI,QACJ,eAAe,EAAE,iBAAiB,EAClC,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,aAAa,KAAK,UAAU,EACjD,oBAAoB,EAAE,IAAI,CAAC,EAAE;gBACzB,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;gBACxD,UAAU,EAAE,CAAC;YACjB,CAAC,EACD,OAAO,EAAE,UAAU,GACrB,CACL,CAAC,CAAC,CAAC,IAAI;KACX,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
|
+
import { DeleteValueFunc, SubmitValueFunc } from '../../../_types';
|
|
3
|
+
import { IExplorerFilterStandard } from '../../../../../../components/Explorer/_types';
|
|
4
|
+
interface IUseLinkRecordsProps {
|
|
5
|
+
attribute: RecordFormAttributeFragment;
|
|
6
|
+
libraryId: string;
|
|
7
|
+
onValueSubmit: SubmitValueFunc;
|
|
8
|
+
onValueDelete: DeleteValueFunc;
|
|
9
|
+
}
|
|
10
|
+
export declare const useLinkRecords: ({ attribute, libraryId, onValueSubmit, onValueDelete }: IUseLinkRecordsProps) => {
|
|
11
|
+
explorerFilters: IExplorerFilterStandard[];
|
|
12
|
+
explorerKey: number;
|
|
13
|
+
selectedRecordIds: string[];
|
|
14
|
+
linkRecords: (recordIds: string[]) => void;
|
|
15
|
+
unlinkRecords: (recordIds?: string[]) => void;
|
|
16
|
+
hasNoSelectedRecord: boolean;
|
|
17
|
+
canDeleteAllValues: boolean;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { FILTER_ON_ID_DEFAULT_FIELDS, NO_RECORD_FILTERS } from '../shared/utils';
|
|
3
|
+
import { AntForm } from 'aristid-ds';
|
|
4
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
5
|
+
export const useLinkRecords = ({ attribute, libraryId, onValueSubmit, onValueDelete }) => {
|
|
6
|
+
const { t } = useSharedTranslation();
|
|
7
|
+
const [selectedRecordIds, setSelectedRecordIds] = useState([]);
|
|
8
|
+
const [explorerFilters, setExplorerFilters] = useState(NO_RECORD_FILTERS);
|
|
9
|
+
const [explorerKey, setExplorerKey] = useState(0);
|
|
10
|
+
const updateExplorerKey = () => setExplorerKey(explorerKey + 1);
|
|
11
|
+
const form = AntForm.useFormInstance();
|
|
12
|
+
const linkRecords = (recordIds) => {
|
|
13
|
+
if (!attribute.multiple_values) {
|
|
14
|
+
selectedRecordIds.forEach(id => {
|
|
15
|
+
const originalIndex = selectedRecordIds.indexOf(id);
|
|
16
|
+
// In Create mode, we don't really delete the value, we just remove them from the pending values
|
|
17
|
+
onValueDelete({
|
|
18
|
+
id_value: `pending_${originalIndex + 1}`
|
|
19
|
+
}, attribute.id);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const newSelectedRecordIds = attribute.multiple_values ? [...selectedRecordIds, ...recordIds] : [...recordIds];
|
|
23
|
+
setSelectedRecordIds(newSelectedRecordIds);
|
|
24
|
+
form.setFieldValue(attribute.id, newSelectedRecordIds);
|
|
25
|
+
const newFilters = newSelectedRecordIds.map(id => ({
|
|
26
|
+
...FILTER_ON_ID_DEFAULT_FIELDS,
|
|
27
|
+
value: id
|
|
28
|
+
}));
|
|
29
|
+
setExplorerFilters(newFilters.length > 0 ? newFilters : NO_RECORD_FILTERS);
|
|
30
|
+
const valuesToAddInPending = recordIds.map(id => ({
|
|
31
|
+
attribute,
|
|
32
|
+
idValue: null,
|
|
33
|
+
value: {
|
|
34
|
+
id,
|
|
35
|
+
whoAmI: {
|
|
36
|
+
id,
|
|
37
|
+
library: {
|
|
38
|
+
id: libraryId
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
form.setFields([
|
|
44
|
+
{
|
|
45
|
+
name: attribute.id,
|
|
46
|
+
errors: attribute.required && newSelectedRecordIds.length === 0 ? [t('errors.standard_field_required')] : []
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
// In Create mode, we don't really submit the values, we just add them to the pending values
|
|
50
|
+
onValueSubmit(valuesToAddInPending, null);
|
|
51
|
+
updateExplorerKey();
|
|
52
|
+
};
|
|
53
|
+
const unlinkRecords = (recordIds) => {
|
|
54
|
+
selectedRecordIds
|
|
55
|
+
.filter(id => (recordIds ? recordIds.includes(id) : true))
|
|
56
|
+
.forEach(id => {
|
|
57
|
+
const originalIndex = selectedRecordIds.indexOf(id);
|
|
58
|
+
// In Create mode, we don't really delete the value, we just remove them from the pending values
|
|
59
|
+
onValueDelete({
|
|
60
|
+
id_value: `pending_${originalIndex + 1}`
|
|
61
|
+
}, attribute.id);
|
|
62
|
+
});
|
|
63
|
+
if (!recordIds) {
|
|
64
|
+
setSelectedRecordIds([]);
|
|
65
|
+
setExplorerFilters(NO_RECORD_FILTERS);
|
|
66
|
+
form.setFieldValue(attribute.id, []);
|
|
67
|
+
updateExplorerKey();
|
|
68
|
+
if (attribute.required) {
|
|
69
|
+
form.setFields([
|
|
70
|
+
{
|
|
71
|
+
name: attribute.id,
|
|
72
|
+
errors: [t('errors.standard_field_required')]
|
|
73
|
+
}
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const newSelectedRecordIds = selectedRecordIds.filter(id => !recordIds.includes(id));
|
|
79
|
+
setSelectedRecordIds(newSelectedRecordIds);
|
|
80
|
+
form.setFieldValue(attribute.id, newSelectedRecordIds);
|
|
81
|
+
form.setFields([
|
|
82
|
+
{
|
|
83
|
+
name: attribute.id,
|
|
84
|
+
errors: attribute.required && newSelectedRecordIds.length === 0 ? [t('errors.standard_field_required')] : []
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
const newExplorerFilters = explorerFilters.filter(filter => !recordIds.includes(filter.value));
|
|
88
|
+
setExplorerFilters(newExplorerFilters.length > 0 ? newExplorerFilters : NO_RECORD_FILTERS);
|
|
89
|
+
updateExplorerKey();
|
|
90
|
+
};
|
|
91
|
+
const hasNoSelectedRecord = selectedRecordIds.length === 0;
|
|
92
|
+
const canDeleteAllValues = selectedRecordIds.length > 1 && attribute.multiple_values && !attribute.required;
|
|
93
|
+
return {
|
|
94
|
+
explorerFilters,
|
|
95
|
+
explorerKey,
|
|
96
|
+
selectedRecordIds,
|
|
97
|
+
linkRecords,
|
|
98
|
+
unlinkRecords,
|
|
99
|
+
hasNoSelectedRecord,
|
|
100
|
+
canDeleteAllValues
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=useLinkRecords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLinkRecords.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAC,2BAA2B,EAAE,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CA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AC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;QAE3F,iBAAiB,EAAE,CAAC;IACxB,CAAC,CAAC;IAEF,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,MAAM,KAAK,CAAC,CAAC;IAE3D,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,IAAI,SAAS,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;IAE5G,OAAO;QACH,eAAe;QACf,WAAW;QACX,iBAAiB;QACjB,WAAW;QACX,aAAa;QACb,mBAAmB;QACnB,kBAAkB;KACrB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RecordFormAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
|
+
import { DeleteValueFunc, SubmitValueFunc } from '../../../_types';
|
|
3
|
+
import { Dispatch } from 'react';
|
|
4
|
+
import { RecordFormElementsValueLinkValue } from '../../../../../../hooks/useGetRecordForm';
|
|
5
|
+
import { IEditRecordReducerActions, IRecordPropertyWithAttribute } from '../../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
6
|
+
interface IUseLinkRecordsInCreationProps {
|
|
7
|
+
attribute: RecordFormAttributeFragment;
|
|
8
|
+
libraryId: string;
|
|
9
|
+
pendingValues: RecordFormElementsValueLinkValue[];
|
|
10
|
+
activeAttribute: IRecordPropertyWithAttribute | null;
|
|
11
|
+
dispatch: Dispatch<IEditRecordReducerActions>;
|
|
12
|
+
isHookUsed: boolean;
|
|
13
|
+
isReadOnly: boolean;
|
|
14
|
+
isFieldInError: boolean;
|
|
15
|
+
onValueSubmit: SubmitValueFunc;
|
|
16
|
+
onValueDelete: DeleteValueFunc;
|
|
17
|
+
}
|
|
18
|
+
export declare const useLinkRecordsInCreation: ({ attribute, libraryId, pendingValues, activeAttribute, dispatch, isHookUsed, isReadOnly, isFieldInError, onValueSubmit, onValueDelete }: IUseLinkRecordsInCreationProps) => {
|
|
19
|
+
UnlinkAllRecordsInCreation: JSX.Element;
|
|
20
|
+
LinkRecordsInCreation: JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export {};
|