@openui5/sap.ui.mdc 1.130.1 → 1.131.0
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/THIRDPARTY.txt +1 -1
- package/package.json +4 -4
- package/src/sap/ui/mdc/.library +1 -1
- package/src/sap/ui/mdc/ActionToolbar.js +1 -1
- package/src/sap/ui/mdc/Chart.js +62 -25
- package/src/sap/ui/mdc/ChartDelegate.js +17 -14
- package/src/sap/ui/mdc/Control.js +1 -1
- package/src/sap/ui/mdc/DefaultTypeMap.js +1 -1
- package/src/sap/ui/mdc/Element.js +1 -1
- package/src/sap/ui/mdc/Field.js +43 -15
- package/src/sap/ui/mdc/FilterBar.js +1 -1
- package/src/sap/ui/mdc/FilterField.js +2 -2
- package/src/sap/ui/mdc/Link.js +1 -1
- package/src/sap/ui/mdc/LinkDelegate.js +1 -1
- package/src/sap/ui/mdc/MultiValueField.js +3 -4
- package/src/sap/ui/mdc/Table.js +183 -36
- package/src/sap/ui/mdc/TableDelegate.js +40 -18
- package/src/sap/ui/mdc/ValueHelp.js +1 -1
- package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -2
- package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +1 -1
- package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
- package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/chart/ToolbarControlFactory.js +1 -1
- package/src/sap/ui/mdc/condition/Condition.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
- package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
- package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
- package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +361 -54
- package/src/sap/ui/mdc/condition/Operator.js +1 -1
- package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
- package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
- package/src/sap/ui/mdc/enums/ActionToolbarActionAlignment.js +0 -1
- package/src/sap/ui/mdc/enums/OperatorName.js +127 -1
- package/src/sap/ui/mdc/field/ConditionType.js +1 -1
- package/src/sap/ui/mdc/field/ConditionTypeMixin.js +1 -1
- package/src/sap/ui/mdc/field/ConditionsType.js +1 -1
- package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
- package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +1 -1
- package/src/sap/ui/mdc/field/FieldBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldBaseDelegate.js +2 -2
- package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
- package/src/sap/ui/mdc/field/FieldInput.js +1 -1
- package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
- package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
- package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
- package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +0 -1
- package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -2
- package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
- package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
- package/src/sap/ui/mdc/filterbar/FilterBarBase.js +1 -1
- package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
- package/src/sap/ui/mdc/filterbar/vh/CollectiveSearchSelect.js +4 -1
- package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +5 -2
- package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
- package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
- package/src/sap/ui/mdc/flexibility/actiontoolbar/CombineAction.js +1 -2
- package/src/sap/ui/mdc/flexibility/actiontoolbar/SplitAction.js +1 -2
- package/src/sap/ui/mdc/library.js +2 -2
- package/src/sap/ui/mdc/link/Factory.js +1 -1
- package/src/sap/ui/mdc/link/LinkItem.js +1 -1
- package/src/sap/ui/mdc/link/Panel.js +1 -1
- package/src/sap/ui/mdc/link/PanelItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/messagebundle.properties +12 -148
- package/src/sap/ui/mdc/messagebundle_ar.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_bg.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ca.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_cnr.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_cs.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_cy.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_da.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_de.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_el.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_en.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +6 -98
- package/src/sap/ui/mdc/messagebundle_es.properties +7 -97
- package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_et.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_fi.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_fr.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_fr_CA.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_hi.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_hr.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_hu.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_id.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_it.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_iw.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ja.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_kk.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ko.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_lt.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_lv.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_mk.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ms.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_nl.properties +7 -97
- package/src/sap/ui/mdc/messagebundle_no.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_pl.properties +9 -99
- package/src/sap/ui/mdc/messagebundle_pt.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ro.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_ru.properties +13 -103
- package/src/sap/ui/mdc/messagebundle_sh.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_sk.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_sl.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_sr.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_sv.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_th.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_tr.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_uk.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_vi.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_zh_CN.properties +6 -96
- package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -96
- package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
- package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
- package/src/sap/ui/mdc/odata/TypeMap.js +1 -1
- package/src/sap/ui/mdc/odata/v4/TableDelegate.js +239 -197
- package/src/sap/ui/mdc/odata/v4/TypeMap.js +1 -1
- package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +19 -19
- package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +12 -19
- package/src/sap/ui/mdc/table/Column.js +3 -0
- package/src/sap/ui/mdc/table/ColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/CreationRow.js +1 -1
- package/src/sap/ui/mdc/table/DragDropConfig.js +1 -1
- package/src/sap/ui/mdc/table/GridTableType.js +3 -1
- package/src/sap/ui/mdc/table/PropertyHelper.js +14 -1
- package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +1 -1
- package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
- package/src/sap/ui/mdc/table/RowSettings.js +3 -2
- package/src/sap/ui/mdc/table/TableSettings.js +26 -3
- package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +32 -41
- package/src/sap/ui/mdc/table/utils/Personalization.js +1 -1
- package/src/sap/ui/mdc/ushell/SemanticObjectMapping.js +1 -1
- package/src/sap/ui/mdc/ushell/SemanticObjectMappingItem.js +1 -1
- package/src/sap/ui/mdc/ushell/SemanticObjectUnavailableAction.js +1 -1
- package/src/sap/ui/mdc/util/InfoBar.js +2 -1
- package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
- package/src/sap/ui/mdc/util/PropertyHelper.js +1 -1
- package/src/sap/ui/mdc/valuehelp/CollectiveSearchSelect.js +2 -10
- package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
- package/src/sap/ui/mdc/valuehelp/FilterBar.js +1 -1
- package/src/sap/ui/mdc/valuehelp/Popover.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/DefineConditionPanel.js +30 -32
- package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedList.js +6 -1
- package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +1 -1
- package/src/sap/ui/mdc/valuehelp/content/MTable.js +17 -4
package/src/sap/ui/mdc/Table.js
CHANGED
|
@@ -165,9 +165,9 @@ sap.ui.define([
|
|
|
165
165
|
* @property {boolean} [isKey=false]
|
|
166
166
|
* Defines whether a property is a key or part of a key in the data.
|
|
167
167
|
* @property {string} [unit]
|
|
168
|
-
* Key of the unit property that is related to this property.
|
|
168
|
+
* Key of the unit property that is related to this property. A property must not have both a unit and a text.
|
|
169
169
|
* @property {string} [text]
|
|
170
|
-
* Key of the text property that is related to this property in a 1:1 relation.
|
|
170
|
+
* Key of the text property that is related to this property in a 1:1 relation. A property must not have both a unit and a text.
|
|
171
171
|
* @property {object} [exportSettings]
|
|
172
172
|
* Object that contains information about the export settings, see {@link sap.ui.export.Spreadsheet}.
|
|
173
173
|
* @property {object} [clipboardSettings]
|
|
@@ -201,6 +201,8 @@ sap.ui.define([
|
|
|
201
201
|
* @public
|
|
202
202
|
*/
|
|
203
203
|
|
|
204
|
+
// TODO: The extension in PropertyInfo has been discarded as a general concept in MDC, therefore it might be justified to move this typedef to
|
|
205
|
+
// sap.ui.mdc.odata.v4.TableDelegate. They are tightly coupled and other MDC controls also won't contain multiple PropertyInfo definitions.
|
|
204
206
|
/**
|
|
205
207
|
* @typedef {sap.ui.mdc.table.PropertyInfo} sap.ui.mdc.odata.v4.TablePropertyInfo
|
|
206
208
|
*
|
|
@@ -235,6 +237,8 @@ sap.ui.define([
|
|
|
235
237
|
* <li><code>propertyInfos</code> (all referenced properties must be specified)</li>
|
|
236
238
|
* </ul>
|
|
237
239
|
*
|
|
240
|
+
* @property {boolean} [isKey=false]
|
|
241
|
+
* Defines whether a property is a key or part of a key in the data. A key property must be technically groupable.
|
|
238
242
|
* @property {boolean} [aggregatable=false]
|
|
239
243
|
* Defines whether the property is aggregatable. A property can only be declared aggregatable if there is a <code>CustomAggregate</code> whose
|
|
240
244
|
* <code>Qualifier</code> is equal to the property key.
|
|
@@ -250,7 +254,8 @@ sap.ui.define([
|
|
|
250
254
|
* <code>aggregatable</code>.
|
|
251
255
|
* @property {string[]} [extension.additionalProperties]
|
|
252
256
|
* Properties that are loaded in addition if this property is loaded. These properties must be technically groupable, otherwise they can't be
|
|
253
|
-
* loaded.
|
|
257
|
+
* loaded. All nested additional properties must be listed at root level. For example, if property A references B and B references C, A must
|
|
258
|
+
* also reference C.
|
|
254
259
|
* This attribute is only taken into account if the <code>Aggregate</code> or <code>Group</code> <code>p13nMode</code> is enabled and the
|
|
255
260
|
* table type is {@link sap.ui.mdc.table.GridTableType GridTable}.
|
|
256
261
|
* These properties are not considered for any other functionality, such as export or column width calculation, for example.
|
|
@@ -994,7 +999,9 @@ sap.ui.define([
|
|
|
994
999
|
this._setPropertyHelperClass(PropertyHelper);
|
|
995
1000
|
this._setupPropertyInfoStore("propertyInfo");
|
|
996
1001
|
|
|
997
|
-
this._oManagedObjectModel = new ManagedObjectModel(this
|
|
1002
|
+
this._oManagedObjectModel = new ManagedObjectModel(this, {
|
|
1003
|
+
hasGrandTotal: false
|
|
1004
|
+
});
|
|
998
1005
|
this._oManagedObjectModel.setDefaultBindingMode(BindingMode.OneWay);
|
|
999
1006
|
this.setModel(this._oManagedObjectModel, "$sap.ui.mdc.Table");
|
|
1000
1007
|
};
|
|
@@ -2313,29 +2320,72 @@ sap.ui.define([
|
|
|
2313
2320
|
});
|
|
2314
2321
|
};
|
|
2315
2322
|
|
|
2316
|
-
Table.prototype.
|
|
2317
|
-
|
|
2323
|
+
Table.prototype.setSelectionMode = function(sSelectionMode) {
|
|
2324
|
+
const sOldSelectionMode = this.getSelectionMode();
|
|
2325
|
+
|
|
2326
|
+
this.setProperty("selectionMode", sSelectionMode, true);
|
|
2327
|
+
|
|
2328
|
+
if (sOldSelectionMode !== sSelectionMode) {
|
|
2329
|
+
this._updateExpandAllButton(true);
|
|
2330
|
+
this._updateCollapseAllButton(true);
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
return this;
|
|
2334
|
+
};
|
|
2335
|
+
|
|
2336
|
+
/**
|
|
2337
|
+
* Checks if collapse capabilities are enabled.
|
|
2338
|
+
*
|
|
2339
|
+
* @returns {boolean} whether collapse capabilities are enabled
|
|
2340
|
+
*/
|
|
2341
|
+
Table.prototype._isCollapseEnabled = async function() {
|
|
2342
|
+
if (!this.isControlDelegateInitialized()) {
|
|
2343
|
+
return false;
|
|
2344
|
+
}
|
|
2345
|
+
const oConfig = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
|
|
2346
|
+
let bAvailable = false;
|
|
2347
|
+
|
|
2348
|
+
if ("collapseAll" in oConfig) {
|
|
2349
|
+
if (typeof oConfig.collapseAll !== "function") {
|
|
2350
|
+
throw new Error("TableDelegate#collapseAll: collapseAll needs to be a function");
|
|
2351
|
+
}
|
|
2352
|
+
bAvailable = true;
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
if ("collapseAllFromNode" in oConfig && "isNodeExpanded" in oConfig) {
|
|
2356
|
+
if (typeof oConfig.collapseAllFromNode !== "function") {
|
|
2357
|
+
throw new Error("TableDelegate#fetchExpandAndCollapseConfiguration: collapseAllFromNode needs to be a function");
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
if (typeof oConfig.isNodeExpanded !== "function") {
|
|
2361
|
+
throw new Error("TableDelegate#isNodeExpanded: isNodeExpanded needs to be a function");
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
bAvailable = true;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
return bAvailable;
|
|
2318
2368
|
};
|
|
2319
2369
|
|
|
2320
2370
|
/**
|
|
2321
2371
|
* Retrieves the "Collapse All" button. Creates the button if necessary.
|
|
2322
2372
|
*
|
|
2323
|
-
* @
|
|
2373
|
+
* @param {boolean} bRecreate Whether the button should be recreated
|
|
2324
2374
|
* @private
|
|
2325
2375
|
*/
|
|
2326
|
-
Table.prototype._updateCollapseAllButton = function() {
|
|
2327
|
-
const
|
|
2376
|
+
Table.prototype._updateCollapseAllButton = async function(bRecreate) {
|
|
2377
|
+
const bCollapseAllAvailable = await this._isCollapseEnabled();
|
|
2378
|
+
const bNeedCollapseAllButton = this._oToolbar != null && bCollapseAllAvailable;
|
|
2328
2379
|
|
|
2329
|
-
if (bNeedCollapseAllButton && !this._oCollapseAllButton) {
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
], false);
|
|
2380
|
+
if (bNeedCollapseAllButton && (!this._oCollapseAllButton || bRecreate)) {
|
|
2381
|
+
if (this._oCollapseAllButton) {
|
|
2382
|
+
if (this._oToolbar && this._oToolbar.getEnd().includes(this._oCollapseAllButton)) {
|
|
2383
|
+
this._oToolbar.removeEnd(this._oCollapseAllButton);
|
|
2384
|
+
}
|
|
2385
|
+
this._oCollapseAllButton.destroy();
|
|
2386
|
+
this._oCollapseAllButton = null;
|
|
2387
|
+
}
|
|
2388
|
+
this._oCollapseAllButton = await this._createCollapseButton();
|
|
2339
2389
|
}
|
|
2340
2390
|
|
|
2341
2391
|
if (!this._oCollapseAllButton) {
|
|
@@ -2347,32 +2397,62 @@ sap.ui.define([
|
|
|
2347
2397
|
}
|
|
2348
2398
|
|
|
2349
2399
|
this._oCollapseAllButton.setEnabled(!MTableUtil.isEmpty(this.getRowBinding()));
|
|
2350
|
-
this._oCollapseAllButton.setVisible(
|
|
2400
|
+
this._oCollapseAllButton.setVisible(bCollapseAllAvailable);
|
|
2351
2401
|
};
|
|
2352
2402
|
|
|
2353
|
-
|
|
2354
|
-
|
|
2403
|
+
/**
|
|
2404
|
+
* Checks if expand capabilities are enabled.
|
|
2405
|
+
*
|
|
2406
|
+
* @returns {boolean} whether expand capabilities are enabled
|
|
2407
|
+
*/
|
|
2408
|
+
Table.prototype._isExpandEnabled = async function() {
|
|
2409
|
+
if (!this.isControlDelegateInitialized()) {
|
|
2410
|
+
return false;
|
|
2411
|
+
}
|
|
2412
|
+
const oConfig = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
|
|
2413
|
+
let bAvailable = false;
|
|
2414
|
+
|
|
2415
|
+
if ("expandAll" in oConfig) {
|
|
2416
|
+
if (typeof oConfig.expandAll !== "function") {
|
|
2417
|
+
throw new Error("TableDelegate#expandAll: expandAll needs to be a function");
|
|
2418
|
+
}
|
|
2419
|
+
bAvailable = true;
|
|
2420
|
+
}
|
|
2421
|
+
|
|
2422
|
+
if ("expandAllFromNode" in oConfig && "isNodeExpanded" in oConfig) {
|
|
2423
|
+
if (typeof oConfig.expandAllFromNode !== "function") {
|
|
2424
|
+
throw new Error("TableDelegate#fetchExpandAndCollapseConfiguration: expandAllFromNode needs to be a function");
|
|
2425
|
+
}
|
|
2426
|
+
|
|
2427
|
+
if (typeof oConfig.isNodeExpanded !== "function") {
|
|
2428
|
+
throw new Error("TableDelegate#isNodeExpanded: isNodeExpanded needs to be a function");
|
|
2429
|
+
}
|
|
2430
|
+
|
|
2431
|
+
bAvailable = true;
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
return bAvailable;
|
|
2355
2435
|
};
|
|
2356
2436
|
|
|
2357
2437
|
/**
|
|
2358
2438
|
* Retrieves the "Collapse All" button. Creates the button if necessary.
|
|
2359
2439
|
*
|
|
2360
|
-
* @
|
|
2440
|
+
* @param {boolean} bRecreate Whether the button should be recreated
|
|
2361
2441
|
* @private
|
|
2362
2442
|
*/
|
|
2363
|
-
Table.prototype._updateExpandAllButton = function() {
|
|
2364
|
-
const
|
|
2443
|
+
Table.prototype._updateExpandAllButton = async function(bRecreate) {
|
|
2444
|
+
const bExpandAllAvailable = await this._isExpandEnabled();
|
|
2445
|
+
const bNeedExpandAllButton = this._oToolbar != null && bExpandAllAvailable;
|
|
2365
2446
|
|
|
2366
|
-
if (bNeedExpandAllButton && !this._oExpandAllButton) {
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
], true);
|
|
2447
|
+
if (bNeedExpandAllButton && (!this._oExpandAllButton || bRecreate)) {
|
|
2448
|
+
if (this._oExpandAllButton) {
|
|
2449
|
+
if (this._oToolbar && this._oToolbar.getEnd().includes(this._oExpandAllButton)) {
|
|
2450
|
+
this._oToolbar.removeEnd(this._oExpandAllButton);
|
|
2451
|
+
}
|
|
2452
|
+
this._oExpandAllButton.destroy();
|
|
2453
|
+
this._oExpandAllButton = null;
|
|
2454
|
+
}
|
|
2455
|
+
this._oExpandAllButton = await this._createExpandButton();
|
|
2376
2456
|
}
|
|
2377
2457
|
|
|
2378
2458
|
if (!this._oExpandAllButton) {
|
|
@@ -2384,7 +2464,74 @@ sap.ui.define([
|
|
|
2384
2464
|
}
|
|
2385
2465
|
|
|
2386
2466
|
this._oExpandAllButton.setEnabled(!MTableUtil.isEmpty(this.getRowBinding()));
|
|
2387
|
-
this._oExpandAllButton.setVisible(
|
|
2467
|
+
this._oExpandAllButton.setVisible(bExpandAllAvailable);
|
|
2468
|
+
};
|
|
2469
|
+
|
|
2470
|
+
/**
|
|
2471
|
+
* Create an expand button for the toolbar.
|
|
2472
|
+
*
|
|
2473
|
+
* @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
|
|
2474
|
+
*/
|
|
2475
|
+
Table.prototype._createExpandButton = async function() {
|
|
2476
|
+
const oConfiguration = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
|
|
2477
|
+
return this._createExpandCollapseButton(true, {
|
|
2478
|
+
tree: oConfiguration.expandAll,
|
|
2479
|
+
node: oConfiguration.expandAllFromNode,
|
|
2480
|
+
isExpanded: oConfiguration.isNodeExpanded
|
|
2481
|
+
});
|
|
2482
|
+
};
|
|
2483
|
+
|
|
2484
|
+
/**
|
|
2485
|
+
* Create a collapse button for the toolbar.
|
|
2486
|
+
*
|
|
2487
|
+
* @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
|
|
2488
|
+
*/
|
|
2489
|
+
Table.prototype._createCollapseButton = async function() {
|
|
2490
|
+
const oConfiguration = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
|
|
2491
|
+
return this._createExpandCollapseButton(false, {
|
|
2492
|
+
tree: oConfiguration.collapseAll,
|
|
2493
|
+
node: oConfiguration.collapseAllFromNode,
|
|
2494
|
+
isExpanded: oConfiguration.isNodeExpanded
|
|
2495
|
+
});
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
/**
|
|
2499
|
+
* Creates either an expand or collapse button as button or menu button.
|
|
2500
|
+
*
|
|
2501
|
+
* @param {*} bIsExpand whether the button should expand or collapse
|
|
2502
|
+
* @param {object} mConfig configuration map that contains the expand/collapse methods
|
|
2503
|
+
* @param {function} mConfig.tree method to expand/collapse the whole tree
|
|
2504
|
+
* @param {function} mConfig.node method to expand/collapse a single node
|
|
2505
|
+
* @param {function} mConfig.isExpanded method to check if a node is expanded
|
|
2506
|
+
*
|
|
2507
|
+
* @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
|
|
2508
|
+
* @private
|
|
2509
|
+
*/
|
|
2510
|
+
Table.prototype._createExpandCollapseButton = function(bIsExpand, mConfig) {
|
|
2511
|
+
const { tree: fnTree, node: fnNode, isExpanded: fnIsExpanded } = mConfig;
|
|
2512
|
+
|
|
2513
|
+
if (this.getSelectionMode() === "None" || typeof fnNode !== "function" || typeof fnIsExpanded !== "function") {
|
|
2514
|
+
return TableSettings.createExpandCollapseButton(this.getId(), bIsExpand, () => fnTree(this));
|
|
2515
|
+
}
|
|
2516
|
+
|
|
2517
|
+
const oMenuButton = TableSettings.createExpandCollapseMenuButton(this.getId(), bIsExpand, {
|
|
2518
|
+
"tree": () => fnTree(this),
|
|
2519
|
+
"node": () => {
|
|
2520
|
+
const aContexts = this.getSelectedContexts();
|
|
2521
|
+
return aContexts.length === 1 && fnNode(this, aContexts[0]);
|
|
2522
|
+
}
|
|
2523
|
+
});
|
|
2524
|
+
|
|
2525
|
+
oMenuButton.attachBeforeMenuOpen(() => {
|
|
2526
|
+
const aContexts = this.getSelectedContexts();
|
|
2527
|
+
// Node needs to be expanded to collapse it and vice versa
|
|
2528
|
+
const bShowNodeOption = aContexts.length === 1 && fnIsExpanded(this, aContexts[0]) === !bIsExpand;
|
|
2529
|
+
|
|
2530
|
+
oMenuButton.getMenu().getItems()[0].setEnabled(fnTree != undefined);
|
|
2531
|
+
oMenuButton.getMenu().getItems()[1].setEnabled(bShowNodeOption);
|
|
2532
|
+
});
|
|
2533
|
+
|
|
2534
|
+
return oMenuButton;
|
|
2388
2535
|
};
|
|
2389
2536
|
|
|
2390
2537
|
/**
|
|
@@ -113,6 +113,18 @@ sap.ui.define([
|
|
|
113
113
|
* @protected
|
|
114
114
|
*/
|
|
115
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Represents the expand and collapse configuration object.
|
|
118
|
+
*
|
|
119
|
+
* @typedef {object} sap.ui.mdc.TableDelegate.ExpandAndCollapseConfiguration
|
|
120
|
+
*
|
|
121
|
+
* @property {function(sap.ui.mdc.Table): void} [expandAll] Function to expand all rows
|
|
122
|
+
* @property {function(sap.ui.mdc.Table): void} [collapseAll] Function to collapse all rows
|
|
123
|
+
* @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [expandAllFromNode] Function to expand all rows from a specific node
|
|
124
|
+
* @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [collapseAllFromNode] Function to collapse all rows from a specific node
|
|
125
|
+
* @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [isNodeExpanded] Function to check if a specific node is expanded
|
|
126
|
+
*/
|
|
127
|
+
|
|
116
128
|
/**
|
|
117
129
|
* Updates the binding info object that is used to bind the table in {@link module:sap/ui/mdc/TableDelegate.updateBinding updateBinding}.
|
|
118
130
|
*
|
|
@@ -342,25 +354,37 @@ sap.ui.define([
|
|
|
342
354
|
};
|
|
343
355
|
|
|
344
356
|
/**
|
|
345
|
-
*
|
|
357
|
+
* Returns the feature set for expanding or collapsing in the table.
|
|
346
358
|
*
|
|
347
|
-
*
|
|
348
|
-
* @throws {Error} If the delegate does not support this operation
|
|
349
|
-
* @protected
|
|
350
|
-
*/
|
|
351
|
-
TableDelegate.expandAllRows = function(oTable) {
|
|
352
|
-
throw Error("Unsupported operation: TableDelegate.expandAllRows");
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
/**
|
|
356
|
-
* Collapses all rows.
|
|
359
|
+
* By default, this method returns an empty object.
|
|
357
360
|
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
361
|
+
* The configuration object needs to contain the following functions to enable specific functionalities:
|
|
362
|
+
* <ul>
|
|
363
|
+
* <li>To enable the <b>expand all</b> functionality, you need to implement the <code>expandAll</code> function in the configuration object.</li>
|
|
364
|
+
* <li>To enable the <b>collapse all</b> functionality, you need to implement the <code>collapseAll</code> function in the configuration object.</li>
|
|
365
|
+
* <li>To enable the <b>expand all from a specific node</b> functionality, you need to implement the <code>expandAllFromNode</code> and the <code>isNodeExpanded</code> function in the configuration object.</li>
|
|
366
|
+
* <li>To enable the <b>collapse all from a specific node</b> functionality, you need to implement the <code>collapseAllFromNode</code> and the <code>isNodeExpanded</code> function in the configuration object.</li>
|
|
367
|
+
* <ul>
|
|
368
|
+
*
|
|
369
|
+
* <b>Note:</b> Expand and collapse all from a specific node is only supported, if the table rows are selectable.
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* TableDelegate.fetchExpandAndCollapseConfiguration = function(oTable) {
|
|
373
|
+
* return Promise.resolve({
|
|
374
|
+
* expandAll: function(oTable) {
|
|
375
|
+
* // Implement expandAll functionality
|
|
376
|
+
* },
|
|
377
|
+
* collapseAll: function(oTable) {
|
|
378
|
+
* // Implement collapseAll functionality
|
|
379
|
+
* }
|
|
380
|
+
* });
|
|
381
|
+
* }
|
|
382
|
+
* @param {sap.ui.mdc.Table} oTable table instance
|
|
383
|
+
* @returns {Promise<sap.ui.mdc.TableDelegate.ExpandAndCollapseConfiguration>} A <code>Promise</code> that resolves with an object containing the expand and collapse functions
|
|
360
384
|
* @protected
|
|
361
385
|
*/
|
|
362
|
-
TableDelegate.
|
|
363
|
-
|
|
386
|
+
TableDelegate.fetchExpandAndCollapseConfiguration = function(oTable) {
|
|
387
|
+
return Promise.resolve({});
|
|
364
388
|
};
|
|
365
389
|
|
|
366
390
|
/**
|
|
@@ -381,9 +405,7 @@ sap.ui.define([
|
|
|
381
405
|
|
|
382
406
|
return {
|
|
383
407
|
p13nModes: aSupportedP13nModes,
|
|
384
|
-
"export": true
|
|
385
|
-
expandAllRows: false,
|
|
386
|
-
collapseAllRows: false
|
|
408
|
+
"export": true
|
|
387
409
|
};
|
|
388
410
|
};
|
|
389
411
|
|
|
@@ -67,7 +67,7 @@ sap.ui.define([
|
|
|
67
67
|
* and {@link sap.ui.mdc.FilterField FilterField} controls using the <code>valueHelp</code> association. One <code>ValueHelp</code> element instance can be
|
|
68
68
|
* assigned to multiple fields (like in different table rows). It should be placed in the control tree on the container holding the fields.
|
|
69
69
|
* @extends sap.ui.mdc.Element
|
|
70
|
-
* @version 1.
|
|
70
|
+
* @version 1.131.0
|
|
71
71
|
* @constructor
|
|
72
72
|
* @abstract
|
|
73
73
|
* @public
|
|
@@ -20,11 +20,10 @@ sap.ui.define([
|
|
|
20
20
|
* The action for an {@link sap.ui.mdc.ActionToolbar ActionToolbar} control with given layout information that determines where the wrapped control is displayed on the <code>ActionToolbar</code>.
|
|
21
21
|
* @extends sap.ui.core.Control
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.131.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @since 1.58
|
|
26
26
|
* @private
|
|
27
|
-
* @experimental
|
|
28
27
|
* @alias sap.ui.mdc.actiontoolbar.ActionToolbarAction
|
|
29
28
|
*/
|
|
30
29
|
const ActionToolbarAction = Control.extend("sap.ui.mdc.actiontoolbar.ActionToolbarAction", {
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* @class The <code>ChartImplementationContainer</code> creates a container for the <code>content</code> (chart) and <code>noDataContent</code>. Based on the <code>showNoDataStruct</code> the <code>content</code> or <code>noDataContent</code> will be shown.
|
|
22
22
|
* @extends sap.ui.core.Control
|
|
23
23
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.131.0
|
|
25
25
|
* @constructor
|
|
26
26
|
*
|
|
27
27
|
* @public
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @class The <code>ChartSelectionDetails</code> control creates a <code>sap.m.SelectionDetails</code> popover based on metadata and the configuration specified.
|
|
39
39
|
* @extends sap.m.SelectionDetails
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.131.0
|
|
42
42
|
* @constructor
|
|
43
43
|
* @public
|
|
44
44
|
* @experimental As of version 1.88
|