@adaptabletools/adaptable 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",
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
  }
@@ -35,4 +35,8 @@ export class CustomSortInternalApi extends ApiBase {
35
35
  return indexFirstElement - indexSecondElement;
36
36
  };
37
37
  }
38
+ columnHasCustomSortComparer(columnId) {
39
+ const columnSortComparer = this.getCustomSortComparer(columnId);
40
+ return columnSortComparer ? true : false;
41
+ }
38
42
  }
@@ -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
  }
@@ -20,24 +20,21 @@ export class CustomSortModule extends AdaptableModuleBase {
20
20
  }
21
21
  createColumnMenuItems(column) {
22
22
  if (column && this.isModuleEditable() && column.sortable) {
23
- let customSort = this.api.customSortApi
24
- .getCustomSorts()
25
- .find((x) => x.ColumnId == column.columnId);
26
- let label = customSort ? 'Edit ' : 'Create ';
27
- // dont show a menu item if there is a custom sort that uses a comparer function
28
- const columnSortComparer = this.api.customSortApi.internalApi.getCustomSortComparer(column.columnId);
29
- if (columnSortComparer) {
30
- return undefined;
23
+ if (!this.api.customSortApi.internalApi.columnHasCustomSortComparer(column.columnId)) {
24
+ let customSort = this.api.customSortApi
25
+ .getCustomSorts()
26
+ .find((x) => x.ColumnId == column.columnId);
27
+ let label = customSort ? 'Edit ' : 'Create ';
28
+ let popupParam = {
29
+ column: column,
30
+ action: customSort ? 'Edit' : 'New',
31
+ source: 'ColumnMenu',
32
+ };
33
+ let name = customSort ? 'custom-sort-edit' : 'custom-sort-add';
34
+ return [
35
+ this.createMenuItemShowPopup(name, label + 'Custom Sort', this.moduleInfo.Popup, this.moduleInfo.Glyph, popupParam),
36
+ ];
31
37
  }
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
- ];
41
38
  }
42
39
  }
43
40
  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 {
@@ -77,6 +77,10 @@ export class LayoutModule extends AdaptableModuleBase {
77
77
  Reference: formatColumn,
78
78
  Module: 'FormatColumn',
79
79
  }));
80
+ this.api.styledColumnApi.getStyledColumns(loadConfig).forEach((styledcolumn) => layoutAssociatedObjectReferences.push({
81
+ Reference: styledcolumn,
82
+ Module: 'StyledColumn',
83
+ }));
80
84
  this.api.plusMinusApi.getAllPlusMinus(loadConfig).forEach((plusMinusNudge) => layoutAssociatedObjectReferences.push({
81
85
  Reference: plusMinusNudge,
82
86
  Module: 'PlusMinus',
@@ -388,7 +392,7 @@ export class LayoutModule extends AdaptableModuleBase {
388
392
  .getModuleService()
389
393
  .getModuleById('Schedule')
390
394
  .setUpScheduleJobs();
391
- // CustomSort, FlashingCell, FormatColumn
395
+ // CustomSort, FlashingCell, FormatColumn, StyledColumn
392
396
  // we need to re-setup the column defs, as some colDefs properties may be changed
393
397
  this.api.internalApi
394
398
  .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;
@@ -9,18 +9,13 @@ import { StyledColumnBadgePreview } from '../View/StyledColumn/Wizard/StyledColu
9
9
  export class StyledColumnModule extends AdaptableModuleBase {
10
10
  constructor(api) {
11
11
  super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
12
- 'Create a Special Column Style e.g Gradient or Percent Bar', api);
12
+ 'Create a Special Column Style e.g Gradient, Percent Bar or Badge', api);
13
13
  }
14
14
  getModuleAdaptableObjects(config) {
15
15
  return this.api.styledColumnApi.getStyledColumns(config);
16
16
  }
17
- getExplicitlyReferencedColumnIds(formatColumn) {
18
- if (this.api.columnScopeApi.scopeHasColumns(formatColumn.Scope)) {
19
- return this.api.columnScopeApi
20
- .getColumnsForScope(formatColumn.Scope)
21
- .map((adaptableColumn) => adaptableColumn.columnId);
22
- }
23
- return [];
17
+ getExplicitlyReferencedColumnIds(styledColumn) {
18
+ return [styledColumn.ColumnId];
24
19
  }
25
20
  hasNamedQueryReferences() {
26
21
  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
  };
@@ -20,6 +20,9 @@ export const CustomSortColumnWizardSection = (props) => {
20
20
  const { data, api } = useOnePageAdaptableWizardContext();
21
21
  const sortableCols = React.useMemo(() => {
22
22
  const sortableColumns = api.columnApi.getSortableColumns();
23
+ const nonComparerSortableColumns = sortableColumns.filter((c) => {
24
+ return api.customSortApi.internalApi.columnHasCustomSortComparer(c.columnId);
25
+ });
23
26
  const customSorts = api.customSortApi.getCustomSorts();
24
27
  const columnSortComparers = api.optionsApi.getCustomSortOptions().customSortComparers || [];
25
28
  const usedColumnIds = [
@@ -28,6 +31,9 @@ export const CustomSortColumnWizardSection = (props) => {
28
31
  ];
29
32
  // filter out used colum ids, but include the current one
30
33
  return sortableColumns.filter((column) => {
34
+ if (api.customSortApi.internalApi.columnHasCustomSortComparer(column.columnId)) {
35
+ return false;
36
+ }
31
37
  if (!props.isNew && column.columnId === (data === null || data === void 0 ? void 0 : data.ColumnId)) {
32
38
  return true;
33
39
  }
@@ -429,12 +429,13 @@ export class AdaptableAgGrid {
429
429
  this.lifecycleState = 'ready';
430
430
  this.forPlugins((plugin) => plugin.onAdaptableReady(this, this.adaptableOptions));
431
431
  setTimeout(() => {
432
+ var _a, _b;
432
433
  // without the setTimeout, calling autoSizeAllColumns immediately in the onAdaptableReady
433
434
  // does not work. (I prefer setTimeout to rAF, as raf is not running when you switch tabs)
434
435
  //
435
436
  // it also makes it possible to listen to CALCULATED_COLUMN_READY, DASHBOARD_READY, etc.
436
437
  // in onAdaptableReady - without this those event listeners are not triggered
437
- this.api.eventApi.emit('AdaptableReady', {
438
+ (_b = (_a = this.api) === null || _a === void 0 ? void 0 : _a.eventApi) === null || _b === void 0 ? void 0 : _b.emit('AdaptableReady', {
438
439
  adaptableApi: this.api,
439
440
  agGridApi: this.agGridAdapter.getAgGridApi(),
440
441
  });
@@ -1629,7 +1630,10 @@ export class AdaptableAgGrid {
1629
1630
  autoSizeLayoutIfNeeded() {
1630
1631
  if (this.shouldAutoSizeLayout()) {
1631
1632
  requestAnimationFrame(() => {
1632
- this.autoSizeAllColumns();
1633
+ var _a;
1634
+ if (this.isAvailable) {
1635
+ (_a = this.agGridAdapter.getAgGridApi()) === null || _a === void 0 ? void 0 : _a.autoSizeAllColumns();
1636
+ }
1633
1637
  });
1634
1638
  }
1635
1639
  }
@@ -1785,7 +1789,8 @@ export class AdaptableAgGrid {
1785
1789
  return acc;
1786
1790
  }
1787
1791
  const ColumnGroupId = columnGroup.getGroupId();
1788
- const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef().marryChildren;
1792
+ const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
1793
+ .marryChildren;
1789
1794
  const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
1790
1795
  const columnsInGroup = columnGroup.getLeafColumns();
1791
1796
  columnsInGroup.forEach((col) => {
@@ -3081,8 +3086,8 @@ export class AdaptableAgGrid {
3081
3086
  this.previousAgGridLayoutState = '';
3082
3087
  const gridContainerElement = this.getAgGridContainerElement();
3083
3088
  if (gridContainerElement) {
3084
- gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown);
3085
- gridContainerElement.removeEventListener('mouseenter', this.agGridListenerMouseEnter);
3089
+ gridContainerElement.removeEventListener('keydown', this.agGridListenerKeydown, true);
3090
+ gridContainerElement.removeEventListener('mouseenter', this.agGridListenerMouseEnter, true);
3086
3091
  gridContainerElement.removeEventListener('mouseleave', this.agGridListenerMouseLeave);
3087
3092
  this.agGridListenerKeydown = null;
3088
3093
  this.agGridListenerMouseEnter = null;
@@ -3507,7 +3512,9 @@ export class AdaptableAgGrid {
3507
3512
  if (pivoted && ((_d = (_c = this.adaptableOptions) === null || _c === void 0 ? void 0 : _c.layoutOptions) === null || _d === void 0 ? void 0 : _d.autoSizeColumnsInPivotLayout)) {
3508
3513
  // when a pivoted layout loads, autosize all cols
3509
3514
  requestAnimationFrame(() => {
3510
- this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3515
+ if (this.isAvailable) {
3516
+ this.agGridAdapter.getAgGridApi().autoSizeAllColumns();
3517
+ }
3511
3518
  });
3512
3519
  // //but if it's also the first time the grid is loading
3513
3520
  // //it's not timely enough the above call, so we keep trying... I know it's ugly, we need to find a better way
@@ -3522,7 +3529,9 @@ export class AdaptableAgGrid {
3522
3529
  if (((_f = (_e = this.adaptableOptions) === null || _e === void 0 ? void 0 : _e.layoutOptions) === null || _f === void 0 ? void 0 : _f.autoSizeColumnsInLayout) &&
3523
3530
  colsToAutoSizeArray.length) {
3524
3531
  requestAnimationFrame(() => {
3525
- this.autoSizeColumns(colsToAutoSizeArray);
3532
+ if (this.isAvailable) {
3533
+ this.autoSizeColumns(colsToAutoSizeArray);
3534
+ }
3526
3535
  });
3527
3536
  }
3528
3537
  }
@@ -3640,7 +3649,9 @@ export class AdaptableAgGrid {
3640
3649
  if (cellDataChangedInfo.trigger === 'undo') {
3641
3650
  this.logger.info(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3642
3651
  }
3643
- if (cellDataChangedInfo.trigger === 'edit' || cellDataChangedInfo.trigger === 'undo') {
3652
+ if (cellDataChangedInfo.trigger === 'edit' ||
3653
+ cellDataChangedInfo.trigger === 'undo' ||
3654
+ cellDataChangedInfo.trigger === 'tick') {
3644
3655
  this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
3645
3656
  this.api.freeTextColumnApi.internalApi.handleFreeTextColumnDataChange(cellDataChangedInfo);
3646
3657
  }
@@ -3749,14 +3760,14 @@ export class AdaptableAgGrid {
3749
3760
  let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == cellDataChangedInfo.primaryKeyValue &&
3750
3761
  gc.column == cellDataChangedInfo.column);
3751
3762
  if (matchingCell) {
3752
- this.refreshSelectedCellsState();
3763
+ this.debouncedSetSelectedCells();
3753
3764
  }
3754
3765
  }
3755
3766
  let selectedRowInfo = this.api.gridApi.getSelectedRowInfo();
3756
3767
  if (selectedRowInfo && ArrayExtensions.IsNotNullOrEmpty(selectedRowInfo.gridRows)) {
3757
3768
  let matchingRow = selectedRowInfo.gridRows.find((gr) => gr.primaryKeyValue == cellDataChangedInfo.primaryKeyValue);
3758
3769
  if (matchingRow) {
3759
- this.refreshSelectedRowsState();
3770
+ this.debouncedSetSelectedRows();
3760
3771
  }
3761
3772
  }
3762
3773
  }
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export default {
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: 1732886810388 || Date.now(),
4
- VERSION: "19.2.2-canary.1" || '--current-version--',
2
+ INFINITE_TABLE_LICENSE_KEY: process.env.INFINITE_TABLE_LICENSE_KEY || '',
3
+ PUBLISH_TIMESTAMP: 1736417144748 || Date.now(),
4
+ VERSION: "19.2.3" || '--current-version--',
5
5
  };