@adaptabletools/adaptable 11.0.0-canary.2 → 11.0.0-canary.3
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 +5 -1
- package/bundle.cjs.js +93 -89
- package/index.css +6 -1
- package/package.json +31 -31
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/EntitlementOptions.d.ts +1 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/Api/GridApi.d.ts +3 -3
- package/src/Api/Implementation/DashboardApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +3 -3
- package/src/Api/Implementation/GridApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +11 -0
- 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 +1 -1
- 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/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/CalculatedColumnWizard.js +15 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -2
- package/src/View/Components/ModuleValueSelector/index.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +4 -3
- 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/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 +3 -2
- 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/FlashingCellSettingsWizardSection.js +20 -5
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +10 -5
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +12 -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.js +3 -2
- 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 +42 -28
- package/src/agGrid/agGridHelper.js +1 -1
- package/src/agGrid/agGridMenuHelper.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/metamodel/adaptable.metamodel.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -12,15 +12,22 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
12
12
|
const FreeTextColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FreeTextColumnRedux"));
|
|
13
13
|
const react_redux_1 = require("react-redux");
|
|
14
14
|
exports.FreeTextColumnWizard = (props) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const allFreeTextColumns = react_redux_1.useSelector((state) => state.FreeTextColumn.FreeTextColumns);
|
|
15
17
|
const [freeTextColumn, setFreeTextColumn] = react_1.useState(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (props.data) {
|
|
20
|
+
return Helper_1.cloneObject(props.data);
|
|
21
|
+
}
|
|
22
|
+
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
23
|
+
return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
|
|
24
|
+
}
|
|
25
|
+
return ObjectFactory_1.default.CreateEmptyFreeTextColumn(false);
|
|
20
26
|
});
|
|
21
27
|
const dispatch = react_redux_1.useDispatch();
|
|
28
|
+
const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
22
29
|
const handleFinish = () => {
|
|
23
|
-
if (
|
|
30
|
+
if (isEdit) {
|
|
24
31
|
dispatch(FreeTextColumnRedux.FreeTextColumnEdit(freeTextColumn));
|
|
25
32
|
}
|
|
26
33
|
else {
|
|
@@ -13,8 +13,14 @@ const react_redux_1 = require("react-redux");
|
|
|
13
13
|
const PlusMinusRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/PlusMinusRedux"));
|
|
14
14
|
exports.PlusMinusWizard = (props) => {
|
|
15
15
|
const [plusMinus, setPlusMinus] = React.useState(() => {
|
|
16
|
-
var _a, _b, _c, _d;
|
|
17
|
-
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
const newPlusMinus = Object.assign(Object.assign({}, (props.data ? props.data : ObjectFactory_1.default.CreateEmptyPlusMinusNudge())), { Scope: (_b = (_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a.Scope) !== null && _b !== void 0 ? _b : { All: true }, NudgeValue: (_d = (_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.NudgeValue) !== null && _d !== void 0 ? _d : 20 });
|
|
18
|
+
if ((_e = props === null || props === void 0 ? void 0 : props.popupParams) === null || _e === void 0 ? void 0 : _e.column) {
|
|
19
|
+
newPlusMinus.Scope = {
|
|
20
|
+
ColumnIds: [props.popupParams.column.columnId],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return newPlusMinus;
|
|
18
24
|
});
|
|
19
25
|
const [hasCondition, setHasCondition] = React.useState(() => {
|
|
20
26
|
var _a;
|
|
@@ -78,28 +78,31 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
80
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
81
|
+
const handleEnter = (e) => {
|
|
82
|
+
if (e.key === 'Enter') {
|
|
83
|
+
this.runQuery();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
81
86
|
const renderTextInput = () => {
|
|
82
87
|
return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
|
|
83
88
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
84
|
-
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 }
|
|
85
|
-
if (e.key === 'Enter') {
|
|
86
|
-
this.runQuery();
|
|
87
|
-
}
|
|
88
|
-
} }),
|
|
89
|
+
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
89
90
|
isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
|
|
90
91
|
' ',
|
|
91
|
-
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.
|
|
92
|
+
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%' } }));
|
|
92
93
|
};
|
|
93
94
|
const queryModuleAccessLevel = this.props.api.internalApi
|
|
94
95
|
.getEntitlementService()
|
|
95
96
|
.getEntitlementAccessLevelForModule(ModuleConstants_1.QueryModuleId);
|
|
97
|
+
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => this.saveQuery(), tooltip: "Save as New Query", accessLevel: queryModuleAccessLevel, disabled: !isExpressionValid || isExpressionNamedQuery || this.state.expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
96
98
|
const renderButtons = () => {
|
|
97
99
|
return this.props.viewType === 'Toolbar' ? (React.createElement(React.Fragment, null,
|
|
98
|
-
|
|
100
|
+
saveButton,
|
|
99
101
|
React.createElement(DropdownButton_1.default, { variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns" },
|
|
100
102
|
React.createElement(icons_1.Icon, { name: 'list' })),
|
|
101
103
|
React.createElement(DropdownButton_1.default, { disabled: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(availableSearches), variant: "text", items: availableSearches, marginRight: 1, tooltip: "Load Query", icon: "folder-open" }),
|
|
102
104
|
' ')) : (React.createElement(React.Fragment, null,
|
|
105
|
+
saveButton,
|
|
103
106
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
104
107
|
React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full', disabled: this.state.expression == '' }),
|
|
105
108
|
React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: "Run Query", accessLevel: 'Full', variant: "text", tone: "neutral", disabled: !isExpressionValid ||
|
|
@@ -107,12 +110,12 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
107
110
|
this.state.expression == this.props.CurrentQuery, marginRight: 1 }),
|
|
108
111
|
React.createElement(DropdownButton_1.default, { variant: "text", disabled: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(availableSearches), items: availableSearches, marginRight: 1, tooltip: "Load Query", icon: "folder-open" })));
|
|
109
112
|
};
|
|
110
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
113
|
+
return (React.createElement(rebass_1.Flex, { onKeyDown: handleEnter, flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
111
114
|
React.createElement(rebass_1.Flex, null, renderTextInput()),
|
|
112
115
|
React.createElement(rebass_1.Flex, null, renderButtons())));
|
|
113
116
|
}
|
|
114
117
|
clearQuery() {
|
|
115
|
-
this.
|
|
118
|
+
this.props.onRunQuery('');
|
|
116
119
|
}
|
|
117
120
|
saveQuery() {
|
|
118
121
|
this.props.onShowNamedQueries(this.state.expression, this.props.moduleInfo.Popup);
|
|
@@ -14,9 +14,11 @@ const react_redux_1 = require("react-redux");
|
|
|
14
14
|
const QueryRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/QueryRedux"));
|
|
15
15
|
function NamedQueryWizard(props) {
|
|
16
16
|
const [namedQuery, setNamedQuery] = react_1.useState(() => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const value = (_b = (_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
17
19
|
return props.data
|
|
18
20
|
? Helper_1.cloneObject(props.data)
|
|
19
|
-
: ObjectFactory_1.default.CreateEmptyNamedQuery();
|
|
21
|
+
: ObjectFactory_1.default.CreateEmptyNamedQuery(value);
|
|
20
22
|
});
|
|
21
23
|
const dispatch = react_redux_1.useDispatch();
|
|
22
24
|
const handleFinish = () => {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useQuickSearchDebounced = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash
|
|
6
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
7
7
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
8
8
|
exports.useQuickSearchDebounced = (props) => {
|
|
9
9
|
var _a;
|
|
@@ -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);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SpecialColumnSettingsWizardStep = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const chunk_1 = tslib_1.__importDefault(require("lodash
|
|
5
|
+
const chunk_1 = tslib_1.__importDefault(require("lodash/chunk"));
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const CheckBox_1 = require("../components/CheckBox");
|
|
@@ -12,7 +12,8 @@ const AdaptableContext_1 = require("./AdaptableContext");
|
|
|
12
12
|
exports.SpecialColumnSettingsWizardStep = (props) => {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
const adaptable = AdaptableContext_1.useAdaptable();
|
|
15
|
-
const possibleColumnTypes = adaptable.api.internalApi.getAdaptableOptions().userInterfaceOptions
|
|
15
|
+
const possibleColumnTypes = adaptable.api.internalApi.getAdaptableOptions().userInterfaceOptions
|
|
16
|
+
.columnTypes;
|
|
16
17
|
const { Filterable, Resizable, Groupable, Sortable, Pivotable, Aggregatable, SuppressMenu, SuppressMovable, } = (_a = props.settings) !== null && _a !== void 0 ? _a : {};
|
|
17
18
|
const handleColumnTypeChange = (columnType, checked) => {
|
|
18
19
|
var _a, _b, _c;
|
|
@@ -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");
|
|
@@ -340,8 +340,7 @@ class Adaptable {
|
|
|
340
340
|
// TODO: if a custom 'aggFunc' property is defined (see setupColumnAggFunc()), it won't be evaluated
|
|
341
341
|
if (!this.getDefaultGroupOrderComparator(this.gridOptions) &&
|
|
342
342
|
this.adaptableOptions.generalOptions.autoOrderGroupedColumns) {
|
|
343
|
-
this.gridOptions.defaultGroupOrderComparator =
|
|
344
|
-
this.agGridHelper.runAdaptableGroupComparerFunction();
|
|
343
|
+
this.gridOptions.defaultGroupOrderComparator = this.agGridHelper.runAdaptableGroupComparerFunction();
|
|
345
344
|
}
|
|
346
345
|
// we prefer the grid to be NOT instantiated so that we can do it
|
|
347
346
|
// perhaps in future we will force instantiation only?
|
|
@@ -903,13 +902,12 @@ class Adaptable {
|
|
|
903
902
|
}
|
|
904
903
|
return null;
|
|
905
904
|
}
|
|
906
|
-
|
|
907
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
908
|
-
return this.getFlashingCellStyleFor(primaryKeyValue);
|
|
909
|
-
}
|
|
910
|
-
getFlashingCellStyleFor(primaryKey, colId) {
|
|
905
|
+
getFlashingCellStyle(col, params) {
|
|
911
906
|
var _a;
|
|
912
|
-
const
|
|
907
|
+
const primaryKey = params.node.aggData
|
|
908
|
+
? params.node.id
|
|
909
|
+
: this.getPrimaryKeyValueFromRowNode(params.node);
|
|
910
|
+
const flashingCell = this.api.internalApi.getAdaptableFlashingCellFor(primaryKey, col.columnId);
|
|
913
911
|
if (!flashingCell) {
|
|
914
912
|
return {};
|
|
915
913
|
}
|
|
@@ -919,10 +917,6 @@ class Adaptable {
|
|
|
919
917
|
? flashingCell.flashingCellDefinition.DownChangeStyle
|
|
920
918
|
: flashingCell.flashingCellDefinition.NeutralChangeStyle)) !== null && _a !== void 0 ? _a : {});
|
|
921
919
|
}
|
|
922
|
-
getFlashingCellStyle(col, params) {
|
|
923
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
924
|
-
return this.getFlashingCellStyleFor(primaryKeyValue, col.columnId);
|
|
925
|
-
}
|
|
926
920
|
getCellHighlightStyle(col, params) {
|
|
927
921
|
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(params.node);
|
|
928
922
|
const cellHightlight = this.api.internalApi
|
|
@@ -1948,8 +1942,10 @@ class Adaptable {
|
|
|
1948
1942
|
];
|
|
1949
1943
|
}
|
|
1950
1944
|
getColDefsForFreeTextColumns() {
|
|
1951
|
-
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
|
|
1952
|
-
|
|
1945
|
+
const specialColumnsAreFilterable = this.api.internalApi.getAdaptableOptions().filterOptions
|
|
1946
|
+
.enableFilterOnSpecialColumns;
|
|
1947
|
+
const defaultFreeTextColumnSettings = ObjectFactory_1.CreateEmptyFreeTextColumn(specialColumnsAreFilterable)
|
|
1948
|
+
.FreeTextColumnSettings;
|
|
1953
1949
|
return this.api.freeTextColumnApi.getAllFreeTextColumn().map((freeTextColumn) => {
|
|
1954
1950
|
var _a;
|
|
1955
1951
|
const freeTextColumnSettings = Object.assign(Object.assign({}, defaultFreeTextColumnSettings), freeTextColumn.FreeTextColumnSettings);
|
|
@@ -2093,13 +2089,13 @@ class Adaptable {
|
|
|
2093
2089
|
.enableFilterOnSpecialColumns
|
|
2094
2090
|
? this.adaptableOptions.filterOptions.enableFilterOnSpecialColumns
|
|
2095
2091
|
: true;
|
|
2096
|
-
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
|
|
2092
|
+
const defaultCalculatedColumnSettings = ObjectFactory_1.CreateEmptyCalculatedColumn(specialColumnsAreFilterable)
|
|
2093
|
+
.CalculatedColumnSettings;
|
|
2097
2094
|
return this.api.calculatedColumnApi.getAllCalculatedColumn().map((calculatedColumn) => {
|
|
2098
2095
|
var _a;
|
|
2099
2096
|
const calculatedColumnSettings = Object.assign(Object.assign({}, defaultCalculatedColumnSettings), calculatedColumn.CalculatedColumnSettings);
|
|
2100
2097
|
if (!calculatedColumnSettings.DataType) {
|
|
2101
|
-
calculatedColumnSettings.DataType =
|
|
2102
|
-
this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
2098
|
+
calculatedColumnSettings.DataType = this.CalculatedColumnExpressionService.GetCalculatedColumnDataType((_a = calculatedColumn.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression);
|
|
2103
2099
|
}
|
|
2104
2100
|
const columnTypes = [
|
|
2105
2101
|
GeneralConstants_1.AB_SPECIAL_COLUMN,
|
|
@@ -2478,7 +2474,8 @@ class Adaptable {
|
|
|
2478
2474
|
this.onSortChanged();
|
|
2479
2475
|
this.debouncedSetSelectedCells();
|
|
2480
2476
|
});
|
|
2481
|
-
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions
|
|
2477
|
+
const showGroupingTotalsAsHeader = this.adaptableOptions.generalOptions
|
|
2478
|
+
.showGroupingTotalsAsHeader;
|
|
2482
2479
|
/**
|
|
2483
2480
|
* Use Case: Model has updated
|
|
2484
2481
|
* Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
|
|
@@ -2912,7 +2909,8 @@ class Adaptable {
|
|
|
2912
2909
|
// set the default to the AG Grid provided values
|
|
2913
2910
|
// from https://github.com/ag-grid/ag-grid/blob/v26.1.0/community-modules/core/src/ts/columns/columnModel.ts#L2515
|
|
2914
2911
|
let resultHeaderName = userHeaderName !== null && userHeaderName !== void 0 ? userHeaderName : StringExtensions_1.StringExtensions.CamelCaseToHumanText(col.getColDef().field);
|
|
2915
|
-
const layoutCustomHeader = (_a = this.api.layoutApi.getCurrentLayout()
|
|
2912
|
+
const layoutCustomHeader = (_a = this.api.layoutApi.getCurrentLayout()
|
|
2913
|
+
.ColumnHeadersMap) === null || _a === void 0 ? void 0 : _a[col.getColId()];
|
|
2916
2914
|
if (layoutCustomHeader) {
|
|
2917
2915
|
resultHeaderName = layoutCustomHeader;
|
|
2918
2916
|
}
|
|
@@ -3155,14 +3153,30 @@ class Adaptable {
|
|
|
3155
3153
|
if (oldValue == newValue) {
|
|
3156
3154
|
return;
|
|
3157
3155
|
}
|
|
3158
|
-
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
3159
|
-
if (!primaryKeyValue) {
|
|
3160
|
-
return;
|
|
3161
|
-
}
|
|
3162
3156
|
const abColumn = this.api.columnApi.getColumnFromId(colId);
|
|
3163
3157
|
if (!abColumn) {
|
|
3164
3158
|
return;
|
|
3165
3159
|
}
|
|
3160
|
+
if (this.isGroupRowNode(rowNode)) {
|
|
3161
|
+
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3162
|
+
oldValue: oldValue,
|
|
3163
|
+
newValue: newValue,
|
|
3164
|
+
column: abColumn,
|
|
3165
|
+
/**
|
|
3166
|
+
* A grouped row does not have an underling data item.
|
|
3167
|
+
* Because of this we use the rowNode.id as an identifier.
|
|
3168
|
+
*/
|
|
3169
|
+
primaryKeyValue: rowNode.id,
|
|
3170
|
+
rowNode: rowNode,
|
|
3171
|
+
trigger: 'aggChange',
|
|
3172
|
+
});
|
|
3173
|
+
this.DataService.CreateDataChangedEvent(dataChangedInfo);
|
|
3174
|
+
return;
|
|
3175
|
+
}
|
|
3176
|
+
const primaryKeyValue = this.getPrimaryKeyValueFromRowNode(rowNode);
|
|
3177
|
+
if (!primaryKeyValue) {
|
|
3178
|
+
return;
|
|
3179
|
+
}
|
|
3166
3180
|
const dataChangedInfo = this.api.internalApi.buildDataChangedInfo({
|
|
3167
3181
|
oldValue: oldValue,
|
|
3168
3182
|
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");
|
|
@@ -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) {
|
|
@@ -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);
|
|
@@ -4443,7 +4443,7 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
4443
4443
|
{
|
|
4444
4444
|
"name": "defaultAccessLevel",
|
|
4445
4445
|
"kind": "unknown",
|
|
4446
|
-
"description": "AccessLevel to use when an Entitlement is not explicitly set;
|
|
4446
|
+
"description": "AccessLevel to use when an Entitlement is not explicitly set; can be hardcoded value or a function to invoke",
|
|
4447
4447
|
"uiLabel": "Default Access Level",
|
|
4448
4448
|
"isOptional": true,
|
|
4449
4449
|
"gridInfo": "item",
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "11.0.0-canary.
|
|
1
|
+
declare const _default: "11.0.0-canary.3";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '11.0.0-canary.
|
|
3
|
+
exports.default = '11.0.0-canary.3'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|