@adaptabletools/adaptable 11.0.0-canary.0 → 11.0.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +21 -10
- package/bundle.cjs.js +98 -94
- package/index.css +23 -10
- package/package.json +32 -32
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +3 -2
- package/src/AdaptableOptions/EntitlementOptions.d.ts +1 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +1 -1
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +1 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/GridApi.d.ts +5 -4
- package/src/Api/Implementation/DashboardApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +5 -4
- package/src/Api/Implementation/GridApiImpl.js +4 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +1 -9
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -12
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowHighlightInfo.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/DashboardState.d.ts +4 -4
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -1
- package/src/Redux/ActionsReducers/DashboardRedux.d.ts +0 -7
- package/src/Redux/ActionsReducers/DashboardRedux.js +1 -11
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -13
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +13 -3
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.js +32 -16
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregationExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +2 -3
- package/src/Utilities/Extensions/StringExtensions.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/ObjectFactory.js +4 -2
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.d.ts +2 -3
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -23
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +15 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +4 -6
- package/src/View/Components/ModuleValueSelector/index.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.d.ts +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +43 -87
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +10 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +54 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +19 -6
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -3
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +6 -14
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +2 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +44 -0
- package/src/View/Components/SharedProps/ModuleViewPopupProps.d.ts +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -4
- package/src/View/Components/ValueSelector/index.d.ts +2 -1
- package/src/View/Components/ValueSelector/index.js +5 -5
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +10 -5
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +16 -4
- package/src/View/Dashboard/Dashboard.js +4 -4
- package/src/View/Dashboard/DashboardPopup.js +5 -5
- package/src/View/Export/Wizard/NewReportWizard.js +13 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +17 -26
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -2
- package/src/View/FlashingCell/Wizard/{FlashingCellDurationWizardSection.d.ts → FlashingCellSettingsWizardSection.d.ts} +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +81 -0
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +5 -5
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +10 -5
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +8 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +13 -5
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +8 -2
- package/src/View/Query/QueryViewPanel.js +12 -9
- package/src/View/Query/Wizard/NamedQueryWizard.js +3 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleWizard.js +14 -14
- package/src/View/SpecialColumnSettingsWizardStep.d.ts +9 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +62 -0
- package/src/View/Wizard/AdaptableWizard.js +1 -1
- package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -0
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/agGrid/Adaptable.d.ts +0 -2
- package/src/agGrid/Adaptable.js +32 -22
- package/src/agGrid/agGridHelper.js +2 -3
- package/src/agGrid/agGridMenuHelper.js +5 -9
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/Dashboard/DashboardManager.d.ts +5 -3
- package/src/components/Dashboard/DashboardManager.js +33 -27
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/Overlay.js +1 -1
- package/src/components/WindowModal/WindowModal.js +17 -2
- package/src/components/utils/useDraggable.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +9 -0
- package/src/metamodel/adaptable.metamodel.js +18 -11
- package/src/types.d.ts +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellDurationWizardSection.js +0 -60
|
@@ -13,39 +13,39 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
13
13
|
const react_redux_1 = require("react-redux");
|
|
14
14
|
const ScheduleRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ScheduleRedux"));
|
|
15
15
|
exports.ScheduleWizard = (props) => {
|
|
16
|
-
var _a;
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
var _a, _b;
|
|
17
|
+
const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
|
|
18
|
+
const isNew = props.popupParams.action ? props.popupParams.action === 'New' : !props.data;
|
|
19
|
+
const scheduleType = data ? data.ScheduleType : (_b = props === null || props === void 0 ? void 0 : props.abObjectType) === null || _b === void 0 ? void 0 : _b.name;
|
|
20
20
|
const [schedule, setSchedule] = React.useState(() => {
|
|
21
|
-
if (
|
|
22
|
-
return
|
|
21
|
+
if (data) {
|
|
22
|
+
return data;
|
|
23
23
|
}
|
|
24
|
-
let
|
|
24
|
+
let scheduleState = null;
|
|
25
25
|
switch (scheduleType) {
|
|
26
26
|
case Enums_1.ScheduleType.Reminder:
|
|
27
|
-
|
|
27
|
+
scheduleState = ObjectFactory_1.default.CreateEmptyReminderSchedule();
|
|
28
28
|
break;
|
|
29
29
|
case Enums_1.ScheduleType.Report:
|
|
30
|
-
|
|
30
|
+
scheduleState = ObjectFactory_1.default.CreateEmptyReportSchedule();
|
|
31
31
|
break;
|
|
32
32
|
case Enums_1.ScheduleType.ipushpull:
|
|
33
|
-
|
|
33
|
+
scheduleState = ObjectFactory_1.default.CreateEmptyIPushPullSchedule();
|
|
34
34
|
break;
|
|
35
35
|
case Enums_1.ScheduleType.Glue42:
|
|
36
|
-
|
|
36
|
+
scheduleState = ObjectFactory_1.default.CreateEmptyGlue42Schedule();
|
|
37
37
|
break;
|
|
38
38
|
case Enums_1.ScheduleType.OpenFin:
|
|
39
|
-
|
|
39
|
+
scheduleState = ObjectFactory_1.default.CreateEmptyOpenFinSchedule();
|
|
40
40
|
break;
|
|
41
41
|
}
|
|
42
|
-
return
|
|
42
|
+
return scheduleState;
|
|
43
43
|
});
|
|
44
44
|
const [isOneOff, setIsOneOff] = React.useState(false);
|
|
45
45
|
const dispatch = react_redux_1.useDispatch();
|
|
46
46
|
const handleFinish = () => {
|
|
47
47
|
let action = null;
|
|
48
|
-
if (
|
|
48
|
+
if (!isNew) {
|
|
49
49
|
switch (scheduleType) {
|
|
50
50
|
case Enums_1.ScheduleType.Reminder:
|
|
51
51
|
action = ScheduleRedux.ReminderScheduleEdit(schedule);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { SpecialColumnSettings } from '../../types';
|
|
3
|
+
interface SpecialColumnTypeSettingsProps {
|
|
4
|
+
settings: SpecialColumnSettings;
|
|
5
|
+
onChange: (settings: SpecialColumnSettings) => void;
|
|
6
|
+
isEditable?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const SpecialColumnSettingsWizardStep: React.FunctionComponent<SpecialColumnTypeSettingsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpecialColumnSettingsWizardStep = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chunk_1 = tslib_1.__importDefault(require("lodash/chunk"));
|
|
6
|
+
const React = tslib_1.__importStar(require("react"));
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const CheckBox_1 = require("../components/CheckBox");
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../components/FormLayout"));
|
|
10
|
+
const Tabs_1 = require("../components/Tabs");
|
|
11
|
+
const AdaptableContext_1 = require("./AdaptableContext");
|
|
12
|
+
exports.SpecialColumnSettingsWizardStep = (props) => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const adaptable = AdaptableContext_1.useAdaptable();
|
|
15
|
+
const possibleColumnTypes = adaptable.api.internalApi.getAdaptableOptions().userInterfaceOptions.columnTypes;
|
|
16
|
+
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_a = props.settings) !== null && _a !== void 0 ? _a : {};
|
|
17
|
+
const handleColumnTypeChange = (columnType, checked) => {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
const columnTypes = (_b = (_a = props.settings) === null || _a === void 0 ? void 0 : _a.ColumnTypes) !== null && _b !== void 0 ? _b : [];
|
|
20
|
+
if (checked) {
|
|
21
|
+
props.onChange(Object.assign(Object.assign({}, props.settings), { ColumnTypes: [...columnTypes, columnType] }));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
props.onChange(Object.assign(Object.assign({}, props.settings), { ColumnTypes: (_c = columnTypes === null || columnTypes === void 0 ? void 0 : columnTypes.filter) === null || _c === void 0 ? void 0 : _c.call(columnTypes, (item) => item !== columnType) }));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const onSettingsChange = (values) => {
|
|
28
|
+
props.onChange(Object.assign(Object.assign({}, props.settings), values));
|
|
29
|
+
};
|
|
30
|
+
return (React.createElement(React.Fragment, null,
|
|
31
|
+
React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false },
|
|
32
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Column Properties"),
|
|
33
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
34
|
+
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
35
|
+
React.createElement(FormLayout_1.default, { style: { width: '100%' }, columns: [
|
|
36
|
+
{ name: 'first', size: '30%' },
|
|
37
|
+
{ size: '30%', name: 'second' },
|
|
38
|
+
{ size: '30%', name: 'third' },
|
|
39
|
+
] },
|
|
40
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
41
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Filterable, onChange: (Filterable) => onSettingsChange({ Filterable }), disabled: !adaptable.api.internalApi.getAdaptableOptions().filterOptions
|
|
42
|
+
.enableFilterOnSpecialColumns }, "Filterable"),
|
|
43
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Resizable, onChange: (Resizable) => onSettingsChange({ Resizable }) }, "Resizable"),
|
|
44
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Groupable, onChange: (Groupable) => onSettingsChange({ Groupable }) }, "Groupable")),
|
|
45
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
46
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Sortable, onChange: (Sortable) => onSettingsChange({ Sortable }) }, "Sortable"),
|
|
47
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Pivotable, onChange: (Pivotable) => onSettingsChange({ Pivotable }) }, "Pivotable"),
|
|
48
|
+
React.createElement(CheckBox_1.CheckBox, { checked: Aggregatable, onChange: (Aggregatable) => onSettingsChange({ Aggregatable }) }, "Aggregatable")),
|
|
49
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
50
|
+
React.createElement(CheckBox_1.CheckBox, { checked: SuppressMenu, onChange: (SuppressMenu) => onSettingsChange({ SuppressMenu }) }, "Suppress Menu"),
|
|
51
|
+
React.createElement(CheckBox_1.CheckBox, { checked: SuppressMovable, onChange: (SuppressMovable) => onSettingsChange({ SuppressMovable }) }, "Suppress Movable"),
|
|
52
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: true, checked: props.isEditable }, "Editable")))))),
|
|
53
|
+
Boolean(possibleColumnTypes === null || possibleColumnTypes === void 0 ? void 0 : possibleColumnTypes.length) && (React.createElement(Tabs_1.Tabs, { marginTop: 2, autoFocus: false },
|
|
54
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Column Types"),
|
|
55
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
56
|
+
React.createElement(FormLayout_1.default, { columns: [{ name: 'first', size: '30%' }, { name: 'second' }] }, (_b = chunk_1.default(possibleColumnTypes !== null && possibleColumnTypes !== void 0 ? possibleColumnTypes : [], 2)) === null || _b === void 0 ? void 0 : _b.map(([first, second]) => {
|
|
57
|
+
var _a, _b, _c, _d, _e, _f;
|
|
58
|
+
return (React.createElement(FormLayout_1.FormRow, { key: first },
|
|
59
|
+
first && (React.createElement(CheckBox_1.CheckBox, { onChange: (checked) => handleColumnTypeChange(first, checked), checked: (_c = (_b = (_a = props.settings) === null || _a === void 0 ? void 0 : _a.ColumnTypes) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, first) }, first)),
|
|
60
|
+
second && (React.createElement(CheckBox_1.CheckBox, { onChange: (checked) => handleColumnTypeChange(second, checked), checked: (_f = (_e = (_d = props.settings) === null || _d === void 0 ? void 0 : _d.ColumnTypes) === null || _e === void 0 ? void 0 : _e.includes) === null || _f === void 0 ? void 0 : _f.call(_e, second) }, second))));
|
|
61
|
+
})))))));
|
|
62
|
+
};
|
|
@@ -9,7 +9,7 @@ const rebass_1 = require("rebass");
|
|
|
9
9
|
const Dialog_1 = tslib_1.__importDefault(require("../../components/Dialog"));
|
|
10
10
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
11
11
|
const Panel_1 = tslib_1.__importDefault(require("../../components/Panel"));
|
|
12
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash
|
|
12
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
13
13
|
exports.AdaptableWizardContext = React.createContext({
|
|
14
14
|
data: null,
|
|
15
15
|
updateGoBackState: () => { },
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { AdaptableObject } from '../../../PredefinedConfig/Common/AdaptableObject';
|
|
3
3
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
4
4
|
import { ModuleInfo } from '../../../Strategy/Interface/IModule';
|
|
5
|
+
import { ModuleParams } from '../../Components/SharedProps/ModuleViewPopupProps';
|
|
5
6
|
export interface AdaptableWizardStep {
|
|
6
7
|
canNext(): boolean;
|
|
7
8
|
canBack(): boolean;
|
|
@@ -44,4 +45,5 @@ export interface AdaptableOnePageWizardProps<T extends AdaptableObject> {
|
|
|
44
45
|
name: string;
|
|
45
46
|
label?: string;
|
|
46
47
|
};
|
|
48
|
+
popupParams?: ModuleParams;
|
|
47
49
|
}
|
|
@@ -9,7 +9,7 @@ const rebass_1 = require("rebass");
|
|
|
9
9
|
const QueryRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/QueryRedux"));
|
|
10
10
|
const Dialog_1 = tslib_1.__importDefault(require("../../components/Dialog"));
|
|
11
11
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
12
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash
|
|
12
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
13
13
|
const useProperty_1 = tslib_1.__importDefault(require("../../components/utils/useProperty"));
|
|
14
14
|
const AdaptableContext_1 = require("../AdaptableContext");
|
|
15
15
|
const isMacLike_1 = require("../../Utilities/isMacLike");
|
|
@@ -129,8 +129,6 @@ export declare class Adaptable implements IAdaptable {
|
|
|
129
129
|
private getAlertCellClass;
|
|
130
130
|
private getAlertRowClass;
|
|
131
131
|
private getAlertRowStyle;
|
|
132
|
-
private getFlashingCellRowStyle;
|
|
133
|
-
private getFlashingCellStyleFor;
|
|
134
132
|
private getFlashingCellStyle;
|
|
135
133
|
private getCellHighlightStyle;
|
|
136
134
|
private getRowHighlightStyle;
|
package/src/agGrid/Adaptable.js
CHANGED
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.bindAdaptableAgGrid = exports.AdaptableNoCodeWizard = exports.Adaptable = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const all_modules_1 = require("@ag-grid-community/all-modules");
|
|
6
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash
|
|
7
|
-
const isEqual_1 = tslib_1.__importDefault(require("lodash
|
|
8
|
-
const throttle_1 = tslib_1.__importDefault(require("lodash
|
|
9
|
-
const uniqBy_1 = tslib_1.__importDefault(require("lodash
|
|
6
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
7
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
8
|
+
const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
|
|
9
|
+
const uniqBy_1 = tslib_1.__importDefault(require("lodash/uniqBy"));
|
|
10
10
|
const React = tslib_1.__importStar(require("react"));
|
|
11
11
|
const ReactDOM = tslib_1.__importStar(require("react-dom"));
|
|
12
|
-
const clamp_1 = tslib_1.__importDefault(require("lodash
|
|
12
|
+
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
13
13
|
const AdaptableApiImpl_1 = require("../Api/Implementation/AdaptableApiImpl");
|
|
14
14
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
15
15
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
@@ -903,13 +903,12 @@ class Adaptable {
|
|
|
903
903
|
}
|
|
904
904
|
return null;
|
|
905
905
|
}
|
|
906
|
-
|
|
907
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
908
|
-
return this.getFlashingCellStyleFor(primaryKeyValue);
|
|
909
|
-
}
|
|
910
|
-
getFlashingCellStyleFor(primaryKey, colId) {
|
|
906
|
+
getFlashingCellStyle(col, params) {
|
|
911
907
|
var _a;
|
|
912
|
-
const
|
|
908
|
+
const primaryKey = params.node.aggData
|
|
909
|
+
? params.node.id
|
|
910
|
+
: this.getPrimaryKeyValueFromRowNode(params.node);
|
|
911
|
+
const flashingCell = this.api.internalApi.getAdaptableFlashingCellFor(primaryKey, col.columnId);
|
|
913
912
|
if (!flashingCell) {
|
|
914
913
|
return {};
|
|
915
914
|
}
|
|
@@ -919,10 +918,6 @@ class Adaptable {
|
|
|
919
918
|
? flashingCell.flashingCellDefinition.DownChangeStyle
|
|
920
919
|
: flashingCell.flashingCellDefinition.NeutralChangeStyle)) !== null && _a !== void 0 ? _a : {});
|
|
921
920
|
}
|
|
922
|
-
getFlashingCellStyle(col, params) {
|
|
923
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
924
|
-
return this.getFlashingCellStyleFor(primaryKeyValue, col.columnId);
|
|
925
|
-
}
|
|
926
921
|
getCellHighlightStyle(col, params) {
|
|
927
922
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
928
923
|
const cellHightlight = this.api.internalApi
|
|
@@ -1951,6 +1946,7 @@ class Adaptable {
|
|
|
1951
1946
|
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions.enableFilterOnSpecialColumns;
|
|
1952
1947
|
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable).FreeTextColumnSettings;
|
|
1953
1948
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
1949
|
+
var _a;
|
|
1954
1950
|
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
1955
1951
|
const dataTypeEditor = freeTextColumn.DataType === 'Number'
|
|
1956
1952
|
? AdaptableNumberEditor_1.AdaptableNumberEditor
|
|
@@ -1962,8 +1958,7 @@ class Adaptable {
|
|
|
1962
1958
|
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
1963
1959
|
this.agGridHelper.getAgGridDataType(freeTextColumn.DataType),
|
|
1964
1960
|
];
|
|
1965
|
-
if (freeTextColumn.FreeTextColumnSettings
|
|
1966
|
-
ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(freeTextColumn.FreeTextColumnSettings.ColumnTypes)) {
|
|
1961
|
+
if (ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty((_a = freeTextColumn === null || freeTextColumn === void 0 ? void 0 : freeTextColumn.FreeTextColumnSettings) === null || _a === void 0 ? void 0 : _a.ColumnTypes)) {
|
|
1967
1962
|
columnTypes.push(...freeTextColumn.FreeTextColumnSettings.ColumnTypes);
|
|
1968
1963
|
}
|
|
1969
1964
|
return {
|
|
@@ -2443,7 +2438,6 @@ class Adaptable {
|
|
|
2443
2438
|
*/
|
|
2444
2439
|
this.gridOptions.api.addEventListener(all_modules_1.Events.EVENT_COLUMN_RESIZED, (params) => {
|
|
2445
2440
|
if (params.finished == true && params.type == 'columnResized' && params.column) {
|
|
2446
|
-
this._emit('ColumnResized', params.column.getColId());
|
|
2447
2441
|
this.debouncedSaveGridLayout();
|
|
2448
2442
|
}
|
|
2449
2443
|
});
|
|
@@ -3156,14 +3150,30 @@ class Adaptable {
|
|
|
3156
3150
|
if (oldValue == newValue) {
|
|
3157
3151
|
return;
|
|
3158
3152
|
}
|
|
3159
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
3160
|
-
if (!primaryKeyValue) {
|
|
3161
|
-
return;
|
|
3162
|
-
}
|
|
3163
3153
|
const abColumn = this.api.columnApi.getColumnFromId(colId);
|
|
3164
3154
|
if (!abColumn) {
|
|
3165
3155
|
return;
|
|
3166
3156
|
}
|
|
3157
|
+
if (this.isGroupRowNode(rowNode)) {
|
|
3158
|
+
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3159
|
+
oldValue: oldValue,
|
|
3160
|
+
newValue: newValue,
|
|
3161
|
+
column: abColumn,
|
|
3162
|
+
/**
|
|
3163
|
+
* A grouped row does not have an underling data item.
|
|
3164
|
+
* Because of this we use the rowNode.id as an identifier.
|
|
3165
|
+
*/
|
|
3166
|
+
primaryKeyValue: rowNode.id,
|
|
3167
|
+
rowNode: rowNode,
|
|
3168
|
+
trigger: 'aggChange',
|
|
3169
|
+
});
|
|
3170
|
+
this.DataService.CreateDataChangedEvent(dataChangedInfo);
|
|
3171
|
+
return;
|
|
3172
|
+
}
|
|
3173
|
+
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
3174
|
+
if (!primaryKeyValue) {
|
|
3175
|
+
return;
|
|
3176
|
+
}
|
|
3167
3177
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3168
3178
|
oldValue: oldValue,
|
|
3169
3179
|
newValue: newValue,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.agGridHelper = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const clamp_1 = tslib_1.__importDefault(require("lodash
|
|
5
|
+
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
6
6
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
7
7
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
8
8
|
const AlertModule_1 = require("../Strategy/AlertModule");
|
|
@@ -248,8 +248,7 @@ class agGridHelper {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
// lets set this here one as the function cannot change the result so dont need to run it each time
|
|
251
|
-
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions
|
|
252
|
-
.excludeColumnFromQuickSearch;
|
|
251
|
+
let excludeColumnFromQuickSearch = this.adaptable.adaptableOptions.searchOptions.excludeColumnFromQuickSearch;
|
|
253
252
|
if (excludeColumnFromQuickSearch) {
|
|
254
253
|
if (excludeColumnFromQuickSearch(abColumn)) {
|
|
255
254
|
abColumn.isExcludedFromQuickSearch = true;
|
|
@@ -4,7 +4,7 @@ exports.agGridMenuHelper = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
|
|
6
6
|
const icons_1 = require("../components/icons");
|
|
7
|
-
const flatten_1 = tslib_1.__importDefault(require("lodash
|
|
7
|
+
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
8
8
|
// tslint:disable-next-line: class-name
|
|
9
9
|
class agGridMenuHelper {
|
|
10
10
|
constructor(adaptable, gridOptions) {
|
|
@@ -21,8 +21,7 @@ class agGridMenuHelper {
|
|
|
21
21
|
let userColumnMenuItems = [];
|
|
22
22
|
//First get Ag Grid Column Items
|
|
23
23
|
agGridColumnMenuItems.push(...this.createAgGridColumnMenuItems(originalgetMainMenuItems, params));
|
|
24
|
-
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions
|
|
25
|
-
.showAdaptableColumnMenu;
|
|
24
|
+
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableColumnMenu;
|
|
26
25
|
let hasAdaptableColumnMenuItems = showAdaptableColumnMenu == null || showAdaptableColumnMenu !== false;
|
|
27
26
|
if (hasAdaptableColumnMenuItems) {
|
|
28
27
|
agGridColumnMenuItems.push('separator');
|
|
@@ -56,8 +55,7 @@ class agGridMenuHelper {
|
|
|
56
55
|
let agGridContextMenuItems = [];
|
|
57
56
|
let adaptableContextMenuItems = [];
|
|
58
57
|
let userContextMenuItems = [];
|
|
59
|
-
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions
|
|
60
|
-
.showAdaptableContextMenu;
|
|
58
|
+
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableContextMenu;
|
|
61
59
|
let hasAdaptableContextMenuItems = showAdaptableContextMenu == null || showAdaptableContextMenu !== false;
|
|
62
60
|
let userDefinedContextMenuItems = this.adaptable.adaptableOptions.menuOptions.contextMenuItems;
|
|
63
61
|
let hasUserDefinedContextMenuItems = ArrayExtensions_1.ArrayExtensions.IsNotNullOrEmpty(userDefinedContextMenuItems);
|
|
@@ -285,8 +283,7 @@ class agGridMenuHelper {
|
|
|
285
283
|
// here we create agGrid Menu items based on Adaptable Menu Items
|
|
286
284
|
// user has ability to decide whether to show or not
|
|
287
285
|
let contextMenuItems = [];
|
|
288
|
-
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions
|
|
289
|
-
.showAdaptableContextMenu;
|
|
286
|
+
let showAdaptableContextMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableContextMenu;
|
|
290
287
|
if (showAdaptableContextMenu == null || showAdaptableContextMenu !== false) {
|
|
291
288
|
adaptableMenuItems.forEach((adaptableMenuItem) => {
|
|
292
289
|
if (adaptableMenuItem) {
|
|
@@ -321,8 +318,7 @@ class agGridMenuHelper {
|
|
|
321
318
|
// method to get all the Adaptable Menu Items - together with running the function where user can choose whether or not to display
|
|
322
319
|
getAdaptableMenuItemsColumnHeader(adaptableColumn, menuContext) {
|
|
323
320
|
const adaptableMenuItems = [];
|
|
324
|
-
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions
|
|
325
|
-
.showAdaptableColumnMenu;
|
|
321
|
+
let showAdaptableColumnMenu = this.adaptable.adaptableOptions.menuOptions.showAdaptableColumnMenu;
|
|
326
322
|
let runCheck = showAdaptableColumnMenu == null || showAdaptableColumnMenu !== false;
|
|
327
323
|
// if (adaptableColumn != null) {
|
|
328
324
|
this.adaptable.adaptableModules.forEach((s) => {
|
|
@@ -29,7 +29,7 @@ function Dashboard(props) {
|
|
|
29
29
|
top: position.y,
|
|
30
30
|
};
|
|
31
31
|
const renderTabs = () => (React.createElement("div", { className: "ab-Dashboard__tabs" }, children &&
|
|
32
|
-
React.Children.map(children, (child, index) => (React.createElement("button", { className: join_1.default('ab-Dashboard__tab', !collapsed && activeTabIndex === index ? 'ab-Dashboard__tab--active' : ''), key: index, onClick: () => {
|
|
32
|
+
React.Children.map(children, (child, index) => (React.createElement("button", { type: "button", className: join_1.default('ab-Dashboard__tab', !collapsed && activeTabIndex === index ? 'ab-Dashboard__tab--active' : ''), key: index, onClick: () => {
|
|
33
33
|
if (activeTabIndex === index) {
|
|
34
34
|
setCollapsed(!collapsed);
|
|
35
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { DashboardTab } from '../../PredefinedConfig/DashboardState';
|
|
3
3
|
import { AdaptableDashboardToolbar } from '../../PredefinedConfig/Common/Types';
|
|
4
4
|
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
@@ -6,10 +6,12 @@ export interface DashboardToolbar {
|
|
|
6
6
|
Id: AdaptableDashboardToolbar | string;
|
|
7
7
|
Title: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
interface DashboardManagerProps {
|
|
10
10
|
tabs: DashboardTab[];
|
|
11
11
|
onTabsChange: (tabs: DashboardTab[]) => void;
|
|
12
12
|
availableToolbars: DashboardToolbar[];
|
|
13
13
|
api: AdaptableApi;
|
|
14
|
-
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const DashboardManager: React.FunctionComponent<DashboardManagerProps>;
|
|
15
17
|
export default DashboardManager;
|
|
@@ -14,22 +14,22 @@ const getToolbarTitle = (availableToolbars, toolbarId) => {
|
|
|
14
14
|
const found = availableToolbars.find((t) => t.Id === toolbarId);
|
|
15
15
|
return found ? found.Title : toolbarId;
|
|
16
16
|
};
|
|
17
|
-
function TabList({ tabs, onRemoveTab, onRemoveToolbar, onChangeTabName, }) {
|
|
17
|
+
function TabList({ tabs, onRemoveTab, onRemoveToolbar, onChangeTabName, disabled, }) {
|
|
18
18
|
return (React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "MAIN", type: "TAB", direction: "horizontal" }, (provided) => (React.createElement("div", Object.assign({ ref: provided.innerRef }, provided.droppableProps, { style: { display: 'flex' }, "data-name": "dashboard-tabs" }),
|
|
19
|
-
tabs.map((tab, tabIndex) => (React.createElement(TabItem, { key: tabIndex, tabIndex: tabIndex, tab: tab, onRemove: () => onRemoveTab(tabIndex), onRemoveToolbar: (toolbarIndex) => onRemoveToolbar(tabIndex, toolbarIndex), onChangeTabName: (tabName) => onChangeTabName(tabIndex, tabName) }))),
|
|
19
|
+
tabs.map((tab, tabIndex) => (React.createElement(TabItem, { disabled: disabled, key: tabIndex, tabIndex: tabIndex, tab: tab, onRemove: () => onRemoveTab(tabIndex), onRemoveToolbar: (toolbarIndex) => onRemoveToolbar(tabIndex, toolbarIndex), onChangeTabName: (tabName) => onChangeTabName(tabIndex, tabName) }))),
|
|
20
20
|
provided.placeholder))));
|
|
21
21
|
}
|
|
22
|
-
function TabItem({ tab, tabIndex, onRemove, onRemoveToolbar, onChangeTabName, }) {
|
|
23
|
-
return (React.createElement(react_beautiful_dnd_1.Draggable, { draggableId: String(tabIndex), index: tabIndex }, (provided) => (React.createElement("div", Object.assign({ "data-name": "dashboard-tab", ref: provided.innerRef }, provided.draggableProps, { style: Object.assign(Object.assign({}, provided.draggableProps.style), { boxSizing: 'border-box', border: '1px solid var(--ab-color-primarydark)', borderRadius: 'var(--ab__border-radius)', marginRight: 'var(--ab-space-2)', width: 160, display: 'flex', flexDirection: 'column' }) }),
|
|
22
|
+
function TabItem({ tab, tabIndex, onRemove, onRemoveToolbar, onChangeTabName, disabled, }) {
|
|
23
|
+
return (React.createElement(react_beautiful_dnd_1.Draggable, { isDragDisabled: disabled, draggableId: String(tabIndex), index: tabIndex }, (provided) => (React.createElement("div", Object.assign({ "data-name": "dashboard-tab", ref: provided.innerRef }, provided.draggableProps, { style: Object.assign(Object.assign({}, (disabled ? {} : provided.draggableProps.style)), { boxSizing: 'border-box', border: '1px solid var(--ab-color-primarydark)', borderRadius: 'var(--ab__border-radius)', marginRight: 'var(--ab-space-2)', width: 160, display: 'flex', flexDirection: 'column' }) }),
|
|
24
24
|
React.createElement("div", { style: {
|
|
25
25
|
display: 'flex',
|
|
26
26
|
alignItems: 'center',
|
|
27
27
|
padding: 'var(--ab-space-1)',
|
|
28
28
|
borderBottom: '1px solid var(--ab-color-primarydark)',
|
|
29
29
|
} },
|
|
30
|
-
React.createElement("div", Object.assign({}, provided.dragHandleProps, { style: {} }),
|
|
30
|
+
React.createElement("div", Object.assign({}, (disabled ? {} : provided.dragHandleProps), { style: {} }),
|
|
31
31
|
React.createElement(icons_1.Icon, { name: "drag" })),
|
|
32
|
-
React.createElement("input", { type: "text", value: tab.Name, style: {
|
|
32
|
+
React.createElement("input", { type: "text", disabled: disabled, value: tab.Name, style: {
|
|
33
33
|
flex: 1,
|
|
34
34
|
width: '100%',
|
|
35
35
|
border: 'none',
|
|
@@ -41,11 +41,11 @@ function TabItem({ tab, tabIndex, onRemove, onRemoveToolbar, onChangeTabName, })
|
|
|
41
41
|
}, onChange: (event) => {
|
|
42
42
|
onChangeTabName(event.target.value);
|
|
43
43
|
} }),
|
|
44
|
-
React.createElement(SimpleButton_1.default, { icon: "delete", variant: "text", onClick: onRemove })),
|
|
45
|
-
React.createElement(ToolbarList, { toolbars: tab.Toolbars, droppableId: String(tabIndex), onRemove: onRemoveToolbar })))));
|
|
44
|
+
React.createElement(SimpleButton_1.default, { disabled: disabled, icon: "delete", variant: "text", onClick: onRemove })),
|
|
45
|
+
React.createElement(ToolbarList, { disabled: disabled, toolbars: tab.Toolbars, droppableId: String(tabIndex), onRemove: onRemoveToolbar })))));
|
|
46
46
|
}
|
|
47
|
-
function ToolbarList({ toolbars, droppableId, onRemove, }) {
|
|
48
|
-
return (React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: droppableId, type: "TOOLBAR" }, (provided, snapshot) => (React.createElement("div", Object.assign({ ref: provided.innerRef }, provided.droppableProps, { "data-name": "dashboard-toolbar-drop-target", style: {
|
|
47
|
+
function ToolbarList({ toolbars, droppableId, onRemove, disabled, }) {
|
|
48
|
+
return (React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: droppableId, type: "TOOLBAR" }, (provided, snapshot) => (React.createElement("div", Object.assign({ ref: provided.innerRef }, (disabled ? {} : provided.droppableProps), { "data-name": "dashboard-toolbar-drop-target", style: {
|
|
49
49
|
flex: 1,
|
|
50
50
|
padding: 4,
|
|
51
51
|
paddingBottom: 0,
|
|
@@ -54,18 +54,18 @@ function ToolbarList({ toolbars, droppableId, onRemove, }) {
|
|
|
54
54
|
: '',
|
|
55
55
|
minHeight: 200,
|
|
56
56
|
} }),
|
|
57
|
-
toolbars.map((toolbar, toolbarIndex) => (React.createElement(ToolbarItem, { key: toolbar, toolbar: toolbar, toolbarIndex: toolbarIndex, onRemove: () => onRemove(toolbarIndex) }))),
|
|
57
|
+
toolbars.map((toolbar, toolbarIndex) => (React.createElement(ToolbarItem, { disabled: disabled, key: toolbar, toolbar: toolbar, toolbarIndex: toolbarIndex, onRemove: () => onRemove(toolbarIndex) }))),
|
|
58
58
|
provided.placeholder))));
|
|
59
59
|
}
|
|
60
|
-
function ToolbarItem({ toolbar, toolbarIndex, onRemove, }) {
|
|
60
|
+
function ToolbarItem({ toolbar, toolbarIndex, onRemove, disabled, }) {
|
|
61
61
|
const { availableToolbars } = react_1.useContext(DashboardManagerContext);
|
|
62
|
-
return (React.createElement(react_beautiful_dnd_1.Draggable, { draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) => (React.createElement("div", Object.assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: Object.assign(Object.assign({}, provided.draggableProps.style), { display: 'flex', alignItems: 'center', border: '1px solid var(--ab-color-primary)', backgroundColor: snapshot.isDragging
|
|
62
|
+
return (React.createElement(react_beautiful_dnd_1.Draggable, { isDragDisabled: disabled, draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) => (React.createElement("div", Object.assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: Object.assign(Object.assign({}, provided.draggableProps.style), { display: 'flex', alignItems: 'center', border: '1px solid var(--ab-color-primary)', backgroundColor: snapshot.isDragging
|
|
63
63
|
? 'var(--ab-dashboard-toolbar-drag__background)'
|
|
64
64
|
: 'var(--ab-color-primarylight)', paddingLeft: 'var(--ab-space-1)', marginBottom: 'var(--ab-space-1)' }) }),
|
|
65
65
|
React.createElement("div", { style: { flex: 1 } }, getToolbarTitle(availableToolbars, toolbar)),
|
|
66
|
-
React.createElement(SimpleButton_1.default, { icon: "clear", variant: "text", padding: 1, onClick: onRemove })))));
|
|
66
|
+
React.createElement(SimpleButton_1.default, { disabled: disabled, icon: "clear", variant: "text", padding: 1, onClick: onRemove })))));
|
|
67
67
|
}
|
|
68
|
-
function UnusedPanel({ toolbars }) {
|
|
68
|
+
function UnusedPanel({ toolbars, disabled }) {
|
|
69
69
|
return (React.createElement("div", { "data-name": "dashboard-toolbars", style: {
|
|
70
70
|
border: '1px solid var(--ab-color-primarydark)',
|
|
71
71
|
borderRadius: 'var(--ab__border-radius)',
|
|
@@ -76,9 +76,9 @@ function UnusedPanel({ toolbars }) {
|
|
|
76
76
|
React.createElement("div", { style: { padding: 'var(--ab-space-2)' } },
|
|
77
77
|
React.createElement("b", null, "Available Toolbars"),
|
|
78
78
|
" (drag into a Tab below)"),
|
|
79
|
-
React.createElement(UnusedToolbarList, { toolbars: toolbars })));
|
|
79
|
+
React.createElement(UnusedToolbarList, { disabled: disabled, toolbars: toolbars })));
|
|
80
80
|
}
|
|
81
|
-
function UnusedToolbarList({ toolbars }) {
|
|
81
|
+
function UnusedToolbarList({ toolbars, disabled }) {
|
|
82
82
|
return (React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "UNUSED", type: "TOOLBAR", isDropDisabled: true, direction: "horizontal" }, (provided) => (React.createElement("div", Object.assign({ ref: provided.innerRef, "data-name": "dashboard-toolbars-list" }, provided.droppableProps, { style: {
|
|
83
83
|
display: 'flex',
|
|
84
84
|
flexDirection: 'row',
|
|
@@ -86,16 +86,22 @@ function UnusedToolbarList({ toolbars }) {
|
|
|
86
86
|
paddingLeft: 'var(--ab-space-2)',
|
|
87
87
|
paddingRight: 'var(--ab-space-2)',
|
|
88
88
|
} }),
|
|
89
|
-
toolbars.map((toolbar, toolbarIndex) => (React.createElement(UnusedToolbarItem, { key: toolbar, toolbar: toolbar, toolbarIndex: toolbarIndex }))),
|
|
89
|
+
toolbars.map((toolbar, toolbarIndex) => (React.createElement(UnusedToolbarItem, { disabled: disabled, key: toolbar, toolbar: toolbar, toolbarIndex: toolbarIndex }))),
|
|
90
90
|
provided.placeholder))));
|
|
91
91
|
}
|
|
92
|
-
function UnusedToolbarItem({ toolbar, toolbarIndex }) {
|
|
92
|
+
function UnusedToolbarItem({ toolbar, toolbarIndex, disabled, }) {
|
|
93
93
|
const { availableToolbars } = react_1.useContext(DashboardManagerContext);
|
|
94
|
-
return (React.createElement(react_beautiful_dnd_1.Draggable, { draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) =>
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
return (React.createElement(react_beautiful_dnd_1.Draggable, { isDragDisabled: disabled, draggableId: toolbar, index: toolbarIndex }, (provided, snapshot) => {
|
|
95
|
+
const eventHandlers = disabled
|
|
96
|
+
? {}
|
|
97
|
+
: Object.assign(Object.assign({}, provided.draggableProps), provided.dragHandleProps);
|
|
98
|
+
const dragStyle = disabled ? {} : provided.draggableProps.style;
|
|
99
|
+
return (React.createElement("div", Object.assign({ "data-name": "dashboard-toolbar", ref: provided.innerRef }, eventHandlers, { style: Object.assign(Object.assign({}, dragStyle), { border: '1px solid var(--ab-color-primary)', backgroundColor: snapshot.isDragging
|
|
100
|
+
? 'var(--ab-dashboard-toolbar-drag__background)'
|
|
101
|
+
: 'var(--ab-color-primarylight)', padding: 'var(--ab-space-1) var(--ab-space-2)', marginRight: 'var(--ab-space-1)', marginBottom: 'var(--ab-space-1)' }) }), getToolbarTitle(availableToolbars, toolbar)));
|
|
102
|
+
}));
|
|
97
103
|
}
|
|
98
|
-
|
|
104
|
+
const DashboardManager = ({ tabs, onTabsChange, availableToolbars, api, disabled, }) => {
|
|
99
105
|
const moduleService = api.internalApi.getModuleService();
|
|
100
106
|
const moduleInfo = moduleService.getModuleInfoByModule('Dashboard');
|
|
101
107
|
const contextValue = react_1.useMemo(() => ({
|
|
@@ -157,9 +163,9 @@ function DashboardManager({ tabs, onTabsChange, availableToolbars, api, }) {
|
|
|
157
163
|
} },
|
|
158
164
|
React.createElement(DashboardManagerContext.Provider, { value: contextValue },
|
|
159
165
|
React.createElement("div", { style: { display: 'flex', flexDirection: 'column' } },
|
|
160
|
-
React.createElement(UnusedPanel, { toolbars: unusedToolbars }),
|
|
161
|
-
React.createElement(PanelWithButton_1.PanelWithButton, { headerText: moduleInfo.FriendlyName + ' Tabs', button: React.createElement(SimpleButton_1.default, { onClick: handleTabAdd }, "Add Tab") },
|
|
166
|
+
React.createElement(UnusedPanel, { disabled: disabled, toolbars: unusedToolbars }),
|
|
167
|
+
React.createElement(PanelWithButton_1.PanelWithButton, { headerText: moduleInfo.FriendlyName + ' Tabs', button: React.createElement(SimpleButton_1.default, { disabled: disabled, onClick: handleTabAdd }, "Add Tab") },
|
|
162
168
|
React.createElement("div", { style: { display: 'flex', flex: 1 } },
|
|
163
|
-
React.createElement(TabList, { tabs: tabs, onRemoveTab: handleRemoveTab, onRemoveToolbar: handleRemoveToolbar, onChangeTabName: handleChangeTabName })))))));
|
|
164
|
-
}
|
|
169
|
+
React.createElement(TabList, { disabled: disabled, tabs: tabs, onRemoveTab: handleRemoveTab, onRemoveToolbar: handleRemoveToolbar, onChangeTabName: handleChangeTabName })))))));
|
|
170
|
+
};
|
|
165
171
|
exports.default = DashboardManager;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const isPlainObject_1 = tslib_1.__importDefault(require("lodash
|
|
5
|
+
const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
|
|
6
6
|
exports.default = ({ domProps, item, onItemClick, index, columns, className, idProperty, style, }) => {
|
|
7
7
|
const key = item[idProperty] || index;
|
|
8
8
|
if (!isPlainObject_1.default(item)) {
|
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const merge_1 = tslib_1.__importDefault(require("lodash
|
|
8
|
+
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
9
9
|
const join_1 = tslib_1.__importDefault(require("../utils/join"));
|
|
10
10
|
const FormLayoutContext = react_1.createContext(null);
|
|
11
11
|
const defaultColumns = {
|
|
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const batchUpdate_1 = tslib_1.__importDefault(require("../utils/batchUpdate"));
|
|
8
8
|
const usePrevious_1 = tslib_1.__importDefault(require("../utils/usePrevious"));
|
|
9
|
-
const isEqual_1 = tslib_1.__importDefault(require("lodash
|
|
9
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
exports.useRefresh = () => {
|
|
12
12
|
const [x, update] = react_1.useState(0);
|
|
@@ -5,6 +5,20 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const re_resizable_1 = require("re-resizable");
|
|
7
7
|
const useDraggable_1 = tslib_1.__importDefault(require("../utils/useDraggable"));
|
|
8
|
+
const UIHelper_1 = require("../../View/UIHelper");
|
|
9
|
+
const react_dom_1 = require("react-dom");
|
|
10
|
+
let portalElement;
|
|
11
|
+
const ensurePortalElement = () => {
|
|
12
|
+
if (!UIHelper_1.isBrowserDocumentAvailable()) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
if (portalElement) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
portalElement = document.createElement('div');
|
|
19
|
+
portalElement.classList.add('ab-cmp-modal-window');
|
|
20
|
+
document.body.appendChild(portalElement);
|
|
21
|
+
};
|
|
8
22
|
const getResizePositionDelta = (direction, delta) => {
|
|
9
23
|
const positionDelta = { x: 0, y: 0 };
|
|
10
24
|
const left = -delta.width;
|
|
@@ -26,6 +40,7 @@ const getResizePositionDelta = (direction, delta) => {
|
|
|
26
40
|
return null;
|
|
27
41
|
};
|
|
28
42
|
exports.WindowModal = (props) => {
|
|
43
|
+
ensurePortalElement();
|
|
29
44
|
const positionDeltaRef = React.useRef(null);
|
|
30
45
|
const positionRef = React.useRef(props.position);
|
|
31
46
|
/**
|
|
@@ -77,11 +92,11 @@ exports.WindowModal = (props) => {
|
|
|
77
92
|
applyTransform(positionDelta.x, positionDelta.y);
|
|
78
93
|
}
|
|
79
94
|
}, []);
|
|
80
|
-
return (React.createElement("div", { style: style,
|
|
95
|
+
return react_dom_1.createPortal(React.createElement("div", { style: style,
|
|
81
96
|
//@ts-ignore
|
|
82
97
|
ref: targetRef },
|
|
83
98
|
React.createElement(re_resizable_1.Resizable, { onResizeStop: handleResizeStop, onResize: handleResize, bounds: "window", defaultSize: {
|
|
84
99
|
width: props.size.width,
|
|
85
100
|
height: props.size.height,
|
|
86
|
-
} }, props.children)));
|
|
101
|
+
} }, props.children)), portalElement);
|
|
87
102
|
};
|
|
@@ -26,7 +26,8 @@ function useDraggable({ onMove, onDrop, getBoundingRect = () => document.body.ge
|
|
|
26
26
|
* This gives time react to render the node handle.
|
|
27
27
|
*/
|
|
28
28
|
setTimeout(() => {
|
|
29
|
-
|
|
29
|
+
var _a;
|
|
30
|
+
const node = (_a = targetRef === null || targetRef === void 0 ? void 0 : targetRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(handleSelector);
|
|
30
31
|
node && handleRefCallback(node);
|
|
31
32
|
}, 16);
|
|
32
33
|
}
|
|
@@ -873,6 +873,14 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
873
873
|
kind: string;
|
|
874
874
|
description: string;
|
|
875
875
|
uiLabel: string;
|
|
876
|
+
reference?: undefined;
|
|
877
|
+
isOptional?: undefined;
|
|
878
|
+
} | {
|
|
879
|
+
name: string;
|
|
880
|
+
kind: string;
|
|
881
|
+
description: string;
|
|
882
|
+
uiLabel: string;
|
|
883
|
+
reference: string;
|
|
876
884
|
isOptional?: undefined;
|
|
877
885
|
} | {
|
|
878
886
|
name: string;
|
|
@@ -880,6 +888,7 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
880
888
|
description: string;
|
|
881
889
|
uiLabel: string;
|
|
882
890
|
isOptional: boolean;
|
|
891
|
+
reference?: undefined;
|
|
883
892
|
})[];
|
|
884
893
|
};
|
|
885
894
|
CellSummaryApi: {
|