@adaptabletools/adaptable-cjs 18.1.14 → 18.1.15-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -5
- package/src/AdaptableOptions/AlertOptions.d.ts +2 -1
- package/src/AdaptableOptions/ChartingOptions.d.ts +5 -1
- package/src/AdaptableOptions/ColumnFilterOptions.d.ts +5 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +5 -1
- package/src/AdaptableOptions/FlashingCellOptions.d.ts +5 -1
- package/src/AdaptableOptions/LayoutOptions.d.ts +5 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +6 -2
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +5 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -1
- package/src/Api/ChartingApi.d.ts +2 -2
- package/src/Api/ColumnApi.d.ts +6 -0
- package/src/Api/ConfigApi.d.ts +22 -2
- package/src/Api/Events/LiveDataChanged.d.ts +1 -1
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ChartingApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ChartingApiImpl.js +2 -2
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +3 -0
- package/src/Api/Implementation/ConfigApiImpl.d.ts +4 -1
- package/src/Api/Implementation/ConfigApiImpl.js +16 -1
- package/src/Api/Implementation/EntitlementApiImpl.d.ts +4 -1
- package/src/Api/Implementation/EntitlementApiImpl.js +31 -6
- package/src/Api/Implementation/ExportApiImpl.js +5 -7
- package/src/Api/Implementation/GridApiImpl.js +1 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +2 -6
- package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -6
- package/src/Api/Internal/AdaptableInternalApi.js +5 -11
- package/src/Api/Internal/EntitlementInternalApi.d.ts +4 -0
- package/src/Api/Internal/EntitlementInternalApi.js +15 -0
- package/src/Api/Internal/ExportInternalApi.d.ts +33 -8
- package/src/Api/Internal/ExportInternalApi.js +577 -5
- package/src/Api/Internal/NamedQueryInternalApi.d.ts +0 -1
- package/src/Api/Internal/NamedQueryInternalApi.js +0 -5
- package/src/PredefinedConfig/AdaptableState.d.ts +0 -5
- package/src/PredefinedConfig/Common/FilterActionOnDataChange.d.ts +2 -1
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/Redux/ActionsReducers/GridRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/GridRedux.js +11 -11
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +3 -3
- package/src/Redux/ActionsReducers/LayoutRedux.js +10 -10
- package/src/Redux/ActionsReducers/NamedQueryRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/NamedQueryRedux.js +1 -1
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +2 -2
- package/src/Redux/ActionsReducers/PluginsRedux.js +3 -3
- package/src/Redux/Store/AdaptableReduxMerger.js +3 -3
- package/src/Redux/Store/AdaptableStore.js +2 -4
- package/src/Strategy/AdaptableModuleBase.js +1 -2
- package/src/Strategy/ColumnFilterModule.js +1 -2
- package/src/Strategy/ExportModule.js +17 -44
- package/src/Strategy/FlashingCellModule.js +2 -10
- package/src/Strategy/ScheduleModule.js +4 -6
- package/src/Strategy/SmartEditModule.js +1 -7
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Strategy/Utilities/Export/getExportColumnsViewItems.js +1 -1
- package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +1 -3
- package/src/Utilities/Constants/FilterConstants.d.ts +10 -0
- package/src/Utilities/Constants/FilterConstants.js +11 -0
- package/src/Utilities/Constants/GeneralConstants.d.ts +41 -4
- package/src/Utilities/Constants/GeneralConstants.js +44 -5
- package/src/Utilities/Defaults/DefaultSettingsPanel.d.ts +0 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -6
- package/src/Utilities/Extensions/ArrayExtensions.d.ts +14 -0
- package/src/Utilities/Extensions/ArrayExtensions.js +68 -1
- package/src/Utilities/Extensions/EnumExtensions.d.ts +0 -4
- package/src/Utilities/Extensions/EnumExtensions.js +3 -15
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +4 -10
- package/src/Utilities/Helpers/AdaptableHelper.js +10 -64
- package/src/Utilities/Helpers/FormatHelper.d.ts +9 -0
- package/src/Utilities/Helpers/FormatHelper.js +26 -14
- package/src/Utilities/Helpers/Helper.d.ts +0 -10
- package/src/Utilities/Helpers/Helper.js +1 -76
- package/src/Utilities/Services/ChartingService.d.ts +2 -2
- package/src/Utilities/Services/ChartingService.js +5 -11
- package/src/Utilities/Services/ModuleService.js +35 -31
- package/src/Utilities/Services/RowEditService.js +1 -6
- package/src/Utilities/Services/RowSummaryService.js +2 -2
- package/src/Utilities/Services/ValidationService.js +2 -16
- package/src/View/Alert/AlertEmptyView.js +1 -2
- package/src/View/Charting/ChartingStatusBarPopover.js +1 -2
- package/src/View/Charting/useChartingElements.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectCompactList.js +2 -6
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -12
- package/src/View/Components/ModuleValueSelector/index.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -5
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupBody.js +1 -3
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +2 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -7
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +6 -12
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +3 -23
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -5
- package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -3
- package/src/View/Components/ValueSelector/index.js +2 -2
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +2 -2
- package/src/View/Dashboard/CustomDashboardButton.js +1 -6
- package/src/View/Dashboard/CustomToolbar.js +2 -9
- package/src/View/Dashboard/Dashboard.js +2 -4
- package/src/View/Dashboard/DashboardPopup.js +1 -3
- package/src/View/Dashboard/DashboardToolbarFactory.js +1 -2
- package/src/View/Dashboard/PinnedToolbarsSelector.js +1 -2
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -3
- package/src/View/Export/ExportViewPanel.js +2 -4
- package/src/View/Export/Wizard/ReportSummaryWizard.js +2 -6
- package/src/View/GridFilter/GridFilterExpressionEditor.js +2 -2
- package/src/View/GridFilter/useGridFilterExpressionEditor.js +2 -6
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/PivotDetailsPopoup.js +1 -7
- package/src/View/Layout/SaveLayoutButton.js +1 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +2 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/SystemStatus/SystemStatusPopup.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +2 -2
- package/src/agGrid/ActionColumnRenderer.js +8 -22
- package/src/agGrid/AdaptableAgGrid.d.ts +5 -7
- package/src/agGrid/AdaptableAgGrid.js +152 -144
- package/src/agGrid/AgGridAdapter.d.ts +0 -1
- package/src/agGrid/AgGridAdapter.js +7 -10
- package/src/agGrid/AgGridColumnAdapter.d.ts +3 -1
- package/src/agGrid/AgGridColumnAdapter.js +39 -13
- package/src/agGrid/BadgeRenderer.js +4 -22
- package/src/agGrid/FloatingFilterWrapper.js +21 -0
- package/src/agGrid/buildSortedColumnStateForLayout.d.ts +1 -1
- package/src/agGrid/buildSortedColumnStateForLayout.js +2 -2
- package/src/agGrid/defaultAdaptableOptions.js +35 -30
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -15
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +84 -8
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +9 -9
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Redux/ActionsReducers/QueryRedux.d.ts +0 -10
- package/src/Redux/ActionsReducers/QueryRedux.js +0 -25
- package/src/Utilities/Helpers/FormatContentHelper.d.ts +0 -22
- package/src/Utilities/Helpers/FormatContentHelper.js +0 -39
- package/src/Utilities/Services/EntitlementService.d.ts +0 -14
- package/src/Utilities/Services/EntitlementService.js +0 -67
- package/src/Utilities/Services/Interface/IEntitlementService.d.ts +0 -10
- package/src/Utilities/Services/Interface/IEntitlementService.js +0 -2
- package/src/Utilities/Services/Interface/IReportService.d.ts +0 -27
- package/src/Utilities/Services/Interface/IReportService.js +0 -2
- package/src/Utilities/Services/ReportService.d.ts +0 -41
- package/src/Utilities/Services/ReportService.js +0 -608
- package/src/Utilities/isAdaptableObject.d.ts +0 -2
- package/src/Utilities/isAdaptableObject.js +0 -8
- package/src/Utilities/reorder.d.ts +0 -1
- package/src/Utilities/reorder.js +0 -17
- package/src/Utilities/sortWithOrder.d.ts +0 -11
- package/src/Utilities/sortWithOrder.js +0 -54
|
@@ -4,7 +4,6 @@ exports.TeamSharingModule = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
6
6
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
7
|
-
const isAdaptableObject_1 = require("../Utilities/isAdaptableObject");
|
|
8
7
|
const TeamSharingRedux_1 = require("../Redux/ActionsReducers/TeamSharingRedux");
|
|
9
8
|
const TeamSharingRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/TeamSharingRedux"));
|
|
10
9
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
@@ -14,6 +13,7 @@ const TeamSharingApplyButton_1 = require("../View/TeamSharing/TeamSharingApplyBu
|
|
|
14
13
|
const SharedEntityDependencies_1 = require("../View/TeamSharing/SharedEntityDependencies");
|
|
15
14
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
|
|
16
15
|
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
16
|
+
const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/AdaptableHelper"));
|
|
17
17
|
class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
18
18
|
constructor(api) {
|
|
19
19
|
super(ModuleConstants.TeamSharingModuleId, ModuleConstants.TeamSharingFriendlyName, 'folder-shared', 'TeamSharingPopup', 'Team Sharing allows users to share - at run-time - Adaptable Objects between colleagues.', api);
|
|
@@ -78,7 +78,7 @@ class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
78
78
|
if (!action) {
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
return Object.values(action).find((actionProperty) =>
|
|
81
|
+
return Object.values(action).find((actionProperty) => AdaptableHelper_1.default.isAdaptableObject(actionProperty));
|
|
82
82
|
}
|
|
83
83
|
isAdaptableObjectPresentInLocalState(sharedEntity) {
|
|
84
84
|
var _a;
|
|
@@ -4,7 +4,7 @@ exports.getExportColumnsViewItems = void 0;
|
|
|
4
4
|
const getExportColumnsViewItems = (report, api) => {
|
|
5
5
|
return {
|
|
6
6
|
name: 'Columns',
|
|
7
|
-
values: [...api.internalApi.
|
|
7
|
+
values: [...api.exportApi.internalApi.getReportColumnScopeShortDescription(report)],
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
exports.getExportColumnsViewItems = getExportColumnsViewItems;
|
|
@@ -11,9 +11,7 @@ const getExportRowsViewItems = (report, api) => {
|
|
|
11
11
|
element = React.createElement(ExpressionPreview_1.ExpressionPreview, { query: report.Query });
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
element = api.internalApi
|
|
15
|
-
.getReportService()
|
|
16
|
-
.GetReportExpressionDescription(report, api.columnApi.getColumns());
|
|
14
|
+
element = api.exportApi.internalApi.getReportExpressionDescription(report, api.columnApi.getColumns());
|
|
17
15
|
}
|
|
18
16
|
return {
|
|
19
17
|
name: 'Rows',
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplyFilterAction } from '../../PredefinedConfig/Common/FilterActionOnDataChange';
|
|
2
|
+
import { FilterTrigger } from '../../AdaptableOptions/ColumnFilterOptions';
|
|
3
|
+
export declare const FILTER_ACTION_ALWAYS: ApplyFilterAction;
|
|
4
|
+
export declare const FILTER_ACTION_NEVER: ApplyFilterAction;
|
|
5
|
+
export declare const FILTER_ACTION_THROTTLE: ApplyFilterAction;
|
|
6
|
+
export declare const PREDICATE_EQUALS = "Equals";
|
|
7
|
+
export declare const PREDICATE_CONTAINS = "Contains";
|
|
8
|
+
export declare const PREDICATE_ON = "On";
|
|
9
|
+
export declare const FILTER_TRIGGER_MOUSE_ENTER: FilterTrigger;
|
|
10
|
+
export declare const FILTER_TRIGGER_CLICK: FilterTrigger;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FILTER_TRIGGER_CLICK = exports.FILTER_TRIGGER_MOUSE_ENTER = exports.PREDICATE_ON = exports.PREDICATE_CONTAINS = exports.PREDICATE_EQUALS = exports.FILTER_ACTION_THROTTLE = exports.FILTER_ACTION_NEVER = exports.FILTER_ACTION_ALWAYS = void 0;
|
|
4
|
+
exports.FILTER_ACTION_ALWAYS = 'Always';
|
|
5
|
+
exports.FILTER_ACTION_NEVER = 'Never';
|
|
6
|
+
exports.FILTER_ACTION_THROTTLE = 'Throttle';
|
|
7
|
+
exports.PREDICATE_EQUALS = 'Equals';
|
|
8
|
+
exports.PREDICATE_CONTAINS = 'Contains';
|
|
9
|
+
exports.PREDICATE_ON = 'On';
|
|
10
|
+
exports.FILTER_TRIGGER_MOUSE_ENTER = 'mouseenter';
|
|
11
|
+
exports.FILTER_TRIGGER_CLICK = 'click';
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
2
2
|
import { AdaptableTheme } from '../../PredefinedConfig/ThemeState';
|
|
3
3
|
import { AdaptableMessageType } from '../../PredefinedConfig/Common/AdaptableMessageType';
|
|
4
|
-
import { AdaptableColumnType } from '../../PredefinedConfig/Common/Types';
|
|
4
|
+
import { AdaptableColumnType, AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
5
|
+
import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
|
|
6
|
+
import { DataChangeDetectionPolicy } from '../../AdaptableOptions/AlertOptions';
|
|
7
|
+
import { ToastPositions, ToastTransitions } from '../../AdaptableOptions/NotificationsOptions';
|
|
8
|
+
import { FlashTarget } from '../../AdaptableOptions/FlashingCellOptions';
|
|
9
|
+
import { DashboardButtonsLocation } from '../../AdaptableOptions/DashboardOptions';
|
|
10
|
+
import { PopupType } from '../../AdaptableOptions/SettingsPanelOptions';
|
|
11
|
+
import { SaveChartBehaviour } from '../../AdaptableOptions/ChartingOptions';
|
|
12
|
+
import { DisplayRowGroups } from '../../AdaptableOptions/LayoutOptions';
|
|
5
13
|
export declare const AUTOGENERATED_PK_COLUMN: string;
|
|
6
14
|
export declare const MISSING_COLUMN: string;
|
|
7
15
|
export declare const DEFAULT_LAYOUT: string;
|
|
@@ -11,6 +19,8 @@ export declare const OS_THEME: string;
|
|
|
11
19
|
export declare const USER_NAME: string;
|
|
12
20
|
export declare const ADAPTABLE_ID: string;
|
|
13
21
|
export declare const ADAPTABLE: string;
|
|
22
|
+
export declare const ADAPTABLE_CONTAINER_ID: string;
|
|
23
|
+
export declare const AG_GRID_CONTAINER_ID: string;
|
|
14
24
|
export declare const ADAPTABLE_TOOLPANEL_ID: string;
|
|
15
25
|
export declare const ADAPTABLE_TOOLPANEL_COMPONENT: string;
|
|
16
26
|
export declare const AGGRID_TOOLPANEL_FILTERS: string;
|
|
@@ -18,9 +28,6 @@ export declare const AGGRID_TOOLPANEL_COLUMNS: string;
|
|
|
18
28
|
export declare const MENU_PREFIX: string;
|
|
19
29
|
export declare const READ_ONLY_STYLE: string;
|
|
20
30
|
export declare const ALL_COLUMN_VALUES: string;
|
|
21
|
-
export declare const FILTER_ALWAYS: 'Always' | 'Never' | 'Throttle';
|
|
22
|
-
export declare const FILTER_NEVER: 'Always' | 'Never' | 'Throttle';
|
|
23
|
-
export declare const FILTER_THROTTLE: 'Always' | 'Never' | 'Throttle';
|
|
24
31
|
export declare const EMPTY_STRING: string;
|
|
25
32
|
export declare const EMPTY_ARRAY: any[];
|
|
26
33
|
export declare const AB_SPECIAL_COLUMN: AdaptableColumnType;
|
|
@@ -40,6 +47,36 @@ export declare const BLANK_DISTINCT_COLUMN_VALUE = "[BLANKS]";
|
|
|
40
47
|
export declare const DEFAULT_STRING_DISPLAY_VALUE = "Hello World";
|
|
41
48
|
export declare const DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
|
|
42
49
|
export declare const DEFAULT_DOUBLE_DISPLAY_VALUE = 12345.6789;
|
|
50
|
+
export declare const RAW_VALUE_DATA_CHANGE_DETECTION_POLICY: DataChangeDetectionPolicy;
|
|
51
|
+
export declare const TOAST_POSITIONS_BOTTOM_RIGHT: ToastPositions;
|
|
52
|
+
export declare const TOAST_TRANSITIONS_SLIDE: ToastTransitions;
|
|
53
|
+
export declare const NOTIFICATION_DURATION = 3000;
|
|
54
|
+
export declare const NOTIFICATION_MAX_SYSTEM_MESSAGES = 100;
|
|
55
|
+
export declare const QUICK_SEARCH_PLACEHOLDER = "Search";
|
|
56
|
+
export declare const DASHBOARD_BUTTONS_LOCATION_LEFT: DashboardButtonsLocation;
|
|
57
|
+
export declare const DASHBOARD_BUTTONS_LOCATION_RIGHT: DashboardButtonsLocation;
|
|
58
|
+
export declare const ENGLISH_VARIANT = "GB";
|
|
59
|
+
export declare const LOADING_SCREEN_DELAY = 200;
|
|
60
|
+
export declare const LOADING_SCREEN_TITLE = "Initialising Grid";
|
|
61
|
+
export declare const LOADING_SCREEN_TEXT = "Retrieving your settings and setting up the grid...";
|
|
62
|
+
export declare const DATE_INPUT_DATE_FORMAT = "yyyy-MM-dd";
|
|
63
|
+
export declare const FLASHING_TARGET_CELL: FlashTarget;
|
|
64
|
+
export declare const FLASHING_TARGET_ROW: FlashTarget;
|
|
65
|
+
export declare const ICON_CONFIGURATION = "ConfigurationIcon";
|
|
66
|
+
export declare const POPUP_TYPE_MODAL: PopupType;
|
|
67
|
+
export declare const POPUP_TYPE_WINDOW: PopupType;
|
|
68
|
+
export declare const SAVE_CHART_BEHAVIOUR_AUTO: SaveChartBehaviour;
|
|
69
|
+
export declare const SAVE_CHART_BEHAVIOUR_MANUAL: SaveChartBehaviour;
|
|
70
|
+
export declare const SAVE_CHART_BEHAVIOUR_NONE: SaveChartBehaviour;
|
|
71
|
+
export declare const DISPLAY_ROW_GROUPS_DYNAMIC: DisplayRowGroups;
|
|
72
|
+
export declare const DISPLAY_ROW_GROUPS_EXPANDED: DisplayRowGroups;
|
|
73
|
+
export declare const DISPLAY_ROW_GROUPS_CLOSED: DisplayRowGroups;
|
|
74
|
+
export declare const FDC3_ACTION_COLUMN_DEFAULT_COLUMN_ID = "fdc3ActionColumn";
|
|
75
|
+
export declare const FDC3_ACTION_COLUMN_DEFAULT_HEADER_NAME = "FDC3 Actions";
|
|
76
|
+
export declare const ACCESS_LEVEL_READONLY: AccessLevel;
|
|
77
|
+
export declare const ACCESS_LEVEL_HIDDEN: AccessLevel;
|
|
78
|
+
export declare const ACCESS_LEVEL_FULL: AccessLevel;
|
|
79
|
+
export declare const STANDALONE_MODULE_POPUPS: AdaptableModule[];
|
|
43
80
|
export declare const SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE: number;
|
|
44
81
|
export declare const QUICK_SEARCH_DEFAULT_BACK_COLOR: string;
|
|
45
82
|
export declare const QUICK_SEARCH_DEFAULT_FORE_COLOR: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = void 0;
|
|
3
|
+
exports.DATE_INPUT_DATE_FORMAT = exports.LOADING_SCREEN_TEXT = exports.LOADING_SCREEN_TITLE = exports.LOADING_SCREEN_DELAY = exports.ENGLISH_VARIANT = exports.DASHBOARD_BUTTONS_LOCATION_RIGHT = exports.DASHBOARD_BUTTONS_LOCATION_LEFT = exports.QUICK_SEARCH_PLACEHOLDER = exports.NOTIFICATION_MAX_SYSTEM_MESSAGES = exports.NOTIFICATION_DURATION = exports.TOAST_TRANSITIONS_SLIDE = exports.TOAST_POSITIONS_BOTTOM_RIGHT = exports.RAW_VALUE_DATA_CHANGE_DETECTION_POLICY = exports.DEFAULT_DOUBLE_DISPLAY_VALUE = exports.DEFAULT_INTEGER_DISPLAY_VALUE = exports.DEFAULT_STRING_DISPLAY_VALUE = exports.BLANK_DISTINCT_COLUMN_VALUE = exports.DEFAULT_DATE_FORMAT_PATTERN_WITH_TIME = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_FDC3_ACTION_COLUMN_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.GROUP_PATH_SEPARATOR = exports.HALF_SECOND = exports.AB_FDC3_COLUMN = exports.AB_ROW_ACTIONS_COLUMN = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.AG_GRID_CONTAINER_ID = exports.ADAPTABLE_CONTAINER_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.OS_THEME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
4
|
+
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.STANDALONE_MODULE_POPUPS = exports.ACCESS_LEVEL_FULL = exports.ACCESS_LEVEL_HIDDEN = exports.ACCESS_LEVEL_READONLY = exports.FDC3_ACTION_COLUMN_DEFAULT_HEADER_NAME = exports.FDC3_ACTION_COLUMN_DEFAULT_COLUMN_ID = exports.DISPLAY_ROW_GROUPS_CLOSED = exports.DISPLAY_ROW_GROUPS_EXPANDED = exports.DISPLAY_ROW_GROUPS_DYNAMIC = exports.SAVE_CHART_BEHAVIOUR_NONE = exports.SAVE_CHART_BEHAVIOUR_MANUAL = exports.SAVE_CHART_BEHAVIOUR_AUTO = exports.POPUP_TYPE_WINDOW = exports.POPUP_TYPE_MODAL = exports.ICON_CONFIGURATION = exports.FLASHING_TARGET_ROW = exports.FLASHING_TARGET_CELL = void 0;
|
|
5
5
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
6
6
|
const UIHelper_1 = require("../../View/UIHelper");
|
|
7
7
|
exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
|
|
@@ -13,6 +13,8 @@ exports.OS_THEME = 'os';
|
|
|
13
13
|
exports.USER_NAME = 'anonymous';
|
|
14
14
|
exports.ADAPTABLE_ID = 'adaptable_id';
|
|
15
15
|
exports.ADAPTABLE = 'AdapTable';
|
|
16
|
+
exports.ADAPTABLE_CONTAINER_ID = 'adaptable';
|
|
17
|
+
exports.AG_GRID_CONTAINER_ID = 'grid';
|
|
16
18
|
exports.ADAPTABLE_TOOLPANEL_ID = 'adaptable';
|
|
17
19
|
exports.ADAPTABLE_TOOLPANEL_COMPONENT = 'AdaptableToolPanel';
|
|
18
20
|
// from https://www.ag-grid.com/javascript-data-grid/side-bar/#string-configuration
|
|
@@ -21,9 +23,6 @@ exports.AGGRID_TOOLPANEL_COLUMNS = 'columns';
|
|
|
21
23
|
exports.MENU_PREFIX = 'ab_';
|
|
22
24
|
exports.READ_ONLY_STYLE = 'ab_readonly';
|
|
23
25
|
exports.ALL_COLUMN_VALUES = 'ALL_COLUMN_VALUES';
|
|
24
|
-
exports.FILTER_ALWAYS = 'Always';
|
|
25
|
-
exports.FILTER_NEVER = 'Never';
|
|
26
|
-
exports.FILTER_THROTTLE = 'Throttle';
|
|
27
26
|
exports.EMPTY_STRING = '';
|
|
28
27
|
exports.EMPTY_ARRAY = [];
|
|
29
28
|
exports.AB_SPECIAL_COLUMN = 'abSpecialColumn';
|
|
@@ -43,6 +42,46 @@ exports.BLANK_DISTINCT_COLUMN_VALUE = '[BLANKS]';
|
|
|
43
42
|
exports.DEFAULT_STRING_DISPLAY_VALUE = 'Hello World';
|
|
44
43
|
exports.DEFAULT_INTEGER_DISPLAY_VALUE = 12345;
|
|
45
44
|
exports.DEFAULT_DOUBLE_DISPLAY_VALUE = 12345.6789;
|
|
45
|
+
exports.RAW_VALUE_DATA_CHANGE_DETECTION_POLICY = 'rawValue';
|
|
46
|
+
exports.TOAST_POSITIONS_BOTTOM_RIGHT = 'BottomRight';
|
|
47
|
+
exports.TOAST_TRANSITIONS_SLIDE = 'Slide';
|
|
48
|
+
exports.NOTIFICATION_DURATION = 3000;
|
|
49
|
+
exports.NOTIFICATION_MAX_SYSTEM_MESSAGES = 100;
|
|
50
|
+
exports.QUICK_SEARCH_PLACEHOLDER = 'Search';
|
|
51
|
+
exports.DASHBOARD_BUTTONS_LOCATION_LEFT = 'left';
|
|
52
|
+
exports.DASHBOARD_BUTTONS_LOCATION_RIGHT = 'right';
|
|
53
|
+
// User Interface
|
|
54
|
+
exports.ENGLISH_VARIANT = 'GB';
|
|
55
|
+
exports.LOADING_SCREEN_DELAY = 200;
|
|
56
|
+
exports.LOADING_SCREEN_TITLE = 'Initialising Grid';
|
|
57
|
+
exports.LOADING_SCREEN_TEXT = 'Retrieving your settings and setting up the grid...';
|
|
58
|
+
exports.DATE_INPUT_DATE_FORMAT = 'yyyy-MM-dd';
|
|
59
|
+
// Flashing Cell
|
|
60
|
+
exports.FLASHING_TARGET_CELL = 'cell';
|
|
61
|
+
exports.FLASHING_TARGET_ROW = 'row';
|
|
62
|
+
exports.ICON_CONFIGURATION = 'ConfigurationIcon';
|
|
63
|
+
exports.POPUP_TYPE_MODAL = 'modal';
|
|
64
|
+
exports.POPUP_TYPE_WINDOW = 'window';
|
|
65
|
+
exports.SAVE_CHART_BEHAVIOUR_AUTO = 'auto';
|
|
66
|
+
exports.SAVE_CHART_BEHAVIOUR_MANUAL = 'manual';
|
|
67
|
+
exports.SAVE_CHART_BEHAVIOUR_NONE = 'none';
|
|
68
|
+
// Layout
|
|
69
|
+
exports.DISPLAY_ROW_GROUPS_DYNAMIC = 'dynamic';
|
|
70
|
+
exports.DISPLAY_ROW_GROUPS_EXPANDED = 'expanded';
|
|
71
|
+
exports.DISPLAY_ROW_GROUPS_CLOSED = 'closed';
|
|
72
|
+
// FDC3 defaults
|
|
73
|
+
exports.FDC3_ACTION_COLUMN_DEFAULT_COLUMN_ID = 'fdc3ActionColumn';
|
|
74
|
+
exports.FDC3_ACTION_COLUMN_DEFAULT_HEADER_NAME = 'FDC3 Actions';
|
|
75
|
+
// Entitlement Defaults
|
|
76
|
+
exports.ACCESS_LEVEL_READONLY = 'ReadOnly';
|
|
77
|
+
exports.ACCESS_LEVEL_HIDDEN = 'Hidden';
|
|
78
|
+
exports.ACCESS_LEVEL_FULL = 'Full';
|
|
79
|
+
// Standalone Popups
|
|
80
|
+
exports.STANDALONE_MODULE_POPUPS = [
|
|
81
|
+
'BulkUpdate',
|
|
82
|
+
'SmartEdit',
|
|
83
|
+
'CellSummary',
|
|
84
|
+
];
|
|
46
85
|
/*
|
|
47
86
|
Redux / State Defaults
|
|
48
87
|
Try to put all our Redux / State defaults here and ONLY reference from here - avoid magic numbers / strings.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { AdaptableSettingsPanel } from '../../PredefinedConfig/Common/Types';
|
|
2
|
-
import { AdaptableModule } from '../../types';
|
|
3
|
-
export declare const STANDALONE_MODULE_POPUPS: AdaptableModule[];
|
|
4
2
|
/**
|
|
5
3
|
* This constants determines the order and the items that appear in the navigation.
|
|
6
4
|
*/
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_SETTINGS_PANEL_NAVIGATION_ITEMS =
|
|
4
|
-
exports.STANDALONE_MODULE_POPUPS = [
|
|
5
|
-
'BulkUpdate',
|
|
6
|
-
'SmartEdit',
|
|
7
|
-
'CellSummary',
|
|
8
|
-
];
|
|
3
|
+
exports.DEFAULT_SETTINGS_PANEL_NAVIGATION_ITEMS = void 0;
|
|
9
4
|
/**
|
|
10
5
|
* This constants determines the order and the items that appear in the navigation.
|
|
11
6
|
*/
|
|
@@ -33,6 +33,18 @@ export declare function sortCellValueArrayDates(cellValues: GridCell[], sortOrde
|
|
|
33
33
|
export declare function groupArrayBy(array: Array<any>, prop: string): Array<any>;
|
|
34
34
|
export declare function createCommaSeparatedString(values: any[]): string;
|
|
35
35
|
export declare function SumArray(array: (number | undefined)[]): number;
|
|
36
|
+
export declare function reorderArray(array: any[], startIndex: number, endIndex: number): any[];
|
|
37
|
+
export declare function sortArrayWithOrder<T>(array: T[], order: T[],
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* The array can contain items which are not listed in the order array.
|
|
41
|
+
* So sortUnorderedItems decides whether to leave these items untouched
|
|
42
|
+
* in the current order in which they are in the array (sortUnorderedItems: false)
|
|
43
|
+
* or to sort them using normal comparison rules
|
|
44
|
+
*/
|
|
45
|
+
{ sortUnorderedItems: sortUnorderedItems }: {
|
|
46
|
+
sortUnorderedItems: boolean;
|
|
47
|
+
}): T[];
|
|
36
48
|
export declare const ArrayExtensions: {
|
|
37
49
|
GetLength: typeof GetLength;
|
|
38
50
|
CorrectLength: typeof CorrectLength;
|
|
@@ -67,5 +79,7 @@ export declare const ArrayExtensions: {
|
|
|
67
79
|
sortArrayWithProperty: typeof sortArrayWithProperty;
|
|
68
80
|
createCommaSeparatedString: typeof createCommaSeparatedString;
|
|
69
81
|
SumArray: typeof SumArray;
|
|
82
|
+
reorderArray: typeof reorderArray;
|
|
83
|
+
sortArrayWithOrder: typeof sortArrayWithOrder;
|
|
70
84
|
};
|
|
71
85
|
export default ArrayExtensions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArrayExtensions = exports.SumArray = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
3
|
+
exports.ArrayExtensions = exports.sortArrayWithOrder = exports.reorderArray = exports.SumArray = exports.createCommaSeparatedString = exports.groupArrayBy = exports.sortCellValueArrayDates = exports.sortCellValueArrayNumeric = exports.sortCellValueArray = exports.sortArray = exports.sortArrayWithProperty = exports.areArraysEqualWithOrderandProperties = exports.areArraysEqualWithOrder = exports.areArraysNotEqual = exports.areArraysEqual = exports.moveArray = exports.hasItemsOfCount = exports.hasOneItem = exports.getOccurrence = exports.HasSingleEmptyValue = exports.IsNotNullOrEmptyNorContainsSingleEmptyValue = exports.IsNullOrEmptyOrContainsSingleEmptyValue = exports.IsNotNullOrEmpty = exports.IsNullOrEmpty = exports.IsNotEmpty = exports.IsEmpty = exports.IsNotNull = exports.IsNull = exports.RetrieveDistinct = exports.NotContainsItem = exports.ContainsAnyItem = exports.ContainsItem = exports.AddItem = exports.NotCorrectLength = exports.CorrectLength = exports.GetLength = void 0;
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
5
|
function GetLength(arrayToCheck) {
|
|
6
6
|
return IsNotNull(arrayToCheck) ? arrayToCheck.length : 0;
|
|
@@ -293,6 +293,71 @@ function SumArray(array) {
|
|
|
293
293
|
return array.filter((num) => typeof num === 'number' && !isNaN(num)).reduce((a, b) => a + b, 0);
|
|
294
294
|
}
|
|
295
295
|
exports.SumArray = SumArray;
|
|
296
|
+
function reorderArray(array, startIndex, endIndex) {
|
|
297
|
+
const result = [...array];
|
|
298
|
+
if (startIndex > array.length - 1) {
|
|
299
|
+
// not much that we can do if the dragged item is out of bounds...
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
if (endIndex > array.length - 1) {
|
|
303
|
+
endIndex = array.length - 1;
|
|
304
|
+
}
|
|
305
|
+
const [removed] = result.splice(startIndex, 1);
|
|
306
|
+
result.splice(endIndex, 0, removed);
|
|
307
|
+
return result;
|
|
308
|
+
}
|
|
309
|
+
exports.reorderArray = reorderArray;
|
|
310
|
+
function sortArrayWithOrder(array, order,
|
|
311
|
+
/**
|
|
312
|
+
*
|
|
313
|
+
* The array can contain items which are not listed in the order array.
|
|
314
|
+
* So sortUnorderedItems decides whether to leave these items untouched
|
|
315
|
+
* in the current order in which they are in the array (sortUnorderedItems: false)
|
|
316
|
+
* or to sort them using normal comparison rules
|
|
317
|
+
*/
|
|
318
|
+
{ sortUnorderedItems: sortUnorderedItems }) {
|
|
319
|
+
const itemsToIndex = array.reduce((acc, x, i) => {
|
|
320
|
+
acc.set(x, i);
|
|
321
|
+
return acc;
|
|
322
|
+
}, new Map());
|
|
323
|
+
const orderItemsToIndex = order.reduce((acc, x, i) => {
|
|
324
|
+
acc.set(x, i);
|
|
325
|
+
return acc;
|
|
326
|
+
}, new Map());
|
|
327
|
+
function compareItemsOfCustomSort(valueA, valueB) {
|
|
328
|
+
const orderContainsFirstElement = orderItemsToIndex.has(valueA);
|
|
329
|
+
const indexInOrderOfFirstElement = orderContainsFirstElement
|
|
330
|
+
? orderItemsToIndex.get(valueA)
|
|
331
|
+
: -1;
|
|
332
|
+
const orderContainsSecondElement = orderItemsToIndex.has(valueB);
|
|
333
|
+
const indexInOrderSecondElement = orderContainsSecondElement
|
|
334
|
+
? orderItemsToIndex.get(valueB)
|
|
335
|
+
: -1;
|
|
336
|
+
//if none of the element are in the order list we just return normal compare
|
|
337
|
+
if (!orderContainsFirstElement && !orderContainsSecondElement) {
|
|
338
|
+
if (!sortUnorderedItems) {
|
|
339
|
+
// keep the original order
|
|
340
|
+
return itemsToIndex.get(valueA) - itemsToIndex.get(valueB);
|
|
341
|
+
}
|
|
342
|
+
if (valueA == valueB) {
|
|
343
|
+
return 0;
|
|
344
|
+
}
|
|
345
|
+
return valueA < valueB ? -1 : 1;
|
|
346
|
+
}
|
|
347
|
+
//if first item not in the list make sure we put it after the second item
|
|
348
|
+
if (!orderContainsFirstElement) {
|
|
349
|
+
return 1;
|
|
350
|
+
}
|
|
351
|
+
//if second item not in the list make sure we put it after the first item
|
|
352
|
+
if (!orderContainsSecondElement) {
|
|
353
|
+
return -1;
|
|
354
|
+
}
|
|
355
|
+
//return the comparison from the list if the two items are in the list
|
|
356
|
+
return indexInOrderOfFirstElement - indexInOrderSecondElement;
|
|
357
|
+
}
|
|
358
|
+
return [].concat(array).sort(compareItemsOfCustomSort);
|
|
359
|
+
}
|
|
360
|
+
exports.sortArrayWithOrder = sortArrayWithOrder;
|
|
296
361
|
exports.ArrayExtensions = {
|
|
297
362
|
GetLength,
|
|
298
363
|
CorrectLength,
|
|
@@ -327,5 +392,7 @@ exports.ArrayExtensions = {
|
|
|
327
392
|
sortArrayWithProperty,
|
|
328
393
|
createCommaSeparatedString,
|
|
329
394
|
SumArray,
|
|
395
|
+
reorderArray,
|
|
396
|
+
sortArrayWithOrder
|
|
330
397
|
};
|
|
331
398
|
exports.default = exports.ArrayExtensions;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
export declare function getNames(e: any): string[];
|
|
2
|
-
export declare function getValues<T extends number>(e: any): T[];
|
|
3
|
-
export declare function getObjValues(e: any): (number | string)[];
|
|
4
2
|
export declare function getCssFontSizeFromFontSizeEnum(fontSize: any): string;
|
|
5
3
|
export declare const EnumExtensions: {
|
|
6
4
|
getNames: typeof getNames;
|
|
7
|
-
getValues: typeof getValues;
|
|
8
|
-
getObjValues: typeof getObjValues;
|
|
9
5
|
getCssFontSizeFromFontSizeEnum: typeof getCssFontSizeFromFontSizeEnum;
|
|
10
6
|
};
|
|
11
7
|
export default EnumExtensions;
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EnumExtensions = exports.getCssFontSizeFromFontSizeEnum = exports.
|
|
3
|
+
exports.EnumExtensions = exports.getCssFontSizeFromFontSizeEnum = exports.getNames = void 0;
|
|
4
4
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
5
|
-
// export function getNamesAndValues<T extends number>(e: any) {
|
|
6
|
-
// return EnumExtensions.getNames(e).map(n => ({ name: n, value: e[n] as T }));
|
|
7
|
-
// }
|
|
8
5
|
function getNames(e) {
|
|
9
|
-
|
|
6
|
+
const vals = Object.keys(e).map((k) => e[k]);
|
|
7
|
+
return vals.filter((v) => typeof v === 'string');
|
|
10
8
|
}
|
|
11
9
|
exports.getNames = getNames;
|
|
12
|
-
function getValues(e) {
|
|
13
|
-
return exports.EnumExtensions.getObjValues(e).filter((v) => typeof v === 'number');
|
|
14
|
-
}
|
|
15
|
-
exports.getValues = getValues;
|
|
16
|
-
function getObjValues(e) {
|
|
17
|
-
return Object.keys(e).map((k) => e[k]);
|
|
18
|
-
}
|
|
19
|
-
exports.getObjValues = getObjValues;
|
|
20
10
|
function getCssFontSizeFromFontSizeEnum(fontSize) {
|
|
21
11
|
switch (fontSize) {
|
|
22
12
|
case Enums_1.FontSize.XLarge:
|
|
@@ -34,8 +24,6 @@ function getCssFontSizeFromFontSizeEnum(fontSize) {
|
|
|
34
24
|
exports.getCssFontSizeFromFontSizeEnum = getCssFontSizeFromFontSizeEnum;
|
|
35
25
|
exports.EnumExtensions = {
|
|
36
26
|
getNames,
|
|
37
|
-
getValues,
|
|
38
|
-
getObjValues,
|
|
39
27
|
getCssFontSizeFromFontSizeEnum,
|
|
40
28
|
};
|
|
41
29
|
exports.default = exports.EnumExtensions;
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import { AdaptableObject } from '../../PredefinedConfig/Common/AdaptableObject';
|
|
2
|
-
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
3
|
-
import { AdaptableComparerFunction } from '../../PredefinedConfig/Common/AdaptableComparerFunction';
|
|
4
2
|
import { PredefinedConfig } from '../../PredefinedConfig/PredefinedConfig';
|
|
5
3
|
import { AccessLevel } from '../../PredefinedConfig/Common/Entitlement';
|
|
6
4
|
export declare function initPredefinedConfigWithUuids(predefinedConfig: PredefinedConfig): PredefinedConfig;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function AdaptableObjectExistsInState(array: AdaptableObject[], itemToCheck: AdaptableObject): boolean;
|
|
9
|
-
export declare function getAppropriateAccessLevel(adaptableObject: AdaptableObject, moduleAccessLevel: AccessLevel): AccessLevel;
|
|
10
|
-
export declare function runAdaptableComparerFunction(columnId: string, columnValues: any[], adaptable: IAdaptable): AdaptableComparerFunction;
|
|
5
|
+
export declare function getAccessLevelForObject(adaptableObject: AdaptableObject, moduleAccessLevel: AccessLevel): AccessLevel;
|
|
11
6
|
export declare function addUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
|
|
12
7
|
export declare function removeUuidAndSource<T extends AdaptableObject>(adaptableObject: T): T;
|
|
8
|
+
export declare function isAdaptableObject(object: unknown): object is AdaptableObject;
|
|
13
9
|
export declare const AdaptableHelper: {
|
|
14
10
|
initPredefinedConfigWithUuids: typeof initPredefinedConfigWithUuids;
|
|
15
|
-
|
|
16
|
-
AdaptableObjectExistsInState: typeof AdaptableObjectExistsInState;
|
|
17
|
-
runAdaptableComparerFunction: typeof runAdaptableComparerFunction;
|
|
18
|
-
getAppropriateAccessLevel: typeof getAppropriateAccessLevel;
|
|
11
|
+
getAccessLevelForObject: typeof getAccessLevelForObject;
|
|
19
12
|
addUuidAndSource: typeof addUuidAndSource;
|
|
20
13
|
removeUuidAndSource: typeof removeUuidAndSource;
|
|
14
|
+
isAdaptableObject: typeof isAdaptableObject;
|
|
21
15
|
};
|
|
22
16
|
export default AdaptableHelper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableHelper = exports.
|
|
3
|
+
exports.AdaptableHelper = exports.isAdaptableObject = exports.removeUuidAndSource = exports.addUuidAndSource = exports.getAccessLevelForObject = exports.initPredefinedConfigWithUuids = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
|
|
6
6
|
const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
|
|
@@ -19,32 +19,7 @@ function initPredefinedConfigWithUuids(predefinedConfig) {
|
|
|
19
19
|
return (0, cloneDeepWith_1.default)(predefinedConfig, customizer);
|
|
20
20
|
}
|
|
21
21
|
exports.initPredefinedConfigWithUuids = initPredefinedConfigWithUuids;
|
|
22
|
-
function
|
|
23
|
-
const pkColumn = adaptable.api.columnApi.getColumnWithColumnId(adaptable.adaptableOptions.primaryKey);
|
|
24
|
-
if (pkColumn == undefined && !adaptable.adaptableOptions.autogeneratePrimaryKey) {
|
|
25
|
-
const errorMessage = `The Primary Key Column '${adaptable.adaptableOptions.primaryKey}' does not exist. This will affect many functions in Adaptable.`;
|
|
26
|
-
if (adaptable.adaptableOptions.alertOptions.showMissingPrimaryKeyAlert == true) {
|
|
27
|
-
// show an alert if that is the option
|
|
28
|
-
adaptable.api.alertApi.showAlertError('No Primary Key', errorMessage);
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
if (adaptable.adaptableOptions.columnOptions.showMissingColumnsWarning == true) {
|
|
32
|
-
adaptable.logger.consoleError(errorMessage);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
exports.checkValidPrimaryKey = checkValidPrimaryKey;
|
|
40
|
-
function AdaptableObjectExistsInState(array, itemToCheck) {
|
|
41
|
-
if (array == null) {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
return array.findIndex((abObject) => abObject.Uuid == itemToCheck.Uuid) > -1;
|
|
45
|
-
}
|
|
46
|
-
exports.AdaptableObjectExistsInState = AdaptableObjectExistsInState;
|
|
47
|
-
function getAppropriateAccessLevel(adaptableObject, moduleAccessLevel) {
|
|
22
|
+
function getAccessLevelForObject(adaptableObject, moduleAccessLevel) {
|
|
48
23
|
// we always return the Module Access Level unless the following condition is met:
|
|
49
24
|
// the object prpoerty has been set and set to true and the Module entitlement is full
|
|
50
25
|
if (moduleAccessLevel == 'Full' &&
|
|
@@ -55,39 +30,7 @@ function getAppropriateAccessLevel(adaptableObject, moduleAccessLevel) {
|
|
|
55
30
|
}
|
|
56
31
|
return moduleAccessLevel;
|
|
57
32
|
}
|
|
58
|
-
exports.
|
|
59
|
-
function runAdaptableComparerFunction(columnId, columnValues, adaptable) {
|
|
60
|
-
return function compareItemsOfCustomSort(valueA, valueB, nodeA, nodeB) {
|
|
61
|
-
let firstElementValueString = nodeA
|
|
62
|
-
? adaptable.getDisplayValueFromRowNode(nodeA, columnId)
|
|
63
|
-
: valueA;
|
|
64
|
-
let secondElementValueString = nodeB
|
|
65
|
-
? adaptable.getDisplayValueFromRowNode(nodeB, columnId)
|
|
66
|
-
: valueB;
|
|
67
|
-
let indexFirstElement = columnValues.indexOf(firstElementValueString);
|
|
68
|
-
let containsFirstElement = indexFirstElement >= 0;
|
|
69
|
-
let indexSecondElement = columnValues.indexOf(secondElementValueString);
|
|
70
|
-
let containsSecondElement = indexSecondElement >= 0;
|
|
71
|
-
//if none of the element are in the list we jsut return normal compare
|
|
72
|
-
if (!containsFirstElement && !containsSecondElement) {
|
|
73
|
-
if (valueA == valueB) {
|
|
74
|
-
return 0;
|
|
75
|
-
}
|
|
76
|
-
return valueA < valueB ? -1 : 1;
|
|
77
|
-
}
|
|
78
|
-
//if first item not in the list make sure we put it after the second item
|
|
79
|
-
if (!containsFirstElement) {
|
|
80
|
-
return 1;
|
|
81
|
-
}
|
|
82
|
-
//if second item not in the list make sure we put it after the first item
|
|
83
|
-
if (!containsSecondElement) {
|
|
84
|
-
return -1;
|
|
85
|
-
}
|
|
86
|
-
//return the comparison from the list if the two items are in the list
|
|
87
|
-
return indexFirstElement - indexSecondElement;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
exports.runAdaptableComparerFunction = runAdaptableComparerFunction;
|
|
33
|
+
exports.getAccessLevelForObject = getAccessLevelForObject;
|
|
91
34
|
function addUuidAndSource(adaptableObject) {
|
|
92
35
|
if (!adaptableObject.Uuid) {
|
|
93
36
|
adaptableObject.Uuid = (0, Uuid_1.createUuid)();
|
|
@@ -115,13 +58,16 @@ function removeUuidAndSource(adaptableObject) {
|
|
|
115
58
|
return clonedObject;
|
|
116
59
|
}
|
|
117
60
|
exports.removeUuidAndSource = removeUuidAndSource;
|
|
61
|
+
// pretty primitive type guard for AdaptableObject, but currently there is no better/safer way
|
|
62
|
+
function isAdaptableObject(object) {
|
|
63
|
+
return object != undefined && typeof object['Uuid'] === 'string';
|
|
64
|
+
}
|
|
65
|
+
exports.isAdaptableObject = isAdaptableObject;
|
|
118
66
|
exports.AdaptableHelper = {
|
|
119
67
|
initPredefinedConfigWithUuids,
|
|
120
|
-
|
|
121
|
-
AdaptableObjectExistsInState,
|
|
122
|
-
runAdaptableComparerFunction,
|
|
123
|
-
getAppropriateAccessLevel,
|
|
68
|
+
getAccessLevelForObject,
|
|
124
69
|
addUuidAndSource,
|
|
125
70
|
removeUuidAndSource,
|
|
71
|
+
isAdaptableObject,
|
|
126
72
|
};
|
|
127
73
|
exports.default = exports.AdaptableHelper;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { NumberFormatterOptions, DateFormatterOptions, StringFormatterOptions } from '../../PredefinedConfig/Common/AdaptableFormat';
|
|
2
2
|
import { IRowNode } from '@ag-grid-community/core';
|
|
3
3
|
import { AdaptableApi, AdaptableColumn } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Context used for Placeholders in Display Format
|
|
6
|
+
*/
|
|
7
|
+
export interface DisplayFormatPlaceholderContext {
|
|
8
|
+
column: AdaptableColumn;
|
|
9
|
+
rowNode: IRowNode;
|
|
10
|
+
input: any;
|
|
11
|
+
api: AdaptableApi;
|
|
12
|
+
}
|
|
4
13
|
export declare function NumberFormatter(input: number, options?: NumberFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
|
|
5
14
|
export declare function DateFormatter(input: number | Date | string, options: DateFormatterOptions, strictFormatting?: boolean): string | undefined;
|
|
6
15
|
export declare function StringFormatter(input: string, options?: StringFormatterOptions, rowNode?: IRowNode, column?: AdaptableColumn, api?: AdaptableApi): string;
|
|
@@ -7,18 +7,7 @@ const tslib_1 = require("tslib");
|
|
|
7
7
|
const format_1 = tslib_1.__importDefault(require("date-fns/format"));
|
|
8
8
|
const sentence_case_1 = require("sentence-case");
|
|
9
9
|
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
10
|
-
const
|
|
11
|
-
/*
|
|
12
|
-
export function Format(input: any, format: AdaptableFormat) {
|
|
13
|
-
if (format.Formatter === 'NumberFormatter') {
|
|
14
|
-
return NumberFormatter(input, format.Options);
|
|
15
|
-
}
|
|
16
|
-
if (format.Formatter === 'DateFormatter') {
|
|
17
|
-
return DateFormatter(input, format.Options);
|
|
18
|
-
}
|
|
19
|
-
throw new Error('Unknown formatter');
|
|
20
|
-
}
|
|
21
|
-
*/
|
|
10
|
+
const Helper_1 = tslib_1.__importDefault(require("./Helper"));
|
|
22
11
|
function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
23
12
|
var _a;
|
|
24
13
|
let preparedInput;
|
|
@@ -29,7 +18,7 @@ function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
|
29
18
|
input,
|
|
30
19
|
api,
|
|
31
20
|
};
|
|
32
|
-
preparedInput =
|
|
21
|
+
preparedInput = formatPlaceholder(options.Content.toString(), context);
|
|
33
22
|
}
|
|
34
23
|
else {
|
|
35
24
|
preparedInput = input;
|
|
@@ -137,7 +126,7 @@ function StringFormatter(input, options = {}, rowNode, column, api) {
|
|
|
137
126
|
input,
|
|
138
127
|
api,
|
|
139
128
|
};
|
|
140
|
-
preparedInput =
|
|
129
|
+
preparedInput = formatPlaceholder(options.Content, context);
|
|
141
130
|
}
|
|
142
131
|
else {
|
|
143
132
|
preparedInput = input;
|
|
@@ -172,4 +161,27 @@ function StringFormatter(input, options = {}, rowNode, column, api) {
|
|
|
172
161
|
return s;
|
|
173
162
|
}
|
|
174
163
|
exports.StringFormatter = StringFormatter;
|
|
164
|
+
function formatPlaceholder(text, context) {
|
|
165
|
+
if (!text) {
|
|
166
|
+
return text;
|
|
167
|
+
}
|
|
168
|
+
if (!context) {
|
|
169
|
+
return text;
|
|
170
|
+
}
|
|
171
|
+
if (context === null || context === void 0 ? void 0 : context.input) {
|
|
172
|
+
text = Helper_1.default.replaceAll(text, '[value]', context.input);
|
|
173
|
+
}
|
|
174
|
+
if (context === null || context === void 0 ? void 0 : context.column) {
|
|
175
|
+
text = Helper_1.default.replaceAll(text, '[column]', context.api.columnApi.getFriendlyNameForColumnId(context.column.columnId));
|
|
176
|
+
}
|
|
177
|
+
if (context === null || context === void 0 ? void 0 : context.rowNode) {
|
|
178
|
+
const columns = Helper_1.default.extractColsFromText(text);
|
|
179
|
+
for (const column of columns) {
|
|
180
|
+
if (context.api.columnApi.getColumnWithColumnId(column)) {
|
|
181
|
+
text = Helper_1.default.replaceAll(text, `[rowData.${column}]`, context.api.gridApi.getRawValueFromRowNode(context.rowNode, column));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return text;
|
|
186
|
+
}
|
|
175
187
|
exports.default = { NumberFormatter, DateFormatter, StringFormatter };
|