@sapui5/sap.fe.macros 1.138.0 → 1.140.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/package.json +1 -1
- package/src/sap/fe/macros/.library +1 -1
- package/src/sap/fe/macros/Breadcrumbs.js +269 -0
- package/src/sap/fe/macros/Breadcrumbs.tsx +243 -0
- package/src/sap/fe/macros/CommonHelper.js +2 -2
- package/src/sap/fe/macros/CommonHelper.ts +1 -1
- package/src/sap/fe/macros/Field.js +85 -58
- package/src/sap/fe/macros/Field.ts +104 -60
- package/src/sap/fe/macros/FooterContent.js +44 -11
- package/src/sap/fe/macros/FooterContent.tsx +48 -9
- package/src/sap/fe/macros/FormElement.js +2 -2
- package/src/sap/fe/macros/FormElement.ts +1 -2
- package/src/sap/fe/macros/MessageButton.js +1 -2
- package/src/sap/fe/macros/MessageButton.tsx +0 -1
- package/src/sap/fe/macros/MultiValueField.js +17 -6
- package/src/sap/fe/macros/MultiValueField.tsx +7 -4
- package/src/sap/fe/macros/RichTextEditor.js +30 -5
- package/src/sap/fe/macros/RichTextEditor.tsx +34 -6
- package/src/sap/fe/macros/Share.js +85 -40
- package/src/sap/fe/macros/Share.tsx +42 -1
- package/src/sap/fe/macros/Status.js +226 -0
- package/src/sap/fe/macros/Status.tsx +192 -0
- package/src/sap/fe/macros/ValueHelp.js +4 -29
- package/src/sap/fe/macros/ValueHelp.tsx +2 -43
- package/src/sap/fe/macros/ai/EasyFillButton.js +10 -4
- package/src/sap/fe/macros/ai/EasyFillButton.tsx +8 -1
- package/src/sap/fe/macros/ai/EasyFillDialog.js +25 -10
- package/src/sap/fe/macros/ai/EasyFillDialog.tsx +32 -23
- package/src/sap/fe/macros/ai/EasyFilterBar.js +123 -114
- package/src/sap/fe/macros/ai/EasyFilterBar.tsx +140 -124
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.js +11 -5
- package/src/sap/fe/macros/ai/EasyFilterDataFetcher.ts +14 -5
- package/src/sap/fe/macros/ai/SummarizationButton.js +2 -2
- package/src/sap/fe/macros/ai/SummarizationButton.tsx +1 -1
- package/src/sap/fe/macros/chart/ChartDelegate.js +4 -4
- package/src/sap/fe/macros/chart/ChartDelegate.ts +3 -3
- package/src/sap/fe/macros/chart/ChartHelper.js +1 -2
- package/src/sap/fe/macros/chart/ChartHelper.ts +0 -1
- package/src/sap/fe/macros/chart/ChartRuntime.js +1 -2
- package/src/sap/fe/macros/chart/ChartRuntime.ts +0 -1
- package/src/sap/fe/macros/chart/MdcChartTemplate.js +20 -6
- package/src/sap/fe/macros/chart/MdcChartTemplate.tsx +16 -8
- package/src/sap/fe/macros/controls/BuildingBlockWithTemplating.js +3 -1
- package/src/sap/fe/macros/controls/BuildingBlockWithTemplating.ts +2 -0
- package/src/sap/fe/macros/controls/FieldWrapper.js +9 -3
- package/src/sap/fe/macros/controls/FieldWrapper.ts +11 -2
- package/src/sap/fe/macros/controls/FilterBar.js +49 -2
- package/src/sap/fe/macros/controls/FilterBar.ts +55 -1
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.js +2 -2
- package/src/sap/fe/macros/controls/NumberWithUnitOrCurrency.tsx +2 -2
- package/src/sap/fe/macros/controls/RequiredFlexBox.js +62 -0
- package/src/sap/fe/macros/controls/RequiredFlexBox.tsx +20 -0
- package/src/sap/fe/macros/controls/filterbar/VisualFilter.js +21 -11
- package/src/sap/fe/macros/controls/filterbar/VisualFilter.ts +25 -11
- package/src/sap/fe/macros/controls/filterbar/VisualFilterContainer.js +11 -2
- package/src/sap/fe/macros/controls/filterbar/VisualFilterContainer.ts +12 -1
- package/src/sap/fe/macros/controls/filterbar/utils/VisualFilterUtils.js +18 -1
- package/src/sap/fe/macros/controls/filterbar/utils/VisualFilterUtils.ts +20 -0
- package/src/sap/fe/macros/coreUI/CreateDialog.js +2 -2
- package/src/sap/fe/macros/coreUI/CreateDialog.tsx +1 -1
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.js +43 -4
- package/src/sap/fe/macros/coreUI/OperationParameterDialog.tsx +48 -1
- package/src/sap/fe/macros/designtime/Designtime.helper.js +39 -2
- package/src/sap/fe/macros/designtime/Designtime.helper.ts +39 -0
- package/src/sap/fe/macros/draftIndicator/DraftIndicator.js +15 -4
- package/src/sap/fe/macros/draftIndicator/DraftIndicator.tsx +5 -0
- package/src/sap/fe/macros/field/FieldBaseDelegate.js +20 -8
- package/src/sap/fe/macros/field/FieldBaseDelegate.ts +34 -9
- package/src/sap/fe/macros/field/FieldFormatOptions.js +73 -44
- package/src/sap/fe/macros/field/FieldFormatOptions.ts +20 -2
- package/src/sap/fe/macros/field/FieldRuntime.js +1 -2
- package/src/sap/fe/macros/field/FieldRuntime.ts +0 -1
- package/src/sap/fe/macros/filter/FilterUtils.js +3 -5
- package/src/sap/fe/macros/filter/FilterUtils.ts +2 -4
- package/src/sap/fe/macros/filterBar/FilterBar.block.js +8 -2
- package/src/sap/fe/macros/filterBar/FilterBar.block.tsx +2 -5
- package/src/sap/fe/macros/filterBar/FilterBarAPI.js +8 -8
- package/src/sap/fe/macros/filterBar/FilterBarAPI.ts +8 -8
- package/src/sap/fe/macros/filterBar/designtime/FilterBar.designtime.js +3 -1
- package/src/sap/fe/macros/filterBar/designtime/FilterBar.designtime.ts +2 -0
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.js +1 -1
- package/src/sap/fe/macros/filterBar/mixin/FilterBarAPIStateHandler.ts +1 -1
- package/src/sap/fe/macros/form/Form.js +1 -4
- package/src/sap/fe/macros/form/Form.tsx +0 -3
- package/src/sap/fe/macros/form/FormActionButtons.fragment.xml +13 -2
- package/src/sap/fe/macros/form/FormContainer.block.js +1 -2
- package/src/sap/fe/macros/form/FormContainer.block.ts +0 -1
- package/src/sap/fe/macros/form/FormContainer.fragment.xml +40 -0
- package/src/sap/fe/macros/form/FormContainerAPI.js +14 -16
- package/src/sap/fe/macros/form/FormContainerAPI.ts +13 -15
- package/src/sap/fe/macros/form/FormDelegate.js +20 -1
- package/src/sap/fe/macros/form/FormDelegate.ts +25 -0
- package/src/sap/fe/macros/form/FormHelper.js +1 -2
- package/src/sap/fe/macros/form/FormHelper.ts +0 -1
- package/src/sap/fe/macros/formatters/TableFormatter.js +10 -1
- package/src/sap/fe/macros/formatters/TableFormatter.ts +14 -5
- package/src/sap/fe/macros/fpm/CustomFragment.block.js +1 -2
- package/src/sap/fe/macros/fpm/CustomFragment.block.ts +0 -1
- package/src/sap/fe/macros/inlineEdit/InlineEdit.js +15 -3
- package/src/sap/fe/macros/inlineEdit/InlineEdit.ts +14 -2
- package/src/sap/fe/macros/internal/ActionCommand.block.js +1 -2
- package/src/sap/fe/macros/internal/ActionCommand.block.ts +0 -1
- package/src/sap/fe/macros/internal/DataPoint.js +2 -1
- package/src/sap/fe/macros/internal/DataPoint.tsx +1 -0
- package/src/sap/fe/macros/internal/DataPointFormatOptions.js +11 -2
- package/src/sap/fe/macros/internal/DataPointFormatOptions.ts +3 -0
- package/src/sap/fe/macros/internal/FilterField.block.js +10 -2
- package/src/sap/fe/macros/internal/FilterField.block.ts +11 -1
- package/src/sap/fe/macros/internal/field/CheckBoxGroup.fragment.xml +25 -0
- package/src/sap/fe/macros/internal/field/DisplayStyle.js +51 -13
- package/src/sap/fe/macros/internal/field/DisplayStyle.tsx +53 -6
- package/src/sap/fe/macros/internal/field/EditStyle.js +5 -1
- package/src/sap/fe/macros/internal/field/EditStyle.tsx +4 -0
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.js +9 -2
- package/src/sap/fe/macros/internal/field/FieldStructureHelper.ts +11 -0
- package/src/sap/fe/macros/internal/field/FieldStyles.js +1 -1
- package/src/sap/fe/macros/internal/field/FieldStyles.tsx +2 -1
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueHelper.js +46 -8
- package/src/sap/fe/macros/internal/valuehelp/AdditionalValueHelper.ts +60 -6
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.js +38 -2
- package/src/sap/fe/macros/internal/valuehelp/TableDelegate.ts +37 -2
- package/src/sap/fe/macros/internal/valuehelp/ValueListDialogTable.fragment.xml +2 -1
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.js +16 -5
- package/src/sap/fe/macros/internal/valuehelp/ValueListHelper.ts +21 -9
- package/src/sap/fe/macros/internal/valuehelp/ValueListTable.fragment.xml +1 -0
- package/src/sap/fe/macros/library.js +1 -1
- package/src/sap/fe/macros/mdc/adapter/StateHelper.js +7 -2
- package/src/sap/fe/macros/mdc/adapter/StateHelper.ts +7 -3
- package/src/sap/fe/macros/messagebundle.properties +42 -32
- package/src/sap/fe/macros/messagebundle_ar.properties +12 -4
- package/src/sap/fe/macros/messagebundle_bg.properties +11 -3
- package/src/sap/fe/macros/messagebundle_ca.properties +15 -7
- package/src/sap/fe/macros/messagebundle_cnr.properties +12 -4
- package/src/sap/fe/macros/messagebundle_cs.properties +10 -2
- package/src/sap/fe/macros/messagebundle_cy.properties +12 -4
- package/src/sap/fe/macros/messagebundle_da.properties +11 -3
- package/src/sap/fe/macros/messagebundle_de.properties +18 -10
- package/src/sap/fe/macros/messagebundle_el.properties +13 -5
- package/src/sap/fe/macros/messagebundle_en.properties +16 -8
- package/src/sap/fe/macros/messagebundle_en_GB.properties +16 -8
- package/src/sap/fe/macros/messagebundle_en_US_saprigi.properties +16 -8
- package/src/sap/fe/macros/messagebundle_es.properties +13 -5
- package/src/sap/fe/macros/messagebundle_es_MX.properties +14 -6
- package/src/sap/fe/macros/messagebundle_et.properties +13 -5
- package/src/sap/fe/macros/messagebundle_fi.properties +14 -6
- package/src/sap/fe/macros/messagebundle_fr.properties +14 -6
- package/src/sap/fe/macros/messagebundle_fr_CA.properties +15 -7
- package/src/sap/fe/macros/messagebundle_hi.properties +11 -3
- package/src/sap/fe/macros/messagebundle_hr.properties +11 -3
- package/src/sap/fe/macros/messagebundle_hu.properties +10 -2
- package/src/sap/fe/macros/messagebundle_id.properties +18 -10
- package/src/sap/fe/macros/messagebundle_it.properties +10 -2
- package/src/sap/fe/macros/messagebundle_iw.properties +10 -2
- package/src/sap/fe/macros/messagebundle_ja.properties +13 -5
- package/src/sap/fe/macros/messagebundle_kk.properties +15 -7
- package/src/sap/fe/macros/messagebundle_ko.properties +10 -2
- package/src/sap/fe/macros/messagebundle_lt.properties +11 -3
- package/src/sap/fe/macros/messagebundle_lv.properties +12 -4
- package/src/sap/fe/macros/messagebundle_mk.properties +12 -4
- package/src/sap/fe/macros/messagebundle_ms.properties +14 -6
- package/src/sap/fe/macros/messagebundle_nl.properties +13 -5
- package/src/sap/fe/macros/messagebundle_no.properties +12 -4
- package/src/sap/fe/macros/messagebundle_pl.properties +12 -4
- package/src/sap/fe/macros/messagebundle_pt.properties +13 -5
- package/src/sap/fe/macros/messagebundle_pt_PT.properties +12 -4
- package/src/sap/fe/macros/messagebundle_ro.properties +12 -4
- package/src/sap/fe/macros/messagebundle_ru.properties +13 -5
- package/src/sap/fe/macros/messagebundle_sh.properties +12 -4
- package/src/sap/fe/macros/messagebundle_sk.properties +11 -3
- package/src/sap/fe/macros/messagebundle_sl.properties +12 -4
- package/src/sap/fe/macros/messagebundle_sr.properties +12 -4
- package/src/sap/fe/macros/messagebundle_sv.properties +11 -3
- package/src/sap/fe/macros/messagebundle_th.properties +11 -3
- package/src/sap/fe/macros/messagebundle_tr.properties +10 -2
- package/src/sap/fe/macros/messagebundle_uk.properties +17 -9
- package/src/sap/fe/macros/messagebundle_vi.properties +12 -4
- package/src/sap/fe/macros/messagebundle_zh_CN.properties +11 -3
- package/src/sap/fe/macros/messagebundle_zh_TW.properties +12 -4
- package/src/sap/fe/macros/messages/MessageButton.js +55 -36
- package/src/sap/fe/macros/messages/MessageButton.ts +64 -39
- package/src/sap/fe/macros/messages/MessagePopover.js +2 -2
- package/src/sap/fe/macros/messages/MessagePopover.ts +4 -4
- package/src/sap/fe/macros/microchart/MicroChartContainer.js +1 -2
- package/src/sap/fe/macros/microchart/MicroChartContainer.ts +1 -2
- package/src/sap/fe/macros/microchart/MicroChartHelper.js +1 -2
- package/src/sap/fe/macros/microchart/MicroChartHelper.tsx +0 -1
- package/src/sap/fe/macros/share/ShareAPI.js +4 -29
- package/src/sap/fe/macros/share/ShareAPI.ts +1 -32
- package/src/sap/fe/macros/situations/SituationsPopover.js +3 -1
- package/src/sap/fe/macros/situations/SituationsPopover.ts +2 -0
- package/src/sap/fe/macros/table/Action.js +24 -2
- package/src/sap/fe/macros/table/Action.ts +13 -0
- package/src/sap/fe/macros/table/ActionGroup.js +24 -2
- package/src/sap/fe/macros/table/ActionGroup.ts +13 -0
- package/src/sap/fe/macros/table/ActionGroupOverride.js +24 -2
- package/src/sap/fe/macros/table/ActionGroupOverride.ts +13 -0
- package/src/sap/fe/macros/table/ActionOverride.js +24 -2
- package/src/sap/fe/macros/table/ActionOverride.ts +13 -0
- package/src/sap/fe/macros/table/ActionsTemplating.js +73 -12
- package/src/sap/fe/macros/table/ActionsTemplating.tsx +69 -13
- package/src/sap/fe/macros/table/Column.js +3 -3
- package/src/sap/fe/macros/table/Column.ts +2 -2
- package/src/sap/fe/macros/table/MdcTableTemplate.js +20 -8
- package/src/sap/fe/macros/table/MdcTableTemplate.tsx +36 -7
- package/src/sap/fe/macros/table/QuickFilterSelector.js +35 -14
- package/src/sap/fe/macros/table/QuickFilterSelector.tsx +22 -3
- package/src/sap/fe/macros/table/Table.block.js +137 -108
- package/src/sap/fe/macros/table/Table.block.tsx +29 -2
- package/src/sap/fe/macros/table/TableAPI.js +143 -133
- package/src/sap/fe/macros/table/TableAPI.ts +5 -1
- package/src/sap/fe/macros/table/TableDefinition.js +4 -2
- package/src/sap/fe/macros/table/TableDefinition.ts +3 -1
- package/src/sap/fe/macros/table/TableHelper.js +1 -2
- package/src/sap/fe/macros/table/TableHelper.ts +0 -1
- package/src/sap/fe/macros/table/TableRuntime.js +26 -7
- package/src/sap/fe/macros/table/TableRuntime.ts +33 -5
- package/src/sap/fe/macros/table/Utils.js +6 -2
- package/src/sap/fe/macros/table/Utils.ts +5 -1
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.js +1 -2
- package/src/sap/fe/macros/table/delegates/ALPTableDelegate.ts +0 -1
- package/src/sap/fe/macros/table/delegates/TableDelegate.js +25 -20
- package/src/sap/fe/macros/table/delegates/TableDelegate.ts +25 -24
- package/src/sap/fe/macros/table/delegates/TreeTableDelegate.js +1 -2
- package/src/sap/fe/macros/table/delegates/TreeTableDelegate.ts +0 -1
- package/src/sap/fe/macros/table/designtime/Table.designtime.js +3 -1
- package/src/sap/fe/macros/table/designtime/Table.designtime.ts +2 -0
- package/src/sap/fe/macros/table/massEdit/designtime/MassEdit.designtime.js +3 -1
- package/src/sap/fe/macros/table/massEdit/designtime/MassEdit.designtime.ts +2 -1
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.js +2 -1
- package/src/sap/fe/macros/table/mixin/ContextMenuHandler.ts +1 -0
- package/src/sap/fe/macros/table/mixin/TableHierarchy.js +8 -1
- package/src/sap/fe/macros/table/mixin/TableHierarchy.ts +10 -0
- package/src/sap/fe/macros/table/mixin/TableSharing.js +3 -2
- package/src/sap/fe/macros/table/mixin/TableSharing.ts +9 -1
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.js +20 -6
- package/src/sap/fe/macros/valuehelp/ValueHelpDelegate.ts +36 -14
- package/src/sap/fe/macros/visualfilters/VisualFilter.js +95 -7
- package/src/sap/fe/macros/visualfilters/VisualFilter.tsx +93 -3
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.js +16 -5
- package/src/sap/fe/macros/visualfilters/VisualFilterRuntime.ts +18 -4
|
@@ -20,6 +20,7 @@ import { generate } from "sap/fe/core/helpers/StableIdHelper";
|
|
|
20
20
|
import { getContextRelativeTargetObjectPath, type DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
|
|
21
21
|
import type Contact from "sap/fe/macros/contact/Contact";
|
|
22
22
|
import type BuildingBlockObjectProperty from "sap/fe/macros/controls/BuildingBlockObjectProperty";
|
|
23
|
+
import type ConditionalWrapper from "sap/fe/macros/controls/ConditionalWrapper";
|
|
23
24
|
import type FieldWrapper from "sap/fe/macros/controls/FieldWrapper";
|
|
24
25
|
import type TextLink from "sap/fe/macros/controls/TextLink";
|
|
25
26
|
import FieldRuntime from "sap/fe/macros/field/FieldRuntime";
|
|
@@ -237,7 +238,6 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
237
238
|
/**
|
|
238
239
|
* This is used to optionally provide an external value that comes from a different model than the OData model.
|
|
239
240
|
* It is designed to work with a field with value help, and without support for complex value help (currency / unit).
|
|
240
|
-
* @experimental
|
|
241
241
|
* @public
|
|
242
242
|
*/
|
|
243
243
|
@property({
|
|
@@ -251,7 +251,6 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
251
251
|
/**
|
|
252
252
|
* This is used to optionally provide an external description that comes from a different model than the oData model.
|
|
253
253
|
* This should be used in conjunction with the value property.
|
|
254
|
-
* @experimental
|
|
255
254
|
* @public
|
|
256
255
|
*/
|
|
257
256
|
@property({
|
|
@@ -447,18 +446,27 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
447
446
|
// a potential UNLOCK that would be sent in handleFocusOut, to make sure it's sent after the CHANGE message
|
|
448
447
|
controller?.collaborativeDraft.retainAsyncMessages(data);
|
|
449
448
|
|
|
450
|
-
const
|
|
451
|
-
if (isDataUpdated) {
|
|
449
|
+
const sendCollaborationMessagesAfterPatchCompleted = (): void => {
|
|
452
450
|
// The value has been changed by the user --> wait until it's sent to the server before sending a notification to other users
|
|
453
451
|
binding.attachEventOnce("patchCompleted", function () {
|
|
454
452
|
controller?.collaborativeDraft.send({ action: Activity.Change, content: data });
|
|
455
453
|
controller?.collaborativeDraft.releaseAsyncMessages(data);
|
|
456
454
|
});
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
const isDataUpdated = binding.hasPendingChanges();
|
|
458
|
+
if (isDataUpdated) {
|
|
459
|
+
sendCollaborationMessagesAfterPatchCompleted();
|
|
457
460
|
}
|
|
458
461
|
|
|
459
462
|
const updateCollaboration = (): void => {
|
|
460
463
|
if (!isDataUpdated) {
|
|
461
|
-
|
|
464
|
+
// We need to check again if the binding has some pending changes, since it may have been updated once the Field value is resolved
|
|
465
|
+
if (binding.hasPendingChanges()) {
|
|
466
|
+
sendCollaborationMessagesAfterPatchCompleted();
|
|
467
|
+
} else {
|
|
468
|
+
controller?.collaborativeDraft.releaseAsyncMessages(data);
|
|
469
|
+
}
|
|
462
470
|
}
|
|
463
471
|
};
|
|
464
472
|
if (source.isA("sap.ui.mdc.Field") || (source as Control).isA("sap.ui.mdc.MultiValueField")) {
|
|
@@ -544,8 +552,27 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
544
552
|
this._setAriaLabelledBy(this.content as unknown as ControlWithAccessibility);
|
|
545
553
|
}
|
|
546
554
|
|
|
555
|
+
private getInnerControl(source: Control): Control | undefined {
|
|
556
|
+
if (source?.isA("sap.fe.macros.controls.FieldWrapper") && !source?.isA("sap.fe.macros.controls.FileWrapper")) {
|
|
557
|
+
const fieldWrapper = source as EnhanceWithUI5<FieldWrapper>;
|
|
558
|
+
const controls = fieldWrapper.getContentEdit() as Control[];
|
|
559
|
+
let innerControl;
|
|
560
|
+
if (controls.length >= 1) {
|
|
561
|
+
innerControl = controls[0];
|
|
562
|
+
}
|
|
563
|
+
if (innerControl?.isA("sap.m.HBox")) {
|
|
564
|
+
innerControl = (innerControl as HBox).getItems()[0];
|
|
565
|
+
}
|
|
566
|
+
return innerControl;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
547
570
|
onAfterRendering(): void {
|
|
548
|
-
|
|
571
|
+
const editControl = this.getInnerControl(this.content);
|
|
572
|
+
const notLockControls = ["sap.m.CheckBox"];
|
|
573
|
+
|
|
574
|
+
const canLock = !notLockControls.includes(editControl?.getMetadata().getName() ?? "");
|
|
575
|
+
if (this.collaborationEnabled && !this.focusHandlersAttached && canLock) {
|
|
549
576
|
// The event delegate doesn't work on the Field, we need to put it on its content (FieldWrapper)
|
|
550
577
|
this.content?.addEventDelegate(
|
|
551
578
|
{
|
|
@@ -577,6 +604,15 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
577
604
|
}
|
|
578
605
|
}
|
|
579
606
|
|
|
607
|
+
/**
|
|
608
|
+
* Method to determine if the field has some Mdc field with pending user input.
|
|
609
|
+
* @returns True if the field has pending user input, false otherwise
|
|
610
|
+
*/
|
|
611
|
+
hasPendingUserInput(): boolean {
|
|
612
|
+
const targetControl = Field.getControlInFieldWrapper(this.getContent());
|
|
613
|
+
return !!(targetControl && targetControl.isA<mdcField>("sap.ui.mdc.Field") && targetControl.hasPendingUserInput());
|
|
614
|
+
}
|
|
615
|
+
|
|
580
616
|
/**
|
|
581
617
|
* Returns the label controls of the field
|
|
582
618
|
* when being referenced by the 'labelFor' attribute on the label or when in a form.
|
|
@@ -707,63 +743,69 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
707
743
|
*/
|
|
708
744
|
getEnabled(): boolean {
|
|
709
745
|
let control = Field.getControlInFieldWrapper(this.content);
|
|
710
|
-
if (control !== null && control !== undefined && !control?.isA("sap.m.Text")) {
|
|
711
|
-
//check needed for file wrapper which does not have a content
|
|
712
|
-
if (this.collaborationEnabled && control.isA<HBox>("sap.m.HBox")) {
|
|
713
|
-
// for chaining reasons, let´s keep it like that
|
|
714
|
-
control = control.getItems()[0];
|
|
715
|
-
}
|
|
716
|
-
if (control.isA<VBox>("sap.m.VBox")) {
|
|
717
|
-
// for chaining reasons, let´s keep it like that
|
|
718
|
-
control = control.getItems()[0];
|
|
719
|
-
}
|
|
720
746
|
|
|
721
|
-
|
|
722
|
-
// otherwise we end up in a max call stack size
|
|
723
|
-
if (control.isA<CheckBox>("sap.m.CheckBox")) {
|
|
724
|
-
return control.getProperty("enabled");
|
|
725
|
-
} else if (control.isA<InputBase>("sap.m.InputBase")) {
|
|
726
|
-
return control.getProperty("enabled");
|
|
727
|
-
} else if (control.isA<Link>("sap.m.Link")) {
|
|
728
|
-
return control.getProperty("enabled");
|
|
729
|
-
} else if (control.isA<Button>("sap.m.Button")) {
|
|
730
|
-
return control.getProperty("enabled");
|
|
731
|
-
} else if (control.isA<ObjectStatus>("sap.m.ObjectStatus")) {
|
|
732
|
-
return true;
|
|
733
|
-
} else if (control.isA<ObjectIdentifier>("sap.m.ObjectIdentifier")) {
|
|
734
|
-
return true;
|
|
735
|
-
} else if (control.isA<FormElementWrapper>("sap.fe.core.controls.FormElementWrapper")) {
|
|
736
|
-
// It is for a Draft Indicator
|
|
737
|
-
return true;
|
|
738
|
-
} else if (control.isA<DataPoint>("sap.fe.macros.internal.DataPoint")) {
|
|
739
|
-
return control.getEnabled();
|
|
740
|
-
} else if (control.isA<Email>("sap.fe.macros.contact.Email")) {
|
|
741
|
-
return control.getProperty("linkEnabled");
|
|
742
|
-
} else if (control.isA<Contact>("sap.fe.macros.contact.Contact")) {
|
|
743
|
-
return control.getEnabled();
|
|
744
|
-
} else if (control.isA<ExpandableText>("sap.m.ExpandableText")) {
|
|
745
|
-
// otherwise show more would be inactive
|
|
746
|
-
return true;
|
|
747
|
-
} else if (control.isA<mdcField>("sap.ui.mdc.Field")) {
|
|
748
|
-
const editMode = control.getEditMode();
|
|
749
|
-
// The mdc field does not have a direct property "enabled", therefore we map
|
|
750
|
-
// the internal disabled setting of the edit mode in this graceful pattern
|
|
751
|
-
return editMode !== FieldEditMode.Disabled;
|
|
752
|
-
} else if (control.isA<FileWrapper>("sap.fe.macros.controls.FileWrapper")) {
|
|
753
|
-
// The file wrapper could contain a link or an avatar with a delete button,
|
|
754
|
-
// we must ensure the enablement in both cases
|
|
755
|
-
return control.link ? control.link.getProperty("enabled") : true;
|
|
756
|
-
} else if (
|
|
757
|
-
control.isA("sap.fe.macros.controls.ConditionalWrapper") ||
|
|
758
|
-
(control as Control).isA<TextLink>("sap.fe.macros.controls.TextLink")
|
|
759
|
-
) {
|
|
760
|
-
return true;
|
|
761
|
-
} else {
|
|
762
|
-
return false;
|
|
763
|
-
}
|
|
764
|
-
} else {
|
|
747
|
+
if (control === null || control === undefined || control?.isA("sap.m.Text")) {
|
|
765
748
|
return true;
|
|
766
749
|
}
|
|
750
|
+
|
|
751
|
+
// Handle collaboration-enabled HBox
|
|
752
|
+
if (this.collaborationEnabled && control.isA<HBox>("sap.m.HBox")) {
|
|
753
|
+
control = control.getItems()[0];
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// Handle VBox wrapper
|
|
757
|
+
if (control.isA<VBox>("sap.m.VBox")) {
|
|
758
|
+
control = control.getItems()[0];
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// Handle property-based controls that use "enabled" property
|
|
762
|
+
if (
|
|
763
|
+
control.isA<CheckBox>("sap.m.CheckBox") ||
|
|
764
|
+
control.isA<InputBase>("sap.m.InputBase") ||
|
|
765
|
+
control.isA<Link>("sap.m.Link") ||
|
|
766
|
+
control.isA<Button>("sap.m.Button")
|
|
767
|
+
) {
|
|
768
|
+
return control.getProperty("enabled");
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// Handle controls that are always enabled
|
|
772
|
+
if (
|
|
773
|
+
control.isA<ObjectStatus>("sap.m.ObjectStatus") ||
|
|
774
|
+
control.isA<ObjectIdentifier>("sap.m.ObjectIdentifier") ||
|
|
775
|
+
control.isA<FormElementWrapper>("sap.fe.core.controls.FormElementWrapper") ||
|
|
776
|
+
control.isA<ExpandableText>("sap.m.ExpandableText") ||
|
|
777
|
+
control.isA<typeof ConditionalWrapper>("sap.fe.macros.controls.ConditionalWrapper") ||
|
|
778
|
+
control.isA<TextLink>("sap.fe.macros.controls.TextLink")
|
|
779
|
+
) {
|
|
780
|
+
return true;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
// Handle special property cases
|
|
784
|
+
if (control.isA<DataPoint>("sap.fe.macros.internal.DataPoint") || control.isA<Contact>("sap.fe.macros.contact.Contact")) {
|
|
785
|
+
return control.getEnabled();
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
if (control.isA<Email>("sap.fe.macros.contact.Email")) {
|
|
789
|
+
return control.getProperty("linkEnabled");
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// Handle MDC Field special case
|
|
793
|
+
if (control.isA<mdcField>("sap.ui.mdc.Field")) {
|
|
794
|
+
const editMode = control.getEditMode();
|
|
795
|
+
return editMode !== FieldEditMode.Disabled;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// Handle FileWrapper special case
|
|
799
|
+
if (control.isA<FileWrapper>("sap.fe.macros.controls.FileWrapper")) {
|
|
800
|
+
return control.link ? control.link.getProperty("enabled") : true;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
// Handle HBox with SituationsIndicator at item[1]
|
|
804
|
+
if ((control as HBox).isA?.("sap.m.HBox") && (control as HBox).getItems()[1]?.isA("sap.fe.macros.situations.SituationsIndicator")) {
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
return false;
|
|
767
809
|
}
|
|
768
810
|
|
|
769
811
|
/**
|
|
@@ -951,6 +993,8 @@ class Field extends MacroAPI<{ readOnly: boolean; semanticObject: string }> {
|
|
|
951
993
|
preparedProperties.isDynamicInstantiation = true;
|
|
952
994
|
if (preparedProperties.mainPropertyRelativePath) this.mainPropertyRelativePath = preparedProperties.mainPropertyRelativePath;
|
|
953
995
|
if (preparedProperties.collaborationEnabled) this.collaborationEnabled = preparedProperties.collaborationEnabled;
|
|
996
|
+
if (preparedProperties.displayStyle === "File")
|
|
997
|
+
preparedProperties.fileUploaderVisible = !this.readOnly && preparedProperties.editableExpression;
|
|
954
998
|
return preparedProperties;
|
|
955
999
|
}
|
|
956
1000
|
|