@gooddata/sdk-ui-filters 11.55.0 → 11.56.0-alpha.1
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/AttributeFilterDefaultComponents.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/Addons/AttributeDatasetInfo.js +1 -3
- package/esm/AttributeFilter/Components/Addons/AttributeFilterConfigurationButton.js +1 -3
- package/esm/AttributeFilter/Components/Addons/AttributeFilterDeleteButton.js +1 -3
- package/esm/AttributeFilter/Components/Addons/AttributeFilterDependencyTooltip.js +1 -3
- package/esm/AttributeFilter/Components/Addons/hooks/useAutoOpenAttributeFilterDropdownButton.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/Addons/hooks/useOnCloseAttributeFilterDropdownButton.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDetailsBubble.js +2 -16
- package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownActions.js +1 -4
- package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownBody.js +1 -2
- package/esm/AttributeFilter/Components/Dropdown/AttributeFilterDropdownHeader.js +1 -4
- package/esm/AttributeFilter/Components/DropdownButton/AttributeFilterButtonErrorTooltip.js +1 -2
- package/esm/AttributeFilter/Components/DropdownButton/AttributeFilterButtonTooltip.js +1 -3
- package/esm/AttributeFilter/Components/DropdownButton/AttributeFilterSimpleDropdownButton.js +1 -4
- package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelectItem.js +2 -8
- package/esm/AttributeFilter/Components/ElementsSelect/AttributeFilterElementsSelectItemTooltip.js +1 -3
- package/esm/AttributeFilter/Components/ElementsSelect/EmptyResult/AttributeFilterEmptyFilteredResult.js +5 -15
- package/esm/AttributeFilter/Components/ElementsSelect/SingleSelectionAttributeFilterElementsSelectItem.js +1 -4
- package/esm/AttributeFilter/Components/ElementsSelect/StatusBar/AttributeFilterFilteredStatus.js +2 -6
- package/esm/AttributeFilter/Components/ElementsSelect/StatusBar/AttributeFilterIrrelevantSelectionStatus.js +2 -4
- package/esm/AttributeFilter/Components/ElementsSelect/StatusBar/AttributeFilterShowFilteredElements.js +2 -6
- package/esm/AttributeFilter/Components/ElementsSelect/StatusBar/AttributeFilterStatusBar.js +2 -4
- package/esm/AttributeFilter/Components/ElementsSelect/StatusBar/SingleSelectionAttributeFilterStatusBar.js +1 -2
- package/esm/AttributeFilter/Components/FilterMenu/FilterMenuDropdownBody.js +2 -6
- package/esm/AttributeFilter/Components/FilterMenu/FilterMenuSectionHeader.js +1 -2
- package/esm/AttributeFilter/Components/TextFilterBody/ArbitraryValuesInput.js +3 -6
- package/esm/AttributeFilter/Components/TextFilterBody/TextFilterBody.js +4 -11
- package/esm/AttributeFilter/Components/TextFilterBody/TextFilterStateSummary.js +1 -5
- package/esm/AttributeFilter/Components/TextFilterBody/useArbitraryValuesInput.d.ts +3 -3
- package/esm/AttributeFilter/Components/TextFilterBody/useArbitraryValuesInput.d.ts.map +1 -1
- package/esm/AttributeFilter/Components/TextFilterBody/useTextFilterBodyTexts.d.ts.map +1 -1
- package/esm/AttributeFilter/Context/AttributeFilterComponentsContext.d.ts.map +1 -1
- package/esm/AttributeFilter/Context/AttributeFilterContext.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterController.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterHandler.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterHandlerState.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useAttributeFilterSearch.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useResolveDependentDateFiltersInput.d.ts +1 -1
- package/esm/AttributeFilter/hooks/useResolveDependentDateFiltersInput.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useResolveFilterInput.d.ts +1 -1
- package/esm/AttributeFilter/hooks/useResolveFilterInput.d.ts.map +1 -1
- package/esm/AttributeFilter/hooks/useResolveParentFiltersInput.d.ts +1 -1
- package/esm/AttributeFilter/hooks/useResolveParentFiltersInput.d.ts.map +1 -1
- package/esm/AttributeFilter/utils.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/AttributeFilterHandler.test.helpers.d.ts +4 -4
- package/esm/AttributeFilterHandler/AttributeFilterHandler.test.helpers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/bridge.d.ts +13 -13
- package/esm/AttributeFilterHandler/internal/bridge.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/callbacks.d.ts +32 -32
- package/esm/AttributeFilterHandler/internal/callbacks.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/loader.d.ts +11 -11
- package/esm/AttributeFilterHandler/internal/loader.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/multiSelectHandler.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/common/selectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/displayForms/displayFormsReducers.d.ts +4 -3
- package/esm/AttributeFilterHandler/internal/redux/displayForms/displayFormsReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsReducers.d.ts +8 -7
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/elementsSelectors.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/elements/loadElementsFromBackend.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/init/initReducers.d.ts +8 -7
- package/esm/AttributeFilterHandler/internal/redux/init/initReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadAttribute/loadAttributeByDisplayForm.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadAttribute/loadAttributeByDisplayForm.js +30 -2
- package/esm/AttributeFilterHandler/internal/redux/loadAttribute/loadAttributeReducers.d.ts +6 -5
- package/esm/AttributeFilterHandler/internal/redux/loadAttribute/loadAttributeReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadCustomElements/loadCustomElementsReducers.d.ts +7 -6
- package/esm/AttributeFilterHandler/internal/redux/loadCustomElements/loadCustomElementsReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadInitialElementsPage/loadInitialElementsPageReducers.d.ts +6 -5
- package/esm/AttributeFilterHandler/internal/redux/loadInitialElementsPage/loadInitialElementsPageReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadIrrelevantElements/loadIrrelevantElementsReducers.d.ts +7 -6
- package/esm/AttributeFilterHandler/internal/redux/loadIrrelevantElements/loadIrrelevantElementsReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageReducers.d.ts +6 -5
- package/esm/AttributeFilterHandler/internal/redux/loadNextElementsPage/loadNextElementsPageReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/selection/selectionReducers.d.ts +2 -2
- package/esm/AttributeFilterHandler/internal/redux/selection/selectionReducers.d.ts.map +1 -1
- package/esm/AttributeFilterHandler/internal/redux/store/rootReducers.d.ts +46 -46
- package/esm/AttributeFilterHandler/internal/redux/store/slice.d.ts +46 -46
- package/esm/AttributeFilterHandler/internal/singleSelectHandler.d.ts.map +1 -1
- package/esm/DateFilter/AbsoluteDateFilterForm/AbsoluteDateFilterForm.d.ts +29 -2
- package/esm/DateFilter/AbsoluteDateFilterForm/AbsoluteDateFilterForm.d.ts.map +1 -1
- package/esm/DateFilter/AbsoluteDateFilterForm/AbsoluteDateFilterForm.js +38 -5
- package/esm/DateFilter/AbsoluteDateFilterForm/conversions.d.ts +17 -1
- package/esm/DateFilter/AbsoluteDateFilterForm/conversions.d.ts.map +1 -1
- package/esm/DateFilter/AbsoluteDateFilterForm/conversions.js +17 -1
- package/esm/DateFilter/CheckboxSection/CheckboxSection.js +2 -6
- package/esm/DateFilter/DateFilter.d.ts +10 -0
- package/esm/DateFilter/DateFilter.d.ts.map +1 -1
- package/esm/DateFilter/DateFilter.js +2 -2
- package/esm/DateFilter/DateFilterBody/DateFilterBody.d.ts +1 -0
- package/esm/DateFilter/DateFilterBody/DateFilterBody.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterBody/DateFilterBody.js +50 -30
- package/esm/DateFilter/DateFilterBody/DateFilterBodyContentFiltered.js +1 -3
- package/esm/DateFilter/DateFilterBody/DateFilterConfigurationButton.js +1 -3
- package/esm/DateFilter/DateFilterBody/DateFilterFormContent.d.ts +3 -1
- package/esm/DateFilter/DateFilterBody/DateFilterFormContent.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterBody/DateFilterFormContent.js +4 -5
- package/esm/DateFilter/DateFilterBody/DateFilterFormNavigationWrapper.js +1 -2
- package/esm/DateFilter/DateFilterBody/DateFilterHeader.js +1 -3
- package/esm/DateFilter/DateFilterBody/EditModeMessage.js +2 -4
- package/esm/DateFilter/DateFilterBody/RelativePresetFilterItems.js +1 -2
- package/esm/DateFilter/DateFilterButton/DateFilterButton.js +1 -5
- package/esm/DateFilter/DateFilterCore.d.ts +1 -0
- package/esm/DateFilter/DateFilterCore.d.ts.map +1 -1
- package/esm/DateFilter/DateFilterCore.js +1 -4
- package/esm/DateFilter/DateFilterTextLocalized/DateFilterTextLocalized.d.ts +2 -2
- package/esm/DateFilter/DateFilterTextLocalized/DateFilterTextLocalized.d.ts.map +1 -1
- package/esm/DateFilter/DateRangePicker/DateInput.js +3 -7
- package/esm/DateFilter/DateRangePicker/DatePicker.d.ts +5 -5
- package/esm/DateFilter/DateRangePicker/DatePicker.d.ts.map +1 -1
- package/esm/DateFilter/DateRangePicker/DatePicker.js +1 -30
- package/esm/DateFilter/DateRangePicker/DateRangeHint.js +1 -2
- package/esm/DateFilter/DateRangePicker/DateRangePicker.js +2 -4
- package/esm/DateFilter/DateRangePicker/DateRangePickerInputFieldBody.js +1 -3
- package/esm/DateFilter/DateRangePicker/DateTimePicker.js +1 -2
- package/esm/DateFilter/DateRangePicker/TimeInput.js +2 -6
- package/esm/DateFilter/DateRangePicker/utils.d.ts.map +1 -1
- package/esm/DateFilter/DynamicSelect/DynamicSelect.js +1 -2
- package/esm/DateFilter/DynamicSelect/RelativeRangeDynamicSelect.js +1 -2
- package/esm/DateFilter/DynamicSelect/utils.d.ts.map +1 -1
- package/esm/DateFilter/EmptyValuesHandlingToggle/EmptyValuesHandlingToggle.js +1 -5
- package/esm/DateFilter/ExcludeCurrentPeriodToggle/ExcludeCurrentPeriodToggle.js +2 -7
- package/esm/DateFilter/GranularityTabs.d.ts +20 -0
- package/esm/DateFilter/GranularityTabs.d.ts.map +1 -0
- package/esm/DateFilter/{RelativeDateFilterForm/GranularityTabs.js → GranularityTabs.js} +6 -6
- package/esm/DateFilter/ListItemTooltip/ListItemTooltip.js +1 -3
- package/esm/DateFilter/Other/OtherPresetsSection.js +1 -3
- package/esm/DateFilter/RelativeDateFilterForm/RelativeDateFilterForm.d.ts.map +1 -1
- package/esm/DateFilter/RelativeDateFilterForm/RelativeDateFilterForm.js +4 -6
- package/esm/DateFilter/RelativeRangePicker/RelativeRangePicker.js +2 -5
- package/esm/DateFilter/Select/ScrollableSelectMenu.d.ts.map +1 -1
- package/esm/DateFilter/Select/utils.d.ts +1 -1
- package/esm/DateFilter/Select/utils.d.ts.map +1 -1
- package/esm/DateFilter/Tabs/Tabs.d.ts +6 -1
- package/esm/DateFilter/Tabs/Tabs.d.ts.map +1 -1
- package/esm/DateFilter/Tabs/Tabs.js +2 -3
- package/esm/DateFilter/accessibility/elementId.d.ts +4 -0
- package/esm/DateFilter/accessibility/elementId.d.ts.map +1 -1
- package/esm/DateFilter/accessibility/elementId.js +4 -0
- package/esm/DateFilter/accessibility/keyboardNavigation.d.ts +3 -3
- package/esm/DateFilter/accessibility/keyboardNavigation.d.ts.map +1 -1
- package/esm/DateFilter/extendedDateFilters.test.helpers.d.ts.map +1 -1
- package/esm/DateFilter/index.d.ts +2 -2
- package/esm/DateFilter/interfaces/index.d.ts.map +1 -1
- package/esm/DateFilter/utils/AFMConversions.d.ts.map +1 -1
- package/esm/DateFilter/utils/DateConversions.d.ts +2 -2
- package/esm/DateFilter/utils/DateConversions.d.ts.map +1 -1
- package/esm/DateFilter/utils/DateFilterOptionMapping.d.ts.map +1 -1
- package/esm/DateFilter/utils/DateFilterOptionMapping.js +1 -0
- package/esm/DateFilter/utils/FormattingUtils.d.ts.map +1 -1
- package/esm/DateFilter/utils/OptionUtils.d.ts.map +1 -1
- package/esm/DateFilter/utils/OptionUtils.js +7 -4
- package/esm/DateFilter/utils/PeriodExclusion.d.ts.map +1 -1
- package/esm/DateFilter/utils/Translations/DateFilterTitle.d.ts +2 -2
- package/esm/DateFilter/utils/Translations/DateFilterTitle.d.ts.map +1 -1
- package/esm/DateFilter/utils/Translations/DateFilterTitle.js +36 -2
- package/esm/DateFilter/utils/Translations/Translators.d.ts +1 -0
- package/esm/DateFilter/utils/Translations/Translators.d.ts.map +1 -1
- package/esm/DateFilter/utils/Translations/Translators.js +1 -0
- package/esm/DateFilter/utils/dateFnsLocale.d.ts +9 -0
- package/esm/DateFilter/utils/dateFnsLocale.d.ts.map +1 -0
- package/esm/DateFilter/utils/dateFnsLocale.js +37 -0
- package/esm/DateFilter/utils/presetFilterUtils.d.ts +21 -1
- package/esm/DateFilter/utils/presetFilterUtils.d.ts.map +1 -1
- package/esm/DateFilter/utils/presetFilterUtils.js +28 -0
- package/esm/DateFilter/validation/OptionValidation.d.ts.map +1 -1
- package/esm/FilterGroup/useFilterGroupStatus.d.ts.map +1 -1
- package/esm/MeasureValueFilter/AttributePicker.d.ts +1 -1
- package/esm/MeasureValueFilter/AttributePicker.d.ts.map +1 -1
- package/esm/MeasureValueFilter/ComparisonInput.js +2 -4
- package/esm/MeasureValueFilter/ConditionInputSection.d.ts +1 -1
- package/esm/MeasureValueFilter/ConditionInputSection.d.ts.map +1 -1
- package/esm/MeasureValueFilter/ConditionInputSection.js +1 -2
- package/esm/MeasureValueFilter/DimensionalitySection.d.ts +1 -1
- package/esm/MeasureValueFilter/DimensionalitySection.d.ts.map +1 -1
- package/esm/MeasureValueFilter/DimensionalitySection.js +2 -8
- package/esm/MeasureValueFilter/Dropdown.js +1 -2
- package/esm/MeasureValueFilter/DropdownBody.d.ts +2 -2
- package/esm/MeasureValueFilter/DropdownBody.d.ts.map +1 -1
- package/esm/MeasureValueFilter/DropdownBody.js +5 -11
- package/esm/MeasureValueFilter/MeasureValueFilter.js +1 -2
- package/esm/MeasureValueFilter/MeasureValueFilterDetailsBubble.js +1 -9
- package/esm/MeasureValueFilter/MeasureValueFilterDropdown.test.utils.d.ts.map +1 -1
- package/esm/MeasureValueFilter/MeasureValueFilterDropdownActions.js +1 -3
- package/esm/MeasureValueFilter/MeasureValueFilterDropdownHeader.js +1 -2
- package/esm/MeasureValueFilter/OperatorDropdown.d.ts +1 -1
- package/esm/MeasureValueFilter/OperatorDropdown.d.ts.map +1 -1
- package/esm/MeasureValueFilter/OperatorDropdown.js +1 -3
- package/esm/MeasureValueFilter/OperatorDropdownBody.d.ts +1 -1
- package/esm/MeasureValueFilter/OperatorDropdownBody.d.ts.map +1 -1
- package/esm/MeasureValueFilter/OperatorDropdownBody.js +3 -11
- package/esm/MeasureValueFilter/PreviewSection.d.ts +1 -1
- package/esm/MeasureValueFilter/PreviewSection.d.ts.map +1 -1
- package/esm/MeasureValueFilter/RangeInput.js +3 -7
- package/esm/MeasureValueFilter/TreatNullValuesAsZeroCheckbox.js +1 -5
- package/esm/MeasureValueFilter/helpers/measureValueFilterOperator.d.ts.map +1 -1
- package/esm/MeasureValueFilter/useDimensionalityEditor.d.ts +1 -1
- package/esm/MeasureValueFilter/useDimensionalityEditor.d.ts.map +1 -1
- package/esm/MeasureValueFilter/useDimensionalityEditor.js +1 -4
- package/esm/RankingFilter/AttributeDropdown/AttributeDropdown.js +1 -4
- package/esm/RankingFilter/AttributeDropdown/AttributeDropdownBody.js +1 -2
- package/esm/RankingFilter/AttributeDropdown/DropdownItems/AllRecordsItem.js +1 -5
- package/esm/RankingFilter/AttributeDropdown/DropdownItems/AttributeItem.js +1 -3
- package/esm/RankingFilter/MeasureDropdown/MeasureDropdown.js +1 -2
- package/esm/RankingFilter/MeasureDropdown/MeasureDropdownItem.js +1 -2
- package/esm/RankingFilter/OperatorDropdown/OperatorDropdown.js +1 -2
- package/esm/RankingFilter/OperatorDropdown/OperatorDropdownItem.js +1 -2
- package/esm/RankingFilter/RankingAttributesSection.d.ts +1 -1
- package/esm/RankingFilter/RankingAttributesSection.d.ts.map +1 -1
- package/esm/RankingFilter/RankingAttributesSection.js +2 -8
- package/esm/RankingFilter/RankingFilter.js +1 -2
- package/esm/RankingFilter/RankingFilterDropdown.d.ts.map +1 -1
- package/esm/RankingFilter/RankingFilterDropdown.test.utils.d.ts.map +1 -1
- package/esm/RankingFilter/RankingFilterDropdownBody.js +3 -19
- package/esm/RankingFilter/ValueDropdown/utils.d.ts.map +1 -1
- package/esm/sdk-ui-filters.d.ts +13 -2
- package/esm/shared/components/internal/FilterButtonCustomIcon.js +1 -3
- package/package.json +14 -14
- package/styles/css/attributeFilter.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilter.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterAddons.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterDropdownBody.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterDropdownButton.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterElementsSelect.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterEmptyResult.css.map +1 -1
- package/styles/css/attributeFilterNext/attributeFilterStatusBar.css.map +1 -1
- package/styles/css/attributeFilterNext.css.map +1 -1
- package/styles/css/components/GranularityTabs.css +4 -2
- package/styles/css/components/GranularityTabs.css.map +1 -1
- package/styles/css/components/SelectMenu.css.map +1 -1
- package/styles/css/dateFilter.css +4 -2
- package/styles/css/dateFilter.css.map +1 -1
- package/styles/css/main.css +4 -2
- package/styles/css/main.css.map +1 -1
- package/styles/scss/components/GranularityTabs.scss +2 -1
- package/styles/scss/components/SelectMenu.scss +4 -4
- package/esm/DateFilter/RelativeDateFilterForm/GranularityTabs.d.ts +0 -10
- package/esm/DateFilter/RelativeDateFilterForm/GranularityTabs.d.ts.map +0 -1
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type WeekStart } from "@gooddata/sdk-model";
|
|
2
|
+
import { type DateFilterGranularity, type WeekStart } from "@gooddata/sdk-model";
|
|
3
|
+
import { type IAccessibilityConfigBase } from "@gooddata/sdk-ui-kit";
|
|
3
4
|
import { type DateFilterOption, type IUiAbsoluteDateFilterForm } from "../interfaces/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface IAbsoluteDateFilterFormAccessibilityConfig extends IAccessibilityConfigBase {
|
|
9
|
+
/**
|
|
10
|
+
* Id applied to the picker panel, wired to the granularity tabs' `aria-controls`.
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
13
|
+
}
|
|
4
14
|
/**
|
|
5
15
|
* @internal
|
|
6
16
|
*/
|
|
@@ -16,9 +26,26 @@ export interface IAbsoluteDateFilterFormProps {
|
|
|
16
26
|
withoutApply?: boolean;
|
|
17
27
|
submitForm: () => void;
|
|
18
28
|
customRangeHint?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Enables Day/Week/Month/Quarter/Year granularity switching.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* When false (the default), this component renders without the granularity tabs - regardless of
|
|
34
|
+
* what `availableGranularities` is set to, or what `granularity` flows in through
|
|
35
|
+
* `selectedFilterOption`.
|
|
36
|
+
*/
|
|
37
|
+
isGranularityEnabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Available granularities for this absolute date filter.
|
|
40
|
+
*/
|
|
41
|
+
availableGranularities: DateFilterGranularity[];
|
|
42
|
+
/**
|
|
43
|
+
* Accessibility configuration for the absolute date filter form.
|
|
44
|
+
*/
|
|
45
|
+
accessibilityConfig?: IAbsoluteDateFilterFormAccessibilityConfig;
|
|
19
46
|
}
|
|
20
47
|
/**
|
|
21
48
|
* @internal
|
|
22
49
|
*/
|
|
23
|
-
export declare function AbsoluteDateFilterForm({ dateFormat, isMobile, selectedFilterOption, isTimeEnabled, isSecondsEnabled, weekStart, shouldOverlayDatePicker, withoutApply, onSelectedFilterOptionChange, submitForm, customRangeHint }: IAbsoluteDateFilterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function AbsoluteDateFilterForm({ dateFormat, isMobile, selectedFilterOption, isTimeEnabled, isSecondsEnabled, weekStart, shouldOverlayDatePicker, withoutApply, onSelectedFilterOptionChange, submitForm, customRangeHint, isGranularityEnabled, availableGranularities, accessibilityConfig }: IAbsoluteDateFilterFormProps): import("react/jsx-runtime").JSX.Element;
|
|
24
51
|
//# sourceMappingURL=AbsoluteDateFilterForm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbsoluteDateFilterForm.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/AbsoluteDateFilterForm/AbsoluteDateFilterForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,
|
|
1
|
+
{"version":3,"file":"AbsoluteDateFilterForm.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/AbsoluteDateFilterForm/AbsoluteDateFilterForm.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,EAEH,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAMrE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAU/F;;GAEG;AACH,MAAM,WAAW,0CAA2C,SAAQ,wBAAwB;IACxF;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB,EAAE,yBAAyB,CAAC;IAChD,QAAQ,EAAE,OAAO,CAAC;IAClB,4BAA4B,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACjE,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;;;;OAOG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD;;OAEG;IACH,mBAAmB,CAAC,EAAE,0CAA0C,CAAC;CACpE;AAYD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EACnC,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,gBAAwB,EACxB,SAAS,EACT,uBAAuB,EACvB,YAAY,EACZ,4BAA4B,EAC5B,UAAU,EACV,eAAe,EACf,oBAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACtB,EAAE,4BAA4B,2CA+F9B"}
|
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_ABSOLUTE_DATE_FILTER_GRANULARITIES, } from "@gooddata/sdk-model";
|
|
3
|
+
import { DATE_FILTER_ABSOLUTE_GRANULARITY_TAB_ID } from "../accessibility/elementId.js";
|
|
2
4
|
import { DateRangePicker } from "../DateRangePicker/DateRangePicker.js";
|
|
3
|
-
import {
|
|
5
|
+
import { GranularityTabs } from "../GranularityTabs.js";
|
|
6
|
+
import { PeriodRangePicker } from "../PeriodRangePicker/PeriodRangePicker.js";
|
|
7
|
+
import { dateFilterValueToDateRange, dateRangeToDateFilterValue, periodRangeToDateFilterValue, } from "./conversions.js";
|
|
4
8
|
const dayPickerProps = {
|
|
5
9
|
mode: "range",
|
|
6
10
|
weekStartsOn: 0, // Sunday, regardless of locale
|
|
7
11
|
};
|
|
12
|
+
const isPeriodPickerGranularity = (granularity) => DEFAULT_ABSOLUTE_DATE_FILTER_GRANULARITIES.includes(granularity);
|
|
8
13
|
/**
|
|
9
14
|
* @internal
|
|
10
15
|
*/
|
|
11
|
-
export function AbsoluteDateFilterForm({ dateFormat, isMobile, selectedFilterOption, isTimeEnabled, isSecondsEnabled = false, weekStart, shouldOverlayDatePicker, withoutApply, onSelectedFilterOptionChange, submitForm, customRangeHint, }) {
|
|
16
|
+
export function AbsoluteDateFilterForm({ dateFormat, isMobile, selectedFilterOption, isTimeEnabled, isSecondsEnabled = false, weekStart, shouldOverlayDatePicker, withoutApply, onSelectedFilterOptionChange, submitForm, customRangeHint, isGranularityEnabled = false, availableGranularities, accessibilityConfig, }) {
|
|
17
|
+
const selectedGranularity = selectedFilterOption.granularity ?? availableGranularities[0];
|
|
18
|
+
const showGranularityTabs = isGranularityEnabled && availableGranularities.length > 0;
|
|
12
19
|
const handleRangeChange = (range) => {
|
|
13
|
-
onSelectedFilterOptionChange(
|
|
20
|
+
onSelectedFilterOptionChange({
|
|
21
|
+
...selectedFilterOption,
|
|
22
|
+
...dateRangeToDateFilterValue(range, selectedFilterOption.localIdentifier, isTimeEnabled, selectedFilterOption.emptyValueHandling, isSecondsEnabled),
|
|
23
|
+
});
|
|
14
24
|
};
|
|
15
|
-
|
|
25
|
+
const handlePeriodRangeChange = (range) => {
|
|
26
|
+
onSelectedFilterOptionChange({
|
|
27
|
+
...selectedFilterOption,
|
|
28
|
+
...periodRangeToDateFilterValue({
|
|
29
|
+
range,
|
|
30
|
+
localIdentifier: selectedFilterOption.localIdentifier,
|
|
31
|
+
isTimeForAbsoluteRangeEnabled: isTimeEnabled,
|
|
32
|
+
emptyValueHandling: selectedFilterOption.emptyValueHandling,
|
|
33
|
+
isSecondsForAbsoluteRangeEnabled: isSecondsEnabled,
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const handleGranularityChange = (granularity) => {
|
|
38
|
+
onSelectedFilterOptionChange({
|
|
39
|
+
...selectedFilterOption,
|
|
40
|
+
...(selectedGranularity === granularity ? {} : { from: undefined, to: undefined }),
|
|
41
|
+
granularity,
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
// TODO MC-5322: time granularity is not supported in the new picker yet - the hour/minute/second can't be
|
|
45
|
+
// modified, so the selected range always spans the whole day (00:00-23:59[:59] once time is enabled).
|
|
46
|
+
// This will be added as part of MC-5322.
|
|
47
|
+
const picker = showGranularityTabs && isPeriodPickerGranularity(selectedGranularity) ? (_jsx(PeriodRangePicker, { granularity: selectedGranularity, range: { from: selectedFilterOption.from, to: selectedFilterOption.to }, onRangeChange: handlePeriodRangeChange, isMobile: isMobile, weekStart: weekStart, withoutApply: withoutApply, submitForm: submitForm }, selectedGranularity)) : (_jsx(DateRangePicker, { dateFormat: dateFormat, onRangeChange: handleRangeChange, range: dateFilterValueToDateRange(selectedFilterOption, isTimeEnabled, isSecondsEnabled), isMobile: isMobile, dayPickerProps: dayPickerProps, isTimeEnabled: isTimeEnabled, isSecondsEnabled: isSecondsEnabled, weekStart: weekStart, shouldOverlayDatePicker: shouldOverlayDatePicker, submitForm: submitForm, withoutApply: withoutApply, customRangeHint: customRangeHint }));
|
|
48
|
+
return (_jsxs(_Fragment, { children: [showGranularityTabs ? (_jsx(GranularityTabs, { availableGranularities: availableGranularities, selectedGranularity: selectedGranularity, onSelectedGranularityChange: handleGranularityChange, accessibilityConfig: { ariaControls: accessibilityConfig?.id }, className: "gd-absolute-filter-form-granularity-tabs s-absolute-filter-form-granularity-tabs", selectedTabId: DATE_FILTER_ABSOLUTE_GRANULARITY_TAB_ID })) : null, showGranularityTabs ? (_jsx("div", { id: accessibilityConfig?.id, role: "tabpanel", "aria-labelledby": DATE_FILTER_ABSOLUTE_GRANULARITY_TAB_ID, children: picker })) : (picker)] }));
|
|
16
49
|
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { type EmptyValues } from "@gooddata/sdk-model";
|
|
2
2
|
import { type IDateRange } from "../DateRangePicker/types.js";
|
|
3
3
|
import { type IUiAbsoluteDateFilterForm } from "../interfaces/index.js";
|
|
4
|
-
|
|
4
|
+
import { type IPeriodRange } from "../PeriodRangePicker/types.js";
|
|
5
|
+
export declare const dateRangeToDateFilterValue: (range: IDateRange, localIdentifier: string, isTimeForAbsoluteRangeEnabled: boolean, emptyValueHandling?: EmptyValues, isSecondsForAbsoluteRangeEnabled?: boolean) => IUiAbsoluteDateFilterForm;
|
|
5
6
|
export declare const dateFilterValueToDateRange: (value: IUiAbsoluteDateFilterForm, isTimeForAbsoluteRangeEnabled?: boolean, isSecondsForAbsoluteRangeEnabled?: boolean) => IDateRange;
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export interface IPeriodRangeToDateFilterValueOptions {
|
|
11
|
+
range: IPeriodRange;
|
|
12
|
+
localIdentifier: string;
|
|
13
|
+
isTimeForAbsoluteRangeEnabled: boolean;
|
|
14
|
+
emptyValueHandling?: EmptyValues;
|
|
15
|
+
isSecondsForAbsoluteRangeEnabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Converts a resolved period-picker range into an absolute date filter value, extending it to the
|
|
19
|
+
* start/end of day when time-of-day is enabled.
|
|
20
|
+
*/
|
|
21
|
+
export declare const periodRangeToDateFilterValue: ({ range, localIdentifier, isTimeForAbsoluteRangeEnabled, emptyValueHandling, isSecondsForAbsoluteRangeEnabled, }: IPeriodRangeToDateFilterValueOptions) => IUiAbsoluteDateFilterForm;
|
|
6
22
|
//# sourceMappingURL=conversions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/AbsoluteDateFilterForm/conversions.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/AbsoluteDateFilterForm/conversions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAWxE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAMlE,eAAO,MAAM,0BAA0B,UAC5B,UAAU,mBACA,MAAM,iCACQ,OAAO,uBACjB,WAAW,iDAEjC,yBAeF,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAC5B,yBAAyB,0FAGjC,UAmBF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACjD,KAAK,EAAE,YAAY,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,6BAA6B,EAAE,OAAO,CAAC;IACvC,kBAAkB,CAAC,EAAE,WAAW,CAAC;IACjC,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC9C;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,qHAMtC,oCAAoC,KAAG,yBAmBzC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// (C) 2007-2026 GoodData Corporation
|
|
2
|
-
import { platformDateFormat, platformDateTimeFormat, platformDateTimeFormatWithSeconds, } from "../constants/Platform.js";
|
|
2
|
+
import { DAY_END_TIME, DAY_END_TIME_WITH_SECONDS, DAY_START_TIME, DAY_START_TIME_WITH_SECONDS, platformDateFormat, platformDateTimeFormat, platformDateTimeFormatWithSeconds, } from "../constants/Platform.js";
|
|
3
3
|
import { convertDateToPlatformDateString, convertPlatformDateStringToDate, } from "../utils/DateConversions.js";
|
|
4
4
|
export const dateRangeToDateFilterValue = (range, localIdentifier, isTimeForAbsoluteRangeEnabled, emptyValueHandling, isSecondsForAbsoluteRangeEnabled = false) => {
|
|
5
5
|
const timeFormat = isSecondsForAbsoluteRangeEnabled
|
|
@@ -33,3 +33,19 @@ export const dateFilterValueToDateRange = (value, isTimeForAbsoluteRangeEnabled
|
|
|
33
33
|
}
|
|
34
34
|
return { from, to };
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* Converts a resolved period-picker range into an absolute date filter value, extending it to the
|
|
38
|
+
* start/end of day when time-of-day is enabled.
|
|
39
|
+
*/
|
|
40
|
+
export const periodRangeToDateFilterValue = ({ range, localIdentifier, isTimeForAbsoluteRangeEnabled, emptyValueHandling, isSecondsForAbsoluteRangeEnabled = false, }) => {
|
|
41
|
+
const withDayBoundaryTime = (date, time) => isTimeForAbsoluteRangeEnabled && date ? `${date} ${time}` : date;
|
|
42
|
+
return {
|
|
43
|
+
from: withDayBoundaryTime(range.from, isSecondsForAbsoluteRangeEnabled ? DAY_START_TIME_WITH_SECONDS : DAY_START_TIME),
|
|
44
|
+
to: withDayBoundaryTime(range.to, isSecondsForAbsoluteRangeEnabled ? DAY_END_TIME_WITH_SECONDS : DAY_END_TIME),
|
|
45
|
+
localIdentifier,
|
|
46
|
+
type: "absoluteForm",
|
|
47
|
+
name: "",
|
|
48
|
+
visible: true,
|
|
49
|
+
...(emptyValueHandling ? { emptyValueHandling } : {}),
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -18,15 +18,11 @@ function CheckboxItem({ checked, onChange, disabled, label, tooltip, testId, cla
|
|
|
18
18
|
onChange(!checked);
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
return (_jsxs(BubbleHoverTrigger, { children: [
|
|
22
|
-
_jsxs("label", { className: cx("input-checkbox-label", className, { "is-disabled": disabled }), children: [
|
|
23
|
-
_jsx("input", { type: "checkbox", className: "input-checkbox", checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled, onKeyDown: handleKeyDown, ...(testId ? { "data-testid": testId } : {}) }),
|
|
24
|
-
"\u2002", label] }), disabled && tooltip ? _jsx(Bubble, { alignPoints: alignPoints, children: tooltip }) : null] }));
|
|
21
|
+
return (_jsxs(BubbleHoverTrigger, { children: [_jsxs("label", { className: cx("input-checkbox-label", className, { "is-disabled": disabled }), children: [_jsx("input", { type: "checkbox", className: "input-checkbox", checked: checked, onChange: (e) => onChange(e.target.checked), disabled: disabled, onKeyDown: handleKeyDown, ...(testId ? { "data-testid": testId } : {}) }), "\u2002", label] }), disabled && tooltip ? _jsx(Bubble, { alignPoints: alignPoints, children: tooltip }) : null] }));
|
|
25
22
|
}
|
|
26
23
|
export function CheckboxSection({ className, visible = true, showDivider = false, emptyValuesHandling, excludeCurrentPeriod, }) {
|
|
27
24
|
if (!visible || (!emptyValuesHandling && !excludeCurrentPeriod)) {
|
|
28
25
|
return null;
|
|
29
26
|
}
|
|
30
|
-
return (_jsxs(_Fragment, { children: [showDivider ? _jsx("div", { className: "gd-date-filter-menu-divider" }) : null, _jsxs("div", { className: cx("gd-extended-date-filter-exclude-current", "gd-date-filter-checkbox-section", className), children: [emptyValuesHandling ? (_jsx("div", { className: "gd-date-filter-checkbox-section-item", children: _jsx(CheckboxItem, { checked: emptyValuesHandling.checked, onChange: emptyValuesHandling.onChange, label: _jsx(FormattedMessage, { id: EMPTY_VALUES_LABEL_ID_BY_MODE[emptyValuesHandling.mode], children: (...children) => _jsx("span", { className: "input-label-text", children: children }) }), testId: emptyValuesHandling.testId }) })) : null, excludeCurrentPeriod ? (_jsx("div", { className: "gd-date-filter-checkbox-section-item", children: _jsx(CheckboxItem, { checked: excludeCurrentPeriod.value, onChange: excludeCurrentPeriod.onChange, disabled: excludeCurrentPeriod.disabled, className: "s-exclude-current-period", label: _jsx(ExcludeCurrentPeriodToggleLabel, { granularity: excludeCurrentPeriod.granularity, disabled: excludeCurrentPeriod.disabled }), tooltip: excludeCurrentPeriod.disabled ? (_jsx(FormattedMessage, { id: "filters.excludeCurrentPeriod.unavailable" })) : null, testId: excludeCurrentPeriod.testId }) })) : null] })
|
|
31
|
-
] }));
|
|
27
|
+
return (_jsxs(_Fragment, { children: [showDivider ? _jsx("div", { className: "gd-date-filter-menu-divider" }) : null, _jsxs("div", { className: cx("gd-extended-date-filter-exclude-current", "gd-date-filter-checkbox-section", className), children: [emptyValuesHandling ? (_jsx("div", { className: "gd-date-filter-checkbox-section-item", children: _jsx(CheckboxItem, { checked: emptyValuesHandling.checked, onChange: emptyValuesHandling.onChange, label: _jsx(FormattedMessage, { id: EMPTY_VALUES_LABEL_ID_BY_MODE[emptyValuesHandling.mode], children: (...children) => _jsx("span", { className: "input-label-text", children: children }) }), testId: emptyValuesHandling.testId }) })) : null, excludeCurrentPeriod ? (_jsx("div", { className: "gd-date-filter-checkbox-section-item", children: _jsx(CheckboxItem, { checked: excludeCurrentPeriod.value, onChange: excludeCurrentPeriod.onChange, disabled: excludeCurrentPeriod.disabled, className: "s-exclude-current-period", label: _jsx(ExcludeCurrentPeriodToggleLabel, { granularity: excludeCurrentPeriod.granularity, disabled: excludeCurrentPeriod.disabled }), tooltip: excludeCurrentPeriod.disabled ? (_jsx(FormattedMessage, { id: "filters.excludeCurrentPeriod.unavailable" })) : null, testId: excludeCurrentPeriod.testId }) })) : null] })] }));
|
|
32
28
|
}
|
|
@@ -35,6 +35,16 @@ export interface IDateFilterOwnProps extends IDateFilterStatePropsIntersection {
|
|
|
35
35
|
* @defaultValue false
|
|
36
36
|
*/
|
|
37
37
|
isSecondsForAbsoluteRangeEnabled?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Enables Day/Week/Month/Quarter/Year granularity switching for the absolute (static) date filter.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Defaults to `false` to keep backward compatibility. Dashboard apps should control this
|
|
43
|
+
* via a feature flag and explicitly opt-in.
|
|
44
|
+
*
|
|
45
|
+
* @alpha
|
|
46
|
+
*/
|
|
47
|
+
isAbsoluteDateFilterGranularityEnabled?: boolean;
|
|
38
48
|
showDropDownHeaderMessage?: boolean;
|
|
39
49
|
weekStart?: WeekStart;
|
|
40
50
|
/**
|
|
@@ -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;AAIf,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGlG,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,EAEhC,MAAM,uBAAuB,CAAC;AAK/B;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAC9C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,gBAAgB,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iCAAiC;IAC1E,aAAa,EAAE,wBAAwB,CAAC;IACxC,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;OAKG;IACH,gCAAgC,CAAC,EAAE,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;AAIf,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAIjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAGlG,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,EAEhC,MAAM,uBAAuB,CAAC;AAK/B;;;;GAIG;AACH,MAAM,WAAW,iCAAiC;IAC9C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,oBAAoB,EAAE,gBAAgB,CAAC;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,iCAAiC;IAC1E,aAAa,EAAE,wBAAwB,CAAC;IACxC,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC;;;;;OAKG;IACH,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAE3C;;;;;;;;OAQG;IACH,sCAAsC,CAAC,EAAE,OAAO,CAAC;IACjD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;;;OAIG;IACH,UAAU,CAAC,EAAE,uBAAuB,CAAC;IAErC;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IAExE;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,gBAAgB,CAAC;IAE/C;;;;;;OAMG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC;;;;OAIG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAExD;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAE1C;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;;;;;;OAaG;IACH,eAAe,CAAC,EAAE,gBAAgB,CAAC;IAEnC;;;;;;;;;;OAUG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,OAAO,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,OAAO,KAAK,IAAI,CAAC;IACrF,QAAQ,CAAC,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,OAAO,KAAK,IAAI,CAAC;IACvF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB,EAAE,wBAAwB;CAAG;AAE1F;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,iCAAiC;IACvE,wBAAwB,EAAE,OAAO,CAAC;IAClC,wBAAwB,EAAE,gBAAgB,CAAC;IAC3C,+BAA+B,EAAE,OAAO,CAAC;IACzC,+BAA+B,EAAE,gBAAgB,CAAC;IAClD,6BAA6B,EAAE,OAAO,CAAC;CAC1C;AAwGD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,oBAAoB,CAAC,gBAAgB,CAiQ5D,CAAC"}
|
|
@@ -90,7 +90,7 @@ function isSameOptionExceptEmptyValueHandling(a, b) {
|
|
|
90
90
|
* @public
|
|
91
91
|
*/
|
|
92
92
|
export const DateFilter = memo(function DateFilter(props) {
|
|
93
|
-
const { customFilterName, dateFilterMode, dateFormat = DEFAULT_DATE_FORMAT, filterOptions, selectedFilterOption: originalSelectedFilterOption, excludeCurrentPeriod: originalExcludeCurrentPeriod, availableGranularities, isEditMode = false, openOnInit, locale = "en-US", isTimeForAbsoluteRangeEnabled = false, isSecondsForAbsoluteRangeEnabled = false, weekStart = "Sunday", customIcon, showDropDownHeaderMessage, FilterConfigurationComponent, withoutApply = false, ButtonComponent, overlayPositionType, activeCalendars, enableEmptyDateValues, customRangeHint, hideDisabledExclude = false, onApply, onSelect, onCancel = () => { }, onOpen = () => { }, onClose = () => { }, } = props;
|
|
93
|
+
const { customFilterName, dateFilterMode, dateFormat = DEFAULT_DATE_FORMAT, filterOptions, selectedFilterOption: originalSelectedFilterOption, excludeCurrentPeriod: originalExcludeCurrentPeriod, availableGranularities, isEditMode = false, openOnInit, locale = "en-US", isTimeForAbsoluteRangeEnabled = false, isSecondsForAbsoluteRangeEnabled = false, isAbsoluteDateFilterGranularityEnabled = false, weekStart = "Sunday", customIcon, showDropDownHeaderMessage, FilterConfigurationComponent, withoutApply = false, ButtonComponent, overlayPositionType, activeCalendars, enableEmptyDateValues, customRangeHint, hideDisabledExclude = false, onApply, onSelect, onCancel = () => { }, onOpen = () => { }, onClose = () => { }, } = props;
|
|
94
94
|
const [storedState, setStoredState] = useState(() => getStateFromProps(props));
|
|
95
95
|
// The class component read `this.state` at call time, so a handler invoked later than the
|
|
96
96
|
// render that produced it still saw the current state. Handlers of a function component
|
|
@@ -238,5 +238,5 @@ export const DateFilter = memo(function DateFilter(props) {
|
|
|
238
238
|
});
|
|
239
239
|
};
|
|
240
240
|
const { excludeCurrentPeriod, selectedFilterOption, isExcludeCurrentPeriodEnabled } = state;
|
|
241
|
-
return dateFilterMode === "hidden" ? null : (_jsx(DateFilterCore, { availableGranularities: availableGranularities, customFilterName: customFilterName, dateFormat: dateFormat ?? DEFAULT_DATE_FORMAT, openOnInit: openOnInit, showDropDownHeaderMessage: showDropDownHeaderMessage, disabled: dateFilterMode === "readonly", excludeCurrentPeriod: excludeCurrentPeriod, originalExcludeCurrentPeriod: originalExcludeCurrentPeriod, isExcludeCurrentPeriodEnabled: isExcludeCurrentPeriodEnabled, hideDisabledExclude: hideDisabledExclude, isTimeForAbsoluteRangeEnabled: isTimeForAbsoluteRangeEnabled ?? false, isSecondsForAbsoluteRangeEnabled: isSecondsForAbsoluteRangeEnabled ?? false, isEditMode: isEditMode ?? false, filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, originalSelectedFilterOption: originalSelectedFilterOption, locale: locale, onApplyClick: handleApplyClick, onCancelClick: onCancelClicked, onDropdownOpenChanged: onDropdownOpenChanged, onExcludeCurrentPeriodChange: handleExcludeCurrentPeriodChange, onSelectedFilterOptionChange: handleSelectedFilterOptionChange, errors: validateFilterOption(selectedFilterOption), weekStart: weekStart, customIcon: customIcon, FilterConfigurationComponent: FilterConfigurationComponent, withoutApply: withoutApply, ButtonComponent: ButtonComponent, overlayPositionType: overlayPositionType, activeCalendars: activeCalendars, enableEmptyDateValues: enableEmptyDateValues, customRangeHint: customRangeHint }));
|
|
241
|
+
return dateFilterMode === "hidden" ? null : (_jsx(DateFilterCore, { availableGranularities: availableGranularities, customFilterName: customFilterName, dateFormat: dateFormat ?? DEFAULT_DATE_FORMAT, openOnInit: openOnInit, showDropDownHeaderMessage: showDropDownHeaderMessage, disabled: dateFilterMode === "readonly", excludeCurrentPeriod: excludeCurrentPeriod, originalExcludeCurrentPeriod: originalExcludeCurrentPeriod, isExcludeCurrentPeriodEnabled: isExcludeCurrentPeriodEnabled, hideDisabledExclude: hideDisabledExclude, isTimeForAbsoluteRangeEnabled: isTimeForAbsoluteRangeEnabled ?? false, isSecondsForAbsoluteRangeEnabled: isSecondsForAbsoluteRangeEnabled ?? false, isAbsoluteDateFilterGranularityEnabled: isAbsoluteDateFilterGranularityEnabled ?? false, isEditMode: isEditMode ?? false, filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, originalSelectedFilterOption: originalSelectedFilterOption, locale: locale, onApplyClick: handleApplyClick, onCancelClick: onCancelClicked, onDropdownOpenChanged: onDropdownOpenChanged, onExcludeCurrentPeriodChange: handleExcludeCurrentPeriodChange, onSelectedFilterOptionChange: handleSelectedFilterOptionChange, errors: validateFilterOption(selectedFilterOption), weekStart: weekStart, customIcon: customIcon, FilterConfigurationComponent: FilterConfigurationComponent, withoutApply: withoutApply, ButtonComponent: ButtonComponent, overlayPositionType: overlayPositionType, activeCalendars: activeCalendars, enableEmptyDateValues: enableEmptyDateValues, customRangeHint: customRangeHint }));
|
|
242
242
|
});
|
|
@@ -12,6 +12,7 @@ export interface IDateFilterBodyProps {
|
|
|
12
12
|
onExcludeCurrentPeriodChange: (isExcluded: boolean) => void;
|
|
13
13
|
isTimeForAbsoluteRangeEnabled: boolean;
|
|
14
14
|
isSecondsForAbsoluteRangeEnabled?: boolean;
|
|
15
|
+
isAbsoluteDateFilterGranularityEnabled: boolean;
|
|
15
16
|
availableGranularities: DateFilterGranularity[];
|
|
16
17
|
isEditMode: boolean;
|
|
17
18
|
isMobile: boolean;
|
|
@@ -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,
|
|
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;AAMf,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAI7B,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,iHAoczB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2007-2026 GoodData Corporation
|
|
3
|
-
import { forwardRef, useEffect, useRef, useState, } from "react";
|
|
3
|
+
import { forwardRef, useEffect, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { isEmpty } from "lodash-es";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
@@ -8,7 +8,7 @@ import { isAbsoluteDateFilterForm, isAllTimeDateFilterOption, isEmptyValuesDateF
|
|
|
8
8
|
import { useIdPrefixed } from "@gooddata/sdk-ui-kit";
|
|
9
9
|
import { CheckboxSection } from "../CheckboxSection/CheckboxSection.js";
|
|
10
10
|
import { getDateFilterOptionGranularity } from "../utils/OptionUtils.js";
|
|
11
|
-
import { ensureCompatibleGranularity, getDefaultCalendarTab, getFilteredGranularities, getFilteredPresets, getFiscalTabsConfig, } from "../utils/presetFilterUtils.js";
|
|
11
|
+
import { ensureCompatibleAbsoluteGranularity, ensureCompatibleGranularity, filterStandardGranularities, getDefaultCalendarTab, getFilteredGranularities, getFilteredPresets, getFiscalTabsConfig, } from "../utils/presetFilterUtils.js";
|
|
12
12
|
import { VisibleScrollbar } from "../VisibleScrollbar/VisibleScrollbar.js";
|
|
13
13
|
import { DateFilterBodyButton } from "./DateFilterBodyButton.js";
|
|
14
14
|
import { DateFilterBodyContentFiltered } from "./DateFilterBodyContentFiltered.js";
|
|
@@ -36,16 +36,31 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
36
36
|
const [selectedTab, setSelectedTab] = useState(() => getDefaultCalendarTab(props.activeCalendars, props.selectedFilterOption));
|
|
37
37
|
const filteredRelativePreset = getFilteredPresets(props.filterOptions.relativePreset, fiscalTabsConfig, selectedTab);
|
|
38
38
|
const filteredAvailableGranularities = getFilteredGranularities(props.availableGranularities, fiscalTabsConfig, selectedTab);
|
|
39
|
+
// Absolute form granularities are standard-calendar-only, so they're filtered independently of
|
|
40
|
+
// the fiscal/standard tab state.
|
|
41
|
+
const filteredAbsoluteAvailableGranularities = useMemo(() => props.isAbsoluteDateFilterGranularityEnabled
|
|
42
|
+
? filterStandardGranularities(props.filterOptions.absoluteForm?.availableGranularities ?? [])
|
|
43
|
+
: [], [
|
|
44
|
+
props.isAbsoluteDateFilterGranularityEnabled,
|
|
45
|
+
props.filterOptions.absoluteForm?.availableGranularities,
|
|
46
|
+
]);
|
|
39
47
|
const changeRoute = (newRoute = null) => {
|
|
40
48
|
setRoute(newRoute);
|
|
41
49
|
};
|
|
42
50
|
const handleStaticButtonClick = () => {
|
|
43
51
|
const newForm = route === "absoluteForm" ? null : "absoluteForm";
|
|
44
52
|
setRoute(newForm);
|
|
45
|
-
if (newForm === "absoluteForm" &&
|
|
46
|
-
filterOptions.absoluteForm
|
|
47
|
-
|
|
48
|
-
|
|
53
|
+
if (newForm === "absoluteForm" && filterOptions.absoluteForm) {
|
|
54
|
+
const baseOption = selectedFilterOption.localIdentifier === filterOptions.absoluteForm.localIdentifier
|
|
55
|
+
? selectedFilterOption
|
|
56
|
+
: filterOptions.absoluteForm;
|
|
57
|
+
const correctedOption = ensureCompatibleAbsoluteGranularity(baseOption, filteredAbsoluteAvailableGranularities);
|
|
58
|
+
if (correctedOption !== baseOption) {
|
|
59
|
+
onSelectedFilterOptionChange(correctedOption);
|
|
60
|
+
}
|
|
61
|
+
else if (selectedFilterOption.localIdentifier !== filterOptions.absoluteForm.localIdentifier) {
|
|
62
|
+
onSelectedFilterOptionChange(filterOptions.absoluteForm);
|
|
63
|
+
}
|
|
49
64
|
}
|
|
50
65
|
};
|
|
51
66
|
const handleRelativeButtonClick = () => {
|
|
@@ -82,21 +97,6 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
82
97
|
}
|
|
83
98
|
}, 0);
|
|
84
99
|
};
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
// Sync route from selected option only once after mount on mobile.
|
|
87
|
-
// Without this guard, later option updates (e.g. checkbox toggles that keep the same form type)
|
|
88
|
-
// would unexpectedly reopen the form after the user navigated back to the list.
|
|
89
|
-
if (!props.isMobile || didSyncInitialMobileRoute.current) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
didSyncInitialMobileRoute.current = true;
|
|
93
|
-
if (isAbsoluteDateFilterForm(props.selectedFilterOption)) {
|
|
94
|
-
changeRoute("absoluteForm");
|
|
95
|
-
}
|
|
96
|
-
else if (isRelativeDateFilterForm(props.selectedFilterOption)) {
|
|
97
|
-
changeRoute("relativeForm");
|
|
98
|
-
}
|
|
99
|
-
}, [props.isMobile, props.selectedFilterOption]);
|
|
100
100
|
const calculateHeight = (showExcludeCurrent, showEmptyValuesHandling) => {
|
|
101
101
|
// Mobile in Horizontal Layout
|
|
102
102
|
if (window.innerHeight <= MOBILE_WIDTH) {
|
|
@@ -113,6 +113,31 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
113
113
|
return "gd-extended-date-filter-body-scrollable";
|
|
114
114
|
};
|
|
115
115
|
const { isExcludeCurrentPeriodEnabled, isMobile, dateFilterButton, errors, isConfigurationEnabled, withoutApply, selectedFilterOption, isEditMode, excludeCurrentPeriod, hideDisabledExclude, filterOptions, showHeaderMessage = true, dateFormat, isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled, weekStart = "Sunday", availableGranularities, onApplyClick, onCancelClick, closeDropdown, onConfigurationClick, onExcludeCurrentPeriodChange, onSelectedFilterOptionChange, ariaLabel, id, } = props;
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
// Sync route from selected option only once after mount on mobile.
|
|
118
|
+
// Without this guard, later option updates (e.g. checkbox toggles that keep the same form type)
|
|
119
|
+
// would unexpectedly reopen the form after the user navigated back to the list.
|
|
120
|
+
if (!isMobile || didSyncInitialMobileRoute.current) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
didSyncInitialMobileRoute.current = true;
|
|
124
|
+
if (isAbsoluteDateFilterForm(selectedFilterOption)) {
|
|
125
|
+
changeRoute("absoluteForm");
|
|
126
|
+
// Correct a stale/incompatible granularity before the absolute form renders with it.
|
|
127
|
+
const correctedOption = ensureCompatibleAbsoluteGranularity(selectedFilterOption, filteredAbsoluteAvailableGranularities);
|
|
128
|
+
if (correctedOption !== selectedFilterOption) {
|
|
129
|
+
onSelectedFilterOptionChange(correctedOption);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (isRelativeDateFilterForm(selectedFilterOption)) {
|
|
133
|
+
changeRoute("relativeForm");
|
|
134
|
+
}
|
|
135
|
+
}, [
|
|
136
|
+
isMobile,
|
|
137
|
+
selectedFilterOption,
|
|
138
|
+
onSelectedFilterOptionChange,
|
|
139
|
+
filteredAbsoluteAvailableGranularities,
|
|
140
|
+
]);
|
|
116
141
|
// Keep the same behavior as `DateFilterBody`:
|
|
117
142
|
// - hide disabled exclude toggle on mobile by default
|
|
118
143
|
// - allow callers to hide it on desktop via `hideDisabledExclude`
|
|
@@ -163,15 +188,14 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
163
188
|
return (_jsxs("div", { ref: rootRef, className: cx(!isMobile && "gd-extended-date-filter-body-redesigned", "gd-extended-date-filter-body", "s-extended-date-filters-body", isMobile && "gd-extended-date-filter-body-mobile", route && "gd-active-form"), onKeyDown: handleKeyDown, onFocus: handleFocus, role: "dialog", id: formId, "aria-label": formLabel, children: [route === null && isMobile ? (_jsx("div", { className: "gd-extended-date-filter-mobile-header", onClick: () => {
|
|
164
189
|
onCancelClick();
|
|
165
190
|
closeDropdown();
|
|
166
|
-
}, children: dateFilterButton })) : null, route ? (_jsx("div", { className: "gd-extended-date-filter-form-wrapper", ref: ref, children: _jsx(DateFilterFormContent, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, dateFormat: dateFormat, weekStart: weekStart, isTimeForAbsoluteRangeEnabled: isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled: isSecondsForAbsoluteRangeEnabled, availableGranularities: filteredAvailableGranularities, isMobile: isMobile, withoutApply: withoutApply, enableEmptyDateValues: props.enableEmptyDateValues, customRangeHint: props.customRangeHint, activeForm: route, onBackNavigation: handleBackNavigation, onClose: closeDropdown, submitForm: () => {
|
|
191
|
+
}, children: dateFilterButton })) : null, route ? (_jsx("div", { className: "gd-extended-date-filter-form-wrapper", ref: ref, children: _jsx(DateFilterFormContent, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, dateFormat: dateFormat, weekStart: weekStart, isTimeForAbsoluteRangeEnabled: isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled: isSecondsForAbsoluteRangeEnabled, isAbsoluteDateFilterGranularityEnabled: props.isAbsoluteDateFilterGranularityEnabled, availableGranularities: filteredAvailableGranularities, absoluteAvailableGranularities: filteredAbsoluteAvailableGranularities, isMobile: isMobile, withoutApply: withoutApply, enableEmptyDateValues: props.enableEmptyDateValues, customRangeHint: props.customRangeHint, activeForm: route, onBackNavigation: handleBackNavigation, onClose: closeDropdown, submitForm: () => {
|
|
167
192
|
onApplyClick();
|
|
168
193
|
if (!withoutApply) {
|
|
169
194
|
closeDropdown();
|
|
170
195
|
}
|
|
171
196
|
}, errors: errors || undefined }) })) : null, route ? null : (_jsxs("div", { ref: ref, className: cx("gd-extended-date-filter-body-wrapper", {
|
|
172
197
|
"gd-extended-date-filter-body-wrapper-wide": isRelativeDateFilterForm(selectedFilterOption),
|
|
173
|
-
}), style: wrapperStyle, children: [isEditMode && !isMobile && showHeaderMessage ? _jsx(EditModeMessage, {}) : null, isMobile ? (_jsx(DateFilterBodyContentFiltered, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, dateFormat: dateFormat, showTabs: fiscalTabsConfig.showTabs, selectedTab: selectedTab, onTabSelect: setSelectedTab, filteredRelativePreset: filteredRelativePreset, enableEmptyDateValues: props.enableEmptyDateValues })) : (_jsx(VisibleScrollbar, { className: visibleScrollbarClassName, style: scrollerStyle, children: _jsx(DateFilterBodyContentFiltered, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, dateFormat: dateFormat, showTabs: fiscalTabsConfig.showTabs, selectedTab: selectedTab, onTabSelect: setSelectedTab, filteredRelativePreset: filteredRelativePreset, enableEmptyDateValues: props.enableEmptyDateValues }) }))] })), hasFormOptions && !route ? (_jsxs(_Fragment, { children: [isMobile ? null : _jsx("div", { className: "gd-date-filter-menu-divider" }), _jsx(DateFilterCustomPeriodButtons, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, availableGranularities: availableGranularities, onStaticButtonClick: handleStaticButtonClick, onRelativeButtonClick: handleRelativeButtonClick, absoluteButtonRef: absoluteButtonRef, relativeButtonRef: relativeButtonRef, absoluteFormId: absoluteFormId, relativeFormId: relativeFormId })
|
|
174
|
-
] })) : null, _jsx(CheckboxSection, { visible: !route, showDivider: true, emptyValuesHandling: shouldRenderEmptyValuesHandling
|
|
198
|
+
}), style: wrapperStyle, children: [isEditMode && !isMobile && showHeaderMessage ? _jsx(EditModeMessage, {}) : null, isMobile ? (_jsx(DateFilterBodyContentFiltered, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, dateFormat: dateFormat, showTabs: fiscalTabsConfig.showTabs, selectedTab: selectedTab, onTabSelect: setSelectedTab, filteredRelativePreset: filteredRelativePreset, enableEmptyDateValues: props.enableEmptyDateValues })) : (_jsx(VisibleScrollbar, { className: visibleScrollbarClassName, style: scrollerStyle, children: _jsx(DateFilterBodyContentFiltered, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, dateFormat: dateFormat, showTabs: fiscalTabsConfig.showTabs, selectedTab: selectedTab, onTabSelect: setSelectedTab, filteredRelativePreset: filteredRelativePreset, enableEmptyDateValues: props.enableEmptyDateValues }) }))] })), hasFormOptions && !route ? (_jsxs(_Fragment, { children: [isMobile ? null : _jsx("div", { className: "gd-date-filter-menu-divider" }), _jsx(DateFilterCustomPeriodButtons, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, availableGranularities: availableGranularities, onStaticButtonClick: handleStaticButtonClick, onRelativeButtonClick: handleRelativeButtonClick, absoluteButtonRef: absoluteButtonRef, relativeButtonRef: relativeButtonRef, absoluteFormId: absoluteFormId, relativeFormId: relativeFormId })] })) : null, _jsx(CheckboxSection, { visible: !route, showDivider: true, emptyValuesHandling: shouldRenderEmptyValuesHandling
|
|
175
199
|
? {
|
|
176
200
|
mode: emptyValuesToggleMode,
|
|
177
201
|
checked: emptyValuesToggleChecked,
|
|
@@ -197,16 +221,12 @@ export const DateFilterBody = forwardRef((props, ref) => {
|
|
|
197
221
|
disabled: !isExcludeCurrentPeriodEnabled,
|
|
198
222
|
granularity: getDateFilterOptionGranularity(selectedFilterOption),
|
|
199
223
|
}
|
|
200
|
-
: undefined }), _jsxs("div", { role: "group", className: cx("gd-extended-date-filter-actions"), children: [
|
|
201
|
-
_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: [
|
|
202
|
-
_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: () => {
|
|
224
|
+
: 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: () => {
|
|
203
225
|
onCancelClick();
|
|
204
226
|
closeDropdown();
|
|
205
227
|
} }), !withoutApply && (_jsx(DateFilterBodyButton, { messageId: "apply", className: cx("gd-button-action", isMobile ? "gd-button-medium" : "gd-button-small", "s-date-filter-apply"), disabled: !isEmpty(errors), onClick: () => {
|
|
206
228
|
onApplyClick();
|
|
207
229
|
closeDropdown();
|
|
208
|
-
}, describedByFromValidation: true }))] })
|
|
209
|
-
] })
|
|
210
|
-
] }));
|
|
230
|
+
}, describedByFromValidation: true }))] })] })] }));
|
|
211
231
|
});
|
|
212
232
|
DateFilterBody.displayName = "DateFilterBody";
|
|
@@ -30,8 +30,6 @@ export function DateFilterBodyContentFiltered({ filterOptions, selectedFilterOpt
|
|
|
30
30
|
selectedId === filterOptions.emptyValues?.localIdentifier ||
|
|
31
31
|
filterOptions.absolutePreset?.some((p) => p.localIdentifier === selectedId) ||
|
|
32
32
|
Object.values(filteredRelativePreset ?? {}).some((items) => items?.some((p) => p.localIdentifier === selectedId));
|
|
33
|
-
const listContent = (_jsxs(_Fragment, { children: [
|
|
34
|
-
_jsx(AllTimeFilterSection, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, isFocusFallback: !isSelectedInVisibleList }), filterOptions.absolutePreset && filterOptions.absolutePreset.length > 0 ? (_jsx(AbsolutePresetFilterItems, { dateFormat: dateFormat, filterOptions: filterOptions.absolutePreset, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, className: isMobile ? ITEM_CLASS_MOBILE : undefined })) : null, filteredRelativePreset ? (_jsx(RelativePresetFilterItems, { dateFormat: dateFormat, filterOption: filteredRelativePreset, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, className: isMobile ? ITEM_CLASS_MOBILE : undefined })) : null, _jsx(OtherPresetsSection, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, enableEmptyDateValues: enableEmptyDateValues ?? false })
|
|
35
|
-
] }));
|
|
33
|
+
const listContent = (_jsxs(_Fragment, { children: [_jsx(AllTimeFilterSection, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, isFocusFallback: !isSelectedInVisibleList }), filterOptions.absolutePreset && filterOptions.absolutePreset.length > 0 ? (_jsx(AbsolutePresetFilterItems, { dateFormat: dateFormat, filterOptions: filterOptions.absolutePreset, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, className: isMobile ? ITEM_CLASS_MOBILE : undefined })) : null, filteredRelativePreset ? (_jsx(RelativePresetFilterItems, { dateFormat: dateFormat, filterOption: filteredRelativePreset, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, className: isMobile ? ITEM_CLASS_MOBILE : undefined })) : null, _jsx(OtherPresetsSection, { filterOptions: filterOptions, selectedFilterOption: selectedFilterOption, onSelectedFilterOptionChange: onSelectedFilterOptionChange, isMobile: isMobile, enableEmptyDateValues: enableEmptyDateValues ?? false })] }));
|
|
36
34
|
return (_jsxs(_Fragment, { children: [showTabs ? (_jsx(CalendarTypeTabs, { selectedTab: selectedTab, onTabSelect: onTabSelect, isMobile: isMobile, tabIds: tabIds, panelId: panelId })) : null, showTabs ? (_jsx("div", { role: "tabpanel", id: panelId, "aria-labelledby": activeTabId, children: _jsx("div", { role: "listbox", "aria-label": listboxLabel, children: listContent }) })) : (_jsx("div", { role: "listbox", "aria-label": listboxLabel, children: listContent }))] }));
|
|
37
35
|
}
|
|
@@ -7,7 +7,5 @@ const ALIGN_POINTS = [{ align: "bc tc", offset: { x: -1, y: 5 } }];
|
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
9
|
export function DateFilterConfigurationButton({ onConfiguration }) {
|
|
10
|
-
return (_jsx("div", { className: "gd-date-filter-configuration-button s-gd-date-filter-configuration-button", children: _jsxs(BubbleHoverTrigger, { children: [
|
|
11
|
-
_jsx(Button, { className: "gd-button-link gd-button-icon-only gd-icon-settings gd-button-small gd-configuration-button s-configuration-button", disabled: false, onClick: onConfiguration }), _jsx(Bubble, { className: `bubble-primary`, alignPoints: ALIGN_POINTS, children: _jsx(FormattedMessage, { id: "dateFilterDropdown.configuration" }) })
|
|
12
|
-
] }) }));
|
|
10
|
+
return (_jsx("div", { className: "gd-date-filter-configuration-button s-gd-date-filter-configuration-button", children: _jsxs(BubbleHoverTrigger, { children: [_jsx(Button, { className: "gd-button-link gd-button-icon-only gd-icon-settings gd-button-small gd-configuration-button s-configuration-button", disabled: false, onClick: onConfiguration }), _jsx(Bubble, { className: `bubble-primary`, alignPoints: ALIGN_POINTS, children: _jsx(FormattedMessage, { id: "dateFilterDropdown.configuration" }) })] }) }));
|
|
13
11
|
}
|
|
@@ -10,7 +10,9 @@ export interface IDateFilterFormContentProps {
|
|
|
10
10
|
weekStart: WeekStart;
|
|
11
11
|
isTimeForAbsoluteRangeEnabled: boolean;
|
|
12
12
|
isSecondsForAbsoluteRangeEnabled?: boolean;
|
|
13
|
+
isAbsoluteDateFilterGranularityEnabled: boolean;
|
|
13
14
|
availableGranularities: DateFilterGranularity[];
|
|
15
|
+
absoluteAvailableGranularities: DateFilterGranularity[];
|
|
14
16
|
isMobile: boolean;
|
|
15
17
|
withoutApply?: boolean;
|
|
16
18
|
enableEmptyDateValues?: boolean;
|
|
@@ -27,5 +29,5 @@ export interface IDateFilterFormContentProps {
|
|
|
27
29
|
*
|
|
28
30
|
* @internal
|
|
29
31
|
*/
|
|
30
|
-
export declare function DateFilterFormContent({ filterOptions, selectedFilterOption, onSelectedFilterOptionChange, dateFormat, weekStart, isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled, availableGranularities, isMobile, withoutApply, enableEmptyDateValues, customRangeHint, activeForm, onBackNavigation, onClose, submitForm, errors }: IDateFilterFormContentProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function DateFilterFormContent({ filterOptions, selectedFilterOption, onSelectedFilterOptionChange, dateFormat, weekStart, isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled, isAbsoluteDateFilterGranularityEnabled, availableGranularities, absoluteAvailableGranularities, isMobile, withoutApply, enableEmptyDateValues, customRangeHint, activeForm, onBackNavigation, onClose, submitForm, errors }: IDateFilterFormContentProps): import("react/jsx-runtime").JSX.Element;
|
|
31
33
|
//# sourceMappingURL=DateFilterFormContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateFilterFormContent.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterFormContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAKhF,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAGjC,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,2BAA2B;IACxC,aAAa,EAAE,wBAAwB,CAAC;IACxC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,4BAA4B,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEjE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,6BAA6B,EAAE,OAAO,CAAC;IACvC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"DateFilterFormContent.d.ts","sourceRoot":"","sources":["../../../src/DateFilter/DateFilterBody/DateFilterFormContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAKhF,OAAO,EACH,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAKjB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAGjC,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,MAAM,WAAW,2BAA2B;IACxC,aAAa,EAAE,wBAAwB,CAAC;IACxC,oBAAoB,EAAE,gBAAgB,CAAC;IACvC,4BAA4B,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAEjE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,6BAA6B,EAAE,OAAO,CAAC;IACvC,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,sCAAsC,EAAE,OAAO,CAAC;IAChD,sBAAsB,EAAE,qBAAqB,EAAE,CAAC;IAChD,8BAA8B,EAAE,qBAAqB,EAAE,CAAC;IAExD,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,eAAe,CAAC,EAAE,SAAS,CAAC;IAE5B,UAAU,EAAE,eAAe,CAAC;IAC5B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACtC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,aAAa,EACb,oBAAoB,EACpB,4BAA4B,EAC5B,UAAU,EACV,SAAS,EACT,6BAA6B,EAC7B,gCAAgC,EAChC,sCAAsC,EACtC,sBAAsB,EACtB,8BAA8B,EAC9B,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,MAAM,EACT,EAAE,2BAA2B,2CA+I7B"}
|
|
@@ -17,7 +17,7 @@ import { DateFilterFormNavigationWrapper } from "./DateFilterFormNavigationWrapp
|
|
|
17
17
|
*
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
export function DateFilterFormContent({ filterOptions, selectedFilterOption, onSelectedFilterOptionChange, dateFormat, weekStart, isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled, availableGranularities, isMobile, withoutApply, enableEmptyDateValues, customRangeHint, activeForm, onBackNavigation, onClose, submitForm, errors, }) {
|
|
20
|
+
export function DateFilterFormContent({ filterOptions, selectedFilterOption, onSelectedFilterOptionChange, dateFormat, weekStart, isTimeForAbsoluteRangeEnabled, isSecondsForAbsoluteRangeEnabled, isAbsoluteDateFilterGranularityEnabled, availableGranularities, absoluteAvailableGranularities, isMobile, withoutApply, enableEmptyDateValues, customRangeHint, activeForm, onBackNavigation, onClose, submitForm, errors, }) {
|
|
21
21
|
const showStaticForm = activeForm === "absoluteForm" && filterOptions.absoluteForm;
|
|
22
22
|
const showRelativeForm = activeForm === "relativeForm" && filterOptions.relativeForm && availableGranularities.length > 0;
|
|
23
23
|
const absoluteSelectedFilterOption = filterOptions.absoluteForm && isAbsoluteDateFilterForm(selectedFilterOption)
|
|
@@ -30,6 +30,7 @@ export function DateFilterFormContent({ filterOptions, selectedFilterOption, onS
|
|
|
30
30
|
const relativeDateFilterRef = useRef(null);
|
|
31
31
|
const tabGranularityRef = useRef(null);
|
|
32
32
|
const relativeDateFilterId = useId();
|
|
33
|
+
const absoluteDateFilterId = useId();
|
|
33
34
|
const shouldRenderEmptyValuesHandling = !!enableEmptyDateValues &&
|
|
34
35
|
!isAllTimeDateFilterOption(selectedFilterOption) &&
|
|
35
36
|
!isEmptyValuesDateFilterOption(selectedFilterOption) &&
|
|
@@ -46,8 +47,7 @@ export function DateFilterFormContent({ filterOptions, selectedFilterOption, onS
|
|
|
46
47
|
}, [relativeDateFilterRef, tabGranularityRef]);
|
|
47
48
|
return (_jsxs("div", { className: "gd-date-filter-form-content", children: [showStaticForm ? (_jsx(DateFilterFormNavigationWrapper, { title: filterOptions.absoluteForm?.name
|
|
48
49
|
? filterOptions.absoluteForm.name
|
|
49
|
-
: intl.formatMessage({ id: "filters.staticPeriod" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsxs(DateFilterFormWrapper, { isMobile: isMobile, children: [
|
|
50
|
-
_jsx(AbsoluteDateFilterForm, { dateFormat: dateFormat, onSelectedFilterOptionChange: onSelectedFilterOptionChange, selectedFilterOption: absoluteSelectedFilterOption, isMobile: isMobile, isTimeEnabled: isTimeForAbsoluteRangeEnabled, isSecondsEnabled: isSecondsForAbsoluteRangeEnabled, weekStart: weekStart, submitForm: submitForm, withoutApply: withoutApply, customRangeHint: customRangeHint }), shouldRenderEmptyValuesHandling ? (_jsx(EmptyValuesHandlingToggle, { mode: "include", className: "gd-date-filter-empty-values-handling-toggle", checked: emptyValueHandlingToggleChecked, onChange: (checked) => {
|
|
50
|
+
: intl.formatMessage({ id: "filters.staticPeriod" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsxs(DateFilterFormWrapper, { isMobile: isMobile, children: [_jsx(AbsoluteDateFilterForm, { dateFormat: dateFormat, onSelectedFilterOptionChange: onSelectedFilterOptionChange, selectedFilterOption: absoluteSelectedFilterOption, isMobile: isMobile, isTimeEnabled: isTimeForAbsoluteRangeEnabled, isSecondsEnabled: isSecondsForAbsoluteRangeEnabled, isGranularityEnabled: isAbsoluteDateFilterGranularityEnabled, availableGranularities: absoluteAvailableGranularities, accessibilityConfig: { id: absoluteDateFilterId }, weekStart: weekStart, submitForm: submitForm, withoutApply: withoutApply, customRangeHint: customRangeHint }), shouldRenderEmptyValuesHandling ? (_jsx(EmptyValuesHandlingToggle, { mode: "include", className: "gd-date-filter-empty-values-handling-toggle", checked: emptyValueHandlingToggleChecked, onChange: (checked) => {
|
|
51
51
|
const emptyValueHandling = checked ? "include" : undefined;
|
|
52
52
|
onSelectedFilterOptionChange({
|
|
53
53
|
...absoluteSelectedFilterOption,
|
|
@@ -55,8 +55,7 @@ export function DateFilterFormContent({ filterOptions, selectedFilterOption, onS
|
|
|
55
55
|
});
|
|
56
56
|
} })) : null] }) })) : null, showRelativeForm ? (_jsx(DateFilterFormNavigationWrapper, { title: filterOptions.relativeForm?.name
|
|
57
57
|
? filterOptions.relativeForm.name
|
|
58
|
-
: intl.formatMessage({ id: "filters.floatingRange" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsx("div", { ref: relativeDateFilterRef, onKeyDown: (e) => handleRelativeDateFilterKeydown(e, onClose), children: _jsxs(DateFilterFormWrapper, { isMobile: isMobile, children: [
|
|
59
|
-
_jsx(RelativeDateFilterForm, { onSelectedFilterOptionChange: onSelectedFilterOptionChange, selectedFilterOption: relativeSelectedFilterOption, availableGranularities: availableGranularities, isMobile: isMobile, ref: tabGranularityRef, relativeDateFilterId: relativeDateFilterId, onKeyDown: (event) => submitRelativeDateFilterForm(event, isEmpty(errors), withoutApply ?? false, onClose, submitForm) }), shouldRenderEmptyValuesHandling ? (_jsx(EmptyValuesHandlingToggle, { mode: "include", className: "gd-date-filter-empty-values-handling-toggle", checked: emptyValueHandlingToggleChecked, onChange: (checked) => {
|
|
58
|
+
: intl.formatMessage({ id: "filters.floatingRange" }), onBack: onBackNavigation, backLabel: intl.formatMessage({ id: "menu.back" }), isMobile: isMobile, children: _jsx("div", { ref: relativeDateFilterRef, onKeyDown: (e) => handleRelativeDateFilterKeydown(e, onClose), 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, onClose, submitForm) }), shouldRenderEmptyValuesHandling ? (_jsx(EmptyValuesHandlingToggle, { mode: "include", className: "gd-date-filter-empty-values-handling-toggle", checked: emptyValueHandlingToggleChecked, onChange: (checked) => {
|
|
60
59
|
const emptyValueHandling = checked ? "include" : undefined;
|
|
61
60
|
onSelectedFilterOptionChange({
|
|
62
61
|
...relativeSelectedFilterOption,
|
|
@@ -9,6 +9,5 @@ import { DateFilterHeader } from "./DateFilterHeader.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export function DateFilterFormNavigationWrapper({ title, onBack, children, className, backLabel, isMobile, }) {
|
|
11
11
|
const intl = useIntl();
|
|
12
|
-
return (_jsxs("div", { className: cx("gd-date-filter-form-navigation", className), children: [isMobile ? (_jsx(DateFilterHeader, { onBack: onBack, title: title, ariaLabel: backLabel })) : (_jsx(UiSubmenuHeader, { title: title, onBack: () => onBack(), backAriaLabel: backLabel ?? intl.formatMessage({ id: "menu.back" }), useShortenedTitle: false })), _jsx(UiFocusManager, { enableAutofocus: true, children: _jsx("div", { className: "gd-date-filter-form-navigation-content", children: children }) })
|
|
13
|
-
] }));
|
|
12
|
+
return (_jsxs("div", { className: cx("gd-date-filter-form-navigation", className), children: [isMobile ? (_jsx(DateFilterHeader, { onBack: onBack, title: title, ariaLabel: backLabel })) : (_jsx(UiSubmenuHeader, { title: title, onBack: () => onBack(), backAriaLabel: backLabel ?? intl.formatMessage({ id: "menu.back" }), useShortenedTitle: false })), _jsx(UiFocusManager, { enableAutofocus: true, children: _jsx("div", { className: "gd-date-filter-form-navigation-content", children: children }) })] }));
|
|
14
13
|
}
|
|
@@ -6,7 +6,5 @@ export function DateFilterHeader({ onBack, title, ariaLabel, ...otherProps }) {
|
|
|
6
6
|
return (_jsxs("button", { tabIndex: 0, className: "gd-extended-date-filter-header s-do-not-close-dropdown-on-click", onClick: (e) => {
|
|
7
7
|
e.preventDefault();
|
|
8
8
|
onBack();
|
|
9
|
-
}, "aria-label": ariaLabel, ...otherProps, ...autofocusConnectors, children: [
|
|
10
|
-
_jsx("span", { className: "gd-icon-navigateleft" }),
|
|
11
|
-
"\u2003", title] }));
|
|
9
|
+
}, "aria-label": ariaLabel, ...otherProps, ...autofocusConnectors, children: [_jsx("span", { className: "gd-icon-navigateleft" }), "\u2003", title] }));
|
|
12
10
|
}
|
|
@@ -2,9 +2,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
// (C) 2019-2025 GoodData Corporation
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
export function EditModeMessage() {
|
|
5
|
-
return (_jsxs("div", { className: "s-extended-date-filter-edit-mode-message gd-extended-date-filter-edit-mode-message", children: [
|
|
6
|
-
_jsx("div", { className: "gd-extended-date-filter-edit-mode-message-text", children: _jsx(FormattedMessage, { id: "dateFilterDropdown.setDefault", values: {
|
|
5
|
+
return (_jsxs("div", { className: "s-extended-date-filter-edit-mode-message gd-extended-date-filter-edit-mode-message", children: [_jsx("div", { className: "gd-extended-date-filter-edit-mode-message-text", children: _jsx(FormattedMessage, { id: "dateFilterDropdown.setDefault", values: {
|
|
7
6
|
nbsp: _jsx(_Fragment, { children: "\u00A0" }),
|
|
8
|
-
} }) }), _jsx("hr", { className: "gd-separator-generic" })
|
|
9
|
-
] }));
|
|
7
|
+
} }) }), _jsx("hr", { className: "gd-separator-generic" })] }));
|
|
10
8
|
}
|
|
@@ -16,8 +16,7 @@ const granularityOrder = getDateFilterGranularities({
|
|
|
16
16
|
function PresetItemsGroup({ granularity, items, dateFormat, selectedFilterOption, className, onSelectedFilterOptionChange, }) {
|
|
17
17
|
const groupClassNames = cx("gd-list-items-group");
|
|
18
18
|
const titleId = useIdPrefixed("group-title");
|
|
19
|
-
return (_jsxs("ul", { role: "group", className: groupClassNames, "aria-labelledby": titleId, children: [
|
|
20
|
-
_jsx(ListHeading, { className: className, id: titleId, children: _jsx(RelativePresetTitleTranslated, { granularity: granularity }) }), items.map((item) => (_jsx(ListItem, { isSelected: item.localIdentifier === selectedFilterOption.localIdentifier, onClick: () => onSelectedFilterOptionChange(item), className: cx(`s-relative-preset-${kebabCase(item.localIdentifier)}`, className), children: _jsx(DateFilterTextLocalized, { filter: item, dateFormat: dateFormat }) }, item.localIdentifier)))] }));
|
|
19
|
+
return (_jsxs("ul", { role: "group", className: groupClassNames, "aria-labelledby": titleId, children: [_jsx(ListHeading, { className: className, id: titleId, children: _jsx(RelativePresetTitleTranslated, { granularity: granularity }) }), items.map((item) => (_jsx(ListItem, { isSelected: item.localIdentifier === selectedFilterOption.localIdentifier, onClick: () => onSelectedFilterOptionChange(item), className: cx(`s-relative-preset-${kebabCase(item.localIdentifier)}`, className), children: _jsx(DateFilterTextLocalized, { filter: item, dateFormat: dateFormat }) }, item.localIdentifier)))] }));
|
|
21
20
|
}
|
|
22
21
|
/**
|
|
23
22
|
* @internal
|
|
@@ -12,9 +12,5 @@ export function DateFilterButton({ isOpen, isMobile, title, children, disabled,
|
|
|
12
12
|
e.stopPropagation();
|
|
13
13
|
}
|
|
14
14
|
}, [disabled]);
|
|
15
|
-
return (_jsxs("div", { ref: buttonRef, className: cx("s-date-filter-button", "gd-date-filter-button", `s-date-filter-button-${simplifyText(customFilterName ?? "")}`, "dropdown-button", isMobile && "gd-date-filter-button-mobile", isOpen && "is-active", disabled && "disabled"), role: "button", "aria-haspopup": "dialog", "aria-expanded": isOpen, "aria-controls": isOpen ? dropdownId : undefined, tabIndex: 0, onKeyDown: handleKeyDown, children: [
|
|
16
|
-
_jsxs("div", { className: "button-content", children: [
|
|
17
|
-
_jsx("div", { className: "s-date-filter-title button-title", children: title }), _jsx("div", { className: "button-subtitle", children: children })
|
|
18
|
-
] }), _jsx(FilterButtonCustomIcon, { customIcon: customIcon, disabled: disabled })
|
|
19
|
-
] }));
|
|
15
|
+
return (_jsxs("div", { ref: buttonRef, className: cx("s-date-filter-button", "gd-date-filter-button", `s-date-filter-button-${simplifyText(customFilterName ?? "")}`, "dropdown-button", isMobile && "gd-date-filter-button-mobile", isOpen && "is-active", disabled && "disabled"), role: "button", "aria-haspopup": "dialog", "aria-expanded": isOpen, "aria-controls": isOpen ? dropdownId : undefined, tabIndex: 0, onKeyDown: handleKeyDown, children: [_jsxs("div", { className: "button-content", children: [_jsx("div", { className: "s-date-filter-title button-title", children: title }), _jsx("div", { className: "button-subtitle", children: children })] }), _jsx(FilterButtonCustomIcon, { customIcon: customIcon, disabled: disabled })] }));
|
|
20
16
|
}
|
|
@@ -24,6 +24,7 @@ export interface IDateFilterCoreProps {
|
|
|
24
24
|
onExcludeCurrentPeriodChange: (isExcluded: boolean) => void;
|
|
25
25
|
isTimeForAbsoluteRangeEnabled: boolean;
|
|
26
26
|
isSecondsForAbsoluteRangeEnabled?: boolean;
|
|
27
|
+
isAbsoluteDateFilterGranularityEnabled: boolean;
|
|
27
28
|
availableGranularities: DateFilterGranularity[];
|
|
28
29
|
isEditMode: boolean;
|
|
29
30
|
locale?: string;
|