123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2020
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['authoring-common'], function (AuthoringCommon) {
- var SchematicEditor = AuthoringCommon.SchematicEditor;
- var dialogWrapper = AuthoringCommon.DialogWrapper;
- return function () {
- function SchematicEditorUI() {
- _classCallCheck(this, SchematicEditorUI);
- }
- SchematicEditorUI.openSchematicEditor = function openSchematicEditor(metadata) {
- if (!metadata) {
- return;
- }
- var resolve = void 0,
- reject = void 0,
- data = void 0;
- var promise = new Promise(function (_resolve, _reject) {
- resolve = _resolve;
- reject = _reject;
- });
- var _okCallbackFn = function _okCallbackFn(_editorResponse) {
- // save the data which we're going to return
- data = _editorResponse;
- };
- var _onCloseDialog = function _onCloseDialog() {
- // if when we close the dialog we have data
- // the data is to be resolved
- return data ? resolve(data) : reject();
- };
- var _onOpenDialog = function _onOpenDialog(_schematicEditorRef) {
- if (_schematicEditorRef) _schematicEditorRef.openDialog();
- };
- dialogWrapper.show(SchematicEditor, {
- definition: metadata,
- okCallbackFn: _okCallbackFn,
- onCloseDialog: _onCloseDialog,
- ref: _onOpenDialog
- });
- return promise;
- };
- return SchematicEditorUI;
- }();
- });
- //# sourceMappingURL=SchematicEditorUI.js.map
|