@leav/ui 0.4.0-58529dc → 0.4.0-5c1d9113
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/README.md +1 -0
- package/dist/_gqlTypes/index.d.ts +1256 -250
- package/dist/_gqlTypes/index.js +285 -42
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/records/getRecordFormQuery.js +9 -0
- package/dist/_queries/records/getRecordFormQuery.js.map +1 -1
- package/dist/_queries/trees/treeNodeChildrenQuery.js +12 -2
- package/dist/_queries/trees/treeNodeChildrenQuery.js.map +1 -1
- package/dist/_utils/attributeType.d.ts +2 -1
- package/dist/_utils/attributeType.js +2 -1
- package/dist/_utils/attributeType.js.map +1 -1
- package/dist/components/Explorer/DataView.js +4 -4
- package/dist/components/Explorer/DataView.js.map +1 -1
- package/dist/components/Explorer/Explorer.d.ts +6 -4
- package/dist/components/Explorer/Explorer.js +13 -4
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerToolbar.d.ts +2 -1
- package/dist/components/Explorer/ExplorerToolbar.js +5 -4
- package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +1 -1
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js +82 -31
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.js +31 -27
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +22 -3
- package/dist/components/Explorer/_types.js +1 -0
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.d.ts +2 -1
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js +2 -2
- package/dist/components/Explorer/actions-item/useReplaceItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.d.ts +5 -1
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js +16 -21
- package/dist/components/Explorer/actions-primary/useCreatePrimaryAction.js.map +1 -1
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.d.ts +6 -3
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js +5 -19
- package/dist/components/Explorer/actions-primary/useLinkPrimaryAction.js.map +1 -1
- package/dist/components/Explorer/link-item/LinkModal.d.ts +3 -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/manage-view-settings/_shared/CommonFilterItem.js +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js +26 -2
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +10 -7
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js +2 -2
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js +5 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.d.ts +3 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js +69 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.d.ts +6 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.d.ts +2 -0
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js +31 -4
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +19 -8
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +2 -1
- 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 +3 -2
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +38 -12
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/useLoadView.d.ts +1 -1
- package/dist/components/Explorer/useLoadView.js +32 -38
- package/dist/components/Explorer/useLoadView.js.map +1 -1
- package/dist/components/Explorer/useSearchInput.js +2 -0
- package/dist/components/Explorer/useSearchInput.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.js +6 -2
- package/dist/components/Explorer/useViewSettingsReducer.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/RecordEdition/EditRecord/EditRecord.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecord/EditRecord.js +72 -224
- package/dist/components/RecordEdition/EditRecord/EditRecord.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.d.ts +2 -2
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js +4 -11
- package/dist/components/RecordEdition/EditRecordContent/EditRecordContent.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/_types.d.ts +2 -5
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.d.ts +5 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js +28 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateEmptyRecordMutation.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.d.ts +11 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js +35 -0
- package/dist/components/RecordEdition/EditRecordContent/hooks/useTabManagement.js.map +1 -0
- 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/FormDivider/FormDivider.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/Frame/Frame.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +11 -36
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.d.ts +3 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.js +9 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/ActionButton.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record-in-edition/useLinkRecords.d.ts → link-record/useExplorerLinkRecords.d.ts} +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/{link-record-in-edition/useLinkRecords.js → link-record/useExplorerLinkRecords.js} +3 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useExplorerLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.d.ts +24 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +76 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/utils.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +19 -15
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TextBlock/TextBlock.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.d.ts +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +19 -24
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.d.ts +2 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js +2 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeItem.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/{useDisplayTreeNode.d.ts → TreeNodeList.d.ts} +4 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js +5 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js.map +1 -0
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.d.ts +16 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js +12 -13
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/SelectTreeNodeModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.d.ts +4 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +49 -62
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.d.ts +1 -3
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js +6 -10
- package/dist/components/RecordEdition/EditRecordContent/uiElements/shared/useOutsideInteractionDetector.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js +22 -4
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +23 -5
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/index.d.ts +2 -1
- package/dist/components/RecordEdition/index.js +2 -1
- package/dist/components/RecordEdition/index.js.map +1 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.d.ts +4 -1
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js +6 -4
- package/dist/components/SelectRecordForLinkModal/SelectRecordForLinkModal.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNode.d.ts +7 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js +2 -3
- package/dist/components/SelectTreeNode/SelectTreeNode.js.map +1 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.d.ts +5 -1
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js +70 -56
- package/dist/components/SelectTreeNode/SelectTreeNodeContent.js.map +1 -1
- package/dist/components/SelectTreeNode/_types.d.ts +18 -0
- package/dist/components/SelectTreeNode/_types.js +2 -0
- package/dist/components/SelectTreeNode/_types.js.map +1 -0
- package/dist/components/{SelectTreeNodeModal/SelectTreeNodeModal.d.ts → SelectTreeNodeModalOld/SelectTreeNodeModalOld.d.ts} +1 -1
- package/dist/components/{SelectTreeNodeModal/SelectTreeNodeModal.js → SelectTreeNodeModalOld/SelectTreeNodeModalOld.js} +4 -2
- package/dist/components/SelectTreeNodeModalOld/SelectTreeNodeModalOld.js.map +1 -0
- package/dist/components/SelectTreeNodeModalOld/index.d.ts +1 -0
- package/dist/components/{LinkSelect → SelectTreeNodeModalOld}/index.js +1 -2
- package/dist/components/SelectTreeNodeModalOld/index.js.map +1 -0
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js +2 -2
- package/dist/components/ValuesVersionConfigurator/VersionTree/VersionTree.js.map +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/components/index.js +1 -2
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js +1 -1
- package/dist/hooks/useGetRecordForm/useGetRecordForm.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.d.ts +3 -1
- package/dist/hooks/useIFrameMessenger/messageHandlers.js +13 -2
- package/dist/hooks/useIFrameMessenger/messageHandlers.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +21 -0
- package/dist/hooks/useIFrameMessenger/schema.js +76 -0
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -0
- package/dist/hooks/useIFrameMessenger/types.d.ts +41 -6
- package/dist/hooks/useIFrameMessenger/types.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.d.ts +10 -1
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js +55 -20
- package/dist/hooks/useIFrameMessenger/useIFrameMessenger.js.map +1 -1
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.d.ts +7 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js +13 -0
- package/dist/hooks/useIFrameMessengerClient/IFrameMessengerClient.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.d.ts +13 -0
- package/dist/{components/RecordEdition/EditRecord/creationErrorContext.js → hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js} +2 -3
- package/dist/hooks/useIFrameMessengerClient/iFrameMessengerClientContext.js.map +1 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.d.ts +13 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js +13 -0
- package/dist/hooks/useIFrameMessengerClient/useIFrameMessengerClient.js.map +1 -0
- package/dist/types/attributes.d.ts +2 -1
- package/package.json +22 -6
- package/dist/components/LinkSelect/LinkSelect.d.ts +0 -12
- package/dist/components/LinkSelect/LinkSelect.js +0 -44
- package/dist/components/LinkSelect/LinkSelect.js.map +0 -1
- package/dist/components/LinkSelect/index.d.ts +0 -2
- package/dist/components/LinkSelect/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecord/creationErrorContext.d.ts +0 -6
- package/dist/components/RecordEdition/EditRecord/creationErrorContext.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.d.ts +0 -5
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js +0 -28
- package/dist/components/RecordEdition/EditRecordContent/hooks/useCreateRecordMutation.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.d.ts +0 -121
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js +0 -31
- package/dist/components/RecordEdition/EditRecordContent/hooks/useRunActionsListAndFormatOnValue.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.d.ts +0 -5
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js +0 -39
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useEditRecord.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js +0 -23
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-item/useUnselectRecord.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js +0 -23
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-mass/useUnselectAllRecords.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.d.ts +0 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js +0 -26
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useCreateRecord.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.d.ts +0 -12
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js +0 -24
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/action-primary/useRecordSelector.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.d.ts +0 -19
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js +0 -103
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecords.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.d.ts +0 -22
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js +0 -104
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-creation/useLinkRecordsInCreation.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecords.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.d.ts +0 -27
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js +0 -124
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record-in-edition/useLinkRecordsInEdition.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.d.ts +0 -9
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js +0 -15
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/shared/LinkActionsButtons.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.d.ts +0 -16
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.js +0 -35
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/ValuesList.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.d.ts +0 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.js +0 -6
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/ValuesList/index.js.map +0 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js +0 -8
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/useDisplayTreeNode.js.map +0 -1
- package/dist/components/SelectTreeNodeModal/SelectTreeNodeModal.js.map +0 -1
- package/dist/components/SelectTreeNodeModal/index.d.ts +0 -1
- package/dist/components/SelectTreeNodeModal/index.js +0 -5
- package/dist/components/SelectTreeNodeModal/index.js.map +0 -1
|
@@ -3,47 +3,42 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
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 { useEffect, useState } from 'react';
|
|
6
|
-
import { localizedTranslation } from '@leav/utils';
|
|
7
6
|
import styled from 'styled-components';
|
|
7
|
+
import { localizedTranslation } from '@leav/utils';
|
|
8
8
|
import { AntForm, KitButton, KitInputWrapper } from 'aristid-ds';
|
|
9
|
-
import { TREE_FIELD_ID_PREFIX } from '../../../../../constants';
|
|
10
|
-
import { useLang } from '../../../../../hooks';
|
|
11
9
|
import { FaList } from 'react-icons/fa';
|
|
12
|
-
import {
|
|
10
|
+
import { useLang } from '../../../../../hooks';
|
|
11
|
+
import { RecordPermissionsActions } from '../../../../../_gqlTypes';
|
|
12
|
+
import { TREE_FIELD_ID_PREFIX } from '../../../../../constants';
|
|
13
|
+
import { TreeNodeList } from './display-tree-node/TreeNodeList';
|
|
13
14
|
import { useManageTreeNodeSelection } from './manage-tree-node-selection/useManageTreeNodeSelection';
|
|
14
15
|
import { useOutsideInteractionDetector } from '../shared/useOutsideInteractionDetector';
|
|
15
16
|
import { useEditRecordReducer } from '../../../../../components/RecordEdition/editRecordReducer/useEditRecordReducer';
|
|
16
17
|
import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
17
18
|
import { computeCalculatedFlags, computeInheritedFlags } from '../shared/calculatedInheritedFlags';
|
|
18
19
|
import { ComputeIndicator } from '../shared/ComputeIndicator';
|
|
19
|
-
const
|
|
20
|
+
const StyledWrapperDiv = styled.div `
|
|
20
21
|
margin-bottom: ${props => (props.$metadataEdit ? 0 : '1.5em')};
|
|
21
22
|
`;
|
|
22
|
-
const
|
|
23
|
+
const KitInputExtraAlignLeftDiv = styled.div `
|
|
23
24
|
margin-right: auto;
|
|
24
25
|
line-height: 12px;
|
|
25
26
|
`;
|
|
26
|
-
const
|
|
27
|
+
const StyledFieldFooterKitButton = styled(KitButton) `
|
|
27
28
|
margin-top: ${props => (props.$hasNoValue ? 0 : 'calc((var(--general-spacing-xs)) * 1px)')};
|
|
28
29
|
`;
|
|
29
|
-
const TreeField = ({ element, readonly,
|
|
30
|
+
const TreeField = ({ element, readonly, isFormCreationMode, onDeleteMultipleValues, onValueSubmit, onValueDelete, metadataEdit = false }) => {
|
|
30
31
|
const { state, dispatch } = useEditRecordReducer();
|
|
31
32
|
const { lang } = useLang();
|
|
32
33
|
const { settings, attribute, values } = element;
|
|
33
34
|
const [backendValues, setBackendValues] = useState(values);
|
|
34
|
-
const [attributePendingValues, setAttributePendingValues] = useState([]);
|
|
35
35
|
const calculatedFlags = computeCalculatedFlags(backendValues);
|
|
36
36
|
const inheritedFlags = computeInheritedFlags(backendValues);
|
|
37
37
|
const label = localizedTranslation(settings.label, lang);
|
|
38
38
|
const form = AntForm.useFormInstance();
|
|
39
39
|
const fieldErrors = form.getFieldError(attribute.id);
|
|
40
|
-
const isReadOnly = attribute.readonly || readonly;
|
|
40
|
+
const isReadOnly = attribute.readonly || !attribute.permissions.edit_value || readonly;
|
|
41
41
|
const isFieldInError = fieldErrors.length > 0;
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
setAttributePendingValues(pendingValues?.[attribute.id]
|
|
44
|
-
? Object.values(pendingValues?.[attribute.id])
|
|
45
|
-
: []);
|
|
46
|
-
}, [pendingValues, attribute.id]);
|
|
47
42
|
useEffect(() => {
|
|
48
43
|
if (state.activeAttribute?.attribute.id === attribute.id) {
|
|
49
44
|
dispatch({
|
|
@@ -57,28 +52,28 @@ const TreeField = ({ element, readonly, formIdToLoad, pendingValues, onDeleteMul
|
|
|
57
52
|
activeAttribute: state.activeAttribute,
|
|
58
53
|
attributePrefix: TREE_FIELD_ID_PREFIX,
|
|
59
54
|
dispatch,
|
|
60
|
-
formIdToLoad,
|
|
61
55
|
backendValues,
|
|
62
|
-
pendingValues: attributePendingValues,
|
|
63
56
|
allowedSelectors: ['.kit-modal-wrapper']
|
|
64
57
|
});
|
|
58
|
+
const childrenAsRecordValuePermissionFilter = {
|
|
59
|
+
libraryId: state.libraryId,
|
|
60
|
+
attributeId: state.activeAttribute?.attribute?.id,
|
|
61
|
+
action: RecordPermissionsActions.create_record
|
|
62
|
+
};
|
|
65
63
|
const { openModal, removeTreeNode, actionButtonLabel, SelectTreeNodeModal, RemoveAllTreeNodes } = useManageTreeNodeSelection({
|
|
66
64
|
modaleTitle: label,
|
|
67
65
|
attribute,
|
|
66
|
+
isFormCreationMode,
|
|
68
67
|
backendValues,
|
|
69
68
|
setBackendValues,
|
|
70
69
|
onValueSubmit,
|
|
71
70
|
onValueDelete,
|
|
72
71
|
onDeleteMultipleValues,
|
|
73
72
|
isReadOnly,
|
|
74
|
-
isFieldInError
|
|
75
|
-
|
|
76
|
-
const { TreeNodeList } = useDisplayTreeNode({
|
|
77
|
-
attribute,
|
|
78
|
-
backendValues,
|
|
79
|
-
removeTreeNode
|
|
73
|
+
isFieldInError,
|
|
74
|
+
childrenAsRecordValuePermissionFilter
|
|
80
75
|
});
|
|
81
|
-
return (_jsx(
|
|
76
|
+
return (_jsx(StyledWrapperDiv, { "$metadataEdit": metadataEdit, children: _jsx(AntForm.Item, { name: attribute.id, noStyle: true, children: _jsxs(KitInputWrapper, { id: TREE_FIELD_ID_PREFIX + attribute.id, "data-testid": "tree-field", label: label, required: attribute.required, bordered: true, disabled: isReadOnly, status: isFieldInError ? 'error' : undefined, helper: isFieldInError ? String(fieldErrors[0]) : undefined, extra: _jsxs(_Fragment, { children: [_jsx(KitInputExtraAlignLeftDiv, { children: _jsx(ComputeIndicator, { calculatedFlags: calculatedFlags, inheritedFlags: inheritedFlags }) }), RemoveAllTreeNodes] }), children: [_jsx(TreeNodeList, { attribute: attribute, backendValues: backendValues, removeTreeNode: removeTreeNode, isReadOnly: isReadOnly }), _jsx(StyledFieldFooterKitButton, { disabled: isReadOnly, icon: _jsx(FaList, {}), onClick: openModal, size: "m", "$hasNoValue": !backendValues?.length, children: actionButtonLabel }), SelectTreeNodeModal] }) }) }));
|
|
82
77
|
};
|
|
83
78
|
export default TreeField;
|
|
84
79
|
//# sourceMappingURL=TreeField.js.map
|
package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeField.js","sourceRoot":"","sources":["../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoB,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAwB,oBAAoB,EAAC,MAAM,aAAa,CAAC;AACxE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAC,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAElC,OAAO,EAGH,wBAAwB,EAC3B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAC,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAC,0BAA0B,EAAC,MAAM,yDAAyD,CAAC;AACnG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,oBAAoB,EAAC,MAAM,qEAAqE,CA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gB,YAAY,YACzC,KAAC,OAAO,CAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,OAAO,kBACrC,MAAC,eAAe,IACZ,EAAE,EAAE,oBAAoB,GAAG,SAAS,CAAC,EAAE,iBAC3B,YAAY,EACxB,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,yBAAyB,cACtB,KAAC,gBAAgB,IAAC,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,GAAI,GAC9D,EAC3B,kBAAkB,IACpB,aAGP,KAAC,YAAY,IACT,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACxB,EACF,KAAC,0BAA0B,IACvB,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,KAAC,MAAM,KAAG,EAChB,OAAO,EAAE,SAAS,EAClB,IAAI,EAAC,GAAG,iBACK,CAAC,aAAa,EAAE,MAAM,YAElC,iBAAiB,GACO,EAC5B,mBAAmB,IACN,GACP,GACA,CACtB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -5,6 +5,7 @@ interface IUseTreeNodeItemProps {
|
|
|
5
5
|
ancestors?: RecordFormElementsValueTreeValue['treeValue']['ancestors'];
|
|
6
6
|
canDelete?: boolean;
|
|
7
7
|
onClickToDelete?: (node: RecordFormElementsValueTreeValue) => void;
|
|
8
|
+
isReadOnly?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const TreeNodeItem: ({ color, label, ancestors, canDelete, onClickToDelete }: IUseTreeNodeItemProps) => JSX.Element;
|
|
10
|
+
declare const TreeNodeItem: ({ color, label, ancestors, canDelete, onClickToDelete, isReadOnly }: IUseTreeNodeItemProps) => JSX.Element;
|
|
10
11
|
export default TreeNodeItem;
|
|
@@ -31,9 +31,9 @@ const KitBreadcrumbStyled = styled(KitBreadcrumb) `
|
|
|
31
31
|
`;
|
|
32
32
|
const BREADCRUMB_SEPARATOR = '>';
|
|
33
33
|
const NOT_FOCUSABLE = -1;
|
|
34
|
-
const TreeNodeItem = ({ color, label, ancestors, canDelete, onClickToDelete }) => {
|
|
34
|
+
const TreeNodeItem = ({ color, label, ancestors, canDelete, onClickToDelete, isReadOnly }) => {
|
|
35
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 => ({
|
|
36
|
+
return (_jsx(KitItemListStyled, { tabIndex: NOT_FOCUSABLE, disabled: isReadOnly, 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
37
|
title: ancestor.record.whoAmI.label
|
|
38
38
|
})), separator: BREADCRUMB_SEPARATOR })] })] }), actions: canDelete
|
|
39
39
|
? [
|
|
@@ -1 +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,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACtF,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;;;;CAO5C,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;;;;;;;;;;;;;;;;CAiBhD,CAAC;AAEF,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;
|
|
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,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AACtF,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,MAAM,iBAAiB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAA;;;;;;;CAO5C,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;;;;;;;;;;;;;;;;;CAiBhD,CAAC;AAEF,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,MAAM,aAAa,GAAG,CAAC,CAAC,CAAC;AAWzB,MAAM,YAAY,GAAG,CAAC,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAwB,EAAE,EAAE;IAC9G,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO,CACH,KAAC,iBAAiB,IACd,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,UAAU,EACpB,gBAAgB,EACZ,MAAC,QAAQ,IAAC,SAAS,EAAC,YAAY,aAC5B,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAC,QAAQ,GAAG,EACxD,MAAC,QAAQ,IAAC,SAAS,EAAC,UAAU,EAAC,IAAI,EAAC,MAAM,aACtC,KAAC,SAAS,IAAC,KAAK,EAAE,KAAK,GAAI,EAC3B,KAAC,mBAAmB,IAChB,KAAK,EAAE,SAAS,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;gCAC/B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK;6BACtC,CAAC,CAAC,EACH,SAAS,EAAE,oBAAoB,GACjC,IACK,IACJ,EAEf,OAAO,EACH,SAAS;YACL,CAAC,CAAC;gBACI;oBACI,GAAG,EAAE,QAAQ;oBACb,IAAI,EAAE,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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { type FunctionComponent } from 'react';
|
|
1
2
|
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
2
3
|
import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
3
|
-
interface
|
|
4
|
+
interface IDisplayTreeNodeProps {
|
|
4
5
|
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
5
6
|
backendValues: RecordFormElementsValueTreeValue[];
|
|
6
7
|
removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue) => void;
|
|
8
|
+
isReadOnly: boolean;
|
|
7
9
|
}
|
|
8
|
-
export declare const
|
|
9
|
-
TreeNodeList: JSX.Element;
|
|
10
|
-
};
|
|
10
|
+
export declare const TreeNodeList: FunctionComponent<IDisplayTreeNodeProps>;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import TreeNodeItem from './TreeNodeItem';
|
|
3
|
+
import { TreeFieldWrapper } from './TreeFieldWrapper';
|
|
4
|
+
export const TreeNodeList = ({ attribute, backendValues, removeTreeNode, isReadOnly }) => (_jsx(TreeFieldWrapper, { children: backendValues.map((value, index) => (_jsx(TreeNodeItem, { isReadOnly: isReadOnly, 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) || !attribute.required, onClickToDelete: () => removeTreeNode(value) }, index))) }));
|
|
5
|
+
//# sourceMappingURL=TreeNodeList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeNodeList.js","sourceRoot":"","sources":["../../../../../../../src/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.tsx"],"names":[],"mappings":";AAMA,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AASpD,MAAM,CAAC,MAAM,YAAY,GAA6C,CAAC,EACnE,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACb,EAAE,EAAE,CAAC,CACF,KAAC,gBAAgB,cACZ,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,KAAC,YAAY,IAET,UAAU,EAAE,UAAU,EACtB,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,IAAI,CAAC,SAAS,CAAC,QAAQ,EAExG,eAAe,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IARvC,KAAK,CASZ,CACL,CAAC,GACa,CACtB,CAAC"}
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ChildrenAsRecordValuePermissionFilterInput, RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
3
|
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
3
4
|
import { ITreeNodeWithRecord } from '../../../../../../types';
|
|
4
|
-
|
|
5
|
+
type SelectTreeNodeModalBackendValue = RecordFormElementsValueTreeValue | {
|
|
6
|
+
treeValue: {
|
|
7
|
+
id: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type SelectTreeNodeModalAttribute = RecordFormAttributeTreeAttributeFragment | {
|
|
11
|
+
multiple_values: boolean;
|
|
12
|
+
linked_tree: {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
5
16
|
interface ISelectTreeNodeModalProps {
|
|
6
17
|
title: string;
|
|
7
18
|
open: boolean;
|
|
8
|
-
attribute:
|
|
9
|
-
backendValues:
|
|
19
|
+
attribute: SelectTreeNodeModalAttribute;
|
|
20
|
+
backendValues: SelectTreeNodeModalBackendValue[];
|
|
10
21
|
onConfirm: (selectedNodes: ITreeNodeWithRecord[]) => void;
|
|
11
22
|
onClose: () => void;
|
|
23
|
+
childrenAsRecordValuePermissionFilter?: ChildrenAsRecordValuePermissionFilterInput;
|
|
12
24
|
className?: string;
|
|
13
25
|
}
|
|
14
26
|
export declare const SelectTreeNodeModal: FunctionComponent<ISelectTreeNodeModalProps>;
|
|
@@ -2,21 +2,23 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// Copyright LEAV Solutions 2017 until 2023/11/05, Copyright Aristid from 2023/11/06
|
|
3
3
|
// This file is released under LGPL V3
|
|
4
4
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
5
|
+
import { useState } from 'react';
|
|
6
|
+
import { FaCheck } from 'react-icons/fa';
|
|
5
7
|
import { faXmark } from '@fortawesome/free-solid-svg-icons';
|
|
6
8
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
9
|
+
import { KitButton, KitModal } from 'aristid-ds';
|
|
7
10
|
import { SelectTreeNode } from '../../../../../../components/SelectTreeNode';
|
|
8
11
|
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
12
|
const SELECT_TREE_NODE_MODAL_HEIGHT = '563px';
|
|
13
13
|
const SELECT_TREE_NODE_MODAL_WIDTH = '656px';
|
|
14
|
-
export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onConfirm, onClose, className }) => {
|
|
14
|
+
export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onConfirm, onClose, childrenAsRecordValuePermissionFilter, className }) => {
|
|
15
15
|
const { t } = useSharedTranslation();
|
|
16
16
|
const [selectedNodes, setSelectedNode] = useState([]);
|
|
17
|
+
const [isMonoValueToReplace, setIsMonoValueToReplace] = useState(false);
|
|
17
18
|
const _handleOnSelect = (node, selected) => {
|
|
18
19
|
if (!attribute.multiple_values) {
|
|
19
20
|
setSelectedNode(selected ? [node] : []);
|
|
21
|
+
setIsMonoValueToReplace(true);
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
24
|
if (selected) {
|
|
@@ -26,19 +28,16 @@ export const SelectTreeNodeModal = ({ title, open, attribute, backendValues, onC
|
|
|
26
28
|
setSelectedNode(selectedNodes.filter(selectedValue => selectedValue.id !== node.id));
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
|
-
const _handleOnCheck = (selection) => {
|
|
30
|
-
setSelectedNode(selection.map(node => node).filter(node => !node?.disabled));
|
|
31
|
-
};
|
|
32
31
|
const _handleOnConfirm = () => {
|
|
33
32
|
onConfirm(selectedNodes);
|
|
34
33
|
onClose();
|
|
35
34
|
};
|
|
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:
|
|
35
|
+
return (_jsx(KitModal, { className: className, showCloseIcon: true, 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
36
|
// 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') })] }),
|
|
39
|
-
|
|
40
|
-
...selectedNodes.map(node => node.id)
|
|
41
|
-
|
|
42
|
-
:
|
|
37
|
+
_jsx(FontAwesomeIcon, { icon: faXmark }), onClick: onClose, children: t('global.close') }), _jsx(KitButton, { type: "primary", icon: _jsx(FaCheck, {}), onClick: _handleOnConfirm, children: t('global.confirm') })] }), children: _jsx(SelectTreeNode, { treeId: attribute.linked_tree.id, multiple // We want to be able to set as selected in the tree components, the nodes that are already selected and the disabled nodes
|
|
38
|
+
: true, selectedNodes: [
|
|
39
|
+
...selectedNodes.map(node => node.id),
|
|
40
|
+
...(isMonoValueToReplace ? [] : backendValues.map(value => value.treeValue.id))
|
|
41
|
+
], childrenAsRecordValuePermissionFilter: childrenAsRecordValuePermissionFilter, disabledNodes: backendValues.map(value => value.treeValue.id).concat(attribute.linked_tree.id), onSelect: _handleOnSelect }) }));
|
|
43
42
|
};
|
|
44
43
|
//# sourceMappingURL=SelectTreeNodeModal.js.map
|
|
@@ -1 +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,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,
|
|
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,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAoC,QAAQ,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAE/C,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAGpE,MAAM,6BAA6B,GAAG,OAAO,CAAC;AAC9C,MAAM,4BAA4B,GAAG,OAAO,CAAC;AA8B7C,MAAM,CAAC,MAAM,mBAAmB,GAAiD,CAAC,EA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BACA,4EAA4E;oBAC5E,KAAC,eAAe,IAAC,IAAI,EAAE,OAAO,GAAI,EAEtC,OAAO,EAAE,OAAO,YAEf,CAAC,CAAC,cAAc,CAAC,GACV,EACZ,KAAC,SAAS,IAAC,IAAI,EAAC,SAAS,EAAC,IAAI,EAAE,KAAC,OAAO,KAAG,EAAE,OAAO,EAAE,gBAAgB,YACjE,CAAC,CAAC,gBAAgB,CAAC,GACZ,IACb,YAGP,KAAC,cAAc,IACX,MAAM,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,EAChC,QAAQ,CAAC,2HAA2H;oBACpI,aAAa,EAAE;gBACX,GAAG,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;aAClF,EACD,qCAAqC,EAAE,qCAAqC,EAC5E,aAAa,EAAE,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,EAC9F,QAAQ,EAAE,eAAe,GAC3B,GACK,CACd,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
2
|
+
import { ChildrenAsRecordValuePermissionFilterInput, RecordFormAttributeTreeAttributeFragment } from '../../../../../../_gqlTypes';
|
|
3
3
|
import { RecordFormElementsValueTreeValue } from '../../../../../../hooks/useGetRecordForm';
|
|
4
4
|
import { DeleteMultipleValuesFunc, DeleteValueFunc, SubmitValueFunc } from '../../../_types';
|
|
5
5
|
interface IUseManageTreeNodeSelectionProps {
|
|
6
6
|
modaleTitle: string;
|
|
7
7
|
attribute: RecordFormAttributeTreeAttributeFragment;
|
|
8
|
+
isFormCreationMode: boolean;
|
|
8
9
|
backendValues: RecordFormElementsValueTreeValue[];
|
|
9
10
|
setBackendValues: Dispatch<SetStateAction<RecordFormElementsValueTreeValue[]>>;
|
|
10
11
|
onValueSubmit: SubmitValueFunc;
|
|
@@ -12,8 +13,9 @@ interface IUseManageTreeNodeSelectionProps {
|
|
|
12
13
|
onDeleteMultipleValues: DeleteMultipleValuesFunc;
|
|
13
14
|
isReadOnly: boolean;
|
|
14
15
|
isFieldInError: boolean;
|
|
16
|
+
childrenAsRecordValuePermissionFilter?: ChildrenAsRecordValuePermissionFilterInput;
|
|
15
17
|
}
|
|
16
|
-
export declare const useManageTreeNodeSelection: ({ modaleTitle, attribute, backendValues, setBackendValues, onValueSubmit, onValueDelete, onDeleteMultipleValues, isReadOnly, isFieldInError }: IUseManageTreeNodeSelectionProps) => {
|
|
18
|
+
export declare const useManageTreeNodeSelection: ({ modaleTitle, attribute, isFormCreationMode, backendValues, setBackendValues, onValueSubmit, onValueDelete, onDeleteMultipleValues, isReadOnly, isFieldInError, childrenAsRecordValuePermissionFilter }: IUseManageTreeNodeSelectionProps) => {
|
|
17
19
|
openModal: () => void;
|
|
18
20
|
removeTreeNode: (nodeValue: RecordFormElementsValueTreeValue, skipAfterRemove?: boolean) => Promise<void>;
|
|
19
21
|
actionButtonLabel: string;
|
|
@@ -3,45 +3,34 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
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 { 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
6
|
import { AntForm } from 'aristid-ds';
|
|
7
|
+
import { arrayValueVersionToObject } from '../../../../../../_utils';
|
|
11
8
|
import { useSharedTranslation } from '../../../../../../hooks/useSharedTranslation';
|
|
12
|
-
|
|
9
|
+
import { APICallStatus } from '../../../_types';
|
|
10
|
+
import { DeleteAllValuesButton } from '../../shared/DeleteAllValuesButton';
|
|
11
|
+
import { SelectTreeNodeModal } from './SelectTreeNodeModal';
|
|
12
|
+
export const useManageTreeNodeSelection = ({ modaleTitle, attribute, isFormCreationMode, backendValues, setBackendValues, onValueSubmit, onValueDelete, onDeleteMultipleValues, isReadOnly, isFieldInError, childrenAsRecordValuePermissionFilter }) => {
|
|
13
13
|
const { t } = useSharedTranslation();
|
|
14
14
|
const form = AntForm.useFormInstance();
|
|
15
|
-
const [
|
|
15
|
+
const [isModalHidden, setIsModalHidden] = useState(true);
|
|
16
|
+
// Used to force the input error display when a value is set
|
|
17
|
+
AntForm.useWatch(attribute.id, form);
|
|
16
18
|
useEffect(() => {
|
|
17
|
-
if (backendValues.length === 0 && attribute.required) {
|
|
18
|
-
|
|
19
|
-
form.setFields([
|
|
20
|
-
{
|
|
21
|
-
name: attribute.id,
|
|
22
|
-
errors: [t('errors.standard_field_required')]
|
|
23
|
-
}
|
|
24
|
-
]);
|
|
19
|
+
if (!isFormCreationMode && backendValues.length === 0 && attribute.required) {
|
|
20
|
+
form.setFields([{ name: attribute.id, errors: [t('errors.standard_field_required')] }]);
|
|
25
21
|
}
|
|
26
22
|
}, []);
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
const closeModal = () => {
|
|
31
|
-
setIsModalVisible(false);
|
|
23
|
+
const _closeModal = () => {
|
|
24
|
+
setIsModalHidden(true);
|
|
32
25
|
};
|
|
33
|
-
const
|
|
26
|
+
const _addTreeNodes = async (selectedNodes) => {
|
|
34
27
|
const valuesToSave = selectedNodes.map(node => ({
|
|
35
28
|
attribute,
|
|
36
|
-
idValue: null,
|
|
29
|
+
idValue: !attribute.multiple_values && backendValues.length > 0 ? backendValues[0].id_value : null,
|
|
37
30
|
value: node
|
|
38
31
|
}));
|
|
39
32
|
// When we will handle computed values, we will need to passe the active version (if still needed)
|
|
40
33
|
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
34
|
if (result.status === APICallStatus.SUCCESS) {
|
|
46
35
|
const formattedValues = result.values.map(value => ({
|
|
47
36
|
...value,
|
|
@@ -80,32 +69,7 @@ export const useManageTreeNodeSelection = ({ modaleTitle, attribute, backendValu
|
|
|
80
69
|
]);
|
|
81
70
|
}
|
|
82
71
|
};
|
|
83
|
-
const
|
|
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 () => {
|
|
72
|
+
const _removeAllTreeNodes = async () => {
|
|
109
73
|
// When we will handle computed values, we will need to passe the active version (if still needed)
|
|
110
74
|
const result = await onDeleteMultipleValues(attribute.id, backendValues, null);
|
|
111
75
|
if (result.status === APICallStatus.SUCCESS) {
|
|
@@ -128,18 +92,41 @@ export const useManageTreeNodeSelection = ({ modaleTitle, attribute, backendValu
|
|
|
128
92
|
]);
|
|
129
93
|
}
|
|
130
94
|
};
|
|
131
|
-
const
|
|
132
|
-
if (!attribute.multiple_values && backendValues.length > 0) {
|
|
133
|
-
return `${t('global.replace')} ${modaleTitle}`;
|
|
134
|
-
}
|
|
135
|
-
return `${t('global.add')} ${modaleTitle}`;
|
|
136
|
-
};
|
|
95
|
+
const label = `${t(!attribute.multiple_values && backendValues.length > 0 ? 'global.replace' : 'global.add')} ${modaleTitle}`;
|
|
137
96
|
return {
|
|
138
|
-
openModal
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
97
|
+
openModal: () => {
|
|
98
|
+
setIsModalHidden(false);
|
|
99
|
+
},
|
|
100
|
+
removeTreeNode: async (nodeValue, skipAfterRemove = false) => {
|
|
101
|
+
const result = await onValueDelete({ id_value: nodeValue.id_value }, attribute.id);
|
|
102
|
+
if (skipAfterRemove) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (result.status === APICallStatus.SUCCESS) {
|
|
106
|
+
const newBackendValues = backendValues.filter(value => value.id_value !== nodeValue.id_value);
|
|
107
|
+
form.setFieldValue(attribute.id, newBackendValues.map(({ treeValue }) => treeValue.id));
|
|
108
|
+
form.setFields([
|
|
109
|
+
{
|
|
110
|
+
name: attribute.id,
|
|
111
|
+
errors: attribute.required && newBackendValues.length === 0
|
|
112
|
+
? [t('errors.standard_field_required')]
|
|
113
|
+
: []
|
|
114
|
+
}
|
|
115
|
+
]);
|
|
116
|
+
setBackendValues(newBackendValues);
|
|
117
|
+
}
|
|
118
|
+
if (result.status === APICallStatus.ERROR) {
|
|
119
|
+
form.setFields([
|
|
120
|
+
{
|
|
121
|
+
name: attribute.id,
|
|
122
|
+
errors: [t('error.error_occurred')]
|
|
123
|
+
}
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
actionButtonLabel: label,
|
|
128
|
+
SelectTreeNodeModal: isModalHidden ? null : (_jsx(SelectTreeNodeModal, { open: true, title: label, attribute: attribute, backendValues: backendValues, onConfirm: _addTreeNodes, onClose: _closeModal, childrenAsRecordValuePermissionFilter: childrenAsRecordValuePermissionFilter })),
|
|
129
|
+
RemoveAllTreeNodes: backendValues.length > 1 && attribute.multiple_values && !attribute.required ? (_jsx(DeleteAllValuesButton, { handleDelete: _removeAllTreeNodes, disabled: isReadOnly, danger: isFieldInError })) : null
|
|
143
130
|
};
|
|
144
131
|
};
|
|
145
132
|
//# sourceMappingURL=useManageTreeNodeSelection.js.map
|
|
@@ -1 +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,
|
|
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,EAA2C,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AACpF,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAGnC,OAAO,EAAC,yBAAyB,EAAC,MAAM,YAAY,CAAC;AACrD,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAC,aAAa,EAA6D,MAAM,iBAAiB,CAAC;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CAAC,CAAC,IAAI;KACf,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -7,11 +7,9 @@ interface IUseOutsideInteractionDetectorProps {
|
|
|
7
7
|
attribute: RecordFormElementFragment['attribute'];
|
|
8
8
|
activeAttribute: IRecordPropertyWithAttribute | null;
|
|
9
9
|
dispatch: Dispatch<IEditRecordReducerActions>;
|
|
10
|
-
formIdToLoad: string | 'edition' | 'creation';
|
|
11
10
|
backendValues: RecordFormElementsValue[];
|
|
12
|
-
pendingValues: RecordFormElementsValue[];
|
|
13
11
|
allowedSelectors?: string[];
|
|
14
12
|
attributePrefix?: typeof LINK_FIELD_ID_PREFIX | typeof STANDARD_FIELD_ID_PREFIX | typeof TREE_FIELD_ID_PREFIX;
|
|
15
13
|
}
|
|
16
|
-
export declare const useOutsideInteractionDetector: ({ attribute, activeAttribute, attributePrefix, dispatch,
|
|
14
|
+
export declare const useOutsideInteractionDetector: ({ attribute, activeAttribute, attributePrefix, dispatch, backendValues, allowedSelectors }: IUseOutsideInteractionDetectorProps) => void;
|
|
17
15
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditRecordReducerActionsTypes } from '../../../../../components/RecordEdition/editRecordReducer/editRecordReducer';
|
|
2
2
|
import { EDIT_RECORD_SIDEBAR_ID } from '../../../../../constants';
|
|
3
3
|
import { useEffect, useRef } from 'react';
|
|
4
|
-
export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attributePrefix, dispatch,
|
|
4
|
+
export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attributePrefix, dispatch, backendValues, allowedSelectors = [] }) => {
|
|
5
5
|
// Use a ref to store the current props to access them in the event handlers
|
|
6
6
|
// This will prevent issue when multiple event handlers are attached to the document
|
|
7
7
|
const hookPropsRef = useRef({
|
|
@@ -9,9 +9,7 @@ export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attr
|
|
|
9
9
|
activeAttribute,
|
|
10
10
|
attributePrefix,
|
|
11
11
|
allowedSelectors,
|
|
12
|
-
|
|
13
|
-
backendValues,
|
|
14
|
-
pendingValues
|
|
12
|
+
backendValues
|
|
15
13
|
});
|
|
16
14
|
useEffect(() => {
|
|
17
15
|
hookPropsRef.current = {
|
|
@@ -19,11 +17,9 @@ export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attr
|
|
|
19
17
|
activeAttribute,
|
|
20
18
|
attributePrefix,
|
|
21
19
|
allowedSelectors,
|
|
22
|
-
|
|
23
|
-
backendValues,
|
|
24
|
-
pendingValues
|
|
20
|
+
backendValues
|
|
25
21
|
};
|
|
26
|
-
}, [attribute, activeAttribute, attributePrefix, allowedSelectors,
|
|
22
|
+
}, [attribute, activeAttribute, attributePrefix, allowedSelectors, backendValues]);
|
|
27
23
|
useEffect(() => {
|
|
28
24
|
const handleClick = (event) => {
|
|
29
25
|
const currentProps = hookPropsRef.current;
|
|
@@ -34,7 +30,7 @@ export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attr
|
|
|
34
30
|
dispatch({
|
|
35
31
|
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
36
32
|
attribute: currentProps.attribute,
|
|
37
|
-
values:
|
|
33
|
+
values: currentProps.backendValues
|
|
38
34
|
});
|
|
39
35
|
return;
|
|
40
36
|
}
|
|
@@ -61,7 +57,7 @@ export const useOutsideInteractionDetector = ({ attribute, activeAttribute, attr
|
|
|
61
57
|
dispatch({
|
|
62
58
|
type: EditRecordReducerActionsTypes.SET_ACTIVE_VALUE,
|
|
63
59
|
attribute: currentProps.attribute,
|
|
64
|
-
values:
|
|
60
|
+
values: currentProps.backendValues
|
|
65
61
|
});
|
|
66
62
|
}
|
|
67
63
|
};
|
|
@@ -1 +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;
|
|
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;AAWlD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,EAC1C,SAAS,EACT,eAAe,EACf,eAAe,EACf,QAAQ,EACR,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,aAAa;KAChB,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,YAAY,CAAC,OAAO,GAAG;YACnB,SAAS;YACT,eAAe;YACf,eAAe;YACf,gBAAgB;YAChB,aAAa;SAChB,CAAC;IACN,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;IAEnF,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,GAAG,KAAK,CAAC,MAAqB,CAAC;YAC3C,MAAM,oBAAoB,GA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