@adaptabletools/adaptable 13.0.0-canary.9 → 13.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/base.css +1454 -840
- package/base.css.map +1 -0
- package/bundle.cjs.js +238 -220
- package/index.css +1505 -850
- package/index.css.map +1 -0
- package/package.json +6 -6
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +30 -6
- package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/Api/AdaptableApi.d.ts +2 -5
- package/src/Api/ColumnApi.d.ts +8 -2
- package/src/Api/ConfigApi.d.ts +0 -5
- package/src/Api/ExportApi.d.ts +6 -6
- package/src/Api/FormatColumnApi.d.ts +46 -73
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -3
- package/src/Api/Implementation/AlertApiImpl.js +9 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +15 -11
- package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -2
- package/src/Api/Implementation/ConfigApiImpl.js +0 -11
- package/src/Api/Implementation/ExportApiImpl.d.ts +4 -4
- package/src/Api/Implementation/ExportApiImpl.js +14 -14
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -1
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +24 -22
- package/src/Api/Implementation/FormatColumnApiImpl.js +57 -224
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +4 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -1
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -15
- package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +25 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +193 -0
- package/src/Api/InternalApi.d.ts +1 -1
- package/src/Api/QueryLanguageApi.d.ts +3 -2
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +106 -0
- package/src/Api/{ConditionalStyleApi.js → StyledColumnApi.js} +0 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/FormatColumnState.d.ts +6 -90
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
- package/src/{Strategy/Interface/IConditionalStyleModule.js → PredefinedConfig/StyledColumnState.js} +0 -0
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +4 -4
- package/src/Redux/ActionsReducers/PluginsRedux.js +5 -5
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
- package/src/Redux/DeadRedux.d.ts +6 -0
- package/src/Redux/DeadRedux.js +19 -1
- package/src/Redux/Store/AdaptableStore.js +9 -8
- package/src/Strategy/ConditionalStyleModule.d.ts +2 -27
- package/src/Strategy/ConditionalStyleModule.js +0 -219
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +30 -221
- package/src/Strategy/LayoutModule.js +0 -4
- package/src/Strategy/StyledColumnModule.d.ts +24 -0
- package/src/Strategy/StyledColumnModule.js +165 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
- package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +4 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -3
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
- package/src/Utilities/ObjectFactory.d.ts +5 -2
- package/src/Utilities/ObjectFactory.js +14 -6
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/Utilities/Services/QueryLanguageService.js +1 -1
- package/src/Utilities/Services/ReportService.js +6 -6
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +15 -14
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +24 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +6 -5
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +3 -3
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -3
- package/src/View/Alert/Wizard/isValidAlertRules.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +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/ListBoxFilterForm.js +2 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +7 -13
- package/src/View/Components/NewScopeComponent.js +3 -3
- 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/RangesComponent.d.ts +8 -1
- package/src/View/Components/RangesComponent.js +60 -24
- package/src/View/Components/ScopeComponent.js +6 -6
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/Selectors/ColumnValueSelector.js +2 -2
- package/src/View/Components/StyleComponent.js +14 -19
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +1 -11
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- package/src/View/Dashboard/DashboardPopup.js +1 -1
- package/src/View/DataSet/DataSetSelector.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.js +4 -4
- package/src/View/Export/ReportExportDropdown.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -11
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FlashingCell/FlashingCellStyle.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.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 +27 -27
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +4 -5
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +2 -6
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -300
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -10
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/GridInfo/ColumnInfoComponent.js +26 -18
- package/src/View/GridInfo/GridInfoPopup.js +10 -9
- package/src/View/Layout/LayoutRadioSelector.js +1 -1
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/Wizard/Components/ColumnLabels.js +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +7 -6
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +3 -3
- package/src/View/Query/QueryViewPanel.d.ts +1 -1
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
- 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/StatusBar/StatusBarPopup.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +234 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
- package/src/View/SystemStatus/SystemStatusEntityRow.js +4 -6
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- 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.d.ts +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 +10 -11
- package/src/agGrid/Adaptable.js +164 -222
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.js +60 -16
- package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
- package/src/agGrid/FloatingFilterWrapper.js +71 -32
- package/src/agGrid/PercentBarRenderer.d.ts +6 -2
- package/src/agGrid/PercentBarRenderer.js +19 -17
- package/src/agGrid/agGridHelper.d.ts +6 -2
- package/src/agGrid/agGridHelper.js +17 -17
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +84 -17
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +78 -27
- package/src/agGrid/weightedAverage.js +19 -11
- package/src/components/CheckBox/index.js +7 -2
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/DragAndDropContext/UnusedPanel.js +3 -2
- 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/components/icons/brush.d.ts +3 -0
- package/src/components/icons/brush.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +113 -57
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +5 -5
- package/themes/dark.css +8 -4
- package/themes/dark.css.map +1 -0
- package/themes/light.css +4 -1
- package/themes/light.css.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableComponents.d.ts +0 -1
- package/src/AdaptableComponents.js +0 -5
- package/src/Api/ConditionalStyleApi.d.ts +0 -86
- package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +0 -29
- package/src/Api/Implementation/ConditionalStyleApiImpl.js +0 -98
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +0 -49
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +0 -95
- package/src/Strategy/Interface/IConditionalStyleModule.d.ts +0 -6
- package/src/Strategy/Utilities/getStyleViewItems.d.ts +0 -2
- package/src/Strategy/Utilities/getStyleViewItems.js +0 -16
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +0 -2
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +0 -18
- package/src/View/ConditionalStyle/ConditionalStyleSummary.d.ts +0 -25
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +0 -108
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.d.ts +0 -9
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +0 -42
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +0 -43
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +0 -29
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +0 -23
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.d.ts +0 -6
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +0 -114
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.d.ts +0 -1
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.js +0 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import { ICellEditorComp, ICellEditorParams } from '@ag-grid-community/core';
|
|
2
3
|
/**
|
|
3
4
|
* Adaptable number editor parameters extending the AG Grid {@link ICellEditorParams}.
|
|
@@ -14,6 +15,7 @@ interface AdaptableNumberCellEditorParams extends ICellEditorParams {
|
|
|
14
15
|
*/
|
|
15
16
|
emptyValue: string;
|
|
16
17
|
}
|
|
18
|
+
export declare const ReactAdaptableNumberEditor: React.ForwardRefExoticComponent<AdaptableNumberCellEditorParams & React.RefAttributes<unknown>>;
|
|
17
19
|
/**
|
|
18
20
|
* Used by default for all `abColDefNumber` columns.
|
|
19
21
|
*
|
|
@@ -51,8 +53,5 @@ export declare class AdaptableNumberEditor implements ICellEditorComp {
|
|
|
51
53
|
afterGuiAttached(): void;
|
|
52
54
|
destroy(): void;
|
|
53
55
|
private onValueChange;
|
|
54
|
-
private getStartValue;
|
|
55
|
-
private shouldClearExistingValue;
|
|
56
|
-
private isValidChar;
|
|
57
56
|
}
|
|
58
57
|
export {};
|
|
@@ -1,11 +1,82 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableNumberEditor = void 0;
|
|
3
|
+
exports.AdaptableNumberEditor = exports.ReactAdaptableNumberEditor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const renderWithAdaptableContext_1 = require("../../../View/renderWithAdaptableContext");
|
|
7
7
|
const InternalAdaptableNumberEditor_1 = require("./InternalAdaptableNumberEditor");
|
|
8
8
|
const core_1 = require("@ag-grid-community/core");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
function shouldClearExistingValue(params) {
|
|
11
|
+
return params.eventKey === core_1.KeyCode.BACKSPACE || params.eventKey === core_1.KeyCode.DELETE;
|
|
12
|
+
}
|
|
13
|
+
function isValidChar(char) {
|
|
14
|
+
// allow only digits
|
|
15
|
+
return ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char);
|
|
16
|
+
// we do NOT allow key shortcuts for starting non-digits (minus sign, decimal separators) as the input[number] handling is very buggy and we would open a can of worms
|
|
17
|
+
}
|
|
18
|
+
function getStartValue(params) {
|
|
19
|
+
if (shouldClearExistingValue(params)) {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
if (params.charPress && isValidChar(params.charPress)) {
|
|
23
|
+
return params.charPress;
|
|
24
|
+
}
|
|
25
|
+
return params.value;
|
|
26
|
+
}
|
|
27
|
+
const defaultValueParser = ({ newValue, oldValue: _ }) => {
|
|
28
|
+
return newValue;
|
|
29
|
+
};
|
|
30
|
+
const style = {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
top: '0px',
|
|
33
|
+
left: '0px',
|
|
34
|
+
right: '0px',
|
|
35
|
+
bottom: '0px',
|
|
36
|
+
};
|
|
37
|
+
exports.ReactAdaptableNumberEditor = (0, react_1.forwardRef)((props, ref) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const [initialValue] = (0, react_1.useState)(() => getStartValue(props));
|
|
40
|
+
const valueRef = (0, react_1.useRef)(initialValue);
|
|
41
|
+
const columnId = props.column.getColId();
|
|
42
|
+
const adaptable = props.api.__adaptable;
|
|
43
|
+
const colValueParser = props.column.getColDef().valueParser;
|
|
44
|
+
const valueParser = typeof colValueParser === 'function' ? colValueParser : defaultValueParser;
|
|
45
|
+
function onValueChange(value) {
|
|
46
|
+
value = valueParser
|
|
47
|
+
? valueParser(Object.assign(Object.assign({}, props), { oldValue: props.value, newValue: value }))
|
|
48
|
+
: value;
|
|
49
|
+
valueRef.current = value;
|
|
50
|
+
}
|
|
51
|
+
const editorRef = (0, react_1.useRef)(null);
|
|
52
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
53
|
+
return {
|
|
54
|
+
focusIn() {
|
|
55
|
+
var _a;
|
|
56
|
+
(_a = editorRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
57
|
+
},
|
|
58
|
+
// the final value to send to the grid, on completion of editing
|
|
59
|
+
getValue() {
|
|
60
|
+
return valueRef.current;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
const editorElement = (React.createElement(InternalAdaptableNumberEditor_1.InternalAdaptableNumberEditor, { defaultValue: initialValue, showClearButton: (_a = props.showClearButton) !== null && _a !== void 0 ? _a : true, emptyValue: (_b = props.emptyValue) !== null && _b !== void 0 ? _b : '', onValueChange: onValueChange, ref: (editor) => {
|
|
65
|
+
editorRef.current = editor;
|
|
66
|
+
editor === null || editor === void 0 ? void 0 : editor.focus();
|
|
67
|
+
} }));
|
|
68
|
+
function onKeyDown(keyDownEvent) {
|
|
69
|
+
adaptable._emit('CellEditorKeyDown', {
|
|
70
|
+
keyDownEvent,
|
|
71
|
+
cellValue: valueRef.current,
|
|
72
|
+
columnId,
|
|
73
|
+
updateValueCallback: (updatedValue) => {
|
|
74
|
+
editorRef.current.setValue(updatedValue);
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return (React.createElement("div", { style: style, onKeyDown: onKeyDown }, (0, renderWithAdaptableContext_1.renderWithAdaptableContext)(editorElement, adaptable)));
|
|
79
|
+
});
|
|
9
80
|
/**
|
|
10
81
|
* Used by default for all `abColDefNumber` columns.
|
|
11
82
|
*
|
|
@@ -29,9 +100,7 @@ const core_1 = require("@ag-grid-community/core");
|
|
|
29
100
|
*/
|
|
30
101
|
class AdaptableNumberEditor {
|
|
31
102
|
constructor() {
|
|
32
|
-
this.valueParser =
|
|
33
|
-
return newValue;
|
|
34
|
-
};
|
|
103
|
+
this.valueParser = defaultValueParser;
|
|
35
104
|
this.onValueChange = (value) => {
|
|
36
105
|
this.value = this.valueParser
|
|
37
106
|
? this.valueParser(Object.assign(Object.assign({}, this.params), { oldValue: this.params.value, newValue: value }))
|
|
@@ -39,7 +108,7 @@ class AdaptableNumberEditor {
|
|
|
39
108
|
};
|
|
40
109
|
}
|
|
41
110
|
init(params) {
|
|
42
|
-
this.value =
|
|
111
|
+
this.value = getStartValue(params);
|
|
43
112
|
this.params = params;
|
|
44
113
|
this.columnId = params.column.getColId();
|
|
45
114
|
const { valueParser } = params.column.getColDef();
|
|
@@ -47,11 +116,10 @@ class AdaptableNumberEditor {
|
|
|
47
116
|
this.valueParser = valueParser;
|
|
48
117
|
}
|
|
49
118
|
this.el = document.createElement('div');
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
this.el.style.bottom = '0px';
|
|
119
|
+
Object.keys(style).forEach((key) => {
|
|
120
|
+
//@ts-ignore
|
|
121
|
+
this.el.style[key] = style[key];
|
|
122
|
+
});
|
|
55
123
|
}
|
|
56
124
|
/* Component Editor Lifecycle methods */
|
|
57
125
|
// gets called once when grid ready to insert the element
|
|
@@ -92,22 +160,5 @@ class AdaptableNumberEditor {
|
|
|
92
160
|
var _a;
|
|
93
161
|
(_a = this.unmountReactRoot) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
94
162
|
}
|
|
95
|
-
getStartValue(params) {
|
|
96
|
-
if (this.shouldClearExistingValue(params)) {
|
|
97
|
-
return '';
|
|
98
|
-
}
|
|
99
|
-
if (params.charPress && this.isValidChar(params.charPress)) {
|
|
100
|
-
return params.charPress;
|
|
101
|
-
}
|
|
102
|
-
return params.value;
|
|
103
|
-
}
|
|
104
|
-
shouldClearExistingValue(params) {
|
|
105
|
-
return params.eventKey === core_1.KeyCode.BACKSPACE || params.eventKey === core_1.KeyCode.DELETE;
|
|
106
|
-
}
|
|
107
|
-
isValidChar(char) {
|
|
108
|
-
// allow only digits
|
|
109
|
-
return ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes(char);
|
|
110
|
-
// we do NOT allow key shortcuts for starting non-digits (minus sign, decimal separators) as the input[number] handling is very buggy and we would open a can of worms
|
|
111
|
-
}
|
|
112
163
|
}
|
|
113
164
|
exports.AdaptableNumberEditor = AdaptableNumberEditor;
|
|
@@ -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;
|
|
@@ -31,7 +31,12 @@ const CheckBox = (_a) => {
|
|
|
31
31
|
? 'unchecked'
|
|
32
32
|
: 'indeterminate';
|
|
33
33
|
const gap = React.createElement("div", { style: { marginLeft: gapDistance, display: 'inline-block' } });
|
|
34
|
-
children = children ? React.createElement("div", { style: {
|
|
34
|
+
children = children ? (React.createElement("div", { style: {
|
|
35
|
+
display: 'inline-block',
|
|
36
|
+
whiteSpace: 'nowrap',
|
|
37
|
+
overflow: 'hidden',
|
|
38
|
+
textOverflow: 'ellipsis',
|
|
39
|
+
} }, children)) : null;
|
|
35
40
|
const before = childrenPosition === 'start' ? children : null;
|
|
36
41
|
const beforeGap = childrenPosition === 'start' && children ? gap : null;
|
|
37
42
|
const after = childrenPosition === 'end' ? children : null;
|
|
@@ -46,7 +51,7 @@ const CheckBox = (_a) => {
|
|
|
46
51
|
opacity: 0,
|
|
47
52
|
cursor: 'pointer',
|
|
48
53
|
}, 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:
|
|
54
|
+
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
55
|
before,
|
|
51
56
|
beforeGap,
|
|
52
57
|
input,
|
|
@@ -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" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "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" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "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" | "onClick" | "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" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx" | "
|
|
18
|
+
export declare const Datepicker: React.ForwardRefExoticComponent<Pick<DatepickerProps, "max" | "required" | "type" | "data" | "default" | "high" | "low" | "key" | "id" | "media" | "height" | "width" | "start" | "open" | "name" | "alignContent" | "alignItems" | "alignSelf" | "backgroundColor" | "color" | "content" | "display" | "flex" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "justifyContent" | "justifyItems" | "justifySelf" | "letterSpacing" | "lineHeight" | "margin" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "opacity" | "order" | "overflow" | "overflowX" | "overflowY" | "padding" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "textAlign" | "translate" | "verticalAlign" | "value" | "hidden" | "cite" | "dir" | "form" | "label" | "p" | "slot" | "span" | "style" | "summary" | "title" | "pattern" | "acceptCharset" | "action" | "method" | "noValidate" | "target" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "nonce" | "tabIndex" | "async" | "disabled" | "multiple" | "size" | "manifest" | "m" | "wrap" | "accept" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "list" | "loop" | "marginHeight" | "marginWidth" | "maxLength" | "mediaGroup" | "min" | "minLength" | "muted" | "optimum" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "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" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "selected" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "useMap" | "wmode" | "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" | "onClick" | "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" | "bg" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "css" | "variant" | "tx" | "sx" | "showOutsideDays" | "showWeekNumber" | "onHide" | "showClearButton" | "datepickerButtons" | "dateProps"> & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -42,7 +42,7 @@ function ToolbarItem({ toolbar, toolbarIndex, onRemove, disabled, }) {
|
|
|
42
42
|
const { availableItems } = React.useContext(DragAndDropContext_1.DragAndDropContext);
|
|
43
43
|
let currentItem = availableItems.find((t) => t.Id === toolbar);
|
|
44
44
|
const title = currentItem ? currentItem.Title : toolbar;
|
|
45
|
-
return (React.createElement(react_beautiful_dnd_1.Draggable, { isDragDisabled: disabled, draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) => (React.createElement(rebass_1.Flex, Object.assign({ className: "ab-ModuleSelector__ToolbarItem", alignItems: "center", backgroundColor: snapshot.isDragging
|
|
45
|
+
return (React.createElement(react_beautiful_dnd_1.Draggable, { isDragDisabled: disabled, draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) => (React.createElement(rebass_1.Flex, Object.assign({ className: "ab-ModuleSelector__ToolbarItem", alignItems: "center", mb: 1, pl: 1, backgroundColor: snapshot.isDragging
|
|
46
46
|
? 'var(--ab-dashboard-toolbar-drag__background)'
|
|
47
47
|
: 'var(--ab-color-primarylight)', ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }),
|
|
48
48
|
React.createElement("div", { style: { flex: 1 } }, title),
|
|
@@ -4,10 +4,11 @@ exports.UnusedPanel = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_beautiful_dnd_1 = require("react-beautiful-dnd");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
7
8
|
const DragAndDropContext_1 = require("./DragAndDropContext");
|
|
8
9
|
function UnusedPanel({ items, disabled, title, dragItemText, }) {
|
|
9
|
-
return (React.createElement(
|
|
10
|
-
React.createElement(
|
|
10
|
+
return (React.createElement(rebass_1.Box, { pb: 1, mb: 2, className: "ab-ModuleSelector__UnusedPanel", "data-name": "unusedpanel-items" },
|
|
11
|
+
React.createElement(rebass_1.Box, { p: 2 },
|
|
11
12
|
React.createElement("b", null, title),
|
|
12
13
|
" (",
|
|
13
14
|
dragItemText,
|
|
@@ -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)))))));
|
|
@@ -31,6 +31,7 @@ function ExpressionEditor(props) {
|
|
|
31
31
|
const [data, setData] = (0, react_1.useState)(props.initialData);
|
|
32
32
|
const [showColumnIds, setShowColumnIds] = (0, react_1.useState)(false);
|
|
33
33
|
const [showNamedQueries, setShowNamedQueries] = (0, react_1.useState)(false);
|
|
34
|
+
const baseClassName = `ab-ExpressionEditor`;
|
|
34
35
|
const [selectedFunction, setSelectedFunction] = (0, react_1.useState)(null);
|
|
35
36
|
const [expressionText, setExpressionText] = (0, react_1.useState)('');
|
|
36
37
|
const { namedQuery, setNamedQuery } = (0, NamedQueryContext_1.useNamedQueryContext)();
|
|
@@ -102,7 +103,7 @@ function ExpressionEditor(props) {
|
|
|
102
103
|
};
|
|
103
104
|
const [searchInputValue, setSearchInputValue] = React.useState('');
|
|
104
105
|
const dataTableEditor = (React.createElement(React.Fragment, null,
|
|
105
|
-
React.createElement(rebass_1.Flex, { flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
|
|
106
|
+
React.createElement(rebass_1.Flex, { className: `${baseClassName}__columns-list`, flexDirection: "column", alignItems: "start", style: { marginTop: 2 } },
|
|
106
107
|
React.createElement(CheckBox_1.CheckBox, { checked: showColumnIds, onChange: (checked) => setShowColumnIds(checked), style: {
|
|
107
108
|
float: 'right',
|
|
108
109
|
margin: 0,
|
|
@@ -157,28 +158,24 @@ function ExpressionEditor(props) {
|
|
|
157
158
|
setSelectedFunction,
|
|
158
159
|
textAreaRef,
|
|
159
160
|
} },
|
|
160
|
-
React.createElement(
|
|
161
|
+
React.createElement(rebass_1.Flex, { className: baseClassName, flex: 1, "data-name": "expression-editor-wrapper", pl: 2, style: props.style },
|
|
161
162
|
React.createElement(rebass_1.Flex, { flex: 1, style: { minHeight: 0 }, flexDirection: "column", onFocus: (event) => {
|
|
162
163
|
if (event.target.tagName === 'TEXTAREA') {
|
|
163
164
|
textAreaRef.current = event.target;
|
|
164
165
|
}
|
|
165
166
|
} },
|
|
166
|
-
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", "data-name": "expression-editor",
|
|
167
|
+
React.createElement(rebass_1.Flex, { flex: 1, flexDirection: "row", "data-name": "expression-editor", fontSize: 2, style: { minHeight: 0 } },
|
|
167
168
|
React.createElement(rebass_1.Flex, { flex: 1, paddingRight: 2, style: { overflow: 'auto' }, "data-name": "expression-builder", flexDirection: "column" },
|
|
168
169
|
editorInput,
|
|
169
170
|
StringExtensions_1.default.IsNotNullOrEmpty(expressionText === null || expressionText === void 0 ? void 0 : expressionText.trim()) && (React.createElement(ExpressionFunctionDocumentation_1.ExpressionFunctionDocumentation, { expressionFunction: selectedFunction })),
|
|
170
171
|
/* displayed for advanced queries (observable&Aggregation) to give the users a starting point */
|
|
171
172
|
StringExtensions_1.default.IsNullOrEmpty(expressionText === null || expressionText === void 0 ? void 0 : expressionText.trim()) && renderQueryHints(type),
|
|
172
|
-
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 2, mb: 2,
|
|
173
|
-
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2,
|
|
174
|
-
color: 'var(--ab-color-text-on-add)',
|
|
175
|
-
fill: 'var(--ab-color-text-on-add)',
|
|
176
|
-
background: 'var(--ab-color-action-add)',
|
|
177
|
-
}, onClick: () => window.open(queryDocumentationLink, '_blank') }),
|
|
173
|
+
showDocumentationLinks && (React.createElement(HelpBlock_1.default, { "data-name": "query-documentation", mt: 2, mb: 2, fontSize: 3 },
|
|
174
|
+
React.createElement(ButtonInfo_1.ButtonInfo, { mr: 2, onClick: () => window.open(queryDocumentationLink, '_blank') }),
|
|
178
175
|
"See ",
|
|
179
176
|
StringExtensions_1.default.CapitaliseFirstLetter(type),
|
|
180
177
|
" Query documentation for more details and examples")),
|
|
181
|
-
React.createElement(
|
|
178
|
+
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
182
179
|
allowSaveNamedQuery &&
|
|
183
180
|
props.api.internalApi
|
|
184
181
|
.getModuleService()
|
|
@@ -202,13 +199,8 @@ function ExpressionEditor(props) {
|
|
|
202
199
|
BooleanExpression: expressionText,
|
|
203
200
|
});
|
|
204
201
|
} })) : null))),
|
|
205
|
-
React.createElement(rebass_1.Box, { "data-name": "expression-column-picker", pb: 2, paddingLeft: 2,
|
|
206
|
-
|
|
207
|
-
minWidth: 220,
|
|
208
|
-
height: '100%',
|
|
209
|
-
paddingRight: 'var(--ab-space-2)',
|
|
210
|
-
} },
|
|
211
|
-
ArrayExtensions_1.default.IsNotNullOrEmpty(props.namedQueries) && (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "start", style: { padding: 3, marginTop: 5 }, backgroundColor: "primarylight" },
|
|
202
|
+
React.createElement(rebass_1.Box, { className: `${baseClassName}__column-picker`, "data-name": "expression-column-picker", pb: 2, paddingLeft: 2, pr: 2 },
|
|
203
|
+
ArrayExtensions_1.default.IsNotNullOrEmpty(props.namedQueries) && (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "start", p: 1, mt: 2, backgroundColor: "primarylight" },
|
|
212
204
|
React.createElement(Radio_1.default, { checked: !showNamedQueries, onChange: (checked) => setShowNamedQueries(!checked), style: { marginRight: 10 } }, "Columns"),
|
|
213
205
|
React.createElement(Radio_1.default, { checked: showNamedQueries, onChange: (checked) => setShowNamedQueries(checked), style: { marginLeft: 10, whiteSpace: 'nowrap' } }, "Named Queries"))),
|
|
214
206
|
showNamedQueries ? React.createElement("div", null, namedQueries) : React.createElement("div", null, dataTableEditor)))))));
|
|
@@ -73,7 +73,7 @@ const FormRow = (props) => {
|
|
|
73
73
|
}
|
|
74
74
|
if (props.as != null || column.component != null) {
|
|
75
75
|
const Cmp = column.component;
|
|
76
|
-
value = (React.createElement(Cmp, { style: Object.assign(Object.assign({}, column.style), { gridColumn: columnIndex + 1, gridRow: rowIndex + 1 }), className: column.className }, value));
|
|
76
|
+
value = (React.createElement(Cmp, { "data-name": props.dataName, style: Object.assign(Object.assign({}, column.style), { gridColumn: columnIndex + 1, gridRow: rowIndex + 1 }), className: column.className }, value));
|
|
77
77
|
}
|
|
78
78
|
return typeof value === 'string' ? value : React.cloneElement(value, { key: columnName });
|
|
79
79
|
});
|
|
@@ -5,8 +5,9 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const StyleHelper_1 = require("../Utilities/Helpers/StyleHelper");
|
|
8
|
+
const join_1 = tslib_1.__importDefault(require("./utils/join"));
|
|
8
9
|
const StylePreview = (props) => {
|
|
9
10
|
var _a, _b, _c;
|
|
10
|
-
return (React.createElement(rebass_1.Box, Object.assign({}, props, { padding: (_a = props.padding) !== null && _a !== void 0 ? _a : 2, mt: (_b = props.mt) !== null && _b !== void 0 ? _b : 2, style: Object.assign(Object.assign({}, (0, StyleHelper_1.toStyle)(props.styleObject)), props.style) }), (_c = props.children) !== null && _c !== void 0 ? _c : 'Preview result'));
|
|
11
|
+
return (React.createElement(rebass_1.Box, Object.assign({}, props, { className: (0, join_1.default)('ab-StylePreview', props.className), padding: (_a = props.padding) !== null && _a !== void 0 ? _a : 2, mt: (_b = props.mt) !== null && _b !== void 0 ? _b : 2, style: Object.assign(Object.assign({}, (0, StyleHelper_1.toStyle)(props.styleObject)), props.style) }), (_c = props.children) !== null && _c !== void 0 ? _c : 'Preview result'));
|
|
11
12
|
};
|
|
12
13
|
exports.StylePreview = StylePreview;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const React = tslib_1.__importStar(require("react"));
|
|
5
|
+
const DefaultIcon_1 = tslib_1.__importDefault(require("./DefaultIcon"));
|
|
6
|
+
exports.default = (props) => (React.createElement(DefaultIcon_1.default, Object.assign({}, props),
|
|
7
|
+
React.createElement("path", { d: "M6 21q-1.125 0-2.225-.55T2 19q.65 0 1.325-.512Q4 17.975 4 17q0-1.25.875-2.125T7 14q1.25 0 2.125.875T10 17q0 1.65-1.175 2.825Q7.65 21 6 21Zm0-2q.825 0 1.412-.587Q8 17.825 8 17q0-.425-.287-.712Q7.425 16 7 16t-.713.288Q6 16.575 6 17q0 .575-.137 1.05-.138.475-.363.9.125.05.25.05H6Zm5.75-4L9 12.25l8.95-8.95q.275-.275.688-.288.412-.012.712.288l1.35 1.35q.3.3.3.7 0 .4-.3.7ZM7 17Z" })));
|
|
@@ -132,6 +132,7 @@ const track_changes_1 = tslib_1.__importDefault(require("./track-changes"));
|
|
|
132
132
|
const menu_1 = tslib_1.__importDefault(require("./menu"));
|
|
133
133
|
const statusbar_1 = tslib_1.__importDefault(require("./statusbar"));
|
|
134
134
|
const add_row_1 = tslib_1.__importDefault(require("./add-row"));
|
|
135
|
+
const brush_1 = tslib_1.__importDefault(require("./brush"));
|
|
135
136
|
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
136
137
|
const quote_1 = tslib_1.__importDefault(require("./quote"));
|
|
137
138
|
const news_1 = tslib_1.__importDefault(require("./news"));
|
|
@@ -154,6 +155,7 @@ const allIcons = {
|
|
|
154
155
|
call: call_1.default,
|
|
155
156
|
instrument: instrument_1.default,
|
|
156
157
|
news: news_1.default,
|
|
158
|
+
brush: brush_1.default,
|
|
157
159
|
'data-set': data_set_1.default,
|
|
158
160
|
export: export_1.default,
|
|
159
161
|
campaign: campaign_1.default,
|