@gooddata/sdk-ui-filters 10.23.0-alpha.8 → 10.23.0

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.
Files changed (42) hide show
  1. package/esm/AttributeFilter/AttributeFilterProviders.d.ts.map +1 -1
  2. package/esm/AttributeFilter/AttributeFilterProviders.js +2 -2
  3. package/esm/AttributeFilter/AttributeFilterProviders.js.map +1 -1
  4. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.d.ts.map +1 -1
  5. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.js +15 -6
  6. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.js.map +1 -1
  7. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.d.ts +6 -0
  8. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.d.ts.map +1 -1
  9. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.js +5 -4
  10. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.js.map +1 -1
  11. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.d.ts.map +1 -1
  12. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.js +3 -2
  13. package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.js.map +1 -1
  14. package/esm/AttributeFilter/Context/AttributeFilterContext.d.ts +1 -1
  15. package/esm/AttributeFilter/Context/AttributeFilterContext.d.ts.map +1 -1
  16. package/esm/AttributeFilter/Context/AttributeFilterContext.js +4 -2
  17. package/esm/AttributeFilter/Context/AttributeFilterContext.js.map +1 -1
  18. package/esm/AttributeFilter/hooks/types.d.ts +6 -1
  19. package/esm/AttributeFilter/hooks/types.d.ts.map +1 -1
  20. package/esm/AttributeFilter/hooks/types.js +1 -1
  21. package/esm/AttributeFilter/hooks/useAttributeFilterController.d.ts.map +1 -1
  22. package/esm/AttributeFilter/hooks/useAttributeFilterController.js +101 -30
  23. package/esm/AttributeFilter/hooks/useAttributeFilterController.js.map +1 -1
  24. package/esm/AttributeFilter/hooks/useAttributeFilterControllerData.d.ts.map +1 -1
  25. package/esm/AttributeFilter/hooks/useAttributeFilterControllerData.js +3 -2
  26. package/esm/AttributeFilter/hooks/useAttributeFilterControllerData.js.map +1 -1
  27. package/esm/AttributeFilter/types.d.ts +18 -1
  28. package/esm/AttributeFilter/types.d.ts.map +1 -1
  29. package/esm/DateFilter/DateFilter.d.ts +25 -0
  30. package/esm/DateFilter/DateFilter.d.ts.map +1 -1
  31. package/esm/DateFilter/DateFilter.js +30 -4
  32. package/esm/DateFilter/DateFilter.js.map +1 -1
  33. package/esm/DateFilter/DateFilterBody/DateFilterBody.d.ts +1 -0
  34. package/esm/DateFilter/DateFilterBody/DateFilterBody.d.ts.map +1 -1
  35. package/esm/DateFilter/DateFilterBody/DateFilterBody.js +5 -5
  36. package/esm/DateFilter/DateFilterBody/DateFilterBody.js.map +1 -1
  37. package/esm/DateFilter/DateFilterCore.d.ts +1 -0
  38. package/esm/DateFilter/DateFilterCore.d.ts.map +1 -1
  39. package/esm/DateFilter/DateFilterCore.js +15 -5
  40. package/esm/DateFilter/DateFilterCore.js.map +1 -1
  41. package/esm/sdk-ui-filters.d.ts +56 -3
  42. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterProviders.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/AttributeFilterProviders.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CA8GxG,CAAC"}
1
+ {"version":3,"file":"AttributeFilterProviders.d.ts","sourceRoot":"","sources":["../../src/AttributeFilter/AttributeFilterProviders.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAGvD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAiHxG,CAAC"}
@@ -8,10 +8,10 @@ import { getAttributeFilterDefaultComponents } from "./AttributeFilterDefaultCom
8
8
  * @internal
9
9
  */
10
10
  export const AttributeFilterProviders = (props) => {
11
- const { resetOnParentFilterChange = true, children, locale, backend, workspace, title, filter, displayAsLabel, connectToPlaceholder, parentFilters, dependentDateFilters, parentFilterOverAttribute, validateElementsBy, hiddenElements, staticElements, fullscreenOnMobile = false, selectionMode = "multi", selectFirst = false, disabled, customIcon, onApply, onSelect, onError, ErrorComponent, LoadingComponent, DropdownButtonComponent, DropdownBodyComponent, DropdownActionsComponent, ElementsSearchBarComponent, ElementsSelectComponent, ElementsSelectItemComponent, ElementsSelectErrorComponent, ElementsSelectLoadingComponent, ElementsSelectActionsComponent, EmptyResultComponent, StatusBarComponent, enableDuplicatedLabelValuesInAttributeFilter = true, enableImmediateAttributeFilterDisplayAsLabelMigration = false, } = props;
11
+ 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, onApply, onSelect, onError, ErrorComponent, LoadingComponent, DropdownButtonComponent, DropdownBodyComponent, DropdownActionsComponent, ElementsSearchBarComponent, ElementsSelectComponent, ElementsSelectItemComponent, ElementsSelectErrorComponent, ElementsSelectLoadingComponent, ElementsSelectActionsComponent, EmptyResultComponent, StatusBarComponent, enableDuplicatedLabelValuesInAttributeFilter = true, enableImmediateAttributeFilterDisplayAsLabelMigration = false, } = props;
12
12
  const DefaultComponents = getAttributeFilterDefaultComponents(props);
13
13
  return (React.createElement(IntlWrapper, { locale: locale },
14
14
  React.createElement(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 },
15
- React.createElement(AttributeFilterContextProvider, { backend: backend, workspace: workspace, title: title, filter: filter, displayAsLabel: displayAsLabel, connectToPlaceholder: connectToPlaceholder, resetOnParentFilterChange: resetOnParentFilterChange, parentFilters: parentFilters, dependentDateFilters: dependentDateFilters, parentFilterOverAttribute: parentFilterOverAttribute, validateElementsBy: validateElementsBy, onApply: onApply, onSelect: onSelect, onError: onError, hiddenElements: hiddenElements, staticElements: staticElements, fullscreenOnMobile: fullscreenOnMobile, selectionMode: selectionMode, selectFirst: selectFirst, disabled: disabled, customIcon: customIcon, enableDuplicatedLabelValuesInAttributeFilter: enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration: enableImmediateAttributeFilterDisplayAsLabelMigration, withoutApply: props.withoutApply }, children))));
15
+ React.createElement(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, onSelect: onSelect, onError: onError, hiddenElements: hiddenElements, staticElements: staticElements, fullscreenOnMobile: fullscreenOnMobile, selectionMode: selectionMode, selectFirst: selectFirst, disabled: disabled, customIcon: customIcon, enableDuplicatedLabelValuesInAttributeFilter: enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration: enableImmediateAttributeFilterDisplayAsLabelMigration, withoutApply: props.withoutApply, enableDashboardFiltersApplyModes: props.enableDashboardFiltersApplyModes }, children))));
16
16
  };
17
17
  //# sourceMappingURL=AttributeFilterProviders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterProviders.js","sourceRoot":"","sources":["../../src/AttributeFilter/AttributeFilterProviders.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAwE,CACzG,KAAK,EACP,EAAE;IACA,MAAM,EACF,yBAAyB,GAAG,IAAI,EAChC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EACd,oBAA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ttributeFilterDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,GA2F3C,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdown.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAwBtC;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,GAoG3C,CAAC"}
@@ -1,5 +1,5 @@
1
- // (C) 2022-2023 GoodData Corporation
2
- import React from "react";
1
+ // (C) 2022-2025 GoodData Corporation
2
+ import React, { useRef } from "react";
3
3
  import { Dropdown, useMediaQuery } from "@gooddata/sdk-ui-kit";
4
4
  import cx from "classnames";
5
5
  import { useAttributeFilterComponentsContext } from "../../Context/AttributeFilterComponentsContext.js";
@@ -23,18 +23,20 @@ const ALIGN_POINTS = [
23
23
  */
24
24
  export const AttributeFilterDropdown = () => {
25
25
  const { DropdownButtonComponent, DropdownBodyComponent, LoadingComponent, ErrorComponent } = useAttributeFilterComponentsContext();
26
- const { title, isInitializing, initError, isFiltering, committedSelectionElements, onReset, onApply, onOpen, fullscreenOnMobile, isCommittedSelectionInverted, selectionMode, disabled, customIcon, } = useAttributeFilterContext();
26
+ const { title, isInitializing, initError, isFiltering, committedSelectionElements, workingSelectionElements, onReset, onApply, onOpen, fullscreenOnMobile, isCommittedSelectionInverted, isWorkingSelectionInverted, selectionMode, disabled, customIcon, withoutApply, isSelectionInvalid, } = useAttributeFilterContext();
27
27
  const isMobile = useMediaQuery("mobileDevice");
28
- const subtitle = useResolveAttributeFilterSubtitle(isCommittedSelectionInverted, committedSelectionElements);
28
+ const isSelectionInverted = useLastValidValue(withoutApply ? isWorkingSelectionInverted : isCommittedSelectionInverted, !isSelectionInvalid || !withoutApply);
29
+ const selectionElements = useLastValidValue(withoutApply ? workingSelectionElements : committedSelectionElements, !isSelectionInvalid || !withoutApply);
30
+ const subtitle = useResolveAttributeFilterSubtitle(isSelectionInverted, selectionElements);
29
31
  const isMultiselect = selectionMode !== "single";
30
- const showSelectionCount = isMultiselect && committedSelectionElements.length !== 0;
32
+ const showSelectionCount = isMultiselect && selectionElements.length !== 0;
31
33
  return (React.createElement(Dropdown, { className: "gd-attribute-filter__next", closeOnParentScroll: true, closeOnMouseDrag: true, closeOnOutsideClick: true, enableEventPropagation: true, alignPoints: ALIGN_POINTS, fullscreenOnMobile: fullscreenOnMobile, renderButton: ({ toggleDropdown, isOpen }) => {
32
34
  const handleClickAction = disabled ? noop : toggleDropdown;
33
35
  return (React.createElement("div", { className: cx({ "gd-is-mobile": fullscreenOnMobile && isMobile && isOpen }) },
34
36
  !!isInitializing && React.createElement(LoadingComponent, { onClick: handleClickAction, isOpen: isOpen }),
35
37
  !isInitializing && !!initError && !title && (React.createElement(ErrorComponent, { message: initError.message, error: initError })),
36
38
  !isInitializing && !!title && (React.createElement(AttributeFilterButtonErrorTooltip, { errorMessage: initError?.message },
37
- React.createElement(DropdownButtonComponent, { title: title, subtitle: subtitle, isFiltering: isFiltering, isLoaded: !isInitializing, isLoading: isInitializing, isOpen: isOpen, selectedItemsCount: committedSelectionElements.length, showSelectionCount: showSelectionCount, disabled: disabled, customIcon: customIcon, onClick: handleClickAction, isError: !!initError })))));
39
+ React.createElement(DropdownButtonComponent, { title: title, subtitle: subtitle, isFiltering: isFiltering, isLoaded: !isInitializing, isLoading: isInitializing, isOpen: isOpen, selectedItemsCount: selectionElements.length, showSelectionCount: showSelectionCount, disabled: disabled, customIcon: customIcon, onClick: handleClickAction, isError: !!initError })))));
38
40
  }, onOpenStateChanged: (isOpen) => {
39
41
  if (!isOpen) {
40
42
  onReset();
@@ -48,4 +50,11 @@ export const AttributeFilterDropdown = () => {
48
50
  closeDropdown();
49
51
  }, onCancelButtonClick: closeDropdown }))) }));
50
52
  };
53
+ function useLastValidValue(value, isValid) {
54
+ const lastValidValue = useRef();
55
+ if (isValid) {
56
+ lastValidValue.current = value;
57
+ }
58
+ return lastValidValue.current;
59
+ }
51
60
  //# sourceMappingURL=AttributeFilterDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterDropdown.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,MAAM,YAAY,GAAG;IACjB,EAAE,KAAK,EAAE,OAAO,EAAE;IAClB,EAAE,KAAK,EAAE,OAAO,EAAE;IAClB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;IAEtC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;IAE1C,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;IAC5C,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;IAC7C,EAAE,KAAK,EAAE,OAAO,EAAE,M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E,EAAE,CAAC,EAAE,cAAc,EAAE,kBAAkB,IAAI,QAAQ,EAAE,CAAC,EACjE,KAAK,EAAE,EAAE,MAAM,EAAE,kBAAkB,IAAI,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE;YAEnE,oBAAC,qBAAqB,IAClB,kBAAkB,EAAE,GAAG,EAAE;oBACrB,OAAO,EAAE,CAAC;oBACV,aAAa,EAAE,CAAC;gBACpB,CAAC,EACD,mBAAmB,EAAE,aAAa,GACpC,CACA,CACT,GACH,CACL,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdown.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdown.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AACxG,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AACrG,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3G,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,MAAM,YAAY,GAAG;IACjB,EAAE,KAAK,EAAE,OAAO,EAAE;IAClB,EAAE,KAAK,EAAE,OAAO,EAAE;IAClB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;IAEtC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE;IAE1C,EAAE,KAAK,EAAE,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Props {
22
22
  * @beta
23
23
  */
24
24
  isApplyDisabled?: boolean;
25
+ /**
26
+ * If true, the Apply button is not rendered and Cancel button is renamed to Close.
27
+ *
28
+ * @alpha
29
+ */
30
+ withoutApply?: boolean;
25
31
  }
26
32
  /**
27
33
  * This component displays two buttons Apply and Cancel.
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterDropdownActions.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;GAGG;AACH,MAAM,WAAW,oCAAoC;IACjD;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAE/B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAEhC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,GAAG,CAAC,oCAAoC,CA8B1F,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdownActions.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;GAGG;AACH,MAAM,WAAW,oCAAoC;IACjD;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAE/B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAEhC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAkC1F,CAAC"}
@@ -1,4 +1,4 @@
1
- // (C) 2019-2022 GoodData Corporation
1
+ // (C) 2019-2025 GoodData Corporation
2
2
  import React from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import { Button } from "@gooddata/sdk-ui-kit";
@@ -9,14 +9,15 @@ import { Button } from "@gooddata/sdk-ui-kit";
9
9
  *
10
10
  * @beta
11
11
  */
12
- export const AttributeFilterDropdownActions = ({ isApplyDisabled, onApplyButtonClick, onCancelButtonClick, }) => {
12
+ export const AttributeFilterDropdownActions = ({ isApplyDisabled, onApplyButtonClick, onCancelButtonClick, withoutApply, }) => {
13
13
  const intl = useIntl();
14
14
  const cancelText = intl.formatMessage({ id: "gs.list.cancel" });
15
+ const closeText = intl.formatMessage({ id: "close" });
15
16
  const applyText = intl.formatMessage({ id: "gs.list.apply" });
16
17
  return (React.createElement("div", { className: "gd-attribute-filter-dropdown-actions__next" },
17
18
  React.createElement("div", { className: "gd-attribute-filter-dropdown-actions-left-content__next" }),
18
19
  React.createElement("div", { className: "gd-attribute-filter-dropdown-actions-right-content__next" },
19
- React.createElement(Button, { className: "gd-attribute-filter-cancel-button__next gd-button-secondary gd-button-small cancel-button s-cancel", onClick: onCancelButtonClick, value: cancelText, title: cancelText }),
20
- React.createElement(Button, { disabled: isApplyDisabled, className: "gd-attribute-filter-apply-button__next gd-button-action gd-button-small s-apply", onClick: onApplyButtonClick, value: applyText, title: applyText }))));
20
+ React.createElement(Button, { className: "gd-attribute-filter-cancel-button__next gd-button-secondary gd-button-small cancel-button s-cancel", onClick: onCancelButtonClick, value: withoutApply ? closeText : cancelText, title: withoutApply ? closeText : cancelText }),
21
+ !withoutApply && (React.createElement(Button, { disabled: isApplyDisabled, className: "gd-attribute-filter-apply-button__next gd-button-action gd-button-small s-apply", onClick: onApplyButtonClick, value: applyText, title: applyText })))));
21
22
  };
22
23
  //# sourceMappingURL=AttributeFilterDropdownActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterDropdownActions.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA6B9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAoD,CAAC,EAC5F,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACtB,EAAE,EAAE;IACD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;IAE9D,OAAO,CACH,6BAAK,SAAS,EAAC,4CAA4C;QACvD,6BAAK,SAAS,EAAC,yDAAyD,GAAG;QAC3E,6BAAK,SAAS,EAAC,0DAA0D;YACrE,oBAAC,MAAM,IACH,SAAS,EAAC,oGAAoG,EAC9G,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,GACnB;YACF,oBAAC,MAAM,IACH,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,GAClB,CACA,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdownActions.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAoC9C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAoD,CAAC,EAC5F,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACf,EAAE,EAAE;IACD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IAEvB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC;IAE9D,OAAO,CACH,6BAAK,SAAS,EAAC,4CAA4C;QACvD,6BAAK,SAAS,EAAC,yDAAyD,GAAG;QAC3E,6BAAK,SAAS,EAAC,0DAA0D;YACrE,oBAAC,MAAM,IACH,SAAS,EAAC,oGAAoG,EAC9G,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,EAC5C,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,GAC9C;YACD,CAAC,YAAY,IAAI,CACd,oBAAC,MAAM,IACH,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAC,iFAAiF,EAC3F,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,SAAS,EAChB,KAAK,EAAE,SAAS,GAClB,CACL,CACC,CACJ,CACT,CAAC;AACN,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterDropdownBody.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAI/D;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAmFnF,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdownBody.d.ts","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAIpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAI/D;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CAqFnF,CAAC"}
@@ -1,4 +1,4 @@
1
- // (C) 2022-2024 GoodData Corporation
1
+ // (C) 2022-2025 GoodData Corporation
2
2
  import React, { useMemo, useCallback } from "react";
3
3
  import { useMediaQuery } from "@gooddata/sdk-ui-kit";
4
4
  import { useAttributeFilterComponentsContext } from "../../Context/AttributeFilterComponentsContext.js";
@@ -16,6 +16,7 @@ import { DEFAULT_DROPDOWN_BODY_WIDTH } from "../../constants.js";
16
16
  export const AttributeFilterDropdownBody = (props) => {
17
17
  const { onApplyButtonClick, onCancelButtonClick, width = DEFAULT_DROPDOWN_BODY_WIDTH } = props;
18
18
  const { DropdownActionsComponent, ElementsSelectComponent } = useAttributeFilterComponentsContext();
19
+ const { withoutApply } = useAttributeFilterContext();
19
20
  const isMobile = useMediaQuery("mobileDevice");
20
21
  const { initialElementsPageError, nextElementsPageError, isApplyDisabled, isWorkingSelectionInverted, isLoadingInitialElementsPage, isLoadingNextElementsPage, onLoadNextElementsPage, elements, onSearch, onSelect, nextElementsPageSize, searchString, totalElementsCount, totalElementsCountWithCurrentSettings, workingSelectionElements, parentFilterAttributes, isFilteredByParentFilters, isFilteredByDependentDateFilters, fullscreenOnMobile, selectionMode, title, enableShowingFilteredElements, onShowFilteredElements, irrelevantSelection, onClearIrrelevantSelection, } = useAttributeFilterContext();
21
22
  const parentFilterTitles = useMemo(() => {
@@ -31,6 +32,6 @@ export const AttributeFilterDropdownBody = (props) => {
31
32
  }, [onSelect, onApplyButtonClick, selectionMode]);
32
33
  return (React.createElement("div", { className: "gd-attribute-filter-dropdown-body__next", style: style },
33
34
  React.createElement(ElementsSelectComponent, { isInverted: isWorkingSelectionInverted, isLoading: isLoadingInitialElementsPage, isLoadingNextPage: isLoadingNextElementsPage, items: elements, onLoadNextPage: onLoadNextElementsPage, onSearch: onSearch, onSelect: onSelectWithPotentialClose, nextPageSize: nextElementsPageSize, searchString: searchString, selectedItems: workingSelectionElements, totalItemsCount: totalElementsCount, totalItemsCountWithCurrentSettings: totalElementsCountWithCurrentSettings, parentFilterTitles: parentFilterTitles, isFilteredByParentFilters: isFilteredByParentFilters, error: initialElementsPageError ?? nextElementsPageError, attributeTitle: title, enableShowingFilteredElements: enableShowingFilteredElements, isFilteredByDependentDateFilters: isFilteredByDependentDateFilters, onShowFilteredElements: onShowFilteredElements, irrelevantSelection: irrelevantSelection, onClearIrrelevantSelection: onClearIrrelevantSelection }),
34
- React.createElement(DropdownActionsComponent, { onApplyButtonClick: onApplyButtonClick, onCancelButtonClick: onCancelButtonClick, isApplyDisabled: isApplyDisabled })));
35
+ React.createElement(DropdownActionsComponent, { onApplyButtonClick: onApplyButtonClick, onCancelButtonClick: onCancelButtonClick, isApplyDisabled: isApplyDisabled, withoutApply: withoutApply })));
35
36
  };
36
37
  //# sourceMappingURL=AttributeFilterDropdownBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterDropdownBody.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mCAAmC,EAAE,MAAM,mDAAmD,CAAC;AACxG,OAAO,EAAE,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D,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QACpC,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;YAC7B,kBAAkB,EAAE,CAAC;QACzB,CAAC;IACL,CAAC,EACD,CAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAChD,CAAC;IAEF,OAAO,CACH,6BAAK,SAAS,EAAC,yCAAyC,EAAC,KAAK,EAAE,KAAK;QACjE,oBAAC,uBAAuB,IACpB,UAAU,EAAE,0BAA0B,EACtC,SAAS,EAAE,4BAA4B,EACvC,iBAAiB,EAAE,yBAAyB,EAC5C,KAAK,EAAE,QAAQ,EACf,cAAc,EAAE,sBAAsB,EACtC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,0BAA0B,EACpC,YAAY,EAAE,oBAAoB,EAClC,YAAY,EAAE,YAAY,EAC1B,aAAa,EAAE,wBAAwB,EACvC,eAAe,EAAE,kBAAkB,EACnC,kCAAkC,EAAE,qCAAqC,EACzE,kBAAkB,EAAE,kBAAkB,EACtC,yBAAyB,EAAE,yBAAyB,EACpD,KAAK,EAAE,wBAAwB,IAAI,qBAAqB,EACxD,cAAc,EAAE,KAAK,EACrB,6BAA6B,EAAE,6BAA6B,EAC5D,gCAAgC,EAAE,gCAAgC,EAClE,sBAAsB,EAAE,sBAAsB,EAC9C,mBAAmB,EAAE,mBAAmB,EACxC,0BAA0B,EAAE,0BAA0B,GACxD;QACF,oBAAC,wBAAwB,IACrB,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,EACxC,eAAe,EAAE,eAAe,GAClC,CACA,CACT,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"AttributeFilterDropdownBody.js","sourceRoot":"","sources":["../../../../src/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAA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AC"}
@@ -5,7 +5,7 @@ import { AttributeFilterController } from "../hooks/types.js";
5
5
  * The return type of {@link useAttributeFilterContext}.
6
6
  * @beta
7
7
  */
8
- export type IAttributeFilterContext = AttributeFilterController & Pick<IAttributeFilterCoreProps, "fullscreenOnMobile" | "title" | "selectionMode" | "selectFirst" | "disabled" | "customIcon">;
8
+ export type IAttributeFilterContext = AttributeFilterController & Pick<IAttributeFilterCoreProps, "fullscreenOnMobile" | "title" | "selectionMode" | "selectFirst" | "disabled" | "customIcon" | "withoutApply" | "workingFilter">;
9
9
  export declare const AttributeFilterContext: React.Context<IAttributeFilterContext>;
10
10
  /**
11
11
  * Context providing AttributeFilter state and callbacks wrapped as {@link AttributeFilterController}.
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterContext.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/Context/AttributeFilterContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAC3D,IAAI,CACA,yBAAyB,EACzB,oBAAoB,GAAG,OAAO,GAAG,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,YAAY,CAC/F,CAAC;AAEN,eAAO,MAAM,sBAAsB,wCAAqD,CAAC;AAIzF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,uBAA6D,CAAC;AAE3G;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CACjD,yBAAyB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAgC5D,CAAC"}
1
+ {"version":3,"file":"AttributeFilterContext.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/Context/AttributeFilterContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,yBAAyB,GAC3D,IAAI,CACA,yBAAyB,EACvB,oBAAoB,GACpB,OAAO,GACP,eAAe,GACf,aAAa,GACb,UAAU,GACV,YAAY,GACZ,cAAc,GACd,eAAe,CACpB,CAAC;AAEN,eAAO,MAAM,sBAAsB,wCAAqD,CAAC;AAIzF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,uBAA6D,CAAC;AAE3G;;GAEG;AACH,eAAO,MAAM,8BAA8B,EAAE,KAAK,CAAC,EAAE,CACjD,yBAAyB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAoC5D,CAAC"}
@@ -1,4 +1,4 @@
1
- // (C) 2022-2024 GoodData Corporation
1
+ // (C) 2022-2025 GoodData Corporation
2
2
  import React, { useContext } from "react";
3
3
  import { useAttributeFilterController } from "../hooks/useAttributeFilterController.js";
4
4
  export const AttributeFilterContext = React.createContext(null);
@@ -12,7 +12,7 @@ export const useAttributeFilterContext = () => useContext(AttributeFilterContext
12
12
  * @internal
13
13
  */
14
14
  export const AttributeFilterContextProvider = (props) => {
15
- const { children, fullscreenOnMobile, title: titleInput, selectionMode, selectFirst, disabled, customIcon, enableDuplicatedLabelValuesInAttributeFilter = true, } = props;
15
+ const { children, fullscreenOnMobile, title: titleInput, selectionMode, selectFirst, disabled, customIcon, enableDuplicatedLabelValuesInAttributeFilter = true, withoutApply, workingFilter, } = props;
16
16
  const controller = useAttributeFilterController(props);
17
17
  const title = titleInput ?? controller?.attribute?.title ?? "";
18
18
  return (React.createElement(AttributeFilterContext.Provider, { value: {
@@ -24,6 +24,8 @@ export const AttributeFilterContextProvider = (props) => {
24
24
  disabled,
25
25
  customIcon,
26
26
  enableDuplicatedLabelValuesInAttributeFilter,
27
+ withoutApply,
28
+ workingFilter,
27
29
  } }, children));
28
30
  };
29
31
  //# sourceMappingURL=AttributeFilterContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeFilterContext.js","sourceRoot":"","sources":["../../../src/AttributeFilter/Context/AttributeFilterContext.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAaxF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC;AAEzF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA4B,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAE3G;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAEvC,CAAC,KAAK,EAAE,EAAE;IACV,MAAM,EACF,QAAQ,EACR,kBAAkB,EAClB,KAAK,EAAE,UAAU,EACjB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,4CAA4C,GAAG,IAAI,GACtD,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,UAAU,IAAI,UAAU,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC;IAE/D,OAAO,CACH,oBAAC,sBAAsB,CAAC,QAAQ,IAC5B,KAAK,EAAE;YACH,GAAG,UAAU;YACb,kBAAkB;YAClB,KAAK;YACL,aAAa;YACb,WAAW;YACX,QAAQ;YACR,UAAU;YACV,4CAA4C;SAC/C,IAEA,QAAQ,CACqB,CACrC,CAAC;AACN,CAAC,CAAC"}
1
+ {"version":3,"file":"AttributeFilterContext.js","sourceRoot":"","sources":["../../../src/AttributeFilter/Context/AttributeFilterContext.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAoBxF,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAA0B,IAAI,CAAC,CAAC;AAEzF,sBAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAA4B,EAAE,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAE3G;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAEvC,CAAC,KAAK,EAAE,EAAE;IACV,MAAM,EACF,QAAQ,EACR,kBAAkB,EAClB,KAAK,EAAE,UAAU,EACjB,aAAa,EACb,WAAW,EACX,QAAQ,EACR,UAAU,EACV,4CAA4C,GAAG,IAAI,EACnD,YAAY,EACZ,aAAa,GAChB,GAAG,KAAK,CAAC;IAEV,MAAM,UAAU,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,UAAU,IAAI,UAAU,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,CAAC;IAE/D,OAAO,CACH,oBAAC,sBAAsB,CAAC,QAAQ,IAC5B,KAAK,EAAE;YACH,GAAG,UAAU;YACb,kBAAkB;YAClB,KAAK;YACL,aAAa;YACb,WAAW;YACX,QAAQ;YACR,UAAU;YACV,4CAA4C;YAC5C,YAAY;YACZ,aAAa;SAChB,IAEA,QAAQ,CACqB,CACrC,CAAC;AACN,CAAC,CAAC"}
@@ -63,7 +63,12 @@ export type AttributeFilterControllerData = {
63
63
  */
64
64
  totalElementsCountWithCurrentSettings: number;
65
65
  /**
66
- * If true, selection has changes or the number of selected elements reached the limit of maximum selection size.
66
+ * If true, current selection is considered not valid and should not be applied.
67
+ * The number of selected elements reached the limit of maximum selection size or no elements are selected.
68
+ */
69
+ isSelectionInvalid: boolean;
70
+ /**
71
+ * If true, selection has no changes or the selection si invalid. see {@link AttributeFilterControllerData.isSelectionInvalid}.
67
72
  */
68
73
  isApplyDisabled: boolean;
69
74
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/types.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,mCAAmC,EACnC,iBAAiB,EACjB,wBAAwB,EACxB,MAAM,EACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,GAAG;IACxC;;OAEG;IACH,SAAS,EAAE,wBAAwB,CAAC;IAEpC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAE7B;;OAEG;IACH,4BAA4B,EAAE,OAAO,CAAC;IAEtC;;OAEG;IACH,wBAAwB,CAAC,EAAE,gBAAgB,CAAC;IAE5C;;OAEG;IACH,yBAAyB,EAAE,OAAO,CAAC;IAEnC;;OAEG;IACH,qBAAqB,CAAC,EAAE,gBAAgB,CAAC;IAEzC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;OAEG;IACH,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAE9B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,qCAAqC,EAAE,MAAM,CAAC;IAE9C;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,0BAA0B,EAAE,OAAO,CAAC;IAEpC;;OAEG;IACH,wBAAwB,EAAE,iB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,GAAG,6BAA6B,GAAG,kCAAkC,CAAC"}
@@ -1,3 +1,3 @@
1
- // (C) 2022-2024 GoodData Corporation
1
+ // (C) 2022-2025 GoodData Corporation
2
2
  export {};
3
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAttributeFilterController.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterController.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,yBAAyB,EAA6C,MAAM,aAAa,CAAC;AAenG,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAMvD;;;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;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,UAC9B,kCAAkC,KAC1C,yBAwIF,CAAC"}
1
+ {"version":3,"file":"useAttributeFilterController.d.ts","sourceRoot":"","sources":["../../../src/AttributeFilter/hooks/useAttributeFilterController.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,yBAAyB,EAA6C,MAAM,aAAa,CAAC;AAgBnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAMvD;;;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;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,4BAA4B,UAC9B,kCAAkC,KAC1C,yBA+IF,CAAC"}
@@ -4,14 +4,14 @@ import isEqual from "lodash/isEqual.js";
4
4
  import debounce from "lodash/debounce.js";
5
5
  import difference from "lodash/difference.js";
6
6
  import differenceBy from "lodash/differenceBy.js";
7
- import { areObjRefsEqual, filterAttributeElements, filterObjRef, isAttributeElementsByRef, isAttributeElementsByValue, isNegativeAttributeFilter, isPositiveAttributeFilter, objRefToString, } from "@gooddata/sdk-model";
7
+ import { areObjRefsEqual, filterAttributeElements, filterObjRef, getAttributeElementsItems, isAttributeElementsByRef, isAttributeElementsByValue, isNegativeAttributeFilter, isPositiveAttributeFilter, objRefToString, } from "@gooddata/sdk-model";
8
8
  import { useBackendStrict, useWorkspaceStrict, UnexpectedSdkError } from "@gooddata/sdk-ui";
9
9
  import { useResolveFilterInput } from "./useResolveFilterInput.js";
10
10
  import { useResolveParentFiltersInput } from "./useResolveParentFiltersInput.js";
11
11
  import { useResolveDependentDateFiltersInput } from "./useResolveDependentDateFiltersInput.js";
12
12
  import { useAttributeFilterHandler } from "./useAttributeFilterHandler.js";
13
13
  import { useAttributeFilterControllerData } from "./useAttributeFilterControllerData.js";
14
- import { DISPLAY_FORM_CHANGED_CORRELATION, IRRELEVANT_SELECTION, PARENT_FILTERS_CORRELATION, RESET_CORRELATION, SEARCH_CORRELATION, SHOW_FILTERED_ELEMENTS_CORRELATION, } from "./constants.js";
14
+ import { DISPLAY_FORM_CHANGED_CORRELATION, IRRELEVANT_SELECTION, MAX_SELECTION_SIZE, PARENT_FILTERS_CORRELATION, RESET_CORRELATION, SEARCH_CORRELATION, SHOW_FILTERED_ELEMENTS_CORRELATION, } from "./constants.js";
15
15
  import { isValidSingleSelectionFilter } from "../utils.js";
16
16
  import isEmpty from "lodash/isEmpty.js";
17
17
  import { invariant } from "ts-invariant";
@@ -29,7 +29,7 @@ import { useAttributeFilterHandlerState } from "./useAttributeFilterHandlerState
29
29
  * @public
30
30
  */
31
31
  export const useAttributeFilterController = (props) => {
32
- const { backend: backendInput, workspace: workspaceInput, filter: filterInput, connectToPlaceholder, parentFilters, dependentDateFilters, parentFilterOverAttribute, validateElementsBy, resetOnParentFilterChange = true, onApply, onSelect, onError, hiddenElements, staticElements, elementsOptions, displayAsLabel, selectionMode = "multi", selectFirst = false, enableDuplicatedLabelValuesInAttributeFilter = true, enableImmediateAttributeFilterDisplayAsLabelMigration = false, withoutApply = false, } = props;
32
+ const { backend: backendInput, workspace: workspaceInput, filter: filterInput, workingFilter, connectToPlaceholder, parentFilters, dependentDateFilters, parentFilterOverAttribute, validateElementsBy, resetOnParentFilterChange = true, onApply, onSelect, onError, hiddenElements, staticElements, elementsOptions, displayAsLabel, selectionMode = "multi", selectFirst = false, enableDuplicatedLabelValuesInAttributeFilter = true, enableImmediateAttributeFilterDisplayAsLabelMigration = false, enableDashboardFiltersApplyModes = false, withoutApply = false, } = props;
33
33
  const backend = useBackendStrict(backendInput, "AttributeFilter");
34
34
  const workspace = useWorkspaceStrict(workspaceInput, "AttributeFilter");
35
35
  const supportsSettingConnectingAttributes = backend.capabilities.supportsSettingConnectingAttributes;
@@ -58,6 +58,7 @@ export const useAttributeFilterController = (props) => {
58
58
  useOnError(handler, { onError });
59
59
  useInitOrReload(handler, {
60
60
  filter,
61
+ workingFilter,
61
62
  limitingAttributeFilters,
62
63
  limitingDateFilters,
63
64
  limitingValidationItems: validateElementsBy,
@@ -69,7 +70,7 @@ export const useAttributeFilterController = (props) => {
69
70
  selectionMode,
70
71
  setShouldReloadElements,
71
72
  displayAsLabel,
72
- }, supportsKeepingDependentFiltersSelection, supportsCircularDependencyInFilters, enableDuplicatedLabelValuesInAttributeFilter);
73
+ }, supportsKeepingDependentFiltersSelection, supportsCircularDependencyInFilters, enableDuplicatedLabelValuesInAttributeFilter, enableDashboardFiltersApplyModes);
73
74
  const callbacks = useCallbacks(handler, {
74
75
  onApply,
75
76
  onSelect,
@@ -82,13 +83,15 @@ export const useAttributeFilterController = (props) => {
82
83
  limitingAttributeFilters,
83
84
  limitingDateFilters,
84
85
  withoutApply,
85
- }, supportsShowingFilteredElements, supportsKeepingDependentFiltersSelection, enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration);
86
+ isSelectionInvalid: attributeFilterControllerData.isSelectionInvalid,
87
+ workingFilter,
88
+ }, supportsShowingFilteredElements, supportsKeepingDependentFiltersSelection, enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration, enableDashboardFiltersApplyModes);
86
89
  useSingleSelectModeHandler(handler, {
87
90
  selectFirst,
88
91
  onApply: callbacks.onApply,
89
92
  selectionMode,
90
93
  enableDuplicatedLabelValuesInAttributeFilter,
91
- withoutApply,
94
+ enableDashboardFiltersApplyModes,
92
95
  });
93
96
  return {
94
97
  ...attributeFilterControllerData,
@@ -139,8 +142,8 @@ const areFiltersEqual = (filterA, filterB) => {
139
142
  const elementsEqual = areElementsEqual(elementsA, elementsB);
140
143
  return typeEqual && dfsEqual && elementsEqual;
141
144
  };
142
- function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelection, supportsCircularDependencyInFilters, enableDuplicatedLabelValuesInAttributeFilter) {
143
- const { filter, limitingAttributeFilters, limitingDateFilters, limitingValidationItems = EMPTY_LIMITING_VALIDATION_ITEMS, limit, resetOnParentFilterChange, setConnectedPlaceholderValue, onApply, onSelect, selectionMode, setShouldReloadElements, displayAsLabel, } = props;
145
+ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelection, supportsCircularDependencyInFilters, enableDuplicatedLabelValuesInAttributeFilter, enableDashboardFiltersApplyModes) {
146
+ const { filter, workingFilter, limitingAttributeFilters, limitingDateFilters, limitingValidationItems = EMPTY_LIMITING_VALIDATION_ITEMS, limit, resetOnParentFilterChange, setConnectedPlaceholderValue, onApply, onSelect, selectionMode, setShouldReloadElements, displayAsLabel, } = props;
144
147
  useEffect(() => {
145
148
  if (limitingAttributeFilters.length > 0) {
146
149
  handler.setLimitingAttributeFilters(limitingAttributeFilters);
@@ -170,14 +173,35 @@ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelectio
170
173
  return !areFiltersEqual(filter, handler.getFilter());
171
174
  };
172
175
  const filterChanged = getFilterChanged(filter, handler, enableDuplicatedLabelValuesInAttributeFilter);
176
+ const getWorkingFilterChanged = (handler, workingFilter) => {
177
+ if (!workingFilter) {
178
+ return false;
179
+ }
180
+ const { isInverted, keys } = handler.getWorkingSelection();
181
+ if (isPositiveAttributeFilter(workingFilter)) {
182
+ if (isInverted) {
183
+ return true;
184
+ }
185
+ return !isEqual([...keys].sort(), [...getAttributeElementsItems(workingFilter.positiveAttributeFilter.in)].sort());
186
+ }
187
+ else {
188
+ if (!isInverted) {
189
+ return true;
190
+ }
191
+ return !isEqual([...keys].sort(), [...getAttributeElementsItems(workingFilter.negativeAttributeFilter.notIn)].sort());
192
+ }
193
+ };
194
+ const workingFilterChanged = getWorkingFilterChanged(handler, workingFilter);
173
195
  const limitingValidationItemsChanged = !isEqual(limitingValidationItems, handler.getLimitingValidationItems());
174
196
  const props = {
175
197
  filter,
198
+ workingFilter,
176
199
  limitingAttributeFilters,
177
200
  limitingAttributesChanged,
178
201
  limitingDateFilters,
179
202
  limitingDateFiltersChanged,
180
203
  filterChanged,
204
+ workingFilterChanged,
181
205
  setConnectedPlaceholderValue,
182
206
  onApply,
183
207
  onSelect,
@@ -191,8 +215,12 @@ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelectio
191
215
  ? updateAutomaticResettingFilter(handler, props, supportsCircularDependencyInFilters)
192
216
  : updateNonResettingFilter(handler, props, supportsKeepingDependentFiltersSelection, enableDuplicatedLabelValuesInAttributeFilter);
193
217
  refreshByType(handler, change, supportsKeepingDependentFiltersSelection);
218
+ if (enableDashboardFiltersApplyModes) {
219
+ updateWorkingSelection(handler, props);
220
+ }
194
221
  }, [
195
222
  filter,
223
+ workingFilter,
196
224
  limitingAttributeFilters,
197
225
  limitingDateFilters,
198
226
  resetOnParentFilterChange,
@@ -207,6 +235,7 @@ function useInitOrReload(handler, props, supportsKeepingDependentFiltersSelectio
207
235
  limitingValidationItems,
208
236
  displayAsLabel,
209
237
  enableDuplicatedLabelValuesInAttributeFilter,
238
+ enableDashboardFiltersApplyModes,
210
239
  ]);
211
240
  const isMountedRef = useRef(false);
212
241
  useEffect(() => {
@@ -340,40 +369,67 @@ function refreshByType(handler, change, supportsKeepingDependentFiltersSelection
340
369
  handler.init();
341
370
  }
342
371
  }
372
+ function updateWorkingSelection(handler, { workingFilter, workingFilterChanged }) {
373
+ if (workingFilterChanged) {
374
+ const workingElements = filterAttributeElements(workingFilter);
375
+ const workingKeys = isAttributeElementsByValue(workingElements)
376
+ ? workingElements.values
377
+ : workingElements.uris;
378
+ const isWorkingInverted = isNegativeAttributeFilter(workingFilter);
379
+ handler.changeSelection({ keys: workingKeys, isInverted: isWorkingInverted });
380
+ }
381
+ }
343
382
  //
344
- function useCallbacks(handler, props, supportsShowingFilteredElements, supportsKeepingDependentFiltersSelection, enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration) {
345
- const { onApply: onApplyInputCallback, onSelect: onSelectInputCallback, setConnectedPlaceholderValue, selectionMode, shouldReloadElements, setShouldReloadElements, shouldIncludeLimitingFilters, setShouldIncludeLimitingFilters, limitingAttributeFilters, limitingDateFilters, withoutApply, } = props;
383
+ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsKeepingDependentFiltersSelection, enableDuplicatedLabelValuesInAttributeFilter, enableImmediateAttributeFilterDisplayAsLabelMigration, enableDashboardFiltersApplyModes) {
384
+ const { onApply: onApplyInputCallback, onSelect: onSelectInputCallback, setConnectedPlaceholderValue, selectionMode, shouldReloadElements, setShouldReloadElements, shouldIncludeLimitingFilters, setShouldIncludeLimitingFilters, limitingAttributeFilters, limitingDateFilters, withoutApply, isSelectionInvalid, workingFilter, } = props;
346
385
  const handlerState = useAttributeFilterHandlerState(handler);
347
- const onSelectionChange = useCallback((onSelectionChangeInputCallback) => {
386
+ const onSelectionChange = useCallback((onSelectionChangeInputCallback, isResultOfMigration) => {
348
387
  const nextFilter = handler.getFilter();
349
- const isInverted = handler.getCommittedSelection()?.isInverted;
388
+ const isInverted = handler.getWorkingSelection()?.isInverted;
389
+ const keys = handler.getWorkingSelection().keys;
390
+ const isSelectionInvalid = (!isInverted && isEmpty(keys)) || keys.length > MAX_SELECTION_SIZE;
391
+ if (isSelectionInvalid && enableDashboardFiltersApplyModes) {
392
+ return;
393
+ }
350
394
  if (enableDuplicatedLabelValuesInAttributeFilter) {
351
395
  const displayAsLabel = handler.getDisplayAsLabel();
352
396
  const { attribute } = handlerState;
353
- if (!isPrimaryLabelUsed(nextFilter, attribute.data?.displayForms)) {
397
+ if (isPrimaryLabelUsed(nextFilter, attribute.data?.displayForms)) {
398
+ onSelectionChangeInputCallback?.(nextFilter, isInverted, selectionMode, handler.getElementsByKey(keys), displayAsLabel,
399
+ // filter was migrated after first render,
400
+ // enableImmediateAttributeFilterDisplayAsLabelMigration ff is enabled
401
+ isResultOfMigration);
402
+ }
403
+ else {
354
404
  const primaryDisplayForm = attribute.data?.displayForms.find((df) => df.isPrimary);
355
405
  if (!primaryDisplayForm) {
356
406
  throw new Error("No primary display form found.");
357
407
  }
358
408
  const primaryLabelRef = primaryDisplayForm.ref;
359
409
  const filterUsingPrimaryLabel = replaceFilterDisplayForm(nextFilter, primaryLabelRef);
360
- onSelectionChangeInputCallback?.(filterUsingPrimaryLabel, isInverted, selectionMode, handler.getElementsByKey(handler.getWorkingSelection().keys), displayAsLabel);
361
- }
362
- else {
363
- onSelectionChangeInputCallback?.(nextFilter, isInverted, selectionMode, handler.getElementsByKey(handler.getWorkingSelection().keys), displayAsLabel);
410
+ onSelectionChangeInputCallback?.(filterUsingPrimaryLabel, isInverted, selectionMode, handler.getElementsByKey(keys), displayAsLabel,
411
+ // filter was migrated when user changed it for the first time,
412
+ // enableImmediateAttributeFilterDisplayAsLabelMigration ff is disabled
413
+ true);
364
414
  }
365
415
  }
366
416
  else {
367
417
  onSelectionChangeInputCallback?.(nextFilter, isInverted, selectionMode);
368
418
  }
369
- }, [handler, enableDuplicatedLabelValuesInAttributeFilter, handlerState, selectionMode]);
419
+ }, [
420
+ handler,
421
+ enableDuplicatedLabelValuesInAttributeFilter,
422
+ handlerState,
423
+ selectionMode,
424
+ enableDashboardFiltersApplyModes,
425
+ ]);
370
426
  const onSelect = useCallback((selectedItems, isInverted) => {
371
427
  const attributeFilter = handler.getFilter();
372
428
  const isElementsByRef = isAttributeElementsByRef(filterAttributeElements(attributeFilter));
373
429
  const keys = selectedItems.map((item) => isElementsByRef || enableDuplicatedLabelValuesInAttributeFilter ? item.uri : item.title);
374
430
  const irrelevantKeysObj = selectionMode === "single" ? { irrelevantKeys: [] } : {};
375
431
  handler.changeSelection({ keys, isInverted, ...irrelevantKeysObj });
376
- onSelectionChange(onSelectInputCallback);
432
+ onSelectionChange(onSelectInputCallback, false);
377
433
  }, [
378
434
  handler,
379
435
  selectionMode,
@@ -396,6 +452,14 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
396
452
  if (!withoutApply) {
397
453
  handler.revertSelection();
398
454
  }
455
+ else if (isSelectionInvalid && enableDashboardFiltersApplyModes) {
456
+ const workingElements = filterAttributeElements(workingFilter);
457
+ const workingKeys = isAttributeElementsByValue(workingElements)
458
+ ? workingElements.values
459
+ : workingElements.uris;
460
+ const isWorkingInverted = isNegativeAttributeFilter(workingFilter);
461
+ handler.changeSelection({ keys: workingKeys, isInverted: isWorkingInverted });
462
+ }
399
463
  if (handler.getSearch().length > 0) {
400
464
  handler.setSearch("");
401
465
  handler.loadInitialElementsPage(RESET_CORRELATION);
@@ -418,15 +482,21 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
418
482
  shouldIncludeLimitingFilters,
419
483
  supportsShowingFilteredElements,
420
484
  withoutApply,
485
+ isSelectionInvalid,
486
+ workingFilter,
487
+ enableDashboardFiltersApplyModes,
421
488
  ]);
489
+ const onApplyChanges = useCallback((isResultOfMigration) => {
490
+ handler.commitSelection();
491
+ setConnectedPlaceholderValue(handler.getFilter());
492
+ onSelectionChange(onApplyInputCallback, isResultOfMigration);
493
+ }, [handler, setConnectedPlaceholderValue, onSelectionChange, onApplyInputCallback]);
422
494
  const onApply = useCallback((applyRegardlessWithoutApplySetting = false) => {
423
495
  if (withoutApply && !applyRegardlessWithoutApplySetting) {
424
496
  return;
425
497
  }
426
- handler.commitSelection();
427
- setConnectedPlaceholderValue(handler.getFilter());
428
- onSelectionChange(onApplyInputCallback);
429
- }, [handler, setConnectedPlaceholderValue, onSelectionChange, onApplyInputCallback, withoutApply]);
498
+ onApplyChanges(false);
499
+ }, [withoutApply, onApplyChanges]);
430
500
  const onOpen = useCallback(() => {
431
501
  if (shouldReloadElements) {
432
502
  handler.loadInitialElementsPage(RESET_CORRELATION);
@@ -455,7 +525,8 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
455
525
  });
456
526
  }
457
527
  }, [handler, supportsKeepingDependentFiltersSelection, supportsShowingFilteredElements]);
458
- useReportMigratedFilter(handler, onApply, enableImmediateAttributeFilterDisplayAsLabelMigration);
528
+ const onFilterMigrated = useCallback(() => onApplyChanges(true), [onApplyChanges]);
529
+ useReportMigratedFilter(handler, onFilterMigrated, enableImmediateAttributeFilterDisplayAsLabelMigration);
459
530
  return {
460
531
  onApply,
461
532
  onLoadNextElementsPage,
@@ -469,7 +540,7 @@ function useCallbacks(handler, props, supportsShowingFilteredElements, supportsK
469
540
  }
470
541
  //
471
542
  const useSingleSelectModeHandler = (handler, props) => {
472
- const { selectFirst, selectionMode, onApply, enableDuplicatedLabelValuesInAttributeFilter, withoutApply, } = props;
543
+ const { selectFirst, selectionMode, onApply, enableDuplicatedLabelValuesInAttributeFilter, enableDashboardFiltersApplyModes, } = props;
473
544
  const committedSelectionKeys = handler.getCommittedSelection().keys;
474
545
  const initialStatus = handler.getInitStatus();
475
546
  const elements = handler.getAllElements();
@@ -477,10 +548,10 @@ const useSingleSelectModeHandler = (handler, props) => {
477
548
  useEffect(() => {
478
549
  if (selectFirst &&
479
550
  selectionMode === "single" &&
480
- isEmpty(committedSelectionKeys) &&
551
+ (isEmpty(committedSelectionKeys) ||
552
+ (committedSelectionKeys.length > 1 && enableDashboardFiltersApplyModes)) &&
481
553
  initialStatus === "success" &&
482
- !isEmpty(elements) &&
483
- !withoutApply) {
554
+ !isEmpty(elements)) {
484
555
  const isElementsByRef = isAttributeElementsByRef(filterAttributeElements(filter));
485
556
  const keys = [
486
557
  isElementsByRef || enableDuplicatedLabelValuesInAttributeFilter
@@ -489,7 +560,7 @@ const useSingleSelectModeHandler = (handler, props) => {
489
560
  ];
490
561
  handler.changeSelection({ keys, isInverted: false, irrelevantKeys: [] });
491
562
  handler.commitSelection();
492
- onApply();
563
+ onApply(true);
493
564
  }
494
565
  }, [
495
566
  selectFirst,
@@ -501,7 +572,7 @@ const useSingleSelectModeHandler = (handler, props) => {
501
572
  handler,
502
573
  onApply,
503
574
  enableDuplicatedLabelValuesInAttributeFilter,
504
- withoutApply,
575
+ enableDashboardFiltersApplyModes,
505
576
  ]);
506
577
  };
507
578
  /**