@adaptabletools/adaptable-cjs 19.2.2 → 19.2.4

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",
3
+ "version": "19.2.4",
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
  }
@@ -1793,7 +1793,8 @@ class AdaptableAgGrid {
1793
1793
  return acc;
1794
1794
  }
1795
1795
  const ColumnGroupId = columnGroup.getGroupId();
1796
- const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef().marryChildren;
1796
+ const AllowGroupSplit = !columnGroup.getProvidedColumnGroup().getColGroupDef()
1797
+ .marryChildren;
1797
1798
  const FriendlyName = (_c = columnGroup.getProvidedColumnGroup().getColGroupDef().headerName) !== null && _c !== void 0 ? _c : ColumnGroupId;
1798
1799
  const columnsInGroup = columnGroup.getLeafColumns();
1799
1800
  columnsInGroup.forEach((col) => {
@@ -3652,7 +3653,9 @@ class AdaptableAgGrid {
3652
3653
  if (cellDataChangedInfo.trigger === 'undo') {
3653
3654
  this.logger.info(`Undo data change: PK(${cellDataChangedInfo.primaryKeyValue}) Col(${cellDataChangedInfo.column}) RevertedValue(${cellDataChangedInfo.oldValue}) OriginalValue(${cellDataChangedInfo.newValue})`);
3654
3655
  }
3655
- if (cellDataChangedInfo.trigger === 'edit' || cellDataChangedInfo.trigger === 'undo') {
3656
+ if (cellDataChangedInfo.trigger === 'edit' ||
3657
+ cellDataChangedInfo.trigger === 'undo' ||
3658
+ cellDataChangedInfo.trigger === 'tick') {
3656
3659
  this.checkChangedCellCurrentlySelected(cellDataChangedInfo);
3657
3660
  this.api.freeTextColumnApi.internalApi.handleFreeTextColumnDataChange(cellDataChangedInfo);
3658
3661
  }
@@ -3761,14 +3764,14 @@ class AdaptableAgGrid {
3761
3764
  let matchingCell = selectedCellInfo.gridCells.find((gc) => gc.primaryKeyValue == cellDataChangedInfo.primaryKeyValue &&
3762
3765
  gc.column == cellDataChangedInfo.column);
3763
3766
  if (matchingCell) {
3764
- this.refreshSelectedCellsState();
3767
+ this.debouncedSetSelectedCells();
3765
3768
  }
3766
3769
  }
3767
3770
  let selectedRowInfo = this.api.gridApi.getSelectedRowInfo();
3768
3771
  if (selectedRowInfo && ArrayExtensions_1.default.IsNotNullOrEmpty(selectedRowInfo.gridRows)) {
3769
3772
  let matchingRow = selectedRowInfo.gridRows.find((gr) => gr.primaryKeyValue == cellDataChangedInfo.primaryKeyValue);
3770
3773
  if (matchingRow) {
3771
- this.refreshSelectedRowsState();
3774
+ this.debouncedSetSelectedRows();
3772
3775
  }
3773
3776
  }
3774
3777
  }
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: 1732896423270 || Date.now(),
6
- VERSION: "19.2.2" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1736500897657 || Date.now(),
6
+ VERSION: "19.2.4" || '--current-version--',
7
7
  };