@adaptabletools/adaptable 15.3.2 → 15.3.3-canary.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 +57 -2
- package/base.css.map +1 -1
- package/bundle.cjs.js +156 -156
- package/index.css +83 -2
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/ActionOptions.d.ts +6 -1
- package/src/AdaptableOptions/EditOptions.d.ts +35 -6
- package/src/AdaptableOptions/EntitlementOptions.d.ts +3 -2
- package/src/AdaptableOptions/ExportOptions.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +9 -3
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/Api/Implementation/StyledColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/StyledColumnApiImpl.js +12 -0
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +3 -1
- package/src/Api/Internal/StyledColumnInternalApi.js +24 -0
- package/src/Api/StyledColumnApi.d.ts +5 -0
- package/src/PredefinedConfig/Common/AdaptableFormat.d.ts +1 -2
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +5 -5
- package/src/PredefinedConfig/Common/AdaptableStyle.d.ts +8 -0
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/PredefinedConfig/StyledColumnState.d.ts +61 -5
- package/src/Redux/Store/AdaptableReduxMerger.js +1 -1
- package/src/Strategy/BulkUpdateModule.js +1 -1
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +1 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.js +2 -2
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FormatColumnModule.js +42 -3
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +2 -2
- package/src/Strategy/LayoutModule.js +7 -6
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/QuickSearchModule.js +1 -1
- package/src/Strategy/ShortcutModule.js +1 -1
- package/src/Strategy/SmartEditModule.js +1 -1
- package/src/Strategy/StateManagementModule.js +1 -1
- package/src/Strategy/StyledColumnModule.d.ts +2 -0
- package/src/Strategy/StyledColumnModule.js +132 -59
- package/src/Strategy/SystemStatusModule.js +1 -1
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -1
- package/src/Utilities/Constants/GeneralConstants.d.ts +2 -0
- package/src/Utilities/Constants/GeneralConstants.js +4 -2
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/Helpers/StyleHelper.js +19 -0
- package/src/Utilities/ObjectFactory.d.ts +3 -1
- package/src/Utilities/ObjectFactory.js +14 -1
- package/src/Utilities/Services/EntitlementService.js +7 -4
- package/src/Utilities/Services/ValidationService.js +13 -2
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +27 -25
- package/src/View/Charting/ShowChartButton.js +1 -1
- package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +1 -1
- package/src/View/Components/Buttons/ButtonClear.js +1 -1
- package/src/View/Components/Buttons/ButtonClose.js +1 -1
- package/src/View/Components/Buttons/ButtonConfigure.js +1 -1
- package/src/View/Components/Buttons/ButtonDelete.js +1 -1
- package/src/View/Components/Buttons/ButtonExpand.js +1 -1
- package/src/View/Components/Buttons/ButtonInvalid.js +1 -1
- package/src/View/Components/Buttons/ButtonLogin.js +1 -1
- package/src/View/Components/Buttons/ButtonPreviewDelete.js +1 -1
- package/src/View/Components/Buttons/ButtonShare.js +1 -1
- package/src/View/Components/FilterForm/QuickFilterForm.js +10 -2
- package/src/View/Components/Forms/AdaptableFormControlTextClear.js +1 -1
- package/src/View/Components/ListBox/ListBoxFilterSortComponent.js +1 -1
- package/src/View/Components/NewScopeComponent.js +2 -2
- package/src/View/Components/Panels/ToolPanelSettingsPanel.js +1 -1
- package/src/View/Components/PredicateEditor/PredicateEditor.d.ts +1 -0
- package/src/View/Components/PredicateEditor/PredicateEditor.js +24 -16
- package/src/View/Components/StyleComponent.d.ts +7 -0
- package/src/View/Components/StyleComponent.js +68 -16
- package/src/View/Components/ValueSelector/index.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +8 -6
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +18 -10
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +4 -3
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +3 -3
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +14 -12
- package/src/View/StateManagement/StateManagementViewPanel.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +7 -0
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +108 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +15 -14
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +44 -21
- package/src/View/StyledColumn/Wizard/StyledColumnWizardColumnSection.js +17 -9
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +29 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +25 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +15 -4
- package/src/View/Theme/ThemeEditor.js +1 -1
- package/src/agGrid/Adaptable.d.ts +6 -0
- package/src/agGrid/Adaptable.js +63 -26
- package/src/agGrid/BadgeRenderer.d.ts +4 -0
- package/src/agGrid/BadgeRenderer.js +59 -0
- package/src/agGrid/PercentBarRenderer.js +37 -17
- package/src/agGrid/agGridHelper.d.ts +1 -0
- package/src/agGrid/agGridHelper.js +4 -0
- package/src/agGrid/editors/AdaptableNumberEditor/InternalAdaptableNumberEditor.js +1 -1
- package/src/components/Badge/index.d.ts +8 -0
- package/src/components/Badge/index.js +18 -0
- package/src/components/Dashboard/DashboardToolbar.js +2 -2
- package/src/components/Datepicker/index.js +1 -1
- package/src/components/DragAndDropContext/TabList.js +1 -1
- package/src/components/Dropdown/index.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/FileDroppable/index.js +1 -1
- package/src/components/IconSelector/IconSelector.d.ts +7 -0
- package/src/components/IconSelector/IconSelector.js +42 -0
- package/src/components/IconSelector/index.d.ts +1 -0
- package/src/components/IconSelector/index.js +4 -0
- package/src/components/OverlayTrigger/index.js +1 -0
- package/src/components/Toggle/Toggle.d.ts +8 -0
- package/src/components/Toggle/Toggle.js +15 -0
- package/src/components/Toggle/ToggleGroup.d.ts +2 -0
- package/src/components/Toggle/ToggleGroup.js +10 -0
- package/src/components/Toggle/index.d.ts +2 -0
- package/src/components/Toggle/index.js +5 -0
- package/src/components/icons/DefaultIcon.js +1 -1
- package/src/components/icons/align-center.js +7 -0
- package/src/components/icons/align-left.d.ts +3 -0
- package/src/components/icons/align-left.js +7 -0
- package/src/components/icons/align-right.d.ts +3 -0
- package/src/components/icons/align-right.js +7 -0
- package/src/components/icons/badge.d.ts +3 -0
- package/src/components/icons/badge.js +7 -0
- package/src/components/icons/bold.d.ts +3 -0
- package/src/components/icons/bold.js +7 -0
- package/src/components/icons/case-lower.d.ts +3 -0
- package/src/components/icons/case-lower.js +7 -0
- package/src/components/icons/case-sentence.d.ts +3 -0
- package/src/components/icons/case-sentence.js +8 -0
- package/src/components/icons/case-upper.d.ts +3 -0
- package/src/components/icons/case-upper.js +7 -0
- package/src/components/icons/gradient.d.ts +3 -0
- package/src/components/icons/gradient.js +7 -0
- package/src/components/icons/index.js +76 -72
- package/src/components/icons/italic.d.ts +3 -0
- package/src/components/icons/{clear.js → italic.js} +2 -2
- package/src/components/icons/overline.d.ts +3 -0
- package/src/components/icons/overline.js +7 -0
- package/src/components/icons/strikethrough.d.ts +3 -0
- package/src/components/icons/strikethrough.js +7 -0
- package/src/components/icons/underline.d.ts +3 -0
- package/src/components/icons/underline.js +7 -0
- package/src/metamodel/adaptable.metamodel.d.ts +86 -6
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- /package/src/components/icons/{clear.d.ts → align-center.d.ts} +0 -0
|
@@ -4,7 +4,6 @@ exports.ShortcutSettingsWizard = exports.ShortcutSettingsSummary = exports.isSet
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
8
7
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
9
8
|
const shortcutOperations_1 = require("../shortcutOperations");
|
|
10
9
|
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
@@ -13,6 +12,7 @@ const Tabs_1 = require("../../../components/Tabs");
|
|
|
13
12
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
14
13
|
const OnePageAdaptableWizard_2 = require("../../../View/Wizard/OnePageAdaptableWizard");
|
|
15
14
|
const Tag_1 = require("../../../components/Tag");
|
|
15
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
16
16
|
const isSettingsValid = (data) => {
|
|
17
17
|
const shortcutKey = data.ShortcutKey && typeof data.ShortcutKey === 'string' ? '' : 'Shortcut key is not selected';
|
|
18
18
|
const shortcutValue = typeof data.ShortcutValue === 'number' ? '' : 'Shortcut value is not specified';
|
|
@@ -62,22 +62,24 @@ const ShortcutSettingsWizard = (props) => {
|
|
|
62
62
|
React.createElement(Tabs_1.Tabs, { autoFocus: false },
|
|
63
63
|
React.createElement(Tabs_1.Tabs.Tab, null, "Shortcut Settings"),
|
|
64
64
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
65
|
-
React.createElement(FormLayout_1.default, { width:
|
|
65
|
+
React.createElement(FormLayout_1.default, { width: 800 },
|
|
66
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
67
|
+
' ',
|
|
68
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 0 }, "Keyboard key that, when pressed, triggers the shortcut")),
|
|
66
69
|
React.createElement(FormLayout_1.FormRow, { label: "Key" },
|
|
67
70
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
68
|
-
React.createElement(DropdownButton_1.default, { "data-name": "shortcut-key", style: { flex: 1 }, marginRight: 3, items: optionKeys, columns: ['label'] }, shortcut.ShortcutKey || 'Select Key'),
|
|
69
|
-
|
|
71
|
+
React.createElement(DropdownButton_1.default, { "data-name": "shortcut-key", style: { flex: 1 }, marginRight: 3, items: optionKeys, columns: ['label'] }, shortcut.ShortcutKey || 'Select Key'))),
|
|
72
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
73
|
+
' ',
|
|
74
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 0 }, "Mathematical operation performed on Cell's current value (using the Shortcut's 'value') - used to calculate the Cell's new total")),
|
|
70
75
|
React.createElement(FormLayout_1.FormRow, { label: "Operation" },
|
|
71
76
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
72
|
-
React.createElement(DropdownButton_1.default, { "data-name": "shortcut-operation", style: { flex: 1 }, marginRight: 3, items: optionActions, columns: ['label'] }, shortcut.ShortcutOperation || 'Select Operation'),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
React.createElement(DropdownButton_1.default, { "data-name": "shortcut-operation", style: { flex: 1 }, marginRight: 3, items: optionActions, columns: ['label'] }, shortcut.ShortcutOperation || 'Select Operation'))),
|
|
78
|
+
React.createElement(FormLayout_1.FormRow, null,
|
|
79
|
+
' ',
|
|
80
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 0 }, "Number that is used - together with the 'Operation' and the current cell value - to calculate the new total for the cell")),
|
|
76
81
|
React.createElement(FormLayout_1.FormRow, { label: "Value" },
|
|
77
82
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
78
|
-
React.createElement(Input_1.default, { "data-name": "shortcut-value", flex: 1, marginRight: 3, onChange: handleOperationValueChange, placeholder: "Enter Number", type: "number", value: (_a = shortcut.ShortcutValue) !== null && _a !== void 0 ? _a : '' })
|
|
79
|
-
React.createElement(AdaptablePopover_1.AdaptablePopover, { headerText: 'Shortcut: Value', bodyText: [
|
|
80
|
-
"The number that is used - together with the shortcut's mathematical 'operation' and the current cell value - in order to calculate the new total for the cell.",
|
|
81
|
-
] }))))))));
|
|
83
|
+
React.createElement(Input_1.default, { "data-name": "shortcut-value", flex: 1, marginRight: 3, onChange: handleOperationValueChange, placeholder: "Enter Number", type: "number", value: (_a = shortcut.ShortcutValue) !== null && _a !== void 0 ? _a : '' }))))))));
|
|
82
84
|
};
|
|
83
85
|
exports.ShortcutSettingsWizard = ShortcutSettingsWizard;
|
|
@@ -15,7 +15,7 @@ const StateManagementViewPanel = (props) => {
|
|
|
15
15
|
return (React.createElement(rebass_1.Flex, { flexDirection: isToolbar ? 'row' : 'column', className: (0, join_1.default)(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__StateManagement__wrap`) },
|
|
16
16
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
17
17
|
React.createElement(LoadButton_1.LoadButton, { tooltip: "Load Predefined Config", variant: "text", icon: "upload", onLoad: (json) => props.api.configApi.reloadPredefinedConfig(json), accessLevel: props.accessLevel }, !isToolbar && 'Load'),
|
|
18
|
-
React.createElement(ClearButton_1.ClearButton, { icon: "
|
|
18
|
+
React.createElement(ClearButton_1.ClearButton, { icon: "delete", tooltip: "Clear User State", variant: "text", onClick: () => props.api.configApi.reloadPredefinedConfig(), accessLevel: props.accessLevel }, !isToolbar && 'Clear')),
|
|
19
19
|
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "adaptableState" }, "All State"),
|
|
20
20
|
React.createElement(ExportDropdown_1.ExportDropdown, { api: props.api, type: "predefinedConfig" }, "Predefined Config")));
|
|
21
21
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyledColumn } from '../../../types';
|
|
3
|
+
export declare const renderBadgeSummary: (styledColumn: StyledColumn) => JSX.Element;
|
|
4
|
+
export interface StyledColumnBadgeSectionProps {
|
|
5
|
+
onChange: (data: StyledColumn) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const StyledColumnBadgeSection: React.FunctionComponent<StyledColumnBadgeSectionProps>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnBadgeSection = exports.renderBadgeSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const AdaptableIconComponent_1 = require("../../../components/AdaptableIconComponent");
|
|
8
|
+
const Badge_1 = require("../../../components/Badge");
|
|
9
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
10
|
+
const ErrorBox_1 = tslib_1.__importDefault(require("../../../components/ErrorBox"));
|
|
11
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
12
|
+
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
13
|
+
const IconSelector_1 = require("../../../components/IconSelector");
|
|
14
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
15
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
16
|
+
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
17
|
+
const AdaptablePopover_1 = require("../../AdaptablePopover");
|
|
18
|
+
const PredicateEditor_1 = require("../../Components/PredicateEditor/PredicateEditor");
|
|
19
|
+
const StyleComponent_1 = require("../../Components/StyleComponent");
|
|
20
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
21
|
+
const StyledColumnBadgePreview_1 = require("./StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview");
|
|
22
|
+
const BadgeEditor = (props) => {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
25
|
+
const { badge, columnId, onChange } = props;
|
|
26
|
+
const predicateDefs = api.styledColumnApi.getBadgePredicateDefsForColumn(columnId);
|
|
27
|
+
let previewValue = 'Hello world';
|
|
28
|
+
if (api.columnApi.getColumnDataTypeForColumnId(columnId) === 'Number') {
|
|
29
|
+
previewValue = '12345';
|
|
30
|
+
}
|
|
31
|
+
return (React.createElement(rebass_1.Flex, { className: "ab-Badge-Definition-Editor", mb: 15, p: 3 },
|
|
32
|
+
React.createElement(rebass_1.Box, { flex: 1 },
|
|
33
|
+
React.createElement(FormLayout_1.default, null,
|
|
34
|
+
React.createElement(FormLayout_1.FormRow, { label: "Preview" },
|
|
35
|
+
React.createElement(Badge_1.Badge, { adaptableStyle: badge.Style, icon: badge.Icon, iconPosition: badge.IconPosition }, previewValue)),
|
|
36
|
+
React.createElement(FormLayout_1.FormRow, { label: "Style" },
|
|
37
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Select the Style for the Badge"),
|
|
38
|
+
' ',
|
|
39
|
+
React.createElement(AdaptablePopover_1.AdaptablePopover, { showEvent: "mouseenter", hideEvent: "mouseleave", showIcon: false, useButton: false, popoverMaxWidth: 700, bodyText: [
|
|
40
|
+
React.createElement(StyleComponent_1.StyleComponent, { showFontSizeAs: "radio", headless: true, hidePreview: true, api: api, Style: (_a = badge.Style) !== null && _a !== void 0 ? _a : {}, UpdateStyle: (Style) => {
|
|
41
|
+
onChange(Object.assign(Object.assign({}, badge), { Style }));
|
|
42
|
+
} }),
|
|
43
|
+
] },
|
|
44
|
+
React.createElement(SimpleButton_1.default, { variant: "raised" }, "Edit Badge Style"))),
|
|
45
|
+
React.createElement(FormLayout_1.FormRow, { label: 'Predicate' }, columnId ? (React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Create (optional) Rule for when the Badge is displayed; if no Rule provided Badge will always display (unless overriden by another Rule)"),
|
|
47
|
+
React.createElement(PredicateEditor_1.PredicateEditor, { columnId: columnId, predicate: badge.Predicate, predicateDefs: predicateDefs, placeholder: "No Predicate Selected", onChange: (predicate) => {
|
|
48
|
+
onChange(Object.assign(Object.assign({}, badge), { Predicate: predicate }));
|
|
49
|
+
}, onClear: () => onChange(Object.assign(Object.assign({}, badge), { Predicate: undefined })) }))) : (React.createElement(ErrorBox_1.default, null, "Select a column first"))),
|
|
50
|
+
React.createElement(FormLayout_1.FormRow, { label: "Icon" },
|
|
51
|
+
React.createElement(HelpBlock_1.default, { fontSize: 2, mb: 1, mt: 2 }, "Select (optional) Icon (and Icon position) to display in the Badge"),
|
|
52
|
+
' ',
|
|
53
|
+
// for now, only show for system icons the
|
|
54
|
+
!badge.Icon || 'name' in badge.Icon ? (React.createElement(IconSelector_1.IconSelector, { value: (badge === null || badge === void 0 ? void 0 : badge.Icon) && 'name' in (badge === null || badge === void 0 ? void 0 : badge.Icon) ? badge.Icon.name : undefined, onChange: (iconName) => {
|
|
55
|
+
if (iconName) {
|
|
56
|
+
onChange(Object.assign(Object.assign({}, badge), { Icon: {
|
|
57
|
+
name: iconName,
|
|
58
|
+
} }));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
onChange(Object.assign(Object.assign({}, badge), { Icon: undefined }));
|
|
62
|
+
}
|
|
63
|
+
} })) : (React.createElement(AdaptableIconComponent_1.AdaptableIconComponent, { icon: badge.Icon }))),
|
|
64
|
+
badge.Icon && (React.createElement(FormLayout_1.FormRow, { label: "Icon Position" },
|
|
65
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: [
|
|
66
|
+
{
|
|
67
|
+
label: 'Start',
|
|
68
|
+
onClick: () => onChange(Object.assign(Object.assign({}, badge), { IconPosition: 'Start' })),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'End',
|
|
72
|
+
onClick: () => onChange(Object.assign(Object.assign({}, badge), { IconPosition: 'End' })),
|
|
73
|
+
},
|
|
74
|
+
] }, (_b = badge.IconPosition) !== null && _b !== void 0 ? _b : 'Start'))))),
|
|
75
|
+
React.createElement(rebass_1.Box, { justifyContent: "end" },
|
|
76
|
+
React.createElement(SimpleButton_1.default, { icon: "delete", onClick: props.onDelete }))));
|
|
77
|
+
};
|
|
78
|
+
const renderBadgeSummary = (styledColumn) => {
|
|
79
|
+
return React.createElement(StyledColumnBadgePreview_1.StyledColumnBadgePreview, { data: styledColumn });
|
|
80
|
+
};
|
|
81
|
+
exports.renderBadgeSummary = renderBadgeSummary;
|
|
82
|
+
const StyledColumnBadgeSection = (props) => {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
85
|
+
const badges = (_b = (_a = data === null || data === void 0 ? void 0 : data.BadgeStyle) === null || _a === void 0 ? void 0 : _a.Badges) !== null && _b !== void 0 ? _b : [];
|
|
86
|
+
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' } },
|
|
87
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Badges"),
|
|
88
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
89
|
+
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
90
|
+
React.createElement(SimpleButton_1.default, { icon: "plus", onClick: () => {
|
|
91
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: {
|
|
92
|
+
Badges: [...badges, ObjectFactory_1.default.CreateDefaultStyledColumnBadge()],
|
|
93
|
+
} }));
|
|
94
|
+
} }, "Add Badge")),
|
|
95
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column", p: 2 }, badges.map((badge, index) => {
|
|
96
|
+
const handleEditBadge = (badge) => {
|
|
97
|
+
const newBadges = [...badges];
|
|
98
|
+
newBadges[index] = badge;
|
|
99
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { Badges: newBadges }) }));
|
|
100
|
+
};
|
|
101
|
+
return (React.createElement(BadgeEditor, { key: index, badge: badge, columnId: data.ColumnId, onChange: handleEditBadge, onDelete: () => {
|
|
102
|
+
const newBadges = [...badges];
|
|
103
|
+
newBadges.splice(index, 1);
|
|
104
|
+
props.onChange(Object.assign(Object.assign({}, data), { BadgeStyle: Object.assign(Object.assign({}, data.BadgeStyle), { Badges: newBadges }) }));
|
|
105
|
+
} }));
|
|
106
|
+
})))));
|
|
107
|
+
};
|
|
108
|
+
exports.StyledColumnBadgeSection = StyledColumnBadgeSection;
|
|
@@ -14,6 +14,7 @@ const Tag_1 = require("../../../components/Tag");
|
|
|
14
14
|
const ObjectExtensions_1 = require("../../../Utilities/Extensions/ObjectExtensions");
|
|
15
15
|
const StringExtensions_1 = require("../../../Utilities/Extensions/StringExtensions");
|
|
16
16
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
17
|
+
const UIHelper_1 = require("../../UIHelper");
|
|
17
18
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
18
19
|
const CommonProperties = (props) => {
|
|
19
20
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
@@ -54,7 +55,7 @@ const CommonProperties = (props) => {
|
|
|
54
55
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
55
56
|
React.createElement(FormLayout_1.default, null,
|
|
56
57
|
React.createElement(FormLayout_1.FormRow, { label: "Axis Type" },
|
|
57
|
-
React.createElement(DropdownButton_1.default, { columns: ['label'], items: axisTypeOptions }, (_k = (_j = axisTypeOptions.find((option) => { var _a, _b, _c; return option.value === ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.SparkLineStyle) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.axis) === null || _c === void 0 ? void 0 : _c.type); })) === null || _j === void 0 ? void 0 : _j.label) !== null && _k !== void 0 ? _k : 'Select Type')),
|
|
58
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: axisTypeOptions }, (_k = (_j = axisTypeOptions.find((option) => { var _a, _b, _c; return option.value === ((_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.SparkLineStyle) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.axis) === null || _c === void 0 ? void 0 : _c.type); })) === null || _j === void 0 ? void 0 : _j.label) !== null && _k !== void 0 ? _k : 'Select Axis Type')),
|
|
58
59
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Color" },
|
|
59
60
|
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_p = (_o = (_m = (_l = data.SparkLineStyle) === null || _l === void 0 ? void 0 : _l.options) === null || _m === void 0 ? void 0 : _m.axis) === null || _o === void 0 ? void 0 : _o.stroke) !== null && _p !== void 0 ? _p : '#fff', onChange: (color) => props.onOptionChange(['axis', 'stroke'], color) })),
|
|
60
61
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
@@ -64,9 +65,9 @@ const CommonProperties = (props) => {
|
|
|
64
65
|
React.createElement(FormLayout_1.FormRow, { label: "Size" },
|
|
65
66
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_w = (_v = (_u = data.SparkLineStyle) === null || _u === void 0 ? void 0 : _u.options) === null || _v === void 0 ? void 0 : _v.highlightStyle) === null || _w === void 0 ? void 0 : _w.size, onChange: (event) => props.onOptionChange(['highlightStyle', 'size'], parseFloat(event.target.value)) })),
|
|
66
67
|
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
67
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_0 = (_z = (_y = (_x = data.SparkLineStyle) === null || _x === void 0 ? void 0 : _x.options) === null || _y === void 0 ? void 0 : _y.highlightStyle) === null || _z === void 0 ? void 0 : _z.fill) !== null && _0 !== void 0 ? _0 :
|
|
68
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_0 = (_z = (_y = (_x = data.SparkLineStyle) === null || _x === void 0 ? void 0 : _x.options) === null || _y === void 0 ? void 0 : _y.highlightStyle) === null || _z === void 0 ? void 0 : _z.fill) !== null && _0 !== void 0 ? _0 : UIHelper_1.YELLOW, onChange: (color) => props.onOptionChange(['highlightStyle', 'fill'], color) })),
|
|
68
69
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
69
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_4 = (_3 = (_2 = (_1 = data.SparkLineStyle) === null || _1 === void 0 ? void 0 : _1.options) === null || _2 === void 0 ? void 0 : _2.highlightStyle) === null || _3 === void 0 ? void 0 : _3.stroke) !== null && _4 !== void 0 ? _4 :
|
|
70
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_4 = (_3 = (_2 = (_1 = data.SparkLineStyle) === null || _1 === void 0 ? void 0 : _1.options) === null || _2 === void 0 ? void 0 : _2.highlightStyle) === null || _3 === void 0 ? void 0 : _3.stroke) !== null && _4 !== void 0 ? _4 : UIHelper_1.LIGHT_GRAY, onChange: (color) => props.onOptionChange(['highlightStyle', 'stroke'], color) })),
|
|
70
71
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
71
72
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_7 = (_6 = (_5 = data.SparkLineStyle) === null || _5 === void 0 ? void 0 : _5.options) === null || _6 === void 0 ? void 0 : _6.highlightStyle) === null || _7 === void 0 ? void 0 : _7.strokeWidth, onChange: (event) => props.onOptionChange(['highlightStyle', 'strokeWidth'], parseFloat(event.target.value)) }))))));
|
|
72
73
|
};
|
|
@@ -80,9 +81,9 @@ const SparklineMarkerProperties = (props) => {
|
|
|
80
81
|
React.createElement(FormLayout_1.FormRow, { label: "Size" },
|
|
81
82
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_d = (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 0, onChange: (event) => props.onOptionChange(['marker', 'size'], parseFloat(event.target.value)) })),
|
|
82
83
|
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
83
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f :
|
|
84
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _e === void 0 ? void 0 : _e.fill) !== null && _f !== void 0 ? _f : UIHelper_1.LIGHT_BLUE, onChange: (color) => props.onOptionChange(['marker', 'fill'], color) })),
|
|
84
85
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
85
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_h = (_g = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _g === void 0 ? void 0 : _g.stroke) !== null && _h !== void 0 ? _h :
|
|
86
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_h = (_g = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _g === void 0 ? void 0 : _g.stroke) !== null && _h !== void 0 ? _h : UIHelper_1.LIGHT_BLUE, onChange: (color) => props.onOptionChange(['marker', 'stroke'], color) })),
|
|
86
87
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
87
88
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_k = (_j = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.marker) === null || _j === void 0 ? void 0 : _j.strokeWidth) !== null && _k !== void 0 ? _k : 1, onChange: (event) => props.onOptionChange(['marker', 'strokeWidth'], parseFloat(event.target.value)) }))));
|
|
88
89
|
};
|
|
@@ -92,7 +93,7 @@ const SparklineLineProperties = (props) => {
|
|
|
92
93
|
const sparklineOptions = data.SparkLineStyle.options;
|
|
93
94
|
return (React.createElement(FormLayout_1.default, null,
|
|
94
95
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
95
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.line) === null || _a === void 0 ? void 0 : _a.stroke) !== null && _b !== void 0 ? _b :
|
|
96
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.line) === null || _a === void 0 ? void 0 : _a.stroke) !== null && _b !== void 0 ? _b : UIHelper_1.LIGHT_BLUE, onChange: (color) => props.onOptionChange(['line', 'stroke'], color) })),
|
|
96
97
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
97
98
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.line) === null || _c === void 0 ? void 0 : _c.strokeWidth, onChange: (event) => props.onOptionChange(['line', 'strokeWidth'], parseFloat(event.target.value)) }))));
|
|
98
99
|
};
|
|
@@ -134,7 +135,7 @@ const CrossHairsProperties = (props) => {
|
|
|
134
135
|
React.createElement(FormLayout_1.FormRow, { label: "Show" },
|
|
135
136
|
React.createElement(CheckBox_1.CheckBox, { checked: (_c = (_b = (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : true, onChange: (checked) => props.onOptionChange(['crosshairs', key, 'enabled'], checked) })),
|
|
136
137
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
137
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = (_d = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _d === void 0 ? void 0 : _d[key]) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f :
|
|
138
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_f = (_e = (_d = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _d === void 0 ? void 0 : _d[key]) === null || _e === void 0 ? void 0 : _e.stroke) !== null && _f !== void 0 ? _f : UIHelper_1.BLACK, onChange: (color) => props.onOptionChange(['crosshairs', key, 'stroke'], color) })),
|
|
138
139
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
139
140
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_j = (_h = (_g = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.crosshairs) === null || _g === void 0 ? void 0 : _g[key]) === null || _h === void 0 ? void 0 : _h.strokeWidth) !== null && _j !== void 0 ? _j : 1, onChange: (event) => props.onOptionChange(['crosshairs', key, 'strokeWidth'], event.target.value) })),
|
|
140
141
|
React.createElement(FormLayout_1.FormRow, { label: "Line Dash" },
|
|
@@ -162,7 +163,7 @@ const TypeAreaProperties = (props) => {
|
|
|
162
163
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
163
164
|
React.createElement(FormLayout_1.default, null,
|
|
164
165
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
165
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a :
|
|
166
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a : UIHelper_1.LIGHT_BLUE, onChange: (color) => props.onOptionChange(['fill'], color) })))),
|
|
166
167
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
167
168
|
React.createElement(SparklineLineProperties, { onOptionChange: props.onOptionChange })),
|
|
168
169
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -191,9 +192,9 @@ const TypeColumnBarProperties = (props) => {
|
|
|
191
192
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
192
193
|
React.createElement(FormLayout_1.default, null,
|
|
193
194
|
React.createElement(FormLayout_1.FormRow, { label: "Fill" },
|
|
194
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a :
|
|
195
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_a = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.fill) !== null && _a !== void 0 ? _a : UIHelper_1.LIGHT_BLUE, onChange: (color) => props.onOptionChange(['fill'], color) })),
|
|
195
196
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke" },
|
|
196
|
-
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.stroke) !== null && _b !== void 0 ? _b :
|
|
197
|
+
React.createElement(ColorPicker_1.ColorPicker, { api: api, value: (_b = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.stroke) !== null && _b !== void 0 ? _b : UIHelper_1.LIGHT_GRAY, onChange: (color) => props.onOptionChange(['stroke'], color) })),
|
|
197
198
|
React.createElement(FormLayout_1.FormRow, { label: "Stroke Width" },
|
|
198
199
|
React.createElement(AdaptableInput_1.default, { type: "number", value: (_c = sparklineOptions === null || sparklineOptions === void 0 ? void 0 : sparklineOptions.strokeWidth) !== null && _c !== void 0 ? _c : 1, onChange: (event) => props.onOptionChange(['strokeWidth'], event.target.value) })),
|
|
199
200
|
React.createElement(FormLayout_1.FormRow, { label: "Padding Inner" },
|
|
@@ -232,9 +233,9 @@ const SparklineObjectNumberArrayProperties = (props) => {
|
|
|
232
233
|
}, [data]);
|
|
233
234
|
return (React.createElement(React.Fragment, null,
|
|
234
235
|
React.createElement(FormLayout_1.FormRow, { label: "X Key" },
|
|
235
|
-
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['xKey'], event.target.value), value: (_a = sparkLineOptions.xKey) !== null && _a !== void 0 ? _a : 'x' })),
|
|
236
|
+
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['xKey'], event.target.value), value: (_a = sparkLineOptions === null || sparkLineOptions === void 0 ? void 0 : sparkLineOptions.xKey) !== null && _a !== void 0 ? _a : 'x' })),
|
|
236
237
|
React.createElement(FormLayout_1.FormRow, { label: "Y Key" },
|
|
237
|
-
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['yKey'], event.target.value), value: (_b = sparkLineOptions.yKey) !== null && _b !== void 0 ? _b : 'y' })),
|
|
238
|
+
React.createElement(Input_1.default, { onChange: (event) => props.onOptionChange(['yKey'], event.target.value), value: (_b = sparkLineOptions === null || sparkLineOptions === void 0 ? void 0 : sparkLineOptions.yKey) !== null && _b !== void 0 ? _b : 'y' })),
|
|
238
239
|
sparklineDataItem && (React.createElement(FormLayout_1.FormRow, { label: "Preview" },
|
|
239
240
|
React.createElement(Tag_1.Tag, null, sparklineDataItem)))));
|
|
240
241
|
};
|
|
@@ -262,8 +263,8 @@ const StyledColumnSparklineSettingsSection = (props) => {
|
|
|
262
263
|
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
263
264
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
264
265
|
React.createElement(FormLayout_1.default, null,
|
|
265
|
-
React.createElement(FormLayout_1.FormRow, { label: "Type" },
|
|
266
|
-
React.createElement(DropdownButton_1.default, { columns: ['label'], items: sparklineTypeOptions }, (_c = (_b = sparklineTypeOptions.find((option) => { var _a; return option.value === ((_a = data.SparkLineStyle.options) === null || _a === void 0 ? void 0 : _a.type); })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : 'Select Type')),
|
|
266
|
+
React.createElement(FormLayout_1.FormRow, { label: "Sparkline Type" },
|
|
267
|
+
React.createElement(DropdownButton_1.default, { columns: ['label'], items: sparklineTypeOptions }, (_c = (_b = sparklineTypeOptions.find((option) => { var _a; return option.value === ((_a = data.SparkLineStyle.options) === null || _a === void 0 ? void 0 : _a.type); })) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : 'Select Sparkline Type')),
|
|
267
268
|
isObjectNumberArray && (React.createElement(SparklineObjectNumberArrayProperties, { onOptionChange: handleOptionChange }))))),
|
|
268
269
|
React.createElement(CommonProperties, { onOptionChange: handleOptionChange }),
|
|
269
270
|
(() => {
|
|
@@ -16,6 +16,7 @@ const Helper_1 = require("../../../Utilities/Helpers/Helper");
|
|
|
16
16
|
const StyledColumnWizardSettingsSection_1 = require("./StyledColumnWizardSettingsSection");
|
|
17
17
|
const StyledColumnSparklineSettingsSection_1 = require("./StyledColumnSparklineSettingsSection");
|
|
18
18
|
const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
|
|
19
|
+
const StyledColumnBadgeSection_1 = require("./StyledColumnBadgeSection");
|
|
19
20
|
const StyledColumnWizard = (props) => {
|
|
20
21
|
var _a, _b, _c, _d, _e, _f;
|
|
21
22
|
const data = (_a = props.data) !== null && _a !== void 0 ? _a : (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.value;
|
|
@@ -40,8 +41,27 @@ const StyledColumnWizard = (props) => {
|
|
|
40
41
|
}
|
|
41
42
|
props.onFinishWizard(styledColumn);
|
|
42
43
|
};
|
|
43
|
-
const
|
|
44
|
-
|
|
44
|
+
const AdditionalSettingSection = {
|
|
45
|
+
details: 'Apply Additional Settings',
|
|
46
|
+
renderSummary: StyledColumnWizardSettingsSection_1.renderStyledColumnWizardSettingsSummary,
|
|
47
|
+
render: () => {
|
|
48
|
+
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
49
|
+
React.createElement(StyledColumnWizardSettingsSection_1.StyledColumnWizardSettingsSection, { onChange: setStyledColumn })));
|
|
50
|
+
},
|
|
51
|
+
title: 'Settings',
|
|
52
|
+
};
|
|
53
|
+
const specificSteps = [];
|
|
54
|
+
if (styledColumn.SparkLineStyle) {
|
|
55
|
+
specificSteps.push({
|
|
56
|
+
title: 'Settings',
|
|
57
|
+
render: () => (React.createElement(rebass_1.Box, { p: 2 },
|
|
58
|
+
React.createElement(StyledColumnSparklineSettingsSection_1.StyledColumnSparklineSettingsSection, { onChange: setStyledColumn }))),
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else if (styledColumn.CheckBoxStyle ||
|
|
62
|
+
styledColumn.GradientStyle ||
|
|
63
|
+
styledColumn.PercentBarStyle) {
|
|
64
|
+
specificSteps.push({
|
|
45
65
|
details: 'Create the Style to apply',
|
|
46
66
|
renderSummary: StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary,
|
|
47
67
|
render: () => {
|
|
@@ -49,31 +69,34 @@ const StyledColumnWizard = (props) => {
|
|
|
49
69
|
React.createElement(StyledColumnWizardStyleSection_1.StyledColumnWizardStyleSection, { onChange: setStyledColumn })));
|
|
50
70
|
},
|
|
51
71
|
title: 'Style',
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
72
|
+
}, AdditionalSettingSection);
|
|
73
|
+
}
|
|
74
|
+
else if (styledColumn.BadgeStyle) {
|
|
75
|
+
specificSteps.push({
|
|
76
|
+
title: 'Badges',
|
|
77
|
+
details: 'Create Badge Styles',
|
|
78
|
+
isValid: () => {
|
|
79
|
+
var _a;
|
|
80
|
+
if (((_a = styledColumn.BadgeStyle.Badges) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
81
|
+
return 'Define at least one Badge';
|
|
82
|
+
}
|
|
83
|
+
if (styledColumn.BadgeStyle.Badges.filter((badge) => !badge.Predicate).length > 1) {
|
|
84
|
+
return 'Only one Badge can have no Predicate';
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
59
87
|
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
];
|
|
63
|
-
const sparklineSteps = [
|
|
64
|
-
{
|
|
65
|
-
title: 'Settings',
|
|
88
|
+
renderSummary: () => (0, StyledColumnBadgeSection_1.renderBadgeSummary)(styledColumn),
|
|
66
89
|
render: () => (React.createElement(rebass_1.Box, { p: 2 },
|
|
67
|
-
React.createElement(
|
|
68
|
-
}
|
|
69
|
-
|
|
90
|
+
React.createElement(StyledColumnBadgeSection_1.StyledColumnBadgeSection, { onChange: setStyledColumn }))),
|
|
91
|
+
});
|
|
92
|
+
specificSteps.push(AdditionalSettingSection);
|
|
93
|
+
}
|
|
70
94
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: styledColumn, onFinish: handleFinish, onHide: props.onCloseWizard, sections: [
|
|
71
95
|
{
|
|
72
96
|
details: 'Select a Styled Column type',
|
|
73
97
|
renderSummary: StyledColumnWizardTypeSection_1.renderStyledColumnTypeSummary,
|
|
74
98
|
render: () => {
|
|
75
|
-
return
|
|
76
|
-
React.createElement(StyledColumnWizardTypeSection_1.StyledColumnWizardTypeSection, { onChange: setStyledColumn })));
|
|
99
|
+
return React.createElement(StyledColumnWizardTypeSection_1.StyledColumnWizardTypeSection, { onChange: setStyledColumn });
|
|
77
100
|
},
|
|
78
101
|
title: 'Type',
|
|
79
102
|
},
|
|
@@ -87,7 +110,7 @@ const StyledColumnWizard = (props) => {
|
|
|
87
110
|
},
|
|
88
111
|
title: 'Column',
|
|
89
112
|
},
|
|
90
|
-
...
|
|
113
|
+
...specificSteps,
|
|
91
114
|
{
|
|
92
115
|
details: 'Select Format Column Tags',
|
|
93
116
|
title: 'Tags',
|
|
@@ -28,15 +28,23 @@ exports.isValidStyledColumnColumn = isValidStyledColumnColumn;
|
|
|
28
28
|
const StyledColumnWizardColumnSection = (props) => {
|
|
29
29
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
30
30
|
const sortableCols = React.useMemo(() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
let sortableColumns = [];
|
|
32
|
+
if (data.CheckBoxStyle) {
|
|
33
|
+
sortableColumns = api.columnApi.getBooleanColumns();
|
|
34
|
+
}
|
|
35
|
+
else if (data.SparkLineStyle) {
|
|
36
|
+
sortableColumns = [
|
|
37
|
+
...api.columnApi.getNumberArrayColumns(),
|
|
38
|
+
...api.columnApi.getTupleNumberArrayColumns(),
|
|
39
|
+
...api.columnApi.getObjectNumberArrayColumns(),
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
else if (data.BadgeStyle) {
|
|
43
|
+
sortableColumns = [...api.columnApi.getNumericColumns(), ...api.columnApi.getStringColumns()];
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
sortableColumns = api.columnApi.getNumericColumns();
|
|
47
|
+
}
|
|
40
48
|
const styledColumns = api.styledColumnApi.getStyledColumns();
|
|
41
49
|
const usedColumnIds = styledColumns
|
|
42
50
|
.map((styledColumn) => {
|
|
@@ -27,7 +27,7 @@ const StyledColumnWizardSettingsSection = (props) => {
|
|
|
27
27
|
props.onChange(Object.assign(Object.assign({}, data), { IncludeGroupedRows }));
|
|
28
28
|
};
|
|
29
29
|
return (React.createElement(Tabs_1.Tabs, null,
|
|
30
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "
|
|
30
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
|
|
31
31
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
32
32
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
33
33
|
React.createElement(FormLayout_1.default, null,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledColumnBadgePreview = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const Badge_1 = require("../../../../../components/Badge");
|
|
8
|
+
const Tag_1 = require("../../../../../components/Tag");
|
|
9
|
+
const AdaptableContext_1 = require("../../../../AdaptableContext");
|
|
10
|
+
const StyledColumnBadgePreview = ({ data }) => {
|
|
11
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
12
|
+
const badgeStyle = data.BadgeStyle;
|
|
13
|
+
if (!badgeStyle || badgeStyle.Badges.length === 0) {
|
|
14
|
+
return React.createElement("div", null, "No Badges Defined");
|
|
15
|
+
}
|
|
16
|
+
let value = 'Hello world';
|
|
17
|
+
if (adaptable.api.columnApi.getColumnDataTypeForColumnId(data.ColumnId) === 'Number') {
|
|
18
|
+
value = '12345';
|
|
19
|
+
}
|
|
20
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column" }, badgeStyle.Badges.map((badge, index) => {
|
|
21
|
+
const predicateStr = badge.Predicate
|
|
22
|
+
? adaptable.api.predicateApi.predicateToString(badge.Predicate)
|
|
23
|
+
: 'No Predicate';
|
|
24
|
+
return (React.createElement(rebass_1.Box, { mb: 1, key: index },
|
|
25
|
+
React.createElement(Badge_1.Badge, { icon: badge.Icon, adaptableStyle: badge.Style, iconPosition: badge.IconPosition }, value),
|
|
26
|
+
React.createElement(Tag_1.Tag, { ml: 2 }, predicateStr)));
|
|
27
|
+
})));
|
|
28
|
+
};
|
|
29
|
+
exports.StyledColumnBadgePreview = StyledColumnBadgePreview;
|
|
@@ -16,6 +16,8 @@ const UIHelper_1 = require("../../../UIHelper");
|
|
|
16
16
|
const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
|
|
17
17
|
const PercentBarColumnComparisonPreview_1 = require("./Components/PercentBarColumnComparisonPreview");
|
|
18
18
|
const PercentBarRangesPreview_1 = require("./Components/PercentBarRangesPreview");
|
|
19
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
|
|
20
|
+
const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/ArrayExtensions"));
|
|
19
21
|
const renderFormatColumnStyleWizardSummary = (data) => {
|
|
20
22
|
const { api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
21
23
|
return (0, exports.renderStyledColumnStyleSummary)(data, api);
|
|
@@ -83,7 +85,7 @@ const renderStyledColumnStyleSummary = (data, api) => {
|
|
|
83
85
|
};
|
|
84
86
|
exports.renderStyledColumnStyleSummary = renderStyledColumnStyleSummary;
|
|
85
87
|
const StyledColumnWizardStyleSection = (props) => {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
87
89
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
88
90
|
const minMaxRangeValues = React.useMemo(() => {
|
|
89
91
|
const columnId = data.ColumnId;
|
|
@@ -157,6 +159,9 @@ const StyledColumnWizardStyleSection = (props) => {
|
|
|
157
159
|
}
|
|
158
160
|
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: percentBarStyle }));
|
|
159
161
|
};
|
|
162
|
+
const handlePercentBarCellTextPositionChange = (percentBarPosition) => {
|
|
163
|
+
props.onChange(Object.assign(Object.assign({}, data), { PercentBarStyle: Object.assign(Object.assign({}, data.PercentBarStyle), { CellTextPosition: percentBarPosition }) }));
|
|
164
|
+
};
|
|
160
165
|
const onPercentBarToolTipTextCellValueChanged = (checked) => {
|
|
161
166
|
let percentBarStyle = data === null || data === void 0 ? void 0 : data.PercentBarStyle;
|
|
162
167
|
if (checked) {
|
|
@@ -247,17 +252,32 @@ const StyledColumnWizardStyleSection = (props) => {
|
|
|
247
252
|
"Percent Value",
|
|
248
253
|
' '),
|
|
249
254
|
' '),
|
|
255
|
+
React.createElement(FormLayout_1.FormRow, { label: "Cell Display Position:" },
|
|
256
|
+
React.createElement(DropdownButton_1.default, { disabled: ArrayExtensions_1.default.IsNullOrEmpty(data.PercentBarStyle.CellText) || disabled, columns: ['label'], items: [
|
|
257
|
+
{
|
|
258
|
+
label: 'Above Bar',
|
|
259
|
+
onClick: () => handlePercentBarCellTextPositionChange('Above'),
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
label: 'Below Bar',
|
|
263
|
+
onClick: () => handlePercentBarCellTextPositionChange('Below'),
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
label: 'Merged',
|
|
267
|
+
onClick: () => handlePercentBarCellTextPositionChange('Merged'),
|
|
268
|
+
},
|
|
269
|
+
] }, (_m = (_l = data.PercentBarStyle) === null || _l === void 0 ? void 0 : _l.CellTextPosition) !== null && _m !== void 0 ? _m : 'Below')),
|
|
250
270
|
React.createElement(FormLayout_1.FormRow, { label: "ToolTip Display:" },
|
|
251
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (
|
|
271
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 2, checked: (_p = (_o = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _o === void 0 ? void 0 : _o.ToolTipText) === null || _p === void 0 ? void 0 : _p.includes('CellValue'), onChange: (checked) => onPercentBarToolTipTextCellValueChanged(checked) }, "Cell Value"),
|
|
252
272
|
' ',
|
|
253
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (
|
|
273
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, marginLeft: 3, checked: (_r = (_q = data === null || data === void 0 ? void 0 : data.PercentBarStyle) === null || _q === void 0 ? void 0 : _q.ToolTipText) === null || _r === void 0 ? void 0 : _r.includes('PercentageValue'), onChange: (checked) => onPercentBarToolTipTextPercentValueChanged(checked) },
|
|
254
274
|
"Percent Value",
|
|
255
275
|
' '),
|
|
256
276
|
' '),
|
|
257
277
|
React.createElement(FormLayout_1.FormRow, { label: `Back ${api.internalApi.getCorrectEnglishVariant('Colour')}` },
|
|
258
278
|
React.createElement(rebass_1.Flex, { alignItems: "center", marginLeft: 2 },
|
|
259
|
-
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, checked: !!((
|
|
260
|
-
((
|
|
279
|
+
React.createElement(CheckBox_1.CheckBox, { disabled: disabled, checked: !!((_s = data.PercentBarStyle) === null || _s === void 0 ? void 0 : _s.BackColor), onChange: (checked) => onUsePercentStyleColorCheckChanged(checked), mr: 2 }),
|
|
280
|
+
((_t = data.PercentBarStyle) === null || _t === void 0 ? void 0 : _t.BackColor) !== undefined && (React.createElement(ColorPicker_1.ColorPicker, { disabled: disabled, api: api, value: (_u = data.PercentBarStyle) === null || _u === void 0 ? void 0 : _u.BackColor, onChange: (x) => onForeColorSelectChange(x) }))))))),
|
|
261
281
|
!data.ColumnId && React.createElement(ErrorBox_1.default, { mt: 2 }, "You need to select a column before styling.")));
|
|
262
282
|
};
|
|
263
283
|
exports.StyledColumnWizardStyleSection = StyledColumnWizardStyleSection;
|
|
@@ -6,6 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const Tabs_1 = require("../../../components/Tabs");
|
|
8
8
|
const Tag_1 = require("../../../components/Tag");
|
|
9
|
+
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
9
10
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
10
11
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
11
12
|
const TypeRadio_1 = require("../../Wizard/TypeRadio");
|
|
@@ -23,6 +24,9 @@ const renderStyledColumnTypeSummary = (data) => {
|
|
|
23
24
|
else if (data.SparkLineStyle) {
|
|
24
25
|
type = 'Spark Line';
|
|
25
26
|
}
|
|
27
|
+
else if (data.BadgeStyle) {
|
|
28
|
+
type = 'Badge';
|
|
29
|
+
}
|
|
26
30
|
return (React.createElement(rebass_1.Text, { pr: 2, py: 2 },
|
|
27
31
|
"Type ",
|
|
28
32
|
React.createElement(Tag_1.Tag, null, type)));
|
|
@@ -37,6 +41,7 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
37
41
|
delete newStyledColumn.PercentBarStyle;
|
|
38
42
|
delete newStyledColumn.CheckBoxStyle;
|
|
39
43
|
delete newStyledColumn.SparkLineStyle;
|
|
44
|
+
delete newStyledColumn.BadgeStyle;
|
|
40
45
|
switch (type) {
|
|
41
46
|
case 'gradient':
|
|
42
47
|
newStyledColumn.GradientStyle = {};
|
|
@@ -54,6 +59,11 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
54
59
|
},
|
|
55
60
|
};
|
|
56
61
|
break;
|
|
62
|
+
case 'badge':
|
|
63
|
+
newStyledColumn.BadgeStyle = {
|
|
64
|
+
Badges: [ObjectFactory_1.default.CreateDefaultStyledColumnBadge()],
|
|
65
|
+
};
|
|
66
|
+
break;
|
|
57
67
|
}
|
|
58
68
|
newStyledColumn.ColumnId = null;
|
|
59
69
|
props.onChange(newStyledColumn);
|
|
@@ -62,9 +72,10 @@ const StyledColumnWizardTypeSection = (props) => {
|
|
|
62
72
|
React.createElement(Tabs_1.Tabs, { autoFocus: false, padding: 2 },
|
|
63
73
|
React.createElement(Tabs_1.Tabs.Tab, null, "Type"),
|
|
64
74
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
65
|
-
React.createElement(TypeRadio_1.TypeRadio, { text: "Gradient
|
|
66
|
-
React.createElement(TypeRadio_1.TypeRadio, { text: "Percent Bar", description: "Display a coloured bar where the width is based on the cell", checked: Boolean(data.PercentBarStyle), onClick: () => handleTypeChange('percent') }),
|
|
67
|
-
React.createElement(TypeRadio_1.TypeRadio, { text: "Check Box", description: "Display a checkbox (
|
|
68
|
-
adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(TypeRadio_1.TypeRadio, { text: "Sparkline", description: "Render the column as a Sparkline", checked: Boolean(data.SparkLineStyle), onClick: () => handleTypeChange('sparkline') }))
|
|
75
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: "Gradient", description: "Colour each cell in the column using a gradient value (Numeric Columns)", checked: Boolean(data.GradientStyle), onClick: () => handleTypeChange('gradient') }),
|
|
76
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: "Percent Bar", description: "Display a coloured bar where the width is based on the cell (Numeric Columns)", checked: Boolean(data.PercentBarStyle), onClick: () => handleTypeChange('percent') }),
|
|
77
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: "Check Box", description: "Display a checkbox (Boolean Columns)", checked: Boolean(data.CheckBoxStyle), onClick: () => handleTypeChange('checkbox') }),
|
|
78
|
+
adaptable.api.styledColumnApi.canDisplaySparklines() && (React.createElement(TypeRadio_1.TypeRadio, { text: "Sparkline", description: "Render the column as a Sparkline (Numeric Array Columns)", checked: Boolean(data.SparkLineStyle), onClick: () => handleTypeChange('sparkline') })),
|
|
79
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: "Badge", description: "Display the column's values as Badges (All Columns)", checked: Boolean(data.BadgeStyle), onClick: () => handleTypeChange('badge') })))));
|
|
69
80
|
};
|
|
70
81
|
exports.StyledColumnWizardTypeSection = StyledColumnWizardTypeSection;
|