@sisense/sdk-ui 1.5.0 → 1.7.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 (119) hide show
  1. package/dist/ai/ai-context-provider.d.ts +1 -0
  2. package/dist/ai/api/chat-api-provider.d.ts +1 -1
  3. package/dist/ai/api/chat-history.d.ts +18 -0
  4. package/dist/ai/api/chat-rest-api.d.ts +3 -0
  5. package/dist/ai/api/errors.d.ts +4 -1
  6. package/dist/ai/api/hooks.d.ts +2 -13
  7. package/dist/ai/api/types.d.ts +21 -19
  8. package/dist/ai/chat-config.d.ts +10 -3
  9. package/dist/ai/chat-intro-blurb.d.ts +4 -0
  10. package/dist/ai/chat-style-provider.d.ts +15 -0
  11. package/dist/ai/chatbot.d.ts +8 -0
  12. package/dist/ai/{error-page.d.ts → common/error-container.d.ts} +1 -1
  13. package/dist/ai/get-nlg-query-result.d.ts +3 -3
  14. package/dist/ai/index.d.ts +2 -0
  15. package/dist/ai/messages/feedback-wrapper.d.ts +2 -1
  16. package/dist/ai/messages/insights-message.d.ts +6 -1
  17. package/dist/ai/messages/message-list-resolver.d.ts +1 -2
  18. package/dist/ai/messages/message-resolver.d.ts +1 -3
  19. package/dist/ai/messages/nlq-message-group.d.ts +10 -0
  20. package/dist/ai/suggestions/index.d.ts +1 -1
  21. package/dist/ai/suggestions/suggestion-item.d.ts +1 -2
  22. package/dist/ai/suggestions/suggestion-list.d.ts +1 -1
  23. package/dist/ai/suggestions/suggestions-with-intro.d.ts +2 -2
  24. package/dist/ai/translators/code-templates.d.ts +11 -0
  25. package/dist/ai/translators/generate-code.d.ts +9 -0
  26. package/dist/ai/translators/index.d.ts +4 -0
  27. package/dist/ai/translators/model-translator.d.ts +50 -0
  28. package/dist/ai/translators/query-translator.d.ts +122 -0
  29. package/dist/ai/translators/translate-props-to-code.d.ts +8 -0
  30. package/dist/ai/translators/types.d.ts +105 -0
  31. package/dist/ai/translators/use-get-data-source.d.ts +12 -0
  32. package/dist/ai/translators/utils.d.ts +2 -0
  33. package/dist/ai/use-chat-session.d.ts +10 -3
  34. package/dist/ai/use-get-nlg-query-result.d.ts +6 -6
  35. package/dist/ai/use-get-query-recommendations.d.ts +1 -0
  36. package/dist/ai.js +7037 -3332
  37. package/dist/alert-box/alert-box.d.ts +1 -1
  38. package/dist/app/client-application.d.ts +27 -0
  39. package/dist/app/settings/settings.d.ts +1 -1
  40. package/dist/area-chart.d.ts +1 -0
  41. package/dist/areamap-chart.d.ts +1 -0
  42. package/dist/bar-chart.d.ts +3 -0
  43. package/dist/boxplot-chart.d.ts +1 -0
  44. package/dist/boxplot-utils.d.ts +3 -1
  45. package/dist/chart/chart.d.ts +1 -0
  46. package/dist/chart-options-processor/translations/base-design-options.d.ts +1 -0
  47. package/dist/chart-options-processor/translations/tooltip-utils.d.ts +1 -0
  48. package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +2 -0
  49. package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +1 -2
  50. package/dist/column-chart.d.ts +4 -0
  51. package/dist/common/components/loading-indicator.d.ts +2 -0
  52. package/dist/common/hooks/use-fetch.d.ts +42 -0
  53. package/dist/const.d.ts +1 -0
  54. package/dist/dashboard-widget/dashboard-widget.d.ts +2 -0
  55. package/dist/dashboard-widget/translate-widget-data-options.d.ts +5 -0
  56. package/dist/dashboard-widget/translate-widget-filters.d.ts +1 -0
  57. package/dist/dashboard-widget/types.d.ts +3 -2
  58. package/dist/dynamic-size-container/dynamic-size-container.d.ts +4 -3
  59. package/dist/filters/components/criteria-filter-tile/criteria-filter-tile.d.ts +1 -0
  60. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +1 -0
  61. package/dist/filters/components/date-filter/relative-date-filter-tile/relative-date-filter-tile.d.ts +1 -0
  62. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +1 -0
  63. package/dist/formulas/use-get-shared-formula.d.ts +2 -0
  64. package/dist/funnel-chart.d.ts +1 -0
  65. package/dist/index.d.ts +5 -0
  66. package/dist/index.js +6680 -37439
  67. package/dist/indicator-chart.d.ts +1 -0
  68. package/dist/line-chart.d.ts +1 -0
  69. package/dist/models/dashboard/get-dashboard-models.d.ts +1 -3
  70. package/dist/models/dashboard/translate-dashboard.d.ts +1 -1
  71. package/dist/models/dashboard/types.d.ts +17 -0
  72. package/dist/models/dashboard/use-get-dashboard-model.d.ts +2 -0
  73. package/dist/models/dashboard/use-get-dashboard-models.d.ts +2 -0
  74. package/dist/models/widget/use-get-widget-model.d.ts +2 -0
  75. package/dist/models/widget/widget-model.d.ts +11 -1
  76. package/dist/pie-chart.d.ts +1 -0
  77. package/dist/pivot-table/formatters/data-cell-formatters/data-cell-value-formatter.d.ts +3 -0
  78. package/dist/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
  79. package/dist/pivot-table/formatters/header-cell-formatters/header-cell-value-formatter.d.ts +3 -0
  80. package/dist/pivot-table/formatters/header-cell-formatters/index.d.ts +1 -0
  81. package/dist/pivot-table/formatters/index.d.ts +2 -0
  82. package/dist/pivot-table/formatters/types.d.ts +4 -0
  83. package/dist/pivot-table/formatters/utils.d.ts +5 -0
  84. package/dist/pivot-table/pivot-table.d.ts +1 -0
  85. package/dist/pivot-table/sorting-utils.d.ts +56 -0
  86. package/dist/pivot-table/use-apply-pivot-table-formatting.d.ts +11 -0
  87. package/dist/pivot-table/use-get-pivot-table-query.d.ts +1 -1
  88. package/dist/polar-chart.d.ts +1 -0
  89. package/dist/props.d.ts +5 -4
  90. package/dist/query/execute-query.d.ts +5 -5
  91. package/dist/query-execution/execute-query-by-widget-id.d.ts +2 -0
  92. package/dist/query-execution/execute-query.d.ts +1 -0
  93. package/dist/query-execution/index.d.ts +2 -1
  94. package/dist/query-execution/query-params-comparator.d.ts +8 -0
  95. package/dist/query-execution/types.d.ts +7 -0
  96. package/dist/query-execution/use-execute-csv-query.d.ts +1 -0
  97. package/dist/query-execution/use-execute-pivot-query.d.ts +1 -0
  98. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +2 -0
  99. package/dist/query-execution/use-execute-query.d.ts +4 -10
  100. package/dist/query-execution/use-query-cache.d.ts +10 -0
  101. package/dist/scatter-chart.d.ts +1 -0
  102. package/dist/scattermap-chart.d.ts +1 -0
  103. package/dist/sisense-context/sisense-context-provider.d.ts +1 -0
  104. package/dist/sisense-context/sisense-query-client-provider.d.ts +2 -0
  105. package/dist/sunburst-chart.d.ts +1 -0
  106. package/dist/table/table.d.ts +1 -0
  107. package/dist/theme-provider/theme-provider.d.ts +7 -0
  108. package/dist/treemap-chart.d.ts +1 -0
  109. package/dist/types.d.ts +2 -2
  110. package/dist/useQuery-aa258c0d.js +121301 -0
  111. package/dist/utils/create-cache.d.ts +33 -0
  112. package/dist/widgets/chart-widget.d.ts +1 -0
  113. package/dist/widgets/common/context-menu.d.ts +5 -0
  114. package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs.d.ts +5 -0
  115. package/dist/widgets/drilldown-widget.d.ts +1 -0
  116. package/package.json +14 -9
  117. package/dist/chart-data-processor/utils.d.ts +0 -10
  118. package/dist/utils/not-available-value.d.ts +0 -3
  119. package/dist/with-tracking-0799ec25.js +0 -78081
@@ -0,0 +1,33 @@
1
+ export type CacheKey = string;
2
+ /**
3
+ * Function to create cache key from params of the async function you want to cache
4
+ */
5
+ export type CreateCacheKeyFn<AsyncFnToCache extends AsyncFn> = (...params: Parameters<AsyncFnToCache>) => CacheKey;
6
+ type AsyncFn = (...params: any[]) => Promise<any>;
7
+ export type CreateCacheFn = <AsyncFnToCache extends AsyncFn>(createCacheKey: CreateCacheKeyFn<AsyncFnToCache>, options?: CacheOptions) => {
8
+ withCache: (fn: AsyncFnToCache) => AsyncFnToCache;
9
+ clearCache: (specificKey?: CacheKey) => void;
10
+ };
11
+ type CacheOptions = {
12
+ cacheMaxSize?: number;
13
+ };
14
+ /**
15
+ * Universal cache creator for any async function
16
+ *
17
+ * @param createCacheKey - function to create cache key from params of the async function you want to cache
18
+ * @param options - optional object with cache options
19
+ * @returns - object with two methods: withCache and clearCache.
20
+ * "withCache" is a function that wraps the async function you want to cache.
21
+ * "clearCache" is a function to clear the cache.
22
+ *
23
+ * @example
24
+ * const myAsyncFn = async (a: number, b: number) => a + b;
25
+ *
26
+ * // define here how to create cache-key for your function
27
+ * const createExecuteQueryCacheKey: CreateCacheKeyFn<typeof myAsyncFn> = (a, b) => `${a}+${b}`;
28
+ *
29
+ * const { withCache, clearCache } = createCache(createExecuteQueryCacheKey);
30
+ * const executeQueryWithCache = withCache(executeQuery);
31
+ */
32
+ export declare const createCache: CreateCacheFn;
33
+ export {};
@@ -22,5 +22,6 @@ import { ChartWidgetProps } from '../props';
22
22
  * <img src="media://chart-widget-with-drilldown-example-1.png" width="800px" />
23
23
  * @param props - ChartWidget properties
24
24
  * @returns ChartWidget component representing a chart type as specified in `ChartWidgetProps.`{@link ChartWidgetProps.chartType | chartType}
25
+ * @group Chart Utilities
25
26
  */
26
27
  export declare const ChartWidget: FunctionComponent<ChartWidgetProps>;
@@ -1,3 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { ContextMenuProps } from '../../props';
3
+ /**
4
+ * Context menu of a Drilldown Widget
5
+ *
6
+ * @group Drilldown
7
+ */
3
8
  export declare const ContextMenu: ({ position, closeContextMenu, itemSections, children, }: ContextMenuProps) => JSX.Element;
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
2
  import { DrilldownBreadcrumbsProps } from '../../../props';
3
3
  export declare const BREADCRUMBS_BORDER_COLOR = "#F2F2F2";
4
+ /**
5
+ * Drilldown breadcrumbs component
6
+ *
7
+ * @group Drilldown
8
+ */
4
9
  export declare const DrilldownBreadcrumbs: React.FC<DrilldownBreadcrumbsProps>;
@@ -45,5 +45,6 @@ import { DrilldownWidgetProps } from '../props';
45
45
  * ```
46
46
  * @param props - DrilldownWidget properties
47
47
  * @returns DrilldownWidget wrapper component
48
+ * @group Drilldown
48
49
  */
49
50
  export declare const DrilldownWidget: ({ drilldownDimensions, initialDimension, config, children, }: DrilldownWidgetProps) => JSX.Element;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "Sisense",
12
12
  "Compose SDK"
13
13
  ],
14
- "version": "1.5.0",
14
+ "version": "1.7.0",
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
@@ -39,13 +39,13 @@
39
39
  "@emotion/react": "^11.10.5",
40
40
  "@emotion/styled": "^11.10.5",
41
41
  "@mui/material": "^5.11.6",
42
- "@sisense/sdk-common": "^1.5.0",
43
- "@sisense/sdk-data": "^1.5.0",
44
- "@sisense/sdk-pivot-client": "^1.5.0",
45
- "@sisense/sdk-query-client": "^1.5.0",
46
- "@sisense/sdk-rest-client": "^1.5.0",
47
- "@sisense/sdk-tracking": "^1.5.0",
48
- "@sisense/sisense-charts": "5.1.0-alpha-04052758.0",
42
+ "@sisense/sdk-common": "^1.7.0",
43
+ "@sisense/sdk-data": "^1.7.0",
44
+ "@sisense/sdk-pivot-client": "^1.7.0",
45
+ "@sisense/sdk-query-client": "^1.7.0",
46
+ "@sisense/sdk-rest-client": "^1.7.0",
47
+ "@sisense/sdk-tracking": "^1.7.0",
48
+ "@sisense/sisense-charts": "5.1.0-alpha-831b13b4.0",
49
49
  "@tanstack/react-query": "4.36.1",
50
50
  "classnames": "^2.3.2",
51
51
  "colorjs.io": "^0.4.3",
@@ -67,7 +67,8 @@
67
67
  "react-number-format": "^5.1.0",
68
68
  "ts-deepmerge": "6.0.2",
69
69
  "ts-essentials": "^9.3.0",
70
- "whatwg-fetch": "^3.6.2"
70
+ "whatwg-fetch": "^3.6.2",
71
+ "yaml": "^2.4.0"
71
72
  },
72
73
  "scripts": {
73
74
  "dev": "vite",
@@ -92,6 +93,7 @@
92
93
  ],
93
94
  "devDependencies": {
94
95
  "@babel/preset-env": "^7.20.2",
96
+ "@monaco-editor/react": "^4.6.0",
95
97
  "@mui/icons-material": "^5.14.9",
96
98
  "@mui/x-data-grid": "^6.16.0",
97
99
  "@mui/x-data-grid-pro": "^6.16.0",
@@ -114,6 +116,7 @@
114
116
  "@types/react": "18.2.0",
115
117
  "@types/react-datepicker": "^4.11.2",
116
118
  "@types/react-dom": "18.2.0",
119
+ "@types/react-grid-layout": "^1.3.5",
117
120
  "@types/react-plotly.js": "^2.6.0",
118
121
  "@vitejs/plugin-react-swc": "^3.3.0",
119
122
  "autoprefixer": "^10.4.14",
@@ -121,12 +124,14 @@
121
124
  "canvas": "^2.11.2",
122
125
  "eslint": "^8.40.0",
123
126
  "jsdom": "^22.1.0",
127
+ "monaco-editor": "^0.45.0",
124
128
  "msw": "2.2.1",
125
129
  "plotly.js": "^2.25.2",
126
130
  "postcss": "^8.4.31",
127
131
  "prettier": "2.8.4",
128
132
  "react": "18.2.0",
129
133
  "react-dom": "^18.2.0",
134
+ "react-grid-layout": "^1.4.4",
130
135
  "react-json-view": "^1.21.3",
131
136
  "react-plotly.js": "^2.6.0",
132
137
  "sass": "1.58.3",
@@ -1,10 +0,0 @@
1
- import { ChartType } from '../types';
2
- import { DataTable } from '../chart-data-processor/table-processor';
3
- /**
4
- * Remove rows with 'N/A' values for charts that do not support visualization of this type of value
5
- *
6
- * @param chartType - type of chart
7
- * @param dataTable - Chart data table
8
- * @returns Chart data table
9
- */
10
- export declare function handleNAInTable(chartType: ChartType, dataTable: DataTable): DataTable;
@@ -1,3 +0,0 @@
1
- export type NAType = 'N\\A';
2
- export declare const NAValue = "N\\A";
3
- export declare const isNotAvailable: (value: number | string | null | undefined) => boolean;