@colijnit/corecomponents_v12 12.0.47 → 12.0.50
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/colijnit-corecomponents_v12.umd.js +1003 -986
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.d.ts +7 -7
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/colijnit-corecomponents_v12.js +8 -8
- package/esm2015/lib/components/drop-down-list/drop-down-list.component.js +8 -1
- package/esm2015/lib/components/input-combo-box/input-combo-box.component.js +2 -1
- package/esm2015/lib/components/input-search/input-search.component.js +17 -7
- package/esm2015/lib/components/input-text/input-text.component.js +2 -2
- package/esm2015/lib/components/simple-grid/simple-grid-cell.component.js +1 -4
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +10 -2
- package/esm2015/lib/components/simple-grid/simple-grid.module.js +4 -2
- package/esm2015/lib/core/interface/filter-item-viewmodel.js +1 -1
- package/fesm2015/colijnit-corecomponents_v12.js +723 -701
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/drop-down-list/drop-down-list.component.d.ts +3 -0
- package/lib/components/input-search/input-search.component.d.ts +3 -2
- package/lib/components/input-text/style/_layout.scss +5 -2
- package/lib/components/simple-grid/simple-grid-cell.component.d.ts +2 -3
- package/lib/components/simple-grid/simple-grid.component.d.ts +3 -0
- package/lib/components/simple-grid/style/_material-definition.scss +2 -0
- package/lib/components/simple-grid/style/_theme.scss +4 -0
- package/lib/components/simple-grid/style/material.scss +1 -0
- package/lib/core/interface/filter-item-viewmodel.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5394,6 +5394,7 @@
|
|
|
5394
5394
|
* Where 'text' is showing in the dropdown and 'id' used for the model binding
|
|
5395
5395
|
*/
|
|
5396
5396
|
_this.fields = {};
|
|
5397
|
+
_this.allowFiltering = false;
|
|
5397
5398
|
_super.prototype._markAsOnPush.call(_this);
|
|
5398
5399
|
return _this;
|
|
5399
5400
|
}
|
|
@@ -5410,7 +5411,7 @@
|
|
|
5410
5411
|
DropDownListComponent.decorators = [
|
|
5411
5412
|
{ type: core.Component, args: [{
|
|
5412
5413
|
selector: "co-drop-down-list",
|
|
5413
|
-
template: "\n <ejs-dropdownlist\n [dataSource]=\"collection\"\n [value]=\"model\"\n [fields]=\"fields\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [itemTemplate]=\"itemTemplate\"\n [headerTemplate]=\"headerTemplate\"\n [valueTemplate]=\"valueTemplate\"\n [disabled]=\"disabled\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (valueChange)=\"handleValueChanged($event)\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-dropdownlist>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
5414
|
+
template: "\n <ejs-dropdownlist\n [dataSource]=\"collection\"\n [allowFiltering]=\"allowFiltering\"\n [value]=\"model\"\n [fields]=\"fields\"\n [filterBarPlaceholder]=\"filterBarPlaceholder\"\n [filterType]=\"filterType\"\n [placeholder]=\"placeholder\"\n [readonly]=\"readonly\"\n [itemTemplate]=\"itemTemplate\"\n [headerTemplate]=\"headerTemplate\"\n [valueTemplate]=\"valueTemplate\"\n [disabled]=\"disabled\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (valueChange)=\"handleValueChanged($event)\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-dropdownlist>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
5414
5415
|
providers: [
|
|
5415
5416
|
ej2AngularDropdowns.CheckBoxSelectionService,
|
|
5416
5417
|
{
|
|
@@ -5436,6 +5437,9 @@
|
|
|
5436
5437
|
collection: [{ type: core.Input }],
|
|
5437
5438
|
fields: [{ type: core.Input }],
|
|
5438
5439
|
placeholder: [{ type: core.Input }],
|
|
5440
|
+
allowFiltering: [{ type: core.Input }],
|
|
5441
|
+
filterBarPlaceholder: [{ type: core.Input }],
|
|
5442
|
+
filterType: [{ type: core.Input }],
|
|
5439
5443
|
itemTemplate: [{ type: core.Input }],
|
|
5440
5444
|
headerTemplate: [{ type: core.Input }],
|
|
5441
5445
|
valueTemplate: [{ type: core.Input }],
|
|
@@ -6242,7 +6246,7 @@
|
|
|
6242
6246
|
InputComboBoxComponent.decorators = [
|
|
6243
6247
|
{ type: core.Component, args: [{
|
|
6244
6248
|
selector: "co-input-combo-box",
|
|
6245
|
-
template: "\n <ejs-combobox #combo [dataSource]=\"collection\"\n [fields]=\"fields\"\n [placeholder]=\"placeholder\"\n [autofill]=\"true\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (valueChange)=\"valueChange.emit($event)\"\n (focus)=\"onFocus()\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-combobox>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
6249
|
+
template: "\n <ejs-combobox #combo [dataSource]=\"collection\"\n [fields]=\"fields\"\n [disabled]=\"readonly\"\n [placeholder]=\"placeholder\"\n [autofill]=\"true\"\n [ngModel]=\"model\"\n (ngModelChange)=\"modelChange.emit($event)\"\n (valueChange)=\"valueChange.emit($event)\"\n (focus)=\"onFocus()\"\n showClearButton=\"true\"\n floatLabelType=\"Auto\"\n >\n </ejs-combobox>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
6246
6250
|
providers: [{
|
|
6247
6251
|
provide: COMPONENT_INTERFACE_NAME,
|
|
6248
6252
|
useExisting: core.forwardRef(function () { return InputComboBoxComponent; })
|
|
@@ -7261,7 +7265,7 @@
|
|
|
7261
7265
|
InputTextComponent.decorators = [
|
|
7262
7266
|
{ type: core.Component, args: [{
|
|
7263
7267
|
selector: "co-input-text",
|
|
7264
|
-
template: "\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\" [textContent]=\"placeholder\"></label>\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\"></co-icon>\n <input #input\n [type]=\"type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n >\n <co-
|
|
7268
|
+
template: "\n <label *ngIf=\"showPlaceholderOnFocus || (!showPlaceholderOnFocus && !hasValue && !focused)\" [textContent]=\"placeholder\"></label>\n <co-icon *ngIf=\"leftIcon\" class=\"input-text-left-icon\" [icon]=\"leftIcon\"></co-icon>\n <co-icon *ngIf=\"rightIcon\" class=\"input-text-right-icon\" [icon]=\"rightIcon\"></co-icon>\n <input #input\n [type]=\"type\"\n [ngModel]=\"model\"\n [min]=\"type === 'number' && this.min ? this.min : undefined\"\n [max]=\"type === 'number' && this.max ? this.max : undefined\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n (ngModelChange)=\"modelChange.emit($event)\"\n >\n <co-commit-buttons *ngIf=\"showSaveCancel && focused && canSaveOrCancel\"\n [committing]=\"committing\"\n [commitFinished]=\"commitFinished\"\n (commitClick)=\"commitClick($event)\"\n (cancelClick)=\"cancelClick($event)\"\n >\n </co-commit-buttons>\n <div class=\"required-indicator\"></div>\n <ng-template #validationError></ng-template>\n ",
|
|
7265
7269
|
providers: [{
|
|
7266
7270
|
provide: COMPONENT_INTERFACE_NAME,
|
|
7267
7271
|
useExisting: core.forwardRef(function () { return InputTextComponent; })
|
|
@@ -7547,9 +7551,10 @@
|
|
|
7547
7551
|
function InputSearchComponent() {
|
|
7548
7552
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
7549
7553
|
_this.searchIcon = exports.CoreComponentsIcon.Magnifier;
|
|
7550
|
-
_this.iconRight = false;
|
|
7551
|
-
_this.noIcon = false;
|
|
7552
7554
|
_this.search = new core.EventEmitter();
|
|
7555
|
+
_this.useLeftIcon = false;
|
|
7556
|
+
_this.useRightIcon = false;
|
|
7557
|
+
_this.noIcon = false;
|
|
7553
7558
|
return _this;
|
|
7554
7559
|
}
|
|
7555
7560
|
InputSearchComponent.prototype.showClass = function () {
|
|
@@ -7568,18 +7573,25 @@
|
|
|
7568
7573
|
InputSearchComponent.decorators = [
|
|
7569
7574
|
{ type: core.Component, args: [{
|
|
7570
7575
|
selector: 'co-input-search',
|
|
7571
|
-
template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"
|
|
7576
|
+
template: "\n <co-input-text\n [model]=\"model\"\n [leftIcon]=\"useLeftIcon ? searchIcon : null\"\n [rightIcon]=\"useRightIcon ? searchIcon : null\"\n [placeholder]=\"placeholder\"\n [showPlaceholderOnFocus]=\"false\"\n (modelChange)=\"modelChange.emit($event)\"\n ></co-input-text>\n ",
|
|
7572
7577
|
changeDetection: core.ChangeDetectionStrategy.OnPush,
|
|
7573
7578
|
encapsulation: core.ViewEncapsulation.None
|
|
7574
7579
|
},] }
|
|
7575
7580
|
];
|
|
7576
7581
|
InputSearchComponent.propDecorators = {
|
|
7577
7582
|
placeholder: [{ type: core.Input }],
|
|
7578
|
-
iconRight: [{ type: core.Input }],
|
|
7579
|
-
noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
|
|
7580
7583
|
search: [{ type: core.Output }],
|
|
7584
|
+
useLeftIcon: [{ type: core.Input }],
|
|
7585
|
+
useRightIcon: [{ type: core.Input }],
|
|
7586
|
+
noIcon: [{ type: core.HostBinding, args: ['class.no-icon',] }, { type: core.Input }],
|
|
7581
7587
|
showClass: [{ type: core.HostBinding, args: ['class.co-input-search',] }]
|
|
7582
|
-
};
|
|
7588
|
+
};
|
|
7589
|
+
__decorate([
|
|
7590
|
+
InputBoolean()
|
|
7591
|
+
], InputSearchComponent.prototype, "useLeftIcon", void 0);
|
|
7592
|
+
__decorate([
|
|
7593
|
+
InputBoolean()
|
|
7594
|
+
], InputSearchComponent.prototype, "useRightIcon", void 0);
|
|
7583
7595
|
|
|
7584
7596
|
var InputSearchModule = /** @class */ (function () {
|
|
7585
7597
|
function InputSearchModule() {
|
|
@@ -9491,10 +9503,12 @@
|
|
|
9491
9503
|
_this.showAdd = false;
|
|
9492
9504
|
_this.showDelete = false;
|
|
9493
9505
|
_this.rightToolbar = false;
|
|
9506
|
+
_this.rowsPerPage = 1000;
|
|
9494
9507
|
_this.editing = false;
|
|
9495
9508
|
_this.editRowIndex = -1;
|
|
9496
9509
|
_this.editCellIndex = -1;
|
|
9497
9510
|
_this.selectedRowIndex = -1;
|
|
9511
|
+
_this.currentPage = 1;
|
|
9498
9512
|
_this._doubleClicked = false;
|
|
9499
9513
|
_this._newRow = false;
|
|
9500
9514
|
return _this;
|
|
@@ -9761,6 +9775,10 @@
|
|
|
9761
9775
|
}
|
|
9762
9776
|
this._detectChanges();
|
|
9763
9777
|
};
|
|
9778
|
+
SimpleGridComponent.prototype.pageChange = function (page) {
|
|
9779
|
+
this.currentPage = page;
|
|
9780
|
+
//this.gridBody.nativeElement.scrollTop = 0;
|
|
9781
|
+
};
|
|
9764
9782
|
SimpleGridComponent.prototype._detectChanges = function () {
|
|
9765
9783
|
this._changeDetection.detectChanges();
|
|
9766
9784
|
};
|
|
@@ -9769,7 +9787,7 @@
|
|
|
9769
9787
|
SimpleGridComponent.decorators = [
|
|
9770
9788
|
{ type: core.Component, args: [{
|
|
9771
9789
|
selector: 'co-simple-grid',
|
|
9772
|
-
template: "\n <co-grid-toolbar *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"inlineEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\"\n ></co-grid-toolbar>\n <table class=\"simple-grid-table\">\n <colgroup>\n <col *ngFor=\"let column of headerColumns; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th scope=\"col\" #headerCell class=\"simple-grid-column-header\" *ngFor=\"let column of headerColumns; let index = index\">\n <div class=\"simple-grid-column-header-wrapper\" [class.resizable]=\"resizable\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText || ' '\"\n ></div>\n </ng-template>\n <div *ngIf=\"resizable && column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <tr class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.editing]=\"rowIndex === editRowIndex\" *ngFor=\"let row of data; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\" (visible)=\"rowVisible.next(row)\">\n <co-form class=\"simple-grid-row-form\">\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumns.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\"\n ></co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumns; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n </ng-container>\n </co-form>\n </tr>\n </tbody>\n </table>\n ",
|
|
9790
|
+
template: "\n <co-grid-toolbar *ngIf=\"showToolbar\" [class.right]=\"rightToolbar\"\n [showEdit]=\"inlineEdit\"\n [showAdd]=\"showAdd\"\n [showDelete]=\"showDelete\"\n [deleteEnabled]=\"selectedRowIndex > -1\"\n (addClick)=\"addNewRow()\"\n (editClick)=\"editRow($event)\"\n (saveClick)=\"validateAndSave()\"\n (cancelClick)=\"cancelEditRow()\"\n (deleteClick)=\"removeRow()\"\n ></co-grid-toolbar>\n <table class=\"simple-grid-table\">\n <colgroup>\n <col *ngFor=\"let column of headerColumns; let index = index\"\n [class.simple-grid-column-auto-fit]=\"column.autoFit\"\n [style.width.px]=\"column.width\"\n [style.min-width.px]=\"MIN_COLUMN_WIDTH\">\n </colgroup>\n <thead>\n <tr>\n <th scope=\"col\" #headerCell class=\"simple-grid-column-header\" *ngFor=\"let column of headerColumns; let index = index\">\n <div class=\"simple-grid-column-header-wrapper\" [class.resizable]=\"resizable\"\n [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"column.headerTemplate; else noHeaderTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.headerTemplate\"></ng-container>\n </ng-container>\n <ng-template #noHeaderTemplate>\n <div class=\"simple-grid-column-header-label\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\"\n [textContent]=\"column.headerText || ' '\"\n ></div>\n </ng-template>\n <div *ngIf=\"resizable && column.resizable\" class=\"simple-grid-column-sizer\"\n (mousedown)=\"handleSizerMouseDown($event, column)\"\n ></div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody #dropList cdkDropList cdkDropListOrientation=\"vertical\"\n class=\"simple-grid-drag-drop-list\"\n [cdkDropListDisabled]=\"!dragDropEnabled\"\n [cdkDropListData]=\"data\"\n [cdkDropListEnterPredicate]=\"handleCanDragDrop\"\n (cdkDropListDropped)=\"handleDrop($event)\">\n <tr class=\"simple-grid-row\" [class.selected]=\"rowIndex === selectedRowIndex && !editing\" observeVisibility\n [class.editing]=\"rowIndex === editRowIndex\" *ngFor=\"let row of (!!rowsPerPage ? (data | paginate: {itemsPerPage: rowsPerPage, currentPage: currentPage}) : data); last as last; let rowIndex = index\" cdkDrag\n (click)=\"handleClickRow($event, rowIndex)\" (dblclick)=\"handleDblClickRow($event, rowIndex)\" (visible)=\"rowVisible.next(row)\">\n <co-form class=\"simple-grid-row-form\">\n <ng-container *ngIf=\"isSingleColumnRow(row)\">\n <td class=\"simple-grid-single-column-cell\" [attr.colspan]=\"headerColumns.length\">\n <co-simple-grid-cell\n [column]=\"columns[singleColumnIndex(row)]\"\n [row]=\"row\"\n [editMode]=\"false\"\n ></co-simple-grid-cell>\n </td>\n </ng-container>\n <ng-container *ngIf=\"!isSingleColumnRow(row)\">\n <ng-container *ngFor=\"let column of headerColumns; let columnIndex = index\">\n <td class=\"simple-grid-column-cell\" *ngIf=\"columnIndex !== singleColumnIndex(row)\">\n <co-simple-grid-cell\n [column]=\"column\"\n [row]=\"row\"\n [editMode]=\"inlineEdit && editing && rowIndex === editRowIndex\"\n [fieldEditMode]=\"editCellIndex === columnIndex\"\n (cellClick)=\"handleCellClick(columnIndex)\"\n ></co-simple-grid-cell>\n <div *ngIf=\"column.resizable\" class=\"simple-grid-column-sizer-placeholder\"></div>\n </td>\n </ng-container>\n </ng-container>\n </co-form>\n </tr>\n </tbody>\n </table>\n <co-pagination *ngIf=\"data?.length > rowsPerPage\" [autoHide]=\"true\" (pageChange)=\"pageChange($event)\"></co-pagination>\n ",
|
|
9773
9791
|
providers: [
|
|
9774
9792
|
FormMasterService
|
|
9775
9793
|
],
|
|
@@ -9786,1131 +9804,1130 @@
|
|
|
9786
9804
|
showAdd: [{ type: core.Input }],
|
|
9787
9805
|
showDelete: [{ type: core.Input }],
|
|
9788
9806
|
rightToolbar: [{ type: core.Input }],
|
|
9807
|
+
rowsPerPage: [{ type: core.Input }],
|
|
9789
9808
|
showClass: [{ type: core.HostBinding, args: ['class.co-simple-grid',] }],
|
|
9790
9809
|
handleKeyDown: [{ type: core.HostListener, args: ['keydown', ['$event'],] }]
|
|
9791
9810
|
};
|
|
9792
9811
|
|
|
9793
|
-
var
|
|
9794
|
-
function
|
|
9795
|
-
this.
|
|
9796
|
-
this.
|
|
9797
|
-
this.editMode = false;
|
|
9798
|
-
this.cellClick = new core.EventEmitter();
|
|
9799
|
-
this._fieldEditMode = false;
|
|
9800
|
-
this._focused = false;
|
|
9812
|
+
var PaginationService = /** @class */ (function () {
|
|
9813
|
+
function PaginationService() {
|
|
9814
|
+
this.change = new rxjs.Subject();
|
|
9815
|
+
this.instances = {};
|
|
9801
9816
|
}
|
|
9802
|
-
Object.defineProperty(
|
|
9803
|
-
set: function (template) {
|
|
9804
|
-
if (template) {
|
|
9805
|
-
this._editTemplate = template;
|
|
9806
|
-
this._setFocusComponent();
|
|
9807
|
-
}
|
|
9808
|
-
},
|
|
9809
|
-
enumerable: false,
|
|
9810
|
-
configurable: true
|
|
9811
|
-
});
|
|
9812
|
-
Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
|
|
9813
|
-
set: function (template) {
|
|
9814
|
-
if (template) {
|
|
9815
|
-
this._template = template;
|
|
9816
|
-
this._setFocusComponent();
|
|
9817
|
-
}
|
|
9818
|
-
},
|
|
9819
|
-
enumerable: false,
|
|
9820
|
-
configurable: true
|
|
9821
|
-
});
|
|
9822
|
-
Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
|
|
9823
|
-
set: function (template) {
|
|
9824
|
-
if (template) {
|
|
9825
|
-
this._inputTemplate = template;
|
|
9826
|
-
this._setFocusComponent();
|
|
9827
|
-
}
|
|
9828
|
-
},
|
|
9829
|
-
enumerable: false,
|
|
9830
|
-
configurable: true
|
|
9831
|
-
});
|
|
9832
|
-
Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
|
|
9817
|
+
Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
|
|
9833
9818
|
get: function () {
|
|
9834
|
-
return
|
|
9835
|
-
},
|
|
9836
|
-
set: function (value) {
|
|
9837
|
-
this._fieldEditMode = value;
|
|
9838
|
-
this._setFocusComponent();
|
|
9819
|
+
return PaginationService.DEFAULT_ID;
|
|
9839
9820
|
},
|
|
9840
9821
|
enumerable: false,
|
|
9841
9822
|
configurable: true
|
|
9842
9823
|
});
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
SimpleGridCellComponent.prototype.handleClick = function (event) {
|
|
9847
|
-
if (this.column && !this.column.readonly) {
|
|
9848
|
-
this.cellClick.next();
|
|
9824
|
+
PaginationService.prototype.register = function (instance) {
|
|
9825
|
+
if (!instance.id) {
|
|
9826
|
+
instance.id = PaginationService.DEFAULT_ID;
|
|
9849
9827
|
}
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
};
|
|
9854
|
-
SimpleGridCellComponent.prototype._setFocusComponent = function () {
|
|
9855
|
-
if (this.editMode && this.fieldEditMode) {
|
|
9856
|
-
var element = this._getElement();
|
|
9857
|
-
if (element) {
|
|
9858
|
-
var focusEvent = this._createNewEvent(element, 'focus');
|
|
9859
|
-
element.focus();
|
|
9860
|
-
element.dispatchEvent(focusEvent);
|
|
9861
|
-
this._focused = true;
|
|
9862
|
-
}
|
|
9828
|
+
if (!this.instances[instance.id]) {
|
|
9829
|
+
this.instances[instance.id] = instance;
|
|
9830
|
+
this.change.next(instance.id);
|
|
9863
9831
|
}
|
|
9864
9832
|
else {
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
var blurEvent = this._createNewEvent(element, 'blur');
|
|
9869
|
-
element.blur();
|
|
9870
|
-
element.dispatchEvent(blurEvent);
|
|
9871
|
-
}
|
|
9872
|
-
this._focused = false;
|
|
9833
|
+
var changed = this.updateInstance(instance);
|
|
9834
|
+
if (changed) {
|
|
9835
|
+
this.change.next(instance.id);
|
|
9873
9836
|
}
|
|
9874
9837
|
}
|
|
9875
|
-
this._detectChanges();
|
|
9876
9838
|
};
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
otherCollection.map(function (o) { return collection_1.push(o); });
|
|
9882
|
-
if (collection_1.length > 0) {
|
|
9883
|
-
return collection_1[0];
|
|
9884
|
-
}
|
|
9839
|
+
// Returns the current page number.
|
|
9840
|
+
PaginationService.prototype.getCurrentPage = function (id) {
|
|
9841
|
+
if (this.instances[id]) {
|
|
9842
|
+
return this.instances[id].currentPage;
|
|
9885
9843
|
}
|
|
9886
9844
|
};
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
if (
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9845
|
+
// Sets the current page number.
|
|
9846
|
+
PaginationService.prototype.setCurrentPage = function (id, page) {
|
|
9847
|
+
if (this.instances[id]) {
|
|
9848
|
+
var instance = this.instances[id];
|
|
9849
|
+
var maxPage = Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
9850
|
+
if (page <= maxPage && 1 <= page) {
|
|
9851
|
+
this.instances[id].currentPage = page;
|
|
9852
|
+
this.change.next(id);
|
|
9853
|
+
}
|
|
9895
9854
|
}
|
|
9896
|
-
return event;
|
|
9897
9855
|
};
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
if (this.
|
|
9901
|
-
|
|
9856
|
+
// Sets the value of instance.totalItems
|
|
9857
|
+
PaginationService.prototype.setTotalItems = function (id, totalItems) {
|
|
9858
|
+
if (this.instances[id] && 0 <= totalItems) {
|
|
9859
|
+
this.instances[id].totalItems = totalItems;
|
|
9860
|
+
this.change.next(id);
|
|
9902
9861
|
}
|
|
9903
|
-
|
|
9904
|
-
|
|
9862
|
+
};
|
|
9863
|
+
// Sets the value of instance.itemsPerPage.
|
|
9864
|
+
PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
|
|
9865
|
+
if (this.instances[id]) {
|
|
9866
|
+
this.instances[id].itemsPerPage = itemsPerPage;
|
|
9867
|
+
this.change.next(id);
|
|
9905
9868
|
}
|
|
9906
|
-
|
|
9907
|
-
|
|
9869
|
+
};
|
|
9870
|
+
/**
|
|
9871
|
+
* Returns a clone of the pagination instance object matching the id. If no
|
|
9872
|
+
* id specified, returns the instance corresponding to the default id.
|
|
9873
|
+
*/
|
|
9874
|
+
PaginationService.prototype.getInstance = function (id) {
|
|
9875
|
+
if (id === void 0) { id = PaginationService.DEFAULT_ID; }
|
|
9876
|
+
if (this.instances[id]) {
|
|
9877
|
+
return ObjectUtils.GetShallowClone(this.instances[id]);
|
|
9908
9878
|
}
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9879
|
+
return {};
|
|
9880
|
+
};
|
|
9881
|
+
/**
|
|
9882
|
+
* Check each property of the instance and update any that have changed. Return
|
|
9883
|
+
* true if any changes were made, else return false.
|
|
9884
|
+
*/
|
|
9885
|
+
PaginationService.prototype.updateInstance = function (instance) {
|
|
9886
|
+
var changed = false;
|
|
9887
|
+
for (var prop in this.instances[instance.id]) {
|
|
9888
|
+
if (instance[prop] !== this.instances[instance.id][prop]) {
|
|
9889
|
+
this.instances[instance.id][prop] = instance[prop];
|
|
9890
|
+
changed = true;
|
|
9915
9891
|
}
|
|
9916
9892
|
}
|
|
9893
|
+
return changed;
|
|
9917
9894
|
};
|
|
9918
|
-
|
|
9919
|
-
this._changeDetector.detectChanges();
|
|
9920
|
-
};
|
|
9921
|
-
return SimpleGridCellComponent;
|
|
9895
|
+
return PaginationService;
|
|
9922
9896
|
}());
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
template: "\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"editMode; else noInlineEdit\">\n <ng-container #editTemplate *ngIf=\"column.editTemplate; else noEditTemplate\"\n [ngTemplateOutlet]=\"column.editTemplate\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n <ng-template #noEditTemplate>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <co-input-text [(model)]=\"row[column.field]\" [required]=\"column.required\"></co-input-text>\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-template #noInlineEdit>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <span [textContent]=\"column.getFieldValue(row[column.field])\"></span>\n </ng-template>\n </ng-template>\n </div>\n ",
|
|
9927
|
-
encapsulation: core.ViewEncapsulation.None
|
|
9928
|
-
},] }
|
|
9897
|
+
PaginationService.DEFAULT_ID = "DEFAULT_PAGINATION_ID";
|
|
9898
|
+
PaginationService.decorators = [
|
|
9899
|
+
{ type: core.Injectable }
|
|
9929
9900
|
];
|
|
9930
|
-
|
|
9931
|
-
{ type: core.ChangeDetectorRef }
|
|
9932
|
-
]; };
|
|
9933
|
-
SimpleGridCellComponent.propDecorators = {
|
|
9934
|
-
editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
|
|
9935
|
-
noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
|
|
9936
|
-
noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
|
|
9937
|
-
column: [{ type: core.Input }],
|
|
9938
|
-
row: [{ type: core.Input }],
|
|
9939
|
-
editMode: [{ type: core.Input }],
|
|
9940
|
-
fieldEditMode: [{ type: core.Input }],
|
|
9941
|
-
cellClick: [{ type: core.Output }],
|
|
9942
|
-
showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
|
|
9943
|
-
handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
|
|
9944
|
-
};
|
|
9901
|
+
PaginationService.ctorParameters = function () { return []; };
|
|
9945
9902
|
|
|
9946
|
-
var
|
|
9947
|
-
function
|
|
9948
|
-
|
|
9949
|
-
this.
|
|
9950
|
-
this.
|
|
9951
|
-
this.
|
|
9952
|
-
this.
|
|
9903
|
+
var PaginationComponent = /** @class */ (function () {
|
|
9904
|
+
function PaginationComponent(_paginationService) {
|
|
9905
|
+
var _this = this;
|
|
9906
|
+
this._paginationService = _paginationService;
|
|
9907
|
+
this.maxSize = 7;
|
|
9908
|
+
this.directionLinks = true;
|
|
9909
|
+
this.previousLabel = 'Vorige pagina';
|
|
9910
|
+
this.nextLabel = 'Volgende pagina';
|
|
9911
|
+
this.autoHide = false;
|
|
9912
|
+
// Emits the new page number.
|
|
9913
|
+
this.pageChange = new core.EventEmitter();
|
|
9914
|
+
this.showClass = true;
|
|
9915
|
+
this.pages = [];
|
|
9916
|
+
this.changeSub = this._paginationService.change.subscribe(function (id) {
|
|
9917
|
+
if (_this.id === id) {
|
|
9918
|
+
_this._updatePageLinks();
|
|
9919
|
+
}
|
|
9920
|
+
});
|
|
9953
9921
|
}
|
|
9954
|
-
|
|
9955
|
-
this.
|
|
9922
|
+
PaginationComponent.prototype.ngOnInit = function () {
|
|
9923
|
+
if (!this.id) {
|
|
9924
|
+
this.id = this._paginationService.DEFAULT_ID;
|
|
9925
|
+
}
|
|
9926
|
+
this._updatePageLinks();
|
|
9956
9927
|
};
|
|
9957
|
-
|
|
9958
|
-
this.
|
|
9928
|
+
PaginationComponent.prototype.ngOnChanges = function () {
|
|
9929
|
+
this._updatePageLinks();
|
|
9959
9930
|
};
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9931
|
+
PaginationComponent.prototype.ngOnDestroy = function () {
|
|
9932
|
+
this.changeSub.unsubscribe();
|
|
9933
|
+
};
|
|
9934
|
+
PaginationComponent.prototype.goToFirstPage = function () {
|
|
9935
|
+
if (!this.isOnFirstPage()) {
|
|
9936
|
+
this.setCurrentPage(1);
|
|
9964
9937
|
}
|
|
9965
|
-
this._subject.next();
|
|
9966
|
-
this._subject.complete();
|
|
9967
9938
|
};
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
var observer = new IntersectionObserver(function (_a) {
|
|
9972
|
-
var _b = __read(_a, 1), entry = _b[0];
|
|
9973
|
-
resolve(entry.isIntersecting && entry.intersectionRatio >= _this.threshold);
|
|
9974
|
-
observer.disconnect();
|
|
9975
|
-
});
|
|
9976
|
-
observer.observe(element);
|
|
9977
|
-
});
|
|
9978
|
-
};
|
|
9979
|
-
ObserveVisibilityDirective.prototype._createObserver = function () {
|
|
9980
|
-
var _this = this;
|
|
9981
|
-
var options = {
|
|
9982
|
-
rootMargin: '0px',
|
|
9983
|
-
threshold: this.threshold,
|
|
9984
|
-
};
|
|
9985
|
-
var isIntersecting = function (entry) { return entry.isIntersecting || entry.intersectionRatio > 0; };
|
|
9986
|
-
this._observer = new IntersectionObserver(function (entries, observer) {
|
|
9987
|
-
entries.forEach(function (entry) {
|
|
9988
|
-
if (isIntersecting(entry)) {
|
|
9989
|
-
_this._subject.next({ entry: entry, observer: observer });
|
|
9990
|
-
}
|
|
9991
|
-
});
|
|
9992
|
-
}, options);
|
|
9993
|
-
};
|
|
9994
|
-
ObserveVisibilityDirective.prototype._startObservingElements = function () {
|
|
9995
|
-
var _this = this;
|
|
9996
|
-
if (!this._observer) {
|
|
9997
|
-
return;
|
|
9939
|
+
PaginationComponent.prototype.goToPreviousPage = function () {
|
|
9940
|
+
if (!this.isOnFirstPage()) {
|
|
9941
|
+
this.setCurrentPage(this.getCurrentPage() - 1);
|
|
9998
9942
|
}
|
|
9999
|
-
this._observer.observe(this._element.nativeElement);
|
|
10000
|
-
this._subject
|
|
10001
|
-
.pipe(operators.delay(this.debounceTime), operators.filter(Boolean))
|
|
10002
|
-
.subscribe(function (_a) {
|
|
10003
|
-
var entry = _a.entry, observer = _a.observer;
|
|
10004
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
10005
|
-
var target, isStillVisible;
|
|
10006
|
-
return __generator(this, function (_a) {
|
|
10007
|
-
switch (_a.label) {
|
|
10008
|
-
case 0:
|
|
10009
|
-
target = entry.target;
|
|
10010
|
-
return [4 /*yield*/, this._isVisible(target)];
|
|
10011
|
-
case 1:
|
|
10012
|
-
isStillVisible = _a.sent();
|
|
10013
|
-
if (isStillVisible) {
|
|
10014
|
-
this.visible.emit(target);
|
|
10015
|
-
observer.unobserve(target);
|
|
10016
|
-
}
|
|
10017
|
-
return [2 /*return*/];
|
|
10018
|
-
}
|
|
10019
|
-
});
|
|
10020
|
-
});
|
|
10021
|
-
});
|
|
10022
9943
|
};
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
selector: '[observeVisibility]',
|
|
10028
|
-
},] }
|
|
10029
|
-
];
|
|
10030
|
-
ObserveVisibilityDirective.ctorParameters = function () { return [
|
|
10031
|
-
{ type: core.ElementRef }
|
|
10032
|
-
]; };
|
|
10033
|
-
ObserveVisibilityDirective.propDecorators = {
|
|
10034
|
-
debounceTime: [{ type: core.Input }],
|
|
10035
|
-
threshold: [{ type: core.Input }],
|
|
10036
|
-
visible: [{ type: core.Output }]
|
|
10037
|
-
};
|
|
10038
|
-
|
|
10039
|
-
var ObserveVisibilityModule = /** @class */ (function () {
|
|
10040
|
-
function ObserveVisibilityModule() {
|
|
10041
|
-
}
|
|
10042
|
-
return ObserveVisibilityModule;
|
|
10043
|
-
}());
|
|
10044
|
-
ObserveVisibilityModule.decorators = [
|
|
10045
|
-
{ type: core.NgModule, args: [{
|
|
10046
|
-
declarations: [
|
|
10047
|
-
ObserveVisibilityDirective
|
|
10048
|
-
],
|
|
10049
|
-
exports: [
|
|
10050
|
-
ObserveVisibilityDirective
|
|
10051
|
-
]
|
|
10052
|
-
},] }
|
|
10053
|
-
];
|
|
10054
|
-
|
|
10055
|
-
var SimpleGridModule = /** @class */ (function () {
|
|
10056
|
-
function SimpleGridModule() {
|
|
10057
|
-
}
|
|
10058
|
-
return SimpleGridModule;
|
|
10059
|
-
}());
|
|
10060
|
-
SimpleGridModule.decorators = [
|
|
10061
|
-
{ type: core.NgModule, args: [{
|
|
10062
|
-
imports: [
|
|
10063
|
-
common.CommonModule,
|
|
10064
|
-
dragDrop.DragDropModule,
|
|
10065
|
-
GridToolbarModule,
|
|
10066
|
-
InputTextModule,
|
|
10067
|
-
FormModule,
|
|
10068
|
-
ObserveVisibilityModule
|
|
10069
|
-
],
|
|
10070
|
-
declarations: [
|
|
10071
|
-
SimpleGridComponent,
|
|
10072
|
-
SimpleGridCellComponent,
|
|
10073
|
-
SimpleGridColumnDirective
|
|
10074
|
-
],
|
|
10075
|
-
exports: [
|
|
10076
|
-
SimpleGridComponent,
|
|
10077
|
-
SimpleGridCellComponent,
|
|
10078
|
-
SimpleGridColumnDirective
|
|
10079
|
-
]
|
|
10080
|
-
},] }
|
|
10081
|
-
];
|
|
10082
|
-
|
|
10083
|
-
var FilterItemComponent = /** @class */ (function () {
|
|
10084
|
-
function FilterItemComponent(iconService) {
|
|
10085
|
-
this.iconService = iconService;
|
|
10086
|
-
this.icons = exports.CoreComponentsIcon;
|
|
10087
|
-
this.initialLimit = 10;
|
|
10088
|
-
this.expanded = false;
|
|
10089
|
-
// Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
|
|
10090
|
-
this.customContent = false;
|
|
10091
|
-
// Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
|
|
10092
|
-
this.showAllResults = false;
|
|
10093
|
-
this.singleSelect = false;
|
|
10094
|
-
this.searchPlaceholder = 'Search...';
|
|
10095
|
-
this.showMoreLabel = 'Show more';
|
|
10096
|
-
this.showLessLabel = 'Show less';
|
|
10097
|
-
this.noResultsLabel = "No results";
|
|
10098
|
-
this.collectionChange = new core.EventEmitter();
|
|
10099
|
-
this.filteredCollection = [];
|
|
10100
|
-
this.limitTo = 10;
|
|
10101
|
-
this.filterText = "";
|
|
10102
|
-
this._collection = [];
|
|
10103
|
-
}
|
|
10104
|
-
Object.defineProperty(FilterItemComponent.prototype, "collection", {
|
|
10105
|
-
get: function () {
|
|
10106
|
-
return this._collection;
|
|
10107
|
-
},
|
|
10108
|
-
set: function (value) {
|
|
10109
|
-
var _a;
|
|
10110
|
-
this._collection = value;
|
|
10111
|
-
this.filteredCollection = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.slice();
|
|
10112
|
-
},
|
|
10113
|
-
enumerable: false,
|
|
10114
|
-
configurable: true
|
|
10115
|
-
});
|
|
10116
|
-
FilterItemComponent.prototype.showClass = function () {
|
|
10117
|
-
return true;
|
|
9944
|
+
PaginationComponent.prototype.goToNextPage = function () {
|
|
9945
|
+
if (!this.isOnLastPage()) {
|
|
9946
|
+
this.setCurrentPage(this.getCurrentPage() + 1);
|
|
9947
|
+
}
|
|
10118
9948
|
};
|
|
10119
|
-
|
|
10120
|
-
this.
|
|
9949
|
+
PaginationComponent.prototype.setCurrentPage = function (page) {
|
|
9950
|
+
this.pageChange.emit(page);
|
|
10121
9951
|
};
|
|
10122
|
-
|
|
10123
|
-
this.
|
|
9952
|
+
PaginationComponent.prototype.isOnFirstPage = function () {
|
|
9953
|
+
return this.getCurrentPage() === 1;
|
|
10124
9954
|
};
|
|
10125
|
-
|
|
10126
|
-
this.
|
|
9955
|
+
PaginationComponent.prototype.isOnLastPage = function () {
|
|
9956
|
+
return this.getLastPage() === this.getCurrentPage();
|
|
10127
9957
|
};
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
if (this.showAllResults) {
|
|
9958
|
+
PaginationComponent.prototype.shouldBeHidden = function () {
|
|
9959
|
+
if (!this.autoHide) {
|
|
10131
9960
|
return false;
|
|
10132
9961
|
}
|
|
10133
|
-
|
|
9962
|
+
else {
|
|
9963
|
+
var instance = this._paginationService.getInstance();
|
|
9964
|
+
return (instance.totalItems <= instance.itemsPerPage);
|
|
9965
|
+
}
|
|
10134
9966
|
};
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
9967
|
+
/**
|
|
9968
|
+
* Updates the page links and checks that the current page is valid. Should run whenever the
|
|
9969
|
+
* PaginationService.change stream emits a value matching the current ID, or when any of the
|
|
9970
|
+
* input values changes.
|
|
9971
|
+
*/
|
|
9972
|
+
PaginationComponent.prototype._updatePageLinks = function () {
|
|
9973
|
+
var paginationInstance = this._paginationService.getInstance(this.id);
|
|
9974
|
+
this.pages = this.createPageArray(paginationInstance.currentPage, paginationInstance.itemsPerPage, paginationInstance.totalItems, this.maxSize);
|
|
9975
|
+
var correctedCurrentPage = this.outOfBoundCorrection(paginationInstance);
|
|
9976
|
+
if (correctedCurrentPage !== paginationInstance.currentPage) {
|
|
9977
|
+
this.setCurrentPage(correctedCurrentPage);
|
|
10139
9978
|
}
|
|
10140
|
-
return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) <= this.limitTo && ((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > this.initialLimit;
|
|
10141
9979
|
};
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
9980
|
+
PaginationComponent.prototype.getCurrentPage = function () {
|
|
9981
|
+
return this._paginationService.getCurrentPage(this.id);
|
|
9982
|
+
};
|
|
9983
|
+
PaginationComponent.prototype.getLastPage = function () {
|
|
9984
|
+
var instance = this._paginationService.getInstance(this.id);
|
|
9985
|
+
return Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
9986
|
+
};
|
|
9987
|
+
/**
|
|
9988
|
+
* Checks that the instance.currentPage property is within bounds for the current page range.
|
|
9989
|
+
* If not, return a correct value for currentPage, or the current value if OK.
|
|
9990
|
+
*/
|
|
9991
|
+
PaginationComponent.prototype.outOfBoundCorrection = function (instance) {
|
|
9992
|
+
var totalPages = Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
9993
|
+
if (totalPages < instance.currentPage && 0 < totalPages) {
|
|
9994
|
+
return totalPages;
|
|
9995
|
+
}
|
|
9996
|
+
else if (instance.currentPage < 1) {
|
|
9997
|
+
return 1;
|
|
9998
|
+
}
|
|
9999
|
+
return instance.currentPage;
|
|
10000
|
+
};
|
|
10001
|
+
// Returns an array of IPage objects to use in the pagination controls.
|
|
10002
|
+
PaginationComponent.prototype.createPageArray = function (currentPage, itemsPerPage, totalItems, paginationRange) {
|
|
10003
|
+
// paginationRange could be a string if passed from attribute, so cast to number.
|
|
10004
|
+
paginationRange = +paginationRange;
|
|
10005
|
+
var pages = [];
|
|
10006
|
+
var totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
10007
|
+
var halfWay = Math.ceil(paginationRange / 2);
|
|
10008
|
+
var isStart = currentPage <= halfWay;
|
|
10009
|
+
var isEnd = totalPages - halfWay < currentPage;
|
|
10010
|
+
var isMiddle = !isStart && !isEnd;
|
|
10011
|
+
var ellipsesNeeded = paginationRange < totalPages;
|
|
10012
|
+
var i = 1;
|
|
10013
|
+
while (i <= totalPages && i <= paginationRange) {
|
|
10014
|
+
var label = void 0;
|
|
10015
|
+
var pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages);
|
|
10016
|
+
var openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd));
|
|
10017
|
+
var closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart));
|
|
10018
|
+
if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
|
|
10019
|
+
label = '...';
|
|
10020
|
+
}
|
|
10021
|
+
else {
|
|
10022
|
+
label = '' + pageNumber;
|
|
10023
|
+
}
|
|
10024
|
+
pages.push({
|
|
10025
|
+
label: label,
|
|
10026
|
+
value: pageNumber
|
|
10148
10027
|
});
|
|
10028
|
+
i++;
|
|
10149
10029
|
}
|
|
10150
|
-
|
|
10151
|
-
this.collectionChange.emit(this.collection);
|
|
10030
|
+
return pages;
|
|
10152
10031
|
};
|
|
10153
|
-
//
|
|
10154
|
-
|
|
10155
|
-
var
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
return [2 /*return*/, []];
|
|
10177
|
-
}
|
|
10178
|
-
filterText = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
|
|
10179
|
-
filteredItemCount = 0;
|
|
10180
|
-
this.filteredCollection = (_b = this.collection) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
10181
|
-
var _a;
|
|
10182
|
-
var labelText = (_a = item.description) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
|
|
10183
|
-
var isHiddenByFilter = ((labelText === null || labelText === void 0 ? void 0 : labelText.indexOf(filterText)) === -1);
|
|
10184
|
-
if (isHiddenByFilter) {
|
|
10185
|
-
return false;
|
|
10186
|
-
}
|
|
10187
|
-
else {
|
|
10188
|
-
filteredItemCount++;
|
|
10189
|
-
return true;
|
|
10190
|
-
}
|
|
10191
|
-
});
|
|
10192
|
-
return [2 /*return*/];
|
|
10193
|
-
}
|
|
10194
|
-
});
|
|
10195
|
-
});
|
|
10032
|
+
// Given the position in the sequence of pagination links [i], figure out what page number corresponds to that position.
|
|
10033
|
+
PaginationComponent.prototype.calculatePageNumber = function (i, currentPage, paginationRange, totalPages) {
|
|
10034
|
+
var halfWay = Math.ceil(paginationRange / 2);
|
|
10035
|
+
if (i === paginationRange) {
|
|
10036
|
+
return totalPages;
|
|
10037
|
+
}
|
|
10038
|
+
else if (i === 1) {
|
|
10039
|
+
return i;
|
|
10040
|
+
}
|
|
10041
|
+
else if (paginationRange < totalPages) {
|
|
10042
|
+
if (totalPages - halfWay < currentPage) {
|
|
10043
|
+
return totalPages - paginationRange + i;
|
|
10044
|
+
}
|
|
10045
|
+
else if (halfWay < currentPage) {
|
|
10046
|
+
return currentPage - halfWay + i;
|
|
10047
|
+
}
|
|
10048
|
+
else {
|
|
10049
|
+
return i;
|
|
10050
|
+
}
|
|
10051
|
+
}
|
|
10052
|
+
else {
|
|
10053
|
+
return i;
|
|
10054
|
+
}
|
|
10196
10055
|
};
|
|
10197
|
-
return
|
|
10056
|
+
return PaginationComponent;
|
|
10198
10057
|
}());
|
|
10199
|
-
|
|
10058
|
+
PaginationComponent.decorators = [
|
|
10200
10059
|
{ type: core.Component, args: [{
|
|
10201
|
-
selector:
|
|
10202
|
-
template: "\n <div class=\"
|
|
10060
|
+
selector: 'co-pagination',
|
|
10061
|
+
template: "\n <div class=\"pagination-component-main-wrapper\" *ngIf=\"!shouldBeHidden()\">\n <div>\n <ng-content></ng-content>\n </div>\n <ul class=\"pagination\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\">\n <a (click)=\"goToPreviousPage()\" [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"getCurrentPage() === page.value\" (click)=\"setCurrentPage(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\">\n <a (click)=\"goToNextPage()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n </div>\n ",
|
|
10203
10062
|
encapsulation: core.ViewEncapsulation.None
|
|
10204
10063
|
},] }
|
|
10205
10064
|
];
|
|
10206
|
-
|
|
10207
|
-
{ type:
|
|
10065
|
+
PaginationComponent.ctorParameters = function () { return [
|
|
10066
|
+
{ type: PaginationService }
|
|
10208
10067
|
]; };
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
searchPlaceholder: [{ type: core.Input }],
|
|
10220
|
-
showMoreLabel: [{ type: core.Input }],
|
|
10221
|
-
showLessLabel: [{ type: core.Input }],
|
|
10222
|
-
noResultsLabel: [{ type: core.Input }],
|
|
10223
|
-
collectionChange: [{ type: core.Output }],
|
|
10224
|
-
showClass: [{ type: core.HostBinding, args: ["class.co-filter-item",] }]
|
|
10068
|
+
PaginationComponent.propDecorators = {
|
|
10069
|
+
template: [{ type: core.ViewChild, args: ['template',] }],
|
|
10070
|
+
id: [{ type: core.Input }],
|
|
10071
|
+
maxSize: [{ type: core.Input }],
|
|
10072
|
+
directionLinks: [{ type: core.Input }],
|
|
10073
|
+
previousLabel: [{ type: core.Input }],
|
|
10074
|
+
nextLabel: [{ type: core.Input }],
|
|
10075
|
+
autoHide: [{ type: core.Input }],
|
|
10076
|
+
pageChange: [{ type: core.Output }],
|
|
10077
|
+
showClass: [{ type: core.HostBinding, args: ['class.co-pagination',] }]
|
|
10225
10078
|
};
|
|
10226
10079
|
|
|
10227
|
-
|
|
10228
|
-
var
|
|
10229
|
-
function
|
|
10080
|
+
var LARGE_NUMBER = 999999999;
|
|
10081
|
+
var PaginatePipe = /** @class */ (function () {
|
|
10082
|
+
function PaginatePipe(paginateService) {
|
|
10083
|
+
this.paginateService = paginateService;
|
|
10084
|
+
// store the values from the last time the pipe
|
|
10085
|
+
this.state = {};
|
|
10230
10086
|
}
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10087
|
+
PaginatePipe.prototype.transform = function (collection, args) {
|
|
10088
|
+
// When an observable is passed through the AsyncPipe, it will output
|
|
10089
|
+
// `null` until the subscription resolves. In this case, we want to
|
|
10090
|
+
// use the cached data from the `state` object to prevent the NgFor
|
|
10091
|
+
// from flashing empty until the real values arrive.
|
|
10092
|
+
if (!(collection instanceof Array)) {
|
|
10093
|
+
var _id = args.id || this.paginateService.DEFAULT_ID;
|
|
10094
|
+
if (this.state[_id]) {
|
|
10095
|
+
return this.state[_id].slice;
|
|
10096
|
+
}
|
|
10097
|
+
else {
|
|
10098
|
+
return collection;
|
|
10099
|
+
}
|
|
10234
10100
|
}
|
|
10235
|
-
|
|
10236
|
-
|
|
10101
|
+
var serverSideMode = args.totalItems !== undefined;
|
|
10102
|
+
var instance = this._createInstance(collection, args);
|
|
10103
|
+
var id = instance.id;
|
|
10104
|
+
var start;
|
|
10105
|
+
var end;
|
|
10106
|
+
var perPage = instance.itemsPerPage;
|
|
10107
|
+
this.paginateService.register(instance);
|
|
10108
|
+
if (!serverSideMode && collection instanceof Array) {
|
|
10109
|
+
perPage = perPage || LARGE_NUMBER;
|
|
10110
|
+
start = (instance.currentPage - 1) * perPage;
|
|
10111
|
+
end = start + perPage;
|
|
10112
|
+
var isIdentical = this._stateIsIdentical(id, collection, start, end);
|
|
10113
|
+
if (isIdentical) {
|
|
10114
|
+
return this.state[id].slice;
|
|
10115
|
+
}
|
|
10116
|
+
else {
|
|
10117
|
+
var slice = collection.slice(start, end);
|
|
10118
|
+
this._saveState(id, collection, slice, start, end);
|
|
10119
|
+
this.paginateService.change.next(id);
|
|
10120
|
+
return slice;
|
|
10121
|
+
}
|
|
10237
10122
|
}
|
|
10238
|
-
|
|
10123
|
+
// save the state for server-side collection to avoid null
|
|
10124
|
+
// flash as new data loads.
|
|
10125
|
+
this._saveState(id, collection, collection, start, end);
|
|
10126
|
+
return collection;
|
|
10239
10127
|
};
|
|
10240
|
-
|
|
10241
|
-
|
|
10242
|
-
|
|
10243
|
-
|
|
10244
|
-
|
|
10245
|
-
|
|
10246
|
-
|
|
10247
|
-
|
|
10248
|
-
|
|
10249
|
-
|
|
10128
|
+
// Create an IPaginationInstance object, using defaults for any optional properties not supplied.
|
|
10129
|
+
PaginatePipe.prototype._createInstance = function (collection, args) {
|
|
10130
|
+
var config = args;
|
|
10131
|
+
this._checkConfig(config);
|
|
10132
|
+
return {
|
|
10133
|
+
id: config.id || this.paginateService.DEFAULT_ID,
|
|
10134
|
+
itemsPerPage: config.itemsPerPage || 0,
|
|
10135
|
+
currentPage: config.currentPage || 1,
|
|
10136
|
+
totalItems: config.totalItems || collection.length
|
|
10137
|
+
};
|
|
10138
|
+
};
|
|
10139
|
+
// Ensure the argument passed to the filter contains the required properties.
|
|
10140
|
+
PaginatePipe.prototype._checkConfig = function (config) {
|
|
10141
|
+
var required = ["itemsPerPage", "currentPage"];
|
|
10142
|
+
var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); });
|
|
10143
|
+
if (0 < missing.length) {
|
|
10144
|
+
throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(", "));
|
|
10145
|
+
}
|
|
10146
|
+
};
|
|
10147
|
+
/**
|
|
10148
|
+
* To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
|
|
10149
|
+
* array for a given id. This means that the next time the pipe is run on this collection & id, we just
|
|
10150
|
+
* need to check that the collection, start and end points are all identical, and if so, return the
|
|
10151
|
+
* last sliced array.
|
|
10152
|
+
*/
|
|
10153
|
+
PaginatePipe.prototype._saveState = function (id, collection, slice, start, end) {
|
|
10154
|
+
this.state[id] = {
|
|
10155
|
+
collection: collection,
|
|
10156
|
+
size: collection.length,
|
|
10157
|
+
slice: slice,
|
|
10158
|
+
start: start,
|
|
10159
|
+
end: end
|
|
10160
|
+
};
|
|
10161
|
+
};
|
|
10162
|
+
// For a given id, returns true if the collection, size, start and end values are identical.
|
|
10163
|
+
PaginatePipe.prototype._stateIsIdentical = function (id, collection, start, end) {
|
|
10164
|
+
var state = this.state[id];
|
|
10165
|
+
if (!state) {
|
|
10166
|
+
return false;
|
|
10167
|
+
}
|
|
10168
|
+
return state.collection === collection &&
|
|
10169
|
+
state.size === collection.length &&
|
|
10170
|
+
state.start === start &&
|
|
10171
|
+
state.end === end;
|
|
10172
|
+
};
|
|
10173
|
+
return PaginatePipe;
|
|
10250
10174
|
}());
|
|
10251
|
-
|
|
10252
|
-
{ type: core.
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
],
|
|
10256
|
-
exports: [
|
|
10257
|
-
PrependPipe
|
|
10258
|
-
]
|
|
10175
|
+
PaginatePipe.decorators = [
|
|
10176
|
+
{ type: core.Pipe, args: [{
|
|
10177
|
+
name: 'paginate',
|
|
10178
|
+
pure: false
|
|
10259
10179
|
},] }
|
|
10260
|
-
];
|
|
10180
|
+
];
|
|
10181
|
+
PaginatePipe.ctorParameters = function () { return [
|
|
10182
|
+
{ type: PaginationService }
|
|
10183
|
+
]; };
|
|
10261
10184
|
|
|
10262
|
-
var
|
|
10263
|
-
function
|
|
10185
|
+
var PaginationModule = /** @class */ (function () {
|
|
10186
|
+
function PaginationModule() {
|
|
10264
10187
|
}
|
|
10265
|
-
return
|
|
10188
|
+
return PaginationModule;
|
|
10266
10189
|
}());
|
|
10267
|
-
|
|
10190
|
+
PaginationModule.decorators = [
|
|
10268
10191
|
{ type: core.NgModule, args: [{
|
|
10269
10192
|
imports: [
|
|
10270
|
-
common.CommonModule
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
InputCheckboxModule,
|
|
10275
|
-
IconModule,
|
|
10276
|
-
scrolling.ScrollingModule,
|
|
10277
|
-
AppendPipeModule,
|
|
10278
|
-
PrependPipeModule,
|
|
10279
|
-
InputTextModule,
|
|
10280
|
-
InputRadioButtonModule
|
|
10193
|
+
common.CommonModule
|
|
10194
|
+
],
|
|
10195
|
+
providers: [
|
|
10196
|
+
PaginationService
|
|
10281
10197
|
],
|
|
10282
10198
|
declarations: [
|
|
10283
|
-
|
|
10199
|
+
PaginationComponent,
|
|
10200
|
+
PaginatePipe
|
|
10284
10201
|
],
|
|
10285
10202
|
exports: [
|
|
10286
|
-
|
|
10203
|
+
PaginationComponent,
|
|
10204
|
+
PaginatePipe
|
|
10287
10205
|
]
|
|
10288
10206
|
},] }
|
|
10289
10207
|
];
|
|
10290
10208
|
|
|
10291
|
-
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
|
|
10298
|
-
|
|
10299
|
-
KeyboardKey["Escape"] = "Escape";
|
|
10300
|
-
KeyboardKey["Enter"] = "Enter";
|
|
10301
|
-
KeyboardKey["Home"] = "Home";
|
|
10302
|
-
KeyboardKey["End"] = "End";
|
|
10303
|
-
KeyboardKey["Delete"] = "Delete";
|
|
10304
|
-
KeyboardKey["Insert"] = "Insert";
|
|
10305
|
-
KeyboardKey["ShiftLeft"] = "ShiftLeft";
|
|
10306
|
-
KeyboardKey["ShiftRight"] = "ShiftRight";
|
|
10307
|
-
KeyboardKey["Backspace"] = "Backspace";
|
|
10308
|
-
KeyboardKey["SpaceBar"] = "Space";
|
|
10309
|
-
KeyboardKey["Period"] = "Period";
|
|
10310
|
-
KeyboardKey["DecimalPoint"] = "NumpadDecimal";
|
|
10311
|
-
KeyboardKey["SemiColon"] = "Semicolon";
|
|
10312
|
-
KeyboardKey["ControlRight"] = "ControlRight";
|
|
10313
|
-
KeyboardKey["ControlLeft"] = "ControlLeft";
|
|
10314
|
-
KeyboardKey["Comma"] = "Comma";
|
|
10315
|
-
////Minus,
|
|
10316
|
-
////MinusFireFox,
|
|
10317
|
-
////Substract,
|
|
10318
|
-
KeyboardKey["Zero"] = "Digit0";
|
|
10319
|
-
KeyboardKey["One"] = "Digit1";
|
|
10320
|
-
KeyboardKey["Two"] = "Digit2";
|
|
10321
|
-
KeyboardKey["Three"] = "Digit3";
|
|
10322
|
-
KeyboardKey["Four"] = "Digit4";
|
|
10323
|
-
KeyboardKey["Five"] = "Digit5";
|
|
10324
|
-
KeyboardKey["Six"] = "Digit6";
|
|
10325
|
-
KeyboardKey["Seven"] = "Digit7";
|
|
10326
|
-
KeyboardKey["Eight"] = "Digit8";
|
|
10327
|
-
KeyboardKey["Nine"] = "Digit9";
|
|
10328
|
-
KeyboardKey["NumpadZero"] = "Numpad0";
|
|
10329
|
-
KeyboardKey["NumpadOne"] = "Numpad1";
|
|
10330
|
-
KeyboardKey["NumpadTwo"] = "Numpad2";
|
|
10331
|
-
KeyboardKey["NumpadThree"] = "Numpad3";
|
|
10332
|
-
KeyboardKey["NumpadFour"] = "Numpad4";
|
|
10333
|
-
KeyboardKey["NumpadFive"] = "Numpad5";
|
|
10334
|
-
KeyboardKey["NumpadSix"] = "Numpad6";
|
|
10335
|
-
KeyboardKey["NumpadSeven"] = "Numpad7";
|
|
10336
|
-
KeyboardKey["NumpadEight"] = "Numpad8";
|
|
10337
|
-
KeyboardKey["NumpadNine"] = "Numpad9";
|
|
10338
|
-
KeyboardKey["A"] = "KeyA";
|
|
10339
|
-
KeyboardKey["B"] = "KeyB";
|
|
10340
|
-
KeyboardKey["C"] = "KeyC";
|
|
10341
|
-
KeyboardKey["D"] = "KeyD";
|
|
10342
|
-
KeyboardKey["E"] = "KeyE";
|
|
10343
|
-
KeyboardKey["F"] = "KeyF";
|
|
10344
|
-
KeyboardKey["G"] = "KeyG";
|
|
10345
|
-
KeyboardKey["H"] = "KeyH";
|
|
10346
|
-
KeyboardKey["I"] = "KeyI";
|
|
10347
|
-
KeyboardKey["J"] = "KeyJ";
|
|
10348
|
-
KeyboardKey["K"] = "KeyK";
|
|
10349
|
-
KeyboardKey["L"] = "KeyL";
|
|
10350
|
-
KeyboardKey["M"] = "KeyM";
|
|
10351
|
-
KeyboardKey["N"] = "KeyN";
|
|
10352
|
-
KeyboardKey["O"] = "KeyO";
|
|
10353
|
-
KeyboardKey["P"] = "KeyP";
|
|
10354
|
-
KeyboardKey["Q"] = "KeyQ";
|
|
10355
|
-
KeyboardKey["R"] = "KeyR";
|
|
10356
|
-
KeyboardKey["S"] = "KeyS";
|
|
10357
|
-
KeyboardKey["T"] = "KeyT";
|
|
10358
|
-
KeyboardKey["U"] = "KeyU";
|
|
10359
|
-
KeyboardKey["V"] = "KeyV";
|
|
10360
|
-
KeyboardKey["W"] = "KeyW";
|
|
10361
|
-
KeyboardKey["X"] = "KeyX";
|
|
10362
|
-
KeyboardKey["Y"] = "KeyY";
|
|
10363
|
-
KeyboardKey["Z"] = "KeyZ";
|
|
10364
|
-
})(KeyboardKey || (KeyboardKey = {}));
|
|
10365
|
-
|
|
10366
|
-
var ClickOutsideMasterService = /** @class */ (function () {
|
|
10367
|
-
function ClickOutsideMasterService(_ngZone) {
|
|
10368
|
-
var _this = this;
|
|
10369
|
-
this._ngZone = _ngZone;
|
|
10370
|
-
this._clickOutsideRefs = [];
|
|
10371
|
-
this.onClick = function (event) {
|
|
10372
|
-
_this._currentClick = event;
|
|
10373
|
-
var first = _this._clickOutsideRefs[0];
|
|
10374
|
-
var targets = _this._clickOutsideRefs.filter(function (co) { return co.alwaysTrigger; });
|
|
10375
|
-
if (first) {
|
|
10376
|
-
targets.push(first);
|
|
10377
|
-
}
|
|
10378
|
-
setTimeout(function () {
|
|
10379
|
-
targets.forEach(function (clickOutside) { return _this.checkEmit(clickOutside, event); });
|
|
10380
|
-
});
|
|
10381
|
-
};
|
|
10382
|
-
this.onKeyDown = function (event) {
|
|
10383
|
-
if (event.key === KeyboardKey.Escape) {
|
|
10384
|
-
var first = _this._clickOutsideRefs[0];
|
|
10385
|
-
if (first) {
|
|
10386
|
-
_this.checkEmit(first, event, true);
|
|
10387
|
-
}
|
|
10388
|
-
}
|
|
10389
|
-
};
|
|
10390
|
-
document.addEventListener('click', this.onClick, true);
|
|
10391
|
-
window.addEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
|
|
10209
|
+
var SimpleGridCellComponent = /** @class */ (function () {
|
|
10210
|
+
function SimpleGridCellComponent(_changeDetector) {
|
|
10211
|
+
this._changeDetector = _changeDetector;
|
|
10212
|
+
this.defaultTextAlign = exports.ColumnAlign.Left;
|
|
10213
|
+
this.editMode = false;
|
|
10214
|
+
this.cellClick = new core.EventEmitter();
|
|
10215
|
+
this._fieldEditMode = false;
|
|
10216
|
+
this._focused = false;
|
|
10392
10217
|
}
|
|
10393
|
-
Object.defineProperty(
|
|
10394
|
-
|
|
10395
|
-
|
|
10218
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "editTemplateContent", {
|
|
10219
|
+
set: function (template) {
|
|
10220
|
+
if (template) {
|
|
10221
|
+
this._editTemplate = template;
|
|
10222
|
+
this._setFocusComponent();
|
|
10223
|
+
}
|
|
10396
10224
|
},
|
|
10397
10225
|
enumerable: false,
|
|
10398
10226
|
configurable: true
|
|
10399
10227
|
});
|
|
10400
|
-
|
|
10401
|
-
|
|
10402
|
-
|
|
10403
|
-
|
|
10404
|
-
|
|
10405
|
-
if (clickOutside && (clickOutside.currentClick !== this.currentClick || force) && this._clickOutsideRefs.indexOf(clickOutside) !== -1) {
|
|
10406
|
-
this._ngZone.run(function () { return clickOutside.clickOutside.emit(event); });
|
|
10407
|
-
}
|
|
10408
|
-
};
|
|
10409
|
-
ClickOutsideMasterService.prototype.addClickOutside = function (clickOutside) {
|
|
10410
|
-
this.removeClickOutside(clickOutside);
|
|
10411
|
-
this._clickOutsideRefs.unshift(clickOutside);
|
|
10412
|
-
};
|
|
10413
|
-
ClickOutsideMasterService.prototype.removeClickOutside = function (clickOutside) {
|
|
10414
|
-
ArrayUtils.RemoveElement(clickOutside, this._clickOutsideRefs);
|
|
10415
|
-
};
|
|
10416
|
-
return ClickOutsideMasterService;
|
|
10417
|
-
}());
|
|
10418
|
-
ClickOutsideMasterService.decorators = [
|
|
10419
|
-
{ type: core.Injectable }
|
|
10420
|
-
];
|
|
10421
|
-
ClickOutsideMasterService.ctorParameters = function () { return [
|
|
10422
|
-
{ type: core.NgZone }
|
|
10423
|
-
]; };
|
|
10424
|
-
|
|
10425
|
-
var ClickOutsideDirective = /** @class */ (function () {
|
|
10426
|
-
function ClickOutsideDirective(elementRef, _ngZone, _master) {
|
|
10427
|
-
var _this = this;
|
|
10428
|
-
this.elementRef = elementRef;
|
|
10429
|
-
this._ngZone = _ngZone;
|
|
10430
|
-
this._master = _master;
|
|
10431
|
-
this.clickOutside = new core.EventEmitter();
|
|
10432
|
-
this._enabled = true;
|
|
10433
|
-
this._initialized = false;
|
|
10434
|
-
this.onClick = function (event) {
|
|
10435
|
-
if (_this._enabled) {
|
|
10436
|
-
_this._currentClick = event;
|
|
10228
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "noEditTemplateContent", {
|
|
10229
|
+
set: function (template) {
|
|
10230
|
+
if (template) {
|
|
10231
|
+
this._template = template;
|
|
10232
|
+
this._setFocusComponent();
|
|
10437
10233
|
}
|
|
10438
|
-
};
|
|
10439
|
-
}
|
|
10440
|
-
Object.defineProperty(ClickOutsideDirective.prototype, "currentClick", {
|
|
10441
|
-
get: function () {
|
|
10442
|
-
return this._currentClick;
|
|
10443
10234
|
},
|
|
10444
10235
|
enumerable: false,
|
|
10445
10236
|
configurable: true
|
|
10446
10237
|
});
|
|
10447
|
-
Object.defineProperty(
|
|
10448
|
-
set: function (
|
|
10449
|
-
|
|
10450
|
-
|
|
10451
|
-
|
|
10452
|
-
this._enabled = enabled;
|
|
10453
|
-
if (this._initialized) {
|
|
10454
|
-
this._enabled ? this._master.addClickOutside(this) : this._master.removeClickOutside(this);
|
|
10455
|
-
}
|
|
10238
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "noTemplateContent", {
|
|
10239
|
+
set: function (template) {
|
|
10240
|
+
if (template) {
|
|
10241
|
+
this._inputTemplate = template;
|
|
10242
|
+
this._setFocusComponent();
|
|
10456
10243
|
}
|
|
10457
10244
|
},
|
|
10458
10245
|
enumerable: false,
|
|
10459
10246
|
configurable: true
|
|
10460
10247
|
});
|
|
10461
|
-
|
|
10462
|
-
var _this = this;
|
|
10463
|
-
setTimeout(function () {
|
|
10464
|
-
_this._ngZone.runOutsideAngular(function () {
|
|
10465
|
-
if (_this.elementRef && _this.elementRef.nativeElement) {
|
|
10466
|
-
_this.elementRef.nativeElement.addEventListener('click', _this.onClick, EventUtils.passiveCapture);
|
|
10467
|
-
if (_this._enabled) {
|
|
10468
|
-
_this._master.addClickOutside(_this);
|
|
10469
|
-
}
|
|
10470
|
-
_this._initialized = true;
|
|
10471
|
-
}
|
|
10472
|
-
});
|
|
10473
|
-
});
|
|
10474
|
-
};
|
|
10475
|
-
ClickOutsideDirective.prototype.ngOnDestroy = function () {
|
|
10476
|
-
this._master.removeClickOutside(this);
|
|
10477
|
-
this.elementRef.nativeElement.removeEventListener('click', this.onClick, EventUtils.passiveCapture);
|
|
10478
|
-
this.elementRef = undefined;
|
|
10479
|
-
};
|
|
10480
|
-
return ClickOutsideDirective;
|
|
10481
|
-
}());
|
|
10482
|
-
ClickOutsideDirective.decorators = [
|
|
10483
|
-
{ type: core.Directive, args: [{
|
|
10484
|
-
selector: "[clickOutside]",
|
|
10485
|
-
exportAs: 'clickOutside'
|
|
10486
|
-
},] }
|
|
10487
|
-
];
|
|
10488
|
-
ClickOutsideDirective.ctorParameters = function () { return [
|
|
10489
|
-
{ type: core.ElementRef },
|
|
10490
|
-
{ type: core.NgZone },
|
|
10491
|
-
{ type: ClickOutsideMasterService }
|
|
10492
|
-
]; };
|
|
10493
|
-
ClickOutsideDirective.propDecorators = {
|
|
10494
|
-
enabled: [{ type: core.Input, args: ["clickOutside",] }],
|
|
10495
|
-
alwaysTrigger: [{ type: core.Input }],
|
|
10496
|
-
clickOutside: [{ type: core.Output }]
|
|
10497
|
-
};
|
|
10498
|
-
__decorate([
|
|
10499
|
-
InputBoolean()
|
|
10500
|
-
], ClickOutsideDirective.prototype, "alwaysTrigger", void 0);
|
|
10501
|
-
|
|
10502
|
-
var ClickoutsideModule = /** @class */ (function () {
|
|
10503
|
-
function ClickoutsideModule() {
|
|
10504
|
-
}
|
|
10505
|
-
return ClickoutsideModule;
|
|
10506
|
-
}());
|
|
10507
|
-
ClickoutsideModule.decorators = [
|
|
10508
|
-
{ type: core.NgModule, args: [{
|
|
10509
|
-
declarations: [
|
|
10510
|
-
ClickOutsideDirective
|
|
10511
|
-
],
|
|
10512
|
-
providers: [
|
|
10513
|
-
ClickOutsideMasterService
|
|
10514
|
-
],
|
|
10515
|
-
exports: [
|
|
10516
|
-
ClickOutsideDirective
|
|
10517
|
-
]
|
|
10518
|
-
},] }
|
|
10519
|
-
];
|
|
10520
|
-
|
|
10521
|
-
var PaginationService = /** @class */ (function () {
|
|
10522
|
-
function PaginationService() {
|
|
10523
|
-
this.change = new rxjs.Subject();
|
|
10524
|
-
this.instances = {};
|
|
10525
|
-
}
|
|
10526
|
-
Object.defineProperty(PaginationService.prototype, "DEFAULT_ID", {
|
|
10248
|
+
Object.defineProperty(SimpleGridCellComponent.prototype, "fieldEditMode", {
|
|
10527
10249
|
get: function () {
|
|
10528
|
-
return
|
|
10250
|
+
return this._fieldEditMode;
|
|
10251
|
+
},
|
|
10252
|
+
set: function (value) {
|
|
10253
|
+
this._fieldEditMode = value;
|
|
10254
|
+
this._setFocusComponent();
|
|
10529
10255
|
},
|
|
10530
10256
|
enumerable: false,
|
|
10531
10257
|
configurable: true
|
|
10532
10258
|
});
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
if (!this.
|
|
10538
|
-
this.
|
|
10539
|
-
this.change.next(instance.id);
|
|
10259
|
+
SimpleGridCellComponent.prototype.showClass = function () {
|
|
10260
|
+
return true;
|
|
10261
|
+
};
|
|
10262
|
+
SimpleGridCellComponent.prototype.handleClick = function (event) {
|
|
10263
|
+
if (this.column && !this.column.readonly) {
|
|
10264
|
+
this.cellClick.next();
|
|
10540
10265
|
}
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10266
|
+
};
|
|
10267
|
+
SimpleGridCellComponent.prototype._setFocusComponent = function () {
|
|
10268
|
+
if (this.editMode && this.fieldEditMode) {
|
|
10269
|
+
var element = this._getElement();
|
|
10270
|
+
if (element) {
|
|
10271
|
+
var focusEvent = this._createNewEvent(element, 'focus');
|
|
10272
|
+
element.focus();
|
|
10273
|
+
element.dispatchEvent(focusEvent);
|
|
10274
|
+
this._focused = true;
|
|
10545
10275
|
}
|
|
10546
10276
|
}
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10277
|
+
else {
|
|
10278
|
+
if (this._focused) {
|
|
10279
|
+
var element = this._getElement();
|
|
10280
|
+
if (element) {
|
|
10281
|
+
var blurEvent = this._createNewEvent(element, 'blur');
|
|
10282
|
+
element.blur();
|
|
10283
|
+
element.dispatchEvent(blurEvent);
|
|
10284
|
+
}
|
|
10285
|
+
this._focused = false;
|
|
10286
|
+
}
|
|
10552
10287
|
}
|
|
10288
|
+
this._detectChanges();
|
|
10553
10289
|
};
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
var
|
|
10558
|
-
|
|
10559
|
-
if (
|
|
10560
|
-
|
|
10561
|
-
this.change.next(id);
|
|
10290
|
+
SimpleGridCellComponent.prototype._getFirstFormInput = function (parent) {
|
|
10291
|
+
if (parent) {
|
|
10292
|
+
var collection_1 = Array.from(parent.getElementsByTagName('input'));
|
|
10293
|
+
var otherCollection = Array.from(parent.getElementsByTagName('textarea'));
|
|
10294
|
+
otherCollection.map(function (o) { return collection_1.push(o); });
|
|
10295
|
+
if (collection_1.length > 0) {
|
|
10296
|
+
return collection_1[0];
|
|
10562
10297
|
}
|
|
10563
10298
|
}
|
|
10564
10299
|
};
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
if (
|
|
10568
|
-
|
|
10569
|
-
|
|
10300
|
+
SimpleGridCellComponent.prototype._createNewEvent = function (element, eventType) {
|
|
10301
|
+
var event;
|
|
10302
|
+
if ("createEvent" in document) {
|
|
10303
|
+
event = document.createEvent("Event");
|
|
10304
|
+
event.initEvent(eventType, true, true);
|
|
10570
10305
|
}
|
|
10571
|
-
|
|
10572
|
-
|
|
10573
|
-
PaginationService.prototype.setItemsPerPage = function (id, itemsPerPage) {
|
|
10574
|
-
if (this.instances[id]) {
|
|
10575
|
-
this.instances[id].itemsPerPage = itemsPerPage;
|
|
10576
|
-
this.change.next(id);
|
|
10306
|
+
else if ("Event" in window) {
|
|
10307
|
+
event = new Event(eventType, { bubbles: true, cancelable: true });
|
|
10577
10308
|
}
|
|
10309
|
+
return event;
|
|
10578
10310
|
};
|
|
10579
|
-
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
|
|
10583
|
-
PaginationService.prototype.getInstance = function (id) {
|
|
10584
|
-
if (id === void 0) { id = PaginationService.DEFAULT_ID; }
|
|
10585
|
-
if (this.instances[id]) {
|
|
10586
|
-
return ObjectUtils.GetShallowClone(this.instances[id]);
|
|
10311
|
+
SimpleGridCellComponent.prototype._getElement = function () {
|
|
10312
|
+
var templ;
|
|
10313
|
+
if (this._editTemplate) {
|
|
10314
|
+
templ = this._editTemplate;
|
|
10587
10315
|
}
|
|
10588
|
-
|
|
10589
|
-
|
|
10590
|
-
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
|
|
10594
|
-
|
|
10595
|
-
|
|
10596
|
-
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
|
|
10316
|
+
else if (this._template) {
|
|
10317
|
+
templ = this._template;
|
|
10318
|
+
}
|
|
10319
|
+
else {
|
|
10320
|
+
templ = this._inputTemplate;
|
|
10321
|
+
}
|
|
10322
|
+
if (templ) {
|
|
10323
|
+
if (templ && templ.elementRef) {
|
|
10324
|
+
var inputElement = this._getFirstFormInput(templ.elementRef.nativeElement.parentElement);
|
|
10325
|
+
if (inputElement) {
|
|
10326
|
+
return inputElement;
|
|
10327
|
+
}
|
|
10600
10328
|
}
|
|
10601
10329
|
}
|
|
10602
|
-
return changed;
|
|
10603
10330
|
};
|
|
10604
|
-
|
|
10331
|
+
SimpleGridCellComponent.prototype._detectChanges = function () {
|
|
10332
|
+
this._changeDetector.detectChanges();
|
|
10333
|
+
};
|
|
10334
|
+
return SimpleGridCellComponent;
|
|
10605
10335
|
}());
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10336
|
+
SimpleGridCellComponent.decorators = [
|
|
10337
|
+
{ type: core.Component, args: [{
|
|
10338
|
+
selector: "co-simple-grid-cell",
|
|
10339
|
+
template: "\n <div class=\"simple-grid-column-cell-value\" [ngClass]=\"column.textAlign ? column.textAlign : defaultTextAlign\">\n <ng-container *ngIf=\"editMode; else noInlineEdit\">\n <ng-container #editTemplate *ngIf=\"column.editTemplate; else noEditTemplate\"\n [ngTemplateOutlet]=\"column.editTemplate\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n <ng-template #noEditTemplate>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <co-input-text [(model)]=\"row[column.field]\" [required]=\"column.required\"></co-input-text>\n </ng-template>\n </ng-template>\n </ng-container>\n <ng-template #noInlineEdit>\n <ng-container *ngIf=\"column.template; else noTemplate\">\n <ng-container [ngTemplateOutlet]=\"column.template\"\n [ngTemplateOutletContext]=\"{value: row[column.field], row: row}\"></ng-container>\n </ng-container>\n <ng-template #noTemplate>\n <span [textContent]=\"column.getFieldValue(row[column.field])\"></span>\n </ng-template>\n </ng-template>\n </div>\n ",
|
|
10340
|
+
encapsulation: core.ViewEncapsulation.None
|
|
10341
|
+
},] }
|
|
10609
10342
|
];
|
|
10610
|
-
|
|
10343
|
+
SimpleGridCellComponent.ctorParameters = function () { return [
|
|
10344
|
+
{ type: core.ChangeDetectorRef }
|
|
10345
|
+
]; };
|
|
10346
|
+
SimpleGridCellComponent.propDecorators = {
|
|
10347
|
+
editTemplateContent: [{ type: core.ViewChild, args: ["editTemplate", { read: BaseInputComponent },] }],
|
|
10348
|
+
noEditTemplateContent: [{ type: core.ViewChild, args: ["noEditTemplate",] }],
|
|
10349
|
+
noTemplateContent: [{ type: core.ViewChild, args: ["noTemplate",] }],
|
|
10350
|
+
column: [{ type: core.Input }],
|
|
10351
|
+
row: [{ type: core.Input }],
|
|
10352
|
+
editMode: [{ type: core.Input }],
|
|
10353
|
+
fieldEditMode: [{ type: core.Input }],
|
|
10354
|
+
cellClick: [{ type: core.Output }],
|
|
10355
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-simple-grid-cell",] }],
|
|
10356
|
+
handleClick: [{ type: core.HostListener, args: ['click', ['$event'],] }]
|
|
10357
|
+
};
|
|
10611
10358
|
|
|
10612
|
-
var
|
|
10613
|
-
function
|
|
10614
|
-
|
|
10615
|
-
this.
|
|
10616
|
-
this.
|
|
10617
|
-
this.
|
|
10618
|
-
this.
|
|
10619
|
-
this.nextLabel = 'Volgende pagina';
|
|
10620
|
-
this.autoHide = false;
|
|
10621
|
-
// Emits the new page number.
|
|
10622
|
-
this.pageChange = new core.EventEmitter();
|
|
10623
|
-
this.showClass = true;
|
|
10624
|
-
this.pages = [];
|
|
10625
|
-
this.changeSub = this._paginationService.change.subscribe(function (id) {
|
|
10626
|
-
if (_this.id === id) {
|
|
10627
|
-
_this._updatePageLinks();
|
|
10628
|
-
}
|
|
10629
|
-
});
|
|
10359
|
+
var ObserveVisibilityDirective = /** @class */ (function () {
|
|
10360
|
+
function ObserveVisibilityDirective(_element) {
|
|
10361
|
+
this._element = _element;
|
|
10362
|
+
this.debounceTime = 0;
|
|
10363
|
+
this.threshold = 0;
|
|
10364
|
+
this.visible = new core.EventEmitter();
|
|
10365
|
+
this._subject = new rxjs.Subject();
|
|
10630
10366
|
}
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
this.id = this._paginationService.DEFAULT_ID;
|
|
10634
|
-
}
|
|
10635
|
-
this._updatePageLinks();
|
|
10636
|
-
};
|
|
10637
|
-
PaginationComponent.prototype.ngOnChanges = function () {
|
|
10638
|
-
this._updatePageLinks();
|
|
10639
|
-
};
|
|
10640
|
-
PaginationComponent.prototype.ngOnDestroy = function () {
|
|
10641
|
-
this.changeSub.unsubscribe();
|
|
10642
|
-
};
|
|
10643
|
-
PaginationComponent.prototype.goToFirstPage = function () {
|
|
10644
|
-
if (!this.isOnFirstPage()) {
|
|
10645
|
-
this.setCurrentPage(1);
|
|
10646
|
-
}
|
|
10367
|
+
ObserveVisibilityDirective.prototype.ngOnInit = function () {
|
|
10368
|
+
this._createObserver();
|
|
10647
10369
|
};
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
this.setCurrentPage(this.getCurrentPage() - 1);
|
|
10651
|
-
}
|
|
10370
|
+
ObserveVisibilityDirective.prototype.ngAfterViewInit = function () {
|
|
10371
|
+
this._startObservingElements();
|
|
10652
10372
|
};
|
|
10653
|
-
|
|
10654
|
-
if (
|
|
10655
|
-
this.
|
|
10373
|
+
ObserveVisibilityDirective.prototype.ngOnDestroy = function () {
|
|
10374
|
+
if (this._observer) {
|
|
10375
|
+
this._observer.disconnect();
|
|
10376
|
+
this._observer = undefined;
|
|
10656
10377
|
}
|
|
10378
|
+
this._subject.next();
|
|
10379
|
+
this._subject.complete();
|
|
10657
10380
|
};
|
|
10658
|
-
|
|
10659
|
-
this
|
|
10660
|
-
|
|
10661
|
-
|
|
10662
|
-
|
|
10381
|
+
ObserveVisibilityDirective.prototype._isVisible = function (element) {
|
|
10382
|
+
var _this = this;
|
|
10383
|
+
return new Promise(function (resolve) {
|
|
10384
|
+
var observer = new IntersectionObserver(function (_a) {
|
|
10385
|
+
var _b = __read(_a, 1), entry = _b[0];
|
|
10386
|
+
resolve(entry.isIntersecting && entry.intersectionRatio >= _this.threshold);
|
|
10387
|
+
observer.disconnect();
|
|
10388
|
+
});
|
|
10389
|
+
observer.observe(element);
|
|
10390
|
+
});
|
|
10663
10391
|
};
|
|
10664
|
-
|
|
10665
|
-
|
|
10392
|
+
ObserveVisibilityDirective.prototype._createObserver = function () {
|
|
10393
|
+
var _this = this;
|
|
10394
|
+
var options = {
|
|
10395
|
+
rootMargin: '0px',
|
|
10396
|
+
threshold: this.threshold,
|
|
10397
|
+
};
|
|
10398
|
+
var isIntersecting = function (entry) { return entry.isIntersecting || entry.intersectionRatio > 0; };
|
|
10399
|
+
this._observer = new IntersectionObserver(function (entries, observer) {
|
|
10400
|
+
entries.forEach(function (entry) {
|
|
10401
|
+
if (isIntersecting(entry)) {
|
|
10402
|
+
_this._subject.next({ entry: entry, observer: observer });
|
|
10403
|
+
}
|
|
10404
|
+
});
|
|
10405
|
+
}, options);
|
|
10666
10406
|
};
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
else {
|
|
10672
|
-
var instance = this._paginationService.getInstance();
|
|
10673
|
-
return (instance.totalItems <= instance.itemsPerPage);
|
|
10407
|
+
ObserveVisibilityDirective.prototype._startObservingElements = function () {
|
|
10408
|
+
var _this = this;
|
|
10409
|
+
if (!this._observer) {
|
|
10410
|
+
return;
|
|
10674
10411
|
}
|
|
10412
|
+
this._observer.observe(this._element.nativeElement);
|
|
10413
|
+
this._subject
|
|
10414
|
+
.pipe(operators.delay(this.debounceTime), operators.filter(Boolean))
|
|
10415
|
+
.subscribe(function (_a) {
|
|
10416
|
+
var entry = _a.entry, observer = _a.observer;
|
|
10417
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
10418
|
+
var target, isStillVisible;
|
|
10419
|
+
return __generator(this, function (_a) {
|
|
10420
|
+
switch (_a.label) {
|
|
10421
|
+
case 0:
|
|
10422
|
+
target = entry.target;
|
|
10423
|
+
return [4 /*yield*/, this._isVisible(target)];
|
|
10424
|
+
case 1:
|
|
10425
|
+
isStillVisible = _a.sent();
|
|
10426
|
+
if (isStillVisible) {
|
|
10427
|
+
this.visible.emit(target);
|
|
10428
|
+
observer.unobserve(target);
|
|
10429
|
+
}
|
|
10430
|
+
return [2 /*return*/];
|
|
10431
|
+
}
|
|
10432
|
+
});
|
|
10433
|
+
});
|
|
10434
|
+
});
|
|
10675
10435
|
};
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
|
|
10687
|
-
|
|
10436
|
+
return ObserveVisibilityDirective;
|
|
10437
|
+
}());
|
|
10438
|
+
ObserveVisibilityDirective.decorators = [
|
|
10439
|
+
{ type: core.Directive, args: [{
|
|
10440
|
+
selector: '[observeVisibility]',
|
|
10441
|
+
},] }
|
|
10442
|
+
];
|
|
10443
|
+
ObserveVisibilityDirective.ctorParameters = function () { return [
|
|
10444
|
+
{ type: core.ElementRef }
|
|
10445
|
+
]; };
|
|
10446
|
+
ObserveVisibilityDirective.propDecorators = {
|
|
10447
|
+
debounceTime: [{ type: core.Input }],
|
|
10448
|
+
threshold: [{ type: core.Input }],
|
|
10449
|
+
visible: [{ type: core.Output }]
|
|
10450
|
+
};
|
|
10451
|
+
|
|
10452
|
+
var ObserveVisibilityModule = /** @class */ (function () {
|
|
10453
|
+
function ObserveVisibilityModule() {
|
|
10454
|
+
}
|
|
10455
|
+
return ObserveVisibilityModule;
|
|
10456
|
+
}());
|
|
10457
|
+
ObserveVisibilityModule.decorators = [
|
|
10458
|
+
{ type: core.NgModule, args: [{
|
|
10459
|
+
declarations: [
|
|
10460
|
+
ObserveVisibilityDirective
|
|
10461
|
+
],
|
|
10462
|
+
exports: [
|
|
10463
|
+
ObserveVisibilityDirective
|
|
10464
|
+
]
|
|
10465
|
+
},] }
|
|
10466
|
+
];
|
|
10467
|
+
|
|
10468
|
+
var SimpleGridModule = /** @class */ (function () {
|
|
10469
|
+
function SimpleGridModule() {
|
|
10470
|
+
}
|
|
10471
|
+
return SimpleGridModule;
|
|
10472
|
+
}());
|
|
10473
|
+
SimpleGridModule.decorators = [
|
|
10474
|
+
{ type: core.NgModule, args: [{
|
|
10475
|
+
imports: [
|
|
10476
|
+
common.CommonModule,
|
|
10477
|
+
dragDrop.DragDropModule,
|
|
10478
|
+
GridToolbarModule,
|
|
10479
|
+
InputTextModule,
|
|
10480
|
+
FormModule,
|
|
10481
|
+
ObserveVisibilityModule,
|
|
10482
|
+
PaginationModule
|
|
10483
|
+
],
|
|
10484
|
+
declarations: [
|
|
10485
|
+
SimpleGridComponent,
|
|
10486
|
+
SimpleGridCellComponent,
|
|
10487
|
+
SimpleGridColumnDirective
|
|
10488
|
+
],
|
|
10489
|
+
exports: [
|
|
10490
|
+
SimpleGridComponent,
|
|
10491
|
+
SimpleGridCellComponent,
|
|
10492
|
+
SimpleGridColumnDirective
|
|
10493
|
+
]
|
|
10494
|
+
},] }
|
|
10495
|
+
];
|
|
10496
|
+
|
|
10497
|
+
var FilterItemComponent = /** @class */ (function () {
|
|
10498
|
+
function FilterItemComponent(iconService) {
|
|
10499
|
+
this.iconService = iconService;
|
|
10500
|
+
this.icons = exports.CoreComponentsIcon;
|
|
10501
|
+
this.initialLimit = 10;
|
|
10502
|
+
this.expanded = false;
|
|
10503
|
+
// Set to false to use filter item with a multi selectable collection. Set to true to specify custom content
|
|
10504
|
+
this.customContent = false;
|
|
10505
|
+
// Set to true to show all results. Set to false to get 'show more' and 'show less' buttons to expand and contract.
|
|
10506
|
+
this.showAllResults = false;
|
|
10507
|
+
this.singleSelect = false;
|
|
10508
|
+
this.searchPlaceholder = 'Search...';
|
|
10509
|
+
this.showMoreLabel = 'Show more';
|
|
10510
|
+
this.showLessLabel = 'Show less';
|
|
10511
|
+
this.noResultsLabel = "No results";
|
|
10512
|
+
this.collectionChange = new core.EventEmitter();
|
|
10513
|
+
this.filteredCollection = [];
|
|
10514
|
+
this.limitTo = 10;
|
|
10515
|
+
this.filterText = "";
|
|
10516
|
+
this._collection = [];
|
|
10517
|
+
}
|
|
10518
|
+
Object.defineProperty(FilterItemComponent.prototype, "collection", {
|
|
10519
|
+
get: function () {
|
|
10520
|
+
return this._collection;
|
|
10521
|
+
},
|
|
10522
|
+
set: function (value) {
|
|
10523
|
+
var _a;
|
|
10524
|
+
this._collection = value;
|
|
10525
|
+
this.filteredCollection = (_a = this._collection) === null || _a === void 0 ? void 0 : _a.slice();
|
|
10526
|
+
},
|
|
10527
|
+
enumerable: false,
|
|
10528
|
+
configurable: true
|
|
10529
|
+
});
|
|
10530
|
+
FilterItemComponent.prototype.showClass = function () {
|
|
10531
|
+
return true;
|
|
10688
10532
|
};
|
|
10689
|
-
|
|
10690
|
-
|
|
10533
|
+
FilterItemComponent.prototype.ngOnInit = function () {
|
|
10534
|
+
this.setToInitialLimit();
|
|
10691
10535
|
};
|
|
10692
|
-
|
|
10693
|
-
|
|
10694
|
-
return Math.ceil(instance.totalItems / instance.itemsPerPage);
|
|
10536
|
+
FilterItemComponent.prototype.setToInitialLimit = function () {
|
|
10537
|
+
this.limitTo = this.initialLimit;
|
|
10695
10538
|
};
|
|
10696
|
-
|
|
10697
|
-
|
|
10698
|
-
|
|
10699
|
-
|
|
10700
|
-
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
return totalPages;
|
|
10539
|
+
FilterItemComponent.prototype.increaseLimit = function () {
|
|
10540
|
+
this.limitTo += 10;
|
|
10541
|
+
};
|
|
10542
|
+
FilterItemComponent.prototype.moreToShow = function () {
|
|
10543
|
+
var _a;
|
|
10544
|
+
if (this.showAllResults) {
|
|
10545
|
+
return false;
|
|
10704
10546
|
}
|
|
10705
|
-
|
|
10706
|
-
|
|
10547
|
+
return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) > this.limitTo;
|
|
10548
|
+
};
|
|
10549
|
+
FilterItemComponent.prototype.lessToShow = function () {
|
|
10550
|
+
var _a, _b;
|
|
10551
|
+
if (this.showAllResults) {
|
|
10552
|
+
return false;
|
|
10707
10553
|
}
|
|
10708
|
-
return
|
|
10554
|
+
return ((_a = this.filteredCollection) === null || _a === void 0 ? void 0 : _a.length) <= this.limitTo && ((_b = this.filteredCollection) === null || _b === void 0 ? void 0 : _b.length) > this.initialLimit;
|
|
10709
10555
|
};
|
|
10710
|
-
|
|
10711
|
-
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10716
|
-
var halfWay = Math.ceil(paginationRange / 2);
|
|
10717
|
-
var isStart = currentPage <= halfWay;
|
|
10718
|
-
var isEnd = totalPages - halfWay < currentPage;
|
|
10719
|
-
var isMiddle = !isStart && !isEnd;
|
|
10720
|
-
var ellipsesNeeded = paginationRange < totalPages;
|
|
10721
|
-
var i = 1;
|
|
10722
|
-
while (i <= totalPages && i <= paginationRange) {
|
|
10723
|
-
var label = void 0;
|
|
10724
|
-
var pageNumber = this.calculatePageNumber(i, currentPage, paginationRange, totalPages);
|
|
10725
|
-
var openingEllipsesNeeded = (i === 2 && (isMiddle || isEnd));
|
|
10726
|
-
var closingEllipsesNeeded = (i === paginationRange - 1 && (isMiddle || isStart));
|
|
10727
|
-
if (ellipsesNeeded && (openingEllipsesNeeded || closingEllipsesNeeded)) {
|
|
10728
|
-
label = '...';
|
|
10729
|
-
}
|
|
10730
|
-
else {
|
|
10731
|
-
label = '' + pageNumber;
|
|
10732
|
-
}
|
|
10733
|
-
pages.push({
|
|
10734
|
-
label: label,
|
|
10735
|
-
value: pageNumber
|
|
10556
|
+
FilterItemComponent.prototype.handleModelChange = function (model) {
|
|
10557
|
+
if (this.singleSelect) {
|
|
10558
|
+
this.collection.forEach(function (m) {
|
|
10559
|
+
if (m.code !== model.code && m.description !== model.description) {
|
|
10560
|
+
m.checked = false;
|
|
10561
|
+
}
|
|
10736
10562
|
});
|
|
10737
|
-
i++;
|
|
10738
10563
|
}
|
|
10739
|
-
|
|
10564
|
+
model.checked = !model.checked;
|
|
10565
|
+
this.collectionChange.emit(this.collection);
|
|
10740
10566
|
};
|
|
10741
|
-
//
|
|
10742
|
-
|
|
10743
|
-
var
|
|
10744
|
-
|
|
10745
|
-
|
|
10567
|
+
// Applies filter to the collection.
|
|
10568
|
+
FilterItemComponent.prototype.applyFilter = function (text) {
|
|
10569
|
+
var _a, _b;
|
|
10570
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10571
|
+
var _c, filterText, filteredItemCount;
|
|
10572
|
+
return __generator(this, function (_d) {
|
|
10573
|
+
switch (_d.label) {
|
|
10574
|
+
case 0:
|
|
10575
|
+
if (!(!isNaN(this.minSearchCharsToLoadCollection) && this.collectionLoadFn)) return [3 /*break*/, 3];
|
|
10576
|
+
if (!(text.length === this.minSearchCharsToLoadCollection && text.length > this.filterText.length)) return [3 /*break*/, 2];
|
|
10577
|
+
_c = this;
|
|
10578
|
+
return [4 /*yield*/, this.collectionLoadFn(text)];
|
|
10579
|
+
case 1:
|
|
10580
|
+
_c.collection = _d.sent();
|
|
10581
|
+
return [3 /*break*/, 3];
|
|
10582
|
+
case 2:
|
|
10583
|
+
if (text.length < this.minSearchCharsToLoadCollection) {
|
|
10584
|
+
this.collection = undefined;
|
|
10585
|
+
}
|
|
10586
|
+
_d.label = 3;
|
|
10587
|
+
case 3:
|
|
10588
|
+
this.filterText = text;
|
|
10589
|
+
if (!this.collection) {
|
|
10590
|
+
return [2 /*return*/, []];
|
|
10591
|
+
}
|
|
10592
|
+
filterText = (_a = this.filterText) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
|
|
10593
|
+
filteredItemCount = 0;
|
|
10594
|
+
this.filteredCollection = (_b = this.collection) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
10595
|
+
var _a;
|
|
10596
|
+
var labelText = (_a = item.description) === null || _a === void 0 ? void 0 : _a.toString().toLowerCase();
|
|
10597
|
+
var isHiddenByFilter = ((labelText === null || labelText === void 0 ? void 0 : labelText.indexOf(filterText)) === -1);
|
|
10598
|
+
if (isHiddenByFilter) {
|
|
10599
|
+
return false;
|
|
10600
|
+
}
|
|
10601
|
+
else {
|
|
10602
|
+
filteredItemCount++;
|
|
10603
|
+
return true;
|
|
10604
|
+
}
|
|
10605
|
+
});
|
|
10606
|
+
return [2 /*return*/];
|
|
10607
|
+
}
|
|
10608
|
+
});
|
|
10609
|
+
});
|
|
10610
|
+
};
|
|
10611
|
+
return FilterItemComponent;
|
|
10612
|
+
}());
|
|
10613
|
+
FilterItemComponent.decorators = [
|
|
10614
|
+
{ type: core.Component, args: [{
|
|
10615
|
+
selector: "co-filter-item",
|
|
10616
|
+
template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [name]=\"'radiogroup'\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
|
|
10617
|
+
encapsulation: core.ViewEncapsulation.None
|
|
10618
|
+
},] }
|
|
10619
|
+
];
|
|
10620
|
+
FilterItemComponent.ctorParameters = function () { return [
|
|
10621
|
+
{ type: IconCacheService }
|
|
10622
|
+
]; };
|
|
10623
|
+
FilterItemComponent.propDecorators = {
|
|
10624
|
+
collection: [{ type: core.Input }],
|
|
10625
|
+
placeholder: [{ type: core.Input }],
|
|
10626
|
+
initialLimit: [{ type: core.Input }],
|
|
10627
|
+
expanded: [{ type: core.Input }],
|
|
10628
|
+
minSearchCharsToLoadCollection: [{ type: core.Input }],
|
|
10629
|
+
collectionLoadFn: [{ type: core.Input }],
|
|
10630
|
+
customContent: [{ type: core.Input }],
|
|
10631
|
+
showAllResults: [{ type: core.Input }],
|
|
10632
|
+
singleSelect: [{ type: core.Input }],
|
|
10633
|
+
searchPlaceholder: [{ type: core.Input }],
|
|
10634
|
+
showMoreLabel: [{ type: core.Input }],
|
|
10635
|
+
showLessLabel: [{ type: core.Input }],
|
|
10636
|
+
noResultsLabel: [{ type: core.Input }],
|
|
10637
|
+
collectionChange: [{ type: core.Output }],
|
|
10638
|
+
showClass: [{ type: core.HostBinding, args: ["class.co-filter-item",] }]
|
|
10639
|
+
};
|
|
10640
|
+
|
|
10641
|
+
// A pipe for prepending strings to other strings in view templates.
|
|
10642
|
+
var PrependPipe = /** @class */ (function () {
|
|
10643
|
+
function PrependPipe() {
|
|
10644
|
+
}
|
|
10645
|
+
PrependPipe.prototype.transform = function (value, prepend) {
|
|
10646
|
+
if (!value) {
|
|
10647
|
+
return "";
|
|
10746
10648
|
}
|
|
10747
|
-
|
|
10748
|
-
return
|
|
10649
|
+
if (!prepend) {
|
|
10650
|
+
return value;
|
|
10749
10651
|
}
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
|
|
10754
|
-
|
|
10755
|
-
|
|
10652
|
+
return prepend + value;
|
|
10653
|
+
};
|
|
10654
|
+
return PrependPipe;
|
|
10655
|
+
}());
|
|
10656
|
+
PrependPipe.decorators = [
|
|
10657
|
+
{ type: core.Pipe, args: [{ name: "prepend" },] }
|
|
10658
|
+
];
|
|
10659
|
+
|
|
10660
|
+
var PrependPipeModule = /** @class */ (function () {
|
|
10661
|
+
function PrependPipeModule() {
|
|
10662
|
+
}
|
|
10663
|
+
return PrependPipeModule;
|
|
10664
|
+
}());
|
|
10665
|
+
PrependPipeModule.decorators = [
|
|
10666
|
+
{ type: core.NgModule, args: [{
|
|
10667
|
+
declarations: [
|
|
10668
|
+
PrependPipe
|
|
10669
|
+
],
|
|
10670
|
+
exports: [
|
|
10671
|
+
PrependPipe
|
|
10672
|
+
]
|
|
10673
|
+
},] }
|
|
10674
|
+
];
|
|
10675
|
+
|
|
10676
|
+
var FilterItemModule = /** @class */ (function () {
|
|
10677
|
+
function FilterItemModule() {
|
|
10678
|
+
}
|
|
10679
|
+
return FilterItemModule;
|
|
10680
|
+
}());
|
|
10681
|
+
FilterItemModule.decorators = [
|
|
10682
|
+
{ type: core.NgModule, args: [{
|
|
10683
|
+
imports: [
|
|
10684
|
+
common.CommonModule,
|
|
10685
|
+
CollapsibleModule,
|
|
10686
|
+
InputTextModule,
|
|
10687
|
+
InputCheckboxMultiSelectModule,
|
|
10688
|
+
InputCheckboxModule,
|
|
10689
|
+
IconModule,
|
|
10690
|
+
scrolling.ScrollingModule,
|
|
10691
|
+
AppendPipeModule,
|
|
10692
|
+
PrependPipeModule,
|
|
10693
|
+
InputTextModule,
|
|
10694
|
+
InputRadioButtonModule
|
|
10695
|
+
],
|
|
10696
|
+
declarations: [
|
|
10697
|
+
FilterItemComponent
|
|
10698
|
+
],
|
|
10699
|
+
exports: [
|
|
10700
|
+
FilterItemComponent
|
|
10701
|
+
]
|
|
10702
|
+
},] }
|
|
10703
|
+
];
|
|
10704
|
+
|
|
10705
|
+
// Human-readable JS keyboard codes, as in KeyboardEvent.key string values.
|
|
10706
|
+
var KeyboardKey;
|
|
10707
|
+
(function (KeyboardKey) {
|
|
10708
|
+
KeyboardKey["Down"] = "ArrowDown";
|
|
10709
|
+
KeyboardKey["Up"] = "ArrowUp";
|
|
10710
|
+
KeyboardKey["Left"] = "ArrowLeft";
|
|
10711
|
+
KeyboardKey["Right"] = "ArrowRight";
|
|
10712
|
+
KeyboardKey["Tab"] = "Tab";
|
|
10713
|
+
KeyboardKey["Escape"] = "Escape";
|
|
10714
|
+
KeyboardKey["Enter"] = "Enter";
|
|
10715
|
+
KeyboardKey["Home"] = "Home";
|
|
10716
|
+
KeyboardKey["End"] = "End";
|
|
10717
|
+
KeyboardKey["Delete"] = "Delete";
|
|
10718
|
+
KeyboardKey["Insert"] = "Insert";
|
|
10719
|
+
KeyboardKey["ShiftLeft"] = "ShiftLeft";
|
|
10720
|
+
KeyboardKey["ShiftRight"] = "ShiftRight";
|
|
10721
|
+
KeyboardKey["Backspace"] = "Backspace";
|
|
10722
|
+
KeyboardKey["SpaceBar"] = "Space";
|
|
10723
|
+
KeyboardKey["Period"] = "Period";
|
|
10724
|
+
KeyboardKey["DecimalPoint"] = "NumpadDecimal";
|
|
10725
|
+
KeyboardKey["SemiColon"] = "Semicolon";
|
|
10726
|
+
KeyboardKey["ControlRight"] = "ControlRight";
|
|
10727
|
+
KeyboardKey["ControlLeft"] = "ControlLeft";
|
|
10728
|
+
KeyboardKey["Comma"] = "Comma";
|
|
10729
|
+
////Minus,
|
|
10730
|
+
////MinusFireFox,
|
|
10731
|
+
////Substract,
|
|
10732
|
+
KeyboardKey["Zero"] = "Digit0";
|
|
10733
|
+
KeyboardKey["One"] = "Digit1";
|
|
10734
|
+
KeyboardKey["Two"] = "Digit2";
|
|
10735
|
+
KeyboardKey["Three"] = "Digit3";
|
|
10736
|
+
KeyboardKey["Four"] = "Digit4";
|
|
10737
|
+
KeyboardKey["Five"] = "Digit5";
|
|
10738
|
+
KeyboardKey["Six"] = "Digit6";
|
|
10739
|
+
KeyboardKey["Seven"] = "Digit7";
|
|
10740
|
+
KeyboardKey["Eight"] = "Digit8";
|
|
10741
|
+
KeyboardKey["Nine"] = "Digit9";
|
|
10742
|
+
KeyboardKey["NumpadZero"] = "Numpad0";
|
|
10743
|
+
KeyboardKey["NumpadOne"] = "Numpad1";
|
|
10744
|
+
KeyboardKey["NumpadTwo"] = "Numpad2";
|
|
10745
|
+
KeyboardKey["NumpadThree"] = "Numpad3";
|
|
10746
|
+
KeyboardKey["NumpadFour"] = "Numpad4";
|
|
10747
|
+
KeyboardKey["NumpadFive"] = "Numpad5";
|
|
10748
|
+
KeyboardKey["NumpadSix"] = "Numpad6";
|
|
10749
|
+
KeyboardKey["NumpadSeven"] = "Numpad7";
|
|
10750
|
+
KeyboardKey["NumpadEight"] = "Numpad8";
|
|
10751
|
+
KeyboardKey["NumpadNine"] = "Numpad9";
|
|
10752
|
+
KeyboardKey["A"] = "KeyA";
|
|
10753
|
+
KeyboardKey["B"] = "KeyB";
|
|
10754
|
+
KeyboardKey["C"] = "KeyC";
|
|
10755
|
+
KeyboardKey["D"] = "KeyD";
|
|
10756
|
+
KeyboardKey["E"] = "KeyE";
|
|
10757
|
+
KeyboardKey["F"] = "KeyF";
|
|
10758
|
+
KeyboardKey["G"] = "KeyG";
|
|
10759
|
+
KeyboardKey["H"] = "KeyH";
|
|
10760
|
+
KeyboardKey["I"] = "KeyI";
|
|
10761
|
+
KeyboardKey["J"] = "KeyJ";
|
|
10762
|
+
KeyboardKey["K"] = "KeyK";
|
|
10763
|
+
KeyboardKey["L"] = "KeyL";
|
|
10764
|
+
KeyboardKey["M"] = "KeyM";
|
|
10765
|
+
KeyboardKey["N"] = "KeyN";
|
|
10766
|
+
KeyboardKey["O"] = "KeyO";
|
|
10767
|
+
KeyboardKey["P"] = "KeyP";
|
|
10768
|
+
KeyboardKey["Q"] = "KeyQ";
|
|
10769
|
+
KeyboardKey["R"] = "KeyR";
|
|
10770
|
+
KeyboardKey["S"] = "KeyS";
|
|
10771
|
+
KeyboardKey["T"] = "KeyT";
|
|
10772
|
+
KeyboardKey["U"] = "KeyU";
|
|
10773
|
+
KeyboardKey["V"] = "KeyV";
|
|
10774
|
+
KeyboardKey["W"] = "KeyW";
|
|
10775
|
+
KeyboardKey["X"] = "KeyX";
|
|
10776
|
+
KeyboardKey["Y"] = "KeyY";
|
|
10777
|
+
KeyboardKey["Z"] = "KeyZ";
|
|
10778
|
+
})(KeyboardKey || (KeyboardKey = {}));
|
|
10779
|
+
|
|
10780
|
+
var ClickOutsideMasterService = /** @class */ (function () {
|
|
10781
|
+
function ClickOutsideMasterService(_ngZone) {
|
|
10782
|
+
var _this = this;
|
|
10783
|
+
this._ngZone = _ngZone;
|
|
10784
|
+
this._clickOutsideRefs = [];
|
|
10785
|
+
this.onClick = function (event) {
|
|
10786
|
+
_this._currentClick = event;
|
|
10787
|
+
var first = _this._clickOutsideRefs[0];
|
|
10788
|
+
var targets = _this._clickOutsideRefs.filter(function (co) { return co.alwaysTrigger; });
|
|
10789
|
+
if (first) {
|
|
10790
|
+
targets.push(first);
|
|
10756
10791
|
}
|
|
10757
|
-
|
|
10758
|
-
return
|
|
10792
|
+
setTimeout(function () {
|
|
10793
|
+
targets.forEach(function (clickOutside) { return _this.checkEmit(clickOutside, event); });
|
|
10794
|
+
});
|
|
10795
|
+
};
|
|
10796
|
+
this.onKeyDown = function (event) {
|
|
10797
|
+
if (event.key === KeyboardKey.Escape) {
|
|
10798
|
+
var first = _this._clickOutsideRefs[0];
|
|
10799
|
+
if (first) {
|
|
10800
|
+
_this.checkEmit(first, event, true);
|
|
10801
|
+
}
|
|
10759
10802
|
}
|
|
10760
|
-
}
|
|
10761
|
-
|
|
10762
|
-
|
|
10803
|
+
};
|
|
10804
|
+
document.addEventListener('click', this.onClick, true);
|
|
10805
|
+
window.addEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
|
|
10806
|
+
}
|
|
10807
|
+
Object.defineProperty(ClickOutsideMasterService.prototype, "currentClick", {
|
|
10808
|
+
get: function () {
|
|
10809
|
+
return this._currentClick;
|
|
10810
|
+
},
|
|
10811
|
+
enumerable: false,
|
|
10812
|
+
configurable: true
|
|
10813
|
+
});
|
|
10814
|
+
ClickOutsideMasterService.prototype.ngOnDestroy = function () {
|
|
10815
|
+
document.removeEventListener('click', this.onClick, true);
|
|
10816
|
+
window.removeEventListener('keydown', this.onKeyDown, EventUtils.passiveBubble);
|
|
10817
|
+
};
|
|
10818
|
+
ClickOutsideMasterService.prototype.checkEmit = function (clickOutside, event, force) {
|
|
10819
|
+
if (clickOutside && (clickOutside.currentClick !== this.currentClick || force) && this._clickOutsideRefs.indexOf(clickOutside) !== -1) {
|
|
10820
|
+
this._ngZone.run(function () { return clickOutside.clickOutside.emit(event); });
|
|
10763
10821
|
}
|
|
10764
10822
|
};
|
|
10765
|
-
|
|
10823
|
+
ClickOutsideMasterService.prototype.addClickOutside = function (clickOutside) {
|
|
10824
|
+
this.removeClickOutside(clickOutside);
|
|
10825
|
+
this._clickOutsideRefs.unshift(clickOutside);
|
|
10826
|
+
};
|
|
10827
|
+
ClickOutsideMasterService.prototype.removeClickOutside = function (clickOutside) {
|
|
10828
|
+
ArrayUtils.RemoveElement(clickOutside, this._clickOutsideRefs);
|
|
10829
|
+
};
|
|
10830
|
+
return ClickOutsideMasterService;
|
|
10766
10831
|
}());
|
|
10767
|
-
|
|
10768
|
-
{ type: core.
|
|
10769
|
-
selector: 'co-pagination',
|
|
10770
|
-
template: "\n <div class=\"pagination-component-main-wrapper\" *ngIf=\"!shouldBeHidden()\">\n <div>\n <ng-content></ng-content>\n </div>\n <ul class=\"pagination\">\n <li *ngIf=\"directionLinks\" class=\"pagination-previous\">\n <a (click)=\"goToPreviousPage()\" [class.disabled]=\"isOnFirstPage()\">{{ previousLabel }}</a>\n </li>\n <li *ngFor=\"let page of pages\" [class.current]=\"getCurrentPage() === page.value\" (click)=\"setCurrentPage(page.value)\">\n <span>{{page.label}}</span>\n </li>\n <li *ngIf=\"directionLinks\" class=\"pagination-next\">\n <a (click)=\"goToNextPage()\" [class.disabled]=\"isOnLastPage()\">{{ nextLabel }}</a>\n </li>\n </ul>\n </div>\n ",
|
|
10771
|
-
encapsulation: core.ViewEncapsulation.None
|
|
10772
|
-
},] }
|
|
10832
|
+
ClickOutsideMasterService.decorators = [
|
|
10833
|
+
{ type: core.Injectable }
|
|
10773
10834
|
];
|
|
10774
|
-
|
|
10775
|
-
{ type:
|
|
10776
|
-
]; };
|
|
10777
|
-
PaginationComponent.propDecorators = {
|
|
10778
|
-
template: [{ type: core.ViewChild, args: ['template',] }],
|
|
10779
|
-
id: [{ type: core.Input }],
|
|
10780
|
-
maxSize: [{ type: core.Input }],
|
|
10781
|
-
directionLinks: [{ type: core.Input }],
|
|
10782
|
-
previousLabel: [{ type: core.Input }],
|
|
10783
|
-
nextLabel: [{ type: core.Input }],
|
|
10784
|
-
autoHide: [{ type: core.Input }],
|
|
10785
|
-
pageChange: [{ type: core.Output }],
|
|
10786
|
-
showClass: [{ type: core.HostBinding, args: ['class.co-pagination',] }]
|
|
10787
|
-
};
|
|
10835
|
+
ClickOutsideMasterService.ctorParameters = function () { return [
|
|
10836
|
+
{ type: core.NgZone }
|
|
10837
|
+
]; };
|
|
10788
10838
|
|
|
10789
|
-
var
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
this.
|
|
10793
|
-
|
|
10794
|
-
this.
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
if (!(collection instanceof Array)) {
|
|
10802
|
-
var _id = args.id || this.paginateService.DEFAULT_ID;
|
|
10803
|
-
if (this.state[_id]) {
|
|
10804
|
-
return this.state[_id].slice;
|
|
10805
|
-
}
|
|
10806
|
-
else {
|
|
10807
|
-
return collection;
|
|
10808
|
-
}
|
|
10809
|
-
}
|
|
10810
|
-
var serverSideMode = args.totalItems !== undefined;
|
|
10811
|
-
var instance = this._createInstance(collection, args);
|
|
10812
|
-
var id = instance.id;
|
|
10813
|
-
var start;
|
|
10814
|
-
var end;
|
|
10815
|
-
var perPage = instance.itemsPerPage;
|
|
10816
|
-
this.paginateService.register(instance);
|
|
10817
|
-
if (!serverSideMode && collection instanceof Array) {
|
|
10818
|
-
perPage = perPage || LARGE_NUMBER;
|
|
10819
|
-
start = (instance.currentPage - 1) * perPage;
|
|
10820
|
-
end = start + perPage;
|
|
10821
|
-
var isIdentical = this._stateIsIdentical(id, collection, start, end);
|
|
10822
|
-
if (isIdentical) {
|
|
10823
|
-
return this.state[id].slice;
|
|
10824
|
-
}
|
|
10825
|
-
else {
|
|
10826
|
-
var slice = collection.slice(start, end);
|
|
10827
|
-
this._saveState(id, collection, slice, start, end);
|
|
10828
|
-
this.paginateService.change.next(id);
|
|
10829
|
-
return slice;
|
|
10839
|
+
var ClickOutsideDirective = /** @class */ (function () {
|
|
10840
|
+
function ClickOutsideDirective(elementRef, _ngZone, _master) {
|
|
10841
|
+
var _this = this;
|
|
10842
|
+
this.elementRef = elementRef;
|
|
10843
|
+
this._ngZone = _ngZone;
|
|
10844
|
+
this._master = _master;
|
|
10845
|
+
this.clickOutside = new core.EventEmitter();
|
|
10846
|
+
this._enabled = true;
|
|
10847
|
+
this._initialized = false;
|
|
10848
|
+
this.onClick = function (event) {
|
|
10849
|
+
if (_this._enabled) {
|
|
10850
|
+
_this._currentClick = event;
|
|
10830
10851
|
}
|
|
10831
|
-
}
|
|
10832
|
-
// save the state for server-side collection to avoid null
|
|
10833
|
-
// flash as new data loads.
|
|
10834
|
-
this._saveState(id, collection, collection, start, end);
|
|
10835
|
-
return collection;
|
|
10836
|
-
};
|
|
10837
|
-
// Create an IPaginationInstance object, using defaults for any optional properties not supplied.
|
|
10838
|
-
PaginatePipe.prototype._createInstance = function (collection, args) {
|
|
10839
|
-
var config = args;
|
|
10840
|
-
this._checkConfig(config);
|
|
10841
|
-
return {
|
|
10842
|
-
id: config.id || this.paginateService.DEFAULT_ID,
|
|
10843
|
-
itemsPerPage: config.itemsPerPage || 0,
|
|
10844
|
-
currentPage: config.currentPage || 1,
|
|
10845
|
-
totalItems: config.totalItems || collection.length
|
|
10846
|
-
};
|
|
10847
|
-
};
|
|
10848
|
-
// Ensure the argument passed to the filter contains the required properties.
|
|
10849
|
-
PaginatePipe.prototype._checkConfig = function (config) {
|
|
10850
|
-
var required = ["itemsPerPage", "currentPage"];
|
|
10851
|
-
var missing = required.filter(function (prop) { return !config.hasOwnProperty(prop); });
|
|
10852
|
-
if (0 < missing.length) {
|
|
10853
|
-
throw new Error("PaginatePipe: Argument is missing the following required properties: " + missing.join(", "));
|
|
10854
|
-
}
|
|
10855
|
-
};
|
|
10856
|
-
/**
|
|
10857
|
-
* To avoid returning a brand new array each time the pipe is run, we store the state of the sliced
|
|
10858
|
-
* array for a given id. This means that the next time the pipe is run on this collection & id, we just
|
|
10859
|
-
* need to check that the collection, start and end points are all identical, and if so, return the
|
|
10860
|
-
* last sliced array.
|
|
10861
|
-
*/
|
|
10862
|
-
PaginatePipe.prototype._saveState = function (id, collection, slice, start, end) {
|
|
10863
|
-
this.state[id] = {
|
|
10864
|
-
collection: collection,
|
|
10865
|
-
size: collection.length,
|
|
10866
|
-
slice: slice,
|
|
10867
|
-
start: start,
|
|
10868
|
-
end: end
|
|
10869
10852
|
};
|
|
10853
|
+
}
|
|
10854
|
+
Object.defineProperty(ClickOutsideDirective.prototype, "currentClick", {
|
|
10855
|
+
get: function () {
|
|
10856
|
+
return this._currentClick;
|
|
10857
|
+
},
|
|
10858
|
+
enumerable: false,
|
|
10859
|
+
configurable: true
|
|
10860
|
+
});
|
|
10861
|
+
Object.defineProperty(ClickOutsideDirective.prototype, "enabled", {
|
|
10862
|
+
set: function (enabled) {
|
|
10863
|
+
enabled = enabled === undefined || enabled;
|
|
10864
|
+
// noinspection SuspiciousTypeOfGuard
|
|
10865
|
+
if (typeof enabled === 'boolean' && this._enabled !== enabled) {
|
|
10866
|
+
this._enabled = enabled;
|
|
10867
|
+
if (this._initialized) {
|
|
10868
|
+
this._enabled ? this._master.addClickOutside(this) : this._master.removeClickOutside(this);
|
|
10869
|
+
}
|
|
10870
|
+
}
|
|
10871
|
+
},
|
|
10872
|
+
enumerable: false,
|
|
10873
|
+
configurable: true
|
|
10874
|
+
});
|
|
10875
|
+
ClickOutsideDirective.prototype.ngAfterViewInit = function () {
|
|
10876
|
+
var _this = this;
|
|
10877
|
+
setTimeout(function () {
|
|
10878
|
+
_this._ngZone.runOutsideAngular(function () {
|
|
10879
|
+
if (_this.elementRef && _this.elementRef.nativeElement) {
|
|
10880
|
+
_this.elementRef.nativeElement.addEventListener('click', _this.onClick, EventUtils.passiveCapture);
|
|
10881
|
+
if (_this._enabled) {
|
|
10882
|
+
_this._master.addClickOutside(_this);
|
|
10883
|
+
}
|
|
10884
|
+
_this._initialized = true;
|
|
10885
|
+
}
|
|
10886
|
+
});
|
|
10887
|
+
});
|
|
10870
10888
|
};
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
return false;
|
|
10876
|
-
}
|
|
10877
|
-
return state.collection === collection &&
|
|
10878
|
-
state.size === collection.length &&
|
|
10879
|
-
state.start === start &&
|
|
10880
|
-
state.end === end;
|
|
10889
|
+
ClickOutsideDirective.prototype.ngOnDestroy = function () {
|
|
10890
|
+
this._master.removeClickOutside(this);
|
|
10891
|
+
this.elementRef.nativeElement.removeEventListener('click', this.onClick, EventUtils.passiveCapture);
|
|
10892
|
+
this.elementRef = undefined;
|
|
10881
10893
|
};
|
|
10882
|
-
return
|
|
10894
|
+
return ClickOutsideDirective;
|
|
10883
10895
|
}());
|
|
10884
|
-
|
|
10885
|
-
{ type: core.
|
|
10886
|
-
|
|
10887
|
-
|
|
10896
|
+
ClickOutsideDirective.decorators = [
|
|
10897
|
+
{ type: core.Directive, args: [{
|
|
10898
|
+
selector: "[clickOutside]",
|
|
10899
|
+
exportAs: 'clickOutside'
|
|
10888
10900
|
},] }
|
|
10889
10901
|
];
|
|
10890
|
-
|
|
10891
|
-
{ type:
|
|
10892
|
-
|
|
10902
|
+
ClickOutsideDirective.ctorParameters = function () { return [
|
|
10903
|
+
{ type: core.ElementRef },
|
|
10904
|
+
{ type: core.NgZone },
|
|
10905
|
+
{ type: ClickOutsideMasterService }
|
|
10906
|
+
]; };
|
|
10907
|
+
ClickOutsideDirective.propDecorators = {
|
|
10908
|
+
enabled: [{ type: core.Input, args: ["clickOutside",] }],
|
|
10909
|
+
alwaysTrigger: [{ type: core.Input }],
|
|
10910
|
+
clickOutside: [{ type: core.Output }]
|
|
10911
|
+
};
|
|
10912
|
+
__decorate([
|
|
10913
|
+
InputBoolean()
|
|
10914
|
+
], ClickOutsideDirective.prototype, "alwaysTrigger", void 0);
|
|
10893
10915
|
|
|
10894
|
-
var
|
|
10895
|
-
function
|
|
10916
|
+
var ClickoutsideModule = /** @class */ (function () {
|
|
10917
|
+
function ClickoutsideModule() {
|
|
10896
10918
|
}
|
|
10897
|
-
return
|
|
10919
|
+
return ClickoutsideModule;
|
|
10898
10920
|
}());
|
|
10899
|
-
|
|
10921
|
+
ClickoutsideModule.decorators = [
|
|
10900
10922
|
{ type: core.NgModule, args: [{
|
|
10901
|
-
|
|
10902
|
-
|
|
10923
|
+
declarations: [
|
|
10924
|
+
ClickOutsideDirective
|
|
10903
10925
|
],
|
|
10904
10926
|
providers: [
|
|
10905
|
-
|
|
10906
|
-
],
|
|
10907
|
-
declarations: [
|
|
10908
|
-
PaginationComponent,
|
|
10909
|
-
PaginatePipe
|
|
10927
|
+
ClickOutsideMasterService
|
|
10910
10928
|
],
|
|
10911
10929
|
exports: [
|
|
10912
|
-
|
|
10913
|
-
PaginatePipe
|
|
10930
|
+
ClickOutsideDirective
|
|
10914
10931
|
]
|
|
10915
10932
|
},] }
|
|
10916
10933
|
];
|
|
@@ -11017,13 +11034,13 @@
|
|
|
11017
11034
|
exports.TileModule = TileModule;
|
|
11018
11035
|
exports["ɵa"] = RippleModule;
|
|
11019
11036
|
exports["ɵb"] = MD_RIPPLE_GLOBAL_OPTIONS;
|
|
11020
|
-
exports["ɵba"] =
|
|
11021
|
-
exports["ɵbb"] =
|
|
11022
|
-
exports["ɵbc"] =
|
|
11023
|
-
exports["ɵbd"] =
|
|
11024
|
-
exports["ɵbe"] =
|
|
11025
|
-
exports["ɵbf"] =
|
|
11026
|
-
exports["ɵbg"] =
|
|
11037
|
+
exports["ɵba"] = PaginationService;
|
|
11038
|
+
exports["ɵbb"] = PaginatePipe;
|
|
11039
|
+
exports["ɵbc"] = SimpleGridCellComponent;
|
|
11040
|
+
exports["ɵbd"] = PrependPipeModule;
|
|
11041
|
+
exports["ɵbe"] = PrependPipe;
|
|
11042
|
+
exports["ɵbf"] = ClickOutsideDirective;
|
|
11043
|
+
exports["ɵbg"] = ClickOutsideMasterService;
|
|
11027
11044
|
exports["ɵc"] = CoRippleDirective;
|
|
11028
11045
|
exports["ɵd"] = CoViewportRulerService;
|
|
11029
11046
|
exports["ɵe"] = CoScrollDispatcherService;
|