@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
|
@@ -9,6 +9,7 @@ const StyledColumnWizard_1 = require("../View/StyledColumn/Wizard/StyledColumnWi
|
|
|
9
9
|
const StyledColumnWizardStyleSection_1 = require("../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection");
|
|
10
10
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../Utilities/ObjectFactory"));
|
|
11
11
|
const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
|
|
12
|
+
const StyledColumnBadgePreview_1 = require("../View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview");
|
|
12
13
|
class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
13
14
|
constructor(api) {
|
|
14
15
|
super(ModuleConstants.StyledColumnModuleId, ModuleConstants.StyledColumnFriendlyName, 'brush', 'StyledColumnPopup', // to change
|
|
@@ -72,71 +73,106 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
72
73
|
}
|
|
73
74
|
addColumnMenuItems(column) {
|
|
74
75
|
let returnColumnMenuItems = [];
|
|
75
|
-
const config = {
|
|
76
|
-
defaultCurrentSectionName: 'Style',
|
|
77
|
-
};
|
|
78
76
|
// Need a Column and an editable Module
|
|
79
77
|
if (column && this.isModuleEditable()) {
|
|
78
|
+
let styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
|
|
80
79
|
// First look at Sparkline Columns - needs to be editable array type
|
|
81
80
|
if (this.api.columnApi.hasArrayDataType(column.columnId) &&
|
|
82
81
|
column.IsReadOnly !== true &&
|
|
83
82
|
this.api.styledColumnApi.canDisplaySparklines()) {
|
|
84
|
-
let styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
|
|
85
83
|
let sparklineColumnExists = column.isSparkline && Boolean(styledColumn);
|
|
86
84
|
if (column.isSparkline && !sparklineColumnExists) {
|
|
87
85
|
// do nothing as we only want to continue if there is no sparkline column or if its in state
|
|
88
86
|
// because if just one then it was created in AG Grid and we dont want to edit it
|
|
89
87
|
}
|
|
90
88
|
else {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
SparkLineStyle: {} });
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
|
|
89
|
+
const hasSparklineStyle = styledColumn != null && styledColumn.SparkLineStyle != null;
|
|
90
|
+
if (!hasSparklineStyle) {
|
|
91
|
+
styledColumn = Object.assign(Object.assign({}, ObjectFactory_1.default.CreateEmptyStyledColumn()), { ColumnId: column.columnId, SparkLineStyle: {} });
|
|
98
92
|
}
|
|
99
|
-
let label =
|
|
93
|
+
let label = hasSparklineStyle ? 'Edit ' : 'Create ';
|
|
100
94
|
let popupParam = {
|
|
101
95
|
action: sparklineColumnExists ? 'Edit' : 'New',
|
|
102
96
|
source: 'ColumnMenu',
|
|
103
97
|
value: styledColumn,
|
|
104
|
-
config
|
|
98
|
+
config: {
|
|
99
|
+
defaultCurrentSectionName: 'Settings',
|
|
100
|
+
},
|
|
105
101
|
};
|
|
106
|
-
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Sparkline Column', this.moduleInfo.Popup, this.
|
|
102
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label + 'Sparkline Column', this.moduleInfo.Popup, this.getGlyphForStyledColumn(styledColumn), popupParam));
|
|
107
103
|
}
|
|
108
104
|
}
|
|
109
105
|
// Next do non sparkline
|
|
110
|
-
if (!column.isSparkline) {
|
|
111
|
-
//
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
106
|
+
else if (!column.isSparkline) {
|
|
107
|
+
// Edit is common
|
|
108
|
+
if (styledColumn) {
|
|
109
|
+
if (!styledColumn.IsReadOnly && !styledColumn.CheckBoxStyle) {
|
|
110
|
+
let defaultCurrentSectionName = undefined;
|
|
111
|
+
if (styledColumn.BadgeStyle) {
|
|
112
|
+
defaultCurrentSectionName = 'Badges';
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
defaultCurrentSectionName = 'Style';
|
|
116
|
+
}
|
|
117
|
+
const popupParam = {
|
|
118
|
+
action: 'Edit',
|
|
119
|
+
source: 'ColumnMenu',
|
|
120
|
+
value: styledColumn,
|
|
121
|
+
config: {
|
|
122
|
+
defaultCurrentSectionName,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
const icon = this.getGlyphForStyledColumn(styledColumn);
|
|
126
|
+
const label = `Edit ${this.getTypeLabel(styledColumn)} Style`;
|
|
127
|
+
returnColumnMenuItems.push(this.createColumnMenuItemShowPopup(label, this.moduleInfo.Popup, icon, popupParam));
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
action: styledColumnExists ? 'Edit' : 'New',
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
const newStyledColumn = Object.assign(Object.assign({}, ObjectFactory_1.default.CreateEmptyStyledColumn()), { ColumnId: column.columnId });
|
|
132
|
+
const popupParam = {
|
|
133
|
+
action: 'New',
|
|
131
134
|
source: 'ColumnMenu',
|
|
132
|
-
value:
|
|
133
|
-
config,
|
|
135
|
+
value: newStyledColumn,
|
|
136
|
+
config: {},
|
|
134
137
|
};
|
|
135
|
-
|
|
138
|
+
const badgeLabel = column.dataType === 'Number' ? 'Badge' : 'Create Badge Style';
|
|
139
|
+
const newBadgeButton = this.createColumnMenuItemShowPopup(badgeLabel, this.moduleInfo.Popup, 'badge', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { BadgeStyle: {
|
|
140
|
+
Badges: [ObjectFactory_1.default.CreateDefaultStyledColumnBadge()],
|
|
141
|
+
} }), config: {
|
|
142
|
+
defaultCurrentSectionName: 'Badges',
|
|
143
|
+
} }));
|
|
144
|
+
switch (column.dataType) {
|
|
145
|
+
// Number
|
|
146
|
+
// Create Styled Column - Gradient | Percent Bar | Badge
|
|
147
|
+
case 'Number':
|
|
148
|
+
const emptyRanges = this.api.scopeApi.createCellColorRangesForScope({
|
|
149
|
+
ColumnIds: [column.columnId],
|
|
150
|
+
});
|
|
151
|
+
const newGrandientButton = this.createColumnMenuItemShowPopup('Gradient', this.moduleInfo.Popup, 'gradient', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { GradientStyle: {
|
|
152
|
+
CellRanges: emptyRanges,
|
|
153
|
+
} }), config: {
|
|
154
|
+
defaultCurrentSectionName: 'Style',
|
|
155
|
+
} }));
|
|
156
|
+
const newPrecentBarButton = this.createColumnMenuItemShowPopup('Percent Bar', this.moduleInfo.Popup, 'percent', Object.assign(Object.assign({}, popupParam), { value: Object.assign(Object.assign({}, newStyledColumn), { PercentBarStyle: {
|
|
157
|
+
CellRanges: emptyRanges,
|
|
158
|
+
} }), config: {
|
|
159
|
+
defaultCurrentSectionName: 'Style',
|
|
160
|
+
} }));
|
|
161
|
+
returnColumnMenuItems.push({
|
|
162
|
+
label: 'Create Styled Column',
|
|
163
|
+
module: this.moduleInfo.ModuleName,
|
|
164
|
+
isVisible: true,
|
|
165
|
+
icon: { name: this.moduleInfo.Glyph },
|
|
166
|
+
subItems: [newGrandientButton, newPrecentBarButton, newBadgeButton],
|
|
167
|
+
});
|
|
168
|
+
break;
|
|
169
|
+
case 'String':
|
|
170
|
+
returnColumnMenuItems.push(newBadgeButton);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
136
173
|
}
|
|
137
174
|
// Then do Checkbox
|
|
138
175
|
if (column.dataType == 'Boolean' && !this.api.columnApi.isFreeTextColumn(column.columnId)) {
|
|
139
|
-
let styledColumn = this.api.styledColumnApi.getStyledColumnForColumnId(column.columnId);
|
|
140
176
|
const hasCheckBox = styledColumn && (styledColumn === null || styledColumn === void 0 ? void 0 : styledColumn.CheckBoxStyle);
|
|
141
177
|
if (hasCheckBox) {
|
|
142
178
|
returnColumnMenuItems.push(this.createColumnMenuItemClickFunction('Remove Checkbox', 'unchecked', () => {
|
|
@@ -154,6 +190,24 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
154
190
|
}
|
|
155
191
|
return returnColumnMenuItems;
|
|
156
192
|
}
|
|
193
|
+
getGlyphForStyledColumn(styledColumn) {
|
|
194
|
+
if (styledColumn.GradientStyle) {
|
|
195
|
+
return 'gradient';
|
|
196
|
+
}
|
|
197
|
+
else if (styledColumn.PercentBarStyle) {
|
|
198
|
+
return 'percent';
|
|
199
|
+
}
|
|
200
|
+
else if (styledColumn.CheckBoxStyle) {
|
|
201
|
+
return 'check-circle';
|
|
202
|
+
}
|
|
203
|
+
else if (styledColumn.SparkLineStyle) {
|
|
204
|
+
return 'spark-line';
|
|
205
|
+
}
|
|
206
|
+
else if (styledColumn.BadgeStyle) {
|
|
207
|
+
return 'badge';
|
|
208
|
+
}
|
|
209
|
+
return this.moduleInfo.Glyph;
|
|
210
|
+
}
|
|
157
211
|
getTeamSharingAction() {
|
|
158
212
|
return {
|
|
159
213
|
ModuleEntities: this.api.styledColumnApi.getStyledColumns(),
|
|
@@ -162,40 +216,40 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
162
216
|
};
|
|
163
217
|
}
|
|
164
218
|
toView(styledColumn) {
|
|
165
|
-
|
|
166
|
-
if (styledColumn.GradientStyle) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
219
|
+
const specificTypeItems = [];
|
|
220
|
+
if (styledColumn.GradientStyle || styledColumn.PercentBarStyle || styledColumn.CheckBoxStyle) {
|
|
221
|
+
specificTypeItems.push({
|
|
222
|
+
name: 'Style',
|
|
223
|
+
view: () => {
|
|
224
|
+
return (0, StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary)(styledColumn, this.api);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
171
227
|
}
|
|
172
|
-
|
|
173
|
-
|
|
228
|
+
if (!styledColumn.BadgeStyle) {
|
|
229
|
+
specificTypeItems.push({
|
|
230
|
+
name: 'Settings',
|
|
231
|
+
values: [`Include grouped rows: ${styledColumn.IncludeGroupedRows ? 'Yes' : 'No'}`],
|
|
232
|
+
});
|
|
174
233
|
}
|
|
175
|
-
|
|
176
|
-
|
|
234
|
+
if (styledColumn.BadgeStyle) {
|
|
235
|
+
specificTypeItems.push({
|
|
236
|
+
name: 'Preview',
|
|
237
|
+
view: StyledColumnBadgePreview_1.StyledColumnBadgePreview,
|
|
238
|
+
});
|
|
177
239
|
}
|
|
178
240
|
return {
|
|
179
241
|
abObject: styledColumn,
|
|
180
242
|
items: [
|
|
181
243
|
{
|
|
182
244
|
name: 'Type',
|
|
183
|
-
values: [
|
|
245
|
+
values: [this.getTypeLabel(styledColumn)],
|
|
184
246
|
},
|
|
185
247
|
{
|
|
186
248
|
name: 'Column',
|
|
187
249
|
values: [this.api.columnApi.getFriendlyNameForColumnId(styledColumn.ColumnId)],
|
|
188
250
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
view: () => {
|
|
192
|
-
return (0, StyledColumnWizardStyleSection_1.renderStyledColumnStyleSummary)(styledColumn, this.api);
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: 'Settings',
|
|
197
|
-
values: [`Include grouped rows: ${styledColumn.IncludeGroupedRows ? 'Yes' : 'No'}`],
|
|
198
|
-
},
|
|
251
|
+
...specificTypeItems,
|
|
252
|
+
,
|
|
199
253
|
(0, getObjectTagsViewItems_1.getObjectTagsViewItems)(styledColumn, this.api),
|
|
200
254
|
].filter(Boolean),
|
|
201
255
|
};
|
|
@@ -221,5 +275,24 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
221
275
|
canBeAssociatedWithLayouts() {
|
|
222
276
|
return true;
|
|
223
277
|
}
|
|
278
|
+
getTypeLabel(styledColumn) {
|
|
279
|
+
let type = null;
|
|
280
|
+
if (styledColumn.GradientStyle) {
|
|
281
|
+
type = 'Gradient';
|
|
282
|
+
}
|
|
283
|
+
else if (styledColumn.PercentBarStyle) {
|
|
284
|
+
type = 'Percent Bar';
|
|
285
|
+
}
|
|
286
|
+
else if (styledColumn.CheckBoxStyle) {
|
|
287
|
+
type = 'Check Box';
|
|
288
|
+
}
|
|
289
|
+
else if (styledColumn.SparkLineStyle) {
|
|
290
|
+
type = 'Spark Line';
|
|
291
|
+
}
|
|
292
|
+
else if (styledColumn.BadgeStyle) {
|
|
293
|
+
type = 'Badge';
|
|
294
|
+
}
|
|
295
|
+
return type;
|
|
296
|
+
}
|
|
224
297
|
}
|
|
225
298
|
exports.StyledColumnModule = StyledColumnModule;
|
|
@@ -7,7 +7,7 @@ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/Mod
|
|
|
7
7
|
const SystemStatusStatusBarContent_1 = require("../View/SystemStatus/SystemStatusStatusBarContent");
|
|
8
8
|
class SystemStatusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
9
9
|
constructor(api) {
|
|
10
|
-
super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, '
|
|
10
|
+
super(ModuleConstants.SystemStatusModuleId, ModuleConstants.SystemStatusFriendlyName, 'traffic-lights', 'SystemStatusPopup', 'Provide messages about the Status of your application', api);
|
|
11
11
|
}
|
|
12
12
|
addColumnMenuItems(column) {
|
|
13
13
|
if (this.isModuleAvailable()) {
|
|
@@ -16,7 +16,7 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensio
|
|
|
16
16
|
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
17
17
|
class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
18
18
|
constructor(api) {
|
|
19
|
-
super(ModuleConstants.TeamSharingModuleId, ModuleConstants.TeamSharingFriendlyName, '
|
|
19
|
+
super(ModuleConstants.TeamSharingModuleId, ModuleConstants.TeamSharingFriendlyName, 'folder-shared', 'TeamSharingPopup', 'Team Sharing allows users to share - at run-time - Adaptable Objects between colleagues.', api);
|
|
20
20
|
this.SKIP_TEAMSHARING_UPDATE_ACTIONS = [
|
|
21
21
|
TeamSharingRedux_1.TEAMSHARING_GET,
|
|
22
22
|
TeamSharingRedux_1.TEAMSHARING_SET,
|
|
@@ -8,7 +8,7 @@ const Types_1 = require("../PredefinedConfig/Common/Types");
|
|
|
8
8
|
const ToolPanelRedux_1 = require("../Redux/ActionsReducers/ToolPanelRedux");
|
|
9
9
|
class ToolPanelModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
10
10
|
constructor(api) {
|
|
11
|
-
super(ModuleConstants.ToolPanelModuleId, ModuleConstants.ToolPanelFriendlyName, '
|
|
11
|
+
super(ModuleConstants.ToolPanelModuleId, ModuleConstants.ToolPanelFriendlyName, 'clipboard', 'ToolPanelPopup', 'An alternative to using the Dashboard is the AdapTable Tool Panel, the Tool Panel is the collapsible area to the right of the Grid.', api);
|
|
12
12
|
}
|
|
13
13
|
isModuleAvailable() {
|
|
14
14
|
if (!super.isModuleAvailable()) {
|
|
@@ -38,6 +38,8 @@ export declare const CELL_SUMMARY_DEFAULT_OPERATION: SummaryOperation | string;
|
|
|
38
38
|
export declare const SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE: AdaptableMessageType;
|
|
39
39
|
export declare const THEME_DEFAULT_CURRENT_THEME: string;
|
|
40
40
|
export declare const DEFAULT_LIVE_REPORT_THROTTLE_TIME: number;
|
|
41
|
+
export declare const SERVER_VALIDATION_HEADER: string;
|
|
42
|
+
export declare const SERVER_VALIDATION_MESSAGE_TYPE: AdaptableMessageType;
|
|
41
43
|
/**
|
|
42
44
|
* Object Factory
|
|
43
45
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = void 0;
|
|
3
|
+
exports.QUICK_SEARCH_STYLE_STATE_PROPERTY = exports.QUICK_SEARCH_TEXT_STATE_PROPERTY = exports.CURRENT_THEME_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DURATION_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_DOWN_COLOR_STATE_PROPERTY = exports.FLASHING_CELL_DEFAULT_UP_COLOR_STATE_PROPERTY = exports.CURRENT_REPORT_STATE_PROPERTY = exports.CURRENT_LAYOUT_STATE_PROPERTY = exports.SUMMARY_OPERATION_STATE_PROPERTY = exports.ALERT_DEFAULT_SHOW_POPUP = exports.ALERT_DEFAULT_MESSAGE_TYPE = exports.PLUS_MINUS_DEFAULT_NUDGE_VALUE = exports.SERVER_VALIDATION_MESSAGE_TYPE = exports.SERVER_VALIDATION_HEADER = exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = exports.THEME_DEFAULT_CURRENT_THEME = exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = exports.CELL_SUMMARY_DEFAULT_OPERATION = exports.QUICK_SEARCH_DEBOUNCE_TIME = exports.QUICK_SEARCH_DEFAULT_FORE_COLOR = exports.QUICK_SEARCH_DEFAULT_BACK_COLOR = exports.SYSTEM_STATUS_DEFAULT_MAX_MESSAGES_IN_STORE = exports.DEFAULT_DATE_FORMAT_PATTERN = exports.ADAPTABLE_ROW_ACTION_BUTTONS_FRIENDLY_NAME = exports.ADAPTABLE_ROW_ACTION_BUTTONS = exports.AG_GRID_CHART_WINDOW = exports.AG_GRID_PIVOT_COLUMN = exports.AG_GRID_GROUPED_COLUMN = exports.HALF_SECOND = exports.AB_SPECIAL_COLUMN = exports.EMPTY_ARRAY = exports.EMPTY_STRING = exports.FILTER_THROTTLE = exports.FILTER_NEVER = exports.FILTER_ALWAYS = exports.ALL_COLUMN_VALUES = exports.READ_ONLY_STYLE = exports.MENU_PREFIX = exports.AGGRID_TOOLPANEL_COLUMNS = exports.AGGRID_TOOLPANEL_FILTERS = exports.ADAPTABLE_TOOLPANEL_COMPONENT = exports.ADAPTABLE_TOOLPANEL_ID = exports.ADAPTABLE = exports.ADAPTABLE_ID = exports.USER_NAME = exports.DARK_THEME = exports.LIGHT_THEME = exports.DEFAULT_LAYOUT = exports.MISSING_COLUMN = exports.AUTOGENERATED_PK_COLUMN = void 0;
|
|
4
|
+
exports.THEME_STYLE = exports.SELECTED_ROWS_REPORT = exports.SELECTED_CELLS_REPORT = exports.CURRENT_DATA_REPORT = exports.ALL_DATA_REPORT = exports.VISUAL_DATA_REPORT = exports.SYSTEM_THEMES = exports.SMART_EDIT_MATH_OPERATION_STATE_PROPERTY = exports.SMART_EDIT_VALUE_STATE_PROPERTY = void 0;
|
|
5
5
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
6
6
|
const UIHelper_1 = require("../../View/UIHelper");
|
|
7
7
|
exports.AUTOGENERATED_PK_COLUMN = '__ADAPTABLE_PK__';
|
|
@@ -53,6 +53,8 @@ exports.SYSTEM_DEFAULT_SYSTEM_STATUS_TYPE = 'Info';
|
|
|
53
53
|
exports.THEME_DEFAULT_CURRENT_THEME = exports.LIGHT_THEME;
|
|
54
54
|
// Live Report Throttle Time (used in OpenFin, IPushPull, Glue42 etc.)
|
|
55
55
|
exports.DEFAULT_LIVE_REPORT_THROTTLE_TIME = 2000;
|
|
56
|
+
exports.SERVER_VALIDATION_HEADER = 'Server Validation Message';
|
|
57
|
+
exports.SERVER_VALIDATION_MESSAGE_TYPE = 'Info';
|
|
56
58
|
/**
|
|
57
59
|
* Object Factory
|
|
58
60
|
*/
|
|
@@ -31,6 +31,25 @@ const convertAdaptableStyleToCSS = (style) => {
|
|
|
31
31
|
if (style.BorderColor !== undefined && style.BorderColor !== null) {
|
|
32
32
|
result.borderColor = style.BorderColor;
|
|
33
33
|
}
|
|
34
|
+
if (style.BorderRadius !== undefined && style.BorderRadius !== null) {
|
|
35
|
+
const preparedRadious = typeof style.BorderRadius === 'number' ? `${style.BorderRadius}px` : style.BorderRadius;
|
|
36
|
+
result.borderRadius = preparedRadious;
|
|
37
|
+
}
|
|
38
|
+
if (style.TextDecoration !== undefined && style.TextDecoration !== null) {
|
|
39
|
+
switch (style.TextDecoration) {
|
|
40
|
+
case 'None':
|
|
41
|
+
break;
|
|
42
|
+
case 'Underline':
|
|
43
|
+
result.textDecoration = 'underline';
|
|
44
|
+
break;
|
|
45
|
+
case 'Overline':
|
|
46
|
+
result.textDecoration = 'overline';
|
|
47
|
+
break;
|
|
48
|
+
case 'LineThrough':
|
|
49
|
+
result.textDecoration = 'line-through';
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
34
53
|
// assertion added to comply with the ag-Grid types
|
|
35
54
|
return result;
|
|
36
55
|
};
|
|
@@ -25,7 +25,7 @@ import { NotificationsOptions } from '../AdaptableOptions/NotificationsOptions';
|
|
|
25
25
|
import { CellSummmary } from '../PredefinedConfig/Common/CellSummary';
|
|
26
26
|
import { AdaptableTheme, ChartDefinition, ColumnFilter, CustomDisplayFormatterContext, FlashingCellDefinition, GridDataChangedInfo, SystemFilterPredicateId } from '../types';
|
|
27
27
|
import { IRowNode } from '@ag-grid-community/core';
|
|
28
|
-
import { AdaptableApi } from '../../types';
|
|
28
|
+
import { AdaptableApi, BadgeStyleDefinition } from '../../types';
|
|
29
29
|
import { ToastOptions } from '../components/Toastify';
|
|
30
30
|
import { StyledColumn } from '../PredefinedConfig/StyledColumnState';
|
|
31
31
|
export declare function CreateEmptyCustomSort(): CustomSort;
|
|
@@ -64,6 +64,7 @@ export declare function CreateSystemStatusMessageInfo(message: string, type: Ada
|
|
|
64
64
|
export declare function CreateEmptyCellSummmary(): CellSummmary;
|
|
65
65
|
export declare function CreateColumnFilter(ColumnId: string, PredicateId: SystemFilterPredicateId, Inputs: any[]): ColumnFilter;
|
|
66
66
|
export declare function CreateEmptyStyledColumn(): StyledColumn;
|
|
67
|
+
export declare function CreateDefaultStyledColumnBadge(): BadgeStyleDefinition;
|
|
67
68
|
export declare function CreateEmptyChartDefinition(chartDefinition?: ChartDefinition): ChartDefinition;
|
|
68
69
|
export declare function CreateCustomDisplayFormatterContext(value: any, node: IRowNode, abColumn: AdaptableColumn, api: AdaptableApi): CustomDisplayFormatterContext;
|
|
69
70
|
export declare function CreateEmptyTheme(name?: string): AdaptableTheme;
|
|
@@ -110,6 +111,7 @@ export declare const ObjectFactory: {
|
|
|
110
111
|
CreateToastOptions: typeof CreateToastOptions;
|
|
111
112
|
CreateCustomDisplayFormatterContext: typeof CreateCustomDisplayFormatterContext;
|
|
112
113
|
CreateEmptyStyledColumn: typeof CreateEmptyStyledColumn;
|
|
114
|
+
CreateDefaultStyledColumnBadge: typeof CreateDefaultStyledColumnBadge;
|
|
113
115
|
CreateEmptyChartDefinition: typeof CreateEmptyChartDefinition;
|
|
114
116
|
CreateEmptyTheme: typeof CreateEmptyTheme;
|
|
115
117
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectFactory = exports.CreateToastOptions = exports.CreateEmptyTheme = exports.CreateCustomDisplayFormatterContext = exports.CreateEmptyChartDefinition = exports.CreateEmptyStyledColumn = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateServerReport = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateRowChangedAlert = exports.CreateCellChangedAlert = exports.CreateGenericAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyCustomSort = void 0;
|
|
3
|
+
exports.ObjectFactory = exports.CreateToastOptions = exports.CreateEmptyTheme = exports.CreateCustomDisplayFormatterContext = exports.CreateEmptyChartDefinition = exports.CreateDefaultStyledColumnBadge = exports.CreateEmptyStyledColumn = exports.CreateColumnFilter = exports.CreateEmptyCellSummmary = exports.CreateSystemStatusMessageInfo = exports.CreateEmptyStyle = exports.CreateEmptyLayout = exports.CreateEmptyFreeTextColumn = exports.CreateEmptyFormatColumn = exports.CreateEmptyShortcut = exports.CreateEmptySchedule = exports.CreateReportSchedule = exports.CreateGlue42Schedule = exports.CreateIPushPullSchedule = exports.CreateEmptyOpenFinSchedule = exports.CreateEmptyGlue42Schedule = exports.CreateEmptyIPushPullSchedule = exports.CreateEmptyOpenFinReport = exports.CreateEmptyGlue42Report = exports.CreateEmptyIPushPullReport = exports.CreateEmptyReportSchedule = exports.CreateEmptyReminderSchedule = exports.CreateEmptyBaseSchedule = exports.CreateServerReport = exports.CreateEmptyReport = exports.CreateInternalAlertDefinitionForMessages = exports.CreateEmptyFlashingCellDefinition = exports.CreateEmptyAlertDefinition = exports.CreateRowChangedAlert = exports.CreateCellChangedAlert = exports.CreateGenericAlert = exports.CreateEmptyPlusMinusNudge = exports.CreateEmptyNamedQuery = exports.CreateEmptyCalculatedColumn = exports.CreateEmptyCustomSort = void 0;
|
|
4
4
|
const Enums_1 = require("../PredefinedConfig/Common/Enums");
|
|
5
5
|
const GeneralConstants_1 = require("./Constants/GeneralConstants");
|
|
6
6
|
const Uuid_1 = require("../PredefinedConfig/Uuid");
|
|
7
7
|
const Toastify_1 = require("../components/Toastify");
|
|
8
|
+
const UIHelper_1 = require("../View/UIHelper");
|
|
8
9
|
function CreateEmptyCustomSort() {
|
|
9
10
|
return { Uuid: (0, Uuid_1.createUuid)(), ColumnId: GeneralConstants_1.EMPTY_STRING, SortedValues: [] };
|
|
10
11
|
}
|
|
@@ -363,9 +364,20 @@ function CreateEmptyStyledColumn() {
|
|
|
363
364
|
return {
|
|
364
365
|
Uuid: (0, Uuid_1.createUuid)(),
|
|
365
366
|
ColumnId: GeneralConstants_1.EMPTY_STRING,
|
|
367
|
+
IncludeGroupedRows: false,
|
|
366
368
|
};
|
|
367
369
|
}
|
|
368
370
|
exports.CreateEmptyStyledColumn = CreateEmptyStyledColumn;
|
|
371
|
+
function CreateDefaultStyledColumnBadge() {
|
|
372
|
+
return {
|
|
373
|
+
Style: {
|
|
374
|
+
BackColor: (0, UIHelper_1.getHexForName)(UIHelper_1.LIGHT_GRAY),
|
|
375
|
+
ForeColor: (0, UIHelper_1.getHexForName)(UIHelper_1.BLACK),
|
|
376
|
+
BorderRadius: 6,
|
|
377
|
+
},
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
exports.CreateDefaultStyledColumnBadge = CreateDefaultStyledColumnBadge;
|
|
369
381
|
function CreateEmptyChartDefinition(chartDefinition) {
|
|
370
382
|
return Object.assign({ Uuid: (0, Uuid_1.createUuid)() }, chartDefinition);
|
|
371
383
|
}
|
|
@@ -478,6 +490,7 @@ exports.ObjectFactory = {
|
|
|
478
490
|
CreateToastOptions,
|
|
479
491
|
CreateCustomDisplayFormatterContext,
|
|
480
492
|
CreateEmptyStyledColumn,
|
|
493
|
+
CreateDefaultStyledColumnBadge,
|
|
481
494
|
CreateEmptyChartDefinition,
|
|
482
495
|
CreateEmptyTheme,
|
|
483
496
|
};
|
|
@@ -27,11 +27,13 @@ class EntitlementService {
|
|
|
27
27
|
let adaptableOptions = this.adaptableApi.optionsApi.getAdaptableOptions();
|
|
28
28
|
let entitlementOptions = adaptableOptions.entitlementOptions;
|
|
29
29
|
if (entitlementOptions) {
|
|
30
|
+
const defaultAccessLevelContext = {
|
|
31
|
+
userName: adaptableOptions.userName,
|
|
32
|
+
adaptableId: adaptableOptions.adaptableId,
|
|
33
|
+
adaptableApi: this.adaptableApi
|
|
34
|
+
};
|
|
30
35
|
const defaultAccessLevel = typeof entitlementOptions.defaultAccessLevel === 'function'
|
|
31
|
-
? entitlementOptions.defaultAccessLevel(
|
|
32
|
-
userName: adaptableOptions.userName,
|
|
33
|
-
adaptableId: adaptableOptions.adaptableId,
|
|
34
|
-
})
|
|
36
|
+
? entitlementOptions.defaultAccessLevel(defaultAccessLevelContext)
|
|
35
37
|
: entitlementOptions.defaultAccessLevel;
|
|
36
38
|
const moduleEntitlements = entitlementOptions.moduleEntitlements;
|
|
37
39
|
if (moduleEntitlements) {
|
|
@@ -41,6 +43,7 @@ class EntitlementService {
|
|
|
41
43
|
userName: adaptableOptions.userName,
|
|
42
44
|
adaptableId: adaptableOptions.adaptableId,
|
|
43
45
|
defaultAccessLevel,
|
|
46
|
+
adaptableApi: this.adaptableApi
|
|
44
47
|
};
|
|
45
48
|
const dynamicModuleEntitlement = moduleEntitlements(entitlementContext);
|
|
46
49
|
return dynamicModuleEntitlement !== null && dynamicModuleEntitlement !== void 0 ? dynamicModuleEntitlement : defaultAccessLevel;
|
|
@@ -6,6 +6,7 @@ const ArrayExtensions_1 = require("../Extensions/ArrayExtensions");
|
|
|
6
6
|
const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
|
|
7
7
|
const ModuleConstants_1 = require("../Constants/ModuleConstants");
|
|
8
8
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../ObjectFactory"));
|
|
9
|
+
const GeneralConstants_1 = require("../Constants/GeneralConstants");
|
|
9
10
|
class ValidationService {
|
|
10
11
|
constructor(adaptableApi) {
|
|
11
12
|
this.adaptableApi = adaptableApi;
|
|
@@ -72,10 +73,14 @@ class ValidationService {
|
|
|
72
73
|
}, false);
|
|
73
74
|
}
|
|
74
75
|
performServerValidation(cellDataChangedInfo, config) {
|
|
76
|
+
const serverValidationContext = {
|
|
77
|
+
cellDataChangedInfo: cellDataChangedInfo,
|
|
78
|
+
adaptableApi: this.adaptableApi,
|
|
79
|
+
};
|
|
75
80
|
return () => {
|
|
76
81
|
this.adaptableApi.optionsApi
|
|
77
82
|
.getEditOptions()
|
|
78
|
-
.validateOnServer(
|
|
83
|
+
.validateOnServer(serverValidationContext)
|
|
79
84
|
.then((validationResult) => {
|
|
80
85
|
var _a, _b;
|
|
81
86
|
if (validationResult.NewValue === undefined) {
|
|
@@ -94,7 +99,13 @@ class ValidationService {
|
|
|
94
99
|
this.adaptableApi.gridApi.updateGridData([row]);
|
|
95
100
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
96
101
|
this.adaptableApi.optionsApi.getEditOptions().displayServerValidationMessages) {
|
|
97
|
-
|
|
102
|
+
const validationHeader = validationResult.ValidationHeader
|
|
103
|
+
? validationResult.ValidationHeader
|
|
104
|
+
: GeneralConstants_1.SERVER_VALIDATION_HEADER;
|
|
105
|
+
const messageType = validationResult.MessageType
|
|
106
|
+
? validationResult.MessageType
|
|
107
|
+
: GeneralConstants_1.SERVER_VALIDATION_MESSAGE_TYPE;
|
|
108
|
+
this.adaptableApi.alertApi.showAlert(validationHeader, validationResult.ValidationMessage, messageType);
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
config.onServerValidationCompleted();
|
|
@@ -20,7 +20,6 @@ const AlertButtonsEditor = (props) => {
|
|
|
20
20
|
const alertDefinition = adaptableAlert.alertDefinition;
|
|
21
21
|
const rowAddedAlert = api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
|
|
22
22
|
const rowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
23
|
-
const cellChangedAlert = !rowAddedAlert && !rowRemovedAlert;
|
|
24
23
|
// except row change
|
|
25
24
|
const hasHighlightCell = props.alertType !== 'RowChange';
|
|
26
25
|
// all, except row removed
|
|
@@ -56,7 +55,7 @@ const AlertButtonsEditor = (props) => {
|
|
|
56
55
|
return (React.createElement(React.Fragment, null,
|
|
57
56
|
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
|
|
58
57
|
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "Add buttons to Alert, and Actions to perform when button is clicked"),
|
|
59
|
-
React.createElement(SimpleButton_1.default, { icon: "
|
|
58
|
+
React.createElement(SimpleButton_1.default, { icon: "plus", onClick: () => {
|
|
60
59
|
onChange([
|
|
61
60
|
...(AlertButtons || []),
|
|
62
61
|
{
|
|
@@ -71,11 +70,13 @@ const AlertButtonsEditor = (props) => {
|
|
|
71
70
|
var _a, _b;
|
|
72
71
|
let buttonStyle = button.ButtonStyle;
|
|
73
72
|
let buttonLabel = button.Label;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
let btnActions = [];
|
|
74
|
+
if (button.Action && typeof button.Action === 'string') {
|
|
75
|
+
btnActions = [button.Action];
|
|
76
|
+
}
|
|
77
|
+
else if (button.Action && Array.isArray(button.Action)) {
|
|
78
|
+
btnActions = button.Action;
|
|
79
|
+
}
|
|
79
80
|
// filter out the adaptable standard actions
|
|
80
81
|
const btnUserFunctions = btnActions.filter((action) => !buttonActions.includes(action));
|
|
81
82
|
const setVariant = (variant) => {
|
|
@@ -103,11 +104,27 @@ const AlertButtonsEditor = (props) => {
|
|
|
103
104
|
return btn;
|
|
104
105
|
}));
|
|
105
106
|
};
|
|
107
|
+
const handleActionChange = (checked, actionName) => {
|
|
108
|
+
let actions = btnActions;
|
|
109
|
+
if (!checked) {
|
|
110
|
+
// remove current action
|
|
111
|
+
actions = actions.filter((a) => a !== actionName);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
actions = [...actions, actionName];
|
|
115
|
+
}
|
|
116
|
+
onChange(AlertButtons.map((btn, i) => {
|
|
117
|
+
if (i === index) {
|
|
118
|
+
return Object.assign(Object.assign({}, btn), { Action: actions.length ? actions : undefined });
|
|
119
|
+
}
|
|
120
|
+
return btn;
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
106
123
|
return (React.createElement(rebass_1.Box, { key: index, marginLeft: 3, style: {
|
|
107
124
|
borderTop: index ? '1px dashed var(--ab-color-inputborder)' : '',
|
|
108
125
|
} },
|
|
109
126
|
React.createElement(FormLayout_1.default, { marginBottom: 2, paddingTop: 2 },
|
|
110
|
-
React.createElement(FormLayout_1.FormRow, { label: React.createElement(rebass_1.Text, { fontSize: 2, style: { whiteSpace: 'nowrap' } }, "Button
|
|
127
|
+
React.createElement(FormLayout_1.FormRow, { label: React.createElement(rebass_1.Text, { fontSize: 2, style: { whiteSpace: 'nowrap' } }, "Button Text") },
|
|
111
128
|
React.createElement(rebass_1.Flex, { flexDirection: "row" },
|
|
112
129
|
React.createElement(Input_1.default, { value: buttonLabel, style: { width: 80 }, onChange: (e) => {
|
|
113
130
|
onChange(AlertButtons.map((btn, i) => {
|
|
@@ -146,27 +163,12 @@ const AlertButtonsEditor = (props) => {
|
|
|
146
163
|
"Tone:",
|
|
147
164
|
' ',
|
|
148
165
|
StringExtensions_1.default.CapitaliseFirstLetter((_b = buttonStyle === null || buttonStyle === void 0 ? void 0 : buttonStyle.tone) !== null && _b !== void 0 ? _b : 'Use alert tone'))),
|
|
149
|
-
React.createElement(SimpleButton_1.default, { icon: "
|
|
166
|
+
React.createElement(SimpleButton_1.default, { icon: "close", tone: "error", disabled: AlertButtons.length <= 1, marginLeft: 1, variant: "text", tooltip: AlertButtons.length <= 1 ? 'Cannot remove last button' : 'Remove button', onClick: () => {
|
|
150
167
|
onChange(AlertButtons.filter((btn) => btn !== button));
|
|
151
168
|
} }))),
|
|
152
169
|
React.createElement(FormLayout_1.FormRow, { label: React.createElement(rebass_1.Text, { fontSize: 2 }, "Actions") },
|
|
153
170
|
buttonActions.map((actionName) => {
|
|
154
|
-
return (React.createElement(CheckBox_1.CheckBox, { key: actionName, marginRight: 3, onChange: (checked) =>
|
|
155
|
-
let actions = btnActions;
|
|
156
|
-
if (!checked) {
|
|
157
|
-
// remove current action
|
|
158
|
-
actions = actions.filter((a) => a !== actionName);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
actions = [...actions, actionName];
|
|
162
|
-
}
|
|
163
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
164
|
-
if (i === index) {
|
|
165
|
-
return Object.assign(Object.assign({}, btn), { Action: actions.length ? actions : undefined });
|
|
166
|
-
}
|
|
167
|
-
return btn;
|
|
168
|
-
}));
|
|
169
|
-
}, checked: button.Action === actionName ||
|
|
171
|
+
return (React.createElement(CheckBox_1.CheckBox, { key: actionName, marginRight: 3, onChange: (checked) => handleActionChange(checked, actionName), checked: button.Action === actionName ||
|
|
170
172
|
(Array.isArray(button.Action) && button.Action.includes(actionName)) },
|
|
171
173
|
React.createElement(rebass_1.Text, { fontSize: 2 }, (0, sentence_case_1.sentenceCase)(actionName))));
|
|
172
174
|
}),
|
|
@@ -18,7 +18,7 @@ const ShowChartButton = (props) => {
|
|
|
18
18
|
return (React.createElement(SimpleButton_1.default, { "data-name": "close-chart-button", onClick: closeChart, variant: "text", tone: "error", icon: "visibility-off", tooltip: "Hide Chart" }));
|
|
19
19
|
}
|
|
20
20
|
if (!(chartContainers === null || chartContainers === void 0 ? void 0 : chartContainers.length)) {
|
|
21
|
-
return (React.createElement(SimpleButton_1.default, { "data-name": "show-chart-button", onClick: () => showChart(), variant: "text", tone: "success", icon: "visibility", tooltip: "Show Chart" }));
|
|
21
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": "show-chart-button", onClick: () => showChart(), variant: "text", tone: "success", icon: "visibility-on", tooltip: "Show Chart" }));
|
|
22
22
|
}
|
|
23
23
|
const containerOptions = [
|
|
24
24
|
{
|
|
@@ -71,7 +71,7 @@ const AdaptableObjectListItemView = (props) => {
|
|
|
71
71
|
React.createElement(rebass_1.Flex, { justifyContent: "end" },
|
|
72
72
|
props.actions,
|
|
73
73
|
props.teamSharingActivated && (React.createElement(ButtonShare_1.ButtonShare, { iconSize: ICON_SIZE, Header: `TeamSharing ${props.entityType}`, accessLevel: props.accessLevel, onShare: props.onShare })),
|
|
74
|
-
props.onDelete && (React.createElement(SimpleButton_1.default, { "data-name": "delete", disabled: props.deleteDisabled, iconSize: ICON_SIZE, tooltip: props.deleteTooltip, icon: "
|
|
74
|
+
props.onDelete && (React.createElement(SimpleButton_1.default, { "data-name": "delete", disabled: props.deleteDisabled, iconSize: ICON_SIZE, tooltip: props.deleteTooltip, icon: "delete", onClick: props.onDelete, variant: "text" })),
|
|
75
75
|
props.deleteAction && deleteActionButton,
|
|
76
76
|
props.showEditButton && (React.createElement(ButtonEdit_1.ButtonEdit, { iconSize: ICON_SIZE, disabled: props.editDisabled, accessLevel: props.accessLevel, onClick: () => props.handleOnEdit() }))),
|
|
77
77
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
7
7
|
class ButtonClear extends React.Component {
|
|
8
8
|
render() {
|
|
9
|
-
return (React.createElement(SimpleButton_1.default, Object.assign({ "data-name": "clear", tooltip: "Clear", iconSize: 20, icon: this.props.showIcon == false ? '' : '
|
|
9
|
+
return (React.createElement(SimpleButton_1.default, Object.assign({ "data-name": "clear", tooltip: "Clear", iconSize: 20, icon: this.props.showIcon == false ? '' : 'close' }, this.props, { variant: "text" }), this.props.showText ? 'Clear' : ''));
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.ButtonClear = ButtonClear;
|