@adaptabletools/adaptable 12.0.1-canary.0 → 12.0.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.
Files changed (143) hide show
  1. package/base.css +5 -18
  2. package/bundle.cjs.js +107 -107
  3. package/index.css +6 -22
  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 +4 -2
  8. package/src/AdaptableOptions/AdaptableQLOptions.d.ts +1 -1
  9. package/src/AdaptableOptions/EditOptions.d.ts +6 -9
  10. package/src/AdaptableOptions/ExportOptions.d.ts +15 -0
  11. package/src/AdaptableOptions/Glue42PluginOptions.d.ts +1 -1
  12. package/src/AdaptableOptions/IPushPullPluginOptions.d.ts +1 -3
  13. package/src/AdaptableOptions/StateOptions.d.ts +9 -23
  14. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +34 -1
  15. package/src/Api/ChartingApi.d.ts +19 -2
  16. package/src/Api/FilterApi.d.ts +7 -2
  17. package/src/Api/FinanceApi.d.ts +8 -8
  18. package/src/Api/FormatColumnApi.d.ts +6 -6
  19. package/src/Api/GridApi.d.ts +1 -1
  20. package/src/Api/Implementation/ChartingApiImpl.d.ts +6 -0
  21. package/src/Api/Implementation/ChartingApiImpl.js +17 -0
  22. package/src/Api/Implementation/ConfigApiImpl.d.ts +2 -0
  23. package/src/Api/Implementation/ConfigApiImpl.js +11 -0
  24. package/src/Api/Implementation/FilterApiImpl.d.ts +1 -0
  25. package/src/Api/Implementation/FilterApiImpl.js +5 -0
  26. package/src/Api/Implementation/FormatColumnApiImpl.d.ts +3 -3
  27. package/src/Api/Implementation/FormatColumnApiImpl.js +13 -11
  28. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  29. package/src/Api/Implementation/GridApiImpl.js +2 -2
  30. package/src/Api/Implementation/InternalApiImpl.js +1 -2
  31. package/src/Api/Implementation/LayoutApiImpl.js +1 -1
  32. package/src/Api/Implementation/TeamSharingApiImpl.d.ts +1 -0
  33. package/src/Api/Implementation/TeamSharingApiImpl.js +5 -0
  34. package/src/Api/StatusBarApi.d.ts +3 -0
  35. package/src/Api/TeamSharingApi.d.ts +4 -0
  36. package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
  37. package/src/PredefinedConfig/CalculatedColumnState.d.ts +0 -5
  38. package/src/PredefinedConfig/ChartingState.d.ts +20 -0
  39. package/src/PredefinedConfig/ChartingState.js +2 -0
  40. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +4 -1
  41. package/src/PredefinedConfig/Common/CellSummary.d.ts +3 -0
  42. package/src/PredefinedConfig/Common/ColumnFilter.d.ts +9 -0
  43. package/src/PredefinedConfig/Common/FDC3Context.d.ts +12 -3
  44. package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +1 -2
  45. package/src/PredefinedConfig/Common/FilterActionOnDataChange.js +1 -2
  46. package/src/PredefinedConfig/Common/Types.d.ts +1 -1
  47. package/src/PredefinedConfig/ExportState.d.ts +6 -0
  48. package/src/PredefinedConfig/FormatColumnState.d.ts +4 -1
  49. package/src/PredefinedConfig/IPushPullState.d.ts +16 -5
  50. package/src/PredefinedConfig/LayoutState.d.ts +1 -1
  51. package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
  52. package/src/PredefinedConfig/ScheduleState.d.ts +1 -1
  53. package/src/PredefinedConfig/ShortcutState.d.ts +1 -1
  54. package/src/PredefinedConfig/TeamSharingState.d.ts +6 -0
  55. package/src/Redux/ActionsReducers/ChartingRedux.d.ts +23 -0
  56. package/src/Redux/ActionsReducers/ChartingRedux.js +38 -0
  57. package/src/Redux/ActionsReducers/GridRedux.d.ts +30 -1
  58. package/src/Redux/ActionsReducers/GridRedux.js +105 -2
  59. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +10 -11
  60. package/src/Redux/ActionsReducers/LayoutRedux.js +13 -10
  61. package/src/Redux/Store/AdaptableStore.js +39 -8
  62. package/src/Strategy/AdaptableModuleBase.d.ts +4 -0
  63. package/src/Strategy/AdaptableModuleBase.js +6 -0
  64. package/src/Strategy/AlertModule.js +3 -3
  65. package/src/Strategy/ChartingModule.js +1 -1
  66. package/src/Strategy/DashboardModule.js +1 -0
  67. package/src/Strategy/ExportModule.js +1 -0
  68. package/src/Strategy/FlashingCellModule.js +3 -3
  69. package/src/Strategy/FormatColumnModule.js +3 -3
  70. package/src/Strategy/GridInfoModule.js +2 -0
  71. package/src/Strategy/Interface/IModule.d.ts +11 -1
  72. package/src/Strategy/LayoutModule.js +2 -0
  73. package/src/Strategy/TeamSharingModule.d.ts +11 -1
  74. package/src/Strategy/TeamSharingModule.js +104 -0
  75. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -0
  76. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +3 -0
  77. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +3 -0
  78. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +3 -0
  79. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +3 -0
  80. package/src/Utilities/Helpers/FormatHelper.d.ts +1 -1
  81. package/src/Utilities/Helpers/FormatHelper.js +7 -3
  82. package/src/Utilities/Helpers/Helper.js +1 -1
  83. package/src/Utilities/ObjectFactory.d.ts +5 -1
  84. package/src/Utilities/ObjectFactory.js +12 -2
  85. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  86. package/src/Utilities/Services/ReportService.d.ts +1 -1
  87. package/src/Utilities/Services/ReportService.js +5 -5
  88. package/src/Utilities/Services/TeamSharingService.js +0 -2
  89. package/src/View/AdaptableViewFactory.js +0 -2
  90. package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +2 -9
  91. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.d.ts +13 -1
  92. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +17 -14
  93. package/src/View/Components/Buttons/ButtonDelete.js +3 -3
  94. package/src/View/Components/FilterForm/QuickFilterForm.js +22 -1
  95. package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +4 -0
  96. package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +1 -1
  97. package/src/View/Filter/FilterSummary.d.ts +1 -1
  98. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +13 -9
  99. package/src/View/Layout/LayoutEditorStandalonePopup.js +3 -1
  100. package/src/View/Layout/LayoutPopup.d.ts +1 -1
  101. package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
  102. package/src/View/Layout/LayoutViewPanel.js +2 -1
  103. package/src/View/Layout/Wizard/LayoutEditorWizard.d.ts +2 -27
  104. package/src/View/TeamSharing/SharedEntityDependencies.d.ts +8 -0
  105. package/src/View/TeamSharing/SharedEntityDependencies.js +27 -0
  106. package/src/View/TeamSharing/SharedEntityObjectView.d.ts +9 -0
  107. package/src/View/TeamSharing/SharedEntityObjectView.js +84 -0
  108. package/src/View/TeamSharing/TeamSharingApplyButton.d.ts +6 -0
  109. package/src/View/TeamSharing/TeamSharingApplyButton.js +15 -0
  110. package/src/agGrid/Adaptable.d.ts +4 -2
  111. package/src/agGrid/Adaptable.js +37 -22
  112. package/src/components/icons/index.js +0 -4
  113. package/src/metamodel/adaptable.metamodel.d.ts +224 -2
  114. package/src/metamodel/adaptable.metamodel.js +1 -1
  115. package/src/types.d.ts +4 -2
  116. package/version.d.ts +1 -1
  117. package/version.js +1 -1
  118. package/src/View/Alert/AlertSharedEntity.d.ts +0 -5
  119. package/src/View/Alert/AlertSharedEntity.js +0 -19
  120. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.d.ts +0 -5
  121. package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +0 -20
  122. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.d.ts +0 -5
  123. package/src/View/ConditionalStyle/ConditionalStyleSharedEntity.js +0 -23
  124. package/src/View/CustomSort/CustomSortSharedEntity.d.ts +0 -6
  125. package/src/View/CustomSort/CustomSortSharedEntity.js +0 -24
  126. package/src/View/Export/ExportSharedEntity.d.ts +0 -5
  127. package/src/View/Export/ExportSharedEntity.js +0 -16
  128. package/src/View/Filter/FilterSharedEntity.d.ts +0 -5
  129. package/src/View/Filter/FilterSharedEntity.js +0 -15
  130. package/src/View/FormatColumn/FormatColumnSharedEntity.d.ts +0 -5
  131. package/src/View/FormatColumn/FormatColumnSharedEntity.js +0 -18
  132. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.d.ts +0 -5
  133. package/src/View/FreeTextColumn/FreeTextColumnSharedEntity.js +0 -24
  134. package/src/View/Layout/LayoutSharedEntity.d.ts +0 -5
  135. package/src/View/Layout/LayoutSharedEntity.js +0 -15
  136. package/src/View/PlusMinus/PlusMinusSharedEntity.d.ts +0 -5
  137. package/src/View/PlusMinus/PlusMinusSharedEntity.js +0 -21
  138. package/src/View/Query/NamedQuerySharedEntity.d.ts +0 -5
  139. package/src/View/Query/NamedQuerySharedEntity.js +0 -19
  140. package/src/View/Shortcut/ShortcutSharedEntity.d.ts +0 -5
  141. package/src/View/Shortcut/ShortcutSharedEntity.js +0 -19
  142. package/src/View/TeamSharing/TeamSharingPopup.d.ts +0 -23
  143. package/src/View/TeamSharing/TeamSharingPopup.js +0 -163
@@ -18,6 +18,7 @@ const Tabs_1 = require("../../../components/Tabs");
18
18
  const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
19
19
  const Tag_1 = require("../../../components/Tag");
20
20
  const AdaptableContext_1 = require("../../AdaptableContext");
21
+ const FormatHelper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/FormatHelper"));
21
22
  const DOLLAR_OPTIONS = {
22
23
  FractionDigits: 2,
23
24
  FractionSeparator: '.',
@@ -84,13 +85,16 @@ const getFormatColumnFormatSummaryValue = (data, formattedColumnApi) => {
84
85
  }
85
86
  else {
86
87
  if (data.DisplayFormat.Formatter === 'NumberFormatter') {
87
- content = formattedColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options);
88
+ content = FormatHelper_1.default.NumberFormatter(12345.6789, data.DisplayFormat.Options);
89
+ //formattedColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options);
88
90
  }
89
91
  if (data.DisplayFormat.Formatter === 'DateFormatter') {
90
- content = formattedColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options);
92
+ content = FormatHelper_1.default.DateFormatter(new Date(), data.DisplayFormat.Options);
93
+ //formattedColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options);
91
94
  }
92
95
  if (data.DisplayFormat.Formatter === 'StringFormatter') {
93
- content = formattedColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options);
96
+ content = FormatHelper_1.default.StringFormatter('Hello World ', data.DisplayFormat.Options);
97
+ //formattedColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options);
94
98
  }
95
99
  }
96
100
  return content;
@@ -169,7 +173,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, customFormatters, fo
169
173
  React.createElement(FormLayout_1.default, null,
170
174
  React.createElement(FormLayout_1.FormRow, { label: "Pattern" },
171
175
  React.createElement(Input_1.default, { value: data.DisplayFormat.Options.Pattern, onChange: (e) => setFormatOption('Pattern', e.currentTarget.value), mr: 2 }),
172
- React.createElement("span", null, formatColumnApi.getDateFormattedValue(new Date(), data.DisplayFormat.Options))),
176
+ React.createElement("span", null, FormatHelper_1.default.DateFormatter(new Date(), data.DisplayFormat.Options))),
173
177
  customFormatters.map((formatter) => renderCustomFormatter(data, formatter, setFormatOption))))),
174
178
  React.createElement(Tabs_1.Tabs, { marginTop: 2 },
175
179
  React.createElement(Tabs_1.Tabs.Tab, null, "Presets"),
@@ -182,7 +186,7 @@ const renderDateFormat = (data, _onChange, setFormatOption, customFormatters, fo
182
186
  DateFormatPresets.map((Pattern, index) => (React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: index, colItems: [
183
187
  { Content: Pattern, Size: 1 },
184
188
  {
185
- Content: formatColumnApi.getDateFormattedValue(new Date(), { Pattern }),
189
+ Content: FormatHelper_1.default.DateFormatter(new Date(), { Pattern }),
186
190
  Size: 1,
187
191
  },
188
192
  {
@@ -299,21 +303,21 @@ const renderNumberFormat = (data, onChange, setFormatOption, customFormatters, f
299
303
  React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
300
304
  { Content: '12345.6789', Size: 1 },
301
305
  {
302
- Content: formatColumnApi.getNumberFormattedValue(12345.6789, data.DisplayFormat.Options),
306
+ Content: FormatHelper_1.default.NumberFormatter(12345.6789, data.DisplayFormat.Options),
303
307
  Size: 1,
304
308
  },
305
309
  ] }),
306
310
  React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
307
311
  { Content: '-12345.6789', Size: 1 },
308
312
  {
309
- Content: formatColumnApi.getNumberFormattedValue(-12345.6789, data.DisplayFormat.Options),
313
+ Content: FormatHelper_1.default.NumberFormatter(-12345.6789, data.DisplayFormat.Options),
310
314
  Size: 1,
311
315
  },
312
316
  ] }),
313
317
  React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: [
314
318
  { Content: '0.123', Size: 1 },
315
319
  {
316
- Content: formatColumnApi.getNumberFormattedValue(0.123, data.DisplayFormat.Options),
320
+ Content: FormatHelper_1.default.NumberFormatter(0.123, data.DisplayFormat.Options),
317
321
  Size: 1,
318
322
  },
319
323
  ] })))));
@@ -350,7 +354,7 @@ const renderStringFormat = (data, _onChange, setFormatOption, customFormatters,
350
354
  { Content: '"Hello World "', Size: 1 },
351
355
  {
352
356
  Content: '"' +
353
- formatColumnApi.getStringFormattedValue('Hello World ', data.DisplayFormat.Options) +
357
+ FormatHelper_1.default.StringFormatter('Hello World ', data.DisplayFormat.Options) +
354
358
  '"',
355
359
  Size: 1,
356
360
  },
@@ -70,7 +70,9 @@ const LayoutEditorStandalonePopup = (props) => {
70
70
  }, []);
71
71
  const finishDisabled = !layoutData.Name;
72
72
  return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column" },
73
- React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout, updateGoBackState: () => null }),
73
+ React.createElement(LayoutEditorWizard_1.LayoutEditorWizard, { data: layoutData, api: adaptable.api, Layouts: layouts, moduleInfo: layoutModule.moduleInfo, onLayoutChange: setStateLayout,
74
+ // @ts-ignore
75
+ updateGoBackState: () => null }),
74
76
  React.createElement(PanelFooter_1.PanelFooter, { acceptDisabled: finishDisabled, onAccept: handleAccept, onCancel: handleCancel })));
75
77
  };
76
78
  exports.LayoutEditorStandalonePopup = LayoutEditorStandalonePopup;
@@ -28,5 +28,5 @@ declare class LayoutPopupComponent extends React.Component<LayoutPopupProps, Edi
28
28
  canFinishWizard(): boolean;
29
29
  private getCurrentLayout;
30
30
  }
31
- export declare let LayoutPopup: import("react-redux").ConnectedComponent<typeof LayoutPopupComponent, import("react-redux").Omit<React.ClassAttributes<LayoutPopupComponent> & LayoutPopupProps, "ref" | "key" | "api" | "onSuspend" | "accessLevel" | "popupParams" | "onClearPopupParams" | "teamSharingActivated" | "onClosePopup" | "moduleInfo" | "onUnSuspend" | "modalContainer" | "onShare" | "Layouts" | "onSelectLayout" | "onSaveLayout" | "CurrentLayoutName" | "CurrentLayoutDraft" | "onAddLayout">>;
31
+ export declare let LayoutPopup: import("react-redux").ConnectedComponent<typeof LayoutPopupComponent, import("react-redux").Omit<React.ClassAttributes<LayoutPopupComponent> & LayoutPopupProps, "ref" | "key" | "api" | "onSuspend" | "accessLevel" | "popupParams" | "onClearPopupParams" | "teamSharingActivated" | "onClosePopup" | "moduleInfo" | "onUnSuspend" | "modalContainer" | "onShare" | "onSelectLayout" | "onSaveLayout" | "Layouts" | "CurrentLayoutName" | "CurrentLayoutDraft" | "onAddLayout">>;
32
32
  export {};
@@ -15,5 +15,5 @@ declare class LayoutViewPanelComponent extends React.Component<LayoutViewPanelCo
15
15
  render(): any;
16
16
  private onSaveLayout;
17
17
  }
18
- export declare let LayoutViewPanelControl: import("react-redux").ConnectedComponent<typeof LayoutViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<LayoutViewPanelComponent> & LayoutViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "viewType" | "Layouts" | "onSelectLayout" | "onSaveLayout" | "CurrentDraftLayout" | "CanSave" | "CurrentLayoutName"> & LayoutViewPanelComponentProps>;
18
+ export declare let LayoutViewPanelControl: import("react-redux").ConnectedComponent<typeof LayoutViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<LayoutViewPanelComponent> & LayoutViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "viewType" | "onSelectLayout" | "onSaveLayout" | "Layouts" | "CurrentDraftLayout" | "CanSave" | "CurrentLayoutName"> & LayoutViewPanelComponentProps>;
19
19
  export {};
@@ -15,6 +15,7 @@ const ButtonNew_1 = require("../Components/Buttons/ButtonNew");
15
15
  const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
16
16
  const react_redux_1 = require("react-redux");
17
17
  const ButtonClone_1 = require("../Components/Buttons/ButtonClone");
18
+ const GridRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/GridRedux"));
18
19
  exports.COMPONENT_LAYOUT_POPUP_NAME = 'LayoutEditorStandalonePopup';
19
20
  class LayoutViewPanelComponent extends React.Component {
20
21
  render() {
@@ -63,7 +64,7 @@ function mapDispatchToProps(dispatch) {
63
64
  onSelectLayout: (layoutName) => dispatch(LayoutRedux.LayoutSelect(layoutName)),
64
65
  onSaveLayout: (layout) => {
65
66
  dispatch(LayoutRedux.LayoutSave(layout));
66
- dispatch(LayoutRedux.LayoutUpdateCurrentDraft(null));
67
+ dispatch(GridRedux.LayoutUpdateCurrentDraft(null));
67
68
  },
68
69
  };
69
70
  }
@@ -10,7 +10,7 @@ export interface LayoutEditorWizardState {
10
10
  layout: Layout;
11
11
  errorMessage: string;
12
12
  }
13
- export declare class LayoutEditorWizard extends React.Component<LayoutEditorWizardProps, LayoutEditorWizardState> implements AdaptableWizardStep {
13
+ export declare class LayoutEditorWizard extends React.Component<any, any> implements AdaptableWizardStep {
14
14
  constructor(props: LayoutEditorWizardProps);
15
15
  render(): any;
16
16
  onLayoutNameChange: (event: React.FormEvent<any>) => void;
@@ -20,32 +20,7 @@ export declare class LayoutEditorWizard extends React.Component<LayoutEditorWiza
20
20
  }) => string;
21
21
  updateLayout: (layout: Partial<Layout>) => void;
22
22
  onLayoutChange: (layout: Layout) => void;
23
- getLayout: () => {
24
- Name: string;
25
- Columns: string[];
26
- ColumnWidthMap?: {
27
- [columnId: string]: number;
28
- };
29
- ColumnSorts?: import("../../../types").ColumnSort[];
30
- ColumnFilters?: import("../../../types").ColumnFilter[];
31
- RowGroupedColumns?: string[];
32
- ExpandedRowGroupValues?: any[];
33
- AggregationColumns?: Record<string, string | true>;
34
- EnablePivot?: boolean;
35
- PivotColumns?: string[];
36
- PinnedColumnsMap?: {
37
- [columnId: string]: "left" | "right";
38
- };
39
- AutoSave?: boolean;
40
- ColumnHeadersMap?: {
41
- [columnId: string]: string;
42
- };
43
- SuppressAggFuncInHeader?: boolean;
44
- Uuid?: string;
45
- Source?: "Config" | "User";
46
- IsReadOnly?: boolean;
47
- Tags?: string[];
48
- };
23
+ getLayout: () => any;
49
24
  canNext(): boolean;
50
25
  canBack(): boolean;
51
26
  next(): void;
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import { SharedEntity } from '../../../types';
3
+ export declare const Dependencies: React.FunctionComponent<{
4
+ sharedEntity: SharedEntity;
5
+ }>;
6
+ export declare const SharedEntityDependencies: React.FunctionComponent<{
7
+ data: SharedEntity;
8
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SharedEntityDependencies = exports.Dependencies = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const AdaptableContext_1 = require("../AdaptableContext");
9
+ const AdaptableObjectList_1 = require("../Components/AdaptableObjectList/AdaptableObjectList");
10
+ const Dependencies = (props) => {
11
+ const adaptable = AdaptableContext_1.useAdaptable();
12
+ const dependencies = adaptable.api.teamSharingApi.getSharedEntryDependencies(props.sharedEntity);
13
+ return (React.createElement(React.Fragment, null, dependencies.map((sharedEntity) => {
14
+ const module = adaptable.ModuleService.getModuleById('TeamSharing');
15
+ const itemView = module.toView(sharedEntity);
16
+ return (React.createElement(rebass_1.Box, { as: "ul", padding: 0, key: sharedEntity.Uuid, className: "ab-Shared-Entity-Shared-Object", mb: 2 },
17
+ React.createElement(AdaptableObjectList_1.AdaptableObjectListItem, { deleteTooltip: 'Cannot delete dependencies.', deleteDisabled: true, module: module, data: itemView })));
18
+ })));
19
+ };
20
+ exports.Dependencies = Dependencies;
21
+ const SharedEntityDependencies = (props) => {
22
+ const [isExpanded, setIsExpanded] = React.useState(false);
23
+ return (React.createElement(React.Fragment, null,
24
+ React.createElement(rebass_1.Box, { mb: 3, mt: 2 }, isExpanded ? (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
25
+ isExpanded && React.createElement(exports.Dependencies, { sharedEntity: props.data })));
26
+ };
27
+ exports.SharedEntityDependencies = SharedEntityDependencies;
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import { SharedEntity } from '../../../types';
3
+ export declare const SharedEntityTypeItemView: React.FunctionComponent<{
4
+ data: SharedEntity;
5
+ }>;
6
+ export declare const getSharedEntityActiveStatusObjectView: (isDependency: boolean) => (props: {
7
+ data: SharedEntity;
8
+ }) => JSX.Element;
9
+ export declare const getSharedEntityStaleDepsItemView: (staleDependencies: SharedEntity[]) => () => JSX.Element;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSharedEntityStaleDepsItemView = exports.getSharedEntityActiveStatusObjectView = exports.SharedEntityTypeItemView = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const rebass_1 = require("rebass");
7
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
8
+ const Tag_1 = require("../../components/Tag");
9
+ const AdaptableContext_1 = require("../AdaptableContext");
10
+ const AdaptableObjectList_1 = require("../Components/AdaptableObjectList/AdaptableObjectList");
11
+ const SharedEntityTypeItemView = (props) => {
12
+ const [isExpanded, setIsExpanded] = React.useState(false);
13
+ const adaptable = AdaptableContext_1.useAdaptable();
14
+ const moduleName = props.data.Module;
15
+ const module = adaptable.ModuleService.getModuleById(moduleName);
16
+ const sharedObject = props.data.Entity;
17
+ const item = module.toView(sharedObject);
18
+ return (React.createElement(React.Fragment, null,
19
+ React.createElement(rebass_1.Flex, { mb: 2, mt: 2 },
20
+ React.createElement(rebass_1.Flex, { mr: 2, alignItems: "center" },
21
+ React.createElement(Tag_1.Tag, { style: { margin: 0 } }, props.data.Module)),
22
+ isExpanded ? (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
23
+ isExpanded && (React.createElement(rebass_1.Box, { as: "ul", padding: 0, className: "ab-Shared-Entity-Shared-Object" },
24
+ React.createElement(AdaptableObjectList_1.AdaptableObjectListItem, { hideControls: true, data: item, module: module })))));
25
+ };
26
+ exports.SharedEntityTypeItemView = SharedEntityTypeItemView;
27
+ const getSharedEntityActiveStatusObjectView = (isDependency) => (props) => {
28
+ var _a, _b;
29
+ const adaptable = AdaptableContext_1.useAdaptable();
30
+ const activeEntries = adaptable.api.internalApi.getState().TeamSharing.ActiveSharedEntityMap;
31
+ const sharedEntity = props.data;
32
+ const isAdaptableObjectPresentInLocalState = !!adaptable.api.internalApi
33
+ .getModuleService()
34
+ .getModuleById(sharedEntity.Module)
35
+ .getModuleAdaptableObjects()
36
+ .find((adaptableObject) => adaptableObject.Uuid === sharedEntity.Entity.Uuid);
37
+ const isUpToDateAndActive = isAdaptableObjectPresentInLocalState &&
38
+ sharedEntity.Type === 'Active' &&
39
+ ((_a = activeEntries[sharedEntity.Entity.Uuid]) === null || _a === void 0 ? void 0 : _a.Revision) === sharedEntity.Revision;
40
+ const staleActiveEntities = adaptable.api.internalApi
41
+ .getTeamSharingService()
42
+ .getStaleActiveSharedEntities();
43
+ const isStaleAndActive = isAdaptableObjectPresentInLocalState && !!staleActiveEntities[sharedEntity.Uuid];
44
+ let activeInfo = null;
45
+ if (isAdaptableObjectPresentInLocalState) {
46
+ const activeRevision = (_b = activeEntries === null || activeEntries === void 0 ? void 0 : activeEntries[sharedEntity.Entity.Uuid]) === null || _b === void 0 ? void 0 : _b.Revision;
47
+ if (sharedEntity.Type === 'Active') {
48
+ const newRevision = sharedEntity.Revision;
49
+ let statusInfo = null;
50
+ if (isUpToDateAndActive) {
51
+ statusInfo = (React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-success)' } },
52
+ React.createElement("b", null, "up-to-date")));
53
+ }
54
+ if (isStaleAndActive) {
55
+ statusInfo = (React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-warn)' } }, ` (Rev. ${newRevision} available)`));
56
+ }
57
+ activeInfo = (React.createElement(React.Fragment, null,
58
+ `Imported Rev. ${activeRevision} ${isStaleAndActive ? 'is stale' : ''} `,
59
+ " ",
60
+ statusInfo));
61
+ }
62
+ else {
63
+ // snapshot
64
+ activeInfo = React.createElement(React.Fragment, null, `Imported Rev. ${activeRevision}`);
65
+ }
66
+ }
67
+ const sharedValue = `by ${sharedEntity.UserName} at ${new Date(sharedEntity.Timestamp).toLocaleString()}`;
68
+ return (React.createElement(React.Fragment, null,
69
+ !isDependency && React.createElement(Tag_1.Tag, null, sharedValue),
70
+ activeInfo && React.createElement(Tag_1.Tag, null, activeInfo)));
71
+ };
72
+ exports.getSharedEntityActiveStatusObjectView = getSharedEntityActiveStatusObjectView;
73
+ const getSharedEntityStaleDepsItemView = (staleDependencies) => () => {
74
+ let staleDepsString = 'Shared entity has';
75
+ if ((staleDependencies === null || staleDependencies === void 0 ? void 0 : staleDependencies.length) === 1) {
76
+ staleDepsString += ` one (${staleDependencies[0].Module}) stale dependency`;
77
+ }
78
+ else {
79
+ staleDepsString += ` ${staleDependencies.length} stale dependencies`;
80
+ }
81
+ return (React.createElement(Tag_1.Tag, null,
82
+ React.createElement(rebass_1.Box, { ml: 1, style: { color: 'var(--ab-color-warn)' } }, staleDepsString)));
83
+ };
84
+ exports.getSharedEntityStaleDepsItemView = getSharedEntityStaleDepsItemView;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import { AccessLevel, SharedEntity } from '../../../types';
3
+ export declare const TeamSharingApplyButton: React.FunctionComponent<{
4
+ data: SharedEntity;
5
+ accessLevel: AccessLevel;
6
+ }>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamSharingApplyButton = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const React = tslib_1.__importStar(require("react"));
6
+ const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
7
+ const AdaptableContext_1 = require("../AdaptableContext");
8
+ const TeamSharingApplyButton = (props) => {
9
+ const adaptable = AdaptableContext_1.useAdaptable();
10
+ const handleImport = React.useCallback(() => {
11
+ adaptable.api.teamSharingApi.importSharedEntry(props.data);
12
+ }, []);
13
+ return (React.createElement(SimpleButton_1.default, { onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
14
+ };
15
+ exports.TeamSharingApplyButton = TeamSharingApplyButton;
@@ -1,4 +1,4 @@
1
- import { ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/all-modules';
1
+ import { ChartModel, ChartRef, ColDef, ColGroupDef, Column, ExcelStyle, GridOptions, Module, RowNode } from '@ag-grid-community/all-modules';
2
2
  import { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard } from '../AdaptableInterfaces/AdaptableNoCodeWizard';
3
3
  import { IAdaptable } from '../AdaptableInterfaces/IAdaptable';
4
4
  import { AdaptableOptions } from '../AdaptableOptions/AdaptableOptions';
@@ -186,7 +186,7 @@ export declare class Adaptable implements IAdaptable {
186
186
  getDisplayValue(primaryKey: any, columnId: string): string | undefined;
187
187
  getGridCellFromRowNode(rowNode: RowNode, columnId: string): GridCell | undefined;
188
188
  getDisplayValueFromRowNode(rowNode: RowNode, columnId: string): string | undefined;
189
- getDisplayValueFromRawValue(columnId: string, rawValue: any): string | undefined;
189
+ getDisplayValueFromRawValue(rowNode: RowNode, columnId: string, rawValue: any): string | undefined;
190
190
  private getFormattedValue;
191
191
  private getNormalisedValueFromRowValue;
192
192
  getRawValueFromRowNode(rowNode: RowNode, columnId: string): any;
@@ -354,6 +354,8 @@ export declare class Adaptable implements IAdaptable {
354
354
  private addSyntheticPrimaryKey;
355
355
  private addSyntheticPrimaryKeyIfMissing;
356
356
  initLicenseService(): LicenseService;
357
+ showCharts(charts: ChartModel[]): ChartRef[];
358
+ getChartModels(): ChartModel[];
357
359
  }
358
360
  export declare class AdaptableNoCodeWizard implements IAdaptableNoCodeWizard {
359
361
  private init;
@@ -1860,7 +1860,7 @@ class Adaptable {
1860
1860
  const abColumn = this.api.columnApi.getColumnFromId(columnId);
1861
1861
  const pkValue = this.getPrimaryKeyValueFromRowNode(rowNode);
1862
1862
  const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1863
- const displayValue = this.getDisplayValueFromRawValue(columnId, rawValue);
1863
+ const displayValue = this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1864
1864
  const normalisedvalue = this.getNormalisedValueFromRowValue(rawValue, abColumn);
1865
1865
  return {
1866
1866
  rawValue: rawValue,
@@ -1876,15 +1876,15 @@ class Adaptable {
1876
1876
  return undefined;
1877
1877
  }
1878
1878
  const rawValue = this.getRawValueFromRowNode(rowNode, columnId);
1879
- return this.getDisplayValueFromRawValue(columnId, rawValue);
1879
+ return this.getDisplayValueFromRawValue(rowNode, columnId, rawValue);
1880
1880
  }
1881
- getDisplayValueFromRawValue(columnId, rawValue) {
1881
+ getDisplayValueFromRawValue(rowNode, columnId, rawValue) {
1882
1882
  const abColumn = this.api.columnApi.getColumnFromId(columnId);
1883
1883
  const isRenderedColumn = this.api.columnApi.isFormatNumericStyleColumn(abColumn);
1884
1884
  if (isRenderedColumn) {
1885
1885
  const colDef = this.gridOptions.api.getColumnDef(columnId);
1886
1886
  if (typeof colDef.valueFormatter == 'function') {
1887
- return this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
1887
+ return this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
1888
1888
  }
1889
1889
  return this.agGridHelper.getCleanValue(rawValue);
1890
1890
  }
@@ -1895,7 +1895,7 @@ class Adaptable {
1895
1895
  const colDef = this.gridOptions.api.getColumnDef(columnId);
1896
1896
  if (colDef) {
1897
1897
  if (typeof colDef.valueFormatter == 'function') {
1898
- const formattedValue = this.getFormattedValue(rawValue, columnId, colDef, colDef.valueFormatter);
1898
+ const formattedValue = this.getFormattedValue(rowNode, rawValue, columnId, colDef, colDef.valueFormatter);
1899
1899
  // Never use cellRenderer:
1900
1900
  // - when a string, you never know if it is HTML or a normal string
1901
1901
  // - when an object, cannot be used
@@ -1910,14 +1910,14 @@ class Adaptable {
1910
1910
  }
1911
1911
  return this.agGridHelper.getCleanValue(rawValue);
1912
1912
  }
1913
- getFormattedValue(rawValue, columnId, colDef, formatterFn) {
1913
+ getFormattedValue(rowNode, rawValue, columnId, colDef, formatterFn) {
1914
1914
  const column = this.gridOptions.columnApi
1915
1915
  .getAllColumns()
1916
1916
  .find((c) => c.getColId() == columnId);
1917
1917
  const params = {
1918
1918
  value: rawValue,
1919
- node: null,
1920
- data: null,
1919
+ node: rowNode,
1920
+ data: rowNode.data,
1921
1921
  colDef,
1922
1922
  column,
1923
1923
  api: this.gridOptions.api,
@@ -2402,6 +2402,7 @@ class Adaptable {
2402
2402
  ? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
2403
2403
  : true;
2404
2404
  const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
2405
+ const isExternalEvaluation = !this.api.internalApi.runModuleInAdaptableQL('CalculatedColumn');
2405
2406
  return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
2406
2407
  const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
2407
2408
  if (!calculatedColumnSettings.DataType) {
@@ -2434,9 +2435,9 @@ class Adaptable {
2434
2435
  suppressMovable: calculatedColumnSettings.SuppressMovable,
2435
2436
  type: columnTypes,
2436
2437
  valueGetter: (params) => {
2437
- var _a, _b;
2438
- if ((_a = calculatedColumn.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.ExternallyEvaluatedExpression) {
2439
- return (_b = params.data) === null || _b === void 0 ? void 0 : _b[calculatedColumn.ColumnId];
2438
+ var _a;
2439
+ if (isExternalEvaluation) {
2440
+ return (_a = params.data) === null || _a === void 0 ? void 0 : _a[calculatedColumn.ColumnId];
2440
2441
  }
2441
2442
  return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
2442
2443
  },
@@ -2700,7 +2701,6 @@ class Adaptable {
2700
2701
  this.gridOptions.api.addGlobalListener((this.listenerGlobalColumnEventsThatTriggerStateChange = (type) => {
2701
2702
  if (columnEventsThatTriggersStateChange.indexOf(type) > -1) {
2702
2703
  this.debouncedSetColumnIntoStore();
2703
- this.debouncedFilterGrid();
2704
2704
  }
2705
2705
  }));
2706
2706
  /**
@@ -2760,7 +2760,7 @@ class Adaptable {
2760
2760
  all_modules_1.Events.EVENT_ROW_GROUP_OPENED,
2761
2761
  all_modules_1.Events.EVENT_COLUMN_VALUE_CHANGED,
2762
2762
  ];
2763
- // ADD filter event
2763
+ // no need to add filter event, it is handled by AdaptableStore side-effects
2764
2764
  this.gridOptions.api.addGlobalListener((this.listenerGlobalColumnEventsThatTriggerAutoLayoutSave = (type) => {
2765
2765
  if (columnEventsThatTriggersAutoLayoutSave.indexOf(type) > -1) {
2766
2766
  this.debouncedSaveGridLayout();
@@ -3310,28 +3310,29 @@ class Adaptable {
3310
3310
  }
3311
3311
  if (formatColumn.DisplayFormat) {
3312
3312
  let valueFormatter;
3313
+ const options = formatColumn.DisplayFormat.Options;
3313
3314
  if (formatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
3314
3315
  // change the Number format - if the scope allows it
3315
3316
  if (this.api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
3316
- const options = formatColumn.DisplayFormat.Options;
3317
3317
  valueFormatter = (params) => {
3318
- let value = params.value;
3319
- return this.api.formatColumnApi.getNumberFormattedValue(value, options);
3318
+ return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
3320
3319
  };
3321
3320
  }
3322
3321
  }
3323
3322
  if (formatColumn.DisplayFormat.Formatter === 'DateFormatter') {
3324
3323
  // change the Date format - if the scope allows it
3325
3324
  if (this.api.scopeApi.isColumnInDateScope(abColumn, formatColumn.Scope)) {
3326
- const options = formatColumn.DisplayFormat.Options;
3327
- valueFormatter = (params) => this.api.formatColumnApi.getDateFormattedValue(params.value, options);
3325
+ valueFormatter = (params) => {
3326
+ return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
3327
+ };
3328
3328
  }
3329
3329
  }
3330
3330
  if (formatColumn.DisplayFormat.Formatter === 'StringFormatter') {
3331
- // change the Date format - if the scope allows it
3331
+ // change the String format - if the scope allows it
3332
3332
  if (this.api.scopeApi.isColumnInStringsScope(abColumn, formatColumn.Scope)) {
3333
- const options = formatColumn.DisplayFormat.Options;
3334
- valueFormatter = (params) => this.api.formatColumnApi.getStringFormattedValue(params.value, options);
3333
+ valueFormatter = (params) => {
3334
+ return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
3335
+ };
3335
3336
  }
3336
3337
  }
3337
3338
  return valueFormatter;
@@ -4534,7 +4535,7 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4534
4535
  rawValue = numericRawValue;
4535
4536
  }
4536
4537
  }
4537
- return this.ReportService.getCellExportValueFromRawValue(rawValue, columnId);
4538
+ return this.ReportService.getCellExportValueFromRawValue(rowNode, rawValue, columnId);
4538
4539
  }
4539
4540
  hasAutogeneratedPrimaryKey() {
4540
4541
  return this.adaptableOptions.autogeneratePrimaryKey;
@@ -4561,6 +4562,20 @@ import "@adaptabletools/adaptable/themes/${themeName}.css"`);
4561
4562
  publishedAt: publishTimestamp_1.default,
4562
4563
  });
4563
4564
  }
4565
+ showCharts(charts) {
4566
+ if (!this.gridOptions.api) {
4567
+ LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling showCharts');
4568
+ return [];
4569
+ }
4570
+ return charts.map((chart) => this.gridOptions.api.restoreChart(chart));
4571
+ }
4572
+ getChartModels() {
4573
+ if (!this.gridOptions.api) {
4574
+ LoggingHelper_1.ConsoleLogError('Adaptable must be instantiated before calling getChartModels');
4575
+ return [];
4576
+ }
4577
+ return this.gridOptions.api.getChartModels();
4578
+ }
4564
4579
  }
4565
4580
  exports.Adaptable = Adaptable;
4566
4581
  class AdaptableNoCodeWizard {
@@ -52,7 +52,6 @@ const column_chooser_1 = tslib_1.__importDefault(require("./column-chooser"));
52
52
  const column_add_1 = tslib_1.__importDefault(require("./column-add"));
53
53
  const cell_validation_1 = tslib_1.__importDefault(require("./cell-validation"));
54
54
  const column_filter_1 = tslib_1.__importDefault(require("./column-filter"));
55
- const column_info_1 = tslib_1.__importDefault(require("./column-info"));
56
55
  const custom_sort_1 = tslib_1.__importDefault(require("./custom-sort"));
57
56
  const system_status_1 = tslib_1.__importDefault(require("./system-status"));
58
57
  const data_set_1 = tslib_1.__importDefault(require("./data-set"));
@@ -168,7 +167,6 @@ const allIcons = {
168
167
  'cell-validation': cell_validation_1.default,
169
168
  'conditional-style': conditional_style_1.default,
170
169
  chat: chat_1.default,
171
- 'column-info': column_info_1.default,
172
170
  'custom-sort': custom_sort_1.default,
173
171
  dashboard: dashboard_1.default,
174
172
  'flashing-cell': flashing_cell_1.default,
@@ -191,8 +189,6 @@ const allIcons = {
191
189
  // others
192
190
  edit: edit_1.default,
193
191
  'tab-unselected': tab_unselected_1.default,
194
- 'check-box': check_box_1.default,
195
- 'check-box-outline': check_box_outline_1.default,
196
192
  unchecked: check_box_outline_1.default,
197
193
  checked: check_box_1.default,
198
194
  'boolean-list': boolean_list_1.default,