@adaptabletools/adaptable 11.0.8 → 11.0.9
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 +54 -54
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/Api/Implementation/LayoutApiImpl.d.ts +4 -0
- package/src/Api/Implementation/LayoutApiImpl.js +26 -0
- package/src/Api/LayoutApi.d.ts +19 -0
- package/src/View/CellSummary/CellSummaryViewPanel.js +3 -2
- package/src/metamodel/adaptable.metamodel.js +24 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.9",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 datagrid add-on that sits on top of an underlying grid component and provides all the rich functionality that advanced users expect from their DataGrids and Data Tables",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
package/publishTimestamp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: 1647786684508;
|
|
2
2
|
export default _default;
|
package/publishTimestamp.js
CHANGED
|
@@ -34,4 +34,8 @@ export declare class LayoutApiImpl extends ApiBase implements LayoutApi {
|
|
|
34
34
|
showLayoutPopup(): void;
|
|
35
35
|
showLayoutEditor(): void;
|
|
36
36
|
isCurrentLayoutReadOnly(): boolean;
|
|
37
|
+
deleteLayout(layout: Layout): void;
|
|
38
|
+
deleteLayoutByName(layoutName: string): void;
|
|
39
|
+
isDefaultLayout(layout: Layout): boolean;
|
|
40
|
+
isCurrentLayoutDefault(): boolean;
|
|
37
41
|
}
|
|
@@ -262,5 +262,31 @@ class LayoutApiImpl extends ApiBase_1.ApiBase {
|
|
|
262
262
|
}
|
|
263
263
|
return true;
|
|
264
264
|
}
|
|
265
|
+
deleteLayout(layout) {
|
|
266
|
+
if (layout.Name === GeneralConstants_1.DEFAULT_LAYOUT) {
|
|
267
|
+
LoggingHelper_1.LogAdaptableWarning('The Default Layout cannot be deleted');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const layoutCount = this.getAllLayout().length;
|
|
271
|
+
if (layoutCount === 1) {
|
|
272
|
+
LoggingHelper_1.LogAdaptableWarning('You cannot delete the only Layout. AdapTable always requires one layout');
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
this.dispatchAction(LayoutRedux.LayoutDelete(layout));
|
|
276
|
+
}
|
|
277
|
+
deleteLayoutByName(layoutName) {
|
|
278
|
+
const layout = this.getLayoutByName(layoutName);
|
|
279
|
+
if (!layout) {
|
|
280
|
+
LoggingHelper_1.LogAdaptableWarning('No Layout exists with that name');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
return this.deleteLayout(layout);
|
|
284
|
+
}
|
|
285
|
+
isDefaultLayout(layout) {
|
|
286
|
+
return layout.Name === GeneralConstants_1.DEFAULT_LAYOUT;
|
|
287
|
+
}
|
|
288
|
+
isCurrentLayoutDefault() {
|
|
289
|
+
return this.isDefaultLayout(this.getCurrentLayout());
|
|
290
|
+
}
|
|
265
291
|
}
|
|
266
292
|
exports.LayoutApiImpl = LayoutApiImpl;
|
package/src/Api/LayoutApi.d.ts
CHANGED
|
@@ -137,6 +137,16 @@ export interface LayoutApi {
|
|
|
137
137
|
* @param caption New Caption to display
|
|
138
138
|
*/
|
|
139
139
|
setColumnCaption(columnId: string, caption: string): void;
|
|
140
|
+
/**
|
|
141
|
+
* Deletes an existing Layout (if not Default or only existing Layout)
|
|
142
|
+
* @param layout The Layout to delete
|
|
143
|
+
*/
|
|
144
|
+
deleteLayout(layout: Layout): void;
|
|
145
|
+
/**
|
|
146
|
+
* Deletes an existing Layout provided by Name (if not Default or only existing Layout)
|
|
147
|
+
* @param layout Name of the Layout to delete
|
|
148
|
+
*/
|
|
149
|
+
deleteLayoutByName(layoutName: string): void;
|
|
140
150
|
/**
|
|
141
151
|
* Specifies where Current Layout is editable
|
|
142
152
|
*/
|
|
@@ -147,4 +157,13 @@ export interface LayoutApi {
|
|
|
147
157
|
* @param column AdaptableColumn
|
|
148
158
|
*/
|
|
149
159
|
showChangeColumnCaption(column: AdaptableColumn): void;
|
|
160
|
+
/**
|
|
161
|
+
* Checks if the given Layout is Default Layout
|
|
162
|
+
* @param layout Layout to Check
|
|
163
|
+
*/
|
|
164
|
+
isDefaultLayout(layout: Layout): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Checks if the Current Layout is Default Layout
|
|
167
|
+
*/
|
|
168
|
+
isCurrentLayoutDefault(): boolean;
|
|
150
169
|
}
|
|
@@ -38,7 +38,8 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
38
38
|
onClick: () => this.props.onCellSummaryOperationChange(summaryOperation),
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
const cellSummaryOperationDefinitions = this.props.api.internalApi.getAdaptableOptions()
|
|
41
|
+
const cellSummaryOperationDefinitions = this.props.api.internalApi.getAdaptableOptions()
|
|
42
|
+
.generalOptions.cellSummaryOperations;
|
|
42
43
|
const operationDefinitions = ArrayExtensions_1.default.IsNullOrEmpty(cellSummaryOperationDefinitions)
|
|
43
44
|
? []
|
|
44
45
|
: cellSummaryOperationDefinitions.map((operationDefinition) => {
|
|
@@ -59,7 +60,7 @@ class CellSummaryViewPanelComponent extends React.Component {
|
|
|
59
60
|
if (operationValue == undefined) {
|
|
60
61
|
return;
|
|
61
62
|
}
|
|
62
|
-
return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
|
|
63
|
+
return this.props.viewType === 'ToolPanel' ? (React.createElement(rebass_1.Flex, { className: `ab-${elementType}__CellSummary__value`, style: { borderRadius: 'var(--ab__border-radius)' }, marginRight: 2, padding: 2, color: 'var( --ab-color-text-on-info)', backgroundColor: 'var(--ab-color-info)', fontSize: 'var( --ab-font-size-2)' }, operationValue)) : (React.createElement(rebass_1.Flex, { flex: 1, marginRight: 2, marginLeft: 1, justifyContent: "center", className: `ab-${elementType}__CellSummary__value`, color: 'var(--ab-color-text-on-primary)' }, operationValue));
|
|
63
64
|
};
|
|
64
65
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
65
66
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: shouldDisable ? GeneralConstants.READ_ONLY_STYLE : `ab-${elementType}__CellSummary__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
@@ -8036,6 +8036,18 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
8036
8036
|
"description": "Creates new Layout in the state",
|
|
8037
8037
|
"uiLabel": "Create Layout"
|
|
8038
8038
|
},
|
|
8039
|
+
{
|
|
8040
|
+
"name": "deleteLayout",
|
|
8041
|
+
"kind": "function",
|
|
8042
|
+
"description": "Deletes an existing Layout (if not Default or only existing Layout)",
|
|
8043
|
+
"uiLabel": "Delete Layout"
|
|
8044
|
+
},
|
|
8045
|
+
{
|
|
8046
|
+
"name": "deleteLayoutByName",
|
|
8047
|
+
"kind": "function",
|
|
8048
|
+
"description": "Deletes an existing Layout provided by Name (if not Default or only existing Layout)",
|
|
8049
|
+
"uiLabel": "Delete Layout By Name"
|
|
8050
|
+
},
|
|
8039
8051
|
{
|
|
8040
8052
|
"name": "doesLayoutExist",
|
|
8041
8053
|
"kind": "function",
|
|
@@ -8108,12 +8120,24 @@ exports.ADAPTABLE_METAMODEL = {
|
|
|
8108
8120
|
"description": "Retrieves Layout section from Adaptable State",
|
|
8109
8121
|
"uiLabel": "Get Layout State"
|
|
8110
8122
|
},
|
|
8123
|
+
{
|
|
8124
|
+
"name": "isCurrentLayoutDefault",
|
|
8125
|
+
"kind": "function",
|
|
8126
|
+
"description": "Checks if the Current Layout is Default Layout",
|
|
8127
|
+
"uiLabel": "Is Current Layout Default"
|
|
8128
|
+
},
|
|
8111
8129
|
{
|
|
8112
8130
|
"name": "isCurrentLayoutReadOnly",
|
|
8113
8131
|
"kind": "function",
|
|
8114
8132
|
"description": "Specifies where Current Layout is editable",
|
|
8115
8133
|
"uiLabel": "Is Current Layout Read Only"
|
|
8116
8134
|
},
|
|
8135
|
+
{
|
|
8136
|
+
"name": "isDefaultLayout",
|
|
8137
|
+
"kind": "function",
|
|
8138
|
+
"description": "Checks if the given Layout is Default Layout",
|
|
8139
|
+
"uiLabel": "Is Default Layout"
|
|
8140
|
+
},
|
|
8117
8141
|
{
|
|
8118
8142
|
"name": "saveCurrentLayout",
|
|
8119
8143
|
"kind": "function",
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "11.0.
|
|
1
|
+
declare const _default: "11.0.9";
|
|
2
2
|
export default _default;
|
package/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = '11.0.
|
|
3
|
+
exports.default = '11.0.9'; // PLEASE DONT UPDATE THIS!!! - will be updated at build time with the correct version
|