@adaptabletools/adaptable-cjs 20.0.0-canary.18 → 20.0.0-canary.19
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 +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +1 -1
- package/src/AdaptableOptions/QuickSearchOptions.d.ts +2 -2
- package/src/Api/Implementation/ColumnFilterApiImpl.js +1 -1
- package/src/Api/Implementation/PredicateApiImpl.js +1 -1
- package/src/Api/Internal/ColumnFilterInternalApi.js +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
- package/src/PredefinedConfig/Common/ColumnFilter.d.ts +6 -2
- package/src/PredefinedConfig/LayoutState.d.ts +1 -1
- package/src/Redux/ActionsReducers/LayoutRedux.d.ts +1 -1
- package/src/Redux/Store/AdaptableStore.js +1 -1
- package/src/Utilities/Helpers/FormatHelper.js +17 -3
- package/src/View/Components/ColumnFilter/LayoutColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/useAdaptableFilterWrapper.js +1 -1
- package/src/View/Components/ColumnFilter/utils.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/StatusBar/AdaptableStatusBar.js +7 -1
- package/src/agGrid/AdaptableAgGrid.js +10 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +7 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "20.0.0-canary.
|
|
3
|
+
"version": "20.0.0-canary.19",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -222,7 +222,7 @@ const DefaultAdaptableOptions = {
|
|
|
222
222
|
quickSearchOptions: {
|
|
223
223
|
clearQuickSearchOnStartUp: false,
|
|
224
224
|
quickSearchPlaceholder: 'Search',
|
|
225
|
-
|
|
225
|
+
filterGridAfterQuickSearch: false,
|
|
226
226
|
isQuickSearchCaseSensitive: false,
|
|
227
227
|
runCustomQuickSearch: undefined,
|
|
228
228
|
},
|
|
@@ -30,13 +30,13 @@ export interface QuickSearchOptions<TData = any> {
|
|
|
30
30
|
*/
|
|
31
31
|
clearQuickSearchOnStartUp?: boolean;
|
|
32
32
|
/**
|
|
33
|
-
* Filters quick search
|
|
33
|
+
* Filters Grid after quick search so only matching rows are displayed
|
|
34
34
|
*
|
|
35
35
|
* @defaultValue false
|
|
36
36
|
* @gridInfoItem
|
|
37
37
|
* @noCodeItem
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
filterGridAfterQuickSearch?: boolean;
|
|
40
40
|
/**
|
|
41
41
|
* Run Quick Search using Case Sensitivity
|
|
42
42
|
*
|
|
@@ -119,7 +119,7 @@ class ColumnFilterApiImpl extends ApiBase_1.ApiBase {
|
|
|
119
119
|
return ('[' +
|
|
120
120
|
friendlyName +
|
|
121
121
|
'] ' +
|
|
122
|
-
this.getPredicateApi().predicatesToString(columnFilter.Predicates, columnFilter.
|
|
122
|
+
this.getPredicateApi().predicatesToString(columnFilter.Predicates, columnFilter.PredicatesOperator));
|
|
123
123
|
}
|
|
124
124
|
columnFiltersToString(columnFilters) {
|
|
125
125
|
return columnFilters.map((cf) => this.columnFilterToString(cf)).join(', ');
|
|
@@ -121,7 +121,7 @@ class PredicateApiImpl extends ApiBase_1.ApiBase {
|
|
|
121
121
|
if (predicates === undefined || predicates === null || predicates?.length === 0) {
|
|
122
122
|
return this.handlePredicate(undefined, params, defaultReturn);
|
|
123
123
|
}
|
|
124
|
-
if (params.
|
|
124
|
+
if (params.predicatesOperator && params.predicatesOperator === 'OR') {
|
|
125
125
|
return predicates?.some((p) => this.handlePredicate(p, params, defaultReturn));
|
|
126
126
|
}
|
|
127
127
|
return predicates?.every((p) => this.handlePredicate(p, params, defaultReturn));
|
|
@@ -96,7 +96,7 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
|
|
|
96
96
|
displayValue: gridCell.displayValue,
|
|
97
97
|
node,
|
|
98
98
|
column,
|
|
99
|
-
|
|
99
|
+
predicatesOperator: columnFilter.PredicatesOperator,
|
|
100
100
|
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
101
101
|
};
|
|
102
102
|
return this.getPredicateApi().handlePredicates(columnFilter.Predicates, predicateDefHandlerContext, true);
|
|
@@ -104,7 +104,7 @@ export interface PredicateDefHandlerContext extends BaseContext {
|
|
|
104
104
|
* Any (optional) inputs required to perform evaluation
|
|
105
105
|
*/
|
|
106
106
|
inputs?: any[];
|
|
107
|
-
|
|
107
|
+
predicatesOperator?: ColumnFilter['PredicatesOperator'];
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Inputs required for a Predicate
|
|
@@ -13,10 +13,10 @@ export interface ColumnFilter extends SuspendableObject {
|
|
|
13
13
|
*/
|
|
14
14
|
Predicates: ColumnFilterPredicate[];
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Logic used when combining multiple Predicates ('AND'|'OR')
|
|
17
17
|
* @defaultValue 'AND'
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
PredicatesOperator?: PredicatesOperator;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* A Predicate used in Column Filtering
|
|
@@ -24,6 +24,10 @@ export interface ColumnFilter extends SuspendableObject {
|
|
|
24
24
|
export interface ColumnFilterPredicate extends AdaptablePredicate {
|
|
25
25
|
PredicateId: TypeHint<string, SystemFilterPredicateId>;
|
|
26
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Logic used to join multiple Predicates
|
|
29
|
+
*/
|
|
30
|
+
export type PredicatesOperator = 'AND' | 'OR';
|
|
27
31
|
/**
|
|
28
32
|
* Array containing all System Filter Predicates
|
|
29
33
|
*/
|
|
@@ -125,7 +125,7 @@ export interface PivotLayout extends LayoutBase {
|
|
|
125
125
|
*/
|
|
126
126
|
PivotColumns: string[];
|
|
127
127
|
/**
|
|
128
|
-
* How deep to expand
|
|
128
|
+
* How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all)
|
|
129
129
|
*/
|
|
130
130
|
PivotExpandLevel?: number;
|
|
131
131
|
/**
|
|
@@ -180,7 +180,7 @@ export declare const getCurrentLayoutSelector: (state: AdaptableState) => Layout
|
|
|
180
180
|
export declare const getColumnFilterSelector: (state: AdaptableState, columnId: string) => {
|
|
181
181
|
ColumnId: string;
|
|
182
182
|
Predicates: import("../../types").ColumnFilterPredicate[];
|
|
183
|
-
|
|
183
|
+
PredicatesOperator?: import("../../types").PredicatesOperator;
|
|
184
184
|
IsSuspended?: boolean;
|
|
185
185
|
Uuid?: string;
|
|
186
186
|
Source?: "Config" | "User";
|
|
@@ -507,7 +507,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
507
507
|
let returnAction = next(action);
|
|
508
508
|
adaptable.api.gridApi.refreshAllCells(true);
|
|
509
509
|
// if set then return a query on the text
|
|
510
|
-
if (adaptable.adaptableOptions.quickSearchOptions.
|
|
510
|
+
if (adaptable.adaptableOptions.quickSearchOptions.filterGridAfterQuickSearch) {
|
|
511
511
|
const actionTyped = action;
|
|
512
512
|
const searchText = actionTyped.quickSearchText;
|
|
513
513
|
if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(searchText)) {
|
|
@@ -7,6 +7,7 @@ const date_fns_1 = require("date-fns");
|
|
|
7
7
|
const sentence_case_1 = require("sentence-case");
|
|
8
8
|
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
9
9
|
const Helper_1 = tslib_1.__importDefault(require("./Helper"));
|
|
10
|
+
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
10
11
|
function NumberFormatter(input, options = {}, rowNode, column, api) {
|
|
11
12
|
let preparedInput;
|
|
12
13
|
if (options.Content) {
|
|
@@ -116,20 +117,33 @@ function DateFormatter(input, options, strictFormatting = false) {
|
|
|
116
117
|
}
|
|
117
118
|
exports.DateFormatter = DateFormatter;
|
|
118
119
|
function StringFormatter(input, options = {}, rowNode, column, api) {
|
|
120
|
+
let normalisedTextInput = input;
|
|
121
|
+
if (input != undefined && typeof input !== 'string') {
|
|
122
|
+
const warningMessage = column
|
|
123
|
+
? `StringFormatter: input '${input}' from column ${column.columnId} (${column.dataType}) is not a string, but a ${typeof input}`
|
|
124
|
+
: `StringFormatter: input '${input}' is not a string, received ${typeof input}`;
|
|
125
|
+
if (api) {
|
|
126
|
+
api.logWarn(warningMessage);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.warn(warningMessage);
|
|
130
|
+
}
|
|
131
|
+
normalisedTextInput = `${input}`;
|
|
132
|
+
}
|
|
119
133
|
let preparedInput;
|
|
120
134
|
if (options.Content) {
|
|
121
135
|
const context = {
|
|
122
136
|
column,
|
|
123
137
|
rowNode,
|
|
124
|
-
input,
|
|
138
|
+
input: normalisedTextInput,
|
|
125
139
|
api,
|
|
126
140
|
};
|
|
127
141
|
preparedInput = formatPlaceholder(options.Content, context);
|
|
128
142
|
}
|
|
129
143
|
else {
|
|
130
|
-
preparedInput =
|
|
144
|
+
preparedInput = normalisedTextInput;
|
|
131
145
|
}
|
|
132
|
-
if (preparedInput
|
|
146
|
+
if (StringExtensions_1.default.IsNullOrEmptyOrWhiteSpace(preparedInput)) {
|
|
133
147
|
return undefined;
|
|
134
148
|
}
|
|
135
149
|
if (options.Empty) {
|
|
@@ -21,7 +21,7 @@ const LayoutColumnFilter = (props) => {
|
|
|
21
21
|
...props.columnFilter,
|
|
22
22
|
ColumnId: props.columnFilter.ColumnId,
|
|
23
23
|
Predicates: newAdaptablePredicates,
|
|
24
|
-
|
|
24
|
+
PredicatesOperator: newPredicate.operator,
|
|
25
25
|
};
|
|
26
26
|
props.onColumnFilterChange(newFilter);
|
|
27
27
|
};
|
|
@@ -35,7 +35,7 @@ const useAdaptableFilterWrapper = (columnId, handleOnChangeOverride) => {
|
|
|
35
35
|
...columnFilter,
|
|
36
36
|
ColumnId: columnId,
|
|
37
37
|
Predicates: adaptablePredicate,
|
|
38
|
-
|
|
38
|
+
PredicatesOperator: logic,
|
|
39
39
|
};
|
|
40
40
|
if (handleOnChangeOverride) {
|
|
41
41
|
handleOnChangeOverride(newFilter);
|
|
@@ -85,7 +85,7 @@ const isPredicateEmpty = (predicate, predicateDef) => {
|
|
|
85
85
|
};
|
|
86
86
|
exports.isPredicateEmpty = isPredicateEmpty;
|
|
87
87
|
const mapColumnFilterToQlPredicate = (columnFilter, abColumn, qlPredicateDefs, columnFilterOptions) => {
|
|
88
|
-
const combinator = columnFilter?.
|
|
88
|
+
const combinator = columnFilter?.PredicatesOperator ?? 'AND';
|
|
89
89
|
const qlPredicate = {
|
|
90
90
|
operator: combinator,
|
|
91
91
|
args: (columnFilter?.Predicates ?? []).map?.(exports.mapAdaptablePredicateToQlPredicate),
|
|
@@ -18,7 +18,7 @@ const useQuickSearchDebounced_1 = require("./useQuickSearchDebounced");
|
|
|
18
18
|
const QuickSearchPopupComponent = (props) => {
|
|
19
19
|
const [searchText, search] = (0, useQuickSearchDebounced_1.useQuickSearchDebounced)(props);
|
|
20
20
|
const [state, setState] = (0, react_1.useState)({
|
|
21
|
-
RunQueryAfterQuickSearch: props.api.optionsApi.getQuickSearchOptions().
|
|
21
|
+
RunQueryAfterQuickSearch: props.api.optionsApi.getQuickSearchOptions().filterGridAfterQuickSearch,
|
|
22
22
|
EditedStyle: props.QuickSearchStyle,
|
|
23
23
|
});
|
|
24
24
|
const onUpdateStyle = (style) => {
|
|
@@ -27,7 +27,7 @@ const QuickSearchPopupComponent = (props) => {
|
|
|
27
27
|
};
|
|
28
28
|
const onQuickSearchBehaviourChange = (checked) => {
|
|
29
29
|
setState({ ...state, RunQueryAfterQuickSearch: checked });
|
|
30
|
-
props.api.optionsApi.getAdaptableOptions().quickSearchOptions.
|
|
30
|
+
props.api.optionsApi.getAdaptableOptions().quickSearchOptions.filterGridAfterQuickSearch =
|
|
31
31
|
checked;
|
|
32
32
|
};
|
|
33
33
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: props.moduleInfo.FriendlyName, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
@@ -3,14 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AdaptableStatusBar = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const react_redux_1 = require("react-redux");
|
|
7
8
|
const rebass_1 = require("rebass");
|
|
8
9
|
const StatusBarRedux_1 = require("../../Redux/ActionsReducers/StatusBarRedux");
|
|
9
10
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
10
11
|
const StatusBarPanel_1 = require("./StatusBarPanel");
|
|
12
|
+
const useRerender_1 = require("../../components/utils/useRerender");
|
|
11
13
|
const AdaptableStatusBar = (props) => {
|
|
12
|
-
const statusPanels = (0, react_redux_1.useSelector)(StatusBarRedux_1.getStatusPanelsSelector);
|
|
13
14
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
15
|
+
const rerender = (0, useRerender_1.useRerender)();
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
return adaptable.api.eventApi.on('AdaptableStateChanged', rerender);
|
|
18
|
+
}, [adaptable]);
|
|
19
|
+
const statusPanels = (0, react_redux_1.useSelector)(StatusBarRedux_1.getStatusPanelsSelector);
|
|
14
20
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
21
|
const statusSubPanels = statusPanels.find((statusPanel) => statusPanel.Key === props.context.Key);
|
|
16
22
|
const allMenuItems = (0, react_redux_1.useSelector)((state) => state?.Internal?.SettingsPanelModuleEntries);
|
|
@@ -104,6 +104,11 @@ const VersionUpgrade20_1 = require("../migration/VersionUpgrade20");
|
|
|
104
104
|
const LocalEventService_Prototype = ag_grid_enterprise_1.LocalEventService.prototype;
|
|
105
105
|
const LocalEventService_dispatchEvent = LocalEventService_Prototype.dispatchEvent;
|
|
106
106
|
LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
107
|
+
const agGridApi = event.api;
|
|
108
|
+
if (agGridApi?.isDestroyed()) {
|
|
109
|
+
// do nothing if AG Grid was destroyed in the meantime
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
107
112
|
LocalEventService_dispatchEvent.apply(this, arguments);
|
|
108
113
|
if (event.type === 'cellChanged' || event.type === 'dataChanged') {
|
|
109
114
|
const eventRowNode = event.node;
|
|
@@ -123,6 +128,10 @@ LocalEventService_Prototype.dispatchEvent = function (event) {
|
|
|
123
128
|
// so IGNORE IT
|
|
124
129
|
return;
|
|
125
130
|
}
|
|
131
|
+
if (adaptable.isDestroyed) {
|
|
132
|
+
// do nothing if adaptable is destroyed (this is a rare case and happens when Adaptable is quickly destroyed and recreated)
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
126
135
|
// we're on the correct instance, so do this
|
|
127
136
|
//@ts-ignore
|
|
128
137
|
const fn = adaptable.rowListeners ? adaptable.rowListeners[event.type] : null;
|
|
@@ -358,7 +367,7 @@ class AdaptableAgGrid {
|
|
|
358
367
|
this.lifecycleState = 'initAgGrid';
|
|
359
368
|
this.agGridAdapter.initialGridOptions = gridOptions;
|
|
360
369
|
const perfInitAgGrid = this.logger.beginPerf(`initAgGrid()`);
|
|
361
|
-
// AG Grid evaluates early on the floatingFilter params, so we need to "
|
|
370
|
+
// AG Grid evaluates early on the floatingFilter params, so we need to "suppress" the floating filter temporarily
|
|
362
371
|
// we will reset it once Adaptable is ready
|
|
363
372
|
this.agGridColumnAdapter.setupColumnFloatingFilterTemporarily(gridOptions);
|
|
364
373
|
this.validateColumnDefTypes(gridOptions.columnDefs);
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "20.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1742230358395 || Date.now(),
|
|
6
|
+
VERSION: "20.0.0-canary.19" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -1856,12 +1856,14 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1856
1856
|
desc: string;
|
|
1857
1857
|
isOpt?: undefined;
|
|
1858
1858
|
defVal?: undefined;
|
|
1859
|
+
ref?: undefined;
|
|
1859
1860
|
} | {
|
|
1860
1861
|
name: string;
|
|
1861
1862
|
kind: string;
|
|
1862
1863
|
desc: string;
|
|
1863
1864
|
isOpt: boolean;
|
|
1864
1865
|
defVal: string;
|
|
1866
|
+
ref: string;
|
|
1865
1867
|
})[];
|
|
1866
1868
|
};
|
|
1867
1869
|
ColumnFilterDef: {
|
|
@@ -4466,6 +4468,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
4466
4468
|
gridInfo?: undefined;
|
|
4467
4469
|
})[];
|
|
4468
4470
|
};
|
|
4471
|
+
PredicatesOperator: {
|
|
4472
|
+
name: string;
|
|
4473
|
+
kind: string;
|
|
4474
|
+
desc: string;
|
|
4475
|
+
};
|
|
4469
4476
|
PreProcessExportContext: {
|
|
4470
4477
|
name: string;
|
|
4471
4478
|
kind: string;
|