@sd-angular/core 0.0.1003 → 0.0.1007
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/autocomplete/sd-angular-core-autocomplete.metadata.json +1 -1
- package/autocomplete/src/lib/autocomplete.component.d.ts +9 -5
- package/bundles/sd-angular-core-api.umd.js +29 -12
- package/bundles/sd-angular-core-api.umd.js.map +1 -1
- package/bundles/sd-angular-core-api.umd.min.js +1 -1
- package/bundles/sd-angular-core-api.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.js +63 -41
- package/bundles/sd-angular-core-autocomplete.umd.js.map +1 -1
- package/bundles/sd-angular-core-autocomplete.umd.min.js +2 -2
- package/bundles/sd-angular-core-autocomplete.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-button.umd.js +29 -12
- package/bundles/sd-angular-core-button.umd.js.map +1 -1
- package/bundles/sd-angular-core-button.umd.min.js +1 -1
- package/bundles/sd-angular-core-button.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-cache.umd.js +29 -12
- package/bundles/sd-angular-core-cache.umd.js.map +1 -1
- package/bundles/sd-angular-core-cache.umd.min.js +2 -2
- package/bundles/sd-angular-core-cache.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-chart.umd.js +29 -12
- package/bundles/sd-angular-core-chart.umd.js.map +1 -1
- package/bundles/sd-angular-core-chart.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-checkbox.umd.js +29 -12
- package/bundles/sd-angular-core-checkbox.umd.js.map +1 -1
- package/bundles/sd-angular-core-checkbox.umd.min.js +1 -1
- package/bundles/sd-angular-core-checkbox.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-chip.umd.js +29 -12
- package/bundles/sd-angular-core-chip.umd.js.map +1 -1
- package/bundles/sd-angular-core-chip.umd.min.js +1 -1
- package/bundles/sd-angular-core-chip.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-comment.umd.js +446 -0
- package/bundles/sd-angular-core-comment.umd.js.map +1 -0
- package/bundles/sd-angular-core-comment.umd.min.js +16 -0
- package/bundles/sd-angular-core-comment.umd.min.js.map +1 -0
- package/bundles/sd-angular-core-common.umd.js +71 -16
- package/bundles/sd-angular-core-common.umd.js.map +1 -1
- package/bundles/sd-angular-core-common.umd.min.js +3 -2
- package/bundles/sd-angular-core-common.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-date-range.umd.js +29 -12
- package/bundles/sd-angular-core-date-range.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-range.umd.min.js +2 -2
- package/bundles/sd-angular-core-date-range.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-date-time.umd.js +29 -12
- package/bundles/sd-angular-core-date-time.umd.js.map +1 -1
- package/bundles/sd-angular-core-date-time.umd.min.js +2 -2
- package/bundles/sd-angular-core-date-time.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.js +29 -12
- package/bundles/sd-angular-core-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-editor.umd.min.js +1 -1
- package/bundles/sd-angular-core-editor.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-excel.umd.js +29 -12
- package/bundles/sd-angular-core-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-excel.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.js +29 -12
- package/bundles/sd-angular-core-export.umd.js.map +1 -1
- package/bundles/sd-angular-core-export.umd.min.js +1 -1
- package/bundles/sd-angular-core-export.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.js +54 -19
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.js +29 -12
- package/bundles/sd-angular-core-grid.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js +1 -1
- package/bundles/sd-angular-core-grid.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input-currency.umd.js +29 -12
- package/bundles/sd-angular-core-input-currency.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-currency.umd.min.js +2 -2
- package/bundles/sd-angular-core-input-currency.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input-dropdown.umd.js +29 -12
- package/bundles/sd-angular-core-input-dropdown.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-dropdown.umd.min.js +1 -1
- package/bundles/sd-angular-core-input-dropdown.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input-upload-file.umd.js +29 -12
- package/bundles/sd-angular-core-input-upload-file.umd.js.map +1 -1
- package/bundles/sd-angular-core-input-upload-file.umd.min.js +2 -2
- package/bundles/sd-angular-core-input-upload-file.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-input.umd.js +54 -17
- package/bundles/sd-angular-core-input.umd.js.map +1 -1
- package/bundles/sd-angular-core-input.umd.min.js +2 -2
- package/bundles/sd-angular-core-input.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-konva.umd.js +29 -12
- package/bundles/sd-angular-core-konva.umd.js.map +1 -1
- package/bundles/sd-angular-core-konva.umd.min.js +1 -1
- package/bundles/sd-angular-core-konva.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-radio.umd.js +29 -12
- package/bundles/sd-angular-core-radio.umd.js.map +1 -1
- package/bundles/sd-angular-core-radio.umd.min.js +1 -1
- package/bundles/sd-angular-core-radio.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-select-editor.umd.js +29 -12
- package/bundles/sd-angular-core-select-editor.umd.js.map +1 -1
- package/bundles/sd-angular-core-select-editor.umd.min.js +2 -2
- package/bundles/sd-angular-core-select-editor.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.js +29 -12
- package/bundles/sd-angular-core-select.umd.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.min.js +2 -2
- package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.js +29 -12
- package/bundles/sd-angular-core-setting.umd.js.map +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js +1 -1
- package/bundles/sd-angular-core-setting.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-side-drawer.umd.js +29 -12
- package/bundles/sd-angular-core-side-drawer.umd.js.map +1 -1
- package/bundles/sd-angular-core-side-drawer.umd.min.js +2 -2
- package/bundles/sd-angular-core-side-drawer.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-switch.umd.js +29 -12
- package/bundles/sd-angular-core-switch.umd.js.map +1 -1
- package/bundles/sd-angular-core-switch.umd.min.js +2 -2
- package/bundles/sd-angular-core-switch.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-tab-router.umd.js +29 -12
- package/bundles/sd-angular-core-tab-router.umd.js.map +1 -1
- package/bundles/sd-angular-core-tab-router.umd.min.js +2 -2
- package/bundles/sd-angular-core-tab-router.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-textarea.umd.js +29 -12
- package/bundles/sd-angular-core-textarea.umd.js.map +1 -1
- package/bundles/sd-angular-core-textarea.umd.min.js +2 -2
- package/bundles/sd-angular-core-textarea.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-time.umd.js +29 -12
- package/bundles/sd-angular-core-time.umd.js.map +1 -1
- package/bundles/sd-angular-core-time.umd.min.js +2 -2
- package/bundles/sd-angular-core-time.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.js +29 -12
- package/bundles/sd-angular-core-upload-excel.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.min.js +1 -1
- package/bundles/sd-angular-core-upload-excel.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-upload-file.umd.js +29 -12
- package/bundles/sd-angular-core-upload-file.umd.js.map +1 -1
- package/bundles/sd-angular-core-upload-file.umd.min.js +2 -2
- package/bundles/sd-angular-core-upload-file.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-utility.umd.js +29 -12
- package/bundles/sd-angular-core-utility.umd.js.map +1 -1
- package/bundles/sd-angular-core-utility.umd.min.js +1 -1
- package/bundles/sd-angular-core-utility.umd.min.js.map +1 -1
- package/bundles/sd-angular-core.umd.js +33 -16
- package/bundles/sd-angular-core.umd.js.map +1 -1
- package/bundles/sd-angular-core.umd.min.js +1 -1
- package/bundles/sd-angular-core.umd.min.js.map +1 -1
- package/comment/index.d.ts +1 -0
- package/comment/package.json +12 -0
- package/comment/sd-angular-core-comment.d.ts +4 -0
- package/comment/sd-angular-core-comment.metadata.json +1 -0
- package/comment/src/lib/comment.component.d.ts +17 -0
- package/comment/src/lib/comment.model.d.ts +21 -0
- package/comment/src/lib/comment.module.d.ts +2 -0
- package/comment/src/public-api.d.ts +3 -0
- package/common/sd-angular-core-common.metadata.json +1 -1
- package/common/src/lib/common.module.d.ts +2 -0
- package/common/src/lib/directives/view-def.directive.d.ts +5 -0
- package/common/src/public-api.d.ts +2 -0
- package/esm2015/autocomplete/src/lib/autocomplete.component.js +35 -26
- package/esm2015/autocomplete/src/lib/autocomplete.module.js +4 -2
- package/esm2015/comment/index.js +2 -0
- package/esm2015/comment/sd-angular-core-comment.js +5 -0
- package/esm2015/comment/src/lib/comment.component.js +60 -0
- package/esm2015/comment/src/lib/comment.model.js +2 -0
- package/esm2015/comment/src/lib/comment.module.js +37 -0
- package/esm2015/comment/src/public-api.js +7 -0
- package/esm2015/common/src/lib/common.module.js +20 -0
- package/esm2015/common/src/lib/directives/view-def.directive.js +16 -0
- package/esm2015/common/src/public-api.js +3 -1
- package/esm2015/grid-material/src/lib/components/quick-action/quick-action.component.js +7 -4
- package/esm2015/grid-material/src/lib/grid-material.component.js +13 -3
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/selection-disable.pipe.js +4 -2
- package/esm2015/grid-material/src/lib/pipes/selection-visible.pipe.js +5 -3
- package/esm2015/input/src/lib/input.component.js +23 -4
- package/esm2015/input/src/lib/input.module.js +6 -3
- package/esm2015/public-api.js +2 -1
- package/fesm2015/sd-angular-core-autocomplete.js +35 -26
- package/fesm2015/sd-angular-core-autocomplete.js.map +1 -1
- package/fesm2015/sd-angular-core-comment.js +106 -0
- package/fesm2015/sd-angular-core-comment.js.map +1 -0
- package/fesm2015/sd-angular-core-common.js +35 -1
- package/fesm2015/sd-angular-core-common.js.map +1 -1
- package/fesm2015/sd-angular-core-grid-material.js +24 -7
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-input.js +26 -6
- package/fesm2015/sd-angular-core-input.js.map +1 -1
- package/fesm2015/sd-angular-core.js +1 -0
- package/fesm2015/sd-angular-core.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/components/quick-action/quick-action.component.d.ts +2 -0
- package/grid-material/src/lib/grid-material.component.d.ts +1 -0
- package/grid-material/src/lib/models/grid.model.d.ts +1 -0
- package/input/sd-angular-core-input.metadata.json +1 -1
- package/input/src/lib/input.component.d.ts +5 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/{sd-angular-core-0.0.1003.tgz → sd-angular-core-0.0.1007.tgz} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy, Input, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { SdTranslateModule } from '@sd-angular/core/translate';
|
|
4
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
5
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
+
import { __awaiter, __classPrivateFieldGet } from 'tslib';
|
|
7
|
+
import { BehaviorSubject } from 'rxjs';
|
|
8
|
+
import { map } from 'rxjs/operators';
|
|
9
|
+
import { SdButtonModule } from '@sd-angular/core/button';
|
|
10
|
+
import { SdInputModule } from '@sd-angular/core/input';
|
|
11
|
+
import { SdTextareaModule } from '@sd-angular/core/textarea';
|
|
12
|
+
import { SdUtilityModule } from '@sd-angular/core/utility';
|
|
13
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
|
+
|
|
15
|
+
var _items, _send, _load;
|
|
16
|
+
class SdComment {
|
|
17
|
+
constructor() {
|
|
18
|
+
_items.set(this, new BehaviorSubject([]));
|
|
19
|
+
_send.set(this, new BehaviorSubject(''));
|
|
20
|
+
this.onSend = () => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
if (this.message) {
|
|
23
|
+
(_b = (_a = this.option) === null || _a === void 0 ? void 0 : _a.event) === null || _b === void 0 ? void 0 : _b.onSend(this.message);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
_load.set(this, () => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const { items } = this.commentOption;
|
|
28
|
+
const results = items();
|
|
29
|
+
if (results instanceof Promise) {
|
|
30
|
+
return yield results;
|
|
31
|
+
}
|
|
32
|
+
return results;
|
|
33
|
+
}));
|
|
34
|
+
this.reload = () => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
__classPrivateFieldGet(this, _items).next(yield __classPrivateFieldGet(this, _load).call(this));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
set option(option) {
|
|
39
|
+
this.commentOption = option;
|
|
40
|
+
this.reload();
|
|
41
|
+
}
|
|
42
|
+
;
|
|
43
|
+
ngOnInit() {
|
|
44
|
+
this.items = __classPrivateFieldGet(this, _items).pipe(map(items => {
|
|
45
|
+
return items.map(e => {
|
|
46
|
+
var _a;
|
|
47
|
+
return (Object.assign(Object.assign({}, e), { picture: (_a = e.picture) !== null && _a !== void 0 ? _a : `https://ui-avatars.com/api/?size=32&rounded=true&background=random&name=${e.creator}` }));
|
|
48
|
+
});
|
|
49
|
+
}));
|
|
50
|
+
this.count = this.items.pipe(map(items => items.length));
|
|
51
|
+
}
|
|
52
|
+
ngOnDestroy() {
|
|
53
|
+
}
|
|
54
|
+
ngAfterViewInit() {
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_items = new WeakMap(), _send = new WeakMap(), _load = new WeakMap();
|
|
58
|
+
SdComment.decorators = [
|
|
59
|
+
{ type: Component, args: [{
|
|
60
|
+
selector: 'sd-comment',
|
|
61
|
+
template: "<div class=\"c-container\">\r\n <div class=\"c-header\">\r\n <div class=\"c-title\">{{'Comments' | sdTranslate}} <span>({{count | async}})</span></div>\r\n </div>\r\n <div class=\"c-body\">\r\n <ng-container *ngFor=\"let item of items | async\">\r\n <div class=\"d-flex my-8\">\r\n <div class=\"c-avatar mr-12\">\r\n <img height=\"32\" width=\"32px\" [src]=\"item.picture\">\r\n </div>\r\n <div class=\"c-comment\">\r\n <div class=\"c-info mb-4\">\r\n {{'By' | sdTranslate}}\r\n <span class=\"c-creator ml-2\">\r\n {{item.creator}}\r\n </span>\r\n <ng-container *ngIf=\"item.createdDate\">\r\n <span class=\"mx-4\">\u2022</span>\r\n <span [matTooltip]=\"item.createdDate | date:'dd/MM/yyyy HH:mm'\">{{item.createdDate | sdTimeDifferent:'dd/MM/yyyy HH:mm':'hour' | async}}</span>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-content\" [innerHtml]=\"item.content\">\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"c-footer p-16\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <sd-input [(model)]=\"message\" disableErrorMessage></sd-input>\r\n </div>\r\n </div>\r\n <div class=\"row\">\r\n <div class=\"col-12 mt-16\">\r\n <sd-button class=\"float-right\" title=\"G\u1EEDi\" (action)=\"onSend()\" [disabled]=\"!message\" color=\"primary\" type=\"fill\" size=\"sm\">\r\n </sd-button>\r\n </div>\r\n </div>\r\n </div>\r\n</div>",
|
|
62
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
63
|
+
styles: [".c-container{display:flex;flex-direction:column;height:100%}.c-container .c-header{align-items:center;background-color:#fff;display:flex;height:40px;padding:0 16px}.c-container .c-header .c-title{font-weight:500}.c-container .c-body{background:#f8f9fa;flex:1;overflow-y:hidden;padding:16px}.c-container .c-body:hover{overflow-y:auto}.c-container .c-body .c-comment{background:#fff;border:1px solid #f2f2f2;border-radius:4px;padding:12px 16px}.c-container .c-body .c-comment .c-info{color:#757575}.c-container .c-body .c-comment .c-info .c-creator{color:#000;font-weight:500}.c-container .c-footer{min-height:120px}"]
|
|
64
|
+
},] }
|
|
65
|
+
];
|
|
66
|
+
SdComment.ctorParameters = () => [];
|
|
67
|
+
SdComment.propDecorators = {
|
|
68
|
+
option: [{ type: Input }]
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
class SdCommentModule {
|
|
72
|
+
}
|
|
73
|
+
SdCommentModule.decorators = [
|
|
74
|
+
{ type: NgModule, args: [{
|
|
75
|
+
imports: [
|
|
76
|
+
CommonModule,
|
|
77
|
+
MatButtonModule,
|
|
78
|
+
MatIconModule,
|
|
79
|
+
MatTooltipModule,
|
|
80
|
+
SdTranslateModule,
|
|
81
|
+
SdButtonModule,
|
|
82
|
+
SdInputModule,
|
|
83
|
+
SdTextareaModule,
|
|
84
|
+
SdUtilityModule,
|
|
85
|
+
SdTranslateModule
|
|
86
|
+
],
|
|
87
|
+
declarations: [
|
|
88
|
+
SdComment
|
|
89
|
+
],
|
|
90
|
+
exports: [
|
|
91
|
+
SdComment
|
|
92
|
+
],
|
|
93
|
+
providers: []
|
|
94
|
+
},] }
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Public API Surface of superdev-angular-core
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Generated bundle index. Do not edit.
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
export { SdComment, SdCommentModule };
|
|
106
|
+
//# sourceMappingURL=sd-angular-core-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sd-angular-core-comment.js","sources":["../../../../projects/sd-core/comment/src/lib/comment.component.ts","../../../../projects/sd-core/comment/src/lib/comment.module.ts","../../../../projects/sd-core/comment/src/public-api.ts","../../../../projects/sd-core/comment/sd-angular-core-comment.ts"],"sourcesContent":["import {\r\n Component,\r\n AfterViewInit,\r\n OnInit,\r\n OnDestroy,\r\n Input,\r\n ChangeDetectionStrategy\r\n} from '@angular/core';\r\nimport { BehaviorSubject, Observable } from 'rxjs';\r\nimport { map, switchMap } from 'rxjs/operators';\r\nimport { Comment, SdCommentOption } from './comment.model';\r\n@Component({\r\n selector: 'sd-comment',\r\n templateUrl: './comment.component.html',\r\n styleUrls: ['./comment.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class SdComment implements OnInit, AfterViewInit, OnDestroy {\r\n #items = new BehaviorSubject<Comment[]>([]);\r\n #send = new BehaviorSubject<string>('');\r\n commentOption: SdCommentOption;\r\n @Input() set option(option: SdCommentOption) {\r\n this.commentOption = option;\r\n this.reload();\r\n };\r\n\r\n items: Observable<Comment[]>;\r\n count: Observable<number>;\r\n message: string;\r\n constructor() {\r\n }\r\n ngOnInit(): void {\r\n this.items = this.#items.pipe(map(items => {\r\n return items.map(e => ({\r\n ...e,\r\n picture: e.picture ?? `https://ui-avatars.com/api/?size=32&rounded=true&background=random&name=${e.creator}`\r\n }))\r\n }));\r\n this.count = this.items.pipe(map(items => items.length));\r\n }\r\n ngOnDestroy(): void {\r\n }\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n onSend = () => {\r\n if (this.message) {\r\n this.option?.event?.onSend(this.message);\r\n }\r\n }\r\n\r\n #load = async () => {\r\n const { items } = this.commentOption;\r\n const results = items();\r\n if (results instanceof Promise) {\r\n return await results;\r\n }\r\n return results;\r\n }\r\n\r\n reload = async () => {\r\n this.#items.next(await this.#load());\r\n }\r\n}","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdTranslateModule } from '@sd-angular/core/translate';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { SdComment } from './comment.component';\r\nimport { SdButtonModule } from '@sd-angular/core/button';\r\nimport { SdInputModule } from '@sd-angular/core/input';\r\nimport { SdTextareaModule } from '@sd-angular/core/textarea';\r\nimport { SdUtilityModule } from '@sd-angular/core/utility';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule,\r\n MatButtonModule,\r\n MatIconModule,\r\n MatTooltipModule,\r\n SdTranslateModule,\r\n SdButtonModule,\r\n SdInputModule,\r\n SdTextareaModule,\r\n SdUtilityModule,\r\n SdTranslateModule\r\n ],\r\n declarations: [\r\n SdComment\r\n ],\r\n exports: [\r\n SdComment\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdCommentModule { }\r\n","/*\r\n * Public API Surface of superdev-angular-core\r\n */\r\n\r\nexport * from './lib/comment.module';\r\nexport * from './lib/comment.model';\r\nexport * from './lib/comment.component';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAiBa,SAAS;IAYpB;QAXA,iBAAS,IAAI,eAAe,CAAY,EAAE,CAAC,EAAC;QAC5C,gBAAQ,IAAI,eAAe,CAAS,EAAE,CAAC,EAAC;QA0BxC,WAAM,GAAG;;YACP,IAAI,IAAI,CAAC,OAAO,EAAE;gBAChB,YAAA,IAAI,CAAC,MAAM,0CAAE,KAAK,0CAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;aAC1C;SACF,CAAA;QAED,gBAAQ;YACN,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC;YACrC,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;YACxB,IAAI,OAAO,YAAY,OAAO,EAAE;gBAC9B,OAAO,MAAM,OAAO,CAAC;aACtB;YACD,OAAO,OAAO,CAAC;SAChB,CAAA,EAAA;QAED,WAAM,GAAG;YACP,qCAAY,IAAI,CAAC,MAAM,yCAAA,IAAI,CAAQ,CAAC,CAAC;SACtC,CAAA,CAAA;KAhCA;IATD,IAAa,MAAM,CAAC,MAAuB;QACzC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,EAAE,CAAC;KACf;;IAOD,QAAQ;QACN,IAAI,CAAC,KAAK,GAAG,qCAAY,IAAI,CAAC,GAAG,CAAC,KAAK;YACrC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;;gBAAI,wCACjB,CAAC,KACJ,OAAO,QAAE,CAAC,CAAC,OAAO,mCAAI,2EAA2E,CAAC,CAAC,OAAO,EAAE,KAC5G;aAAA,CAAC,CAAA;SACJ,CAAC,CAAC,CAAC;QACJ,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;KAC1D;IACD,WAAW;KACV;IACD,eAAe;KACd;;;;YAhCF,SAAS,SAAC;gBACT,QAAQ,EAAE,YAAY;gBACtB,4lDAAuC;gBAEvC,eAAe,EAAE,uBAAuB,CAAC,MAAM;;aAChD;;;;qBAKE,KAAK;;;MCaK,eAAe;;;YAtB3B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,eAAe;oBACf,aAAa;oBACb,gBAAgB;oBAChB,iBAAiB;oBACjB,cAAc;oBACd,aAAa;oBACb,gBAAgB;oBAChB,eAAe;oBACf,iBAAiB;iBAClB;gBACD,YAAY,EAAE;oBACZ,SAAS;iBACV;gBACD,OAAO,EAAE;oBACP,SAAS;iBACV;gBACD,SAAS,EAAE,EACV;aACF;;;ACjCD;;;;ACAA;;;;;;"}
|
|
@@ -1,6 +1,40 @@
|
|
|
1
|
+
import { Directive, TemplateRef, NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
1
3
|
import { FormControl } from '@angular/forms';
|
|
2
4
|
import { Subject } from 'rxjs';
|
|
3
5
|
|
|
6
|
+
class SdViewDefDirective {
|
|
7
|
+
// @Input() sdViewDef: string;
|
|
8
|
+
constructor(templateRef) {
|
|
9
|
+
this.templateRef = templateRef;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
SdViewDefDirective.decorators = [
|
|
13
|
+
{ type: Directive, args: [{
|
|
14
|
+
selector: '[sdViewDef]'
|
|
15
|
+
},] }
|
|
16
|
+
];
|
|
17
|
+
SdViewDefDirective.ctorParameters = () => [
|
|
18
|
+
{ type: TemplateRef }
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
class SdCommonModule {
|
|
22
|
+
}
|
|
23
|
+
SdCommonModule.decorators = [
|
|
24
|
+
{ type: NgModule, args: [{
|
|
25
|
+
imports: [
|
|
26
|
+
CommonModule
|
|
27
|
+
],
|
|
28
|
+
declarations: [
|
|
29
|
+
SdViewDefDirective
|
|
30
|
+
],
|
|
31
|
+
exports: [
|
|
32
|
+
SdViewDefDirective
|
|
33
|
+
],
|
|
34
|
+
providers: []
|
|
35
|
+
},] }
|
|
36
|
+
];
|
|
37
|
+
|
|
4
38
|
class SdFormControl extends FormControl {
|
|
5
39
|
constructor(formState, validator = null, asyncValidator = null) {
|
|
6
40
|
super(formState, validator, asyncValidator);
|
|
@@ -16,5 +50,5 @@ class SdFormControl extends FormControl {
|
|
|
16
50
|
* Generated bundle index. Do not edit.
|
|
17
51
|
*/
|
|
18
52
|
|
|
19
|
-
export { SdFormControl };
|
|
53
|
+
export { SdCommonModule, SdFormControl, SdViewDefDirective };
|
|
20
54
|
//# sourceMappingURL=sd-angular-core-common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-angular-core-common.js","sources":["../../../../projects/sd-core/common/src/lib/models/sd-form-control.ts","../../../../projects/sd-core/common/sd-angular-core-common.ts"],"sourcesContent":["import { FormControl, AsyncValidatorFn, ValidatorFn } from '@angular/forms';\r\nimport { Subject } from 'rxjs';\r\nexport class SdFormControl extends FormControl {\r\n touchedChanges: Subject<boolean> = new Subject<boolean>();\r\n\r\n constructor(\r\n formState?: Object,\r\n validator: ValidatorFn | ValidatorFn[] = null,\r\n asyncValidator: AsyncValidatorFn | AsyncValidatorFn[] = null\r\n ) {\r\n super(formState, validator, asyncValidator);\r\n }\r\n\r\n markAsTouched({ onlySelf }: { onlySelf?: boolean } = {}): void {\r\n super.markAsTouched({ onlySelf });\r\n this.touchedChanges.next(true);\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sd-angular-core-common.js","sources":["../../../../projects/sd-core/common/src/lib/directives/view-def.directive.ts","../../../../projects/sd-core/common/src/lib/common.module.ts","../../../../projects/sd-core/common/src/lib/models/sd-form-control.ts","../../../../projects/sd-core/common/sd-angular-core-common.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\r\n\r\n@Directive({\r\n selector: '[sdViewDef]'\r\n})\r\nexport class SdViewDefDirective {\r\n // @Input() sdViewDef: string;\r\n constructor(public templateRef: TemplateRef<any>) { }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdViewDefDirective } from './directives/view-def.directive';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule\r\n ],\r\n declarations: [\r\n SdViewDefDirective\r\n ],\r\n exports: [\r\n SdViewDefDirective\r\n ],\r\n providers: [\r\n ]\r\n})\r\nexport class SdCommonModule { }\r\n","import { FormControl, AsyncValidatorFn, ValidatorFn } from '@angular/forms';\r\nimport { Subject } from 'rxjs';\r\nexport class SdFormControl extends FormControl {\r\n touchedChanges: Subject<boolean> = new Subject<boolean>();\r\n\r\n constructor(\r\n formState?: Object,\r\n validator: ValidatorFn | ValidatorFn[] = null,\r\n asyncValidator: AsyncValidatorFn | AsyncValidatorFn[] = null\r\n ) {\r\n super(formState, validator, asyncValidator);\r\n }\r\n\r\n markAsTouched({ onlySelf }: { onlySelf?: boolean } = {}): void {\r\n super.markAsTouched({ onlySelf });\r\n this.touchedChanges.next(true);\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAKa,kBAAkB;;IAE7B,YAAmB,WAA6B;QAA7B,gBAAW,GAAX,WAAW,CAAkB;KAAK;;;YALtD,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;aACxB;;;YAJmB,WAAW;;;MCiBlB,cAAc;;;YAb1B,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;iBACb;gBACD,YAAY,EAAE;oBACZ,kBAAkB;iBACnB;gBACD,OAAO,EAAE;oBACP,kBAAkB;iBACnB;gBACD,SAAS,EAAE,EACV;aACF;;;MCdY,aAAc,SAAQ,WAAW;IAG5C,YACE,SAAkB,EAClB,YAAyC,IAAI,EAC7C,iBAAwD,IAAI;QAE5D,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QAP9C,mBAAc,GAAqB,IAAI,OAAO,EAAW,CAAC;KAQzD;IAED,aAAa,CAAC,EAAE,QAAQ,KAA6B,EAAE;QACrD,KAAK,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KAChC;;;AChBH;;;;;;"}
|
|
@@ -1671,10 +1671,20 @@ class SdGridMaterial {
|
|
|
1671
1671
|
};
|
|
1672
1672
|
this.onSelectAll = () => {
|
|
1673
1673
|
var _a, _b, _c;
|
|
1674
|
-
(_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach(e =>
|
|
1674
|
+
(_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach(e => {
|
|
1675
|
+
if (e.selectable) {
|
|
1676
|
+
e.isSelected = this.isSelectAll;
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1675
1679
|
(_c = (_b = this.gridOption.selection) === null || _b === void 0 ? void 0 : _b.onSelectAll) === null || _c === void 0 ? void 0 : _c.call(_b, this.items.filter(e => e.isSelected));
|
|
1676
1680
|
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
1677
1681
|
};
|
|
1682
|
+
this.onClearSelection = () => {
|
|
1683
|
+
var _a;
|
|
1684
|
+
this.isSelectAll = false;
|
|
1685
|
+
(_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach(e => e.isSelected = false);
|
|
1686
|
+
__classPrivateFieldGet(this, _updateSelectedItems).call(this);
|
|
1687
|
+
};
|
|
1678
1688
|
_updateSelectedItems.set(this, () => {
|
|
1679
1689
|
this.selectedItems = this.items.filter(item => item.isSelected)
|
|
1680
1690
|
.map(item => {
|
|
@@ -1911,7 +1921,7 @@ _paginator = new WeakMap(), _sort = new WeakMap(), _subscription$1 = new WeakMap
|
|
|
1911
1921
|
SdGridMaterial.decorators = [
|
|
1912
1922
|
{ type: Component, args: [{
|
|
1913
1923
|
selector: 'sd-grid-material',
|
|
1914
|
-
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"items\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\" [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible:gridOption?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\" [class.selected]=\"row.isSelected\"\r\n [style]=\"row | sdStyleRowCss:gridOption\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\"></sd-grid-quick-action>",
|
|
1924
|
+
template: "<ng-container *ngIf=\"gridConfigurationObserver | async as gridConfiguration\">\r\n <ng-container *ngIf=\"\r\n gridConfiguration\r\n | sdGridConfigurationResult\r\n : gridOption\r\n : sdSubInformation as configuration\r\n \">\r\n <ng-container *ngIf=\"!gridOption.filter?.disabled\">\r\n <sd-grid-filter [filter]=\"gridOption?.filter\" [columns]=\"configuration.firstColumns\" [filterDefs]=\"filterDefs\">\r\n </sd-grid-filter>\r\n </ng-container>\r\n <div class=\"c-container {{ gridOption?.style?.grid }}\" [ngClass]=\"{ 'mat-elevation-z2': gridOption?.shadow }\">\r\n <div class=\"c-loading\" *ngIf=\"isLoading\">\r\n <mat-spinner *ngIf=\"isLoading\"></mat-spinner>\r\n </div>\r\n <ng-container>\r\n <div class=\"c-table\" [ngStyle]=\"{\r\n 'max-height': gridOption?.maxHeight,\r\n 'min-height': gridOption?.minHeight\r\n }\">\r\n <table *ngIf=\"items?.length; else elseEmpty\" mat-table [dataSource]=\"items\" matSort\r\n [matSortDisabled]=\"!gridOption.sortable\" cdkDropList cdkDropListOrientation=\"horizontal\"\r\n [cdkDropListDisabled]=\"!gridOption.dropDragColumnEnable\"\r\n (cdkDropListDropped)=\"drop($event, configuration.displayedColumns)\" multiTemplateDataRows>\r\n <ng-container matColumnDef=\"sdSubInformation\" sticky>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\" [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <div *ngIf=\"sdSubInformation?.templateRef\" [@detailExpand]=\"item.isExpanded ? 'expanded' : 'collapsed'\">\r\n <ng-container *ngIf=\"item.isExpanded\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdSubInformation.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\" stickyEnd>\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td mat-cell *matCellDef=\"let element\">\r\n <button *ngIf=\"!element.isExpanding\" mat-icon-button aria-label=\"Expand & Collapse\"\r\n (click)=\"onExpand(element)\">\r\n <mat-icon *ngIf=\"!element.isExpanded\">expand_more</mat-icon>\r\n <mat-icon *ngIf=\"element.isExpanded\">expand_less</mat-icon>\r\n </button>\r\n <div *ngIf=\"element.isExpanding\" class=\"lds-ring\">\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </div>\r\n </td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"text-center px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <ng-container *ngIf=\"items | selectionVisibleSelectAll: gridOption?.selection | async\">\r\n <mat-checkbox *ngIf=\"!gridOption.selection?.single\" class=\"c-selection\" color=\"primary\"\r\n [(ngModel)]=\"isSelectAll\" (change)=\"onSelectAll()\">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </th>\r\n <td class=\"text-center px-15\" mat-cell *matCellDef=\"let item\" style=\"min-width: 50px; max-width: 50px\">\r\n <ng-container *ngIf=\"item | selectionVisible:gridOption?.selection\">\r\n <mat-checkbox class=\"c-selection\" color=\"primary\" [(ngModel)]=\"item.isSelected\"\r\n (change)=\"onSelect(item)\" [disabled]=\"\r\n selectedItems | selectionDisable: item:gridOption?.selection\r\n \">\r\n </mat-checkbox>\r\n </ng-container>\r\n\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 2px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0 position-relative\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-editor-validation [sdId]=\"item.sdId\" [item]=\"item\" [gridOption]=\"gridOption\">\r\n </sd-desktop-editor-validation>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <ng-container *sdLet=\"item.editorStatus | sdEditorHandlerRow:item:gridOption as editorHandler\">\r\n <div *ngIf=\"editorHandler\" class=\"d-flex align-items-center justify-content-center\">\r\n <button *ngIf=\"editorHandler.editable\" class=\"mx-2\" (click)=\"onUpdate(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">edit</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.removable\" class=\"mx-2\" (click)=\"onRemove(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">delete</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.savable\" class=\"mx-2\" (click)=\"onSave(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">save</mat-icon>\r\n </button>\r\n <button *ngIf=\"editorHandler.cancelable\" class=\"mx-2\" (click)=\"onCancel(item)\" aria-hidden=\"true\"\r\n mat-icon-button>\r\n <mat-icon class=\"c-icon\">close</mat-icon>\r\n </button>\r\n </div>\r\n </ng-container>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8 py-8\" mat-header-cell *matHeaderCellDef style=\"width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n <td class=\"px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-command [commands]=\"gridOption.commands\" [item]=\"item\"></sd-desktop-command>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef cdkDrag class=\"px-8 py-8 c-th\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader && column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div aria-hidden=\"false\" role=\"presentation\" mat-sort-header [disabled]=\"\r\n !column.sortable || column.type === 'children-col'\r\n \" [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns; let i = index\"\r\n [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef mat-sort-header class=\"c-th px-8\"\r\n [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\" [value]=\"columnFilter[column.field]\"\r\n [columnFilter]=\"columnFilter\" [column]=\"column\" (filterChange)=\"onFilterChange()\">\r\n </sd-column-inline-filter>\r\n </div>\r\n </th>\r\n <td class=\"c-td px-8\" mat-cell *matCellDef=\"let item\">\r\n <sd-desktop-cell [sdId]=\"item.sdId\" [key]=\"key\" [value]=\"item[column.field]\" [column]=\"column\"\r\n [item]=\"item\" [idx]=\"i\" [cellDef]=\"cellDef\" [gridOption]=\"gridOption\">\r\n </sd-desktop-cell>\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef>\r\n <ng-container *ngIf=\"footerDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n footerDef[column.field].templateRef;\r\n context: { items: items, column: column }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\"></tr>\r\n <ng-container *ngIf=\"configuration.secondHeaders?.length\">\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n </ng-container>\r\n <tr mat-row *matRowDef=\"let row; columns: configuration.displayedColumns\" matRipple class=\"c-row\" [class.selected]=\"row.isSelected\"\r\n [style]=\"row | sdStyleRowCss:gridOption\"></tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdSubInformation']\" class=\"c-detail-row\"></tr>\r\n <ng-container *ngIf=\"hasFooter && configuration.displayedFooters?.length\">\r\n <tr mat-footer-row *matFooterRowDef=\"configuration.displayedFooters; sticky: true\"></tr>\r\n </ng-container>\r\n </table>\r\n <ng-template #elseEmpty>\r\n <table mat-table [dataSource]=\"[{}]\">\r\n <ng-container matColumnDef=\"sdSelection\" sticky>\r\n <th class=\"px-15\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditorValidation\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 4px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n </th>\r\n <td class=\"p-0\" mat-cell *matCellDef=\"let item\">\r\n </td>\r\n <td mat-footer-cell *matFooterCellDef></td>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEditor\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\">\r\n <button\r\n *ngIf=\"gridOption.editor?.addable && (!gridOption.editor.limit || gridOption.editor.limit > items.length)\"\r\n (click)=\"onCreate()\" aria-hidden=\"true\" mat-icon-button>\r\n <mat-icon class=\"c-icon\">add</mat-icon>\r\n </button>\r\n </th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdCommand\">\r\n <th class=\"px-8\" mat-header-cell *matHeaderCellDef style=\"min-width: 50px; max-width: 50px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdSubInformationAction\">\r\n <th class=\"p-0\" mat-header-cell *matHeaderCellDef style=\"width: 1px\"\r\n [attr.rowspan]=\"configuration.multipleHeader ? 2 : 1\"></th>\r\n </ng-container>\r\n <ng-container matColumnDef=\"sdEmpty\">\r\n <td class=\"c-empty\" mat-cell *matCellDef=\"let item\"\r\n [attr.colspan]=\"configuration.displayedColumns.length\">\r\n <ng-container *ngIf=\"sdEmptyData?.templateRef; else sdEmptyDataNoRef\">\r\n <ng-container *ngTemplateOutlet=\"\r\n sdEmptyData.templateRef;\r\n context: { item: item }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #sdEmptyDataNoRef>\r\n <mat-icon fontSet=\"material-icons-outlined\">leaderboard</mat-icon>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.columns\" [matColumnDef]=\"column.field\"\r\n [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.firstColumns; let i = index\"\r\n [matColumnDef]=\"column.field\" [sticky]=\"configuration.fixedColumn[column.field]\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\"\r\n [ngStyle]=\"{ 'min-width': configuration.firstColumns[i].width }\" [attr.rowspan]=\"\r\n configuration.multipleHeader &&\r\n column.type !== 'children-col'\r\n ? 2\r\n : 1\r\n \" [attr.colspan]=\"\r\n column.type === 'children-col' ? column.children?.length : 1\r\n \">\r\n <div>\r\n <div [innerHTML]=\"configuration.firstColumns[i].titleHtml || configuration.firstColumns[i].title\">\r\n </div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngFor=\"let column of configuration.secondColumns\" [matColumnDef]=\"column.field\">\r\n <th mat-header-cell *matHeaderCellDef class=\"c-th px-8 py-8\" [ngStyle]=\"{ 'min-width': column.width }\">\r\n <div>\r\n <div [innerHTML]=\"column.titleHtml || column.title\"></div>\r\n <sd-column-inline-filter *ngIf=\"gridOption.filter?.inlineColumn\"\r\n [value]=\"columnFilter[column.field]\" [columnFilter]=\"columnFilter\" [column]=\"column\"\r\n (filterChange)=\"onFilterChange()\"></sd-column-inline-filter>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <tr class=\"c-first-header\" mat-header-row *matHeaderRowDef=\"configuration.firstHeaders; sticky: true\">\r\n </tr>\r\n <tr class=\"c-second-header\" mat-header-row *matHeaderRowDef=\"configuration.secondHeaders; sticky: true\">\r\n </tr>\r\n <tr mat-row *matRowDef=\"let row; columns: ['sdEmpty']\"></tr>\r\n </table>\r\n </ng-template>\r\n </div>\r\n </ng-container>\r\n <div class=\"c-paginator\">\r\n <div class=\"c-action\">\r\n <sd-button *ngIf=\"\r\n !gridOption.filter?.disabled && !gridOption.filter?.inlineColumn\r\n \" class=\"mr-10\" [title]=\"'Filter' | sdTranslate\" icon=\"filter_alt\" size=\"sm\" (action)=\"gridFilter.open()\"\r\n type=\"link\">\r\n </sd-button>\r\n <sd-button *ngIf=\"gridOption.reload?.visible\" class=\"mr-10\" [title]=\"'Reload' | sdTranslate\" icon=\"refresh\"\r\n size=\"sm\" (action)=\"reload()\" [disabled]=\"!items?.length\" type=\"link\">\r\n </sd-button>\r\n <ng-container *ngIf=\"gridOption.export?.visible && items?.length\">\r\n <ng-container *ngIf=\"isExporting; else unExporting\">\r\n <sd-button class=\"mr-10\" [loading]=\"isExporting\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\"\r\n size=\"sm\" type=\"link\">\r\n </sd-button>\r\n </ng-container>\r\n <ng-template #unExporting>\r\n <sd-button class=\"mr-10\" [title]=\"exportTitle | sdTranslate\" icon=\"get_app\" size=\"sm\"\r\n [matMenuTriggerFor]=\"menu\" type=\"link\">\r\n </sd-button>\r\n </ng-template>\r\n\r\n <mat-menu #menu=\"matMenu\">\r\n <button *ngIf=\"gridOption.export?.visibleExcel !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export excel\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.visibleCSV !== false\" mat-menu-item\r\n (click)=\"sdPopupExport.exportDefault(true)\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">file_download</mat-icon>\r\n <span> {{ \"Export CSV\" | sdTranslate }}</span>\r\n </button>\r\n <button *ngIf=\"gridOption.export?.key\" mat-menu-item (click)=\"sdPopupExport.open()\" type=\"button\">\r\n <mat-icon fontSet=\"material-icons-outlined\">settings</mat-icon>\r\n <span> {{ \"Configure\" | sdTranslate }}</span>\r\n </button>\r\n </mat-menu>\r\n </ng-container>\r\n <sd-button *ngIf=\"gridOption.config?.visible\" class=\"mr-10\" [title]=\"'Configure' | sdTranslate\"\r\n icon=\"settings\" size=\"sm\" (action)=\"popupGridConfiguration.open()\" type=\"link\">\r\n </sd-button>\r\n </div>\r\n <mat-paginator [class.d-none]=\"gridOption.paginate?.hidden\" [length]=\"total\"\r\n [pageSize]=\"gridOption.paginate?.pageSize\" [pageSizeOptions]=\"gridOption.paginate?.pages\"\r\n [showFirstLastButtons]=\"gridOption.paginate?.showFirstLastButtons\"></mat-paginator>\r\n </div>\r\n </div>\r\n <sd-popup-export *ngIf=\"gridOption.export?.visible\" [gridOption]=\"gridOption\" (export)=\"onExport($event)\"\r\n #sdPopupExport>\r\n </sd-popup-export>\r\n <sd-popup-grid-configuration [gridOption]=\"gridOption\" [key]=\"key\" #popupGridConfiguration>\r\n </sd-popup-grid-configuration>\r\n </ng-container>\r\n</ng-container>\r\n<sd-grid-quick-action [gridOption]=\"gridOption\" [selectedItems]=\"selectedItems\" (clear)=\"onClearSelection()\"></sd-grid-quick-action>",
|
|
1915
1925
|
animations: [
|
|
1916
1926
|
trigger('detailExpand', [
|
|
1917
1927
|
state('collapsed', style({ height: '0', minHeight: '0', visibility: 'hidden' })),
|
|
@@ -2548,9 +2558,11 @@ class SdSelectionDisablePipe {
|
|
|
2548
2558
|
const { disabled, actions } = selection;
|
|
2549
2559
|
if (!(actions === null || actions === void 0 ? void 0 : actions.length)) {
|
|
2550
2560
|
if (!disabled) {
|
|
2561
|
+
rowData.selectable = true;
|
|
2551
2562
|
return false;
|
|
2552
2563
|
}
|
|
2553
|
-
|
|
2564
|
+
rowData.selectable = !disabled(rowData, selectedItems);
|
|
2565
|
+
return !rowData.selectable;
|
|
2554
2566
|
}
|
|
2555
2567
|
// Lọc các action theo selectedItems hiện tại
|
|
2556
2568
|
const availableActions = actions.filter(action => {
|
|
@@ -3006,7 +3018,8 @@ class SdSelectionVisiblePipe {
|
|
|
3006
3018
|
const { actions } = selection;
|
|
3007
3019
|
rowData.actions = rowData.actions || [];
|
|
3008
3020
|
if (!(actions === null || actions === void 0 ? void 0 : actions.length)) {
|
|
3009
|
-
|
|
3021
|
+
rowData.selectable = true;
|
|
3022
|
+
return rowData.selectable;
|
|
3010
3023
|
}
|
|
3011
3024
|
for (const action of actions) {
|
|
3012
3025
|
if ('children' in action) {
|
|
@@ -3042,7 +3055,8 @@ class SdSelectionVisiblePipe {
|
|
|
3042
3055
|
}
|
|
3043
3056
|
}
|
|
3044
3057
|
}
|
|
3045
|
-
|
|
3058
|
+
rowData.selectable = !!rowData.actions.length;
|
|
3059
|
+
return rowData.selectable;
|
|
3046
3060
|
};
|
|
3047
3061
|
}
|
|
3048
3062
|
}
|
|
@@ -3069,14 +3083,16 @@ SdIdPipe.decorators = [
|
|
|
3069
3083
|
|
|
3070
3084
|
class SdGridQuickAction {
|
|
3071
3085
|
constructor() {
|
|
3086
|
+
this.clear = new EventEmitter();
|
|
3072
3087
|
this.onClear = () => {
|
|
3088
|
+
this.clear.emit();
|
|
3073
3089
|
};
|
|
3074
3090
|
}
|
|
3075
3091
|
}
|
|
3076
3092
|
SdGridQuickAction.decorators = [
|
|
3077
3093
|
{ type: Component, args: [{
|
|
3078
3094
|
selector: 'sd-grid-quick-action',
|
|
3079
|
-
template: "<sd-quick-action *ngIf=\"selectedItems | selectionActionFilter: gridOption?.selection?.actions as actions\"\r\n [isOpened]=\"actions?.length\">\r\n <div class=\"d-flex align-items-center\" sdMessage>\r\n <div class=\"c-bg-length\">\r\n <span class=\"c-length\">{{ selectedItems.length }}</span>\r\n </div>\r\n <div class=\"c-message\">{{ gridOption?.selection?.message || (\"selected items\" | sdTranslate) }}</div>\r\n </div>\r\n <div class=\"d-flex align-items-center mr-8\" sdAction>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <sd-button *ngIf=\"action.click\" class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" (action)=\"action.click(selectedItems)\"></sd-button>\r\n <ng-container *ngIf=\"action.children?.length\">\r\n <sd-button class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon || 'more_vert'\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" [matMenuTriggerFor]=\"menu\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button *ngFor=\"let childAction of action.children\" mat-menu-item (click)=\"childAction.click(selectedItems)\"\r\n [disabled]=\"childAction.disabled\">\r\n <mat-icon [fontSet]=\"childAction.fontSet\" class=\"c-icon\">{{ childAction.icon }}\r\n </mat-icon>\r\n <span> {{ childAction.title }}</span>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-container>\r\n </ng-container>\r\n <sd-button class=\"ml-5\" icon=\"close\" color=\"secondary\" type=\"outline\" size=\"sm\"\r\n (action)=\"onClear()\"></sd-button>\r\n </div>\r\n</sd-quick-action>",
|
|
3095
|
+
template: "<sd-quick-action *ngIf=\"selectedItems | selectionActionFilter: gridOption?.selection?.actions as actions\"\r\n [isOpened]=\"actions?.length\">\r\n <div class=\"d-flex align-items-center\" sdMessage>\r\n <div class=\"c-bg-length\">\r\n <span class=\"c-length\">{{ selectedItems.length }}</span>\r\n </div>\r\n <div class=\"c-message\">{{ gridOption?.selection?.message || (\"selected items\" | sdTranslate) }}</div>\r\n </div>\r\n <div class=\"d-flex align-items-center mr-8\" sdAction>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <sd-button *ngIf=\"action.click\" class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" (action)=\"action.click(selectedItems)\"></sd-button>\r\n <ng-container *ngIf=\"action.children?.length\">\r\n <sd-button class=\"ml-5\" [tooltip]=\"action.tooltip\" [icon]=\"action.icon || 'more_vert'\"\r\n [color]=\"action.color || 'secondary'\" [type]=\"action.type || 'light'\" [fontSet]=\"action.fontSet\"\r\n [title]=\"action.title\" size=\"sm\" [matMenuTriggerFor]=\"menu\">\r\n </sd-button>\r\n <mat-menu #menu=\"matMenu\">\r\n <span>\r\n <button *ngFor=\"let childAction of action.children\" mat-menu-item (click)=\"childAction.click(selectedItems)\"\r\n [disabled]=\"childAction.disabled\">\r\n <mat-icon [fontSet]=\"childAction.fontSet\" class=\"c-icon\">{{ childAction.icon }}\r\n </mat-icon>\r\n <span> {{ childAction.title }}</span>\r\n </button>\r\n </span>\r\n </mat-menu>\r\n </ng-container>\r\n </ng-container>\r\n <sd-button class=\"ml-5\" icon=\"close\" color=\"secondary\" type=\"outline\" size=\"sm\"\r\n (action)=\"onClear()\" width=\"35px\"></sd-button>\r\n </div>\r\n</sd-quick-action>",
|
|
3080
3096
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3081
3097
|
styles: [".c-bg-length{align-items:flex-start;background:#2962ff;border-radius:4px 0 0 4px;display:flex;flex-direction:column;height:48px;left:0;padding:12px 8px;position:static;top:0;width:48px}.c-bg-length .c-length{color:#fff;font-size:16px;font-weight:500;height:24px;left:8px;line-height:24px;text-align:center;top:12px;width:32px}.c-bg-length .c-length,.c-message{font-family:Roboto;font-style:normal;position:static}.c-message{color:#000;font-size:14px;font-weight:400;height:20px;left:0;line-height:20px;margin:0 0 0 16px;min-width:200px;top:6px}"]
|
|
3082
3098
|
},] }
|
|
@@ -3084,7 +3100,8 @@ SdGridQuickAction.decorators = [
|
|
|
3084
3100
|
SdGridQuickAction.ctorParameters = () => [];
|
|
3085
3101
|
SdGridQuickAction.propDecorators = {
|
|
3086
3102
|
gridOption: [{ type: Input }],
|
|
3087
|
-
selectedItems: [{ type: Input }]
|
|
3103
|
+
selectedItems: [{ type: Input }],
|
|
3104
|
+
clear: [{ type: Output }]
|
|
3088
3105
|
};
|
|
3089
3106
|
|
|
3090
3107
|
class MatPaginatorIntlCro extends MatPaginatorIntl {
|