raise-common-lib 0.0.72 → 0.0.74
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 +55 -29
- 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/common-grid/index.component.js +56 -32
- package/esm5/lib/common-grid/index.component.js +59 -32
- package/fesm2015/raise-common-lib.js +53 -30
- package/fesm2015/raise-common-lib.js.map +1 -1
- package/fesm5/raise-common-lib.js +56 -30
- package/fesm5/raise-common-lib.js.map +1 -1
- package/lib/common-grid/index.component.d.ts +6 -4
- package/package.json +1 -1
- package/raise-common-lib.metadata.json +1 -1
- package/src/assets/style/reset/grid.scss +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __assign, __read, __spread } from 'tslib';
|
|
2
2
|
import { EventEmitter, Component, ChangeDetectorRef, ViewChild, Input, Output, HostBinding, ContentChild, Injectable, ɵɵdefineInjectable, ɵɵinject, HostListener, ComponentFactoryResolver, ViewContainerRef, ViewChildren, Inject, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
3
3
|
import { GridModule, PagerModule, GridAllModule, PageService, SortService, FilterService, ExcelExportService, EditService, ResizeService, ToolbarService, ColumnChooserService, AggregateService, ColumnMenuService, DetailRowService, SelectionService, GroupService } from '@syncfusion/ej2-angular-grids';
|
|
4
|
-
import { debounce } from 'lodash';
|
|
4
|
+
import { times, debounce } from 'lodash';
|
|
5
5
|
import { NavigationEnd, Router, ActivatedRoute, RouteReuseStrategy } from '@angular/router';
|
|
6
6
|
import { filter } from 'rxjs/operators';
|
|
7
7
|
import { Subject, BehaviorSubject } from 'rxjs';
|
|
@@ -44,18 +44,17 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
44
44
|
this.authorized = true; // Dataset是否授权,未授权则显示权限错误提示
|
|
45
45
|
// Dataset是否授权,未授权则显示权限错误提示
|
|
46
46
|
// only use for local data pagination
|
|
47
|
-
this.selectedDiffKey =
|
|
48
|
-
this.gridHeight =
|
|
47
|
+
this.selectedDiffKey = "";
|
|
48
|
+
this.gridHeight = "";
|
|
49
49
|
// 这玩意必填,不然filter columnChooser都会报错
|
|
50
|
-
this.gridId =
|
|
51
|
-
this.resizeSettings = { mode:
|
|
52
|
-
this.filterSettings = { type:
|
|
50
|
+
this.gridId = "grid";
|
|
51
|
+
this.resizeSettings = { mode: "Auto" };
|
|
52
|
+
this.filterSettings = { type: "Menu" };
|
|
53
53
|
this.fields = [];
|
|
54
54
|
this.dataSource = [];
|
|
55
55
|
this.allowPaging = true;
|
|
56
|
-
this.clipMode =
|
|
56
|
+
this.clipMode = "EllipsisWithTooltip";
|
|
57
57
|
this.checkBoxWidth = 32; // col 数量过少的时候,check宽度会拉伸,这时候设置null
|
|
58
|
-
// col 数量过少的时候,check宽度会拉伸,这时候设置null
|
|
59
58
|
/**
|
|
60
59
|
* Sample: [
|
|
61
60
|
* {
|
|
@@ -76,7 +75,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
76
75
|
this.contextMenuItems = [];
|
|
77
76
|
// @Input() selectionSettings = { checkboxOnly: true, type: "Multiple" };
|
|
78
77
|
this.selectionSettings = {
|
|
79
|
-
type:
|
|
78
|
+
type: "Multiple",
|
|
80
79
|
// persistSelection: true,
|
|
81
80
|
checkboxOnly: true,
|
|
82
81
|
};
|
|
@@ -99,8 +98,30 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
99
98
|
this.selectId = [];
|
|
100
99
|
this.startPaging = false;
|
|
101
100
|
this.indexList = [];
|
|
102
|
-
this.className =
|
|
103
|
-
this.
|
|
101
|
+
this.className = "grid-loading";
|
|
102
|
+
this.initList = (/**
|
|
103
|
+
* @param {?=} num
|
|
104
|
+
* @param {?=} key
|
|
105
|
+
* @return {?}
|
|
106
|
+
*/
|
|
107
|
+
function (num, key) {
|
|
108
|
+
if (num === void 0) { num = 25; }
|
|
109
|
+
if (key === void 0) { key = "Id"; }
|
|
110
|
+
/** @type {?} */
|
|
111
|
+
var list = [];
|
|
112
|
+
times(num, (/**
|
|
113
|
+
* @param {?} i
|
|
114
|
+
* @return {?}
|
|
115
|
+
*/
|
|
116
|
+
function (i) {
|
|
117
|
+
var _a;
|
|
118
|
+
list.push((_a = {},
|
|
119
|
+
_a[key] = i,
|
|
120
|
+
_a));
|
|
121
|
+
}));
|
|
122
|
+
return list;
|
|
123
|
+
});
|
|
124
|
+
this.translation = JSON.parse(localStorage.getItem("translation"));
|
|
104
125
|
}
|
|
105
126
|
/**
|
|
106
127
|
* @return {?}
|
|
@@ -110,7 +131,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
110
131
|
*/
|
|
111
132
|
function () {
|
|
112
133
|
if (this.hiddenLoaded)
|
|
113
|
-
this.className =
|
|
134
|
+
this.className = "";
|
|
114
135
|
this.ref && this.ref.markForCheck();
|
|
115
136
|
};
|
|
116
137
|
/**
|
|
@@ -142,7 +163,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
142
163
|
this.pageSettings =
|
|
143
164
|
changes.dataSource.currentValue.length > 9
|
|
144
165
|
? {
|
|
145
|
-
pageSizes: [
|
|
166
|
+
pageSizes: ["All", "25", "50", "100"],
|
|
146
167
|
pageSize: 50,
|
|
147
168
|
}
|
|
148
169
|
: null;
|
|
@@ -174,16 +195,16 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
174
195
|
var _this = this;
|
|
175
196
|
// 整个组件加载完成时的回调函数
|
|
176
197
|
/** @type {?} */
|
|
177
|
-
var pagerContainer = document.querySelector(
|
|
198
|
+
var pagerContainer = document.querySelector(".e-pagercontainer");
|
|
178
199
|
if (pagerContainer) {
|
|
179
200
|
/** @type {?} */
|
|
180
|
-
var linkElements = pagerContainer.querySelectorAll(
|
|
201
|
+
var linkElements = pagerContainer.querySelectorAll(".e-link");
|
|
181
202
|
linkElements.forEach((/**
|
|
182
203
|
* @param {?} element
|
|
183
204
|
* @return {?}
|
|
184
205
|
*/
|
|
185
206
|
function (element) {
|
|
186
|
-
element.removeAttribute(
|
|
207
|
+
element.removeAttribute("href"); // SMP2-10310 删除分页器的href属性
|
|
187
208
|
}));
|
|
188
209
|
}
|
|
189
210
|
if (this.selectedDiffKey) {
|
|
@@ -367,10 +388,10 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
367
388
|
*/
|
|
368
389
|
function (args) {
|
|
369
390
|
if (this.selectedDiffKey &&
|
|
370
|
-
(args.requestType ===
|
|
371
|
-
args.requestType ===
|
|
372
|
-
args.requestType ===
|
|
373
|
-
args.requestType ===
|
|
391
|
+
(args.requestType === "paging" ||
|
|
392
|
+
args.requestType === "searching" ||
|
|
393
|
+
args.requestType === "filtering" ||
|
|
394
|
+
args.requestType === "sorting")) {
|
|
374
395
|
this.startPaging = true;
|
|
375
396
|
}
|
|
376
397
|
this.actionBegin.emit(args);
|
|
@@ -486,10 +507,10 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
486
507
|
function ($event) {
|
|
487
508
|
var _this = this;
|
|
488
509
|
if (this.selectedDiffKey &&
|
|
489
|
-
($event.requestType ===
|
|
490
|
-
$event.requestType ===
|
|
491
|
-
$event.requestType ===
|
|
492
|
-
$event.requestType ===
|
|
510
|
+
($event.requestType === "paging" ||
|
|
511
|
+
$event.requestType === "searching" ||
|
|
512
|
+
$event.requestType === "filtering" ||
|
|
513
|
+
$event.requestType === "sorting")) {
|
|
493
514
|
this.indexList = [];
|
|
494
515
|
setTimeout((/**
|
|
495
516
|
* @return {?}
|
|
@@ -614,7 +635,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
614
635
|
*/
|
|
615
636
|
function ($event) {
|
|
616
637
|
if (this.disableSystemRow && $event.data && $event.data.IsSystem) {
|
|
617
|
-
$event.row.classList.add(
|
|
638
|
+
$event.row.classList.add("e-disabled");
|
|
618
639
|
}
|
|
619
640
|
this.rowDataBound.emit($event);
|
|
620
641
|
};
|
|
@@ -713,7 +734,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
713
734
|
* @return {?}
|
|
714
735
|
*/
|
|
715
736
|
function () {
|
|
716
|
-
this.className =
|
|
737
|
+
this.className = "grid-loading";
|
|
717
738
|
this.ref && this.ref.markForCheck();
|
|
718
739
|
this.ref && this.ref.detectChanges();
|
|
719
740
|
};
|
|
@@ -724,14 +745,14 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
724
745
|
* @return {?}
|
|
725
746
|
*/
|
|
726
747
|
function () {
|
|
727
|
-
this.className =
|
|
748
|
+
this.className = "";
|
|
728
749
|
this.ref && this.ref.markForCheck();
|
|
729
750
|
this.ref && this.ref.detectChanges();
|
|
730
751
|
};
|
|
731
752
|
CommonGridComponent.decorators = [
|
|
732
753
|
{ type: Component, args: [{
|
|
733
|
-
selector:
|
|
734
|
-
template: "<ejs-grid\r\n\t#grid\r\n\t[id]=\"gridId\"\r\n\t[ngClass]=\"{\r\n\t\t'hide-Check-box': !alwaysShowCheckbox,\r\n\t\t'grid-loading': className === 'grid-loading'\r\n\t}\"\r\n\t[dataSource]=\"dataSource\"\r\n\t[allowPaging]=\"allowPaging && pageSettings\"\r\n\t[allowResizing]=\"true\"\r\n\t[pageSettings]=\"pageSettings\"\r\n\t[showColumnMenu]=\"true\"\r\n\t[allowSorting]=\"true\"\r\n\t[allowFiltering]=\"true\"\r\n\t[allowExcelExport]=\"true\"\r\n\t[filterSettings]=\"filterSettings\"\r\n\t[resizeSettings]=\"resizeSettings\"\r\n\t[allowSelection]=\"true\"\r\n\t[editSettings]=\"editSettings\"\r\n\t[childGrid]=\"childGrid\"\r\n\t[contextMenuItems]=\"\r\n\t\tdataSource && dataSource.length ? contextMenuItems : null\r\n\t\"\r\n\t[selectionSettings]=\"selectionSettings\"\r\n\t(recordClick)=\"_recordClick($event)\"\r\n\t(recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n\t(actionBegin)=\"_actionBegin($event)\"\r\n\t(actionComplete)=\"_actionHandler($event)\"\r\n\t(rowSelected)=\"_rowSelected($event)\"\r\n\t(rowDeselected)=\"_rowDeselected($event)\"\r\n\tstyle=\"border: none\"\r\n\t(contextMenuClick)=\"_onContextMenu($event)\"\r\n\t(contextMenuOpen)=\"contextMenuOpen($event)\"\r\n\t(queryCellInfo)=\"customiseCell($event)\"\r\n\t(dataBound)=\"_dataBound($event)\"\r\n\t(rowDataBound)=\"_rowDataBound($event)\"\r\n\t(rowSelecting)=\"_rowSelecting($event)\"\r\n\t(excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n\t(load)=\"_load()\"\r\n\t[frozenColumns]=\"frozenColumns\"\r\n>\r\n\t<e-columns>\r\n\t\t<e-column\r\n\t\t\t*ngIf=\"showCheckBox\"\r\n\t\t\ttype=\"checkbox\"\r\n\t\t\t[width]=\"checkBoxWidth\"\r\n\t\t\t[showColumnMenu]=\"false\"\r\n\t\t></e-column>\r\n\t\t<e-column\r\n\t\t\t*ngFor=\"let item of fields; trackBy: trackByFn\"\r\n\t\t\t[field]=\"item.columnName\"\r\n\t\t\t[filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n\t\t\t[customAttributes]=\"\r\n\t\t\t\titem.colName === 'entityUserList' ||\r\n\t\t\t\titem.colName === 'kycProgress'\r\n\t\t\t\t\t? { class: 'hideColumnFilterClass' }\r\n\t\t\t\t\t: {}\r\n\t\t\t\"\r\n\t\t\t[headerText]=\"item.columnDisplayName\"\r\n\t\t\t[textAlign]=\"item.textAlign\"\r\n\t\t\t[showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n\t\t\t[allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n\t\t\t[allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n\t\t\t[editType]=\"item.editType\"\r\n\t\t\t[validationRules]=\"item.validationRules\"\r\n\t\t\t[type]=\"item.dataType\"\r\n\t\t\t[width]=\"item.width\"\r\n\t\t\t[minWidth]=\"item.minWidth\"\r\n\t\t\t[format]=\"item.format\"\r\n\t\t\t[visible]=\"item.visible\"\r\n\t\t\t[template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n\t\t\t[clipMode]=\"\r\n\t\t\t\titem.clipMode\r\n\t\t\t\t\t? item.clipMode\r\n\t\t\t\t\t: clipMode || 'EllipsisWithTooltip'\r\n\t\t\t\"\r\n\t\t\t[sortComparer]=\"item.dateComparer\"\r\n\t\t>\r\n\t\t</e-column>\r\n\t</e-columns>\r\n</ejs-grid>\r\n",
|
|
754
|
+
selector: "rs-common-grid",
|
|
755
|
+
template: "<ejs-grid\r\n\t#grid\r\n\t[id]=\"gridId\"\r\n\t[ngClass]=\"{\r\n\t\t'hide-Check-box': !alwaysShowCheckbox,\r\n\t\t'grid-loading': className === 'grid-loading'\r\n\t}\"\r\n\t[dataSource]=\"dataSource\"\r\n\t[allowPaging]=\"allowPaging && pageSettings\"\r\n\t[allowResizing]=\"true\"\r\n\t[pageSettings]=\"pageSettings\"\r\n\t[showColumnMenu]=\"true\"\r\n\t[allowSorting]=\"true\"\r\n\t[allowFiltering]=\"true\"\r\n\t[allowExcelExport]=\"true\"\r\n\t[filterSettings]=\"filterSettings\"\r\n\t[resizeSettings]=\"resizeSettings\"\r\n\t[allowSelection]=\"true\"\r\n\t[editSettings]=\"editSettings\"\r\n\t[childGrid]=\"childGrid\"\r\n\t[contextMenuItems]=\"\r\n\t\tdataSource && dataSource.length ? contextMenuItems : null\r\n\t\"\r\n\t[selectionSettings]=\"selectionSettings\"\r\n\t(recordClick)=\"_recordClick($event)\"\r\n\t(recordDoubleClick)=\"_recordDoubleClick($event)\"\r\n\t(actionBegin)=\"_actionBegin($event)\"\r\n\t(actionComplete)=\"_actionHandler($event)\"\r\n\t(rowSelected)=\"_rowSelected($event)\"\r\n\t(rowDeselected)=\"_rowDeselected($event)\"\r\n\tstyle=\"border: none\"\r\n\t(contextMenuClick)=\"_onContextMenu($event)\"\r\n\t(contextMenuOpen)=\"contextMenuOpen($event)\"\r\n\t(queryCellInfo)=\"customiseCell($event)\"\r\n\t(dataBound)=\"_dataBound($event)\"\r\n\t(rowDataBound)=\"_rowDataBound($event)\"\r\n\t(rowSelecting)=\"_rowSelecting($event)\"\r\n\t(excelQueryCellInfo)=\"_exportQueryCellInfo($event)\"\r\n\t(load)=\"_load()\"\r\n\t[frozenColumns]=\"frozenColumns\"\r\n\t[columnChooserSettings]=\"columnChooserSettings\"\r\n\r\n>\r\n\t<e-columns>\r\n\t\t<e-column\r\n\t\t\t*ngIf=\"showCheckBox\"\r\n\t\t\ttype=\"checkbox\"\r\n\t\t\t[width]=\"checkBoxWidth\"\r\n\t\t\t[showColumnMenu]=\"false\"\r\n\t\t></e-column>\r\n\t\t<e-column\r\n\t\t\t*ngFor=\"let item of fields; trackBy: trackByFn\"\r\n\t\t\t[field]=\"item.columnName\"\r\n\t\t\t[filter]=\"item.filter ? item.filter : { type: 'CheckBox' }\"\r\n\t\t\t[customAttributes]=\"\r\n\t\t\t\titem.colName === 'entityUserList' ||\r\n\t\t\t\titem.colName === 'kycProgress'\r\n\t\t\t\t\t? { class: 'hideColumnFilterClass' }\r\n\t\t\t\t\t: {}\r\n\t\t\t\"\r\n\t\t\t[headerText]=\"item.columnDisplayName\"\r\n\t\t\t[textAlign]=\"item.textAlign\"\r\n\t\t\t[showColumnMenu]=\"item.showColumnMenu === undefined ? true : false\"\r\n\t\t\t[allowFiltering]=\"item.allowFiltering === undefined ? true : false\"\r\n\t\t\t[allowSorting]=\"item.allowSorting === undefined ? true : false\"\r\n\t\t\t[editType]=\"item.editType\"\r\n\t\t\t[validationRules]=\"item.validationRules\"\r\n\t\t\t[type]=\"item.dataType\"\r\n\t\t\t[width]=\"item.width\"\r\n\t\t\t[minWidth]=\"item.minWidth\"\r\n\t\t\t[format]=\"item.format\"\r\n\t\t\t[visible]=\"item.visible\"\r\n\t\t\t[template]=\"item.showTemplate ? columnTemplate : undefined\"\r\n\t\t\t[clipMode]=\"\r\n\t\t\t\titem.clipMode\r\n\t\t\t\t\t? item.clipMode\r\n\t\t\t\t\t: clipMode || 'EllipsisWithTooltip'\r\n\t\t\t\"\r\n\t\t\t[sortComparer]=\"item.dateComparer\"\r\n\t\t>\r\n\t\t</e-column>\r\n\t</e-columns>\r\n</ejs-grid>\r\n",
|
|
735
756
|
styles: [""]
|
|
736
757
|
}] }
|
|
737
758
|
];
|
|
@@ -740,7 +761,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
740
761
|
{ type: ChangeDetectorRef }
|
|
741
762
|
]; };
|
|
742
763
|
CommonGridComponent.propDecorators = {
|
|
743
|
-
grid: [{ type: ViewChild, args: [
|
|
764
|
+
grid: [{ type: ViewChild, args: ["grid", { static: false },] }],
|
|
744
765
|
showCheckBox: [{ type: Input }],
|
|
745
766
|
loaded: [{ type: Input }],
|
|
746
767
|
hiddenLoaded: [{ type: Input }],
|
|
@@ -761,6 +782,7 @@ var CommonGridComponent = /** @class */ (function () {
|
|
|
761
782
|
checkBoxWidth: [{ type: Input }],
|
|
762
783
|
childGrid: [{ type: Input }],
|
|
763
784
|
frozenColumns: [{ type: Input }],
|
|
785
|
+
columnChooserSettings: [{ type: Input }],
|
|
764
786
|
contextMenuItems: [{ type: Input }],
|
|
765
787
|
selectionSettings: [{ type: Input }],
|
|
766
788
|
alwaysShowCheckbox: [{ type: Input }],
|
|
@@ -825,6 +847,8 @@ if (false) {
|
|
|
825
847
|
CommonGridComponent.prototype.childGrid;
|
|
826
848
|
/** @type {?} */
|
|
827
849
|
CommonGridComponent.prototype.frozenColumns;
|
|
850
|
+
/** @type {?} */
|
|
851
|
+
CommonGridComponent.prototype.columnChooserSettings;
|
|
828
852
|
/**
|
|
829
853
|
* Sample: [
|
|
830
854
|
* {
|
|
@@ -888,6 +912,8 @@ if (false) {
|
|
|
888
912
|
CommonGridComponent.prototype.className;
|
|
889
913
|
/** @type {?} */
|
|
890
914
|
CommonGridComponent.prototype.translation;
|
|
915
|
+
/** @type {?} */
|
|
916
|
+
CommonGridComponent.prototype.initList;
|
|
891
917
|
/**
|
|
892
918
|
* @type {?}
|
|
893
919
|
* @private
|