raise-common-lib-new 0.0.35 → 0.0.37

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.
@@ -1234,6 +1234,13 @@ class RsCommentaryComponent {
1234
1234
  editPermission = true; // edit权限
1235
1235
  deletePermission = true; // delete权限
1236
1236
  isReadOnly = false;
1237
+ filedsKey = {
1238
+ commentaries: "commentaries",
1239
+ messageId: "messageId",
1240
+ ownerName: "ownerName",
1241
+ lastModifiedOn: "lastModifiedOn",
1242
+ messageBody: "messageBody",
1243
+ };
1237
1244
  actionComplete = new EventEmitter();
1238
1245
  commentVal = "";
1239
1246
  replyVal = "";
@@ -1252,18 +1259,18 @@ class RsCommentaryComponent {
1252
1259
  data: { inputValue: this.commentVal },
1253
1260
  callback: (res) => {
1254
1261
  this.commentData.unshift({
1255
- messageId: res.messageId,
1256
- commentaries: [],
1257
- ownerName: this.displayName,
1258
- lastModifiedOn: Date.now(),
1259
- messageBody: this.commentVal,
1262
+ [`${this.filedsKey["messageId"]}`]: res.messageId,
1263
+ [`${this.filedsKey["commentaries"]}`]: [],
1264
+ [`${this.filedsKey["ownerName"]}`]: this.displayName,
1265
+ [`${this.filedsKey["lastModifiedOn"]}`]: Date.now(),
1266
+ [`${this.filedsKey["messageBody"]}`]: this.commentVal,
1260
1267
  });
1261
1268
  this.commentVal = "";
1262
1269
  },
1263
1270
  });
1264
1271
  }
1265
1272
  editComment(item) {
1266
- this.editCommentVal = item.messageBody;
1273
+ this.editCommentVal = item[this.filedsKey["messageBody"]];
1267
1274
  item.showCommentEdit = true;
1268
1275
  }
1269
1276
  async updateComment(item) {
@@ -1271,7 +1278,7 @@ class RsCommentaryComponent {
1271
1278
  action: "updateComment",
1272
1279
  data: { ...item, inputValue: this.editCommentVal },
1273
1280
  callback: (res) => {
1274
- item.messageBody = this.editCommentVal;
1281
+ item[this.filedsKey["messageBody"]] = this.editCommentVal;
1275
1282
  item.showCommentEdit = false;
1276
1283
  this.ref.markForCheck();
1277
1284
  },
@@ -1287,7 +1294,7 @@ class RsCommentaryComponent {
1287
1294
  if (!res) {
1288
1295
  return;
1289
1296
  }
1290
- const idx = this.commentData.findIndex((ele) => ele.messageId === item.messageId);
1297
+ const idx = this.commentData.findIndex((ele) => ele[this.filedsKey.messageId] === item[this.filedsKey.messageId]);
1291
1298
  this.actionComplete.emit({
1292
1299
  action: "deleteComment",
1293
1300
  data: item,
@@ -1304,12 +1311,12 @@ class RsCommentaryComponent {
1304
1311
  action: "replyComment",
1305
1312
  data: { ...item, inputValue: this.replyVal },
1306
1313
  callback: (res) => {
1307
- item.commentaries.unshift({
1308
- messageId: res.messageId,
1309
- commentaries: [],
1310
- ownerName: this.displayName,
1311
- lastModifiedOn: Date.now(),
1312
- messageBody: this.replyVal,
1314
+ item[this.filedsKey["commentaries"]].unshift({
1315
+ [`${this.filedsKey["messageId"]}`]: res[this.filedsKey["messageId"]],
1316
+ [`${this.filedsKey["commentaries"]}`]: [],
1317
+ [`${this.filedsKey["ownerName"]}`]: this.displayName,
1318
+ [`${this.filedsKey["lastModifiedOn"]}`]: Date.now(),
1319
+ [`${this.filedsKey["messageBody"]}`]: this.replyVal,
1313
1320
  });
1314
1321
  this.replyVal = "";
1315
1322
  item.showReplyInput = false;
@@ -1324,7 +1331,7 @@ class RsCommentaryComponent {
1324
1331
  textarea.style.minHeight = textarea.scrollHeight + "px";
1325
1332
  }
1326
1333
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RsCommentaryComponent, deps: [{ token: CommonFunctionService }, { token: DialogService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1327
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: RsCommentaryComponent, selector: "rs-commentary", inputs: { displayName: "displayName", commentData: "commentData", editPermission: "editPermission", deletePermission: "deletePermission", isReadOnly: "isReadOnly" }, outputs: { actionComplete: "actionComplete" }, ngImport: i0, template: "<div class=\"rs-commentary-wrap\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment' }\"\r\n ></ng-container>\r\n <div class=\"reply-box\">\r\n <div *ngFor=\"let item of commentData\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment', item: item }\"\r\n ></ng-container>\r\n <div class=\"sub-reply-list\">\r\n <ng-container\r\n *ngFor=\"\r\n let sub of item.isExpanded\r\n ? item.commentaries\r\n : item.commentaries.slice(0, 3)\r\n \"\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'sub', item: sub }\"\r\n ></ng-container>\r\n </div>\r\n <button\r\n class=\"e-btn text\"\r\n *ngIf=\"item.commentaries.length > 3\"\r\n (click)=\"item.isExpanded = !item.isExpanded\"\r\n style=\"margin-bottom: 8px;\"\r\n >\r\n {{\r\n item.isExpanded\r\n ? \"Collapse\"\r\n : \"View All \" + item.commentaries.length + \" Replies\"\r\n }}\r\n <img\r\n class=\"arrow\"\r\n [ngClass]=\"{ collapse: item.isExpanded }\"\r\n src=\"../../assets/img/dropdown-arrow.svg\"\r\n alt=\"\"\r\n />\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #commentBoxTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"comment-box\">\r\n <div class=\"comment-input-wrap\">\r\n <div class=\"avatar\" *ngIf=\"type !== 'editComment'\">\r\n {{ cf.rtn(displayName) }}\r\n </div>\r\n <textarea\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"commentVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'reply'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"replyVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'editComment'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"editCommentVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n </div>\r\n <div class=\"btn-wrap\">\r\n <button\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"commentVal === ''|| isReadOnly || !editPermission\"\r\n (click)=\"addComment()\"\r\n >\r\n {{ translation.COMMENT || \".COMMENT\" }}\r\n </button>\r\n <ng-container *ngIf=\"type === 'reply'\">\r\n <button\r\n class=\"e-btn small\"\r\n (click)=\"item.showReplyInput = false; replyVal = ''\"\r\n >\r\n {{ translation.CANCEL || \".CANCEL\" }}\r\n </button>\r\n <button\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"replyVal === ''\"\r\n (click)=\"addReply(item)\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngIf=\"type === 'editComment'\">\r\n <button class=\"e-btn text\" (click)=\"item.showCommentEdit = false\">\r\n <img src=\"../../assets/img/comment-cancel.svg\" alt=\"\" />\r\n </button>\r\n <button\r\n class=\"e-btn text\"\r\n [disabled]=\"editCommentVal === ''\"\r\n (click)=\"updateComment(item)\"\r\n >\r\n <img src=\"../../assets/img/comment-check.svg\" alt=\"\" />\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<ng-template #replyItemTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"reply-item\" [ngClass]=\"{ comment: type === 'comment' }\">\r\n <div class=\"avatar\">\r\n {{ cf.rtn(item.ownerName) }}\r\n </div>\r\n <div class=\"owner-wrap\">\r\n <div class=\"owner-info\">\r\n <div class=\"name\">\r\n {{ item.ownerName }}\r\n </div>\r\n <div class=\"time\">\r\n {{ item.lastModifiedOn | date : dateTimePipeFormat }}\r\n </div>\r\n </div>\r\n <div class=\"message-wrap\">\r\n <div class=\"message\" *ngIf=\"!item.showCommentEdit\">\r\n {{ item.messageBody }}\r\n </div>\r\n <ng-container\r\n *ngIf=\"item.showCommentEdit\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'editComment', item: item }\"\r\n ></ng-container>\r\n </div>\r\n\r\n <button\r\n *ngIf=\"\r\n type === 'comment' && !item.showReplyInput && !item.showCommentEdit\r\n \"\r\n class=\"e-btn text\"\r\n (click)=\"item.showReplyInput = true\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n <ng-container\r\n *ngIf=\"item.showReplyInput\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'reply', item: item }\"\r\n ></ng-container>\r\n\r\n <rs-grid-action *ngIf=\"type === 'comment'\">\r\n <rs-grid-action-item\r\n image=\"Edit\"\r\n [text]=\"translation.EDIT\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n (click)=\"editComment(item)\"\r\n ></rs-grid-action-item>\r\n <rs-grid-action-item\r\n image=\"Delete\"\r\n [text]=\"translation.DELETE\"\r\n [disabled]=\"isReadOnly || !deletePermission\"\r\n (click)=\"deleteComment(item)\"\r\n ></rs-grid-action-item>\r\n </rs-grid-action>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".rs-commentary-wrap{width:100%;height:100%;padding:32px;display:flex;flex-direction:column}.rs-commentary-wrap .comment-box{width:100%}.rs-commentary-wrap .comment-box .comment-input-wrap{margin-bottom:12px;display:flex;gap:12px}.rs-commentary-wrap .comment-box .comment-input-wrap .e-input{flex:1;width:0}.rs-commentary-wrap .comment-box .btn-wrap{display:flex;justify-content:flex-end;gap:12px}.rs-commentary-wrap .comment-box .btn-wrap .e-btn.text{padding:4px}.rs-commentary-wrap .reply-box{height:0;flex:1;overflow:auto;margin-top:16px;margin-right:-32px;padding-right:32px}.rs-commentary-wrap .reply-box .sub-reply-list{padding-left:40px}.rs-commentary-wrap .reply-box .e-btn.text{padding:0!important;min-width:auto;height:auto;color:#6c7c90!important}.rs-commentary-wrap .reply-box .e-btn.text:hover{background:transparent!important;color:#1364b3!important}.rs-commentary-wrap .reply-box .e-btn.text:focus{background:transparent!important;color:#6c7c90!important}.rs-commentary-wrap .reply-box .arrow.collapse{transform:rotate(180deg)}.rs-commentary-wrap .reply-box .reply-item{display:flex;gap:12px;padding:12px 0}.rs-commentary-wrap .reply-box .reply-item.comment{border-top:1px solid #eaedf0}.rs-commentary-wrap .reply-box .reply-item.comment:hover{background-color:#f6faff}.rs-commentary-wrap .reply-box .reply-item.comment:hover rs-grid-action{display:block}.rs-commentary-wrap .reply-box .reply-item rs-grid-action{display:none;position:absolute;cursor:pointer;top:-4px;right:8px}.rs-commentary-wrap .reply-box .owner-wrap{flex:1;width:0;position:relative}.rs-commentary-wrap .reply-box .owner-wrap .owner-info{display:flex;align-items:center;gap:12px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .name{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:700;line-height:14px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .time{color:#6c7c90;font-family:Arial;font-size:10px;font-style:normal;font-weight:400;line-height:12px}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap{padding:8px 0}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap .message{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.rs-commentary-wrap .avatar{width:32px;height:32px;border-radius:100%;border:1px solid rgba(108,124,144,.4);color:#44566c;display:flex;align-items:center;justify-content:center;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: GridActionComponent, selector: "rs-grid-action" }, { kind: "component", type: GridActionItemComponent, selector: "rs-grid-action-item", inputs: ["image", "text", "disabled"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: RsCommentaryComponent, selector: "rs-commentary", inputs: { displayName: "displayName", commentData: "commentData", editPermission: "editPermission", deletePermission: "deletePermission", isReadOnly: "isReadOnly", filedsKey: "filedsKey" }, outputs: { actionComplete: "actionComplete" }, ngImport: i0, template: "<div class=\"rs-commentary-wrap\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment' }\"\r\n ></ng-container>\r\n <div class=\"reply-box\">\r\n <div *ngFor=\"let item of commentData\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment', item: item }\"\r\n ></ng-container>\r\n <div class=\"sub-reply-list\">\r\n <ng-container\r\n *ngFor=\"\r\n let sub of item.isExpanded\r\n ? item[filedsKey.commentaries]\r\n : item[filedsKey.commentaries].slice(0, 3)\r\n \"\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'sub', item: sub }\"\r\n ></ng-container>\r\n </div>\r\n <button\r\n class=\"e-btn text\"\r\n *ngIf=\"item[filedsKey.commentaries].length > 3\"\r\n (click)=\"item.isExpanded = !item.isExpanded\"\r\n style=\"margin-bottom: 8px\"\r\n >\r\n {{\r\n item.isExpanded\r\n ? \"Collapse\"\r\n : \"View All \" + item[filedsKey.commentaries].length + \" Replies\"\r\n }}\r\n <img\r\n class=\"arrow\"\r\n [ngClass]=\"{ collapse: item.isExpanded }\"\r\n src=\"../../assets/img/dropdown-arrow.svg\"\r\n alt=\"\"\r\n />\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #commentBoxTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"comment-box\">\r\n <div class=\"comment-input-wrap\">\r\n <div class=\"avatar\" *ngIf=\"type !== 'editComment'\">\r\n {{ cf.rtn(displayName) }}\r\n </div>\r\n <textarea\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"commentVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'reply'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"replyVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'editComment'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"editCommentVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n </div>\r\n <div class=\"btn-wrap\">\r\n <button\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"commentVal === '' || isReadOnly || !editPermission\"\r\n (click)=\"addComment()\"\r\n >\r\n {{ translation.COMMENT || \".COMMENT\" }}\r\n </button>\r\n <ng-container *ngIf=\"type === 'reply'\">\r\n <button\r\n class=\"e-btn small\"\r\n (click)=\"item.showReplyInput = false; replyVal = ''\"\r\n >\r\n {{ translation.CANCEL || \".CANCEL\" }}\r\n </button>\r\n <button\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"replyVal === ''\"\r\n (click)=\"addReply(item)\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngIf=\"type === 'editComment'\">\r\n <button class=\"e-btn text\" (click)=\"item.showCommentEdit = false\">\r\n <img src=\"../../assets/img/comment-cancel.svg\" alt=\"\" />\r\n </button>\r\n <button\r\n class=\"e-btn text\"\r\n [disabled]=\"editCommentVal === ''\"\r\n (click)=\"updateComment(item)\"\r\n >\r\n <img src=\"../../assets/img/comment-check.svg\" alt=\"\" />\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<ng-template #replyItemTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"reply-item\" [ngClass]=\"{ comment: type === 'comment' }\">\r\n <div class=\"avatar\">\r\n {{ cf.rtn(item[filedsKey.ownerName]) }}\r\n </div>\r\n <div class=\"owner-wrap\">\r\n <div class=\"owner-info\">\r\n <div class=\"name\">\r\n {{ item[filedsKey.ownerName] }}\r\n </div>\r\n <div class=\"time\">\r\n {{ item[filedsKey.lastModifiedOn] | date : dateTimePipeFormat }}\r\n </div>\r\n </div>\r\n <div class=\"message-wrap\">\r\n <div class=\"message\" *ngIf=\"!item.showCommentEdit\">\r\n {{ item[filedsKey.messageBody] }}\r\n </div>\r\n <ng-container\r\n *ngIf=\"item.showCommentEdit\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'editComment', item: item }\"\r\n ></ng-container>\r\n </div>\r\n\r\n <button\r\n *ngIf=\"\r\n type === 'comment' && !item.showReplyInput && !item.showCommentEdit\r\n \"\r\n class=\"e-btn text\"\r\n (click)=\"item.showReplyInput = true\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n <ng-container\r\n *ngIf=\"item.showReplyInput\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'reply', item: item }\"\r\n ></ng-container>\r\n\r\n <rs-grid-action *ngIf=\"type === 'comment'\">\r\n <rs-grid-action-item\r\n image=\"Edit\"\r\n [text]=\"translation.EDIT\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n (click)=\"editComment(item)\"\r\n ></rs-grid-action-item>\r\n <rs-grid-action-item\r\n image=\"Delete\"\r\n [text]=\"translation.DELETE\"\r\n [disabled]=\"isReadOnly || !deletePermission\"\r\n (click)=\"deleteComment(item)\"\r\n ></rs-grid-action-item>\r\n </rs-grid-action>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".rs-commentary-wrap{width:100%;height:100%;padding:32px;display:flex;flex-direction:column}.rs-commentary-wrap .comment-box{width:100%}.rs-commentary-wrap .comment-box .comment-input-wrap{margin-bottom:12px;display:flex;gap:12px}.rs-commentary-wrap .comment-box .comment-input-wrap .e-input{flex:1;width:0}.rs-commentary-wrap .comment-box .btn-wrap{display:flex;justify-content:flex-end;gap:12px}.rs-commentary-wrap .comment-box .btn-wrap .e-btn.text{padding:4px}.rs-commentary-wrap .reply-box{height:0;flex:1;overflow:auto;margin-top:16px;margin-right:-32px;padding-right:32px}.rs-commentary-wrap .reply-box .sub-reply-list{padding-left:40px}.rs-commentary-wrap .reply-box .e-btn.text{padding:0!important;min-width:auto;height:auto;color:#6c7c90!important}.rs-commentary-wrap .reply-box .e-btn.text:hover{background:transparent!important;color:#1364b3!important}.rs-commentary-wrap .reply-box .e-btn.text:focus{background:transparent!important;color:#6c7c90!important}.rs-commentary-wrap .reply-box .arrow.collapse{transform:rotate(180deg)}.rs-commentary-wrap .reply-box .reply-item{display:flex;gap:12px;padding:12px 0}.rs-commentary-wrap .reply-box .reply-item.comment{border-top:1px solid #eaedf0}.rs-commentary-wrap .reply-box .reply-item.comment:hover{background-color:#f6faff}.rs-commentary-wrap .reply-box .reply-item.comment:hover rs-grid-action{display:block}.rs-commentary-wrap .reply-box .reply-item rs-grid-action{display:none;position:absolute;cursor:pointer;top:-4px;right:8px}.rs-commentary-wrap .reply-box .owner-wrap{flex:1;width:0;position:relative}.rs-commentary-wrap .reply-box .owner-wrap .owner-info{display:flex;align-items:center;gap:12px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .name{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:700;line-height:14px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .time{color:#6c7c90;font-family:Arial;font-size:10px;font-style:normal;font-weight:400;line-height:12px}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap{padding:8px 0}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap .message{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.rs-commentary-wrap .avatar{width:32px;height:32px;border-radius:100%;border:1px solid rgba(108,124,144,.4);color:#44566c;display:flex;align-items:center;justify-content:center;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: GridActionComponent, selector: "rs-grid-action" }, { kind: "component", type: GridActionItemComponent, selector: "rs-grid-action-item", inputs: ["image", "text", "disabled"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
1328
1335
  }
1329
1336
  __decorate([
1330
1337
  Debounce(300)
@@ -1340,7 +1347,7 @@ __decorate([
1340
1347
  ], RsCommentaryComponent.prototype, "adjustTextareaHeight", null);
1341
1348
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RsCommentaryComponent, decorators: [{
1342
1349
  type: Component,
1343
- args: [{ selector: "rs-commentary", template: "<div class=\"rs-commentary-wrap\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment' }\"\r\n ></ng-container>\r\n <div class=\"reply-box\">\r\n <div *ngFor=\"let item of commentData\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment', item: item }\"\r\n ></ng-container>\r\n <div class=\"sub-reply-list\">\r\n <ng-container\r\n *ngFor=\"\r\n let sub of item.isExpanded\r\n ? item.commentaries\r\n : item.commentaries.slice(0, 3)\r\n \"\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'sub', item: sub }\"\r\n ></ng-container>\r\n </div>\r\n <button\r\n class=\"e-btn text\"\r\n *ngIf=\"item.commentaries.length > 3\"\r\n (click)=\"item.isExpanded = !item.isExpanded\"\r\n style=\"margin-bottom: 8px;\"\r\n >\r\n {{\r\n item.isExpanded\r\n ? \"Collapse\"\r\n : \"View All \" + item.commentaries.length + \" Replies\"\r\n }}\r\n <img\r\n class=\"arrow\"\r\n [ngClass]=\"{ collapse: item.isExpanded }\"\r\n src=\"../../assets/img/dropdown-arrow.svg\"\r\n alt=\"\"\r\n />\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #commentBoxTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"comment-box\">\r\n <div class=\"comment-input-wrap\">\r\n <div class=\"avatar\" *ngIf=\"type !== 'editComment'\">\r\n {{ cf.rtn(displayName) }}\r\n </div>\r\n <textarea\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"commentVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'reply'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"replyVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'editComment'\"\r\n class=\"e-input\"\r\n rows=\"3\"\r\n [(ngModel)]=\"editCommentVal\"\r\n (focus)=\"adjustTextareaHeight($event)\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n </div>\r\n <div class=\"btn-wrap\">\r\n <button\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"commentVal === ''|| isReadOnly || !editPermission\"\r\n (click)=\"addComment()\"\r\n >\r\n {{ translation.COMMENT || \".COMMENT\" }}\r\n </button>\r\n <ng-container *ngIf=\"type === 'reply'\">\r\n <button\r\n class=\"e-btn small\"\r\n (click)=\"item.showReplyInput = false; replyVal = ''\"\r\n >\r\n {{ translation.CANCEL || \".CANCEL\" }}\r\n </button>\r\n <button\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"replyVal === ''\"\r\n (click)=\"addReply(item)\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngIf=\"type === 'editComment'\">\r\n <button class=\"e-btn text\" (click)=\"item.showCommentEdit = false\">\r\n <img src=\"../../assets/img/comment-cancel.svg\" alt=\"\" />\r\n </button>\r\n <button\r\n class=\"e-btn text\"\r\n [disabled]=\"editCommentVal === ''\"\r\n (click)=\"updateComment(item)\"\r\n >\r\n <img src=\"../../assets/img/comment-check.svg\" alt=\"\" />\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<ng-template #replyItemTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"reply-item\" [ngClass]=\"{ comment: type === 'comment' }\">\r\n <div class=\"avatar\">\r\n {{ cf.rtn(item.ownerName) }}\r\n </div>\r\n <div class=\"owner-wrap\">\r\n <div class=\"owner-info\">\r\n <div class=\"name\">\r\n {{ item.ownerName }}\r\n </div>\r\n <div class=\"time\">\r\n {{ item.lastModifiedOn | date : dateTimePipeFormat }}\r\n </div>\r\n </div>\r\n <div class=\"message-wrap\">\r\n <div class=\"message\" *ngIf=\"!item.showCommentEdit\">\r\n {{ item.messageBody }}\r\n </div>\r\n <ng-container\r\n *ngIf=\"item.showCommentEdit\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'editComment', item: item }\"\r\n ></ng-container>\r\n </div>\r\n\r\n <button\r\n *ngIf=\"\r\n type === 'comment' && !item.showReplyInput && !item.showCommentEdit\r\n \"\r\n class=\"e-btn text\"\r\n (click)=\"item.showReplyInput = true\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n <ng-container\r\n *ngIf=\"item.showReplyInput\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'reply', item: item }\"\r\n ></ng-container>\r\n\r\n <rs-grid-action *ngIf=\"type === 'comment'\">\r\n <rs-grid-action-item\r\n image=\"Edit\"\r\n [text]=\"translation.EDIT\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n (click)=\"editComment(item)\"\r\n ></rs-grid-action-item>\r\n <rs-grid-action-item\r\n image=\"Delete\"\r\n [text]=\"translation.DELETE\"\r\n [disabled]=\"isReadOnly || !deletePermission\"\r\n (click)=\"deleteComment(item)\"\r\n ></rs-grid-action-item>\r\n </rs-grid-action>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".rs-commentary-wrap{width:100%;height:100%;padding:32px;display:flex;flex-direction:column}.rs-commentary-wrap .comment-box{width:100%}.rs-commentary-wrap .comment-box .comment-input-wrap{margin-bottom:12px;display:flex;gap:12px}.rs-commentary-wrap .comment-box .comment-input-wrap .e-input{flex:1;width:0}.rs-commentary-wrap .comment-box .btn-wrap{display:flex;justify-content:flex-end;gap:12px}.rs-commentary-wrap .comment-box .btn-wrap .e-btn.text{padding:4px}.rs-commentary-wrap .reply-box{height:0;flex:1;overflow:auto;margin-top:16px;margin-right:-32px;padding-right:32px}.rs-commentary-wrap .reply-box .sub-reply-list{padding-left:40px}.rs-commentary-wrap .reply-box .e-btn.text{padding:0!important;min-width:auto;height:auto;color:#6c7c90!important}.rs-commentary-wrap .reply-box .e-btn.text:hover{background:transparent!important;color:#1364b3!important}.rs-commentary-wrap .reply-box .e-btn.text:focus{background:transparent!important;color:#6c7c90!important}.rs-commentary-wrap .reply-box .arrow.collapse{transform:rotate(180deg)}.rs-commentary-wrap .reply-box .reply-item{display:flex;gap:12px;padding:12px 0}.rs-commentary-wrap .reply-box .reply-item.comment{border-top:1px solid #eaedf0}.rs-commentary-wrap .reply-box .reply-item.comment:hover{background-color:#f6faff}.rs-commentary-wrap .reply-box .reply-item.comment:hover rs-grid-action{display:block}.rs-commentary-wrap .reply-box .reply-item rs-grid-action{display:none;position:absolute;cursor:pointer;top:-4px;right:8px}.rs-commentary-wrap .reply-box .owner-wrap{flex:1;width:0;position:relative}.rs-commentary-wrap .reply-box .owner-wrap .owner-info{display:flex;align-items:center;gap:12px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .name{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:700;line-height:14px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .time{color:#6c7c90;font-family:Arial;font-size:10px;font-style:normal;font-weight:400;line-height:12px}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap{padding:8px 0}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap .message{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.rs-commentary-wrap .avatar{width:32px;height:32px;border-radius:100%;border:1px solid rgba(108,124,144,.4);color:#44566c;display:flex;align-items:center;justify-content:center;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px}\n"] }]
1350
+ args: [{ selector: "rs-commentary", template: "<div class=\"rs-commentary-wrap\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment' }\"\r\n ></ng-container>\r\n <div class=\"reply-box\">\r\n <div *ngFor=\"let item of commentData\">\r\n <ng-container\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'comment', item: item }\"\r\n ></ng-container>\r\n <div class=\"sub-reply-list\">\r\n <ng-container\r\n *ngFor=\"\r\n let sub of item.isExpanded\r\n ? item[filedsKey.commentaries]\r\n : item[filedsKey.commentaries].slice(0, 3)\r\n \"\r\n [ngTemplateOutlet]=\"replyItemTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'sub', item: sub }\"\r\n ></ng-container>\r\n </div>\r\n <button\r\n class=\"e-btn text\"\r\n *ngIf=\"item[filedsKey.commentaries].length > 3\"\r\n (click)=\"item.isExpanded = !item.isExpanded\"\r\n style=\"margin-bottom: 8px\"\r\n >\r\n {{\r\n item.isExpanded\r\n ? \"Collapse\"\r\n : \"View All \" + item[filedsKey.commentaries].length + \" Replies\"\r\n }}\r\n <img\r\n class=\"arrow\"\r\n [ngClass]=\"{ collapse: item.isExpanded }\"\r\n src=\"../../assets/img/dropdown-arrow.svg\"\r\n alt=\"\"\r\n />\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n\r\n<ng-template #commentBoxTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"comment-box\">\r\n <div class=\"comment-input-wrap\">\r\n <div class=\"avatar\" *ngIf=\"type !== 'editComment'\">\r\n {{ cf.rtn(displayName) }}\r\n </div>\r\n <textarea\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"commentVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'reply'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"replyVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n <textarea\r\n *ngIf=\"type === 'editComment'\"\r\n class=\"e-input\"\r\n rows=\"2\"\r\n [(ngModel)]=\"editCommentVal\"\r\n (input)=\"adjustTextareaHeight($event)\"\r\n placeholder=\"Write your comment...\"\r\n ></textarea>\r\n </div>\r\n <div class=\"btn-wrap\">\r\n <button\r\n *ngIf=\"type === 'comment'\"\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"commentVal === '' || isReadOnly || !editPermission\"\r\n (click)=\"addComment()\"\r\n >\r\n {{ translation.COMMENT || \".COMMENT\" }}\r\n </button>\r\n <ng-container *ngIf=\"type === 'reply'\">\r\n <button\r\n class=\"e-btn small\"\r\n (click)=\"item.showReplyInput = false; replyVal = ''\"\r\n >\r\n {{ translation.CANCEL || \".CANCEL\" }}\r\n </button>\r\n <button\r\n class=\"e-btn e-primary small\"\r\n [disabled]=\"replyVal === ''\"\r\n (click)=\"addReply(item)\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n </ng-container>\r\n <ng-container *ngIf=\"type === 'editComment'\">\r\n <button class=\"e-btn text\" (click)=\"item.showCommentEdit = false\">\r\n <img src=\"../../assets/img/comment-cancel.svg\" alt=\"\" />\r\n </button>\r\n <button\r\n class=\"e-btn text\"\r\n [disabled]=\"editCommentVal === ''\"\r\n (click)=\"updateComment(item)\"\r\n >\r\n <img src=\"../../assets/img/comment-check.svg\" alt=\"\" />\r\n </button>\r\n </ng-container>\r\n </div>\r\n </div>\r\n</ng-template>\r\n<ng-template #replyItemTemplate let-type=\"type\" let-item=\"item\">\r\n <div class=\"reply-item\" [ngClass]=\"{ comment: type === 'comment' }\">\r\n <div class=\"avatar\">\r\n {{ cf.rtn(item[filedsKey.ownerName]) }}\r\n </div>\r\n <div class=\"owner-wrap\">\r\n <div class=\"owner-info\">\r\n <div class=\"name\">\r\n {{ item[filedsKey.ownerName] }}\r\n </div>\r\n <div class=\"time\">\r\n {{ item[filedsKey.lastModifiedOn] | date : dateTimePipeFormat }}\r\n </div>\r\n </div>\r\n <div class=\"message-wrap\">\r\n <div class=\"message\" *ngIf=\"!item.showCommentEdit\">\r\n {{ item[filedsKey.messageBody] }}\r\n </div>\r\n <ng-container\r\n *ngIf=\"item.showCommentEdit\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'editComment', item: item }\"\r\n ></ng-container>\r\n </div>\r\n\r\n <button\r\n *ngIf=\"\r\n type === 'comment' && !item.showReplyInput && !item.showCommentEdit\r\n \"\r\n class=\"e-btn text\"\r\n (click)=\"item.showReplyInput = true\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n >\r\n {{ translation.REPLY || \".REPLY\" }}\r\n </button>\r\n <ng-container\r\n *ngIf=\"item.showReplyInput\"\r\n [ngTemplateOutlet]=\"commentBoxTemplate\"\r\n [ngTemplateOutletContext]=\"{ type: 'reply', item: item }\"\r\n ></ng-container>\r\n\r\n <rs-grid-action *ngIf=\"type === 'comment'\">\r\n <rs-grid-action-item\r\n image=\"Edit\"\r\n [text]=\"translation.EDIT\"\r\n [disabled]=\"isReadOnly || !editPermission\"\r\n (click)=\"editComment(item)\"\r\n ></rs-grid-action-item>\r\n <rs-grid-action-item\r\n image=\"Delete\"\r\n [text]=\"translation.DELETE\"\r\n [disabled]=\"isReadOnly || !deletePermission\"\r\n (click)=\"deleteComment(item)\"\r\n ></rs-grid-action-item>\r\n </rs-grid-action>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [".rs-commentary-wrap{width:100%;height:100%;padding:32px;display:flex;flex-direction:column}.rs-commentary-wrap .comment-box{width:100%}.rs-commentary-wrap .comment-box .comment-input-wrap{margin-bottom:12px;display:flex;gap:12px}.rs-commentary-wrap .comment-box .comment-input-wrap .e-input{flex:1;width:0}.rs-commentary-wrap .comment-box .btn-wrap{display:flex;justify-content:flex-end;gap:12px}.rs-commentary-wrap .comment-box .btn-wrap .e-btn.text{padding:4px}.rs-commentary-wrap .reply-box{height:0;flex:1;overflow:auto;margin-top:16px;margin-right:-32px;padding-right:32px}.rs-commentary-wrap .reply-box .sub-reply-list{padding-left:40px}.rs-commentary-wrap .reply-box .e-btn.text{padding:0!important;min-width:auto;height:auto;color:#6c7c90!important}.rs-commentary-wrap .reply-box .e-btn.text:hover{background:transparent!important;color:#1364b3!important}.rs-commentary-wrap .reply-box .e-btn.text:focus{background:transparent!important;color:#6c7c90!important}.rs-commentary-wrap .reply-box .arrow.collapse{transform:rotate(180deg)}.rs-commentary-wrap .reply-box .reply-item{display:flex;gap:12px;padding:12px 0}.rs-commentary-wrap .reply-box .reply-item.comment{border-top:1px solid #eaedf0}.rs-commentary-wrap .reply-box .reply-item.comment:hover{background-color:#f6faff}.rs-commentary-wrap .reply-box .reply-item.comment:hover rs-grid-action{display:block}.rs-commentary-wrap .reply-box .reply-item rs-grid-action{display:none;position:absolute;cursor:pointer;top:-4px;right:8px}.rs-commentary-wrap .reply-box .owner-wrap{flex:1;width:0;position:relative}.rs-commentary-wrap .reply-box .owner-wrap .owner-info{display:flex;align-items:center;gap:12px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .name{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:700;line-height:14px}.rs-commentary-wrap .reply-box .owner-wrap .owner-info .time{color:#6c7c90;font-family:Arial;font-size:10px;font-style:normal;font-weight:400;line-height:12px}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap{padding:8px 0}.rs-commentary-wrap .reply-box .owner-wrap .message-wrap .message{color:#44566c;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:16px}.rs-commentary-wrap .avatar{width:32px;height:32px;border-radius:100%;border:1px solid rgba(108,124,144,.4);color:#44566c;display:flex;align-items:center;justify-content:center;font-family:Arial;font-size:12px;font-style:normal;font-weight:400;line-height:14px}\n"] }]
1344
1351
  }], ctorParameters: function () { return [{ type: CommonFunctionService }, { type: DialogService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { displayName: [{
1345
1352
  type: Input
1346
1353
  }], commentData: [{
@@ -1351,6 +1358,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1351
1358
  type: Input
1352
1359
  }], isReadOnly: [{
1353
1360
  type: Input
1361
+ }], filedsKey: [{
1362
+ type: Input
1354
1363
  }], actionComplete: [{
1355
1364
  type: Output
1356
1365
  }], addComment: [], deleteComment: [], addReply: [], adjustTextareaHeight: [] } });
@@ -1655,6 +1664,8 @@ class MultiTabComponent {
1655
1664
  keepAlive;
1656
1665
  singleReuseUrls = []; //只能单个缓存的url
1657
1666
  noGenerateTabUrls = []; //不生成tab的url
1667
+ flattenMenu = [];
1668
+ defaultTabUrl = "";
1658
1669
  onRefreshTab = new EventEmitter();
1659
1670
  subscriptions = [];
1660
1671
  TAB_WIDTH = 164;
@@ -1693,11 +1704,11 @@ class MultiTabComponent {
1693
1704
  const skipLocationChange = navigation.extras.skipLocationChange; // 获取是否跳过 location change
1694
1705
  const currentRoute = this.router.routerState.root.firstChild;
1695
1706
  const navigationInfo = JSON.parse(sessionStorage.getItem("navigationInfo") || "{}");
1696
- let title = (state && state.title) ||
1707
+ let title = (state && state["title"]) ||
1697
1708
  navigationInfo.title ||
1698
1709
  navigationInfo.subTitle ||
1699
1710
  navigationInfo.name;
1700
- let noReused = (state && state.noReused) || false; // 当前tab不复用,新开一个tab,当有已经存在的tab时候也是新开
1711
+ let noReused = (state && state["noReused"]) || false; // 当前tab不复用,新开一个tab,当有已经存在的tab时候也是新开
1701
1712
  if (currentRoute && !skipLocationChange) {
1702
1713
  if (this.noGenerateTabUrls.includes(this.urlWithoutQuery(this.router.url))) {
1703
1714
  return; // 排除不生成tab的url
@@ -1762,6 +1773,7 @@ class MultiTabComponent {
1762
1773
  };
1763
1774
  }
1764
1775
  initTab() {
1776
+ // console.log("this.flattenMenu", this.flattenMenu);
1765
1777
  let TabCache = JSON.parse(sessionStorage.getItem("TabCache"));
1766
1778
  this.tabList = TabCache || [];
1767
1779
  if (this.tabList.length === 0) {
@@ -1771,6 +1783,20 @@ class MultiTabComponent {
1771
1783
  const url = this.router.url;
1772
1784
  this.addTab(url, title);
1773
1785
  }
1786
+ else {
1787
+ const target = this.flattenMenu.find((ele) => ele.url === this.router.url);
1788
+ if (target) {
1789
+ if (target.url !== this.defaultTabUrl) {
1790
+ const defaultTab = this.flattenMenu.find((ele) => ele.url === this.defaultTabUrl);
1791
+ this.tabList.push({
1792
+ url: defaultTab.url,
1793
+ title: defaultTab.label,
1794
+ displayTitle: defaultTab.label,
1795
+ });
1796
+ }
1797
+ this.addTab(target.url, target.label);
1798
+ }
1799
+ }
1774
1800
  }
1775
1801
  }
1776
1802
  closeTab(idx, noChange) {
@@ -1880,13 +1906,14 @@ class MultiTabComponent {
1880
1906
  sessionStorage.removeItem("TabCache"); // 清除缓存
1881
1907
  this.tabList = []; // 清空 tab 列表
1882
1908
  this.selectedTab = 0; // 重置选中的 tab 索引
1909
+ this.subscriptions.forEach((sub) => sub.unsubscribe());
1883
1910
  this.keepAlive.clearAllCache(); // 调用自定义策略的清除缓存方法
1884
1911
  }
1885
1912
  urlWithoutQuery(url) {
1886
1913
  return url.split("?")[0];
1887
1914
  }
1888
1915
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiTabComponent, deps: [{ token: i1$3.Router }, { token: CommonFunctionService }, { token: i1$3.ActivatedRoute }, { token: i0.ChangeDetectorRef }, { token: DrawerService }, { token: i1$3.RouteReuseStrategy }], target: i0.ɵɵFactoryTarget.Component });
1889
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiTabComponent, selector: "rs-multi-tab", inputs: { singleReuseUrls: "singleReuseUrls", noGenerateTabUrls: "noGenerateTabUrls" }, outputs: { onRefreshTab: "onRefreshTab" }, host: { listeners: { "window:resize": "onResize($event)" } }, ngImport: i0, template: "<div class=\"rs-multi-tab\" [ngClass]=\"{ 'b-line': tabList.length > 0 }\">\r\n\t<ul>\r\n\t\t<ng-container *ngFor=\"let tab of tabList; let i = index\">\r\n\t\t\t<li\r\n\t\t\t\t[ngClass]=\"selectedTab === i ? 'isSelect' : 'notSelect'\"\r\n\t\t\t\t(click)=\"changeTab(tab, i)\"\r\n\t\t\t>\r\n\t\t\t\t<ejs-tooltip\r\n\t\t\t\t\tid=\"notSelectTooltip\"\r\n\t\t\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t\t\t[openDelay]=\"500\"\r\n\t\t\t\t\t*ngIf=\"tab.displayTitle !== tab.title; else originText\"\r\n\t\t\t\t\tstyle=\"height: 27px\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<ng-template #content>\r\n\t\t\t\t\t\t<div class=\"tooltip-content\">\r\n\t\t\t\t\t\t\t{{ tab.title }}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t<span class=\"tabTitle\">{{ tab.displayTitle }}</span>\r\n\t\t\t\t</ejs-tooltip>\r\n\t\t\t\t<ng-template #originText>\r\n\t\t\t\t\t<span class=\"tabTitle\">\r\n\t\t\t\t\t\t{{ tab.displayTitle }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</ng-template>\r\n\t\t\t\t<span\r\n\t\t\t\t\tclass=\"img-block\"\r\n\t\t\t\t\t*ngIf=\"selectedTab !== i && i !== 0\"\r\n\t\t\t\t></span>\r\n\t\t\t\t<img\r\n\t\t\t\t\t*ngIf=\"i !== 0\"\r\n\t\t\t\t\tsrc=\"../../../assets/img/close-url.svg\"\r\n\t\t\t\t\t(click)=\"closeTab(i)\"\r\n\t\t\t\t/>\r\n\t\t\t</li>\r\n\t\t</ng-container>\r\n\t</ul>\r\n\t<div class=\"refresh-tab\" (click)=\"refreshTab()\" *ngIf=\"tabList.length > 0\">\r\n\t\t<ejs-tooltip\r\n\t\t\tid=\"notSelectTooltip\"\r\n\t\t\tcssClass=\"notSelectTooltip\"\r\n\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t[openDelay]=\"500\"\r\n\t\t\tstyle=\"height: 27px\"\r\n\t\t>\r\n\t\t\t<ng-template #content>\r\n\t\t\t\t<div class=\"tooltip-content\">Refresh Current Tab</div>\r\n\t\t\t</ng-template>\r\n\t\t\t<img\r\n\t\t\t\tid=\"loadingIcon\"\r\n\t\t\t\talt\r\n\t\t\t\tclass=\"refresh-btn\"\r\n\t\t\t\tsrc=\"../../../assets/img/desktop-refresh-btn.svg\"\r\n\t\t\t/>\r\n\t\t</ejs-tooltip>\r\n\t</div>\r\n</div>\r\n", styles: [".rs-multi-tab{width:100%;display:flex;justify-content:space-between;margin:0 auto;max-width:1886px}.rs-multi-tab.b-line{border-bottom:1px solid #e5eaef}.rs-multi-tab ul{display:flex;margin:0 8px;padding:0;overflow:hidden;height:100%}.rs-multi-tab ul li{max-width:164px;padding:0 12px;display:flex;align-items:center;flex:auto;border:1px solid #e5eaef;border-bottom:none;color:#5f6f81;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;height:28px;background:#f8fafb;vertical-align:top;position:relative;cursor:default}.rs-multi-tab ul li .tabTitle{display:inline-block;white-space:nowrap;font-size:11px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px;transition:width .3s ease}.rs-multi-tab ul li img{border-radius:4px;padding:4px;margin-left:6px;margin-top:1px;vertical-align:top;cursor:pointer}.rs-multi-tab ul li img:hover{background:#dce8f6}.rs-multi-tab ul li:not(:last-child){border-right:none}.rs-multi-tab ul li:first-of-type{border-top-left-radius:8px}.rs-multi-tab ul li:last-child{border-top-right-radius:8px}.rs-multi-tab ul .isSelect{color:#1f3f5c;background:#fff}.rs-multi-tab ul .notSelect img{display:none}.rs-multi-tab ul .notSelect .img-block{display:inline-block;width:22px}.rs-multi-tab ul .notSelect:hover{color:#1f3f5c;background-color:#1f7bff0a}.rs-multi-tab ul .notSelect:hover .img-block{display:none}.rs-multi-tab ul .notSelect:hover img{display:inline-block}.rs-multi-tab .refresh-tab{cursor:pointer;text-align:right;color:#6c7c90;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;padding-right:12px}.rs-multi-tab .refresh-tab img{vertical-align:middle;margin-right:4px}.refresh-tab-loading{animation:spin 1s linear infinite}.notSelectTooltip{transform:translate(-12px)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tooltip-content{padding:4px;color:#f8fafb;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:14px}@media (max-width: 1400px){.refresh-tab{padding-right:0!important}.refresh-tab span{display:none!important}}@media (max-width: 1100px){.rs-multi-tab ul li img{position:absolute;right:3px;background-color:#fff}.notSelect:hover img{position:absolute;right:3px;background-color:#eff5fb}.img-block{display:none!important}.isSelect:not(:first-child){padding-right:20px!important}}@media (max-width: 600px){.rs-multi-tab ul li{padding:0 8px}.rs-multi-tab ul .notSelect .img-block{width:0px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.TooltipComponent, selector: "ejs-tooltip", inputs: ["animation", "closeDelay", "container", "content", "cssClass", "enableHtmlParse", "enableHtmlSanitizer", "enablePersistence", "enableRtl", "height", "htmlAttributes", "isSticky", "locale", "mouseTrail", "offsetX", "offsetY", "openDelay", "opensOn", "position", "showTipPointer", "target", "tipPointerPosition", "width", "windowCollision"], outputs: ["afterClose", "afterOpen", "beforeClose", "beforeCollision", "beforeOpen", "beforeRender", "created", "destroyed"] }] });
1916
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiTabComponent, selector: "rs-multi-tab", inputs: { singleReuseUrls: "singleReuseUrls", noGenerateTabUrls: "noGenerateTabUrls", flattenMenu: "flattenMenu", defaultTabUrl: "defaultTabUrl" }, outputs: { onRefreshTab: "onRefreshTab" }, host: { listeners: { "window:resize": "onResize($event)" } }, ngImport: i0, template: "<div class=\"rs-multi-tab\" [ngClass]=\"{ 'b-line': tabList.length > 0 }\">\r\n\t<ul>\r\n\t\t<ng-container *ngFor=\"let tab of tabList; let i = index\">\r\n\t\t\t<li\r\n\t\t\t\t[ngClass]=\"selectedTab === i ? 'isSelect' : 'notSelect'\"\r\n\t\t\t\t(click)=\"changeTab(tab, i)\"\r\n\t\t\t>\r\n\t\t\t\t<ejs-tooltip\r\n\t\t\t\t\tid=\"notSelectTooltip\"\r\n\t\t\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t\t\t[openDelay]=\"500\"\r\n\t\t\t\t\t*ngIf=\"tab.displayTitle !== tab.title; else originText\"\r\n\t\t\t\t\tstyle=\"height: 27px\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<ng-template #content>\r\n\t\t\t\t\t\t<div class=\"tooltip-content\">\r\n\t\t\t\t\t\t\t{{ tab.title }}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</ng-template>\r\n\t\t\t\t\t<span class=\"tabTitle\">{{ tab.displayTitle }}</span>\r\n\t\t\t\t</ejs-tooltip>\r\n\t\t\t\t<ng-template #originText>\r\n\t\t\t\t\t<span class=\"tabTitle\">\r\n\t\t\t\t\t\t{{ tab.displayTitle }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</ng-template>\r\n\t\t\t\t<span\r\n\t\t\t\t\tclass=\"img-block\"\r\n\t\t\t\t\t*ngIf=\"selectedTab !== i && i !== 0\"\r\n\t\t\t\t></span>\r\n\t\t\t\t<img\r\n\t\t\t\t\t*ngIf=\"i !== 0\"\r\n\t\t\t\t\tsrc=\"../../../assets/img/close-url.svg\"\r\n\t\t\t\t\t(click)=\"closeTab(i)\"\r\n\t\t\t\t/>\r\n\t\t\t</li>\r\n\t\t</ng-container>\r\n\t</ul>\r\n\t<div class=\"refresh-tab\" (click)=\"refreshTab()\" *ngIf=\"tabList.length > 0\">\r\n\t\t<ejs-tooltip\r\n\t\t\tid=\"notSelectTooltip\"\r\n\t\t\tcssClass=\"notSelectTooltip\"\r\n\t\t\t[showTipPointer]=\"false\"\r\n\t\t\t[openDelay]=\"500\"\r\n\t\t\tstyle=\"height: 27px\"\r\n\t\t>\r\n\t\t\t<ng-template #content>\r\n\t\t\t\t<div class=\"tooltip-content\">Refresh Current Tab</div>\r\n\t\t\t</ng-template>\r\n\t\t\t<img\r\n\t\t\t\tid=\"loadingIcon\"\r\n\t\t\t\talt\r\n\t\t\t\tclass=\"refresh-btn\"\r\n\t\t\t\tsrc=\"../../../assets/img/desktop-refresh-btn.svg\"\r\n\t\t\t/>\r\n\t\t</ejs-tooltip>\r\n\t</div>\r\n</div>\r\n", styles: [".rs-multi-tab{width:100%;display:flex;justify-content:space-between;margin:0 auto;max-width:1886px}.rs-multi-tab.b-line{border-bottom:1px solid #e5eaef}.rs-multi-tab ul{display:flex;margin:0 8px;padding:0;overflow:hidden;height:100%}.rs-multi-tab ul li{max-width:164px;padding:0 12px;display:flex;align-items:center;flex:auto;border:1px solid #e5eaef;border-bottom:none;color:#5f6f81;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;height:28px;background:#f8fafb;vertical-align:top;position:relative;cursor:default}.rs-multi-tab ul li .tabTitle{display:inline-block;white-space:nowrap;font-size:11px;font-family:Arial;font-style:normal;font-weight:400;line-height:16px;transition:width .3s ease}.rs-multi-tab ul li img{border-radius:4px;padding:4px;margin-left:6px;margin-top:1px;vertical-align:top;cursor:pointer}.rs-multi-tab ul li img:hover{background:#dce8f6}.rs-multi-tab ul li:not(:last-child){border-right:none}.rs-multi-tab ul li:first-of-type{border-top-left-radius:8px}.rs-multi-tab ul li:last-child{border-top-right-radius:8px}.rs-multi-tab ul .isSelect{color:#1f3f5c;background:#fff}.rs-multi-tab ul .notSelect img{display:none}.rs-multi-tab ul .notSelect .img-block{display:inline-block;width:22px}.rs-multi-tab ul .notSelect:hover{color:#1f3f5c;background-color:#1f7bff0a}.rs-multi-tab ul .notSelect:hover .img-block{display:none}.rs-multi-tab ul .notSelect:hover img{display:inline-block}.rs-multi-tab .refresh-tab{cursor:pointer;text-align:right;color:#6c7c90;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:28px;padding-right:12px}.rs-multi-tab .refresh-tab img{vertical-align:middle;margin-right:4px}.refresh-tab-loading{animation:spin 1s linear infinite}.notSelectTooltip{transform:translate(-12px)}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tooltip-content{padding:4px;color:#f8fafb;font-family:Arial;font-size:11px;font-style:normal;font-weight:400;line-height:14px}@media (max-width: 1400px){.refresh-tab{padding-right:0!important}.refresh-tab span{display:none!important}}@media (max-width: 1100px){.rs-multi-tab ul li img{position:absolute;right:3px;background-color:#fff}.notSelect:hover img{position:absolute;right:3px;background-color:#eff5fb}.img-block{display:none!important}.isSelect:not(:first-child){padding-right:20px!important}}@media (max-width: 600px){.rs-multi-tab ul li{padding:0 8px}.rs-multi-tab ul .notSelect .img-block{width:0px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.TooltipComponent, selector: "ejs-tooltip", inputs: ["animation", "closeDelay", "container", "content", "cssClass", "enableHtmlParse", "enableHtmlSanitizer", "enablePersistence", "enableRtl", "height", "htmlAttributes", "isSticky", "locale", "mouseTrail", "offsetX", "offsetY", "openDelay", "opensOn", "position", "showTipPointer", "target", "tipPointerPosition", "width", "windowCollision"], outputs: ["afterClose", "afterOpen", "beforeClose", "beforeCollision", "beforeOpen", "beforeRender", "created", "destroyed"] }] });
1890
1917
  }
1891
1918
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiTabComponent, decorators: [{
1892
1919
  type: Component,
@@ -1895,6 +1922,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
1895
1922
  type: Input
1896
1923
  }], noGenerateTabUrls: [{
1897
1924
  type: Input
1925
+ }], flattenMenu: [{
1926
+ type: Input
1927
+ }], defaultTabUrl: [{
1928
+ type: Input
1898
1929
  }], onRefreshTab: [{
1899
1930
  type: Output
1900
1931
  }], onResize: [{