@epam/statgpt-conversation-view 0.7.0-dev.3 → 0.7.0-dev.30
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/components/AdvancedView/Filters/FiltersModal/filter-settings-controller.d.ts +47 -0
- package/components/AdvancedView/Filters/hooks/use-filter-apply.d.ts +36 -0
- package/components/AdvancedView/Filters/hooks/use-filter-constraints.d.ts +59 -0
- package/components/AdvancedView/Filters/hooks/use-filter-initialization.d.ts +40 -0
- package/components/AdvancedView/Filters/hooks/use-filter-modal-state.d.ts +49 -0
- package/components/AdvancedView/Filters/hooks/use-filter-system-message.d.ts +35 -0
- package/components/AdvancedView/Filters/hooks/use-filter-values-loading.d.ts +5 -0
- package/components/AdvancedView/Filters/hooks/use-filters.d.ts +49 -0
- package/components/AdvancedView/Filters/hooks/use-single-dataset-filters.d.ts +7 -0
- package/components/AdvancedView/Filters/hooks/use-single-filter-strategy.d.ts +22 -0
- package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-dataset-display-data-queries.d.ts +3 -0
- package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-dataset-filters.d.ts +7 -0
- package/components/AdvancedView/MultiDatasetFilters/hooks/use-multi-filter-strategy.d.ts +27 -0
- package/components/Attachments/GridCellRenderers/helpers/get-observation-metadata-content.d.ts +2 -2
- package/constants/grid.d.ts +3 -0
- package/index.d.ts +6 -0
- package/index.js +9 -11
- package/index.mjs +10477 -19282
- package/models/attachments-styles.d.ts +1 -1
- package/models/filters.d.ts +1 -0
- package/package.json +19 -20
- package/utils/attachments/attachment-parser.d.ts +3 -2
- package/utils/attachments/python-attachment.d.ts +11 -1
- package/utils/attachments/replace-python-attachment.d.ts +4 -1
- package/utils/query-filters.d.ts +11 -1
- package/utils/single-dataset-filters.d.ts +24 -0
- package/LICENSE +0 -21
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { DataConstraints, Hierarchy, StructuralData } from '../../../../../../sdmx-toolkit/src/index';
|
|
2
|
+
import { DataQuery, TimeRangeOptions } from '../../../../../../shared-toolkit/src/index';
|
|
3
|
+
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
|
4
|
+
import { Filter, FiltersModalProps, HierarchyState } from '../../../../models/filters';
|
|
5
|
+
export interface FilterSettingsState {
|
|
6
|
+
filtersList: Filter[];
|
|
7
|
+
selectedFilter?: Filter;
|
|
8
|
+
isDisableValues?: boolean;
|
|
9
|
+
isValuesLoading?: boolean;
|
|
10
|
+
selectedTimeOption?: string | number;
|
|
11
|
+
disabledDatasetUrns: Set<string>;
|
|
12
|
+
timeSeriesCount?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface FilterSettingsOptions {
|
|
15
|
+
locale?: string;
|
|
16
|
+
timeRangeOptions?: TimeRangeOptions[];
|
|
17
|
+
modalProps?: FiltersModalProps;
|
|
18
|
+
initialConstraints?: DataConstraints[];
|
|
19
|
+
initialConstraintsMap?: Map<string, DataConstraints[] | undefined>;
|
|
20
|
+
datasetIcon?: ReactNode;
|
|
21
|
+
structuresMap?: Map<string, StructuralData | undefined>;
|
|
22
|
+
dataQueries?: DataQuery[];
|
|
23
|
+
}
|
|
24
|
+
export interface FilterSettingsHandlers {
|
|
25
|
+
setSelectedFilter: Dispatch<SetStateAction<Filter | undefined>>;
|
|
26
|
+
onSelectDisplayMode: (filter?: Filter, displayMode?: string) => void;
|
|
27
|
+
onDeleteFilter?: (filter?: Filter) => void;
|
|
28
|
+
onClearAllFilters?: () => void;
|
|
29
|
+
updateSelectedFilterValues?: (filter?: Filter) => void;
|
|
30
|
+
onTimePeriodChange?: (value: string | number) => void;
|
|
31
|
+
onToggleDataset: (urn: string, enabled: boolean) => void;
|
|
32
|
+
onClearAllDatasets: () => void;
|
|
33
|
+
}
|
|
34
|
+
export interface FilterSettingsHierarchy {
|
|
35
|
+
hierarchyStateMap?: Map<string, HierarchyState>;
|
|
36
|
+
onSelectHierarchy?: (filter?: Filter, hierarchy?: Hierarchy | null) => void;
|
|
37
|
+
onExpandHierarchyNode?: (filterKey: string, nodeId: string) => void;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The single structured prop the orchestration passes to `FilterSettings`.
|
|
41
|
+
*/
|
|
42
|
+
export interface FilterSettingsController {
|
|
43
|
+
state: FilterSettingsState;
|
|
44
|
+
options: FilterSettingsOptions;
|
|
45
|
+
handlers: FilterSettingsHandlers;
|
|
46
|
+
hierarchy: FilterSettingsHierarchy;
|
|
47
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Filter } from '../../../../models/filters';
|
|
2
|
+
/** Filters passed to the system message: flat (single) or per-dataset (multi). */
|
|
3
|
+
export type SystemMessageFilters = Filter[] | Map<string, Filter[]>;
|
|
4
|
+
/**
|
|
5
|
+
* Mode-specific apply behavior injected into the shared {@link useFilterApply}
|
|
6
|
+
* skeleton. `runApply` performs the mode's `onFiltersChange` side effect and
|
|
7
|
+
* returns the next applied filters plus the filters to persist on the system
|
|
8
|
+
* message; `getIsFiltersUnchanged` powers the Apply-disabled state.
|
|
9
|
+
*/
|
|
10
|
+
export interface FilterApplyStrategy {
|
|
11
|
+
getIsFiltersUnchanged: (modalFilters: Filter[], appliedFilters: Filter[], disabledDatasetUrns: Set<string>, appliedDisabledUrns: Set<string>) => boolean;
|
|
12
|
+
runApply: (modalFilters: Filter[], disabledDatasetUrns: Set<string>) => {
|
|
13
|
+
appliedFilters: Filter[];
|
|
14
|
+
systemMessageFilters: SystemMessageFilters;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
interface UseFilterApplyParams {
|
|
18
|
+
apply: FilterApplyStrategy;
|
|
19
|
+
modalFilters: Filter[];
|
|
20
|
+
appliedFilters: Filter[];
|
|
21
|
+
disabledDatasetUrns: Set<string>;
|
|
22
|
+
appliedDisabledUrns: Set<string>;
|
|
23
|
+
setAppliedFilters: (filters: Filter[]) => void;
|
|
24
|
+
closeModal: () => void;
|
|
25
|
+
addSystemMessage: (filters: SystemMessageFilters, disabledDatasetUrns: Set<string>) => Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shared apply control flow for both filter modes: compute the unchanged state,
|
|
29
|
+
* and on apply run the mode-specific change, persist applied filters, close the
|
|
30
|
+
* modal and write the system message off the render path.
|
|
31
|
+
*/
|
|
32
|
+
export declare const useFilterApply: ({ apply, modalFilters, appliedFilters, disabledDatasetUrns, appliedDisabledUrns, setAppliedFilters, closeModal, addSystemMessage, }: UseFilterApplyParams) => {
|
|
33
|
+
isFiltersUnchanged: boolean;
|
|
34
|
+
onApply: () => void;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DataConstraints } from '../../../../../../sdmx-toolkit/src/index';
|
|
2
|
+
import { DataQuery } from '../../../../../../shared-toolkit/src/index';
|
|
3
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
4
|
+
import { Filter } from '../../../../models/filters';
|
|
5
|
+
type SetFilters = (filters: Filter[]) => void;
|
|
6
|
+
type SetBooleanLoading = (isLoading: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Mode-specific constraint operations injected into the shared
|
|
9
|
+
* {@link useFilterConstraints} skeleton. The single-dataset flow works on a
|
|
10
|
+
* flat `DataConstraints[]`; the multi-dataset flow works on a per-dataset map.
|
|
11
|
+
* `TResult` is the opaque per-call constraints payload each mode produces.
|
|
12
|
+
*/
|
|
13
|
+
export interface FilterConstraintsStrategy<TResult> {
|
|
14
|
+
/**
|
|
15
|
+
* Fire the constraint request(s) for `filters`. `shouldTrackLoading` drives
|
|
16
|
+
* the shared loading counter. `targetDataQueries` narrows the request set on
|
|
17
|
+
* the delete path (multi-dataset only; ignored by single-dataset).
|
|
18
|
+
*/
|
|
19
|
+
startFetch: (filters: Filter[], targetDataQueries?: DataQuery[]) => {
|
|
20
|
+
promise: Promise<TResult>;
|
|
21
|
+
shouldTrackLoading: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** Constraints payload to use when a request fails. */
|
|
24
|
+
fallbackResult: (filters: Filter[]) => TResult;
|
|
25
|
+
/** Drop values no longer supported by the fetched constraints. */
|
|
26
|
+
cleanIncompatible: (filters: Filter[], result: TResult, changedFilter: Filter) => {
|
|
27
|
+
filters: Filter[];
|
|
28
|
+
changed: boolean;
|
|
29
|
+
};
|
|
30
|
+
/** Fill `filters` with the fetched constraints. */
|
|
31
|
+
fill: (filters: Filter[], result: TResult) => Filter[];
|
|
32
|
+
/** Persist the fetched constraints into the mode-specific ref. */
|
|
33
|
+
commit: (result: TResult) => void;
|
|
34
|
+
/** Constraints to rebuild the hierarchy tree with after a change. */
|
|
35
|
+
getRebuildConstraints: (changedFilter: Filter, result: TResult) => DataConstraints[] | undefined;
|
|
36
|
+
}
|
|
37
|
+
interface UseFilterConstraintsParams<TResult> {
|
|
38
|
+
strategy: FilterConstraintsStrategy<TResult>;
|
|
39
|
+
modalFilters: Filter[];
|
|
40
|
+
setModalFilters: SetFilters;
|
|
41
|
+
setSelectedFilter: Dispatch<SetStateAction<Filter | undefined>>;
|
|
42
|
+
rebuildHierarchyTree: (filter: Filter, constraints?: DataConstraints[]) => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Shared constraint-fetching control flow for both filter modes. The async
|
|
46
|
+
* skeleton (request → optionally clean-and-recurse → fill/commit → catch/finally)
|
|
47
|
+
* is identical across single- and multi-dataset; the mode-specific primitives
|
|
48
|
+
* arrive through `strategy`.
|
|
49
|
+
*/
|
|
50
|
+
export declare const useFilterConstraints: <TResult>({ strategy, modalFilters, setModalFilters, setSelectedFilter, rebuildHierarchyTree, }: UseFilterConstraintsParams<TResult>) => {
|
|
51
|
+
isConstraintsLoading: boolean | undefined;
|
|
52
|
+
isDisableFilterValues: boolean | undefined;
|
|
53
|
+
isFilterValuesLoading: boolean;
|
|
54
|
+
setIsConstraintsLoading: Dispatch<SetStateAction<boolean | undefined>>;
|
|
55
|
+
handleFiltersWithConstraints: (filters: Filter[], setFilters: SetFilters, setLoading?: SetBooleanLoading, changedFilter?: Filter) => void;
|
|
56
|
+
handleFiltersDelete: (filtersToUpdate: Filter[], targetDataQueries?: DataQuery[]) => void;
|
|
57
|
+
updateSelectedFilterValues: (filter?: Filter) => void;
|
|
58
|
+
};
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Filter } from '../../../../models/filters';
|
|
2
|
+
type SetFilters = (filters: Filter[]) => void;
|
|
3
|
+
type SetBooleanLoading = (isLoading: boolean) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Outcome of a mode's initialization check:
|
|
6
|
+
* - `ready` — preselect now with `filters`;
|
|
7
|
+
* - `pending` — structure data not ready yet, show loading and wait;
|
|
8
|
+
* - `skip` — nothing to do (e.g. already initialized, or no structure).
|
|
9
|
+
*/
|
|
10
|
+
export type FilterInitResult = {
|
|
11
|
+
status: 'ready';
|
|
12
|
+
filters: Filter[];
|
|
13
|
+
} | {
|
|
14
|
+
status: 'pending';
|
|
15
|
+
} | {
|
|
16
|
+
status: 'skip';
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Mode-specific initialization behavior injected into the shared
|
|
20
|
+
* {@link useFilterInitialization} skeleton. `prepareInit` computes the preselected
|
|
21
|
+
* filters (or signals pending/skip); `markInitialized` lets a one-shot mode
|
|
22
|
+
* (single-dataset) record that it has run.
|
|
23
|
+
*/
|
|
24
|
+
export interface FilterInitStrategy {
|
|
25
|
+
prepareInit: () => FilterInitResult;
|
|
26
|
+
markInitialized?: () => void;
|
|
27
|
+
}
|
|
28
|
+
interface UseFilterInitializationParams {
|
|
29
|
+
init: FilterInitStrategy;
|
|
30
|
+
setAppliedFilters: SetFilters;
|
|
31
|
+
setIsConstraintsLoading: SetBooleanLoading;
|
|
32
|
+
handleFiltersWithConstraints: (filters: Filter[], setFilters: SetFilters, setLoading?: SetBooleanLoading) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Shared initial preselect for both filter modes. Re-runs whenever the mode's
|
|
36
|
+
* `prepareInit` identity changes (i.e., its inputs change); the mode decides via
|
|
37
|
+
* the returned status whether to preselect, wait, or skip.
|
|
38
|
+
*/
|
|
39
|
+
export declare const useFilterInitialization: ({ init, setAppliedFilters, setIsConstraintsLoading, handleFiltersWithConstraints, }: UseFilterInitializationParams) => void;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PopUpState } from '../../../../../../ui-components/src/index';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
import { Filter, FilterMode, FiltersProps, HierarchyState } from '../../../../models/filters';
|
|
4
|
+
interface UseFilterModalStateParams {
|
|
5
|
+
mode: FilterMode;
|
|
6
|
+
modalState: PopUpState;
|
|
7
|
+
dataQueries?: FiltersProps['dataQueries'];
|
|
8
|
+
hierarchyStateMap: Map<string, HierarchyState>;
|
|
9
|
+
loadAvailableHierarchies: (filter: Filter) => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export interface UseFilterModalStateResult {
|
|
12
|
+
modalFilters: Filter[];
|
|
13
|
+
setModalFilters: Dispatch<SetStateAction<Filter[]>>;
|
|
14
|
+
appliedFilters: Filter[];
|
|
15
|
+
setAppliedFilters: Dispatch<SetStateAction<Filter[]>>;
|
|
16
|
+
selectedFilter: Filter | undefined;
|
|
17
|
+
setSelectedFilter: Dispatch<SetStateAction<Filter | undefined>>;
|
|
18
|
+
selectedFilterValues: Filter[];
|
|
19
|
+
selectedTimeOption: string | number | undefined;
|
|
20
|
+
disabledDatasetUrns: Set<string>;
|
|
21
|
+
appliedDisabledUrns: Set<string>;
|
|
22
|
+
onSelectDisplayMode: (filter?: Filter, displayMode?: string) => void;
|
|
23
|
+
onClearAllDatasets: () => void;
|
|
24
|
+
onToggleDataset: (urn: string, enabled: boolean) => void;
|
|
25
|
+
onTimePeriodChange: (value: string | number) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Modal state shared by both filter modes (modal/applied filters, selected
|
|
29
|
+
* filter, time option). The two modes are identical except for two `multi`-only
|
|
30
|
+
* concerns: the dataset-disable sets, and resetting `selectedTimeOption` when
|
|
31
|
+
* the modal opens — single-dataset keeps the last time option across reopens.
|
|
32
|
+
*/
|
|
33
|
+
export declare const useFilterModalState: ({ mode, modalState, dataQueries, hierarchyStateMap, loadAvailableHierarchies, }: UseFilterModalStateParams) => {
|
|
34
|
+
modalFilters: Filter[];
|
|
35
|
+
setModalFilters: Dispatch<SetStateAction<Filter[]>>;
|
|
36
|
+
appliedFilters: Filter[];
|
|
37
|
+
setAppliedFilters: Dispatch<SetStateAction<Filter[]>>;
|
|
38
|
+
selectedFilter: Filter | undefined;
|
|
39
|
+
setSelectedFilter: Dispatch<SetStateAction<Filter | undefined>>;
|
|
40
|
+
selectedFilterValues: Filter[];
|
|
41
|
+
selectedTimeOption: string | number | undefined;
|
|
42
|
+
disabledDatasetUrns: Set<string>;
|
|
43
|
+
appliedDisabledUrns: Set<string>;
|
|
44
|
+
onSelectDisplayMode: (filter?: Filter, displayMode?: string) => void;
|
|
45
|
+
onClearAllDatasets: () => void;
|
|
46
|
+
onToggleDataset: (urn: string, enabled: boolean) => void;
|
|
47
|
+
onTimePeriodChange: (value: string | number) => void;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Conversation } from '@epam/ai-dial-shared';
|
|
2
|
+
import { DataQuery } from '../../../../../../shared-toolkit/src/index';
|
|
3
|
+
import { FiltersProps } from '../../../../models/filters';
|
|
4
|
+
import { SystemMessageFilters } from './use-filter-apply';
|
|
5
|
+
/**
|
|
6
|
+
* Mode-specific system-message builder injected into the shared
|
|
7
|
+
* {@link useFilterSystemMessage} skeleton. Given the current conversation and the
|
|
8
|
+
* applied filters, it returns the conversation updated with the new system message
|
|
9
|
+
* (or `null` when there is no conversation) plus the data queries to persist. The
|
|
10
|
+
* single-dataset flow works on a flat `Filter[]`; the multi-dataset flow works on
|
|
11
|
+
* a per-dataset map and additionally folds in `disabledDatasetUrns`.
|
|
12
|
+
*/
|
|
13
|
+
export interface FilterSystemMessageStrategy {
|
|
14
|
+
buildSystemMessage: (conversation: Conversation | null, systemMessageFilters: SystemMessageFilters, disabledDatasetUrns: Set<string>) => {
|
|
15
|
+
conversation: Conversation | null;
|
|
16
|
+
nextDataQueries: DataQuery[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
interface UseFilterSystemMessageParams {
|
|
20
|
+
buildSystemMessage: FilterSystemMessageStrategy['buildSystemMessage'];
|
|
21
|
+
conversation?: FiltersProps['conversation'];
|
|
22
|
+
conversationKey: string;
|
|
23
|
+
setConversation?: FiltersProps['setConversation'];
|
|
24
|
+
updateConversation: FiltersProps['updateConversation'];
|
|
25
|
+
updateDataQueries?: FiltersProps['updateDataQueries'];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shared system-message persistence for both filter modes: snapshot the current
|
|
29
|
+
* conversation off a ref, delegate message + data-query construction to the
|
|
30
|
+
* mode-specific `buildSystemMessage`, then persist the result (local conversation
|
|
31
|
+
* state, data queries, and the remote conversation). No per-mode branching lives
|
|
32
|
+
* here — all of it is encapsulated in `buildSystemMessage`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const useFilterSystemMessage: ({ buildSystemMessage, conversation, conversationKey, setConversation, updateConversation, updateDataQueries, }: UseFilterSystemMessageParams) => (systemMessageFilters: SystemMessageFilters, disabledDatasetUrns?: Set<string>) => Promise<void>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DataConstraints } from '../../../../../../sdmx-toolkit/src/index';
|
|
2
|
+
import { DataQuery } from '../../../../../../shared-toolkit/src/index';
|
|
3
|
+
import { Filter, FilterMode, FiltersProps } from '../../../../models/filters';
|
|
4
|
+
import { FilterSettingsOptions } from '../FiltersModal/filter-settings-controller';
|
|
5
|
+
import { FiltersModalShellProps } from '../FiltersModal/FiltersModalShell';
|
|
6
|
+
import { FilterApplyStrategy } from './use-filter-apply';
|
|
7
|
+
import { FilterConstraintsStrategy } from './use-filter-constraints';
|
|
8
|
+
import { FilterInitStrategy } from './use-filter-initialization';
|
|
9
|
+
import { FilterSystemMessageStrategy } from './use-filter-system-message';
|
|
10
|
+
/**
|
|
11
|
+
* Everything mode-specific about a filter flow, bundled behind one object so the
|
|
12
|
+
* shared {@link useFilters} orchestration stays mode-agnostic. Built per mode by
|
|
13
|
+
* `useSingleFilterStrategy` / `useMultiFilterStrategy`.
|
|
14
|
+
*/
|
|
15
|
+
export interface FilterStrategy<TResult> {
|
|
16
|
+
mode: FilterMode;
|
|
17
|
+
/** Constraint operations consumed by the shared constraints skeleton. */
|
|
18
|
+
constraints: FilterConstraintsStrategy<TResult>;
|
|
19
|
+
/** Apply operations consumed by the shared apply skeleton. */
|
|
20
|
+
apply: FilterApplyStrategy;
|
|
21
|
+
/**
|
|
22
|
+
* Builds the mode-specific system message + persisted data queries, consumed
|
|
23
|
+
* by the shared system-message skeleton on apply.
|
|
24
|
+
*/
|
|
25
|
+
buildSystemMessage: FilterSystemMessageStrategy['buildSystemMessage'];
|
|
26
|
+
/** Initialization behavior consumed by the shared init skeleton. */
|
|
27
|
+
init: FilterInitStrategy;
|
|
28
|
+
getConstraintsForFilter: (filter: Filter) => DataConstraints[] | undefined;
|
|
29
|
+
getCodelistUrnForFilter: (filter: Filter) => string | undefined;
|
|
30
|
+
getSourceArtefactUrn: (filter: Filter) => string | undefined;
|
|
31
|
+
remember: () => void;
|
|
32
|
+
restore: () => void;
|
|
33
|
+
/** Data queries whose constraints to refresh when a single filter is deleted. */
|
|
34
|
+
getDeleteTargets: (filter: Filter | undefined, dataQueries?: DataQuery[]) => DataQuery[] | undefined;
|
|
35
|
+
/** Data queries whose constraints to refresh when all filters are cleared. */
|
|
36
|
+
getClearTargets: (dataQueries?: DataQuery[]) => DataQuery[] | undefined;
|
|
37
|
+
/** Mode-specific `FilterSettings` options (merged with the common ones). */
|
|
38
|
+
controllerOptions: Partial<FilterSettingsOptions>;
|
|
39
|
+
/** Total timeseries count (single-dataset only). */
|
|
40
|
+
timeSeriesCount?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Shared orchestration for both filter modes: wires hierarchy, modal state,
|
|
44
|
+
* constraint fetching, initialization, system-message persistence and apply,
|
|
45
|
+
* then assembles the `FiltersModalShell` props. All mode-specific behavior is
|
|
46
|
+
* provided by `strategy`, so this hook contains no per-mode branching beyond a
|
|
47
|
+
* couple of tiny gates keyed on `strategy.mode`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const useFilters: <TResult>({ actions, buttonProps, modalProps, dataQueries, locale, timeRangeOptions, conversationKey, conversation, setConversation, updateConversation, updateDataQueries, limitMessages, filterIconClassName, }: FiltersProps, strategy: FilterStrategy<TResult>) => FiltersModalShellProps;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FiltersProps } from '../../../../models/filters';
|
|
2
|
+
import { FiltersModalShellProps } from '../FiltersModal/FiltersModalShell';
|
|
3
|
+
/**
|
|
4
|
+
* Single-dataset (attachment-scoped) filter flow. Builds the single-dataset
|
|
5
|
+
* strategy and delegates orchestration to the shared {@link useFilters} hook.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSingleDatasetFilters: (props: FiltersProps) => FiltersModalShellProps;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DataConstraints } from '../../../../../../sdmx-toolkit/src/index';
|
|
2
|
+
import { FiltersProps } from '../../../../models/filters';
|
|
3
|
+
import { FilterStrategy } from './use-filters';
|
|
4
|
+
interface UseSingleFilterStrategyParams {
|
|
5
|
+
actions?: FiltersProps['actions'];
|
|
6
|
+
attachmentsDataQuery?: FiltersProps['attachmentsDataQuery'];
|
|
7
|
+
dataQueries?: FiltersProps['dataQueries'];
|
|
8
|
+
dimensions?: FiltersProps['dimensions'];
|
|
9
|
+
structureDimensions?: FiltersProps['structureDimensions'];
|
|
10
|
+
structures?: FiltersProps['structures'];
|
|
11
|
+
initialConstraints?: DataConstraints[];
|
|
12
|
+
locale?: string;
|
|
13
|
+
onFiltersChange?: FiltersProps['onFiltersChange'];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Single-dataset filter strategy. Owns the flat `DataConstraints[]` ref and
|
|
17
|
+
* provides the array-shaped constraint, apply and init primitives the shared
|
|
18
|
+
* {@link useFilters} orchestration injects, plus the hierarchy getters and
|
|
19
|
+
* the modal remember/restore snapshot.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useSingleFilterStrategy: ({ actions, attachmentsDataQuery, dataQueries, dimensions, structureDimensions, structures, initialConstraints, locale, onFiltersChange, }: UseSingleFilterStrategyParams) => FilterStrategy<DataConstraints[]>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { FiltersProps } from '../../../../models/filters';
|
|
2
|
+
import { StructureDataMaps } from '../../../../models/structure-data';
|
|
3
|
+
export declare const useMultiDatasetDisplayDataQueries: (dataQueries?: FiltersProps["dataQueries"], structuresMap?: StructureDataMaps["structuresMap"], locale?: string) => import('../../../../../../shared-toolkit/src/index').DataQuery[] | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FiltersProps } from '../../../../models/filters';
|
|
2
|
+
import { FiltersModalShellProps } from '../../Filters/FiltersModal/FiltersModalShell';
|
|
3
|
+
/**
|
|
4
|
+
* Multi-dataset (cross-dataset) filter flow. Builds the multi-dataset strategy
|
|
5
|
+
* and delegates orchestration to the shared {@link useFilters} hook.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useMultiDatasetFilters: (props: FiltersProps) => FiltersModalShellProps;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DataConstraints, DatasetDimensionsMetadataMap } from '../../../../../../sdmx-toolkit/src/index';
|
|
2
|
+
import { Filter, FiltersProps } from '../../../../models/filters';
|
|
3
|
+
import { StructureDataMaps } from '../../../../models/structure-data';
|
|
4
|
+
import { FilterStrategy } from '../../Filters/hooks/use-filters';
|
|
5
|
+
type ConstraintsMap = Map<string, DataConstraints[] | undefined>;
|
|
6
|
+
export interface MultiConstraintsResult {
|
|
7
|
+
filtersMap: Map<string, Filter[]>;
|
|
8
|
+
constraints: ConstraintsMap;
|
|
9
|
+
structureDataMaps: StructureDataMaps;
|
|
10
|
+
}
|
|
11
|
+
interface UseMultiFilterStrategyParams {
|
|
12
|
+
actions?: FiltersProps['actions'];
|
|
13
|
+
dataQueries?: FiltersProps['dataQueries'];
|
|
14
|
+
datasetDimensionsMetadataMap?: DatasetDimensionsMetadataMap;
|
|
15
|
+
structureDataMaps?: StructureDataMaps;
|
|
16
|
+
datasetIcon?: FiltersProps['datasetIcon'];
|
|
17
|
+
locale?: string;
|
|
18
|
+
onMultipleDataFiltersChange?: FiltersProps['onMultipleDataFiltersChange'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Multi-dataset (cross-dataset) filter strategy. Owns the per-dataset
|
|
22
|
+
* constraints map ref and provides the map-shaped constraint, apply and init
|
|
23
|
+
* primitives the shared {@link useFilters} orchestration injects, plus the
|
|
24
|
+
* hierarchy getters and the modal remember/restore snapshot.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useMultiFilterStrategy: ({ actions, dataQueries, datasetDimensionsMetadataMap, structureDataMaps, datasetIcon, locale, onMultipleDataFiltersChange, }: UseMultiFilterStrategyParams) => FilterStrategy<MultiConstraintsResult>;
|
|
27
|
+
export {};
|
package/components/Attachments/GridCellRenderers/helpers/get-observation-metadata-content.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getObsAttributesFromParams } from '../../../../utils/attachments/metadata';
|
|
2
2
|
import { ICellRendererParams } from 'ag-grid-community';
|
|
3
|
-
import { StructuralData } from '../../../../../../sdmx-toolkit/src/index';
|
|
3
|
+
import { Dataflow, StructuralData } from '../../../../../../sdmx-toolkit/src/index';
|
|
4
4
|
import { MetadataSettings } from '../../../../models/metadata';
|
|
5
5
|
import { ConversationViewTitles } from '../../../../index';
|
|
6
6
|
export interface ObservationValueCellRendererParams extends ICellRendererParams {
|
|
@@ -11,7 +11,7 @@ export interface ObservationValueCellRendererParams extends ICellRendererParams
|
|
|
11
11
|
titles?: ConversationViewTitles;
|
|
12
12
|
}
|
|
13
13
|
export type ObservationMetadataContent = ReturnType<typeof getObservationMetadataContent>;
|
|
14
|
-
export declare const getObservationMetadataContent: (params: ObservationValueCellRendererParams, obsAttributes: NonNullable<ReturnType<typeof getObsAttributesFromParams
|
|
14
|
+
export declare const getObservationMetadataContent: (params: ObservationValueCellRendererParams, obsAttributes: NonNullable<ReturnType<typeof getObsAttributesFromParams>>, getDatasetLastUpdated?: (dataset: Dataflow | null | undefined) => string | undefined) => {
|
|
15
15
|
metadata: (import('../../../../index').StructureComponentValue | {
|
|
16
16
|
title: string;
|
|
17
17
|
value: string | undefined;
|
package/constants/grid.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export declare const GRID_COLUMN_FLEX: {
|
|
|
13
13
|
minWidth: number;
|
|
14
14
|
};
|
|
15
15
|
export declare const CHART_COLUMN_WIDTH = 32;
|
|
16
|
+
export declare const MOBILE_GRID_COLUMN_WIDTH = 100;
|
|
17
|
+
export declare const FIXED_GRID_COLUMN_MAX_WIDTH = 64;
|
|
16
18
|
export declare const OBSERVATION_VALUE_CELL_RENDER = "observationValueCell";
|
|
17
19
|
export declare const METADATA_CELL_RENDER = "metadataCell";
|
|
18
20
|
export declare const CHART_CELL_RENDER = "chartCell";
|
|
@@ -21,4 +23,5 @@ export declare const DATASET_DETAIL_CELL_RENDER = "datasetDetailCell";
|
|
|
21
23
|
export declare const CHART_COLUMN_ID = "Chart_column";
|
|
22
24
|
export declare const getMetaDataColumn: (dataSetData?: StructuralData, data?: Data, locale?: string, metadataSettings?: MetadataSettings, titles?: ConversationViewTitles, action?: PutOnboardingFile) => ColDef;
|
|
23
25
|
export declare function getChartColumn(dataSetData?: StructuralData, data?: Data, locale?: string, width?: number, titles?: ConversationViewTitles, action?: PutOnboardingFile): ColDef;
|
|
26
|
+
export declare function applyMobileColumnWidth(col: ColDef, isMobile: boolean): ColDef;
|
|
24
27
|
export declare function getCrossDatasetMetadataColumn(structuresMap: Map<string, StructuralData | undefined>, attributesDataMap: Map<string, Data | undefined>, locale: string, titles?: ConversationViewTitles): ColDef;
|
package/index.d.ts
CHANGED
|
@@ -26,3 +26,9 @@ export type { ConversationViewSidePanelConfig, ConversationViewSidePanelScope, }
|
|
|
26
26
|
export { ConversationViewFeatureTogglesProvider, useConversationViewFeatureToggles, } from './context/ConversationViewFeatureTogglesContext';
|
|
27
27
|
export type { ConversationViewFeatureToggles } from './context/ConversationViewFeatureTogglesContext';
|
|
28
28
|
export { CrossDatasetAttachmentsProvider, useCrossDatasetAttachments, } from './context/CrossDatasetAttachmentsContext';
|
|
29
|
+
export { AttachmentRenderer } from './components/Attachments/AttachmentRenderer';
|
|
30
|
+
export { CustomChartAttachment } from './components/Attachments/CustomAttachments/CustomChartAttachment';
|
|
31
|
+
export { CustomDataGridAttachment } from './components/Attachments/CustomAttachments/CustomGridAttachment';
|
|
32
|
+
export { CrossDatasetGridAttachment } from './components/Attachments/CustomAttachments/CrossDatasetGridAttachment';
|
|
33
|
+
export type { ChartingData, ChartUnit, ChartUnitGroup, } from './models/charting';
|
|
34
|
+
export type { GridData } from './types/data-grid/grid-data';
|