@adaptabletools/adaptable 11.0.0-canary.6 → 11.0.1
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/README.md +4 -4
- package/agGrid.d.ts +5 -4
- package/agGrid.js +7 -5
- package/base.css +3 -4
- package/bundle.cjs.js +120 -115
- package/index.css +3 -4
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +3 -5
- package/src/AdaptableOptions/{QueryLanguageOptions.d.ts → AdaptableQLOptions.d.ts} +34 -2
- package/src/AdaptableOptions/{QueryLanguageOptions.js → AdaptableQLOptions.js} +0 -0
- package/src/AdaptableOptions/FilterOptions.d.ts +4 -0
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
- package/src/AdaptableOptions/SearchOptions.d.ts +0 -9
- package/src/AdaptableOptions/SettingsPanelOptions.d.ts +7 -6
- package/src/AdaptableOptions/StateOptions.d.ts +7 -7
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +2 -2
- package/src/Api/CalculatedColumnApi.d.ts +2 -9
- package/src/Api/GridApi.d.ts +12 -3
- package/src/Api/Implementation/AlertApiImpl.js +1 -2
- package/src/Api/Implementation/ApiBase.d.ts +3 -2
- package/src/Api/Implementation/ApiBase.js +5 -2
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +3 -4
- package/src/Api/Implementation/ColumnApiImpl.js +1 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +2 -0
- package/src/Api/Implementation/GridApiImpl.js +41 -21
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -3
- package/src/Api/Implementation/InternalApiImpl.js +5 -4
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +3 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +15 -2
- package/src/Api/Implementation/SettingsPanelApiImpl.js +1 -1
- package/src/Api/Implementation/ToolPanelApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +2 -3
- package/src/Api/QueryApi.d.ts +2 -2
- package/src/Api/QueryLanguageApi.d.ts +13 -0
- package/src/Api/SettingsPanelApi.d.ts +4 -5
- package/src/PredefinedConfig/AlertState.d.ts +5 -1
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +8 -3
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +3 -0
- package/src/PredefinedConfig/Common/AdaptableQuery.d.ts +0 -1
- package/src/PredefinedConfig/Common/AdaptableQuery.js +1 -5
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +6 -1
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/ConditionalStyleState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +15 -0
- package/src/PredefinedConfig/PlusMinusState.d.ts +1 -1
- package/src/PredefinedConfig/Selection/GridCellRange.d.ts +3 -1
- package/src/PredefinedConfig/ToolPanelState.d.ts +3 -0
- package/src/Redux/ActionsReducers/AlertRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/AlertRedux.js +4 -4
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +4 -4
- package/src/Redux/ActionsReducers/CustomSortRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/CustomSortRedux.js +4 -4
- package/src/Redux/ActionsReducers/FlashingCellRedux.d.ts +12 -12
- package/src/Redux/ActionsReducers/FlashingCellRedux.js +33 -29
- package/src/Redux/ActionsReducers/FormatColumnRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/FormatColumnRedux.js +4 -4
- package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/PlusMinusRedux.js +4 -4
- package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +5 -5
- package/src/Redux/ActionsReducers/ScheduleRedux.js +16 -16
- package/src/Redux/ActionsReducers/ShortcutRedux.d.ts +1 -1
- package/src/Redux/ActionsReducers/ShortcutRedux.js +4 -4
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +47 -22
- package/src/Strategy/AlertModule.js +4 -4
- package/src/Strategy/CalculatedColumnModule.js +4 -4
- package/src/Strategy/ChartingModule.d.ts +3 -3
- package/src/Strategy/ChartingModule.js +2 -2
- package/src/Strategy/FlashingCellModule.js +4 -4
- package/src/Strategy/FreeTextColumnModule.js +1 -0
- package/src/Strategy/{SetingsPanelModule.d.ts → SettingsPanelModule.d.ts} +0 -0
- package/src/Strategy/{SetingsPanelModule.js → SettingsPanelModule.js} +0 -0
- package/src/Strategy/Utilities/getAlertPreviewViewItems.js +1 -1
- package/src/Strategy/Utilities/getExpressionViewItems.d.ts +2 -2
- package/src/Strategy/Utilities/getExpressionViewItems.js +2 -1
- package/src/Strategy/Utilities/getRuleViewItems.js +1 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.d.ts +3 -2
- package/src/Utilities/Constants/DocumentationLinkConstants.js +12 -10
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +18 -13
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +18 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +311 -14
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -2
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +8 -8
- package/src/Utilities/ExpressionFunctions/groupingMap.d.ts +2 -3
- package/src/Utilities/ExpressionFunctions/groupingMap.js +3 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.d.ts +33 -0
- package/src/Utilities/ExpressionFunctions/scalarAggregationHelper.js +154 -0
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -1
- package/src/Utilities/Services/AlertService.js +5 -1
- package/src/Utilities/Services/CalculatedColumnExpressionService.d.ts +7 -3
- package/src/Utilities/Services/CalculatedColumnExpressionService.js +143 -18
- package/src/Utilities/Services/Interface/IAdaptableService.d.ts +1 -1
- package/src/Utilities/Services/Interface/ICalculatedColumnExpressionService.d.ts +6 -3
- package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +7 -1
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ModuleService.js +33 -40
- package/src/Utilities/Services/QueryLanguageService.d.ts +9 -2
- package/src/Utilities/Services/QueryLanguageService.js +81 -22
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationForm.js +5 -3
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.d.ts +1 -0
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +2 -2
- package/src/View/Alert/Wizard/isValidAlertRules.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnSharedEntity.js +3 -3
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +2 -4
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +43 -12
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -2
- package/src/View/ColorPicker.d.ts +1 -1
- package/src/View/Components/AdaptableDateInput/index.d.ts +1 -1
- package/src/View/Components/AdaptableInput/index.d.ts +1 -1
- package/src/View/Components/Buttons/ButtonDelete.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.d.ts +1 -1
- package/src/View/Components/EntityRulesEditor/index.js +3 -4
- package/src/View/Components/Forms/AdaptableFormControlTextClear.d.ts +1 -1
- package/src/View/Components/Panels/PanelWithImage.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -8
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +1 -2
- package/src/View/Components/Popups/AdaptablePopupAlert.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +1 -1
- package/src/View/FlashingCell/Wizard/isValidFlashingCellRules.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/index.js +1 -1
- package/src/View/License/LicenseWatermark.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +1 -1
- package/src/View/Query/Wizard/NamedQueryExpressionWizardSection.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleWizard.js +3 -3
- package/src/agGrid/Adaptable.d.ts +4 -1
- package/src/agGrid/Adaptable.js +71 -48
- package/src/agGrid/CheckboxRenderer.d.ts +8 -1
- package/src/agGrid/CheckboxRenderer.js +18 -3
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +9 -10
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.d.ts +4 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +4 -4
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.d.ts +1 -1
- package/src/components/ExpressionEditor/EditorInput.js +5 -2
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.d.ts +2 -0
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +45 -0
- package/src/components/ExpressionEditor/editorButtonsReactive.js +8 -13
- package/src/components/ExpressionEditor/index.d.ts +2 -1
- package/src/components/ExpressionEditor/index.js +9 -2
- package/src/components/Input/index.d.ts +1 -1
- package/src/components/List/ListGroupItem/index.d.ts +1 -1
- package/src/components/Logo/index.js +8 -7
- package/src/components/PopupWithFooter.d.ts +1 -1
- package/src/components/Textarea/index.d.ts +1 -1
- package/src/components/icons/calculated-column.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +235 -41
- package/src/metamodel/adaptable.metamodel.js +435 -149
- package/src/types.d.ts +5 -5
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -148,7 +148,7 @@ function ValueSelector(props) {
|
|
|
148
148
|
borderRadius: 'var(--ab__border-radius)',
|
|
149
149
|
overflow: 'hidden',
|
|
150
150
|
}, fontSize: 2, backgroundColor: "defaultbackground" },
|
|
151
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show
|
|
151
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: !value.length, checked: selectedOnly, onChange: setSelectedOnly }, showSelectedOnlyLabel !== null && showSelectedOnlyLabel !== void 0 ? showSelectedOnlyLabel : 'Show Selected Only'))),
|
|
152
152
|
React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "droppable" }, (droppableProvided) => {
|
|
153
153
|
return (React.createElement("div", Object.assign({ ref: droppableProvided.innerRef }, droppableProvided.droppableProps),
|
|
154
154
|
options
|
|
@@ -72,7 +72,7 @@ class DashboardPopupComponent extends React.Component {
|
|
|
72
72
|
};
|
|
73
73
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph },
|
|
74
74
|
React.createElement(rebass_1.Flex, { flex: 1, height: "100%", flexDirection: "column" },
|
|
75
|
-
areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard
|
|
75
|
+
areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard Views', style: { height: 'auto', overflow: 'visible' }, variant: "default", borderRadius: "none", marginLeft: 2, marginRight: 2 },
|
|
76
76
|
React.createElement(rebass_1.Flex, null,
|
|
77
77
|
React.createElement(CheckBox_1.CheckBox, { mr: 3, className: `${baseClassName}__Checkbox__collapsed-check`, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
|
|
78
78
|
' ',
|
|
@@ -16,7 +16,7 @@ exports.isValidFlashingCellRules = (flashingCell, api, context) => {
|
|
|
16
16
|
if (valid && flashingCell.Rule.BooleanExpression) {
|
|
17
17
|
valid = api.queryLanguageApi.isValidBooleanExpression(flashingCell.Rule.BooleanExpression, ModuleConstants_1.FlashingCellModuleId);
|
|
18
18
|
if (!valid) {
|
|
19
|
-
return 'The
|
|
19
|
+
return 'The Expression is not a valid Boolean Expression';
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
// boolean expressions may also be saved as named queries
|
|
@@ -37,7 +37,7 @@ const ColumnLabels = (props) => {
|
|
|
37
37
|
'Pivotable',
|
|
38
38
|
'Sortable',
|
|
39
39
|
];
|
|
40
|
-
const labels = labelNames.map((name) =>
|
|
40
|
+
const labels = labelNames.map((name) => columnProperties[name.toLocaleLowerCase()] ? name.charAt(0) : '');
|
|
41
41
|
const flexProps = {
|
|
42
42
|
[flexDirection === 'row' ? 'alignItems' : 'justifyContent']: 'center',
|
|
43
43
|
};
|
|
@@ -60,6 +60,6 @@ exports.LicenseWatermark = (props) => {
|
|
|
60
60
|
return () => clearTimeout(timerId);
|
|
61
61
|
}, []);
|
|
62
62
|
return (React.createElement(rebass_1.Flex, { style: style, ref: ref },
|
|
63
|
-
React.createElement(Logo_1.Logo, { style: { marginRight: 10
|
|
63
|
+
React.createElement(Logo_1.Logo, { style: { marginRight: 10 } }),
|
|
64
64
|
React.createElement("div", null, props.children)));
|
|
65
65
|
};
|
|
@@ -4,7 +4,7 @@ import { PlusMinusNudge, AdaptableApi } from '../../../types';
|
|
|
4
4
|
export declare const PlusMinusSettingsSummary: React.FunctionComponent<{
|
|
5
5
|
hasCondition: boolean;
|
|
6
6
|
}>;
|
|
7
|
-
export declare const isSettingsValid: (hasCondition: boolean) => (data: PlusMinusNudge, api: AdaptableApi, context: OnePageAdaptableWizardContextType<PlusMinusNudge>) => true | "No valid Condition is specified" | "The Predicate is not valid" | "The
|
|
7
|
+
export declare const isSettingsValid: (hasCondition: boolean) => (data: PlusMinusNudge, api: AdaptableApi, context: OnePageAdaptableWizardContextType<PlusMinusNudge>) => true | "No valid Condition is specified" | "The Predicate is not valid" | "The Expression is not a valid Boolean Expression" | "Nudge value is not specified" | "Nudge value must be different than 0";
|
|
8
8
|
interface PlusMinusSettingsWizardSectionProps {
|
|
9
9
|
onChange: (plusMinusNudge: PlusMinusNudge) => void;
|
|
10
10
|
hasCondition: boolean;
|
|
@@ -12,11 +12,11 @@ const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants"
|
|
|
12
12
|
const Tag_1 = require("../../../components/Tag");
|
|
13
13
|
exports.isValidNamedQueryExpression = (data, api) => {
|
|
14
14
|
if (!data.BooleanExpression) {
|
|
15
|
-
return '
|
|
15
|
+
return 'Expression is empty';
|
|
16
16
|
}
|
|
17
17
|
const valid = api.queryLanguageApi.isValidBooleanExpression(data.BooleanExpression, ModuleConstants_1.QueryModuleId);
|
|
18
18
|
if (!valid) {
|
|
19
|
-
return 'Query is not a valid
|
|
19
|
+
return 'Query is not a valid Boolean Query';
|
|
20
20
|
}
|
|
21
21
|
return valid;
|
|
22
22
|
};
|
|
@@ -13,10 +13,10 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
13
13
|
const react_redux_1 = require("react-redux");
|
|
14
14
|
const ScheduleRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ScheduleRedux"));
|
|
15
15
|
exports.ScheduleWizard = (props) => {
|
|
16
|
-
var _a, _b;
|
|
16
|
+
var _a, _b, _c;
|
|
17
17
|
const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
|
|
18
|
-
const isNew = props.popupParams.action ? props.popupParams.action === 'New' : !props.data;
|
|
19
|
-
const scheduleType = data ? data.ScheduleType : (
|
|
18
|
+
const isNew = ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) ? props.popupParams.action === 'New' : !props.data;
|
|
19
|
+
const scheduleType = data ? data.ScheduleType : (_c = props === null || props === void 0 ? void 0 : props.abObjectType) === null || _c === void 0 ? void 0 : _c.name;
|
|
20
20
|
const [schedule, setSchedule] = React.useState(() => {
|
|
21
21
|
if (data) {
|
|
22
22
|
return data;
|
|
@@ -151,6 +151,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
151
151
|
setSelectedRows(): SelectedRowInfo | undefined;
|
|
152
152
|
setValue(dataChangedInfo: DataChangedInfo): void;
|
|
153
153
|
cancelEdit(): void;
|
|
154
|
+
isCellEditable(rowNode: RowNode, column: Column): boolean;
|
|
154
155
|
getDistinctValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, skipRowNode?: RowNode, permittedValues?: any[]): GridCell[];
|
|
155
156
|
getDistinctFilterValuesForColumn(column: AdaptableColumn, visibleRowsOnly: boolean, filter: string, skipRowNode?: RowNode): Promise<{
|
|
156
157
|
suppressClientSideFilter?: boolean;
|
|
@@ -172,6 +173,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
172
173
|
getRawValueFromRowNode(rowNode: RowNode, columnId: string): any;
|
|
173
174
|
getDataRowFromRowNode(rowNode: RowNode): any;
|
|
174
175
|
getRowNodeForPrimaryKey(primaryKeyValue: any): any;
|
|
176
|
+
getRowNodeByIndex(index: number): RowNode;
|
|
175
177
|
getRowNodesForPrimaryKeys(primaryKeyValues: any[]): any[];
|
|
176
178
|
forAllRowNodesDo(func: (rowNode: RowNode) => void): void;
|
|
177
179
|
forAllVisibleRowNodesDo(func: (rowNode: RowNode, rowIndex: number) => void): void;
|
|
@@ -255,6 +257,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
255
257
|
setupColumnFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
256
258
|
setupColumnFloatingFilter({ col, colDef }: ColumnSetupInfo): void;
|
|
257
259
|
setupColumnValueFormatter({ col, abColumn }: ColumnSetupInfo): void;
|
|
260
|
+
setupColumnEditable({ col }: ColumnSetupInfo): void;
|
|
258
261
|
setupColumnValueSetter({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
259
262
|
setupColumnComparator({ col, colId, abColumn }: ColumnSetupInfo): void;
|
|
260
263
|
private applyCurrentTheme;
|
|
@@ -277,7 +280,7 @@ export declare class Adaptable implements IAdaptable {
|
|
|
277
280
|
expandAllRowGroups(): void;
|
|
278
281
|
closeAllRowGroups(): void;
|
|
279
282
|
expandRowGroupsForValues(columnValues: any[]): void;
|
|
280
|
-
|
|
283
|
+
getAgGridColumnForColumnId(columnId: string): Column;
|
|
281
284
|
setRowGroupColumns(columnIds: string[]): void;
|
|
282
285
|
clearRowGroupColumns(): void;
|
|
283
286
|
getExpandRowGroupsKeys(): any[];
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -56,6 +56,7 @@ const publishTimestamp_1 = tslib_1.__importDefault(require("../../publishTimesta
|
|
|
56
56
|
const MetamodelService_1 = require("../Utilities/Services/MetamodelService");
|
|
57
57
|
const DocumentationLinkConstants_1 = require("../Utilities/Constants/DocumentationLinkConstants");
|
|
58
58
|
const ModuleConstants_1 = require("../Utilities/Constants/ModuleConstants");
|
|
59
|
+
const CheckboxRenderer_1 = require("./CheckboxRenderer");
|
|
59
60
|
const tinycolor = require('tinycolor2');
|
|
60
61
|
all_modules_1.ModuleRegistry.registerModules(all_modules_1.AllCommunityModules);
|
|
61
62
|
const GROUP_PATH_SEPARATOR = '/';
|
|
@@ -797,6 +798,7 @@ class Adaptable {
|
|
|
797
798
|
return;
|
|
798
799
|
}
|
|
799
800
|
let style = {};
|
|
801
|
+
// percent bar && do we show text
|
|
800
802
|
const columnStyle = formatColumn.ColumnStyle;
|
|
801
803
|
if (columnStyle) {
|
|
802
804
|
const gradientStyle = columnStyle === null || columnStyle === void 0 ? void 0 : columnStyle.GradientStyle;
|
|
@@ -824,6 +826,10 @@ class Adaptable {
|
|
|
824
826
|
}
|
|
825
827
|
style.backgroundColor = tinycolor(cellBackColor).setAlpha(alpha).toRgbString();
|
|
826
828
|
}
|
|
829
|
+
if (columnStyle.PercentBarStyle && columnStyle.PercentBarStyle.CellText) {
|
|
830
|
+
style.paddingTop = 0;
|
|
831
|
+
style.paddingBottom = 0;
|
|
832
|
+
}
|
|
827
833
|
}
|
|
828
834
|
else if (formatColumn.Style) {
|
|
829
835
|
style = this.convertAdaptableStyleToCSS(formatColumn.Style);
|
|
@@ -1240,6 +1246,24 @@ class Adaptable {
|
|
|
1240
1246
|
}
|
|
1241
1247
|
const pivoted = !!layout.EnablePivot;
|
|
1242
1248
|
const shouldUpdatePivoted = this.gridOptions.columnApi.isPivotMode() !== pivoted;
|
|
1249
|
+
/**
|
|
1250
|
+
* Pivot columns are secondary columns that are created on the fly and base
|
|
1251
|
+
* their configuration on the main columns by copying that configuration.
|
|
1252
|
+
* Because they copy the colDefs they might have an old copy of the colldefs.
|
|
1253
|
+
* This is why when the layout is pivoted we need to set columns before pivoting is applied.
|
|
1254
|
+
* e.g. {
|
|
1255
|
+
* field: 'pivot-1',
|
|
1256
|
+
* pivotValueColumn: {
|
|
1257
|
+
* colDef: {
|
|
1258
|
+
* field: 'price',
|
|
1259
|
+
* // this is a copy of the original column
|
|
1260
|
+
* }
|
|
1261
|
+
* }
|
|
1262
|
+
*
|
|
1263
|
+
*/
|
|
1264
|
+
if (shouldUpdatePivoted) {
|
|
1265
|
+
this.setupColumns();
|
|
1266
|
+
}
|
|
1243
1267
|
isChanged = isChanged || shouldUpdatePivoted;
|
|
1244
1268
|
let shouldUpdateHeaders = false;
|
|
1245
1269
|
shouldUpdateHeaders = this.setupColumnHeaderAggregations(layout);
|
|
@@ -1520,6 +1544,10 @@ class Adaptable {
|
|
|
1520
1544
|
cancelEdit() {
|
|
1521
1545
|
this.gridOptions.api.stopEditing(true);
|
|
1522
1546
|
}
|
|
1547
|
+
isCellEditable(rowNode, column) {
|
|
1548
|
+
// it's safe to rely on the AG Grid implementation because we override the colDef.editable property, which is in this case the single source of truth
|
|
1549
|
+
return column === null || column === void 0 ? void 0 : column.isCellEditable(rowNode);
|
|
1550
|
+
}
|
|
1523
1551
|
getDistinctValuesForColumn(column, visibleRowsOnly, skipRowNode, permittedValues) {
|
|
1524
1552
|
let returnValues = [];
|
|
1525
1553
|
// this function does NOT look up for server values but actually it should...
|
|
@@ -1823,6 +1851,9 @@ class Adaptable {
|
|
|
1823
1851
|
});
|
|
1824
1852
|
}
|
|
1825
1853
|
}
|
|
1854
|
+
getRowNodeByIndex(index) {
|
|
1855
|
+
return this.gridOptions.api.getDisplayedRowAtIndex(index);
|
|
1856
|
+
}
|
|
1826
1857
|
getRowNodesForPrimaryKeys(primaryKeyValues) {
|
|
1827
1858
|
let rowNodes = [];
|
|
1828
1859
|
if (this.useRowNodeLookUp) {
|
|
@@ -2106,11 +2137,10 @@ class Adaptable {
|
|
|
2106
2137
|
: true;
|
|
2107
2138
|
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable).CalculatedColumnSettings;
|
|
2108
2139
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
2109
|
-
var _a;
|
|
2110
2140
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
2111
2141
|
if (!calculatedColumnSettings.DataType) {
|
|
2112
2142
|
calculatedColumnSettings.DataType =
|
|
2113
|
-
this.CalculatedColumnExpressionService.
|
|
2143
|
+
this.CalculatedColumnExpressionService.getCalculatedColumnDataType(calculatedColumn.Query);
|
|
2114
2144
|
}
|
|
2115
2145
|
const columnTypes = [
|
|
2116
2146
|
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
@@ -2138,15 +2168,13 @@ class Adaptable {
|
|
|
2138
2168
|
suppressMovable: calculatedColumnSettings.SuppressMovable,
|
|
2139
2169
|
type: columnTypes,
|
|
2140
2170
|
valueGetter: (params) => {
|
|
2141
|
-
|
|
2142
|
-
return this.CalculatedColumnExpressionService.ComputeExpressionValue((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, params.node);
|
|
2171
|
+
return this.CalculatedColumnExpressionService.evaluateCalculatedColumnQuery(calculatedColumn, params.node);
|
|
2143
2172
|
},
|
|
2144
2173
|
};
|
|
2145
2174
|
if (calculatedColumnSettings.ShowToolTip != null &&
|
|
2146
2175
|
calculatedColumnSettings.ShowToolTip == true) {
|
|
2147
2176
|
newColDef.tooltipValueGetter = () => {
|
|
2148
|
-
|
|
2149
|
-
return (_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression;
|
|
2177
|
+
return this.api.queryLanguageApi.getAdaptableQueryExpression(calculatedColumn.Query);
|
|
2150
2178
|
};
|
|
2151
2179
|
}
|
|
2152
2180
|
LoggingHelper_1.LogAdaptableInfo('Setting up Calculated Column: ' + calculatedColumn.ColumnId);
|
|
@@ -2360,24 +2388,6 @@ class Adaptable {
|
|
|
2360
2388
|
this.checkColumnsDataTypeSet();
|
|
2361
2389
|
this.setLayout();
|
|
2362
2390
|
});
|
|
2363
|
-
/**
|
|
2364
|
-
* Use Case: User has started to edit a readonly cell
|
|
2365
|
-
* Action1: Stop editing immediately
|
|
2366
|
-
* Note: Deals only with user edits and not ticking data (not a problem)
|
|
2367
|
-
*/
|
|
2368
|
-
this.gridOptions.api.addEventListener(all_modules_1.Events.EVENT_CELL_EDITING_STARTED, (params) => {
|
|
2369
|
-
if (this.gridOptions.columnApi.isPivotMode()) {
|
|
2370
|
-
return;
|
|
2371
|
-
}
|
|
2372
|
-
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
2373
|
-
if (cellEditableFn) {
|
|
2374
|
-
let gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
2375
|
-
let isEditable = cellEditableFn(gridCell);
|
|
2376
|
-
if (!isEditable) {
|
|
2377
|
-
this.gridOptions.api.stopEditing();
|
|
2378
|
-
}
|
|
2379
|
-
}
|
|
2380
|
-
});
|
|
2381
2391
|
/**
|
|
2382
2392
|
* Use Case: Entered or Left Pivot Mode
|
|
2383
2393
|
* Action 1: Autosize pivot columns when entering pivot mode (if autosize pivot in Layout is true)
|
|
@@ -2595,8 +2605,8 @@ class Adaptable {
|
|
|
2595
2605
|
(originalisExternalFilterPresent ? originalisExternalFilterPresent() : false));
|
|
2596
2606
|
};
|
|
2597
2607
|
const originaldoesExternalFilterPass = this.gridOptions.doesExternalFilterPass;
|
|
2598
|
-
const evaluateQueryOnClient =
|
|
2599
|
-
const evaluateFilterOnClient =
|
|
2608
|
+
const evaluateQueryOnClient = this.api.internalApi.runModuleInAdaptableQL('Query');
|
|
2609
|
+
const evaluateFilterOnClient = this.api.internalApi.runModuleInAdaptableQL('Filter');
|
|
2600
2610
|
this.gridOptions.doesExternalFilterPass = (node) => {
|
|
2601
2611
|
// first we assess Query (if its running locally)
|
|
2602
2612
|
if (evaluateQueryOnClient && !this.isGroupRowNode(node)) {
|
|
@@ -2689,6 +2699,7 @@ class Adaptable {
|
|
|
2689
2699
|
this.setupColumnFilter(colSetupInfo);
|
|
2690
2700
|
this.setupColumnFloatingFilter(colSetupInfo);
|
|
2691
2701
|
this.setupColumnValueFormatter(colSetupInfo);
|
|
2702
|
+
this.setupColumnEditable(colSetupInfo);
|
|
2692
2703
|
this.setupColumnValueSetter(colSetupInfo);
|
|
2693
2704
|
this.setupColumnComparator(colSetupInfo);
|
|
2694
2705
|
this.setupColumnCellEditor(colSetupInfo);
|
|
@@ -2842,16 +2853,21 @@ class Adaptable {
|
|
|
2842
2853
|
});
|
|
2843
2854
|
}
|
|
2844
2855
|
getExcelClassNameForCell(colId, primaryKeyValue) {
|
|
2845
|
-
let
|
|
2846
|
-
if (
|
|
2847
|
-
|
|
2856
|
+
let excelClassName = `--excel-cell-${colId}-${primaryKeyValue}`;
|
|
2857
|
+
if (excelClassName.indexOf(' ') > 0) {
|
|
2858
|
+
excelClassName = excelClassName.replace(/\s/g, '_');
|
|
2848
2859
|
}
|
|
2849
|
-
return
|
|
2860
|
+
return excelClassName;
|
|
2850
2861
|
}
|
|
2851
2862
|
setupColumnCellEditor({ colId, col }) {
|
|
2852
2863
|
const adaptableColumn = this.api.columnApi.getColumnFromId(colId);
|
|
2853
2864
|
const editLookUpItem = this.api.userInterfaceApi.getEditLookUpItemForColumn(adaptableColumn);
|
|
2854
2865
|
this.setColDefProperty(col, 'cellEditor', () => {
|
|
2866
|
+
var _a;
|
|
2867
|
+
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(adaptableColumn);
|
|
2868
|
+
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && ((_a = formatColumn.ColumnStyle) === null || _a === void 0 ? void 0 : _a.CheckBoxStyle)) {
|
|
2869
|
+
return CheckboxRenderer_1.CheckboxEditor;
|
|
2870
|
+
}
|
|
2855
2871
|
if (editLookUpItem) {
|
|
2856
2872
|
return this.isModulePresent('rich-select')
|
|
2857
2873
|
? 'agRichSelectCellEditor'
|
|
@@ -2872,7 +2888,7 @@ class Adaptable {
|
|
|
2872
2888
|
setupColumnCellRenderer({ col, colId, abColumn }) {
|
|
2873
2889
|
this.setColDefProperty(col, 'cellRenderer', () => {
|
|
2874
2890
|
const formatColumn = this.api.formatColumnApi.getFormatColumnForColumn(abColumn);
|
|
2875
|
-
if (!(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn
|
|
2891
|
+
if (formatColumn && !(formatColumn === null || formatColumn === void 0 ? void 0 : formatColumn.IsSuspended) && formatColumn.ColumnStyle) {
|
|
2876
2892
|
if (formatColumn.ColumnStyle.PercentBarStyle) {
|
|
2877
2893
|
return this.agGridHelper.createNumericStyleRendererFunc(formatColumn);
|
|
2878
2894
|
}
|
|
@@ -3019,6 +3035,23 @@ class Adaptable {
|
|
|
3019
3035
|
}
|
|
3020
3036
|
});
|
|
3021
3037
|
}
|
|
3038
|
+
setupColumnEditable({ col }) {
|
|
3039
|
+
this.setColDefProperty(col, 'editable', (userValue) => {
|
|
3040
|
+
// if AG Grid defines the column as NOT editable, we don't mess with it
|
|
3041
|
+
if (typeof userValue === 'boolean' && userValue === false) {
|
|
3042
|
+
return userValue;
|
|
3043
|
+
}
|
|
3044
|
+
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
3045
|
+
if (!cellEditableFn) {
|
|
3046
|
+
return userValue;
|
|
3047
|
+
}
|
|
3048
|
+
const editableCallback = (params) => {
|
|
3049
|
+
const gridCell = this.getGridCellFromRowNode(params.node, params.column.getColId());
|
|
3050
|
+
return cellEditableFn(gridCell);
|
|
3051
|
+
};
|
|
3052
|
+
return editableCallback;
|
|
3053
|
+
});
|
|
3054
|
+
}
|
|
3022
3055
|
setupColumnValueSetter({ col, colId, abColumn }) {
|
|
3023
3056
|
this.setColDefProperty(col, 'valueSetter', (userValueSetter) => {
|
|
3024
3057
|
var _a;
|
|
@@ -3027,19 +3060,14 @@ class Adaptable {
|
|
|
3027
3060
|
.filter((alertDefinition) => {
|
|
3028
3061
|
return this.api.scopeApi.isColumnInScope(abColumn, alertDefinition.Scope);
|
|
3029
3062
|
});
|
|
3030
|
-
const cellEditableFn = this.adaptableOptions.editOptions.isCellEditable;
|
|
3031
3063
|
const noValidations = !preventEditAlertsForColumn.length && !((_a = this.adaptableOptions.editOptions) === null || _a === void 0 ? void 0 : _a.validateOnServer);
|
|
3032
|
-
if (noValidations
|
|
3064
|
+
if (noValidations) {
|
|
3033
3065
|
return;
|
|
3034
3066
|
}
|
|
3035
3067
|
const valueSetter = (params) => {
|
|
3036
3068
|
var _a;
|
|
3037
|
-
if (
|
|
3038
|
-
|
|
3039
|
-
let isEditable = cellEditableFn(gridCell);
|
|
3040
|
-
if (!isEditable) {
|
|
3041
|
-
return false;
|
|
3042
|
-
}
|
|
3069
|
+
if (preventEditAlertsForColumn.length) {
|
|
3070
|
+
return false;
|
|
3043
3071
|
}
|
|
3044
3072
|
const field = params.column.getColDef().field;
|
|
3045
3073
|
if (noValidations) {
|
|
@@ -3064,10 +3092,6 @@ class Adaptable {
|
|
|
3064
3092
|
rowNode: params.node,
|
|
3065
3093
|
trigger: 'edit',
|
|
3066
3094
|
});
|
|
3067
|
-
// just Prevent Edit Alerts below
|
|
3068
|
-
if (!preventEditAlertsForColumn.length) {
|
|
3069
|
-
return true;
|
|
3070
|
-
}
|
|
3071
3095
|
if (dataChangedInfo.oldValue === dataChangedInfo.newValue) {
|
|
3072
3096
|
return true;
|
|
3073
3097
|
}
|
|
@@ -3387,10 +3411,8 @@ class Adaptable {
|
|
|
3387
3411
|
this.gridOptions.api.onGroupExpandedOrCollapsed();
|
|
3388
3412
|
}
|
|
3389
3413
|
}
|
|
3390
|
-
|
|
3391
|
-
return this.gridOptions.columnApi
|
|
3392
|
-
.getAllColumns()
|
|
3393
|
-
.find((c) => c.getColId() === abColumn.columnId);
|
|
3414
|
+
getAgGridColumnForColumnId(columnId) {
|
|
3415
|
+
return this.gridOptions.columnApi.getColumn(columnId);
|
|
3394
3416
|
}
|
|
3395
3417
|
setRowGroupColumns(columnIds) {
|
|
3396
3418
|
this.gridOptions.columnApi.setRowGroupColumns(columnIds);
|
|
@@ -3717,7 +3739,8 @@ class Adaptable {
|
|
|
3717
3739
|
return false;
|
|
3718
3740
|
}
|
|
3719
3741
|
showQuickFilter() {
|
|
3720
|
-
this.
|
|
3742
|
+
const height = this.api.internalApi.getAdaptableOptions().filterOptions.quickFilterHeight;
|
|
3743
|
+
this.gridOptions.api.setFloatingFiltersHeight(height);
|
|
3721
3744
|
}
|
|
3722
3745
|
hideQuickFilter() {
|
|
3723
3746
|
this.gridOptions.api.setFloatingFiltersHeight(0);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { ICellRendererFunc } from '@ag-grid-community/all-modules';
|
|
2
2
|
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
3
|
-
|
|
3
|
+
import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core/dist/cjs/es5/interfaces/iCellEditor';
|
|
4
|
+
export declare const getCheckboxRendererForColumn: (columnId: string, isColumnReadOnly: boolean, api: AdaptableApi) => ICellRendererFunc;
|
|
5
|
+
export declare class CheckboxEditor implements ICellEditorComp {
|
|
6
|
+
isCancelBeforeStart(): boolean;
|
|
7
|
+
init(params: ICellEditorParams): void;
|
|
8
|
+
getGui(): HTMLElement;
|
|
9
|
+
getValue(): any;
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCheckboxRendererForColumn = void 0;
|
|
4
|
-
exports.getCheckboxRendererForColumn = (columnId,
|
|
3
|
+
exports.CheckboxEditor = exports.getCheckboxRendererForColumn = void 0;
|
|
4
|
+
exports.getCheckboxRendererForColumn = (columnId, isColumnReadOnly, api) => {
|
|
5
5
|
const CheckboxRenderer = function () {
|
|
6
6
|
return '';
|
|
7
7
|
};
|
|
@@ -10,7 +10,9 @@ exports.getCheckboxRendererForColumn = (columnId, readOnly, api) => {
|
|
|
10
10
|
const inputElement = document.createElement('input');
|
|
11
11
|
inputElement.type = 'checkbox';
|
|
12
12
|
inputElement.checked = params.value;
|
|
13
|
-
inputElement.disabled =
|
|
13
|
+
inputElement.disabled =
|
|
14
|
+
isColumnReadOnly ||
|
|
15
|
+
!api.internalApi.getAdaptableInstance().isCellEditable(params.node, params.column);
|
|
14
16
|
this.checkedHandler = this.checkedHandler.bind(this);
|
|
15
17
|
inputElement.addEventListener('click', this.checkedHandler);
|
|
16
18
|
this.eGui = document.createElement('div');
|
|
@@ -33,3 +35,16 @@ exports.getCheckboxRendererForColumn = (columnId, readOnly, api) => {
|
|
|
33
35
|
};
|
|
34
36
|
return CheckboxRenderer;
|
|
35
37
|
};
|
|
38
|
+
// this is just a stub editor instance, we just need the `isCancelBeforeStart()` hook
|
|
39
|
+
class CheckboxEditor {
|
|
40
|
+
isCancelBeforeStart() {
|
|
41
|
+
// never show the editor, we edit it via the checkbox input element
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
init(params) { }
|
|
45
|
+
getGui() {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
getValue() { }
|
|
49
|
+
}
|
|
50
|
+
exports.CheckboxEditor = CheckboxEditor;
|
|
@@ -21,7 +21,7 @@ export declare class agGridHelper {
|
|
|
21
21
|
getAgGridDarkThemeName(): string;
|
|
22
22
|
setUpModules(): Map<AdaptableModule, IModule>;
|
|
23
23
|
TrySetUpNodeIds(): boolean;
|
|
24
|
-
createCheckboxRendererComp(columnId: string,
|
|
24
|
+
createCheckboxRendererComp(columnId: string, isColumnReadOnly: boolean): ICellRendererFunc | undefined;
|
|
25
25
|
createNumericStyleRendererFunc(formatColumn: FormatColumn): ICellRendererFunc;
|
|
26
26
|
getCleanValue(value: string): string | undefined;
|
|
27
27
|
getRenderedValue(colDef: ColDef, valueToRender: any): any;
|
|
@@ -39,7 +39,7 @@ const FormatHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/For
|
|
|
39
39
|
const CheckboxRenderer_1 = require("./CheckboxRenderer");
|
|
40
40
|
const DataChangeHistoryModule_1 = require("../Strategy/DataChangeHistoryModule");
|
|
41
41
|
const FlashingCellModule_1 = require("../Strategy/FlashingCellModule");
|
|
42
|
-
const
|
|
42
|
+
const SettingsPanelModule_1 = require("../Strategy/SettingsPanelModule");
|
|
43
43
|
const ChartingModule_1 = require("../Strategy/ChartingModule");
|
|
44
44
|
const tinycolor = require('tinycolor2');
|
|
45
45
|
/**
|
|
@@ -97,7 +97,7 @@ class agGridHelper {
|
|
|
97
97
|
modules.set(ModuleConstants.SystemStatusModuleId, new SystemStatusModule_1.SystemStatusModule(api));
|
|
98
98
|
modules.set(ModuleConstants.ThemeModuleId, new ThemeModule_1.ThemeModule(api));
|
|
99
99
|
modules.set(ModuleConstants.GridInfoModuleId, new GridInfoModule_1.GridInfoModule(api));
|
|
100
|
-
modules.set(ModuleConstants.SettingsPanelModuleId, new
|
|
100
|
+
modules.set(ModuleConstants.SettingsPanelModuleId, new SettingsPanelModule_1.SettingsPanelModule(api));
|
|
101
101
|
modules.set(ModuleConstants.ChartingModuleId, new ChartingModule_1.ChartingModule(api));
|
|
102
102
|
return modules;
|
|
103
103
|
}
|
|
@@ -118,8 +118,8 @@ class agGridHelper {
|
|
|
118
118
|
};
|
|
119
119
|
return true;
|
|
120
120
|
}
|
|
121
|
-
createCheckboxRendererComp(columnId,
|
|
122
|
-
return CheckboxRenderer_1.getCheckboxRendererForColumn(columnId,
|
|
121
|
+
createCheckboxRendererComp(columnId, isColumnReadOnly) {
|
|
122
|
+
return CheckboxRenderer_1.getCheckboxRendererForColumn(columnId, isColumnReadOnly, this.adaptable.api);
|
|
123
123
|
}
|
|
124
124
|
createNumericStyleRendererFunc(formatColumn) {
|
|
125
125
|
const numericStyle = formatColumn.ColumnStyle;
|
|
@@ -331,13 +331,12 @@ class agGridHelper {
|
|
|
331
331
|
this.adaptable.api.eventApi.emit('SelectionChanged', selectionChangedInfo);
|
|
332
332
|
}
|
|
333
333
|
isColumnReadonly(colDef) {
|
|
334
|
-
//
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (colDef && typeof colDef.editable === 'boolean') {
|
|
338
|
-
return !colDef.editable;
|
|
334
|
+
// if the column has conditional/dynamic editability, we assume some rows may be editable
|
|
335
|
+
if (colDef && typeof colDef.editable === 'function') {
|
|
336
|
+
return false;
|
|
339
337
|
}
|
|
340
|
-
|
|
338
|
+
// otherwise we evaluate the colDef.editable property (columns are NOT editable by default)
|
|
339
|
+
return !colDef.editable;
|
|
341
340
|
}
|
|
342
341
|
isColumnSortable(colDef) {
|
|
343
342
|
if (colDef && colDef.sortable != null) {
|
|
@@ -11,14 +11,16 @@ interface AdaptableFormComponentProps {
|
|
|
11
11
|
displayTitle: boolean;
|
|
12
12
|
api: AdaptableApi;
|
|
13
13
|
context?: ButtonContext;
|
|
14
|
+
focusFirstButton?: boolean;
|
|
14
15
|
}
|
|
15
|
-
export declare function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, }: {
|
|
16
|
+
export declare function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, focusFirstButton, }: {
|
|
16
17
|
disabledButtons?: boolean[];
|
|
17
18
|
defaultTone: SimpleButtonProps['tone'];
|
|
18
19
|
onClick: (button: AdaptableButton<ButtonContext>) => void;
|
|
19
20
|
formDef: AdaptableForm<ButtonContext>;
|
|
20
21
|
api: AdaptableApi;
|
|
21
22
|
context: ButtonContext;
|
|
23
|
+
focusFirstButton?: boolean;
|
|
22
24
|
}): JSX.Element;
|
|
23
|
-
export declare function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displayTitle, api, context, }: AdaptableFormComponentProps): JSX.Element;
|
|
25
|
+
export declare function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displayTitle, api, context, focusFirstButton, }: AdaptableFormComponentProps): JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -10,7 +10,7 @@ const SimpleButton_1 = tslib_1.__importDefault(require("../SimpleButton"));
|
|
|
10
10
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../View/Components/AdaptableInput"));
|
|
11
11
|
const DropdownButton_1 = tslib_1.__importDefault(require("../DropdownButton"));
|
|
12
12
|
const react_1 = require("react");
|
|
13
|
-
function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, }) {
|
|
13
|
+
function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabledButtons, api, context, focusFirstButton = true, }) {
|
|
14
14
|
return (React.createElement(React.Fragment, null, formDef.buttons.map((button, index) => {
|
|
15
15
|
var _a;
|
|
16
16
|
const defaultIconProps = {
|
|
@@ -23,7 +23,7 @@ function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabled
|
|
|
23
23
|
let buttonStyle = api.internalApi.getStyleForButton(button, context ? context : { adaptableApi: api });
|
|
24
24
|
let buttonLabel = api.internalApi.getLabelForButton(button, context ? context : { adaptableApi: api });
|
|
25
25
|
let buttonTooltip = api.internalApi.getTooltipForButton(button, context ? context : { adaptableApi: api });
|
|
26
|
-
return (React.createElement(SimpleButton_1.default, { autoFocus: index === 0, disabled: disabledButtons[index], key: index, tooltip: buttonTooltip, tone: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _a !== void 0 ? _a : defaultTone, variant: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, "data-text": buttonLabel, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, marginLeft: index ? 2 : 0, onClick: () => {
|
|
26
|
+
return (React.createElement(SimpleButton_1.default, { autoFocus: focusFirstButton && index === 0, disabled: disabledButtons[index], key: index, tooltip: buttonTooltip, tone: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _a !== void 0 ? _a : defaultTone, variant: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant, "data-text": buttonLabel, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, marginLeft: index ? 2 : 0, onClick: () => {
|
|
27
27
|
onClick(button);
|
|
28
28
|
} },
|
|
29
29
|
button.icon ? React.createElement("img", Object.assign({}, iconProps)) : null,
|
|
@@ -31,7 +31,7 @@ function AdaptableFormComponentButtons({ formDef, onClick, defaultTone, disabled
|
|
|
31
31
|
})));
|
|
32
32
|
}
|
|
33
33
|
exports.AdaptableFormComponentButtons = AdaptableFormComponentButtons;
|
|
34
|
-
function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displayTitle, api, context, }) {
|
|
34
|
+
function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displayTitle, api, context, focusFirstButton, }) {
|
|
35
35
|
var _a;
|
|
36
36
|
const getFieldValue = (key) => data[key];
|
|
37
37
|
const setFieldValue = (key, value) => {
|
|
@@ -92,6 +92,6 @@ function AdaptableFormComponent({ formDef, data, onChange, onButtonClick, displa
|
|
|
92
92
|
formDef.description && React.createElement(rebass_1.Box, { mb: 3 }, formDef.description),
|
|
93
93
|
React.createElement(FormLayout_1.default, null, (_a = formDef.fields) === null || _a === void 0 ? void 0 : _a.map((field) => (React.createElement(FormLayout_1.FormRow, { key: field.name, label: field.label }, renderField(field))))),
|
|
94
94
|
formDef.buttons ? (React.createElement(rebass_1.Flex, { marginTop: 3, flexDirection: "row", alignItems: "center", justifyContent: "center" },
|
|
95
|
-
React.createElement(AdaptableFormComponentButtons, { onClick: onButtonClick, disabledButtons: disabledButtons, defaultTone: "success", formDef: formDef, api: api, context: context }))) : null));
|
|
95
|
+
React.createElement(AdaptableFormComponentButtons, { focusFirstButton: focusFirstButton, onClick: onButtonClick, disabledButtons: disabledButtons, defaultTone: "success", formDef: formDef, api: api, context: context }))) : null));
|
|
96
96
|
}
|
|
97
97
|
exports.AdaptableFormComponent = AdaptableFormComponent;
|
|
@@ -15,4 +15,4 @@ export declare type DatepickerProps = Omit<BoxProps, 'value' | 'onChange' | 'def
|
|
|
15
15
|
showWeekNumber?: boolean;
|
|
16
16
|
showOutsideDays?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare const Datepicker: React.ForwardRefExoticComponent<Pick<DatepickerProps, "max" | "required" | "default" | "high" | "low" | "disabled" | "start" | "open" | "media" | "hidden" | "cite" | "data" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "async" | "defer" | "manifest" | "m" | "color" | "content" | "size" | "flex" | "wrap" | "padding" | "multiple" | "alignSelf" | "backgroundColor" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "children" | "key" | "list" | "step" | "contextMenu" | "type" | "min" | "rows" | "download" | "value" | "checked" | "onClick" | "
|
|
18
|
+
export declare const Datepicker: React.ForwardRefExoticComponent<Pick<DatepickerProps, "max" | "required" | "default" | "high" | "low" | "disabled" | "start" | "open" | "media" | "hidden" | "cite" | "data" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "async" | "defer" | "manifest" | "m" | "color" | "content" | "size" | "flex" | "wrap" | "padding" | "multiple" | "alignSelf" | "backgroundColor" | "fontSize" | "height" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "children" | "key" | "list" | "step" | "contextMenu" | "type" | "min" | "rows" | "download" | "value" | "checked" | "onClick" | "name" | "colSpan" | "rowSpan" | "className" | "id" | "lang" | "method" | "target" | "role" | "tabIndex" | "crossOrigin" | "href" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classID" | "useMap" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "as" | "hrefLang" | "integrity" | "rel" | "sizes" | "charSet" | "kind" | "src" | "srcLang" | "alt" | "coords" | "shape" | "autoPlay" | "controls" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "dateTime" | "acceptCharset" | "action" | "autoComplete" | "encType" | "noValidate" | "allowFullScreen" | "allowTransparency" | "frameBorder" | "marginHeight" | "marginWidth" | "sandbox" | "scrolling" | "seamless" | "srcDoc" | "srcSet" | "accept" | "capture" | "maxLength" | "minLength" | "readOnly" | "htmlFor" | "httpEquiv" | "optimum" | "reversed" | "selected" | "nonce" | "scoped" | "cellPadding" | "cellSpacing" | "headers" | "scope" | "cols" | "poster" | "challenge" | "keyType" | "keyParams" | "mt" | "mb" | "ml" | "mr" | "my" | "marginY" | "mx" | "marginX" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "bg" | "showClearButton" | "showOutsideDays" | "showWeekNumber" | "onHide" | "datepickerButtons" | "dateProps"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
3
3
|
import { AdaptableModule } from '../../PredefinedConfig/Common/Types';
|
|
4
4
|
interface EditorInputProps {
|
|
5
|
-
type: 'boolean' | 'scalar';
|
|
5
|
+
type: 'boolean' | 'scalar' | 'aggregatedScalar';
|
|
6
6
|
module: AdaptableModule;
|
|
7
7
|
value: string;
|
|
8
8
|
onChange: (value: string) => void;
|