@sisense/sdk-ui 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/ai.cjs +1 -1
  2. package/dist/ai.js +4 -4
  3. package/dist/analytics-composer.cjs +1 -1
  4. package/dist/analytics-composer.js +4 -4
  5. package/dist/{derive-chart-family-Cqw-HJq1.cjs → derive-chart-family-Cjjn5U5S.cjs} +83 -83
  6. package/dist/{derive-chart-family-woVAnbRi.js → derive-chart-family-ci86jmVk.js} +2117 -2116
  7. package/dist/{dimensions-oGJ_aWd5.cjs → dimensions-COtPNdpu.cjs} +1 -1
  8. package/dist/{dimensions-BHdLQaOB.js → dimensions-wzj4u0MX.js} +1 -1
  9. package/dist/index.cjs +17 -17
  10. package/dist/index.js +7119 -6835
  11. package/dist/index.umd.js +311 -311
  12. package/dist/packages/sdk-ui/src/analytics-composer/common/utils.d.ts +18 -0
  13. package/dist/packages/sdk-ui/src/api/types/dashboard-dto.d.ts +4 -0
  14. package/dist/packages/sdk-ui/src/app/client-application.d.ts +25 -6
  15. package/dist/packages/sdk-ui/src/chart/advanced-chart.d.ts +1 -1
  16. package/dist/packages/sdk-ui/src/chart-data-options/types.d.ts +8 -0
  17. package/dist/packages/sdk-ui/src/chart-data-options/utils.d.ts +8 -1
  18. package/dist/packages/sdk-ui/src/common/components/modal/index.d.ts +1 -1
  19. package/dist/packages/sdk-ui/src/common/components/modal/modal-context.d.ts +0 -6
  20. package/dist/packages/sdk-ui/src/common/hooks/use-modal.d.ts +14 -0
  21. package/dist/packages/sdk-ui/src/common/icons/jtd-jumpable-icon.d.ts +1 -0
  22. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/components/resizable-columns.d.ts +7 -3
  23. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/const.d.ts +2 -2
  24. package/dist/packages/sdk-ui/src/dashboard/components/editable-layout/helpers.d.ts +6 -0
  25. package/dist/packages/sdk-ui/src/dashboard/components/jtd-dashboard.d.ts +2 -2
  26. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/index.d.ts +5 -0
  27. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-filters.d.ts +95 -0
  28. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-handlers.d.ts +46 -0
  29. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-menu.d.ts +47 -0
  30. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-types.d.ts +93 -0
  31. package/dist/packages/sdk-ui/src/dashboard/hooks/jtd/jtd-widget-transforms.d.ts +48 -0
  32. package/dist/packages/sdk-ui/src/dashboard/hooks/use-jtd.d.ts +1 -92
  33. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/utils.d.ts +8 -0
  34. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +18 -2
  35. package/dist/packages/sdk-ui/src/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +2 -2
  36. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +1 -0
  37. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +2 -0
  38. package/dist/packages/sdk-ui/src/utils/parseISOWithTimezoneCheck.d.ts +9 -0
  39. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +9 -9
  40. package/dist/{use-common-filters-Br-CoziA.js → use-common-filters-BTk7vuUo.js} +3930 -3886
  41. package/dist/{use-common-filters-CCXbao1t.cjs → use-common-filters-Bf8KKBN2.cjs} +77 -77
  42. package/dist/{widget-composer-BCNu5BzM.js → widget-composer-BtqAxkpr.js} +110 -92
  43. package/dist/{widget-composer-DheWJukc.cjs → widget-composer-CJDaEkCY.cjs} +7 -7
  44. package/package.json +7 -7
@@ -1,100 +1,8 @@
1
1
  import { type Filter } from '@sisense/sdk-data';
2
2
  import { WidgetProps } from '../../props.js';
3
3
  import { OpenMenuFn } from '../../common/components/menu/types.js';
4
- import { DataPoint } from '../../types';
5
4
  import { WidgetsOptions } from '../../index-typedoc';
6
- import { JTDConfig, JTDDrillTarget } from '../../widget-by-id/types';
7
- import React from 'react';
8
- import { SizeMeasurement } from '../../types';
9
5
  /**
10
- * Jump to Dashboard (JTD) Filter Merging Logic:
11
- *
12
- * When a user clicks on a datapoint to open a JTD modal, multiple types of filters are merged:
13
- *
14
- * 1. **Generated Filters**: Created from the clicked datapoint's category and breakBy entries
15
- * 2. **Dashboard Filters**: Current dashboard filters (filtered by includeDashFilterDims)
16
- * 3. **Widget Filters**: Original widget-specific filters (filtered by includeWidgetFilterDims)
17
- * 4. **Formula Context Filters**: NEW - Embedded filters from the clicked widget's datapoint calculations
18
- *
19
- * ## Formula Context Filters (New Feature)
20
- *
21
- * Formula context filters are embedded within datapoint calculations and represent intrinsic
22
- * filters that are part of the measure/column computation itself. They are extracted only from
23
- * the specific widget that was clicked, not from all widgets. For example:
24
- *
25
- * ```
26
- * clickedWidget.dataOptions.value[0].column.context = {
27
- * "13FC1-655": {
28
- * "type": "filter",
29
- * "filterType": "numeric",
30
- * "attribute": { ... },
31
- * "valueA": 10,
32
- * "valueB": 27249.89453125
33
- * }
34
- * }
35
- * ```
36
- *
37
- * These filters:
38
- * - Represent calculation constraints that are intrinsic to the clicked widget's datapoint
39
- * - Are extracted from all dataOption fields of the clicked widget (value, category, breakBy, x, y, etc.)
40
- * - Support both object format and string reference format
41
- *
42
- * ## Duplicate Filter Handling
43
- *
44
- * Complex formulas like `AVG(cost) - AVG(PREVMONTH(cost))` can contain multiple filters on the same dimension.
45
- * The `sendFormulaFiltersDuplicate` parameter controls how duplicates are handled:
46
- *
47
- * - **"none"**: Exclude all duplicate filters (only include filters that appear once)
48
- * - **Number (1+)**: Include only the filter at that position (1-indexed). Invalid numbers treated as "none"
49
- * - **Other values**: Include only the first duplicate filter
50
- *
51
- * Examples:
52
- * - Formula has 2 filters on Commerce.Cost dimension
53
- * - `sendFormulaFiltersDuplicate = "none"` → No Cost filters included
54
- * - `sendFormulaFiltersDuplicate = 1` → Include first Cost filter
55
- * - `sendFormulaFiltersDuplicate = 2` → Include second Cost filter
56
- * - `sendFormulaFiltersDuplicate = 3` → Invalid (out of range), treat as "none"
57
- */
58
- export declare const getFormulaContextFilters: (point: DataPoint, clickedWidget: WidgetProps, jtdConfig: JTDConfig) => Filter[];
59
- /**
60
- * @internal
61
- * Handle duplicate formula filters based on sendFormulaFiltersDuplicate parameter
62
- * @param filters - The filters to handle
63
- * @param sendFormulaFiltersDuplicate - The send formula filters duplicate parameter
64
- * @returns The filtered filters
65
- */
66
- export declare const handleFormulaDuplicateFilters: (filters: Filter[], sendFormulaFiltersDuplicate?: number | 'none') => Filter[];
67
- export declare const getFiltersFromDataPoint: (point: DataPoint) => Filter[];
68
- /**
69
- * Filter filters based on allowed dimension names, supporting cascading filters
70
- *
71
- * @param filters - The filters to filter
72
- * @param allowedDims - The allowed dimensions
73
- * @returns The filtered filters
74
- */
75
- export declare const filterByAllowedDimensions: (filters: Filter[], allowedDims?: string[]) => Filter[];
76
- /**
77
- * @internal
78
- * Get the JTD click handler for a specific data point of the specific widget
79
- * @param jtdConfig - The JTD config
80
- * @param drillTarget - The drill target
81
- * @param widgetProps - The widget props
82
- * @param point - The data point
83
- * @param dashboardFilters - The dashboard filters
84
- * @param originalWidgetFilters - The original widget filters
85
- * @param openModal - The open modal function
86
- * @returns The JTD click handler
87
- */
88
- export declare const getJtdClickHandler: (jtdConfig: JTDConfig, drillTarget: JTDDrillTarget, widgetProps: WidgetProps, point: DataPoint, dashboardFilters: Filter[], originalWidgetFilters: Filter[], openModal: (options: {
89
- title: string;
90
- width?: number;
91
- height?: number;
92
- measurement?: SizeMeasurement;
93
- allowResize?: boolean;
94
- content: React.ReactNode;
95
- }) => Promise<string>) => () => Promise<void>;
96
- /**
97
- * @internal
98
6
  * Jump to Dashboard (JTD) hook.
99
7
  * Implements the JTD functionality for each widget with JTD config.
100
8
  * @param widgetOptions - The widget options of the dashboard
@@ -111,3 +19,4 @@ export declare const useJtd: ({ widgetOptions, dashboardFilters, widgetFilters,
111
19
  }) => {
112
20
  connectToWidgetProps: (widgetProps: WidgetProps) => WidgetProps;
113
21
  };
22
+ export * from './jtd';
@@ -5,3 +5,11 @@ export declare function createExcludeMembersFilter(attribute: Attribute, members
5
5
  export declare function getMembersWithoutDeactivated(filter: Filter, selectedMembers: string[]): string[];
6
6
  export declare function getMembersWithDeactivated(filter: Filter): string[];
7
7
  export declare function getConfigWithUpdatedDeactivated(filter: Filter, selectedMembers: string[]): import("@sisense/sdk-data").FilterConfig;
8
+ /**
9
+ * Returns the granularities that are restricted by the parent filters (previous cascading levels)
10
+ *
11
+ * @param datetimeAttribute - The datetime attribute
12
+ * @param parentFilters - The parent filters
13
+ * @returns The restricted granularities
14
+ */
15
+ export declare function getRestrictedGranularities(datetimeAttribute: Attribute, parentFilters?: Filter[]): string[];
@@ -1,6 +1,6 @@
1
1
  import { CommonFiltersOptions } from '../../common-filters/types';
2
2
  import { ColorPaletteTheme, TabberConfig } from '../../types';
3
- import { JTDConfig } from '../../widget-by-id/types';
3
+ import { JtdConfig } from '../../widget-by-id/types';
4
4
  export type { CommonFiltersOptions, CommonFiltersApplyMode, FiltersIgnoringRules, } from '../../common-filters/types';
5
5
  /**
6
6
  * Part of Dashboard layout, which describes how widgets are arranged in a cell
@@ -14,6 +14,22 @@ export interface WidgetsPanelCell {
14
14
  * @internal
15
15
  */
16
16
  height?: number | string;
17
+ /**
18
+ * @internal
19
+ */
20
+ minHeight?: number;
21
+ /**
22
+ * @internal
23
+ */
24
+ maxHeight?: number;
25
+ /**
26
+ * @internal
27
+ */
28
+ minWidth?: number;
29
+ /**
30
+ * @internal
31
+ */
32
+ maxWidth?: number;
17
33
  widgetId: string;
18
34
  }
19
35
  /**
@@ -54,7 +70,7 @@ export type WidgetsOptions = Record<WidgetId, {
54
70
  * Jump to dashboard config for widgets
55
71
  @internal
56
72
  */
57
- jtdConfig?: JTDConfig;
73
+ jtdConfig?: JtdConfig;
58
74
  }>;
59
75
  /**
60
76
  * Options for TabberWidets in a dashboard
@@ -2,7 +2,7 @@ import type { PivotTableDataOptions } from '../../../chart-data-options/types.js
2
2
  import type { DateFormatter, HeaderCellFormatter } from '../types.js';
3
3
  export declare const createHeaderCellValueFormatter: (dataOptions: PivotTableDataOptions, dateFormatter: DateFormatter) => HeaderCellFormatter;
4
4
  /**
5
- * Formats the date time string.
5
+ * Formats the date time string or Date object.
6
6
  * If the date is invalid, it returns the original value.
7
7
  */
8
- export declare function formatDatetimeString(value: string, dateFormatter: DateFormatter, dateFormat?: string): string;
8
+ export declare function formatDatetimeString(value: string | Date, dateFormatter: DateFormatter, dateFormat?: string): string;
@@ -372,6 +372,7 @@ export declare const translation: {
372
372
  };
373
373
  jumpToDashboard: {
374
374
  defaultCaption: string;
375
+ jumpableTooltip: string;
375
376
  };
376
377
  };
377
378
  /**
@@ -382,6 +382,7 @@ export declare const resources: {
382
382
  };
383
383
  jumpToDashboard: {
384
384
  defaultCaption: string;
385
+ jumpableTooltip: string;
385
386
  };
386
387
  };
387
388
  uk: {
@@ -758,6 +759,7 @@ export declare const resources: {
758
759
  };
759
760
  jumpToDashboard: {
760
761
  defaultCaption: string;
762
+ jumpableTooltip: string;
761
763
  };
762
764
  };
763
765
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parses an ISO date string with timezone handling.
3
+ * If the date string doesn't have a timezone offset, it appends 'Z' (UTC) to ensure consistent parsing.
4
+ * This prevents parseISO from adding timezone based on daylight saving time.
5
+ *
6
+ * @param dateString - The ISO date string to parse
7
+ * @returns A Date object parsed from the string
8
+ */
9
+ export declare function parseISOWithTimezoneCheck(dateString: string): Date;
@@ -47,7 +47,7 @@ export interface WidgetDto {
47
47
  drillHistory?: PanelItem[];
48
48
  usedFormulasMapping?: any;
49
49
  };
50
- drillToDashboardConfig?: JTDConfigDto;
50
+ drillToDashboardConfig?: JtdConfigDto;
51
51
  style: WidgetStyle;
52
52
  title: string;
53
53
  desc: string | null;
@@ -514,11 +514,11 @@ export type TextWidgetDtoStyle = {
514
514
  textAlign: 'center';
515
515
  };
516
516
  };
517
- export type JTDDrillTarget = {
517
+ export type JtdDrillTarget = {
518
518
  caption: string;
519
519
  id: string;
520
520
  };
521
- export type JTDConfigDto = {
521
+ export type JtdConfigDto = {
522
522
  drilledDashboardPrefix: string;
523
523
  drilledDashboardsFolderPrefix: string;
524
524
  displayFilterPane: boolean;
@@ -547,7 +547,7 @@ export type JTDConfigDto = {
547
547
  showFolderNameOnMenuSelection: boolean;
548
548
  resetDashFiltersAfterJTD: boolean;
549
549
  sameCubeRestriction: boolean;
550
- showJTDIcon: boolean;
550
+ showJTDIcon?: boolean;
551
551
  sendPieChartMeasureFiltersOnClick: boolean;
552
552
  forceZeroInsteadNull: boolean;
553
553
  mergeTargetDashboardFilters: boolean;
@@ -560,26 +560,26 @@ export type JTDConfigDto = {
560
560
  includeDashFilterDims?: string[];
561
561
  includeWidgetFilterDims?: string[];
562
562
  };
563
- export declare enum JTDNavigateType {
563
+ export declare enum JtdNavigateType {
564
564
  CLICK = "click",
565
565
  RIGHT_CLICK = "rightclick",
566
566
  PIVOT_LINK = "pivotlink",
567
567
  BLOX = "blox"
568
568
  }
569
- export type JTDConfig = {
569
+ export type JtdConfig = {
570
570
  drilledDashboardPrefix?: string;
571
571
  displayFilterPane?: boolean;
572
572
  displayToolbarRow?: boolean;
573
573
  drillToDashboardRightMenuCaption?: string;
574
- navigateType?: JTDNavigateType;
574
+ navigateType?: JtdNavigateType;
575
575
  includeDashFilterDims?: string[];
576
576
  includeWidgetFilterDims?: string[];
577
- drillTargets: JTDDrillTarget[];
577
+ drillTargets: JtdDrillTarget[];
578
578
  modalWindowResize?: boolean;
579
579
  modalWindowMeasurement?: SizeMeasurement;
580
580
  modalWindowWidth?: number;
581
581
  modalWindowHeight?: number;
582
- showJTDIcon?: boolean;
582
+ showJtdIcon?: boolean;
583
583
  mergeTargetDashboardFilters?: boolean;
584
584
  sendFormulaFiltersDuplicate?: number | 'none' | undefined;
585
585
  enabled?: boolean;