@adaptabletools/adaptable-cjs 18.0.1 → 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-cjs",
3
- "version": "18.0.1",
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
@@ -19,7 +19,7 @@ const parseCSV = (content) => {
19
19
  const item = {};
20
20
  for (let j = 0; j < headers.length; j++) {
21
21
  const value = values[j];
22
- item[headers[j]] = value === '' || isNaN(Number(value)) ? value : Number(value);
22
+ item[headers[j]] = value === '' || isNaN(Number(value)) ? value : Number(value); // '0012345'
23
23
  }
24
24
  data.push(item);
25
25
  }
@@ -11,6 +11,7 @@ const AdaptableContext_1 = require("../AdaptableContext");
11
11
  const AdaptableButton_1 = require("../Components/AdaptableButton");
12
12
  const PopupPanel_1 = require("../Components/Popups/AdaptablePopup/PopupPanel");
13
13
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
14
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
14
15
  const tableDOMProps = {
15
16
  style: {
16
17
  height: '100%',
@@ -21,7 +22,9 @@ const tableDOMProps = {
21
22
  const NotePopup = (props) => {
22
23
  var _a, _b, _c, _d;
23
24
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
24
- const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
25
+ const primaryKeyHeader = adaptable.api.columnApi.getPrimaryKeyColumn()
26
+ ? adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId)
27
+ : StringExtensions_1.default.Humanize(adaptable.adaptableOptions.primaryKey);
25
28
  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 : GeneralConstants_1.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME;
26
29
  const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
27
30
  const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
@@ -81,7 +81,23 @@ const StyledColumnWizard = (props) => {
81
81
  React.createElement(StyledColumnWizardStyleSection_1.StyledColumnWizardStyleSection, { onChange: setStyledColumn })));
82
82
  },
83
83
  title: 'Style',
84
- });
84
+ isValid: () => {
85
+ var _a, _b, _c;
86
+ 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;
87
+ return columnComparison
88
+ ? columnComparison.MaxValue == undefined && columnComparison.MinValue == undefined
89
+ ? 'Define Min and Max Values for the Column Comparison'
90
+ : columnComparison.MaxValue == undefined
91
+ ? 'Define a Max Value for the Column Comparison'
92
+ : columnComparison.MinValue == undefined
93
+ ? 'Define a Min Value for the Column Comparison'
94
+ : true
95
+ : true;
96
+ },
97
+ }
98
+ // Only available for Badge
99
+ // AdditionalSettingSection
100
+ );
85
101
  }
86
102
  else if (styledColumn.BadgeStyle) {
87
103
  specificSteps.push({
@@ -61,6 +61,10 @@ const getColumnComparison = (columnComparison, api) => {
61
61
  } })));
62
62
  };
63
63
  const renderStyledColumnStyleSummary = (data, api) => {
64
+ if (!api) {
65
+ const { api: adaptableApi } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
66
+ api = adaptableApi;
67
+ }
64
68
  if (data.GradientStyle) {
65
69
  if (data.GradientStyle.CellRanges) {
66
70
  return getRanges(data.GradientStyle.CellRanges, data.GradientStyle.RangeValueType);
@@ -97,8 +101,10 @@ const StyledColumnWizardStyleSection = (props) => {
97
101
  const scope = { ColumnIds: [data.ColumnId] }; // TODO: remove scope when format column columnStyle is removed
98
102
  // gradient
99
103
  const onUpdateGradientStyleRanges = (ranges) => {
100
- const GradientStyle = Object.assign(Object.assign({}, data.GradientStyle), { CellRanges: ranges });
101
- props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
104
+ const gradientStyle = Object.assign(Object.assign({}, data.GradientStyle), { CellRanges: ranges });
105
+ // delete gradientStyle.ColumnComparison in case we are switching from ColumnComparison to CellRanges
106
+ delete gradientStyle.ColumnComparison;
107
+ props.onChange(Object.assign(Object.assign({}, data), { GradientStyle: gradientStyle }));
102
108
  };
103
109
  const onUpdateGradientStyleColumnComparison = (columnComparison) => {
104
110
  const GradientStyle = {
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  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" || '',
5
- PUBLISH_TIMESTAMP: 1713347042139 || Date.now(),
6
- VERSION: "18.0.1" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1713452251297 || Date.now(),
6
+ VERSION: "18.0.2-canary.0" || '--current-version--',
7
7
  };