@adaptabletools/adaptable-cjs 23.0.0-canary.2 → 23.0.0-canary.4
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/index.css +68 -73
- package/package.json +1 -1
- package/src/AdaptableOptions/DefaultAdaptableOptions.js +0 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +0 -7
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +1 -3
- package/src/AdaptableState/Common/AdaptableForm.d.ts +18 -1
- package/src/AdaptableState/Common/AdaptableForm.js +34 -0
- package/src/AdaptableState/Common/AdaptableFormat.d.ts +1 -1
- package/src/AdaptableState/Common/CellDataChangedInfo.d.ts +3 -2
- package/src/AdaptableState/Common/Enums.d.ts +0 -5
- package/src/AdaptableState/Common/Enums.js +1 -7
- package/src/Api/EventApi.d.ts +1 -1
- package/src/Api/Events/ReportScheduleRan.d.ts +4 -0
- package/src/Api/Implementation/LayoutHelpers.js +12 -0
- package/src/Api/Internal/EventInternalApi.js +2 -1
- package/src/Strategy/CalculatedColumnModule.js +3 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +1 -0
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +7 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.d.ts +4 -0
- package/src/Utilities/Services/CalculatedColumnSyntheticChange.js +120 -0
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +1 -0
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +8 -16
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonInfo.js +4 -4
- package/src/View/Components/ColumnFilter/AdaptableColumnFilter.js +1 -1
- package/src/View/Components/ColumnFilter/ColumnFilter.js +15 -5
- package/src/View/Components/ColumnFilter/ColumnFilterWindow.js +1 -1
- package/src/View/Components/ColumnFilter/FloatingFilter.js +57 -59
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -1
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +2 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -0
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +3 -8
- package/src/View/GridFilter/GridFilterViewPanel.js +1 -1
- package/src/View/Layout/LayoutViewPanel.js +23 -21
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +3 -3
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardScopeSection.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/View/renderWithAdaptableContext.js +1 -2
- package/src/agGrid/AdaptableAgGrid.d.ts +0 -1
- package/src/agGrid/AdaptableAgGrid.js +3 -18
- package/src/agGrid/AgGridColumnAdapter.js +1 -4
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +10 -5
- package/src/components/Card/index.js +1 -1
- package/src/components/Combobox/VirtualizedList.js +5 -5
- package/src/components/Combobox/comboboxUtils.d.ts +4 -1
- package/src/components/Combobox/comboboxUtils.js +2 -0
- package/src/components/Combobox/index.d.ts +1 -0
- package/src/components/Combobox/index.js +39 -13
- package/src/components/Datepicker/index.js +2 -2
- package/src/components/Dialog/index.js +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/Dropdown/Arrows.js +0 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/index.js +1 -1
- package/src/components/Input/index.js +1 -1
- package/src/components/NewDropdownButton/index.d.ts +1 -0
- package/src/components/NewDropdownButton/index.js +2 -2
- package/src/components/NewSelect/index.d.ts +2 -0
- package/src/components/NewSelect/index.js +10 -7
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +1 -1
- package/src/components/Tabs/index.js +1 -1
- package/src/components/Tree/TreeDropdown/index.js +5 -13
- package/src/components/ui/button.d.ts +5 -2
- package/src/components/ui/button.js +8 -6
- package/src/components/ui/combobox.d.ts +16 -16
- package/src/components/ui/combobox.js +48 -49
- package/src/components/ui/input-group.d.ts +10 -9
- package/src/components/ui/input-group.js +19 -16
- package/src/components/ui/input.d.ts +2 -2
- package/src/components/ui/input.js +7 -4
- package/src/components/ui/popover.d.ts +5 -5
- package/src/components/ui/popover.js +5 -5
- package/src/components/ui/select.d.ts +7 -6
- package/src/components/ui/select.js +19 -17
- package/src/components/ui/textarea.d.ts +2 -2
- package/src/components/ui/textarea.js +7 -4
- package/src/components/ui/tooltip.d.ts +6 -5
- package/src/components/ui/tooltip.js +10 -7
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +5 -1
- package/src/lib/utils.d.ts +20 -0
- package/src/lib/utils.js +48 -1
- package/src/metamodel/adaptable.metamodel.d.ts +7 -19
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade23.d.ts +2 -3
- package/src/migration/VersionUpgrade23.js +4 -16
- package/src/types.d.ts +0 -1
- package/themes/dark.css +7 -17
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/AdaptableState/Common/FilterActionOnDataChange.d.ts +0 -17
- package/src/AdaptableState/Common/FilterActionOnDataChange.js +0 -5
- package/src/View/AdaptableComputedCSSVarsContext.d.ts +0 -12
- package/src/View/AdaptableComputedCSSVarsContext.js +0 -36
- package/src/components/Select/CSSNumericVariableWatch.d.ts +0 -11
- package/src/components/Select/CSSNumericVariableWatch.js +0 -51
|
@@ -103,7 +103,8 @@ class EventInternalApi extends ApiBase_1.ApiBase {
|
|
|
103
103
|
fireScheduledReportRanEvent(reportSchedule) {
|
|
104
104
|
const reportScheduleRanInfo = {
|
|
105
105
|
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
106
|
-
reportSchedule
|
|
106
|
+
reportSchedule,
|
|
107
|
+
RanAt: new Date().toISOString(),
|
|
107
108
|
};
|
|
108
109
|
this.getEventApi().emit('ReportScheduleRan', reportScheduleRanInfo);
|
|
109
110
|
}
|
|
@@ -36,7 +36,9 @@ class CalculatedColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
36
36
|
this.api.internalApi
|
|
37
37
|
.getDataService()
|
|
38
38
|
.on('CellDataChanged', (cellDataChangedInfo) => {
|
|
39
|
-
if (cellDataChangedInfo.trigger !== 'aggChange' &&
|
|
39
|
+
if (cellDataChangedInfo.trigger !== 'aggChange' &&
|
|
40
|
+
cellDataChangedInfo.trigger !== 'calculatedColumnChange' &&
|
|
41
|
+
!cellDataChangedInfo.preventEdit) {
|
|
40
42
|
this.api.internalApi
|
|
41
43
|
.getCalculatedColumnExpressionService()
|
|
42
44
|
.listentoCellDataChange(cellDataChangedInfo);
|
|
@@ -8,6 +8,7 @@ export declare class CalculatedColumnExpressionService implements ICalculatedCol
|
|
|
8
8
|
private adaptableApi;
|
|
9
9
|
private aggregatedScalarLiveValuesMap;
|
|
10
10
|
constructor(adaptableApi: AdaptableApi);
|
|
11
|
+
buildSyntheticCellDataChangedInfosForCalcColumns(cellDataChangedInfo: CellDataChangedInfo): CellDataChangedInfo[];
|
|
11
12
|
listentoCellDataChange(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
12
13
|
listentoRowDataChange(rowDataChangedInfo: RowDataChangedInfo): void;
|
|
13
14
|
destroy(): void;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CalculatedColumnExpressionService = void 0;
|
|
4
4
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
5
5
|
const AggregatedScalarLiveValue_1 = require("./AggregatedScalarLiveValue");
|
|
6
|
+
const CalculatedColumnSyntheticChange_1 = require("./CalculatedColumnSyntheticChange");
|
|
6
7
|
class CalculatedColumnExpressionService {
|
|
7
8
|
adaptableApi;
|
|
8
9
|
aggregatedScalarLiveValuesMap = new Map();
|
|
@@ -10,7 +11,13 @@ class CalculatedColumnExpressionService {
|
|
|
10
11
|
this.adaptableApi = adaptableApi;
|
|
11
12
|
this.adaptableApi = adaptableApi;
|
|
12
13
|
}
|
|
14
|
+
buildSyntheticCellDataChangedInfosForCalcColumns(cellDataChangedInfo) {
|
|
15
|
+
return (0, CalculatedColumnSyntheticChange_1.buildSyntheticCellDataChangedInfosForCalcColumns)(this.adaptableApi, cellDataChangedInfo);
|
|
16
|
+
}
|
|
13
17
|
listentoCellDataChange(cellDataChangedInfo) {
|
|
18
|
+
if (cellDataChangedInfo.trigger === 'calculatedColumnChange') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
14
21
|
const refreshedCalculatedColumns = [];
|
|
15
22
|
this.aggregatedScalarLiveValuesMap.forEach((aggregatedScalarLiveValue, calculatedColumnId) => {
|
|
16
23
|
const calculatedColumn = this.adaptableApi.calculatedColumnApi.getCalculatedColumnById(calculatedColumnId);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AdaptableApi } from '../../types';
|
|
2
|
+
import { CellDataChangedInfo } from '../../AdaptableState/Common/CellDataChangedInfo';
|
|
3
|
+
export declare function buildSyntheticCellDataChangedInfosForCalcColumns(adaptableApi: AdaptableApi, info: CellDataChangedInfo): CellDataChangedInfo[];
|
|
4
|
+
export declare function expandCellDataChangedInfosWithCalculatedColumns(adaptableApi: AdaptableApi, cellDataChangedInfos: CellDataChangedInfo[]): CellDataChangedInfo[];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildSyntheticCellDataChangedInfosForCalcColumns = buildSyntheticCellDataChangedInfosForCalcColumns;
|
|
4
|
+
exports.expandCellDataChangedInfosWithCalculatedColumns = expandCellDataChangedInfosWithCalculatedColumns;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const parser = tslib_1.__importStar(require("../../parser/src"));
|
|
7
|
+
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
8
|
+
const Helper_1 = tslib_1.__importDefault(require("../Helpers/Helper"));
|
|
9
|
+
function isScalarCalculatedColumn(calculatedColumn) {
|
|
10
|
+
return !!calculatedColumn.Query?.ScalarExpression;
|
|
11
|
+
}
|
|
12
|
+
function collectDependentScalarCalculatedColumns(adaptableApi, rootColumnId) {
|
|
13
|
+
const collected = [];
|
|
14
|
+
const seenCalcColumnIds = new Set();
|
|
15
|
+
const queue = [rootColumnId];
|
|
16
|
+
while (queue.length > 0) {
|
|
17
|
+
const columnId = queue.shift();
|
|
18
|
+
const adaptableColumn = adaptableApi.columnApi.getColumnWithColumnId(columnId);
|
|
19
|
+
if (!adaptableColumn) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const dependentColumnIds = adaptableApi.calculatedColumnApi.internalApi.getCalculatedColumnsDependentOnColumn(adaptableColumn);
|
|
23
|
+
dependentColumnIds.forEach((dependentColumnId) => {
|
|
24
|
+
if (seenCalcColumnIds.has(dependentColumnId)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const calculatedColumn = adaptableApi.calculatedColumnApi.getCalculatedColumnForColumnId(dependentColumnId);
|
|
28
|
+
if (!calculatedColumn || !isScalarCalculatedColumn(calculatedColumn)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
seenCalcColumnIds.add(dependentColumnId);
|
|
32
|
+
collected.push(calculatedColumn);
|
|
33
|
+
queue.push(dependentColumnId);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return collected;
|
|
37
|
+
}
|
|
38
|
+
function buildShadowRowData(adaptableApi, info) {
|
|
39
|
+
const shadowData = Helper_1.default.cloneObject(info.rowNode?.data ?? info.rowData ?? {});
|
|
40
|
+
const fieldName = info.column.field ?? info.column.columnId;
|
|
41
|
+
adaptableApi.internalApi.setValueUsingField(shadowData, fieldName, info.oldValue);
|
|
42
|
+
return shadowData;
|
|
43
|
+
}
|
|
44
|
+
function evaluateScalarExpressionWithShadowData(adaptableApi, calculatedColumn, rowNode, shadowData) {
|
|
45
|
+
const internalApi = adaptableApi.internalApi;
|
|
46
|
+
const moduleFns = internalApi
|
|
47
|
+
.getQueryLanguageService()
|
|
48
|
+
.getModuleExpressionFunctionsMap(ModuleConstants_1.CalculatedColumnModuleId);
|
|
49
|
+
const baseFunctions = { ...moduleFns.booleanFunctions, ...moduleFns.scalarFunctions };
|
|
50
|
+
const resolveColumnValue = (columnId) => {
|
|
51
|
+
const childCalculatedColumn = adaptableApi.calculatedColumnApi.getCalculatedColumnForColumnId(columnId);
|
|
52
|
+
if (childCalculatedColumn?.Query?.ScalarExpression) {
|
|
53
|
+
return evaluateScalarExpressionWithShadowData(adaptableApi, childCalculatedColumn, rowNode, shadowData);
|
|
54
|
+
}
|
|
55
|
+
const adaptableColumn = adaptableApi.columnApi.getColumnWithColumnId(columnId);
|
|
56
|
+
return internalApi.getValueUsingField(shadowData, adaptableColumn?.field ?? columnId);
|
|
57
|
+
};
|
|
58
|
+
const customFunctions = {
|
|
59
|
+
...baseFunctions,
|
|
60
|
+
COL: {
|
|
61
|
+
...baseFunctions.COL,
|
|
62
|
+
handler: (args) => resolveColumnValue(args[0]),
|
|
63
|
+
},
|
|
64
|
+
FIELD: {
|
|
65
|
+
...baseFunctions.FIELD,
|
|
66
|
+
handler: (args) => internalApi.getValueUsingField(shadowData, args[0]),
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
return parser.evaluate(calculatedColumn.Query.ScalarExpression, {
|
|
70
|
+
node: { ...rowNode, data: shadowData },
|
|
71
|
+
functions: customFunctions,
|
|
72
|
+
...internalApi.buildBaseContext(),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function buildSyntheticCellDataChangedInfosForCalcColumns(adaptableApi, info) {
|
|
76
|
+
if (!info.rowNode ||
|
|
77
|
+
info.preventEdit ||
|
|
78
|
+
info.trigger === 'undo' ||
|
|
79
|
+
info.trigger === 'aggChange' ||
|
|
80
|
+
info.trigger === 'calculatedColumnChange') {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
const calculatedColumns = collectDependentScalarCalculatedColumns(adaptableApi, info.column.columnId);
|
|
84
|
+
if (!calculatedColumns.length) {
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
const shadowData = buildShadowRowData(adaptableApi, info);
|
|
88
|
+
const expressionService = adaptableApi.internalApi.getCalculatedColumnExpressionService();
|
|
89
|
+
const syntheticEvents = [];
|
|
90
|
+
calculatedColumns.forEach((calculatedColumn) => {
|
|
91
|
+
const oldValue = evaluateScalarExpressionWithShadowData(adaptableApi, calculatedColumn, info.rowNode, shadowData);
|
|
92
|
+
const newValue = expressionService.evaluateCalculatedColumnQuery(calculatedColumn, info.rowNode);
|
|
93
|
+
if (oldValue == newValue) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const column = adaptableApi.columnApi.getColumnWithColumnId(calculatedColumn.ColumnId);
|
|
97
|
+
if (!column) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
syntheticEvents.push(adaptableApi.internalApi.buildCellDataChangedInfo({
|
|
101
|
+
oldValue,
|
|
102
|
+
newValue,
|
|
103
|
+
column,
|
|
104
|
+
primaryKeyValue: info.primaryKeyValue,
|
|
105
|
+
rowNode: info.rowNode,
|
|
106
|
+
trigger: 'calculatedColumnChange',
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
return syntheticEvents;
|
|
110
|
+
}
|
|
111
|
+
function expandCellDataChangedInfosWithCalculatedColumns(adaptableApi, cellDataChangedInfos) {
|
|
112
|
+
if (!cellDataChangedInfos.length) {
|
|
113
|
+
return cellDataChangedInfos;
|
|
114
|
+
}
|
|
115
|
+
const syntheticEvents = cellDataChangedInfos.flatMap((info) => buildSyntheticCellDataChangedInfosForCalcColumns(adaptableApi, info));
|
|
116
|
+
if (!syntheticEvents.length) {
|
|
117
|
+
return cellDataChangedInfos;
|
|
118
|
+
}
|
|
119
|
+
return [...cellDataChangedInfos, ...syntheticEvents];
|
|
120
|
+
}
|
|
@@ -11,4 +11,5 @@ export interface ICalculatedColumnExpressionService extends IAdaptableService {
|
|
|
11
11
|
destroyAggregatedScalarLiveValue(calculatedColumn: CalculatedColumn): void;
|
|
12
12
|
listentoCellDataChange(cellDataChangedInfo: CellDataChangedInfo): void;
|
|
13
13
|
listentoRowDataChange(rowDataChangedInfo: RowDataChangedInfo): void;
|
|
14
|
+
buildSyntheticCellDataChangedInfosForCalcColumns(cellDataChangedInfo: CellDataChangedInfo): CellDataChangedInfo[];
|
|
14
15
|
}
|
|
@@ -29,7 +29,7 @@ class AdaptablePopover extends React.Component {
|
|
|
29
29
|
const openOnHover = showEvent === 'mouseenter';
|
|
30
30
|
const triggerElement = useButton ? ((0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { style: iconStyle, variant: "text", onClick: () => null, icon: showIcon && icon, tooltip: this.props.tooltipText, disabled: this.props.disabled, children: this.props.children })) : ((0, jsx_runtime_1.jsxs)("div", { title: this.props.tooltipText, tabIndex: 0, style: { cursor: 'pointer', display: 'inline-block' }, children: [this.props.children, showIcon && (0, jsx_runtime_1.jsx)(icons_1.Icon, { name: icon, style: iconStyle })] }));
|
|
31
31
|
const controlledProps = this.props.visible !== undefined ? { open: this.props.visible } : {};
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: this.props.className, children: (0, jsx_runtime_1.jsxs)(popover_1.Popover, { ...controlledProps, children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { nativeButton: !!useButton, openOnHover: openOnHover, delay: 0, closeDelay: 0, render: triggerElement }), (0, jsx_runtime_1.jsxs)(popover_1.PopoverContent, { align: "start", sideOffset: 10, className: "ab-Popover twa:w-auto twa:gap-0 twa:p-0", style: {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { alignItems: "center", className: this.props.className, children: (0, jsx_runtime_1.jsxs)(popover_1.Popover, { ...controlledProps, children: [(0, jsx_runtime_1.jsx)(popover_1.PopoverTrigger, { nativeButton: !!useButton, openOnHover: openOnHover, delay: 0, closeDelay: 0, render: triggerElement }), (0, jsx_runtime_1.jsxs)(popover_1.PopoverContent, { align: "start", sideOffset: 10, className: "ab-Popover twa:border twa:border-primarylight twa:w-auto twa:gap-0 twa:p-0", style: {
|
|
33
33
|
minWidth: popoverMinWidth,
|
|
34
34
|
maxWidth: this.props.popoverMaxWidth ?? 300,
|
|
35
35
|
}, children: [title ? (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-4 twa:p-2", children: title }) : null, (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: `ab-Popover__body ${(this.props.popupPadding ?? 2) === 0 ? 'twa:p-0' : 'twa:p-2'}`, children: this.props.bodyText.map((textOrHTML, index) => ((0, jsx_runtime_1.jsx)("span", { children: textOrHTML }, index))) })] })] }) }));
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const CheckBox_1 = require("../../../../components/CheckBox");
|
|
8
|
-
const
|
|
8
|
+
const NewSelect_1 = require("../../../../components/NewSelect");
|
|
9
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
|
|
10
10
|
const chartingHelper_1 = require("../../../../Utilities/Helpers/chartingHelper");
|
|
11
11
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../../Components/AdaptableInput"));
|
|
@@ -40,28 +40,20 @@ const SettingsSection = (props) => {
|
|
|
40
40
|
});
|
|
41
41
|
}, [props.chartDefinition]);
|
|
42
42
|
const aggFuncs = ['sum', 'min', 'max', 'count', 'avg', 'first', 'last'];
|
|
43
|
-
const aggFuncsOptions = aggFuncs.map((aggFunc) => ({
|
|
44
|
-
label: aggFunc,
|
|
45
|
-
onClick: () => {
|
|
46
|
-
props.onChange({
|
|
47
|
-
...props.chartDefinition,
|
|
48
|
-
Model: {
|
|
49
|
-
...props.chartDefinition.Model,
|
|
50
|
-
aggFunc,
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
},
|
|
54
|
-
}));
|
|
55
43
|
const aggFunc = props.chartDefinition.Model.aggFunc;
|
|
56
|
-
const
|
|
44
|
+
const handleAggFuncChange = React.useCallback((value) => {
|
|
57
45
|
props.onChange({
|
|
58
46
|
...props.chartDefinition,
|
|
59
47
|
Model: {
|
|
60
48
|
...props.chartDefinition.Model,
|
|
61
|
-
aggFunc:
|
|
49
|
+
aggFunc: value,
|
|
62
50
|
},
|
|
63
51
|
});
|
|
64
52
|
}, [props.chartDefinition]);
|
|
65
|
-
|
|
53
|
+
const aggFuncsOptions = aggFuncs.map((option) => ({
|
|
54
|
+
label: option,
|
|
55
|
+
value: option,
|
|
56
|
+
}));
|
|
57
|
+
return ((0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Name", children: (0, jsx_runtime_1.jsx)(AdaptableInput_1.default, { onChange: handleNameChange, value: props.chartDefinition.Name }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Unlink Chart", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onClick: handleUnLinkChange, checked: props.chartDefinition.Model.unlinkChart }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Suppress Chart Ranges", children: (0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onClick: handleSuppressChartRanges, checked: props.chartDefinition.Model.suppressChartRanges }) }), props.chartDefinition.Model.modelType === 'range' && typeof aggFunc !== 'function' && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: "Agg Func", children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { placeholder: "Select", items: aggFuncsOptions, value: aggFunc || undefined, onValueChange: handleAggFuncChange }) }))] }));
|
|
66
58
|
};
|
|
67
59
|
exports.SettingsSection = SettingsSection;
|
|
@@ -4,4 +4,4 @@ export interface InfoButtonProps extends SimpleButtonProps {
|
|
|
4
4
|
glyph?: string;
|
|
5
5
|
tooltip?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const ButtonInfo: React.
|
|
7
|
+
export declare const ButtonInfo: React.ForwardRefExoticComponent<Omit<InfoButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ButtonInfo = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
7
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
7
|
-
|
|
8
|
-
return ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { "data-name": "info", iconSize: 20, icon: "info", variant: "raised", tone: "accent", ...props }));
|
|
9
|
-
};
|
|
10
|
-
exports.ButtonInfo = ButtonInfo;
|
|
8
|
+
exports.ButtonInfo = React.forwardRef(function ButtonInfo(props, ref) {
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { ref: ref, "data-name": "info", iconSize: 20, icon: "info", variant: "raised", tone: "accent", ...props }));
|
|
10
|
+
});
|
|
@@ -25,7 +25,7 @@ const AdaptableColumnFilter = (props) => {
|
|
|
25
25
|
handlePredicateChange(predicate);
|
|
26
26
|
}, [handlePredicateChange]) }) }));
|
|
27
27
|
if (props.location === 'filtersToolPanel') {
|
|
28
|
-
return ((0, jsx_runtime_1.jsx)(Panel_1.default, { className: "twa:
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(Panel_1.default, { className: "twa:p-1", bodyProps: { className: 'twa:p-0 twa:border-none' }, children: filterContent }));
|
|
29
29
|
}
|
|
30
30
|
return filterContent;
|
|
31
31
|
};
|
|
@@ -15,11 +15,13 @@ const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
|
15
15
|
const twMerge_1 = require("../../../twMerge");
|
|
16
16
|
const NewSelect_1 = require("../../../components/NewSelect");
|
|
17
17
|
const columnFilterLocation_1 = require("./columnFilterLocation");
|
|
18
|
+
const utils_2 = require("../../../lib/utils");
|
|
18
19
|
const ColumnFilterPredicateDropdown = (props) => {
|
|
19
20
|
const predicateDef = (0, hooks_1.usePredicateDef)(props.predicate?.operator, props.predicateDefs);
|
|
20
21
|
const options = props.predicateDefs.map((predicateDef) => {
|
|
21
22
|
return {
|
|
22
|
-
label: ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:items-center", children: [(0, jsx_runtime_1.jsx)(SimpleButton_1.default, { as: "span", variant: "raised", className: "twa:mr-2", tone: "accent", children: predicateDef.icon }), predicateDef.label] })),
|
|
23
|
+
label: ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:items-center", children: [(0, jsx_runtime_1.jsx)(SimpleButton_1.default, { as: "span", variant: "raised", className: "twa:mr-2 twa:p-0.5", tone: "accent", children: predicateDef.icon }), predicateDef.label] })),
|
|
24
|
+
tooltip: predicateDef.label,
|
|
23
25
|
value: predicateDef.operator,
|
|
24
26
|
};
|
|
25
27
|
});
|
|
@@ -27,15 +29,14 @@ const ColumnFilterPredicateDropdown = (props) => {
|
|
|
27
29
|
const isAndOr = operator === 'AND' || operator === 'OR';
|
|
28
30
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex twa:items-center ab-ColumnFilterPredicateDropdown twa:p-0.5", style: {
|
|
29
31
|
//@ts-ignore ignore
|
|
30
|
-
'--ab-cmp-input__background': 'var(--ab-color-primary)',
|
|
31
32
|
'--ab-color-input-background': 'var(--ab-color-primary)',
|
|
32
|
-
}, children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { "data-name": "filter-predicate-dropdown",
|
|
33
|
+
}, children: (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { "data-name": "filter-predicate-dropdown", extraWidthChars: 8,
|
|
33
34
|
// The trigger lives inside ag-grid's column menu, which closes itself
|
|
34
35
|
// on mousedowns outside its DOM subtree. Since the popup is portaled
|
|
35
36
|
// to `document.body`, mousedowns inside it would otherwise bubble to
|
|
36
37
|
// `document` and unmount the trigger mid-interaction (causing the
|
|
37
38
|
// popup to re-align to (0,0) before disappearing).
|
|
38
|
-
stopMouseDownPropagation: true, className: predicateDef ? `twa:min-w-[10rem]` : null, onValueChange: (value) => {
|
|
39
|
+
stopMouseDownPropagation: true, showItemTooltip: true, className: predicateDef ? `twa:min-w-[10rem]` : null, onValueChange: (value) => {
|
|
39
40
|
props.onPredicateChange({
|
|
40
41
|
operator: value,
|
|
41
42
|
args: [],
|
|
@@ -64,6 +65,7 @@ const AndOrInput = (props) => {
|
|
|
64
65
|
const ColumnFilterComponent = (props) => {
|
|
65
66
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
66
67
|
const manuallyApplyColumnFilter = adaptable.api.filterApi.columnFilterApi.internalApi.shouldManuallyApplyColumnFilter(props.columnId);
|
|
68
|
+
const rootRef = React.useRef(null);
|
|
67
69
|
const contentWrapperRef = React.useRef(null);
|
|
68
70
|
React.useEffect(() => {
|
|
69
71
|
if (props.location !== 'columnMenu')
|
|
@@ -73,6 +75,14 @@ const ColumnFilterComponent = (props) => {
|
|
|
73
75
|
const dropdown = contentWrapperRef.current?.querySelector('[data-name="filter-predicate-dropdown"]');
|
|
74
76
|
dropdown?.focus();
|
|
75
77
|
}, [props.location]);
|
|
78
|
+
// When rendered inside ag-grid's column menu, Tabbing would otherwise escape
|
|
79
|
+
// to the surrounding menu/grid. Trap focus so Tab / Shift+Tab cycle within the filter.
|
|
80
|
+
const handleFocusTrap = React.useCallback((e) => {
|
|
81
|
+
if (props.location !== 'columnMenu') {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
(0, utils_2.captureTab)(rootRef.current, e);
|
|
85
|
+
}, [props.location]);
|
|
76
86
|
const [predicateNotYetApplied, setPredicateNotYetApplied] = React.useState(props.predicate);
|
|
77
87
|
const applyFilter = () => {
|
|
78
88
|
props.onPredicateChange(currentPredicateRef.current);
|
|
@@ -133,7 +143,7 @@ const ColumnFilterComponent = (props) => {
|
|
|
133
143
|
.map((qlPredicate) => (0, utils_1.mapQlPredicateToAdaptablePredicate)(qlPredicate))
|
|
134
144
|
.some((adaptablePredicate) => adaptable.api.predicateApi.isValidPredicate(adaptablePredicate));
|
|
135
145
|
};
|
|
136
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
146
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: rootRef, onKeyDown: handleFocusTrap, className: "twa:contents", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: (0, clsx_1.default)({
|
|
137
147
|
'twa:pb-2': !props.hideActionButtons,
|
|
138
148
|
'twa:mb-2': (0, columnFilterLocation_1.isEmbeddedColumnFilterLocation)(props.location),
|
|
139
149
|
'twa:mt-2 twa:ml-2 twa:mr-2': props.location === 'columnMenu',
|
|
@@ -32,6 +32,6 @@ const ColumnFilterWindow = (props) => {
|
|
|
32
32
|
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { children: [label, (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1" }), (0, jsx_runtime_1.jsx)(AdaptableIconComponent_1.AdaptableIconComponent, { icon: { name: 'filter' } })] }));
|
|
33
33
|
}
|
|
34
34
|
return label;
|
|
35
|
-
}, onChange: (column) => setColumnId(column), filterColumn: (column) => column.queryable,
|
|
35
|
+
}, onChange: (column) => setColumnId(column), filterColumn: (column) => column.queryable, value: columnId }) }) }) }), (0, jsx_runtime_1.jsx)(AdaptableColumnFilter_1.AdaptableColumnFilter, { columnId: columnId, location: 'filterForm' })] }));
|
|
36
36
|
};
|
|
37
37
|
exports.ColumnFilterWindow = ColumnFilterWindow;
|
|
@@ -4,11 +4,10 @@ exports.FloatingFilter = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
|
-
const OverlayTrigger_1 = tslib_1.__importDefault(require("../../../components/OverlayTrigger"));
|
|
8
7
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
9
8
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
10
9
|
const AdaptableIconComponent_1 = require("../AdaptableIconComponent");
|
|
11
|
-
const
|
|
10
|
+
const NewSelect_1 = require("../../../components/NewSelect");
|
|
12
11
|
const FloatingFilterInputList_1 = require("./components/FloatingFilterInputList");
|
|
13
12
|
const utils_1 = require("./utils");
|
|
14
13
|
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
@@ -44,75 +43,74 @@ const FloatingFilter = (props) => {
|
|
|
44
43
|
const colDef = adaptable.api.columnApi.getAGGridColDefForColumnId(props.columnId);
|
|
45
44
|
const showExpandFilterButton = colDef?.suppressHeaderFilterButton !== true;
|
|
46
45
|
const handleClear = () => props.onClear?.();
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
46
|
+
const [selectOpen, setSelectOpen] = React.useState(false);
|
|
47
|
+
const currentOperator = props.predicate?.args[0]?.operator;
|
|
48
|
+
const operatorOptions = props.predicateDefs.map((predicateDef) => ({
|
|
49
|
+
label: ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:flex twa:items-center", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:mr-2 twa:flex twa:items-center", children: predicateDef.icon }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:truncate", "data-name": "filter-predicate-label", "data-label": predicateDef.label, children: predicateDef.label })] })),
|
|
50
|
+
tooltip: predicateDef.label,
|
|
51
|
+
value: predicateDef.operator,
|
|
52
|
+
}));
|
|
53
|
+
const renderTriggerValue = () => ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { alignItems: "center", className: "twa:min-w-0", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex twa:items-center", children: !isManualApply && singleFilterPredicateDef?.icon ? (singleFilterPredicateDef?.icon) : ((0, jsx_runtime_1.jsx)(AdaptableIconComponent_1.AdaptableIconComponent, { icon: { name: 'filter' } })) }), showLabel && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-FloatingFilter-label twa:ml-2 twa:flex-1 twa:truncate", title: label, children: label }))] }));
|
|
50
54
|
let filterDropdown = null;
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, "data-value": props.predicate?.args[0]?.operator, onClick: () => {
|
|
56
|
-
if (!isInlineEditable) {
|
|
55
|
+
const filterDropdownSelect = ((0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { chevronIcon: null, "data-name": "floating-filter-button", ariaLabel: "Column Filter Operator Dropdown", size: "small", stopMouseDownPropagation: true, disabled: props.disabled, open: selectOpen, extraWidthChars: 5, onOpenChange: (nextOpen) => {
|
|
56
|
+
// In non-inline mode the select doesn't pick an operator inline; opening it
|
|
57
|
+
// instead opens the full column filter popup, so keep the dropdown closed.
|
|
58
|
+
if (nextOpen && !isInlineEditable) {
|
|
57
59
|
adaptable.api.filterApi.columnFilterApi.internalApi.openColumnFilterPopup(props.columnId);
|
|
60
|
+
return;
|
|
58
61
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
flex: 1,
|
|
67
|
-
}
|
|
68
|
-
: {}),
|
|
69
|
-
}, children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { children: !isManualApply && singleFilterPredicateDef?.icon ? (singleFilterPredicateDef?.icon) : ((0, jsx_runtime_1.jsx)(AdaptableIconComponent_1.AdaptableIconComponent, { icon: { name: 'filter' } })) }), showLabel && ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "ab-FloatingFilter-label twa:ml-2 twa:flex-1", title: label, children: label }))] }));
|
|
62
|
+
setSelectOpen(nextOpen);
|
|
63
|
+
}, value: currentOperator, placeholder: label, items: operatorOptions, showItemTooltip: true, renderValue: renderTriggerValue, onValueChange: (operator) => {
|
|
64
|
+
props.onPredicateChange({
|
|
65
|
+
operator: props.predicate.operator,
|
|
66
|
+
args: [{ operator: operator, args: [] }],
|
|
67
|
+
});
|
|
68
|
+
}, className: (0, utils_2.cn)('twa:self-center twa:mx-0.5 twa:my-0.5 twa:text-left twa:p-0.5 twa:border-none', 'twa:shadow-none', !isInlineEditable && 'twa:min-w-0 twa:flex-1') }));
|
|
70
69
|
if (isInlineEditable) {
|
|
71
|
-
filterDropdown = showQuickFilterDropdown &&
|
|
72
|
-
// we render this only for single filter
|
|
73
|
-
return ((0, jsx_runtime_1.jsx)(ColumnFilterMenu_1.ColumnFilterMenu, { columnId: props.columnId, disabled: props.disabled, predicate: props.predicate.args[0], predicateDefs: props.predicateDefs, onPredicateChange: (predicate) => {
|
|
74
|
-
setOverlayVisible(false);
|
|
75
|
-
props.onPredicateChange({
|
|
76
|
-
operator: props.predicate.operator,
|
|
77
|
-
args: [predicate],
|
|
78
|
-
});
|
|
79
|
-
} }));
|
|
80
|
-
}, children: filterDropdownButton }));
|
|
70
|
+
filterDropdown = showQuickFilterDropdown && filterDropdownSelect;
|
|
81
71
|
}
|
|
82
72
|
else {
|
|
83
|
-
filterDropdown =
|
|
73
|
+
filterDropdown = filterDropdownSelect;
|
|
84
74
|
}
|
|
85
75
|
const showClearButton = isMultiple ||
|
|
86
76
|
!(0, utils_1.isPredicateEmpty)(props.predicate.args[0], singleFilterPredicateDef);
|
|
87
77
|
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { className: "ab-FloatingFilter twa:w-full", onKeyDownCapture: (e) => {
|
|
88
78
|
// AG Grid's header keyboard navigation intercepts Tab and calls preventDefault(),
|
|
89
|
-
// which prevents focus from moving between
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
selectInput.focus();
|
|
102
|
-
// When the DummyInput gets focus the combobox sets isFocused=true,
|
|
103
|
-
// triggering a React re-render. During this re-render, unstable component
|
|
104
|
-
// references can cause the DummyInput to be removed from the DOM and
|
|
105
|
-
// recreated, losing focus. We restore focus after the re-render.
|
|
106
|
-
requestAnimationFrame(() => {
|
|
107
|
-
if (document.activeElement === document.body || document.activeElement === null) {
|
|
108
|
-
const newInput = wrapper.querySelector('[data-name="Select Values"] input');
|
|
109
|
-
newInput?.focus();
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
79
|
+
// which prevents focus from moving between the controls inside the floating filter
|
|
80
|
+
// (operator select, filter input(s), expand/clear buttons). We handle Tab ourselves
|
|
81
|
+
// in the capture phase (before AG Grid's handlers) and move focus to the next/previous
|
|
82
|
+
// focusable control. At the boundaries we let the event through so AG Grid can move
|
|
83
|
+
// to the adjacent header cell.
|
|
84
|
+
if (e.key !== 'Tab') {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const wrapper = e.currentTarget;
|
|
88
|
+
const focusable = (0, utils_2.getFocusableElements)(wrapper);
|
|
89
|
+
if (focusable.length === 0) {
|
|
90
|
+
return;
|
|
115
91
|
}
|
|
92
|
+
const active = document.activeElement;
|
|
93
|
+
const currentIndex = active ? focusable.indexOf(active) : -1;
|
|
94
|
+
if (currentIndex === -1) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const nextIndex = currentIndex + (e.shiftKey ? -1 : 1);
|
|
98
|
+
if (nextIndex < 0 || nextIndex >= focusable.length) {
|
|
99
|
+
// boundary reached: let AG Grid navigate between header cells
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
e.nativeEvent.stopImmediatePropagation();
|
|
104
|
+
focusable[nextIndex]?.focus();
|
|
105
|
+
// Focusing the values combobox's input makes it set isFocused=true, which
|
|
106
|
+
// re-renders and can momentarily recreate the input, dropping focus to <body>.
|
|
107
|
+
// Re-resolve the target after the re-render and restore focus to it.
|
|
108
|
+
requestAnimationFrame(() => {
|
|
109
|
+
if (document.activeElement === document.body || document.activeElement === null) {
|
|
110
|
+
const refreshed = (0, utils_2.getFocusableElements)(wrapper);
|
|
111
|
+
refreshed[Math.min(nextIndex, refreshed.length - 1)]?.focus();
|
|
112
|
+
}
|
|
113
|
+
});
|
|
116
114
|
}, children: [filterDropdown, isInlineEditable && ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:flex-1 twa:min-w-0", children: (0, jsx_runtime_1.jsx)(FloatingFilterInputList_1.FloatingFilterInputList, { onKeyDown: props.onKeydown, columnId: props.columnId, disabled: props.disabled,
|
|
117
115
|
// It works only with a predicate
|
|
118
116
|
predicate: props.predicate.args[0], predicateDefs: props.predicateDefs, onPredicateChange: (predicate) => {
|
|
@@ -166,7 +166,7 @@ const ColumnValuesSelect = (props) => {
|
|
|
166
166
|
: props.onChange, items: options,
|
|
167
167
|
// for dates, the treeDateOptions have ids that are numbers
|
|
168
168
|
// so we have to add the `toDateValue` function to convert the values to the correct format
|
|
169
|
-
value: selectedColumnValues, primaryKey: 'value', isLoading: props.isLoading, onOpenChange: onOpenChange, showClear: (0, columnFilterLocation_1.isEmbeddedColumnFilterLocation)(location) })) : ((0, jsx_runtime_1.jsx)(Combobox_1.GridFilterCombobox, { disabled: props.disabled, ...selectProps, onOpenChange: onOpenChange, items: options, value: value, isLoading: props.isLoading, onValueChange: props.onChange, showClear: (0, columnFilterLocation_1.isEmbeddedColumnFilterLocation)(location) }, "select"));
|
|
169
|
+
value: selectedColumnValues, "data-name": "Select Values", primaryKey: 'value', isLoading: props.isLoading, onOpenChange: onOpenChange, showClear: (0, columnFilterLocation_1.isEmbeddedColumnFilterLocation)(location) })) : ((0, jsx_runtime_1.jsx)(Combobox_1.GridFilterCombobox, { disabled: props.disabled, ...selectProps, onOpenChange: onOpenChange, items: options, value: value, isLoading: props.isLoading, onValueChange: props.onChange, showClear: (0, columnFilterLocation_1.isEmbeddedColumnFilterLocation)(location) }, "select"));
|
|
170
170
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, join_1.default)(baseClassName, 'twa:relative', props.isLoading && `${baseClassName}--loading`, !value.length && `${baseClassName}--empty`), onKeyDownCapture: (e) => {
|
|
171
171
|
if (e.key === 'Tab') {
|
|
172
172
|
// Prevent AG Grid from hijacking Tab; keep browser default focus navigation.
|
|
@@ -13,6 +13,7 @@ exports.AdaptableFormControlTextClear = React.forwardRef((props, ref) => {
|
|
|
13
13
|
let closeButtonTooltip = props.value ? 'Clear' : null;
|
|
14
14
|
const inputRef = React.useRef(null);
|
|
15
15
|
const { focusOnClear = true } = props;
|
|
16
|
+
const clearDisabled = StringExtensions_1.StringExtensions.IsNullOrEmpty(props.value.toString());
|
|
16
17
|
return ((0, jsx_runtime_1.jsxs)(FieldWrap_1.default, { onClick: props.onClick, className: (0, twMerge_1.twMerge)('twa:bg-input-background twa:text-input-foreground twa:overflow-visible twa:w-full twa:rounded-input', props.className), style: props.style, children: [(0, jsx_runtime_1.jsx)(Input_1.default, { "aria-label": props['aria-label'], autoFocus: props.autoFocus, style: props.inputStyle, className: props.inputClassName, ref: (r) => {
|
|
17
18
|
inputRef.current = r;
|
|
18
19
|
if (!ref) {
|
|
@@ -35,5 +36,5 @@ exports.AdaptableFormControlTextClear = React.forwardRef((props, ref) => {
|
|
|
35
36
|
input.focus();
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
|
-
}, disabled:
|
|
39
|
+
}, disabled: clearDisabled })] }));
|
|
39
40
|
});
|
|
@@ -71,7 +71,7 @@ const AdaptablePopup = (props) => {
|
|
|
71
71
|
props.onHide();
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
}, children: (0, jsx_runtime_1.jsxs)(AdaptablePopupDialog_1.AdaptablePopupDialog, { dataName: componentModule, baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer, children: [!isStandalone && (0, jsx_runtime_1.jsx)(TopBar_1.default, { icon: settingsPanelOptions.icon, children: settingsPanelTitle }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: (0, clsx_1.default)('twa:flex twa:flex-row twa:flex-1 twa:min-h-0', 'twa:bg-
|
|
74
|
+
}, children: (0, jsx_runtime_1.jsxs)(AdaptablePopupDialog_1.AdaptablePopupDialog, { dataName: componentModule, baseClassName: baseClassName, className: className, friendlyName: friendlyName, isActionModule: isStandalone, isWindowModal: isWindowModal, onHide: props.onHide, modalContainer: modalContainer, children: [!isStandalone && (0, jsx_runtime_1.jsx)(TopBar_1.default, { icon: settingsPanelOptions.icon, children: settingsPanelTitle }), (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: (0, clsx_1.default)('twa:flex twa:flex-row twa:flex-1 twa:min-h-0', 'twa:bg-background twa:text-foreground', 'twa:rounded-bl-standard twa:rounded-br-standard', accessLevel == GeneralConstants.ACCESS_LEVEL_READ_ONLY
|
|
75
75
|
? GeneralConstants.READ_ONLY_STYLE
|
|
76
76
|
: ''), children: [!isStandalone && ((0, jsx_runtime_1.jsx)(Navigation_1.Navigation, { menuItems: menuItems, api: props.api, activeItem: activeItem, customSettingsPanels: settingsPanelOptions.customSettingsPanels })), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: (0, clsx_1.default)('ab-Adaptable-Popup__Body', 'twa:bg-primarylight twa:text-primarylight-foreground', 'twa:flex twa:flex-1 twa:min-w-0 twa:overflow-auto', 'twa:rounded-br-standard', !isStandalone && 'twa:*:p-3'), children: moduleViewContent })] })] }) }));
|
|
77
77
|
};
|
|
@@ -6,7 +6,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const react_redux_1 = require("react-redux");
|
|
8
8
|
const GeneralConstants_1 = require("../../../../Utilities/Constants/GeneralConstants");
|
|
9
|
-
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
10
9
|
const EmptyContent_1 = tslib_1.__importDefault(require("../../../../components/EmptyContent"));
|
|
11
10
|
const icons_1 = require("../../../../components/icons");
|
|
12
11
|
const AdaptableObjectList_1 = require("../../AdaptableObjectList");
|
|
@@ -21,6 +20,7 @@ const useRerender_1 = require("../../../../components/utils/useRerender");
|
|
|
21
20
|
const Flex_1 = require("../../../../components/Flex");
|
|
22
21
|
const Panel_1 = tslib_1.__importDefault(require("../../../../components/Panel"));
|
|
23
22
|
const Tabs_1 = require("../../../../components/Tabs");
|
|
23
|
+
const NewDropdownButton_1 = require("../../../../components/NewDropdownButton");
|
|
24
24
|
const AdaptablePopupModuleView = (props) => {
|
|
25
25
|
/**
|
|
26
26
|
* This triggers a render for each state change.
|
|
@@ -84,7 +84,7 @@ const AdaptablePopupModuleView = (props) => {
|
|
|
84
84
|
label: abObjectType.label ?? abObjectType.name,
|
|
85
85
|
};
|
|
86
86
|
});
|
|
87
|
-
newButton = ((0, jsx_runtime_1.jsxs)(
|
|
87
|
+
newButton = ((0, jsx_runtime_1.jsxs)(NewDropdownButton_1.NewDropdownButton, { showDivider: false, tone: "accent", variant: "raised", items: items, tooltip: toolTipText, children: [(0, jsx_runtime_1.jsx)(icons_1.Icon, { name: "plus" }), " New"] }));
|
|
88
88
|
}
|
|
89
89
|
else if (!moduleViewProperties.hideNewButton &&
|
|
90
90
|
(EditWizard || moduleViewProperties.onOpenEditPopup)) {
|
|
@@ -19,6 +19,7 @@ const ColumnSelector = function (props) {
|
|
|
19
19
|
return {
|
|
20
20
|
label,
|
|
21
21
|
textLabel,
|
|
22
|
+
tooltip: textLabel,
|
|
22
23
|
value: column.columnId,
|
|
23
24
|
};
|
|
24
25
|
})
|
|
@@ -35,7 +36,11 @@ const ColumnSelector = function (props) {
|
|
|
35
36
|
virtualized: true,
|
|
36
37
|
items: options,
|
|
37
38
|
showClear: false,
|
|
39
|
+
showItemTooltip: true,
|
|
38
40
|
onValueChange: (colId) => {
|
|
41
|
+
if (colId === null) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
39
44
|
props.onChange(colId);
|
|
40
45
|
},
|
|
41
46
|
value: props.value,
|
|
@@ -106,7 +106,7 @@ function ValueSelector(props) {
|
|
|
106
106
|
notifyChange();
|
|
107
107
|
},
|
|
108
108
|
};
|
|
109
|
-
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { style: props.style, className: (0, clsx_1.default)('twa:flex-1', baseClassName), flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:mb-1", children: showFilterInput && filter ? ((0, jsx_runtime_1.jsx)(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", inputClassName: "twa:p-3", className: "twa:flex-1 twa:
|
|
109
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { style: props.style, className: (0, clsx_1.default)('twa:flex-1', baseClassName), flexDirection: "column", children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: "twa:mb-1", children: showFilterInput && filter ? ((0, jsx_runtime_1.jsx)(AdaptableFormControlTextClear_1.AdaptableFormControlTextClear, { value: searchInputValue, OnTextChange: setSearchInputValue, placeholder: "Type to search", inputClassName: "twa:p-3", className: "twa:flex-1 twa:m-[3px]" })) : ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1" })) }), (0, exports.renderSelectionSection)(selectionSectionProps), (0, jsx_runtime_1.jsx)(dnd_1.DragDropProvider, { children: (0, jsx_runtime_1.jsx)(Flex_1.Flex, { className: `${baseClassName}__body twa:flex-1 twa:overflow-auto`, flexDirection: "column", children: (0, jsx_runtime_1.jsx)(dnd_1.DragList, { dragListId: "value-selector", orientation: "vertical", onDragProxyMove: dnd_1.defaultDragProxyMove, onDragProxySetup: ({ proxyElement }) => {
|
|
110
110
|
proxyElement.classList.add('twa:shadow-md');
|
|
111
111
|
}, onDrop: (_sortedIndexes) => {
|
|
112
112
|
const selection = [];
|
|
@@ -10,7 +10,9 @@ const Flex_1 = require("../../../components/Flex");
|
|
|
10
10
|
const ColumnScope_1 = require("../../../AdaptableState/Common/ColumnScope");
|
|
11
11
|
const FlashingAlertScopeWizardSection = (props) => {
|
|
12
12
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
13
|
-
const availableColumns = React.useMemo(() => api.columnApi
|
|
13
|
+
const availableColumns = React.useMemo(() => api.columnApi
|
|
14
|
+
.getUIAvailableColumns()
|
|
15
|
+
.filter((column) => !column.isActionColumn && !api.columnApi.isFdc3Column(column.columnId)), [api]);
|
|
14
16
|
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:p-2 twa:h-full", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { descriptions: {
|
|
15
17
|
rowScope: 'Changes anywhere in the row will trigger an Flashing Cell',
|
|
16
18
|
columnScope: 'Changes in selected columns will trigger an Flashing Cell',
|