@adaptabletools/adaptable 10.0.0-canary.3 → 10.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +77 -29
- package/index.css +89 -31
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/QueryLanguageOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +89 -4
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +33 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/DataChangeHistoryApi.d.ts +10 -4
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +11 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +7 -0
- package/src/Api/Implementation/ColumnApiImpl.js +37 -1
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +1 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +3 -0
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +2 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +17 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
- package/src/Api/Implementation/InternalApiImpl.js +16 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +3 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +11 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
- package/src/Api/InternalApi.d.ts +2 -0
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/Api/UserInterfaceApi.d.ts +14 -5
- package/src/PredefinedConfig/AlertState.d.ts +10 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -15
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/{AdaptableOptions/DataChangeTrackingOptions.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/SystemRedux.js +11 -11
- package/src/Redux/Store/AdaptableReduxMerger.js +7 -1
- package/src/Redux/Store/AdaptableStore.js +12 -0
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +58 -61
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -4
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +11 -5
- package/src/Utilities/Helpers/DateHelper.d.ts +8 -2
- package/src/Utilities/Helpers/DateHelper.js +42 -20
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +13 -1
- package/src/Utilities/Services/AlertService.d.ts +1 -0
- package/src/Utilities/Services/AlertService.js +5 -0
- package/src/Utilities/Services/DataService.d.ts +0 -4
- package/src/Utilities/Services/DataService.js +2 -18
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -1
- package/src/Utilities/Services/Interface/IDataService.d.ts +0 -2
- package/src/Utilities/Services/Interface/ILicenseService.d.ts +2 -1
- package/src/Utilities/Services/LicenseService.d.ts +2 -2
- package/src/Utilities/Services/MetamodelService.js +1 -0
- package/src/Utilities/Services/ModuleService.js +31 -24
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/Utilities/Services/TeamSharingService.d.ts +1 -0
- package/src/Utilities/Services/TeamSharingService.js +4 -2
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +4 -2
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +44 -23
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +64 -23
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +45 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +42 -32
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +5 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -5
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +3 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Query/QueryViewPanel.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +6 -8
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +20 -3
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +186 -55
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +2 -1
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +74 -34
- package/src/metamodel/adaptable.metamodel.js +346 -116
- package/src/parser/src/types.d.ts +11 -11
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/DataChangeTrackingOptions.d.ts +0 -16
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/Utilities/Interface/ProgressIndicator.js +0 -2
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AlertDefinition, FlashingAlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
2
2
|
import { DataChangedInfo } from '../../../PredefinedConfig/Common/DataChangedInfo';
|
|
3
|
+
import { IAdaptableService } from './IAdaptableService';
|
|
3
4
|
export declare type ReactiveAlertInfo = {
|
|
4
5
|
alertDefinition: AlertDefinition;
|
|
5
6
|
type: 'alert';
|
|
@@ -9,7 +10,7 @@ export declare type ReactiveAlertInfo = {
|
|
|
9
10
|
type: 'flashingAlert';
|
|
10
11
|
dataChangeLogEntry: DataChangedInfo;
|
|
11
12
|
};
|
|
12
|
-
export interface IAlertService {
|
|
13
|
+
export interface IAlertService extends IAdaptableService {
|
|
13
14
|
createReactiveAlert(alertDefinition: AlertDefinition | FlashingAlertDefinition, isFlashingAlert?: boolean): void;
|
|
14
15
|
deleteReactiveAlert(alertDefinition: AlertDefinition | FlashingAlertDefinition): void;
|
|
15
16
|
onReactiveAlertTriggered(callback: (payload: ReactiveAlertInfo) => void): () => void;
|
|
@@ -5,8 +5,6 @@ export interface IDataService extends IAdaptableService {
|
|
|
5
5
|
CreateDataChangedEvent(dataChangedInfo: DataChangedInfo): void;
|
|
6
6
|
on(eventName: 'DataChanged', callback: (dataChangedInfo: DataChangedInfo) => void): () => void;
|
|
7
7
|
readonly dataChangeLog$: Observable<DataChangedInfo>;
|
|
8
|
-
readonly dataChangeLogReplay$: Observable<DataChangedInfo>;
|
|
9
|
-
readonly dataChangeMaxTimeframeSize: number;
|
|
10
8
|
logUndoChange(undoChange: DataChangedInfo): void;
|
|
11
9
|
extractUndoChange(undoChange: DataChangedInfo): DataChangedInfo | undefined;
|
|
12
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
|
|
2
2
|
import { LicenseDetails } from '../license/LicenseDetails';
|
|
3
|
-
import {
|
|
3
|
+
import { ILicenseService } from './Interface/ILicenseService';
|
|
4
4
|
export declare enum LicenseValidityType {
|
|
5
5
|
INVALID_LICENSE = "INVALID_LICENSE",
|
|
6
6
|
NO_LICENSE = "NO_LICENSE",
|
|
@@ -11,7 +11,7 @@ export declare enum LicenseValidityType {
|
|
|
11
11
|
COMMERCIAL_EXPIRED_IN_SCOPE = "COMMERCIAL_EXPIRED_IN_SCOPE",
|
|
12
12
|
COMMERCIAL_EXPIRED_OUT_OF_SCOPE = "COMMERCIAL_EXPIRED_OUT_OF_SCOPE"
|
|
13
13
|
}
|
|
14
|
-
export declare class LicenseService implements
|
|
14
|
+
export declare class LicenseService implements ILicenseService {
|
|
15
15
|
private adaptable;
|
|
16
16
|
constructor(adaptable: IAdaptable, licenseKey: string | undefined, packageDetails: {
|
|
17
17
|
publishedAt: number | Date;
|
|
@@ -16,6 +16,7 @@ class MetamodelService {
|
|
|
16
16
|
buildGridInfoOptions() {
|
|
17
17
|
const gridInfoOptions = new Map();
|
|
18
18
|
const adaptableMetamodel = adaptable_metamodel_1.ADAPTABLE_METAMODEL;
|
|
19
|
+
console.log({ adaptableMetamodel });
|
|
19
20
|
const adaptableOptionsMetamodel = adaptableMetamodel['AdaptableOptions'];
|
|
20
21
|
const adaptableOptionsValues = this.adaptable.adaptableOptions;
|
|
21
22
|
const adaptableOptionsDefaultValues = DefaultAdaptableOptions_1.DefaultAdaptableOptions;
|
|
@@ -76,62 +76,69 @@ class ModuleService {
|
|
|
76
76
|
}
|
|
77
77
|
getModuleDocumentationPageByModule(adaptableModule) {
|
|
78
78
|
let url = `${DocumentationLinkConstants_1.HOST_URL_DOCS}/`;
|
|
79
|
-
let
|
|
79
|
+
let notificationUrl = url + 'notifications/';
|
|
80
|
+
let editingUrl = url + 'editing/';
|
|
81
|
+
let searchingUrl = url + 'searching/';
|
|
82
|
+
let filteringUrl = url + 'filtering/';
|
|
83
|
+
let themingUrl = url + 'theming/';
|
|
84
|
+
let stylingUrl = url + 'styling/';
|
|
85
|
+
let advancedFeaturesUrl = url + 'advanced-features/';
|
|
86
|
+
let gridManagementUrl = url + 'grid-management/';
|
|
80
87
|
let userInterfaceUrl = url + 'user-interface/';
|
|
81
88
|
let pluginUrl = url + 'plugins/';
|
|
82
89
|
switch (adaptableModule) {
|
|
83
90
|
case 'Alert':
|
|
84
|
-
return
|
|
91
|
+
return notificationUrl + 'alerts-module';
|
|
85
92
|
case 'BulkUpdate':
|
|
86
|
-
return
|
|
93
|
+
return editingUrl + 'bulk-update-module';
|
|
87
94
|
case 'CalculatedColumn':
|
|
88
|
-
return
|
|
95
|
+
return advancedFeaturesUrl + 'calculated-column-module';
|
|
89
96
|
case 'CellSummary':
|
|
90
|
-
return
|
|
97
|
+
return advancedFeaturesUrl + 'cell-summary-module';
|
|
91
98
|
case 'ConditionalStyle':
|
|
92
|
-
return
|
|
99
|
+
return stylingUrl + 'conditional-style-module';
|
|
93
100
|
case 'CustomSort':
|
|
94
|
-
return
|
|
101
|
+
return advancedFeaturesUrl + 'custom-sort-module';
|
|
95
102
|
case 'Dashboard':
|
|
96
103
|
return userInterfaceUrl + 'dashboard';
|
|
97
104
|
case 'DataSource':
|
|
98
|
-
return
|
|
105
|
+
return searchingUrl + 'data-source-module';
|
|
99
106
|
case 'Export':
|
|
100
|
-
return
|
|
107
|
+
return gridManagementUrl + 'export-module';
|
|
101
108
|
case 'Filter':
|
|
102
|
-
return
|
|
109
|
+
return filteringUrl + 'filter-module';
|
|
103
110
|
case 'FormatColumn':
|
|
104
|
-
return
|
|
111
|
+
return stylingUrl + 'format-column-module';
|
|
105
112
|
case 'FreeTextColumn':
|
|
106
|
-
return
|
|
113
|
+
return advancedFeaturesUrl + 'freetext-column-module';
|
|
107
114
|
case 'GridInfo':
|
|
108
|
-
return
|
|
115
|
+
return advancedFeaturesUrl + 'grid-info-module';
|
|
109
116
|
case 'Layout':
|
|
110
|
-
return
|
|
117
|
+
return advancedFeaturesUrl + 'layout-module';
|
|
111
118
|
case 'PlusMinus':
|
|
112
|
-
return
|
|
119
|
+
return editingUrl + 'plus-minus-module';
|
|
113
120
|
case 'Query':
|
|
114
|
-
return
|
|
121
|
+
return searchingUrl + 'query-module';
|
|
115
122
|
case 'QuickSearch':
|
|
116
|
-
return
|
|
123
|
+
return searchingUrl + 'quick-search-module';
|
|
117
124
|
case 'Schedule':
|
|
118
|
-
return
|
|
125
|
+
return advancedFeaturesUrl + 'schedule-module';
|
|
119
126
|
case 'Shortcut':
|
|
120
|
-
return
|
|
127
|
+
return editingUrl + 'shortcut-module';
|
|
121
128
|
case 'SmartEdit':
|
|
122
|
-
return
|
|
129
|
+
return editingUrl + 'smart-edit-module';
|
|
123
130
|
case 'StateManagement':
|
|
124
|
-
return
|
|
131
|
+
return advancedFeaturesUrl + 'adaptable-state-overview';
|
|
125
132
|
case 'SystemStatus':
|
|
126
|
-
return
|
|
133
|
+
return notificationUrl + 'system-status-module';
|
|
127
134
|
case 'TeamSharing':
|
|
128
135
|
return url + 'key-topics/team-sharing';
|
|
129
136
|
case 'Theme':
|
|
130
|
-
return
|
|
137
|
+
return themingUrl + 'using-themes';
|
|
131
138
|
case 'ToolPanel':
|
|
132
139
|
return userInterfaceUrl + 'tool-panel';
|
|
133
140
|
case 'DataChangeHistory':
|
|
134
|
-
return
|
|
141
|
+
return editingUrl + 'change-history-module';
|
|
135
142
|
case 'Chart':
|
|
136
143
|
return pluginUrl + 'chart/chart-plugin';
|
|
137
144
|
case 'SparklineColumn':
|
|
@@ -329,7 +329,7 @@ class ReportService {
|
|
|
329
329
|
return type === 'rawValue'
|
|
330
330
|
? cellRawValue
|
|
331
331
|
: // type === formattedValue
|
|
332
|
-
this.adaptable.
|
|
332
|
+
this.adaptable.getDisplayValueFromRawValue(columnId, cellRawValue);
|
|
333
333
|
}
|
|
334
334
|
computeCellExportValueFormat(columnType) {
|
|
335
335
|
if (this.adaptable.adaptableOptions.exportOptions.exportFormatType === 'rawValue' ||
|
|
@@ -6,6 +6,7 @@ import { SharedEntity, SharedEntityConfig, SharedEntityActiveStatus, TeamSharing
|
|
|
6
6
|
import { TypeUuid } from '../../PredefinedConfig/Uuid';
|
|
7
7
|
export declare class TeamSharingService implements ITeamSharingService {
|
|
8
8
|
private adaptable;
|
|
9
|
+
private updateCheckTimerId;
|
|
9
10
|
constructor(adaptable: IAdaptable);
|
|
10
11
|
buildSharedEntityWithDependencies(adaptableObject: AdaptableObject, module: AdaptableModule, configuration: SharedEntityConfig): SharedEntity[];
|
|
11
12
|
getSharedEntityDependants(sharedEntityId: TypeUuid, sharedEntities: SharedEntity[]): SharedEntity[];
|
|
@@ -10,7 +10,7 @@ class TeamSharingService {
|
|
|
10
10
|
if (adaptable.adaptableOptions.teamSharingOptions.updateInterval > 0) {
|
|
11
11
|
// convert minutes to millis
|
|
12
12
|
const updateInterval = adaptable.adaptableOptions.teamSharingOptions.updateInterval * 60000;
|
|
13
|
-
setInterval(() => {
|
|
13
|
+
this.updateCheckTimerId = setInterval(() => {
|
|
14
14
|
this.adaptable.api.teamSharingApi.checkForUpdates();
|
|
15
15
|
}, updateInterval);
|
|
16
16
|
}
|
|
@@ -121,7 +121,9 @@ class TeamSharingService {
|
|
|
121
121
|
this.adaptable.api.teamSharingApi.fireTeamSharingEntityChangedEvent(sharedEntityActiveInfo.sharedEntity);
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
destroy() {
|
|
124
|
+
destroy() {
|
|
125
|
+
clearTimeout(this.updateCheckTimerId);
|
|
126
|
+
}
|
|
125
127
|
createSharedEntity(adaptableObject, module, configuration, sharingUserName, sharingTimestamp, createdSharedEntities) {
|
|
126
128
|
// create main shared entity
|
|
127
129
|
const mainSharedEntity = {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
3
|
+
*
|
|
4
|
+
* @param promise
|
|
5
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
6
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runIfNotResolvedIn: <T>(promise: Promise<T>, callback: () => void, delay?: number) => Promise<T>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runIfNotResolvedIn = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
6
|
+
*
|
|
7
|
+
* @param promise
|
|
8
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
9
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
10
|
+
*/
|
|
11
|
+
exports.runIfNotResolvedIn = async (promise, callback, delay = 100) => {
|
|
12
|
+
let isFulfilled = false;
|
|
13
|
+
promise === null || promise === void 0 ? void 0 : promise.then(() => {
|
|
14
|
+
isFulfilled = true;
|
|
15
|
+
});
|
|
16
|
+
(async () => {
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
18
|
+
if (!isFulfilled) {
|
|
19
|
+
callback();
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
return promise;
|
|
23
|
+
};
|
|
@@ -15,9 +15,9 @@ const ChartEnums_1 = require("../PredefinedConfig/Common/ChartEnums");
|
|
|
15
15
|
const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingScreen");
|
|
16
16
|
const Toastify_1 = require("../components/Toastify");
|
|
17
17
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
18
|
-
const ProgressIndicator_1 = require("./Export/ProgressIndicator");
|
|
19
18
|
const License_1 = require("./License");
|
|
20
19
|
const ExportCustomDestinationFormPopups_1 = require("./Export/ExportCustomDestinationFormPopups");
|
|
20
|
+
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
21
21
|
class AdaptableView extends React.Component {
|
|
22
22
|
render() {
|
|
23
23
|
var _a, _b, _c, _d, _e;
|
|
@@ -11,6 +11,7 @@ const rebass_1 = require("rebass");
|
|
|
11
11
|
const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
|
|
12
12
|
const AlertButtonsEditor_1 = require("./AlertButtonsEditor");
|
|
13
13
|
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
14
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
14
15
|
const DEFAULT_BUTTONS = [
|
|
15
16
|
{
|
|
16
17
|
Label: 'OK',
|
|
@@ -58,22 +59,35 @@ exports.AlertDisplayWizardSection = (props) => {
|
|
|
58
59
|
var _a, _b, _c, _d;
|
|
59
60
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
60
61
|
const messageType = data.MessageType;
|
|
62
|
+
const messageText = api.alertApi.getAlertDescription(data);
|
|
61
63
|
const adaptableAlert = {
|
|
62
64
|
header: data.MessageType,
|
|
63
65
|
message: '',
|
|
64
66
|
alertDefinition: data,
|
|
65
67
|
};
|
|
68
|
+
const onMessageTextChange = (e) => {
|
|
69
|
+
const { value } = e.target;
|
|
70
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
71
|
+
};
|
|
66
72
|
return (React.createElement(React.Fragment, null,
|
|
67
73
|
React.createElement(Tabs_1.Tabs, null,
|
|
68
74
|
React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
|
|
69
75
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
70
|
-
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "
|
|
76
|
+
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
71
77
|
props.onChange(Object.assign(Object.assign({}, data), { MessageType }));
|
|
72
78
|
} },
|
|
73
|
-
React.createElement(Radio_1.default, { value: "Info" }, "Info"),
|
|
74
|
-
React.createElement(Radio_1.default, { value: "Success" }, "Success"),
|
|
75
|
-
React.createElement(Radio_1.default, { value: "Warning" }, "Warning"),
|
|
76
|
-
React.createElement(Radio_1.default, { value: "Error" }, "Error")))),
|
|
79
|
+
React.createElement(Radio_1.default, { marginLeft: 1, value: "Info" }, "Info"),
|
|
80
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Success" }, "Success"),
|
|
81
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Warning" }, "Warning"),
|
|
82
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Error" }, "Error")))),
|
|
83
|
+
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
84
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
85
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
86
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Trigger and Condition)"),
|
|
87
|
+
' ',
|
|
88
|
+
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText,
|
|
89
|
+
// onChange={(e: any) => onPredicateInputChange(e, index)}
|
|
90
|
+
onChange: (e) => onMessageTextChange(e) }))),
|
|
77
91
|
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
78
92
|
React.createElement(Tabs_1.Tabs.Tab, null, "Display options"),
|
|
79
93
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
6
6
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupComponent> {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -11,6 +12,7 @@ interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupCompo
|
|
|
11
12
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
12
13
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
13
14
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
15
|
+
SelectedGridCells: GridCell[];
|
|
14
16
|
}
|
|
15
17
|
export interface BulkUpdatePopupState {
|
|
16
18
|
isShowingError: boolean;
|
|
@@ -57,7 +57,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
57
57
|
' ',
|
|
58
58
|
"Select from existing column values")),
|
|
59
59
|
React.createElement(rebass_1.Flex, { padding: 2, flexDirection: "row", alignItems: "center" },
|
|
60
|
-
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.DataType), placeholder: UIHelper_1.UIHelper.getPlaceHolderforDataType(col.DataType), onChange: (e) => this.onBulkUpdateValueChange(e) }))),
|
|
60
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.DataType), placeholder: UIHelper_1.UIHelper.getPlaceHolderforDataType(col.DataType), onChange: (e) => this.onBulkUpdateValueChange(e) }))),
|
|
61
61
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
62
62
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
|
|
63
63
|
this.onApplyClick();
|
|
@@ -65,7 +65,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
65
65
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Select an existing column value from the dropdown, or enter a new value"),
|
|
66
66
|
React.createElement(rebass_1.Flex, { marginTop: 2, flexDirection: "row", alignItems: "center" },
|
|
67
67
|
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 },
|
|
68
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
68
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
69
69
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
70
70
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All' ||
|
|
71
71
|
hasDataTypeError, variant: "raised", tone: "accent", marginRight: 2, onClick: () => {
|
|
@@ -96,10 +96,12 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
function mapStateToProps(state, ownProps) {
|
|
99
|
+
var _a;
|
|
99
100
|
return {
|
|
100
101
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
101
102
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
102
103
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
104
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function mapDispatchToProps(dispatch) {
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import * as BulkUpdateRedux from '../../Redux/ActionsReducers/BulkUpdateRedux';
|
|
5
5
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
6
6
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -12,6 +13,7 @@ export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
|
12
13
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
13
14
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
14
15
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
16
|
+
SelectedGridCells: GridCell[];
|
|
15
17
|
}
|
|
16
18
|
declare class BulkUpdateViewPanelComponent extends React.Component<BulkUpdateViewPanelComponentProps, {}> {
|
|
17
19
|
private cleanupEvent?;
|
|
@@ -52,7 +52,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
52
52
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
53
53
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: join_1.default(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap`), flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
54
54
|
React.createElement(rebass_1.Flex, null,
|
|
55
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
55
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
56
56
|
listMinWidth: 160,
|
|
57
57
|
}, className: `ab-${elementType}__BulkUpdate__select`, disabled: shouldDisable, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
|
|
58
58
|
React.createElement(rebass_1.Flex, null,
|
|
@@ -90,7 +90,9 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function mapStateToProps(state, ownProps) {
|
|
93
|
+
var _a;
|
|
93
94
|
return {
|
|
95
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
94
96
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
95
97
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
96
98
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
@@ -1,63 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Redux from 'redux';
|
|
3
|
-
import * as FilterRedux from '../../../Redux/ActionsReducers/FilterRedux';
|
|
4
|
-
import * as PopupRedux from '../../../Redux/ActionsReducers/PopupRedux';
|
|
5
|
-
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
1
|
+
/// <reference types="react" />
|
|
6
2
|
import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
|
|
7
3
|
import { ColumnMenuTab } from '../../../PredefinedConfig/Common/Enums';
|
|
8
|
-
import { ModuleViewPopupProps } from '../SharedProps/ModuleViewPopupProps';
|
|
9
|
-
import { UIPrompt } from '../../../Utilities/Interface/MessagePopups';
|
|
10
|
-
import { AdaptableMenuItem } from '../../../PredefinedConfig/Common/Menu';
|
|
11
4
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
12
|
-
import { AdaptablePredicateDef } from '../../../PredefinedConfig/Common/AdaptablePredicate';
|
|
13
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
14
|
-
interface FilterFormProps extends ModuleViewPopupProps<FilterFormComponent> {
|
|
15
|
-
currentColumn: AdaptableColumn;
|
|
16
|
-
api: AdaptableApi;
|
|
17
|
-
columns: AdaptableColumn[];
|
|
18
|
-
columnFilters: ColumnFilter[];
|
|
19
|
-
embedColumnMenu: boolean;
|
|
20
|
-
showCloseButton: boolean;
|
|
21
|
-
onClearColumnFilter: (columnfilter: ColumnFilter) => FilterRedux.ColumnFilterClearAction;
|
|
22
|
-
onAddColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterAddAction;
|
|
23
|
-
onEditColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterEditAction;
|
|
24
|
-
onSetColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterSetAction;
|
|
25
|
-
onHideFilterForm: () => FilterRedux.FilterFormHideAction;
|
|
26
|
-
onMenuItemClick: (action: Redux.Action) => Redux.Action;
|
|
27
|
-
onShowPrompt: (prompt: UIPrompt) => PopupRedux.PopupShowPromptAction;
|
|
28
|
-
}
|
|
29
5
|
export interface FilterFormState {
|
|
30
6
|
columnFilters: ColumnFilter[];
|
|
31
7
|
distinctColumnValues: any[];
|
|
8
|
+
isDistinctColumnValuesLoading: boolean;
|
|
32
9
|
showTab: boolean;
|
|
33
10
|
selectedTab: ColumnMenuTab;
|
|
34
11
|
editedColumnFilter: ColumnFilter | undefined;
|
|
35
12
|
currentTab: 'values' | 'predicates';
|
|
13
|
+
suppressClientSideFilter: boolean;
|
|
36
14
|
}
|
|
37
|
-
declare class FilterFormComponent extends React.Component<FilterFormProps, FilterFormState> {
|
|
38
|
-
static createColumnFilterFromProps(props: FilterFormProps): ColumnFilter;
|
|
39
|
-
static getCurrentTab(editedColumnFilter: ColumnFilter | undefined): 'values' | 'predicates';
|
|
40
|
-
static getDerivedStateFromProps(props: FilterFormProps, state: FilterFormState): {
|
|
41
|
-
editedColumnFilter: ColumnFilter;
|
|
42
|
-
columnFilters: ColumnFilter[];
|
|
43
|
-
currentTab: "values" | "predicates";
|
|
44
|
-
};
|
|
45
|
-
constructor(props: FilterFormProps);
|
|
46
|
-
componentDidMount(): void;
|
|
47
|
-
render(): any;
|
|
48
|
-
private renderColumnPredicate;
|
|
49
|
-
renderPredicateInput(predicateDef: AdaptablePredicateDef, filter: ColumnFilter): JSX.Element | JSX.Element[];
|
|
50
|
-
isFilterable(): string;
|
|
51
|
-
onSelectTab(tab: any): any;
|
|
52
|
-
onColumnValuesChange(columnValues: any[]): void;
|
|
53
|
-
persistFilter(): void;
|
|
54
|
-
onClearFilter(): void;
|
|
55
|
-
onFilterApplied(): void;
|
|
56
|
-
onCloseForm(): void;
|
|
57
|
-
onMenuItemClick(menuItem: AdaptableMenuItem): any;
|
|
58
|
-
selectColumnPredicate(predicateDef: AdaptablePredicateDef): void;
|
|
59
|
-
changeColumnPredicateInput(value: string, index: number): void;
|
|
60
|
-
}
|
|
61
|
-
export declare let FilterForm: import("react-redux").ConnectedComponent<typeof FilterFormComponent, any>;
|
|
62
15
|
export declare const FilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;
|
|
63
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FilterFormReact =
|
|
3
|
+
exports.FilterFormReact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
@@ -18,15 +18,37 @@ const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlo
|
|
|
18
18
|
const rebass_1 = require("rebass");
|
|
19
19
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
20
20
|
const Helper_1 = tslib_1.__importDefault(require("../../../Utilities/Helpers/Helper"));
|
|
21
|
-
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/ArrayExtensions"));
|
|
22
21
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
23
22
|
const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
|
|
24
23
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
24
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
25
|
+
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
25
26
|
const panelStyle = {
|
|
26
27
|
width: '100%',
|
|
27
28
|
minWidth: 150,
|
|
28
29
|
};
|
|
29
30
|
class FilterFormComponent extends React.Component {
|
|
31
|
+
constructor(props) {
|
|
32
|
+
super(props);
|
|
33
|
+
this._isMounted = false;
|
|
34
|
+
this.handleFilterChange = (filter) => {
|
|
35
|
+
if (this.state.suppressClientSideFilter) {
|
|
36
|
+
this.loadPermittedValues(filter);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this._isMounted = true;
|
|
40
|
+
const existingColumnFilter = FilterFormComponent.createColumnFilterFromProps(this.props);
|
|
41
|
+
this.state = {
|
|
42
|
+
columnFilters: props.columnFilters,
|
|
43
|
+
distinctColumnValues: [],
|
|
44
|
+
isDistinctColumnValuesLoading: false,
|
|
45
|
+
showTab: true,
|
|
46
|
+
selectedTab: Enums_1.ColumnMenuTab.Filter,
|
|
47
|
+
editedColumnFilter: existingColumnFilter,
|
|
48
|
+
currentTab: FilterFormComponent.getCurrentTab(existingColumnFilter),
|
|
49
|
+
suppressClientSideFilter: false,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
30
52
|
static createColumnFilterFromProps(props) {
|
|
31
53
|
let existingColumnFilter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.ColumnId);
|
|
32
54
|
if (!existingColumnFilter) {
|
|
@@ -36,13 +58,13 @@ class FilterFormComponent extends React.Component {
|
|
|
36
58
|
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, 'Values', []);
|
|
37
59
|
}
|
|
38
60
|
if (props.currentColumn.DataType === 'Number') {
|
|
39
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, filterOptions.defaultNumericColumnFilter, ['']);
|
|
61
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
40
62
|
}
|
|
41
63
|
if (props.currentColumn.DataType === 'String') {
|
|
42
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, filterOptions.defaultStringColumnFilter, ['']);
|
|
64
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
43
65
|
}
|
|
44
66
|
if (props.currentColumn.DataType === 'Date') {
|
|
45
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, filterOptions.defaultDateColumnFilter, ['']);
|
|
67
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
46
68
|
}
|
|
47
69
|
if (props.currentColumn.DataType === 'Boolean') {
|
|
48
70
|
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, 'BooleanToggle', [
|
|
@@ -76,25 +98,24 @@ class FilterFormComponent extends React.Component {
|
|
|
76
98
|
: state.currentTab,
|
|
77
99
|
};
|
|
78
100
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
let existingColumnFilter = FilterFormComponent.createColumnFilterFromProps(this.props);
|
|
82
|
-
this.state = {
|
|
83
|
-
columnFilters: props.columnFilters,
|
|
84
|
-
distinctColumnValues: [],
|
|
85
|
-
showTab: false,
|
|
86
|
-
selectedTab: Enums_1.ColumnMenuTab.Filter,
|
|
87
|
-
editedColumnFilter: existingColumnFilter,
|
|
88
|
-
currentTab: FilterFormComponent.getCurrentTab(existingColumnFilter),
|
|
89
|
-
};
|
|
101
|
+
componentWillUnmount() {
|
|
102
|
+
this._isMounted = false;
|
|
90
103
|
}
|
|
91
104
|
componentDidMount() {
|
|
92
105
|
if (this.props.currentColumn.DataType != Enums_1.DataType.Boolean) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
106
|
+
this.loadPermittedValues();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async loadPermittedValues(filter = '') {
|
|
110
|
+
const { values: distinctColumnValues, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.ColumnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
111
|
+
if (!this._isMounted) {
|
|
112
|
+
return;
|
|
97
113
|
}
|
|
114
|
+
this.setState({
|
|
115
|
+
distinctColumnValues,
|
|
116
|
+
isDistinctColumnValuesLoading: false,
|
|
117
|
+
suppressClientSideFilter,
|
|
118
|
+
});
|
|
98
119
|
}
|
|
99
120
|
render() {
|
|
100
121
|
var _a, _b;
|
|
@@ -120,7 +141,7 @@ class FilterFormComponent extends React.Component {
|
|
|
120
141
|
React.createElement(Radio_1.default, { marginLeft: 2, flex: 1, checked: this.state.currentTab == 'predicates', onChange: () => this.setState({ currentTab: 'predicates' }) },
|
|
121
142
|
React.createElement(rebass_1.Flex, { fontSize: 'var( --ab-font-size-2)' }, "Filters")))),
|
|
122
143
|
this.state.currentTab === 'values' && (React.createElement("div", null,
|
|
123
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.DataType, uiSelectedColumnValues: uiSelectedColumnValues, useVendorStyle: useVendorStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
144
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: this.props.columns, columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.DataType, uiSelectedColumnValues: uiSelectedColumnValues, useVendorStyle: useVendorStyle, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) }))),
|
|
124
145
|
this.state.currentTab === 'predicates' && (React.createElement("div", null,
|
|
125
146
|
' ',
|
|
126
147
|
this.state.showTab && React.createElement("hr", null),
|
|
@@ -258,5 +279,5 @@ function mapDispatchToProps(dispatch) {
|
|
|
258
279
|
onHideFilterForm: () => dispatch(FilterRedux.FilterFormHide()),
|
|
259
280
|
};
|
|
260
281
|
}
|
|
261
|
-
|
|
262
|
-
exports.FilterFormReact = (FilterContext) => renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(
|
|
282
|
+
const FilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(FilterFormComponent);
|
|
283
|
+
exports.FilterFormReact = (FilterContext) => renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(FilterForm, { api: FilterContext.Adaptable.api, currentColumn: FilterContext.Column, teamSharingActivated: false, embedColumnMenu: FilterContext.Adaptable.embedColumnMenu, showCloseButton: FilterContext.ShowCloseButton }), FilterContext.Adaptable);
|
|
@@ -9,6 +9,9 @@ export interface ListBoxFilterFormProps extends ListGroupProps {
|
|
|
9
9
|
uiSelectedColumnValues: Array<string>;
|
|
10
10
|
onColumnValueSelectedChange: (SelectedValues: Array<any>) => void;
|
|
11
11
|
dataType: 'String' | 'Number' | 'NumberArray' | 'Boolean' | 'Date' | 'Object' | 'Unknown';
|
|
12
|
+
isLoading?: boolean;
|
|
13
|
+
suppressClientSideFilter?: boolean;
|
|
14
|
+
onFilterChange?: (filter: string) => void;
|
|
12
15
|
}
|
|
13
16
|
export interface ListBoxFilterFormState extends React.ClassAttributes<any> {
|
|
14
17
|
UiSelectedColumnValues: Array<string>;
|
|
@@ -11,8 +11,13 @@ const join_1 = tslib_1.__importDefault(require("../../../components/utils/join")
|
|
|
11
11
|
const AdaptableFormControlTextClear_1 = require("../Forms/AdaptableFormControlTextClear");
|
|
12
12
|
const GridList_1 = tslib_1.__importDefault(require("../../../components/List/GridList"));
|
|
13
13
|
const react_1 = require("react");
|
|
14
|
+
const Loader_1 = require("../../../components/Loader");
|
|
14
15
|
exports.ListBoxFilterForm = (props) => {
|
|
15
16
|
const [FilterValue, setFilterValue] = react_1.useState('');
|
|
17
|
+
const handleFilterValueChange = React.useCallback((newValue) => {
|
|
18
|
+
setFilterValue(newValue);
|
|
19
|
+
props === null || props === void 0 ? void 0 : props.onFilterChange(newValue);
|
|
20
|
+
}, [props.onFilterChange]);
|
|
16
21
|
const [UiSelectedColumnValues, internalUpdateUISelectedColumnValues] = react_1.useState(props.uiSelectedColumnValues);
|
|
17
22
|
const setUiSelectedColumnValues = (values) => {
|
|
18
23
|
internalUpdateUISelectedColumnValues(values);
|
|
@@ -41,7 +46,8 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
41
46
|
if (StringExtensions_1.StringExtensions.IsNullOrEmpty(columnValue)) {
|
|
42
47
|
return null;
|
|
43
48
|
}
|
|
44
|
-
if (
|
|
49
|
+
if (!props.suppressClientSideFilter &&
|
|
50
|
+
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(FilterValue) &&
|
|
45
51
|
columnValue.toLocaleLowerCase().indexOf(FilterValue.toLocaleLowerCase()) < 0) {
|
|
46
52
|
return null;
|
|
47
53
|
}
|
|
@@ -60,9 +66,12 @@ exports.ListBoxFilterForm = (props) => {
|
|
|
60
66
|
paddingBottom: 'var(--ab-space-1)',
|
|
61
67
|
paddingLeft: 'var(--ab-space-1)',
|
|
62
68
|
borderRadius: 'var(--ab__border-radius)',
|
|
63
|
-
}, OnTextChange:
|
|
64
|
-
|
|
69
|
+
}, OnTextChange: handleFilterValueChange }));
|
|
70
|
+
const baseClassName = 'ab-ListBoxFilterForm';
|
|
71
|
+
return (React.createElement("div", { className: join_1.default(baseClassName, props.useVendorStyle ? `${baseClassName}--vendor-style` : null, props.isLoading && `${baseClassName}--loading`) },
|
|
65
72
|
React.createElement(rebass_1.Box, { px: 2 },
|
|
66
|
-
React.createElement(rebass_1.Box, { mx: props.useVendorStyle ? 0 : '2px', marginBottom: 2 },
|
|
67
|
-
|
|
73
|
+
React.createElement(rebass_1.Box, { mx: props.useVendorStyle ? 0 : '2px', marginBottom: 2 },
|
|
74
|
+
textClear,
|
|
75
|
+
props.isLoading && React.createElement(Loader_1.Loader, null, "Loading"))),
|
|
76
|
+
!props.isLoading && (React.createElement(GridList_1.default, { showZebraRows: false, className: !props.useVendorStyle ? 'ab-padding-horizontal-0' : '' }, columnValuesItemsElements))));
|
|
68
77
|
};
|