@sisense/sdk-ui 1.33.0 → 2.0.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 (112) hide show
  1. package/dist/ai.cjs +9 -9
  2. package/dist/ai.js +566 -578
  3. package/dist/analytics-composer.cjs +120 -119
  4. package/dist/analytics-composer.js +3235 -2506
  5. package/dist/{derive-chart-family-nTKwlMms.js → derive-chart-family-BLaI9-3r.js} +27266 -27205
  6. package/dist/derive-chart-family-CxqjTyNt.cjs +758 -0
  7. package/dist/dimensions-C-VKss5V.cjs +1 -0
  8. package/dist/dimensions-Cfq9FexH.js +200 -0
  9. package/dist/index.cjs +31 -18
  10. package/dist/index.js +6117 -6185
  11. package/dist/packages/sdk-ui/src/ai/ai-context-provider.d.ts +13 -6
  12. package/dist/packages/sdk-ui/src/ai/chat-config.d.ts +4 -2
  13. package/dist/packages/sdk-ui/src/ai/chatbot.d.ts +17 -7
  14. package/dist/packages/sdk-ui/src/ai/custom-ai-context-provider.d.ts +4 -6
  15. package/dist/packages/sdk-ui/src/ai/get-nlg-insights.d.ts +0 -20
  16. package/dist/packages/sdk-ui/src/ai/index.d.ts +6 -4
  17. package/dist/packages/sdk-ui/src/ai/use-final-nlq-response.d.ts +20 -0
  18. package/dist/packages/sdk-ui/src/ai/use-get-nlg-insights.d.ts +0 -12
  19. package/dist/packages/sdk-ui/src/ai/use-get-nlq-result.d.ts +1 -4
  20. package/dist/packages/sdk-ui/src/ai/use-get-query-recommendations.d.ts +1 -4
  21. package/dist/packages/sdk-ui/src/analytics-composer/{common → code}/stringify-props.d.ts +10 -2
  22. package/dist/packages/sdk-ui/src/analytics-composer/common/custom-superjson.d.ts +16 -0
  23. package/dist/packages/sdk-ui/src/analytics-composer/dashboard/dashboard-composer.d.ts +8 -0
  24. package/dist/packages/sdk-ui/src/analytics-composer/dashboard/stringify-widgets.d.ts +3 -0
  25. package/dist/packages/sdk-ui/src/analytics-composer/dashboard/to-dashboard-code.d.ts +3 -0
  26. package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +4 -0
  27. package/dist/packages/sdk-ui/src/analytics-composer/query/index.d.ts +1 -0
  28. package/dist/packages/sdk-ui/src/analytics-composer/query/query-translator.d.ts +1 -0
  29. package/dist/packages/sdk-ui/src/analytics-composer/query/simplify-metadata-item.d.ts +9 -0
  30. package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +95 -5
  31. package/dist/packages/sdk-ui/src/analytics-composer/widget/chart-options/get-widget-options.d.ts +1 -1
  32. package/dist/packages/sdk-ui/src/analytics-composer/widget/to-widget-code.d.ts +3 -1
  33. package/dist/packages/sdk-ui/src/api/rest-api.d.ts +3 -0
  34. package/dist/packages/sdk-ui/src/app/client-application.d.ts +3 -55
  35. package/dist/packages/sdk-ui/src/area-range-chart.d.ts +0 -1
  36. package/dist/packages/sdk-ui/src/chart-data/table-data.d.ts +10 -0
  37. package/dist/packages/sdk-ui/src/common/components/grouped-items-browser/types.d.ts +2 -0
  38. package/dist/packages/sdk-ui/src/common/components/menu/types.d.ts +1 -0
  39. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/index.d.ts +1 -0
  40. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/hooks/use-data-accumulation.d.ts +1 -0
  41. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/{utils/get-hook-state-result.d.ts → hooks/use-get-hook-state-result.d.ts} +3 -2
  42. package/dist/packages/sdk-ui/src/common/hooks/decorators/with-lazy-loading/helpers/utils/index.d.ts +0 -1
  43. package/dist/packages/sdk-ui/src/common/hooks/use-defaults.d.ts +1 -0
  44. package/dist/packages/sdk-ui/src/dashboard/components/content-panel.d.ts +1 -0
  45. package/dist/packages/sdk-ui/src/dashboard/dashboard-helpers.d.ts +0 -12
  46. package/dist/packages/sdk-ui/src/dashboard/index.d.ts +1 -1
  47. package/dist/packages/sdk-ui/src/dashboard/types.d.ts +9 -3
  48. package/dist/packages/sdk-ui/src/dashboard/use-composed-dashboard.d.ts +1 -4
  49. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-data-browser.d.ts +8 -1
  50. package/dist/packages/sdk-ui/src/data-browser/add-filter-popover/add-filter-popover.d.ts +6 -1
  51. package/dist/packages/sdk-ui/src/data-browser/dimensions-browser/types.d.ts +8 -0
  52. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-filter-tile.d.ts +2 -0
  53. package/dist/packages/sdk-ui/src/filters/components/cascading-filter-tile/cascading-level-filter.d.ts +3 -1
  54. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/index.d.ts +0 -1
  55. package/dist/packages/sdk-ui/src/filters/components/date-filter/relative-date-filter-tile/relative-date-filter.d.ts +5 -1
  56. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-context.d.ts +3 -1
  57. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor-popover.d.ts +2 -1
  58. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/filter-editor.d.ts +2 -1
  59. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/hooks/use-get-attribute-stats.d.ts +2 -1
  60. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/sections/common/granularities.d.ts +36 -6
  61. package/dist/packages/sdk-ui/src/filters/components/filter-editor-popover/types.d.ts +2 -0
  62. package/dist/packages/sdk-ui/src/filters/components/filter-tile-container.d.ts +1 -0
  63. package/dist/packages/sdk-ui/src/filters/components/filter-tile.d.ts +5 -4
  64. package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-existing-filter-editing.d.ts +1 -1
  65. package/dist/packages/sdk-ui/src/filters/components/filters-panel/hooks/use-new-filter-adding.d.ts +3 -1
  66. package/dist/packages/sdk-ui/src/filters/hooks/use-get-filter-members.d.ts +3 -3
  67. package/dist/packages/sdk-ui/src/index-typedoc.d.ts +4 -1
  68. package/dist/packages/sdk-ui/src/index.d.ts +4 -3
  69. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-dto-utils.d.ts +0 -1
  70. package/dist/packages/sdk-ui/src/models/dashboard/translate-dashboard-utils.d.ts +1 -0
  71. package/dist/packages/sdk-ui/src/models/dashboard/types.d.ts +1 -0
  72. package/dist/packages/sdk-ui/src/models/dashboard/use-dashboard-model/use-dashboard-model-reducer.d.ts +15 -1
  73. package/dist/packages/sdk-ui/src/models/hierarchy/types.d.ts +0 -1
  74. package/dist/packages/sdk-ui/src/models/widget/types.d.ts +1 -1
  75. package/dist/packages/sdk-ui/src/models/widget/widget-model-translator.d.ts +2 -12
  76. package/dist/packages/sdk-ui/src/models/widget/widget-model.d.ts +1 -125
  77. package/dist/packages/sdk-ui/src/plugins-provider/custom-plugins-provider.d.ts +4 -9
  78. package/dist/packages/sdk-ui/src/props.d.ts +27 -45
  79. package/dist/packages/sdk-ui/src/query-execution/index.d.ts +1 -1
  80. package/dist/packages/sdk-ui/src/query-execution/types.d.ts +2 -4
  81. package/dist/packages/sdk-ui/src/sisense-context/custom-sisense-context-provider.d.ts +2 -4
  82. package/dist/packages/sdk-ui/src/theme-provider/custom-theme-provider.d.ts +5 -8
  83. package/dist/packages/sdk-ui/src/translation/resources/en.d.ts +5 -1
  84. package/dist/packages/sdk-ui/src/translation/resources/index.d.ts +10 -2
  85. package/dist/packages/sdk-ui/src/types.d.ts +60 -40
  86. package/dist/packages/sdk-ui/src/utils/{utility-types.d.ts → utility-types/basic-utility-types.d.ts} +0 -34
  87. package/dist/packages/sdk-ui/src/utils/utility-types/distributive-omit.d.ts +24 -0
  88. package/dist/packages/sdk-ui/src/utils/utility-types/index.d.ts +4 -0
  89. package/dist/packages/sdk-ui/src/utils/utility-types/rest-api-hook-state.d.ts +35 -0
  90. package/dist/packages/sdk-ui/src/utils/utility-types/soft-union.d.ts +35 -0
  91. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +2 -2
  92. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-drilldown-options.d.ts +2 -2
  93. package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-style-options.d.ts +2 -2
  94. package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +2 -2
  95. package/dist/packages/sdk-ui/src/widget-by-id/use-get-dashboard-model-and-widget-model.d.ts +1 -0
  96. package/dist/packages/sdk-ui/src/widget-by-id/utils.d.ts +23 -16
  97. package/dist/packages/sdk-ui/src/widgets/tabber-widget.d.ts +5 -0
  98. package/dist/packages/sdk-ui/src/widgets/widget.d.ts +0 -1
  99. package/dist/{use-common-filters-BNKt9a0z.cjs → use-common-filters-BGGGgJJ5.cjs} +48 -48
  100. package/dist/{use-common-filters--WPkVexd.js → use-common-filters-Cmyb86sc.js} +5339 -5351
  101. package/dist/widget-composer-BJURHrVD.cjs +428 -0
  102. package/dist/widget-composer-C4rwNt4P.js +959 -0
  103. package/package.json +14 -10
  104. package/dist/derive-chart-family-B4sA-ao-.cjs +0 -758
  105. package/dist/packages/sdk-ui/src/ai/common/beta-label.d.ts +0 -1
  106. package/dist/packages/sdk-ui/src/analytics-composer/widget/stringify-props.d.ts +0 -8
  107. package/dist/packages/sdk-ui/src/filters/components/criteria-filter-tile/types.d.ts +0 -7
  108. package/dist/packages/sdk-ui/src/utils/check-and-notify-about-deprecated-prop.d.ts +0 -1
  109. package/dist/packages/sdk-ui/src/widget-by-id/dashboard-widget.d.ts +0 -27
  110. package/dist/widget-composer-CobNNZ1e.js +0 -742
  111. package/dist/widget-composer-DPqi_qzU.cjs +0 -316
  112. /package/dist/packages/sdk-ui/src/analytics-composer/{widget → code}/stringify-filters.d.ts +0 -0
@@ -13,6 +13,7 @@ import { HighchartsOptionsInternal } from './chart-options-processor/chart-optio
13
13
  import { CSSProperties } from 'react';
14
14
  import { GeoDataElement, RawGeoDataElement } from './chart/restructured-charts/areamap-chart/types';
15
15
  import { TabCornerRadius, TabInterval, TabSize } from './widgets/tabber-widget';
16
+ import { SoftUnion } from './utils/utility-types';
16
17
  export type { SortDirection, PivotRowsSort } from '@sisense/sdk-data';
17
18
  export type { AppConfig } from './app/client-application';
18
19
  export type { DateConfig } from './query/date-formats';
@@ -70,12 +71,12 @@ export type SeriesLabels = {
70
71
  /**
71
72
  * Boolean flag that defines if value should be shown in series labels
72
73
  * (if not specified, value will be shown by default)
73
- * */
74
+ */
74
75
  showValue?: boolean;
75
76
  /**
76
77
  * Boolean flag that defines if percentage should be shown in series labels
77
78
  * (only applicable for subtypes that support percentage, like "stacked100")
78
- * */
79
+ */
79
80
  showPercentage?: boolean;
80
81
  };
81
82
  /**
@@ -320,24 +321,6 @@ export type IndicatorStyleOptions = (NumericSimpleIndicatorStyleOptions | Numeri
320
321
  };
321
322
  /** Configuration options that define functional style of the various elements of the Table Component */
322
323
  export interface TableStyleOptions {
323
- /**
324
- * Boolean flag whether to fill header cells with background color
325
- *
326
- * @deprecated Use {@link TableStyleOptions#header | TableStyleOptions.header.color} instead.
327
- */
328
- headersColor?: boolean;
329
- /**
330
- * Boolean flag whether to apply background color to alternate rows.
331
- *
332
- * @deprecated Use {@link TableStyleOptions#rows | TableStyleOptions.rows.alternatingColor} instead.
333
- */
334
- alternatingRowsColor?: boolean;
335
- /**
336
- * Boolean flag whether to apply background color to alternate columns
337
- *
338
- * @deprecated Use {@link TableStyleOptions#columns | TableStyleOptions.columns.alternatingColor} instead.
339
- */
340
- alternatingColumnsColor?: boolean;
341
324
  /**
342
325
  * Vertical padding around whole table
343
326
  * Default value is 20px
@@ -668,12 +651,6 @@ export interface ChartThemeSettings {
668
651
  secondaryTextColor?: string;
669
652
  /** Background color */
670
653
  backgroundColor?: string;
671
- /**
672
- * Toolbar Background color, can be used as a secondary background color
673
- *
674
- * @deprecated
675
- */
676
- panelBackgroundColor?: string;
677
654
  /** Animation options */
678
655
  animation?: {
679
656
  /** Chart initialization animation options */
@@ -1201,7 +1178,7 @@ export interface WidgetContainerStyleOptions {
1201
1178
  * Configuration options that define functional style of the various elements of the Nlq Chart Widget
1202
1179
  *
1203
1180
  * @internal
1204
- * */
1181
+ */
1205
1182
  export type NlqChartWidgetStyleOptions = {
1206
1183
  header?: {
1207
1184
  hidden?: boolean;
@@ -1229,13 +1206,6 @@ export interface WidgetByIdStyleOptions extends WidgetContainerStyleOptions {
1229
1206
  */
1230
1207
  height?: number;
1231
1208
  }
1232
- /**
1233
- * Style settings defining the look and feel of DashboardWidget
1234
- *
1235
- * @deprecated Use {@link WidgetByIdStyleOptions} instead
1236
- */
1237
- export interface DashboardWidgetStyleOptions extends WidgetByIdStyleOptions {
1238
- }
1239
1209
  /** Style settings defining the look and feel of ChartWidget */
1240
1210
  export type ChartWidgetStyleOptions = ChartStyleOptions & WidgetContainerStyleOptions;
1241
1211
  /**
@@ -1272,12 +1242,6 @@ export declare type ColorPaletteTheme = {
1272
1242
  };
1273
1243
  /** Configuration for the drilldown */
1274
1244
  export type DrilldownOptions = {
1275
- /**
1276
- * Dimensions that can be used for drilldown
1277
- *
1278
- * @deprecated Use {@link DrilldownOptions.drilldownPaths} instead
1279
- */
1280
- drilldownDimensions?: Attribute[];
1281
1245
  /**
1282
1246
  * Dimensions and hierarchies available for drilldown on.
1283
1247
  */
@@ -1653,8 +1617,54 @@ export type CustomTranslationObject = {
1653
1617
  */
1654
1618
  namespace?: string;
1655
1619
  };
1620
+ /**
1621
+ * Translation Configuration
1622
+ */
1623
+ export type TranslationConfig = {
1624
+ /**
1625
+ * Language code to be used for translations.
1626
+ */
1627
+ language?: string;
1628
+ /**
1629
+ * Additional translation resources to be loaded.
1630
+ *
1631
+ * You can find the list of available translation keys in the translation folder of every package.
1632
+ *
1633
+ * Translation keys that are not provided will default to the English translation.
1634
+ * If translation is provided for a package other than sdk-ui, please specify the namespace property.
1635
+ *
1636
+ * Important: Do not translate parts in {{}} - these are placeholders for dynamic values and will be matched using provided variable names.
1637
+ *
1638
+ * @example
1639
+ * ```ts
1640
+ * customTranslations: [
1641
+ * {
1642
+ * language: 'fr',
1643
+ * resources: {
1644
+ * errors: {
1645
+ * invalidFilterType: 'Type de filtre invalide',
1646
+ * },
1647
+ * },
1648
+ * },
1649
+ * {
1650
+ * language: 'es',
1651
+ * namespace: 'sdkData'
1652
+ * resources: {
1653
+ * errors: {
1654
+ * measure: {
1655
+ * unsupportedType: 'Tipo de medida no compatible',
1656
+ * },
1657
+ * },
1658
+ * },
1659
+ * },
1660
+ * ]
1661
+ * ```
1662
+ */
1663
+ customTranslations?: CustomTranslationObject[];
1664
+ };
1656
1665
  /**
1657
1666
  * Single Tabber Widget tab object without styling
1667
+ *
1658
1668
  * @internal
1659
1669
  */
1660
1670
  export type TabberTab = {
@@ -1663,6 +1673,7 @@ export type TabberTab = {
1663
1673
  };
1664
1674
  /**
1665
1675
  * Tabber widget DTO style property
1676
+ *
1666
1677
  * @internal
1667
1678
  */
1668
1679
  export type TabberDtoStyle = TabberStyleProps & {
@@ -1670,6 +1681,7 @@ export type TabberDtoStyle = TabberStyleProps & {
1670
1681
  };
1671
1682
  /**
1672
1683
  * Configuration options that define style of the various elements of the Tabber component.
1684
+ *
1673
1685
  * @internal
1674
1686
  */
1675
1687
  export type TabberStyleOptions = {
@@ -1690,14 +1702,22 @@ export type TabberStyleOptions = {
1690
1702
  };
1691
1703
  /**
1692
1704
  * Configuration options that defined tabber look and feel, including tabs and active tab.
1705
+ *
1693
1706
  * @internal
1694
1707
  */
1695
1708
  export type TabberStyleProps = TabberStyleOptions & TabberConfig;
1696
1709
  /**
1697
1710
  * Tabber business logic configuration
1711
+ *
1698
1712
  * @internal
1699
1713
  */
1700
1714
  export type TabberConfig = {
1701
1715
  tabs: TabberTab[];
1702
1716
  activeTab: number;
1703
1717
  };
1718
+ /** @internal */
1719
+ export type CustomContextProviderProps<P> = SoftUnion<{
1720
+ context: P;
1721
+ } | {
1722
+ error: Error;
1723
+ }>;
@@ -61,38 +61,4 @@ export type AnyArray = any[];
61
61
  * type TRequiredB = WithRequiredProp<T, 'b'>; // { a: string; b: number; c?: boolean; }
62
62
  */
63
63
  export type WithRequiredProp<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
64
- /**
65
- * Universal generic state for hooks that fetch data from the REST API.
66
- */
67
- export type RestApiHookState<DataKey extends string, SuccessDataType extends AnyObject | AnyArray> = RestApiHookSuccessState<DataKey, SuccessDataType> | RestApiHookErrorState<DataKey> | RestApiHookLoadingState<DataKey>;
68
- /** Success state of the REST API hook */
69
- export type RestApiHookSuccessState<DataKey extends string, SuccessDataType extends AnyObject | AnyArray> = {
70
- isLoading: false;
71
- isError: false;
72
- isSuccess: true;
73
- error: undefined;
74
- status: 'success';
75
- } & {
76
- [key in DataKey]: SuccessDataType;
77
- };
78
- /** Error state of the REST API hook */
79
- export type RestApiHookErrorState<DataKey extends string> = {
80
- isLoading: false;
81
- isError: true;
82
- isSuccess: false;
83
- error: Error;
84
- status: 'error';
85
- } & {
86
- [key in DataKey]: undefined;
87
- };
88
- /** Loading state of the REST API hook */
89
- export type RestApiHookLoadingState<DataKey extends string> = {
90
- isLoading: true;
91
- isError: false;
92
- isSuccess: false;
93
- error: undefined;
94
- status: 'loading';
95
- } & {
96
- [key in DataKey]: undefined;
97
- };
98
64
  export {};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Utility type that applies `Omit` distributively over a union of types.
3
+ *
4
+ * In TypeScript, applying `Omit` directly to a union type causes the keys to be removed
5
+ * from the union "as a whole", resulting in unintended behavior. This type fixes that by
6
+ * distributing `Omit` to each member of the union individually.
7
+ *
8
+ * @template T The union of types to apply the omit to.
9
+ * @template K The keys to omit from each type in the union.
10
+ *
11
+ * @example
12
+ * type A = { type: 'a'; foo: string };
13
+ * type B = { type: 'b'; bar: number };
14
+ * type U = A | B;
15
+ *
16
+ * // Without distributive omit:
17
+ * type Broken = Omit<U, 'type'>;
18
+ * // Result: { foo?: string; bar?: number } - not a union anymore
19
+ *
20
+ * // With distributive omit:
21
+ * type Fixed = DistributiveOmit<U, 'type'>;
22
+ * // Result: { foo: string } | { bar: number } - still a union
23
+ */
24
+ export type DistributiveOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
@@ -0,0 +1,4 @@
1
+ export * from './basic-utility-types';
2
+ export * from './rest-api-hook-state';
3
+ export * from './soft-union';
4
+ export * from './distributive-omit';
@@ -0,0 +1,35 @@
1
+ import { AnyArray, AnyObject } from './basic-utility-types';
2
+ /**
3
+ * Universal generic state for hooks that fetch data from the REST API.
4
+ */
5
+ export type RestApiHookState<DataKey extends string, SuccessDataType extends AnyObject | AnyArray> = RestApiHookSuccessState<DataKey, SuccessDataType> | RestApiHookErrorState<DataKey> | RestApiHookLoadingState<DataKey>;
6
+ /** Success state of the REST API hook */
7
+ export type RestApiHookSuccessState<DataKey extends string, SuccessDataType extends AnyObject | AnyArray> = {
8
+ isLoading: false;
9
+ isError: false;
10
+ isSuccess: true;
11
+ error: undefined;
12
+ status: 'success';
13
+ } & {
14
+ [key in DataKey]: SuccessDataType;
15
+ };
16
+ /** Error state of the REST API hook */
17
+ export type RestApiHookErrorState<DataKey extends string> = {
18
+ isLoading: false;
19
+ isError: true;
20
+ isSuccess: false;
21
+ error: Error;
22
+ status: 'error';
23
+ } & {
24
+ [key in DataKey]: undefined;
25
+ };
26
+ /** Loading state of the REST API hook */
27
+ export type RestApiHookLoadingState<DataKey extends string> = {
28
+ isLoading: true;
29
+ isError: false;
30
+ isSuccess: false;
31
+ error: undefined;
32
+ status: 'loading';
33
+ } & {
34
+ [key in DataKey]: undefined;
35
+ };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Gets all unique keys from a union of object types.
3
+ *
4
+ * @template T - The union of object types.
5
+ * @returns A union of all keys present in the types in `T`.
6
+ *
7
+ * @example
8
+ * type Type1 = { a: number; b: string };
9
+ * type Type2 = { b: string; c?: boolean };
10
+ * type AllKeys = KeysOfUnion<Type1 | Type2>; // Evaluates to "a" | "b" | "c"
11
+ */
12
+ type KeysOfUnion<T> = T extends unknown ? keyof T : never;
13
+ /**
14
+ * Creates a "soft union" type from a union of object types. A soft union
15
+ * combines the properties of all types in the union, making properties
16
+ * optional with `undefined` if they are not present in a specific type
17
+ * within the union.
18
+ *
19
+ * @template T - The union of object types.
20
+ * @returns A type that represents the soft union of the types in `T`.
21
+ * Each constituent type in the union `T` is augmented with the missing
22
+ * properties from other types in `T`, typed as optional `undefined`.
23
+ *
24
+ * @example
25
+ * type Type1 = { bar: string };
26
+ * type Type2 = { agg: number };
27
+ * type SoftUnionType = SoftUnion<Type1 | Type2>;
28
+ * // Evaluates to:
29
+ * // | { bar: string; agg?: undefined }
30
+ * // | { bar?: undefined; agg: number; }
31
+ *
32
+ * @internal
33
+ */
34
+ export type SoftUnion<T, K extends PropertyKey = KeysOfUnion<T>> = T extends unknown ? T & Partial<Record<Exclude<K, keyof T>, undefined>> : never;
35
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { JaqlDataSource } from '@sisense/sdk-data';
2
2
  import { StyledMeasureColumn, StyledColumn, Color } from '../types.js';
3
- import { Panel, PanelItem, WidgetType, WidgetStyle, BoxplotWidgetStyle } from './types.js';
3
+ import { Panel, PanelItem, FusionWidgetType, WidgetStyle, BoxplotWidgetStyle } from './types.js';
4
4
  import { WidgetDataOptions } from '../models/index.js';
5
5
  /** @internal */
6
6
  export declare function applyStatisticalModels(dataOption: StyledMeasureColumn, statisticalModels?: {
@@ -38,4 +38,4 @@ export declare function extractBoxplotBoxType(style: BoxplotWidgetStyle): "iqr"
38
38
  * This is to support multi-source dashboards.
39
39
  */
40
40
  export declare function attachDataSourceToPanels(panels: Panel[], dataSource: JaqlDataSource): Panel[];
41
- export declare function extractDataOptions(widgetType: WidgetType, panels: Panel[], style: WidgetStyle, customPaletteColors?: Color[]): WidgetDataOptions;
41
+ export declare function extractDataOptions(fusionWidgetType: FusionWidgetType, panels: Panel[], style: WidgetStyle, customPaletteColors?: Color[]): WidgetDataOptions;
@@ -1,3 +1,3 @@
1
- import { Panel, PanelItem, WidgetType } from './types.js';
1
+ import { Panel, PanelItem, FusionWidgetType } from './types.js';
2
2
  import { DrilldownOptions } from '../types.js';
3
- export declare const extractDrilldownOptions: (widgetType: WidgetType, panels: Panel[], drillHistory?: PanelItem[], enableDrillToAnywhere?: boolean) => DrilldownOptions;
3
+ export declare const extractDrilldownOptions: (widgetType: FusionWidgetType, panels: Panel[], drillHistory?: PanelItem[], enableDrillToAnywhere?: boolean) => DrilldownOptions;
@@ -1,9 +1,9 @@
1
1
  import { ChartStyleOptions, TableStyleOptions, NumericBarIndicatorStyleOptions, NumericSimpleIndicatorStyleOptions, GaugeIndicatorStyleOptions, PivotTableStyleOptions, SpaceSizes, RadiusSizes, ShadowsTypes, AlignmentTypes, WidgetStyleOptions, TextWidgetStyleOptions } from '../types';
2
- import { WidgetSubtype, WidgetType, TableWidgetStyle, IndicatorWidgetStyle, PivotWidgetStyle, WidgetDesign, WidgetDto } from './types';
2
+ import { WidgetSubtype, FusionWidgetType, TableWidgetStyle, IndicatorWidgetStyle, PivotWidgetStyle, WidgetDesign, WidgetDto } from './types';
3
3
  export declare function extractTableChartStyleOptions(widgetStyle: TableWidgetStyle): TableStyleOptions;
4
4
  export declare const getIndicatorTypeSpecificOptions: (widgetSubtype: WidgetSubtype, widgetStyle: IndicatorWidgetStyle) => NumericSimpleIndicatorStyleOptions | NumericBarIndicatorStyleOptions | GaugeIndicatorStyleOptions;
5
5
  export declare function extractPivotTableStyleOptions(widgetStyle: PivotWidgetStyle): PivotTableStyleOptions;
6
- export declare function extractStyleOptions<WType extends WidgetType>(widgetType: WType, widget: WidgetDto): ChartStyleOptions | TableStyleOptions | TextWidgetStyleOptions;
6
+ export declare function extractStyleOptions<WType extends FusionWidgetType>(widgetType: WType, widget: WidgetDto): ChartStyleOptions | TableStyleOptions | TextWidgetStyleOptions;
7
7
  export declare const getFlattenWidgetDesign: (widgetDesign: WidgetDesign) => {
8
8
  backgroundColor: string;
9
9
  spaceAround: SpaceSizes;
@@ -21,7 +21,7 @@ export type TextWidgetType = 'richtexteditor';
21
21
  /**
22
22
  * The type of a widget on a dashboard.
23
23
  */
24
- export type WidgetType = CartesianWidgetType | CategoricalWidgetType | 'chart/scatter' | 'indicator' | TabularWidgetType | 'chart/boxplot' | 'map/scatter' | 'map/area' | TextWidgetType | 'plugin';
24
+ export type FusionWidgetType = CartesianWidgetType | CategoricalWidgetType | 'chart/scatter' | 'indicator' | TabularWidgetType | 'chart/boxplot' | 'map/scatter' | 'map/area' | TextWidgetType | 'plugin';
25
25
  export type WidgetSubtype = 'area/basic' | 'area/stacked' | 'area/stacked100' | 'area/spline' | 'area/stackedspline' | 'area/stackedspline100' | 'bar/classic' | 'bar/stacked' | 'bar/stacked100' | 'column/classic' | 'column/stackedcolumn' | 'column/stackedcolumn100' | 'line/basic' | 'line/spline' | 'pie/classic' | 'pie/donut' | 'pie/ring' | 'column/polar' | 'area/polar' | 'line/polar' | 'indicator/numeric' | 'indicator/gauge' | 'bubble/scatter' | 'treemap' | 'sunburst' | 'boxplot/full' | 'boxplot/hollow' | 'map/scatter' | 'areamap/world' | 'areamap/usa' | 'richtexteditor';
26
26
  export declare enum WidgetDashboardFilterMode {
27
27
  FILTER = "filter",
@@ -37,7 +37,7 @@ export declare enum WidgetDashboardFilterMode {
37
37
  */
38
38
  export interface WidgetDto {
39
39
  oid: string;
40
- type: WidgetType | string;
40
+ type: FusionWidgetType;
41
41
  subtype: WidgetSubtype | string;
42
42
  datasource: JaqlDataSource;
43
43
  metadata: {
@@ -1,6 +1,7 @@
1
1
  import { DashboardModel, WidgetModel } from '../models';
2
2
  /**
3
3
  * Custom hook for fetching a dashboard model and a widget model.
4
+ *
4
5
  * @returns
5
6
  */
6
7
  export declare function useGetDashboardModelAndWidgetModel({ widgetOid, dashboardOid, shouldLoadFullDashboard, }: {
@@ -1,25 +1,32 @@
1
1
  import { ChartSubtype } from '../chart-options-processor/subtype-to-design-options.js';
2
- import { ChartType } from '../types.js';
3
- import { Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle, WidgetSubtype, WidgetType } from './types.js';
4
- import { ChartProps, ChartWidgetProps, PivotTableWidgetProps, PluginWidgetProps, RenderToolbarHandler, TextWidgetProps, CommonWidgetProps, WithWidgetType, WidgetProps } from '../index.js';
2
+ import { ChartType, RenderToolbarHandler } from '../types.js';
3
+ import { Panel, PanelItem, TextWidgetDtoStyle, WidgetStyle, WidgetSubtype, FusionWidgetType } from './types.js';
4
+ import { ChartProps, ChartWidgetProps, PivotTableWidgetProps, PluginWidgetProps, TextWidgetProps, CommonWidgetProps, WithCommonWidgetProps, WidgetProps, WidgetType } from '../props';
5
5
  import { WidgetTypeInternal } from '../models/widget/types';
6
+ import { WidgetModel } from '../models';
6
7
  export { mergeFilters, getFilterRelationsFromJaql, convertFilterRelationsModelToJaql, getFilterCompareId, } from '@sisense/sdk-data';
7
8
  /**
8
9
  * Returns the corresponding chart type for a given widget type
9
10
  *
10
11
  * @internal
11
12
  */
12
- export declare function getChartType(widgetType: WidgetType): ChartType;
13
- export declare function getWidgetTypeFromChartType(chartType: ChartType): WidgetType;
13
+ export declare function getChartType(fusionWidgetType: FusionWidgetType): ChartType;
14
+ export declare function getFusionWidgetTypeFromChartType(chartType: ChartType): FusionWidgetType;
15
+ export declare function getFusionWidgetType(widgetType: WidgetType, chartType?: ChartType): FusionWidgetType;
16
+ export declare function getWidgetType(fusionWidgetType: FusionWidgetType): WidgetType;
14
17
  export declare function getChartSubtype(widgetSubtype: WidgetSubtype): ChartSubtype | undefined;
15
- type WidgetTypeOrString = string | WidgetType;
16
- export declare function isSupportedWidgetType(widgetType: WidgetTypeOrString): widgetType is WidgetType;
17
- export declare function isTableWidget(widgetType: WidgetTypeOrString): boolean;
18
- export declare function isPivotTableWidget(widgetType: WidgetTypeOrString): boolean;
19
- export declare function isTextWidget(widgetType: WidgetTypeOrString): boolean;
18
+ export declare function isSupportedWidgetType(fusionWidgetType: FusionWidgetType): fusionWidgetType is FusionWidgetType;
19
+ export declare function isTableFusionWidget(fusionWidgetType: FusionWidgetType): boolean;
20
+ export declare function isTableWidgetModel(widgetModel: WidgetModel): boolean;
21
+ export declare function isPivotTableFusionWidget(fusionWidgetType: FusionWidgetType): boolean;
22
+ export declare function isPivotWidget(widgetType: WidgetType): boolean;
23
+ export declare function isTextFusionWidget(fusionWidgetType: FusionWidgetType): boolean;
24
+ export declare function isTextWidget(widgetType: WidgetType): boolean;
20
25
  export declare function isTextWidgetDtoStyle(widgetStyle: WidgetStyle): widgetStyle is TextWidgetDtoStyle;
21
- export declare function isPluginWidget(widgetType: WidgetTypeOrString): boolean;
22
- export declare function isChartWidget(widgetType: WidgetTypeOrString): boolean;
26
+ export declare function isPluginFusionWidget(fusionWidgetType: FusionWidgetType): boolean;
27
+ export declare function isPluginWidget(widgetType: WidgetType): boolean;
28
+ export declare function isChartFusionWidget(fusionWidgetType: FusionWidgetType): boolean;
29
+ export declare function isChartWidget(widgetType: WidgetType): boolean;
23
30
  /**
24
31
  * Type guard for checking if the widget props is for a text widget.
25
32
  *
@@ -27,7 +34,7 @@ export declare function isChartWidget(widgetType: WidgetTypeOrString): boolean;
27
34
  * @returns whether the widget props is for a text widget
28
35
  * @internal
29
36
  */
30
- export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<TextWidgetProps, 'text'>;
37
+ export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps<TextWidgetProps, 'text'>;
31
38
  /**
32
39
  * Type guard for checking if the widget props is for a pivot table widget.
33
40
  *
@@ -35,7 +42,7 @@ export declare function isTextWidgetProps(widgetProps: CommonWidgetProps): widge
35
42
  * @returns whether the widget props is for a pivot table widget
36
43
  * @internal
37
44
  */
38
- export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<PivotTableWidgetProps, 'pivot'>;
45
+ export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps<PivotTableWidgetProps, 'pivot'>;
39
46
  /**
40
47
  * Type guard for checking if the widget props is for a plugin widget
41
48
  *
@@ -43,7 +50,7 @@ export declare function isPivotTableWidgetProps(widgetProps: CommonWidgetProps):
43
50
  * @returns whether the widget props is for a plugin widget
44
51
  * @internal
45
52
  */
46
- export declare function isPluginWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<PluginWidgetProps, 'plugin'>;
53
+ export declare function isPluginWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps<PluginWidgetProps, 'plugin'>;
47
54
  /**
48
55
  * Type guard for checking if the widget props is for a chart widget
49
56
  *
@@ -51,7 +58,7 @@ export declare function isPluginWidgetProps(widgetProps: CommonWidgetProps): wid
51
58
  * @returns whether the widget props is for a chart widget
52
59
  * @internal
53
60
  */
54
- export declare function isChartWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithWidgetType<ChartWidgetProps, 'chart'>;
61
+ export declare function isChartWidgetProps(widgetProps: CommonWidgetProps): widgetProps is WithCommonWidgetProps<ChartWidgetProps, 'chart'>;
55
62
  export declare function getInternalWidgetType(widgetProps: CommonWidgetProps): WidgetTypeInternal;
56
63
  /**
57
64
  * Registers new "onDataPointClick" handler for the Widget component
@@ -1,30 +1,35 @@
1
1
  import { TabberWidgetProps } from '../props';
2
2
  /**
3
3
  * Tabber widget tab size
4
+ *
4
5
  * @group TabberWidget
5
6
  * @internal
6
7
  */
7
8
  export type TabSize = 'SMALL' | 'MEDIUM' | 'LARGE';
8
9
  /**
9
10
  * Tabber widget tab interval
11
+ *
10
12
  * @group TabberWidget
11
13
  * @internal
12
14
  */
13
15
  export type TabInterval = 'SMALL' | 'MEDIUM' | 'LARGE';
14
16
  /**
15
17
  * Tabber widget tab alignment
18
+ *
16
19
  * @group TabberWidget
17
20
  * @internal
18
21
  */
19
22
  export type TabAlignment = 'LEFT' | 'CENTER' | 'RIGHT';
20
23
  /**
21
24
  * Tabber widget tab corner radius
25
+ *
22
26
  * @group TabberWidget
23
27
  * @internal
24
28
  */
25
29
  export type TabCornerRadius = 'SMALL' | 'MEDIUM' | 'LARGE' | 'NONE';
26
30
  /**
27
31
  * Visual representation of a Fusion's tabber widget
32
+ *
28
33
  * @param styleOptions
29
34
  * @param description
30
35
  * @param props
@@ -4,6 +4,5 @@ import { WidgetProps } from '..';
4
4
  * Facade component that renders a widget within a dashboard based on the widget type.
5
5
  *
6
6
  * @group Dashboards
7
- * @alpha
8
7
  */
9
8
  export declare const Widget: React.FC<WidgetProps>;