react-application-core
Version:
A react-based application core for the business applications.
71 lines • 2.76 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnsavedFormChangesDialog = void 0;
var util_1 = require("../../../util");
var base_dialog_component_1 = require("../base-dialog.component");
/**
* @component-impl
* @stable [01.08.2020]
*
* Please use the "Mappers.unsavedFormChangesDialogProps"
*/
var UnsavedFormChangesDialog = /** @class */ (function (_super) {
__extends(UnsavedFormChangesDialog, _super);
function UnsavedFormChangesDialog() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* @stable [10.10.2020]
* @param payload
*/
UnsavedFormChangesDialog.prototype.activate = function (payload) {
if (util_1.FormUtils.isChanged(this.originalProps)) { // We can't use dirty flag because of the default changes (!)
_super.prototype.activate.call(this, payload);
}
else {
this.onAcceptClick();
}
};
Object.defineProperty(UnsavedFormChangesDialog.prototype, "acceptText", {
/**
* @stable [10.10.2020]
*/
get: function () {
return this.mergedProps.acceptText || this.settings.messages.DIALOG_DISCARD;
},
enumerable: false,
configurable: true
});
Object.defineProperty(UnsavedFormChangesDialog.prototype, "title", {
/**
* @stable [10.10.2020]
*/
get: function () {
var title = this.originalProps.title;
return title === false
? title
: (title || this.settings.messages.CHANGES_YOU_MADE_WILL_NOT_BE_SAVED);
},
enumerable: false,
configurable: true
});
UnsavedFormChangesDialog.defaultProps = util_1.PropsUtils.mergeWithParentDefaultProps({
confirm: true,
}, base_dialog_component_1.BaseDialog);
return UnsavedFormChangesDialog;
}(base_dialog_component_1.BaseDialog));
exports.UnsavedFormChangesDialog = UnsavedFormChangesDialog;
//# sourceMappingURL=unsaved-form-changes-dialog.component.js.map