@gooddata/sdk-ui-filters 11.68.0-alpha.2 → 11.68.0-alpha.4
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/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelect.js +6 -3
- 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 +12 -11
- 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/loadElementsFromBackend.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/loadElementsFromBackend.js +5 -5
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.js +3 -2
- 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/interfaces/index.d.ts.map +1 -1
- package/esm/DateFilter/interfaces/index.js +3 -3
- 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 +12 -12
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":"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":"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;AAI7E,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAYlF,OAAO,EAEH,KAAK,wBAAwB,EAEhC,MAAM,YAAY,CAAC;AAw7BpB;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC3C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wBAAwB,CAAC,EAAE,6BAA6B,EAAE,GAAG,IAAI,CAAC;IAClE,mBAAmB,CAAC,EAAE,CAAC,mBAAmB,GAAG,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC;IAC3E,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAChG,cAAc,CAAC,EAAE,MAAM,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 { debounce, difference, differenceBy
|
|
4
|
+
import { debounce, 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
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 ?? [])) {
|
|
@@ -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,MAAM,EASd,MAAM,qBAAqB,CAAC;AAI7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,8DAA8D,CAAC;AAKlG,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ChB,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":"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":"loadNextElementsPageSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadNextElementsPageSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageSelectors.ts"],"names":[],"mappings":"AAQA,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,7 +3,8 @@
|
|
|
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 {
|
|
6
|
+
import { omit } from "lodash-es";
|
|
7
|
+
import { _isEqual } from "@gooddata/util";
|
|
7
8
|
import { selectState } from "../common/selectors.js";
|
|
8
9
|
import { selectElementsTotalCountWithCurrentSettings, selectLastLoadedElementsOptions, selectLoadElementsOptions, } from "../elements/elementsSelectors.js";
|
|
9
10
|
/**
|
|
@@ -34,7 +35,7 @@ export const selectHasNextPage = createSelector(selectLastLoadedElementsOptions,
|
|
|
34
35
|
* @internal
|
|
35
36
|
*/
|
|
36
37
|
export const selectIsLoadElementsOptionsChanged = createSelector(selectLoadElementsOptions, selectLastLoadedElementsOptions, (loadOptions, lastLoadedOptions) => {
|
|
37
|
-
return !
|
|
38
|
+
return !_isEqual(
|
|
38
39
|
// omit offset as it changes for each page
|
|
39
40
|
// omit options which can not be set externally by user and thus are not stored in state
|
|
40
41
|
omit(loadOptions, "offset", "excludePrimaryLabel", "filterByPrimaryLabel"), omit(lastLoadedOptions, "offset", "excludePrimaryLabel", "filterByPrimaryLabel"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectionSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/selection/selectionSelectors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"selectionSelectors.d.ts","sourceRoot":"","sources":["../../../../../src/AttributeFilterHandler/internal/redux/selection/selectionSelectors.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,mCAAmC,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAGxE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,cAAc,CAAC,OAAO,CAGpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAGlF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAG1E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAAC,OAAO,CAGtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAAC,mBAAmB,EAAE,CAGpF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gCAAgC,EAAE,cAAc,CAAC,mCAAmC,CAU5F,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,kCAAkC,EAAE,cAAc,CAAC,mCAAmC,CAU9F,CAAC;AAEN;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,OAAO,CAQnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAAc,CAAC,OAAO,CAGjE,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// we need direct import from esm module otherwise import ar not node compatible
|
|
5
5
|
// https://github.com/reduxjs/redux-toolkit/issues/1960
|
|
6
6
|
import { createSelector } from "@reduxjs/toolkit";
|
|
7
|
-
import {
|
|
7
|
+
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
8
8
|
import { selectState } from "../common/selectors.js";
|
|
9
9
|
/**
|
|
10
10
|
* @internal
|
|
@@ -50,8 +50,8 @@ export const selectInvertableCommittedSelection = createSelector(selectCommitted
|
|
|
50
50
|
* @internal
|
|
51
51
|
*/
|
|
52
52
|
export const selectIsWorkingSelectionChanged = createSelector(selectIsWorkingSelectionInverted, selectWorkingSelection, selectIsCommittedSelectionInverted, selectCommittedSelection, (isWorkingSelectionInverted, workingSelection, isCommitedSelectionInverted, commitedSelection) => isWorkingSelectionInverted !== isCommitedSelectionInverted ||
|
|
53
|
-
!
|
|
53
|
+
!_isEqual([...commitedSelection].sort(), [...workingSelection].sort()));
|
|
54
54
|
/**
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
|
-
export const selectIsWorkingSelectionEmpty = createSelector(selectWorkingSelection,
|
|
57
|
+
export const selectIsWorkingSelectionEmpty = createSelector(selectWorkingSelection, _isEmpty);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/AttributeFilterHandler/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/AttributeFilterHandler/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAQ/E;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,wBAAwB,EAAE,6BAA6B,EAAE,WASxG"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// (C) 2022-
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
1
|
+
// (C) 2022-2026 GoodData Corporation
|
|
3
2
|
import { attributeElementsIsEmpty, filterAttributeElements, isNegativeAttributeFilter, } from "@gooddata/sdk-model";
|
|
3
|
+
import { _isEmpty } from "@gooddata/util";
|
|
4
4
|
/**
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
7
|
export function isLimitingAttributeFiltersEmpty(limitingAttributeFilters) {
|
|
8
|
-
return (
|
|
8
|
+
return (_isEmpty(limitingAttributeFilters) ||
|
|
9
9
|
limitingAttributeFilters.every((limitingAttributeFilter) => isNegativeAttributeFilter(limitingAttributeFilter.attributeFilter)
|
|
10
10
|
? attributeElementsIsEmpty(filterAttributeElements(limitingAttributeFilter.attributeFilter))
|
|
11
11
|
: false));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilter.d.ts","sourceRoot":"","sources":["../../src/DateFilter/DateFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAMjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilter.d.ts","sourceRoot":"","sources":["../../src/DateFilter/DateFilter.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EAMjB,MAAM,OAAO,CAAC;AAEf,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EA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AC,gBAAgB,CAiQ5D,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { memo, useCallback, useEffect, useRef, useState, } from "react";
|
|
4
|
-
import { isEmpty, isEqual } from "lodash-es";
|
|
5
4
|
import { isAbsoluteDateFilterForm, isAllTimeDateFilterOption, isEmptyValuesDateFilterOption, } from "@gooddata/sdk-model";
|
|
5
|
+
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
6
6
|
import { DEFAULT_DATE_FORMAT } from "./constants/Platform.js";
|
|
7
7
|
import { DateFilterCore } from "./DateFilterCore.js";
|
|
8
8
|
import { isUiRelativeDateFilterForm, } from "./interfaces/index.js";
|
|
@@ -53,11 +53,11 @@ function getDerivedStateFromProps(nextProps, prevState) {
|
|
|
53
53
|
if (nextProps.withoutApply &&
|
|
54
54
|
nextProps.workingSelectedFilterOption &&
|
|
55
55
|
nextProps.excludeCurrentPeriod !== undefined &&
|
|
56
|
-
(!
|
|
56
|
+
(!_isEqual(nextProps.workingSelectedFilterOption, prevState.initWorkingSelectedFilterOption) ||
|
|
57
57
|
nextProps.workingExcludeCurrentPeriod !== prevState.initWorkingExcludeCurrentPeriod)) {
|
|
58
58
|
return getStateFromWorkingProps(nextProps);
|
|
59
59
|
}
|
|
60
|
-
if (!
|
|
60
|
+
if (!_isEqual(nextProps.selectedFilterOption, prevState.initSelectedFilterOption) ||
|
|
61
61
|
nextProps.excludeCurrentPeriod !== prevState.initExcludeCurrentPeriod) {
|
|
62
62
|
return getStateFromProps(nextProps);
|
|
63
63
|
}
|
|
@@ -82,7 +82,7 @@ function checkInitialFilterOption(filterOption) {
|
|
|
82
82
|
function isSameOptionExceptEmptyValueHandling(a, b) {
|
|
83
83
|
const { emptyValueHandling: _aEmptyValueHandling, ...aWithoutEmptyValueHandling } = a;
|
|
84
84
|
const { emptyValueHandling: _bEmptyValueHandling, ...bWithoutEmptyValueHandling } = b;
|
|
85
|
-
return
|
|
85
|
+
return _isEqual(aWithoutEmptyValueHandling, bWithoutEmptyValueHandling);
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* {@link https://www.gooddata.com/docs/gooddata-ui/latest/references/filters/date_filter | DateFilter} is a component for configuring a date filter value.
|
|
@@ -118,7 +118,7 @@ export const DateFilter = memo(function DateFilter(props) {
|
|
|
118
118
|
// The `isEqual` guard makes the extra render pass a no-op once the state is in sync.
|
|
119
119
|
let state = storedState;
|
|
120
120
|
const derivedState = getDerivedStateFromProps(props, storedState);
|
|
121
|
-
if (derivedState !== null && !
|
|
121
|
+
if (derivedState !== null && !_isEqual(derivedState, storedState)) {
|
|
122
122
|
setState(() => derivedState);
|
|
123
123
|
state = derivedState;
|
|
124
124
|
}
|
|
@@ -177,7 +177,7 @@ export const DateFilter = memo(function DateFilter(props) {
|
|
|
177
177
|
};
|
|
178
178
|
const fireOnSelect = (selectedFilterOption, excludeCurrentPeriod) => {
|
|
179
179
|
const normalizedSelectedFilterOption = normalizeEmptyValueHandling(normalizeSelectedFilterOption(selectedFilterOption));
|
|
180
|
-
if (
|
|
180
|
+
if (_isEmpty(validateFilterOption(normalizedSelectedFilterOption))) {
|
|
181
181
|
onSelect?.(normalizedSelectedFilterOption, excludeCurrentPeriod);
|
|
182
182
|
}
|
|
183
183
|
};
|
|
@@ -202,7 +202,7 @@ export const DateFilter = memo(function DateFilter(props) {
|
|
|
202
202
|
setState(() => getStateFromProps(props));
|
|
203
203
|
pendingSelectRef.current = {};
|
|
204
204
|
}
|
|
205
|
-
else if (withoutApply && !
|
|
205
|
+
else if (withoutApply && !_isEmpty(validateFilterOption(stateRef.current.selectedFilterOption))) {
|
|
206
206
|
setState(() => getStateFromWorkingProps(props));
|
|
207
207
|
}
|
|
208
208
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterBody.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,SAAS,EAMjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilterBody.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterBody.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGH,KAAK,YAAY,EACjB,KAAK,SAAS,EAMjB,MAAM,OAAO,CAAC;AAKf,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAGjC,MAAM,wBAAwB,CAAC;AA4BhC,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,wBAAwB,CAAC;IACxC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,4BAA4B,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEjE,oBAAoB,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6BAA6B,EAAE,OAAO,CAAC;IACvC,4BAA4B,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5D,6BAA6B,EAAE,OAAO,CAAC;IACvC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAE3C,sCAAsC,EAAE,OAAO,CAAC;IAEhD,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAEhD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B,MAAM,CAAC,EAAE,yBAAyB,CAAC;IACnC,gBAAgB,EAAE,YAAY,CAAC;IAE/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oBAAoB,EAAE,MAAM,IAAI,CAAC;IAEjC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;OAIG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,cAAc,iHA2czB,CAAC"}
|
|
@@ -2,10 +2,10 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { forwardRef, useEffect, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { isEmpty } from "lodash-es";
|
|
6
5
|
import { useIntl } from "react-intl";
|
|
7
6
|
import { isAbsoluteDateFilterForm, isAllTimeDateFilterOption, isEmptyValuesDateFilterOption, isRelativeDateFilterForm, } from "@gooddata/sdk-model";
|
|
8
7
|
import { isEscapeKey, useIdPrefixed } from "@gooddata/sdk-ui-kit";
|
|
8
|
+
import { _isEmpty } from "@gooddata/util";
|
|
9
9
|
import { isEditableElement } from "../../shared/utils/domUtilities.js";
|
|
10
10
|
import { CheckboxSection } from "../CheckboxSection/CheckboxSection.js";
|
|
11
11
|
import { getDateFilterOptionGranularity } from "../utils/OptionUtils.js";
|
|
@@ -231,7 +231,7 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
231
231
|
: undefined }), _jsxs("div", { role: "group", className: cx("gd-extended-date-filter-actions"), children: [_jsx("div", { className: "gd-extended-date-filter-actions-left-content", children: isConfigurationEnabled ? (_jsx(DateFilterConfigurationButton, { onConfiguration: onConfigurationClick })) : null }), _jsxs("div", { className: "gd-extended-date-filter-actions-buttons", children: [_jsx(DateFilterBodyButton, { messageId: withoutApply ? "close" : "cancel", className: cx("gd-button-secondary", isMobile ? "gd-button-medium" : "gd-button-small", withoutApply ? "s-date-filter-close" : "s-date-filter-cancel"), onClick: () => {
|
|
232
232
|
onCancelClick();
|
|
233
233
|
closeDropdown();
|
|
234
|
-
} }), !withoutApply && (_jsx(DateFilterBodyButton, { messageId: "apply", className: cx("gd-button-action", isMobile ? "gd-button-medium" : "gd-button-small", "s-date-filter-apply"), disabled: !
|
|
234
|
+
} }), !withoutApply && (_jsx(DateFilterBodyButton, { messageId: "apply", className: cx("gd-button-action", isMobile ? "gd-button-medium" : "gd-button-small", "s-date-filter-apply"), disabled: !_isEmpty(errors) || !isPeriodRangeValid, onClick: () => {
|
|
235
235
|
onApplyClick();
|
|
236
236
|
closeDropdown();
|
|
237
237
|
}, describedByFromValidation: true }))] })] })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterFormContent.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterFormContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilterFormContent.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterFormContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAI/C,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAGjC,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAA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ef } from "react";
|
|
4
|
-
import { isEmpty } from "lodash-es";
|
|
5
4
|
import { useIntl } from "react-intl";
|
|
6
5
|
import { isAbsoluteDateFilterForm, isAllTimeDateFilterOption, isEmptyValuesDateFilterOption, isRelativeDateFilterForm, } from "@gooddata/sdk-model";
|
|
7
6
|
import { useId } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { _isEmpty } from "@gooddata/util";
|
|
8
8
|
import { AbsoluteDateFilterForm } from "../AbsoluteDateFilterForm/AbsoluteDateFilterForm.js";
|
|
9
9
|
import { createGranularityTabsKeyboardHandler, submitRelativeDateFilterForm, } from "../accessibility/keyboardNavigation.js";
|
|
10
10
|
import { DateFilterFormWrapper } from "../DateFilterFormWrapper/DateFilterFormWrapper.js";
|
|
@@ -51,7 +51,7 @@ export function DateFilterFormContent({ filterOptions, selectedFilterOption, onS
|
|
|
51
51
|
});
|
|
52
52
|
} })) : null] }) }) })) : null, showRelativeForm ? (_jsx(DateFilterFormNavigationWrapper, { title: filterOptions.relativeForm?.name
|
|
53
53
|
? filterOptions.relativeForm.name
|
|
54
|
-
: intl.formatMessage({ id: "filters.floatingRange" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsx("div", { onKeyDown: handleRelativeDateFilterKeydown, children: _jsxs(DateFilterFormWrapper, { isMobile: isMobile, children: [_jsx(RelativeDateFilterForm, { onSelectedFilterOptionChange: onSelectedFilterOptionChange, selectedFilterOption: relativeSelectedFilterOption, availableGranularities: availableGranularities, isMobile: isMobile, ref: tabGranularityRef, relativeDateFilterId: relativeDateFilterId, onKeyDown: (event) => submitRelativeDateFilterForm(event,
|
|
54
|
+
: intl.formatMessage({ id: "filters.floatingRange" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsx("div", { onKeyDown: handleRelativeDateFilterKeydown, children: _jsxs(DateFilterFormWrapper, { isMobile: isMobile, children: [_jsx(RelativeDateFilterForm, { onSelectedFilterOptionChange: onSelectedFilterOptionChange, selectedFilterOption: relativeSelectedFilterOption, availableGranularities: availableGranularities, isMobile: isMobile, ref: tabGranularityRef, relativeDateFilterId: relativeDateFilterId, onKeyDown: (event) => submitRelativeDateFilterForm(event, _isEmpty(errors), withoutApply ?? false, submitForm) }), shouldRenderEmptyValuesHandling ? (_jsx(EmptyValuesHandlingToggle, { mode: "include", className: "gd-date-filter-empty-values-handling-toggle", checked: emptyValueHandlingToggleChecked, onChange: (checked) => {
|
|
55
55
|
const emptyValueHandling = checked ? "include" : undefined;
|
|
56
56
|
onSelectedFilterOptionChange({
|
|
57
57
|
...relativeSelectedFilterOption,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterCore.d.ts","sourceRoot":"","sources":["../../src/DateFilter/DateFilterCore.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,SAAS,EAKjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilterCore.d.ts","sourceRoot":"","sources":["../../src/DateFilter/DateFilterCore.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,SAAS,EAKjB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAOxG,OAAO,EAAY,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI1E,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAe7E,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAErF,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EACjC,MAAM,uBAAuB,CAAC;AAK/B,MAAM,WAAW,oBAAoB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E,mBAAmB,CAAC;IAE1C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;OAIG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,gBAAgB,eAAgB,MAAM,KAAG,MAYrD,CAAC;AAqCF,wBAAgB,cAAc,CAAC,EAC3B,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,MAAM,EACN,aAAa,EACb,6BAA6B,EAC7B,gCAAgC,EAChC,SAAS,EACT,UAAU,EACV,4BAA4B,EAC5B,YAAY,EACZ,aAAa,EACb,yBAAyB,EACzB,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,GAAG,iBAAiB,EACvB,EAAE,oBAAoB,2CAkLtB"}
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import { format } from "date-fns";
|
|
5
|
-
import { isEmpty } from "lodash-es";
|
|
6
5
|
import { MediaQuery } from "react-responsive";
|
|
7
6
|
import { IntlWrapper, ValidationContextStore, createInvalidNode, useValidationContextValue, } from "@gooddata/sdk-ui";
|
|
8
7
|
import { Dropdown } from "@gooddata/sdk-ui-kit";
|
|
8
|
+
import { _isEmpty } from "@gooddata/util";
|
|
9
9
|
import { MediaQueries } from "../constants/MediaQueries.js";
|
|
10
10
|
import { DATE_FILTER_ACTIVE_CALENDAR_TAB_ID, DATE_FILTER_CUSTOM_RELATIVE_ID, DATE_FILTER_CUSTOM_STATIC_ID, DATE_FILTER_SELECTED_LIST_ITEM_ID, } from "./accessibility/elementId.js";
|
|
11
11
|
import { createDateFilterKeyboardHandler } from "./accessibility/keyboardNavigation.js";
|
|
@@ -74,8 +74,8 @@ export function DateFilterCore({ originalSelectedFilterOption, originalExcludeCu
|
|
|
74
74
|
closeConfiguration();
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
const lastValidSelectedFilterOption = useLastValidValue(selectedFilterOption,
|
|
78
|
-
const lastValidExcludeCurrentPeriod = useLastValidValue(excludeCurrentPeriod,
|
|
77
|
+
const lastValidSelectedFilterOption = useLastValidValue(selectedFilterOption, _isEmpty(dropdownBodyProps.errors));
|
|
78
|
+
const lastValidExcludeCurrentPeriod = useLastValidValue(excludeCurrentPeriod, _isEmpty(dropdownBodyProps.errors));
|
|
79
79
|
const handleKeyDown = useCallback((event, closeDropdown = () => { }) => {
|
|
80
80
|
const keyboardHandler = createDateFilterKeyboardHandler({
|
|
81
81
|
dateFilterContainerRef,
|
|
@@ -2,9 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { forwardRef, useCallback, useEffect, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { isEmpty } from "lodash-es";
|
|
6
5
|
import { ValidationContextStore, createInvalidDatapoint, createInvalidNode, useValidationContextValue, } from "@gooddata/sdk-ui";
|
|
7
6
|
import { isArrowKey, isEnterKey, useId } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { _isEmpty } from "@gooddata/util";
|
|
8
8
|
import { convertPlatformDateStringToDate } from "../utils/DateConversions.js";
|
|
9
9
|
import { DateRangePickerInputFieldBody } from "./DateRangePickerInputFieldBody.js";
|
|
10
10
|
import { InputErrorMessage } from "./InputErrorMessage.js";
|
|
@@ -55,7 +55,7 @@ const useDateInput = ({ value, dateFormat, onChange, onKeyDown, isDateOrderError
|
|
|
55
55
|
}
|
|
56
56
|
}, [dateFormat, isValid, setError, onChange]);
|
|
57
57
|
const onSubmitValue = useCallback((shouldSubmitForm) => {
|
|
58
|
-
if (
|
|
58
|
+
if (_isEmpty(inputValue)) {
|
|
59
59
|
setError("empty");
|
|
60
60
|
onChange(undefined, shouldSubmitForm);
|
|
61
61
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/interfaces/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,sCAAsC,EAC3C,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,EAK3C,MAAM,qBAAqB,CAAC;AAG7B;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACtE;;OAEG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,EAAE,CAAC,EAAE,UAAU,CAAC;IAChB;;OAEG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC;CACpC;AAED;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAAS,OAAO,KAAG,GAAG,IAAI,yBAEhE,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;IACtG;;OAEG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IACpC;;OAEG;IACH,IAAI,CAAC,EAAE,mCAAmC,CAAC;IAC3C;;OAEG;IACH,EAAE,CAAC,EAAE,mCAAmC,CAAC;I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AAqC;IAClD,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC;;OAEG;IACH,YAAY,CAAC,EAAE,qCAAqC,CAAC;IACrD;;OAEG;IACH,YAAY,CAAC,EAAE,6BAA6B,CAAC;CAChD"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
3
2
|
import { isAbsoluteDateFilterForm, isAbsoluteDateFilterPreset, isRelativeDateFilterForm, isRelativeDateFilterPreset, } from "@gooddata/sdk-model";
|
|
3
|
+
import { _isEmpty } from "@gooddata/util";
|
|
4
4
|
/**
|
|
5
5
|
* Type-guard testing whether the provided object is an instance of {@link IUiRelativeDateFilterForm}.
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export const isUiRelativeDateFilterForm = (obj) => {
|
|
9
|
-
return !
|
|
9
|
+
return !_isEmpty(obj) && obj.type === "relativeForm";
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
12
|
* Type-guard testing whether the provided object is an instance of {@link AbsoluteDateFilterOption}.
|
|
@@ -22,4 +22,4 @@ export const isRelativeDateFilterOption = (obj) => isRelativeDateFilterForm(obj)
|
|
|
22
22
|
* Type-guard testing whether the provided object is an instance of {@link RelativeDateFilterOption} with boundedFilter.
|
|
23
23
|
* @public
|
|
24
24
|
*/
|
|
25
|
-
export const isRelativeDateFilterWithBoundOption = (obj) => isRelativeDateFilterOption(obj) && !
|
|
25
|
+
export const isRelativeDateFilterWithBoundOption = (obj) => isRelativeDateFilterOption(obj) && !_isEmpty(obj.boundedFilter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionUtils.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/OptionUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OptionUtils.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/utils/OptionUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,qBAAqB,EAM7B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACH,KAAK,gBAAgB,EAErB,KAAK,wBAAwB,EAEhC,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,8BAA8B,CAC1C,gBAAgB,EAAE,gBAAgB,GACnC,qBAAqB,GAAG,SAAS,CASnC;AA+BD,wBAAgB,oCAAoC,CAAC,EACjD,YAAY,EACZ,cAAc,EACd,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,GACjB,EAAE,wBAAwB,GAAG,wBAAwB,CASrD;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC1C,iBAAiB,EAAE,wBAAwB,GAC5C,wBAAwB,CAsB1B;AA+BD;;;GAGG;AACH,wBAAgB,uBAAuB,CACnC,iBAAiB,EAAE,wBAAwB,GAC5C,wBAAwB,CAW1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// (C) 2019-2026 GoodData Corporation
|
|
2
|
-
import { isEmpty } from "lodash-es";
|
|
3
2
|
import { isAbsoluteDateFilterForm, isRelativeDateFilterPreset, } from "@gooddata/sdk-model";
|
|
3
|
+
import { _isEmpty } from "@gooddata/util";
|
|
4
4
|
import { isUiRelativeDateFilterForm, } from "../interfaces/index.js";
|
|
5
5
|
export function getDateFilterOptionGranularity(dateFilterOption) {
|
|
6
6
|
if (isUiRelativeDateFilterForm(dateFilterOption) ||
|
|
@@ -31,9 +31,9 @@ export function removeEmptyKeysFromDateFilterOptions({ absoluteForm, absolutePre
|
|
|
31
31
|
...(allTime && { allTime }),
|
|
32
32
|
...(emptyValues && { emptyValues }),
|
|
33
33
|
...(absoluteForm && { absoluteForm }),
|
|
34
|
-
...(!
|
|
34
|
+
...(!_isEmpty(absolutePreset) && { absolutePreset }),
|
|
35
35
|
...(relativeForm && { relativeForm }),
|
|
36
|
-
...(!
|
|
36
|
+
...(!_isEmpty(relativePreset) && { relativePreset }),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterGroup.d.ts","sourceRoot":"","sources":["../../src/FilterGroup/FilterGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAQjB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterGroup.d.ts","sourceRoot":"","sources":["../../src/FilterGroup/FilterGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,YAAY,EACjB,KAAK,SAAS,EAQjB,MAAM,OAAO,CAAC;AAMf,OAAO,EAOH,KAAK,4BAA4B,EAKpC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAiBnF,OAAO,EACH,KAAK,wBAAwB,EAEhC,MAAM,6CAA6C,CAAC;AAOrD;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,mBAAmB,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,MAAM,CAAC;IAC3C,cAAc,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;IACvC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;IAC7C,iBAAiB,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC;IAClF;;OAEG;IACH,YAAY,EAAE,CACV,MAAM,EAAE,CAAC,EACT,wBAAwB,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,EAC/D,2BAA2B,CAAC,EAAE,aAAa,CAAC,wBAAwB,CAAC,KACpE,YAAY,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,iCAAiC,CAAC,CAAC,IAAI,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC;AA6B9G;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAwZzD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CAQ/D"}
|
|
@@ -2,9 +2,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { isEqual } from "lodash-es";
|
|
6
5
|
import { useIntl } from "react-intl";
|
|
7
6
|
import { Dropdown, DropdownList, FilterGroupItem, UiIcon, isArrowKey, isSpaceKey, useMediaQuery, } from "@gooddata/sdk-ui-kit";
|
|
7
|
+
import { _isEqual } from "@gooddata/util";
|
|
8
8
|
import { AttributeFilterButton } from "../AttributeFilter/AttributeFilterButton.js";
|
|
9
9
|
import { AttributeFilterDropdownButton, } from "../AttributeFilter/Components/DropdownButton/AttributeFilterDropdownButton.js";
|
|
10
10
|
import { AttributeFilterElementsSearchBar } from "../AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSearchBar.js";
|
|
@@ -234,7 +234,7 @@ export function useDeepEqualRefStablizer(unstableState) {
|
|
|
234
234
|
const stableRef = useRef(unstableState);
|
|
235
235
|
// Compare and update the ref synchronously to keep the reference stable
|
|
236
236
|
const prevState = stableRef.current;
|
|
237
|
-
if (!
|
|
237
|
+
if (!_isEqual(prevState, unstableState)) {
|
|
238
238
|
stableRef.current = unstableState;
|
|
239
239
|
}
|
|
240
240
|
return stableRef.current;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../src/MeasureValueFilter/typings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../src/MeasureValueFilter/typings.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EACH,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,MAAM,EACX,KAAK,aAAa,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,KAAK,sCAAsC,EAAE,MAAM,+BAA+B,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC;IAC1B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,EAAE,sBAAsB,CAAC;IAC7B;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE;QACN;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QACnB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC;CACL;AAED;;;GAGG;AAC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,OAAO,CAAC;IACrB;;;;;;;;;OASG;IACH,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;IACtE;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wCAAwC;IACrD;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,aAAa,CAAC,sCAAsC,CAAC,CAAC;CACnF;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,eAAe,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe,CAErE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// (C) 2020-2026 GoodData Corporation
|
|
2
|
-
import {
|
|
2
|
+
import { _isEmpty } from "@gooddata/util";
|
|
3
3
|
/**
|
|
4
4
|
* @alpha
|
|
5
5
|
*/
|
|
6
6
|
export function isWarningMessage(obj) {
|
|
7
|
-
return !
|
|
7
|
+
return !_isEmpty(obj) && !!obj.severity;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RankingFilterDropdownBody.d.ts","sourceRoot":"","sources":["../../src/RankingFilter/RankingFilterDropdownBody.tsx"],"names":[],"mappings":"AAQA,OAAO,EACH,KAAK,cAAc,EACnB,KAAK,aAAa,EAGrB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"RankingFilterDropdownBody.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ACd,MAAM,EACN,OAAO,EACP,QAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,oBAA4B,EAC5B,wBAAgC,EAChC,yBAAyB,EACzB,0BAAkC,EAClC,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,GACxB,EAAE,wCAAwC,2CAqQ1C"}
|
|
@@ -2,10 +2,11 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2020-2026 GoodData Corporation
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import {
|
|
5
|
+
import { xorWith } from "lodash-es";
|
|
6
6
|
import { FormattedMessage, useIntl } from "react-intl";
|
|
7
7
|
import { areObjRefsEqual, newRankingFilter, } from "@gooddata/sdk-model";
|
|
8
8
|
import { Bubble, BubbleHoverTrigger, Button } from "@gooddata/sdk-ui-kit";
|
|
9
|
+
import { _isEmpty, _isEqual } from "@gooddata/util";
|
|
9
10
|
import { areDimensionalitySetsEqual, isEmptyDimensionalityInvalid, } from "../MeasureValueFilter/useDimensionalityEditor.js";
|
|
10
11
|
import { AttributeDropdown } from "./AttributeDropdown/AttributeDropdown.js";
|
|
11
12
|
import { MeasureDropdown } from "./MeasureDropdown/MeasureDropdown.js";
|
|
@@ -18,8 +19,8 @@ const isApplyButtonDisabled = (filter, filterState, enableRankingWithMvf, applyO
|
|
|
18
19
|
const rankingFilterState = filterState.rankingFilter;
|
|
19
20
|
const operatorNotChanged = rankingFilter.operator === rankingFilterState.operator;
|
|
20
21
|
const valueNotChanged = rankingFilter.value === rankingFilterState.value;
|
|
21
|
-
const attributesNotChanged =
|
|
22
|
-
const measureNotChanged =
|
|
22
|
+
const attributesNotChanged = _isEmpty(xorWith(rankingFilter.attributes, rankingFilterState.attributes, _isEqual));
|
|
23
|
+
const measureNotChanged = _isEqual(rankingFilter.measure, rankingFilterState.measure);
|
|
23
24
|
// When flag is enabled, also check if applyOnResult changed
|
|
24
25
|
const applyOnResultNotChanged = !enableRankingWithMvf || (rankingFilter.applyOnResult ?? true) === applyOnResult;
|
|
25
26
|
// When flag is enabled, also check if strictLimitOfRows changed. A missing flag means "with ties"
|
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.4",
|
|
4
4
|
"description": "GoodData.UI SDK - Filter Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"ts-invariant": "0.10.3",
|
|
48
48
|
"tslib": "2.8.1",
|
|
49
49
|
"uuid": "11.1.1",
|
|
50
|
-
"@gooddata/sdk-backend-spi": "11.68.0-alpha.
|
|
51
|
-
"@gooddata/sdk-model": "11.68.0-alpha.
|
|
52
|
-
"@gooddata/
|
|
53
|
-
"@gooddata/sdk-ui": "11.68.0-alpha.
|
|
54
|
-
"@gooddata/
|
|
50
|
+
"@gooddata/sdk-backend-spi": "11.68.0-alpha.4",
|
|
51
|
+
"@gooddata/sdk-model": "11.68.0-alpha.4",
|
|
52
|
+
"@gooddata/sdk-ui": "11.68.0-alpha.4",
|
|
53
|
+
"@gooddata/sdk-ui-kit": "11.68.0-alpha.4",
|
|
54
|
+
"@gooddata/util": "11.68.0-alpha.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@microsoft/api-documenter": "7.30.20",
|
|
@@ -89,12 +89,12 @@
|
|
|
89
89
|
"stylelint": "16.26.1",
|
|
90
90
|
"typescript": "7.0.2",
|
|
91
91
|
"vitest": "5.0.4",
|
|
92
|
-
"@gooddata/eslint-config": "11.68.0-alpha.
|
|
93
|
-
"@gooddata/oxlint-config": "11.68.0-alpha.
|
|
94
|
-
"@gooddata/reference-workspace": "11.68.0-alpha.
|
|
95
|
-
"@gooddata/sdk-
|
|
96
|
-
"@gooddata/sdk-
|
|
97
|
-
"@gooddata/stylelint-config": "11.68.0-alpha.
|
|
92
|
+
"@gooddata/eslint-config": "11.68.0-alpha.4",
|
|
93
|
+
"@gooddata/oxlint-config": "11.68.0-alpha.4",
|
|
94
|
+
"@gooddata/reference-workspace": "11.68.0-alpha.4",
|
|
95
|
+
"@gooddata/sdk-backend-mockingbird": "11.68.0-alpha.4",
|
|
96
|
+
"@gooddata/sdk-ui-theme-provider": "11.68.0-alpha.4",
|
|
97
|
+
"@gooddata/stylelint-config": "11.68.0-alpha.4"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"react": "^18.0.0 || ^19.0.0",
|