raise-common-lib 0.0.134 → 0.0.135
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/bundles/raise-common-lib.umd.js +30 -18
- package/bundles/raise-common-lib.umd.js.map +1 -1
- package/bundles/raise-common-lib.umd.min.js +1 -1
- package/bundles/raise-common-lib.umd.min.js.map +1 -1
- package/esm2015/lib/commentary/constants.js +10 -10
- package/esm2015/lib/commentary/index.component.js +26 -16
- package/esm5/lib/commentary/constants.js +10 -10
- package/esm5/lib/commentary/index.component.js +31 -19
- package/fesm2015/raise-common-lib.js +25 -15
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +30 -18
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/commentary/constants.d.ts +9 -9
- package/lib/commentary/index.component.d.ts +7 -0
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
|
@@ -2292,6 +2292,13 @@
|
|
|
2292
2292
|
this.deletePermission = true; // delete权限
|
|
2293
2293
|
// delete权限
|
|
2294
2294
|
this.isReadOnly = false;
|
|
2295
|
+
this.filedsKey = {
|
|
2296
|
+
commentaries: "commentaries",
|
|
2297
|
+
messageId: "messageId",
|
|
2298
|
+
ownerName: "ownerName",
|
|
2299
|
+
lastModifiedOn: "lastModifiedOn",
|
|
2300
|
+
messageBody: "messageBody",
|
|
2301
|
+
};
|
|
2295
2302
|
this.actionComplete = new core.EventEmitter();
|
|
2296
2303
|
this.commentVal = "";
|
|
2297
2304
|
this.replyVal = "";
|
|
@@ -2332,13 +2339,14 @@
|
|
|
2332
2339
|
* @return {?}
|
|
2333
2340
|
*/
|
|
2334
2341
|
function (res) {
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
+
var _a;
|
|
2343
|
+
_this.commentData.unshift((_a = {},
|
|
2344
|
+
_a["" + _this.filedsKey["messageId"]] = res.messageId,
|
|
2345
|
+
_a["" + _this.filedsKey["commentaries"]] = [],
|
|
2346
|
+
_a["" + _this.filedsKey["ownerName"]] = _this.displayName,
|
|
2347
|
+
_a["" + _this.filedsKey["lastModifiedOn"]] = Date.now(),
|
|
2348
|
+
_a["" + _this.filedsKey["messageBody"]] = _this.commentVal,
|
|
2349
|
+
_a));
|
|
2342
2350
|
_this.commentVal = "";
|
|
2343
2351
|
}),
|
|
2344
2352
|
});
|
|
@@ -2352,7 +2360,7 @@
|
|
|
2352
2360
|
* @return {?}
|
|
2353
2361
|
*/
|
|
2354
2362
|
function (item) {
|
|
2355
|
-
this.editCommentVal = item.messageBody;
|
|
2363
|
+
this.editCommentVal = item[this.filedsKey["messageBody"]];
|
|
2356
2364
|
item.showCommentEdit = true;
|
|
2357
2365
|
};
|
|
2358
2366
|
/**
|
|
@@ -2375,7 +2383,7 @@
|
|
|
2375
2383
|
* @return {?}
|
|
2376
2384
|
*/
|
|
2377
2385
|
function (res) {
|
|
2378
|
-
item.messageBody = _this.editCommentVal;
|
|
2386
|
+
item[_this.filedsKey["messageBody"]] = _this.editCommentVal;
|
|
2379
2387
|
item.showCommentEdit = false;
|
|
2380
2388
|
_this.ref.markForCheck();
|
|
2381
2389
|
}),
|
|
@@ -2413,7 +2421,7 @@
|
|
|
2413
2421
|
* @param {?} ele
|
|
2414
2422
|
* @return {?}
|
|
2415
2423
|
*/
|
|
2416
|
-
function (ele) { return ele.messageId === item.messageId; }));
|
|
2424
|
+
function (ele) { return ele[_this.filedsKey.messageId] === item[_this.filedsKey.messageId]; }));
|
|
2417
2425
|
_this.actionComplete.emit({
|
|
2418
2426
|
action: "deleteComment",
|
|
2419
2427
|
data: item,
|
|
@@ -2447,13 +2455,14 @@
|
|
|
2447
2455
|
* @return {?}
|
|
2448
2456
|
*/
|
|
2449
2457
|
function (res) {
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2458
|
+
var _a;
|
|
2459
|
+
item[_this.filedsKey["commentaries"]].unshift((_a = {},
|
|
2460
|
+
_a["" + _this.filedsKey["messageId"]] = res[_this.filedsKey["messageId"]],
|
|
2461
|
+
_a["" + _this.filedsKey["commentaries"]] = [],
|
|
2462
|
+
_a["" + _this.filedsKey["ownerName"]] = _this.displayName,
|
|
2463
|
+
_a["" + _this.filedsKey["lastModifiedOn"]] = Date.now(),
|
|
2464
|
+
_a["" + _this.filedsKey["messageBody"]] = _this.replyVal,
|
|
2465
|
+
_a));
|
|
2457
2466
|
_this.replyVal = "";
|
|
2458
2467
|
item.showReplyInput = false;
|
|
2459
2468
|
_this.ref.detectChanges();
|
|
@@ -2478,7 +2487,7 @@
|
|
|
2478
2487
|
RsCommentaryComponent.decorators = [
|
|
2479
2488
|
{ type: core.Component, args: [{
|
|
2480
2489
|
selector: "rs-commentary",
|
|
2481
|
-
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
|
|
2490
|
+
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",
|
|
2482
2491
|
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;height:44px}.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:0 0!important;color:#1364b3!important}.rs-commentary-wrap .reply-box .e-btn.text:focus{background:0 0!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}"]
|
|
2483
2492
|
}] }
|
|
2484
2493
|
];
|
|
@@ -2494,6 +2503,7 @@
|
|
|
2494
2503
|
editPermission: [{ type: core.Input }],
|
|
2495
2504
|
deletePermission: [{ type: core.Input }],
|
|
2496
2505
|
isReadOnly: [{ type: core.Input }],
|
|
2506
|
+
filedsKey: [{ type: core.Input }],
|
|
2497
2507
|
actionComplete: [{ type: core.Output }]
|
|
2498
2508
|
};
|
|
2499
2509
|
__decorate([
|
|
@@ -2534,6 +2544,8 @@
|
|
|
2534
2544
|
/** @type {?} */
|
|
2535
2545
|
RsCommentaryComponent.prototype.isReadOnly;
|
|
2536
2546
|
/** @type {?} */
|
|
2547
|
+
RsCommentaryComponent.prototype.filedsKey;
|
|
2548
|
+
/** @type {?} */
|
|
2537
2549
|
RsCommentaryComponent.prototype.actionComplete;
|
|
2538
2550
|
/** @type {?} */
|
|
2539
2551
|
RsCommentaryComponent.prototype.commentVal;
|