@adaptabletools/adaptable 11.0.3 → 11.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable",
3
- "version": "11.0.3",
3
+ "version": "11.0.4",
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: 1646417924493;
1
+ declare const _default: 1646846997369;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = 1646417924493;
3
+ exports.default = 1646846997369;
@@ -12,6 +12,7 @@ export interface AdaptableNoCodeWizardOptions {
12
12
  defaultActionMessage?: React.ReactNode;
13
13
  dragOverActionMessage?: React.ReactNode;
14
14
  fetchData?: () => Promise<any>;
15
+ showFetchDataWizard?: boolean;
15
16
  helpText?: React.ReactNode;
16
17
  fileContentsToJSON?: (str: string) => Promise<any> | any;
17
18
  readFile?: (file: File) => Promise<any>;
@@ -66,7 +66,10 @@ export interface FilterOptions {
66
66
  */
67
67
  quickFilterValuesTrigger?: 'mouseenter' | 'click';
68
68
  /**
69
- * TODO: add comment
69
+ * Sets a height for Quick Filter Bar (if not provided AG Grid's default is used)
70
+ *
71
+ * @defaultValue null
72
+ * @gridInfoItem
70
73
  */
71
74
  quickFilterHeight?: number;
72
75
  /**
@@ -7,6 +7,10 @@ export interface CellSummaryApi {
7
7
  * Retrieves currently selected Cell Summary Operation
8
8
  */
9
9
  getCurrentCellSummaryOperation(): CellSummaryOperation | string;
10
+ /**
11
+ * Sets the currently selected Cell Summary Operation
12
+ */
13
+ setCurrentCellSummaryOperation(operation: CellSummaryOperation | string): void;
10
14
  /**
11
15
  * Retrieves all Cell Summary Definitions from Cell Summary State
12
16
  */
@@ -1,8 +1,10 @@
1
1
  import { ApiBase } from './ApiBase';
2
2
  import { CellSummaryApi } from '../CellSummaryApi';
3
3
  import { CellSummaryOperation } from '../../PredefinedConfig/Common/CellSummary';
4
+ import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
4
5
  export declare class CellSummaryApiImpl extends ApiBase implements CellSummaryApi {
5
6
  getCurrentCellSummaryOperation(): CellSummaryOperation | string;
6
7
  getCellSummaryOperationDefinitions(): CellSummaryOperation[];
7
8
  showCellSummaryPopup(): void;
9
+ setCurrentCellSummaryOperation(operation: SummaryOperation | string): void;
8
10
  }
@@ -4,6 +4,7 @@ exports.CellSummaryApiImpl = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("./ApiBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
7
+ const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
7
8
  class CellSummaryApiImpl extends ApiBase_1.ApiBase {
8
9
  getCurrentCellSummaryOperation() {
9
10
  return this.getAdaptableState().System.CellSummaryOperation;
@@ -14,5 +15,8 @@ class CellSummaryApiImpl extends ApiBase_1.ApiBase {
14
15
  showCellSummaryPopup() {
15
16
  this.showModulePopup(ModuleConstants.CellSummaryModuleId);
16
17
  }
18
+ setCurrentCellSummaryOperation(operation) {
19
+ this.dispatchAction(SystemRedux.SystemCellSummaryChangeOperation(operation));
20
+ }
17
21
  }
18
22
  exports.CellSummaryApiImpl = CellSummaryApiImpl;
@@ -1,159 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LicenseService = exports.LicenseValidityType = void 0;
4
- const tslib_1 = require("tslib");
5
- const SystemRedux_1 = require("../../Redux/ActionsReducers/SystemRedux");
6
- const PopupRedux_1 = require("../../Redux/ActionsReducers/PopupRedux");
7
- const ObjectFactory_1 = tslib_1.__importDefault(require("../ObjectFactory"));
8
- const LoggingHelper_1 = require("../Helpers/LoggingHelper");
9
- const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
10
- const DocumentationLinkConstants_1 = require("../Constants/DocumentationLinkConstants");
11
- const decode_1 = require("../license/decode");
12
- const EMAIL = 'sales@adaptabletools.com';
13
- const COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE = 10;
14
- const DAY_IN_MS = 1000 * 60 * 60 * 24;
15
- var LicenseValidityType;
16
- (function (LicenseValidityType) {
17
- LicenseValidityType["INVALID_LICENSE"] = "INVALID_LICENSE";
18
- LicenseValidityType["NO_LICENSE"] = "NO_LICENSE";
19
- LicenseValidityType["NON_PRODUCTION_VALID"] = "NON_PRODUCTION_VALID";
20
- LicenseValidityType["NON_PRODUCTION_EXPIRED_IN_SCOPE"] = "NON_PRODUCTION_EXPIRED_IN_SCOPE";
21
- LicenseValidityType["NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE"] = "NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE";
22
- LicenseValidityType["COMMERCIAL_VALID"] = "COMMERCIAL_VALID";
23
- LicenseValidityType["COMMERCIAL_EXPIRED_IN_SCOPE"] = "COMMERCIAL_EXPIRED_IN_SCOPE";
24
- LicenseValidityType["COMMERCIAL_EXPIRED_OUT_OF_SCOPE"] = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE";
25
- })(LicenseValidityType = exports.LicenseValidityType || (exports.LicenseValidityType = {}));
26
- const SANDPACK_REGEX = /(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g;
27
- const SANDBOX_REGEX = /(https):\/\/\S+(\.csb\.app)/g;
28
- const origin = typeof window !== 'undefined' ? window.location.origin : '';
29
- const isInsideSandpack = () => {
30
- const [_fullUrl, protocol, sandpackUrl] = Array.from(SANDPACK_REGEX.exec(origin) || []);
31
- return protocol === 'https' && sandpackUrl === 'sandpack.codesandbox.io';
32
- };
33
- const isInsideSandbox = () => {
34
- const [_fullUrl, protocol, sandboxUrl] = Array.from(SANDBOX_REGEX.exec(origin) || []);
35
- return protocol === 'https' && sandboxUrl === '.csb.app';
36
- };
37
- class LicenseService {
38
- constructor(adaptable, licenseKey, packageDetails) {
39
- this.adaptable = adaptable;
40
- this.adaptable = adaptable;
41
- let details = null;
42
- if (licenseKey) {
43
- try {
44
- details = decode_1.decode(licenseKey);
45
- }
46
- catch (error) {
47
- details = error;
48
- }
49
- }
50
- if (!isInsideSandpack() && !isInsideSandbox()) {
51
- this.handleLicenseValidation(details, this.getValidityType(details, packageDetails));
52
- }
53
- }
54
- getValidityType(details, packageDetails) {
55
- if (!details) {
56
- return LicenseValidityType.NO_LICENSE;
57
- }
58
- if (details instanceof Error) {
59
- return LicenseValidityType.INVALID_LICENSE;
60
- }
61
- const currentVersionReleaseDate = new Date(packageDetails.publishedAt);
62
- const licenseEndDate = new Date(details.end);
63
- const currentDate = new Date();
64
- const isExpired = licenseEndDate < currentDate;
65
- const isTrial = details.trial;
66
- const isScope = licenseEndDate > currentVersionReleaseDate;
67
- let validityType = null;
68
- if (isExpired) {
69
- if (isScope) {
70
- if (isTrial) {
71
- validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_IN_SCOPE;
72
- }
73
- else {
74
- validityType = LicenseValidityType.COMMERCIAL_EXPIRED_IN_SCOPE;
75
- }
76
- }
77
- else {
78
- if (isTrial) {
79
- validityType = LicenseValidityType.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE;
80
- }
81
- else {
82
- validityType = LicenseValidityType.COMMERCIAL_EXPIRED_OUT_OF_SCOPE;
83
- }
84
- }
85
- }
86
- else {
87
- if (isTrial) {
88
- validityType = LicenseValidityType.NON_PRODUCTION_VALID;
89
- }
90
- else {
91
- validityType = LicenseValidityType.COMMERCIAL_VALID;
92
- }
93
- }
94
- return validityType;
95
- }
96
- handleLicenseValidation(details, validityType) {
97
- var _a;
98
- const nowAtMidnight = new Date();
99
- nowAtMidnight.setHours(0, 0, 0, 0);
100
- let daysLeft = 0;
101
- if (!(details instanceof Error) && (details === null || details === void 0 ? void 0 : details.end)) {
102
- daysLeft = Math.floor((((_a = details === null || details === void 0 ? void 0 : details.end) === null || _a === void 0 ? void 0 : _a.getTime()) - nowAtMidnight.getTime()) / DAY_IN_MS);
103
- daysLeft = clamp_1.default(daysLeft, 0, Infinity);
104
- }
105
- const annotateMessage = (message, link = DocumentationLinkConstants_1.LicenseDocsLink, email = EMAIL, days = daysLeft) => {
106
- return message.replace('[LINK]', link).replace('[EMAIL]', email).replace('[DAYS]', `${days}`);
107
- };
108
- switch (validityType) {
109
- case 'NO_LICENSE':
110
- case 'NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE':
111
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('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');
112
- this.showNotification('No AdapTable License found.');
113
- this.showWatermark('This instance of AdapTable does not have a license, and some functionality has therefore been removed.');
114
- this.disableStatePersistence();
115
- break;
116
- case 'INVALID_LICENSE':
117
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('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');
118
- this.showNotification('Corrupted AdapTable License found.');
119
- this.showWatermark('This instance of AdapTable has a corrupted License, and some functionality has therefore been removed.');
120
- this.disableStatePersistence();
121
- break;
122
- case 'NON_PRODUCTION_VALID':
123
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('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');
124
- break;
125
- case 'NON_PRODUCTION_EXPIRED_IN_SCOPE':
126
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('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');
127
- this.showWatermark('AdapTable License has expired');
128
- break;
129
- case 'COMMERCIAL_VALID':
130
- if (daysLeft <= COMMERCIAL_LICENSE_SHOW_INFO_DAYS_BEFORE_EXPIRE) {
131
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage(`This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`), 'Info');
132
- }
133
- break;
134
- case 'COMMERCIAL_EXPIRED_IN_SCOPE':
135
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable license has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)'), 'Warning');
136
- break;
137
- case 'COMMERCIAL_EXPIRED_OUT_OF_SCOPE':
138
- LoggingHelper_1.ConsoleLogByMessageType(annotateMessage('This AdapTable license has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.'), 'Error');
139
- this.showNotification('Adaptable License has expired');
140
- this.showWatermark('Adaptable License has expired');
141
- break;
142
- }
143
- }
144
- showNotification(text) {
145
- this.adaptable.api.internalApi.dispatchReduxAction(PopupRedux_1.PopupShowAlert({
146
- header: 'License Error',
147
- message: text,
148
- alertDefinition: ObjectFactory_1.default.CreateInternalAlertDefinitionForMessages('Error'),
149
- }));
150
- }
151
- showWatermark(text) {
152
- this.adaptable.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemLicenseShowWatermark(text));
153
- }
154
- disableStatePersistence() {
155
- this.adaptable.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemLicenseDisablePersistence());
156
- }
157
- destroy() { }
158
- }
159
- exports.LicenseService = LicenseService;
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=require("../Helpers/LoggingHelper"),i=e.__importDefault(require("lodash/clamp")),n=require("../Constants/DocumentationLinkConstants"),r=require("../license/decode"),c="sales@adaptabletools.com",l=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 E=/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g,I=/(https):\/\/\S+(\.csb\.app)/g,_=/(https):\/\/\S+(\.adaptabletools\.com)/g,O="undefined"!=typeof window?window.location.origin:"",h=()=>{const[e,a,t]=Array.from(E.exec(O)||[]);return"https"===a&&"sandpack.codesandbox.io"===t},u=()=>{const[e,a,t]=Array.from(I.exec(O)||[]);return"https"===a&&".csb.app"===t},L=()=>{const[e,a,t]=Array.from(_.exec(O)||[]);return"https"===a&&".adaptabletools.com"===t};class A{constructor(e,a,t){this.adaptable=e,this.adaptable=e;let s=null;if(a)try{s=r.decode(a)}catch(e){s=e}h()||u()||L()||this.handleLicenseValidation(s,this.getValidityType(s,t))}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 r=0;e instanceof Error||!(null==e?void 0:e.end)||(r=Math.floor(((null===(t=null==e?void 0:e.end)||void 0===t?void 0:t.getTime())-s.getTime())/864e5),r=i.default(r,0,1/0));const l=(e,a=n.LicenseDocsLink,t=c,s=r)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[DAYS]",`${s}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":o.ConsoleLogByMessageType(l("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":o.ConsoleLogByMessageType(l("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":o.ConsoleLogByMessageType(l("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":o.ConsoleLogByMessageType(l("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":r<=10&&o.ConsoleLogByMessageType(l("This AdapTable license expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)"),"Info");break;case"COMMERCIAL_EXPIRED_IN_SCOPE":o.ConsoleLogByMessageType(l("This AdapTable license 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":o.ConsoleLogByMessageType(l("This AdapTable license 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(t.PopupShowAlert({header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseShowWatermark(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction(a.SystemLicenseDisablePersistence())}destroy(){}}exports.LicenseService=A;
@@ -1,67 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decode = exports.fieldsToLicenseDetails = void 0;
4
- const hashing_1 = require("./hashing");
5
- const getGenericError = () => new Error('Invalid License');
6
- exports.fieldsToLicenseDetails = (fields) => {
7
- var _a;
8
- const fieldsMap = fields.reduce((acc, field) => {
9
- acc.set(field.name, field.value);
10
- return acc;
11
- }, new Map());
12
- const details = {
13
- count: fieldsMap.get('DeveloperCount') ? Number(fieldsMap.get('DeveloperCount')) : 0,
14
- start: new Date(fieldsMap.get('StartDate')),
15
- end: new Date(fieldsMap.get('EndDate')),
16
- owner: fieldsMap.get('Owner'),
17
- timestamp: fieldsMap.get('TS') ? Number(fieldsMap.get('TS')) : 0,
18
- trial: fieldsMap.get('Trial') === 'true' ? true : false,
19
- ref: (_a = fieldsMap.get('Ref')) !== null && _a !== void 0 ? _a : '',
20
- };
21
- if (!details.start ||
22
- !details.end ||
23
- !details.owner ||
24
- typeof details.trial !== 'boolean' ||
25
- !details.ref) {
26
- throw getGenericError();
27
- }
28
- return details;
29
- };
30
- exports.decode = (licenseKey) => {
31
- let crc = '';
32
- let fields = licenseKey.split('|').map((part) => {
33
- let [name, value] = part.split('=');
34
- if (name === 'C') {
35
- crc = value;
36
- }
37
- return {
38
- name,
39
- value,
40
- };
41
- });
42
- if (!crc) {
43
- throw getGenericError();
44
- }
45
- const crcParts = crc.split(',').reverse();
46
- const overallCrc = crcParts.pop();
47
- crcParts.forEach((fieldCrc, index) => {
48
- const field = fields[index];
49
- if (hashing_1.compute_string(field.value) !== fieldCrc) {
50
- throw getGenericError();
51
- }
52
- });
53
- const fieldsWithoutC = [...fields];
54
- fieldsWithoutC.pop();
55
- const fieldsWithoutCString = fieldsWithoutC
56
- .map((field) => {
57
- return `${field.name}=${field.value}`;
58
- })
59
- .join('|');
60
- if (hashing_1.compute_string(fieldsWithoutCString) !== overallCrc) {
61
- throw getGenericError();
62
- }
63
- fields = fields.map((f) => {
64
- return Object.assign(Object.assign({}, f), { value: decodeURI(f.value) });
65
- });
66
- return exports.fieldsToLicenseDetails(fields);
67
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.decode=exports.fieldsToLicenseDetails=void 0;const e=require("./hashing"),t=()=>new Error("Invalid License");exports.fieldsToLicenseDetails=e=>{var r;const o=e.reduce(((e,t)=>(e.set(t.name,t.value),e)),new Map),s={count:o.get("DeveloperCount")?Number(o.get("DeveloperCount")):0,start:new Date(o.get("StartDate")),end:new Date(o.get("EndDate")),owner:o.get("Owner"),timestamp:o.get("TS")?Number(o.get("TS")):0,trial:"true"===o.get("Trial"),ref:null!==(r=o.get("Ref"))&&void 0!==r?r:""};if(!(s.start&&s.end&&s.owner&&"boolean"==typeof s.trial&&s.ref))throw t();return s},exports.decode=r=>{let o="",s=r.split("|").map((e=>{let[t,r]=e.split("=");return"C"===t&&(o=r),{name:t,value:r}}));if(!o)throw t();const n=o.split(",").reverse(),a=n.pop();n.forEach(((r,o)=>{const n=s[o];if(e.compute_string(n.value)!==r)throw t()}));const i=[...s];i.pop();const l=i.map((e=>`${e.name}=${e.value}`)).join("|");if(e.compute_string(l)!==a)throw t();return s=s.map((e=>Object.assign(Object.assign({},e),{value:decodeURI(e.value)}))),exports.fieldsToLicenseDetails(s)};
@@ -1,47 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compute_string = void 0;
4
- const DEFAULT_ReversedPolynomial = 0xedb88320;
5
- /*
6
- * CRC-32 implementation
7
- */
8
- function generate(reversedPolynomial = DEFAULT_ReversedPolynomial) {
9
- var table = new Array();
10
- var i, j, n;
11
- for (i = 0; i < 256; i++) {
12
- n = i;
13
- for (j = 8; j > 0; j--) {
14
- if ((n & 1) == 1) {
15
- n = (n >>> 1) ^ reversedPolynomial;
16
- }
17
- else {
18
- n = n >>> 1;
19
- }
20
- }
21
- table[i] = n;
22
- }
23
- return table;
24
- }
25
- function crc32_initial() {
26
- return 0xffffffff;
27
- }
28
- function crc32_add_byte(table, crc, byte) {
29
- crc = (crc >>> 8) ^ table[byte ^ (crc & 0x000000ff)];
30
- return crc;
31
- }
32
- function crc32_final(crc) {
33
- crc = ~crc;
34
- crc = crc < 0 ? 0xffffffff + crc + 1 : crc;
35
- return crc;
36
- }
37
- function compute_string(str, reversedPolynomial = DEFAULT_ReversedPolynomial) {
38
- var table = generate(reversedPolynomial);
39
- var crc = 0;
40
- var i;
41
- crc = crc32_initial();
42
- for (i = 0; i < str.length; i++)
43
- crc = crc32_add_byte(table, crc, str.charCodeAt(i));
44
- crc = crc32_final(crc);
45
- return `${crc}`;
46
- }
47
- exports.compute_string = compute_string;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compute_string=void 0;const r=3988292384;function t(r=3988292384){var t,e,n,o=new Array;for(t=0;t<256;t++){for(n=t,e=8;e>0;e--)1==(1&n)?n=n>>>1^r:n>>>=1;o[t]=n}return o}function e(){return 4294967295}function n(r,t,e){return t=t>>>8^r[e^255&t]}function o(r){return r=(r=~r)<0?4294967295+r+1:r}function u(r,u=3988292384){var c,i=t(u),f=0;for(f=e(),c=0;c<r.length;c++)f=n(i,f,r.charCodeAt(c));return`${f=o(f)}`}exports.compute_string=u;
@@ -15,6 +15,7 @@ exports.renderAlertBehaviourSummary = (alert, api, allowWrap = false) => {
15
15
  const values = [
16
16
  AlertProperties.PreventEdit ? { label: 'Prevent Cell Edit', id: 'preventCellEdit' } : null,
17
17
  AlertProperties.HighlightCell ? { label: 'Highlight Cell', id: 'highlightCell' } : null,
18
+ AlertProperties.HighlightRow ? { label: 'Highlight Row', id: 'highlightRow' } : null,
18
19
  AlertProperties.JumpToCell ? { label: 'Jump To Cell', id: 'jumptocell' } : null,
19
20
  AlertProperties.ShowInDiv
20
21
  ? {
@@ -1,65 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LicenseWatermark = void 0;
4
- const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
6
- const Logo_1 = require("../../components/Logo");
7
- const rebass_1 = require("rebass");
8
- const style = {
9
- border: '1px solid var(--ab-color-error)',
10
- padding: '5px',
11
- fontWeight: 600,
12
- margin: '5px',
13
- fontSize: '14px',
14
- alignItems: 'center',
15
- color: 'var(--ab-color-text-on-defaultbackground)',
16
- background: 'var(--ab-color-defaultbackground)',
17
- };
18
- const isStyleValid = (element) => {
19
- const notAllowedProperties = [
20
- ['display', 'none'],
21
- ['opacity', '0'],
22
- ['position', 'absolute'],
23
- ['position', 'fixed'],
24
- ['position', 'relative'],
25
- ['visibility', 'hidden'],
26
- ];
27
- for (const [prop, value] of notAllowedProperties) {
28
- if (element.style[prop] === value) {
29
- return false;
30
- }
31
- }
32
- return true;
33
- };
34
- exports.LicenseWatermark = (props) => {
35
- const ref = React.useRef(null);
36
- React.useEffect(() => {
37
- const checkWatermark = () => {
38
- var _a, _b;
39
- if (!((_a = ref.current) === null || _a === void 0 ? void 0 : _a.isConnected)) {
40
- alert('It is not allowed to remove the Adaptable watermark.');
41
- }
42
- if (!isStyleValid(ref.current)) {
43
- alert('It is not allowed to modify the Adaptable watermark.');
44
- }
45
- if ((_b = ref === null || ref === void 0 ? void 0 : ref.current) === null || _b === void 0 ? void 0 : _b.style) {
46
- ref.current.style.border = style.border;
47
- ref.current.style.padding = style.padding;
48
- ref.current.style.fontWeight = `${style.fontWeight}`;
49
- ref.current.style.margin = style.margin;
50
- ref.current.style.fontSize = style.fontSize;
51
- ref.current.style.color = style.color;
52
- ref.current.style.background = style.background;
53
- ref.current.style.display = 'flex';
54
- ref.current.style.position = 'static';
55
- ref.current.style.opacity = '1';
56
- ref.current.style.visibility = 'visible';
57
- }
58
- };
59
- const timerId = setInterval(checkWatermark, 5000);
60
- return () => clearTimeout(timerId);
61
- }, []);
62
- return (React.createElement(rebass_1.Flex, { style: style, ref: ref },
63
- React.createElement(Logo_1.Logo, { style: { marginRight: 10 } }),
64
- React.createElement("div", null, props.children)));
65
- };
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseWatermark=void 0;const e=require("tslib"),t=e.__importStar(require("react")),r=require("../../components/Logo"),o=require("rebass"),n={border:"1px solid var(--ab-color-error)",padding:"5px",fontWeight:600,margin:"5px",fontSize:"14px",alignItems:"center",color:"var(--ab-color-text-on-defaultbackground)",background:"var(--ab-color-defaultbackground)"},i=e=>{const t=[["display","none"],["opacity","0"],["position","absolute"],["position","fixed"],["position","relative"],["visibility","hidden"]];for(const[r,o]of t)if(e.style[r]===o)return!1;return!0};exports.LicenseWatermark=e=>{const l=t.useRef(null);return t.useEffect((()=>{const e=setInterval((()=>{var e,t;(null===(e=l.current)||void 0===e?void 0:e.isConnected)||alert("It is not allowed to remove the Adaptable watermark."),i(l.current)||alert("It is not allowed to modify the Adaptable watermark."),(null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.style)&&(l.current.style.border=n.border,l.current.style.padding=n.padding,l.current.style.fontWeight=`${n.fontWeight}`,l.current.style.margin=n.margin,l.current.style.fontSize=n.fontSize,l.current.style.color=n.color,l.current.style.background=n.background,l.current.style.display="flex",l.current.style.position="static",l.current.style.opacity="1",l.current.style.visibility="visible")}),5e3);return()=>clearTimeout(e)}),[]),t.createElement(o.Flex,{style:n,ref:l},t.createElement(r.Logo,{style:{marginRight:10}}),t.createElement("div",null,e.children))};
@@ -2892,7 +2892,7 @@ class Adaptable {
2892
2892
  const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(abColumn);
2893
2893
  if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
2894
2894
  if (formatColumn.ColumnStyle.PercentBarStyle) {
2895
- return this.agGridHelper.createNumericStyleRendererFunc(formatColumn);
2895
+ return this.agGridHelper.createPercentBarRendererComp(formatColumn);
2896
2896
  }
2897
2897
  if (formatColumn.ColumnStyle.CheckBoxStyle) {
2898
2898
  return this.agGridHelper.createCheckboxRendererComp(abColumn.columnId, abColumn.readOnly);
@@ -0,0 +1,3 @@
1
+ import { FormatColumn } from '../PredefinedConfig/FormatColumnState';
2
+ import { AdaptableApi } from '../Api/AdaptableApi';
3
+ export declare const getPercentBarRendererForColumn: (formatColumn: FormatColumn, api: AdaptableApi) => any;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPercentBarRendererForColumn = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
6
+ const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
7
+ const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/FormatHelper"));
8
+ exports.getPercentBarRendererForColumn = (formatColumn, api) => {
9
+ var _a;
10
+ if (!((_a = formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.PercentBarStyle)) {
11
+ return;
12
+ }
13
+ return class PercentBarRenderer {
14
+ init(params) {
15
+ if (!formatColumn.IncludeGroupedRows && api.gridApi.isGroupRowNode(params.node)) {
16
+ return;
17
+ }
18
+ const min = api.formatColumnApi.getNumericStyleMinValue(formatColumn.ColumnStyle, params.node, params.value);
19
+ const max = api.formatColumnApi.getNumericStyleMaxValue(formatColumn.ColumnStyle, params.node, params.value);
20
+ let value = params.value;
21
+ if (Helper_1.default.objectNotExists(value)) {
22
+ value = 0;
23
+ }
24
+ const clampedValue = clamp_1.default(value, min, max);
25
+ const percentageValue = ((clampedValue - min) / (max - min)) * 100;
26
+ let cellBackColor;
27
+ const percentBarStyle = formatColumn.ColumnStyle.PercentBarStyle;
28
+ if (percentBarStyle.ColumnComparison) {
29
+ cellBackColor = percentBarStyle.ColumnComparison.Color;
30
+ }
31
+ else {
32
+ const matchingRange = percentBarStyle.CellRanges.find((r) => r.Min <= clampedValue && r.Max >= clampedValue);
33
+ if (matchingRange) {
34
+ cellBackColor = matchingRange.Color;
35
+ }
36
+ }
37
+ if (cellBackColor) {
38
+ this.eGui = document.createElement('div');
39
+ this.eGui.className = 'ab-PercentBar__wrapper';
40
+ this.eGui.style.height = percentBarStyle.CellText ? '80%' : '100%';
41
+ this.eGui.style.display = 'flex';
42
+ this.eGui.style.flexDirection = 'column';
43
+ this.eGui.style.justifyContent = 'center';
44
+ const barEl = document.createElement('div');
45
+ barEl.className = 'ab-PercentBar__bar';
46
+ barEl.style.background = percentBarStyle.BackColor;
47
+ barEl.style.flex = '1';
48
+ const barInsideEl = document.createElement('div');
49
+ barInsideEl.className = 'ab-PercentBar__barInside';
50
+ barInsideEl.style.background = cellBackColor;
51
+ barInsideEl.style.height = '100%';
52
+ barInsideEl.style.width = `${percentageValue.toFixed(0)}%`;
53
+ barEl.append(barInsideEl);
54
+ this.eGui.append(barEl);
55
+ if (percentBarStyle.CellText) {
56
+ const textEl = document.createElement('div');
57
+ textEl.className = 'ab-PercentBar__text';
58
+ textEl.style.lineHeight = '1.2';
59
+ if (percentBarStyle.CellText.includes('CellValue')) {
60
+ if (formatColumn.DisplayFormat) {
61
+ const options = formatColumn.DisplayFormat
62
+ .Options;
63
+ if (options) {
64
+ value = FormatHelper_1.default.NumberFormatter(params.value, options);
65
+ }
66
+ }
67
+ textEl.innerText = value;
68
+ }
69
+ if (percentBarStyle.CellText.includes('PercentageValue')) {
70
+ textEl.innerText += ' ' + `(${percentageValue.toFixed(0)}%)`;
71
+ }
72
+ this.eGui.append(textEl);
73
+ }
74
+ }
75
+ }
76
+ getGui() {
77
+ return this.eGui;
78
+ }
79
+ refresh(params) {
80
+ return true;
81
+ }
82
+ };
83
+ };
@@ -22,7 +22,7 @@ export declare class agGridHelper {
22
22
  setUpModules(): Map<AdaptableModule, IModule>;
23
23
  TrySetUpNodeIds(): boolean;
24
24
  createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
25
- createNumericStyleRendererFunc(formatColumn: FormatColumn): ICellRendererFunc;
25
+ createPercentBarRendererComp(formatColumn: FormatColumn): ICellRendererFunc;
26
26
  getCleanValue(value: string): string | undefined;
27
27
  getRenderedValue(colDef: ColDef, valueToRender: any): any;
28
28
  createAdaptableColumnFromAgGridColumn(agGridColumn: Column, colsToGroups: Record<string, AdaptableColumnGroup>): AdaptableColumn;