@adaptabletools/adaptable-cjs 19.2.2-canary.1 → 19.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-cjs",
3
- "version": "19.2.2-canary.1",
3
+ "version": "19.2.3",
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,7 +1,7 @@
1
1
  import { ColumnScope } from '../../types';
2
2
  import { AdaptableComparerFunction } from '../PredefinedConfig/Common/AdaptableComparerFunction';
3
3
  /**
4
- * Options for providing Custom Sorts comparers
4
+ * Used to provide Custom Sorts comparers
5
5
  */
6
6
  export interface CustomSortOptions<TData = any> {
7
7
  /**
@@ -4,4 +4,5 @@ import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/Adaptab
4
4
  export declare class CustomSortInternalApi extends ApiBase {
5
5
  getCustomSortComparer(columnId: string): ColumnValuesComparer | undefined;
6
6
  getDefaultCustomSortComparer(columnId: string, columnValues: any[]): AdaptableComparerFunction;
7
+ columnHasCustomSortComparer(columnId: string): boolean;
7
8
  }
@@ -38,5 +38,9 @@ class CustomSortInternalApi extends ApiBase_1.ApiBase {
38
38
  return indexFirstElement - indexSecondElement;
39
39
  };
40
40
  }
41
+ columnHasCustomSortComparer(columnId) {
42
+ const columnSortComparer = this.getCustomSortComparer(columnId);
43
+ return columnSortComparer ? true : false;
44
+ }
41
45
  }
42
46
  exports.CustomSortInternalApi = CustomSortInternalApi;
@@ -21,5 +21,5 @@ export interface CustomSort extends SuspendableObject {
21
21
  * Order of values by which Column will be sorted
22
22
  *
23
23
  */
24
- SortedValues?: string[];
24
+ SortedValues?: any[];
25
25
  }
@@ -24,24 +24,21 @@ class CustomSortModule extends AdaptableModuleBase_1.AdaptableModuleBase {
24
24
  }
25
25
  createColumnMenuItems(column) {
26
26
  if (column && this.isModuleEditable() && column.sortable) {
27
- let customSort = this.api.customSortApi
28
- .getCustomSorts()
29
- .find((x) => x.ColumnId == column.columnId);
30
- let label = customSort ? 'Edit ' : 'Create ';
31
- // dont show a menu item if there is a custom sort that uses a comparer function
32
- const columnSortComparer = this.api.customSortApi.internalApi.getCustomSortComparer(column.columnId);
33
- if (columnSortComparer) {
34
- return undefined;
27
+ if (!this.api.customSortApi.internalApi.columnHasCustomSortComparer(column.columnId)) {
28
+ let customSort = this.api.customSortApi
29
+ .getCustomSorts()
30
+ .find((x) => x.ColumnId == column.columnId);
31
+ let label = customSort ? 'Edit ' : 'Create ';
32
+ let popupParam = {
33
+ column: column,
34
+ action: customSort ? 'Edit' : 'New',
35
+ source: 'ColumnMenu',
36
+ };
37
+ let name = customSort ? 'custom-sort-edit' : 'custom-sort-add';
38
+ return [
39
+ this.createMenuItemShowPopup(name, label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
40
+ ];
35
41
  }
36
- let popupParam = {
37
- column: column,
38
- action: customSort ? 'Edit' : 'New',
39
- source: 'ColumnMenu',
40
- };
41
- let name = customSort ? 'custom-sort-edit' : 'custom-sort-add';
42
- return [
43
- this.createMenuItemShowPopup(name, label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
44
- ];
45
42
  }
46
43
  }
47
44
  getTeamSharingAction() {
@@ -22,7 +22,7 @@ export interface ModuleInfo {
22
22
  }
23
23
  export type TeamSharingReferences = TeamSharingReference[];
24
24
  export type TeamSharingReference = {
25
- Module: StrictExtract<AdaptableModule, 'CalculatedColumn' | 'FreeTextColumn' | 'NamedQuery' | 'Alert' | 'CustomSort' | 'FlashingCell' | 'FormatColumn' | 'PlusMinus' | 'Shortcut' | 'Schedule'>;
25
+ Module: StrictExtract<AdaptableModule, 'CalculatedColumn' | 'FreeTextColumn' | 'NamedQuery' | 'Alert' | 'CustomSort' | 'FlashingCell' | 'FormatColumn' | 'PlusMinus' | 'Shortcut' | 'Schedule' | 'StyledColumn'>;
26
26
  Reference: AdaptableObject;
27
27
  };
28
28
  export interface AdaptableObjectItemView {
@@ -81,6 +81,10 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
81
81
  Reference: formatColumn,
82
82
  Module: 'FormatColumn',
83
83
  }));
84
+ this.api.styledColumnApi.getStyledColumns(loadConfig).forEach((styledcolumn) => layoutAssociatedObjectReferences.push({
85
+ Reference: styledcolumn,
86
+ Module: 'StyledColumn',
87
+ }));
84
88
  this.api.plusMinusApi.getAllPlusMinus(loadConfig).forEach((plusMinusNudge) => layoutAssociatedObjectReferences.push({
85
89
  Reference: plusMinusNudge,
86
90
  Module: 'PlusMinus',
@@ -392,7 +396,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
392
396
  .getModuleService()
393
397
  .getModuleById('Schedule')
394
398
  .setUpScheduleJobs();
395
- // CustomSort, FlashingCell, FormatColumn
399
+ // CustomSort, FlashingCell, FormatColumn, StyledColumn
396
400
  // we need to re-setup the column defs, as some colDefs properties may be changed
397
401
  this.api.internalApi
398
402
  .getAdaptableInstance()
@@ -2,7 +2,6 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
2
2
  import { AdaptableColumn } from '../PredefinedConfig/Common/AdaptableColumn';
3
3
  import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
4
4
  import { TeamSharingImportInfo } from '../PredefinedConfig/TeamSharingState';
5
- import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
6
5
  import { AdaptableModuleView, AdaptableObjectView, IModule } from './Interface/IModule';
7
6
  import { AdaptableApi } from '../Api/AdaptableApi';
8
7
  import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
@@ -12,7 +11,7 @@ export declare class StyledColumnModule extends AdaptableModuleBase implements I
12
11
  getModuleAdaptableObjects(config?: {
13
12
  includeLayoutNotAssociatedObjects?: boolean;
14
13
  }): AdaptableObject[];
15
- getExplicitlyReferencedColumnIds(formatColumn: FormatColumn): string[];
14
+ getExplicitlyReferencedColumnIds(styledColumn: StyledColumn): string[];
16
15
  hasNamedQueryReferences(): boolean;
17
16
  createColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem<"calculated-column-edit" | "cell-summary-show" | "column-group" | "column-filter-group" | "column-filter-bar-hide" | "column-filter-bar-show" | "column-filter-clear" | "column-filter-suspend" | "column-filter-unsuspend" | "column-info-show" | "custom-sort-add" | "custom-sort-edit" | "dashboard-group" | "dashboard-collapse" | "dashboard-configure" | "dashboard-dock" | "dashboard-expand" | "dashboard-float" | "dashboard-hide" | "dashboard-show" | "data-import" | "flashing-cell-add" | "flashing-cell-delete" | "format-column-add" | "format-column-edit" | "free-text-column-edit" | "grid-group" | "grid-info-show" | "layout-column-caption-change" | "layout-column-hide" | "layout-edit" | "layout-column-select" | "layout-column-select-preserve" | "layout-column-select-reset" | "layout-grid-select" | "plus-minus-add" | "settings-panel-open" | "styling-group" | "styled-column-badge-add" | "styled-column-badge-edit" | "styled-column-gradient-add" | "styled-column-gradient-edit" | "styled-column-percent-bar-add" | "styled-column-percent-bar-edit" | "styled-column-sparkline-add" | "styled-column-sparkline-edit" | "system-status-show" | "_navbar">[];
18
17
  private getGlyphForStyledColumn;
@@ -13,18 +13,13 @@ const StyledColumnBadgePreview_1 = require("../View/StyledColumn/Wizard/StyledCo
13
13
  class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
14
14
  constructor(api) {
15
15
  super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
16
- 'Create a Special Column Style e.g Gradient or Percent Bar', api);
16
+ 'Create a Special Column Style e.g Gradient, Percent Bar or Badge', api);
17
17
  }
18
18
  getModuleAdaptableObjects(config) {
19
19
  return this.api.styledColumnApi.getStyledColumns(config);
20
20
  }
21
- getExplicitlyReferencedColumnIds(formatColumn) {
22
- if (this.api.columnScopeApi.scopeHasColumns(formatColumn.Scope)) {
23
- return this.api.columnScopeApi
24
- .getColumnsForScope(formatColumn.Scope)
25
- .map((adaptableColumn) => adaptableColumn.columnId);
26
- }
27
- return [];
21
+ getExplicitlyReferencedColumnIds(styledColumn) {
22
+ return [styledColumn.ColumnId];
28
23
  }
29
24
  hasNamedQueryReferences() {
30
25
  return false;
@@ -1,5 +1,5 @@
1
1
  import { CustomSort } from '../../../../types';
2
2
  export declare const getCustomSortSortOrderViewItems: (customSort: CustomSort) => {
3
3
  name: string;
4
- values: string[];
4
+ values: any[];
5
5
  };
@@ -26,6 +26,9 @@ const CustomSortColumnWizardSection = (props) => {
26
26
  const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
27
27
  const sortableCols = React.useMemo(() => {
28
28
  const sortableColumns = api.columnApi.getSortableColumns();
29
+ const nonComparerSortableColumns = sortableColumns.filter((c) => {
30
+ return api.customSortApi.internalApi.columnHasCustomSortComparer(c.columnId);
31
+ });
29
32
  const customSorts = api.customSortApi.getCustomSorts();
30
33
  const columnSortComparers = api.optionsApi.getCustomSortOptions().customSortComparers || [];
31
34
  const usedColumnIds = [
@@ -34,6 +37,9 @@ const CustomSortColumnWizardSection = (props) => {
34
37
  ];
35
38
  // filter out used colum ids, but include the current one
36
39
  return sortableColumns.filter((column) => {
40
+ if (api.customSortApi.internalApi.columnHasCustomSortComparer(column.columnId)) {
41
+ return false;
42
+ }
37
43
  if (!props.isNew && column.columnId === (data === null || data === void 0 ? void 0 : data.ColumnId)) {
38
44
  return true;
39
45
  }
@@ -433,12 +433,13 @@ class AdaptableAgGrid {
433
433
  this.lifecycleState = 'ready';
434
434
  this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
435
435
  setTimeout(() => {
436
+ var _a, _b;
436
437
  // without the setTimeout, calling autoSizeAllColumns immediately in the onAdaptableReady
437
438
  // does not work. (I prefer setTimeout to rAF, as raf is not running when you switch tabs)
438
439
  //
439
440
  // it also makes it possible to listen to CALCULATED_COLUMN_READY, DASHBOARD_READY, etc.
440
441
  // in onAdaptableReady - without this those event listeners are not triggered
441
- this.api.eventApi.emit('AdaptableReady', {
442
+ (_b = (_a = this.api) === null || _a === void 0 ? void 0 : _a.eventApi) === null || _b === void 0 ? void 0 : _b.emit('AdaptableReady', {
442
443
  adaptableApi: this.api,
443
444
  agGridApi: this.agGridAdapter.getAgGridApi(),
444
445
  });
@@ -1633,7 +1634,10 @@ class AdaptableAgGrid {
1633
1634
  autoSizeLayoutIfNeeded() {
1634
1635
  if (this.shouldAutoSizeLayout()) {
1635
1636
  requestAnimationFrame(() => {
1636
- this.autoSizeAllColumns();
1637
+ var _a;
1638
+ if (this.isAvailable) {
1639
+ (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
1640
+ }
1637
1641
  });
1638
1642
  }
1639
1643
  }
@@ -1789,7 +1793,8 @@ class AdaptableAgGrid {
1789
1793
  return acc;
1790
1794
  }
1791
1795
  const ColumnGroupId = columnGroup.getGroupId();
1792
- const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef().marryChildren;
1796
+ const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
1797
+ .marryChildren;
1793
1798
  const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
1794
1799
  const columnsInGroup = columnGroup.getLeafColumns();
1795
1800
  columnsInGroup.forEach((col) => {
@@ -3085,8 +3090,8 @@ class AdaptableAgGrid {
3085
3090
  this.previousAgGridLayoutState = '';
3086
3091
  const gridContainerElement = this.getAgGridContainerElement();
3087
3092
  if (gridContainerElement) {
3088
- gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown);
3089
- gridContainerElement.removeEventListener('mouseenter', this.agGridListenerMouseEnter);
3093
+ gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown, true);
3094
+ gridContainerElement.removeEventListener('mouseenter', this.agGridListenerMouseEnter, true);
3090
3095
  gridContainerElement.removeEventListener('mouseleave', this.agGridListenerMouseLeave);
3091
3096
  this.agGridListenerKeydown = null;
3092
3097
  this.agGridListenerMouseEnter = null;
@@ -3511,7 +3516,9 @@ class AdaptableAgGrid {
3511
3516
  if (pivoted && ((_d = (_c = this.adaptableOptions) === null || _c === void 0 ? void 0 : _c.layoutOptions) === null || _d === void 0 ? void 0 : _d.autoSizeColumnsInPivotLayout)) {
3512
3517
  // when a pivoted layout loads, autosize all cols
3513
3518
  requestAnimationFrame(() => {
3514
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3519
+ if (this.isAvailable) {
3520
+ this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3521
+ }
3515
3522
  });
3516
3523
  // //but if it's also the first time the grid is loading
3517
3524
  // //it's not timely enough the above call, so we keep trying... I know it's ugly, we need to find a better way
@@ -3526,7 +3533,9 @@ class AdaptableAgGrid {
3526
3533
  if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
3527
3534
  colsToAutoSizeArray.length) {
3528
3535
  requestAnimationFrame(() => {
3529
- this.autoSizeColumns(colsToAutoSizeArray);
3536
+ if (this.isAvailable) {
3537
+ this.autoSizeColumns(colsToAutoSizeArray);
3538
+ }
3530
3539
  });
3531
3540
  }
3532
3541
  }
@@ -3644,7 +3653,9 @@ class AdaptableAgGrid {
3644
3653
  if (cellDataChangedInfo.trigger === 'undo') {
3645
3654
  this.logger.info(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3646
3655
  }
3647
- if (cellDataChangedInfo.trigger === 'edit' || cellDataChangedInfo.trigger === 'undo') {
3656
+ if (cellDataChangedInfo.trigger === 'edit' ||
3657
+ cellDataChangedInfo.trigger === 'undo' ||
3658
+ cellDataChangedInfo.trigger === 'tick') {
3648
3659
  this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
3649
3660
  this.api.freeTextColumnApi.internalApi.handleFreeTextColumnDataChange(cellDataChangedInfo);
3650
3661
  }
@@ -3753,14 +3764,14 @@ class AdaptableAgGrid {
3753
3764
  let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == cellDataChangedInfo.primaryKeyValue &&
3754
3765
  gc.column == cellDataChangedInfo.column);
3755
3766
  if (matchingCell) {
3756
- this.refreshSelectedCellsState();
3767
+ this.debouncedSetSelectedCells();
3757
3768
  }
3758
3769
  }
3759
3770
  let selectedRowInfo = this.api.gridApi.getSelectedRowInfo();
3760
3771
  if (selectedRowInfo && ArrayExtensions_1.default.IsNotNullOrEmpty(selectedRowInfo.gridRows)) {
3761
3772
  let matchingRow = selectedRowInfo.gridRows.find((gr) => gr.primaryKeyValue == cellDataChangedInfo.primaryKeyValue);
3762
3773
  if (matchingRow) {
3763
- this.refreshSelectedRowsState();
3774
+ this.debouncedSetSelectedRows();
3764
3775
  }
3765
3776
  }
3766
3777
  }
package/src/env.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
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: 1732886841433 || Date.now(),
6
- VERSION: "19.2.2-canary.1" || '--current-version--',
4
+ INFINITE_TABLE_LICENSE_KEY: process.env.INFINITE_TABLE_LICENSE_KEY || '',
5
+ PUBLISH_TIMESTAMP: 1736417174449 || Date.now(),
6
+ VERSION: "19.2.3" || '--current-version--',
7
7
  };