@adaptabletools/adaptable 10.0.2 → 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 +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- 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/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/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/UserInterfaceApiImpl.d.ts +11 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
- package/src/Api/InternalApi.d.ts +2 -0
- package/src/Api/UserInterfaceApi.d.ts +14 -5
- package/src/PredefinedConfig/AlertState.d.ts +5 -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/{Utilities/Interface/ProgressIndicator.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/Store/AdaptableStore.js +4 -0
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +58 -61
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +13 -1
- package/src/Utilities/Services/MetamodelService.js +1 -0
- package/src/Utilities/Services/ReportService.js +1 -1
- 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/FreeTextColumn/FreeTextColumnPopup.js +3 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- 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 +166 -50
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -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 +72 -2
- package/src/metamodel/adaptable.metamodel.js +304 -69
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
|
|
6
6
|
const parse_1 = tslib_1.__importDefault(require("date-fns/parse"));
|
|
@@ -25,26 +25,36 @@ exports.dateToISO = (date) => {
|
|
|
25
25
|
return FormatHelper_1.DateFormatter(date, { Pattern: 'yyyy-MM-dd' });
|
|
26
26
|
};
|
|
27
27
|
exports.parseToISO = (date, dateFormat) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
: typeof date === 'number'
|
|
31
|
-
? new Date(date)
|
|
32
|
-
: exports.parseDate(date, dateFormat);
|
|
33
|
-
let valid = dateInstance && exports.isValidDate(dateInstance);
|
|
34
|
-
if (!valid) {
|
|
35
|
-
dateInstance = new Date(date);
|
|
36
|
-
valid = exports.isValidDate(dateInstance);
|
|
37
|
-
}
|
|
38
|
-
return valid ? exports.dateToISO(dateInstance) : '';
|
|
28
|
+
const dateInstance = exports.parseDateValue(date, dateFormat);
|
|
29
|
+
return exports.isValidDate(dateInstance) ? exports.dateToISO(dateInstance) : '';
|
|
39
30
|
};
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
exports.parseDateValue = (dateValue, dateFormat) => {
|
|
32
|
+
if (dateValue == undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (dateValue instanceof Date) {
|
|
36
|
+
return !isNaN(dateValue.getTime()) ? dateValue : undefined;
|
|
37
|
+
}
|
|
38
|
+
let dateInstance;
|
|
39
|
+
if (typeof dateValue === 'number') {
|
|
40
|
+
dateInstance = new Date(dateValue);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// typeof dateValue === 'string'
|
|
44
|
+
if (dateFormat) {
|
|
45
|
+
dateInstance = parse_1.default(dateValue, dateFormat, new Date());
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
dateInstance = parseISO_1.default(dateValue);
|
|
49
|
+
}
|
|
50
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
51
|
+
// last chance: try to use the native Date.parse(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
|
|
52
|
+
dateInstance = new Date(Date.parse(dateValue));
|
|
53
|
+
}
|
|
44
54
|
}
|
|
45
|
-
if (!exports.isValidDate(
|
|
46
|
-
LoggingHelper_1.LogAdaptableError(`Invalid date value "${
|
|
47
|
-
|
|
55
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
56
|
+
LoggingHelper_1.LogAdaptableError(`Invalid date value "${dateValue}" - cannot be converted to a Date instance. Please make sure you specify adaptableOptions.userInterfaceOptions.dateInputOptions.dateFormat correctly.`);
|
|
57
|
+
dateInstance = undefined;
|
|
48
58
|
}
|
|
49
|
-
return
|
|
59
|
+
return dateInstance;
|
|
50
60
|
};
|
|
@@ -61,7 +61,7 @@ export declare function CreateEmptySchedule(): Schedule;
|
|
|
61
61
|
export declare function CreateEmptyShortcut(): Shortcut;
|
|
62
62
|
export declare function CreateEmptyConditionalStyle(): ConditionalStyle;
|
|
63
63
|
export declare function CreateEmptyFormatColumn(): FormatColumn;
|
|
64
|
-
export declare function CreateEmptyFreeTextColumn(): FreeTextColumn;
|
|
64
|
+
export declare function CreateEmptyFreeTextColumn(isFilterable: boolean): FreeTextColumn;
|
|
65
65
|
export declare function CreateEmptyLayout(layout?: Partial<Layout> & {
|
|
66
66
|
Name: string;
|
|
67
67
|
}, adaptableColumns?: AdaptableColumn[]): Layout;
|
|
@@ -74,6 +74,8 @@ function CreateEmptyCalculatedColumn(isFilterable) {
|
|
|
74
74
|
Sortable: true,
|
|
75
75
|
Pivotable: true,
|
|
76
76
|
Aggregatable: true,
|
|
77
|
+
SuppressMenu: false,
|
|
78
|
+
SuppressMovable: false,
|
|
77
79
|
},
|
|
78
80
|
};
|
|
79
81
|
}
|
|
@@ -334,13 +336,23 @@ function CreateEmptyFormatColumn() {
|
|
|
334
336
|
};
|
|
335
337
|
}
|
|
336
338
|
exports.CreateEmptyFormatColumn = CreateEmptyFormatColumn;
|
|
337
|
-
function CreateEmptyFreeTextColumn() {
|
|
339
|
+
function CreateEmptyFreeTextColumn(isFilterable) {
|
|
338
340
|
return {
|
|
339
341
|
Uuid: Uuid_1.createUuid(),
|
|
340
342
|
ColumnId: GeneralConstants_1.EMPTY_STRING,
|
|
341
343
|
DefaultValue: GeneralConstants_1.EMPTY_STRING,
|
|
342
344
|
FreeTextStoredValues: [],
|
|
343
345
|
TextEditor: 'Inline',
|
|
346
|
+
FreeTextColumnSettings: {
|
|
347
|
+
Filterable: isFilterable,
|
|
348
|
+
Resizable: true,
|
|
349
|
+
Groupable: true,
|
|
350
|
+
Sortable: true,
|
|
351
|
+
Pivotable: true,
|
|
352
|
+
Aggregatable: true,
|
|
353
|
+
SuppressMenu: false,
|
|
354
|
+
SuppressMovable: false,
|
|
355
|
+
},
|
|
344
356
|
};
|
|
345
357
|
}
|
|
346
358
|
exports.CreateEmptyFreeTextColumn = CreateEmptyFreeTextColumn;
|
|
@@ -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;
|
|
@@ -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' ||
|
|
@@ -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
|
};
|
|
@@ -1,50 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import * as FilterRedux from '../../../Redux/ActionsReducers/FilterRedux';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
|
|
4
|
-
import { ModuleViewPopupProps } from '../SharedProps/ModuleViewPopupProps';
|
|
5
|
-
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
7
3
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
8
|
-
import { AdaptablePredicateDef } from '../../../PredefinedConfig/Common/AdaptablePredicate';
|
|
9
|
-
import { FilterOptions } from '../../../AdaptableOptions/FilterOptions';
|
|
10
|
-
interface QuickFilterFormProps extends ModuleViewPopupProps<QuickFilterFormComponent> {
|
|
11
|
-
api: AdaptableApi;
|
|
12
|
-
currentColumn: AdaptableColumn;
|
|
13
|
-
columnFilters: ColumnFilter[];
|
|
14
|
-
quickFilterTrigger?: FilterOptions['quickFilterTrigger'];
|
|
15
|
-
onAddColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterAddAction;
|
|
16
|
-
onEditColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterEditAction;
|
|
17
|
-
}
|
|
18
4
|
export interface QuickFilterFormState {
|
|
19
5
|
filter: ColumnFilter;
|
|
20
6
|
distinctColumnValues: any[];
|
|
7
|
+
isDistinctColumnValuesLoading: boolean;
|
|
8
|
+
suppressClientSideFilter: boolean;
|
|
21
9
|
}
|
|
22
|
-
declare class QuickFilterFormComponent extends React.Component<QuickFilterFormProps, QuickFilterFormState> {
|
|
23
|
-
private valuesDropdown?;
|
|
24
|
-
constructor(props: QuickFilterFormProps);
|
|
25
|
-
getDistinctValues: (props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
}>) => any[];
|
|
28
|
-
updateDistinctValues(props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
}>): void;
|
|
31
|
-
UNSAFE_componentWillReceiveProps(nextProps: QuickFilterFormProps): void;
|
|
32
|
-
getFilterFromProps(props: QuickFilterFormProps): ColumnFilter;
|
|
33
|
-
render(): any;
|
|
34
|
-
renderLabel(filter: ColumnFilter, activePredicateDef: AdaptablePredicateDef): JSX.Element;
|
|
35
|
-
renderPredicateIcon(predicateDef: AdaptablePredicateDef): JSX.Element;
|
|
36
|
-
renderPredicateInput(predicateDef: AdaptablePredicateDef, filter: ColumnFilter): JSX.Element | JSX.Element[];
|
|
37
|
-
renderNoValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
38
|
-
renderValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
39
|
-
onColumnValuesChange(columnValues: any[]): void;
|
|
40
|
-
selectColumnPredicate(predicateId: string): void;
|
|
41
|
-
debouncedAddFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterAddAction>;
|
|
42
|
-
debouncedEditFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterEditAction>;
|
|
43
|
-
private updateFilter;
|
|
44
|
-
changeColumnPredicateInput(value: string, index: number): void;
|
|
45
|
-
getPredicateIdForShortcutValue(value: string): string;
|
|
46
|
-
clearFilter(): void;
|
|
47
|
-
}
|
|
48
|
-
export declare const QuickFilterForm: import("react-redux").ConnectedComponent<typeof QuickFilterFormComponent, any>;
|
|
49
10
|
export declare const QuickFilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;
|
|
50
|
-
export {};
|