@sisense/sdk-ui 0.11.3

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 (241) hide show
  1. package/LICENSE.md +35 -0
  2. package/README.md +2 -0
  3. package/dist/alert-box/alert-box.d.ts +6 -0
  4. package/dist/app/client-application.d.ts +52 -0
  5. package/dist/app/settings/settings.d.ts +23 -0
  6. package/dist/app/settings/types/brand.d.ts +1 -0
  7. package/dist/app/settings/types/deployment-props.d.ts +37 -0
  8. package/dist/app/settings/types/ecm-props.d.ts +11 -0
  9. package/dist/app/settings/types/features.d.ts +124 -0
  10. package/dist/app/settings/types/globalization.d.ts +7 -0
  11. package/dist/app/settings/types/globals.d.ts +33 -0
  12. package/dist/app/settings/types/index.d.ts +1 -0
  13. package/dist/app/settings/types/role-manifest.d.ts +263 -0
  14. package/dist/app/settings/types/user.d.ts +51 -0
  15. package/dist/area-chart.d.ts +30 -0
  16. package/dist/bar-chart.d.ts +29 -0
  17. package/dist/chart-data/cartesian-data.d.ts +5 -0
  18. package/dist/chart-data/categorical-data.d.ts +5 -0
  19. package/dist/chart-data/chart-data-service.d.ts +18 -0
  20. package/dist/chart-data/filter-and-aggregate-chart-data.d.ts +4 -0
  21. package/dist/chart-data/indicator-data.d.ts +4 -0
  22. package/dist/chart-data/scatter-data.d.ts +23 -0
  23. package/dist/chart-data/series-data-color-service/index.d.ts +3 -0
  24. package/dist/chart-data/series-data-color-service/legend-color.d.ts +2 -0
  25. package/dist/chart-data/series-data-color-service/series-data-color-service.d.ts +4 -0
  26. package/dist/chart-data/series-data-color-service/types.d.ts +143 -0
  27. package/dist/chart-data/table-data.d.ts +6 -0
  28. package/dist/chart-data/types.d.ts +80 -0
  29. package/dist/chart-data/utils.d.ts +7 -0
  30. package/dist/chart-data-options/coloring/coloring-service.d.ts +22 -0
  31. package/dist/chart-data-options/coloring/conditional-coloring.d.ts +9 -0
  32. package/dist/chart-data-options/coloring/consts.d.ts +1 -0
  33. package/dist/chart-data-options/coloring/index.d.ts +1 -0
  34. package/dist/chart-data-options/coloring/range-coloring.d.ts +9 -0
  35. package/dist/chart-data-options/coloring/uniform-coloring.d.ts +4 -0
  36. package/dist/chart-data-options/translate-data-options.d.ts +7 -0
  37. package/dist/chart-data-options/types.d.ts +349 -0
  38. package/dist/chart-data-options/utils.d.ts +11 -0
  39. package/dist/chart-data-options/validate-data-options.d.ts +21 -0
  40. package/dist/chart-data-processor/categorical-distribution.d.ts +10 -0
  41. package/dist/chart-data-processor/data-table-date-period.d.ts +37 -0
  42. package/dist/chart-data-processor/distribution.d.ts +22 -0
  43. package/dist/chart-data-processor/row-comparator.d.ts +24 -0
  44. package/dist/chart-data-processor/table-creators.d.ts +39 -0
  45. package/dist/chart-data-processor/table-processor.d.ts +93 -0
  46. package/dist/chart-options-processor/apply-event-handlers.d.ts +49 -0
  47. package/dist/chart-options-processor/cartesian-chart-options.d.ts +18 -0
  48. package/dist/chart-options-processor/category-chart-options.d.ts +16 -0
  49. package/dist/chart-options-processor/chart-options-service.d.ts +253 -0
  50. package/dist/chart-options-processor/common-highcharts-option-service.d.ts +4 -0
  51. package/dist/chart-options-processor/defaults/cartesian.d.ts +45 -0
  52. package/dist/chart-options-processor/plot-bands.d.ts +23 -0
  53. package/dist/chart-options-processor/scatter-chart-options.d.ts +22 -0
  54. package/dist/chart-options-processor/style-to-design-options-translator/translate-style-to-design-options.d.ts +4 -0
  55. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-highcharts-options.d.ts +13 -0
  56. package/dist/chart-options-processor/style-to-design-options-translator/translate-to-indicator-options.d.ts +3 -0
  57. package/dist/chart-options-processor/subtype-to-design-options.d.ts +97 -0
  58. package/dist/chart-options-processor/theme-option-service.d.ts +11 -0
  59. package/dist/chart-options-processor/tooltip.d.ts +29 -0
  60. package/dist/chart-options-processor/translations/axis-section.d.ts +105 -0
  61. package/dist/chart-options-processor/translations/base-design-options.d.ts +7 -0
  62. package/dist/chart-options-processor/translations/design-options.d.ts +118 -0
  63. package/dist/chart-options-processor/translations/funnel-plot-options.d.ts +53 -0
  64. package/dist/chart-options-processor/translations/funnel-series.d.ts +15 -0
  65. package/dist/chart-options-processor/translations/legend-section.d.ts +23 -0
  66. package/dist/chart-options-processor/translations/marker-section.d.ts +26 -0
  67. package/dist/chart-options-processor/translations/navigator.d.ts +32 -0
  68. package/dist/chart-options-processor/translations/number-format-config.d.ts +16 -0
  69. package/dist/chart-options-processor/translations/pie-plot-options.d.ts +29 -0
  70. package/dist/chart-options-processor/translations/pie-series.d.ts +19 -0
  71. package/dist/chart-options-processor/translations/scatter-axis.d.ts +7 -0
  72. package/dist/chart-options-processor/translations/scatter-plot-options.d.ts +22 -0
  73. package/dist/chart-options-processor/translations/scatter-series.d.ts +23 -0
  74. package/dist/chart-options-processor/translations/scatter-tooltip.d.ts +21 -0
  75. package/dist/chart-options-processor/translations/tooltip-utils.d.ts +39 -0
  76. package/dist/chart-options-processor/translations/tooltip.d.ts +3 -0
  77. package/dist/chart-options-processor/translations/translations-to-highcharts.d.ts +73 -0
  78. package/dist/chart-options-processor/translations/treemap/treemap-labels.d.ts +6 -0
  79. package/dist/chart-options-processor/translations/treemap/treemap-options.d.ts +6 -0
  80. package/dist/chart-options-processor/translations/treemap/treemap-series.d.ts +5 -0
  81. package/dist/chart-options-processor/translations/treemap/treemap-tooltip.d.ts +6 -0
  82. package/dist/chart-options-processor/translations/treemap/types.d.ts +19 -0
  83. package/dist/chart-options-processor/translations/types.d.ts +36 -0
  84. package/dist/chart-options-processor/translations/value-label-section.d.ts +28 -0
  85. package/dist/chart.d.ts +80 -0
  86. package/dist/charts/indicator/chart/gauge.d.ts +166 -0
  87. package/dist/charts/indicator/chart/indicator-helper.d.ts +47 -0
  88. package/dist/charts/indicator/chart/indicator.d.ts +39 -0
  89. package/dist/charts/indicator/chart/numeric-bar.d.ts +98 -0
  90. package/dist/charts/indicator/chart/numeric-simple.d.ts +91 -0
  91. package/dist/charts/indicator/chart/ticker.d.ts +65 -0
  92. package/dist/charts/indicator/indicator-legacy-chart-data-options.d.ts +36 -0
  93. package/dist/charts/indicator/indicator-legacy-chart-options/default-options.d.ts +4 -0
  94. package/dist/charts/indicator/indicator-legacy-chart-options/index.d.ts +1 -0
  95. package/dist/charts/indicator/indicator-legacy-chart-options/indicator-legacy-chart-options.d.ts +16 -0
  96. package/dist/charts/indicator/indicator-legacy-chart-options/legacy-chart-options-to-theme-settings-dictionary.d.ts +12 -0
  97. package/dist/charts/indicator/indicator-legacy-chart-options/override-with-theme-settings.d.ts +3 -0
  98. package/dist/charts/indicator/indicator-legacy-chart-options/override-with-value-color.d.ts +35 -0
  99. package/dist/charts/indicator/indicator-legacy-chart-options/utils/override-with-custom-settings.d.ts +22 -0
  100. package/dist/charts/indicator/types.d.ts +118 -0
  101. package/dist/charts/table/data-table-wrapper.d.ts +3 -0
  102. package/dist/charts/table/header/field-type-icon.d.ts +6 -0
  103. package/dist/charts/table/header/sortable-table-column-header.d.ts +10 -0
  104. package/dist/charts/table/helpers/calc-column-widths.d.ts +2 -0
  105. package/dist/charts/table/helpers/format-numbers.d.ts +3 -0
  106. package/dist/charts/table/helpers/get-cell-styles.d.ts +13 -0
  107. package/dist/charts/table/index.d.ts +3 -0
  108. package/dist/charts/table/pure-table.d.ts +8 -0
  109. package/dist/charts/table/styles/style-constants.d.ts +9 -0
  110. package/dist/charts/table/types.d.ts +83 -0
  111. package/dist/column-chart.d.ts +29 -0
  112. package/dist/dashboard-widget/dashboard-widget.d.ts +16 -0
  113. package/dist/dashboard-widget/fetch-widget.d.ts +11 -0
  114. package/dist/dashboard-widget/translate-panel-color-format.d.ts +5 -0
  115. package/dist/dashboard-widget/translate-widget-data-options.d.ts +7 -0
  116. package/dist/dashboard-widget/translate-widget-drilldown-options.d.ts +3 -0
  117. package/dist/dashboard-widget/translate-widget-filters.d.ts +16 -0
  118. package/dist/dashboard-widget/translate-widget-style-options.d.ts +5 -0
  119. package/dist/dashboard-widget/translate-widget.d.ts +12 -0
  120. package/dist/dashboard-widget/types.d.ts +336 -0
  121. package/dist/dashboard-widget/utils.d.ts +32 -0
  122. package/dist/decorators/as-sisense-component.d.ts +19 -0
  123. package/dist/decorators/with-error-boundary.d.ts +5 -0
  124. package/dist/decorators/with-sisense-context-validation.d.ts +7 -0
  125. package/dist/decorators/with-tracking/error-tracker.d.ts +20 -0
  126. package/dist/decorators/with-tracking/index.d.ts +1 -0
  127. package/dist/decorators/with-tracking/use-track-component-init.d.ts +5 -0
  128. package/dist/decorators/with-tracking/with-tracking.d.ts +10 -0
  129. package/dist/dynamic-size-container/default-size.d.ts +14 -0
  130. package/dist/dynamic-size-container/dynamic-size-container.d.ts +22 -0
  131. package/dist/dynamic-size-container/index.d.ts +2 -0
  132. package/dist/error-boundary/error-boundary-box.d.ts +13 -0
  133. package/dist/error-boundary/error-boundary.d.ts +34 -0
  134. package/dist/error-boundary/use-set-error.d.ts +2 -0
  135. package/dist/filters/components/common/buttons.d.ts +10 -0
  136. package/dist/filters/components/common/checkbox.d.ts +7 -0
  137. package/dist/filters/components/common/date-range-field-button.d.ts +13 -0
  138. package/dist/filters/components/common/index.d.ts +5 -0
  139. package/dist/filters/components/common/input.d.ts +7 -0
  140. package/dist/filters/components/common/radio.d.ts +6 -0
  141. package/dist/filters/components/common/switch.d.ts +1 -0
  142. package/dist/filters/components/date-filter/consts.d.ts +1 -0
  143. package/dist/filters/components/date-filter/date-filter/calendar-date-selector.d.ts +20 -0
  144. package/dist/filters/components/date-filter/date-filter/calendar-header.d.ts +12 -0
  145. package/dist/filters/components/date-filter/date-filter/date-filter.d.ts +61 -0
  146. package/dist/filters/components/date-filter/date-filter/date-range-calculator.d.ts +8 -0
  147. package/dist/filters/components/date-filter/date-filter/index.d.ts +1 -0
  148. package/dist/filters/components/date-filter/date-filter/quick-date-selection-buttons.d.ts +13 -0
  149. package/dist/filters/components/date-filter/date-filter/styled-date-picker.d.ts +7 -0
  150. package/dist/filters/components/date-filter/date-range-filter-tile/date-range-filter-tile.d.ts +63 -0
  151. package/dist/filters/components/date-filter/date-range-filter-tile/index.d.ts +1 -0
  152. package/dist/filters/components/date-filter/date-range-filter-tile/use-date-limits.d.ts +7 -0
  153. package/dist/filters/components/date-filter/index.d.ts +2 -0
  154. package/dist/filters/components/date-filter/types.d.ts +14 -0
  155. package/dist/filters/components/filter-tile.d.ts +14 -0
  156. package/dist/filters/components/icons/arrow-down-icon.d.ts +2 -0
  157. package/dist/filters/components/icons/arrow-right-icon.d.ts +2 -0
  158. package/dist/filters/components/icons/date-icon.d.ts +5 -0
  159. package/dist/filters/components/icons/double-arrow-right-icon.d.ts +2 -0
  160. package/dist/filters/components/icons/index.d.ts +7 -0
  161. package/dist/filters/components/icons/menu-icon.d.ts +2 -0
  162. package/dist/filters/components/icons/pencil-icon.d.ts +2 -0
  163. package/dist/filters/components/icons/plus-icon.d.ts +2 -0
  164. package/dist/filters/components/icons/search-icon.d.ts +2 -0
  165. package/dist/filters/components/icons/trash-icon.d.ts +2 -0
  166. package/dist/filters/components/member-filter-tile/basic-member-filter-tile.d.ts +50 -0
  167. package/dist/filters/components/member-filter-tile/index.d.ts +3 -0
  168. package/dist/filters/components/member-filter-tile/member-filter-tile.d.ts +46 -0
  169. package/dist/filters/components/member-filter-tile/member-list.d.ts +11 -0
  170. package/dist/filters/components/member-filter-tile/members-reducer.d.ts +32 -0
  171. package/dist/filters/components/member-filter-tile/pill-section.d.ts +9 -0
  172. package/dist/filters/components/member-filter-tile/use-members.d.ts +14 -0
  173. package/dist/filters/components/member-filter-tile/use-validate-members.d.ts +8 -0
  174. package/dist/filters/index.d.ts +2 -0
  175. package/dist/funnel-chart.d.ts +47 -0
  176. package/dist/index.d.ts +35 -0
  177. package/dist/index.js +71761 -0
  178. package/dist/indicator-canvas.d.ts +21 -0
  179. package/dist/indicator-chart.d.ts +60 -0
  180. package/dist/line-chart.d.ts +28 -0
  181. package/dist/locales/en.d.ts +17 -0
  182. package/dist/no-results-overlay/images/index.d.ts +2 -0
  183. package/dist/no-results-overlay/no-results-overlay.d.ts +13 -0
  184. package/dist/pie-chart.d.ts +28 -0
  185. package/dist/polar-chart.d.ts +28 -0
  186. package/dist/props.d.ts +882 -0
  187. package/dist/query/date-formats/angular-text-date-format-replacers.d.ts +5 -0
  188. package/dist/query/date-formats/apply-date-format.d.ts +65 -0
  189. package/dist/query/date-formats/fiscal-date-format-replacers.d.ts +33 -0
  190. package/dist/query/date-formats/index.d.ts +2 -0
  191. package/dist/query/date-formats/new-date-format.d.ts +16 -0
  192. package/dist/query/date-formats/simple-date-format-replacers.d.ts +4 -0
  193. package/dist/query/execute-query.d.ts +8 -0
  194. package/dist/query/query-result-date-formatting.d.ts +5 -0
  195. package/dist/query-execution/execute-query-by-widget-id.d.ts +29 -0
  196. package/dist/query-execution/execute-query.d.ts +32 -0
  197. package/dist/query-execution/index.d.ts +5 -0
  198. package/dist/query-execution/query-state-reducer.d.ts +66 -0
  199. package/dist/query-execution/use-execute-query-by-widget-id.d.ts +71 -0
  200. package/dist/query-execution/use-execute-query.d.ts +70 -0
  201. package/dist/query-execution/utils.d.ts +9 -0
  202. package/dist/scatter-chart.d.ts +68 -0
  203. package/dist/sisense-chart.d.ts +23 -0
  204. package/dist/sisense-context/custom-sisense-context-provider.d.ts +19 -0
  205. package/dist/sisense-context/sisense-context-provider.d.ts +36 -0
  206. package/dist/sisense-context/sisense-context.d.ts +9 -0
  207. package/dist/table/hooks/use-table-data.d.ts +11 -0
  208. package/dist/table/hooks/use-table-datatable.d.ts +11 -0
  209. package/dist/table/index.d.ts +1 -0
  210. package/dist/table/styles/get-custom-pagination-styles.d.ts +10 -0
  211. package/dist/table/table.d.ts +50 -0
  212. package/dist/theme-provider/custom-theme-provider.d.ts +18 -0
  213. package/dist/theme-provider/index.d.ts +1 -0
  214. package/dist/theme-provider/theme-provider.d.ts +45 -0
  215. package/dist/theme-provider/use-theme-settings.d.ts +12 -0
  216. package/dist/themes/legacy-design-settings.d.ts +84 -0
  217. package/dist/themes/theme-loader.d.ts +14 -0
  218. package/dist/treemap-chart.d.ts +34 -0
  219. package/dist/types.d.ts +692 -0
  220. package/dist/utils/color/color-interpolation.d.ts +37 -0
  221. package/dist/utils/color/index.d.ts +1 -0
  222. package/dist/utils/data-limit-warning.d.ts +2 -0
  223. package/dist/utils/dedupe.d.ts +1 -0
  224. package/dist/utils/filters-comparator.d.ts +11 -0
  225. package/dist/utils/utility-types.d.ts +39 -0
  226. package/dist/vite.svg +1 -0
  227. package/dist/widgets/chart-widget.d.ts +30 -0
  228. package/dist/widgets/common/context-menu.d.ts +3 -0
  229. package/dist/widgets/common/custom-drilldown.d.ts +20 -0
  230. package/dist/widgets/common/drilldown-breadcrumbs/drilldown-breadcrumbs.d.ts +4 -0
  231. package/dist/widgets/common/drilldown-breadcrumbs/index.d.ts +1 -0
  232. package/dist/widgets/common/drilldown-breadcrumbs/use-buttons.d.ts +27 -0
  233. package/dist/widgets/common/drilldown-breadcrumbs/use-popper.d.ts +24 -0
  234. package/dist/widgets/common/drilldown-breadcrumbs/use-theme-for-breadcrumbs.d.ts +11 -0
  235. package/dist/widgets/common/drilldown.d.ts +32 -0
  236. package/dist/widgets/common/use-widget-drilldown.d.ts +2 -0
  237. package/dist/widgets/common/widget-header.d.ts +11 -0
  238. package/dist/widgets/common/widget-style-utils.d.ts +13 -0
  239. package/dist/widgets/drilldown-widget.d.ts +49 -0
  240. package/dist/widgets/table-widget.d.ts +23 -0
  241. package/package.json +110 -0
@@ -0,0 +1,37 @@
1
+ import Color from 'colorjs.io';
2
+ export type ColorArg = string | Color;
3
+ export declare const toColor: (color: ColorArg) => Color;
4
+ export declare const toString: (color: Color) => string;
5
+ export declare const toRangeFn: (...colorArgs: ColorArg[]) => (percentage: number) => string;
6
+ export declare const toSteps: (numSteps: number, ...colorArgs: ColorArg[]) => string[];
7
+ export declare const toGray: (color: ColorArg) => string;
8
+ export declare const toAvg: (color1: ColorArg, color2: ColorArg) => string;
9
+ export declare const hueDiff: (color1: ColorArg, color2: ColorArg) => number;
10
+ /**
11
+ * Scales the color's brightness by the given percentage.
12
+ *
13
+ * @param colorArg - The color to scale, in any valid color format (e.g., hex, RGB, HSL).
14
+ * @param percent - The percentage by which to scale the color's brightness.
15
+ * A positive value will increase the brightness, while a negative value will decrease it.
16
+ * The percentage should be a number between -1 and 1, where -1 represents a 100% decrease
17
+ * in brightness (i.e., completely black) and 1 represents a 100% increase in brightness
18
+ * (i.e., completely white).
19
+ * @returns The scaled color as a string.
20
+ */
21
+ export declare const scaleBrightness: (colorArg: ColorArg, percent: number) => string;
22
+ export declare const getRgbValuesFromColor: (color: Color) => {
23
+ R: number;
24
+ G: number;
25
+ B: number;
26
+ };
27
+ export declare const getDarkFactor: (color: Color) => number;
28
+ export declare function isBright(color: Color): boolean;
29
+ export declare const getSlightlyDifferentColor: (colorString: string, percent?: number, opacity?: number) => string;
30
+ /**
31
+ * Applies opacity to a color
32
+ *
33
+ * @param color - color to apply opacity to
34
+ * @param opacity - opacity to apply (from 0 to 1)
35
+ * @returns - color with opacity applied
36
+ */
37
+ export declare const applyOpacity: (color: string, opacity: number) => string;
@@ -0,0 +1 @@
1
+ export * from './color-interpolation';
@@ -0,0 +1,2 @@
1
+ export declare const seriesSliceWarning: (seriesLength: number, seriesCapacity: number) => string;
2
+ export declare const categoriesSliceWarning: (axis: string, categoriesLength: number, categoriesCapacity: number) => string;
@@ -0,0 +1 @@
1
+ export declare const dedupe: <T>(items: T[], id: (item: T) => string) => T[];
@@ -0,0 +1,11 @@
1
+ import { Filter } from '@sisense/sdk-data';
2
+ /**
3
+ * Checks if the filters have changed by deep comparison.
4
+ *
5
+ * @param prevFilters - Previous filters
6
+ * @param newFilters - New filters
7
+ * @returns Whether the filters have changed
8
+ * @remarks
9
+ * The function ignores randomly generated names of the filters.
10
+ */
11
+ export declare function isFiltersChanged(prevFilters: Filter[] | undefined, newFilters: Filter[] | undefined): boolean;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generic utility type that allows you to merge union type
3
+ *
4
+ * @example
5
+ * type T1 = {
6
+ * a: string;
7
+ * b?: number;
8
+ * };
9
+ * type T2 = {
10
+ * a: string;
11
+ * c: number;
12
+ * };
13
+ * type T3 = {
14
+ * a: number;
15
+ * d: string;
16
+ * }
17
+ * type MergedT = Merge<T1 | T2 | T3>;
18
+ * /*
19
+ * {
20
+ * a: string | number;
21
+ * b?: number;
22
+ * c?: number;
23
+ * d?: string;
24
+ * };
25
+ */
26
+ export type Merge<T extends object> = {
27
+ [k in CommonKeys<T>]: PickTypeOf<T, k>;
28
+ } & {
29
+ [k in NonCommonKeys<T>]?: PickTypeOf<T, k>;
30
+ };
31
+ type CommonKeys<T extends object> = keyof T;
32
+ type PickType<T, K extends AllKeys<T>> = T extends {
33
+ [k in K]?: any;
34
+ } ? T[K] : undefined;
35
+ type AllKeys<T> = T extends any ? keyof T : never;
36
+ type NonCommonKeys<T extends object> = Subtract<AllKeys<T>, CommonKeys<T>>;
37
+ type Subtract<A, C> = A extends C ? never : A;
38
+ type PickTypeOf<T, K extends string | number | symbol> = K extends AllKeys<T> ? PickType<T, K> : never;
39
+ export {};
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,30 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { ChartWidgetProps } from '../props';
3
+ /**
4
+ * The Chart Widget component extending the {@link Chart} component to support advanced BI
5
+ * capabilities such as drilldown.
6
+ *
7
+ * @example
8
+ * Example of using the `ChartWidget` component to
9
+ * plot a bar chart of the `Sample ECommerce` data source hosted in a Sisense instance.
10
+ * Drill-down capability is enabled.
11
+ * ```tsx
12
+ * <ChartWidget
13
+ * dataSource={DM.DataSource}
14
+ * chartType="bar"
15
+ * dataOptions={{
16
+ * category: [DM.Category.Category],
17
+ * value: [measures.sum(DM.Commerce.Revenue)],
18
+ * breakBy: [],
19
+ * }}
20
+ * drilldownOptions={{
21
+ * drilldownDimensions: [DM.Commerce.AgeRange, DM.Commerce.Gender, DM.Commerce.Condition],
22
+ * }}
23
+ * />
24
+ * ```
25
+ *
26
+ * <img src="media://chart-widget-with-drilldown-example-1.png" width="800px" />
27
+ * @param props - ChartWidget properties
28
+ * @returns ChartWidget component representing a chart type as specified in `ChartWidgetProps.`{@link ChartWidgetProps.chartType}
29
+ */
30
+ export declare const ChartWidget: FunctionComponent<ChartWidgetProps>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { ContextMenuProps } from '../../props';
3
+ export declare const ContextMenu: ({ position, closeContextMenu, itemSections, children, }: ContextMenuProps) => JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { DataPoint, StyledColumn, DrilldownSelection } from '../../types.js';
2
+ import { Attribute, Column, MembersFilter } from '@sisense/sdk-data';
3
+ export declare const useCustomDrilldown: ({ drilldownDimensions, initialDimension, }: {
4
+ drilldownDimensions: Attribute[];
5
+ initialDimension: Column | StyledColumn;
6
+ }) => {
7
+ drilldownFilters: MembersFilter[];
8
+ drilldownFiltersDisplayValues: string[][];
9
+ drilldownDimension: Attribute;
10
+ selectDrilldown: (points: DataPoint[], nextDimension: Attribute) => void;
11
+ sliceDrilldownSelections: (i: number) => void;
12
+ clearDrilldownSelections: () => void;
13
+ drilldownSelections: DrilldownSelection[];
14
+ availableDrilldowns: Attribute[];
15
+ };
16
+ export declare const processDrilldownSelections: (drilldownSelections: DrilldownSelection[], initialDimension: Column | StyledColumn | null) => {
17
+ drilldownFilters: MembersFilter[];
18
+ drilldownFiltersDisplayValues: string[][];
19
+ drilldownDimension: Attribute;
20
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DrilldownBreadcrumbsProps } from '../../../props';
3
+ export declare const BREADCRUMBS_BORDER_COLOR = "#F2F2F2";
4
+ export declare const DrilldownBreadcrumbs: React.FC<DrilldownBreadcrumbsProps>;
@@ -0,0 +1 @@
1
+ export { DrilldownBreadcrumbs } from './drilldown-breadcrumbs';
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { Attribute } from '@sisense/sdk-data';
3
+ import { Dispatch, SetStateAction } from 'react';
4
+ interface ButtonsProps {
5
+ clearDrilldownSelections: () => void;
6
+ currentDimension: Attribute;
7
+ isHovered: boolean;
8
+ setIsHovered: Dispatch<SetStateAction<boolean>>;
9
+ themeProps: ThemeProps;
10
+ }
11
+ interface ThemeProps {
12
+ primaryTextColor: string;
13
+ secondaryTextColor: string;
14
+ fontFamily: string;
15
+ backgroundColor: string;
16
+ brandColor: string;
17
+ primaryButtonTextColor: string;
18
+ chartBackgroundColor: string;
19
+ activeDrillBackgroundColor: string;
20
+ activeDrillHoverBackgroundColor: string;
21
+ }
22
+ interface Buttons {
23
+ CancelButton: React.FC;
24
+ CurrentDrillButton: React.FC;
25
+ }
26
+ declare const useButtons: ({ clearDrilldownSelections, currentDimension, setIsHovered, themeProps, }: ButtonsProps) => Buttons;
27
+ export default useButtons;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ interface DrilldownBreadcrumbsThemeProps {
3
+ popperParams?: {
4
+ filterDisplayValues: string[];
5
+ anchorEl: HTMLElement;
6
+ } | null;
7
+ currentDimension: {
8
+ expression: string;
9
+ };
10
+ themeProps: ThemeProps;
11
+ }
12
+ interface ThemeProps {
13
+ primaryTextColor: string;
14
+ secondaryTextColor: string;
15
+ fontFamily: string;
16
+ backgroundColor: string;
17
+ brandColor: string;
18
+ primaryButtonTextColor: string;
19
+ chartBackgroundColor: string;
20
+ activeDrillBackgroundColor: string;
21
+ activeDrillHoverBackgroundColor: string;
22
+ }
23
+ declare const DrillPopper: React.FC<DrilldownBreadcrumbsThemeProps>;
24
+ export default DrillPopper;
@@ -0,0 +1,11 @@
1
+ export declare const useThemeForBreadcrumbs: () => {
2
+ primaryTextColor: string;
3
+ secondaryTextColor: string;
4
+ fontFamily: string;
5
+ backgroundColor: string;
6
+ brandColor: string;
7
+ primaryButtonTextColor: string;
8
+ chartBackgroundColor: string;
9
+ activeDrillBackgroundColor: string;
10
+ activeDrillHoverBackgroundColor: string;
11
+ };
@@ -0,0 +1,32 @@
1
+ import { ChartDataOptions, DataPoint, DrilldownOptions, DrilldownSelection } from '../../types';
2
+ import { Attribute, MembersFilter } from '@sisense/sdk-data';
3
+ export declare const useDrilldown: (dataOptions: ChartDataOptions, drilldownOptions?: DrilldownOptions) => {
4
+ drilldownFilters: never[];
5
+ drilldownFiltersDisplayValues: never[];
6
+ drilldownDimension: undefined;
7
+ dataOptionsWithDrilldown: ChartDataOptions;
8
+ selectDrilldown: (points: DataPoint[], nextDimension: Attribute) => void;
9
+ sliceDrilldownSelections: (i: number) => void;
10
+ clearDrilldownSelections: () => void;
11
+ drilldownSelections: DrilldownSelection[];
12
+ availableDrilldowns: Attribute[];
13
+ } | {
14
+ drilldownFilters: MembersFilter[];
15
+ drilldownFiltersDisplayValues: string[][];
16
+ drilldownDimension: Attribute;
17
+ dataOptionsWithDrilldown: {
18
+ category: (import("@sisense/sdk-data").Column | import("../../types").StyledColumn)[];
19
+ value: (import("@sisense/sdk-data").MeasureColumn | import("@sisense/sdk-data").CalculatedMeasureColumn | import("../../types").StyledMeasureColumn)[];
20
+ breakBy: (import("@sisense/sdk-data").Column | import("../../types").StyledColumn)[];
21
+ seriesToColorMap?: import("../../types").ValueToColorMap | undefined;
22
+ } | {
23
+ category: (import("@sisense/sdk-data").Column | import("../../types").StyledColumn)[];
24
+ value: (import("@sisense/sdk-data").MeasureColumn | import("@sisense/sdk-data").CalculatedMeasureColumn | import("../../types").StyledMeasureColumn)[];
25
+ seriesToColorMap?: import("../../types").ValueToColorMap | undefined;
26
+ };
27
+ selectDrilldown: (points: DataPoint[], nextDimension: Attribute) => void;
28
+ sliceDrilldownSelections: (i: number) => void;
29
+ clearDrilldownSelections: () => void;
30
+ drilldownSelections: DrilldownSelection[];
31
+ availableDrilldowns: Attribute[];
32
+ };
@@ -0,0 +1,2 @@
1
+ import { ChartWidgetProps } from '../../props';
2
+ export declare const useWidgetDrilldown: (props: ChartWidgetProps) => ChartWidgetProps;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { WidgetStyleOptions } from '../../types';
3
+ interface WidgetHeaderProps {
4
+ onRefresh: () => void;
5
+ title?: string;
6
+ description?: string;
7
+ dataSetName?: string;
8
+ styleOptions?: WidgetStyleOptions['header'];
9
+ }
10
+ export declare const WidgetHeader: React.FC<WidgetHeaderProps>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { WidgetStyleOptions } from '../../types';
2
+ export declare enum WidgetCornerRadius {
3
+ 'Large' = "30px",
4
+ 'Medium' = "20px",
5
+ 'Small' = "10px"
6
+ }
7
+ export declare enum WidgetSpaceAround {
8
+ 'Large' = "15px",
9
+ 'Medium' = "10px",
10
+ 'Small' = "5px",
11
+ 'None' = "0px"
12
+ }
13
+ export declare const getShadowValue: (widgetStyleOptions: WidgetStyleOptions | undefined) => string;
@@ -0,0 +1,49 @@
1
+ /// <reference types="react" />
2
+ import { DrilldownWidgetProps } from '../props';
3
+ /**
4
+ * React component designed to add drilldown functionality to any type of chart
5
+ *
6
+ * It acts as a wrapper around a given chart component, enhancing it with drilldown capabilities
7
+ *
8
+ * The widget offers several features including:
9
+ * - A context menu for initiating drilldown actions (can be provided as a custom component)
10
+ * - Breadcrumbs that not only allow for drilldown selection slicing but also
11
+ * provide an option to clear the selection (can be provided as a custom component)
12
+ * - Filters specifically created for drilldown operation
13
+ * - An option to navigate to the next drilldown dimension
14
+ *
15
+ * When an `initialDimension` is specified, the `drilldownDimension` will automatically inherit its value,
16
+ * even before any points on the chart are selected.
17
+ * This allows for complete control over the chart's dimensions to be handed over to the DrilldownWidget
18
+ *
19
+ * @example
20
+ * Example of using the `DrilldownWidget` component to
21
+ * plot a custom React component that uses the `ExecuteQuery` component to
22
+ * query the `Sample ECommerce` data source hosted in a Sisense instance.
23
+ * ```tsx
24
+ * <DrilldownWidget
25
+ * drilldownDimensions={[DM.Commerce.AgeRange, DM.Commerce.Gender, DM.Commerce.Condition]}
26
+ * initialDimension={DM.Category.Category}
27
+ * >
28
+ * {({ drilldownFilters, drilldownDimension, onDataPointsSelected, onContextMenu }) => (
29
+ * <ExecuteQuery
30
+ * dataSource={DM.DataSource}
31
+ * dimensions={[drilldownDimension]}
32
+ * measures={measure.sum(DM.Commerce.Revenue)}
33
+ * filters={drilldownFilters}
34
+ * >
35
+ * {(data) => (
36
+ * <MyCustomChart
37
+ * rawData={data}
38
+ * onContextMenu={onContextMenu}
39
+ * onDataPointsSelected={onDataPointsSelected}
40
+ * />
41
+ * )}
42
+ * </ExecuteQuery>
43
+ * )}
44
+ * </DrilldownWidget>
45
+ * ```
46
+ * @param props - DrilldownWidget properties
47
+ * @returns DrilldownWidget wrapper component
48
+ */
49
+ export declare const DrilldownWidget: ({ drilldownDimensions, initialDimension, config, children, }: DrilldownWidgetProps) => JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { type FunctionComponent } from 'react';
2
+ import { TableWidgetProps } from '../props';
3
+ /**
4
+ * The TableWidget component extending the {@link Table} component to support advanced BI
5
+ * capabilities such as header.
6
+ *
7
+ * @example
8
+ * Example of using the `Widget` component to
9
+ * plot a bar chart of the `Sample ECommerce` data source hosted in a Sisense instance.
10
+ * Drill-down capability is enabled.
11
+ * ```tsx
12
+ * <TableWidget
13
+ * dataSource={DM.DataSource}
14
+ * dataOptions={{
15
+ * columns: [DM.Category.Category]
16
+ * }}
17
+ * />
18
+ * ```
19
+ * @param props - Table Widget properties
20
+ * @returns Widget component representing a table
21
+ * @internal
22
+ */
23
+ export declare const TableWidget: FunctionComponent<TableWidgetProps>;
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "@sisense/sdk-ui",
3
+ "version": "0.11.3",
4
+ "type": "module",
5
+ "exports": "./dist/index.js",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "author": "Sisense",
10
+ "license": "SEE LICENSE IN LICENSE.md",
11
+ "dependencies": {
12
+ "@emotion/react": "^11.10.5",
13
+ "@emotion/styled": "^11.10.5",
14
+ "@mui/material": "^5.11.6",
15
+ "@sisense/sdk-common": "^0.11.3",
16
+ "@sisense/sdk-data": "^0.11.3",
17
+ "@sisense/sdk-query-client": "^0.11.3",
18
+ "@sisense/sdk-rest-client": "^0.11.3",
19
+ "@sisense/sisense-charts": "5.1.0-alpha-04052758.0",
20
+ "classnames": "^2.3.2",
21
+ "colorjs.io": "^0.4.3",
22
+ "date-fns": "^2.29.3",
23
+ "date-fns-tz": "^2.0.0",
24
+ "dayjs": "^1.11.7",
25
+ "fixed-data-table-2": "^1.2.18",
26
+ "guid-typescript": "^1.0.9",
27
+ "highcharts-react-official": "^3.2.1",
28
+ "immer": "^10.0.2",
29
+ "lodash": "^4.17.21",
30
+ "merge-deep": "^3.0.3",
31
+ "react-datepicker": "^4.16.0",
32
+ "react-number-format": "^5.1.0",
33
+ "ts-deepmerge": "6.0.2",
34
+ "ts-essentials": "^9.3.0",
35
+ "whatwg-fetch": "^3.6.2"
36
+ },
37
+ "scripts": {
38
+ "dev": "vite",
39
+ "type-check": "tsc --noEmit",
40
+ "build": "run type-check && vite build --mode development",
41
+ "build:prod": "run type-check && vite build",
42
+ "clean": "rm -rf ./dist && rm -rf ./coverage && rm -rf tsconfig.tsbuildinfo",
43
+ "lint": "eslint . --fix",
44
+ "format": "prettier --write .",
45
+ "format:check": "prettier --check .",
46
+ "vitest": "run -T vitest",
47
+ "test": "TZ=utc run vitest run",
48
+ "test:update": "TZ=utc run vitest -u",
49
+ "test:watch": "TZ=utc run vitest watch",
50
+ "test:coverage": "TZ=utc run vitest run --coverage",
51
+ "storybook": "storybook dev -p 6006",
52
+ "build-storybook": "storybook build"
53
+ },
54
+ "files": [
55
+ "dist/**/*",
56
+ "esm/**/*"
57
+ ],
58
+ "devDependencies": {
59
+ "@babel/preset-env": "^7.20.2",
60
+ "@mui/icons-material": "^5.14.9",
61
+ "@mui/x-data-grid": "^6.16.0",
62
+ "@mui/x-data-grid-generator": "^6.16.0",
63
+ "@mui/x-data-grid-pro": "^6.16.0",
64
+ "@storybook/addon-actions": "7.0.24",
65
+ "@storybook/addon-docs": "7.0.24",
66
+ "@storybook/addon-essentials": "7.0.24",
67
+ "@storybook/addon-interactions": "7.0.24",
68
+ "@storybook/addon-links": "7.0.24",
69
+ "@storybook/addon-storysource": "7.0.24",
70
+ "@storybook/react": "7.0.24",
71
+ "@storybook/react-vite": "7.0.24",
72
+ "@storybook/testing-library": "0.2.0",
73
+ "@swc-node/register": "^1.6.5",
74
+ "@testing-library/jest-dom": "^5.16.5",
75
+ "@testing-library/react": "^14.0.0",
76
+ "@types/fixed-data-table-2": "^0.8.8",
77
+ "@types/lodash": "^4.14.194",
78
+ "@types/react": "18.2.0",
79
+ "@types/react-datepicker": "^4.11.2",
80
+ "@types/react-dom": "18.2.0",
81
+ "@types/react-plotly.js": "^2.6.0",
82
+ "@vitejs/plugin-react-swc": "^3.3.0",
83
+ "autoprefixer": "^10.4.14",
84
+ "eslint": "^8.40.0",
85
+ "jsdom": "^22.1.0",
86
+ "plotly.js": "^2.25.2",
87
+ "postcss": "^8.4.31",
88
+ "prettier": "2.8.4",
89
+ "react": "18.2.0",
90
+ "react-dom": "^18.2.0",
91
+ "react-plotly.js": "^2.6.0",
92
+ "sass": "1.58.3",
93
+ "storybook": "7.0.24",
94
+ "tailwindcss": "^3.3.1",
95
+ "typescript": "4.8.4",
96
+ "vite": "4.1.4",
97
+ "vite-plugin-checker": "^0.6.1",
98
+ "vite-plugin-css-injected-by-js": "3.0.1",
99
+ "vite-plugin-dts": "^2.3.0",
100
+ "vitest-canvas-mock": "^0.3.2",
101
+ "vitest-fetch-mock": "^0.2.2"
102
+ },
103
+ "peerDependencies": {
104
+ "react": "^16.14.0 || ^17.0.0 || ^18.0.0",
105
+ "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0"
106
+ },
107
+ "volta": {
108
+ "extends": "../../package.json"
109
+ }
110
+ }