@gooddata/sdk-ui-filters 11.68.0-alpha.7 → 11.68.0-alpha.9
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/NOTICE +122 -107
- package/esm/AttributeFilter/AttributeFilterProviders.d.ts.map +1 -1
- package/esm/AttributeFilter/AttributeFilterProviders.js +2 -2
- package/esm/AttributeFilter/hooks/useAttributeFilterController.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterController.js +7 -8
- package/esm/AttributeFilter/hooks/useElementsFilterController.js +3 -3
- package/esm/AttributeFilter/hooks/useFilterDetailRequestHandler.d.ts +4 -3
- package/esm/AttributeFilter/hooks/useFilterDetailRequestHandler.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useFilterDetailRequestHandler.js +9 -4
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsSaga.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsSaga.js +2 -2
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsSelectors.js +2 -2
- package/esm/AttributeFilterHandler/internal/redux/elements/formatElementTitles.d.ts +9 -0
- package/esm/AttributeFilterHandler/internal/redux/elements/formatElementTitles.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/formatElementTitles.js +16 -0
- package/esm/AttributeFilterHandler/internal/redux/filter/filterSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/filter/filterSelectors.js +4 -3
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.js +2 -3
- package/esm/DateFilter/DynamicSelect/utils.d.ts.map +1 -1
- package/esm/DateFilter/DynamicSelect/utils.js +3 -3
- package/esm/DateFilter/Select/ScrollableSelectMenu.d.ts.map +1 -1
- package/esm/DateFilter/Select/ScrollableSelectMenu.js +2 -2
- package/esm/DateFilter/utils/DateFilterConfigConversions.d.ts.map +1 -1
- package/esm/DateFilter/utils/DateFilterConfigConversions.js +3 -2
- package/esm/DateFilter/utils/DateFilterOptionMapping.d.ts.map +1 -1
- package/esm/DateFilter/utils/DateFilterOptionMapping.js +3 -3
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeFilterProviders.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/AttributeFilterProviders.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,yBAAyB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"AttributeFilterProviders.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/AttributeFilterProviders.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,yBAAyB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CA8HlG"}
|
|
@@ -7,7 +7,7 @@ import { AttributeFilterContextProvider } from "./Context/AttributeFilterContext
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function AttributeFilterProviders(props) {
|
|
10
|
-
const { resetOnParentFilterChange = true, children, locale, backend, workspace, title, filter, workingFilter, displayAsLabel, connectToPlaceholder, parentFilters, dependentDateFilters, parentFilterOverAttribute, validateElementsBy, hiddenElements, staticElements, fullscreenOnMobile = false, selectionMode = "multi", selectFirst = false, disabled, customIcon, withoutApply = false, overlayPositionType, alignPoints, menuConfig, hideTooltips, showHeader, onApply, onChange, onSelect, onError, onInitLoadingChanged, ErrorComponent, LoadingComponent, DropdownButtonComponent, DropdownBodyComponent, DropdownActionsComponent, ElementsSearchBarComponent, ElementsSelectComponent, ElementsSelectItemComponent, ElementsSelectErrorComponent, ElementsSelectLoadingComponent, ElementsSelectActionsComponent, EmptyResultComponent, StatusBarComponent, FilterMenuComponent, TextFilterBodyComponent, enableImmediateAttributeFilterDisplayAsLabelMigration = false, } = props;
|
|
10
|
+
const { resetOnParentFilterChange = true, children, locale, backend, workspace, title, filter, workingFilter, displayAsLabel, connectToPlaceholder, parentFilters, dependentDateFilters, parentFilterOverAttribute, validateElementsBy, hiddenElements, staticElements, fullscreenOnMobile = false, selectionMode = "multi", selectFirst = false, disabled, customIcon, withoutApply = false, separators, overlayPositionType, alignPoints, menuConfig, hideTooltips, showHeader, onApply, onChange, onSelect, onError, onInitLoadingChanged, ErrorComponent, LoadingComponent, DropdownButtonComponent, DropdownBodyComponent, DropdownActionsComponent, ElementsSearchBarComponent, ElementsSelectComponent, ElementsSelectItemComponent, ElementsSelectErrorComponent, ElementsSelectLoadingComponent, ElementsSelectActionsComponent, EmptyResultComponent, StatusBarComponent, FilterMenuComponent, TextFilterBodyComponent, enableImmediateAttributeFilterDisplayAsLabelMigration = false, } = props;
|
|
11
11
|
const DefaultComponents = getAttributeFilterDefaultComponents(props);
|
|
12
|
-
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(AttributeFilterComponentsProvider, { ErrorComponent: ErrorComponent ?? DefaultComponents.ErrorComponent, LoadingComponent: LoadingComponent ?? DefaultComponents.LoadingComponent, DropdownButtonComponent: DropdownButtonComponent ?? DefaultComponents.DropdownButtonComponent, DropdownBodyComponent: DropdownBodyComponent ?? DefaultComponents.DropdownBodyComponent, DropdownActionsComponent: DropdownActionsComponent ?? DefaultComponents.DropdownActionsComponent, ElementsSearchBarComponent: ElementsSearchBarComponent ?? DefaultComponents.ElementsSearchBarComponent, ElementsSelectComponent: ElementsSelectComponent ?? DefaultComponents.ElementsSelectComponent, ElementsSelectItemComponent: ElementsSelectItemComponent ?? DefaultComponents.ElementsSelectItemComponent, ElementsSelectErrorComponent: ElementsSelectErrorComponent ?? DefaultComponents.ElementsSelectErrorComponent, ElementsSelectLoadingComponent: ElementsSelectLoadingComponent ?? DefaultComponents.ElementsSelectLoadingComponent, ElementsSelectActionsComponent: ElementsSelectActionsComponent ?? DefaultComponents.ElementsSelectActionsComponent, EmptyResultComponent: EmptyResultComponent ?? DefaultComponents.EmptyResultComponent, StatusBarComponent: StatusBarComponent ?? DefaultComponents.StatusBarComponent, FilterMenuComponent: FilterMenuComponent ?? DefaultComponents.FilterMenuComponent, TextFilterBodyComponent: TextFilterBodyComponent ?? DefaultComponents.TextFilterBodyComponent, children: _jsx(AttributeFilterContextProvider, { backend: backend, workspace: workspace, title: title, filter: filter, workingFilter: workingFilter, displayAsLabel: displayAsLabel, connectToPlaceholder: connectToPlaceholder, resetOnParentFilterChange: resetOnParentFilterChange, parentFilters: parentFilters, dependentDateFilters: dependentDateFilters, parentFilterOverAttribute: parentFilterOverAttribute, validateElementsBy: validateElementsBy, onApply: onApply, onChange: onChange ?? onSelect, onError: onError, onInitLoadingChanged: onInitLoadingChanged, hiddenElements: hiddenElements, staticElements: staticElements, fullscreenOnMobile: fullscreenOnMobile, selectionMode: selectionMode, selectFirst: selectFirst, disabled: disabled, customIcon: customIcon, enableImmediateAttributeFilterDisplayAsLabelMigration: enableImmediateAttributeFilterDisplayAsLabelMigration, withoutApply: withoutApply, overlayPositionType: overlayPositionType, alignPoints: alignPoints, menuConfig: menuConfig, hideTooltips: hideTooltips, showHeader: showHeader, children: children }) }) }));
|
|
12
|
+
return (_jsx(IntlWrapper, { locale: locale, children: _jsx(AttributeFilterComponentsProvider, { ErrorComponent: ErrorComponent ?? DefaultComponents.ErrorComponent, LoadingComponent: LoadingComponent ?? DefaultComponents.LoadingComponent, DropdownButtonComponent: DropdownButtonComponent ?? DefaultComponents.DropdownButtonComponent, DropdownBodyComponent: DropdownBodyComponent ?? DefaultComponents.DropdownBodyComponent, DropdownActionsComponent: DropdownActionsComponent ?? DefaultComponents.DropdownActionsComponent, ElementsSearchBarComponent: ElementsSearchBarComponent ?? DefaultComponents.ElementsSearchBarComponent, ElementsSelectComponent: ElementsSelectComponent ?? DefaultComponents.ElementsSelectComponent, ElementsSelectItemComponent: ElementsSelectItemComponent ?? DefaultComponents.ElementsSelectItemComponent, ElementsSelectErrorComponent: ElementsSelectErrorComponent ?? DefaultComponents.ElementsSelectErrorComponent, ElementsSelectLoadingComponent: ElementsSelectLoadingComponent ?? DefaultComponents.ElementsSelectLoadingComponent, ElementsSelectActionsComponent: ElementsSelectActionsComponent ?? DefaultComponents.ElementsSelectActionsComponent, EmptyResultComponent: EmptyResultComponent ?? DefaultComponents.EmptyResultComponent, StatusBarComponent: StatusBarComponent ?? DefaultComponents.StatusBarComponent, FilterMenuComponent: FilterMenuComponent ?? DefaultComponents.FilterMenuComponent, TextFilterBodyComponent: TextFilterBodyComponent ?? DefaultComponents.TextFilterBodyComponent, children: _jsx(AttributeFilterContextProvider, { backend: backend, workspace: workspace, title: title, filter: filter, workingFilter: workingFilter, displayAsLabel: displayAsLabel, connectToPlaceholder: connectToPlaceholder, resetOnParentFilterChange: resetOnParentFilterChange, parentFilters: parentFilters, dependentDateFilters: dependentDateFilters, parentFilterOverAttribute: parentFilterOverAttribute, validateElementsBy: validateElementsBy, onApply: onApply, onChange: onChange ?? onSelect, onError: onError, onInitLoadingChanged: onInitLoadingChanged, hiddenElements: hiddenElements, staticElements: staticElements, fullscreenOnMobile: fullscreenOnMobile, selectionMode: selectionMode, selectFirst: selectFirst, disabled: disabled, customIcon: customIcon, enableImmediateAttributeFilterDisplayAsLabelMigration: enableImmediateAttributeFilterDisplayAsLabelMigration, withoutApply: withoutApply, separators: separators, overlayPositionType: overlayPositionType, alignPoints: alignPoints, menuConfig: menuConfig, hideTooltips: hideTooltips, showHeader: showHeader, children: children }) }) }));
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttributeFilterController.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAttributeFilterController.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterController.ts"],"names":[],"mappings":"AA8BA,OAAO,EACH,KAAK,yBAAyB,EAGjC,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAS5D;;;GAGG;AACH,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACjD,yBAAyB,EACzB,oBAAoB,GAAG,QAAQ,GAAG,OAAO,CAC5C,GAAG;IACA,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAMF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,UAC9B,kCAAkC,KAC1C,yBAonBF,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import noop from "lodash-es/noop.js";
|
|
4
3
|
import { invariant } from "ts-invariant";
|
|
5
4
|
import { areObjRefsEqual, filterLocalIdentifier, filterObjRef, isArbitraryAttributeFilter, isMatchAttributeFilter, isNegativeFilter, } from "@gooddata/sdk-model";
|
|
6
5
|
import { useBackendStrict, useWorkspaceStrict } from "@gooddata/sdk-ui";
|
|
@@ -105,7 +104,7 @@ export const useAttributeFilterController = (props) => {
|
|
|
105
104
|
: (onChange ?? NOOP_ON_CHANGE);
|
|
106
105
|
const effectiveOnError = isTextSelectionType ? undefined : onError;
|
|
107
106
|
const effectiveOnInitLoadingChanged = isTextSelectionType ? undefined : onInitLoadingChanged;
|
|
108
|
-
const filterDetailRequestHandler = useFilterDetailRequestHandler(backend, workspace);
|
|
107
|
+
const filterDetailRequestHandler = useFilterDetailRequestHandler(backend, workspace, separators);
|
|
109
108
|
const limitingAttributeFilters = useResolveParentFiltersInput(parentFilters, parentFilterOverAttribute, supportsSettingConnectingAttributes);
|
|
110
109
|
const limitingDateFilters = useResolveDependentDateFiltersInput(dependentDateFilters);
|
|
111
110
|
const availableInternalSelectionTypes = mapAvailableSelectionTypesToInternal(availableSelectionTypes);
|
|
@@ -438,7 +437,7 @@ export const useAttributeFilterController = (props) => {
|
|
|
438
437
|
onReset: onResetTextMode,
|
|
439
438
|
filterDetailRequestHandler,
|
|
440
439
|
setDisplayForm,
|
|
441
|
-
resetForModeSwitch: textFilterController.resetForModeSwitch ??
|
|
440
|
+
resetForModeSwitch: textFilterController.resetForModeSwitch ?? (() => { }),
|
|
442
441
|
onSelectionTypeChange: availableInternalSelectionTypes.length > 1 ? onSelectionTypeChangeForControllers : undefined,
|
|
443
442
|
currentSelectionType: selectionType,
|
|
444
443
|
availableInternalSelectionTypes,
|
|
@@ -459,13 +458,13 @@ export const useAttributeFilterController = (props) => {
|
|
|
459
458
|
searchString: elementsFilterController.searchString,
|
|
460
459
|
isFilteredByParentFilters: false,
|
|
461
460
|
parentFilterAttributes: [],
|
|
462
|
-
onLoadNextElementsPage:
|
|
461
|
+
onLoadNextElementsPage: () => { },
|
|
463
462
|
// Expose onSearch in text mode for autocomplete lazy loading
|
|
464
463
|
onSearch: elementsFilterController.onSearch,
|
|
465
|
-
onSelect:
|
|
466
|
-
onOpen:
|
|
467
|
-
onShowFilteredElements:
|
|
468
|
-
onClearIrrelevantSelection:
|
|
464
|
+
onSelect: () => { },
|
|
465
|
+
onOpen: () => { },
|
|
466
|
+
onShowFilteredElements: () => { },
|
|
467
|
+
onClearIrrelevantSelection: () => { },
|
|
469
468
|
};
|
|
470
469
|
}
|
|
471
470
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
// oxlint-disable @typescript-eslint/require-array-sort-compare
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { difference, differenceBy } from "lodash-es";
|
|
5
5
|
import { invariant } from "ts-invariant";
|
|
6
6
|
import { areObjRefsEqual, filterAttributeElements, filterLocalIdentifier, filterObjRef, isArbitraryAttributeFilter, isAttributeElementsByRef, isAttributeElementsByValue, isAttributeFilterWithSelection, isMatchAttributeFilter, isNegativeAttributeFilter, isPositiveAttributeFilter, newNegativeAttributeFilter, newPositiveAttributeFilter, objRefToString, } from "@gooddata/sdk-model";
|
|
7
7
|
import { UnexpectedSdkError } from "@gooddata/sdk-ui";
|
|
8
|
-
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
8
|
+
import { _debounce, _isEmpty, _isEqual } from "@gooddata/util";
|
|
9
9
|
import { isValidSingleSelectionFilter } from "../utils.js";
|
|
10
10
|
import { DISPLAY_FORM_CHANGED_CORRELATION, IRRELEVANT_SELECTION, MAX_SELECTION_SIZE, PARENT_FILTERS_CORRELATION, RESET_CORRELATION, SEARCH_CORRELATION, SHOW_FILTERED_ELEMENTS_CORRELATION, } from "./constants.js";
|
|
11
11
|
import { useAttributeFilterControllerData } from "./useAttributeFilterControllerData.js";
|
|
@@ -495,7 +495,7 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
|
|
|
495
495
|
}, [handler, selectionMode, onSelectionChange, onChangeInputCallback, withoutApply]);
|
|
496
496
|
// Rule is not working with debounce
|
|
497
497
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
498
|
-
const onSearch = useCallback(
|
|
498
|
+
const onSearch = useCallback(_debounce((search) => {
|
|
499
499
|
if (handler.getSearch() !== search) {
|
|
500
500
|
handler.setSearch(search);
|
|
501
501
|
handler.loadInitialElementsPage(SEARCH_CORRELATION);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { type IAnalyticalBackend } from "@gooddata/sdk-backend-spi";
|
|
2
|
-
import { type IAttributeElement, type ObjRef } from "@gooddata/sdk-model";
|
|
2
|
+
import { type IAttributeElement, type ISeparators, type ObjRef } from "@gooddata/sdk-model";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a request handler for loading filter details (sample elements + total count).
|
|
5
|
-
* Used by AttributeFilterDetailsBubble for both elements and text filter modes.
|
|
5
|
+
* Used by AttributeFilterDetailsBubble for both elements and text filter modes. Values of a numeric
|
|
6
|
+
* computed attribute get a formatted title by the number format of the query and the separators.
|
|
6
7
|
*
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
9
|
-
export declare function useFilterDetailRequestHandler(backend: IAnalyticalBackend, workspace: string): (labelRef: ObjRef) => Promise<{
|
|
10
|
+
export declare function useFilterDetailRequestHandler(backend: IAnalyticalBackend, workspace: string, separators?: ISeparators): (labelRef: ObjRef) => Promise<{
|
|
10
11
|
elements: IAttributeElement[];
|
|
11
12
|
totalCount: number;
|
|
12
13
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilterDetailRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useFilterDetailRequestHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"useFilterDetailRequestHandler.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useFilterDetailRequestHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAM5F;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CACzC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,WAAW,GACzB,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBtF"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
+
import { formatElementTitles } from "../../AttributeFilterHandler/internal/redux/elements/formatElementTitles.js";
|
|
3
4
|
const FILTER_DETAILS_ELEMENT_LIMIT = 5;
|
|
4
5
|
/**
|
|
5
6
|
* Creates a request handler for loading filter details (sample elements + total count).
|
|
6
|
-
* Used by AttributeFilterDetailsBubble for both elements and text filter modes.
|
|
7
|
+
* Used by AttributeFilterDetailsBubble for both elements and text filter modes. Values of a numeric
|
|
8
|
+
* computed attribute get a formatted title by the number format of the query and the separators.
|
|
7
9
|
*
|
|
8
10
|
* @internal
|
|
9
11
|
*/
|
|
10
|
-
export function useFilterDetailRequestHandler(backend, workspace) {
|
|
12
|
+
export function useFilterDetailRequestHandler(backend, workspace, separators) {
|
|
11
13
|
return useCallback(async (labelRef) => {
|
|
12
14
|
const result = await backend
|
|
13
15
|
.workspace(workspace)
|
|
@@ -16,6 +18,9 @@ export function useFilterDetailRequestHandler(backend, workspace) {
|
|
|
16
18
|
.forDisplayForm(labelRef)
|
|
17
19
|
.withLimit(FILTER_DETAILS_ELEMENT_LIMIT)
|
|
18
20
|
.query();
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
+
return {
|
|
22
|
+
elements: formatElementTitles(result.items, result.numberFormat, separators),
|
|
23
|
+
totalCount: result.totalCount,
|
|
24
|
+
};
|
|
25
|
+
}, [backend, workspace, separators]);
|
|
21
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementsSaga.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/elementsSaga.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elementsSaga.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/elementsSaga.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAInE,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAYvG;;GAEG;AACH,wBAAiB,YAAY,CACzB,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,EACjD,OAAO,CAAC,EAAE,MAAM,GACjB,YAAY,CAAC,mBAAmB,CAAC,CA6DnC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { omit } from "lodash-es";
|
|
3
2
|
import { call, select } from "redux-saga/effects";
|
|
3
|
+
import { _omit } from "@gooddata/util";
|
|
4
4
|
import { getAttributeFilterContext } from "../common/sagas.js";
|
|
5
5
|
import { selectAttributeFilterDisplayAsLabel, selectAttributeFilterDisplayForm, selectHiddenElementsAsAttributeElements, } from "../filter/filterSelectors.js";
|
|
6
6
|
import { selectAttribute } from "../loadAttribute/loadAttributeSelectors.js";
|
|
@@ -33,7 +33,7 @@ export function* elementsSaga(options, cacheId) {
|
|
|
33
33
|
return {
|
|
34
34
|
elements: elementsQueryResult.items,
|
|
35
35
|
totalCount: elementsQueryResult.totalCount,
|
|
36
|
-
options:
|
|
36
|
+
options: _omit(allOptions, "signal"),
|
|
37
37
|
cacheId: elementsQueryResult.cacheId,
|
|
38
38
|
...(elementsQueryResult.numberFormat === undefined
|
|
39
39
|
? {}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementsSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/elementsSelectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elementsSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/elementsSelectors.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
3
|
-
import {
|
|
3
|
+
import { _compact } from "@gooddata/util";
|
|
4
4
|
import { selectState, toCacheKey } from "../common/selectors.js";
|
|
5
5
|
import { formatElementTitlesMap } from "./formatElementTitles.js";
|
|
6
6
|
import { toRawValueSearch } from "./numericElementValues.js";
|
|
@@ -15,7 +15,7 @@ import { toRawValueSearch } from "./numericElementValues.js";
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export const getElementsByKeys = (keys, elementsMap) => {
|
|
18
|
-
return
|
|
18
|
+
return _compact(keys.map((key) => elementsMap[toCacheKey(key)]));
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* @internal
|
|
@@ -10,4 +10,13 @@ import { type IAttributeElement, type ISeparators } from "@gooddata/sdk-model";
|
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
12
|
export declare function formatElementTitlesMap(elements: Record<string, IAttributeElement>, numberFormat: string | undefined, separators: ISeparators | undefined): Record<string, IAttributeElement>;
|
|
13
|
+
/**
|
|
14
|
+
* Gives a list of elements a formatted title according to the number format of their values.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Returns the very same list when nothing gets formatted.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatElementTitles(elements: IAttributeElement[], numberFormat: string | undefined, separators: ISeparators | undefined): IAttributeElement[];
|
|
13
22
|
//# sourceMappingURL=formatElementTitles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatElementTitles.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/formatElementTitles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAwB/E;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC3C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,WAAW,GAAG,SAAS,GACpC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAcnC"}
|
|
1
|
+
{"version":3,"file":"formatElementTitles.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/formatElementTitles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAwB/E;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC3C,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,WAAW,GAAG,SAAS,GACpC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAcnC;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,iBAAiB,EAAE,EAC7B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,UAAU,EAAE,WAAW,GAAG,SAAS,GACpC,iBAAiB,EAAE,CASrB"}
|
|
@@ -34,3 +34,19 @@ export function formatElementTitlesMap(elements, numberFormat, separators) {
|
|
|
34
34
|
? elements
|
|
35
35
|
: Object.fromEntries(formatted);
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Gives a list of elements a formatted title according to the number format of their values.
|
|
39
|
+
*
|
|
40
|
+
* @remarks
|
|
41
|
+
* Returns the very same list when nothing gets formatted.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export function formatElementTitles(elements, numberFormat, separators) {
|
|
46
|
+
if (!numberFormat) {
|
|
47
|
+
return elements;
|
|
48
|
+
}
|
|
49
|
+
const formatter = createNumberFormatter(separators);
|
|
50
|
+
const formatted = elements.map((element) => formatElementTitle(element, numberFormat, formatter));
|
|
51
|
+
return formatted.every((element, index) => element === elements[index]) ? elements : formatted;
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/filter/filterSelectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filterSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/filter/filterSelectors.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,MAAM,EAGd,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC,MAAM,GAAG,QAAQ,CAG/E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,EAAE,CAGzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uCAAuC,EAAE,cAAc,CAAC,kBAAkB,CAKtF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,cAAc,CAAC,MAAM,CAGnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mCAAmC,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAGlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAGnF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,gBAAgB,GAAG,SAAS,CAG7E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAAc,CAAC,kBAAkB,CAK5E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uDAAuD,EAAE,cAAc,CAAC,kBAAkB,CAelG,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,gEAAgE,EAAE,cAAc,CAAC,kBAAkB,CAoB3G,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,wBAAwB,GAAG,wBAAwB,CAUjG,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,cAAc,CACvD,wBAAwB,GAAG,wBAAwB,CAoBtD,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// (C) 2021-
|
|
1
|
+
// (C) 2021-2026 GoodData Corporation
|
|
2
2
|
// in current version of @reduxjs/toolkit esm export are not defined
|
|
3
3
|
// we need direct import from esm module otherwise import ar not node compatible
|
|
4
4
|
// https://github.com/reduxjs/redux-toolkit/issues/1960
|
|
5
5
|
import { createSelector } from "@reduxjs/toolkit";
|
|
6
|
-
import { difference, union
|
|
6
|
+
import { difference, union } from "lodash-es";
|
|
7
7
|
import { newNegativeAttributeFilter, newPositiveAttributeFilter, } from "@gooddata/sdk-model";
|
|
8
|
+
import { _uniq } from "@gooddata/util";
|
|
8
9
|
import { selectState } from "../common/selectors.js";
|
|
9
10
|
import { selectElements } from "../elements/elementsSelectors.js";
|
|
10
11
|
import { selectCommittedSelection, selectIsCommittedSelectionInverted, } from "../selection/selectionSelectors.js";
|
|
@@ -62,7 +63,7 @@ export const selectAttributeFilterElementsToDisplayWithHiddenElementsResolved =
|
|
|
62
63
|
const selectedTitles = elements
|
|
63
64
|
.filter((element) => updatedSelection.find((selectionItem) => selectionItem === element.uri))
|
|
64
65
|
.map((element) => element.title);
|
|
65
|
-
const uniqueTitles =
|
|
66
|
+
const uniqueTitles = _uniq(selectedTitles);
|
|
66
67
|
return elementsForm === "uris"
|
|
67
68
|
? { uris: uniqueTitles }
|
|
68
69
|
: { values: uniqueTitles };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadNextElementsPageSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadNextElementsPageSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOzD;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,cAAc,CAAC,oBAAoB,CAGjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,gBAAgB,GAAG,SAAS,CAGxF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC,oBAAoB,CAQlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,OAAO,CAOrD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAAC,OAAO,CAWtE,CAAC"}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// we need direct import from esm module otherwise import ar not node compatible
|
|
4
4
|
// https://github.com/reduxjs/redux-toolkit/issues/1960
|
|
5
5
|
import { createSelector } from "@reduxjs/toolkit";
|
|
6
|
-
import {
|
|
7
|
-
import { _isEqual } from "@gooddata/util";
|
|
6
|
+
import { _isEqual, _omit } from "@gooddata/util";
|
|
8
7
|
import { selectState } from "../common/selectors.js";
|
|
9
8
|
import { selectElementsTotalCountWithCurrentSettings, selectLastLoadedElementsOptions, selectLoadElementsOptions, } from "../elements/elementsSelectors.js";
|
|
10
9
|
/**
|
|
@@ -38,5 +37,5 @@ export const selectIsLoadElementsOptionsChanged = createSelector(selectLoadEleme
|
|
|
38
37
|
return !_isEqual(
|
|
39
38
|
// omit offset as it changes for each page
|
|
40
39
|
// omit options which can not be set externally by user and thus are not stored in state
|
|
41
|
-
|
|
40
|
+
_omit(loadOptions, "offset", "excludePrimaryLabel", "filterByPrimaryLabel"), _omit(lastLoadedOptions, "offset", "excludePrimaryLabel", "filterByPrimaryLabel"));
|
|
42
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DynamicSelect/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DynamicSelect/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAMjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE9E,eAAO,MAAM,MAAM,EAAE,qBAAyC,CAAC;AAC/D,eAAO,MAAM,MAAM,EAAE,qBAAyC,CAAC;AAC/D,eAAO,MAAM,IAAI,EAAE,qBAAuC,CAAC;AAC3D,eAAO,MAAM,GAAG,EAAE,qBAAuC,CAAC;AAC1D,eAAO,MAAM,OAAO,EAAE,qBAA0C,CAAC;AACjE,eAAO,MAAM,KAAK,EAAE,qBAAwC,CAAC;AAC7D,eAAO,MAAM,OAAO,EAAE,qBAA0C,CAAC;AACjE,eAAO,MAAM,IAAI,EAAE,qBAAuC,CAAC;AAC3D,eAAO,MAAM,YAAY,EAAE,qBAA+C,CAAC;AAC3E,eAAO,MAAM,cAAc,EAAE,qBAAiD,CAAC;AAC/E,eAAO,MAAM,WAAW,EAAE,qBAA8C,CAAC;AA4LzE,eAAO,MAAM,mCAAmC,YACnC,iBAAiB,EAAE,SACrB,MAAM,KACd,mBAAmB,GAAG,IAGxB,CAAC;AAEF,eAAO,MAAM,wCAAwC,YACxC,iBAAiB,EAAE,SACrB,MAAM,KACd,MAGF,CAAC;AAEF,eAAO,MAAM,mCAAmC,YACnC,iBAAiB,EAAE,SACrB,MAAM,KACd,mBAAmB,GAAG,IAExB,CAAC;AAEF,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,MAAM,YAAK,EAClB,WAAW,EAAE,qBAAqB,YAAM,EACxC,IAAI,EAAE,kBAAkB,GACzB,iBAAiB,EAAE,CAkBrB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { _range } from "@gooddata/util";
|
|
3
3
|
import { messages } from "../../locales.js";
|
|
4
4
|
import { granularityIntlCodes } from "../constants/i18n.js";
|
|
5
5
|
import { getSelectableItems } from "../Select/utils.js";
|
|
@@ -81,8 +81,8 @@ const getOption = (offset, granularity, intl) => {
|
|
|
81
81
|
const getOptionsForOffsets = (offsets, granularity, intl) => offsets.map((offset) => getOption(offset, granularity, intl));
|
|
82
82
|
const getDefaultOptions = (granularity, intl) => {
|
|
83
83
|
const optionRange = granularityOffsetLimits[granularity];
|
|
84
|
-
const negativeOptions = getOptionsForOffsets(
|
|
85
|
-
const positiveOptions = getOptionsForOffsets(
|
|
84
|
+
const negativeOptions = getOptionsForOffsets(_range(-optionRange, 0), granularity, intl);
|
|
85
|
+
const positiveOptions = getOptionsForOffsets(_range(1, optionRange + 1), granularity, intl);
|
|
86
86
|
return [
|
|
87
87
|
...negativeOptions,
|
|
88
88
|
{ type: "separator" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollableSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/Select/ScrollableSelectMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"ScrollableSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/Select/ScrollableSelectMenu.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAO3D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAwB,MAAM,YAAY,CAAC;AAG5F,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7B,YAAY,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,yBAAyB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AACD,MAAM,WAAW,gBAAgB,CAAC,CAAC,CAAE,SAAQ,kBAAkB,CAAC,CAAC,CAAC;IAC9D,YAAY,EAAE,yBAAyB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAgE1C,eAAO,MAAM,cAAc,UAAW,GAAG,EAAE,KAAG,MAAsC,CAAC;AAErF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,EAAE,EACnD,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,eAAe,EACf,iBAA4C,EAC5C,UAAU,EACV,mBAAmB,GACtB,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CA4IrB"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2019-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useLayoutEffect, useRef } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { _range } from "@gooddata/util";
|
|
6
6
|
import { SelectHeading } from "./SelectHeading.js";
|
|
7
7
|
import { SelectOption } from "./SelectOption.js";
|
|
8
8
|
import { SelectSeparator } from "./SelectSeparator.js";
|
|
@@ -138,7 +138,7 @@ export function ScrollableSelectMenu({ items, selectedItem, highlightedIndex, ge
|
|
|
138
138
|
optionClassName,
|
|
139
139
|
});
|
|
140
140
|
const middleItemIndex = getMedianIndex(getSelectableItems(items));
|
|
141
|
-
const visibleIndexes =
|
|
141
|
+
const visibleIndexes = _range(Math.max(middleItemIndex - visibleItemsRange, 0), Math.min(middleItemIndex + visibleItemsRange + 1, items.length));
|
|
142
142
|
const itemHeightFn = getItemHeight(items);
|
|
143
143
|
const listHeight = visibleIndexes.reduce((totalHeight, itemIndex) => totalHeight + itemHeightFn(itemIndex), 0);
|
|
144
144
|
return (_jsx("div", { ...getMenuProps({ className: cx("gd-select-menu-wrapper", className) }), children: _jsx("div", { className: "gd-select-menu s-select-menu", children: _jsx("div", { className: "List", ref: listRef, style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterConfigConversions.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/DateFilterConfigConversions.ts"],"names":[],"mappings":"AAKA,OAAO,EAIH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilterConfigConversions.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/DateFilterConfigConversions.ts"],"names":[],"mappings":"AAKA,OAAO,EAIH,KAAK,iBAAiB,EAIzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EAGH,KAAK,wBAAwB,EAIhC,MAAM,wBAAwB,CAAC;AAOhC;;;;;;;;;;GAUG;AACH,wBAAgB,0CAA0C,CACtD,MAAM,EAAE,iBAAiB,GAC1B,wBAAwB,CAgB1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
2
|
import { endOfDay, format, startOfDay, subMonths } from "date-fns";
|
|
3
|
-
import {
|
|
3
|
+
import { max, min } from "lodash-es";
|
|
4
|
+
import { _groupBy } from "@gooddata/util";
|
|
4
5
|
import { removeEmptyKeysFromDateFilterOptions } from "./OptionUtils.js";
|
|
5
6
|
// date-fns tokens of the platform date-time format (Platform.ts holds the moment spelling).
|
|
6
7
|
const PLATFORM_DATE_FORMAT = "yyyy-MM-dd HH:mm";
|
|
@@ -72,7 +73,7 @@ function convertAbsolutePresets(filters) {
|
|
|
72
73
|
}
|
|
73
74
|
function convertRelativePresets(filters) {
|
|
74
75
|
return (filters &&
|
|
75
|
-
|
|
76
|
+
_groupBy(filters.map((preset) => sanitizeDateFilterOption({
|
|
76
77
|
...preset,
|
|
77
78
|
type: "relativePreset",
|
|
78
79
|
})), (preset) => preset.granularity));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterOptionMapping.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/DateFilterOptionMapping.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateFilterOptionMapping.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/DateFilterOptionMapping.ts"],"names":[],"mappings":"AAEA,OAAO,EAIH,KAAK,oBAAoB,EAK5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAKhC,MAAM,wBAAwB,CAAC;AAYhC;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oBAAoB,EAAE,OAAO,CAAC;CACjC;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,+CAA+C,CAC3D,UAAU,EAAE,oBAAoB,GAAG,SAAS,EAC5C,gBAAgB,EAAE,wBAAwB,EAC1C,iBAAiB,EAAE,MAAM,GAAG,SAAS,GACtC,qBAAqB,CAmBvB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC7C,UAAU,EAAE,oBAAoB,GAAG,SAAS,EAC5C,gBAAgB,EAAE,wBAAwB,GAC3C,qBAAqB,CA6EvB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,wBAAwB,GAAG,gBAAgB,EAAE,CAcxG;AAuDD;;;;GAIG;AACH,wBAAgB,2BAA2B,CACvC,UAAU,EAAE,oBAAoB,EAChC,iBAAiB,EAAE,wBAAwB,gCAG9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2021-2026 GoodData Corporation
|
|
2
|
-
import { compact } from "lodash-es";
|
|
3
2
|
import { isAllTimeDashboardDateFilter, isLowerBound, isUpperBound, } from "@gooddata/sdk-model";
|
|
3
|
+
import { _compact } from "@gooddata/util";
|
|
4
4
|
import { isAbsoluteDateFilterOption, isRelativeDateFilterOption, } from "../interfaces/index.js";
|
|
5
5
|
import { revertExcludedCurrentPeriodRange } from "./PeriodExclusion.js";
|
|
6
6
|
const VIRTUAL_PRESET_IDENTIFIER = "GDC__VIRTUAL_PRESET";
|
|
@@ -125,10 +125,10 @@ export function matchDateFilterToDateFilterOption(dateFilter, availableOptions)
|
|
|
125
125
|
export function flattenDateFilterOptions(dateFilterOptions) {
|
|
126
126
|
// relativePreset is optional — guard it, or option sets without it (e.g. a static-only picker)
|
|
127
127
|
// crash the whole matching path on Object.values(undefined).
|
|
128
|
-
const relativePresets =
|
|
128
|
+
const relativePresets = _compact(Object.values(dateFilterOptions.relativePreset ?? {})).flat();
|
|
129
129
|
// the order is significant here
|
|
130
130
|
// the first visible filter is selected for new dashboards if none is specified in config
|
|
131
|
-
return
|
|
131
|
+
return _compact([
|
|
132
132
|
dateFilterOptions.allTime,
|
|
133
133
|
dateFilterOptions.emptyValues,
|
|
134
134
|
...(dateFilterOptions.absolutePreset || []),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-filters",
|
|
3
|
-
"version": "11.68.0-alpha.
|
|
3
|
+
"version": "11.68.0-alpha.9",
|
|
4
4
|
"description": "GoodData.UI SDK - Filter Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"ts-invariant": "0.10.3",
|
|
49
49
|
"tslib": "2.8.1",
|
|
50
50
|
"uuid": "11.1.1",
|
|
51
|
-
"@gooddata/sdk-backend-spi": "11.68.0-alpha.
|
|
52
|
-
"@gooddata/sdk-
|
|
53
|
-
"@gooddata/sdk-
|
|
54
|
-
"@gooddata/
|
|
55
|
-
"@gooddata/
|
|
51
|
+
"@gooddata/sdk-backend-spi": "11.68.0-alpha.9",
|
|
52
|
+
"@gooddata/sdk-ui": "11.68.0-alpha.9",
|
|
53
|
+
"@gooddata/sdk-model": "11.68.0-alpha.9",
|
|
54
|
+
"@gooddata/sdk-ui-kit": "11.68.0-alpha.9",
|
|
55
|
+
"@gooddata/util": "11.68.0-alpha.9"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@microsoft/api-documenter": "7.30.20",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"stylelint": "16.26.1",
|
|
91
91
|
"typescript": "7.0.2",
|
|
92
92
|
"vitest": "5.0.4",
|
|
93
|
-
"@gooddata/eslint-config": "11.68.0-alpha.
|
|
94
|
-
"@gooddata/
|
|
95
|
-
"@gooddata/
|
|
96
|
-
"@gooddata/
|
|
97
|
-
"@gooddata/
|
|
98
|
-
"@gooddata/stylelint-config": "11.68.0-alpha.
|
|
93
|
+
"@gooddata/eslint-config": "11.68.0-alpha.9",
|
|
94
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.9",
|
|
95
|
+
"@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.9",
|
|
96
|
+
"@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.9",
|
|
97
|
+
"@gooddata/reference-workspace": "11.68.0-alpha.9",
|
|
98
|
+
"@gooddata/stylelint-config": "11.68.0-alpha.9"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
101
|
"react": "^18.0.0 || ^19.0.0",
|