@adaptabletools/adaptable 11.2.1 → 11.2.4-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.
Files changed (76) hide show
  1. package/base.css +24 -1
  2. package/bundle.cjs.js +94 -94
  3. package/index.css +28 -1
  4. package/package.json +1 -1
  5. package/publishTimestamp.d.ts +1 -1
  6. package/publishTimestamp.js +1 -1
  7. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
  8. package/src/AdaptableOptions/LayoutOptions.d.ts +36 -11
  9. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +0 -1
  10. package/src/Api/GridApi.d.ts +8 -1
  11. package/src/Api/Implementation/ColumnApiImpl.js +2 -1
  12. package/src/Api/Implementation/FreeTextColumnApiImpl.js +3 -3
  13. package/src/Api/Implementation/GridApiImpl.d.ts +3 -0
  14. package/src/Api/Implementation/GridApiImpl.js +3 -0
  15. package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
  16. package/src/Api/Implementation/InternalApiImpl.js +49 -28
  17. package/src/Api/Implementation/LayoutApiImpl.d.ts +2 -0
  18. package/src/Api/Implementation/LayoutApiImpl.js +6 -0
  19. package/src/Api/Implementation/SystemStatusApiImpl.js +1 -1
  20. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +2 -1
  21. package/src/Api/Implementation/TeamSharingApiImpl.js +11 -2
  22. package/src/Api/Implementation/ThemeApiImpl.js +1 -1
  23. package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +2 -1
  24. package/src/Api/Implementation/UserInterfaceApiImpl.js +16 -4
  25. package/src/Api/InternalApi.d.ts +2 -0
  26. package/src/Api/LayoutApi.d.ts +6 -1
  27. package/src/Api/TeamSharingApi.d.ts +10 -1
  28. package/src/Api/UserInterfaceApi.d.ts +6 -1
  29. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +4 -0
  30. package/src/PredefinedConfig/Common/AdaptableObject.d.ts +5 -5
  31. package/src/Redux/ActionsReducers/TeamSharingRedux.d.ts +1 -1
  32. package/src/Redux/ActionsReducers/TeamSharingRedux.js +4 -4
  33. package/src/Strategy/DashboardModule.js +3 -0
  34. package/src/Strategy/FilterModule.d.ts +7 -0
  35. package/src/Strategy/FilterModule.js +11 -2
  36. package/src/Strategy/Interface/IModule.d.ts +5 -0
  37. package/src/Strategy/LayoutModule.js +4 -4
  38. package/src/Strategy/Utilities/getObjectTagsViewItems.js +1 -1
  39. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +4 -1
  40. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +4 -3
  41. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +16 -36
  42. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +24 -14
  43. package/src/Utilities/Services/CalculatedColumnExpressionService.js +32 -9
  44. package/src/View/AdaptablePopover/index.d.ts +1 -0
  45. package/src/View/AdaptablePopover/index.js +2 -2
  46. package/src/View/AdaptableView.js +8 -2
  47. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
  48. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.d.ts +13 -0
  49. package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +41 -0
  50. package/src/View/Components/EntityRulesEditor/index.js +2 -1
  51. package/src/View/Components/ExpressionWizard.js +2 -1
  52. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -1
  53. package/src/View/Components/Popups/AdaptableToaster.js +1 -0
  54. package/src/View/Components/TagValueSelector/index.js +4 -3
  55. package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +2 -2
  56. package/src/View/Export/ReportExportDropdown.js +1 -1
  57. package/src/View/Filter/ActiveFiltersPanel.d.ts +1 -13
  58. package/src/View/Filter/ActiveFiltersPanel.js +8 -31
  59. package/src/View/Filter/FilterStatusBarSubPanelPopover.js +1 -10
  60. package/src/View/Filter/FilterViewPanel.js +2 -2
  61. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +2 -2
  62. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +1 -1
  63. package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
  64. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +1 -1
  65. package/src/View/Schedule/Wizard/ScheduleWizard.js +4 -4
  66. package/src/agGrid/Adaptable.d.ts +3 -0
  67. package/src/agGrid/Adaptable.js +10 -2
  68. package/src/agGrid/agGridHelper.js +1 -0
  69. package/src/components/ExpressionEditor/BaseEditorInput.js +8 -1
  70. package/src/components/ExpressionEditor/index.js +54 -5
  71. package/src/metamodel/adaptable.metamodel.d.ts +32 -18
  72. package/src/metamodel/adaptable.metamodel.js +96 -25
  73. package/src/parser/src/types.d.ts +1 -1
  74. package/src/types.d.ts +3 -3
  75. package/version.d.ts +1 -1
  76. package/version.js +1 -1
package/index.css CHANGED
@@ -2284,7 +2284,16 @@ template {
2284
2284
  --ab-cmp-adaptable-object-list-item__margin-bottom: var(--ab-space-3);
2285
2285
  --ab-cmp-adaptable-object-list-item-label__padding-top: var(--ab-space-3);
2286
2286
  --ab-cmp-adaptable-object-list-item-label__width: 130px;
2287
- --ab-cmp-adaptable-object-list-item-tag__padding: 6px 12px; }
2287
+ --ab-cmp-adaptable-object-list-item-tag__padding: 6px 12px;
2288
+ --ab-cmp-adaptable-object-compact-list__background: var(--ab-color-primarylight);
2289
+ --ab-cmp-adaptable-object-compact-list__padding: var(--ab-space-2);
2290
+ --ab-cmp-adaptable-object-compact-list-item__background: var(--ab-color-defaultbackground);
2291
+ --ab-cmp-adaptable-object-compact-list-item__padding: var(--ab-space-1);
2292
+ --ab-cmp-adaptable-object-compact-list-item__margin-bottom: var(--ab-space-2);
2293
+ --ab-cmp-adaptable-object-compact-list-item-name__width: 80px;
2294
+ --ab-cmp-adaptable-object-compact-list-item-name__padding: var(--ab-space-1);
2295
+ --ab-cmp-adaptable-object-compact-list-item-name__margin-right: var(--ab-space-1);
2296
+ --ab-cmp-adaptable-object-compact-list-item-name__font-size: var(--ab-font-size-4); }
2288
2297
 
2289
2298
  :root {
2290
2299
  --ab-cmp-adaptable-options__background-color: var(--ab-color-defaultbackground);
@@ -3691,6 +3700,24 @@ html.ab--theme-dark .ab-ListBoxFilterForm--aggrid-style {
3691
3700
  .ab-Adaptable-Object-List__Item__label:hover .ab-Adaptable-Object-List__Item__edit-property {
3692
3701
  visibility: visible; }
3693
3702
 
3703
+ .ab-Adaptable-Object-Compact-List {
3704
+ padding: var(--ab-cmp-adaptable-object-compact-list__padding);
3705
+ background: var(--ab-cmp-adaptable-object-compact-list__background); }
3706
+
3707
+ .ab-Adaptable-Object-Compact-List .ab-Adaptable-Object-Compact-List__Item {
3708
+ padding: var(--ab-cmp-adaptable-object-compact-list-item__padding);
3709
+ margin-bottom: var(--ab-cmp-adaptable-object-compact-list-item__margin-bottom);
3710
+ background: var(--ab-cmp-adaptable-object-compact-list-item__background); }
3711
+
3712
+ .ab-Adaptable-Object-Compact-List .ab-Adaptable-Object-Compact-List__Item:last-child {
3713
+ margin-bottom: 0; }
3714
+
3715
+ .ab-Adaptable-Object-Compact-List__Item__Name {
3716
+ width: var(--ab-cmp-adaptable-object-compact-list-item-name__width);
3717
+ padding: var(--ab-cmp-adaptable-object-compact-list-item-name__padding);
3718
+ margin-right: var(--ab-cmp-adaptable-object-compact-list-item-name__margin-right);
3719
+ font-size: var(--ab-cmp-adaptable-object-compact-list-item-name__font-size); }
3720
+
3694
3721
  .ab-StatusBar {
3695
3722
  display: flex; }
3696
3723
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.2.1",
3
+ "version": "11.2.4-canary.0",
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: 1652706790076;
1
+ declare const _default: 1652955781582;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1652706790076;
3
+ exports.default = 1652955781582;
@@ -174,6 +174,9 @@ export interface IAdaptable {
174
174
  forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
175
175
  forAllVisibleRowNodesDo(func: (rowNode: RowNode) => void): void;
176
176
  getVisibleRowNodes(): RowNode[];
177
+ getAllRowNodes(config?: {
178
+ includeGroupRows?: boolean;
179
+ }): RowNode[];
177
180
  getRowsInViewport(): RowNode[];
178
181
  isGroupRowNode(rowNode: RowNode): boolean;
179
182
  isVisibleNode(rowNode: RowNode): boolean;
@@ -1,4 +1,3 @@
1
- import { AdaptableApi } from '../Api/AdaptableApi';
2
1
  import { AlertDefinition } from '../PredefinedConfig/AlertState';
3
2
  import { ConditionalStyle } from '../PredefinedConfig/ConditionalStyleState';
4
3
  import { CustomSort } from '../PredefinedConfig/CustomSortState';
@@ -60,43 +59,69 @@ export interface LayoutOptions {
60
59
  /**
61
60
  * Customize how Layouts are displayed in Settings Panel
62
61
  */
63
- viewOptions?: LayoutViewOptions;
62
+ layoutViewOptions?: LayoutViewOptions;
64
63
  /**
65
- * Checks if the provided AdaptableObject is available in the given Layout
64
+ * Options for leveraging Object Tags to extend Layouts
66
65
  */
67
- isObjectAvailableInLayout?: (context: IsObjectAvailableInLayoutContext) => boolean;
66
+ layoutTagOptions?: LayoutTagOptions;
67
+ }
68
+ export interface LayoutTagOptions {
68
69
  /**
69
- * Automatically generate a tag for each existing layout
70
+ * Automatically generate an Object Tag for each Layout
70
71
  */
71
72
  autoGenerateTagsForLayouts?: boolean | ((context: AutoGenerateTagsForLayoutsContext) => AdaptableObjectTag[]);
73
+ /**
74
+ * Checks if the provided Adaptable Object is available in the given Layout
75
+ */
76
+ isObjectAvailableInLayout?: (context: LayoutAvailableContext) => boolean;
77
+ /**
78
+ * Automatically checks if Adaptable Objects Tags are available in current Layout
79
+ * @defaultValue false
80
+ */
81
+ autoCheckTagsForLayouts?: boolean;
72
82
  }
73
83
  /**
74
84
  * Customize how Layouts are displayed in Settings Panel
75
85
  */
76
86
  export interface LayoutViewOptions {
77
87
  /**
78
- * How many columns to display in inline Layout preview
88
+ * How many Column Names to display in inline Layout preview
79
89
  *
80
90
  * @defaultValue 10
81
91
  */
82
92
  maxColumnsToDisplay?: number;
83
93
  }
84
94
  /**
85
- * Context for `LayoutOptions.isObjectAvailableInLayout` method
95
+ * Context for `LayoutOptions.isObjectAvailableInLayout` functions
86
96
  */
87
- export interface IsObjectAvailableInLayoutContext {
88
- abObject: LayoutAssociatedObject;
97
+ export interface LayoutAvailableContext extends BaseContext {
98
+ /**
99
+ * Object being checked
100
+ */
101
+ adaptableObject: LayoutAssociatedObject;
102
+ /**
103
+ * Current Adaptable Module
104
+ */
89
105
  module: AdaptableModule;
106
+ /**
107
+ * Current Layout
108
+ */
90
109
  layout: Layout;
91
- adaptableApi: AdaptableApi;
92
110
  }
93
111
  /**
94
- * Types of objects that can be associated with a Layout
112
+ * Types of Adaptable Objects that can be associated with a Layout
95
113
  */
96
114
  export declare type LayoutAssociatedObject = AlertDefinition | ConditionalStyle | CustomSort | FlashingCellDefinition | FormatColumn | PlusMinusNudge | Shortcut | BaseSchedule;
97
115
  /**
98
116
  * Context for `LayoutOptions.autoGenerateTagsForLayouts` method
99
117
  */
100
118
  export interface AutoGenerateTagsForLayoutsContext extends BaseContext {
119
+ /**
120
+ * Layouts currently in Adaptable State
121
+ */
101
122
  layouts: Layout[];
123
+ /**
124
+ * Object Tags provided in User Interface Options
125
+ */
126
+ objectTags: AdaptableObjectTag[];
102
127
  }
@@ -18,7 +18,6 @@ export interface UserInterfaceOptions {
18
18
  * @gridInfoItem
19
19
  */
20
20
  useCustomMacLikeScrollbars?: boolean;
21
- testproperty?: any;
22
21
  /**
23
22
  * The application icon to appear in Dashboard and elsewhere (e.g. OpenFin notifications)
24
23
  *
@@ -197,9 +197,16 @@ export interface GridApi {
197
197
  */
198
198
  getFirstDisplayedRowNode(): RowNode;
199
199
  /**
200
- * Retrieves all Row Nodes currently in the Grid (i.e. filtered)
200
+ * Retrieves all filtered Row Nodes currently in the Grid (i.e. after applying the current filter)
201
201
  */
202
202
  getVisibleRowNodes(): RowNode[];
203
+ /**
204
+ * Retrieves all Row Nodes currently in the Grid (by default excluding the group rows)
205
+ * @param config - configuration
206
+ */
207
+ getAllRowNodes(config?: {
208
+ includeGroupRows?: boolean;
209
+ }): RowNode[];
203
210
  /**
204
211
  * Retrieves Row Nodes that contain given Primary Keys
205
212
  * @param primaryKeyValues Primary Kev Values to look up
@@ -10,7 +10,8 @@ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants")
10
10
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/ArrayExtensions"));
11
11
  class ColumnApiImpl extends ApiBase_1.ApiBase {
12
12
  getColumns() {
13
- return this.adaptable.api.gridApi.getGridState().Columns;
13
+ var _a;
14
+ return (_a = this.adaptable.api.gridApi.getGridState().Columns) !== null && _a !== void 0 ? _a : [];
14
15
  }
15
16
  getVisibleColumns() {
16
17
  const layout = this.adaptable.api.layoutApi.getCurrentLayout();
@@ -12,11 +12,11 @@ class FreeTextColumnApiImpl extends ApiBase_1.ApiBase {
12
12
  return this.getAdaptableState().FreeTextColumn;
13
13
  }
14
14
  getAllFreeTextColumn() {
15
- return this.getFreeTextColumnState().FreeTextColumns;
15
+ var _a;
16
+ return (_a = this.getFreeTextColumnState().FreeTextColumns) !== null && _a !== void 0 ? _a : [];
16
17
  }
17
18
  getFreeTextColumnById(columnId) {
18
- var _a;
19
- return (_a = this.getAllFreeTextColumn()) === null || _a === void 0 ? void 0 : _a.find((ftc) => ftc.ColumnId === columnId);
19
+ return this.getAllFreeTextColumn().find((ftc) => ftc.ColumnId === columnId);
20
20
  }
21
21
  addFreeTextColumn(freeTextColumn) {
22
22
  this.addUidToAdaptableObject(freeTextColumn);
@@ -59,6 +59,9 @@ export declare class GridApiImpl extends ApiBase implements GridApi {
59
59
  getFirstRowNode(): RowNode;
60
60
  getFirstDisplayedRowNode(): RowNode;
61
61
  getVisibleRowNodes(): RowNode[];
62
+ getAllRowNodes(config: {
63
+ includeGroupRows?: boolean;
64
+ }): RowNode[];
62
65
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
63
66
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
64
67
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): any | undefined;
@@ -188,6 +188,9 @@ class GridApiImpl extends ApiBase_1.ApiBase {
188
188
  getVisibleRowNodes() {
189
189
  return this.adaptable.getVisibleRowNodes();
190
190
  }
191
+ getAllRowNodes(config) {
192
+ return this.adaptable.getAllRowNodes(config);
193
+ }
191
194
  getGridCellFromRowNode(rowNode, columnId) {
192
195
  return this.adaptable.getGridCellFromRowNode(rowNode, columnId);
193
196
  }
@@ -131,4 +131,6 @@ export declare class InternalApiImpl extends ApiBase implements InternalApi {
131
131
  private getLayoutTags;
132
132
  dispatchReduxAction(action: Action): void;
133
133
  showSettingsPanel(module: AdaptableModule, moduleParams?: ModuleParams): void;
134
+ getLabelForTag(adaptableObjectTag: AdaptableObjectTag): string;
135
+ getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
134
136
  }
@@ -364,17 +364,17 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
364
364
  getQueryPreviewData() {
365
365
  var _a;
366
366
  const firstRowNode = this.adaptable.api.gridApi.getFirstRowNode();
367
- const firstRowData = (_a = firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data) !== null && _a !== void 0 ? _a : {};
368
- if (firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data) {
369
- // we have to add the calculated values which are not persisted in the row data
370
- const firstRowPrimaryKeyValue = this.adaptable.api.gridApi.getPrimaryKeyValueForRowNode(firstRowNode);
371
- this.adaptable.api.calculatedColumnApi
372
- .getAllCalculatedColumn()
373
- .forEach((calculatedColumn) => {
374
- firstRowData[calculatedColumn.ColumnId] = this.adaptable.api.gridApi.getCellRawValue(firstRowPrimaryKeyValue, calculatedColumn.ColumnId);
375
- });
376
- // FIXME AFL shouldn't here be also the FreeTextColumn??
377
- }
367
+ const firstRowData = (_a = Object.assign({}, firstRowNode === null || firstRowNode === void 0 ? void 0 : firstRowNode.data)) !== null && _a !== void 0 ? _a : {};
368
+ // handle CalcCols which are not persisted in the rowModel
369
+ this.adaptable.api.calculatedColumnApi.getAllCalculatedColumn().forEach((calculatedColumn) => {
370
+ const columnRawValue = this.adaptable.api.gridApi.getRawValueFromRowNode(firstRowNode, calculatedColumn.ColumnId);
371
+ firstRowData[calculatedColumn.ColumnId] = columnRawValue;
372
+ });
373
+ // handle FreeTextCols which are not persisted in the rowModel
374
+ this.adaptable.api.freeTextColumnApi.getAllFreeTextColumn().forEach((freeTextColumn) => {
375
+ const columnRawValue = this.adaptable.api.gridApi.getRawValueFromRowNode(firstRowNode, freeTextColumn.ColumnId);
376
+ firstRowData[freeTextColumn.ColumnId] = columnRawValue;
377
+ });
378
378
  return firstRowData;
379
379
  }
380
380
  waitForTeamSharingImportEnd() {
@@ -470,19 +470,31 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
470
470
  return wordToSpell;
471
471
  }
472
472
  hasLayoutSpecificObjects() {
473
- return (typeof this.adaptable.adaptableOptions.layoutOptions.isObjectAvailableInLayout === 'function');
473
+ const layoutTagOptions = this.getAdaptableOptions().layoutOptions.layoutTagOptions;
474
+ if (!layoutTagOptions) {
475
+ return false;
476
+ }
477
+ if (layoutTagOptions.autoCheckTagsForLayouts == true ||
478
+ typeof (layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.isObjectAvailableInLayout) === 'function') {
479
+ return true;
480
+ }
481
+ return false;
474
482
  }
475
483
  isObjectAvailableInLayout(object, module) {
476
484
  if (!this.hasLayoutSpecificObjects()) {
477
485
  return true;
478
486
  }
487
+ const layoutTagOptions = this.getAdaptableOptions().layoutOptions.layoutTagOptions;
488
+ if ((layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.autoCheckTagsForLayouts) == true) {
489
+ return this.getAdaptableApi().layoutApi.isObjectAvailableInCurrentLayout(object);
490
+ }
479
491
  const context = {
480
- abObject: object,
492
+ adaptableObject: object,
481
493
  module,
482
- layout: this.adaptable.api.layoutApi.getCurrentLayout(),
483
- adaptableApi: this.adaptable.api,
494
+ layout: this.getAdaptableApi().layoutApi.getCurrentLayout(),
495
+ adaptableApi: this.getAdaptableApi(),
484
496
  };
485
- return this.adaptable.adaptableOptions.layoutOptions.isObjectAvailableInLayout(context);
497
+ return layoutTagOptions === null || layoutTagOptions === void 0 ? void 0 : layoutTagOptions.isObjectAvailableInLayout(context);
486
498
  }
487
499
  showLayoutNotAssociatedObjects() {
488
500
  return this.getAdaptableState().System.ShowLayoutNotAssociatedObjects;
@@ -507,30 +519,33 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
507
519
  }
508
520
  if (typeof this.adaptable.adaptableOptions.userInterfaceOptions.objectTags === 'function') {
509
521
  // sanitize the provided tags, just to be sure that the user does NOT break the UI
510
- return this.adaptable.adaptableOptions.userInterfaceOptions
522
+ return (this.adaptable.adaptableOptions.userInterfaceOptions
511
523
  .objectTags(this.adaptable.api)
512
- .filter((tag) => (tag === null || tag === void 0 ? void 0 : tag.value) != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
524
+ // jw - not sure how to check here only for when its a object and then do check
525
+ .filter((tag) => typeof tag == 'string' ? tag : tag.value != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined));
513
526
  }
514
527
  }
515
528
  getLayoutTags() {
516
- if (!this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts) {
529
+ var _a;
530
+ if (!((_a = this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions) === null || _a === void 0 ? void 0 : _a.autoGenerateTagsForLayouts)) {
517
531
  return;
518
532
  }
519
- if (this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts === true) {
533
+ if (this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions.autoGenerateTagsForLayouts ===
534
+ true) {
520
535
  return this.adaptable.api.layoutApi.getAllLayout().map((layout) => {
521
- return {
522
- label: layout.Name,
523
- value: layout.Name,
524
- };
536
+ return layout.Name;
525
537
  });
526
538
  }
527
- if (typeof this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts === 'function') {
528
- const customGeneratedTags = this.adaptable.adaptableOptions.layoutOptions.autoGenerateTagsForLayouts({
539
+ if (typeof this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions
540
+ .autoGenerateTagsForLayouts === 'function') {
541
+ const autoGenerateTagsForLayoutsContext = {
529
542
  layouts: this.adaptable.api.layoutApi.getAllLayout(),
543
+ objectTags: this.getAdaptableApi().userInterfaceApi.getAdaptableObjectTags(),
530
544
  adaptableApi: this.adaptable.api,
531
- });
545
+ };
546
+ const customGeneratedTags = this.adaptable.adaptableOptions.layoutOptions.layoutTagOptions.autoGenerateTagsForLayouts(autoGenerateTagsForLayoutsContext);
532
547
  // sanitize the provided tags, just to be sure that the user does NOT break the UI
533
- return customGeneratedTags.filter((tag) => (tag === null || tag === void 0 ? void 0 : tag.value) != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
548
+ return customGeneratedTags.filter((tag) => typeof tag == 'string' ? tag : tag.value != undefined && (tag === null || tag === void 0 ? void 0 : tag.label) != undefined);
534
549
  }
535
550
  }
536
551
  // General way to get to store from inside Adaptable...
@@ -541,5 +556,11 @@ class InternalApiImpl extends ApiBase_1.ApiBase {
541
556
  showSettingsPanel(module, moduleParams) {
542
557
  this.showModulePopup(module, moduleParams);
543
558
  }
559
+ getLabelForTag(adaptableObjectTag) {
560
+ return typeof adaptableObjectTag == 'string' ? adaptableObjectTag : adaptableObjectTag.label;
561
+ }
562
+ getValueForTag(adaptableObjectTag) {
563
+ return typeof adaptableObjectTag == 'string' ? adaptableObjectTag : adaptableObjectTag.value;
564
+ }
544
565
  }
545
566
  exports.InternalApiImpl = InternalApiImpl;
@@ -3,6 +3,7 @@ import { LayoutApi } from '../LayoutApi';
3
3
  import { LayoutState, Layout } from '../../PredefinedConfig/LayoutState';
4
4
  import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
5
5
  import { ColumnSort } from '../../PredefinedConfig/Common/ColumnSort';
6
+ import { LayoutAssociatedObject } from '../../types';
6
7
  export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
7
8
  getLayoutState(): LayoutState;
8
9
  shouldAutoSaveLayout: (layout?: Layout) => boolean;
@@ -40,4 +41,5 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
40
41
  isDefaultLayout(layout: Layout): boolean;
41
42
  isCurrentLayoutDefault(): boolean;
42
43
  areExpandedRowGroupsSavedInLayouts(): boolean;
44
+ isObjectAvailableInCurrentLayout(adaptableObject: LayoutAssociatedObject): boolean;
43
45
  }
@@ -315,5 +315,11 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
315
315
  return (this.getLayoutOptions().includeExpandedRowGroups ||
316
316
  this.getLayoutOptions().displayRowGroups === 'dynamic');
317
317
  }
318
+ isObjectAvailableInCurrentLayout(adaptableObject) {
319
+ var _a;
320
+ return ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(adaptableObject.Tags)
321
+ ? true
322
+ : (_a = adaptableObject.Tags) === null || _a === void 0 ? void 0 : _a.map((tag) => tag).includes(this.getCurrentLayoutName());
323
+ }
318
324
  }
319
325
  exports.LayoutApiImpl = LayoutApiImpl;
@@ -80,7 +80,7 @@ class SystemStatusApiImpl extends ApiBase_1.ApiBase {
80
80
  }
81
81
  fireSystemStatusMessageDisplayedEvent(systemStatusMessageInfo) {
82
82
  const systemStatusMessageDisplayedInfo = {
83
- adaptableApi: this.adaptable.api,
83
+ adaptableApi: this.getAdaptableApi(),
84
84
  systemStatusMessageInfo: systemStatusMessageInfo,
85
85
  };
86
86
  this.adaptable.api.eventApi.emit('SystemStatusMessageDisplayed', systemStatusMessageDisplayedInfo);
@@ -1,6 +1,6 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { TeamSharingApi } from '../TeamSharingApi';
3
- import { TeamSharingState, SharedEntity } from '../../types';
3
+ import { TeamSharingState, SharedEntity, AdaptableModule, AdaptableObject, SharedEntityConfig } from '../../types';
4
4
  export declare class TeamSharingApiImpl extends ApiBase implements TeamSharingApi {
5
5
  getTeamSharingState(): TeamSharingState;
6
6
  getSharedEntities(): SharedEntity[];
@@ -9,4 +9,5 @@ export declare class TeamSharingApiImpl extends ApiBase implements TeamSharingAp
9
9
  checkForUpdates(): void;
10
10
  showTeamSharingPopup(): void;
11
11
  fireTeamSharingEntityChangedEvent(sharedEntity: SharedEntity): void;
12
+ shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: SharedEntityConfig): void;
12
13
  }
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
6
6
  const ApiBase_1 = require("./ApiBase");
7
7
  const TeamSharingRedux_1 = require("../../Redux/ActionsReducers/TeamSharingRedux");
8
+ const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
9
+ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
8
10
  class TeamSharingApiImpl extends ApiBase_1.ApiBase {
9
11
  getTeamSharingState() {
10
12
  return this.getAdaptableState().TeamSharing;
@@ -13,8 +15,8 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
13
15
  return this.getAdaptableState().TeamSharing.SharedEntities;
14
16
  }
15
17
  isTeamSharingActivated() {
16
- return (!this.adaptable.api.internalApi
17
- .getEntitlementService()
18
+ return (!this.getAdaptableApi()
19
+ .internalApi.getEntitlementService()
18
20
  .isModuleHiddenEntitlement(ModuleConstants.TeamSharingModuleId) &&
19
21
  this.adaptable.adaptableOptions.teamSharingOptions &&
20
22
  this.adaptable.adaptableOptions.teamSharingOptions.enableTeamSharing &&
@@ -41,5 +43,12 @@ class TeamSharingApiImpl extends ApiBase_1.ApiBase {
41
43
  this.adaptable.api.eventApi.emit('TeamSharingEntityChanged', teamSharingEntityChangedInfo);
42
44
  }
43
45
  }
46
+ shareEntity(entity, module, sharedEntityConfig) {
47
+ if (!this.isTeamSharingActivated()) {
48
+ LoggingHelper_1.ConsoleLogWarning('Team Sharing is not Activated so Entities cannot be shared');
49
+ return;
50
+ }
51
+ this.dispatchAction(TeamSharingRedux.TeamSharingShare(entity, module, sharedEntityConfig));
52
+ }
44
53
  }
45
54
  exports.TeamSharingApiImpl = TeamSharingApiImpl;
@@ -48,7 +48,7 @@ class ThemeApiImpl extends ApiBase_1.ApiBase {
48
48
  }
49
49
  this.adaptable.applyAdaptableTheme(currentTheme);
50
50
  let themeChangedInfo = {
51
- adaptableApi: this.adaptable.api,
51
+ adaptableApi: this.getAdaptableApi(),
52
52
  theme: currentTheme,
53
53
  };
54
54
  this.adaptable.api.eventApi.emit('ThemeChanged', themeChangedInfo);
@@ -4,7 +4,7 @@ import { AdaptableColumn } from '../../PredefinedConfig/Common/AdaptableColumn';
4
4
  import { AdaptableStyle } from '../../PredefinedConfig/Common/AdaptableStyle';
5
5
  import { ColumnMenuContext, ContextMenuContext, UserMenuItem } from '../../PredefinedConfig/Common/Menu';
6
6
  import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../../AdaptableOptions/UserInterfaceOptions';
7
- import { GridCell } from '../../types';
7
+ import { AdaptableObjectTag, GridCell } from '../../types';
8
8
  export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfaceApi {
9
9
  getColorPalette(): string[];
10
10
  getStyleClassNames(): string[] | undefined;
@@ -25,4 +25,5 @@ export declare class UserInterfaceApiImpl extends ApiBase implements UserInterfa
25
25
  getEditableCellStyle(): AdaptableStyle | undefined;
26
26
  getReadOnlyCellStyle(): AdaptableStyle | undefined;
27
27
  getAllActionColumn(): ActionColumn[];
28
+ getAdaptableObjectTags(): AdaptableObjectTag[] | undefined;
28
29
  }
@@ -8,7 +8,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
8
8
  let colorPalette = this.getUserInterfaceOptions().colorPalette;
9
9
  // first do the function then get hardcoded items
10
10
  if (colorPalette != null && typeof colorPalette === 'function') {
11
- const currentTheme = this.adaptable.api.themeApi.getCurrentTheme();
11
+ const currentTheme = this.getAdaptableApi().themeApi.getCurrentTheme();
12
12
  const colours = colorPalette(currentTheme);
13
13
  return colours;
14
14
  }
@@ -35,14 +35,14 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
35
35
  // columns id
36
36
  permittedValuesItem = permittedValues.find((permittedValue) => {
37
37
  return ('ColumnIds' in permittedValue.scope &&
38
- this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
38
+ this.getAdaptableApi().scopeApi.isColumnInScope(column, permittedValue.scope));
39
39
  });
40
40
  if (permittedValuesItem) {
41
41
  return permittedValuesItem;
42
42
  }
43
43
  permittedValuesItem = permittedValues.find((permittedValue) => {
44
44
  return ('DataTypes' in permittedValue.scope &&
45
- this.adaptable.api.scopeApi.isColumnInScope(column, permittedValue.scope));
45
+ this.getAdaptableApi().scopeApi.isColumnInScope(column, permittedValue.scope));
46
46
  });
47
47
  if (permittedValuesItem) {
48
48
  return permittedValuesItem;
@@ -70,7 +70,7 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
70
70
  if (permittedValues != null && typeof permittedValues === 'function') {
71
71
  if (column) {
72
72
  const permittedValuesParams = {
73
- adaptableApi: this.adaptable.api,
73
+ adaptableApi: this.getAdaptableApi(),
74
74
  column: column,
75
75
  };
76
76
  return permittedValues(permittedValuesParams);
@@ -172,5 +172,17 @@ class UserInterfaceApiImpl extends ApiBase_1.ApiBase {
172
172
  var _a;
173
173
  return (_a = this.getUserInterfaceOptions().actionColumns) !== null && _a !== void 0 ? _a : [];
174
174
  }
175
+ getAdaptableObjectTags() {
176
+ let objectTags = this.getUserInterfaceOptions().objectTags;
177
+ if (objectTags != null && typeof objectTags === 'function') {
178
+ return objectTags(this.getAdaptableApi());
179
+ }
180
+ else {
181
+ let arr = objectTags;
182
+ if (arr && ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(arr)) {
183
+ return arr;
184
+ }
185
+ }
186
+ }
175
187
  }
176
188
  exports.UserInterfaceApiImpl = UserInterfaceApiImpl;
@@ -131,4 +131,6 @@ export interface InternalApi {
131
131
  shouldDisplayTagSections(): boolean;
132
132
  getAvailableTags(): AdaptableObjectTag[] | undefined;
133
133
  showSettingsPanel(module: AdaptableModule, moduleParams?: ModuleParams): void;
134
+ getLabelForTag(adaptableObjectTag: AdaptableObjectTag): string;
135
+ getValueForTag(adaptableObjectTag: AdaptableObjectTag): string | number;
134
136
  }
@@ -1,4 +1,4 @@
1
- import { AdaptableColumn, ColumnSort } from '../../types';
1
+ import { AdaptableColumn, ColumnSort, LayoutAssociatedObject } 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
@@ -182,4 +182,9 @@ export interface LayoutApi {
182
182
  * Returns true if Layouts will contain Expanded Row Groups information
183
183
  */
184
184
  areExpandedRowGroupsSavedInLayouts(): boolean;
185
+ /**
186
+ * Does an object's Tags include the Current Layout
187
+ * @param adaptableObject object to check
188
+ */
189
+ isObjectAvailableInCurrentLayout(adaptableObject: LayoutAssociatedObject): boolean;
185
190
  }
@@ -1,4 +1,6 @@
1
- import { TeamSharingState, SharedEntity } from '../PredefinedConfig/TeamSharingState';
1
+ import { AdaptableObject } from '../PredefinedConfig/Common/AdaptableObject';
2
+ import { SharedEntity } from '../PredefinedConfig/TeamSharingState';
3
+ import { AdaptableModule, SharedEntityConfig, TeamSharingState } from '../types';
2
4
  /**
3
5
  * Provides run-time access to Team Sharing Module and associated state
4
6
  */
@@ -32,4 +34,11 @@ export interface TeamSharingApi {
32
34
  * @param sharedEntity Entity that has been changed
33
35
  */
34
36
  fireTeamSharingEntityChangedEvent(sharedEntity: SharedEntity): void;
37
+ /**
38
+ * Puts an Adaptable Object into Team Share
39
+ * @param entity entity to Share
40
+ * @param module module which Shared Entity belongs to
41
+ * @param sharedEntityConfig Config info about the Sharing Actions
42
+ */
43
+ shareEntity(entity: AdaptableObject, module: AdaptableModule, sharedEntityConfig: SharedEntityConfig): void;
35
44
  }
@@ -3,6 +3,7 @@ import { AdaptableStyle } from '../PredefinedConfig/Common/AdaptableStyle';
3
3
  import { ColumnMenuContext, ContextMenuContext, UserMenuItem } from '../PredefinedConfig/Common/Menu';
4
4
  import { ActionColumn, BulkUpdatePermittedValues, CustomSortPermittedValues, EditLookUpPermittedValues, FilterPermittedValues, PermittedValues } from '../AdaptableOptions/UserInterfaceOptions';
5
5
  import { GridCell } from '../PredefinedConfig/Selection/GridCell';
6
+ import { AdaptableObjectTag } from '../PredefinedConfig/Common/AdaptableObject';
6
7
  /**
7
8
  * Functions relating to User Interface section of Adaptable State
8
9
  */
@@ -70,7 +71,11 @@ export interface UserInterfaceApi {
70
71
  */
71
72
  getReadOnlyCellStyle(): AdaptableStyle | undefined;
72
73
  /**
73
- * Retrieves any Action Columns in User Interface Options
74
+ * Retrieves any Action Columns (provided in User Interface Options)
74
75
  */
75
76
  getAllActionColumn(): ActionColumn[];
77
+ /**
78
+ * Retrieves any Object Tags (provided in User Interface Options)
79
+ */
80
+ getAdaptableObjectTags(): AdaptableObjectTag[] | undefined;
76
81
  }
@@ -33,6 +33,10 @@ export interface AdaptableColumnGroup {
33
33
  * Defines an Adaptable Column - created at run-time based on AG Grid column definition
34
34
  */
35
35
  export interface AdaptableColumn extends AdaptableColumnBase {
36
+ /**
37
+ * Is the field of the row to get the cell data from
38
+ */
39
+ field?: string;
36
40
  /**
37
41
  * Is this the Primary Key column
38
42
  */
@@ -16,20 +16,20 @@ export interface AdaptableObject {
16
16
  */
17
17
  IsReadOnly?: boolean;
18
18
  /**
19
- * List of tags associated with the object
19
+ * List of Tags associated with the Object; often used for (but not limited to) managing Layout object scope
20
20
  */
21
21
  Tags?: AdaptableObjectTag[];
22
22
  }
23
23
  /**
24
- * Tag object defined as a label and a value
24
+ * Object Tag - defined as a label and a value
25
25
  */
26
- export declare type AdaptableObjectTag = {
26
+ export declare type AdaptableObjectTag = string | {
27
27
  /**
28
- * Label for the tag
28
+ * Label for the Tag
29
29
  */
30
30
  label: string;
31
31
  /**
32
- * Value for the tag
32
+ * Value for the Tag - string or number
33
33
  */
34
34
  value: string | number;
35
35
  };