raise-common-lib 0.0.1
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/README.md +24 -0
- package/karma.conf.js +32 -0
- package/ng-package.json +7 -0
- package/package.json +8 -0
- package/src/assets/img/RAISE-3334.png +0 -0
- package/src/assets/img/RAISE.png +0 -0
- package/src/assets/img/notification-close.svg +4 -0
- package/src/assets/img/notification-collapse.svg +14 -0
- package/src/assets/img/notification-status-error.svg +5 -0
- package/src/assets/img/notification-status-loading.svg +9 -0
- package/src/assets/img/notification-status-success.svg +4 -0
- package/src/assets/img/notification-status-warning.svg +5 -0
- package/src/assets/style/syncfusion.min.css +1 -0
- package/src/lib/common-grid/grid-utils.ts +26 -0
- package/src/lib/common-grid/index.component.html +80 -0
- package/src/lib/common-grid/index.component.scss +230 -0
- package/src/lib/common-grid/index.component.ts +420 -0
- package/src/lib/constant/index.ts +59 -0
- package/src/lib/raise-common-lib.module.ts +48 -0
- package/src/public-api.ts +5 -0
- package/tsconfig.lib.json +26 -0
- package/tsconfig.spec.json +17 -0
- package/tslint.json +17 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { times } from "lodash";
|
|
2
|
+
import { IColumnField } from "../constant";
|
|
3
|
+
|
|
4
|
+
export const initCommonFields = (fields: IColumnField[], translation: any) => {
|
|
5
|
+
const result = [];
|
|
6
|
+
fields.forEach((col: IColumnField) => {
|
|
7
|
+
result.push({
|
|
8
|
+
...col,
|
|
9
|
+
columnDisplayName:
|
|
10
|
+
translation[col.translationCode] ||
|
|
11
|
+
`${col.translationCode ? "." + col.translationCode : ""}`,
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
return [...result];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// 初始化数据集,避免列表为空时没有数据
|
|
18
|
+
export const initList = (num = 25, key = "Id") => {
|
|
19
|
+
const list = [];
|
|
20
|
+
times(num, (i) => {
|
|
21
|
+
list.push({
|
|
22
|
+
[key]: i,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return list;
|
|
26
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<ejs-grid
|
|
2
|
+
#grid
|
|
3
|
+
[id]="gridId"
|
|
4
|
+
[ngClass]="{
|
|
5
|
+
'hide-Check-box': !alwaysShowCheckbox,
|
|
6
|
+
'grid-loading': className === 'grid-loading'
|
|
7
|
+
}"
|
|
8
|
+
[dataSource]="dataSource"
|
|
9
|
+
[allowPaging]="allowPaging && pageSettings"
|
|
10
|
+
[allowResizing]="true"
|
|
11
|
+
[pageSettings]="pageSettings"
|
|
12
|
+
[showColumnMenu]="true"
|
|
13
|
+
[allowSorting]="true"
|
|
14
|
+
[allowFiltering]="true"
|
|
15
|
+
[allowExcelExport]="true"
|
|
16
|
+
[filterSettings]="filterSettings"
|
|
17
|
+
[resizeSettings]="resizeSettings"
|
|
18
|
+
[allowSelection]="true"
|
|
19
|
+
[editSettings]="editSettings"
|
|
20
|
+
[childGrid]="childGrid"
|
|
21
|
+
[contextMenuItems]="
|
|
22
|
+
dataSource && dataSource.length ? contextMenuItems : null
|
|
23
|
+
"
|
|
24
|
+
[selectionSettings]="selectionSettings"
|
|
25
|
+
(recordClick)="_recordClick($event)"
|
|
26
|
+
(recordDoubleClick)="_recordDoubleClick($event)"
|
|
27
|
+
(actionBegin)="_actionBegin($event)"
|
|
28
|
+
(actionComplete)="_actionHandler($event)"
|
|
29
|
+
(rowSelected)="_rowSelected($event)"
|
|
30
|
+
(rowDeselected)="_rowDeselected($event)"
|
|
31
|
+
style="border: none"
|
|
32
|
+
(contextMenuClick)="_onContextMenu($event)"
|
|
33
|
+
(contextMenuOpen)="contextMenuOpen($event)"
|
|
34
|
+
(queryCellInfo)="customiseCell($event)"
|
|
35
|
+
(dataBound)="_dataBound($event)"
|
|
36
|
+
(rowDataBound)="_rowDataBound($event)"
|
|
37
|
+
(rowSelecting)="_rowSelecting($event)"
|
|
38
|
+
(excelQueryCellInfo)="_exportQueryCellInfo($event)"
|
|
39
|
+
(load)="_load()"
|
|
40
|
+
>
|
|
41
|
+
<e-columns>
|
|
42
|
+
<e-column
|
|
43
|
+
*ngIf="showCheckBox"
|
|
44
|
+
type="checkbox"
|
|
45
|
+
[width]="checkBoxWidth"
|
|
46
|
+
[showColumnMenu]="false"
|
|
47
|
+
></e-column>
|
|
48
|
+
<e-column
|
|
49
|
+
*ngFor="let item of fields; trackBy: trackByFn"
|
|
50
|
+
[field]="item.columnName"
|
|
51
|
+
[filter]="item.filter ? item.filter : { type: 'CheckBox' }"
|
|
52
|
+
[customAttributes]="
|
|
53
|
+
item.colName === 'entityUserList' ||
|
|
54
|
+
item.colName === 'kycProgress'
|
|
55
|
+
? { class: 'hideColumnFilterClass' }
|
|
56
|
+
: {}
|
|
57
|
+
"
|
|
58
|
+
[headerText]="item.columnDisplayName"
|
|
59
|
+
[textAlign]="item.textAlign"
|
|
60
|
+
[showColumnMenu]="item.showColumnMenu === undefined ? true : false"
|
|
61
|
+
[allowFiltering]="item.allowFiltering === undefined ? true : false"
|
|
62
|
+
[allowSorting]="item.allowSorting === undefined ? true : false"
|
|
63
|
+
[editType]="item.editType"
|
|
64
|
+
[validationRules]="item.validationRules"
|
|
65
|
+
[type]="item.dataType"
|
|
66
|
+
[width]="item.width"
|
|
67
|
+
[minWidth]="item.minWidth"
|
|
68
|
+
[format]="item.format"
|
|
69
|
+
[visible]="item.visible"
|
|
70
|
+
[template]="item.showTemplate ? columnTemplate : undefined"
|
|
71
|
+
[clipMode]="
|
|
72
|
+
item.clipMode
|
|
73
|
+
? item.clipMode
|
|
74
|
+
: clipMode || 'EllipsisWithTooltip'
|
|
75
|
+
"
|
|
76
|
+
[sortComparer]="item.dateComparer"
|
|
77
|
+
>
|
|
78
|
+
</e-column>
|
|
79
|
+
</e-columns>
|
|
80
|
+
</ejs-grid>
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
.e-grid.e-gridhover
|
|
2
|
+
tr[role="row"]:hover
|
|
3
|
+
.e-rowcell:not(.e-cellselectionbackground):not(.e-active):not(
|
|
4
|
+
.e-updatedtd
|
|
5
|
+
):not(.e-indentcell) {
|
|
6
|
+
background: rgba(31, 123, 255, 0.04) !important;
|
|
7
|
+
}
|
|
8
|
+
.e-summaryrow {
|
|
9
|
+
.e-summarycell {
|
|
10
|
+
&:nth-child(2) {
|
|
11
|
+
padding-left: 0 !important;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
.e-footerpadding {
|
|
16
|
+
padding-right: 0 !important;
|
|
17
|
+
.e-summaryrow {
|
|
18
|
+
margin-right: 5px !important;
|
|
19
|
+
.e-indentcell {
|
|
20
|
+
background-color: unset !important;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
kt-common-grid {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex: 1;
|
|
27
|
+
height: 100%;
|
|
28
|
+
.e-grid {
|
|
29
|
+
height: 100%;
|
|
30
|
+
.e-headercontent {
|
|
31
|
+
margin-right: 0px !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
.e-grid td.e-active {
|
|
36
|
+
// SMP2-17564 不能带透明度,否则滚动时重叠左侧表头区域会颜色叠加
|
|
37
|
+
// background: rgba(31, 123, 255, 0.08) !important;
|
|
38
|
+
background: #edf5ff !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.grid-tools {
|
|
42
|
+
height: 32px;
|
|
43
|
+
min-height: 32px;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: space-between;
|
|
47
|
+
padding-left: 7px;
|
|
48
|
+
.right-opt-group {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
margin-right: 6px;
|
|
52
|
+
}
|
|
53
|
+
.tools-button {
|
|
54
|
+
border: none;
|
|
55
|
+
font-family: Arial;
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #43566c;
|
|
58
|
+
background: none;
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
padding: 0;
|
|
62
|
+
margin-right: 16px;
|
|
63
|
+
&.disabled-button {
|
|
64
|
+
pointer-events: none;
|
|
65
|
+
opacity: 0.5;
|
|
66
|
+
}
|
|
67
|
+
img {
|
|
68
|
+
margin-right: 4px;
|
|
69
|
+
height: 16px !important;
|
|
70
|
+
width: 16px !important;
|
|
71
|
+
}
|
|
72
|
+
.tools-font {
|
|
73
|
+
transform: translateY(1px);
|
|
74
|
+
display: inline-block;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.select-num {
|
|
78
|
+
font-size: 12px;
|
|
79
|
+
color: #43566c;
|
|
80
|
+
margin-right: 24px;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.e-rowcell {
|
|
86
|
+
padding: 0 8px 0 12px;
|
|
87
|
+
&.e-gridchkbox {
|
|
88
|
+
padding: 0 0 0 8px !important;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
.e-headercell {
|
|
92
|
+
padding: 0;
|
|
93
|
+
&:first-child {
|
|
94
|
+
&.e-defaultcursor {
|
|
95
|
+
& + .e-headercell {
|
|
96
|
+
.e-headercelldiv {
|
|
97
|
+
padding-left: 0;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.e-headercelldiv {
|
|
104
|
+
margin: 0;
|
|
105
|
+
padding: 0 20px 0 12px;
|
|
106
|
+
}
|
|
107
|
+
.e-headerchkcelldiv {
|
|
108
|
+
padding: 0 0 0 8px !important;
|
|
109
|
+
}
|
|
110
|
+
.e-columnmenu {
|
|
111
|
+
position: absolute;
|
|
112
|
+
right: 0;
|
|
113
|
+
float: unset;
|
|
114
|
+
margin: 0;
|
|
115
|
+
padding: 0;
|
|
116
|
+
top: 8px;
|
|
117
|
+
}
|
|
118
|
+
.e-sortfilterdiv {
|
|
119
|
+
padding-top: 11px;
|
|
120
|
+
}
|
|
121
|
+
&.e-rightalign {
|
|
122
|
+
.e-sortfilterdiv {
|
|
123
|
+
padding-left: 5px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
.e-detailheadercell {
|
|
128
|
+
height: 28px !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.e-grid {
|
|
132
|
+
font-family: Arial !important;
|
|
133
|
+
display: flex;
|
|
134
|
+
flex-direction: column;
|
|
135
|
+
flex: 1;
|
|
136
|
+
border: none;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
.e-gridcontent {
|
|
139
|
+
flex: 1;
|
|
140
|
+
}
|
|
141
|
+
.e-content {
|
|
142
|
+
overflow: scroll !important;
|
|
143
|
+
&::-webkit-scrollbar {
|
|
144
|
+
// 滚动条样式
|
|
145
|
+
width: 5px;
|
|
146
|
+
height: 5px;
|
|
147
|
+
background: #ffffff;
|
|
148
|
+
position: static;
|
|
149
|
+
z-index: 999;
|
|
150
|
+
border-radius: 10px;
|
|
151
|
+
}
|
|
152
|
+
&::-webkit-scrollbar-thumb {
|
|
153
|
+
// 滚动条滑块颜色
|
|
154
|
+
background: #eaedf0;
|
|
155
|
+
border-radius: 10px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.e-gridheader {
|
|
159
|
+
margin-right: 5px !important;
|
|
160
|
+
padding-right: 0 !important;
|
|
161
|
+
}
|
|
162
|
+
.e-gridcontent,
|
|
163
|
+
.e-content {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
flex: 1;
|
|
167
|
+
}
|
|
168
|
+
.e-gridheader {
|
|
169
|
+
height: 30px !important;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.e-columnheader,
|
|
173
|
+
.e-headercell,
|
|
174
|
+
.e-rhandler {
|
|
175
|
+
height: 28px !important;
|
|
176
|
+
}
|
|
177
|
+
.e-headertext {
|
|
178
|
+
font-size: 10px !important;
|
|
179
|
+
}
|
|
180
|
+
.e-headercell .e-columnmenu {
|
|
181
|
+
color: #929dab;
|
|
182
|
+
}
|
|
183
|
+
.e-row {
|
|
184
|
+
height: 26px !important;
|
|
185
|
+
line-height: 26px !important;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.e-rowcell {
|
|
189
|
+
font-size: 11px !important;
|
|
190
|
+
color: #43566c !important;
|
|
191
|
+
padding-top: 0;
|
|
192
|
+
padding-bottom: 0;
|
|
193
|
+
padding-right: 7px;
|
|
194
|
+
.mat-icon-button {
|
|
195
|
+
height: 26px;
|
|
196
|
+
width: 26px;
|
|
197
|
+
line-height: 26px;
|
|
198
|
+
}
|
|
199
|
+
&:empty {
|
|
200
|
+
height: 26px !important;
|
|
201
|
+
}
|
|
202
|
+
&.e-gridchkbox {
|
|
203
|
+
& + .e-rowcell {
|
|
204
|
+
padding-left: 0 !important;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
.e-gridpager {
|
|
209
|
+
border: none;
|
|
210
|
+
.e-gridcontent {
|
|
211
|
+
transform: unset;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
.e-summaryrow {
|
|
215
|
+
height: 24px !important;
|
|
216
|
+
.e-indentcell,
|
|
217
|
+
.e-summarycell {
|
|
218
|
+
background-color: #fff;
|
|
219
|
+
border: none;
|
|
220
|
+
font-family: Arial;
|
|
221
|
+
font-size: 11px !important;
|
|
222
|
+
font-weight: bold;
|
|
223
|
+
color: #43566c;
|
|
224
|
+
padding: 0 12px;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
.e-row:last-child .e-rowcell {
|
|
228
|
+
border-bottom: 1px solid #dee2e6;
|
|
229
|
+
}
|
|
230
|
+
}
|