@adaptabletools/adaptable 13.0.0-canary.1 → 13.0.0-canary.10
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/agGrid.d.ts +23 -1
- package/agGrid.js +23 -1
- package/base.css +1 -0
- package/bundle.cjs.js +169 -169
- package/index.css +1 -0
- package/package.json +3 -3
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +7 -3
- package/src/AdaptableOptions/AdaptableOptions.d.ts +0 -2
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +108 -23
- package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +32 -0
- package/src/AdaptableOptions/FinsemblePluginOptions.js +2 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +5 -0
- package/src/Api/ConditionalStyleApi.d.ts +20 -42
- package/src/Api/ConfigApi.d.ts +1 -2
- package/src/Api/FinsembleApi.d.ts +10 -0
- package/src/Api/FinsembleApi.js +2 -0
- package/src/Api/FormatColumnApi.d.ts +47 -3
- package/src/Api/Implementation/ColumnApiImpl.js +3 -3
- package/src/Api/Implementation/DashboardApiImpl.js +2 -3
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +18 -1
- package/src/Api/Implementation/FormatColumnApiImpl.js +97 -14
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -0
- package/src/Api/Implementation/InternalApiImpl.js +4 -0
- package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -0
- package/src/Api/Implementation/PluginsApiImpl.js +6 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +0 -2
- package/src/Api/Implementation/QueryLanguageApiImpl.js +0 -3
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -2
- package/src/Api/Implementation/ToolPanelApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ToolPanelApiImpl.js +8 -0
- package/src/Api/InternalApi.d.ts +1 -0
- package/src/Api/PluginsApi.d.ts +5 -0
- package/src/Api/QueryLanguageApi.d.ts +0 -5
- package/src/Api/ToolPanelApi.d.ts +10 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +37 -37
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +10 -19
- package/src/PredefinedConfig/FormatColumnState.d.ts +19 -6
- package/src/PredefinedConfig/PredefinedConfig.d.ts +1 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +14 -0
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +43 -1
- package/src/Redux/Store/AdaptableStore.js +2 -0
- package/src/Strategy/ConditionalStyleModule.d.ts +2 -0
- package/src/Strategy/ConditionalStyleModule.js +6 -0
- package/src/Strategy/DataChangeHistoryModule.d.ts +1 -0
- package/src/Strategy/DataChangeHistoryModule.js +12 -0
- package/src/Strategy/FormatColumnModule.d.ts +4 -9
- package/src/Strategy/FormatColumnModule.js +52 -2
- package/src/Strategy/Interface/IModule.d.ts +11 -10
- package/src/Strategy/Utilities/Alert/getAlertBehaviourViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +3 -4
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +6 -10
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +3 -2
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -0
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +3 -1
- package/src/Utilities/Extensions/TypeExtensions.d.ts +1 -0
- package/src/Utilities/Extensions/TypeExtensions.js +5 -0
- package/src/Utilities/ObjectFactory.js +0 -1
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +14 -4
- package/src/Utilities/Services/{LicenseService.d.ts → LicenseService/index.d.ts} +3 -3
- package/src/Utilities/Services/LicenseService/index.js +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.d.ts +1 -0
- package/src/Utilities/Services/LicenseService/shouldLogThankYouMessage.js +15 -0
- package/src/Utilities/Services/QueryLanguageService.d.ts +3 -3
- package/src/Utilities/Services/QueryLanguageService.js +88 -39
- package/src/Utilities/license/LicenseDetails.d.ts +1 -1
- package/src/Utilities/license/decode.d.ts +1 -0
- package/src/Utilities/license/decode.js +1 -1
- package/src/View/AdaptablePopover/index.d.ts +2 -2
- package/src/View/AdaptableView.d.ts +3 -3
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/Components/FormBox.d.ts +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +1 -1
- package/src/View/AdaptableWizardView/index.d.ts +1 -1
- package/src/View/ColorPicker.d.ts +1 -5
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonEdit.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.d.ts +2 -1
- package/src/View/Components/EntityRulesEditor/index.js +29 -19
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +1 -0
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/TopBar.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupPrompt.d.ts +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +4 -0
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +5 -2
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +2 -0
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +18 -0
- package/src/View/FormatColumn/MoveFormatColumn.d.ts +7 -0
- package/src/View/FormatColumn/MoveFormatColumn.js +27 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +29 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +20 -2
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +0 -22
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +13 -0
- package/src/View/FormatColumn/Wizard/constants.d.ts +1 -0
- package/src/View/FormatColumn/Wizard/constants.js +4 -0
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.d.ts +2 -2
- package/src/View/License/LicenseWatermark.d.ts +1 -1
- package/src/View/StateManagement/components/ClearButton.d.ts +1 -1
- package/src/View/StateManagement/components/LoadButton.d.ts +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +4 -4
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +3 -3
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/View/Wizard/OnePageWizards.d.ts +3 -3
- package/src/View/Wizard/OnePageWizards.js +2 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +1 -0
- package/src/agGrid/ActionColumnRenderer.js +5 -5
- package/src/agGrid/Adaptable.d.ts +13 -2
- package/src/agGrid/Adaptable.js +142 -85
- package/src/agGrid/FilterWrapper.js +5 -5
- package/src/agGrid/FloatingFilterWrapper.js +3 -4
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -0
- package/src/agGrid/createAgStatusPanelComponent.js +3 -3
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.js +3 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +1 -0
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +3 -3
- package/src/components/CheckBox/index.d.ts +1 -1
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/Dialog/index.d.ts +4 -2
- package/src/components/Dialog/index.js +2 -2
- package/src/components/DropdownButton/index.d.ts +21 -4
- package/src/components/DropdownButton/index.js +5 -6
- package/src/components/ExpressionEditor/BaseEditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +1 -1
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +1 -1
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +4 -2
- package/src/components/Loader/Loader.d.ts +2 -2
- package/src/components/Logo/index.d.ts +1 -1
- package/src/components/Modal/index.d.ts +1 -1
- package/src/components/PopupWithFooter.d.ts +2 -2
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/src/components/SelectList.d.ts +1 -1
- package/src/components/SimpleButton/index.d.ts +4 -5
- package/src/components/SimpleButton/index.js +3 -2
- package/src/components/StylePreview.d.ts +1 -1
- package/src/components/Tag/Tag.d.ts +1 -1
- package/src/components/Textarea/index.d.ts +6 -4
- package/src/components/ToggleButton/index.d.ts +1 -1
- package/src/components/WindowModal/WindowModal.d.ts +1 -1
- package/src/components/icons/index.d.ts +3 -2
- package/src/components/icons/layout.d.ts +2 -1
- package/src/components/utils/useContainerScrollObserver/index.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +100 -64
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +6 -3
- package/src/renderReactRoot.d.ts +3 -0
- package/src/renderReactRoot.js +54 -0
- package/src/types.d.ts +4 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Services/LicenseService.js +0 -1
|
@@ -22,11 +22,11 @@ export interface ExpressionContext extends BaseContext {
|
|
|
22
22
|
/**
|
|
23
23
|
* All Expression Functions available to AdaptableQL
|
|
24
24
|
*/
|
|
25
|
-
functions: ExpressionFunctionMap
|
|
25
|
+
functions: ExpressionFunctionMap<string>;
|
|
26
26
|
/**
|
|
27
27
|
* Expression Functions available to AdaptableQL in (optional) WHERE clause
|
|
28
28
|
*/
|
|
29
|
-
whereClauseFunctions?: ExpressionFunctionMap
|
|
29
|
+
whereClauseFunctions?: ExpressionFunctionMap<string>;
|
|
30
30
|
/**
|
|
31
31
|
* Optional filter function to be applied before evaluating the expression
|
|
32
32
|
*/
|
|
@@ -40,7 +40,10 @@ export interface ExpressionContext extends BaseContext {
|
|
|
40
40
|
*/
|
|
41
41
|
evaluateCustomQueryVariable: (functionName: string, args?: any[]) => any;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Key-Value map of Expression Names and their implementation
|
|
45
|
+
*/
|
|
46
|
+
export declare type ExpressionFunctionMap<T extends string> = Record<T | string, ExpressionFunction>;
|
|
44
47
|
/**
|
|
45
48
|
* Defines an AdaptableQL Function used in an Adaptable Expression
|
|
46
49
|
*/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderReactRoot = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
6
|
+
//@ts-ignore
|
|
7
|
+
// import * as ReactDOMClient from 'react-dom/client';
|
|
8
|
+
const originalConsoleError = console.error;
|
|
9
|
+
const doRenderReactRoot = (el, container) => {
|
|
10
|
+
// if ((ReactDOMClient || {}).createRoot) {
|
|
11
|
+
// const root = ReactDOMClient.createRoot(container);
|
|
12
|
+
// root.render(el);
|
|
13
|
+
// return () => {
|
|
14
|
+
// root.unmount();
|
|
15
|
+
// };
|
|
16
|
+
// }
|
|
17
|
+
ReactDOM.render(el, container);
|
|
18
|
+
return () => {
|
|
19
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
function capture() {
|
|
23
|
+
console.error = (message, ...optionalParams) => {
|
|
24
|
+
if (message &&
|
|
25
|
+
typeof message === 'string' &&
|
|
26
|
+
message.includes('Warning: ReactDOM.render is no longer supported in React 18.')) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return originalConsoleError.call(console, message, ...optionalParams);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function release() {
|
|
33
|
+
console.error = originalConsoleError;
|
|
34
|
+
}
|
|
35
|
+
const renderReactRoot = (el, container, supressReact18RenderWarning) => {
|
|
36
|
+
if (supressReact18RenderWarning) {
|
|
37
|
+
capture();
|
|
38
|
+
}
|
|
39
|
+
const unmount = doRenderReactRoot(el, container);
|
|
40
|
+
if (supressReact18RenderWarning) {
|
|
41
|
+
release();
|
|
42
|
+
}
|
|
43
|
+
return () => {
|
|
44
|
+
// probably capturing not needed for unmount to be honest ...
|
|
45
|
+
if (supressReact18RenderWarning) {
|
|
46
|
+
capture();
|
|
47
|
+
}
|
|
48
|
+
unmount();
|
|
49
|
+
if (supressReact18RenderWarning) {
|
|
50
|
+
release();
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
exports.renderReactRoot = renderReactRoot;
|
package/src/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { AdaptableNoCodeWizardOptions, IAdaptableNoCodeWizard, } from './Ad
|
|
|
3
3
|
export type { BooleanFunctionName } from './Utilities/ExpressionFunctions/booleanExpressionFunctions';
|
|
4
4
|
export type { ScalarFunctionName } from './Utilities/ExpressionFunctions/scalarExpressionFunctions';
|
|
5
5
|
export type { ObservableFunctionName } from './Utilities/ExpressionFunctions/observableExpressionFunctions';
|
|
6
|
-
export type {
|
|
6
|
+
export type { AggregatedBooleanFunctionName } from './Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions';
|
|
7
7
|
export type { AggregatedScalarFunctionName } from './Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions';
|
|
8
8
|
export type { AdaptableOptions } from './AdaptableOptions/AdaptableOptions';
|
|
9
9
|
export { AdaptablePlugin } from './AdaptableOptions/AdaptablePlugin';
|
|
@@ -21,6 +21,7 @@ export type { IPushPullPluginOptions } from './AdaptableOptions/IPushPullPluginO
|
|
|
21
21
|
export type { LayoutOptions, LayoutViewOptions, LayoutTagOptions, LayoutAvailableContext, AutoGenerateTagsForLayoutsContext, LayoutAssociatedObject, } from './AdaptableOptions/LayoutOptions';
|
|
22
22
|
export type { OpenFinPluginOptions } from './AdaptableOptions/OpenFinPluginOptions';
|
|
23
23
|
export type { MasterDetailPluginOptions } from './AdaptableOptions/MasterDetailPluginOptions';
|
|
24
|
+
export type { FinsemblePluginOptions, FinsemblePluginStateOptions, } from './AdaptableOptions/FinsemblePluginOptions';
|
|
24
25
|
export type { FinancePluginOptions, WeightedAverageColumn, FDC3Column, InstrumentColumn, PositionColumn, CountryColumn, InstrumentIntent, InstrumentIntents, PositionIntent, PositionIntents, ContactIntent, ContactIntents, CountryIntent, CountryIntents, ContactColumn, OrganizationColumn, OrganizationIntent, OrganizationIntents, FDC3Intent, RaiseFDC3IntentContext, FDC3DesktopAgent, CustomFDC3Column, CustomFDC3Intent, } from './AdaptableOptions/FinancePluginOptions';
|
|
25
26
|
export type { DateInputOptions } from './AdaptableOptions/DateInputOptions';
|
|
26
27
|
export type { FilterOptions } from './AdaptableOptions/FilterOptions';
|
|
@@ -37,7 +38,7 @@ export type { UserInterfaceOptions, BasePermittedValues, PermittedValues, EditLo
|
|
|
37
38
|
export type { MenuOptions } from './AdaptableOptions/MenuOptions';
|
|
38
39
|
export type { CustomSettingsPanel, SettingsPanelOptions, } from './AdaptableOptions/SettingsPanelOptions';
|
|
39
40
|
export type { EntitlementOptions, EntitlementContext } from './AdaptableOptions/EntitlementOptions';
|
|
40
|
-
export type { ExpressionOptions, ModuleExpressionFunctions, AdaptableQLOptions, CustomQueryVariableContext, } from './AdaptableOptions/AdaptableQLOptions';
|
|
41
|
+
export type { ExpressionOptions, ModuleExpressionFunctions, ModuleExpressionFunctionsMap, GlobalExpressionFunctionsContext, EvaluateExpressionExternallyContext, ModuleExpressionFunctionsContext, AdaptableQLOptions, CustomQueryVariableContext, } from './AdaptableOptions/AdaptableQLOptions';
|
|
41
42
|
export type { DataChangeHistoryOptions, DataChangeHistoryButton, DataChangeHistoryContext, AdaptableDataChangeHistoryAction, } from './AdaptableOptions/DataChangeHistoryOptions';
|
|
42
43
|
export type { LayoutAssociatedObjectLoadConfig } from './Api/Implementation/ApiBase';
|
|
43
44
|
export type { AdaptableApi } from './Api/AdaptableApi';
|
|
@@ -58,6 +59,7 @@ export type { DataChangeHistoryApi } from './Api/DataChangeHistoryApi';
|
|
|
58
59
|
export type { ExportApi } from './Api/ExportApi';
|
|
59
60
|
export type { FilterApi } from './Api/FilterApi';
|
|
60
61
|
export type { FinanceApi } from './Api/FinanceApi';
|
|
62
|
+
export type { FinsembleApi } from './Api/FinsembleApi';
|
|
61
63
|
export type { FlashingCellApi } from './Api/FlashingCellApi';
|
|
62
64
|
export type { FormatColumnApi } from './Api/FormatColumnApi';
|
|
63
65
|
export type { FreeTextColumnApi } from './Api/FreeTextColumnApi';
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "13.0.0-canary.
|
|
1
|
+
declare const _default: "13.0.0-canary.10";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '13.0.0-canary.
|
|
3
|
+
exports.default = '13.0.0-canary.10'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|
|
@@ -1 +0,0 @@
|
|
|
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=(0,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=(0,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":(0,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":(0,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":(0,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":(0,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&&(0,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":(0,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":(0,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((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=A;
|