@adaptabletools/adaptable 13.0.0-canary.16 → 13.0.0-canary.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +99 -0
- package/base.css.map +1 -1
- package/bundle.cjs.js +144 -144
- package/index.css +115 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/FormatColumnApi.d.ts +37 -29
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +21 -11
- package/src/Api/Implementation/FormatColumnApiImpl.js +42 -63
- package/src/Api/StyledColumnApi.d.ts +27 -13
- package/src/PredefinedConfig/StyledColumnState.d.ts +10 -4
- package/src/Strategy/ConditionalStyleModule.d.ts +0 -2
- package/src/Strategy/ConditionalStyleModule.js +1 -27
- package/src/Strategy/FormatColumnModule.js +2 -12
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +9 -9
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +6 -5
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/AdaptableObjectRow/index.js +1 -6
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -3
- package/src/View/Components/Buttons/ButtonInfo.js +3 -5
- package/src/View/Components/EntityRulesEditor/index.js +8 -17
- package/src/View/Components/FilterForm/FilterForm.js +11 -16
- package/src/View/Components/FilterForm/QuickFilterForm.js +7 -13
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Panels/PanelWithButton.js +1 -5
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +3 -16
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -1
- package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +5 -5
- package/src/View/Components/ScopeComponent.js +4 -4
- package/src/View/Components/Selectors/ColumnValueSelector.js +2 -2
- package/src/View/Components/StyleComponent.js +12 -17
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +1 -1
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +1 -11
- package/src/View/DataSet/DataSetSelector.js +1 -1
- package/src/View/Export/ReportExportDropdown.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -11
- package/src/View/FlashingCell/FlashingCellStyle.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +6 -6
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +26 -26
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +2 -6
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/Layout/LayoutRadioSelector.js +1 -1
- package/src/View/Layout/Wizard/Components/ColumnLabels.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +5 -5
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +3 -3
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +3 -3
- package/src/View/SmartEdit/SmartEditPopup.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +10 -10
- package/src/View/StateManagement/StateManagementPopup.js +4 -4
- package/src/View/SystemStatus/SystemStatusEntityRow.js +4 -6
- package/src/View/TeamSharing/SharedEntityObjectView.js +1 -1
- package/src/View/TeamSharing/TeamSharingApplyButton.js +1 -1
- package/src/View/Theme/ThemePopup.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -0
- package/src/agGrid/ActionColumnRenderer.js +94 -62
- package/src/agGrid/Adaptable.d.ts +0 -1
- package/src/agGrid/Adaptable.js +43 -67
- package/src/agGrid/PercentBarRenderer.js +10 -0
- package/src/agGrid/weightedAverage.js +19 -11
- package/src/components/CheckBox/index.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +13 -32
- package/src/components/ExpressionEditor/index.js +9 -17
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/StylePreview.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +7 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -7,6 +7,7 @@ const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
|
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
|
|
9
9
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
10
|
+
const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
|
|
10
11
|
class SystemStatusEntityRow extends React.Component {
|
|
11
12
|
render() {
|
|
12
13
|
var _a;
|
|
@@ -15,15 +16,12 @@ class SystemStatusEntityRow extends React.Component {
|
|
|
15
16
|
let messageTypeColor = UIHelper_1.default.getColorByMessageType((_a = systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.statusType) !== null && _a !== void 0 ? _a : 'Success');
|
|
16
17
|
let colItems = (0, Helper_1.cloneObject)(this.props.colItems);
|
|
17
18
|
colItems[0].Content = systemStatus ? (React.createElement("details", null,
|
|
18
|
-
React.createElement(rebass_1.Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '',
|
|
19
|
-
|
|
20
|
-
fontWeight: 'bold',
|
|
21
|
-
cursor: systemStatus.statusFurtherInformation ? 'pointer' : 'auto',
|
|
22
|
-
}, className: "ab-DashboardToolbar__SystemStatus__text", marginRight: 2, padding: 2, color: 'text-on-secondary', backgroundColor: messageTypeColor, fontSize: 'var( --ab-font-size-2)', alignItems: "center", as: "summary" },
|
|
19
|
+
React.createElement(rebass_1.Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '', className: (0, join_1.default)('ab-DashboardToolbar__SystemStatus__text', systemStatus.statusFurtherInformation &&
|
|
20
|
+
'ab-DashboardToolbar__SystemStatus__text--expandable'), backgroundColor: messageTypeColor, alignItems: "center", as: "summary" },
|
|
23
21
|
systemStatus.statusMessage,
|
|
24
22
|
" ",
|
|
25
23
|
systemStatus.statusFurtherInformation ? '...' : ''),
|
|
26
|
-
systemStatus.statusFurtherInformation ? (React.createElement(rebass_1.Box, {
|
|
24
|
+
systemStatus.statusFurtherInformation ? (React.createElement(rebass_1.Box, { className: "ab-DashboardToolbar__SystemStatus__further-information", margin: 2 }, systemStatus.statusFurtherInformation)) : null)) : null;
|
|
27
25
|
colItems[1].Content = systemStatus.timestamp.toLocaleString();
|
|
28
26
|
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: colItems });
|
|
29
27
|
}
|
|
@@ -19,7 +19,7 @@ const SharedEntityTypeItemView = (props) => {
|
|
|
19
19
|
React.createElement(rebass_1.Flex, { mb: 2, mt: 2 },
|
|
20
20
|
React.createElement(rebass_1.Flex, { mr: 2, alignItems: "center" },
|
|
21
21
|
React.createElement(Tag_1.Tag, { style: { margin: 0 } }, props.data.Module)),
|
|
22
|
-
isExpanded ? (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
|
|
22
|
+
isExpanded ? (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-collapse-button", onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-epxand-button", onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
|
|
23
23
|
isExpanded && (React.createElement(rebass_1.Box, { as: "ul", padding: 0, className: "ab-Shared-Entity-Shared-Object" },
|
|
24
24
|
React.createElement(AdaptableObjectList_1.AdaptableObjectListItem, { hideControls: true, data: item, module: module })))));
|
|
25
25
|
};
|
|
@@ -10,6 +10,6 @@ const TeamSharingApplyButton = (props) => {
|
|
|
10
10
|
const handleImport = React.useCallback(() => {
|
|
11
11
|
adaptable.api.teamSharingApi.importSharedEntry(props.data);
|
|
12
12
|
}, []);
|
|
13
|
-
return (React.createElement(SimpleButton_1.default, { onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
|
|
13
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-apply-button", onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
|
|
14
14
|
};
|
|
15
15
|
exports.TeamSharingApplyButton = TeamSharingApplyButton;
|
|
@@ -38,7 +38,7 @@ class ThemePopupComponent extends React.Component {
|
|
|
38
38
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
39
39
|
React.createElement(FormLayout_1.default, null,
|
|
40
40
|
React.createElement(FormLayout_1.FormRow, { label: "Current Theme:" },
|
|
41
|
-
React.createElement(DropdownButton_1.default, { columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription)))));
|
|
41
|
+
React.createElement(DropdownButton_1.default, { "data-name": "select-theme-dropdown", columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription)))));
|
|
42
42
|
}
|
|
43
43
|
onChangeTheme(value) {
|
|
44
44
|
this.props.SelectTheme(value);
|
|
@@ -76,7 +76,6 @@ const OnePageAdaptableWizard = (props) => {
|
|
|
76
76
|
exports.OnePageAdaptableWizard = OnePageAdaptableWizard;
|
|
77
77
|
const OnePageWizardSummary = () => {
|
|
78
78
|
const { setCurrentSection, sections, data } = (0, OnePageWizards_1.useOnePageWizardContext)();
|
|
79
|
-
const { api } = useOnePageAdaptableWizardContext();
|
|
80
79
|
const renderEdit = (index) => (React.createElement(SimpleButton_1.default, { px: 1, variant: "text", style: {
|
|
81
80
|
textDecoration: 'underline',
|
|
82
81
|
display: 'inline-block',
|
|
@@ -84,7 +83,7 @@ const OnePageWizardSummary = () => {
|
|
|
84
83
|
}, onClick: () => {
|
|
85
84
|
setCurrentSection(index);
|
|
86
85
|
} }, "edit"));
|
|
87
|
-
return (React.createElement(
|
|
86
|
+
return (React.createElement(rebass_1.Box, { className: "ab-OnePageWizardSummary" }, sections
|
|
88
87
|
.map((section, index) => {
|
|
89
88
|
if (section === '-') {
|
|
90
89
|
return null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/core';
|
|
2
3
|
import { ActionColumn } from '../AdaptableOptions/ActionOptions';
|
|
3
4
|
interface ActionColumnCellRendererParams extends ICellRendererParams {
|
|
4
5
|
actionColumn?: ActionColumn;
|
|
5
6
|
}
|
|
7
|
+
export declare const ReactActionColumnRenderer: (props: ActionColumnCellRendererParams) => JSX.Element;
|
|
6
8
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
7
9
|
private eGui;
|
|
8
10
|
private eventListener;
|
|
@@ -1,76 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionColumnRenderer = void 0;
|
|
3
|
+
exports.ActionColumnRenderer = exports.ReactActionColumnRenderer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButton"));
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const uuid_1 = require("../components/utils/uuid");
|
|
8
|
+
const useRerender_1 = require("../components/utils/useRerender");
|
|
9
|
+
function getActionButtonsAndActionColumn(adaptable, actionColumn, colId) {
|
|
10
|
+
var _a;
|
|
11
|
+
const actionCol = actionColumn
|
|
12
|
+
? actionColumn
|
|
13
|
+
: (_a = adaptable.api.actionApi.getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == colId);
|
|
14
|
+
if (actionCol && actionCol.actionColumnButton) {
|
|
15
|
+
let actionButtons = Array.isArray(actionCol.actionColumnButton)
|
|
16
|
+
? actionCol.actionColumnButton
|
|
17
|
+
: [actionCol.actionColumnButton];
|
|
18
|
+
if (!actionButtons.length) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// actionButtons don't have IDs, so we need to generate them to be used later as a react component key
|
|
22
|
+
actionButtons = actionButtons.map((actionButton) => (Object.assign(Object.assign({}, actionButton), { Uuid: (0, uuid_1.createUuid)() })));
|
|
23
|
+
return { actionButtons, actionColumn: actionCol };
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
actionButtons: [],
|
|
27
|
+
actionColumn: actionCol,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const renderActionButtons = (buttons, adaptableApi, context, rerender) => {
|
|
31
|
+
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (button.hidden && button.hidden(button, context)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context, {
|
|
37
|
+
height: 15,
|
|
38
|
+
width: 15,
|
|
39
|
+
});
|
|
40
|
+
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
41
|
+
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
42
|
+
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
43
|
+
const handleClick = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, context);
|
|
46
|
+
// Timeout to let any updates to be done before re-rendering the component
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
// when called again it triggers a re-render
|
|
49
|
+
// https:reactjs.org/docs/react-dom.html#render
|
|
50
|
+
rerender();
|
|
51
|
+
}, 16);
|
|
52
|
+
};
|
|
53
|
+
const disabled = button.disabled && button.disabled(button, context);
|
|
54
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
|
|
55
|
+
})));
|
|
56
|
+
};
|
|
57
|
+
const ReactActionColumnRenderer = (props) => {
|
|
58
|
+
const rerender = (0, useRerender_1.useRerender)();
|
|
59
|
+
const adaptable = props.api.__adaptable;
|
|
60
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, props.actionColumn, props.colDef.colId);
|
|
61
|
+
if (!actionColumn || !actionButtons.length) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (adaptable.api.gridApi.isGroupRowNode(props.node) && !actionColumn.includeGroupedRows) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node);
|
|
68
|
+
const buttonContext = {
|
|
69
|
+
actionColumn,
|
|
70
|
+
primaryKeyValue: pkValue,
|
|
71
|
+
rowNode: props.node,
|
|
72
|
+
adaptableApi: adaptable.api,
|
|
73
|
+
};
|
|
74
|
+
return (React.createElement("div", { className: "ab-ActionColumn" }, renderActionButtons(actionButtons, adaptable.api, buttonContext, rerender)));
|
|
75
|
+
};
|
|
76
|
+
exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
8
77
|
class ActionColumnRenderer {
|
|
9
78
|
// gets called once before the renderer is used
|
|
10
79
|
init(params) {
|
|
11
|
-
var _a;
|
|
12
80
|
const adaptable = params.api.__adaptable;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// actionButtons don't have IDs, so we need to generate them to be used later as a react component key
|
|
25
|
-
actionButtons = actionButtons.map((actionButton) => (Object.assign(Object.assign({}, actionButton), { Uuid: (0, uuid_1.createUuid)() })));
|
|
26
|
-
// create the cell
|
|
27
|
-
this.eGui = document.createElement('div');
|
|
28
|
-
this.eGui.className = 'ab-ActionColumn';
|
|
29
|
-
// if its a group node then only show if set to do so
|
|
30
|
-
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionCol.includeGroupedRows) {
|
|
31
|
-
this.eGui.innerHTML = '';
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
35
|
-
const buttonContext = {
|
|
36
|
-
actionColumn: actionCol,
|
|
37
|
-
primaryKeyValue: pkValue,
|
|
38
|
-
rowNode: params.node,
|
|
39
|
-
adaptableApi: adaptable.api,
|
|
40
|
-
};
|
|
41
|
-
const renderActionButtons = (buttons, adaptableApi, context) => {
|
|
42
|
-
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
if (button.hidden && button.hidden(button, context)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context, {
|
|
48
|
-
height: 15,
|
|
49
|
-
width: 15,
|
|
50
|
-
});
|
|
51
|
-
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
52
|
-
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
53
|
-
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
54
|
-
const handleClick = () => {
|
|
55
|
-
button.onClick(button, context);
|
|
56
|
-
// Timeout to let any updates to be done before re-rendering the component
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
// when called again it triggers a re-render
|
|
59
|
-
// https:reactjs.org/docs/react-dom.html#render
|
|
60
|
-
doRender();
|
|
61
|
-
}, 16);
|
|
62
|
-
};
|
|
63
|
-
const disabled = button.disabled && button.disabled(button, context);
|
|
64
|
-
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
const eGui = this.eGui;
|
|
68
|
-
const doRender = () => {
|
|
69
|
-
this.unmountReactRoot = adaptable.renderReactRoot(renderActionButtons(actionButtons, adaptable.api, buttonContext), eGui);
|
|
70
|
-
};
|
|
71
|
-
this.render = doRender;
|
|
72
|
-
doRender();
|
|
81
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, params.actionColumn, params.colDef.colId);
|
|
82
|
+
if (!actionColumn || !actionButtons.length) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// create the cell
|
|
86
|
+
this.eGui = document.createElement('div');
|
|
87
|
+
this.eGui.className = 'ab-ActionColumn';
|
|
88
|
+
// if its a group node then only show if set to do so
|
|
89
|
+
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionColumn.includeGroupedRows) {
|
|
90
|
+
this.eGui.innerHTML = '';
|
|
91
|
+
return;
|
|
73
92
|
}
|
|
93
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
94
|
+
const buttonContext = {
|
|
95
|
+
actionColumn,
|
|
96
|
+
primaryKeyValue: pkValue,
|
|
97
|
+
rowNode: params.node,
|
|
98
|
+
adaptableApi: adaptable.api,
|
|
99
|
+
};
|
|
100
|
+
const eGui = this.eGui;
|
|
101
|
+
const doRender = () => {
|
|
102
|
+
this.unmountReactRoot = adaptable.renderReactRoot(renderActionButtons(actionButtons, adaptable.api, buttonContext, doRender), eGui);
|
|
103
|
+
};
|
|
104
|
+
this.render = doRender;
|
|
105
|
+
doRender();
|
|
74
106
|
}
|
|
75
107
|
// defined on init
|
|
76
108
|
// used to re-render in refresh
|
|
@@ -161,7 +161,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
161
161
|
private getFormatColumnAdaptableStyle;
|
|
162
162
|
private getFormatColumnCellStyle;
|
|
163
163
|
private getFormatColumnCellClass;
|
|
164
|
-
private getFormatColumnRowClass;
|
|
165
164
|
private getActiveAlertWithHighlightCell;
|
|
166
165
|
private getActiveAlertWithHighlightRow;
|
|
167
166
|
private getAlertCellStyle;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -956,7 +956,9 @@ class Adaptable {
|
|
|
956
956
|
getFormatColumnAdaptableStyle(formatColumns) {
|
|
957
957
|
// first has more precedence, then they need to be applied in reverse order
|
|
958
958
|
return formatColumns.reduceRight((style, formatColumn) => {
|
|
959
|
-
const formatColumnStyle =
|
|
959
|
+
const formatColumnStyle = formatColumn.Style
|
|
960
|
+
? this.convertAdaptableStyleToCSS(formatColumn.Style)
|
|
961
|
+
: {};
|
|
960
962
|
if (formatColumn.CellAlignment) {
|
|
961
963
|
switch (formatColumn.CellAlignment) {
|
|
962
964
|
case 'Left':
|
|
@@ -973,37 +975,21 @@ class Adaptable {
|
|
|
973
975
|
return Object.assign(Object.assign({}, style), formatColumnStyle);
|
|
974
976
|
}, {});
|
|
975
977
|
}
|
|
976
|
-
getFormatColumnCellStyle(abColumn,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
const activeFormatColumnsWithStyle = formatColumnsWithStyle.filter((formatColumn) => {
|
|
980
|
-
return this.api.formatColumnApi.isFormatColumnActiveForColumn(formatColumn, abColumn, params);
|
|
981
|
-
});
|
|
982
|
-
if (!activeFormatColumnsWithStyle.length) {
|
|
983
|
-
return style;
|
|
984
|
-
}
|
|
985
|
-
style = Object.assign(Object.assign({}, style), this.getFormatColumnAdaptableStyle(activeFormatColumnsWithStyle));
|
|
978
|
+
getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params) {
|
|
979
|
+
if (!activeFormatColumnsWithStyle.length) {
|
|
980
|
+
return {};
|
|
986
981
|
}
|
|
987
|
-
|
|
982
|
+
const relevantFormatColumnsWithStyle = activeFormatColumnsWithStyle.filter((formatColumn) => {
|
|
983
|
+
return this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params);
|
|
984
|
+
});
|
|
985
|
+
return this.getFormatColumnAdaptableStyle(relevantFormatColumnsWithStyle);
|
|
988
986
|
}
|
|
989
987
|
getFormatColumnCellClass(formatColumns, abColumn, params) {
|
|
990
988
|
const classNames = formatColumns
|
|
991
989
|
.map((formatColumn) => {
|
|
992
990
|
var _a, _b;
|
|
993
991
|
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
994
|
-
this.api.formatColumnApi.
|
|
995
|
-
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
996
|
-
}
|
|
997
|
-
})
|
|
998
|
-
.filter((x) => !!x);
|
|
999
|
-
return classNames;
|
|
1000
|
-
}
|
|
1001
|
-
getFormatColumnRowClass(formatColumns, params) {
|
|
1002
|
-
const classNames = formatColumns
|
|
1003
|
-
.map((formatColumn) => {
|
|
1004
|
-
var _a, _b;
|
|
1005
|
-
if (((_a = formatColumn.Style) === null || _a === void 0 ? void 0 : _a.ClassName) &&
|
|
1006
|
-
this.api.formatColumnApi.isFormatColumnActiveForRow(formatColumn, params)) {
|
|
992
|
+
this.api.formatColumnApi.isFormatColumnRelevantForColumn(formatColumn, abColumn, params)) {
|
|
1007
993
|
return (_b = formatColumn.Style) === null || _b === void 0 ? void 0 : _b.ClassName;
|
|
1008
994
|
}
|
|
1009
995
|
})
|
|
@@ -2335,7 +2321,7 @@ class Adaptable {
|
|
|
2335
2321
|
pinned: this.adaptableOptions.actionOptions.actionRowButtonsPosition === 'pinnedRight'
|
|
2336
2322
|
? 'right'
|
|
2337
2323
|
: 'left',
|
|
2338
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2324
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2339
2325
|
cellRendererParams: {
|
|
2340
2326
|
actionColumn: rowEditActionColumn,
|
|
2341
2327
|
},
|
|
@@ -2364,7 +2350,7 @@ class Adaptable {
|
|
|
2364
2350
|
filter: false,
|
|
2365
2351
|
sortable: false,
|
|
2366
2352
|
enableRowGroup: false,
|
|
2367
|
-
cellRenderer: ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2353
|
+
cellRenderer: this.variant === 'react' ? ActionColumnRenderer_1.ReactActionColumnRenderer : ActionColumnRenderer_1.ActionColumnRenderer,
|
|
2368
2354
|
type: [GeneralConstants_1.AB_SPECIAL_COLUMN, 'abColDefObject'],
|
|
2369
2355
|
};
|
|
2370
2356
|
(0, LoggingHelper_1.LogAdaptableInfo)('Setting up Action Column: ' + actionColumn.columnId);
|
|
@@ -3175,8 +3161,7 @@ class Adaptable {
|
|
|
3175
3161
|
fontSize: null,
|
|
3176
3162
|
borderColor: null,
|
|
3177
3163
|
};
|
|
3178
|
-
const
|
|
3179
|
-
const formatColumnsWithStyle = this.api.formatColumnApi.getColumnFormatColumnsWithStyle(abColumn);
|
|
3164
|
+
const activeFormatColumnsWithStyle = this.api.formatColumnApi.getFormatColumnsWithStyleForColumn(abColumn);
|
|
3180
3165
|
let styledColumn = this.api.styledColumnApi.getStyledColumnByColumnId(colId);
|
|
3181
3166
|
if (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.IsSuspended) {
|
|
3182
3167
|
styledColumn = null;
|
|
@@ -3184,11 +3169,10 @@ class Adaptable {
|
|
|
3184
3169
|
const quickSearchStyle = this.getQuickSearchCellStyle();
|
|
3185
3170
|
const hasQuickSearchStyle = quickSearchStyle != undefined;
|
|
3186
3171
|
const cellStyle = (params) => {
|
|
3187
|
-
const formatColumnCellStyle = formatColumn && !styledColumn // TODO: remove after refactor columnStyle
|
|
3188
|
-
? this.getFormatColumnCellStyle(abColumn, formatColumn, formatColumnsWithStyle, params)
|
|
3189
|
-
: undefined;
|
|
3190
3172
|
const isQuickSearchActive = hasQuickSearchStyle && this.isQuickSearchActive(abColumn, params);
|
|
3191
|
-
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)),
|
|
3173
|
+
const result = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultCellStyle), this.getReadOnlyCellStyle(abColumn, params)), this.getEditableCellStyle(abColumn, params)), (typeof userCellStyle === 'function' ? userCellStyle(params) : userCellStyle)), (!styledColumn
|
|
3174
|
+
? this.getFormatColumnCellStyle(abColumn, activeFormatColumnsWithStyle, params)
|
|
3175
|
+
: {})), (styledColumn ? this.getStyledColumnStyle(styledColumn, abColumn, params) : {})), (isQuickSearchActive ? quickSearchStyle : {})), this.getAlertCellStyle(abColumn, params)), this.getFlashingCellStyle(abColumn, params)), this.getCellHighlightStyle(abColumn, params));
|
|
3192
3176
|
return result;
|
|
3193
3177
|
};
|
|
3194
3178
|
return cellStyle;
|
|
@@ -3416,47 +3400,39 @@ class Adaptable {
|
|
|
3416
3400
|
}
|
|
3417
3401
|
setupColumnValueFormatter({ col, abColumn }) {
|
|
3418
3402
|
this.setColDefProperty(col, 'valueFormatter', (params) => {
|
|
3419
|
-
const
|
|
3420
|
-
if (!
|
|
3403
|
+
const activeFormatColumnsWithDisplayFormat = this.api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
3404
|
+
if (!activeFormatColumnsWithDisplayFormat.length) {
|
|
3421
3405
|
return;
|
|
3422
3406
|
}
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3407
|
+
return (params) => {
|
|
3408
|
+
const { node, value } = params;
|
|
3409
|
+
const [mostRelevantFormatColumn] = this.api.formatColumnApi.getFormatColumnsRelevantForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node, value });
|
|
3410
|
+
if (!mostRelevantFormatColumn) {
|
|
3411
|
+
// ALL FormatColumns are conditional and NONE of them are relevant for this row
|
|
3412
|
+
return value;
|
|
3413
|
+
}
|
|
3414
|
+
const options = mostRelevantFormatColumn.DisplayFormat.Options;
|
|
3415
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'NumberFormatter') {
|
|
3430
3416
|
// change the Number format - if the scope allows it
|
|
3431
|
-
if (this.api.scopeApi.isColumnInNumericScope(abColumn,
|
|
3432
|
-
|
|
3433
|
-
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3434
|
-
};
|
|
3417
|
+
if (this.api.scopeApi.isColumnInNumericScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3418
|
+
return this.api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
3435
3419
|
}
|
|
3436
3420
|
}
|
|
3437
|
-
if (
|
|
3421
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'DateFormatter') {
|
|
3438
3422
|
// change the Date format - if the scope allows it
|
|
3439
|
-
if (this.api.scopeApi.isColumnInDateScope(abColumn,
|
|
3440
|
-
|
|
3441
|
-
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3442
|
-
};
|
|
3423
|
+
if (this.api.scopeApi.isColumnInDateScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3424
|
+
return this.api.formatColumnApi.getDateFormattedValue(params.value, params.node, abColumn, options);
|
|
3443
3425
|
}
|
|
3444
3426
|
}
|
|
3445
|
-
if (
|
|
3427
|
+
if (mostRelevantFormatColumn.DisplayFormat.Formatter === 'StringFormatter') {
|
|
3446
3428
|
// change the String format - if the scope allows it
|
|
3447
|
-
if (this.api.scopeApi.isColumnInStringsScope(abColumn,
|
|
3448
|
-
|
|
3449
|
-
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3450
|
-
};
|
|
3429
|
+
if (this.api.scopeApi.isColumnInStringsScope(abColumn, mostRelevantFormatColumn.Scope)) {
|
|
3430
|
+
return this.api.formatColumnApi.getStringFormattedValue(params.value, params.node, abColumn, options);
|
|
3451
3431
|
}
|
|
3452
3432
|
}
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
return rulePasses ? valueFormatter(params) : params.value;
|
|
3457
|
-
};
|
|
3458
|
-
}
|
|
3459
|
-
}
|
|
3433
|
+
// should NEVER arrive at this line, but just to be sure
|
|
3434
|
+
return value;
|
|
3435
|
+
};
|
|
3460
3436
|
});
|
|
3461
3437
|
}
|
|
3462
3438
|
setupColumnEditable({ col }) {
|
|
@@ -3699,14 +3675,14 @@ class Adaptable {
|
|
|
3699
3675
|
firstInfo.trigger == 'tick' ? this.filterOnTickingDataChange() : this.filterOnEditDataChange();
|
|
3700
3676
|
}
|
|
3701
3677
|
getExpressionStylesChanges(dataChangedScope, cellDataChangedInfos) {
|
|
3702
|
-
const
|
|
3703
|
-
|
|
3704
|
-
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(
|
|
3678
|
+
const formatColumnsWithExpression = [];
|
|
3679
|
+
formatColumnsWithExpression.push(...this.api.formatColumnApi.getFormatColumnsWithExpression());
|
|
3680
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(formatColumnsWithExpression)) {
|
|
3705
3681
|
return;
|
|
3706
3682
|
}
|
|
3707
3683
|
cellDataChangedInfos.forEach((cellDataChangedInfo) => {
|
|
3708
3684
|
if (!dataChangedScope.wholeRow) {
|
|
3709
|
-
|
|
3685
|
+
formatColumnsWithExpression.forEach((styleModule) => {
|
|
3710
3686
|
if (!dataChangedScope.wholeRow) {
|
|
3711
3687
|
const columnIds = this.api.queryLanguageApi.getColumnsFromExpression(styleModule.Rule.BooleanExpression);
|
|
3712
3688
|
if (columnIds.includes(cellDataChangedInfo.column.columnId)) {
|
|
@@ -4,6 +4,7 @@ exports.getPercentBarRendererForColumn = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Helper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/Helper"));
|
|
6
6
|
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
7
|
+
const FormatHelper_1 = require("../Utilities/Helpers/FormatHelper");
|
|
7
8
|
const getPercentBarRendererForColumn = (columnStyle, abColumn, api) => {
|
|
8
9
|
if (!columnStyle.PercentBarStyle) {
|
|
9
10
|
return;
|
|
@@ -56,6 +57,15 @@ const getPercentBarRendererForColumn = (columnStyle, abColumn, api) => {
|
|
|
56
57
|
textEl.className = 'ab-PercentBar__text';
|
|
57
58
|
textEl.style.lineHeight = '1.2';
|
|
58
59
|
if (percentBarStyle.CellText.includes('CellValue')) {
|
|
60
|
+
const activeFormatColumnsWithDisplayFormat = api.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
61
|
+
const [formatColumn] = api.formatColumnApi.getFormatColumnsRelevantForColumn(activeFormatColumnsWithDisplayFormat, abColumn, { node: params.node, value });
|
|
62
|
+
if (formatColumn && api.scopeApi.isColumnInNumericScope(abColumn, formatColumn.Scope)) {
|
|
63
|
+
const options = formatColumn.DisplayFormat.Options;
|
|
64
|
+
value = api.formatColumnApi.getNumberFormattedValue(params.value, params.node, abColumn, options);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
value = (0, FormatHelper_1.NumberFormatter)(value, { FractionDigits: 2 });
|
|
68
|
+
}
|
|
59
69
|
textEl.innerText = value;
|
|
60
70
|
}
|
|
61
71
|
if (percentBarStyle.CellText.includes('PercentageValue')) {
|
|
@@ -79,22 +79,30 @@ const cellSummaryWeightedAverage = ({ numericColumns, selectedCellInfo, adaptabl
|
|
|
79
79
|
sumPrimaryValues += weightedGridCell.rawValue * gridCell.normalisedValue;
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
if (isValid) {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
82
|
+
if (!isValid) {
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
const abColumn = adaptableApi.columnApi.getColumnFromId(columnId);
|
|
86
|
+
if (!abColumn) {
|
|
87
|
+
return '';
|
|
88
|
+
}
|
|
89
|
+
const activeFormatColumnsWithDisplayFormat = adaptableApi.formatColumnApi.getFormatColumnsWithDisplayFormatForColumn(abColumn);
|
|
90
|
+
if (activeFormatColumnsWithDisplayFormat.length === 1 &&
|
|
91
|
+
activeFormatColumnsWithDisplayFormat[0].DisplayFormat.Formatter === 'NumberFormatter') {
|
|
92
|
+
// there only one FormatColumn on this column, so we will use it to format the aggregated value
|
|
93
|
+
const [singleActiveFormatColumnsWithDisplayFormat] = activeFormatColumnsWithDisplayFormat;
|
|
94
|
+
const options = singleActiveFormatColumnsWithDisplayFormat
|
|
95
|
+
.DisplayFormat.Options;
|
|
96
|
+
if (options) {
|
|
97
|
+
return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, options);
|
|
90
98
|
}
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// there are multiple (possibly conflicting) FormatColumns for this column, we cannot know which to use
|
|
91
102
|
return FormatHelper_1.default.NumberFormatter(sumPrimaryValues / sumWeightedValue, {
|
|
92
103
|
FractionDigits: 2,
|
|
93
104
|
});
|
|
94
105
|
}
|
|
95
|
-
else {
|
|
96
|
-
return '';
|
|
97
|
-
}
|
|
98
106
|
}
|
|
99
107
|
};
|
|
100
108
|
exports.cellSummaryWeightedAverage = cellSummaryWeightedAverage;
|
|
@@ -46,7 +46,7 @@ const CheckBox = (_a) => {
|
|
|
46
46
|
opacity: 0,
|
|
47
47
|
cursor: 'pointer',
|
|
48
48
|
}, onChange: onInputChange }));
|
|
49
|
-
return (React.createElement(rebass_1.Box, Object.assign({ my: 2 }, props, { className: (0, join_1.default)('ab-CheckBox', `ab-CheckBox--${type}`, `ab-CheckBox--variant-${variant}`, disabled ? 'ab-CheckBox--disabled' : '', readOnly ? 'ab-CheckBox--readonly' : '', props.className), style:
|
|
49
|
+
return (React.createElement(rebass_1.Box, Object.assign({ my: 2 }, props, { className: (0, join_1.default)('ab-CheckBox', `ab-CheckBox--${type}`, `ab-CheckBox--variant-${variant}`, disabled ? 'ab-CheckBox--disabled' : '', readOnly ? 'ab-CheckBox--readonly' : '', props.className), style: props.style, as: as }),
|
|
50
50
|
before,
|
|
51
51
|
beforeGap,
|
|
52
52
|
input,
|
|
@@ -19,6 +19,7 @@ const DocumentationLinkConstants_1 = require("../../Utilities/Constants/Document
|
|
|
19
19
|
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
20
20
|
const icons_1 = require("../icons");
|
|
21
21
|
const AdaptableContext_1 = require("../../View/AdaptableContext");
|
|
22
|
+
const join_1 = tslib_1.__importDefault(require("../utils/join"));
|
|
22
23
|
const VarEditorButton = () => {
|
|
23
24
|
var _a, _b;
|
|
24
25
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
@@ -39,6 +40,7 @@ function BaseEditorInput(props) {
|
|
|
39
40
|
let evaluationError;
|
|
40
41
|
let expressionError;
|
|
41
42
|
let selectedFunctionName;
|
|
43
|
+
const baseClassName = 'ab-ExpressionEditorInput';
|
|
42
44
|
const buildParserExceptionMessage = (e) => {
|
|
43
45
|
const parserExceptionSummary = 'Invalid expression is not parsable';
|
|
44
46
|
if (!e.message) {
|
|
@@ -101,55 +103,34 @@ function BaseEditorInput(props) {
|
|
|
101
103
|
props.onSelectedFunctionChange(selectedFunctionName ? expressionFunctions[selectedFunctionName] : null);
|
|
102
104
|
}
|
|
103
105
|
}, [selectedFunctionName]);
|
|
104
|
-
const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { "data-name": "expression-dropdown-list", flexDirection: "column", p: 2,
|
|
105
|
-
fontSize: 'var(--ab-font-size-2)',
|
|
106
|
-
border: '1px solid var(--ab-color-primarydark)',
|
|
107
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
108
|
-
background: 'var(--ab-color-primarylight)',
|
|
109
|
-
zIndex: 1000,
|
|
110
|
-
maxHeight: 300,
|
|
111
|
-
overflow: 'auto',
|
|
112
|
-
} }, Object.keys(expressionFunctions)
|
|
106
|
+
const functionsDropdown = (React.createElement(OverlayTrigger_1.default, { render: () => (React.createElement(rebass_1.Flex, { className: `${baseClassName}__dropdown-functions-list`, "data-name": "expression-dropdown-fuctions-list", flexDirection: "column", p: 2 }, Object.keys(expressionFunctions)
|
|
113
107
|
.filter((functionName) => !expressionFunctions[functionName].isHiddenFromMenu)
|
|
114
108
|
.map((functionName) => functionName === 'VAR' ? (React.createElement(VarEditorButton, { key: functionName })) : (React.createElement(EditorButton_1.default, { data: `${functionName}()`, key: functionName, mr: 1 }, functionName))))), showEvent: "focus", hideEvent: "blur" },
|
|
115
109
|
React.createElement(SimpleButton_1.default, { "data-name": "expression-dropdown", icon: "arrow-down", iconPosition: 'end', mr: 1 },
|
|
116
|
-
React.createElement(rebass_1.Flex, { marginRight: 1,
|
|
117
|
-
React.createElement(icons_1.Icon, { name:
|
|
110
|
+
React.createElement(rebass_1.Flex, { marginRight: 1, fontSize: 2 },
|
|
111
|
+
React.createElement(icons_1.Icon, { name: "equation" })))));
|
|
118
112
|
const operatorButtons = props.editorButtons
|
|
119
113
|
.filter((editorButtonDef) => !!expressionFunctions[editorButtonDef.functionName])
|
|
120
114
|
.map((editorButtonDef) => (React.createElement(EditorButton_1.default, { key: `${editorButtonDef.functionName}-operator`, data: editorButtonDef.data, icon: editorButtonDef.icon }, !editorButtonDef.icon && (editorButtonDef.text || editorButtonDef.functionName))));
|
|
121
115
|
const showDocumentationLink = props.api.internalApi.isDocumentationLinksDisplayed();
|
|
122
116
|
return (React.createElement(React.Fragment, null,
|
|
123
|
-
React.createElement(rebass_1.Flex, { "data-name": "expression-toolbar", py: 2, mb: 2, flexWrap: "wrap",
|
|
124
|
-
background: 'var(--ab-color-primarylight)',
|
|
125
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
126
|
-
'--ab-overlay-horizontal-align': 'left',
|
|
127
|
-
width: '100%',
|
|
128
|
-
marginTop: 5,
|
|
129
|
-
} },
|
|
117
|
+
React.createElement(rebass_1.Flex, { className: baseClassName, "data-name": "expression-toolbar", py: 2, mb: 2, mt: 2, flexWrap: "wrap" },
|
|
130
118
|
React.createElement(rebass_1.Flex, { style: { flex: 1, marginLeft: 5 }, flexWrap: "wrap" },
|
|
131
119
|
functionsDropdown,
|
|
132
120
|
operatorButtons),
|
|
133
121
|
showDocumentationLink && (React.createElement(rebass_1.Flex, { alignItems: "flex-start" },
|
|
134
|
-
React.createElement(ButtonInfo_1.ButtonInfo, {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
background: 'var(--ab-color-action-add)',
|
|
138
|
-
marginRight: 5,
|
|
139
|
-
}, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
|
|
140
|
-
React.createElement(Textarea_1.default, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: "ab-ExpressionEditor__textarea", autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
122
|
+
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, tooltip: 'Learn how to use the Expression Editor', onClick: () => window.open(DocumentationLinkConstants_1.ExpressionEditorDocsLink, '_blank') })))),
|
|
123
|
+
React.createElement(Textarea_1.default, { "data-name": `expression-input-${type}`, ref: textAreaRefCallback, value: props.value || '', placeholder: props.placeholder || 'Create Query', disabled: props.disabled || false, className: (0, join_1.default)('ab-ExpressionEditor__textarea', // left for backwards compatibility
|
|
124
|
+
`${baseClassName}__textarea`), autoFocus: true, spellCheck: "false", onChange: (event) => {
|
|
141
125
|
props.onChange(event.target.value);
|
|
142
|
-
}, style:
|
|
143
|
-
props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2,
|
|
126
|
+
}, style: style }),
|
|
127
|
+
props.isFullExpression !== true && (React.createElement(HelpBlock_1.default, { mt: 2, mb: 2, p: 2, fontSize: 3 },
|
|
144
128
|
"This Query must resolve to a ",
|
|
145
129
|
React.createElement("b", null, "boolean "),
|
|
146
130
|
"(i.e. true / false) value")),
|
|
147
|
-
expressionError && (React.createElement(ErrorBox_1.default, { style: { whiteSpace: 'pre-wrap' }, mt: 2 }, expressionError)),
|
|
131
|
+
expressionError && (React.createElement(ErrorBox_1.default, { width: "100%", style: { whiteSpace: 'pre-wrap' }, mt: 2 }, expressionError)),
|
|
148
132
|
evaluationError && (React.createElement(ErrorBox_1.default, { style: { whiteSpace: 'pre-wrap' }, mt: 2 }, `${evaluationError.expressionFnName} ${evaluationError.message}`)),
|
|
149
|
-
!props.hideResultPreview && result !== undefined && (React.createElement(rebass_1.Box, { "data-name": "expression-editor-feedback", mt: 2, p: 2,
|
|
150
|
-
background: 'var(--ab-color-primarylight)',
|
|
151
|
-
borderRadius: 'var(--ab__border-radius)',
|
|
152
|
-
} },
|
|
133
|
+
!props.hideResultPreview && result !== undefined && (React.createElement(rebass_1.Box, { className: `${baseClassName}__editor-feedback`, "data-name": "expression-editor-feedback", mt: 2, p: 2 },
|
|
153
134
|
React.createElement("pre", { style: { whiteSpace: 'pre-wrap', margin: 0 } },
|
|
154
135
|
"Result (using Test Data): ",
|
|
155
136
|
React.createElement("b", null, JSON.stringify(result)))))));
|