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
|
@@ -2099,6 +2099,13 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2099
2099
|
this.deletePermission = true; // delete权限
|
|
2100
2100
|
// delete权限
|
|
2101
2101
|
this.isReadOnly = false;
|
|
2102
|
+
this.filedsKey = {
|
|
2103
|
+
commentaries: "commentaries",
|
|
2104
|
+
messageId: "messageId",
|
|
2105
|
+
ownerName: "ownerName",
|
|
2106
|
+
lastModifiedOn: "lastModifiedOn",
|
|
2107
|
+
messageBody: "messageBody",
|
|
2108
|
+
};
|
|
2102
2109
|
this.actionComplete = new EventEmitter();
|
|
2103
2110
|
this.commentVal = "";
|
|
2104
2111
|
this.replyVal = "";
|
|
@@ -2139,13 +2146,14 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2139
2146
|
* @return {?}
|
|
2140
2147
|
*/
|
|
2141
2148
|
function (res) {
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
+
var _a;
|
|
2150
|
+
_this.commentData.unshift((_a = {},
|
|
2151
|
+
_a["" + _this.filedsKey["messageId"]] = res.messageId,
|
|
2152
|
+
_a["" + _this.filedsKey["commentaries"]] = [],
|
|
2153
|
+
_a["" + _this.filedsKey["ownerName"]] = _this.displayName,
|
|
2154
|
+
_a["" + _this.filedsKey["lastModifiedOn"]] = Date.now(),
|
|
2155
|
+
_a["" + _this.filedsKey["messageBody"]] = _this.commentVal,
|
|
2156
|
+
_a));
|
|
2149
2157
|
_this.commentVal = "";
|
|
2150
2158
|
}),
|
|
2151
2159
|
});
|
|
@@ -2159,7 +2167,7 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2159
2167
|
* @return {?}
|
|
2160
2168
|
*/
|
|
2161
2169
|
function (item) {
|
|
2162
|
-
this.editCommentVal = item.messageBody;
|
|
2170
|
+
this.editCommentVal = item[this.filedsKey["messageBody"]];
|
|
2163
2171
|
item.showCommentEdit = true;
|
|
2164
2172
|
};
|
|
2165
2173
|
/**
|
|
@@ -2182,7 +2190,7 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2182
2190
|
* @return {?}
|
|
2183
2191
|
*/
|
|
2184
2192
|
function (res) {
|
|
2185
|
-
item.messageBody = _this.editCommentVal;
|
|
2193
|
+
item[_this.filedsKey["messageBody"]] = _this.editCommentVal;
|
|
2186
2194
|
item.showCommentEdit = false;
|
|
2187
2195
|
_this.ref.markForCheck();
|
|
2188
2196
|
}),
|
|
@@ -2220,7 +2228,7 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2220
2228
|
* @param {?} ele
|
|
2221
2229
|
* @return {?}
|
|
2222
2230
|
*/
|
|
2223
|
-
function (ele) { return ele.messageId === item.messageId; }));
|
|
2231
|
+
function (ele) { return ele[_this.filedsKey.messageId] === item[_this.filedsKey.messageId]; }));
|
|
2224
2232
|
_this.actionComplete.emit({
|
|
2225
2233
|
action: "deleteComment",
|
|
2226
2234
|
data: item,
|
|
@@ -2254,13 +2262,14 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2254
2262
|
* @return {?}
|
|
2255
2263
|
*/
|
|
2256
2264
|
function (res) {
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2265
|
+
var _a;
|
|
2266
|
+
item[_this.filedsKey["commentaries"]].unshift((_a = {},
|
|
2267
|
+
_a["" + _this.filedsKey["messageId"]] = res[_this.filedsKey["messageId"]],
|
|
2268
|
+
_a["" + _this.filedsKey["commentaries"]] = [],
|
|
2269
|
+
_a["" + _this.filedsKey["ownerName"]] = _this.displayName,
|
|
2270
|
+
_a["" + _this.filedsKey["lastModifiedOn"]] = Date.now(),
|
|
2271
|
+
_a["" + _this.filedsKey["messageBody"]] = _this.replyVal,
|
|
2272
|
+
_a));
|
|
2264
2273
|
_this.replyVal = "";
|
|
2265
2274
|
item.showReplyInput = false;
|
|
2266
2275
|
_this.ref.detectChanges();
|
|
@@ -2285,7 +2294,7 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2285
2294
|
RsCommentaryComponent.decorators = [
|
|
2286
2295
|
{ type: Component, args: [{
|
|
2287
2296
|
selector: "rs-commentary",
|
|
2288
|
-
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
|
|
2297
|
+
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",
|
|
2289
2298
|
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}"]
|
|
2290
2299
|
}] }
|
|
2291
2300
|
];
|
|
@@ -2301,6 +2310,7 @@ var RsCommentaryComponent = /** @class */ (function () {
|
|
|
2301
2310
|
editPermission: [{ type: Input }],
|
|
2302
2311
|
deletePermission: [{ type: Input }],
|
|
2303
2312
|
isReadOnly: [{ type: Input }],
|
|
2313
|
+
filedsKey: [{ type: Input }],
|
|
2304
2314
|
actionComplete: [{ type: Output }]
|
|
2305
2315
|
};
|
|
2306
2316
|
__decorate([
|
|
@@ -2341,6 +2351,8 @@ if (false) {
|
|
|
2341
2351
|
/** @type {?} */
|
|
2342
2352
|
RsCommentaryComponent.prototype.isReadOnly;
|
|
2343
2353
|
/** @type {?} */
|
|
2354
|
+
RsCommentaryComponent.prototype.filedsKey;
|
|
2355
|
+
/** @type {?} */
|
|
2344
2356
|
RsCommentaryComponent.prototype.actionComplete;
|
|
2345
2357
|
/** @type {?} */
|
|
2346
2358
|
RsCommentaryComponent.prototype.commentVal;
|