@sap-ux/preview-middleware 0.19.28 → 0.19.30
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/dist/base/flp.d.ts +2 -2
- package/dist/base/flp.js +3 -3
- package/dist/client/adp/add-fragment.js +48 -0
- package/dist/client/adp/add-fragment.ts +51 -0
- package/dist/client/adp/api-handler.js +155 -153
- package/dist/client/adp/api-handler.ts +2 -2
- package/dist/client/adp/command-executor.js +75 -75
- package/dist/client/adp/control-utils.js +44 -44
- package/dist/client/adp/controllers/AddFragment.controller.js +26 -86
- package/dist/client/adp/controllers/AddFragment.controller.ts +29 -113
- package/dist/client/adp/controllers/ControllerExtension.controller.js +210 -210
- package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
- package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
- package/dist/client/adp/dialog-factory.js +135 -135
- package/dist/client/adp/dialog-factory.ts +21 -13
- package/dist/client/adp/extension-point.js +3 -3
- package/dist/client/adp/extension-point.ts +3 -3
- package/dist/client/adp/init-dialogs.js +163 -138
- package/dist/client/adp/init-dialogs.ts +13 -8
- package/dist/client/adp/init.js +2 -0
- package/dist/client/adp/init.ts +5 -0
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
- package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
- package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
- package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
- package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
- package/dist/client/adp/quick-actions/common/utils.js +18 -18
- package/dist/client/adp/quick-actions/control-types.js +23 -23
- package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
- package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
- package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
- package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
- package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
- package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
- package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
- package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
- package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
- package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
- package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
- package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
- package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
- package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
- package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
- package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
- package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -84
- package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
- package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
- package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
- package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
- package/dist/client/adp/quick-actions/load.js +44 -44
- package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
- package/dist/client/adp/utils.js +218 -218
- package/dist/client/adp/utils.ts +2 -2
- package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +77 -0
- package/dist/client/cpe/additional-change-info/add-xml-additional-info.ts +84 -0
- package/dist/client/cpe/changes/index.js +10 -10
- package/dist/client/cpe/changes/service.js +5 -2
- package/dist/client/cpe/changes/service.ts +2 -0
- package/dist/client/cpe/changes/validator.js +39 -39
- package/dist/client/cpe/connector-service.js +2 -1
- package/dist/client/cpe/connector-service.ts +8 -4
- package/dist/client/cpe/documentation.js +164 -164
- package/dist/client/cpe/feature-service.js +36 -36
- package/dist/client/cpe/logger.js +30 -30
- package/dist/client/cpe/outline/editable.js +37 -37
- package/dist/client/cpe/outline/nodes.js +203 -203
- package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
- package/dist/client/cpe/quick-actions/registry.js +143 -143
- package/dist/client/cpe/quick-actions/utils.js +92 -92
- package/dist/client/cpe/types.js +4 -4
- package/dist/client/cpe/ui5-utils.js +33 -33
- package/dist/client/cpe/utils.js +111 -111
- package/dist/client/flp/WorkspaceConnector.js +92 -86
- package/dist/client/flp/WorkspaceConnector.ts +10 -2
- package/dist/client/flp/common.js +28 -28
- package/dist/client/flp/enableFakeConnector.js +89 -83
- package/dist/client/flp/enableFakeConnector.ts +11 -2
- package/dist/client/flp/homepage/Component.js +14 -14
- package/dist/client/flp/initCdm.js +117 -117
- package/dist/client/flp/initConnectors.js +28 -28
- package/dist/client/flp/initRta.js +178 -178
- package/dist/client/i18n.js +56 -56
- package/dist/client/utils/additional-change-info.js +43 -0
- package/dist/client/utils/additional-change-info.ts +42 -0
- package/dist/client/utils/application.js +32 -32
- package/dist/client/utils/core.js +84 -84
- package/dist/client/utils/error.js +19 -19
- package/dist/client/utils/fe-v2.js +56 -56
- package/dist/client/utils/fe-v4.js +140 -140
- package/dist/client/utils/version.js +104 -104
- package/package.json +3 -3
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["../../../utils/core", "sap/ui/rta/command/CommandFactory", "../../../utils/fe-v4"], function (_____utils_core, CommandFactory, _____utils_fe_v4) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const getControlById = _____utils_core["getControlById"];
|
|
7
|
-
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
8
|
-
const getPageName = _____utils_fe_v4["getPageName"];
|
|
9
|
-
const getReference = _____utils_fe_v4["getReference"];
|
|
10
|
-
async function executeToggleAction(context, isButtonEnabled, controlType, propertyPath) {
|
|
11
|
-
const controls = context.controlIndex[controlType] ?? [];
|
|
12
|
-
const control = controls[0];
|
|
13
|
-
if (control) {
|
|
14
|
-
const modifiedControl = getControlById(control.controlId);
|
|
15
|
-
if (!modifiedControl) {
|
|
16
|
-
return [];
|
|
17
|
-
}
|
|
18
|
-
const {
|
|
19
|
-
flexSettings
|
|
20
|
-
} = context;
|
|
21
|
-
const parent = modifiedControl.getParent();
|
|
22
|
-
if (!parent) {
|
|
23
|
-
return [];
|
|
24
|
-
}
|
|
25
|
-
const modifiedValue = {
|
|
26
|
-
reference: getReference(modifiedControl),
|
|
27
|
-
appComponent: getV4AppComponent(modifiedControl),
|
|
28
|
-
changeType: 'appdescr_fe_changePageConfiguration',
|
|
29
|
-
parameters: {
|
|
30
|
-
page: getPageName(parent),
|
|
31
|
-
entityPropertyChange: {
|
|
32
|
-
propertyPath: propertyPath,
|
|
33
|
-
propertyValue: !isButtonEnabled,
|
|
34
|
-
operation: 'UPSERT'
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
39
|
-
return [command];
|
|
40
|
-
}
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
const PATTERN_SUFFIX = ':?query:';
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Generates the pattern for a new route based on the input.
|
|
47
|
-
*
|
|
48
|
-
* @param sourceRoutePattern source page route pattern
|
|
49
|
-
* @param navProperty navigation property name (used to build nav pattern for nested OP )
|
|
50
|
-
* @param targetEntitySet navigation target entity set
|
|
51
|
-
* @returns the generated pattern as string
|
|
52
|
-
*/
|
|
53
|
-
function generateRoutePattern(sourceRoutePattern, navProperty, targetEntitySet) {
|
|
54
|
-
const parts = [];
|
|
55
|
-
const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
|
|
56
|
-
if (basePattern) {
|
|
57
|
-
parts.push(basePattern);
|
|
58
|
-
parts.push('/');
|
|
59
|
-
parts.push(navProperty);
|
|
60
|
-
} else {
|
|
61
|
-
parts.push(targetEntitySet);
|
|
62
|
-
}
|
|
63
|
-
parts.push(`({${targetEntitySet}Key})`);
|
|
64
|
-
parts.push(PATTERN_SUFFIX);
|
|
65
|
-
return parts.join('');
|
|
66
|
-
}
|
|
67
|
-
var __exports = {
|
|
68
|
-
__esModule: true
|
|
69
|
-
};
|
|
70
|
-
__exports.executeToggleAction = executeToggleAction;
|
|
71
|
-
__exports.generateRoutePattern = generateRoutePattern;
|
|
72
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["../../../utils/core", "sap/ui/rta/command/CommandFactory", "../../../utils/fe-v4"], function (_____utils_core, CommandFactory, _____utils_fe_v4) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const getControlById = _____utils_core["getControlById"];
|
|
7
|
+
const getV4AppComponent = _____utils_fe_v4["getV4AppComponent"];
|
|
8
|
+
const getPageName = _____utils_fe_v4["getPageName"];
|
|
9
|
+
const getReference = _____utils_fe_v4["getReference"];
|
|
10
|
+
async function executeToggleAction(context, isButtonEnabled, controlType, propertyPath) {
|
|
11
|
+
const controls = context.controlIndex[controlType] ?? [];
|
|
12
|
+
const control = controls[0];
|
|
13
|
+
if (control) {
|
|
14
|
+
const modifiedControl = getControlById(control.controlId);
|
|
15
|
+
if (!modifiedControl) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const {
|
|
19
|
+
flexSettings
|
|
20
|
+
} = context;
|
|
21
|
+
const parent = modifiedControl.getParent();
|
|
22
|
+
if (!parent) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const modifiedValue = {
|
|
26
|
+
reference: getReference(modifiedControl),
|
|
27
|
+
appComponent: getV4AppComponent(modifiedControl),
|
|
28
|
+
changeType: 'appdescr_fe_changePageConfiguration',
|
|
29
|
+
parameters: {
|
|
30
|
+
page: getPageName(parent),
|
|
31
|
+
entityPropertyChange: {
|
|
32
|
+
propertyPath: propertyPath,
|
|
33
|
+
propertyValue: !isButtonEnabled,
|
|
34
|
+
operation: 'UPSERT'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const command = await CommandFactory.getCommandFor(modifiedControl, 'appDescriptor', modifiedValue, null, flexSettings);
|
|
39
|
+
return [command];
|
|
40
|
+
}
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
const PATTERN_SUFFIX = ':?query:';
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Generates the pattern for a new route based on the input.
|
|
47
|
+
*
|
|
48
|
+
* @param sourceRoutePattern source page route pattern
|
|
49
|
+
* @param navProperty navigation property name (used to build nav pattern for nested OP )
|
|
50
|
+
* @param targetEntitySet navigation target entity set
|
|
51
|
+
* @returns the generated pattern as string
|
|
52
|
+
*/
|
|
53
|
+
function generateRoutePattern(sourceRoutePattern, navProperty, targetEntitySet) {
|
|
54
|
+
const parts = [];
|
|
55
|
+
const basePattern = sourceRoutePattern.replace(PATTERN_SUFFIX, '');
|
|
56
|
+
if (basePattern) {
|
|
57
|
+
parts.push(basePattern);
|
|
58
|
+
parts.push('/');
|
|
59
|
+
parts.push(navProperty);
|
|
60
|
+
} else {
|
|
61
|
+
parts.push(targetEntitySet);
|
|
62
|
+
}
|
|
63
|
+
parts.push(`({${targetEntitySet}Key})`);
|
|
64
|
+
parts.push(PATTERN_SUFFIX);
|
|
65
|
+
return parts.join('');
|
|
66
|
+
}
|
|
67
|
+
var __exports = {
|
|
68
|
+
__esModule: true
|
|
69
|
+
};
|
|
70
|
+
__exports.executeToggleAction = executeToggleAction;
|
|
71
|
+
__exports.generateRoutePattern = generateRoutePattern;
|
|
72
|
+
return __exports;
|
|
73
73
|
});
|
|
74
74
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define([], function () {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
function __ui5_require_async(path) {
|
|
7
|
-
return new Promise(function (resolve, reject) {
|
|
8
|
-
sap.ui.require([path], function (module) {
|
|
9
|
-
if (!(module && module.__esModule)) {
|
|
10
|
-
module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
|
|
11
|
-
default: module
|
|
12
|
-
} : module;
|
|
13
|
-
Object.defineProperty(module, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
resolve(module);
|
|
18
|
-
}, function (err) {
|
|
19
|
-
reject(err);
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Loads the appropriate Quick Action registries for the given application type.
|
|
25
|
-
*
|
|
26
|
-
* @param appType - Application type.
|
|
27
|
-
* @returns Quick Action registries.
|
|
28
|
-
*/
|
|
29
|
-
async function loadDefinitions(appType) {
|
|
30
|
-
if (appType === 'fe-v2') {
|
|
31
|
-
const FEV2QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v2/registry')).default;
|
|
32
|
-
return [new FEV2QuickActionRegistry()];
|
|
33
|
-
}
|
|
34
|
-
if (appType === 'fe-v4') {
|
|
35
|
-
const FEV4QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v4/registry')).default;
|
|
36
|
-
return [new FEV4QuickActionRegistry()];
|
|
37
|
-
}
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
var __exports = {
|
|
41
|
-
__esModule: true
|
|
42
|
-
};
|
|
43
|
-
__exports.loadDefinitions = loadDefinitions;
|
|
44
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define([], function () {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
function __ui5_require_async(path) {
|
|
7
|
+
return new Promise(function (resolve, reject) {
|
|
8
|
+
sap.ui.require([path], function (module) {
|
|
9
|
+
if (!(module && module.__esModule)) {
|
|
10
|
+
module = module === null || !(typeof module === "object" && path.endsWith("/library")) ? {
|
|
11
|
+
default: module
|
|
12
|
+
} : module;
|
|
13
|
+
Object.defineProperty(module, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
resolve(module);
|
|
18
|
+
}, function (err) {
|
|
19
|
+
reject(err);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Loads the appropriate Quick Action registries for the given application type.
|
|
25
|
+
*
|
|
26
|
+
* @param appType - Application type.
|
|
27
|
+
* @returns Quick Action registries.
|
|
28
|
+
*/
|
|
29
|
+
async function loadDefinitions(appType) {
|
|
30
|
+
if (appType === 'fe-v2') {
|
|
31
|
+
const FEV2QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v2/registry')).default;
|
|
32
|
+
return [new FEV2QuickActionRegistry()];
|
|
33
|
+
}
|
|
34
|
+
if (appType === 'fe-v4') {
|
|
35
|
+
const FEV4QuickActionRegistry = (await __ui5_require_async('open/ux/preview/client/adp/quick-actions/fe-v4/registry')).default;
|
|
36
|
+
return [new FEV4QuickActionRegistry()];
|
|
37
|
+
}
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
var __exports = {
|
|
41
|
+
__esModule: true
|
|
42
|
+
};
|
|
43
|
+
__exports.loadDefinitions = loadDefinitions;
|
|
44
|
+
return __exports;
|
|
45
45
|
});
|
|
46
46
|
//# sourceMappingURL=load.js.map
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
sap.ui.define(["./dialog-enablement-validator"], function (___dialog_enablement_validator) {
|
|
4
|
-
"use strict";
|
|
5
|
-
|
|
6
|
-
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
7
|
-
/**
|
|
8
|
-
* Base class for all quick actions.
|
|
9
|
-
*/
|
|
10
|
-
class QuickActionDefinitionBase {
|
|
11
|
-
get id() {
|
|
12
|
-
return `${this.context.key}-${this.type}`;
|
|
13
|
-
}
|
|
14
|
-
getTelemetryIdentifier() {
|
|
15
|
-
let update = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
16
|
-
if (update === true) {
|
|
17
|
-
this.telemetryIdentifier = new Date().toISOString();
|
|
18
|
-
}
|
|
19
|
-
return this.telemetryIdentifier;
|
|
20
|
-
}
|
|
21
|
-
get quickActionSteps() {
|
|
22
|
-
return this.enablementValidators.find(item => item === DIALOG_ENABLEMENT_VALIDATOR) ? 2 : 1;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Quick Actions tooltip.
|
|
27
|
-
*/
|
|
28
|
-
get tooltip() {
|
|
29
|
-
if (this.validationResult) {
|
|
30
|
-
const validationErrors = this.validationResult.filter(result => result?.type === 'error');
|
|
31
|
-
if (validationErrors.length > 0) {
|
|
32
|
-
const error = validationErrors[0];
|
|
33
|
-
return error.message;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
get isDisabled() {
|
|
39
|
-
if (this.validationResult === undefined) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
const validationErrors = this.validationResult.filter(result => result?.type === 'error');
|
|
43
|
-
return validationErrors.length > 0;
|
|
44
|
-
}
|
|
45
|
-
get textKey() {
|
|
46
|
-
return this.defaultTextKey;
|
|
47
|
-
}
|
|
48
|
-
constructor(type, kind, defaultTextKey, context) {
|
|
49
|
-
let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
50
|
-
this.type = type;
|
|
51
|
-
this.kind = kind;
|
|
52
|
-
this.defaultTextKey = defaultTextKey;
|
|
53
|
-
this.context = context;
|
|
54
|
-
this.enablementValidators = enablementValidators;
|
|
55
|
-
}
|
|
56
|
-
async runEnablementValidators() {
|
|
57
|
-
this.validationResult = await Promise.all(this.enablementValidators.map(async validator => await validator.run()));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
var __exports = {
|
|
61
|
-
__esModule: true
|
|
62
|
-
};
|
|
63
|
-
__exports.QuickActionDefinitionBase = QuickActionDefinitionBase;
|
|
64
|
-
return __exports;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
sap.ui.define(["./dialog-enablement-validator"], function (___dialog_enablement_validator) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
const DIALOG_ENABLEMENT_VALIDATOR = ___dialog_enablement_validator["DIALOG_ENABLEMENT_VALIDATOR"];
|
|
7
|
+
/**
|
|
8
|
+
* Base class for all quick actions.
|
|
9
|
+
*/
|
|
10
|
+
class QuickActionDefinitionBase {
|
|
11
|
+
get id() {
|
|
12
|
+
return `${this.context.key}-${this.type}`;
|
|
13
|
+
}
|
|
14
|
+
getTelemetryIdentifier() {
|
|
15
|
+
let update = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
16
|
+
if (update === true) {
|
|
17
|
+
this.telemetryIdentifier = new Date().toISOString();
|
|
18
|
+
}
|
|
19
|
+
return this.telemetryIdentifier;
|
|
20
|
+
}
|
|
21
|
+
get quickActionSteps() {
|
|
22
|
+
return this.enablementValidators.find(item => item === DIALOG_ENABLEMENT_VALIDATOR) ? 2 : 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Quick Actions tooltip.
|
|
27
|
+
*/
|
|
28
|
+
get tooltip() {
|
|
29
|
+
if (this.validationResult) {
|
|
30
|
+
const validationErrors = this.validationResult.filter(result => result?.type === 'error');
|
|
31
|
+
if (validationErrors.length > 0) {
|
|
32
|
+
const error = validationErrors[0];
|
|
33
|
+
return error.message;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
get isDisabled() {
|
|
39
|
+
if (this.validationResult === undefined) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const validationErrors = this.validationResult.filter(result => result?.type === 'error');
|
|
43
|
+
return validationErrors.length > 0;
|
|
44
|
+
}
|
|
45
|
+
get textKey() {
|
|
46
|
+
return this.defaultTextKey;
|
|
47
|
+
}
|
|
48
|
+
constructor(type, kind, defaultTextKey, context) {
|
|
49
|
+
let enablementValidators = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
50
|
+
this.type = type;
|
|
51
|
+
this.kind = kind;
|
|
52
|
+
this.defaultTextKey = defaultTextKey;
|
|
53
|
+
this.context = context;
|
|
54
|
+
this.enablementValidators = enablementValidators;
|
|
55
|
+
}
|
|
56
|
+
async runEnablementValidators() {
|
|
57
|
+
this.validationResult = await Promise.all(this.enablementValidators.map(async validator => await validator.run()));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var __exports = {
|
|
61
|
+
__esModule: true
|
|
62
|
+
};
|
|
63
|
+
__exports.QuickActionDefinitionBase = QuickActionDefinitionBase;
|
|
64
|
+
return __exports;
|
|
65
65
|
});
|
|
66
66
|
//# sourceMappingURL=quick-action-base.js.map
|