@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeFieldWrapper.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeFieldWrapper.tsx"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAExD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;kBACxB,gBAAgB;;;;;CAKjC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
2
|
+
interface IUseTreeNodeItemProps {
|
|
3
|
+
color?: RecordFormElementsValueTreeValue['treeValue']['record']['whoAmI']['color'];
|
|
4
|
+
label?: RecordFormElementsValueTreeValue['treeValue']['record']['whoAmI']['label'];
|
|
5
|
+
ancestors?: RecordFormElementsValueTreeValue['treeValue']['ancestors'];
|
|
6
|
+
canDelete?: boolean;
|
|
7
|
+
onClickToDelete?: (node: RecordFormElementsValueTreeValue) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const TreeNodeItem: ({ color, label, ancestors, canDelete, onClickToDelete }: IUseTreeNodeItemProps) => JSX.Element;
|
|
10
|
+
export default TreeNodeItem;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
3
|
+
import { KitAvatar, KitBreadcrumb, KitIdCard, KitItemList, KitSpace } from 'aristid-ds';
|
|
4
|
+
import { FaTrash } from 'react-icons/fa';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
const KitItemListStyled = styled(KitItemList) `
|
|
7
|
+
border: none;
|
|
8
|
+
padding: 0;
|
|
9
|
+
|
|
10
|
+
&:hover:not(.kit-item-list-disabled) {
|
|
11
|
+
box-shadow: none;
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
const KitBreadcrumbStyled = styled(KitBreadcrumb) `
|
|
15
|
+
&.ant-breadcrumb {
|
|
16
|
+
li:last-child .ant-breadcrumb-link {
|
|
17
|
+
color: var(--general-utilities-text-primary);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
a {
|
|
21
|
+
cursor: initial;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
background-color: initial;
|
|
26
|
+
cursor: initial;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const BREADCRUMB_SEPARATOR = '>';
|
|
33
|
+
const NOT_FOCUSABLE = -1;
|
|
34
|
+
const TreeNodeItem = ({ color, label, ancestors, canDelete, onClickToDelete }) => {
|
|
35
|
+
const { t } = useSharedTranslation();
|
|
36
|
+
return (_jsx(KitItemListStyled, { tabIndex: NOT_FOCUSABLE, idCardSubstitute: _jsxs(KitSpace, { direction: "horizontal", children: [_jsx(KitAvatar, { color: color, label: label, shape: "square" }), _jsxs(KitSpace, { direction: "vertical", size: "none", children: [_jsx(KitIdCard, { title: label }), _jsx(KitBreadcrumbStyled, { items: ancestors?.map(ancestor => ({
|
|
37
|
+
title: ancestor.record.whoAmI.label
|
|
38
|
+
})), separator: BREADCRUMB_SEPARATOR })] })] }), actions: canDelete
|
|
39
|
+
? [
|
|
40
|
+
{
|
|
41
|
+
key: 'delete',
|
|
42
|
+
icon: _jsx(FaTrash, {}),
|
|
43
|
+
label: t('global.delete'),
|
|
44
|
+
title: t('global.delete'),
|
|
45
|
+
onClick: onClickToDelete
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
: undefined }));
|
|
49
|
+
};
|
|
50
|
+
export default TreeNodeItem;
|
|
51
|
+
//# sourceMappingURL=TreeNodeItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeItem.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAA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KAAC,OAAO,KAAG;oBACjB,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC;oBACzB,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC;oBACzB,OAAO,EAAE,eAAe;iBAC3B;aACJ;YACH,CAAC,CAAC,SAAS,GAErB,CACL,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
2
|
+
import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
3
|
+
interface IUseDisplayTreeNodeProps {
|
|
4
|
+
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
5
|
+
backendValues: RecordFormElementsValueTreeValue[];
|
|
6
|
+
removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useDisplayTreeNode: ({ attribute, backendValues, removeTreeNode }: IUseDisplayTreeNodeProps) => {
|
|
9
|
+
TreeNodeList: JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import TreeNodeItem from './TreeNodeItem';
|
|
3
|
+
import { TreeFieldWrapper } from './TreeFieldWrapper';
|
|
4
|
+
export const useDisplayTreeNode = ({ attribute, backendValues, removeTreeNode }) => ({
|
|
5
|
+
TreeNodeList: (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { color: value.treeValue.record.whoAmI.color, label: value.treeValue.record.whoAmI.label, ancestors: value.treeValue.ancestors, canDelete: (attribute.required && attribute.multiple_values && backendValues.length > 1) ||
|
|
6
|
+
(!attribute.required && attribute.multiple_values), onClickToDelete: () => removeTreeNode(value) }, index))) }))
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=useDisplayTreeNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDisplayTreeNode.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.tsx"],"names":[],"mappings":";AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAQpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAC,SAAS,EAAE,aAAa,EAAE,cAAc,EAA2B,EAAE,EAAE,CAAC,CAAC;IACzG,YAAY,EAAE,CACV,KAAC,gBAAgB,cACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,YAAY,IAET,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAC1C,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,EACpC,SAAS,EACL,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;gBAC7E,CAAC,CAAC,SAAS,CAAC,QAAQ,IAAI,SAAS,CAAC,eAAe,CAAC,EAEtD,eAAe,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IARvC,KAAK,CASZ,CACL,CAAC,GACa,CACtB;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
|
+
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
3
|
+
import { ITreeNodeWithRecord } from '../../../../../../types';
|
|
4
|
+
import { FunctionComponent } from 'react';
|
|
5
|
+
interface ISelectTreeNodeModalProps {
|
|
6
|
+
title: string;
|
|
7
|
+
open: boolean;
|
|
8
|
+
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
9
|
+
backendValues: RecordFormElementsValueTreeValue[];
|
|
10
|
+
onConfirm: (selectedNodes: ITreeNodeWithRecord[]) => void;
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const SelectTreeNodeModal: FunctionComponent<ISelectTreeNodeModalProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } 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 { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { SelectTreeNode } from '../../../../../../components/SelectTreeNode';
|
|
8
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
9
|
+
import { KitButton, KitModal } from 'aristid-ds';
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { FaCheck } from 'react-icons/fa';
|
|
12
|
+
const SELECT_TREE_NODE_MODAL_HEIGHT = '563px';
|
|
13
|
+
const SELECT_TREE_NODE_MODAL_WIDTH = '656px';
|
|
14
|
+
export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onConfirm, onClose, className }) => {
|
|
15
|
+
const { t } = useSharedTranslation();
|
|
16
|
+
const [selectedNodes, setSelectedNode] = useState([]);
|
|
17
|
+
const _handleOnSelect = (node, selected) => {
|
|
18
|
+
if (!attribute.multiple_values) {
|
|
19
|
+
setSelectedNode(selected ? [node] : []);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (selected) {
|
|
23
|
+
setSelectedNode([...selectedNodes, node]);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
setSelectedNode(selectedNodes.filter(selectedValue => selectedValue.id !== node.id));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const _handleOnCheck = (selection) => {
|
|
30
|
+
setSelectedNode(selection.map(node => node).filter(node => !node?.disabled));
|
|
31
|
+
};
|
|
32
|
+
const _handleOnConfirm = () => {
|
|
33
|
+
onConfirm(selectedNodes);
|
|
34
|
+
onClose();
|
|
35
|
+
};
|
|
36
|
+
return (_jsx(KitModal, { className: className, width: SELECT_TREE_NODE_MODAL_WIDTH, height: SELECT_TREE_NODE_MODAL_HEIGHT, title: title, isOpen: open, close: onClose, footer: _jsxs(_Fragment, { children: [_jsx(KitButton, { icon:
|
|
37
|
+
// We can't used react-icons here because it's doesn't have the faXmark icon
|
|
38
|
+
_jsx(FontAwesomeIcon, { icon: faXmark }), onClick: onClose, children: t('global.close') }), _jsx(KitButton, { type: "primary", icon: _jsx(FaCheck, {}), onClick: _handleOnConfirm, children: t('global.confirm') })] }), showCloseIcon: true, children: _jsx(SelectTreeNode, { treeId: attribute.linked_tree.id, selectedNodes: [
|
|
39
|
+
...backendValues.map(value => value.treeValue.id),
|
|
40
|
+
...selectedNodes.map(node => node.id)
|
|
41
|
+
], disabledNodes: backendValues.map(value => value.treeValue.id), onSelect: _handleOnSelect, onCheck: _handleOnCheck, checkable: attribute.multiple_values, multiple // We want to be able to set as selected in the tree components, the nodes that are already selected and the disabled nodes
|
|
42
|
+
: true, canSelectRoot: true }) }));
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=SelectTreeNodeModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectTreeNodeModal.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAs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SAAS,CAAC,EAAE,CAAC,EAC7D,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,SAAS,CAAC,eAAe,EACpC,QAAQ,CAAC,2HAA2H;oBACpI,aAAa,SACf,GACK,CACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
3
|
+
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
4
|
+
import { DeleteMultipleValuesFunc, DeleteValueFunc, SubmitValueFunc } from '../../../_types';
|
|
5
|
+
interface IUseManageTreeNodeSelectionProps {
|
|
6
|
+
modaleTitle: string;
|
|
7
|
+
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
8
|
+
backendValues: RecordFormElementsValueTreeValue[];
|
|
9
|
+
setBackendValues: Dispatch<SetStateAction<RecordFormElementsValueTreeValue[]>>;
|
|
10
|
+
onValueSubmit: SubmitValueFunc;
|
|
11
|
+
onValueDelete: DeleteValueFunc;
|
|
12
|
+
onDeleteMultipleValues: DeleteMultipleValuesFunc;
|
|
13
|
+
isReadOnly: boolean;
|
|
14
|
+
isFieldInError: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const useManageTreeNodeSelection: ({ modaleTitle, attribute, backendValues, setBackendValues, onValueSubmit, onValueDelete, onDeleteMultipleValues, isReadOnly, isFieldInError }: IUseManageTreeNodeSelectionProps) => {
|
|
17
|
+
openModal: () => void;
|
|
18
|
+
removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue, skipAfterRemove?: boolean) => Promise<void>;
|
|
19
|
+
actionButtonLabel: string;
|
|
20
|
+
SelectTreeNodeModal: JSX.Element;
|
|
21
|
+
RemoveAllTreeNodes: JSX.Element;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
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 { useEffect, useState } from 'react';
|
|
6
|
+
import { SelectTreeNodeModal } from './SelectTreeNodeModal';
|
|
7
|
+
import { APICallStatus } from '../../../_types';
|
|
8
|
+
import { arrayValueVersionToObject } from '../../../../../../_utils';
|
|
9
|
+
import { DeleteAllValuesButton } from '../../shared/DeleteAllValuesButton';
|
|
10
|
+
import { AntForm } from 'aristid-ds';
|
|
11
|
+
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
12
|
+
export const useManageTreeNodeSelection = ({ modaleTitle, attribute, backendValues, setBackendValues, onValueSubmit, onValueDelete, onDeleteMultipleValues, isReadOnly, isFieldInError }) => {
|
|
13
|
+
const { t } = useSharedTranslation();
|
|
14
|
+
const form = AntForm.useFormInstance();
|
|
15
|
+
const [isModalVisible, setIsModalVisible] = useState(false);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (backendValues.length === 0 && attribute.required) {
|
|
18
|
+
// Set field in error when TreeField is displayed for the first time. Otherwise, errors will be handled by other functions in this file.
|
|
19
|
+
form.setFields([
|
|
20
|
+
{
|
|
21
|
+
name: attribute.id,
|
|
22
|
+
errors: [t('errors.standard_field_required')]
|
|
23
|
+
}
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
}, []);
|
|
27
|
+
const openModal = () => {
|
|
28
|
+
setIsModalVisible(true);
|
|
29
|
+
};
|
|
30
|
+
const closeModal = () => {
|
|
31
|
+
setIsModalVisible(false);
|
|
32
|
+
};
|
|
33
|
+
const addTreeNodes = async (selectedNodes) => {
|
|
34
|
+
const valuesToSave = selectedNodes.map(node => ({
|
|
35
|
+
attribute,
|
|
36
|
+
idValue: null,
|
|
37
|
+
value: node
|
|
38
|
+
}));
|
|
39
|
+
// When we will handle computed values, we will need to passe the active version (if still needed)
|
|
40
|
+
const result = await onValueSubmit(valuesToSave, null);
|
|
41
|
+
if (!attribute.multiple_values && backendValues.length > 0) {
|
|
42
|
+
// As we can't replace a single value, we need to remove the previous one
|
|
43
|
+
await removeTreeNode(backendValues[0], true);
|
|
44
|
+
}
|
|
45
|
+
if (result.status === APICallStatus.SUCCESS) {
|
|
46
|
+
const formattedValues = result.values.map(value => ({
|
|
47
|
+
...value,
|
|
48
|
+
version: arrayValueVersionToObject(value.version),
|
|
49
|
+
metadata: value.metadata?.map(metadata => ({
|
|
50
|
+
...metadata,
|
|
51
|
+
value: {
|
|
52
|
+
...metadata.value,
|
|
53
|
+
version: arrayValueVersionToObject(metadata.value.version ?? [])
|
|
54
|
+
}
|
|
55
|
+
}))
|
|
56
|
+
}));
|
|
57
|
+
const updatedValues = attribute.multiple_values
|
|
58
|
+
? [...backendValues, ...formattedValues]
|
|
59
|
+
: [...formattedValues];
|
|
60
|
+
form.setFieldValue(attribute.id, [...updatedValues.map(({ treeValue }) => treeValue.id)]);
|
|
61
|
+
form.setFields([
|
|
62
|
+
{
|
|
63
|
+
name: attribute.id,
|
|
64
|
+
errors: []
|
|
65
|
+
}
|
|
66
|
+
]);
|
|
67
|
+
setBackendValues(updatedValues);
|
|
68
|
+
}
|
|
69
|
+
if (result.status === APICallStatus.ERROR) {
|
|
70
|
+
const selectedNodesById = selectedNodes.reduce((acc, cur) => ({ ...acc, [cur.id]: cur }), {});
|
|
71
|
+
const errorsMessage = result.errors?.map(err => {
|
|
72
|
+
const linkedRecordLabel = selectedNodesById[err.input].title || selectedNodesById[err.input].id;
|
|
73
|
+
return `${linkedRecordLabel}: ${err.message}`;
|
|
74
|
+
});
|
|
75
|
+
form.setFields([
|
|
76
|
+
{
|
|
77
|
+
name: attribute.id,
|
|
78
|
+
errors: errorsMessage ?? [t('error.error_occurred')]
|
|
79
|
+
}
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const removeTreeNode = async (nodeValue, skipAfterRemove = false) => {
|
|
84
|
+
const result = await onValueDelete({ id_value: nodeValue.id_value }, attribute.id);
|
|
85
|
+
if (skipAfterRemove) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (result.status === APICallStatus.SUCCESS) {
|
|
89
|
+
const newBackendValues = backendValues.filter(value => value.id_value !== nodeValue.id_value);
|
|
90
|
+
form.setFieldValue(attribute.id, newBackendValues.map(({ treeValue }) => treeValue.id));
|
|
91
|
+
form.setFields([
|
|
92
|
+
{
|
|
93
|
+
name: attribute.id,
|
|
94
|
+
errors: attribute.required && newBackendValues.length === 0 ? [t('errors.standard_field_required')] : []
|
|
95
|
+
}
|
|
96
|
+
]);
|
|
97
|
+
setBackendValues(newBackendValues);
|
|
98
|
+
}
|
|
99
|
+
if (result.status === APICallStatus.ERROR) {
|
|
100
|
+
form.setFields([
|
|
101
|
+
{
|
|
102
|
+
name: attribute.id,
|
|
103
|
+
errors: [t('error.error_occurred')]
|
|
104
|
+
}
|
|
105
|
+
]);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const removeAllTreeNodes = async () => {
|
|
109
|
+
// When we will handle computed values, we will need to passe the active version (if still needed)
|
|
110
|
+
const result = await onDeleteMultipleValues(attribute.id, backendValues, null);
|
|
111
|
+
if (result.status === APICallStatus.SUCCESS) {
|
|
112
|
+
form.setFieldValue(attribute.id, []);
|
|
113
|
+
form.setFields([
|
|
114
|
+
{
|
|
115
|
+
name: attribute.id,
|
|
116
|
+
errors: attribute.required ? [t('errors.standard_field_required')] : []
|
|
117
|
+
}
|
|
118
|
+
]);
|
|
119
|
+
setBackendValues([]);
|
|
120
|
+
}
|
|
121
|
+
if (result.status === APICallStatus.ERROR) {
|
|
122
|
+
const errorsMessage = result.errors?.map(err => err.message);
|
|
123
|
+
form.setFields([
|
|
124
|
+
{
|
|
125
|
+
name: attribute.id,
|
|
126
|
+
errors: errorsMessage ?? [t('error.error_occurred')]
|
|
127
|
+
}
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const getActionButtonLabel = () => {
|
|
132
|
+
if (!attribute.multiple_values && backendValues.length > 0) {
|
|
133
|
+
return `${t('global.replace')} ${modaleTitle}`;
|
|
134
|
+
}
|
|
135
|
+
return `${t('global.add')} ${modaleTitle}`;
|
|
136
|
+
};
|
|
137
|
+
return {
|
|
138
|
+
openModal,
|
|
139
|
+
removeTreeNode,
|
|
140
|
+
actionButtonLabel: getActionButtonLabel(),
|
|
141
|
+
SelectTreeNodeModal: isModalVisible ? (_jsx(SelectTreeNodeModal, { open: true, title: modaleTitle, attribute: attribute, backendValues: backendValues, onConfirm: addTreeNodes, onClose: closeModal })) : null,
|
|
142
|
+
RemoveAllTreeNodes: backendValues.length > 1 && attribute.multiple_values && !attribute.required ? (_jsx(DeleteAllValuesButton, { handleDelete: removeAllTreeNodes, disabled: isReadOnly, danger: isFieldInError })) : null
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=useManageTreeNodeSelection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useManageTreeNodeSelection.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAA2B,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpE,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAI1D,OAAO,EAAC,aAAa,EAA6D,MAAM,iBAAiB,CAAC;AAC1G,OAAO,EAAC,yBAAyB,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AACnC,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f,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { CalculatedFlags, InheritedFlags } from './calculatedInheritedFlags';
|
|
3
|
-
|
|
3
|
+
interface IComputeIndicatorProps {
|
|
4
4
|
calculatedFlags: CalculatedFlags;
|
|
5
5
|
inheritedFlags: InheritedFlags;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export declare const ComputeIndicator: FunctionComponent<IComputeIndicatorProps>;
|
|
8
|
+
export {};
|
package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComputeIndicator.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/shared/ComputeIndicator.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAC;AACtC,OAAO,EAAC,YAAY,EAAE,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,gCAAgC,EAAC,MAAM,eAAe,CAAC;AAE/D,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEzC,CAAC;AAOF,MAAM,CAAC,MAAM,gBAAgB,GAA8C,CAAC,EAAC,eAAe,EAAE,cAAc,EAAC,EAAE,EAAE;IAC7G,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,yBAAyB,GAC3B,eAAe,CAAC,4BAA4B,IAAI,cAAc,CAAC,2BAA2B,CAAC;IAC/F,MAAM,0BAA0B,GAC5B,eAAe,CAAC,yBAAyB,IAAI,cAAc,CAAC,wBAAwB,CAAC;IAEzF,OAAO,CACH,MAAC,uBAAuB,eACnB,yBAAyB,IAAI,CAC1B,KAAC,UAAU,IACP,KAAK,EAAE,CAAC,CAAC,iCAAiC,CAAC,EAC3C,eAAe,EAAE,gCAAgC,YAEjD,KAAC,eAAe,KAAG,GACV,CAChB,EACA,0BAA0B,IAAI,CAC3B,KAAC,UAAU,IACP,KAAK,EAAE,CAAC,CAAC,gCAAgC,CAAC,EAC1C,eAAe,EAAE,gCAAgC,YAEjD,KAAC,YAAY,KAAG,GACP,CAChB,IACqB,CAC7B,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
5
|
import { useSharedTranslation } from '../../../../../hooks/useSharedTranslation';
|
|
6
6
|
import { KitButton, KitModal } from 'aristid-ds';
|
|
7
|
-
export const DeleteAllValuesButton = ({ handleDelete }) => {
|
|
7
|
+
export const DeleteAllValuesButton = ({ handleDelete, disabled, danger }) => {
|
|
8
8
|
const { t } = useSharedTranslation();
|
|
9
9
|
const _confirmDeleteAllValues = () => {
|
|
10
10
|
KitModal.confirm({
|
|
@@ -20,6 +20,6 @@ export const DeleteAllValuesButton = ({ handleDelete }) => {
|
|
|
20
20
|
onOk: handleDelete
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
|
-
return (_jsx(KitButton, { type: "tertiary", size: "s", onClick: _confirmDeleteAllValues, children: t('record_edition.delete_all') }));
|
|
23
|
+
return (_jsx(KitButton, { type: "tertiary", size: "s", onClick: _confirmDeleteAllValues, disabled: disabled, danger: danger, children: t('record_edition.delete_all') }));
|
|
24
24
|
};
|
|
25
25
|
//# sourceMappingURL=DeleteAllValuesButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteAllValuesButton.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/shared/DeleteAllValuesButton.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAS/C,MAAM,CAAC,MAAM,qBAAqB,GAAmD,CAAC,EAClF,YAAY,EACZ,QAAQ,EACR,MAAM,EACT,EAAE,EAAE;IACD,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,uBAAuB,GAAG,GAAG,EAAE;QACjC,QAAQ,CAAC,OAAO,CAAC;YACb,KAAK,EAAE,CAAC,CAAC,kCAAkC,CAAC;YAC5C,OAAO,EAAE,CAAC,CAAC,0CAA0C,CAAC;YACtD,IAAI,EAAE,KAAK;YACX,gBAAgB,EAAE,IAAI;YACtB,aAAa,EAAE,KAAK;YACpB,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,CAAC,CAAC,gBAAgB,CAAC;YAC3B,UAAU,EAAE,CAAC,CAAC,eAAe,CAAC;YAC9B,IAAI,EAAE,YAAY;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,SAAS,IAAC,IAAI,EAAC,UAAU,EAAC,IAAI,EAAC,GAAG,EAAC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,YACnG,CAAC,CAAC,2BAA2B,CAAC,GACvB,CACf,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculatedInheritedFlags.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/shared/calculatedInheritedFlags.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,WAAmD,EAAkB,EAAE;IACzG,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,C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iBAAiB,EAAE,KAAK;YACxB,yBAAyB,EAAE,KAAK;YAChC,4BAA4B,EAAE,KAAK;SACtC,CAAC;IACN,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC;IAE/B,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACnD,OAAO;YACH,eAAe;YACf,iBAAiB;YACjB,4BAA4B,EAAE,IAAI;YAClC,yBAAyB,EAAE,KAAK;SACnC,CAAC;IACN,CAAC;IAED,OAAO;QACH,eAAe;QACf,iBAAiB;QACjB,4BAA4B,EAAE,KAAK;QACnC,yBAAyB,EAAE,IAAI;KAClC,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RecordFormElementFragment } from '../../../../../_gqlTypes';
|
|
2
|
+
import { IEditRecordReducerActions, IRecordPropertyWithAttribute } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
3
|
+
import { LINK_FIELD_ID_PREFIX, STANDARD_FIELD_ID_PREFIX, TREE_FIELD_ID_PREFIX } from '../../../../../constants';
|
|
4
|
+
import { RecordFormElementsValue } from '../../../../../hooks/useGetRecordForm';
|
|
5
|
+
import { Dispatch } from 'react';
|
|
6
|
+
interface IUseOutsideInteractionDetectorProps {
|
|
7
|
+
attribute: RecordFormElementFragment['attribute'];
|
|
8
|
+
activeAttribute: IRecordPropertyWithAttribute | null;
|
|
9
|
+
dispatch: Dispatch<IEditRecordReducerActions>;
|
|
10
|
+
formIdToLoad: string | 'edition' | 'creation';
|
|
11
|
+
backendValues: RecordFormElementsValue[];
|
|
12
|
+
pendingValues: RecordFormElementsValue[];
|
|
13
|
+
allowedSelectors?: string[];
|
|
14
|
+
attributePrefix?: typeof LINK_FIELD_ID_PREFIX | typeof STANDARD_FIELD_ID_PREFIX | typeof TREE_FIELD_ID_PREFIX;
|
|
15
|
+
}
|
|
16
|
+
export declare const useOutsideInteractionDetector: ({ attribute, activeAttribute, attributePrefix, dispatch, formIdToLoad, backendValues, pendingValues, allowedSelectors }: IUseOutsideInteractionDetectorProps) => void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
2
|
+
import { EDIT_RECORD_SIDEBAR_ID } from '../../../../../constants';
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attributePrefix, dispatch, formIdToLoad, backendValues, pendingValues, allowedSelectors = [] }) => {
|
|
5
|
+
// Use a ref to store the current props to access them in the event handlers
|
|
6
|
+
// This will prevent issue when multiple event handlers are attached to the document
|
|
7
|
+
const hookPropsRef = useRef({
|
|
8
|
+
attribute,
|
|
9
|
+
activeAttribute,
|
|
10
|
+
attributePrefix,
|
|
11
|
+
allowedSelectors,
|
|
12
|
+
formIdToLoad,
|
|
13
|
+
backendValues,
|
|
14
|
+
pendingValues
|
|
15
|
+
});
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
hookPropsRef.current = {
|
|
18
|
+
attribute,
|
|
19
|
+
activeAttribute,
|
|
20
|
+
attributePrefix,
|
|
21
|
+
allowedSelectors,
|
|
22
|
+
formIdToLoad,
|
|
23
|
+
backendValues,
|
|
24
|
+
pendingValues
|
|
25
|
+
};
|
|
26
|
+
}, [attribute, activeAttribute, attributePrefix, allowedSelectors, formIdToLoad, backendValues, pendingValues]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const handleClick = (event) => {
|
|
29
|
+
const currentProps = hookPropsRef.current;
|
|
30
|
+
const elementSelector = '#' + currentProps.attributePrefix + currentProps.attribute.id;
|
|
31
|
+
const target = event.target;
|
|
32
|
+
const isClickOnThisElement = target.closest(elementSelector) !== null;
|
|
33
|
+
if (isClickOnThisElement) {
|
|
34
|
+
dispatch({
|
|
35
|
+
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
36
|
+
attribute: currentProps.attribute,
|
|
37
|
+
values: formIdToLoad === 'creation' ? currentProps.pendingValues : currentProps.backendValues
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const sideBarSelector = '#' + EDIT_RECORD_SIDEBAR_ID;
|
|
42
|
+
const isClickInsideSidebar = target.closest(sideBarSelector) !== null;
|
|
43
|
+
const isClickOnAllowedSelector = currentProps.allowedSelectors.length > 0 &&
|
|
44
|
+
currentProps.allowedSelectors.some(selector => target.closest(selector) !== null);
|
|
45
|
+
if (currentProps.activeAttribute !== null &&
|
|
46
|
+
currentProps.activeAttribute.attribute.id === currentProps.attribute.id &&
|
|
47
|
+
!isClickInsideSidebar &&
|
|
48
|
+
!isClickOnAllowedSelector) {
|
|
49
|
+
dispatch({
|
|
50
|
+
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
51
|
+
attribute: null
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const handleFocus = (event) => {
|
|
56
|
+
const currentProps = hookPropsRef.current;
|
|
57
|
+
const elementSelector = '#' + currentProps.attributePrefix + currentProps.attribute.id;
|
|
58
|
+
const target = event.target;
|
|
59
|
+
const isFocusInsideTargetElement = target.closest(elementSelector) !== null;
|
|
60
|
+
if (isFocusInsideTargetElement) {
|
|
61
|
+
dispatch({
|
|
62
|
+
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
63
|
+
attribute: currentProps.attribute,
|
|
64
|
+
values: formIdToLoad === 'creation' ? currentProps.pendingValues : currentProps.backendValues
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
document.addEventListener('mousedown', handleClick);
|
|
69
|
+
document.addEventListener('focusin', handleFocus);
|
|
70
|
+
return () => {
|
|
71
|
+
document.removeEventListener('mousedown', handleClick);
|
|
72
|
+
document.removeEventListener('focusin', handleFocus);
|
|
73
|
+
};
|
|
74
|
+
}, [dispatch]);
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=useOutsideInteractionDetector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOutsideInteractionDetector.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,6BAA6B,EAGhC,MAAM,kEAAkE,CAAC;AAC1E,OAAO,EACH,sBAAsB,EAIzB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAW,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAalD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC1C,SAAS,EACT,eAAe,EACf,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,GAAG,EAAE,EACa,EAAE,EAAE;IACtC,4EAA4E;IAC5E,oFAAoF;IACpF,MAAM,YAAY,GAAG,MAAM,CAAC;QACxB,SAAS;QACT,eAAe;QACf,eAAe;QACf,gBAAgB;QAChB,YAAY;QACZ,aAAa;QACb,aAAa;KAChB,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,YAAY,CAAC,OAAO,GAAG;YACnB,SAAS;YACT,eAAe;YACf,eAAe;YACf,gBAAgB;YAChB,YAAY;YACZ,aAAa;YACb,aAAa;SAChB,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC;IAEhH,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,EAAE;YACtC,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC;YAC1C,MAAM,eAAe,GAAG,GAAG,GAAG,YAAY,CAAC,eAAe,GAAG,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;YAEvF,MAAM,MAAM,GAA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E,CAAC;YAEvF,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;YAC3C,MAAM,0BAA0B,GAAG,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;YAE5E,IAAI,0BAA0B,EAAE,CAAC;gBAC7B,QAAQ,CAAC;oBACL,IAAI,EAAE,6BAA6B,CAAC,gBAAgB;oBACpD,SAAS,EAAE,YAAY,CAAC,SAAS;oBACjC,MAAM,EAAE,YAAY,KAAK,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa;iBAChG,CAAC,CAAC;YACP,CAAC;QACL,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;QACpD,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAElD,OAAO,GAAG,EAAE;YACR,QAAQ,CAAC,mBAAmB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACvD,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACzD,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { IValueVersion } from '../../../types';
|
|
|
3
3
|
import { RecordIdentityFragment } from '../../../_gqlTypes';
|
|
4
4
|
import { possibleSubmitButtons } from '../_types';
|
|
5
5
|
export interface IEditRecordModalProps {
|
|
6
|
+
className?: string;
|
|
6
7
|
open: boolean;
|
|
7
8
|
record: RecordIdentityFragment['whoAmI'] | null;
|
|
8
9
|
creationFormId?: string;
|
|
@@ -14,5 +15,7 @@ export interface IEditRecordModalProps {
|
|
|
14
15
|
submitButtons?: possibleSubmitButtons;
|
|
15
16
|
withInfoButton?: boolean;
|
|
16
17
|
valuesVersion?: IValueVersion;
|
|
18
|
+
showSidebar?: boolean;
|
|
19
|
+
enableSidebar?: boolean;
|
|
17
20
|
}
|
|
18
21
|
export declare const EditRecordModal: FunctionComponent<IEditRecordModalProps>;
|