@adaptabletools/adaptable 11.0.6 → 11.0.7

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": "11.0.6",
3
+ "version": "11.0.7",
4
4
  "description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1,2 +1,2 @@
1
- declare const _default: 1647234590845;
1
+ declare const _default: 1647406497522;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1647234590845;
3
+ exports.default = 1647406497522;
@@ -35,9 +35,9 @@ export interface GeneralOptions {
35
35
  */
36
36
  showGroupingTotalsAsHeader?: boolean;
37
37
  /**
38
- * Sort Grouped Column automatically (using Custom Sort if one applied)
38
+ * Order Grouped Column automatically, deriving from Adaptable State if available (CustomSort or Layout ColumnSort)
39
39
  *
40
- * Order Grouped Column automatically, trying to sort them (in the specified priority order) based on an active CustomSort, a defined Column Comparator, or at least alphanumerically
40
+ * The default group order will be derived from (in the specified priority): 1. an active CustomSort, 2. the defined ColDef Comparator, 3. current Layout ColumnSort or 4. alphanumerically
41
41
  * @defaultValue true
42
42
  * @gridInfoItem
43
43
  */
@@ -2,6 +2,7 @@ import { ApiBase } from './ApiBase';
2
2
  import { LayoutApi } from '../LayoutApi';
3
3
  import { LayoutState, Layout } from '../../PredefinedConfig/LayoutState';
4
4
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
5
+ import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
5
6
  export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
6
7
  getLayoutState(): LayoutState;
7
8
  shouldAutoSaveLayout: (layout?: Layout) => boolean;
@@ -12,6 +13,7 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
12
13
  setLayout(layoutName: string): void;
13
14
  fireLayoutChangedEvent(trigger: string, oldSate: LayoutState, newState: LayoutState): void;
14
15
  getCurrentLayout(): Layout;
16
+ getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
15
17
  getCurrentLayoutName(): string;
16
18
  getLayoutByName(layoutName: string): Layout | null;
17
19
  getAllLayout(): Layout[];
@@ -69,6 +69,11 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
69
69
  let layoutName = state.Layout.CurrentLayout;
70
70
  return (this.getLayoutByName(layoutName) || ObjectFactory_1.default.CreateEmptyLayout({ Name: GeneralConstants_1.DEFAULT_LAYOUT }));
71
71
  }
72
+ getCurrentLayoutColumnSort(columnId) {
73
+ var _a, _b, _c, _d;
74
+ const currentLayout = this.getCurrentLayout();
75
+ return ((_d = (_c = (_b = (_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.ColumnSorts) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (sort) => sort.ColumnId === columnId)) === null || _c === void 0 ? void 0 : _c.SortOrder) !== null && _d !== void 0 ? _d : null);
76
+ }
72
77
  getCurrentLayoutName() {
73
78
  return this.getAdaptableState().Layout.CurrentLayout;
74
79
  }
@@ -1,4 +1,4 @@
1
- import { AdaptableColumn } from '../../types';
1
+ import { AdaptableColumn, ColumnSort } from '../../types';
2
2
  import { LayoutState, Layout } from '../PredefinedConfig/LayoutState';
3
3
  /**
4
4
  * Provides run-time access to the Layout Module and associated state
@@ -24,6 +24,11 @@ export interface LayoutApi {
24
24
  * @returns layout
25
25
  */
26
26
  getCurrentLayout(): Layout;
27
+ /**
28
+ * Retrieves the sort order of a column from the current layout
29
+ * @param columnId Column id
30
+ */
31
+ getCurrentLayoutColumnSort(columnId: string): ColumnSort['SortOrder'] | null;
27
32
  /**
28
33
  * Retrieves map with visible columns in current Layout
29
34
  */
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LicenseDocsLink = exports.PrimaryKeyDocsLink = exports.PredicateDocsLink = exports.AggregatedScalarQueryDocsLink = exports.AggregatedBooleanQueryDocsLink = exports.ObservableQueryDocsLink = exports.ScalarQueryDocsLink = exports.BooleanQueryDocsLink = exports.ExpressionEditorDocsLink = exports.HOST_URL_DOCS = void 0;
4
4
  exports.HOST_URL_DOCS = 'https://docs.adaptabletools.com';
5
5
  //export const HOST_URL_DOCS = 'http://localhost:3000';
6
- exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/learn/ui-expression-editor`;
7
- exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression-boolean`;
8
- exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression-scalar`;
9
- exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression-observable`;
10
- exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression-aggregation#aggregated-boolean-expressions`;
11
- exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-expression-aggregation#aggregated-scalar-expressions`;
12
- exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/learn/adaptable-ql-predicate`;
13
- exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/learn/dev-guide-tutorial-primary-key`;
6
+ exports.ExpressionEditorDocsLink = `${exports.HOST_URL_DOCS}/guide/ui-expression-editor`;
7
+ exports.BooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-boolean`;
8
+ exports.ScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-scalar`;
9
+ exports.ObservableQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-observable`;
10
+ exports.AggregatedBooleanQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-boolean-expressions`;
11
+ exports.AggregatedScalarQueryDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-expression-aggregation#aggregated-scalar-expressions`;
12
+ exports.PredicateDocsLink = `${exports.HOST_URL_DOCS}/guide/adaptable-ql-predicate`;
13
+ exports.PrimaryKeyDocsLink = `${exports.HOST_URL_DOCS}/guide/dev-guide-tutorial-primary-key`;
14
14
  exports.LicenseDocsLink = `${exports.HOST_URL_DOCS}/licensing`;
@@ -516,6 +516,10 @@ class agGridHelper {
516
516
  if (definedColumnComparator) {
517
517
  return definedColumnComparator(nodeA.key, nodeB.key);
518
518
  }
519
+ const sortOder = adaptable.api.layoutApi.getCurrentLayoutColumnSort(firstGroupedColumn.columnId);
520
+ if (sortOder === 'Desc') {
521
+ return nodeA.key > nodeB.key ? -1 : 1;
522
+ }
519
523
  }
520
524
  // if no comparator available, just sort alphanumerically
521
525
  if (nodeA.key == nodeB.key) {
@@ -6532,7 +6532,7 @@ exports.ADAPTABLE_METAMODEL = {
6532
6532
  {
6533
6533
  "name": "autoOrderGroupedColumns",
6534
6534
  "kind": "boolean",
6535
- "description": "Sort Grouped Column automatically (using Custom Sort if one applied)",
6535
+ "description": "Order Grouped Column automatically, deriving from Adaptable State if available (CustomSort or Layout ColumnSort)",
6536
6536
  "uiLabel": "Auto Order Grouped Columns",
6537
6537
  "isOptional": true,
6538
6538
  "gridInfo": "item",
@@ -8054,6 +8054,12 @@ exports.ADAPTABLE_METAMODEL = {
8054
8054
  "description": "Retrieves Current Layout from Layout State",
8055
8055
  "uiLabel": "Get Current Layout"
8056
8056
  },
8057
+ {
8058
+ "name": "getCurrentLayoutColumnSort",
8059
+ "kind": "function",
8060
+ "description": "Retrieves the sort order of a column from the current layout",
8061
+ "uiLabel": "Get Current Layout Column Sort"
8062
+ },
8057
8063
  {
8058
8064
  "name": "getCurrentLayoutName",
8059
8065
  "kind": "function",
package/src/types.d.ts CHANGED
@@ -116,7 +116,7 @@ export type { ColumnSort } from './PredefinedConfig/Common/ColumnSort';
116
116
  export type { DataChangedInfo } from './PredefinedConfig/Common/DataChangedInfo';
117
117
  export type { DataUpdateConfig } from './PredefinedConfig/Common/DataUpdateConfig';
118
118
  export type { AdaptableFormData, AdaptableForm, AdaptableFormField, } from './PredefinedConfig/Common/AdaptableForm';
119
- export type { AdaptableButton } from './PredefinedConfig/Common/AdaptableButton';
119
+ export type { AdaptableButton, ButtonContext } from './PredefinedConfig/Common/AdaptableButton';
120
120
  export type { AdaptableMenuItem, UserMenuItem, ColumnMenuContext, ContextMenuContext, } from './PredefinedConfig/Common/Menu';
121
121
  export type { Schedule } from './PredefinedConfig/Common/Schedule';
122
122
  export type { ButtonStyle } from './PredefinedConfig/Common/ButtonStyle';
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "11.0.6";
1
+ declare const _default: "11.0.7";
2
2
  export default _default;
package/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '11.0.6'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
3
+ exports.default = '11.0.7'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version