@epam/statgpt-conversation-view 0.4.0-rc.9 → 0.4.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/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/columnPanelMapping.d.ts +50 -0
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/columnStateSnapshot.d.ts +16 -0
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/draggableListUtils.d.ts +34 -0
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/hooks/useAgGridColumnGridListeners.d.ts +6 -0
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/{useAgGridColumnPreferences.d.ts → hooks/useAgGridColumnPreferences.d.ts} +6 -1
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/{useAgGridColumnsPanel.d.ts → hooks/useAgGridColumnsPanel.d.ts} +10 -3
- package/components/AdvancedView/TableSettings/helpers/crossDatasetEnrichment.d.ts +44 -0
- package/components/AdvancedView/TableSettings/helpers/dimensionSubItemId.d.ts +25 -0
- package/components/AdvancedView/TableSettings/types.d.ts +5 -0
- package/components/Attachments/GridCellRenderers/helpers/get-external-link-from-context.d.ts +1 -0
- package/index.d.ts +1 -0
- package/index.js +7 -7
- package/index.mjs +7578 -5840
- package/models/attachments-styles.d.ts +4 -0
- package/models/filters.d.ts +13 -1
- package/models/titles.d.ts +4 -0
- package/package.json +8 -7
- package/utils/attachments/attachment-parser.d.ts +1 -0
- package/utils/attachments/cross-dataset-grid/dimensions-columns.d.ts +2 -0
- package/utils/attachments/markdown-attachments.d.ts +12 -0
- package/utils/attachments/time-period.d.ts +3 -1
- package/utils/attachments/unwrap-markdown-code.d.ts +6 -0
- package/utils/filters.d.ts +10 -1
- package/utils/get-filled-filters.d.ts +6 -5
- package/utils/hierarchy-request-context.d.ts +8 -0
- package/utils/hierarchy-view.d.ts +12 -0
- package/utils/multiple-filters.d.ts +21 -7
- package/utils/normalize-constraint-filters.d.ts +2 -0
- package/utils/request-cache.d.ts +1 -0
- package/utils/use-hierarchy-state.d.ts +17 -0
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers.d.ts +0 -24
- package/components/AdvancedView/TableSettings/AgGridColumnPanel/useAgGridColumnGridListeners.d.ts +0 -2
package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/columnPanelMapping.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ColDef, GridApi } from 'ag-grid-community';
|
|
2
|
+
import { DraggableListNode } from '../../../../../../../ui-components/src/index';
|
|
3
|
+
import { ColumnPanelFilter } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Default predicate that includes a column in the panel when it has a non-empty
|
|
6
|
+
* label and has not been suppressed via `suppressColumnsToolPanel`.
|
|
7
|
+
*
|
|
8
|
+
* @param label - Resolved display label for the column.
|
|
9
|
+
* @param colDef - AG Grid column definition for the column.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEFAULT_INCLUDE_COLUMN: ColumnPanelFilter;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the stable identifier for a column definition, preferring `colId` over `field`.
|
|
14
|
+
*
|
|
15
|
+
* @param def - AG Grid column definition to extract the identifier from.
|
|
16
|
+
* @returns The column id string, or `null` if neither `colId` nor `field` is set.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getColId(def: ColDef): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Resolves the human-readable label for a column definition, falling back through
|
|
21
|
+
* `headerName`, `field`, and `colId` in that order.
|
|
22
|
+
*
|
|
23
|
+
* @param def - AG Grid column definition to extract the label from.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getColLabel(def: ColDef): string;
|
|
26
|
+
/**
|
|
27
|
+
* Builds a map from column id to its current AG Grid column state.
|
|
28
|
+
*
|
|
29
|
+
* @param api - AG Grid API instance used to retrieve the current column state.
|
|
30
|
+
* @returns A `Map` keyed by `colId` with the corresponding column state as the value.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildColumnStateMap(api: GridApi): Map<string, import('ag-grid-community').ColumnState>;
|
|
33
|
+
/**
|
|
34
|
+
* Converts the grid's column definitions into draggable panel items sorted by
|
|
35
|
+
* the current column order, applying the provided filter to exclude columns.
|
|
36
|
+
*
|
|
37
|
+
* @param api - AG Grid API instance used to read column definitions and state.
|
|
38
|
+
* @param includeColumn - Predicate that determines whether a column should appear in the panel.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mapColumnsToPanelItems(api: GridApi, includeColumn: ColumnPanelFilter): DraggableListNode[];
|
|
41
|
+
/**
|
|
42
|
+
* Merges a reordered subset of column ids back into the full column order,
|
|
43
|
+
* replacing each included position with the next id from the reordered subset
|
|
44
|
+
* while leaving excluded column positions unchanged.
|
|
45
|
+
*
|
|
46
|
+
* @param fullOrder - The complete list of all column ids in their current order.
|
|
47
|
+
* @param includedOrder - The reordered ids for only the columns that are included in the panel.
|
|
48
|
+
* @param includedSet - A set of column ids that belong to the included subset, used for fast lookup.
|
|
49
|
+
*/
|
|
50
|
+
export declare function mergeIncludedOrderIntoFullOrder(fullOrder: string[], includedOrder: string[], includedSet: Set<string>): string[];
|
package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/columnStateSnapshot.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { AgGridInitialColumnsState } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Reads the current column and column-group state from an AG Grid instance and returns it as a snapshot.
|
|
5
|
+
*
|
|
6
|
+
* @param api - The AG Grid API instance to read column state from.
|
|
7
|
+
* @returns A snapshot containing both column state and column group state.
|
|
8
|
+
*/
|
|
9
|
+
export declare function captureInitialColumnsState(api: GridApi): AgGridInitialColumnsState;
|
|
10
|
+
/**
|
|
11
|
+
* Applies a previously captured column state snapshot back to an AG Grid instance.
|
|
12
|
+
*
|
|
13
|
+
* @param api - The AG Grid API instance to restore column state on.
|
|
14
|
+
* @param initialState - The snapshot to restore; does nothing when absent or null.
|
|
15
|
+
*/
|
|
16
|
+
export declare function restoreInitialColumnsState(api: GridApi, initialState?: AgGridInitialColumnsState | null): void;
|
package/components/AdvancedView/TableSettings/AgGridColumnPanel/helpers/draggableListUtils.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DraggableListItemNode, DraggableListNode } from '../../../../../../../ui-components/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Traverses a tree of draggable list nodes along a path of IDs and returns the item node at the end.
|
|
4
|
+
*
|
|
5
|
+
* @param nodes - The top-level array of nodes to start traversal from.
|
|
6
|
+
* @param path - Ordered sequence of node IDs representing the path to the target item.
|
|
7
|
+
* @returns The item node found at the given path, or `undefined` if any segment is missing or the final node is not an item.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getItemNodeByPath(nodes: DraggableListNode[], path: readonly string[]): DraggableListItemNode | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Ensures the last visible leaf item inside every named group of an enriched
|
|
12
|
+
* draggable list item cannot be unchecked, preventing a column group from
|
|
13
|
+
* becoming completely empty.
|
|
14
|
+
*
|
|
15
|
+
* A leaf is considered visible when `isChecked` is not explicitly `false`.
|
|
16
|
+
* When exactly one visible leaf remains in a group, the visible leaf is
|
|
17
|
+
* returned with `checkable: false`, and all item leaves in that group are
|
|
18
|
+
* returned with `draggable: false`. Groups with zero or two or more visible
|
|
19
|
+
* leaves are left unchanged.
|
|
20
|
+
*
|
|
21
|
+
* @param item - A top-level draggable list item node, potentially containing
|
|
22
|
+
* named group sub-nodes with leaf items.
|
|
23
|
+
* @returns A new item node with the last-visible-leaf protection applied, or
|
|
24
|
+
* the original node if no protection is needed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function protectLastVisibleLeafInGroups(item: DraggableListItemNode): DraggableListItemNode;
|
|
27
|
+
/**
|
|
28
|
+
* Recursively collects IDs of all leaf item nodes from a draggable list tree.
|
|
29
|
+
*
|
|
30
|
+
* @param nodes - The array of nodes to flatten.
|
|
31
|
+
* @param isLeaf - Optional predicate that marks a node as a leaf, stopping further descent into its children.
|
|
32
|
+
* @returns A flat array of IDs for all resolved leaf item nodes in depth-first order.
|
|
33
|
+
*/
|
|
34
|
+
export declare function flattenIncludedLeafIds(nodes: DraggableListNode[], isLeaf?: (node: DraggableListItemNode) => boolean): string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
/**
|
|
3
|
+
* Registers AG Grid column-change event listeners on the provided grid API and cleans them up on unmount,
|
|
4
|
+
* invoking the given callback whenever column visibility, order, pinning, or structure changes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAgGridColumnGridListeners(api: GridApi | null | undefined, listener: () => void): void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { GridApi } from 'ag-grid-community';
|
|
2
|
-
import { AgGridInitialColumnsState } from '
|
|
2
|
+
import { AgGridInitialColumnsState } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Manages per-URN AG Grid column state, capturing the initial column layout on
|
|
5
|
+
* grid ready and restoring any user-applied column preferences when the active
|
|
6
|
+
* URN changes.
|
|
7
|
+
*/
|
|
3
8
|
export declare function useAgGridColumnPreferences({ currentUrn, }: {
|
|
4
9
|
currentUrn: string;
|
|
5
10
|
}): {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { DraggableListItemNode, DraggableListNode, ItemClickEvent, ToggleCheckedEvent, ToggleExpandedEvent } from '
|
|
2
|
-
import { ColumnPanelFilter } from '
|
|
1
|
+
import { DraggableListItemNode, DraggableListNode, ItemClickEvent, ToggleCheckedEvent, ToggleExpandedEvent } from '../../../../../../../ui-components/src/index';
|
|
2
|
+
import { ColumnPanelFilter } from '../types';
|
|
3
3
|
import { GridApi } from 'ag-grid-community';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Manages column panel state for an AG Grid instance, deriving a draggable item
|
|
6
|
+
* tree from the grid's column state and returning handlers for toggling visibility,
|
|
7
|
+
* reordering columns, and expanding or collapsing grouped entries.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useAgGridColumnsPanel({ api, searchQuery, includeColumn, enrichItem, onSubItemOrderChange, onSubItemVisibilityChange, }: {
|
|
5
10
|
api: GridApi | null;
|
|
6
11
|
searchQuery: string;
|
|
7
12
|
includeColumn?: ColumnPanelFilter;
|
|
8
13
|
enrichItem?: (item: DraggableListItemNode) => DraggableListItemNode;
|
|
14
|
+
onSubItemOrderChange?: (urn: string, colId: string, order: string[]) => void;
|
|
15
|
+
onSubItemVisibilityChange?: (urn: string, colId: string, dimensionKey: string, hidden: boolean) => void;
|
|
9
16
|
}): {
|
|
10
17
|
items: DraggableListNode[];
|
|
11
18
|
visibleItems: DraggableListNode[];
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DraggableListItemNode } from '../../../../../../ui-components/src/index';
|
|
2
|
+
import { DatasetDimensionsScheme, DimensionConfig, StructuralData } from '../../../../../../sdmx-toolkit/src/index';
|
|
3
|
+
import { DimensionCustomizationMap, DimensionKeyCustomization } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Column IDs that can be enriched with per-dataset group nodes.
|
|
6
|
+
* Pass a subset as `enrichedColIds` to limit which columns get the grouped sub-items treatment.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ALL_AGGREGATED_COL_IDS: ReadonlySet<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Default set of columns that receive the grouped sub-items treatment.
|
|
11
|
+
* Only the indicator column is enriched by default; country and frequency
|
|
12
|
+
* columns show a flat value without internal dimension breakdown.
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEFAULT_ENRICHED_COL_IDS: ReadonlySet<string>;
|
|
15
|
+
interface CrossDatasetColumnsInfo {
|
|
16
|
+
dataQueries: Array<{
|
|
17
|
+
urn: string;
|
|
18
|
+
}>;
|
|
19
|
+
structuresMap: Map<string, StructuralData | undefined>;
|
|
20
|
+
getDimensionsScheme: (urn: string) => DatasetDimensionsScheme | undefined;
|
|
21
|
+
getDimensionConfig: (urn: string, dimKey: string) => DimensionConfig | undefined;
|
|
22
|
+
locale: string;
|
|
23
|
+
dimensionCustomization?: DimensionCustomizationMap;
|
|
24
|
+
enrichedColIds?: ReadonlySet<string>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Applies ordering and hidden-key filtering from a customization record to a list of dimension keys.
|
|
28
|
+
*
|
|
29
|
+
* @param dimensionKeys - The original ordered list of dimension keys for a column.
|
|
30
|
+
* @param custom - Optional customization describing explicit ordering and a set of keys to hide.
|
|
31
|
+
* @returns A reordered and filtered array of dimension keys.
|
|
32
|
+
*/
|
|
33
|
+
export declare function applyDimensionKeyCustomization(dimensionKeys: string[], custom: DimensionKeyCustomization | undefined): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Returns a mapping function that enriches an aggregated draggable list item with
|
|
36
|
+
* per-dataset dimension sub-items and group nodes derived from cross-dataset structural data.
|
|
37
|
+
*
|
|
38
|
+
* @param info - Context containing data queries, structural metadata, dimension scheme resolvers,
|
|
39
|
+
* locale, and optional dimension customizations used to build child groups.
|
|
40
|
+
* @returns A function that transforms a `DraggableListItemNode`, replacing aggregated column
|
|
41
|
+
* items with nested group/leaf nodes; non-aggregated items are returned unchanged.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildCrossDatasetEnrichItem(info: CrossDatasetColumnsInfo): (item: DraggableListItemNode) => DraggableListItemNode;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a composite sub-item identifier by joining a URN and a dimension key with a separator.
|
|
3
|
+
*
|
|
4
|
+
* @param urn - The URN of the parent dimension item.
|
|
5
|
+
* @param dimensionKey - The key that identifies the specific sub-item within the dimension.
|
|
6
|
+
* @returns A string combining the URN and dimension key, suitable for use as a unique sub-item ID.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildDimensionSubItemId(urn: string, dimensionKey: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns whether the given ID was produced by `buildDimensionSubItemId` and encodes a sub-item.
|
|
11
|
+
*
|
|
12
|
+
* @param id - The ID string to test.
|
|
13
|
+
* @returns `true` when the ID contains the sub-item separator, `false` otherwise.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isDimensionSubItemId(id: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Splits a composite sub-item ID created by `buildDimensionSubItemId` back into its parts.
|
|
18
|
+
*
|
|
19
|
+
* @param id - A sub-item ID previously produced by `buildDimensionSubItemId`.
|
|
20
|
+
* @returns An object containing the original `urn` and `dimensionKey` encoded in the ID.
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseDimensionSubItemId(id: string): {
|
|
23
|
+
urn: string;
|
|
24
|
+
dimensionKey: string;
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getExternalLinkFromContext(context: unknown, urn: string | undefined): string | undefined;
|
package/index.d.ts
CHANGED
|
@@ -23,3 +23,4 @@ export { ConversationViewSidePanelProvider, useConversationViewSidePanelOptional
|
|
|
23
23
|
export type { ConversationViewSidePanelConfig, ConversationViewSidePanelScope, } from './components/ConversationView/SidePanel/ConversationViewSidePanelContext';
|
|
24
24
|
export { ConversationViewFeatureTogglesProvider, useConversationViewFeatureToggles, } from './context/ConversationViewFeatureTogglesContext';
|
|
25
25
|
export type { ConversationViewFeatureToggles } from './context/ConversationViewFeatureTogglesContext';
|
|
26
|
+
export { CrossDatasetAttachmentsProvider, useCrossDatasetAttachments, } from './context/CrossDatasetAttachmentsContext';
|