@adaptabletools/adaptable 13.0.0-canary.9 → 13.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +1454 -840
- package/base.css.map +1 -0
- package/bundle.cjs.js +238 -220
- package/index.css +1505 -850
- package/index.css.map +1 -0
- package/package.json +6 -6
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +30 -6
- package/src/AdaptableOptions/ExportOptions.d.ts +2 -2
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -5
- package/src/AdaptableOptions/LayoutOptions.d.ts +2 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/Api/AdaptableApi.d.ts +2 -5
- package/src/Api/ColumnApi.d.ts +8 -2
- package/src/Api/ConfigApi.d.ts +0 -5
- package/src/Api/ExportApi.d.ts +6 -6
- package/src/Api/FormatColumnApi.d.ts +46 -73
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -2
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -3
- package/src/Api/Implementation/AlertApiImpl.js +9 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +2 -1
- package/src/Api/Implementation/ColumnApiImpl.js +15 -11
- package/src/Api/Implementation/ConfigApiImpl.d.ts +0 -2
- package/src/Api/Implementation/ConfigApiImpl.js +0 -11
- package/src/Api/Implementation/ExportApiImpl.d.ts +4 -4
- package/src/Api/Implementation/ExportApiImpl.js +14 -14
- package/src/Api/Implementation/FlashingCellApiImpl.js +4 -1
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +24 -22
- package/src/Api/Implementation/FormatColumnApiImpl.js +57 -224
- package/src/Api/Implementation/InternalApiImpl.d.ts +1 -1
- package/src/Api/Implementation/InternalApiImpl.js +4 -3
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -1
- package/src/Api/Implementation/QueryLanguageApiImpl.js +9 -15
- package/src/Api/Implementation/ScopeApiImpl.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +25 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +193 -0
- package/src/Api/InternalApi.d.ts +1 -1
- package/src/Api/QueryLanguageApi.d.ts +3 -2
- package/src/Api/ScopeApi.d.ts +1 -1
- package/src/Api/StyledColumnApi.d.ts +106 -0
- package/src/Api/{ConditionalStyleApi.js → StyledColumnApi.js} +0 -0
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/Types.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/FormatColumnState.d.ts +6 -90
- package/src/PredefinedConfig/PredefinedConfig.d.ts +5 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +119 -0
- package/src/{Strategy/Interface/IConditionalStyleModule.js → PredefinedConfig/StyledColumnState.js} +0 -0
- package/src/Redux/ActionsReducers/PluginsRedux.d.ts +4 -4
- package/src/Redux/ActionsReducers/PluginsRedux.js +5 -5
- package/src/Redux/ActionsReducers/StyledColumnRedux.d.ts +49 -0
- package/src/Redux/ActionsReducers/StyledColumnRedux.js +92 -0
- package/src/Redux/DeadRedux.d.ts +6 -0
- package/src/Redux/DeadRedux.js +19 -1
- package/src/Redux/Store/AdaptableStore.js +9 -8
- package/src/Strategy/ConditionalStyleModule.d.ts +2 -27
- package/src/Strategy/ConditionalStyleModule.js +0 -219
- package/src/Strategy/FormatColumnModule.d.ts +0 -2
- package/src/Strategy/FormatColumnModule.js +30 -221
- package/src/Strategy/LayoutModule.js +0 -4
- package/src/Strategy/StyledColumnModule.d.ts +24 -0
- package/src/Strategy/StyledColumnModule.js +165 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnStyleViewItems.js +1 -16
- package/src/Strategy/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +4 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -3
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -4
- package/src/Utilities/ObjectFactory.d.ts +5 -2
- package/src/Utilities/ObjectFactory.js +14 -6
- package/src/Utilities/Services/ModuleService.js +2 -2
- package/src/Utilities/Services/QueryLanguageService.js +1 -1
- package/src/Utilities/Services/ReportService.js +6 -6
- package/src/View/AdaptablePopover/index.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +15 -14
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +24 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +6 -5
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +3 -3
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +3 -3
- package/src/View/Alert/Wizard/isValidAlertRules.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/AdaptableObjectRow/index.js +1 -6
- package/src/View/Components/Buttons/ButtonInfo.d.ts +1 -3
- package/src/View/Components/Buttons/ButtonInfo.js +3 -5
- package/src/View/Components/EntityRulesEditor/index.js +8 -17
- package/src/View/Components/FilterForm/FilterForm.js +11 -16
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +2 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +7 -13
- package/src/View/Components/NewScopeComponent.js +3 -3
- package/src/View/Components/Panels/PanelWithButton.js +1 -5
- package/src/View/Components/Panels/PanelWithImage.js +1 -5
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +2 -2
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +1 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +3 -16
- package/src/View/Components/Popups/AdaptablePopup/PopupPanel.js +1 -1
- package/src/View/Components/Popups/AdaptablePopupTeamSharing.js +5 -5
- package/src/View/Components/RangesComponent.d.ts +8 -1
- package/src/View/Components/RangesComponent.js +60 -24
- package/src/View/Components/ScopeComponent.js +6 -6
- package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
- package/src/View/Components/Selectors/ColumnSelector.js +2 -1
- package/src/View/Components/Selectors/ColumnValueSelector.js +2 -2
- package/src/View/Components/StyleComponent.js +14 -19
- package/src/View/Components/ToolPanel/AdaptableToolPanel.d.ts +1 -11
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +21 -9
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.d.ts +1 -1
- package/src/View/Dashboard/DashboardPopup.js +1 -1
- package/src/View/DataSet/DataSetSelector.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.d.ts +1 -1
- package/src/View/Export/ExportViewPanel.js +4 -4
- package/src/View/Export/ReportExportDropdown.js +1 -1
- package/src/View/Export/Wizard/ReportNameWizardSection.js +10 -11
- package/src/View/Filter/FilterSummary.d.ts +1 -1
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FlashingCell/FlashingCellStyle.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +6 -6
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +27 -27
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +4 -5
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +2 -6
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -3
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +6 -300
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -10
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +7 -7
- package/src/View/GridInfo/ColumnInfoComponent.js +26 -18
- package/src/View/GridInfo/GridInfoPopup.js +10 -9
- package/src/View/Layout/LayoutRadioSelector.js +1 -1
- package/src/View/Layout/LayoutViewPanel.d.ts +1 -1
- package/src/View/Layout/Wizard/Components/ColumnLabels.js +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +7 -6
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +1 -1
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +3 -3
- package/src/View/Query/QueryViewPanel.d.ts +1 -1
- package/src/View/Query/Wizard/NamedQuerySettingsWizardSection.js +1 -1
- package/src/View/QuickSearch/QuickSearchPopup.js +2 -2
- package/src/View/QuickSearch/QuickSearchViewPanel.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +5 -5
- package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +3 -3
- package/src/View/SmartEdit/SmartEditPopup.js +3 -3
- package/src/View/SpecialColumnSettingsWizardStep.js +10 -10
- package/src/View/StateManagement/StateManagementPopup.js +4 -4
- package/src/View/StatusBar/StatusBarPopup.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +77 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +65 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection.js +234 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +59 -0
- package/src/View/SystemStatus/SystemStatusEntityRow.js +4 -6
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/TeamSharing/SharedEntityObjectView.js +1 -1
- package/src/View/TeamSharing/TeamSharingApplyButton.js +1 -1
- package/src/View/Theme/ThemePopup.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.d.ts +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -2
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -0
- package/src/agGrid/ActionColumnRenderer.js +94 -62
- package/src/agGrid/Adaptable.d.ts +10 -11
- package/src/agGrid/Adaptable.js +164 -222
- package/src/agGrid/CheckboxRenderer.js +1 -1
- package/src/agGrid/FilterWrapper.js +60 -16
- package/src/agGrid/FloatingFilterWrapper.d.ts +2 -2
- package/src/agGrid/FloatingFilterWrapper.js +71 -32
- package/src/agGrid/PercentBarRenderer.d.ts +6 -2
- package/src/agGrid/PercentBarRenderer.js +19 -17
- package/src/agGrid/agGridHelper.d.ts +6 -2
- package/src/agGrid/agGridHelper.js +17 -17
- package/src/agGrid/createAgStatusPanelComponent.d.ts +1 -1
- package/src/agGrid/createAgStatusPanelComponent.js +17 -0
- package/src/agGrid/editors/AdaptableDateEditor/index.d.ts +4 -1
- package/src/agGrid/editors/AdaptableDateEditor/index.js +84 -17
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/agGrid/editors/AdaptableNumberEditor/index.d.ts +2 -3
- package/src/agGrid/editors/AdaptableNumberEditor/index.js +78 -27
- package/src/agGrid/weightedAverage.js +19 -11
- package/src/components/CheckBox/index.js +7 -2
- package/src/components/Datepicker/index.d.ts +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/DragAndDropContext/UnusedPanel.js +3 -2
- package/src/components/ExpressionEditor/BaseEditorInput.js +13 -32
- package/src/components/ExpressionEditor/index.js +9 -17
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/StylePreview.js +2 -1
- package/src/components/icons/brush.d.ts +3 -0
- package/src/components/icons/brush.js +7 -0
- package/src/components/icons/index.js +2 -0
- package/src/metamodel/adaptable.metamodel.d.ts +113 -57
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/renderReactRoot.d.ts +2 -0
- package/src/renderReactRoot.js +11 -9
- package/src/types.d.ts +5 -5
- package/themes/dark.css +8 -4
- package/themes/dark.css.map +1 -0
- package/themes/light.css +4 -1
- package/themes/light.css.map +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableComponents.d.ts +0 -1
- package/src/AdaptableComponents.js +0 -5
- package/src/Api/ConditionalStyleApi.d.ts +0 -86
- package/src/Api/Implementation/ConditionalStyleApiImpl.d.ts +0 -29
- package/src/Api/Implementation/ConditionalStyleApiImpl.js +0 -98
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.d.ts +0 -49
- package/src/Redux/ActionsReducers/ConditionalStyleRedux.js +0 -95
- package/src/Strategy/Interface/IConditionalStyleModule.d.ts +0 -6
- package/src/Strategy/Utilities/getStyleViewItems.d.ts +0 -2
- package/src/Strategy/Utilities/getStyleViewItems.js +0 -16
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.d.ts +0 -2
- package/src/View/ConditionalStyle/ConditionalStylePopupHeader.js +0 -18
- package/src/View/ConditionalStyle/ConditionalStyleSummary.d.ts +0 -25
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +0 -108
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.d.ts +0 -9
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleRuleWizardSection.js +0 -42
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleScopeWizardSection.js +0 -43
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleSettingsWizardSettings.js +0 -29
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.d.ts +0 -8
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleStyleWizardSection.js +0 -23
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.d.ts +0 -6
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +0 -114
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.d.ts +0 -1
- package/src/View/ConditionalStyle/Wizard/DEFAULT_PREDICATE_ID_FOR_CONDITIONAL_STYLE.js +0 -4
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnWizardStyleSection = exports.renderStyledColumnStyleSummary = exports.renderFormatColumnStyleWizardSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
8
|
+
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
9
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
10
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
11
|
+
const Tag_1 = require("../../../components/Tag");
|
|
12
|
+
const ColorPicker_1 = require("../../ColorPicker");
|
|
13
|
+
const RangesComponent_1 = require("../../Components/RangesComponent");
|
|
14
|
+
const StyleVisualItem_1 = require("../../Components/StyleVisualItem");
|
|
15
|
+
const UIHelper_1 = require("../../UIHelper");
|
|
16
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
17
|
+
const renderFormatColumnStyleWizardSummary = (data) => {
|
|
18
|
+
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
19
|
+
return (0, exports.renderStyledColumnStyleSummary)(data, api);
|
|
20
|
+
};
|
|
21
|
+
exports.renderFormatColumnStyleWizardSummary = renderFormatColumnStyleWizardSummary;
|
|
22
|
+
const getRanges = (ranges) => {
|
|
23
|
+
return ranges.map((r, i) => (React.createElement(rebass_1.Flex, { key: i, alignItems: "center", mr: 3 },
|
|
24
|
+
React.createElement(rebass_1.Box, { mr: 1 },
|
|
25
|
+
r.Min,
|
|
26
|
+
" to ",
|
|
27
|
+
r.Max,
|
|
28
|
+
' '),
|
|
29
|
+
React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
|
|
30
|
+
BackColor: r.Color,
|
|
31
|
+
ForeColor: r.Color,
|
|
32
|
+
} }))));
|
|
33
|
+
};
|
|
34
|
+
const getColumnComparison = (columnComparison, api) => {
|
|
35
|
+
return (React.createElement(rebass_1.Flex, { key: 'cc', alignItems: "center", mr: 3 },
|
|
36
|
+
React.createElement(rebass_1.Box, { mr: 1 },
|
|
37
|
+
"Min Value:",
|
|
38
|
+
' ',
|
|
39
|
+
isNaN(Number(columnComparison.MinValue))
|
|
40
|
+
? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MinValue)) + ']'
|
|
41
|
+
: columnComparison.MinValue,
|
|
42
|
+
' ',
|
|
43
|
+
", Max Value:",
|
|
44
|
+
' ',
|
|
45
|
+
isNaN(Number(columnComparison.MaxValue))
|
|
46
|
+
? '[' + api.columnApi.getFriendlyNameFromColumnId(String(columnComparison.MaxValue)) + ']'
|
|
47
|
+
: columnComparison.MaxValue,
|
|
48
|
+
' '),
|
|
49
|
+
React.createElement(StyleVisualItem_1.StyleVisualItem, { Style: {
|
|
50
|
+
BackColor: columnComparison.Color,
|
|
51
|
+
ForeColor: columnComparison.Color,
|
|
52
|
+
} })));
|
|
53
|
+
};
|
|
54
|
+
const renderStyledColumnStyleSummary = (data, api) => {
|
|
55
|
+
if (data.CheckBoxStyle) {
|
|
56
|
+
return React.createElement(Tag_1.Tag, null, "Checkbox Style");
|
|
57
|
+
}
|
|
58
|
+
if (data.GradientStyle) {
|
|
59
|
+
if (data.GradientStyle.CellRanges) {
|
|
60
|
+
return getRanges(data.GradientStyle.CellRanges);
|
|
61
|
+
}
|
|
62
|
+
if (data.GradientStyle.ColumnComparison) {
|
|
63
|
+
return getColumnComparison(data.GradientStyle.ColumnComparison, api);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (data.PercentBarStyle) {
|
|
67
|
+
if (data.PercentBarStyle.CellRanges) {
|
|
68
|
+
return getRanges(data.PercentBarStyle.CellRanges);
|
|
69
|
+
}
|
|
70
|
+
if (data.PercentBarStyle.ColumnComparison) {
|
|
71
|
+
return getColumnComparison(data.PercentBarStyle.ColumnComparison, api);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return React.createElement(Tag_1.Tag, null, "No Styling Defined");
|
|
75
|
+
};
|
|
76
|
+
exports.renderStyledColumnStyleSummary = renderStyledColumnStyleSummary;
|
|
77
|
+
const StyledColumnWizardStyleSection = (props) => {
|
|
78
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
79
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
80
|
+
const minMaxRangeValues = React.useMemo(() => {
|
|
81
|
+
const columnId = data.ColumnId;
|
|
82
|
+
if (!columnId) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
const column = api.columnApi.getColumnFromId(columnId);
|
|
86
|
+
return {
|
|
87
|
+
min: api.columnApi.getMinValueForNumericColumn(column),
|
|
88
|
+
max: api.columnApi.getMaxValueForNumericColumn(column),
|
|
89
|
+
};
|
|
90
|
+
}, [data]);
|
|
91
|
+
const scope = { ColumnIds: [data.ColumnId] }; // TODO: remove scope when format column columnStyle is removed
|
|
92
|
+
// gradient
|
|
93
|
+
const onUpdateGradientStyleRanges = (ranges) => {
|
|
94
|
+
const GradientStyle = {
|
|
95
|
+
CellRanges: ranges,
|
|
96
|
+
};
|
|
97
|
+
props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
|
|
98
|
+
};
|
|
99
|
+
const onUpdateGradientStyleColumnComparison = (columnComparison) => {
|
|
100
|
+
const GradientStyle = {
|
|
101
|
+
ColumnComparison: columnComparison,
|
|
102
|
+
};
|
|
103
|
+
props.onChange(Object.assign(Object.assign({}, data), { GradientStyle }));
|
|
104
|
+
};
|
|
105
|
+
// percentbar
|
|
106
|
+
const onUpdatePercentBarStyleColumnComparison = (columnComparison) => {
|
|
107
|
+
const PercentBarStyle = Object.assign(Object.assign({}, data.PercentBarStyle), { ColumnComparison: columnComparison });
|
|
108
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
|
|
109
|
+
};
|
|
110
|
+
const onUpdatePercentBarStyleRanges = (ranges) => {
|
|
111
|
+
const PercentBarStyle = Object.assign(Object.assign({}, data.PercentBarStyle), { CellRanges: ranges });
|
|
112
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle }));
|
|
113
|
+
};
|
|
114
|
+
const onPercentBarCellTextCellValueChanged = (checked) => {
|
|
115
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
116
|
+
if (checked) {
|
|
117
|
+
if (!percentBarStyle.CellText) {
|
|
118
|
+
percentBarStyle.CellText = ['CellValue'];
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
percentBarStyle.CellText.push('CellValue');
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (percentBarStyle.CellText && percentBarStyle.CellText.includes('PercentageValue')) {
|
|
126
|
+
percentBarStyle.CellText = ['PercentageValue'];
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
percentBarStyle.CellText = [];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
133
|
+
};
|
|
134
|
+
const onPercentBarCellTextPercentValueChanged = (checked) => {
|
|
135
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
136
|
+
if (checked) {
|
|
137
|
+
if (!percentBarStyle.CellText) {
|
|
138
|
+
percentBarStyle.CellText = ['PercentageValue'];
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
percentBarStyle.CellText.push('PercentageValue');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
if (percentBarStyle.CellText && percentBarStyle.CellText.includes('CellValue')) {
|
|
146
|
+
percentBarStyle.CellText = ['CellValue'];
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
percentBarStyle.CellText = [];
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
153
|
+
};
|
|
154
|
+
const onPercentBarToolTipTextCellValueChanged = (checked) => {
|
|
155
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
156
|
+
if (checked) {
|
|
157
|
+
if (!percentBarStyle.ToolTipText) {
|
|
158
|
+
percentBarStyle.ToolTipText = ['CellValue'];
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
percentBarStyle.ToolTipText.push('CellValue');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('PercentageValue')) {
|
|
166
|
+
percentBarStyle.ToolTipText = ['PercentageValue'];
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
percentBarStyle.ToolTipText = [];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
173
|
+
};
|
|
174
|
+
const onPercentBarToolTipTextPercentValueChanged = (checked) => {
|
|
175
|
+
let percentBarStyle = data.PercentBarStyle;
|
|
176
|
+
if (checked) {
|
|
177
|
+
if (!percentBarStyle.ToolTipText) {
|
|
178
|
+
percentBarStyle.ToolTipText = ['PercentageValue'];
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
percentBarStyle.ToolTipText.push('PercentageValue');
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
if (percentBarStyle.ToolTipText && percentBarStyle.ToolTipText.includes('CellValue')) {
|
|
186
|
+
percentBarStyle.ToolTipText = ['CellValue'];
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
percentBarStyle.ToolTipText = [];
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
193
|
+
};
|
|
194
|
+
const onUsePercentStyleColorCheckChanged = (checked) => {
|
|
195
|
+
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
196
|
+
percentBarStyle.BackColor = checked ? (0, UIHelper_1.getHexForName)(UIHelper_1.GRAY) : null;
|
|
197
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
198
|
+
};
|
|
199
|
+
const onForeColorSelectChange = (color) => {
|
|
200
|
+
let percentBarStyle = data.PercentBarStyle;
|
|
201
|
+
percentBarStyle.BackColor = color;
|
|
202
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
203
|
+
};
|
|
204
|
+
const disabled = !data.ColumnId;
|
|
205
|
+
return (React.createElement(rebass_1.Box, null,
|
|
206
|
+
data.CheckBoxStyle && (React.createElement(Tabs_1.Tabs, null,
|
|
207
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Check Box Column"),
|
|
208
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
209
|
+
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, readOnly: true, checked: true }, "Display Column As CheckBox")))),
|
|
210
|
+
(data === null || data === void 0 ? void 0 : data.GradientStyle) && (React.createElement(RangesComponent_1.RangesComponent, { disabled: !data.ColumnId, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: true, ranges: (_a = data.GradientStyle) === null || _a === void 0 ? void 0 : _a.CellRanges, columnComparison: (_b = data === null || data === void 0 ? void 0 : data.GradientStyle) === null || _b === void 0 ? void 0 : _b.ColumnComparison, updateRanges: (ranges) => onUpdateGradientStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdateGradientStyleColumnComparison(columnComparison) })),
|
|
211
|
+
data.PercentBarStyle && (React.createElement(React.Fragment, null,
|
|
212
|
+
React.createElement(RangesComponent_1.RangesComponent, { disabled: disabled, minMaxRangeValues: minMaxRangeValues, api: api, scope: scope, showRangeDirection: false, ranges: (_c = data.PercentBarStyle) === null || _c === void 0 ? void 0 : _c.CellRanges, columnComparison: (_d = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _d === void 0 ? void 0 : _d.ColumnComparison, updateRanges: (ranges) => onUpdatePercentBarStyleRanges(ranges), updateColumnComparison: (columnComparison) => onUpdatePercentBarStyleColumnComparison(columnComparison) }),
|
|
213
|
+
React.createElement(FormLayout_1.default, { marginLeft: 2, marginTop: 2 },
|
|
214
|
+
React.createElement(FormLayout_1.FormRow, { label: "Cell Display:" },
|
|
215
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_f = (_e = data.PercentBarStyle) === null || _e === void 0 ? void 0 : _e.CellText) === null || _f === void 0 ? void 0 : _f.includes('CellValue'), onChange: (checked) => onPercentBarCellTextCellValueChanged(checked) }, "Cell Value"),
|
|
216
|
+
' ',
|
|
217
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_h = (_g = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _g === void 0 ? void 0 : _g.CellText) === null || _h === void 0 ? void 0 : _h.includes('PercentageValue'), onChange: (checked) => onPercentBarCellTextPercentValueChanged(checked) },
|
|
218
|
+
"Percent Value",
|
|
219
|
+
' '),
|
|
220
|
+
' '),
|
|
221
|
+
React.createElement(FormLayout_1.FormRow, { label: "ToolTip Display:" },
|
|
222
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_k = (_j = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _j === void 0 ? void 0 : _j.ToolTipText) === null || _k === void 0 ? void 0 : _k.includes('CellValue'), onChange: (checked) => onPercentBarToolTipTextCellValueChanged(checked) }, "Cell Value"),
|
|
223
|
+
' ',
|
|
224
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_m = (_l = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _l === void 0 ? void 0 : _l.ToolTipText) === null || _m === void 0 ? void 0 : _m.includes('PercentageValue'), onChange: (checked) => onPercentBarToolTipTextPercentValueChanged(checked) },
|
|
225
|
+
"Percent Value",
|
|
226
|
+
' '),
|
|
227
|
+
' '),
|
|
228
|
+
React.createElement(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}` },
|
|
229
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
230
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, checked: !!((_o = data.PercentBarStyle) === null || _o === void 0 ? void 0 : _o.BackColor), onChange: (checked) => onUsePercentStyleColorCheckChanged(checked), mr: 2 }),
|
|
231
|
+
((_p = data.PercentBarStyle) === null || _p === void 0 ? void 0 : _p.BackColor) !== undefined && (React.createElement(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: (_q = data.PercentBarStyle) === null || _q === void 0 ? void 0 : _q.BackColor, onChange: (x) => onForeColorSelectChange(x) }))))))),
|
|
232
|
+
!data.ColumnId && React.createElement(ErrorBox_1.default, { mt: 2 }, "You need to select a column before styling.")));
|
|
233
|
+
};
|
|
234
|
+
exports.StyledColumnWizardStyleSection = StyledColumnWizardStyleSection;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyledColumn } from '../../../PredefinedConfig/StyledColumnState';
|
|
3
|
+
export declare const renderStyledColumnTypeSummary: (data: StyledColumn) => JSX.Element;
|
|
4
|
+
export interface StyledColumnWizardTypeSectionProps {
|
|
5
|
+
onChange: (styledColumn: StyledColumn) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StyledColumnWizardTypeSection: React.FunctionComponent<StyledColumnWizardTypeSectionProps>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnWizardTypeSection = exports.renderStyledColumnTypeSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
8
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
9
|
+
const Tag_1 = require("../../../components/Tag");
|
|
10
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
11
|
+
const renderStyledColumnTypeSummary = (data) => {
|
|
12
|
+
let type = null;
|
|
13
|
+
if (data.GradientStyle) {
|
|
14
|
+
type = 'Gradient Column';
|
|
15
|
+
}
|
|
16
|
+
else if (data.PercentBarStyle) {
|
|
17
|
+
type = 'Percent Bar';
|
|
18
|
+
}
|
|
19
|
+
else if (data.CheckBoxStyle) {
|
|
20
|
+
type = 'Check Box';
|
|
21
|
+
}
|
|
22
|
+
return (React.createElement(rebass_1.Text, { pr: 2, py: 2 },
|
|
23
|
+
"Type ",
|
|
24
|
+
React.createElement(Tag_1.Tag, null, type)));
|
|
25
|
+
};
|
|
26
|
+
exports.renderStyledColumnTypeSummary = renderStyledColumnTypeSummary;
|
|
27
|
+
const StyledColumnWizardTypeSection = (props) => {
|
|
28
|
+
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
29
|
+
const handleTypeChange = (type) => {
|
|
30
|
+
const newStyledColumn = Object.assign({}, data);
|
|
31
|
+
switch (type) {
|
|
32
|
+
case 'gradient':
|
|
33
|
+
newStyledColumn.GradientStyle = {};
|
|
34
|
+
delete newStyledColumn.PercentBarStyle;
|
|
35
|
+
delete newStyledColumn.CheckBoxStyle;
|
|
36
|
+
break;
|
|
37
|
+
case 'percent':
|
|
38
|
+
newStyledColumn.PercentBarStyle = {};
|
|
39
|
+
delete newStyledColumn.GradientStyle;
|
|
40
|
+
delete newStyledColumn.CheckBoxStyle;
|
|
41
|
+
break;
|
|
42
|
+
case 'checkbox':
|
|
43
|
+
newStyledColumn.CheckBoxStyle = true;
|
|
44
|
+
delete newStyledColumn.GradientStyle;
|
|
45
|
+
delete newStyledColumn.PercentBarStyle;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
newStyledColumn.ColumnId = null;
|
|
49
|
+
props.onChange(newStyledColumn);
|
|
50
|
+
};
|
|
51
|
+
return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column", "data-name": "styled-column-type" },
|
|
52
|
+
React.createElement(Tabs_1.Tabs, { autoFocus: false, padding: 2 },
|
|
53
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Type"),
|
|
54
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
55
|
+
React.createElement(Radio_1.default, { checked: Boolean(data.GradientStyle), onChange: () => handleTypeChange('gradient') }, "Gradient Column"),
|
|
56
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('percent'), checked: Boolean(data.PercentBarStyle) }, "Percent Bar"),
|
|
57
|
+
React.createElement(Radio_1.default, { onChange: () => handleTypeChange('checkbox'), checked: Boolean(data.CheckBoxStyle) }, "Check Box")))));
|
|
58
|
+
};
|
|
59
|
+
exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
|
|
@@ -7,6 +7,7 @@ const AdaptableObjectRow_1 = require("../Components/AdaptableObjectRow");
|
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
|
|
9
9
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
10
|
+
const join_1 = tslib_1.__importDefault(require("../../components/utils/join"));
|
|
10
11
|
class SystemStatusEntityRow extends React.Component {
|
|
11
12
|
render() {
|
|
12
13
|
var _a;
|
|
@@ -15,15 +16,12 @@ class SystemStatusEntityRow extends React.Component {
|
|
|
15
16
|
let messageTypeColor = UIHelper_1.default.getColorByMessageType((_a = systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.statusType) !== null && _a !== void 0 ? _a : 'Success');
|
|
16
17
|
let colItems = (0, Helper_1.cloneObject)(this.props.colItems);
|
|
17
18
|
colItems[0].Content = systemStatus ? (React.createElement("details", null,
|
|
18
|
-
React.createElement(rebass_1.Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '',
|
|
19
|
-
|
|
20
|
-
fontWeight: 'bold',
|
|
21
|
-
cursor: systemStatus.statusFurtherInformation ? 'pointer' : 'auto',
|
|
22
|
-
}, className: "ab-DashboardToolbar__SystemStatus__text", marginRight: 2, padding: 2, color: 'text-on-secondary', backgroundColor: messageTypeColor, fontSize: 'var( --ab-font-size-2)', alignItems: "center", as: "summary" },
|
|
19
|
+
React.createElement(rebass_1.Flex, { title: systemStatus.statusFurtherInformation ? 'Click to see more' : '', className: (0, join_1.default)('ab-DashboardToolbar__SystemStatus__text', systemStatus.statusFurtherInformation &&
|
|
20
|
+
'ab-DashboardToolbar__SystemStatus__text--expandable'), backgroundColor: messageTypeColor, alignItems: "center", as: "summary" },
|
|
23
21
|
systemStatus.statusMessage,
|
|
24
22
|
" ",
|
|
25
23
|
systemStatus.statusFurtherInformation ? '...' : ''),
|
|
26
|
-
systemStatus.statusFurtherInformation ? (React.createElement(rebass_1.Box, {
|
|
24
|
+
systemStatus.statusFurtherInformation ? (React.createElement(rebass_1.Box, { className: "ab-DashboardToolbar__SystemStatus__further-information", margin: 2 }, systemStatus.statusFurtherInformation)) : null)) : null;
|
|
27
25
|
colItems[1].Content = systemStatus.timestamp.toLocaleString();
|
|
28
26
|
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { colItems: colItems });
|
|
29
27
|
}
|
|
@@ -8,5 +8,5 @@ declare class SystemStatusViewPanelComponent extends React.Component<SystemStatu
|
|
|
8
8
|
constructor(props: SystemStatusViewPanelComponentProps);
|
|
9
9
|
render(): JSX.Element;
|
|
10
10
|
}
|
|
11
|
-
export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "
|
|
11
|
+
export declare let SystemStatusViewPanel: import("react-redux").ConnectedComponent<typeof SystemStatusViewPanelComponent, import("react-redux").Omit<React.ClassAttributes<SystemStatusViewPanelComponent> & SystemStatusViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "SystemStatusMessageInfos" | "viewType">>;
|
|
12
12
|
export {};
|
|
@@ -19,7 +19,7 @@ const SharedEntityTypeItemView = (props) => {
|
|
|
19
19
|
React.createElement(rebass_1.Flex, { mb: 2, mt: 2 },
|
|
20
20
|
React.createElement(rebass_1.Flex, { mr: 2, alignItems: "center" },
|
|
21
21
|
React.createElement(Tag_1.Tag, { style: { margin: 0 } }, props.data.Module)),
|
|
22
|
-
isExpanded ? (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
|
|
22
|
+
isExpanded ? (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-collapse-button", onClick: () => setIsExpanded(false), icon: "arrow-up" }, "Collapse")) : (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-epxand-button", onClick: () => setIsExpanded(true), icon: "arrow-down" }, "Expand"))),
|
|
23
23
|
isExpanded && (React.createElement(rebass_1.Box, { as: "ul", padding: 0, className: "ab-Shared-Entity-Shared-Object" },
|
|
24
24
|
React.createElement(AdaptableObjectList_1.AdaptableObjectListItem, { hideControls: true, data: item, module: module })))));
|
|
25
25
|
};
|
|
@@ -10,6 +10,6 @@ const TeamSharingApplyButton = (props) => {
|
|
|
10
10
|
const handleImport = React.useCallback(() => {
|
|
11
11
|
adaptable.api.teamSharingApi.importSharedEntry(props.data);
|
|
12
12
|
}, []);
|
|
13
|
-
return (React.createElement(SimpleButton_1.default, { onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
|
|
13
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": "shared-entity-apply-button", onClick: handleImport, variant: "text", tooltip: "Apply Adaptable Object", icon: "import-export" }));
|
|
14
14
|
};
|
|
15
15
|
exports.TeamSharingApplyButton = TeamSharingApplyButton;
|
|
@@ -38,7 +38,7 @@ class ThemePopupComponent extends React.Component {
|
|
|
38
38
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() },
|
|
39
39
|
React.createElement(FormLayout_1.default, null,
|
|
40
40
|
React.createElement(FormLayout_1.FormRow, { label: "Current Theme:" },
|
|
41
|
-
React.createElement(DropdownButton_1.default, { columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription)))));
|
|
41
|
+
React.createElement(DropdownButton_1.default, { "data-name": "select-theme-dropdown", columns: ['label'], style: { width: '50%', minWidth: 200 }, placeholder: "Select theme", value: this.props.CurrentTheme, items: optionThemes, accessLevel: this.props.accessLevel }, currentThemeDescription)))));
|
|
42
42
|
}
|
|
43
43
|
onChangeTheme(value) {
|
|
44
44
|
this.props.SelectTheme(value);
|
|
@@ -22,7 +22,7 @@ export interface OnePageAdaptableWizardSection<ENTITY> {
|
|
|
22
22
|
isValid?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => true | string;
|
|
23
23
|
isVisible?: (data: ENTITY, api: AdaptableApi, context: OnePageAdaptableWizardContextType<ENTITY>) => boolean;
|
|
24
24
|
render: (data: ENTITY, index: number) => React.ReactNode;
|
|
25
|
-
renderSummary?: (data: ENTITY) => React.ReactNode;
|
|
25
|
+
renderSummary?: (data: ENTITY, api: AdaptableApi) => React.ReactNode;
|
|
26
26
|
}
|
|
27
27
|
export interface OnePageAdaptableWizardProps<ENTITY> {
|
|
28
28
|
moduleInfo: ModuleInfo;
|
|
@@ -76,7 +76,6 @@ const OnePageAdaptableWizard = (props) => {
|
|
|
76
76
|
exports.OnePageAdaptableWizard = OnePageAdaptableWizard;
|
|
77
77
|
const OnePageWizardSummary = () => {
|
|
78
78
|
const { setCurrentSection, sections, data } = (0, OnePageWizards_1.useOnePageWizardContext)();
|
|
79
|
-
const { api } = useOnePageAdaptableWizardContext();
|
|
80
79
|
const renderEdit = (index) => (React.createElement(SimpleButton_1.default, { px: 1, variant: "text", style: {
|
|
81
80
|
textDecoration: 'underline',
|
|
82
81
|
display: 'inline-block',
|
|
@@ -84,7 +83,7 @@ const OnePageWizardSummary = () => {
|
|
|
84
83
|
}, onClick: () => {
|
|
85
84
|
setCurrentSection(index);
|
|
86
85
|
} }, "edit"));
|
|
87
|
-
return (React.createElement(
|
|
86
|
+
return (React.createElement(rebass_1.Box, { className: "ab-OnePageWizardSummary" }, sections
|
|
88
87
|
.map((section, index) => {
|
|
89
88
|
if (section === '-') {
|
|
90
89
|
return null;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ICellRendererComp, ICellRendererParams } from '@ag-grid-community/core';
|
|
2
3
|
import { ActionColumn } from '../AdaptableOptions/ActionOptions';
|
|
3
4
|
interface ActionColumnCellRendererParams extends ICellRendererParams {
|
|
4
5
|
actionColumn?: ActionColumn;
|
|
5
6
|
}
|
|
7
|
+
export declare const ReactActionColumnRenderer: (props: ActionColumnCellRendererParams) => JSX.Element;
|
|
6
8
|
export declare class ActionColumnRenderer implements ICellRendererComp {
|
|
7
9
|
private eGui;
|
|
8
10
|
private eventListener;
|
|
@@ -1,76 +1,108 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ActionColumnRenderer = void 0;
|
|
3
|
+
exports.ActionColumnRenderer = exports.ReactActionColumnRenderer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const SimpleButton_1 = tslib_1.__importDefault(require("../components/SimpleButton"));
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
7
|
const uuid_1 = require("../components/utils/uuid");
|
|
8
|
+
const useRerender_1 = require("../components/utils/useRerender");
|
|
9
|
+
function getActionButtonsAndActionColumn(adaptable, actionColumn, colId) {
|
|
10
|
+
var _a;
|
|
11
|
+
const actionCol = actionColumn
|
|
12
|
+
? actionColumn
|
|
13
|
+
: (_a = adaptable.api.actionApi.getAllActionColumn()) === null || _a === void 0 ? void 0 : _a.find((ac) => ac.columnId == colId);
|
|
14
|
+
if (actionCol && actionCol.actionColumnButton) {
|
|
15
|
+
let actionButtons = Array.isArray(actionCol.actionColumnButton)
|
|
16
|
+
? actionCol.actionColumnButton
|
|
17
|
+
: [actionCol.actionColumnButton];
|
|
18
|
+
if (!actionButtons.length) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
// actionButtons don't have IDs, so we need to generate them to be used later as a react component key
|
|
22
|
+
actionButtons = actionButtons.map((actionButton) => (Object.assign(Object.assign({}, actionButton), { Uuid: (0, uuid_1.createUuid)() })));
|
|
23
|
+
return { actionButtons, actionColumn: actionCol };
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
actionButtons: [],
|
|
27
|
+
actionColumn: actionCol,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const renderActionButtons = (buttons, adaptableApi, context, rerender) => {
|
|
31
|
+
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
if (button.hidden && button.hidden(button, context)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context, {
|
|
37
|
+
height: 15,
|
|
38
|
+
width: 15,
|
|
39
|
+
});
|
|
40
|
+
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
41
|
+
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
42
|
+
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
43
|
+
const handleClick = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = button.onClick) === null || _a === void 0 ? void 0 : _a.call(button, button, context);
|
|
46
|
+
// Timeout to let any updates to be done before re-rendering the component
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
// when called again it triggers a re-render
|
|
49
|
+
// https:reactjs.org/docs/react-dom.html#render
|
|
50
|
+
rerender();
|
|
51
|
+
}, 16);
|
|
52
|
+
};
|
|
53
|
+
const disabled = button.disabled && button.disabled(button, context);
|
|
54
|
+
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
|
|
55
|
+
})));
|
|
56
|
+
};
|
|
57
|
+
const ReactActionColumnRenderer = (props) => {
|
|
58
|
+
const rerender = (0, useRerender_1.useRerender)();
|
|
59
|
+
const adaptable = props.api.__adaptable;
|
|
60
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, props.actionColumn, props.colDef.colId);
|
|
61
|
+
if (!actionColumn || !actionButtons.length) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
if (adaptable.api.gridApi.isGroupRowNode(props.node) && !actionColumn.includeGroupedRows) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(props.node);
|
|
68
|
+
const buttonContext = {
|
|
69
|
+
actionColumn,
|
|
70
|
+
primaryKeyValue: pkValue,
|
|
71
|
+
rowNode: props.node,
|
|
72
|
+
adaptableApi: adaptable.api,
|
|
73
|
+
};
|
|
74
|
+
return (React.createElement("div", { className: "ab-ActionColumn" }, renderActionButtons(actionButtons, adaptable.api, buttonContext, rerender)));
|
|
75
|
+
};
|
|
76
|
+
exports.ReactActionColumnRenderer = ReactActionColumnRenderer;
|
|
8
77
|
class ActionColumnRenderer {
|
|
9
78
|
// gets called once before the renderer is used
|
|
10
79
|
init(params) {
|
|
11
|
-
var _a;
|
|
12
80
|
const adaptable = params.api.__adaptable;
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// actionButtons don't have IDs, so we need to generate them to be used later as a react component key
|
|
25
|
-
actionButtons = actionButtons.map((actionButton) => (Object.assign(Object.assign({}, actionButton), { Uuid: (0, uuid_1.createUuid)() })));
|
|
26
|
-
// create the cell
|
|
27
|
-
this.eGui = document.createElement('div');
|
|
28
|
-
this.eGui.className = 'ab-ActionColumn';
|
|
29
|
-
// if its a group node then only show if set to do so
|
|
30
|
-
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionCol.includeGroupedRows) {
|
|
31
|
-
this.eGui.innerHTML = '';
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
35
|
-
const buttonContext = {
|
|
36
|
-
actionColumn: actionCol,
|
|
37
|
-
primaryKeyValue: pkValue,
|
|
38
|
-
rowNode: params.node,
|
|
39
|
-
adaptableApi: adaptable.api,
|
|
40
|
-
};
|
|
41
|
-
const renderActionButtons = (buttons, adaptableApi, context) => {
|
|
42
|
-
return (React.createElement(React.Fragment, null, buttons.map((button, index) => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
if (button.hidden && button.hidden(button, context)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const buttonIcon = adaptableApi.internalApi.getIconForButton(button, context, {
|
|
48
|
-
height: 15,
|
|
49
|
-
width: 15,
|
|
50
|
-
});
|
|
51
|
-
const buttonStyle = adaptableApi.internalApi.getStyleForButton(button, context);
|
|
52
|
-
const buttonLabel = adaptableApi.internalApi.getLabelForButton(button, context);
|
|
53
|
-
const buttonTooltip = adaptableApi.internalApi.getTooltipForButton(button, context);
|
|
54
|
-
const handleClick = () => {
|
|
55
|
-
button.onClick(button, context);
|
|
56
|
-
// Timeout to let any updates to be done before re-rendering the component
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
// when called again it triggers a re-render
|
|
59
|
-
// https:reactjs.org/docs/react-dom.html#render
|
|
60
|
-
doRender();
|
|
61
|
-
}, 16);
|
|
62
|
-
};
|
|
63
|
-
const disabled = button.disabled && button.disabled(button, context);
|
|
64
|
-
return (React.createElement(SimpleButton_1.default, { key: button.Uuid, "data-name": `action-button-${index + 1}`, variant: (_a = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.variant) !== null && _a !== void 0 ? _a : 'text', disabled: disabled, tooltip: buttonTooltip, icon: buttonIcon, tone: (_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'none', onClick: handleClick, className: buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.className, accessLevel: 'Full' }, buttonLabel));
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
const eGui = this.eGui;
|
|
68
|
-
const doRender = () => {
|
|
69
|
-
this.unmountReactRoot = adaptable.renderReactRoot(renderActionButtons(actionButtons, adaptable.api, buttonContext), eGui);
|
|
70
|
-
};
|
|
71
|
-
this.render = doRender;
|
|
72
|
-
doRender();
|
|
81
|
+
const { actionButtons, actionColumn } = getActionButtonsAndActionColumn(adaptable, params.actionColumn, params.colDef.colId);
|
|
82
|
+
if (!actionColumn || !actionButtons.length) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// create the cell
|
|
86
|
+
this.eGui = document.createElement('div');
|
|
87
|
+
this.eGui.className = 'ab-ActionColumn';
|
|
88
|
+
// if its a group node then only show if set to do so
|
|
89
|
+
if (adaptable.api.gridApi.isGroupRowNode(params.node) && !actionColumn.includeGroupedRows) {
|
|
90
|
+
this.eGui.innerHTML = '';
|
|
91
|
+
return;
|
|
73
92
|
}
|
|
93
|
+
const pkValue = adaptable.getPrimaryKeyValueFromRowNode(params.node);
|
|
94
|
+
const buttonContext = {
|
|
95
|
+
actionColumn,
|
|
96
|
+
primaryKeyValue: pkValue,
|
|
97
|
+
rowNode: params.node,
|
|
98
|
+
adaptableApi: adaptable.api,
|
|
99
|
+
};
|
|
100
|
+
const eGui = this.eGui;
|
|
101
|
+
const doRender = () => {
|
|
102
|
+
this.unmountReactRoot = adaptable.renderReactRoot(renderActionButtons(actionButtons, adaptable.api, buttonContext, doRender), eGui);
|
|
103
|
+
};
|
|
104
|
+
this.render = doRender;
|
|
105
|
+
doRender();
|
|
74
106
|
}
|
|
75
107
|
// defined on init
|
|
76
108
|
// used to re-render in refresh
|