@gooddata/sdk-ui-filters 11.68.0-alpha.0 → 11.68.0-alpha.10
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/LICENSE +1 -1
- package/NOTICE +10949 -0
- package/esm/AttributeFilter/AttributeFilterProviders.d.ts.map +1 -1
- package/esm/AttributeFilter/AttributeFilterProviders.js +2 -2
- package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.js +6 -3
- package/esm/AttributeFilter/hooks/useAttributeFilterController.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterController.js +7 -8
- package/esm/AttributeFilter/hooks/useAttributeFilterControllerData.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterControllerData.js +3 -3
- package/esm/AttributeFilter/hooks/useAttributeFilterHandler.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterHandler.js +6 -6
- package/esm/AttributeFilter/hooks/useElementsFilterController.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useElementsFilterController.js +13 -12
- 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/AttributeFilter/utils.d.ts +16 -1
- package/esm/AttributeFilter/utils.d.ts.map +1 -1
- package/esm/AttributeFilter/utils.js +25 -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/elements/loadElementsFromBackend.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/loadElementsFromBackend.js +5 -5
- 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 +3 -3
- package/esm/AttributeFilterHandler/internal/redux/selection/selectionSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/selection/selectionSelectors.js +3 -3
- package/esm/AttributeFilterHandler/utils.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/utils.js +3 -3
- package/esm/DateFilter/DateFilter.d.ts.map +1 -1
- package/esm/DateFilter/DateFilter.js +7 -7
- package/esm/DateFilter/DateFilterBody/DateFilterBody.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterBody/DateFilterBody.js +2 -2
- package/esm/DateFilter/DateFilterBody/DateFilterFormContent.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterBody/DateFilterFormContent.js +2 -2
- package/esm/DateFilter/DateFilterCore.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterCore.js +3 -3
- package/esm/DateFilter/DateRangePicker/DateInput.js +2 -2
- 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/interfaces/index.d.ts.map +1 -1
- package/esm/DateFilter/interfaces/index.js +3 -3
- 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/esm/DateFilter/utils/FormattingUtils.d.ts.map +1 -1
- package/esm/DateFilter/utils/FormattingUtils.js +3 -2
- package/esm/DateFilter/utils/OptionUtils.d.ts.map +1 -1
- package/esm/DateFilter/utils/OptionUtils.js +3 -3
- package/esm/FilterGroup/FilterGroup.d.ts.map +1 -1
- package/esm/FilterGroup/FilterGroup.js +2 -2
- package/esm/MeasureValueFilter/typings.d.ts.map +1 -1
- package/esm/MeasureValueFilter/typings.js +2 -2
- package/esm/RankingFilter/RankingFilterDropdownBody.d.ts.map +1 -1
- package/esm/RankingFilter/RankingFilterDropdownBody.js +4 -3
- package/package.json +14 -13
|
@@ -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
|
}
|
package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeFilterElementsSelect.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttributeFilterElementsSelect.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,mCAAmC,EAAE,MAAM,YAAY,CAAC;AAQtE;;;;;;;;;GASG;AACH,wBAAgB,6BAA6B,CAAC,EAC1C,KAAK,EACL,eAAe,EACf,kCAAkC,EAElC,UAAU,EACV,aAAa,EACb,QAAQ,EAER,YAAY,EACZ,QAAQ,EAER,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,KAAK,EAEL,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAElB,6BAA6B,EAC7B,sBAAsB,EAEtB,mBAAmB,EACnB,0BAA0B,EAE1B,kBAAkB,EAClB,eAAe,EAEf,gCAAgC,EAChC,mCAAmC,EACnC,YAAY,GACf,EAAE,mCAAmC,2CAoLrC"}
|
|
@@ -9,7 +9,7 @@ import { useAttributeFilterComponentsContext } from "../../Context/AttributeFilt
|
|
|
9
9
|
import { useAttributeFilterContext } from "../../Context/AttributeFilterContext.js";
|
|
10
10
|
import { BACKEND_PAGE_SIZE, MAX_SELECTION_SIZE } from "../../hooks/constants.js";
|
|
11
11
|
import { useAttributeFilterDropdownHeader } from "../../hooks/useAttributeFilterDropdownHeader.js";
|
|
12
|
-
import { getElementKey, getElementPrimaryTitle, getElementTitle } from "../../utils.js";
|
|
12
|
+
import { getDateFormattedElementRawTitle, getElementKey, getElementPrimaryTitle, getElementTitle, } from "../../utils.js";
|
|
13
13
|
import { AttributeFilterDropdownHeader } from "../Dropdown/AttributeFilterDropdownHeader.js";
|
|
14
14
|
const ITEM_HEIGHT = 28;
|
|
15
15
|
const MOBILE_LIST_ITEM_HEIGHT = 40;
|
|
@@ -46,8 +46,11 @@ export function AttributeFilterElementsSelect({ items, totalItemsCount, totalIte
|
|
|
46
46
|
const primaryLabel = attribute.displayForms.find((df) => !!df.isPrimary);
|
|
47
47
|
return primaryLabel?.title;
|
|
48
48
|
}, [attribute]);
|
|
49
|
-
// Number-formatted values may be rounded or scaled
|
|
50
|
-
|
|
49
|
+
// Number-formatted values may be rounded or scaled and date-formatted values of computed attributes
|
|
50
|
+
// differ from their raw values; the tooltip then tells the raw value users search by.
|
|
51
|
+
const getRawValueTitle = useCallback((item) => elementsNumberFormat
|
|
52
|
+
? getNumberFormattedElementRawTitle(item, separators)
|
|
53
|
+
: getDateFormattedElementRawTitle(item, attribute?.ref), [elementsNumberFormat, separators, attribute?.ref]);
|
|
51
54
|
const handleShowFilteredElements = useCallback(() => {
|
|
52
55
|
setRefocusKey("show");
|
|
53
56
|
onShowFilteredElements?.();
|
|
@@ -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttributeFilterControllerData.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterControllerData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAttributeFilterControllerData.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterControllerData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,qBAAqB,CAAC;AAGrE,OAAO,EAAE,KAAK,kCAAkC,EAAE,MAAM,8DAA8D,CAAC;AAIvH,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAGhE;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,OAAO,EAAE,kCAAkC,EAC3C,+BAA+B,EAAE,OAAO,EACxC,4BAA4B,EAAE,OAAO,EACrC,UAAU,CAAC,EAAE,WAAW,GACzB,6BAA6B,CAqI/B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { isEmpty } from "lodash-es";
|
|
4
3
|
import { filterObjRef } from "@gooddata/sdk-model";
|
|
4
|
+
import { _isEmpty } from "@gooddata/util";
|
|
5
5
|
import { isLimitingAttributeFiltersEmpty } from "../../AttributeFilterHandler/utils.js";
|
|
6
6
|
import { MAX_SELECTION_SIZE, PARENT_FILTERS_CORRELATION } from "./constants.js";
|
|
7
7
|
import { useAttributeFilterHandlerState } from "./useAttributeFilterHandlerState.js";
|
|
@@ -46,10 +46,10 @@ export function useAttributeFilterControllerData(handler, supportsShowingFiltere
|
|
|
46
46
|
const isFilteredByParentFilters = shouldIncludeLimitingFilters && initialElementsPageStatus === "success" && !isParentFiltersEmpty;
|
|
47
47
|
const isFilteredByDependentDateFilters = shouldIncludeLimitingFilters &&
|
|
48
48
|
initialElementsPageStatus === "success" &&
|
|
49
|
-
!
|
|
49
|
+
!_isEmpty(limitingDateFilters);
|
|
50
50
|
const isFilteredByLimitingValidationItems = shouldIncludeLimitingFilters &&
|
|
51
51
|
initialElementsPageStatus === "success" &&
|
|
52
|
-
!
|
|
52
|
+
!_isEmpty(limitingValidationItems);
|
|
53
53
|
const isFiltering = useIsFiltering(handler);
|
|
54
54
|
const parentFilterAttributes = handler.getLimitingAttributeFiltersAttributes();
|
|
55
55
|
const displayForms = attribute?.displayForms ?? [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAttributeFilterHandler.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAttributeFilterHandler.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterHandler.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,MAAM,EAId,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAAE,KAAK,kCAAkC,EAAE,MAAM,8DAA8D,CAAC;AAEvH;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC5C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAElB,MAAM,EAAE,gBAAgB,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,UAAW,+BAA+B,8CAiH/E,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { isEqual } from "lodash-es";
|
|
4
3
|
import { filterObjRef, isArbitraryAttributeFilter, isMatchAttributeFilter, } from "@gooddata/sdk-model";
|
|
5
4
|
import { usePrevious } from "@gooddata/sdk-ui";
|
|
5
|
+
import { _isEqual } from "@gooddata/util";
|
|
6
6
|
import { newAttributeFilterHandler } from "../../AttributeFilterHandler/factory.js";
|
|
7
7
|
/**
|
|
8
8
|
* Hook for retrieving AttributeFilterHandler {@link IMultiSelectAttributeFilterHandler} Core API for Attribute Filter components.
|
|
@@ -62,15 +62,15 @@ export const useAttributeFilterHandler = (props) => {
|
|
|
62
62
|
const originalFilter = handler.getOriginalFilter();
|
|
63
63
|
return (currentFilter &&
|
|
64
64
|
originalFilter &&
|
|
65
|
-
!
|
|
66
|
-
!
|
|
65
|
+
!_isEqual(filterObjRef(filter), filterObjRef(currentFilter)) &&
|
|
66
|
+
!_isEqual(filterObjRef(filter), filterObjRef(originalFilter)));
|
|
67
67
|
};
|
|
68
68
|
if (backend !== prevProps?.backend ||
|
|
69
69
|
workspace !== prevProps?.workspace ||
|
|
70
70
|
filterChanged(filter, handler) ||
|
|
71
|
-
!
|
|
72
|
-
!
|
|
73
|
-
!
|
|
71
|
+
!_isEqual(staticElements, prevProps?.staticElements) ||
|
|
72
|
+
!_isEqual(hiddenElements, prevProps?.hiddenElements) ||
|
|
73
|
+
!_isEqual(separators, prevProps?.separators)) {
|
|
74
74
|
createNewHandler();
|
|
75
75
|
invalidate();
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useElementsFilterController.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useElementsFilterController.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AACxG,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,mBAAmB,EAExB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EAed,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAsB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useElementsFilter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AAM,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACrC,eAAe,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,aAAa,EAAE,qCAAqC,CAAC;IACrD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,qDAAqD,CAAC,EAAE,OAAO,CAAC;IAChE,wCAAwC,EAAE,OAAO,CAAC;IAClD,mCAAmC,EAAE,OAAO,CAAC;IAC7C,+BAA+B,EAAE,OAAO,CAAC;IACzC,oCAAoC,EAAE,OAAO,CAAC;IAC9C,4BAA4B,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACjE,oGAAoG;IACpG,oBAAoB,EAAE,UAAU,GAAG,MAAM,CAAC;IAC1C,+GAA+G;IAC/G,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,8BAA8B,GAAG,wBAAwB,CA+M3G"}
|
|
@@ -1,10 +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 { _debounce, _isEmpty, _isEqual } from "@gooddata/util";
|
|
8
9
|
import { isValidSingleSelectionFilter } from "../utils.js";
|
|
9
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";
|
|
10
11
|
import { useAttributeFilterControllerData } from "./useAttributeFilterControllerData.js";
|
|
@@ -14,10 +15,10 @@ const EMPTY_LIMITING_VALIDATION_ITEMS = [];
|
|
|
14
15
|
const areElementsEqual = (elementsA, elementsB) => {
|
|
15
16
|
return ((isAttributeElementsByRef(elementsA) &&
|
|
16
17
|
isAttributeElementsByRef(elementsB) &&
|
|
17
|
-
|
|
18
|
+
_isEqual([...elementsA.uris].sort(), [...elementsB.uris].sort())) ||
|
|
18
19
|
(isAttributeElementsByValue(elementsA) &&
|
|
19
20
|
isAttributeElementsByValue(elementsB) &&
|
|
20
|
-
|
|
21
|
+
_isEqual([...elementsA.values].sort(), [...elementsB.values].sort())));
|
|
21
22
|
};
|
|
22
23
|
const areFiltersEqual = (filterA, filterB) => {
|
|
23
24
|
if (!filterA || !filterB) {
|
|
@@ -64,7 +65,7 @@ function updateNonResettingFilter(handler, { filter, limitingAttributeFilters, l
|
|
|
64
65
|
const shouldReinitilizeAllElements = supportsKeepingDependentFiltersSelection &&
|
|
65
66
|
(hasNumberOfLimitingAttributesChanged ||
|
|
66
67
|
hasLimitingDateFiltersChanged ||
|
|
67
|
-
!
|
|
68
|
+
!_isEmpty(leftoverIrrelevantKeys));
|
|
68
69
|
const irrelevantKeysObj = shouldReinitilizeAllElements ? { irrelevantKeys: [] } : {};
|
|
69
70
|
if (filterChanged || !supportsKeepingDependentFiltersSelection || shouldReinitilizeAllElements) {
|
|
70
71
|
const displayFormRef = filterObjRef(filter);
|
|
@@ -94,7 +95,7 @@ function updateNonResettingFilter(handler, { filter, limitingAttributeFilters, l
|
|
|
94
95
|
const committedKeys = handler.getCommittedSelection().keys;
|
|
95
96
|
const isSelectionResolved = committedKeys.length === 0 ||
|
|
96
97
|
handler.getElementsByKey(committedKeys).length === committedKeys.length;
|
|
97
|
-
const needsInitialization = filterChanged && (
|
|
98
|
+
const needsInitialization = filterChanged && (_isEmpty(handler.getAllElements()) || !isSelectionResolved);
|
|
98
99
|
if (!needsInitialization) {
|
|
99
100
|
return undefined;
|
|
100
101
|
}
|
|
@@ -282,8 +283,8 @@ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelectio
|
|
|
282
283
|
}
|
|
283
284
|
}
|
|
284
285
|
const limitingAttributesChanged = shouldIncludeLimitingFilters &&
|
|
285
|
-
!
|
|
286
|
-
const limitingDateFiltersChanged = shouldIncludeLimitingFilters && !
|
|
286
|
+
!_isEqual(limitingAttributeFilters, handler.getLimitingAttributeFilters());
|
|
287
|
+
const limitingDateFiltersChanged = shouldIncludeLimitingFilters && !_isEqual(limitingDateFilters, handler.getLimitingDateFilters());
|
|
287
288
|
const getFilterChanged = (filter, handler) => {
|
|
288
289
|
// When the handler migrated the filter internally to a different label (displayAs
|
|
289
290
|
// handling of filters saved directly with a secondary label), the handler's filter
|
|
@@ -305,7 +306,7 @@ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelectio
|
|
|
305
306
|
prevIsTextModeRef.current = isTextMode;
|
|
306
307
|
const filterChanged = justSwitchedFromText || selectionTypeChanged ? false : getFilterChanged(filter, handler);
|
|
307
308
|
const limitingValidationItemsChanged = shouldIncludeLimitingFilters &&
|
|
308
|
-
!
|
|
309
|
+
!_isEqual(limitingValidationItems, handler.getLimitingValidationItems());
|
|
309
310
|
const updateProps = {
|
|
310
311
|
filter: filter,
|
|
311
312
|
limitingAttributeFilters,
|
|
@@ -400,9 +401,9 @@ function useSingleSelectModeHandler(handler, props) {
|
|
|
400
401
|
useEffect(() => {
|
|
401
402
|
if (selectFirst &&
|
|
402
403
|
selectionMode === "single" &&
|
|
403
|
-
(
|
|
404
|
+
(_isEmpty(committedSelectionKeys) || committedSelectionKeys.length > 1) &&
|
|
404
405
|
initialStatus === "success" &&
|
|
405
|
-
!
|
|
406
|
+
!_isEmpty(elements)) {
|
|
406
407
|
const keys = [elements[0].uri];
|
|
407
408
|
handler.changeSelection({
|
|
408
409
|
keys,
|
|
@@ -461,7 +462,7 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
|
|
|
461
462
|
const nextFilter = handler.getFilter();
|
|
462
463
|
const isInverted = handler.getWorkingSelection()?.isInverted;
|
|
463
464
|
const keys = handler.getWorkingSelection().keys;
|
|
464
|
-
const isSelectionInvalid = (!isInverted &&
|
|
465
|
+
const isSelectionInvalid = (!isInverted && _isEmpty(keys)) || keys.length > MAX_SELECTION_SIZE;
|
|
465
466
|
const displayAsLabel = handler.getDisplayAsLabel();
|
|
466
467
|
const { attribute } = handlerState;
|
|
467
468
|
if (isPrimaryLabelUsed(nextFilter, attribute.data?.displayForms ?? [])) {
|
|
@@ -494,7 +495,7 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
|
|
|
494
495
|
}, [handler, selectionMode, onSelectionChange, onChangeInputCallback, withoutApply]);
|
|
495
496
|
// Rule is not working with debounce
|
|
496
497
|
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
497
|
-
const onSearch = useCallback(
|
|
498
|
+
const onSearch = useCallback(_debounce((search) => {
|
|
498
499
|
if (handler.getSearch() !== search) {
|
|
499
500
|
handler.setSearch(search);
|
|
500
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,6 +1,6 @@
|
|
|
1
1
|
import { type IntlShape } from "react-intl";
|
|
2
2
|
import { type IElementsQueryAttributeFilter } from "@gooddata/sdk-backend-spi";
|
|
3
|
-
import { type DashboardAttributeFilterSelectionMode, type IAttributeElement, type IAttributeFilter } from "@gooddata/sdk-model";
|
|
3
|
+
import { type DashboardAttributeFilterSelectionMode, type IAttributeElement, type IAttributeFilter, type ObjRef } from "@gooddata/sdk-model";
|
|
4
4
|
import { getElementCacheKey } from "../AttributeFilterHandler/internal/redux/common/selectors.js";
|
|
5
5
|
import { type IAttributeFilterBaseProps } from "./types.js";
|
|
6
6
|
/**
|
|
@@ -19,6 +19,21 @@ export declare function getElementTitle(element: IAttributeElement, intl: IntlSh
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare function getElementPrimaryTitle(element: IAttributeElement): string;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the raw value of a formatted element of a computed attribute when it differs from the displayed
|
|
24
|
+
* value, e.g. "2026-08-24T00:00" for a date formatted as "24.08.2026". Elements are searched by their raw
|
|
25
|
+
* value, so the tooltip of the element tells it.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Meant for elements without a number format, whose formatted values are dates; number-formatted elements
|
|
29
|
+
* are covered by their own rule, which ignores differences in separators only. Values of date attributes
|
|
30
|
+
* are not covered. Returns undefined for other attributes and for elements without a formatted value.
|
|
31
|
+
*
|
|
32
|
+
* @param element - element of the attribute
|
|
33
|
+
* @param attributeRef - ref of the attribute the element belongs to
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare function getDateFormattedElementRawTitle(element: IAttributeElement, attributeRef: ObjRef | undefined): string | undefined;
|
|
22
37
|
/**
|
|
23
38
|
* @internal
|
|
24
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,M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OG;AACH,wBAAgB,kCAAkC,CAC9C,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,IAAI,EAAE,SAAS,GAChB,MAAM,CAkBR"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
3
2
|
import { invariant } from "ts-invariant";
|
|
4
|
-
import { areObjRefsEqual, attributeElementsCount, filterAttributeElements, filterObjRef, isArbitraryAttributeFilter, isMatchAttributeFilter, isPositiveAttributeFilter, } from "@gooddata/sdk-model";
|
|
3
|
+
import { areObjRefsEqual, attributeElementsCount, filterAttributeElements, filterObjRef, isArbitraryAttributeFilter, isComputedAttributeRef, isMatchAttributeFilter, isPositiveAttributeFilter, } from "@gooddata/sdk-model";
|
|
5
4
|
import { UnexpectedSdkError } from "@gooddata/sdk-ui";
|
|
5
|
+
import { _isEmpty } from "@gooddata/util";
|
|
6
6
|
import { getElementCacheKey } from "../AttributeFilterHandler/internal/redux/common/selectors.js";
|
|
7
7
|
import { getSelectionTypeFromFilter } from "./selectionTypeUtils.js";
|
|
8
8
|
import { getOperatorFromFilter, getValuesFromFilter } from "./textFilterOperatorUtils.js";
|
|
@@ -31,6 +31,27 @@ export function getElementTitle(element, intl) {
|
|
|
31
31
|
export function getElementPrimaryTitle(element) {
|
|
32
32
|
return element.uri && element.uri !== element.title ? element.uri : "";
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the raw value of a formatted element of a computed attribute when it differs from the displayed
|
|
36
|
+
* value, e.g. "2026-08-24T00:00" for a date formatted as "24.08.2026". Elements are searched by their raw
|
|
37
|
+
* value, so the tooltip of the element tells it.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Meant for elements without a number format, whose formatted values are dates; number-formatted elements
|
|
41
|
+
* are covered by their own rule, which ignores differences in separators only. Values of date attributes
|
|
42
|
+
* are not covered. Returns undefined for other attributes and for elements without a formatted value.
|
|
43
|
+
*
|
|
44
|
+
* @param element - element of the attribute
|
|
45
|
+
* @param attributeRef - ref of the attribute the element belongs to
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export function getDateFormattedElementRawTitle(element, attributeRef) {
|
|
49
|
+
const { title, formattedTitle } = element;
|
|
50
|
+
if (!attributeRef || !isComputedAttributeRef(attributeRef)) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return title && formattedTitle && formattedTitle !== title ? title : undefined;
|
|
54
|
+
}
|
|
34
55
|
/**
|
|
35
56
|
* @internal
|
|
36
57
|
*/
|
|
@@ -51,7 +72,7 @@ export function validateAttributeFilterProps({ connectToPlaceholder, filter, onA
|
|
|
51
72
|
invariant(!(filter && connectToPlaceholder), "It's not possible to combine 'filter' property with 'connectToPlaceholder' property. Either provide a filter, or a placeholer.");
|
|
52
73
|
invariant(!(filter && !onApply), "It's not possible to use 'filter' property without 'onApply' property. Either provide 'onApply' callback or use placeholders.");
|
|
53
74
|
invariant(filter || connectToPlaceholder, "No filter or placeholer provided. Provide one of the properties: 'filter', 'connectToPlaceholder'.");
|
|
54
|
-
invariant(!(!
|
|
75
|
+
invariant(!(!_isEmpty(hiddenElements) && _isEmpty(staticElements)), "Hidden elements are not supported by the current backend implementation.");
|
|
55
76
|
if (displayAsLabel &&
|
|
56
77
|
(isArbitraryAttributeFilter(filter) || isMatchAttributeFilter(filter)) &&
|
|
57
78
|
!areObjRefsEqual(displayAsLabel, filterObjRef(filter))) {
|
|
@@ -63,7 +84,7 @@ export function validateAttributeFilterProps({ connectToPlaceholder, filter, onA
|
|
|
63
84
|
*/
|
|
64
85
|
export function isValidSingleSelectionFilter(selectionMode, filter, limitingAttributeFilters, supportsSingleSelectDependentFilters) {
|
|
65
86
|
const isSingleSelect = selectionMode === "single";
|
|
66
|
-
const hasEmptyParentFilters =
|
|
87
|
+
const hasEmptyParentFilters = _isEmpty(limitingAttributeFilters);
|
|
67
88
|
const isPositiveWithMaxOneElement = isPositiveAttributeFilter(filter) && attributeElementsCount(filterAttributeElements(filter)) < 2;
|
|
68
89
|
if (isSingleSelect) {
|
|
69
90
|
if (!isPositiveWithMaxOneElement) {
|
|
@@ -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":"AAIA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EACH,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,QAAQ,EACb,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,aAAa,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7E,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKzD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,SACpB,mBAAmB,EAAE,eACd,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,wBAGjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAGnE,CAAC;AAUF,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,WAAW,GAAG,SAAS,CAG5E,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAGz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AAM,yBAAyB,EAAE,cAAc,CAAC,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CACD,CAAC;AAEpG;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,MAAM,GAAG,SAAS,CAG5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,oBAAoB,CAmC1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,oBAAoB,CAKhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC,EAAE,cAAc,CAAC,wBAAwB,EAAE,CACH,CAAC"}
|
|
@@ -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":"loadElementsFromBackend.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/loadElementsFromBackend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadElementsFromBackend.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/elements/loadElementsFromBackend.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EAIvB,KAAK,oBAAoB,EAG5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAKH,KAAK,MAAM,EAKd,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,KAAK,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AAG7E,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA2CtD;;GAEG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,mCAAmC,EAC5C,OAAO,EAAE,oBAAoB,GAAG,iBAAiB,GAAG;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,EAC9E,kBAAkB,EAAE,mBAAmB,EACvC,OAAO,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,oBAAoB,CAAC,CAsH/B;AAED,eAAO,MAAM,sBAAsB,YAAa,kBAAkB,YACpB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2022-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
3
2
|
import { isElementsQueryOptionsElementsByValue, isValueBasedElementsQueryOptionsElements, } from "@gooddata/sdk-backend-spi";
|
|
4
3
|
import { attributeElementsIsEmpty, newAttribute, newNegativeAttributeFilter, newPositiveAttributeFilter, } from "@gooddata/sdk-model";
|
|
5
4
|
import { DataViewFacade, convertError } from "@gooddata/sdk-ui";
|
|
5
|
+
import { _isEmpty } from "@gooddata/util";
|
|
6
6
|
import { InMemoryPaging } from "./InMemoryPaging.js";
|
|
7
7
|
async function loadElementsAsExecution(backend, workspace, displayFormRef, elements, hiddenElementsInfo) {
|
|
8
8
|
const elementValues = elements.values;
|
|
@@ -40,9 +40,9 @@ async function loadElementsAsExecution(backend, workspace, displayFormRef, eleme
|
|
|
40
40
|
export async function loadElementsFromBackend(context, options, hiddenElementsInfo, cacheId) {
|
|
41
41
|
const { backend, workspace } = context;
|
|
42
42
|
const { displayFormRef, elements, limit, limitingAttributeFilters, limitingDateFilters, limitingMeasures, limitingValidationItems, offset, search, order, includeTotalCountWithoutFilters, excludePrimaryLabel = true, filterByPrimaryLabel, signal, } = options;
|
|
43
|
-
const isInitialSelectionRequest =
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
const isInitialSelectionRequest = _isEmpty(limitingAttributeFilters) &&
|
|
44
|
+
_isEmpty(limitingDateFilters) &&
|
|
45
|
+
_isEmpty(limitingMeasures) &&
|
|
46
46
|
!search &&
|
|
47
47
|
!excludePrimaryLabel &&
|
|
48
48
|
!order &&
|
|
@@ -85,7 +85,7 @@ export async function loadElementsFromBackend(context, options, hiddenElementsIn
|
|
|
85
85
|
if (includeTotalCountWithoutFilters) {
|
|
86
86
|
loaderOptions.includeTotalCountWithoutFilters = includeTotalCountWithoutFilters;
|
|
87
87
|
}
|
|
88
|
-
if (!
|
|
88
|
+
if (!_isEmpty(loaderOptions)) {
|
|
89
89
|
loader = loader.withOptions(loaderOptions);
|
|
90
90
|
}
|
|
91
91
|
if (limitingDateFilters?.length) {
|
|
@@ -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,CA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