raise-common-lib 0.0.151 → 0.0.153

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.
@@ -1758,6 +1758,8 @@ if (false) {
1758
1758
  /** @type {?|undefined} */
1759
1759
  DialogConfig.prototype.cancelBtnLabel;
1760
1760
  /** @type {?|undefined} */
1761
+ DialogConfig.prototype.discardBtnLabel;
1762
+ /** @type {?|undefined} */
1761
1763
  DialogConfig.prototype.showErrorIcon;
1762
1764
  /** @type {?|undefined} */
1763
1765
  DialogConfig.prototype.hideCloseIcon;
@@ -1768,6 +1770,8 @@ if (false) {
1768
1770
  /** @type {?|undefined} */
1769
1771
  DialogConfig.prototype.hideCloseBtn;
1770
1772
  /** @type {?|undefined} */
1773
+ DialogConfig.prototype.hideDiscardBtn;
1774
+ /** @type {?|undefined} */
1771
1775
  DialogConfig.prototype.showZoomBtn;
1772
1776
  /** @type {?|undefined} */
1773
1777
  DialogConfig.prototype.onCloseRequest;
@@ -1779,6 +1783,7 @@ var CommonDeleteComponent = /** @class */ (function () {
1779
1783
  this.title = "";
1780
1784
  this.saveBtnLabel = "";
1781
1785
  this.cancelBtnLabel = "";
1786
+ this.discardBtnLabel = "";
1782
1787
  this.description = "";
1783
1788
  this.size = "small";
1784
1789
  this.showZoomBtn = false;
@@ -1797,6 +1802,7 @@ var CommonDeleteComponent = /** @class */ (function () {
1797
1802
  this.data.saveBtnLabel || this.translation.DELETE || ".DELETE";
1798
1803
  this.cancelBtnLabel =
1799
1804
  this.data.cancelBtnLabel || this.translation.CANCEL || ".CANCEL";
1805
+ this.discardBtnLabel = this.data.discardBtnLabel;
1800
1806
  this.description =
1801
1807
  this.data.description ||
1802
1808
  this.translation.IF_YOU_DELETE_THIS_RECORD_WARNING ||
@@ -1804,46 +1810,10 @@ var CommonDeleteComponent = /** @class */ (function () {
1804
1810
  this.size = this.data.size || "small";
1805
1811
  this.showZoomBtn = this.data.showZoomBtn || false;
1806
1812
  };
1807
- /**
1808
- * @param {?} e
1809
- * @return {?}
1810
- */
1811
- CommonDeleteComponent.prototype.onSave = /**
1812
- * @param {?} e
1813
- * @return {?}
1814
- */
1815
- function (e) {
1816
- this.dialogRef.close(e);
1817
- };
1818
- /**
1819
- * @param {?} e
1820
- * @return {?}
1821
- */
1822
- CommonDeleteComponent.prototype.onClose = /**
1823
- * @param {?} e
1824
- * @return {?}
1825
- */
1826
- function (e) {
1827
- var _this = this;
1828
- if (this.data.onCloseRequest) {
1829
- this.data.onCloseRequest(e).then((/**
1830
- * @param {?} confirmed
1831
- * @return {?}
1832
- */
1833
- function (confirmed) {
1834
- if (confirmed) {
1835
- _this.dialogRef.close();
1836
- }
1837
- }));
1838
- }
1839
- else {
1840
- this.dialogRef.close();
1841
- }
1842
- };
1843
1813
  CommonDeleteComponent.decorators = [
1844
1814
  { type: Component, args: [{
1845
1815
  selector: "kt-common-delete-dialog",
1846
- template: "<kt-common-dialog\r\n\t[size]=\"size\"\r\n\t[title]=\"title\"\r\n\t[hideHeader]=\"false\"\r\n\t[hideCloseBtn]=\"data.hideCloseBtn === undefined ? false : data.hideCloseBtn\"\r\n\t[hideSaveBtn]=\"data.hideSaveBtn === undefined ? false : data.hideSaveBtn\"\r\n\t[saveBtnLabel]=\"saveBtnLabel\"\r\n\t[cancelBtnLabel]=\"cancelBtnLabel\"\r\n\t[showZoomBtn]=\"showZoomBtn\"\r\n\t[showErrorIcon]=\"\r\n\t\tdata.showErrorIcon === undefined ? false : data.showErrorIcon\r\n\t\"\r\n\t[hideCloseIcon]=\"\r\n\t\tdata.hideCloseIcon === undefined ? false : data.hideCloseIcon\r\n\t\"\r\n\t(saveEmit)=\"onSave($event)\"\r\n>\r\n\t<div class=\"mapping-dialog\">\r\n\t\t{{ description }}\r\n\t</div>\r\n</kt-common-dialog>\r\n",
1816
+ template: "<rs-common-dialog\r\n [size]=\"size\"\r\n [title]=\"title\"\r\n [hideHeader]=\"false\"\r\n [hideCloseBtn]=\"data.hideCloseBtn === undefined ? false : data.hideCloseBtn\"\r\n [hideSaveBtn]=\"data.hideSaveBtn === undefined ? false : data.hideSaveBtn\"\r\n [hideDiscardBtn]=\"\r\n data.hideDiscardBtn === undefined ? true : data.hideDiscardBtn\r\n \"\r\n [saveBtnLabel]=\"saveBtnLabel\"\r\n [cancelBtnLabel]=\"cancelBtnLabel\"\r\n [discardBtnLabel]=\"discardBtnLabel\"\r\n [showErrorIcon]=\"\r\n data.showErrorIcon === undefined ? false : data.showErrorIcon\r\n \"\r\n [hideCloseIcon]=\"\r\n data.hideCloseIcon === undefined ? false : data.hideCloseIcon\r\n \"\r\n>\r\n <div class=\"mapping-dialog\">\r\n {{ description }}\r\n </div>\r\n</rs-common-dialog>\r\n",
1847
1817
  styles: [".mapping-dialog{color:#44566c;font-family:Arial;font-size:12px;line-height:16px;white-space:pre-line}"]
1848
1818
  }] }
1849
1819
  ];
@@ -1864,6 +1834,8 @@ if (false) {
1864
1834
  /** @type {?} */
1865
1835
  CommonDeleteComponent.prototype.cancelBtnLabel;
1866
1836
  /** @type {?} */
1837
+ CommonDeleteComponent.prototype.discardBtnLabel;
1838
+ /** @type {?} */
1867
1839
  CommonDeleteComponent.prototype.description;
1868
1840
  /** @type {?} */
1869
1841
  CommonDeleteComponent.prototype.size;
@@ -1991,11 +1963,14 @@ var DialogService = /** @class */ (function () {
1991
1963
  /** @type {?} */
1992
1964
  var defaultData = {
1993
1965
  title: this.translation.UNSAVED_CHANGES || ".UNSAVED_CHANGES",
1994
- description: this.translation
1995
- .YOU_HAVE_UNSAVED_CHANGED_ARE_YOU_SURE_YOU_WANT_TO_DISCARD_THEM ||
1996
- ".YOU_HAVE_UNSAVED_CHANGED_ARE_YOU_SURE_YOU_WANT_TO_DISCARD_THEM",
1997
- saveBtnLabel: this.translation.DISCARD_CHANGES || ".DISCARD_CHANGES",
1998
- cancelBtnLabel: this.translation.CONTINUE_EDITING || ".CONTINUE_EDITING",
1966
+ description: this.translation.YOU_HAVE_UNSAVED_CHANGES_DO_YOU_WANT_TO_CONTINUE ||
1967
+ ".YOU_HAVE_UNSAVED_CHANGES_DO_YOU_WANT_TO_CONTINUE",
1968
+ saveBtnLabel: this.translation.SAVE_AND_LEAVE || ".SAVE_AND_LEAVE",
1969
+ discardBtnLabel: this.translation.DISCARD_AND_LEAVE || ".DISCARD_AND_LEAVE",
1970
+ cancelBtnLabel: this.translation.CANCEL || ".CANCEL",
1971
+ hideDiscardBtn: false,
1972
+ size: "medium",
1973
+ hideCloseIcon: true,
1999
1974
  };
2000
1975
  if (data) {
2001
1976
  data = Object.assign(defaultData, data);
@@ -22697,8 +22672,10 @@ var CommonDialogComponent = /** @class */ (function () {
22697
22672
  this.hideCloseIcon = false;
22698
22673
  this.hideCloseBtn = false;
22699
22674
  this.hideSaveBtn = false;
22675
+ this.hideDiscardBtn = false;
22700
22676
  this.saveBtnLabel = "";
22701
22677
  this.cancelBtnLabel = "";
22678
+ this.discardBtnLabel = "";
22702
22679
  this.showErrorIcon = false;
22703
22680
  this.showZoomBtn = false;
22704
22681
  // 显示相关属性
@@ -22744,12 +22721,12 @@ var CommonDialogComponent = /** @class */ (function () {
22744
22721
  */
22745
22722
  function (confirmed) {
22746
22723
  if (confirmed) {
22747
- _this.dialogRef.close();
22724
+ _this.dialogRef.close("close");
22748
22725
  }
22749
22726
  }));
22750
22727
  }
22751
22728
  else {
22752
- this.dialogRef.close();
22729
+ this.dialogRef.close("close");
22753
22730
  }
22754
22731
  };
22755
22732
  /**
@@ -22773,15 +22750,16 @@ var CommonDialogComponent = /** @class */ (function () {
22773
22750
  * @return {?}
22774
22751
  */
22775
22752
  function () {
22776
- var _this = this;
22777
- // 这里把关闭事件emit上去,但是必须使用箭头函数保存this对象
22778
- this.saveEmit.emit((/**
22779
- * @param {?} res
22780
- * @return {?}
22781
- */
22782
- function (res) {
22783
- _this.dialogRef.close(res);
22784
- }));
22753
+ this.dialogRef.close("save");
22754
+ };
22755
+ /**
22756
+ * @return {?}
22757
+ */
22758
+ CommonDialogComponent.prototype.onDiscard = /**
22759
+ * @return {?}
22760
+ */
22761
+ function () {
22762
+ this.dialogRef.close("discard");
22785
22763
  };
22786
22764
  /**
22787
22765
  * @private
@@ -22801,8 +22779,8 @@ var CommonDialogComponent = /** @class */ (function () {
22801
22779
  CommonDialogComponent.decorators = [
22802
22780
  { type: Component, args: [{
22803
22781
  selector: "rs-common-dialog",
22804
- template: "<div class=\"dialog\" [ngClass]=\"size\" [ngStyle]=\"dialogStyle\">\r\n <!-- \u5934\u90E8 -->\r\n <div *ngIf=\"!hideHeader\" mat-dialog-title class=\"dialog__header\">\r\n <div class=\"header__title\">\r\n <img\r\n src=\"../../../assets/img/notification-status-warning.svg\"\r\n alt=\"\"\r\n *ngIf=\"showErrorIcon\"\r\n />\r\n {{ title }}\r\n </div>\r\n <div class=\"header__actions\">\r\n <div *ngIf=\"showZoomBtn\" class=\"header__close-btn\" (click)=\"onZoom()\">\r\n <img\r\n class=\"header__close-icon\"\r\n *ngIf=\"size === 'largest'\"\r\n src=\"../../../assets/img/shrink-icon.svg\"\r\n />\r\n <img\r\n class=\"header__close-icon\"\r\n *ngIf=\"size !== 'largest'\"\r\n src=\"../../../assets/img/grow-icon.svg\"\r\n />\r\n </div>\r\n <div *ngIf=\"!hideCloseIcon\" class=\"header__close-btn\" (click)=\"onClose()\">\r\n <img class=\"header__close-icon\" src=\"../../../assets/img/close.svg\" />\r\n </div>\r\n </div>\r\n </div>\r\n <!-- \u5185\u5BB9 -->\r\n <div class=\"dialog__content\" mat-dialog-content>\r\n <ng-content></ng-content>\r\n </div>\r\n <!-- \u5E95\u90E8\u6309\u94AE -->\r\n <div mat-dialog-actions class=\"dialog__footer\">\r\n <ng-content select=\"[footerSlot]\"></ng-content>\r\n <!-- \u9ED8\u8BA4\u5C55\u793A\u4FDD\u5B58/\u5173\u95ED\u6309\u94AE -->\r\n <ng-container *ngIf=\"!customFooter\">\r\n <ng-template [ngTemplateOutlet]=\"defaultTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-template #defaultTemplate>\r\n <button\r\n *ngIf=\"!hideCloseBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ cancelBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideSaveBtn\"\r\n class=\"e-btn e-primary\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ saveBtnLabel }}\r\n </button>\r\n </ng-template>\r\n </div>\r\n <!-- loading -->\r\n <div class=\"dialog__loading\" [hidden]=\"!loading\">\r\n <img src=\"../../../assets/img/raise_loading.gif\" alt=\"\" />\r\n </div>\r\n</div>\r\n",
22805
- styles: [":host::ng-deep .dialog{position:relative;max-height:90vh;font-weight:400;padding:20px;overflow:hidden;display:flex;flex-direction:column}:host::ng-deep .dialog.largest{width:80vw!important;max-width:1885px;padding:20px}:host::ng-deep .dialog.medium{width:500px;padding:20px}:host::ng-deep .dialog.small{width:350px;padding:20px 16px}:host::ng-deep .dialog.small .dialog__header{color:#002c4f;margin-bottom:16px}:host::ng-deep .dialog.small .dialog__header .header__title{font-size:13px;line-height:16px}:host::ng-deep .dialog.small .dialog__content{font-size:12px;line-height:16px}:host::ng-deep .dialog.small .dialog__footer{min-height:42px;padding:16px 0 0;font-size:12px;line-height:14px}:host::ng-deep .dialog.small .dialog__footer button{padding:6px 12px;min-width:60px}:host::ng-deep .dialog.large{width:800px;padding:20px}:host::ng-deep .dialog .dialog__header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:0}:host::ng-deep .dialog .dialog__header::before{display:none}:host::ng-deep .dialog .dialog__header .header__title{color:#002c4f;font-family:Arial;font-size:15px;font-weight:700;line-height:18px;flex:1;overflow:hidden;display:flex;align-items:center;gap:8px}:host::ng-deep .dialog .dialog__header .header__actions{display:flex;align-items:center;gap:20px}:host::ng-deep .dialog .dialog__header .header__close-icon{display:block;width:100%;height:100%}:host::ng-deep .dialog .dialog__header .header__close-btn{cursor:pointer;flex:0 0 20px;padding:4px;width:20px;height:20px;display:flex;justify-content:center;align-items:center}:host::ng-deep .dialog .dialog__content{width:100%;min-height:38px;position:relative;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;font-size:13px;line-height:19px;flex:1;height:0}:host::ng-deep .dialog .dialog__footer{position:relative;display:flex;align-items:center;justify-content:flex-end;padding:20px 0 0;font-size:13px;line-height:16px;margin-bottom:0}:host::ng-deep .dialog .dialog__footer button{border-radius:4px;padding:6px 16px;border:none;min-width:70px}:host::ng-deep .dialog .dialog__footer button+button{margin-left:12px}:host::ng-deep .dialog .dialog__footer .save-btn{background:#1364b3;border:1px solid #1364b3;font-weight:700;color:#fff}:host::ng-deep .dialog .dialog__footer .cancel-btn{border:1px solid #adb5bd;background:#fff}:host::ng-deep .dialog .dialog__loading{height:100%;background:0 0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999}:host::ng-deep .dialog .dialog__loading img{position:absolute;left:50%;top:50%;width:40px;height:40px;transform:translate(-50%,-50%)}"]
22782
+ template: "<div class=\"dialog\" [ngClass]=\"size\" [ngStyle]=\"dialogStyle\">\r\n <!-- \u5934\u90E8 -->\r\n <div *ngIf=\"!hideHeader\" mat-dialog-title class=\"dialog__header\">\r\n <div class=\"header__title\">\r\n <img\r\n src=\"../../../assets/img/notification-status-warning.svg\"\r\n alt=\"\"\r\n *ngIf=\"showErrorIcon\"\r\n />\r\n {{ title }}\r\n </div>\r\n <div class=\"header__actions\">\r\n <div *ngIf=\"showZoomBtn\" class=\"header__close-btn\" (click)=\"onZoom()\">\r\n <img\r\n class=\"header__close-icon\"\r\n *ngIf=\"size === 'largest'\"\r\n src=\"../../../assets/img/shrink-icon.svg\"\r\n />\r\n <img\r\n class=\"header__close-icon\"\r\n *ngIf=\"size !== 'largest'\"\r\n src=\"../../../assets/img/grow-icon.svg\"\r\n />\r\n </div>\r\n <div *ngIf=\"!hideCloseIcon\" class=\"header__close-btn\" (click)=\"onClose()\">\r\n <img class=\"header__close-icon\" src=\"../../../assets/img/close.svg\" />\r\n </div>\r\n </div>\r\n </div>\r\n <!-- \u5185\u5BB9 -->\r\n <div class=\"dialog__content\" mat-dialog-content>\r\n <ng-content></ng-content>\r\n </div>\r\n <!-- \u5E95\u90E8\u6309\u94AE -->\r\n <div mat-dialog-actions class=\"dialog__footer\">\r\n <ng-content select=\"[footerSlot]\"></ng-content>\r\n <!-- \u9ED8\u8BA4\u5C55\u793A\u4FDD\u5B58/\u5173\u95ED\u6309\u94AE -->\r\n <ng-container *ngIf=\"!customFooter\">\r\n <ng-template [ngTemplateOutlet]=\"defaultTemplate\"></ng-template>\r\n </ng-container>\r\n <ng-template #defaultTemplate>\r\n <button\r\n *ngIf=\"!hideCloseBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onClose()\"\r\n >\r\n {{ cancelBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideDiscardBtn\"\r\n class=\"e-btn\"\r\n (click)=\"onDiscard()\"\r\n >\r\n {{ discardBtnLabel }}\r\n </button>\r\n <button\r\n *ngIf=\"!hideSaveBtn\"\r\n class=\"e-btn e-primary\"\r\n (click)=\"onSave()\"\r\n >\r\n {{ saveBtnLabel }}\r\n </button>\r\n </ng-template>\r\n </div>\r\n <!-- loading -->\r\n <div class=\"dialog__loading\" [hidden]=\"!loading\">\r\n <img src=\"../../../assets/img/raise_loading.gif\" alt=\"\" />\r\n </div>\r\n</div>\r\n",
22783
+ styles: [":host::ng-deep .dialog{position:relative;max-height:90vh;font-weight:400;padding:20px;overflow:hidden;display:flex;flex-direction:column}:host::ng-deep .dialog.largest{width:80vw!important;height:88vh!important;max-width:1885px;padding:20px}:host::ng-deep .dialog.medium{width:500px;padding:20px}:host::ng-deep .dialog.small{width:350px;padding:20px 16px}:host::ng-deep .dialog.small .dialog__header{color:#002c4f;margin-bottom:16px}:host::ng-deep .dialog.small .dialog__header .header__title{font-size:13px;line-height:16px}:host::ng-deep .dialog.small .dialog__content{font-size:12px;line-height:16px}:host::ng-deep .dialog.small .dialog__footer{min-height:42px;padding:16px 0 0;font-size:12px;line-height:14px}:host::ng-deep .dialog.small .dialog__footer button{padding:6px 12px;min-width:60px}:host::ng-deep .dialog.large{width:800px;padding:20px}:host::ng-deep .dialog .dialog__header{width:100%;display:flex;justify-content:space-between;align-items:center;padding:0}:host::ng-deep .dialog .dialog__header::before{display:none}:host::ng-deep .dialog .dialog__header .header__title{color:#002c4f;font-family:Arial;font-size:15px;font-weight:700;line-height:18px;flex:1;overflow:hidden;display:flex;align-items:center;gap:8px}:host::ng-deep .dialog .dialog__header .header__actions{display:flex;align-items:center;gap:20px}:host::ng-deep .dialog .dialog__header .header__close-icon{display:block;width:100%;height:100%}:host::ng-deep .dialog .dialog__header .header__close-btn{cursor:pointer;flex:0 0 20px;padding:4px;width:20px;height:20px;display:flex;justify-content:center;align-items:center}:host::ng-deep .dialog .dialog__content{width:100%;min-height:38px;position:relative;overflow-y:auto;overflow-x:hidden;margin:0;padding:0;font-size:13px;line-height:19px;flex:1;height:0}:host::ng-deep .dialog .dialog__footer{position:relative;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:20px 0 0;font-size:13px;line-height:16px;margin-bottom:0}:host::ng-deep .dialog .dialog__loading{height:100%;background:0 0;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999}:host::ng-deep .dialog .dialog__loading img{position:absolute;left:50%;top:50%;width:40px;height:40px;transform:translate(-50%,-50%)}"]
22806
22784
  }] }
22807
22785
  ];
22808
22786
  /** @nocollapse */
@@ -22814,8 +22792,10 @@ var CommonDialogComponent = /** @class */ (function () {
22814
22792
  hideCloseIcon: [{ type: Input }],
22815
22793
  hideCloseBtn: [{ type: Input }],
22816
22794
  hideSaveBtn: [{ type: Input }],
22795
+ hideDiscardBtn: [{ type: Input }],
22817
22796
  saveBtnLabel: [{ type: Input }],
22818
22797
  cancelBtnLabel: [{ type: Input }],
22798
+ discardBtnLabel: [{ type: Input }],
22819
22799
  showErrorIcon: [{ type: Input }],
22820
22800
  showZoomBtn: [{ type: Input }],
22821
22801
  onCloseRequest: [{ type: Input }],
@@ -22841,10 +22821,14 @@ if (false) {
22841
22821
  /** @type {?} */
22842
22822
  CommonDialogComponent.prototype.hideSaveBtn;
22843
22823
  /** @type {?} */
22824
+ CommonDialogComponent.prototype.hideDiscardBtn;
22825
+ /** @type {?} */
22844
22826
  CommonDialogComponent.prototype.saveBtnLabel;
22845
22827
  /** @type {?} */
22846
22828
  CommonDialogComponent.prototype.cancelBtnLabel;
22847
22829
  /** @type {?} */
22830
+ CommonDialogComponent.prototype.discardBtnLabel;
22831
+ /** @type {?} */
22848
22832
  CommonDialogComponent.prototype.showErrorIcon;
22849
22833
  /** @type {?} */
22850
22834
  CommonDialogComponent.prototype.showZoomBtn;