@adaptabletools/adaptable 18.0.0 → 18.0.2-canary.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "18.0.0",
3
+ "version": "18.0.2-canary.0",
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",
@@ -250,9 +250,9 @@ export interface ColumnApi {
250
250
  */
251
251
  isColumnInGrid(columnId: string): boolean;
252
252
  /**
253
- * Retrieves current Primary Key Column in AdapTable
253
+ * Retrieves current Primary Key Column in AdapTable. It may be undefined if the primary key is auto-generated, or it is NOT mapped to a column.
254
254
  */
255
- getPrimaryKeyColumn(): AdaptableColumn;
255
+ getPrimaryKeyColumn(): AdaptableColumn | undefined;
256
256
  /**
257
257
  * Returns the default Aggregation Function for a Column
258
258
  * @param columnId Column to Check
@@ -21,11 +21,17 @@ import { AdaptableSearchState, AdaptableSortState, NamedQueryState, PredefinedCo
21
21
  */
22
22
  export interface ConfigApi {
23
23
  /**
24
- * Changes the key used for persisting the AdaptableState into localStorage
25
- * @param adaptableStateKey key for persisting the AdaptableState into localStorage
24
+ * Changes the key used for persisting the AdaptableState into localStorage. Optionally provides a predefinedConfig to load.
25
+ * @param adaptableStateKey - key for persisting the AdaptableState into localStorage
26
+ * @param config.predefinedConfig - new predefinedConfig to load
27
+ * @param config.flushCurrentState - whether to flush(persist) the current state before loading the new predefinedConfig
28
+ * @param config.progressIndicatorLabel - label for the progress indicator
29
+ *
26
30
  */
27
31
  setAdaptableStateKey(adaptableStateKey: string, config?: {
28
- predefinedConfig: PredefinedConfig;
32
+ predefinedConfig?: PredefinedConfig;
33
+ flushCurrentState?: boolean;
34
+ progressIndicatorLabel?: string;
29
35
  }): Promise<void>;
30
36
  /**
31
37
  * Returns current Predefined Config
@@ -37,8 +37,9 @@ export declare class ConfigApiImpl extends ApiBase implements ConfigApi {
37
37
  getAdaptableSortState(): AdaptableSortState;
38
38
  getAdaptableOptions(): Readonly<AdaptableOptions>;
39
39
  setAdaptableStateKey(adaptableStateKey: string, config?: {
40
- predefinedConfig: PredefinedConfig;
40
+ predefinedConfig?: PredefinedConfig;
41
41
  flushCurrentState?: boolean;
42
+ progressIndicatorLabel?: string;
42
43
  }): Promise<void>;
43
44
  getDescriptionForModule(module: AdaptableModule): string;
44
45
  getHelpPageForModule(module: AdaptableModule): string;
@@ -110,7 +110,8 @@ export class ConfigApiImpl extends ApiBase {
110
110
  }
111
111
  setAdaptableStateKey(adaptableStateKey, config) {
112
112
  return new Promise((resolve, reject) => {
113
- this.getAdaptableApi().internalApi.executeWithProgressIndicator(`Initialising...`, () => {
113
+ var _a;
114
+ this.getAdaptableApi().internalApi.executeWithProgressIndicator((_a = config === null || config === void 0 ? void 0 : config.progressIndicatorLabel) !== null && _a !== void 0 ? _a : `Initialising...`, () => {
114
115
  const flushCurrentState = !config || config.flushCurrentState !== false;
115
116
  // make sure we persist any "pending" changes to state - since stateOptions.debounceStateDelay can cause
116
117
  // the state to be persisted with a delay, which we dont want in this case
@@ -145,6 +146,9 @@ export class ConfigApiImpl extends ApiBase {
145
146
  })
146
147
  .catch((e) => {
147
148
  this.logError('Error setting Adaptable State Key', e);
149
+ })
150
+ .finally(() => {
151
+ this.getUserInterfaceApi().hideProgressIndicator();
148
152
  });
149
153
  });
150
154
  });
@@ -16,7 +16,7 @@ export const parseCSV = (content) => {
16
16
  const item = {};
17
17
  for (let j = 0; j < headers.length; j++) {
18
18
  const value = values[j];
19
- item[headers[j]] = value === '' || isNaN(Number(value)) ? value : Number(value);
19
+ item[headers[j]] = value === '' || isNaN(Number(value)) ? value : Number(value); // '0012345'
20
20
  }
21
21
  data.push(item);
22
22
  }
@@ -7,6 +7,7 @@ import { useAdaptable } from '../AdaptableContext';
7
7
  import { AdaptableButtonComponent } from '../Components/AdaptableButton';
8
8
  import { PopupPanel } from '../Components/Popups/AdaptablePopup/PopupPanel';
9
9
  import { DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME } from '../../Utilities/Constants/GeneralConstants';
10
+ import StringExtensions from '../../Utilities/Extensions/StringExtensions';
10
11
  const tableDOMProps = {
11
12
  style: {
12
13
  height: '100%',
@@ -17,7 +18,9 @@ const tableDOMProps = {
17
18
  export const NotePopup = (props) => {
18
19
  var _a, _b, _c, _d;
19
20
  const adaptable = useAdaptable();
20
- const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
21
+ const primaryKeyHeader = adaptable.api.columnApi.getPrimaryKeyColumn()
22
+ ? adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId)
23
+ : StringExtensions.Humanize(adaptable.adaptableOptions.primaryKey);
21
24
  const dateFormat = (_d = (_c = (_b = (_a = adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) === null || _c === void 0 ? void 0 : _c.dateFormat) !== null && _d !== void 0 ? _d : DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
22
25
  const allNotes = useSelector((state) => GetAllNotesSelector(state.Note));
23
26
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
@@ -77,7 +77,23 @@ export const StyledColumnWizard = (props) => {
77
77
  React.createElement(StyledColumnWizardStyleSection, { onChange: setStyledColumn })));
78
78
  },
79
79
  title: 'Style',
80
- });
80
+ isValid: () => {
81
+ var _a, _b, _c;
82
+ const columnComparison = (_b = (_a = styledColumn.GradientStyle) === null || _a === void 0 ? void 0 : _a.ColumnComparison) !== null && _b !== void 0 ? _b : (_c = styledColumn.PercentBarStyle) === null || _c === void 0 ? void 0 : _c.ColumnComparison;
83
+ return columnComparison
84
+ ? columnComparison.MaxValue == undefined && columnComparison.MinValue == undefined
85
+ ? 'Define Min and Max Values for the Column Comparison'
86
+ : columnComparison.MaxValue == undefined
87
+ ? 'Define a Max Value for the Column Comparison'
88
+ : columnComparison.MinValue == undefined
89
+ ? 'Define a Min Value for the Column Comparison'
90
+ : true
91
+ : true;
92
+ },
93
+ }
94
+ // Only available for Badge
95
+ // AdditionalSettingSection
96
+ );
81
97
  }
82
98
  else if (styledColumn.BadgeStyle) {
83
99
  specificSteps.push({
@@ -56,6 +56,10 @@ const getColumnComparison = (columnComparison, api) => {
56
56
  } })));
57
57
  };
58
58
  export const renderStyledColumnStyleSummary = (data, api) => {
59
+ if (!api) {
60
+ const { api: adaptableApi } = useOnePageAdaptableWizardContext();
61
+ api = adaptableApi;
62
+ }
59
63
  if (data.GradientStyle) {
60
64
  if (data.GradientStyle.CellRanges) {
61
65
  return getRanges(data.GradientStyle.CellRanges, data.GradientStyle.RangeValueType);
@@ -91,8 +95,10 @@ export const StyledColumnWizardStyleSection = (props) => {
91
95
  const scope = { ColumnIds: [data.ColumnId] }; // TODO: remove scope when format column columnStyle is removed
92
96
  // gradient
93
97
  const onUpdateGradientStyleRanges = (ranges) => {
94
- const GradientStyle = Object.assign(Object.assign({}, data.GradientStyle), { CellRanges: ranges });
95
- props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
98
+ const gradientStyle = Object.assign(Object.assign({}, data.GradientStyle), { CellRanges: ranges });
99
+ // delete gradientStyle.ColumnComparison in case we are switching from ColumnComparison to CellRanges
100
+ delete gradientStyle.ColumnComparison;
101
+ props.onChange(Object.assign(Object.assign({}, data), { GradientStyle: gradientStyle }));
96
102
  };
97
103
  const onUpdateGradientStyleColumnComparison = (columnComparison) => {
98
104
  const GradientStyle = {
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
2
2
  INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
3
- PUBLISH_TIMESTAMP: 1713175428736 || Date.now(),
4
- VERSION: "18.0.0" || '--current-version--',
3
+ PUBLISH_TIMESTAMP: 1713452220124 || Date.now(),
4
+ VERSION: "18.0.2-canary.0" || '--current-version--',
5
5
  };