Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎹 Pager: Create d.ts #28055

Merged
merged 46 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
43ad3c9
d.ts spike
Raushen Sep 13, 2024
c5d8c83
Merge branch '24_2' of github.com:DevExpress/DevExtreme into Pager_d.…
Raushen Sep 16, 2024
ce42968
fix build
Raushen Sep 16, 2024
1dd31c7
Fix tests
Raushen Sep 16, 2024
b838826
fix build
Raushen Sep 16, 2024
82204cc
fix build
Raushen Sep 16, 2024
44c0935
Add required doctags
alexslavr Sep 18, 2024
ade816a
Merge branch '24_2' of github.com:DevExpress/DevExtreme into Pager_d.…
Raushen Sep 18, 2024
ba697aa
Fix tests
Raushen Sep 18, 2024
6f32fe2
Merge branch 'Pager_d.ts_2_24_2' of github.com:Raushen/DevExtreme int…
Raushen Sep 18, 2024
12fc29a
Generate wrappers
Raushen Sep 18, 2024
255adbb
Move BasePagerOptions, PagerDisplayMode and PagerPageSize to common.d.ts
Raushen Sep 19, 2024
d76c369
fix build
Raushen Sep 19, 2024
dfe900f
fix build
Raushen Sep 19, 2024
f24c1a3
Set type to allowedPageSizes
Raushen Sep 20, 2024
634d802
resolve conflicts
Raushen Sep 24, 2024
3c5165e
Merge branch '24_2' of github.com:DevExpress/DevExtreme into Pager_d.…
Raushen Sep 24, 2024
16b19d5
Use common namespace in common.d.ts
alexslavr Sep 24, 2024
cd5dda9
Add WA for base options
alexslavr Sep 24, 2024
189f52f
Remove WA. Add @inherits doctag for dxPagerOptions
alexslavr Sep 25, 2024
a31fe82
Merge branch '24_2' into Pager_d.ts_2_24_2
alexslavr Sep 25, 2024
856ea80
Update internal-tools to 16.0.0-beta.5. Regenerate all
alexslavr Sep 25, 2024
07fc986
Fix BasePagerOptions
alexslavr Sep 25, 2024
c614a02
Update namespaces of PagerDisplayMode, PagerPageSize in aliases.ts
alexslavr Sep 25, 2024
c1a8d47
Deprecate PagerDisplayMode, PagerPageSize in common.grid namespace
alexslavr Sep 26, 2024
8a15305
Merge branch '24_2' of github.com:DevExpress/DevExtreme into Pager_d.…
Raushen Sep 26, 2024
26f6eaf
Merge branch 'Pager_d.ts_2_24_2' of github.com:Raushen/DevExtreme int…
Raushen Sep 26, 2024
6e75c29
test
Raushen Sep 26, 2024
124ea2b
Merge branch '24_2' of github.com:DevExpress/DevExtreme into Pager_d.…
Raushen Sep 30, 2024
31c4fa6
Add Pager to components list resolved against Angular umd modules for…
Raushen Sep 30, 2024
7863064
fix tests
Raushen Sep 30, 2024
56bbf7e
Fix tags
IlyaKhD Sep 30, 2024
eaf65eb
Move PagerPageSize back to common/grids
IlyaKhD Oct 3, 2024
b445d6b
Refactor PageSize type
IlyaKhD Oct 3, 2024
3cc72dd
Rename PagerDisplayMode to DisplayMode
IlyaKhD Oct 3, 2024
1ee1588
Add missing re-exports for backward compatipility
IlyaKhD Oct 3, 2024
59bbc0e
Rename BasePagerOptions to PagerBaseOptions
IlyaKhD Oct 3, 2024
77f04b6
Partially rename dxPager to dxPagination (types only)
IlyaKhD Oct 3, 2024
c325f51
rename
pomahtri Oct 8, 2024
2f950f0
gen: regenerate-all
pomahtri Oct 8, 2024
20f05cb
fix: forgotten e2e rename
pomahtri Oct 8, 2024
3fdf91d
fix: forgotten jq rename
pomahtri Oct 8, 2024
0e13086
fix: rename in forgotten qunit tests
pomahtri Oct 8, 2024
41e3cab
fix: forgotten hard-coded configs
pomahtri Oct 8, 2024
ee3b475
fix: rename PagerBaseOptions -> PagerBaseProperties
pomahtri Oct 9, 2024
b7a6d1c
fix: rename to PagerBase
pomahtri Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions e2e/testcafe-devextreme/tests/pager/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ fixture.disablePageReloads`Pager`
.page(url(__dirname, '../container.html'));

const options: Options<any> = {
// disabled: [true, false], //not supported

pageIndex: [2, 5, 30],
displayMode: ['full', 'compact'],
infoText: [undefined, 'Total {2} items. Page {0} of {1}'],
pageCount: [10, 100],
pageSizes: [[1, 2, 3], [3, 6, 9]],
showInfo: [true, false],
showNavigationButtons: [true, false],
Expand Down Expand Up @@ -53,7 +53,7 @@ const created = async (t: TestController, optionConfiguration): Promise<void> =>
};

const a11yCheckConfig = {
// NOTE: color-contrast issues
// NOTE: color-contrast issues
rules: { 'color-contrast': { enabled: false } },
};

Expand Down
10 changes: 5 additions & 5 deletions e2e/testcafe-devextreme/tests/pager/baseProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test('Pager width and height property', async (t) => {
}).before(async () => createWidget('dxPager', {
width: 270,
height: '95px',
totalCount: 50,
itemCount: 50,
}));

test('Pager elementAttr property', async (t) => {
Expand Down Expand Up @@ -52,7 +52,7 @@ test('Pager hint, disabled and accessKey properties', async (t) => {
hint: 'Best Pager',
disabled: true,
accessKey: 'F',
totalCount: 50,
itemCount: 50,
}));

test('Pager tabindex and state properties', async (t) => {
Expand Down Expand Up @@ -81,7 +81,7 @@ test('Pager tabindex and state properties', async (t) => {
.expect(pager.element.hasClass('dx-state-active'))
.ok();
}).before(async () => createWidget('dxPager', {
totalCount: 50,
itemCount: 50,
disabled: false,
width: '100%',
focusStateEnabled: true,
Expand All @@ -105,7 +105,7 @@ test('Pager focus method without focusStateEnabled', async (t) => {
.ok();
}).before(async () => createWidget('dxPager', {
focusStateEnabled: false,
totalCount: 50,
itemCount: 50,
}));

test('Pager focus method with focusStateEnabled', async (t) => {
Expand All @@ -123,5 +123,5 @@ test('Pager focus method with focusStateEnabled', async (t) => {
.ok();
}).before(async () => createWidget('dxPager', {
focusStateEnabled: true,
totalCount: 50,
itemCount: 50,
}));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"axe-core": "4.10.0",
"cheerio": "1.0.0-rc.10",
"codelyzer": "6.0.2",
"devextreme-internal-tools": "16.0.0-beta.4",
"devextreme-internal-tools": "16.0.0-beta.5",
"http-server": "14.1.1",
"husky": "8.0.3",
"jest": "29.7.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/devextreme-angular/src/common/grids/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ export {
NewRowInfo,
NewRowPosition,
Pager,
PagerDisplayMode,
PagerPageSize,
PagingBase,
RowDragging,
RowDraggingTemplateData,
Expand Down
4 changes: 4 additions & 0 deletions packages/devextreme-angular/src/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export {
ApplyValueMode,
AsyncRule,
BasePagerOptions,
ButtonStyle,
ButtonType,
CompareRule,
Expand Down Expand Up @@ -28,6 +29,9 @@ export {
Orientation,
PageLoadMode,
PageOrientation,
PagerAllPagesMode,
PagerDisplayMode,
PagerPageSize,
PatternRule,
Position,
PositionAlignment,
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme-angular/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export { DxMapComponent, DxMapModule } from 'devextreme-angular/ui/map';
export { DxMenuComponent, DxMenuModule } from 'devextreme-angular/ui/menu';
export { DxMultiViewComponent, DxMultiViewModule } from 'devextreme-angular/ui/multi-view';
export { DxNumberBoxComponent, DxNumberBoxModule } from 'devextreme-angular/ui/number-box';
export { DxPagerComponent, DxPagerModule } from 'devextreme-angular/ui/pager';
export { DxPieChartComponent, DxPieChartModule } from 'devextreme-angular/ui/pie-chart';
export { DxPivotGridComponent, DxPivotGridModule } from 'devextreme-angular/ui/pivot-grid';
export { DxPivotGridFieldChooserComponent, DxPivotGridFieldChooserModule } from 'devextreme-angular/ui/pivot-grid-field-chooser';
Expand Down
3 changes: 3 additions & 0 deletions packages/devextreme-angular/src/ui/all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { DxMapModule } from 'devextreme-angular/ui/map';
import { DxMenuModule } from 'devextreme-angular/ui/menu';
import { DxMultiViewModule } from 'devextreme-angular/ui/multi-view';
import { DxNumberBoxModule } from 'devextreme-angular/ui/number-box';
import { DxPagerModule } from 'devextreme-angular/ui/pager';
import { DxPieChartModule } from 'devextreme-angular/ui/pie-chart';
import { DxPivotGridModule } from 'devextreme-angular/ui/pivot-grid';
import { DxPivotGridFieldChooserModule } from 'devextreme-angular/ui/pivot-grid-field-chooser';
Expand Down Expand Up @@ -124,6 +125,7 @@ import { DxTemplateModule } from 'devextreme-angular/core';
DxMenuModule,
DxMultiViewModule,
DxNumberBoxModule,
DxPagerModule,
DxPieChartModule,
DxPivotGridModule,
DxPivotGridFieldChooserModule,
Expand Down Expand Up @@ -207,6 +209,7 @@ import { DxTemplateModule } from 'devextreme-angular/core';
DxMenuModule,
DxMultiViewModule,
DxNumberBoxModule,
DxPagerModule,
DxPieChartModule,
DxPivotGridModule,
DxPivotGridFieldChooserModule,
Expand Down
8 changes: 4 additions & 4 deletions packages/devextreme-angular/src/ui/data-grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export { ExplicitTypes } from 'devextreme/ui/data_grid';

import { PositionConfig } from 'devextreme/animation/position';
import { DragDirection, DragHighlight, HorizontalAlignment, Mode, ScrollbarMode, SelectAllMode, SingleMultipleOrNone, SortOrder } from 'devextreme/common';
import { ApplyFilterMode, ColumnChooserMode, ColumnChooserSearchConfig, ColumnChooserSelectionConfig, ColumnResizeMode, DataChange, DataRenderMode, EnterKeyAction, EnterKeyDirection, GridsEditMode, GridsEditRefreshMode, GroupExpandMode, HeaderFilterSearchConfig, NewRowPosition, PagerDisplayMode, PagerPageSize, SelectionColumnDisplayMode, StartEditAction, StateStoreType, SummaryType } from 'devextreme/common/grids';
import { ApplyFilterMode, ColumnChooserMode, ColumnChooserSearchConfig, ColumnChooserSelectionConfig, ColumnResizeMode, DataChange, DataRenderMode, EnterKeyAction, EnterKeyDirection, GridsEditMode, GridsEditRefreshMode, GroupExpandMode, HeaderFilterSearchConfig, NewRowPosition, Pager, SelectionColumnDisplayMode, StartEditAction, StateStoreType, SummaryType } from 'devextreme/common/grids';
import { UserDefinedElement } from 'devextreme/core/element';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
Expand Down Expand Up @@ -804,10 +804,10 @@ export class DxDataGridComponent<TRowData = any, TKey = any> extends DxComponent

*/
@Input()
get pager(): { allowedPageSizes?: Mode | Array<PagerPageSize | number>, displayMode?: PagerDisplayMode, infoText?: string, label?: string, showInfo?: boolean, showNavigationButtons?: boolean, showPageSizeSelector?: boolean, visible?: Mode | boolean } {
get pager(): Pager {
return this._getOption('pager');
}
set pager(value: { allowedPageSizes?: Mode | Array<PagerPageSize | number>, displayMode?: PagerDisplayMode, infoText?: string, label?: string, showInfo?: boolean, showNavigationButtons?: boolean, showPageSizeSelector?: boolean, visible?: Mode | boolean }) {
set pager(value: Pager) {
this._setOption('pager', value);
}

Expand Down Expand Up @@ -1832,7 +1832,7 @@ export class DxDataGridComponent<TRowData = any, TKey = any> extends DxComponent
* This member supports the internal infrastructure and is not intended to be used directly from your code.

*/
@Output() pagerChange: EventEmitter<{ allowedPageSizes?: Mode | Array<PagerPageSize | number>, displayMode?: PagerDisplayMode, infoText?: string, label?: string, showInfo?: boolean, showNavigationButtons?: boolean, showPageSizeSelector?: boolean, visible?: Mode | boolean }>;
@Output() pagerChange: EventEmitter<Pager>;

/**

Expand Down
3 changes: 1 addition & 2 deletions packages/devextreme-angular/src/ui/data-grid/nested/pager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import {



import { Mode } from 'devextreme/common';
import { PagerDisplayMode, PagerPageSize } from 'devextreme/common/grids';
import { Mode, PagerDisplayMode, PagerPageSize } from 'devextreme/common';

import {
NestedOptionHost,
Expand Down
1 change: 1 addition & 0 deletions packages/devextreme-angular/src/ui/nested/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export * from './html-editor-mention-dxi';
export * from './html-editor-table-context-menu';
export * from './html-editor-table-resizing';
export * from './html-editor-variables';
export * from './pager';
export * from './pivot-grid-data-source';
export * from './popup-options';
export * from './position-config';
Expand Down
69 changes: 69 additions & 0 deletions packages/devextreme-angular/src/ui/nested/base/pager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* tslint:disable:max-line-length */

import { NestedOption } from 'devextreme-angular/core';
import {
Component,
} from '@angular/core';

import { Mode, PagerDisplayMode, PagerPageSize } from 'devextreme/common';

@Component({
template: ''
})
export abstract class DxoPager extends NestedOption {
get allowedPageSizes(): Mode | Array<PagerPageSize | number> {
return this._getOption('allowedPageSizes');
}
set allowedPageSizes(value: Mode | Array<PagerPageSize | number>) {
this._setOption('allowedPageSizes', value);
}

get displayMode(): PagerDisplayMode {
return this._getOption('displayMode');
}
set displayMode(value: PagerDisplayMode) {
this._setOption('displayMode', value);
}

get infoText(): string {
return this._getOption('infoText');
}
set infoText(value: string) {
this._setOption('infoText', value);
}

get label(): string {
return this._getOption('label');
}
set label(value: string) {
this._setOption('label', value);
}

get showInfo(): boolean {
return this._getOption('showInfo');
}
set showInfo(value: boolean) {
this._setOption('showInfo', value);
}

get showNavigationButtons(): boolean {
return this._getOption('showNavigationButtons');
}
set showNavigationButtons(value: boolean) {
this._setOption('showNavigationButtons', value);
}

get showPageSizeSelector(): boolean {
return this._getOption('showPageSizeSelector');
}
set showPageSizeSelector(value: boolean) {
this._setOption('showPageSizeSelector', value);
}

get visible(): Mode | boolean {
return this._getOption('visible');
}
set visible(value: Mode | boolean) {
this._setOption('visible', value);
}
}
86 changes: 15 additions & 71 deletions packages/devextreme-angular/src/ui/nested/pager.ts
Original file line number Diff line number Diff line change
@@ -1,99 +1,43 @@
/* tslint:disable:max-line-length */

/* tslint:disable:use-input-property-decorator */

import {
Component,
OnInit,
OnDestroy,
NgModule,
Host,
SkipSelf,
Input
SkipSelf
} from '@angular/core';




import { Mode } from 'devextreme/common';
import { PagerDisplayMode, PagerPageSize } from 'devextreme/common/grids';

import {
NestedOptionHost,
} from 'devextreme-angular/core';
import { NestedOption } from 'devextreme-angular/core';
import { DxoPager } from './base/pager';


@Component({
selector: 'dxo-pager',
template: '',
styles: [''],
providers: [NestedOptionHost]
providers: [NestedOptionHost],
inputs: [
'allowedPageSizes',
'displayMode',
'infoText',
'label',
'showInfo',
'showNavigationButtons',
'showPageSizeSelector',
'visible'
]
})
export class DxoPagerComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get allowedPageSizes(): Mode | Array<PagerPageSize | number> {
return this._getOption('allowedPageSizes');
}
set allowedPageSizes(value: Mode | Array<PagerPageSize | number>) {
this._setOption('allowedPageSizes', value);
}

@Input()
get displayMode(): PagerDisplayMode {
return this._getOption('displayMode');
}
set displayMode(value: PagerDisplayMode) {
this._setOption('displayMode', value);
}

@Input()
get infoText(): string {
return this._getOption('infoText');
}
set infoText(value: string) {
this._setOption('infoText', value);
}

@Input()
get label(): string {
return this._getOption('label');
}
set label(value: string) {
this._setOption('label', value);
}

@Input()
get showInfo(): boolean {
return this._getOption('showInfo');
}
set showInfo(value: boolean) {
this._setOption('showInfo', value);
}

@Input()
get showNavigationButtons(): boolean {
return this._getOption('showNavigationButtons');
}
set showNavigationButtons(value: boolean) {
this._setOption('showNavigationButtons', value);
}

@Input()
get showPageSizeSelector(): boolean {
return this._getOption('showPageSizeSelector');
}
set showPageSizeSelector(value: boolean) {
this._setOption('showPageSizeSelector', value);
}

@Input()
get visible(): Mode | boolean {
return this._getOption('visible');
}
set visible(value: Mode | boolean) {
this._setOption('visible', value);
}

export class DxoPagerComponent extends DxoPager implements OnDestroy, OnInit {

protected get _optionPath() {
return 'pager';
Expand Down
Loading
Loading