@progress/kendo-angular-pager 17.0.0-develop.21 → 17.0.0-develop.22
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/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{esm2020 → esm2022}/pager/focusable.directive.mjs +7 -4
- package/{esm2020 → esm2022}/pager/localization/custom-messages.component.mjs +9 -8
- package/{esm2020 → esm2022}/pager/localization/localized-messages.directive.mjs +9 -8
- package/esm2022/pager/localization/messages.mjs +87 -0
- package/{esm2020 → esm2022}/pager/navigation.service.mjs +2 -4
- package/{esm2020 → esm2022}/pager/pager-context.service.mjs +6 -5
- package/{esm2020 → esm2022}/pager/pager-element.component.mjs +22 -15
- package/{esm2020 → esm2022}/pager/pager-info.component.mjs +8 -7
- package/{esm2020 → esm2022}/pager/pager-input.component.mjs +56 -52
- package/{esm2020 → esm2022}/pager/pager-next-buttons.component.mjs +17 -17
- package/{esm2020 → esm2022}/pager/pager-numeric-buttons.component.mjs +21 -10
- package/{esm2020 → esm2022}/pager/pager-page-sizes.component.mjs +25 -21
- package/{esm2020 → esm2022}/pager/pager-prev-buttons.component.mjs +14 -14
- package/{esm2020 → esm2022}/pager/pager-template.directive.mjs +4 -3
- package/{esm2020 → esm2022}/pager/pager.component.mjs +121 -105
- package/{esm2020 → esm2022}/pager/pager.module.mjs +8 -8
- package/{esm2020 → esm2022}/pager/pagesizechange-event.mjs +4 -0
- package/{esm2020 → esm2022}/pager/preventable-event.mjs +1 -3
- package/{fesm2020 → fesm2022}/progress-kendo-angular-pager.mjs +383 -289
- package/package.json +15 -21
- package/pager/common/pager-size.d.ts +1 -1
- package/pager/common/pager-type.d.ts +1 -1
- package/pager/localization/messages.d.ts +1 -1
- package/pager/pager-context.service.d.ts +1 -1
- package/pager/pager-input.component.d.ts +1 -1
- package/pager/pager-next-buttons.component.d.ts +1 -1
- package/pager/pager-numeric-buttons.component.d.ts +1 -1
- package/pager/pager-page-sizes.component.d.ts +1 -1
- package/pager/pager-prev-buttons.component.d.ts +1 -1
- package/pager/pager.component.d.ts +1 -1
- package/schematics/ngAdd/index.js +6 -6
- package/esm2020/pager/localization/messages.mjs +0 -43
- package/fesm2015/progress-kendo-angular-pager.mjs +0 -1991
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/change-event-args.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/common/constants.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/common/pager-classes.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/common/pager-size.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/common/pager-type.mjs +0 -0
- /package/{esm2020 → esm2022}/pager/pagesize-item.interface.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-pager.mjs +0 -0
- /package/{esm2020 → esm2022}/util.mjs +0 -0
|
@@ -18,23 +18,10 @@ import * as i2 from "./pager-context.service";
|
|
|
18
18
|
* Displays a drop-down list for the page size selection ([see example]({% slug pager_settings %})).
|
|
19
19
|
*/
|
|
20
20
|
export class PagerPageSizesComponent extends PagerElementComponent {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.ngZone = ngZone;
|
|
26
|
-
/**
|
|
27
|
-
* Specifies the padding of the dropdown.
|
|
28
|
-
*
|
|
29
|
-
* The possible values are:
|
|
30
|
-
* * `small`
|
|
31
|
-
* * `medium` (default)
|
|
32
|
-
* * `large`
|
|
33
|
-
* * `none`
|
|
34
|
-
*/
|
|
35
|
-
this.size = DEFAULT_SIZE;
|
|
36
|
-
this._pageSizes = [];
|
|
37
|
-
}
|
|
21
|
+
pagerContext;
|
|
22
|
+
element;
|
|
23
|
+
ngZone;
|
|
24
|
+
dropDownList;
|
|
38
25
|
/**
|
|
39
26
|
* The page sizes collection. Can contain numbers and [PageSizeItem]({% slug api_pager_pagesizeitem %}) objects.
|
|
40
27
|
*
|
|
@@ -176,6 +163,16 @@ export class PagerPageSizesComponent extends PagerElementComponent {
|
|
|
176
163
|
get pageSizes() {
|
|
177
164
|
return this._pageSizes;
|
|
178
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Specifies the padding of the dropdown.
|
|
168
|
+
*
|
|
169
|
+
* The possible values are:
|
|
170
|
+
* * `small`
|
|
171
|
+
* * `medium` (default)
|
|
172
|
+
* * `large`
|
|
173
|
+
* * `none`
|
|
174
|
+
*/
|
|
175
|
+
size = DEFAULT_SIZE;
|
|
179
176
|
/**
|
|
180
177
|
* @hidden
|
|
181
178
|
*
|
|
@@ -184,6 +181,13 @@ export class PagerPageSizesComponent extends PagerElementComponent {
|
|
|
184
181
|
get classes() {
|
|
185
182
|
return true;
|
|
186
183
|
}
|
|
184
|
+
_pageSizes = [];
|
|
185
|
+
constructor(localization, cd, pagerContext, element, ngZone) {
|
|
186
|
+
super(localization, pagerContext, cd);
|
|
187
|
+
this.pagerContext = pagerContext;
|
|
188
|
+
this.element = element;
|
|
189
|
+
this.ngZone = ngZone;
|
|
190
|
+
}
|
|
187
191
|
ngAfterViewInit() {
|
|
188
192
|
this.ngZone.runOutsideAngular(() => {
|
|
189
193
|
this.element.nativeElement.addEventListener('keydown', this.keyDownHandler.bind(this), true);
|
|
@@ -214,9 +218,8 @@ export class PagerPageSizesComponent extends PagerElementComponent {
|
|
|
214
218
|
this.dropDownList.toggle(false);
|
|
215
219
|
}
|
|
216
220
|
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
PagerPageSizesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PagerPageSizesComponent, isStandalone: true, selector: "kendo-datapager-page-sizes", inputs: { pageSizes: "pageSizes", size: "size" }, host: { properties: { "class.k-pager-sizes": "this.classes" } }, viewQueries: [{ propertyName: "dropDownList", first: true, predicate: ["dropdownlist"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
221
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerPageSizesComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.PagerContextService }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
|
|
222
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PagerPageSizesComponent, isStandalone: true, selector: "kendo-datapager-page-sizes", inputs: { pageSizes: "pageSizes", size: "size" }, host: { properties: { "class.k-pager-sizes": "this.classes" } }, viewQueries: [{ propertyName: "dropDownList", first: true, predicate: ["dropdownlist"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: `
|
|
220
223
|
<kendo-dropdownlist kendoPagerFocusable
|
|
221
224
|
#dropdownlist
|
|
222
225
|
[size]="size"
|
|
@@ -229,7 +232,8 @@ PagerPageSizesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0"
|
|
|
229
232
|
[attr.aria-label]="textFor('itemsPerPage')"></kendo-dropdownlist>
|
|
230
233
|
{{ textFor('itemsPerPage') }}
|
|
231
234
|
`, isInline: true, dependencies: [{ kind: "component", type: DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["customIconClass", "showStickyHeader", "icon", "svgIcon", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "title", "subtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { kind: "directive", type: PagerFocusableDirective, selector: "[kendoPagerFocusable]", exportAs: ["kendoPagerFocusable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
232
|
-
|
|
235
|
+
}
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerPageSizesComponent, decorators: [{
|
|
233
237
|
type: Component,
|
|
234
238
|
args: [{
|
|
235
239
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -19,17 +19,17 @@ import * as i2 from "./pager-context.service";
|
|
|
19
19
|
export class PagerPrevButtonsComponent extends PagerElementComponent {
|
|
20
20
|
constructor(localization, pagerContext, cd) {
|
|
21
21
|
super(localization, pagerContext, cd);
|
|
22
|
-
/**
|
|
23
|
-
* Specifies the padding of the buttons.
|
|
24
|
-
*
|
|
25
|
-
* The possible values are:
|
|
26
|
-
* * `small`
|
|
27
|
-
* * `medium` (default)
|
|
28
|
-
* * `large`
|
|
29
|
-
* * `none`
|
|
30
|
-
*/
|
|
31
|
-
this.size = DEFAULT_SIZE;
|
|
32
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Specifies the padding of the buttons.
|
|
25
|
+
*
|
|
26
|
+
* The possible values are:
|
|
27
|
+
* * `small`
|
|
28
|
+
* * `medium` (default)
|
|
29
|
+
* * `large`
|
|
30
|
+
* * `none`
|
|
31
|
+
*/
|
|
32
|
+
size = DEFAULT_SIZE;
|
|
33
33
|
/**
|
|
34
34
|
* @hidden
|
|
35
35
|
*
|
|
@@ -46,9 +46,8 @@ export class PagerPrevButtonsComponent extends PagerElementComponent {
|
|
|
46
46
|
this.pageSize = pageSize;
|
|
47
47
|
this.cd.markForCheck();
|
|
48
48
|
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
PagerPrevButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: PagerPrevButtonsComponent, isStandalone: true, selector: "kendo-datapager-prev-buttons", inputs: { size: "size" }, usesInheritance: true, ngImport: i0, template: `
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerPrevButtonsComponent, deps: [{ token: i1.LocalizationService }, { token: i2.PagerContextService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PagerPrevButtonsComponent, isStandalone: true, selector: "kendo-datapager-prev-buttons", inputs: { size: "size" }, usesInheritance: true, ngImport: i0, template: `
|
|
52
51
|
<button
|
|
53
52
|
type="button" kendoButton kendoPagerFocusable
|
|
54
53
|
class="k-pager-nav k-pager-first"
|
|
@@ -76,7 +75,8 @@ PagerPrevButtonsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.
|
|
|
76
75
|
(click)="currentPage !== 1 ? changePage(currentPage-2) : false">
|
|
77
76
|
</button>
|
|
78
77
|
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }, { kind: "directive", type: PagerFocusableDirective, selector: "[kendoPagerFocusable]", exportAs: ["kendoPagerFocusable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
79
|
-
|
|
78
|
+
}
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerPrevButtonsComponent, decorators: [{
|
|
80
80
|
type: Component,
|
|
81
81
|
args: [{
|
|
82
82
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -47,13 +47,14 @@ import * as i0 from "@angular/core";
|
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
export class PagerTemplateDirective {
|
|
50
|
+
templateRef;
|
|
50
51
|
constructor(templateRef) {
|
|
51
52
|
this.templateRef = templateRef;
|
|
52
53
|
}
|
|
54
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
55
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: PagerTemplateDirective, isStandalone: true, selector: "[kendoDataPagerTemplate]", ngImport: i0 });
|
|
53
56
|
}
|
|
54
|
-
|
|
55
|
-
PagerTemplateDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: PagerTemplateDirective, isStandalone: true, selector: "[kendoDataPagerTemplate]", ngImport: i0 });
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagerTemplateDirective, decorators: [{
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerTemplateDirective, decorators: [{
|
|
57
58
|
type: Directive,
|
|
58
59
|
args: [{
|
|
59
60
|
selector: '[kendoDataPagerTemplate]',
|
|
@@ -26,99 +26,41 @@ import * as i1 from "./pager-context.service";
|
|
|
26
26
|
import * as i2 from "@progress/kendo-angular-l10n";
|
|
27
27
|
import * as i3 from "./navigation.service";
|
|
28
28
|
export class PagerComponent {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.pageChange = new EventEmitter();
|
|
65
|
-
/**
|
|
66
|
-
* Fires when the page size of the Pager is changed.
|
|
67
|
-
* You have to handle the event yourself and page the data.
|
|
68
|
-
* If the event is prevented, the page size will remain unchanged ([see example]({% slug pager_events %})).
|
|
69
|
-
*/
|
|
70
|
-
this.pageSizeChange = new EventEmitter();
|
|
71
|
-
this.pagerClass = true;
|
|
72
|
-
this.widgetRole = 'application';
|
|
73
|
-
this.roleDescription = 'pager';
|
|
74
|
-
this.keyShortcuts = 'Enter ArrowRight ArrowLeft';
|
|
75
|
-
this.hostTabindex = '0';
|
|
76
|
-
this.subscriptions = new Subscription();
|
|
77
|
-
this._templateContext = {};
|
|
78
|
-
this._pageSizeValues = DEFAULT_PAGE_SIZE_VALUES;
|
|
79
|
-
this.isInnerNavigationEnabled = false;
|
|
80
|
-
this._navigable = false;
|
|
81
|
-
this._size = DEFAULT_SIZE;
|
|
82
|
-
this.resizeHandler = () => {
|
|
83
|
-
if (this.template?.first) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const width = this.element.nativeElement.offsetWidth;
|
|
87
|
-
this.ngZone.runOutsideAngular(() => {
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
if (this.numericButtons) {
|
|
90
|
-
const selectElement = this.numericButtons.selectElement.nativeElement;
|
|
91
|
-
const numbersElement = this.numericButtons.numbersElement.nativeElement;
|
|
92
|
-
this.renderer.removeStyle(numbersElement, 'display');
|
|
93
|
-
this.renderer.setStyle(selectElement, 'display', 'none');
|
|
94
|
-
this.renderer.addClass(selectElement, 'k-hidden');
|
|
95
|
-
if (width < RESPONSIVE_BREAKPOINT_MEDIUM) {
|
|
96
|
-
this.renderer.removeStyle(selectElement, 'display');
|
|
97
|
-
this.renderer.removeClass(selectElement, 'k-hidden');
|
|
98
|
-
this.renderer.setStyle(numbersElement, 'display', 'none');
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
this.renderer.addClass(selectElement, 'k-hidden');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
if (this.pagerInfo) {
|
|
105
|
-
this.renderer.removeStyle(this.pagerInfo.nativeElement, 'display');
|
|
106
|
-
if (width < RESPONSIVE_BREAKPOINT_LARGE) {
|
|
107
|
-
this.renderer.setStyle(this.pagerInfo.nativeElement, 'display', 'none');
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
if (this.pagerPageSizes) {
|
|
111
|
-
this.renderer.removeStyle(this.pagerPageSizes.nativeElement, 'display');
|
|
112
|
-
if (width < RESPONSIVE_BREAKPOINT_MEDIUM) {
|
|
113
|
-
this.renderer.setStyle(this.pagerPageSizes.nativeElement, 'display', 'none');
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
validatePackage(packageMetadata);
|
|
120
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
121
|
-
}
|
|
29
|
+
pagerContext;
|
|
30
|
+
element;
|
|
31
|
+
localization;
|
|
32
|
+
renderer;
|
|
33
|
+
ngZone;
|
|
34
|
+
navigationService;
|
|
35
|
+
resizeSensor;
|
|
36
|
+
pagerInfo;
|
|
37
|
+
pagerPageSizes;
|
|
38
|
+
numericButtons;
|
|
39
|
+
template;
|
|
40
|
+
/**
|
|
41
|
+
* Represents the total number of data items in the collection.
|
|
42
|
+
*/
|
|
43
|
+
total = 0;
|
|
44
|
+
/**
|
|
45
|
+
* Defines the number of data items to be skipped.
|
|
46
|
+
*/
|
|
47
|
+
skip = 0;
|
|
48
|
+
/**
|
|
49
|
+
* Defines the number of data items per page.
|
|
50
|
+
*/
|
|
51
|
+
pageSize;
|
|
52
|
+
/**
|
|
53
|
+
* Sets the maximum numeric buttons count before the buttons are collapsed.
|
|
54
|
+
*/
|
|
55
|
+
buttonCount = 10;
|
|
56
|
+
/**
|
|
57
|
+
* Toggles the information about the current page and the total number of records.
|
|
58
|
+
*/
|
|
59
|
+
info = true;
|
|
60
|
+
/**
|
|
61
|
+
* Defines the type of the pager.
|
|
62
|
+
*/
|
|
63
|
+
type = 'numeric';
|
|
122
64
|
/**
|
|
123
65
|
* Shows a dropdown for selecting the page size.
|
|
124
66
|
* When set to `true`, the dropdown will contain the default list of options - 5, 10, 20.
|
|
@@ -131,6 +73,10 @@ export class PagerComponent {
|
|
|
131
73
|
get pageSizeValues() {
|
|
132
74
|
return this._pageSizeValues;
|
|
133
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Toggles the **Previous** and **Next** buttons.
|
|
78
|
+
*/
|
|
79
|
+
previousNext = true;
|
|
134
80
|
/**
|
|
135
81
|
* If set to `true`, the user can use dedicated shortcuts to interact with the Pager ([see example]({% slug keyboard_navigation_pager %})).
|
|
136
82
|
* By default, navigation is disabled and the Pager content is accessible in the normal tab sequence.
|
|
@@ -160,6 +106,22 @@ export class PagerComponent {
|
|
|
160
106
|
get size() {
|
|
161
107
|
return this._size;
|
|
162
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Fires when the current page of the Pager is changed ([see example](slug:overview_pager)).
|
|
111
|
+
* You have to handle the event yourself and page the data.
|
|
112
|
+
*/
|
|
113
|
+
pageChange = new EventEmitter();
|
|
114
|
+
/**
|
|
115
|
+
* Fires when the page size of the Pager is changed.
|
|
116
|
+
* You have to handle the event yourself and page the data.
|
|
117
|
+
* If the event is prevented, the page size will remain unchanged ([see example]({% slug pager_events %})).
|
|
118
|
+
*/
|
|
119
|
+
pageSizeChange = new EventEmitter();
|
|
120
|
+
pagerClass = true;
|
|
121
|
+
widgetRole = 'application';
|
|
122
|
+
roleDescription = 'pager';
|
|
123
|
+
keyShortcuts = 'Enter ArrowRight ArrowLeft';
|
|
124
|
+
hostTabindex = '0';
|
|
163
125
|
get dir() {
|
|
164
126
|
return this.direction;
|
|
165
127
|
}
|
|
@@ -185,6 +147,23 @@ export class PagerComponent {
|
|
|
185
147
|
context.currentPage = this.currentPage;
|
|
186
148
|
return context;
|
|
187
149
|
}
|
|
150
|
+
subscriptions = new Subscription();
|
|
151
|
+
_templateContext = {};
|
|
152
|
+
_pageSizeValues = DEFAULT_PAGE_SIZE_VALUES;
|
|
153
|
+
direction;
|
|
154
|
+
isInnerNavigationEnabled = false;
|
|
155
|
+
_navigable = false;
|
|
156
|
+
_size = DEFAULT_SIZE;
|
|
157
|
+
constructor(pagerContext, element, localization, renderer, ngZone, navigationService) {
|
|
158
|
+
this.pagerContext = pagerContext;
|
|
159
|
+
this.element = element;
|
|
160
|
+
this.localization = localization;
|
|
161
|
+
this.renderer = renderer;
|
|
162
|
+
this.ngZone = ngZone;
|
|
163
|
+
this.navigationService = navigationService;
|
|
164
|
+
validatePackage(packageMetadata);
|
|
165
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
166
|
+
}
|
|
188
167
|
ngOnInit() {
|
|
189
168
|
this.subscriptions.add(this.pagerContext.pageChange.subscribe(this.changePage.bind(this)));
|
|
190
169
|
this.subscriptions.add(this.pagerContext.pageSizeChange.subscribe(this.changePageSize.bind(this)));
|
|
@@ -250,6 +229,43 @@ export class PagerComponent {
|
|
|
250
229
|
this.pageChange.emit({ skip: this.skip, take: event.newPageSize });
|
|
251
230
|
}
|
|
252
231
|
}
|
|
232
|
+
resizeHandler = () => {
|
|
233
|
+
if (this.template?.first) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const width = this.element.nativeElement.offsetWidth;
|
|
237
|
+
this.ngZone.runOutsideAngular(() => {
|
|
238
|
+
setTimeout(() => {
|
|
239
|
+
if (this.numericButtons) {
|
|
240
|
+
const selectElement = this.numericButtons.selectElement.nativeElement;
|
|
241
|
+
const numbersElement = this.numericButtons.numbersElement.nativeElement;
|
|
242
|
+
this.renderer.removeStyle(numbersElement, 'display');
|
|
243
|
+
this.renderer.setStyle(selectElement, 'display', 'none');
|
|
244
|
+
this.renderer.addClass(selectElement, 'k-hidden');
|
|
245
|
+
if (width < RESPONSIVE_BREAKPOINT_MEDIUM) {
|
|
246
|
+
this.renderer.removeStyle(selectElement, 'display');
|
|
247
|
+
this.renderer.removeClass(selectElement, 'k-hidden');
|
|
248
|
+
this.renderer.setStyle(numbersElement, 'display', 'none');
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
this.renderer.addClass(selectElement, 'k-hidden');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (this.pagerInfo) {
|
|
255
|
+
this.renderer.removeStyle(this.pagerInfo.nativeElement, 'display');
|
|
256
|
+
if (width < RESPONSIVE_BREAKPOINT_LARGE) {
|
|
257
|
+
this.renderer.setStyle(this.pagerInfo.nativeElement, 'display', 'none');
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (this.pagerPageSizes) {
|
|
261
|
+
this.renderer.removeStyle(this.pagerPageSizes.nativeElement, 'display');
|
|
262
|
+
if (width < RESPONSIVE_BREAKPOINT_MEDIUM) {
|
|
263
|
+
this.renderer.setStyle(this.pagerPageSizes.nativeElement, 'display', 'none');
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
});
|
|
268
|
+
};
|
|
253
269
|
textFor(value) {
|
|
254
270
|
return this.localization.get(value);
|
|
255
271
|
}
|
|
@@ -320,17 +336,16 @@ export class PagerComponent {
|
|
|
320
336
|
this.renderer.addClass(elem, classes.toAdd);
|
|
321
337
|
}
|
|
322
338
|
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
], queries: [{ propertyName: "template", predicate: PagerTemplateDirective }], viewQueries: [{ propertyName: "resizeSensor", first: true, predicate: ResizeSensorComponent, descendants: true, static: true }, { propertyName: "pagerInfo", first: true, predicate: PagerInfoComponent, descendants: true, read: ElementRef }, { propertyName: "pagerPageSizes", first: true, predicate: PagerPageSizesComponent, descendants: true, read: ElementRef }, { propertyName: "numericButtons", first: true, predicate: PagerNumericButtonsComponent, descendants: true }], exportAs: ["kendoDataPager"], usesOnChanges: true, ngImport: i0, template: `
|
|
339
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerComponent, deps: [{ token: i1.PagerContextService }, { token: i0.ElementRef }, { token: i2.LocalizationService }, { token: i0.Renderer2 }, { token: i0.NgZone }, { token: i3.PagerNavigationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
340
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: PagerComponent, isStandalone: true, selector: "kendo-datapager", inputs: { total: "total", skip: "skip", pageSize: "pageSize", buttonCount: "buttonCount", info: "info", type: "type", pageSizeValues: "pageSizeValues", previousNext: "previousNext", navigable: "navigable", size: "size" }, outputs: { pageChange: "pageChange", pageSizeChange: "pageSizeChange" }, host: { listeners: { "focusin": "focusHandler($event)" }, properties: { "class.k-pager": "this.pagerClass", "attr.role": "this.widgetRole", "attr.aria-roledescription": "this.roleDescription", "attr.aria-keyshortcuts": "this.keyShortcuts", "attr.tabindex": "this.hostTabindex", "attr.dir": "this.dir" } }, providers: [
|
|
341
|
+
LocalizationService,
|
|
342
|
+
PagerContextService,
|
|
343
|
+
PagerNavigationService,
|
|
344
|
+
{
|
|
345
|
+
provide: L10N_PREFIX,
|
|
346
|
+
useValue: 'kendo.pager'
|
|
347
|
+
}
|
|
348
|
+
], queries: [{ propertyName: "template", predicate: PagerTemplateDirective }], viewQueries: [{ propertyName: "resizeSensor", first: true, predicate: ResizeSensorComponent, descendants: true, static: true }, { propertyName: "pagerInfo", first: true, predicate: PagerInfoComponent, descendants: true, read: ElementRef }, { propertyName: "pagerPageSizes", first: true, predicate: PagerPageSizesComponent, descendants: true, read: ElementRef }, { propertyName: "numericButtons", first: true, predicate: PagerNumericButtonsComponent, descendants: true }], exportAs: ["kendoDataPager"], usesOnChanges: true, ngImport: i0, template: `
|
|
334
349
|
<ng-container kendoDataPagerLocalizedMessages
|
|
335
350
|
i18n-firstPage="kendo.pager.firstPage|The label for the first page button in the Pager"
|
|
336
351
|
firstPage="Go to the first page"
|
|
@@ -391,7 +406,8 @@ PagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
391
406
|
</ng-container>
|
|
392
407
|
<kendo-resize-sensor></kendo-resize-sensor>
|
|
393
408
|
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "[kendoDataPagerLocalizedMessages]" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PagerPrevButtonsComponent, selector: "kendo-datapager-prev-buttons", inputs: ["size"] }, { kind: "component", type: PagerNumericButtonsComponent, selector: "kendo-datapager-numeric-buttons", inputs: ["buttonCount", "size"] }, { kind: "component", type: PagerInputComponent, selector: "kendo-datapager-input", inputs: ["size"] }, { kind: "component", type: PagerNextButtonsComponent, selector: "kendo-datapager-next-buttons", inputs: ["size"] }, { kind: "component", type: PagerPageSizesComponent, selector: "kendo-datapager-page-sizes", inputs: ["pageSizes", "size"] }, { kind: "component", type: PagerInfoComponent, selector: "kendo-datapager-info" }, { kind: "component", type: ResizeSensorComponent, selector: "kendo-resize-sensor", inputs: ["rateLimit"], outputs: ["resize"] }] });
|
|
394
|
-
|
|
409
|
+
}
|
|
410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerComponent, decorators: [{
|
|
395
411
|
type: Component,
|
|
396
412
|
args: [{
|
|
397
413
|
selector: 'kendo-datapager',
|
|
@@ -23,15 +23,15 @@ import * as i10 from "./pager.component";
|
|
|
23
23
|
* @hidden
|
|
24
24
|
*/
|
|
25
25
|
export class PagerModule {
|
|
26
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
27
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: PagerModule, imports: [i1.CustomMessagesComponent, i2.PagerFocusableDirective, i3.PagerInfoComponent, i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i9.PagerTemplateDirective, i10.PagerComponent], exports: [i1.CustomMessagesComponent, i2.PagerFocusableDirective, i3.PagerInfoComponent, i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i9.PagerTemplateDirective, i10.PagerComponent] });
|
|
28
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerModule, providers: [
|
|
29
|
+
IconsService,
|
|
30
|
+
PopupService,
|
|
31
|
+
ResizeBatchService
|
|
32
|
+
], imports: [i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i10.PagerComponent] });
|
|
26
33
|
}
|
|
27
|
-
|
|
28
|
-
PagerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: PagerModule, imports: [i1.CustomMessagesComponent, i2.PagerFocusableDirective, i3.PagerInfoComponent, i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i9.PagerTemplateDirective, i10.PagerComponent], exports: [i1.CustomMessagesComponent, i2.PagerFocusableDirective, i3.PagerInfoComponent, i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i9.PagerTemplateDirective, i10.PagerComponent] });
|
|
29
|
-
PagerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagerModule, providers: [
|
|
30
|
-
IconsService,
|
|
31
|
-
PopupService,
|
|
32
|
-
ResizeBatchService
|
|
33
|
-
], imports: [i1.CustomMessagesComponent, i3.PagerInfoComponent, i4.PagerInputComponent, i5.PagerNextButtonsComponent, i6.PagerNumericButtonsComponent, i7.PagerPageSizesComponent, i8.PagerPrevButtonsComponent, i10.PagerComponent] });
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: PagerModule, decorators: [{
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: PagerModule, decorators: [{
|
|
35
35
|
type: NgModule,
|
|
36
36
|
args: [{
|
|
37
37
|
exports: [...KENDO_PAGER],
|
|
@@ -8,6 +8,10 @@ import { PreventableEvent } from './preventable-event';
|
|
|
8
8
|
* is changed from the UI. If you cancel the event, the change is prevented.
|
|
9
9
|
*/
|
|
10
10
|
export class PageSizeChangeEvent extends PreventableEvent {
|
|
11
|
+
/**
|
|
12
|
+
* The newly selected page size.
|
|
13
|
+
*/
|
|
14
|
+
newPageSize;
|
|
11
15
|
/**
|
|
12
16
|
* Constructs the event arguments for the `pageSizeChange` event.
|
|
13
17
|
* @param newPageSize - The newly selected page size.
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
* @hidden
|
|
7
7
|
*/
|
|
8
8
|
export class PreventableEvent {
|
|
9
|
-
|
|
10
|
-
this.prevented = false;
|
|
11
|
-
}
|
|
9
|
+
prevented = false;
|
|
12
10
|
/**
|
|
13
11
|
* Prevents the default action for a specified event.
|
|
14
12
|
* In this way, the source component suppresses the built-in behavior that follows the event.
|