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 all 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
1 change: 1 addition & 0 deletions apps/demos/configs/Angular/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const componentNames = [
'multi-view',
'nested',
'number-box',
'pagination',
'pie-chart',
'pivot-grid-field-chooser',
'pivot-grid',
Expand Down
2 changes: 1 addition & 1 deletion e2e/testcafe-devextreme/helpers/widgetTypings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type WidgetName =
| 'dxPivotGridFieldChooser'
| 'dxDataGrid'
| 'dxTreeList'
| 'dxPager'
| 'dxPagination'
| 'dxRadioGroup'
| 'dxScheduler'
| 'dxTabs'
Expand Down
4 changes: 2 additions & 2 deletions e2e/testcafe-devextreme/tests/pager/accessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fixture.disablePageReloads`Pager`
.page(url(__dirname, '../container.html'));

const options: Options<any> = {
totalCount: [50],
itemCount: [50],

displayMode: ['full', 'compact'],
infoText: [undefined, 'Total {2} items. Page {0} of {1}'],
Expand Down Expand Up @@ -52,7 +52,7 @@ const a11yCheckConfig = {
};

const configuration: Configuration = {
component: 'dxPager',
component: 'dxPagination',
a11yCheckConfig,
options,
created,
Expand Down
22 changes: 11 additions & 11 deletions e2e/testcafe-devextreme/tests/pager/baseProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ test('Pager width and height property', async (t) => {
.eql(null)
.expect(pager.element.getAttribute('height'))
.eql(null);
}).before(async () => createWidget('dxPager', {
}).before(async () => createWidget('dxPagination', {
width: 270,
height: '95px',
totalCount: 50,
itemCount: 50,
}));

test('Pager elementAttr property', async (t) => {
Expand All @@ -30,7 +30,7 @@ test('Pager elementAttr property', async (t) => {
.eql('some description')
.expect(pager.element.getAttribute('data-test'))
.eql('custom data');
}).before(async () => createWidget('dxPager', {
}).before(async () => createWidget('dxPagination', {
elementAttr: {
'aria-label': 'some description',
'data-test': 'custom data',
Expand All @@ -48,11 +48,11 @@ test('Pager hint, disabled and accessKey properties', async (t) => {
.eql('F')
.expect(pager.element.getAttribute('title'))
.eql('Best Pager');
}).before(async () => createWidget('dxPager', {
}).before(async () => createWidget('dxPagination', {
hint: 'Best Pager',
disabled: true,
accessKey: 'F',
totalCount: 50,
itemCount: 50,
}));

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

test('Pager focus method with focusStateEnabled', async (t) => {
Expand All @@ -121,7 +121,7 @@ test('Pager focus method with focusStateEnabled', async (t) => {
await t
.expect(pager.element.focused)
.ok();
}).before(async () => createWidget('dxPager', {
}).before(async () => createWidget('dxPagination', {
focusStateEnabled: true,
totalCount: 50,
itemCount: 50,
}));
16 changes: 8 additions & 8 deletions e2e/testcafe-devextreme/tests/pager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ test('Pager visibile property', async (t) => {
await t
.expect(pager.element.hasClass('dx-state-invisible'))
.ok();
}).before(async () => createWidget('dxPager', {
totalCount: 50,
}).before(async () => createWidget('dxPagination', {
itemCount: 50,
visible: false,
}));

Expand All @@ -22,8 +22,8 @@ test('PageSize selector test', async (t) => {
.click(pager.getPageSize(1).element)
.expect(pager.option('pageCount'))
.eql(13);
}).before(async () => createWidget('dxPager', {
totalCount: 50,
}).before(async () => createWidget('dxPagination', {
itemCount: 50,
pageIndex: 2,
pageSize: 8, // pageCount: 7
allowedPageSizes: [2, 4, 8],
Expand All @@ -38,8 +38,8 @@ test('PageIndex test', async (t) => {
.click(pager.getNavPage('5').element)
.expect(pager.option('pageIndex'))
.eql(5);
}).before(async () => createWidget('dxPager', {
totalCount: 50,
}).before(async () => createWidget('dxPagination', {
itemCount: 50,
pageIndex: 1,
pageSize: 5, // pageCount: 10
}));
Expand All @@ -53,8 +53,8 @@ test('PageIndex correction test', async (t) => {
.click(pager.getPageSize(1).element)
.expect(pager.option('pageIndex'))
.eql(5);
}).before(async () => createWidget('dxPager', {
totalCount: 50,
}).before(async () => createWidget('dxPagination', {
itemCount: 50,
pageIndex: 10,
pageSize: 5, // pageCount: 10
}));
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
1 change: 0 additions & 1 deletion packages/devextreme-angular/src/common/grids/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export {
NewRowInfo,
NewRowPosition,
Pager,
PagerDisplayMode,
PagerPageSize,
PagingBase,
RowDragging,
Expand Down
2 changes: 2 additions & 0 deletions packages/devextreme-angular/src/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export {
DataStructure,
DataType,
Direction,
DisplayMode,
DragDirection,
Draggable,
DragHighlight,
Expand All @@ -28,6 +29,7 @@ export {
Orientation,
PageLoadMode,
PageOrientation,
PagerBase,
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 { DxPaginationComponent, DxPaginationModule } from 'devextreme-angular/ui/pagination';
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 { DxPaginationModule } from 'devextreme-angular/ui/pagination';
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,
DxPaginationModule,
DxPieChartModule,
DxPivotGridModule,
DxPivotGridFieldChooserModule,
Expand Down Expand Up @@ -207,6 +209,7 @@ import { DxTemplateModule } from 'devextreme-angular/core';
DxMenuModule,
DxMultiViewModule,
DxNumberBoxModule,
DxPaginationModule,
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 @@ -806,10 +806,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 @@ -1834,7 +1834,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
8 changes: 4 additions & 4 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,8 @@ import {



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

import {
NestedOptionHost,
Expand All @@ -39,10 +39,10 @@ export class DxoDataGridPagerComponent extends NestedOption implements OnDestroy
}

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

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
70 changes: 70 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,70 @@
/* tslint:disable:max-line-length */

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

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

@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(): DisplayMode {
return this._getOption('displayMode');
}
set displayMode(value: DisplayMode) {
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);
}
}
Loading
Loading