@adaptabletools/adaptable 12.1.3 → 12.1.6
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/bundle.cjs.js +116 -143
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +10 -4
- package/src/AdaptableOptions/FilterOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +31 -24
- package/src/Api/ColumnApi.d.ts +7 -1
- package/src/Api/Events/SearchChanged.d.ts +1 -0
- package/src/Api/FilterApi.d.ts +6 -0
- package/src/Api/FormatColumnApi.d.ts +5 -3
- package/src/Api/Implementation/ColumnApiImpl.d.ts +3 -1
- package/src/Api/Implementation/ColumnApiImpl.js +17 -2
- package/src/Api/Implementation/DataSetApiImpl.js +1 -1
- package/src/Api/Implementation/FilterApiImpl.d.ts +1 -0
- package/src/Api/Implementation/FilterApiImpl.js +10 -1
- package/src/Api/Implementation/FormatColumnApiImpl.d.ts +5 -3
- package/src/Api/Implementation/FormatColumnApiImpl.js +40 -11
- package/src/Api/Implementation/GridApiImpl.js +4 -4
- package/src/Api/Implementation/LayoutApiImpl.d.ts +1 -1
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/QueryApiImpl.js +1 -1
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -1
- package/src/Api/LayoutApi.d.ts +1 -1
- package/src/PredefinedConfig/AlertState.d.ts +2 -2
- package/src/PredefinedConfig/Common/AdaptableColumn.js +3 -2
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +9 -1
- package/src/PredefinedConfig/Common/Types.d.ts +1 -0
- package/src/PredefinedConfig/Common/Types.js +38 -1
- package/src/PredefinedConfig/FlashingCellState.d.ts +1 -1
- package/src/PredefinedConfig/FormatColumnState.d.ts +2 -2
- package/src/Redux/Store/AdaptableStore.js +18 -10
- package/src/Strategy/AlertModule.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/ChartingModule.js +1 -1
- package/src/Strategy/ConditionalStyleModule.js +1 -1
- package/src/Strategy/CustomSortModule.js +1 -1
- package/src/Strategy/DashboardModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/DataSetModule.js +1 -1
- package/src/Strategy/ExportModule.js +1 -1
- package/src/Strategy/FilterModule.js +1 -1
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FormatColumnModule.js +1 -1
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/GridInfoModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +1 -1
- package/src/Strategy/QueryModule.js +1 -1
- package/src/Strategy/QuickSearchModule.js +1 -1
- package/src/Strategy/ScheduleModule.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/StatusBarModule.js +1 -1
- package/src/Strategy/SystemStatusModule.js +1 -1
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/ThemeModule.js +1 -1
- package/src/Strategy/ToolPanelModule.js +1 -1
- package/src/Utilities/Constants/ModuleConstants.d.ts +68 -0
- package/src/Utilities/Constants/ModuleConstants.js +70 -1
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -1
- package/src/Utilities/Extensions/ArrayExtensions.js +6 -0
- package/src/Utilities/Services/Interface/IMetamodelService.d.ts +5 -0
- package/src/Utilities/Services/MetamodelService.d.ts +4 -4
- package/src/Utilities/Services/MetamodelService.js +19 -12
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +193 -135
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +23 -15
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js +3 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.d.ts +2 -2
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +148 -8
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/GridOptionsForm.js +0 -7
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +33 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsSidebarForm.js +82 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.d.ts +6 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsStatusbarForm.js +109 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.d.ts +8 -0
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +16 -0
- package/src/View/AdaptableWizardView/Wizard.js +2 -1
- package/src/View/AdaptableWizardView/helper.d.ts +1 -1
- package/src/View/AdaptableWizardView/helper.js +3 -10
- package/src/View/Components/FilterForm/FilterForm.js +4 -2
- package/src/View/Components/FilterForm/QuickFilterForm.js +2 -1
- package/src/View/Components/RangesComponent.js +1 -1
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +1 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +8 -4
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +3 -2
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +1 -1
- package/src/View/Layout/Wizard/sections/SettingsSection.js +2 -2
- package/src/View/Layout/Wizard/sections/SortSection.js +1 -1
- package/src/agGrid/Adaptable.d.ts +2 -1
- package/src/agGrid/Adaptable.js +19 -12
- package/src/agGrid/PercentBarRenderer.d.ts +2 -1
- package/src/agGrid/PercentBarRenderer.js +3 -3
- package/src/agGrid/agGridHelper.d.ts +1 -1
- package/src/agGrid/agGridHelper.js +2 -2
- package/src/components/ProgressIndicator/ProgressIndicator.js +10 -12
- package/src/metamodel/adaptable.metamodel.d.ts +74 -6
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/parser/src/types.d.ts +1 -1
- package/src/types.d.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -5,12 +5,13 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
5
5
|
const useSelection_1 = tslib_1.__importDefault(require("./useSelection"));
|
|
6
6
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
7
7
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
8
|
-
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
9
|
-
const AdaptableObjectCollection_1 = require("../../Components/AdaptableObjectCollection");
|
|
10
8
|
const Dropdown_1 = tslib_1.__importDefault(require("../../../components/Dropdown"));
|
|
11
9
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
12
10
|
const react_1 = require("react");
|
|
13
11
|
const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
|
|
12
|
+
const InfiniteTable_1 = require("../../../components/InfiniteTable");
|
|
13
|
+
const rebass_1 = require("rebass");
|
|
14
|
+
const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
|
|
14
15
|
const dataTypes = [
|
|
15
16
|
{
|
|
16
17
|
value: 'abColDefString',
|
|
@@ -28,7 +29,7 @@ const dataTypes = [
|
|
|
28
29
|
];
|
|
29
30
|
const inputStyle = {
|
|
30
31
|
width: '100%',
|
|
31
|
-
minWidth:
|
|
32
|
+
minWidth: 80,
|
|
32
33
|
textAlign: 'start',
|
|
33
34
|
};
|
|
34
35
|
const useForceRender = () => {
|
|
@@ -37,6 +38,26 @@ const useForceRender = () => {
|
|
|
37
38
|
setNow(Date.now());
|
|
38
39
|
};
|
|
39
40
|
};
|
|
41
|
+
const ThrottledInput = React.memo((props) => {
|
|
42
|
+
const [stateValue, setStateValue] = react_1.useState(props.value);
|
|
43
|
+
const throttleOnChange = React.useRef(throttle_1.default(props.onChange, 600, { leading: false }));
|
|
44
|
+
const handleChange = React.useCallback((event) => {
|
|
45
|
+
const newValue = event.target.value;
|
|
46
|
+
setStateValue(newValue);
|
|
47
|
+
throttleOnChange.current(newValue);
|
|
48
|
+
}, []);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
setStateValue(props.value);
|
|
51
|
+
}, [props.value]);
|
|
52
|
+
return React.createElement(Input_1.default, { style: props.style, value: stateValue, onChange: handleChange });
|
|
53
|
+
});
|
|
54
|
+
const tableDOMProps = {
|
|
55
|
+
style: {
|
|
56
|
+
height: '100%',
|
|
57
|
+
minWidth: '10rem',
|
|
58
|
+
minHeight: 600,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
40
61
|
const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSelectionChange, selectedColumns, }) => {
|
|
41
62
|
const rerender = useForceRender();
|
|
42
63
|
const columnsRef = react_1.useRef(cols);
|
|
@@ -72,7 +93,7 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
|
|
|
72
93
|
}
|
|
73
94
|
return c;
|
|
74
95
|
});
|
|
75
|
-
|
|
96
|
+
setColumns(cols);
|
|
76
97
|
};
|
|
77
98
|
const onColumnTypeChange = (col, type) => {
|
|
78
99
|
const cols = getColumns().map((c) => {
|
|
@@ -131,144 +152,181 @@ const ColumnsList = ({ columns: cols, handle, onValidityChange, onChange, onSele
|
|
|
131
152
|
});
|
|
132
153
|
const allIncluded = isAllIncludedColumns();
|
|
133
154
|
const allExcluded = isNoneIncludedColumns();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
onValidityChange(isIncludedColumn(primaryKeyField));
|
|
157
|
+
}, [includedColumnsMap, primaryKeyField]);
|
|
158
|
+
const rowHeight = 40;
|
|
159
|
+
const data = columns;
|
|
160
|
+
const CellWrapper = (props) => {
|
|
161
|
+
return (React.createElement(rebass_1.Flex, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { position: 'absolute', textAlign: 'center', top: 0, left: 0, height: '100%', width: '100%', whiteSpace: 'normal' }), justifyContent: "center", alignItems: "center" }), props.children));
|
|
162
|
+
};
|
|
163
|
+
const HeaderCellWrapper = (props) => (React.createElement(CellWrapper, Object.assign({}, props, { fontSize: 3, style: { fontWeight: 600 } })));
|
|
164
|
+
const HeaderWithCheckbox = (props) => {
|
|
165
|
+
const { label, onChange, checked } = props, flexProps = tslib_1.__rest(props, ["label", "onChange", "checked"]);
|
|
166
|
+
return (React.createElement(HeaderCellWrapper, Object.assign({}, flexProps, { flexDirection: "column" }),
|
|
167
|
+
React.createElement(rebass_1.Box, null, label),
|
|
168
|
+
React.createElement(rebass_1.Box, { style: { textAlign: 'center' } },
|
|
169
|
+
React.createElement(CheckBox_1.CheckBox, { checked: checked, onChange: onChange }))));
|
|
170
|
+
};
|
|
171
|
+
const columnsMap = {
|
|
172
|
+
pk: {
|
|
173
|
+
header: () => React.createElement(HeaderCellWrapper, null, "Primary Key"),
|
|
174
|
+
maxWidth: 80,
|
|
175
|
+
sortable: false,
|
|
176
|
+
render: (params) => {
|
|
177
|
+
const { data } = params;
|
|
178
|
+
const column = data;
|
|
179
|
+
const isPrimaryKey = (column === null || column === void 0 ? void 0 : column.field) === primaryKeyField;
|
|
180
|
+
return (React.createElement(Radio_1.default, { checked: isPrimaryKey, onChange: (checked) => {
|
|
181
|
+
if (checked && isIncludedColumn(column.field)) {
|
|
182
|
+
setPrimaryKeyField(column.field);
|
|
146
183
|
}
|
|
147
|
-
} }))
|
|
148
|
-
|
|
184
|
+
} }));
|
|
185
|
+
},
|
|
149
186
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
187
|
+
included: {
|
|
188
|
+
maxWidth: 80,
|
|
189
|
+
resizable: true,
|
|
190
|
+
header: () => (React.createElement(HeaderWithCheckbox, { label: "Included", checked: allIncluded ? true : allExcluded ? false : null, onChange: (allIncluded) => {
|
|
191
|
+
if (allIncluded) {
|
|
192
|
+
includeAllColumns();
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
excludeAllColumns();
|
|
196
|
+
}
|
|
197
|
+
} })),
|
|
198
|
+
render: (params) => {
|
|
199
|
+
const column = params.data;
|
|
200
|
+
return (React.createElement(CellWrapper, null,
|
|
201
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isIncludedColumn(column.field), onChange: (included) => {
|
|
202
|
+
if (included) {
|
|
203
|
+
includeColumn(column.field);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
excludeColumn(column.field);
|
|
207
|
+
}
|
|
208
|
+
} })));
|
|
209
|
+
},
|
|
165
210
|
},
|
|
166
|
-
{
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
Size: 3,
|
|
211
|
+
field: {
|
|
212
|
+
header: React.createElement(HeaderCellWrapper, null, "Field"),
|
|
213
|
+
field: 'field',
|
|
214
|
+
minWidth: 150,
|
|
215
|
+
render: (params) => {
|
|
216
|
+
const column = params.data;
|
|
217
|
+
const humanized = StringExtensions_1.default.Humanize(column.field);
|
|
218
|
+
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
219
|
+
React.createElement(ThrottledInput, { key: column.field, style: inputStyle, value: column.caption != undefined ? column.caption : humanized, placeholder: humanized, onChange: (value) => {
|
|
220
|
+
setColumnCaption(value, column.field);
|
|
221
|
+
} })));
|
|
222
|
+
},
|
|
179
223
|
},
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
else {
|
|
190
|
-
setAllUnresizable();
|
|
191
|
-
}
|
|
192
|
-
} }))),
|
|
224
|
+
type: {
|
|
225
|
+
header: React.createElement(HeaderCellWrapper, null, "Type"),
|
|
226
|
+
maxWidth: 140,
|
|
227
|
+
render: (params) => {
|
|
228
|
+
var _a;
|
|
229
|
+
const column = params.data;
|
|
230
|
+
return (React.createElement(CellWrapper, { paddingLeft: 1, paddingRight: 1 },
|
|
231
|
+
React.createElement(Dropdown_1.default, { style: inputStyle, showClearButton: false, options: dataTypes, value: (_a = column === null || column === void 0 ? void 0 : column.type) !== null && _a !== void 0 ? _a : '', onChange: onColumnTypeChange.bind(null, column) })));
|
|
232
|
+
},
|
|
193
233
|
},
|
|
194
|
-
{
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
234
|
+
sortable: {
|
|
235
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Sortable", checked: isAllSortableColumns() ? true : isNoneSortableColumns() ? false : null, onChange: (allSortable) => {
|
|
236
|
+
if (allSortable) {
|
|
237
|
+
setAllSortable();
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
setAllUnsortable();
|
|
241
|
+
}
|
|
242
|
+
} })),
|
|
243
|
+
render: (params) => {
|
|
244
|
+
const column = params.data;
|
|
245
|
+
return (React.createElement(CheckBox_1.CheckBox, { checked: isSortableColumn(column.field), onChange: (sortable) => {
|
|
246
|
+
sortable ? setSortableColumn(column.field) : setUnsortableColumn(column.field);
|
|
247
|
+
} }));
|
|
248
|
+
},
|
|
207
249
|
},
|
|
208
|
-
{
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
250
|
+
editable: {
|
|
251
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Editable", checked: isAllEditableColumns() ? true : isNoneEditableColumns() ? false : null, onChange: (allEditable) => {
|
|
252
|
+
if (allEditable) {
|
|
253
|
+
setAllEditable();
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
setAllUneditable();
|
|
257
|
+
}
|
|
258
|
+
} })),
|
|
259
|
+
render: (params) => {
|
|
260
|
+
const col = params.data;
|
|
261
|
+
return (React.createElement(CellWrapper, null,
|
|
262
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isEditableColumn(col.field), onChange: (editable) => {
|
|
263
|
+
editable ? setEditableColumn(col.field) : setUneditableColumn(col.field);
|
|
264
|
+
} })));
|
|
265
|
+
},
|
|
221
266
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
resizable: {
|
|
268
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Resizable", checked: isAllResizableColumns() ? true : isNoneResizableColumns() ? false : null, onChange: (allResizable) => {
|
|
269
|
+
if (allResizable) {
|
|
270
|
+
setAllResizable();
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
setAllUnresizable();
|
|
274
|
+
}
|
|
275
|
+
} })),
|
|
276
|
+
render: (params) => {
|
|
277
|
+
const col = params.data;
|
|
278
|
+
return (React.createElement(CellWrapper, null,
|
|
279
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isResizableColumn(col.field), onChange: (resizable) => {
|
|
280
|
+
resizable ? setResizableColumn(col.field) : setUnresizableColumn(col.field);
|
|
281
|
+
} })));
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
groupable: {
|
|
285
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Groupable", checked: isAllGroupableColumns() ? true : isNoneGroupableColumns() ? false : null, onChange: (allGroupable) => {
|
|
286
|
+
if (allGroupable) {
|
|
287
|
+
setAllGroupable();
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
setAllUngroupable();
|
|
291
|
+
}
|
|
292
|
+
} })),
|
|
293
|
+
render: (params) => {
|
|
294
|
+
const col = params.data;
|
|
295
|
+
return (React.createElement(CellWrapper, null,
|
|
296
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isGroupableColumn(col.field), onChange: (groupable) => {
|
|
297
|
+
groupable ? setGroupableColumn(col.field) : setUngroupableColumn(col.field);
|
|
298
|
+
} })));
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
filtrable: {
|
|
302
|
+
header: (React.createElement(HeaderWithCheckbox, { label: "Filtrable", checked: isAllFilterableColumns() ? true : isNoneFilterableColumns() ? false : null, onChange: (allFilterable) => {
|
|
303
|
+
if (allFilterable) {
|
|
304
|
+
setAllFilterable();
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
setAllUnfilterable();
|
|
308
|
+
}
|
|
309
|
+
} })),
|
|
310
|
+
render: (params) => {
|
|
311
|
+
const col = params.data;
|
|
312
|
+
return (React.createElement(CellWrapper, null,
|
|
313
|
+
React.createElement(CheckBox_1.CheckBox, { checked: isFilterableColumn(col.field), onChange: (filterable) => {
|
|
314
|
+
filterable ? setFilterableColumn(col.field) : setUnFilterableColumn(col.field);
|
|
315
|
+
} })));
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
return (React.createElement(rebass_1.Box, { p: 2, style: { height: '100%' }, className: "light" },
|
|
320
|
+
React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "colId" },
|
|
321
|
+
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
322
|
+
default: {
|
|
323
|
+
defaultFlex: 1,
|
|
324
|
+
align: 'center',
|
|
325
|
+
sortable: false,
|
|
326
|
+
},
|
|
327
|
+
}, headerOptions: {
|
|
328
|
+
alwaysReserveSpaceForSortIcon: false,
|
|
329
|
+
}, rowHeight: rowHeight, columnHeaderHeight: 65, domProps: tableDOMProps, columns: columnsMap }))));
|
|
272
330
|
};
|
|
273
331
|
function areEqual() {
|
|
274
332
|
/**
|
|
@@ -9,9 +9,19 @@ const OnePageWizards_1 = require("../../Wizard/OnePageWizards");
|
|
|
9
9
|
const ConfigurationWizardColumnsStep_1 = require("./ConfigurationWizardColumnsStep");
|
|
10
10
|
const GridOptionsForm_1 = tslib_1.__importDefault(require("./GridOptionsForm"));
|
|
11
11
|
const AdaptableOptionsForm_1 = tslib_1.__importDefault(require("./AdaptableOptionsForm"));
|
|
12
|
+
const EntitlementsForm_1 = tslib_1.__importDefault(require("./EntitlementsForm"));
|
|
13
|
+
const UiOptionsForm_1 = require("./UIOptions/UiOptionsForm");
|
|
12
14
|
const ConfigurationWizard = (props) => {
|
|
13
15
|
const [isPrimaryKeySelected, setIsValid] = React.useState(true);
|
|
14
|
-
const [adaptableOptions, setAdaptableOptions] = react_1.useState(
|
|
16
|
+
const [adaptableOptions, setAdaptableOptions] = react_1.useState(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
const gridOptionDefaults = {
|
|
19
|
+
sideBar: {
|
|
20
|
+
toolPanels: ['columns', 'filters', 'adaptable'],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
return Object.assign(Object.assign({}, props.adaptableOptions), { gridOptions: Object.assign(Object.assign({}, gridOptionDefaults), (_a = props === null || props === void 0 ? void 0 : props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) });
|
|
24
|
+
});
|
|
15
25
|
const [selectedColumns, setSelectedColumns] = react_1.useState(() => {
|
|
16
26
|
return props.adaptableOptions.gridOptions.columnDefs.reduce((acc, col) => {
|
|
17
27
|
acc[col.field] = true;
|
|
@@ -77,22 +87,20 @@ const ConfigurationWizard = (props) => {
|
|
|
77
87
|
setAdaptableOptions(abOptions);
|
|
78
88
|
} })),
|
|
79
89
|
},
|
|
80
|
-
// JW - I would like at some point to do a page of Entitlements
|
|
81
|
-
// to show all the Modules and let users select which are Full, ReadOnly or Hidden
|
|
82
|
-
/*
|
|
83
90
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
title: 'UI Elements',
|
|
92
|
+
details: 'Configure UI Elements',
|
|
93
|
+
render: () => (React.createElement(UiOptionsForm_1.UIElementsForm, { adaptableOptions: adaptableOptions, onChangeadaptableOptions: (abOptions) => {
|
|
94
|
+
setAdaptableOptions(abOptions);
|
|
95
|
+
} })),
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: 'Entitlements',
|
|
99
|
+
details: 'Configure Entitlements',
|
|
100
|
+
render: () => (React.createElement(EntitlementsForm_1.default, { adaptableOptions: adaptableOptions, onChangeadaptableOptions: (abOptions) => {
|
|
101
|
+
setAdaptableOptions(abOptions);
|
|
102
|
+
} })),
|
|
94
103
|
},
|
|
95
|
-
*/
|
|
96
104
|
];
|
|
97
105
|
if (props.startSections) {
|
|
98
106
|
sections = [
|
package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizardColumnsStep.js
CHANGED
|
@@ -3,15 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConfigurationWizardColumnsStep = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const Panel_1 = tslib_1.__importDefault(require("../../../components/Panel"));
|
|
7
6
|
const ColumnsList_1 = tslib_1.__importDefault(require("./ColumnsList"));
|
|
8
7
|
const ConfigurationWizardColumnsStep = (props) => {
|
|
9
8
|
var _a, _b;
|
|
10
|
-
return (React.createElement(
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
React.createElement(ColumnsList_1.default, { handle: props.columnsHandle, onValidityChange: (valid) => {
|
|
14
|
-
props.setPrimaryKeyIsNotSelected(valid);
|
|
15
|
-
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_b = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) === null || _b === void 0 ? void 0 : _b.columnDefs })));
|
|
9
|
+
return (React.createElement(ColumnsList_1.default, { handle: props.columnsHandle, onValidityChange: (valid) => {
|
|
10
|
+
props.setPrimaryKeyIsNotSelected(valid);
|
|
11
|
+
}, selectedColumns: props.selectedColumns, onChange: props.onColumnChange, onSelectionChange: props.onSelectionChange, columns: (_b = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.gridOptions) === null || _b === void 0 ? void 0 : _b.columnDefs }));
|
|
16
12
|
};
|
|
17
13
|
exports.ConfigurationWizardColumnsStep = ConfigurationWizardColumnsStep;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { AdaptableOptions } from '../../../types';
|
|
3
3
|
interface EntitlementsFormOptions {
|
|
4
4
|
adaptableOptions: AdaptableOptions;
|
|
5
5
|
onChangeadaptableOptions: (adaptableOptions: AdaptableOptions) => void;
|
|
6
6
|
}
|
|
7
|
-
declare const EntitlementsForm:
|
|
7
|
+
declare const EntitlementsForm: React.FunctionComponent<EntitlementsFormOptions>;
|
|
8
8
|
export default EntitlementsForm;
|
|
@@ -2,16 +2,156 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
6
5
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
7
|
-
const
|
|
6
|
+
const Types_1 = require("../../../PredefinedConfig/Common/Types");
|
|
7
|
+
const AdaptableObjectRow_1 = require("../../Components/AdaptableObjectRow");
|
|
8
|
+
const rebass_1 = require("rebass");
|
|
9
|
+
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
11
|
+
const ModuleConstants_1 = require("../../../Utilities/Constants/ModuleConstants");
|
|
12
|
+
const InfiniteTable_1 = require("../../../components/InfiniteTable");
|
|
13
|
+
const ALL_ENTITLEMENTS_MODULES = Types_1.ALL_MODULES;
|
|
14
|
+
const tableDOMProps = {
|
|
15
|
+
style: {
|
|
16
|
+
height: '100%',
|
|
17
|
+
minWidth: '10rem',
|
|
18
|
+
minHeight: 600,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const EntitlementsListForm = (props) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
let abOptions = props.adaptableOptions;
|
|
24
|
+
const entitlements = (_b = (_a = abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions) === null || _a === void 0 ? void 0 : _a.moduleEntitlements) !== null && _b !== void 0 ? _b : [];
|
|
25
|
+
if (typeof entitlements === 'function') {
|
|
26
|
+
return (React.createElement(HelpBlock_1.default, { mt: 2 }, "Entitlements cannot be customized, they are handled by a custom function."));
|
|
27
|
+
}
|
|
28
|
+
const entitlementsMap = React.useMemo(() => {
|
|
29
|
+
return entitlements.reduce((acc, entitlement) => {
|
|
30
|
+
acc[entitlement.adaptableModule] = entitlement.accessLevel;
|
|
31
|
+
return acc;
|
|
32
|
+
}, {});
|
|
33
|
+
}, [abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions]);
|
|
34
|
+
const colItems = [
|
|
35
|
+
{
|
|
36
|
+
Content: React.createElement(rebass_1.Box, { style: { textAlign: 'left' } }, "Entitlement"),
|
|
37
|
+
Size: 3,
|
|
38
|
+
key: 'name',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
Content: 'Visible',
|
|
42
|
+
Size: 3,
|
|
43
|
+
key: 'Visible',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
Content: 'Read Only',
|
|
47
|
+
Size: 3,
|
|
48
|
+
key: 'ReadOnly',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
Content: 'Hidden',
|
|
52
|
+
Size: 3,
|
|
53
|
+
key: 'Hidden',
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
const handleOnChange = React.useCallback((module, accessLevel) => {
|
|
57
|
+
let newEntitlements = entitlements;
|
|
58
|
+
// change
|
|
59
|
+
if (entitlementsMap[module]) {
|
|
60
|
+
newEntitlements = newEntitlements.map((entitlement) => {
|
|
61
|
+
if (entitlement.adaptableModule === module) {
|
|
62
|
+
entitlement.accessLevel = accessLevel;
|
|
63
|
+
}
|
|
64
|
+
return entitlement;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
// new
|
|
69
|
+
newEntitlements = [
|
|
70
|
+
...newEntitlements,
|
|
71
|
+
{ adaptableModule: module, accessLevel: accessLevel },
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
props.onChangeadaptableOptions(Object.assign(Object.assign({}, abOptions), { entitlementOptions: Object.assign(Object.assign({}, abOptions.entitlementOptions), { moduleEntitlements: newEntitlements }) }));
|
|
75
|
+
}, [abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions]);
|
|
76
|
+
const items = ALL_ENTITLEMENTS_MODULES.map((module) => {
|
|
77
|
+
const cItems = colItems.map((item) => (Object.assign({}, item)));
|
|
78
|
+
const accessLevel = entitlementsMap[module];
|
|
79
|
+
cItems[0].Content = React.createElement(rebass_1.Box, { style: { textAlign: 'left' } }, ModuleConstants_1.ADAPTABLE_MODULE_MAP[module]);
|
|
80
|
+
cItems[1].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Full'), checked: accessLevel === 'Full' }));
|
|
81
|
+
cItems[2].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'ReadOnly'), checked: accessLevel === 'ReadOnly' }));
|
|
82
|
+
cItems[3].Content = (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Hidden'), checked: accessLevel === 'Hidden' }));
|
|
83
|
+
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { key: module, colItems: cItems, style: { cursor: 'pointer' } });
|
|
84
|
+
});
|
|
85
|
+
if (typeof entitlements === 'function') {
|
|
86
|
+
return (React.createElement(HelpBlock_1.default, { mb: 2 }, "Entitlements cannot be customized, they are handled by a custom function."));
|
|
87
|
+
}
|
|
88
|
+
const columnsMap = {
|
|
89
|
+
name: {
|
|
90
|
+
header: 'Module Name',
|
|
91
|
+
align: 'start',
|
|
92
|
+
renderValue: (params) => {
|
|
93
|
+
return React.createElement(React.Fragment, null, params.data.name);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
full: {
|
|
97
|
+
header: 'Full',
|
|
98
|
+
render: (params) => {
|
|
99
|
+
const module = params.data.name;
|
|
100
|
+
const accessLevel = entitlementsMap[module];
|
|
101
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Full'), checked: accessLevel === 'Full' }));
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
readonly: {
|
|
105
|
+
header: 'Read Only',
|
|
106
|
+
render: (params) => {
|
|
107
|
+
const module = params.data.name;
|
|
108
|
+
const accessLevel = entitlementsMap[module];
|
|
109
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'ReadOnly'), checked: accessLevel === 'ReadOnly' }));
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
hidden: {
|
|
113
|
+
header: 'Hidden',
|
|
114
|
+
render: (params) => {
|
|
115
|
+
const module = params.data.name;
|
|
116
|
+
const accessLevel = entitlementsMap[module];
|
|
117
|
+
return (React.createElement(Radio_1.default, { onClick: () => handleOnChange(module, 'Hidden'), checked: accessLevel === 'Hidden' }));
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
const data = ALL_ENTITLEMENTS_MODULES.map((module) => ({ name: ModuleConstants_1.ADAPTABLE_MODULE_MAP[module] }));
|
|
122
|
+
return (React.createElement(rebass_1.Box, { flex: 1, height: "100%", className: "light" },
|
|
123
|
+
React.createElement(InfiniteTable_1.DataSource, { data: data, primaryKey: "name" },
|
|
124
|
+
React.createElement(InfiniteTable_1.InfiniteTable, { columnTypes: {
|
|
125
|
+
default: {
|
|
126
|
+
defaultFlex: 1,
|
|
127
|
+
align: 'center',
|
|
128
|
+
sortable: false,
|
|
129
|
+
},
|
|
130
|
+
}, headerOptions: {
|
|
131
|
+
alwaysReserveSpaceForSortIcon: false,
|
|
132
|
+
}, columnHeaderHeight: 50, domProps: tableDOMProps, columns: columnsMap }))));
|
|
133
|
+
};
|
|
134
|
+
const DefaultEntitlementForm = (props) => {
|
|
135
|
+
var _a, _b;
|
|
136
|
+
const abOptions = props.adaptableOptions;
|
|
137
|
+
const entitlementOptions = (_a = props.adaptableOptions) === null || _a === void 0 ? void 0 : _a.entitlementOptions;
|
|
138
|
+
const defaultEntitlement = entitlementOptions === null || entitlementOptions === void 0 ? void 0 : entitlementOptions.defaultAccessLevel;
|
|
139
|
+
if (typeof defaultEntitlement === 'function') {
|
|
140
|
+
return React.createElement(HelpBlock_1.default, { mb: 2 }, "Default Entitlement is controlled by a custom function");
|
|
141
|
+
}
|
|
142
|
+
const handleDefaultEntitlementChange = React.useCallback((accessLevel) => {
|
|
143
|
+
props.onChangeadaptableOptions(Object.assign(Object.assign({}, abOptions), { entitlementOptions: Object.assign(Object.assign({}, abOptions.entitlementOptions), { defaultAccessLevel: accessLevel }) }));
|
|
144
|
+
}, [(_b = abOptions === null || abOptions === void 0 ? void 0 : abOptions.entitlementOptions) === null || _b === void 0 ? void 0 : _b.defaultAccessLevel]);
|
|
145
|
+
return (React.createElement(FormLayout_1.default, { mb: 2 },
|
|
146
|
+
React.createElement(FormLayout_1.FormRow, { label: "Default Entitlement:" },
|
|
147
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange('Full'), checked: defaultEntitlement === 'Full', mr: 3 }, "Visible"),
|
|
148
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange('ReadOnly'), checked: defaultEntitlement === 'ReadOnly', mr: 3 }, "Read Only"),
|
|
149
|
+
React.createElement(Radio_1.default, { onClick: () => handleDefaultEntitlementChange('Hidden'), checked: defaultEntitlement === 'Hidden' }, "Hidden"))));
|
|
150
|
+
};
|
|
8
151
|
const EntitlementsForm = (props) => {
|
|
9
152
|
let abOptions = props.adaptableOptions;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
React.createElement(HelpBlock_1.default, null, "EntitlementOptions Options"),
|
|
14
|
-
React.createElement(FormLayout_1.default, { margin: 2, columns: [{ name: 'children' }, { name: 'label', style: { textAlign: 'start' } }] },
|
|
15
|
-
React.createElement(FormLayout_1.FormRow, { label: "Entitlements to be set here" }))));
|
|
153
|
+
return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column", p: 2 },
|
|
154
|
+
React.createElement(DefaultEntitlementForm, Object.assign({}, props)),
|
|
155
|
+
React.createElement(EntitlementsListForm, Object.assign({}, props))));
|
|
16
156
|
};
|
|
17
157
|
exports.default = EntitlementsForm;
|