raise-common-lib 0.0.72 → 0.0.73

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.
@@ -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,16 +44,16 @@ 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 = 'grid';
51
- this.resizeSettings = { mode: 'Auto' };
52
- this.filterSettings = { type: 'Menu' };
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 = 'EllipsisWithTooltip';
56
+ this.clipMode = "EllipsisWithTooltip";
57
57
  this.checkBoxWidth = 32; // col 数量过少的时候,check宽度会拉伸,这时候设置null
58
58
  // col 数量过少的时候,check宽度会拉伸,这时候设置null
59
59
  /**
@@ -76,7 +76,7 @@ var CommonGridComponent = /** @class */ (function () {
76
76
  this.contextMenuItems = [];
77
77
  // @Input() selectionSettings = { checkboxOnly: true, type: "Multiple" };
78
78
  this.selectionSettings = {
79
- type: 'Multiple',
79
+ type: "Multiple",
80
80
  // persistSelection: true,
81
81
  checkboxOnly: true,
82
82
  };
@@ -99,8 +99,30 @@ var CommonGridComponent = /** @class */ (function () {
99
99
  this.selectId = [];
100
100
  this.startPaging = false;
101
101
  this.indexList = [];
102
- this.className = 'grid-loading';
103
- this.translation = JSON.parse(localStorage.getItem('translation'));
102
+ this.className = "grid-loading";
103
+ this.initList = (/**
104
+ * @param {?=} num
105
+ * @param {?=} key
106
+ * @return {?}
107
+ */
108
+ function (num, key) {
109
+ if (num === void 0) { num = 25; }
110
+ if (key === void 0) { key = "Id"; }
111
+ /** @type {?} */
112
+ var list = [];
113
+ times(num, (/**
114
+ * @param {?} i
115
+ * @return {?}
116
+ */
117
+ function (i) {
118
+ var _a;
119
+ list.push((_a = {},
120
+ _a[key] = i,
121
+ _a));
122
+ }));
123
+ return list;
124
+ });
125
+ this.translation = JSON.parse(localStorage.getItem("translation"));
104
126
  }
105
127
  /**
106
128
  * @return {?}
@@ -110,7 +132,7 @@ var CommonGridComponent = /** @class */ (function () {
110
132
  */
111
133
  function () {
112
134
  if (this.hiddenLoaded)
113
- this.className = '';
135
+ this.className = "";
114
136
  this.ref && this.ref.markForCheck();
115
137
  };
116
138
  /**
@@ -142,7 +164,7 @@ var CommonGridComponent = /** @class */ (function () {
142
164
  this.pageSettings =
143
165
  changes.dataSource.currentValue.length > 9
144
166
  ? {
145
- pageSizes: ['All', '25', '50', '100'],
167
+ pageSizes: ["All", "25", "50", "100"],
146
168
  pageSize: 50,
147
169
  }
148
170
  : null;
@@ -174,16 +196,16 @@ var CommonGridComponent = /** @class */ (function () {
174
196
  var _this = this;
175
197
  // 整个组件加载完成时的回调函数
176
198
  /** @type {?} */
177
- var pagerContainer = document.querySelector('.e-pagercontainer');
199
+ var pagerContainer = document.querySelector(".e-pagercontainer");
178
200
  if (pagerContainer) {
179
201
  /** @type {?} */
180
- var linkElements = pagerContainer.querySelectorAll('.e-link');
202
+ var linkElements = pagerContainer.querySelectorAll(".e-link");
181
203
  linkElements.forEach((/**
182
204
  * @param {?} element
183
205
  * @return {?}
184
206
  */
185
207
  function (element) {
186
- element.removeAttribute('href'); // SMP2-10310 删除分页器的href属性
208
+ element.removeAttribute("href"); // SMP2-10310 删除分页器的href属性
187
209
  }));
188
210
  }
189
211
  if (this.selectedDiffKey) {
@@ -367,10 +389,10 @@ var CommonGridComponent = /** @class */ (function () {
367
389
  */
368
390
  function (args) {
369
391
  if (this.selectedDiffKey &&
370
- (args.requestType === 'paging' ||
371
- args.requestType === 'searching' ||
372
- args.requestType === 'filtering' ||
373
- args.requestType === 'sorting')) {
392
+ (args.requestType === "paging" ||
393
+ args.requestType === "searching" ||
394
+ args.requestType === "filtering" ||
395
+ args.requestType === "sorting")) {
374
396
  this.startPaging = true;
375
397
  }
376
398
  this.actionBegin.emit(args);
@@ -486,10 +508,10 @@ var CommonGridComponent = /** @class */ (function () {
486
508
  function ($event) {
487
509
  var _this = this;
488
510
  if (this.selectedDiffKey &&
489
- ($event.requestType === 'paging' ||
490
- $event.requestType === 'searching' ||
491
- $event.requestType === 'filtering' ||
492
- $event.requestType === 'sorting')) {
511
+ ($event.requestType === "paging" ||
512
+ $event.requestType === "searching" ||
513
+ $event.requestType === "filtering" ||
514
+ $event.requestType === "sorting")) {
493
515
  this.indexList = [];
494
516
  setTimeout((/**
495
517
  * @return {?}
@@ -614,7 +636,7 @@ var CommonGridComponent = /** @class */ (function () {
614
636
  */
615
637
  function ($event) {
616
638
  if (this.disableSystemRow && $event.data && $event.data.IsSystem) {
617
- $event.row.classList.add('e-disabled');
639
+ $event.row.classList.add("e-disabled");
618
640
  }
619
641
  this.rowDataBound.emit($event);
620
642
  };
@@ -713,7 +735,7 @@ var CommonGridComponent = /** @class */ (function () {
713
735
  * @return {?}
714
736
  */
715
737
  function () {
716
- this.className = 'grid-loading';
738
+ this.className = "grid-loading";
717
739
  this.ref && this.ref.markForCheck();
718
740
  this.ref && this.ref.detectChanges();
719
741
  };
@@ -724,13 +746,13 @@ var CommonGridComponent = /** @class */ (function () {
724
746
  * @return {?}
725
747
  */
726
748
  function () {
727
- this.className = '';
749
+ this.className = "";
728
750
  this.ref && this.ref.markForCheck();
729
751
  this.ref && this.ref.detectChanges();
730
752
  };
731
753
  CommonGridComponent.decorators = [
732
754
  { type: Component, args: [{
733
- selector: 'rs-common-grid',
755
+ selector: "rs-common-grid",
734
756
  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",
735
757
  styles: [""]
736
758
  }] }
@@ -740,7 +762,7 @@ var CommonGridComponent = /** @class */ (function () {
740
762
  { type: ChangeDetectorRef }
741
763
  ]; };
742
764
  CommonGridComponent.propDecorators = {
743
- grid: [{ type: ViewChild, args: ['grid', { static: false },] }],
765
+ grid: [{ type: ViewChild, args: ["grid", { static: false },] }],
744
766
  showCheckBox: [{ type: Input }],
745
767
  loaded: [{ type: Input }],
746
768
  hiddenLoaded: [{ type: Input }],
@@ -888,6 +910,8 @@ if (false) {
888
910
  CommonGridComponent.prototype.className;
889
911
  /** @type {?} */
890
912
  CommonGridComponent.prototype.translation;
913
+ /** @type {?} */
914
+ CommonGridComponent.prototype.initList;
891
915
  /**
892
916
  * @type {?}
893
917
  * @private