@adaptabletools/adaptable 14.0.1 → 14.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "14.0.1",
3
+ "version": "14.0.2",
4
4
  "description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1672863237672;
1
+ declare const _default: 1672934364457;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1672863237672;
3
+ exports.default = 1672934364457;
@@ -222,7 +222,7 @@ export interface IAdaptable {
222
222
  exportToExcel(reportData: ReportData, fileName: string): void;
223
223
  exportVisualDataToExcel(): void;
224
224
  canGenerateCharts(): boolean;
225
- canHaveSparklines(): boolean;
225
+ canDisplaySparklines(): boolean;
226
226
  showCharts(charts: ChartDefinition[]): ChartRef[];
227
227
  showChart(chart: ChartDefinition, container?: HTMLElement): ChartRef;
228
228
  getChartRef(chardId: string): ChartRef;
@@ -14,7 +14,7 @@ export interface ChartingOptions {
14
14
  chartContainers?: ChartContainer[];
15
15
  }
16
16
  /**
17
- * Describes a location to display an AG Grid Chart
17
+ * Describes Location to display an AG Grid Chart
18
18
  */
19
19
  export interface ChartContainer {
20
20
  /**
@@ -22,11 +22,10 @@ export interface ChartContainer {
22
22
  */
23
23
  name: string;
24
24
  /**
25
- * Weather a single chart can be displayed or multiple in the same location
26
- *
27
- * @defaults 'single'
25
+ * Whether one or more Charts can be displayed in same location
26
+ * @defaultValue 'single'
28
27
  */
29
- type?: 'single' | 'multiple';
28
+ chartsDisplay?: 'single' | 'multiple';
30
29
  /**
31
30
  * Location - can be HTMLElement or Id of Div
32
31
  */
@@ -28,4 +28,5 @@ export declare class StyledColumnApiImpl extends ApiBase implements StyledColumn
28
28
  getActiveStyledColumnForColumn(column: AdaptableColumn): StyledColumn | undefined;
29
29
  hasPercentBarStyle(columnId: string): boolean;
30
30
  hasGradientStyle(columnId: string): boolean;
31
+ canDisplaySparklines(): boolean;
31
32
  }
@@ -98,5 +98,8 @@ class StyledColumnApiImpl extends ApiBase_1.ApiBase {
98
98
  }
99
99
  return !!this.getStyledColumns().find((styledColumn) => !!styledColumn.GradientStyle && styledColumn.ColumnId === columnId);
100
100
  }
101
+ canDisplaySparklines() {
102
+ return this.adaptable.canDisplaySparklines();
103
+ }
101
104
  }
102
105
  exports.StyledColumnApiImpl = StyledColumnApiImpl;
@@ -102,4 +102,8 @@ export interface StyledColumnApi {
102
102
  * @deprecated use `getSuspendedStyledColumns()` instead
103
103
  */
104
104
  getAllSuspendedStyledColumn(): StyledColumn[];
105
+ /**
106
+ * If this AdapTable instance can display Sparklines (e.g. is AG Grid SparklinesModule installed)
107
+ */
108
+ canDisplaySparklines(): boolean;
105
109
  }
@@ -24,7 +24,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
24
24
  return this.api.formatColumnApi.getFormatColumns(config);
25
25
  }
26
26
  getExplicitlyReferencedColumnIds(formatColumn) {
27
- const queryExpression = this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
27
+ const queryExpression = formatColumn.Rule && this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
28
28
  if (queryExpression) {
29
29
  return this.api.queryLanguageApi.getColumnsFromExpression(queryExpression);
30
30
  }
@@ -36,7 +36,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
36
36
  return [];
37
37
  }
38
38
  getReferencedNamedQueryNames(formatColumn) {
39
- const queryExpression = this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
39
+ const queryExpression = formatColumn.Rule && this.api.queryLanguageApi.getAdaptableQueryExpression(formatColumn.Rule);
40
40
  if (!queryExpression) {
41
41
  return [];
42
42
  }
@@ -76,7 +76,9 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
76
76
  // Need a Column and an editable Module
77
77
  if (column && this.isModuleEditable()) {
78
78
  // First look at Sparkline Columns - needs to be editable array type
79
- if (this.api.columnApi.hasArrayDataType(column.columnId) && column.IsReadOnly !== true) {
79
+ if (this.api.columnApi.hasArrayDataType(column.columnId) &&
80
+ column.IsReadOnly !== true &&
81
+ this.api.styledColumnApi.canDisplaySparklines()) {
80
82
  let styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
81
83
  let sparklineColumnExists = column.isSparkline && Boolean(styledColumn);
82
84
  if (column.isSparkline && !sparklineColumnExists) {
@@ -49,11 +49,11 @@ const useChartState = (chartDefinition) => {
49
49
  return;
50
50
  }
51
51
  /**
52
- * When using a custom container, make sure multiple charts are not opnoed in the same container.
52
+ * When using a custom container, make sure multiple charts are not opened in the same container.
53
53
  * If multple charts are opened in the same contianer, it infinitly adds the charts to the container.
54
54
  */
55
55
  if (chartContainer && element) {
56
- if (chartContainer.type !== 'multiple') {
56
+ if (chartContainer.chartsDisplay !== 'multiple') {
57
57
  closeAlreadyOpenedChartsInContainer(element);
58
58
  }
59
59
  adaptable.api.chartingApi.showChartDefinitionOnce(chartDefinition, element);
@@ -39,7 +39,7 @@ const StyledColumnWizard = (props) => {
39
39
  };
40
40
  const checkboxGrandientPercentSteps = [
41
41
  {
42
- details: 'Select the style to apply',
42
+ details: 'Create the Style to apply',
43
43
  renderSummary: StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary,
44
44
  render: () => {
45
45
  return (React.createElement(rebass_1.Box, { padding: 2 },
@@ -48,6 +48,7 @@ const StyledColumnWizard = (props) => {
48
48
  title: 'Style',
49
49
  },
50
50
  {
51
+ details: 'Apply additional Settings',
51
52
  renderSummary: StyledColumnWizardSettingsSection_1.renderStyledColumnWizardSettingsSummary,
52
53
  render: () => {
53
54
  return (React.createElement(rebass_1.Box, { padding: 2 },
@@ -65,7 +66,7 @@ const StyledColumnWizard = (props) => {
65
66
  ];
66
67
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: styledColumn, onFinish: handleFinish, onHide: props.onCloseWizard, sections: [
67
68
  {
68
- details: 'Select a Styled Column Type',
69
+ details: 'Select a Styled Column type',
69
70
  renderSummary: StyledColumnWizardTypeSection_1.renderStyledColumnTypeSummary,
70
71
  render: () => {
71
72
  return (React.createElement(rebass_1.Box, { padding: 2 },
@@ -76,7 +77,7 @@ const StyledColumnWizard = (props) => {
76
77
  {
77
78
  isValid: StyledColumnWizardColumnSection_1.isValidStyledColumnColumn,
78
79
  renderSummary: StyledColumnWizardColumnSection_1.renderStyledColumnColumnSummary,
79
- details: 'Select column to apply the style to',
80
+ details: 'Select a Column where the Style will be applied',
80
81
  render: () => {
81
82
  return (React.createElement(rebass_1.Box, { padding: 2, style: { height: '100%' } },
82
83
  React.createElement(StyledColumnWizardColumnSection_1.StyledColumnWizardColumnSection, { isNew: props.isNew, onChange: setStyledColumn })));
@@ -7,6 +7,7 @@ const rebass_1 = require("rebass");
7
7
  const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
8
8
  const Tabs_1 = require("../../../components/Tabs");
9
9
  const Tag_1 = require("../../../components/Tag");
10
+ const AdaptableContext_1 = require("../../AdaptableContext");
10
11
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
11
12
  const renderStyledColumnTypeSummary = (data) => {
12
13
  let type = null;
@@ -29,6 +30,7 @@ const renderStyledColumnTypeSummary = (data) => {
29
30
  exports.renderStyledColumnTypeSummary = renderStyledColumnTypeSummary;
30
31
  const StyledColumnWizardTypeSection = (props) => {
31
32
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
33
+ const adaptable = (0, AdaptableContext_1.useAdaptable)();
32
34
  const handleTypeChange = (type) => {
33
35
  const newStyledColumn = Object.assign({}, data);
34
36
  delete newStyledColumn.GradientStyle;
@@ -63,6 +65,6 @@ const StyledColumnWizardTypeSection = (props) => {
63
65
  React.createElement(Radio_1.default, { checked: Boolean(data.GradientStyle), onChange: () => handleTypeChange('gradient') }, "Gradient Column"),
64
66
  React.createElement(Radio_1.default, { onChange: () => handleTypeChange('percent'), checked: Boolean(data.PercentBarStyle) }, "Percent Bar"),
65
67
  React.createElement(Radio_1.default, { onChange: () => handleTypeChange('checkbox'), checked: Boolean(data.CheckBoxStyle) }, "Check Box"),
66
- React.createElement(Radio_1.default, { onChange: () => handleTypeChange('sparkline'), checked: Boolean(data.SparkLineStyle) }, "Sparkline")))));
68
+ adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(Radio_1.default, { onChange: () => handleTypeChange('sparkline'), checked: Boolean(data.SparkLineStyle) }, "Sparkline"))))));
67
69
  };
68
70
  exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
@@ -368,7 +368,7 @@ export declare class Adaptable implements IAdaptable {
368
368
  private setupColumnHeaderAggregations;
369
369
  private getGridOptionsApi;
370
370
  canGenerateCharts(): boolean;
371
- canHaveSparklines(): boolean;
371
+ canDisplaySparklines(): boolean;
372
372
  canExportToExcel(): boolean;
373
373
  exportToExcel(reportData: ReportData, fileName: string): void;
374
374
  private setExcelStylesForExport;
@@ -4432,7 +4432,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4432
4432
  canGenerateCharts() {
4433
4433
  return (this.isAgGridModulePresent(core_1.ModuleNames.GridChartsModule) && this.gridOptions.enableCharts);
4434
4434
  }
4435
- canHaveSparklines() {
4435
+ canDisplaySparklines() {
4436
4436
  return this.isAgGridModulePresent(core_1.ModuleNames.SparklinesModule);
4437
4437
  }
4438
4438
  canExportToExcel() {
@@ -1540,13 +1540,15 @@ export declare const ADAPTABLE_METAMODEL: {
1540
1540
  kind: string;
1541
1541
  description: string;
1542
1542
  uiLabel: string;
1543
- isOptional?: undefined;
1543
+ isOptional: boolean;
1544
+ defaultValue: string;
1544
1545
  } | {
1545
1546
  name: string;
1546
1547
  kind: string;
1547
1548
  description: string;
1548
1549
  uiLabel: string;
1549
- isOptional: boolean;
1550
+ isOptional?: undefined;
1551
+ defaultValue?: undefined;
1550
1552
  })[];
1551
1553
  };
1552
1554
  ChartDefinition: {