@leav/ui 1.4.1-4d58c0b2 → 1.4.1-79c3ba25
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/_gqlTypes/index.d.ts +49 -0
- package/dist/_gqlTypes/index.js +50 -2
- package/dist/_gqlTypes/index.js.map +1 -1
- package/dist/_queries/export/exportQuery.js +2 -2
- package/dist/_utils/index.js +4 -4
- package/dist/components/AttributePicker/AttributesList/AttributesList.js +1 -1
- package/dist/components/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfoForm/LinkedLibraryForm/LinkedLibraryForm.js +1 -1
- package/dist/components/EditAttributeModal/EditAttribute/EditAttributeInfo/EditAttributeInfoForm/LinkedTreeForm/LinkedTreeForm.js +1 -1
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryAttributes/AttributesList/AttributeCell/AttributeCell.js +1 -1
- package/dist/components/EditLibraryModal/EditLibrary/EditLibraryPreviewsSettings/EditPreviewsSettingsModal/EditPreviewsSettingsModal.js +5 -5
- package/dist/components/EditTreeModal/EditTree/EditTreeInfo/EditTreeInfoForm/TreeLibrariesForm/TreeLibrariesForm.js +1 -1
- package/dist/components/EntityCard/EntityCard.js +5 -5
- package/dist/components/Explorer/Explorer.d.ts +2 -1
- package/dist/components/Explorer/Explorer.js +50 -32
- package/dist/components/Explorer/Explorer.js.map +1 -1
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js +8 -12
- package/dist/components/Explorer/ExplorerFiltersAndSorts.js.map +1 -1
- package/dist/components/Explorer/ExplorerToolbar.js +6 -3
- package/dist/components/Explorer/ExplorerToolbar.js.map +1 -1
- package/dist/components/Explorer/_constants.d.ts +1 -0
- package/dist/components/Explorer/_constants.js +1 -0
- package/dist/components/Explorer/_constants.js.map +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.d.ts +3 -2
- package/dist/components/Explorer/_queries/useExplorerData.js +1 -1
- package/dist/components/Explorer/_queries/useExplorerData.js.map +1 -1
- package/dist/components/Explorer/_types.d.ts +4 -116
- package/dist/components/Explorer/_types.js +1 -12
- package/dist/components/Explorer/_types.js.map +1 -1
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js +17 -8
- package/dist/components/Explorer/actions-item/useEditStatusItemAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js +12 -5
- package/dist/components/Explorer/actions-mass/useDeactivateMassAction.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.d.ts +3 -1
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js +14 -7
- package/dist/components/Explorer/actions-mass/useDeleteLinkValues.js.map +1 -1
- package/dist/components/Explorer/actions-mass/useExportMassAction.d.ts +17 -0
- package/dist/components/Explorer/actions-mass/useExportMassAction.js +95 -0
- package/dist/components/Explorer/actions-mass/useExportMassAction.js.map +1 -0
- package/dist/components/Explorer/actions-mass/useMassActions.d.ts +3 -1
- package/dist/components/Explorer/actions-mass/useMassActions.js +4 -4
- package/dist/components/Explorer/actions-mass/useMassActions.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js +3 -3
- package/dist/components/Explorer/manage-view-settings/filter-items/FilterItems.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js +3 -1
- package/dist/components/Explorer/manage-view-settings/router-menu/SettingsPanel.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.d.ts +2 -1
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js +6 -6
- package/dist/components/Explorer/manage-view-settings/save-view/prepareViewForRequest.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js +15 -3
- package/dist/components/Explorer/manage-view-settings/save-view/useCreateNewView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useResetView.js +4 -0
- 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 +4 -2
- package/dist/components/Explorer/manage-view-settings/save-view/useShareView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js +15 -3
- package/dist/components/Explorer/manage-view-settings/save-view/useUpdateView.js.map +1 -1
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsInitialState.js +1 -4
- 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 -9
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js +4 -128
- package/dist/components/Explorer/manage-view-settings/store-view-settings/viewSettingsReducer.js.map +1 -1
- package/dist/components/Explorer/useLoadView.js +15 -8
- package/dist/components/Explorer/useLoadView.js.map +1 -1
- package/dist/components/Explorer/useViewSettingsReducer.js +5 -10
- package/dist/components/Explorer/useViewSettingsReducer.js.map +1 -1
- package/dist/components/Filters/FiltersProvider.d.ts +3 -0
- package/dist/components/Filters/FiltersProvider.js +8 -0
- package/dist/components/Filters/FiltersProvider.js.map +1 -0
- package/dist/components/Filters/_types.d.ts +130 -0
- package/dist/components/Filters/_types.js +14 -0
- package/dist/components/Filters/_types.js.map +1 -0
- package/dist/components/Filters/conditionsHelper.d.ts +2 -0
- package/dist/components/Filters/conditionsHelper.js +16 -0
- package/dist/components/Filters/conditionsHelper.js.map +1 -0
- package/dist/components/Filters/context/filtersContext.d.ts +6 -0
- package/dist/components/Filters/context/filtersContext.js +9 -0
- package/dist/components/Filters/context/filtersContext.js.map +1 -0
- package/dist/components/Filters/context/filtersInitialState.d.ts +2 -0
- package/dist/components/Filters/context/filtersInitialState.js +10 -0
- package/dist/components/Filters/context/filtersInitialState.js.map +1 -0
- package/dist/components/Filters/context/filtersReducer.d.ts +64 -0
- package/dist/components/Filters/context/filtersReducer.js +179 -0
- package/dist/components/Filters/context/filtersReducer.js.map +1 -0
- package/dist/components/Filters/context/useFiltersReducer.d.ts +13 -0
- package/dist/components/Filters/context/useFiltersReducer.js +68 -0
- package/dist/components/Filters/context/useFiltersReducer.js.map +1 -0
- package/dist/components/Filters/filter-items/CommonFilterItem.d.ts +8 -0
- package/dist/components/{Explorer/manage-view-settings/_shared → Filters/filter-items}/CommonFilterItem.js +7 -7
- package/dist/components/Filters/filter-items/CommonFilterItem.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/BooleanAttributeDropdown.js +16 -8
- package/dist/components/Filters/filter-items/filter-type/BooleanAttributeDropdown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/ColorAttributeDropDown.js +1 -1
- package/dist/components/Filters/filter-items/filter-type/ColorAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/DateAttributeDropDown.js +3 -3
- package/dist/components/Filters/filter-items/filter-type/DateAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/DateRangeAttributeDropDown.js +1 -1
- package/dist/components/Filters/filter-items/filter-type/DateRangeAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/EncryptedAttributeDropDown.js +1 -1
- package/dist/components/Filters/filter-items/filter-type/EncryptedAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/ExtendedAttributeDropDown.js +1 -1
- package/dist/components/Filters/filter-items/filter-type/ExtendedAttributeDropDown.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.d.ts +3 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/FilterDropDown.js +9 -9
- package/dist/components/Filters/filter-items/filter-type/FilterDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/FilterDropdownContent.d.ts +3 -3
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/FilterDropdownContent.js +6 -6
- package/dist/components/Filters/filter-items/filter-type/FilterDropdownContent.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/FilterValueListDropDown.d.ts +3 -3
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/FilterValueListDropDown.js +5 -5
- package/dist/components/Filters/filter-items/filter-type/FilterValueListDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/LinkAttributeDropdown.js +6 -6
- package/dist/components/Filters/filter-items/filter-type/LinkAttributeDropdown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/NumericAttributeDropDown.js +2 -2
- package/dist/components/Filters/filter-items/filter-type/NumericAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/TextAttributeDropDown.js +2 -2
- package/dist/components/Filters/filter-items/filter-type/TextAttributeDropDown.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/TreeAttributeDropDown.js +5 -5
- package/dist/components/Filters/filter-items/filter-type/TreeAttributeDropDown.js.map +1 -0
- package/dist/components/Filters/filter-items/filter-type/_types.d.ts +18 -0
- package/dist/components/Filters/filter-items/filter-type/_types.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/useConditionOptionsByType.d.ts +7 -7
- package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/useConditionOptionsByType.js +14 -14
- package/dist/components/Filters/filter-items/filter-type/useConditionOptionsByType.js.map +1 -0
- package/dist/components/Filters/index.d.ts +8 -0
- package/dist/components/Filters/index.js +12 -0
- package/dist/components/Filters/index.js.map +1 -0
- package/dist/components/Filters/prepareFiltersForRequest.d.ts +4 -0
- package/dist/components/{Explorer/_queries → Filters}/prepareFiltersForRequest.js +12 -11
- package/dist/components/Filters/prepareFiltersForRequest.js.map +1 -0
- package/dist/components/Filters/useFilters.d.ts +1724 -0
- package/dist/components/Filters/useFilters.js +28 -0
- package/dist/components/Filters/useFilters.js.map +1 -0
- package/dist/components/Filters/useFiltersContext.d.ts +4 -0
- package/dist/components/Filters/useFiltersContext.js +13 -0
- package/dist/components/Filters/useFiltersContext.js.map +1 -0
- package/dist/components/{Explorer/manage-view-settings/_shared → Filters}/useTransformFilters.d.ts +9 -9
- package/dist/components/{Explorer/manage-view-settings/_shared → Filters}/useTransformFilters.js +8 -8
- package/dist/components/Filters/useTransformFilters.js.map +1 -0
- package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js +5 -5
- package/dist/components/LibraryItemsList/FiltersDropdown/FiltersDropdown.js.map +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListContent/LibraryItemsListContent.js +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/AllValuesCount/AllValuesCount.js +1 -1
- package/dist/components/LibraryItemsList/LibraryItemsListTable/Cell/Cell.js +1 -1
- package/dist/components/LibraryItemsList/MenuItemList/MenuItemList.js +1 -1
- package/dist/components/LibraryItemsList/MenuItemListSelected/MenuItemListSelected.js +2 -2
- package/dist/components/LibraryItemsList/MenuSelection/MenuSelection.js +1 -1
- package/dist/components/LibraryItemsList/MenuView/MenuView.js +6 -6
- package/dist/components/LibraryItemsList/Sidebar/Sidebar.js +1 -1
- package/dist/components/LibraryItemsList/TileDisplay/ItemTileDisplay/ItemTileDisplay.js +1 -1
- package/dist/components/LibraryItemsList/TileDisplay/helpers/getItemPreviewSize.js +3 -3
- package/dist/components/LibraryItemsList/helpers/displayTypeToPreviewSize.d.ts +1 -1
- package/dist/components/LibraryItemsList/helpers/displayTypeToPreviewSize.js +4 -4
- package/dist/components/LibraryItemsList/hooks/useSearchReducer/searchReducer.js +2 -2
- package/dist/components/LibraryPicker/LibrariesList/LibrariesList.js +2 -2
- package/dist/components/Notifications/InitNotificationsSubscription.d.ts +2 -0
- package/dist/components/Notifications/InitNotificationsSubscription.js +7 -0
- package/dist/components/Notifications/InitNotificationsSubscription.js.map +1 -0
- package/dist/components/Notifications/hooks/useNotificationSubscription.d.ts +4 -0
- package/dist/components/Notifications/hooks/useNotificationSubscription.js +33 -0
- package/dist/components/Notifications/hooks/useNotificationSubscription.js.map +1 -0
- package/dist/components/Notifications/index.d.ts +1 -0
- package/dist/components/Notifications/index.js +5 -0
- package/dist/components/Notifications/index.js.map +1 -0
- package/dist/components/RecordCard/RecordCard.js +4 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js +9 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/LinkField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js +5 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/LinkField/link-record/useLinkRecords.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js +12 -4
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSColorPickerWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSDatePickerWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputEncryptedWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputNumberWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSInputWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRangePickerWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/StandardField/StandardFieldValue/DSRichTextWrapper.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js +14 -2
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/TreeField.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js +3 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/display-tree-node/TreeNodeList.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js +1 -1
- package/dist/components/RecordEdition/EditRecordContent/uiElements/TreeField/manage-tree-node-selection/useManageTreeNodeSelection.js.map +1 -1
- package/dist/components/RecordEdition/EditRecordModal/EditRecordModal.d.ts +2 -2
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.d.ts +3 -2
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js +15 -2
- package/dist/components/RecordEdition/EditRecordPage/EditRecordPage.js.map +1 -1
- package/dist/components/RecordEdition/_types.d.ts +2 -2
- package/dist/components/RecordEdition/hooks/useGetSubmitButtons.d.ts +2 -2
- package/dist/components/RecordPreviewWithModal/FileModal/FileModalContent/FileModalContent.js +1 -1
- package/dist/components/SelectTreeNode/_types.js +1 -0
- package/dist/components/SelectTreeNode/_types.js.map +1 -1
- package/dist/components/TreePicker/TreesList/TreesList.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/constants.d.ts +6 -4
- package/dist/constants.js +6 -4
- package/dist/constants.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useIFrameMessenger/schema.d.ts +8 -2
- package/dist/hooks/useIFrameMessenger/schema.js +4 -3
- package/dist/hooks/useIFrameMessenger/schema.js.map +1 -1
- package/dist/locales/en/shared.json +23 -4
- package/dist/locales/fr/shared.json +23 -4
- package/dist/types/search.d.ts +5 -5
- package/dist/types/search.js +5 -5
- package/package.json +3 -3
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.d.ts +0 -4
- package/dist/components/Explorer/_queries/prepareFiltersForRequest.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.d.ts +0 -6
- package/dist/components/Explorer/manage-view-settings/_shared/CommonFilterItem.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/_shared/useTransformFilters.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/BooleanAttributeDropdown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ColorAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/DateRangeAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/EncryptedAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/ExtendedAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.d.ts +0 -3
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterDropdownContent.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/FilterValueListDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/LinkAttributeDropdown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/NumericAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TextAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/TreeAttributeDropDown.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.d.ts +0 -18
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/_types.js.map +0 -1
- package/dist/components/Explorer/manage-view-settings/filter-items/filter-type/useConditionOptionsByType.js.map +0 -1
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/BooleanAttributeDropdown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/ColorAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/DateAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/DateRangeAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/EncryptedAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/ExtendedAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/LinkAttributeDropdown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/NumericAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/TextAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/TreeAttributeDropDown.d.ts +0 -0
- /package/dist/components/{Explorer/manage-view-settings → Filters}/filter-items/filter-type/_types.js +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// This file is released under LGPL V3
|
|
3
3
|
// License text available at https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
|
-
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator } from '
|
|
6
|
-
import { interleaveElement } from '
|
|
7
|
-
import { AttributeConditionFilter } from '
|
|
8
|
-
import {
|
|
9
|
-
import { nullValueConditions } from '
|
|
5
|
+
import { AttributeFormat, RecordFilterCondition, RecordFilterOperator } from '../../_gqlTypes';
|
|
6
|
+
import { interleaveElement } from '../../_utils/interleaveElement';
|
|
7
|
+
import { AttributeConditionFilter } from '../../types';
|
|
8
|
+
import { isUIFilterStandard, isUIFilterThrough, isUIFilterTree, isUIFilterValueList, isUIFilterLinkWithValueList } from './_types';
|
|
9
|
+
import { nullValueConditions } from './conditionsHelper';
|
|
10
10
|
export const dateValuesSeparator = '\n';
|
|
11
11
|
const _getDateAtNoon = (date) => dayjs.unix(Number(date)).add(12, 'hour').unix().toString();
|
|
12
12
|
const _getDateRequestFilters = ({ field, condition, value }) => {
|
|
@@ -102,19 +102,19 @@ const _generateConditionsFromMultipleValues = (filter) => {
|
|
|
102
102
|
export const prepareFiltersForRequest = (filters, filtersOperator, valuesList) => {
|
|
103
103
|
const interleaveFilter = interleaveElement({ operator: filtersOperator === 'OR' ? RecordFilterOperator.OR : RecordFilterOperator.AND }, filters
|
|
104
104
|
.filter(filter => {
|
|
105
|
-
if (
|
|
105
|
+
if (isUIFilterThrough(filter)) {
|
|
106
106
|
return (filter.subField &&
|
|
107
107
|
filter.subCondition &&
|
|
108
108
|
(filter.value !== null || nullValueConditions.includes(filter.subCondition)));
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if (isUIFilterValueList(filter)) {
|
|
111
111
|
return ((!!filter.condition && filter.value?.length) ||
|
|
112
112
|
(filter.condition && nullValueConditions.includes(filter.condition)));
|
|
113
113
|
}
|
|
114
114
|
return filter.value !== null || (filter.condition && nullValueConditions.includes(filter.condition));
|
|
115
115
|
})
|
|
116
116
|
.map(filter => {
|
|
117
|
-
if (
|
|
117
|
+
if (isUIFilterTree(filter)) {
|
|
118
118
|
return filter;
|
|
119
119
|
}
|
|
120
120
|
const condition = filter.condition === AttributeConditionFilter.THROUGH ? filter.subCondition : filter.condition;
|
|
@@ -122,13 +122,14 @@ export const prepareFiltersForRequest = (filters, filtersOperator, valuesList) =
|
|
|
122
122
|
? `${filter.field}.${filter.subField}`
|
|
123
123
|
: filter.field;
|
|
124
124
|
// When a link attribute has a values list, we must filter on the linked record id
|
|
125
|
-
if (
|
|
125
|
+
if (isUIFilterLinkWithValueList(filter) && typeof field === 'string' && !field.endsWith('.id')) {
|
|
126
126
|
field = `${field}.id`;
|
|
127
127
|
}
|
|
128
128
|
return { ...filter, condition, field };
|
|
129
129
|
})
|
|
130
130
|
.map(filter => {
|
|
131
|
-
|
|
131
|
+
//@ts-ignore typscript does not recognize filter as a UIFilter
|
|
132
|
+
if (isUIFilterValueList(filter) || isUIFilterTree(filter)) {
|
|
132
133
|
if (filter.condition && nullValueConditions.includes(filter.condition)) {
|
|
133
134
|
return [
|
|
134
135
|
{
|
|
@@ -140,7 +141,7 @@ export const prepareFiltersForRequest = (filters, filtersOperator, valuesList) =
|
|
|
140
141
|
}
|
|
141
142
|
return _generateConditionsFromMultipleValues(filter);
|
|
142
143
|
}
|
|
143
|
-
if (
|
|
144
|
+
if (isUIFilterStandard(filter)) {
|
|
144
145
|
switch (filter.attribute.format) {
|
|
145
146
|
case AttributeFormat.date:
|
|
146
147
|
return _getDateRequestFilters(filter);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareFiltersForRequest.js","sourceRoot":"","sources":["../../../src/components/Filters/prepareFiltersForRequest.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,eAAe,EAAE,qBAAqB,EAA0B,oBAAoB,EAAC,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,iBAAiB,EAAC,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAC,wBAAwB,EAAC,MAAM,WAAW,CAAC;AACnD,OAAO,EAIH,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EAGnB,2BAA2B,EAC9B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AAExC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,KAAK,CAAC,IAAI,C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