@adaptabletools/adaptable-cjs 18.0.0-canary.16 → 18.0.0-canary.17

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 (69) hide show
  1. package/package.json +1 -1
  2. package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -2
  3. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +4 -3
  4. package/src/Api/GridApi.d.ts +1 -1
  5. package/src/Api/Implementation/CellSummaryApiImpl.d.ts +0 -5
  6. package/src/Api/Implementation/CellSummaryApiImpl.js +2 -23
  7. package/src/Api/Implementation/GridApiImpl.d.ts +1 -1
  8. package/src/Api/Implementation/GridApiImpl.js +1 -1
  9. package/src/Api/Internal/AdaptableInternalApi.d.ts +0 -2
  10. package/src/Api/Internal/AdaptableInternalApi.js +0 -3
  11. package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
  12. package/src/PredefinedConfig/Common/Enums.js +1 -0
  13. package/src/PredefinedConfig/Common/Menu.d.ts +10 -1
  14. package/src/PredefinedConfig/Common/Menu.js +72 -0
  15. package/src/PredefinedConfig/Common/RowSummary.d.ts +3 -1
  16. package/src/PredefinedConfig/Common/RowSummary.js +17 -1
  17. package/src/Strategy/AdaptableModuleBase.d.ts +6 -5
  18. package/src/Strategy/AdaptableModuleBase.js +9 -8
  19. package/src/Strategy/AlertModule.js +1 -1
  20. package/src/Strategy/BulkUpdateModule.js +1 -1
  21. package/src/Strategy/CalculatedColumnModule.js +1 -1
  22. package/src/Strategy/CellSummaryModule.d.ts +7 -6
  23. package/src/Strategy/CellSummaryModule.js +37 -12
  24. package/src/Strategy/ColumnFilterModule.js +8 -7
  25. package/src/Strategy/ColumnInfoModule.js +2 -0
  26. package/src/Strategy/CommentModule.js +2 -2
  27. package/src/Strategy/CustomSortModule.js +2 -1
  28. package/src/Strategy/DashboardModule.js +8 -7
  29. package/src/Strategy/DataImportModule.js +1 -1
  30. package/src/Strategy/ExportModule.d.ts +1 -0
  31. package/src/Strategy/ExportModule.js +17 -2
  32. package/src/Strategy/Fdc3Module.js +3 -0
  33. package/src/Strategy/FlashingCellModule.js +4 -4
  34. package/src/Strategy/FormatColumnModule.js +6 -4
  35. package/src/Strategy/FreeTextColumnModule.js +1 -1
  36. package/src/Strategy/GridInfoModule.js +2 -0
  37. package/src/Strategy/LayoutModule.js +31 -22
  38. package/src/Strategy/NoteModule.js +2 -2
  39. package/src/Strategy/PlusMinusModule.js +1 -1
  40. package/src/Strategy/SettingsPanelModule.js +3 -3
  41. package/src/Strategy/SmartEditModule.js +1 -1
  42. package/src/Strategy/StyledColumnModule.d.ts +1 -0
  43. package/src/Strategy/StyledColumnModule.js +23 -5
  44. package/src/Strategy/SystemStatusModule.js +2 -2
  45. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +2 -2
  46. package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +125 -3
  47. package/src/Utilities/MenuItem.d.ts +7 -4
  48. package/src/Utilities/MenuItem.js +6 -3
  49. package/src/Utilities/Services/LicenseService/index.js +1 -1
  50. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +5 -2
  51. package/src/View/Components/FilterForm/QuickFilterForm.js +1 -1
  52. package/src/View/Components/ValueSelector/index.js +1 -1
  53. package/src/View/Layout/Wizard/LayoutWizard.js +25 -1
  54. package/src/View/Layout/Wizard/sections/RowSummarySection.d.ts +1 -0
  55. package/src/View/Layout/Wizard/sections/RowSummarySection.js +29 -4
  56. package/src/agGrid/AdaptableAgGrid.d.ts +0 -2
  57. package/src/agGrid/AdaptableAgGrid.js +7 -3
  58. package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -2
  59. package/src/agGrid/weightedAverage.d.ts +0 -2
  60. package/src/agGrid/weightedAverage.js +1 -56
  61. package/src/components/Datepicker/index.js +3 -1
  62. package/src/env.js +2 -2
  63. package/src/metamodel/adaptable.metamodel.d.ts +6 -0
  64. package/src/metamodel/adaptable.metamodel.js +1 -1
  65. package/tsconfig.cjs.tsbuildinfo +1 -1
  66. package/src/Utilities/Services/Interface/ISummaryService.d.ts +0 -17
  67. package/src/Utilities/Services/Interface/ISummaryService.js +0 -15
  68. package/src/Utilities/Services/SummaryService.d.ts +0 -10
  69. package/src/Utilities/Services/SummaryService.js +0 -21
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.aggregatedScalarExpressionFunctionNames = exports.aggregatedScalarExpressionFunctions = exports.quantileAggregatedExpressionFunctions = exports.cumulativeAggregatedExpressionFunctions = exports.aggregatedExpressionFunctions = void 0;
4
- const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
4
+ const tslib_1 = require("tslib");
5
5
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
6
- const TypeExtensions_1 = require("../Extensions/TypeExtensions");
7
6
  const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
7
+ const TypeExtensions_1 = require("../Extensions/TypeExtensions");
8
+ const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
9
+ const isAfter_1 = tslib_1.__importDefault(require("date-fns/isAfter"));
10
+ const DateHelper_1 = require("../Helpers/DateHelper");
8
11
  exports.aggregatedExpressionFunctions = [
9
12
  'SUM',
10
13
  'PERCENTAGE',
@@ -354,6 +357,7 @@ exports.aggregatedScalarExpressionFunctions = {
354
357
  return aggregatedValue;
355
358
  },
356
359
  done: (aggregatedValue) => {
360
+ var _a;
357
361
  const sorted = [...aggregatedValue.entries()].sort(([aVal, aFreq], [bVal, bFreq]) => {
358
362
  if (aFreq < bFreq) {
359
363
  return 1;
@@ -365,7 +369,7 @@ exports.aggregatedScalarExpressionFunctions = {
365
369
  return aVal === bVal ? 0 : 1;
366
370
  }
367
371
  });
368
- return sorted[0][0];
372
+ return (_a = sorted === null || sorted === void 0 ? void 0 : sorted[0]) === null || _a === void 0 ? void 0 : _a[0];
369
373
  },
370
374
  },
371
375
  },
@@ -911,6 +915,124 @@ exports.aggregatedScalarExpressionFunctions = {
911
915
  examples: ['[col1]', 'COL("col1")'],
912
916
  category: 'special',
913
917
  },
918
+ OLDEST: {
919
+ handler(args, context) {
920
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('OLDEST', args);
921
+ const minColumnName = minColumnParameter.value;
922
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'OLDEST', context.adaptableApi);
923
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('OLDEST', 'operand', ['GROUP_BY'], args, {
924
+ isOptional: true,
925
+ });
926
+ const aggregationExpressionEvaluation = {
927
+ aggregationParams: {
928
+ reducers: {
929
+ OLDEST: {
930
+ name: 'OLDEST',
931
+ field: minColumnName,
932
+ initialValue: null,
933
+ reducer: (minValue, rowValue) => {
934
+ if (!minValue) {
935
+ return rowValue;
936
+ }
937
+ if (!rowValue) {
938
+ return minValue;
939
+ }
940
+ if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
941
+ return rowValue;
942
+ }
943
+ else {
944
+ return minValue;
945
+ }
946
+ },
947
+ done: (minValue, arr) => {
948
+ if (minValue !== null) {
949
+ return minValue;
950
+ }
951
+ },
952
+ },
953
+ },
954
+ },
955
+ rowFilterFn: context.filterFn,
956
+ getRowNodes: context.getRowNodes,
957
+ };
958
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
959
+ const result = {
960
+ name: 'OLDEST',
961
+ type: 'aggregationScalar',
962
+ value: aggregationExpressionEvaluation,
963
+ };
964
+ return result;
965
+ },
966
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
967
+ signatures: [
968
+ 'OLDEST( [colName] )',
969
+ 'OLDEST( COL(name: string))',
970
+ 'OLDEST( [colNameA], GROUP_BY( [colNameB] ))',
971
+ 'OLDEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
972
+ ],
973
+ examples: ['OLDEST([colA])', 'OLDEST([colA], GROUP_BY([colB]))'],
974
+ category: 'aggregation',
975
+ inputs: ['date'],
976
+ },
977
+ YOUNGEST: {
978
+ handler(args, context) {
979
+ const minColumnParameter = (0, expressionFunctionUtils_1.extractColumnParameter)('YOUNGEST', args);
980
+ const minColumnName = minColumnParameter.value;
981
+ (0, expressionFunctionUtils_1.validateColumnType)(minColumnName, ['Date'], 'YOUNGEST', context.adaptableApi);
982
+ const groupByParameter = (0, expressionFunctionUtils_1.extractParameter)('YOUNGEST', 'operand', ['GROUP_BY'], args, {
983
+ isOptional: true,
984
+ });
985
+ const aggregationExpressionEvaluation = {
986
+ aggregationParams: {
987
+ reducers: {
988
+ YOUNGEST: {
989
+ name: 'YOUNGEST',
990
+ field: minColumnName,
991
+ initialValue: null,
992
+ reducer: (minValue, rowValue) => {
993
+ if (!minValue) {
994
+ return rowValue;
995
+ }
996
+ if (!rowValue) {
997
+ return minValue;
998
+ }
999
+ if ((0, isAfter_1.default)((0, DateHelper_1.parseDateValue)(minValue), (0, DateHelper_1.parseDateValue)(rowValue))) {
1000
+ return minValue;
1001
+ }
1002
+ else {
1003
+ return rowValue;
1004
+ }
1005
+ },
1006
+ done: (minValue, arr) => {
1007
+ if (minValue !== null) {
1008
+ return minValue;
1009
+ }
1010
+ },
1011
+ },
1012
+ },
1013
+ },
1014
+ rowFilterFn: context.filterFn,
1015
+ getRowNodes: context.getRowNodes,
1016
+ };
1017
+ addGroupByParams(groupByParameter === null || groupByParameter === void 0 ? void 0 : groupByParameter.value, aggregationExpressionEvaluation);
1018
+ const result = {
1019
+ name: 'YOUNGEST',
1020
+ type: 'aggregationScalar',
1021
+ value: aggregationExpressionEvaluation,
1022
+ };
1023
+ return result;
1024
+ },
1025
+ description: 'Aggregates a column over multiple rows by computing the minimum of the column values\nOptionally the aggregation may be computed within provided individual groups',
1026
+ signatures: [
1027
+ 'YOUNGEST( [colName] )',
1028
+ 'YOUNGEST( COL(name: string))',
1029
+ 'YOUNGEST( [colNameA], GROUP_BY( [colNameB] ))',
1030
+ 'YOUNGEST( COL(nameA: string), GROUP_BY( COL(nameB: string)))',
1031
+ ],
1032
+ examples: ['YOUNGEST([colA])', 'YOUNGEST([colA], GROUP_BY([colB]))'],
1033
+ category: 'aggregation',
1034
+ inputs: ['date'],
1035
+ },
914
1036
  };
915
1037
  const mapAggregationToCumulation = (aggregationParameter, overColumnParameter, context) => {
916
1038
  const aggregationEvaluation = aggregationParameter.value;
@@ -1,10 +1,11 @@
1
1
  import * as Redux from 'redux';
2
2
  import { ModuleParams } from '../View/Components/SharedProps/ModuleViewPopupProps';
3
- import { AdaptableMenuItem } from '../PredefinedConfig/Common/Menu';
3
+ import { AdaptableMenuItem, AdaptableMenuItemName } from '../PredefinedConfig/Common/Menu';
4
4
  import { AdaptableModule } from '../PredefinedConfig/Common/Types';
5
5
  import { AdaptableIcon, AdaptableSystemIconName } from '../PredefinedConfig/Common/AdaptableIcon';
6
6
  export declare class MenuItemDoReduxAction implements AdaptableMenuItem {
7
- constructor(label: string, module: AdaptableModule, reduxAction: Redux.Action, icon: AdaptableSystemIconName, isVisible: boolean);
7
+ constructor(name: AdaptableMenuItemName, label: string, module: AdaptableModule, reduxAction: Redux.Action, icon: AdaptableSystemIconName, isVisible: boolean);
8
+ name: AdaptableMenuItemName;
8
9
  reduxAction: Redux.Action;
9
10
  label: string;
10
11
  module: AdaptableModule;
@@ -12,7 +13,8 @@ export declare class MenuItemDoReduxAction implements AdaptableMenuItem {
12
13
  icon: AdaptableIcon;
13
14
  }
14
15
  export declare class MenuItemDoClickFunction implements AdaptableMenuItem {
15
- constructor(label: string, module: AdaptableModule, clickFunction: () => void, icon: AdaptableSystemIconName, isVisible: boolean);
16
+ constructor(name: AdaptableMenuItemName, label: string, module: AdaptableModule, clickFunction: () => void, icon: AdaptableSystemIconName, isVisible: boolean);
17
+ name: AdaptableMenuItemName;
16
18
  onClick: () => void;
17
19
  label: string;
18
20
  module: AdaptableModule;
@@ -20,7 +22,8 @@ export declare class MenuItemDoClickFunction implements AdaptableMenuItem {
20
22
  icon: AdaptableIcon;
21
23
  }
22
24
  export declare class MenuItemShowPopup implements AdaptableMenuItem {
23
- constructor(label: string, module: AdaptableModule, componentName: string, icon: AdaptableSystemIconName, isVisible: boolean, popupParams?: ModuleParams);
25
+ constructor(name: AdaptableMenuItemName, label: string, module: AdaptableModule, componentName: string, icon: AdaptableSystemIconName, isVisible: boolean, popupParams?: ModuleParams);
26
+ name: AdaptableMenuItemName;
24
27
  reduxAction: Redux.Action;
25
28
  label: string;
26
29
  module: AdaptableModule;
@@ -5,7 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const PopupRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/PopupRedux"));
6
6
  // A menu item which performs a Redux Action when it is clicke
7
7
  class MenuItemDoReduxAction {
8
- constructor(label, module, reduxAction, icon, isVisible) {
8
+ constructor(name, label, module, reduxAction, icon, isVisible) {
9
+ this.name = name;
9
10
  this.label = label;
10
11
  this.module = module;
11
12
  this.isVisible = isVisible;
@@ -17,7 +18,8 @@ class MenuItemDoReduxAction {
17
18
  }
18
19
  exports.MenuItemDoReduxAction = MenuItemDoReduxAction;
19
20
  class MenuItemDoClickFunction {
20
- constructor(label, module, clickFunction, icon, isVisible) {
21
+ constructor(name, label, module, clickFunction, icon, isVisible) {
22
+ this.name = name;
21
23
  this.label = label;
22
24
  this.module = module;
23
25
  this.isVisible = isVisible;
@@ -30,7 +32,8 @@ class MenuItemDoClickFunction {
30
32
  exports.MenuItemDoClickFunction = MenuItemDoClickFunction;
31
33
  // A menu item which shows a popup screen when it is clieked
32
34
  class MenuItemShowPopup {
33
- constructor(label, module, componentName, icon, isVisible, popupParams) {
35
+ constructor(name, label, module, componentName, icon, isVisible, popupParams) {
36
+ this.name = name;
34
37
  this.label = label;
35
38
  this.module = module;
36
39
  this.isVisible = isVisible;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/SystemRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),o=e.__importDefault(require("lodash/clamp")),i=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const h=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,E=/(https):\/\/\S+(\.csb\.app)/g,I=/(https):\/\/\S+(\.adaptabletools\.com)/g,_=()=>"undefined"!=typeof window?window.location.origin:"",O=()=>{const e=_();console.log("isInsideSandpack",e);const[a,t,s]=Array.from(h.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},u=()=>{const e=_();console.log("isInsideSandbox",e);const[a,t,s]=Array.from(E.exec(e)||[]);return"https"===t&&".csb.app"===s},A=()=>{const e=_();console.log("isDemoApp",e);const[a,t,s]=Array.from(I.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class N{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}O()||u()||A()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),o=s<new Date,i=e.trial;let n=null;return n=o?s>t?i?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:i?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:i?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let p=0;e instanceof Error||!(null==e?void 0:e.end)||(p=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/d),p=(0,o.default)(p,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(h=e.appName,E=" for application [APP_NAME]");const I=(e,a=i.LicenseDocsLink,t=l,s=p,o=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",o).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(I("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(p<=c)this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(I(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(I(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseDisablePersistence)())}destroy(){}}exports.LicenseService=N;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/SystemRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("lodash/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p=exports.LicenseValidityType||(exports.LicenseValidityType={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},_=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===s},I=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class O{constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",(()=>{requestAnimationFrame((()=>{this.init()}))}))}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}E()||_()||I()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){var t;const s=new Date;s.setHours(0,0,0,0);let p=0;e instanceof Error||!(null==e?void 0:e.end)||(p=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/d),p=(0,i.default)(p,0,1/0));let h="",E="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(h=e.appName,E=" for application [APP_NAME]");const _=(e,a=o.LicenseDocsLink,t=l,s=p,i=h)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",i).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(_("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(_("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(_("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(_("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(p<=c)this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(_(`Thank you for using a valid AdapTable license${E}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(_(`This AdapTable license${E} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.SystemLicenseDisablePersistence)())}destroy(){}}exports.LicenseService=O;
@@ -43,7 +43,7 @@ const AdaptableObjectListItemView = (props) => {
43
43
  var _a;
44
44
  let labelEl = tag.label;
45
45
  if (typeof tag.label === 'function') {
46
- labelEl = React.createElement(tag.label, { data: props.abObject });
46
+ labelEl = React.createElement(tag.label, { key: index, data: props.abObject });
47
47
  }
48
48
  labelEl = labelEl !== null && labelEl !== void 0 ? labelEl : tag.name;
49
49
  return (React.createElement(rebass_1.Flex, { "data-name": tag.name, key: `${index}-${tag.name}`, mb: 2, className: `${baseClassName}__row` },
@@ -135,6 +135,9 @@ const AdaptableObjectListItem = (props) => {
135
135
  exports.AdaptableObjectListItem = AdaptableObjectListItem;
136
136
  const AdaptableObjectList = (props) => {
137
137
  var _a;
138
- return (React.createElement("ul", { className: LIST_BASE_CLASS_NAME }, (_a = props === null || props === void 0 ? void 0 : props.items) === null || _a === void 0 ? void 0 : _a.map((item) => (React.createElement(exports.AdaptableObjectListItem, Object.assign({ key: item.abObject.Uuid, data: item, module: props.module }, props.itemProps))))));
138
+ return (React.createElement("ul", { className: LIST_BASE_CLASS_NAME }, (_a = props === null || props === void 0 ? void 0 : props.items) === null || _a === void 0 ? void 0 : _a.map((item, index) => {
139
+ var _a;
140
+ return (React.createElement(exports.AdaptableObjectListItem, Object.assign({ key: (_a = item.abObject.Uuid) !== null && _a !== void 0 ? _a : index, data: item, module: props.module }, props.itemProps)));
141
+ })));
139
142
  };
140
143
  exports.AdaptableObjectList = AdaptableObjectList;
@@ -152,7 +152,7 @@ class QuickFilterFormComponent extends React.Component {
152
152
  }
153
153
  };
154
154
  if (predicateInput.type === 'date' && !showDatePicker) {
155
- return (React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { value: value, onKeyDownCapture: onKeyDownCapture, onChange: (value) => this.changeColumnPredicateInput(value, index) }));
155
+ return (React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { value: value, key: index, onKeyDownCapture: onKeyDownCapture, onChange: (value) => this.changeColumnPredicateInput(value, index) }));
156
156
  }
157
157
  return (React.createElement(AdaptableInput_1.default, { disabled: this.isFilterDisabled(), key: index, type: predicateInput.type === 'number' ? 'text' : predicateInput.type,
158
158
  // autoFocus has to be FALSE because if the input receives focus in the init phase,
@@ -66,7 +66,7 @@ function ValueSelector(props) {
66
66
  const label = !allowReorder ? preparedToLabel(option) : null;
67
67
  const reorderable = typeof allowReorder === 'function' ? allowReorder(option) : allowReorder;
68
68
  const renderNode = (props, dragHandleProps) => {
69
- return (React.createElement(rebass_1.Flex, Object.assign({ className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props),
69
+ return (React.createElement(rebass_1.Flex, Object.assign({ className: `${baseClassName}__option`, alignItems: "center", mt: index ? 1 : 0, key: identifier !== null && identifier !== void 0 ? identifier : index, backgroundColor: 'primary', padding: 2, "data-index": index, "data-id": identifier, "data-name": "option" }, props),
70
70
  React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", alignItems: "center" },
71
71
  reorderable ? (React.createElement(rebass_1.Box, Object.assign({ mr: 3 }, dragHandleProps),
72
72
  React.createElement(icons_1.Icon, { name: "drag", style: { cursor: 'grab' } }))) : null,
@@ -19,6 +19,7 @@ const SortSection_1 = require("./sections/SortSection");
19
19
  const FilterSection_1 = require("./sections/FilterSection");
20
20
  const GridFilterSection_1 = require("./sections/GridFilterSection");
21
21
  const RowSummarySection_1 = require("./sections/RowSummarySection");
22
+ const RowSummary_1 = require("../../../PredefinedConfig/Common/RowSummary");
22
23
  const LayoutWizard = (props) => {
23
24
  var _a, _b;
24
25
  const dispatch = (0, react_redux_1.useDispatch)();
@@ -107,6 +108,7 @@ const LayoutWizard = (props) => {
107
108
  {
108
109
  title: 'Row Groups',
109
110
  isVisible: () => layoutSupportedFeatures.RowGroupedColumns,
111
+ isValid: RowSummarySection_1.areSummaryRowsValid,
110
112
  details: 'Configure Row Grouping',
111
113
  renderSummary: () => React.createElement(RowGroupingSection_1.RowGroupingSectionSummary, null),
112
114
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
@@ -119,7 +121,29 @@ const LayoutWizard = (props) => {
119
121
  renderSummary: () => React.createElement(AggregationsSection_1.AggregationsSectionSummary, null),
120
122
  isValid: (data) => (0, AggregationsSection_1.isAggregationsSectionValid)(data),
121
123
  render: () => (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' } },
122
- React.createElement(AggregationsSection_1.AggregationsSection, { onChange: setLayout }))),
124
+ React.createElement(AggregationsSection_1.AggregationsSection, { onChange: (layout) => {
125
+ let newLayout = (0, Helper_1.cloneObject)(layout);
126
+ // if we do not have an weighted avg col, we need to clear the row summary if one exists
127
+ if (newLayout.RowSummaries) {
128
+ newLayout.RowSummaries = newLayout.RowSummaries.map((rowSummary) => {
129
+ return Object.assign(Object.assign({}, rowSummary), { ColumnsMap: Object.entries(rowSummary.ColumnsMap).reduce((acc, [columnId, aggFunc]) => {
130
+ if (
131
+ // see if it is weighted avg
132
+ aggFunc === RowSummary_1.WEIGHTED_AVERAGE_AGGREATED_FUNCTION &&
133
+ // see if we have a weight in the agg columns
134
+ newLayout.AggregationColumns[columnId] &&
135
+ (typeof newLayout.AggregationColumns[columnId] !== 'object' ||
136
+ newLayout.AggregationColumns[columnId].weightColumnId)) {
137
+ // need to remove the row summary
138
+ return acc;
139
+ }
140
+ acc[columnId] = aggFunc;
141
+ return acc;
142
+ }, {}) });
143
+ });
144
+ }
145
+ setLayout(newLayout);
146
+ } }))),
123
147
  },
124
148
  {
125
149
  title: 'Row Summaries',
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { Layout } from '../../../../../types';
3
+ export declare const areSummaryRowsValid: (layout: Layout) => true | string;
3
4
  export declare const RowGroupingSectionSummary: React.FunctionComponent;
4
5
  interface RowSummarySectionProps {
5
6
  onChange: (data: Layout) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RowSummarySection = exports.RowGroupingSectionSummary = void 0;
3
+ exports.RowSummarySection = exports.RowGroupingSectionSummary = exports.areSummaryRowsValid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const rebass_1 = require("rebass");
@@ -10,21 +10,38 @@ const Select_1 = require("../../../../components/Select");
10
10
  const SimpleButton_1 = tslib_1.__importDefault(require("../../../../components/SimpleButton"));
11
11
  const Tabs_1 = require("../../../../components/Tabs");
12
12
  const Tag_1 = require("../../../../components/Tag");
13
+ const RowSummary_1 = require("../../../../PredefinedConfig/Common/RowSummary");
13
14
  const adaptableQlUtils_1 = require("../../../../Utilities/adaptableQlUtils");
14
15
  const ModuleConstants_1 = require("../../../../Utilities/Constants/ModuleConstants");
15
- const ISummaryService_1 = require("../../../../Utilities/Services/Interface/ISummaryService");
16
16
  const sortWithOrder_1 = require("../../../../Utilities/sortWithOrder");
17
17
  const AdaptableContext_1 = require("../../../AdaptableContext");
18
18
  const ValueSelector_1 = require("../../../Components/ValueSelector");
19
19
  const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
20
20
  const Utilities_1 = require("./Utilities");
21
+ const areSummaryRowsValid = (layout) => {
22
+ var _a;
23
+ if (!layout.RowSummaries)
24
+ return true;
25
+ let valid = true;
26
+ (_a = layout.RowSummaries) === null || _a === void 0 ? void 0 : _a.find((rowSummary) => {
27
+ var _a;
28
+ for (const [_, fn] of Object.entries((_a = rowSummary.ColumnsMap) !== null && _a !== void 0 ? _a : {})) {
29
+ if (!fn) {
30
+ valid = 'All row summary columns must have an aggregation function.';
31
+ return true;
32
+ }
33
+ }
34
+ });
35
+ return valid;
36
+ };
37
+ exports.areSummaryRowsValid = areSummaryRowsValid;
21
38
  const getAvailableExpressionsForColumnType = (columnType, availableScalarExpressions) => {
22
39
  const inputType = (0, adaptableQlUtils_1.mapColumnDataTypeToExpressionFunctionType)(columnType);
23
40
  return Object.entries(availableScalarExpressions !== null && availableScalarExpressions !== void 0 ? availableScalarExpressions : {})
24
41
  .map(([expression, expressionDef]) => {
25
42
  var _a, _b;
26
43
  let firstArg = null;
27
- if (!ISummaryService_1.summarySupportedExpressions.includes(expression)) {
44
+ if (!RowSummary_1.summarySupportedExpressions.includes(expression)) {
28
45
  return null;
29
46
  }
30
47
  if (Array.isArray((_a = expressionDef === null || expressionDef === void 0 ? void 0 : expressionDef.inputs) === null || _a === void 0 ? void 0 : _a[0])) {
@@ -58,7 +75,7 @@ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, on
58
75
  .getColumns()
59
76
  .filter((column) => {
60
77
  var _a, _b;
61
- if (!['Number', 'String'].includes(column.dataType))
78
+ if (!['Number', 'String', 'Date'].includes(column.dataType))
62
79
  return false;
63
80
  return (_b = (_a = layout.Columns) === null || _a === void 0 ? void 0 : _a.includes) === null || _b === void 0 ? void 0 : _b.call(_a, column.columnId);
64
81
  })
@@ -101,6 +118,14 @@ const RowSummaryEditor = ({ rowSummary, onChange, availableScalarExpressions, on
101
118
  label: expression,
102
119
  value: expression,
103
120
  }));
121
+ // check out if this layout has a aggregation with wighted column
122
+ const aggregation = layout.AggregationColumns[column.columnId];
123
+ if (aggregation && typeof aggregation === 'object' && aggregation.weightedColumnId) {
124
+ expressionOptions.push({
125
+ label: 'WEIGHTERD_AVG',
126
+ value: RowSummary_1.WEIGHTED_AVERAGE_AGGREATED_FUNCTION,
127
+ });
128
+ }
104
129
  const expression = rowSummary.ColumnsMap[column.columnId];
105
130
  return (React.createElement(rebass_1.Flex, null,
106
131
  React.createElement(rebass_1.Flex, { mr: 2, alignItems: 'center' }, label),
@@ -26,7 +26,6 @@ import { RenderReactRootFn } from '../renderReactRoot';
26
26
  import { AgGridOptionsService } from './AgGridOptionsService';
27
27
  import { AgGridColumnAdapter } from './AgGridColumnAdapter';
28
28
  import { RowEditService } from '../Utilities/Services/RowEditService';
29
- import { ISummaryService } from '../Utilities/Services/Interface/ISummaryService';
30
29
  export type AdaptableVariant = 'vanilla' | 'react' | 'angular';
31
30
  export type AdaptableLifecycleState = 'initial' | 'preprocessOptions' | 'initAdaptableState' | 'setupAgGrid' | 'initAgGrid' | 'available' | 'ready' | 'preDestroyed';
32
31
  type RenderAgGridFrameworkComponentResult = false | GridApi;
@@ -82,7 +81,6 @@ export declare class AdaptableAgGrid implements IAdaptable {
82
81
  RowEditService: RowEditService;
83
82
  Fdc3Service: Fdc3Service;
84
83
  CellPopupService: CellPopupService;
85
- SummaryService: ISummaryService;
86
84
  private LicenseService;
87
85
  private ChartingService;
88
86
  private ThemeService;
@@ -99,7 +99,6 @@ const AdaptableUpgradeHelper_1 = require("../migration/AdaptableUpgradeHelper");
99
99
  const Modal_1 = require("../components/Modal");
100
100
  const AdaptableLoadingScreen_1 = require("../View/Components/Popups/AdaptableLoadingScreen");
101
101
  const react_1 = require("react");
102
- const SummaryService_1 = require("../Utilities/Services/SummaryService");
103
102
  const AdaptableHelper_1 = require("../Utilities/Helpers/AdaptableHelper");
104
103
  const RowNodeProto = core_1.RowNode.prototype;
105
104
  const RowNode_dispatchLocalEvent = RowNodeProto.dispatchLocalEvent;
@@ -902,7 +901,7 @@ class AdaptableAgGrid {
902
901
  */
903
902
  // this will have to go/be heavily extended with https://github.com/AdaptableTools/adaptable/issues/2230
904
903
  this.agGridOptionsService.setGridOptionsProperty(gridOptions, 'columnTypes', (original_columnTypes) => {
905
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
904
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
906
905
  const providedColumnTypes = original_columnTypes || {};
907
906
  const gridOptionsColumnTypes = gridOptions.columnTypes || {};
908
907
  const patchedColumnTypes = Object.assign(providedColumnTypes, {
@@ -919,6 +918,12 @@ class AdaptableAgGrid {
919
918
  abColDefTupleNumberArray: (_j = gridOptionsColumnTypes.abColDefTupleNumberArray) !== null && _j !== void 0 ? _j : {},
920
919
  abColDefObjectNumberArray: (_k = gridOptionsColumnTypes.abColDefObjectNumberArray) !== null && _k !== void 0 ? _k : {},
921
920
  });
921
+ const customColumnTypes = (_l = this.api.columnApi.getColumnTypes()) !== null && _l !== void 0 ? _l : [];
922
+ for (const customColumnType of customColumnTypes) {
923
+ if (!patchedColumnTypes[customColumnType]) {
924
+ patchedColumnTypes[customColumnType] = {};
925
+ }
926
+ }
922
927
  if (patchedColumnTypes.abColDefNumber.cellEditor == undefined) {
923
928
  patchedColumnTypes.abColDefNumber.cellEditor =
924
929
  this.variant === 'react' ? AdaptableNumberEditor_1.ReactAdaptableNumberEditor : AdaptableNumberEditor_1.AdaptableNumberEditor;
@@ -1573,7 +1578,6 @@ class AdaptableAgGrid {
1573
1578
  this.AlertService = new AlertService_1.AlertService(this.api);
1574
1579
  this.TeamSharingService = new TeamSharingService_1.TeamSharingService(this.api);
1575
1580
  this.Fdc3Service = new Fdc3Service_1.Fdc3Service(this.api);
1576
- this.SummaryService = new SummaryService_1.SummaryService(this.api);
1577
1581
  this.CellPopupService = new CellPopupService_1.CellPopupService(this.api);
1578
1582
  this.RowEditService = new RowEditService_1.RowEditService(this.api);
1579
1583
  this.MetamodelService = new MetamodelService_1.MetamodelService(() => this.api.optionsApi.getAdaptableOptions(), true);
@@ -6,12 +6,12 @@ import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core';
6
6
  interface AdaptableNumberCellEditorParams extends ICellEditorParams {
7
7
  /**
8
8
  * Whether to show the clear button. If `true`, it works together with `cellEditorParams.emptyValue`
9
- * @default true
9
+ * @defaultValue true
10
10
  */
11
11
  showClearButton: boolean;
12
12
  /**
13
13
  * Value to set for the cell, when the clear button is pressed
14
- * @default '' (empty string)
14
+ * @defaultValue '' (empty string)
15
15
  */
16
16
  emptyValue: string;
17
17
  }
@@ -1,9 +1,7 @@
1
1
  import { IAggFuncParams } from '@ag-grid-community/core';
2
- import { CellSummaryOperationContext } from '../types';
3
2
  export declare const getNumericValue: (input: unknown) => number | null;
4
3
  export declare const weightedAverage: (params: IAggFuncParams, columnId: string, weightColumnId: string) => {
5
4
  [x: string]: number | (() => number | "");
6
5
  toString: () => number | "";
7
6
  valueOf: () => number;
8
7
  };
9
- export declare const cellSummaryWeightedAverage: ({ numericColumns, selectedCellInfo, adaptableApi, }: CellSummaryOperationContext) => any;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cellSummaryWeightedAverage = exports.weightedAverage = exports.getNumericValue = void 0;
3
+ exports.weightedAverage = exports.getNumericValue = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
6
5
  const toNumber_1 = tslib_1.__importDefault(require("lodash/toNumber"));
7
6
  const getNumericValue = (input) => {
8
7
  if (typeof input === 'number') {
@@ -52,57 +51,3 @@ const weightedAverage = (params, columnId, weightColumnId) => {
52
51
  };
53
52
  };
54
53
  exports.weightedAverage = weightedAverage;
55
- const cellSummaryWeightedAverage = ({ numericColumns, selectedCellInfo, adaptableApi, }) => {
56
- if ((numericColumns === null || numericColumns === void 0 ? void 0 : numericColumns.length) != 1) {
57
- return '';
58
- }
59
- const columnId = numericColumns[0];
60
- const currentLayout = adaptableApi.layoutApi.getCurrentLayout();
61
- const selectedColumnAgg = currentLayout.AggregationColumns[columnId];
62
- if (!selectedColumnAgg ||
63
- typeof selectedColumnAgg !== 'object' ||
64
- selectedColumnAgg.type !== 'weightedAverage') {
65
- return '';
66
- }
67
- const weightedColumnId = selectedColumnAgg.weightedColumnId;
68
- if (weightedColumnId) {
69
- let sumWeightedValue = 0;
70
- let sumPrimaryValues = 0;
71
- let isValid = true;
72
- selectedCellInfo.gridCells.forEach((gridCell) => {
73
- if (adaptableApi.gridApi.isGroupRowNode(gridCell.rowNode)) {
74
- isValid = false;
75
- }
76
- if (isValid) {
77
- const weightedGridCell = adaptableApi.gridApi.getGridCellFromRowNode(gridCell.rowNode, weightedColumnId);
78
- sumWeightedValue += weightedGridCell.rawValue;
79
- sumPrimaryValues += weightedGridCell.rawValue * gridCell.normalisedValue;
80
- }
81
- });
82
- if (!isValid) {
83
- return '';
84
- }
85
- const abColumn = adaptableApi.columnApi.getColumnWithColumnId(columnId);
86
- if (!abColumn) {
87
- return '';
88
- }
89
- const activeFormatColumnsWithDisplayFormat = adaptableApi.formatColumnApi.internalApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
90
- if (activeFormatColumnsWithDisplayFormat.length === 1 &&
91
- activeFormatColumnsWithDisplayFormat[0].DisplayFormat.Formatter === 'NumberFormatter') {
92
- // there only one FormatColumn on this column, so we will use it to format the aggregated value
93
- const [singleActiveFormatColumnsWithDisplayFormat] = activeFormatColumnsWithDisplayFormat;
94
- const options = singleActiveFormatColumnsWithDisplayFormat
95
- .DisplayFormat.Options;
96
- if (options) {
97
- return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, options);
98
- }
99
- }
100
- else {
101
- // there are multiple (possibly conflicting) FormatColumns for this column, we cannot know which to use
102
- return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, {
103
- FractionDigits: 2,
104
- });
105
- }
106
- }
107
- };
108
- exports.cellSummaryWeightedAverage = cellSummaryWeightedAverage;
@@ -103,7 +103,9 @@ exports.Datepicker = React.forwardRef((props, ref) => {
103
103
  setVisible(true);
104
104
  }
105
105
  } }),
106
- React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { ref: ref, value: inputValue, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : dateProps.format, onChange: (value) => {
106
+ React.createElement(AdaptableDateInlineInput_1.AdaptableDateInlineInput, { ref: ref, value: inputValue,
107
+ // We do not want to show the format when the date-picker is visible
108
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : '', onChange: (value) => {
107
109
  const date = new Date(value);
108
110
  if ((0, date_fns_1.isValid)(date)) {
109
111
  updateValue(date);
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: 1711464557352 || Date.now(),
6
- VERSION: "18.0.0-canary.16" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1711543434054 || Date.now(),
6
+ VERSION: "18.0.0-canary.17" || '--current-version--',
7
7
  };
@@ -563,6 +563,12 @@ export declare const ADAPTABLE_METAMODEL: {
563
563
  desc: string;
564
564
  isOpt?: undefined;
565
565
  ref?: undefined;
566
+ } | {
567
+ name: string;
568
+ kind: string;
569
+ desc: string;
570
+ ref: string;
571
+ isOpt?: undefined;
566
572
  } | {
567
573
  name: string;
568
574
  kind: string;