@adaptabletools/adaptable-cjs 22.0.0-canary.4 → 22.0.0-canary.5
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/index.css +46 -26
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/src/AdaptableState/Common/AdaptableStyle.d.ts +1 -1
- package/src/AdaptableState/LayoutState.d.ts +1 -1
- package/src/Api/Implementation/LayoutHelpers.js +4 -4
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +84 -33
- package/src/View/GridFilter/GridFilterExpressionEditor.js +6 -1
- package/src/View/GridFilter/GridFilterViewPanel.js +33 -70
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +2 -2
- package/src/components/ColorPicker/ColorPicker.js +5 -4
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -1
- package/src/layout-manager/src/index.js +5 -5
- package/src/layout-manager/src/normalizeLayoutModel.js +2 -2
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +0 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +0 -633
- package/src/View/Alert/AlertEntityRow.d.ts +0 -11
- package/src/View/Alert/AlertEntityRow.js +0 -33
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -21
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +0 -63
- package/src/View/Components/Buttons/ButtonFunction.d.ts +0 -7
- package/src/View/Components/Buttons/ButtonFunction.js +0 -13
- package/src/View/Components/Buttons/ButtonGeneral.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonGeneral.js +0 -12
- package/src/View/Components/Buttons/ButtonPreviewDelete.d.ts +0 -4
- package/src/View/Components/Buttons/ButtonPreviewDelete.js +0 -8
- package/src/View/Components/Buttons/ButtonShow.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonShow.js +0 -12
- package/src/View/Components/Buttons/ButtonShowChart.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonShowChart.js +0 -12
- package/src/View/Components/Buttons/ButtonUndo.d.ts +0 -5
- package/src/View/Components/Buttons/ButtonUndo.js +0 -12
- package/src/View/Components/ExpressionWizard.d.ts +0 -24
- package/src/View/Components/ExpressionWizard.js +0 -82
- package/src/View/Components/FilterForm/Waiting.d.ts +0 -10
- package/src/View/Components/FilterForm/Waiting.js +0 -19
- package/src/View/Components/Panels/PanelFooter.d.ts +0 -10
- package/src/View/Components/Panels/PanelFooter.js +0 -14
- package/src/View/Components/Panels/PanelWithTwoButtons.d.ts +0 -12
- package/src/View/Components/Panels/PanelWithTwoButtons.js +0 -20
- package/src/View/Components/Panels/ToolPanelSettingsPanel.d.ts +0 -8
- package/src/View/Components/Panels/ToolPanelSettingsPanel.js +0 -31
- package/src/View/Components/Selectors/ColumnSelectorOld.d.ts +0 -18
- package/src/View/Components/Selectors/ColumnSelectorOld.js +0 -50
- package/src/View/Components/SharedProps/WizardScopeState.d.ts +0 -4
- package/src/View/Components/SharedProps/WizardScopeState.js +0 -2
- package/src/View/Components/WizardSummaryRow.d.ts +0 -9
- package/src/View/Components/WizardSummaryRow.js +0 -16
- package/src/View/CustomSort/CustomSortSummary.d.ts +0 -23
- package/src/View/CustomSort/CustomSortSummary.js +0 -110
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +0 -9
- package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +0 -24
- package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +0 -19
- package/src/View/Export/Wizard/ReportColumnTypeWizard.js +0 -73
- package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +0 -19
- package/src/View/Export/Wizard/ReportRowTypeWizard.js +0 -73
- package/src/View/Export/Wizard/ReportSettingsWizard.d.ts +0 -21
- package/src/View/Export/Wizard/ReportSettingsWizard.js +0 -61
- package/src/View/Export/Wizard/ReportSummaryWizard.d.ts +0 -15
- package/src/View/Export/Wizard/ReportSummaryWizard.js +0 -40
- package/src/View/Filter/FilterSummary.d.ts +0 -18
- package/src/View/Filter/FilterSummary.js +0 -53
- package/src/View/FormatColumn/FormatColumnSummary.d.ts +0 -22
- package/src/View/FormatColumn/FormatColumnSummary.js +0 -95
- package/src/View/FreeTextColumn/FreeTextColumnSummary.d.ts +0 -22
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +0 -93
- package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.d.ts +0 -7
- package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.js +0 -99
- package/src/View/PlusMinus/PlusMinusSummary.d.ts +0 -22
- package/src/View/PlusMinus/PlusMinusSummary.js +0 -100
- package/src/View/Wizard/WizardLegend.d.ts +0 -12
- package/src/View/Wizard/WizardLegend.js +0 -28
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FormatColumnSummary = exports.FormatColumnSummaryComponent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const EditableConfigEntityState_1 = require("../Components/SharedProps/EditableConfigEntityState");
|
|
7
|
-
const react_redux_1 = require("react-redux");
|
|
8
|
-
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
9
|
-
const FormatColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/FormatColumnRedux"));
|
|
10
|
-
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
11
|
-
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
12
|
-
const ModuleHeader_1 = require("../Components/ModuleSummary/ModuleHeader");
|
|
13
|
-
const ModuleDetail_1 = require("../Components/ModuleSummary/ModuleDetail");
|
|
14
|
-
const ModuleProfile_1 = require("../Components/ModuleProfile");
|
|
15
|
-
const StyleVisualItem_1 = require("../Components/StyleVisualItem");
|
|
16
|
-
const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
|
|
17
|
-
const UIHelper_1 = require("../UIHelper");
|
|
18
|
-
const FormatColumnWizard_1 = require("./Wizard/FormatColumnWizard");
|
|
19
|
-
class FormatColumnSummaryComponent extends React.Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
super(props);
|
|
22
|
-
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
const [formatColumn] = this.props.api.formatColumnApi.getFormatColumnsForColumn(this.props.summarisedColumn);
|
|
26
|
-
let noFormatColumn = formatColumn == null;
|
|
27
|
-
let formatColumnRow;
|
|
28
|
-
if (noFormatColumn) {
|
|
29
|
-
formatColumnRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: 'No Format Column Set', onNew: () => this.onNew(), newButtonTooltip: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel }));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
formatColumnRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: this.props.moduleInfo.FriendlyName, item1: React.createElement(ModuleProfile_1.ModuleProfile, { moduleInfo: this.props.moduleInfo }), item2: React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: formatColumn.Style }), configEnity: formatColumn, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(formatColumn), onShare: (config) => this.props.onShare(formatColumn, config), onDelete: FormatColumnRedux.FormatColumnDelete(formatColumn), showBold: true, accessLevel: this.props.accessLevel }));
|
|
33
|
-
}
|
|
34
|
-
return (React.createElement("div", null,
|
|
35
|
-
formatColumnRow,
|
|
36
|
-
this.state.editedAdaptableObject && (React.createElement(FormatColumnWizard_1.FormatColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FormatColumns, wizardStartIndex: this.state.wizardStartIndex, onCloseWizard: this.onCloseWizard, onFinishWizard: this.onFinishWizard }))));
|
|
37
|
-
}
|
|
38
|
-
onNew() {
|
|
39
|
-
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFormatColumn();
|
|
40
|
-
configEntity.Scope = {
|
|
41
|
-
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
42
|
-
};
|
|
43
|
-
this.setState({
|
|
44
|
-
editedAdaptableObject: configEntity,
|
|
45
|
-
wizardStartIndex: 1,
|
|
46
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.New,
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
onEdit(formatColumn) {
|
|
50
|
-
let clonedObject = Helper_1.Helper.cloneObject(formatColumn);
|
|
51
|
-
this.setState({
|
|
52
|
-
editedAdaptableObject: clonedObject,
|
|
53
|
-
wizardStartIndex: 1,
|
|
54
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.Edit,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
onCloseWizard() {
|
|
58
|
-
this?.setState?.({
|
|
59
|
-
editedAdaptableObject: null,
|
|
60
|
-
wizardStartIndex: 0,
|
|
61
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
onFinishWizard = (formatColumn) => {
|
|
65
|
-
if (this.props.FormatColumns.find((x) => x.Uuid == formatColumn.Uuid)) {
|
|
66
|
-
this.props.onEditFormatColumn(formatColumn);
|
|
67
|
-
}
|
|
68
|
-
else {
|
|
69
|
-
this.props.onAddFormatColumn(formatColumn);
|
|
70
|
-
}
|
|
71
|
-
this.setState({
|
|
72
|
-
editedAdaptableObject: null,
|
|
73
|
-
wizardStartIndex: 0,
|
|
74
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
canFinishWizard() {
|
|
78
|
-
let formatColumn = this.state.editedAdaptableObject;
|
|
79
|
-
return formatColumn.Scope != undefined && UIHelper_1.UIHelper.IsNotEmptyStyle(formatColumn.Style);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.FormatColumnSummaryComponent = FormatColumnSummaryComponent;
|
|
83
|
-
function mapStateToProps(state, ownProps) {
|
|
84
|
-
return {
|
|
85
|
-
FormatColumns: state.FormatColumn.FormatColumns,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
function mapDispatchToProps(dispatch) {
|
|
89
|
-
return {
|
|
90
|
-
onAddFormatColumn: (FormatColumn) => dispatch(FormatColumnRedux.FormatColumnAdd(FormatColumn)),
|
|
91
|
-
onEditFormatColumn: (FormatColumn) => dispatch(FormatColumnRedux.FormatColumnEdit(FormatColumn)),
|
|
92
|
-
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.FormatColumnModuleId, config)),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
exports.FormatColumnSummary = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(FormatColumnSummaryComponent);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ModuleSummaryProps } from '../Components/SharedProps/ModuleSummaryProps';
|
|
3
|
-
import { EditableConfigEntityState } from '../Components/SharedProps/EditableConfigEntityState';
|
|
4
|
-
import * as FreeTextColumnRedux from '../../Redux/ActionsReducers/FreeTextColumnRedux';
|
|
5
|
-
import { FreeTextColumn } from '../../AdaptableState/FreeTextColumnState';
|
|
6
|
-
export interface FreeTextColumnSummaryProps extends ModuleSummaryProps<FreeTextColumnSummaryComponent> {
|
|
7
|
-
FreeTextColumns: FreeTextColumn[];
|
|
8
|
-
onAddFreeTextColumn: (FreeTextColumn: FreeTextColumn) => FreeTextColumnRedux.FreeTextColumnAddAction;
|
|
9
|
-
onEditFreeTextColumn: (FreeTextColumn: FreeTextColumn) => FreeTextColumnRedux.FreeTextColumnEditAction;
|
|
10
|
-
}
|
|
11
|
-
export declare class FreeTextColumnSummaryComponent extends React.Component<FreeTextColumnSummaryProps, EditableConfigEntityState> {
|
|
12
|
-
constructor(props: FreeTextColumnSummaryProps);
|
|
13
|
-
render(): any;
|
|
14
|
-
onNew(): void;
|
|
15
|
-
onEdit(FreeTextColumn: FreeTextColumn): void;
|
|
16
|
-
onCloseWizard(): void;
|
|
17
|
-
onFinishWizard: (FreeTextColumn: FreeTextColumn) => void;
|
|
18
|
-
canFinishWizard(): boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare let FreeTextColumnSummary: import("react-redux").ConnectedComponent<typeof FreeTextColumnSummaryComponent, {
|
|
21
|
-
[x: string]: any;
|
|
22
|
-
}>;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FreeTextColumnSummary = exports.FreeTextColumnSummaryComponent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const EditableConfigEntityState_1 = require("../Components/SharedProps/EditableConfigEntityState");
|
|
7
|
-
const react_redux_1 = require("react-redux");
|
|
8
|
-
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
9
|
-
const FreeTextColumnRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/FreeTextColumnRedux"));
|
|
10
|
-
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
11
|
-
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
12
|
-
const ModuleDetail_1 = require("../Components/ModuleSummary/ModuleDetail");
|
|
13
|
-
const ModuleProfile_1 = require("../Components/ModuleProfile");
|
|
14
|
-
const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
|
|
15
|
-
const UIHelper_1 = require("../UIHelper");
|
|
16
|
-
const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
|
|
17
|
-
const ArrayExtensions_1 = require("../../Utilities/Extensions/ArrayExtensions");
|
|
18
|
-
const FreeTextColumnWizard_1 = require("./Wizard/FreeTextColumnWizard");
|
|
19
|
-
class FreeTextColumnSummaryComponent extends React.Component {
|
|
20
|
-
constructor(props) {
|
|
21
|
-
super(props);
|
|
22
|
-
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
let freeTextColumn = this.props.FreeTextColumns.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
26
|
-
let noFreeTextColumn = freeTextColumn == null;
|
|
27
|
-
let FreeTextColumnRow;
|
|
28
|
-
if (!noFreeTextColumn) {
|
|
29
|
-
let description = ArrayExtensions_1.ArrayExtensions.IsNotEmpty(freeTextColumn.FreeTextStoredValues)
|
|
30
|
-
? ' Stored values: ' + freeTextColumn.FreeTextStoredValues.length
|
|
31
|
-
: 'No stored values';
|
|
32
|
-
FreeTextColumnRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: this.props.moduleInfo.FriendlyName, item1: React.createElement(ModuleProfile_1.ModuleProfile, { moduleInfo: this.props.moduleInfo }), item2: description, configEnity: freeTextColumn, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(freeTextColumn), onShare: (config) => this.props.onShare(freeTextColumn, config), onDelete: FreeTextColumnRedux.FreeTextColumnDelete(freeTextColumn), showBold: true, accessLevel: this.props.accessLevel }));
|
|
33
|
-
}
|
|
34
|
-
return (React.createElement("div", null,
|
|
35
|
-
FreeTextColumnRow,
|
|
36
|
-
this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
|
|
37
|
-
}
|
|
38
|
-
onNew() {
|
|
39
|
-
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(this.props.api.gridApi.internalApi.deriveSpecialColumnSettingsFromAgGridDefaultColDef());
|
|
40
|
-
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
41
|
-
this.setState({
|
|
42
|
-
editedAdaptableObject: configEntity,
|
|
43
|
-
wizardStartIndex: 1,
|
|
44
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.New,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
onEdit(FreeTextColumn) {
|
|
48
|
-
let clonedObject = Helper_1.Helper.cloneObject(FreeTextColumn);
|
|
49
|
-
this.setState({
|
|
50
|
-
editedAdaptableObject: clonedObject,
|
|
51
|
-
wizardStartIndex: 0,
|
|
52
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.Edit,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
onCloseWizard() {
|
|
56
|
-
this.setState({
|
|
57
|
-
editedAdaptableObject: null,
|
|
58
|
-
wizardStartIndex: 0,
|
|
59
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
onFinishWizard = (FreeTextColumn) => {
|
|
63
|
-
if (this.props.FreeTextColumns.find((x) => x.ColumnId == FreeTextColumn.ColumnId)) {
|
|
64
|
-
this.props.onEditFreeTextColumn(FreeTextColumn);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
this.props.onAddFreeTextColumn(FreeTextColumn);
|
|
68
|
-
}
|
|
69
|
-
this.setState({
|
|
70
|
-
editedAdaptableObject: null,
|
|
71
|
-
wizardStartIndex: 0,
|
|
72
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
canFinishWizard() {
|
|
76
|
-
let FreeTextColumn = this.state.editedAdaptableObject;
|
|
77
|
-
return StringExtensions_1.StringExtensions.IsNotNullOrEmpty(FreeTextColumn.ColumnId);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.FreeTextColumnSummaryComponent = FreeTextColumnSummaryComponent;
|
|
81
|
-
function mapStateToProps(state, ownProps) {
|
|
82
|
-
return {
|
|
83
|
-
FreeTextColumns: state.FreeTextColumn.FreeTextColumns,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function mapDispatchToProps(dispatch) {
|
|
87
|
-
return {
|
|
88
|
-
onAddFreeTextColumn: (FreeTextColumn) => dispatch(FreeTextColumnRedux.FreeTextColumnAdd(FreeTextColumn)),
|
|
89
|
-
onEditFreeTextColumn: (FreeTextColumn) => dispatch(FreeTextColumnRedux.FreeTextColumnEdit(FreeTextColumn)),
|
|
90
|
-
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.FreeTextColumnModuleId, config)),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
exports.FreeTextColumnSummary = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(FreeTextColumnSummaryComponent);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
3
|
-
interface AdaptableOptionsComponentProps {
|
|
4
|
-
api: AdaptableApi;
|
|
5
|
-
}
|
|
6
|
-
export declare const AdaptableOptionsComponent: (props: AdaptableOptionsComponentProps) => React.JSX.Element;
|
|
7
|
-
export {};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AdaptableOptionsComponent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const PanelWithButton_1 = require("../../Components/Panels/PanelWithButton");
|
|
8
|
-
const ButtonMinimise_1 = require("../../Components/Buttons/ButtonMinimise");
|
|
9
|
-
const ButtonMaximise_1 = require("../../Components/Buttons/ButtonMaximise");
|
|
10
|
-
const AdaptableObjectCollection_1 = require("../../Components/AdaptableObjectCollection");
|
|
11
|
-
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
12
|
-
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
13
|
-
const Flex_1 = require("../../../components/Flex");
|
|
14
|
-
const AdaptableOptionsComponent = (props) => {
|
|
15
|
-
const { api } = props;
|
|
16
|
-
const getAdaptableOptionsColItems = () => [
|
|
17
|
-
{ Content: 'Property', Size: 5 },
|
|
18
|
-
{ Content: 'Value', Size: 5 },
|
|
19
|
-
{ Content: '', Size: 2 },
|
|
20
|
-
];
|
|
21
|
-
const formatOptionValue = (optionValue) => {
|
|
22
|
-
if (optionValue == undefined || optionValue == null) {
|
|
23
|
-
return 'None';
|
|
24
|
-
}
|
|
25
|
-
const optionValueType = typeof optionValue;
|
|
26
|
-
switch (optionValueType) {
|
|
27
|
-
case 'string':
|
|
28
|
-
case 'number':
|
|
29
|
-
case 'bigint':
|
|
30
|
-
return optionValue;
|
|
31
|
-
case 'boolean':
|
|
32
|
-
return optionValue ? 'True' : 'False';
|
|
33
|
-
case 'function':
|
|
34
|
-
return 'Function';
|
|
35
|
-
case 'object':
|
|
36
|
-
if (Array.isArray(optionValue)) {
|
|
37
|
-
return `[${optionValue
|
|
38
|
-
.map((optionValueItem) => formatOptionValue(optionValueItem))
|
|
39
|
-
.join(', ')}]`;
|
|
40
|
-
}
|
|
41
|
-
if (optionValue instanceof HTMLElement) {
|
|
42
|
-
return 'HTMLElement';
|
|
43
|
-
}
|
|
44
|
-
default:
|
|
45
|
-
// should never happen, but just in case, to avoid a react runtime error
|
|
46
|
-
return 'Complex value';
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const buildGridInfoOptionEntry = (gridInfoOption) => {
|
|
50
|
-
const colItems = getAdaptableOptionsColItems();
|
|
51
|
-
colItems[0].Content = gridInfoOption.name;
|
|
52
|
-
const formattedOptionValue = formatOptionValue(gridInfoOption.value);
|
|
53
|
-
const isUserDefinedValue = gridInfoOption.value !== gridInfoOption.defaultValue;
|
|
54
|
-
colItems[1].Content = isUserDefinedValue ? (React.createElement(React.Fragment, null,
|
|
55
|
-
React.createElement("span", { style: { fontWeight: 'bold' } }, formattedOptionValue),
|
|
56
|
-
React.createElement("span", { style: { fontStyle: 'italic' } },
|
|
57
|
-
' ',
|
|
58
|
-
"(Default: ",
|
|
59
|
-
formatOptionValue(gridInfoOption.defaultValue),
|
|
60
|
-
")"))) : (formattedOptionValue);
|
|
61
|
-
let infoButton = React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: null, bodyText: [gridInfoOption.description] });
|
|
62
|
-
colItems[2].Content = infoButton;
|
|
63
|
-
return colItems;
|
|
64
|
-
};
|
|
65
|
-
const buildGridInfoOptionComponentContainer = (containerContainerName, gridInfoOptionContainer) => {
|
|
66
|
-
const gridInfoOptionComponents = gridInfoOptionContainer.items.map((gridInfoOption) => {
|
|
67
|
-
const gridOptionColItems = buildGridInfoOptionEntry(gridInfoOption);
|
|
68
|
-
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: `${gridInfoOption.name}`, colItems: gridOptionColItems });
|
|
69
|
-
});
|
|
70
|
-
return (React.createElement(AdaptableObjectCollection_1.AdaptableObjectCollection, { colItems: getAdaptableOptionsColItems(), items: gridInfoOptionComponents }));
|
|
71
|
-
};
|
|
72
|
-
const [gridInfoOptions, setGridInfoOptions] = (0, react_1.useState)();
|
|
73
|
-
const [gridInfoContainerComponents, setGridInfoContainerComponents] = (0, react_1.useState)();
|
|
74
|
-
(0, react_1.useEffect)(() => {
|
|
75
|
-
const gridInfoOptions = api.internalApi.getMetamodelService().getGridInfoOptions();
|
|
76
|
-
const gridInfoContainerComponentMap = new Map();
|
|
77
|
-
gridInfoOptions.forEach((gridInfoOptionContainer, containerName) => {
|
|
78
|
-
gridInfoContainerComponentMap.set(containerName, buildGridInfoOptionComponentContainer(containerName, gridInfoOptionContainer));
|
|
79
|
-
});
|
|
80
|
-
setGridInfoContainerComponents(gridInfoContainerComponentMap);
|
|
81
|
-
setGridInfoOptions(gridInfoOptions);
|
|
82
|
-
}, []);
|
|
83
|
-
const [expandedComponentContainer, setExpandedComponentContainer] = (0, react_1.useState)('');
|
|
84
|
-
return (React.createElement(Flex_1.Box, { className: "ab-AdaptableOptions twa:p-2", "data-name": "gridInfo-adaptableOptions-content" }, gridInfoOptions &&
|
|
85
|
-
Array.from(gridInfoOptions.entries()).map(([containerName, container]) => (React.createElement(OptionContainerComponent, { key: containerName, name: containerName, label: container.containerLabel, viewMode: containerName === expandedComponentContainer ? 'expanded' : 'collapsed', onViewModeChange: (newViewMode) => setExpandedComponentContainer(newViewMode === 'expanded' ? containerName : '') }, gridInfoContainerComponents.get(containerName))))));
|
|
86
|
-
};
|
|
87
|
-
exports.AdaptableOptionsComponent = AdaptableOptionsComponent;
|
|
88
|
-
const OptionContainerComponent = (props) => {
|
|
89
|
-
const { viewMode, name, label, onViewModeChange, children } = props;
|
|
90
|
-
const requestViewModeChange = () => {
|
|
91
|
-
onViewModeChange(viewMode === 'expanded' ? 'collapsed' : 'expanded');
|
|
92
|
-
};
|
|
93
|
-
const panelButton = viewMode === 'expanded' ? (React.createElement(ButtonMinimise_1.ButtonMinimise, { onClick: () => requestViewModeChange(), tooltip: `Hide ${label}` })) : (React.createElement(ButtonMaximise_1.ButtonMaximise, { onClick: () => requestViewModeChange(), tooltip: `Show ${label}` }));
|
|
94
|
-
return (React.createElement(PanelWithButton_1.PanelWithButton, { className: `ab-OptionsContainer options-container-${name} twa:mb-3`, variant: "default", headerText: label, headerProps: {
|
|
95
|
-
className: `twa:text-3 twa:cursor-pointer ${viewMode === 'expanded' ? 'twa:font-extrabold' : 'twa:font-normal'}`,
|
|
96
|
-
'data-name': `options-container-header-${name}`,
|
|
97
|
-
onClick: () => requestViewModeChange(),
|
|
98
|
-
}, button: panelButton }, viewMode === 'expanded' && children));
|
|
99
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ModuleSummaryProps } from '../Components/SharedProps/ModuleSummaryProps';
|
|
3
|
-
import { EditableConfigEntityState } from '../Components/SharedProps/EditableConfigEntityState';
|
|
4
|
-
import * as PlusMinusRedux from '../../Redux/ActionsReducers/PlusMinusRedux';
|
|
5
|
-
import { PlusMinusNudge } from '../../AdaptableState/PlusMinusState';
|
|
6
|
-
export interface PlusMinusSummaryProps extends ModuleSummaryProps<PlusMinusSummaryComponent> {
|
|
7
|
-
PlusMinusNudges: PlusMinusNudge[];
|
|
8
|
-
onAddPlusMinusNudge: (PlusMinus: PlusMinusNudge) => PlusMinusRedux.PlusMinusNudgeAddAction;
|
|
9
|
-
onEditPlusMinusNudge: (PlusMinus: PlusMinusNudge) => PlusMinusRedux.PlusMinusNudgeEditAction;
|
|
10
|
-
}
|
|
11
|
-
export declare class PlusMinusSummaryComponent extends React.Component<PlusMinusSummaryProps, EditableConfigEntityState> {
|
|
12
|
-
constructor(props: PlusMinusSummaryProps);
|
|
13
|
-
render(): any;
|
|
14
|
-
onNew(): void;
|
|
15
|
-
onEdit(PlusMinus: PlusMinusNudge): void;
|
|
16
|
-
onCloseWizard(): void;
|
|
17
|
-
onFinishWizard(): void;
|
|
18
|
-
canFinishWizard(): boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare let PlusMinusSummary: import("react-redux").ConnectedComponent<typeof PlusMinusSummaryComponent, {
|
|
21
|
-
[x: string]: any;
|
|
22
|
-
}>;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PlusMinusSummary = exports.PlusMinusSummaryComponent = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const EditableConfigEntityState_1 = require("../Components/SharedProps/EditableConfigEntityState");
|
|
7
|
-
const react_redux_1 = require("react-redux");
|
|
8
|
-
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
9
|
-
const PlusMinusRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PlusMinusRedux"));
|
|
10
|
-
const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
|
|
11
|
-
const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
|
|
12
|
-
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
13
|
-
const ModuleHeader_1 = require("../Components/ModuleSummary/ModuleHeader");
|
|
14
|
-
const ModuleDetail_1 = require("../Components/ModuleSummary/ModuleDetail");
|
|
15
|
-
const TeamSharingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/TeamSharingRedux"));
|
|
16
|
-
const UIHelper_1 = require("../UIHelper");
|
|
17
|
-
const PlusMinusWizard_1 = require("./Wizard/PlusMinusWizard");
|
|
18
|
-
class PlusMinusSummaryComponent extends React.Component {
|
|
19
|
-
constructor(props) {
|
|
20
|
-
super(props);
|
|
21
|
-
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
22
|
-
}
|
|
23
|
-
render() {
|
|
24
|
-
let moduleSummaries = [];
|
|
25
|
-
// title row
|
|
26
|
-
let titleRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: Helper_1.Helper.returnItemCount(this.props.PlusMinusNudges.filter((item) => this.props.api.columnScopeApi.isColumnInScopeColumns(this.props.summarisedColumn, item.Scope)), this.props.moduleInfo.FriendlyName), onNew: () => this.onNew(), newButtonTooltip: 'Plus / Minus Rule', accessLevel: this.props.accessLevel }));
|
|
27
|
-
moduleSummaries.push(titleRow);
|
|
28
|
-
// existing items
|
|
29
|
-
this.props.PlusMinusNudges.map((item, index) => {
|
|
30
|
-
if (this.props.api.columnScopeApi.isColumnInScopeColumns(this.props.summarisedColumn, item.Scope)) {
|
|
31
|
-
let detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'PM' + index, item1: 'Nudge Value: ' + item.NudgeValue, item2: item.Rule?.BooleanExpression ? item.Rule.BooleanExpression : 'Always', configEnity: item, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(item), onShare: (config) => this.props.onShare(item, config), onDelete: PlusMinusRedux.PlusMinusNudgeDelete(item), accessLevel: this.props.accessLevel }));
|
|
32
|
-
moduleSummaries.push(detailRow);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return (React.createElement("div", null,
|
|
36
|
-
moduleSummaries,
|
|
37
|
-
this.state.editedAdaptableObject && (React.createElement(PlusMinusWizard_1.PlusMinusWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: null, wizardStartIndex: this.state.wizardStartIndex, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: () => this.onFinishWizard() }))));
|
|
38
|
-
}
|
|
39
|
-
onNew() {
|
|
40
|
-
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyPlusMinusNudge();
|
|
41
|
-
configEntity.Scope = {
|
|
42
|
-
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
43
|
-
};
|
|
44
|
-
this.setState({
|
|
45
|
-
editedAdaptableObject: configEntity,
|
|
46
|
-
wizardStartIndex: 1,
|
|
47
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.New,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
onEdit(PlusMinus) {
|
|
51
|
-
this.setState({
|
|
52
|
-
editedAdaptableObject: Helper_1.Helper.cloneObject(PlusMinus),
|
|
53
|
-
wizardStartIndex: 1,
|
|
54
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.Edit,
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
onCloseWizard() {
|
|
58
|
-
this.setState({
|
|
59
|
-
editedAdaptableObject: null,
|
|
60
|
-
wizardStartIndex: 0,
|
|
61
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
onFinishWizard() {
|
|
65
|
-
let plusMinusNudge = this.state.editedAdaptableObject;
|
|
66
|
-
if (this.state.wizardStatus == EditableConfigEntityState_1.WizardStatus.Edit) {
|
|
67
|
-
this.props.onEditPlusMinusNudge(plusMinusNudge);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
this.props.onAddPlusMinusNudge(plusMinusNudge);
|
|
71
|
-
}
|
|
72
|
-
this.setState({
|
|
73
|
-
editedAdaptableObject: null,
|
|
74
|
-
wizardStartIndex: 0,
|
|
75
|
-
wizardStatus: EditableConfigEntityState_1.WizardStatus.None,
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
canFinishWizard() {
|
|
79
|
-
let plusMinus = this.state.editedAdaptableObject;
|
|
80
|
-
if (!plusMinus.NudgeValue) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.PlusMinusSummaryComponent = PlusMinusSummaryComponent;
|
|
87
|
-
function mapStateToProps(state, ownProps) {
|
|
88
|
-
return {
|
|
89
|
-
PlusMinusNudges: state.PlusMinus.PlusMinusNudges,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function mapDispatchToProps(dispatch) {
|
|
93
|
-
return {
|
|
94
|
-
onAddPlusMinusNudge: (PlusMinusNudge) => dispatch(PlusMinusRedux.PlusMinusNudgeAdd(PlusMinusNudge)),
|
|
95
|
-
onEditPlusMinusNudge: (PlusMinusNudge) => dispatch(PlusMinusRedux.PlusMinusNudgeEdit(PlusMinusNudge)),
|
|
96
|
-
onClearPopupParams: () => dispatch(PopupRedux.PopupClearParam()),
|
|
97
|
-
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.PlusMinusModuleId, config)),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
exports.PlusMinusSummary = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(PlusMinusSummaryComponent);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export interface WizardLegendProps extends React.ClassAttributes<WizardLegend> {
|
|
3
|
-
StepNames: string[];
|
|
4
|
-
ActiveStepName: string;
|
|
5
|
-
FriendlyName: string;
|
|
6
|
-
CanShowAllSteps: boolean;
|
|
7
|
-
onStepButtonClicked: (stepName: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare class WizardLegend extends React.Component<WizardLegendProps, {}> {
|
|
10
|
-
render(): any;
|
|
11
|
-
private onStepButtonClicked;
|
|
12
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WizardLegend = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
7
|
-
const Flex_1 = require("../../components/Flex");
|
|
8
|
-
class WizardLegend extends React.Component {
|
|
9
|
-
render() {
|
|
10
|
-
let count = this.props.StepNames.length - 1;
|
|
11
|
-
let activeStepIndex = this.props.StepNames.findIndex((s) => s == this.props.ActiveStepName);
|
|
12
|
-
let stepButtons = this.props.StepNames.map((s, index) => {
|
|
13
|
-
let isActiveStep = index == activeStepIndex;
|
|
14
|
-
let isDisabled = this.props.CanShowAllSteps
|
|
15
|
-
? false
|
|
16
|
-
: isActiveStep || index > activeStepIndex;
|
|
17
|
-
let lastStep = index == count;
|
|
18
|
-
return (React.createElement("div", { className: "ab-WizardLegend__step twa:inline-block", "data-name": s, key: index },
|
|
19
|
-
React.createElement(SimpleButton_1.default, { variant: isActiveStep ? 'raised' : 'outlined', tone: isActiveStep ? 'accent' : 'neutral', disabled: isDisabled, onClick: () => this.onStepButtonClicked(s) }, s),
|
|
20
|
-
lastStep == false && (React.createElement(Flex_1.Box, { "data-name": "separator", className: "ab-WizardLegend__step__separator twa:mx-2 twa:inline-block" }, "\u2014"))));
|
|
21
|
-
});
|
|
22
|
-
return React.createElement("div", null, stepButtons);
|
|
23
|
-
}
|
|
24
|
-
onStepButtonClicked(stepName) {
|
|
25
|
-
this.props.onStepButtonClicked(stepName);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.WizardLegend = WizardLegend;
|