diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-blue-light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-blue-light).png index 025fd8eabeda..4ca2ab5d59ab 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-blue-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (fluent-blue-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic-light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic-light).png index 9cf676de87d6..3b4fefc34e8a 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (generic-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material-blue-light).png b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material-blue-light).png index 563a2d7aa912..852c8ad6c2e0 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material-blue-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/Icon set (material-blue-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-blue-light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-blue-light).png index e3995d1a8891..941835f0db4f 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-blue-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (fluent-blue-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic-light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic-light).png index a5133735966b..78c462d0bc46 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (generic-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material-blue-light).png b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material-blue-light).png index 5a1866c88b10..a7e78a0816ce 100644 Binary files a/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material-blue-light).png and b/e2e/testcafe-devextreme/tests/common/etalons/SVG icon set (material-blue-light).png differ diff --git a/e2e/testcafe-devextreme/tests/common/icons.ts b/e2e/testcafe-devextreme/tests/common/icons.ts index 9cc524486bd8..58c8b300cfa8 100644 --- a/e2e/testcafe-devextreme/tests/common/icons.ts +++ b/e2e/testcafe-devextreme/tests/common/icons.ts @@ -271,6 +271,11 @@ const iconSet = { triangleleft: '\f16e', sendfilled: '\f09a', chat: '\f17e', + fixcolumn: '\f16f', + unfixcolumn: '\f17a', + fixcolumnleft: '\f17b', + stickcolumn: '\f17c', + fixcolumnright: '\f17d', }; fixture.disablePageReloads`Icons` diff --git a/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.dark.png b/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.dark.png index 61bf9ef87238..c4ff99648d5a 100644 Binary files a/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.dark.png and b/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.dark.png differ diff --git a/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.light.png b/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.light.png index 653de1506a18..5a13b3f2ce86 100644 Binary files a/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.light.png and b/e2e/testcafe-devextreme/tests/dataGrid/accessibility/etalons/context-menu_fluent.blue.light.png differ diff --git a/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/columnFixingIcons.ts b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/columnFixingIcons.ts new file mode 100644 index 000000000000..218db11c5309 --- /dev/null +++ b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/columnFixingIcons.ts @@ -0,0 +1,53 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ +import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; +import DataGrid from 'devextreme-testcafe-models/dataGrid'; +import url from '../../../helpers/getPageUrl'; +import { createWidget } from '../../../helpers/createWidget'; +import { changeTheme } from '../../../helpers/changeTheme'; +import { Themes } from '../../../helpers/themes'; +import { getData } from '../helpers/generateDataSourceData'; + +fixture.disablePageReloads`Column Fixing`.page( + url(__dirname, '../container.html'), +); + +[Themes.genericLight, Themes.materialBlue, Themes.fluentBlue].forEach( + (theme) => { + test('Fixed columns: add icons for context menu', async (t) => { + const dataGrid = new DataGrid('#container'); + const { takeScreenshot, compareResults } = createScreenshotsComparer(t); + await t + .rightClick(dataGrid.getHeaders().getHeaderRow(0).element) + .click(dataGrid.getContextMenu().getItemByOrder(4)) + .expect( + await takeScreenshot( + `sticky_columns_menu_icons_(${theme}).png`, + dataGrid.element, + ), + ) + .ok() + .expect(compareResults.isValid()) + .ok(compareResults.errorMessages()); + }) + .before(async () => { + await changeTheme(theme); + await createWidget('dxDataGrid', { + dataSource: getData(5, 5), + width: '100%', + columnFixing: { + enabled: true, + texts: { + stickyPosition: 'Stick', + }, + }, + customizeColumns: (columns) => { + columns[1].fixed = true; + columns[1].fixedPosition = 'sticky'; + }, + }); + }) + .after(async () => { + await changeTheme(Themes.genericLight); + }); + }, +); diff --git a/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(fluent.blue.light).png b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(fluent.blue.light).png new file mode 100644 index 000000000000..857d4bdf4574 Binary files /dev/null and b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(fluent.blue.light).png differ diff --git a/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(generic.light).png b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(generic.light).png new file mode 100644 index 000000000000..525f04c98eed Binary files /dev/null and b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(generic.light).png differ diff --git a/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(material.blue.light).png b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(material.blue.light).png new file mode 100644 index 000000000000..f609558942f6 Binary files /dev/null and b/e2e/testcafe-devextreme/tests/dataGrid/stickyColumns/etalons/sticky_columns_menu_icons_(material.blue.light).png differ diff --git a/packages/devextreme-angular/src/common/grids/index.ts b/packages/devextreme-angular/src/common/grids/index.ts index 361c09678876..12ccf6a627f5 100644 --- a/packages/devextreme-angular/src/common/grids/index.ts +++ b/packages/devextreme-angular/src/common/grids/index.ts @@ -10,6 +10,7 @@ export { ColumnChooserSelectionConfig, ColumnCustomizeTextArg, ColumnFixing, + ColumnFixingIcons, ColumnFixingTexts, ColumnHeaderFilter, ColumnHeaderFilterSearchConfig, diff --git a/packages/devextreme-angular/src/ui/data-grid/index.ts b/packages/devextreme-angular/src/ui/data-grid/index.ts index c1e711821b3d..cfadb69dfedd 100644 --- a/packages/devextreme-angular/src/ui/data-grid/index.ts +++ b/packages/devextreme-angular/src/ui/data-grid/index.ts @@ -58,6 +58,7 @@ import { DxoOffsetModule } from 'devextreme-angular/ui/nested'; import { DxoSearchModule } from 'devextreme-angular/ui/nested'; import { DxoSelectionModule } from 'devextreme-angular/ui/nested'; import { DxoColumnFixingModule } from 'devextreme-angular/ui/nested'; +import { DxoIconsModule } from 'devextreme-angular/ui/nested'; import { DxoTextsModule } from 'devextreme-angular/ui/nested'; import { DxiColumnModule } from 'devextreme-angular/ui/nested'; import { DxiButtonModule } from 'devextreme-angular/ui/nested'; @@ -122,6 +123,7 @@ import { DxoDataGridOffsetModule } from 'devextreme-angular/ui/data-grid/nested' import { DxoDataGridSearchModule } from 'devextreme-angular/ui/data-grid/nested'; import { DxoDataGridSelectionModule } from 'devextreme-angular/ui/data-grid/nested'; import { DxoDataGridColumnFixingModule } from 'devextreme-angular/ui/data-grid/nested'; +import { DxoDataGridIconsModule } from 'devextreme-angular/ui/data-grid/nested'; import { DxoDataGridTextsModule } from 'devextreme-angular/ui/data-grid/nested'; import { DxiDataGridColumnModule } from 'devextreme-angular/ui/data-grid/nested'; import { DxiDataGridButtonModule } from 'devextreme-angular/ui/data-grid/nested'; @@ -323,10 +325,10 @@ export class DxDataGridComponent extends DxComponent */ @Input() - get columnFixing(): { enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } } { + get columnFixing(): { enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } } { return this._getOption('columnFixing'); } - set columnFixing(value: { enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } }) { + set columnFixing(value: { enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } }) { this._setOption('columnFixing', value); } @@ -1573,7 +1575,7 @@ export class DxDataGridComponent extends DxComponent * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() columnFixingChange: EventEmitter<{ enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } }>; + @Output() columnFixingChange: EventEmitter<{ enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } }>; /** @@ -2265,6 +2267,7 @@ export class DxDataGridComponent extends DxComponent DxoSearchModule, DxoSelectionModule, DxoColumnFixingModule, + DxoIconsModule, DxoTextsModule, DxiColumnModule, DxiButtonModule, @@ -2328,6 +2331,7 @@ export class DxDataGridComponent extends DxComponent DxoDataGridSearchModule, DxoDataGridSelectionModule, DxoDataGridColumnFixingModule, + DxoDataGridIconsModule, DxoDataGridTextsModule, DxiDataGridColumnModule, DxiDataGridButtonModule, @@ -2400,6 +2404,7 @@ export class DxDataGridComponent extends DxComponent DxoSearchModule, DxoSelectionModule, DxoColumnFixingModule, + DxoIconsModule, DxoTextsModule, DxiColumnModule, DxiButtonModule, @@ -2463,6 +2468,7 @@ export class DxDataGridComponent extends DxComponent DxoDataGridSearchModule, DxoDataGridSelectionModule, DxoDataGridColumnFixingModule, + DxoDataGridIconsModule, DxoDataGridTextsModule, DxiDataGridColumnModule, DxiDataGridButtonModule, diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/column-fixing.ts b/packages/devextreme-angular/src/ui/data-grid/nested/column-fixing.ts index adabb32da4c9..c01974e14669 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/column-fixing.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/column-fixing.ts @@ -37,10 +37,18 @@ export class DxoDataGridColumnFixingComponent extends NestedOption implements On } @Input() - get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } { + get icons(): { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string } { + return this._getOption('icons'); + } + set icons(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }) { + this._setOption('icons', value); + } + + @Input() + get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } { return this._getOption('texts'); } - set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string }) { + set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string }) { this._setOption('texts', value); } diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/icons.ts b/packages/devextreme-angular/src/ui/data-grid/nested/icons.ts new file mode 100644 index 000000000000..c6ab29e22b0d --- /dev/null +++ b/packages/devextreme-angular/src/ui/data-grid/nested/icons.ts @@ -0,0 +1,104 @@ +/* tslint:disable:max-line-length */ + + +import { + Component, + OnInit, + OnDestroy, + NgModule, + Host, + SkipSelf, + Input +} from '@angular/core'; + + + + + +import { + NestedOptionHost, +} from 'devextreme-angular/core'; +import { NestedOption } from 'devextreme-angular/core'; + + +@Component({ + selector: 'dxo-data-grid-icons', + template: '', + styles: [''], + providers: [NestedOptionHost] +}) +export class DxoDataGridIconsComponent extends NestedOption implements OnDestroy, OnInit { + @Input() + get fix(): string { + return this._getOption('fix'); + } + set fix(value: string) { + this._setOption('fix', value); + } + + @Input() + get leftPosition(): string { + return this._getOption('leftPosition'); + } + set leftPosition(value: string) { + this._setOption('leftPosition', value); + } + + @Input() + get rightPosition(): string { + return this._getOption('rightPosition'); + } + set rightPosition(value: string) { + this._setOption('rightPosition', value); + } + + @Input() + get stickyPosition(): string { + return this._getOption('stickyPosition'); + } + set stickyPosition(value: string) { + this._setOption('stickyPosition', value); + } + + @Input() + get unfix(): string { + return this._getOption('unfix'); + } + set unfix(value: string) { + this._setOption('unfix', value); + } + + + protected get _optionPath() { + return 'icons'; + } + + + constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, + @Host() optionHost: NestedOptionHost) { + super(); + parentOptionHost.setNestedOption(this); + optionHost.setHost(this, this._fullOptionPath.bind(this)); + } + + + ngOnInit() { + this._addRecreatedComponent(); + } + + ngOnDestroy() { + this._addRemovedOption(this._getOptionPath()); + } + + +} + +@NgModule({ + declarations: [ + DxoDataGridIconsComponent + ], + exports: [ + DxoDataGridIconsComponent + ], +}) +export class DxoDataGridIconsModule { } diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/index.ts b/packages/devextreme-angular/src/ui/data-grid/nested/index.ts index feb3985c8d0e..1a1b81c78e80 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/index.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/index.ts @@ -29,6 +29,7 @@ export * from './group-panel'; export * from './grouping'; export * from './header-filter'; export * from './hide'; +export * from './icons'; export * from './item-dxi'; export * from './keyboard-navigation'; export * from './label'; diff --git a/packages/devextreme-angular/src/ui/data-grid/nested/texts.ts b/packages/devextreme-angular/src/ui/data-grid/nested/texts.ts index 0fec83d2f221..74309699dbbc 100644 --- a/packages/devextreme-angular/src/ui/data-grid/nested/texts.ts +++ b/packages/devextreme-angular/src/ui/data-grid/nested/texts.ts @@ -52,6 +52,14 @@ export class DxoDataGridTextsComponent extends NestedOption implements OnDestroy this._setOption('rightPosition', value); } + @Input() + get stickPosition(): string { + return this._getOption('stickPosition'); + } + set stickPosition(value: string) { + this._setOption('stickPosition', value); + } + @Input() get unfix(): string { return this._getOption('unfix'); diff --git a/packages/devextreme-angular/src/ui/nested/base/gantt-header-filter-texts.ts b/packages/devextreme-angular/src/ui/nested/base/gantt-header-filter-texts.ts index 8bff036b5b1c..86804456713c 100644 --- a/packages/devextreme-angular/src/ui/nested/base/gantt-header-filter-texts.ts +++ b/packages/devextreme-angular/src/ui/nested/base/gantt-header-filter-texts.ts @@ -31,6 +31,13 @@ export abstract class DxoGanttHeaderFilterTexts extends NestedOption { this._setOption('rightPosition', value); } + get stickPosition(): string { + return this._getOption('stickPosition'); + } + set stickPosition(value: string) { + this._setOption('stickPosition', value); + } + get unfix(): string { return this._getOption('unfix'); } diff --git a/packages/devextreme-angular/src/ui/nested/column-fixing.ts b/packages/devextreme-angular/src/ui/nested/column-fixing.ts index 17e5039903d0..b001770c3206 100644 --- a/packages/devextreme-angular/src/ui/nested/column-fixing.ts +++ b/packages/devextreme-angular/src/ui/nested/column-fixing.ts @@ -37,10 +37,18 @@ export class DxoColumnFixingComponent extends NestedOption implements OnDestroy, } @Input() - get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } { + get icons(): { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string } { + return this._getOption('icons'); + } + set icons(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }) { + this._setOption('icons', value); + } + + @Input() + get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } { return this._getOption('texts'); } - set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string }) { + set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string }) { this._setOption('texts', value); } diff --git a/packages/devextreme-angular/src/ui/nested/icons.ts b/packages/devextreme-angular/src/ui/nested/icons.ts new file mode 100644 index 000000000000..f3a0e43a1b0a --- /dev/null +++ b/packages/devextreme-angular/src/ui/nested/icons.ts @@ -0,0 +1,104 @@ +/* tslint:disable:max-line-length */ + + +import { + Component, + OnInit, + OnDestroy, + NgModule, + Host, + SkipSelf, + Input +} from '@angular/core'; + + + + + +import { + NestedOptionHost, +} from 'devextreme-angular/core'; +import { NestedOption } from 'devextreme-angular/core'; + + +@Component({ + selector: 'dxo-icons', + template: '', + styles: [''], + providers: [NestedOptionHost] +}) +export class DxoIconsComponent extends NestedOption implements OnDestroy, OnInit { + @Input() + get fix(): string { + return this._getOption('fix'); + } + set fix(value: string) { + this._setOption('fix', value); + } + + @Input() + get leftPosition(): string { + return this._getOption('leftPosition'); + } + set leftPosition(value: string) { + this._setOption('leftPosition', value); + } + + @Input() + get rightPosition(): string { + return this._getOption('rightPosition'); + } + set rightPosition(value: string) { + this._setOption('rightPosition', value); + } + + @Input() + get stickyPosition(): string { + return this._getOption('stickyPosition'); + } + set stickyPosition(value: string) { + this._setOption('stickyPosition', value); + } + + @Input() + get unfix(): string { + return this._getOption('unfix'); + } + set unfix(value: string) { + this._setOption('unfix', value); + } + + + protected get _optionPath() { + return 'icons'; + } + + + constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, + @Host() optionHost: NestedOptionHost) { + super(); + parentOptionHost.setNestedOption(this); + optionHost.setHost(this, this._fullOptionPath.bind(this)); + } + + + ngOnInit() { + this._addRecreatedComponent(); + } + + ngOnDestroy() { + this._addRemovedOption(this._getOptionPath()); + } + + +} + +@NgModule({ + declarations: [ + DxoIconsComponent + ], + exports: [ + DxoIconsComponent + ], +}) +export class DxoIconsModule { } diff --git a/packages/devextreme-angular/src/ui/nested/index.ts b/packages/devextreme-angular/src/ui/nested/index.ts index 264bfc5c79e1..db795772b40d 100644 --- a/packages/devextreme-angular/src/ui/nested/index.ts +++ b/packages/devextreme-angular/src/ui/nested/index.ts @@ -102,6 +102,7 @@ export * from './hide'; export * from './history-toolbar'; export * from './horizontal-line'; export * from './hover-style'; +export * from './icons'; export * from './image-upload'; export * from './image'; export * from './indent'; diff --git a/packages/devextreme-angular/src/ui/nested/texts.ts b/packages/devextreme-angular/src/ui/nested/texts.ts index 93b1c9af14fe..ede4d951a6c9 100644 --- a/packages/devextreme-angular/src/ui/nested/texts.ts +++ b/packages/devextreme-angular/src/ui/nested/texts.ts @@ -30,6 +30,7 @@ import { DxoGanttHeaderFilterTexts } from './base/gantt-header-filter-texts'; 'fix', 'leftPosition', 'rightPosition', + 'stickPosition', 'unfix', 'addRow', 'cancelAllChanges', diff --git a/packages/devextreme-angular/src/ui/tree-list/index.ts b/packages/devextreme-angular/src/ui/tree-list/index.ts index 11e7eddf39f2..3042b0492c8d 100644 --- a/packages/devextreme-angular/src/ui/tree-list/index.ts +++ b/packages/devextreme-angular/src/ui/tree-list/index.ts @@ -57,6 +57,7 @@ import { DxoOffsetModule } from 'devextreme-angular/ui/nested'; import { DxoSearchModule } from 'devextreme-angular/ui/nested'; import { DxoSelectionModule } from 'devextreme-angular/ui/nested'; import { DxoColumnFixingModule } from 'devextreme-angular/ui/nested'; +import { DxoIconsModule } from 'devextreme-angular/ui/nested'; import { DxoTextsModule } from 'devextreme-angular/ui/nested'; import { DxiColumnModule } from 'devextreme-angular/ui/nested'; import { DxiButtonModule } from 'devextreme-angular/ui/nested'; @@ -112,6 +113,7 @@ import { DxoTreeListOffsetModule } from 'devextreme-angular/ui/tree-list/nested' import { DxoTreeListSearchModule } from 'devextreme-angular/ui/tree-list/nested'; import { DxoTreeListSelectionModule } from 'devextreme-angular/ui/tree-list/nested'; import { DxoTreeListColumnFixingModule } from 'devextreme-angular/ui/tree-list/nested'; +import { DxoTreeListIconsModule } from 'devextreme-angular/ui/tree-list/nested'; import { DxoTreeListTextsModule } from 'devextreme-angular/ui/tree-list/nested'; import { DxiTreeListColumnModule } from 'devextreme-angular/ui/tree-list/nested'; import { DxiTreeListButtonModule } from 'devextreme-angular/ui/tree-list/nested'; @@ -315,10 +317,10 @@ export class DxTreeListComponent extends DxComponent */ @Input() - get columnFixing(): { enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } } { + get columnFixing(): { enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } } { return this._getOption('columnFixing'); } - set columnFixing(value: { enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } }) { + set columnFixing(value: { enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } }) { this._setOption('columnFixing', value); } @@ -1557,7 +1559,7 @@ export class DxTreeListComponent extends DxComponent * This member supports the internal infrastructure and is not intended to be used directly from your code. */ - @Output() columnFixingChange: EventEmitter<{ enabled?: boolean, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } }>; + @Output() columnFixingChange: EventEmitter<{ enabled?: boolean, icons?: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }, texts?: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } }>; /** @@ -2221,6 +2223,7 @@ export class DxTreeListComponent extends DxComponent DxoSearchModule, DxoSelectionModule, DxoColumnFixingModule, + DxoIconsModule, DxoTextsModule, DxiColumnModule, DxiButtonModule, @@ -2275,6 +2278,7 @@ export class DxTreeListComponent extends DxComponent DxoTreeListSearchModule, DxoTreeListSelectionModule, DxoTreeListColumnFixingModule, + DxoTreeListIconsModule, DxoTreeListTextsModule, DxiTreeListColumnModule, DxiTreeListButtonModule, @@ -2338,6 +2342,7 @@ export class DxTreeListComponent extends DxComponent DxoSearchModule, DxoSelectionModule, DxoColumnFixingModule, + DxoIconsModule, DxoTextsModule, DxiColumnModule, DxiButtonModule, @@ -2392,6 +2397,7 @@ export class DxTreeListComponent extends DxComponent DxoTreeListSearchModule, DxoTreeListSelectionModule, DxoTreeListColumnFixingModule, + DxoTreeListIconsModule, DxoTreeListTextsModule, DxiTreeListColumnModule, DxiTreeListButtonModule, diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/column-fixing.ts b/packages/devextreme-angular/src/ui/tree-list/nested/column-fixing.ts index bb8866e950c7..22c1642260ac 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/column-fixing.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/column-fixing.ts @@ -37,10 +37,18 @@ export class DxoTreeListColumnFixingComponent extends NestedOption implements On } @Input() - get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string } { + get icons(): { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string } { + return this._getOption('icons'); + } + set icons(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickyPosition?: string, unfix?: string }) { + this._setOption('icons', value); + } + + @Input() + get texts(): { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string } { return this._getOption('texts'); } - set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, unfix?: string }) { + set texts(value: { fix?: string, leftPosition?: string, rightPosition?: string, stickPosition?: string, unfix?: string }) { this._setOption('texts', value); } diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/icons.ts b/packages/devextreme-angular/src/ui/tree-list/nested/icons.ts new file mode 100644 index 000000000000..55a01f9a58ac --- /dev/null +++ b/packages/devextreme-angular/src/ui/tree-list/nested/icons.ts @@ -0,0 +1,104 @@ +/* tslint:disable:max-line-length */ + + +import { + Component, + OnInit, + OnDestroy, + NgModule, + Host, + SkipSelf, + Input +} from '@angular/core'; + + + + + +import { + NestedOptionHost, +} from 'devextreme-angular/core'; +import { NestedOption } from 'devextreme-angular/core'; + + +@Component({ + selector: 'dxo-tree-list-icons', + template: '', + styles: [''], + providers: [NestedOptionHost] +}) +export class DxoTreeListIconsComponent extends NestedOption implements OnDestroy, OnInit { + @Input() + get fix(): string { + return this._getOption('fix'); + } + set fix(value: string) { + this._setOption('fix', value); + } + + @Input() + get leftPosition(): string { + return this._getOption('leftPosition'); + } + set leftPosition(value: string) { + this._setOption('leftPosition', value); + } + + @Input() + get rightPosition(): string { + return this._getOption('rightPosition'); + } + set rightPosition(value: string) { + this._setOption('rightPosition', value); + } + + @Input() + get stickyPosition(): string { + return this._getOption('stickyPosition'); + } + set stickyPosition(value: string) { + this._setOption('stickyPosition', value); + } + + @Input() + get unfix(): string { + return this._getOption('unfix'); + } + set unfix(value: string) { + this._setOption('unfix', value); + } + + + protected get _optionPath() { + return 'icons'; + } + + + constructor(@SkipSelf() @Host() parentOptionHost: NestedOptionHost, + @Host() optionHost: NestedOptionHost) { + super(); + parentOptionHost.setNestedOption(this); + optionHost.setHost(this, this._fullOptionPath.bind(this)); + } + + + ngOnInit() { + this._addRecreatedComponent(); + } + + ngOnDestroy() { + this._addRemovedOption(this._getOptionPath()); + } + + +} + +@NgModule({ + declarations: [ + DxoTreeListIconsComponent + ], + exports: [ + DxoTreeListIconsComponent + ], +}) +export class DxoTreeListIconsModule { } diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/index.ts b/packages/devextreme-angular/src/ui/tree-list/nested/index.ts index a1255c64c022..1a001f649123 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/index.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/index.ts @@ -25,6 +25,7 @@ export * from './from'; export * from './group-operation-descriptions'; export * from './header-filter'; export * from './hide'; +export * from './icons'; export * from './item-dxi'; export * from './keyboard-navigation'; export * from './label'; diff --git a/packages/devextreme-angular/src/ui/tree-list/nested/texts.ts b/packages/devextreme-angular/src/ui/tree-list/nested/texts.ts index 6d6b4f9c4eb1..e22735678401 100644 --- a/packages/devextreme-angular/src/ui/tree-list/nested/texts.ts +++ b/packages/devextreme-angular/src/ui/tree-list/nested/texts.ts @@ -52,6 +52,14 @@ export class DxoTreeListTextsComponent extends NestedOption implements OnDestroy this._setOption('rightPosition', value); } + @Input() + get stickPosition(): string { + return this._getOption('stickPosition'); + } + set stickPosition(value: string) { + this._setOption('stickPosition', value); + } + @Input() get unfix(): string { return this._getOption('unfix'); diff --git a/packages/devextreme-react/src/common/grids.ts b/packages/devextreme-react/src/common/grids.ts index 6ccb67c5afa2..e3528b335795 100644 --- a/packages/devextreme-react/src/common/grids.ts +++ b/packages/devextreme-react/src/common/grids.ts @@ -10,6 +10,7 @@ export { ColumnChooserSelectionConfig, ColumnCustomizeTextArg, ColumnFixing, + ColumnFixingIcons, ColumnFixingTexts, ColumnHeaderFilter, ColumnHeaderFilterSearchConfig, diff --git a/packages/devextreme-react/src/data-grid.ts b/packages/devextreme-react/src/data-grid.ts index 5a7a242e658d..df01a3bf03ea 100644 --- a/packages/devextreme-react/src/data-grid.ts +++ b/packages/devextreme-react/src/data-grid.ts @@ -602,10 +602,18 @@ const ColumnChooserSelection: typeof _componentColumnChooserSelection & IElement // DataGrid type IColumnFixingProps = React.PropsWithChildren<{ enabled?: boolean; + icons?: Record | { + fix?: string; + leftPosition?: string; + rightPosition?: string; + stickyPosition?: string; + unfix?: string; + }; texts?: Record | { fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; }; }> @@ -619,6 +627,7 @@ const ColumnFixing: typeof _componentColumnFixing & IElementDescriptor = Object. OptionName: "columnFixing", ExpectedChildren: { columnFixingTexts: { optionName: "texts", isCollectionItem: false }, + icons: { optionName: "icons", isCollectionItem: false }, texts: { optionName: "texts", isCollectionItem: false } }, }) @@ -629,6 +638,7 @@ type IColumnFixingTextsProps = React.PropsWithChildren<{ fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; }> const _componentColumnFixingTexts = memo( @@ -1718,6 +1728,25 @@ const Hide: typeof _componentHide & IElementDescriptor = Object.assign(_componen }, }) +// owners: +// ColumnFixing +type IIconsProps = React.PropsWithChildren<{ + fix?: string; + leftPosition?: string; + rightPosition?: string; + stickyPosition?: string; + unfix?: string; +}> +const _componentIcons = memo( + (props: IIconsProps) => { + return React.createElement(NestedOption, { ...props }); + } +); + +const Icons: typeof _componentIcons & IElementDescriptor = Object.assign(_componentIcons, { + OptionName: "icons", +}) + // owners: // Toolbar type IItemProps = React.PropsWithChildren<{ @@ -2594,6 +2623,7 @@ type ITextsProps = React.PropsWithChildren<{ fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; clearFilter?: string; createFilter?: string; @@ -2874,6 +2904,8 @@ export { IHeaderFilterProps, Hide, IHideProps, + Icons, + IIconsProps, Item, IItemProps, KeyboardNavigation, diff --git a/packages/devextreme-react/src/tree-list.ts b/packages/devextreme-react/src/tree-list.ts index 801eea1f7bcc..8adc96b620f9 100644 --- a/packages/devextreme-react/src/tree-list.ts +++ b/packages/devextreme-react/src/tree-list.ts @@ -558,10 +558,18 @@ const ColumnChooserSelection: typeof _componentColumnChooserSelection & IElement // TreeList type IColumnFixingProps = React.PropsWithChildren<{ enabled?: boolean; + icons?: Record | { + fix?: string; + leftPosition?: string; + rightPosition?: string; + stickyPosition?: string; + unfix?: string; + }; texts?: Record | { fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; }; }> @@ -575,6 +583,7 @@ const ColumnFixing: typeof _componentColumnFixing & IElementDescriptor = Object. OptionName: "columnFixing", ExpectedChildren: { columnFixingTexts: { optionName: "texts", isCollectionItem: false }, + icons: { optionName: "icons", isCollectionItem: false }, texts: { optionName: "texts", isCollectionItem: false } }, }) @@ -585,6 +594,7 @@ type IColumnFixingTextsProps = React.PropsWithChildren<{ fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; }> const _componentColumnFixingTexts = memo( @@ -1447,6 +1457,25 @@ const Hide: typeof _componentHide & IElementDescriptor = Object.assign(_componen }, }) +// owners: +// ColumnFixing +type IIconsProps = React.PropsWithChildren<{ + fix?: string; + leftPosition?: string; + rightPosition?: string; + stickyPosition?: string; + unfix?: string; +}> +const _componentIcons = memo( + (props: IIconsProps) => { + return React.createElement(NestedOption, { ...props }); + } +); + +const Icons: typeof _componentIcons & IElementDescriptor = Object.assign(_componentIcons, { + OptionName: "icons", +}) + // owners: // Toolbar type IItemProps = React.PropsWithChildren<{ @@ -2174,6 +2203,7 @@ type ITextsProps = React.PropsWithChildren<{ fix?: string; leftPosition?: string; rightPosition?: string; + stickPosition?: string; unfix?: string; clearFilter?: string; createFilter?: string; @@ -2469,6 +2499,8 @@ export { IHeaderFilterProps, Hide, IHideProps, + Icons, + IIconsProps, Item, IItemProps, KeyboardNavigation, diff --git a/packages/devextreme-scss/images/icons/fluent/fixcolumn.svg b/packages/devextreme-scss/images/icons/fluent/fixcolumn.svg new file mode 100644 index 000000000000..bd65a36e77ff --- /dev/null +++ b/packages/devextreme-scss/images/icons/fluent/fixcolumn.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/devextreme-scss/images/icons/fluent/fixcolumnleft.svg b/packages/devextreme-scss/images/icons/fluent/fixcolumnleft.svg new file mode 100644 index 000000000000..72fe7e11c9a6 --- /dev/null +++ b/packages/devextreme-scss/images/icons/fluent/fixcolumnleft.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/fluent/fixcolumnright.svg b/packages/devextreme-scss/images/icons/fluent/fixcolumnright.svg new file mode 100644 index 000000000000..6d8f8bf5975c --- /dev/null +++ b/packages/devextreme-scss/images/icons/fluent/fixcolumnright.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/fluent/stickcolumn.svg b/packages/devextreme-scss/images/icons/fluent/stickcolumn.svg new file mode 100644 index 000000000000..8b80fae36e49 --- /dev/null +++ b/packages/devextreme-scss/images/icons/fluent/stickcolumn.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/devextreme-scss/images/icons/fluent/unfixcolumn.svg b/packages/devextreme-scss/images/icons/fluent/unfixcolumn.svg new file mode 100644 index 000000000000..5fe9d066e2d7 --- /dev/null +++ b/packages/devextreme-scss/images/icons/fluent/unfixcolumn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/generic/fixcolumn.svg b/packages/devextreme-scss/images/icons/generic/fixcolumn.svg new file mode 100644 index 000000000000..1ca51bc8a021 --- /dev/null +++ b/packages/devextreme-scss/images/icons/generic/fixcolumn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/generic/fixcolumnleft.svg b/packages/devextreme-scss/images/icons/generic/fixcolumnleft.svg new file mode 100644 index 000000000000..0c235dc1519a --- /dev/null +++ b/packages/devextreme-scss/images/icons/generic/fixcolumnleft.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/devextreme-scss/images/icons/generic/fixcolumnright.svg b/packages/devextreme-scss/images/icons/generic/fixcolumnright.svg new file mode 100644 index 000000000000..9ab017eed7bd --- /dev/null +++ b/packages/devextreme-scss/images/icons/generic/fixcolumnright.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/devextreme-scss/images/icons/generic/stickcolumn.svg b/packages/devextreme-scss/images/icons/generic/stickcolumn.svg new file mode 100644 index 000000000000..ad3fc640d619 --- /dev/null +++ b/packages/devextreme-scss/images/icons/generic/stickcolumn.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/devextreme-scss/images/icons/generic/unfixcolumn.svg b/packages/devextreme-scss/images/icons/generic/unfixcolumn.svg new file mode 100644 index 000000000000..ba7dedcb60f9 --- /dev/null +++ b/packages/devextreme-scss/images/icons/generic/unfixcolumn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/material/fixcolumn.svg b/packages/devextreme-scss/images/icons/material/fixcolumn.svg new file mode 100644 index 000000000000..6d4a90605453 --- /dev/null +++ b/packages/devextreme-scss/images/icons/material/fixcolumn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/material/fixcolumnleft.svg b/packages/devextreme-scss/images/icons/material/fixcolumnleft.svg new file mode 100644 index 000000000000..d4a9a64703bf --- /dev/null +++ b/packages/devextreme-scss/images/icons/material/fixcolumnleft.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/material/fixcolumnright.svg b/packages/devextreme-scss/images/icons/material/fixcolumnright.svg new file mode 100644 index 000000000000..e90a0ca0ebc1 --- /dev/null +++ b/packages/devextreme-scss/images/icons/material/fixcolumnright.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/images/icons/material/stickcolumn.svg b/packages/devextreme-scss/images/icons/material/stickcolumn.svg new file mode 100644 index 000000000000..b73b54eef3eb --- /dev/null +++ b/packages/devextreme-scss/images/icons/material/stickcolumn.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/devextreme-scss/images/icons/material/unfixcolumn.svg b/packages/devextreme-scss/images/icons/material/unfixcolumn.svg new file mode 100644 index 000000000000..a7a823b0c769 --- /dev/null +++ b/packages/devextreme-scss/images/icons/material/unfixcolumn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/devextreme-scss/scss/widgets/base/_icons.scss b/packages/devextreme-scss/scss/widgets/base/_icons.scss index fb9a3ffa03fa..84a978e46dd2 100644 --- a/packages/devextreme-scss/scss/widgets/base/_icons.scss +++ b/packages/devextreme-scss/scss/widgets/base/_icons.scss @@ -130,7 +130,12 @@ .dx-icon-triangleright, .dx-icon-triangleleft, .dx-icon-sendfilled, -.dx-icon-chat { +.dx-icon-chat, +.dx-icon-fixcolumn, +.dx-icon-fixcolumnleft, +.dx-icon-fixcolumnright, +.dx-icon-stickcolumn, +.dx-icon-unfixcolumn { background-position: 0 0; background-repeat: no-repeat; } @@ -465,6 +470,7 @@ $icons: ( "triangledown":"\f16c", "triangleright":"\f16d", "triangleleft":"\f16e", + "fixcolumn":"\f16f", "expandform": "\f170", "description": "\f171", "belloutline": "\f172", @@ -475,6 +481,10 @@ $icons: ( "datausage": "\f177", "datapie": "\f178", "pinmap": "\f179", + "unfixcolumn":"\f17a", + "fixcolumnleft":"\f17b", + "stickcolumn":"\f17c", + "fixcolumnright":"\f17d", ); // stylelint-enable diff --git a/packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss b/packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss index 572caed86ff3..0220703d76b3 100644 --- a/packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss +++ b/packages/devextreme-scss/scss/widgets/fluent/gridBase/_index.scss @@ -114,6 +114,31 @@ $fluent-grid-base-group-panel-message-line-height: $fluent-button-text-line-heig .dx-icon-context-menu-sort-none { @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); } + + .dx-icon-fix-column { + @include dx-icon(fixcolumn); + @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); + } + + .dx-icon-fix-column-left { + @include dx-icon(fixcolumnleft); + @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); + } + + .dx-icon-fix-column-right { + @include dx-icon(fixcolumnright); + @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); + } + + .dx-icon-stick-column { + @include dx-icon(stickcolumn); + @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); + } + + .dx-icon-unfix-column { + @include dx-icon(unfixcolumn); + @include dx-icon-sizing($fluent-grid-base-filter-icon-size - 4); + } } } diff --git a/packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss b/packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss index 76288e9762ec..4c000e4071b9 100644 --- a/packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss +++ b/packages/devextreme-scss/scss/widgets/generic/gridBase/_index.scss @@ -63,6 +63,31 @@ $generic-grid-base-group-panel-message-line-height: $generic-button-text-line-he @include dx-icon(sortdowntext); @include dx-icon-sizing(16px); } + + .dx-icon-fix-column { + @include dx-icon(fixcolumn); + @include dx-icon-sizing(16px); + } + + .dx-icon-fix-column-left { + @include dx-icon(fixcolumnleft); + @include dx-icon-sizing(16px); + } + + .dx-icon-fix-column-right { + @include dx-icon(fixcolumnright); + @include dx-icon-sizing(16px); + } + + .dx-icon-stick-column { + @include dx-icon(stickcolumn); + @include dx-icon-sizing(16px); + } + + .dx-icon-unfix-column { + @include dx-icon(unfixcolumn); + @include dx-icon-sizing(16px); + } } } diff --git a/packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss b/packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss index 61b1f4ff9864..c18125e4aea0 100644 --- a/packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss +++ b/packages/devextreme-scss/scss/widgets/material/gridBase/_index.scss @@ -104,6 +104,31 @@ $material-grid-base-group-panel-message-line-height: $material-button-text-line- .dx-icon-context-menu-sort-none { @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); } + + .dx-icon-fix-column { + @include dx-icon(fixcolumn); + @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); + } + + .dx-icon-fix-column-left { + @include dx-icon(fixcolumnleft); + @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); + } + + .dx-icon-fix-column-right { + @include dx-icon(fixcolumnright); + @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); + } + + .dx-icon-stick-column { + @include dx-icon(stickcolumn); + @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); + } + + .dx-icon-unfix-column { + @include dx-icon(unfixcolumn); + @include dx-icon-sizing($material-grid-base-filter-icon-size - 4); + } } } diff --git a/packages/devextreme-scss/tests/icon-font.test.ts b/packages/devextreme-scss/tests/icon-font.test.ts index 09e306f3f2ae..54adc8e38d73 100644 --- a/packages/devextreme-scss/tests/icon-font.test.ts +++ b/packages/devextreme-scss/tests/icon-font.test.ts @@ -25,21 +25,21 @@ describe('Equals svg to font', () => { const countElementGenericFont = getCountElementInFont(`${BASE_PATH}/icons/dxicons.ttf`); const countElementGenericSvg = getCountElementInSvg(`${BASE_PATH}/images/icons/generic`); - expect(countElementGenericFont - 5).toBe(countElementGenericSvg); + expect(countElementGenericFont).toBe(countElementGenericSvg); }); test('material themes', () => { const countElementMaterialFont = getCountElementInFont(`${BASE_PATH}/icons/dxiconsmaterial.ttf`); const countElementMaterialSvg = getCountElementInSvg(`${BASE_PATH}/images/icons/material`); - expect(countElementMaterialFont - 5).toBe(countElementMaterialSvg); + expect(countElementMaterialFont).toBe(countElementMaterialSvg); }); test('fluent theme', () => { const countElementFluentFont = getCountElementInFont(`${BASE_PATH}/icons/dxiconsfluent.ttf`); const countElementFluentSvg = getCountElementInSvg(`${BASE_PATH}/images/icons/fluent`); - expect(countElementFluentFont - 5).toBe(countElementFluentSvg); + expect(countElementFluentFont).toBe(countElementFluentSvg); }); test('check svg elements', () => { diff --git a/packages/devextreme-vue/src/common/grids.ts b/packages/devextreme-vue/src/common/grids.ts index 6ccb67c5afa2..e3528b335795 100644 --- a/packages/devextreme-vue/src/common/grids.ts +++ b/packages/devextreme-vue/src/common/grids.ts @@ -10,6 +10,7 @@ export { ColumnChooserSelectionConfig, ColumnCustomizeTextArg, ColumnFixing, + ColumnFixingIcons, ColumnFixingTexts, ColumnHeaderFilter, ColumnHeaderFilterSearchConfig, diff --git a/packages/devextreme-vue/src/data-grid.ts b/packages/devextreme-vue/src/data-grid.ts index 1b772e90b663..08c72615ffe9 100644 --- a/packages/devextreme-vue/src/data-grid.ts +++ b/packages/devextreme-vue/src/data-grid.ts @@ -859,10 +859,12 @@ const DxColumnFixingConfig = { "update:isActive": null, "update:hoveredElement": null, "update:enabled": null, + "update:icons": null, "update:texts": null, }, props: { enabled: Boolean, + icons: Object, texts: Object } }; @@ -874,6 +876,7 @@ const DxColumnFixing = defineComponent(DxColumnFixingConfig); (DxColumnFixing as any).$_optionName = "columnFixing"; (DxColumnFixing as any).$_expectedChildren = { columnFixingTexts: { isCollectionItem: false, optionName: "texts" }, + icons: { isCollectionItem: false, optionName: "icons" }, texts: { isCollectionItem: false, optionName: "texts" } }; @@ -884,12 +887,14 @@ const DxColumnFixingTextsConfig = { "update:fix": null, "update:leftPosition": null, "update:rightPosition": null, + "update:stickPosition": null, "update:unfix": null, }, props: { fix: String, leftPosition: String, rightPosition: String, + stickPosition: String, unfix: String } }; @@ -2177,6 +2182,31 @@ const DxHide = defineComponent(DxHideConfig); to: { isCollectionItem: false, optionName: "to" } }; +const DxIconsConfig = { + emits: { + "update:isActive": null, + "update:hoveredElement": null, + "update:fix": null, + "update:leftPosition": null, + "update:rightPosition": null, + "update:stickyPosition": null, + "update:unfix": null, + }, + props: { + fix: String, + leftPosition: String, + rightPosition: String, + stickyPosition: String, + unfix: String + } +}; + +prepareConfigurationComponentConfig(DxIconsConfig); + +const DxIcons = defineComponent(DxIconsConfig); + +(DxIcons as any).$_optionName = "icons"; + const DxItemConfig = { emits: { "update:isActive": null, @@ -3182,6 +3212,7 @@ const DxTextsConfig = { "update:rightPosition": null, "update:saveAllChanges": null, "update:saveRowChanges": null, + "update:stickPosition": null, "update:sum": null, "update:sumOtherColumn": null, "update:undeleteRow": null, @@ -3222,6 +3253,7 @@ const DxTextsConfig = { rightPosition: String, saveAllChanges: String, saveRowChanges: String, + stickPosition: String, sum: String, sumOtherColumn: String, undeleteRow: String, @@ -3488,6 +3520,7 @@ export { DxGroupPanel, DxHeaderFilter, DxHide, + DxIcons, DxItem, DxKeyboardNavigation, DxLabel, diff --git a/packages/devextreme-vue/src/tree-list.ts b/packages/devextreme-vue/src/tree-list.ts index 3d88b694adfa..f595c0768d8e 100644 --- a/packages/devextreme-vue/src/tree-list.ts +++ b/packages/devextreme-vue/src/tree-list.ts @@ -839,10 +839,12 @@ const DxColumnFixingConfig = { "update:isActive": null, "update:hoveredElement": null, "update:enabled": null, + "update:icons": null, "update:texts": null, }, props: { enabled: Boolean, + icons: Object, texts: Object } }; @@ -854,6 +856,7 @@ const DxColumnFixing = defineComponent(DxColumnFixingConfig); (DxColumnFixing as any).$_optionName = "columnFixing"; (DxColumnFixing as any).$_expectedChildren = { columnFixingTexts: { isCollectionItem: false, optionName: "texts" }, + icons: { isCollectionItem: false, optionName: "icons" }, texts: { isCollectionItem: false, optionName: "texts" } }; @@ -864,12 +867,14 @@ const DxColumnFixingTextsConfig = { "update:fix": null, "update:leftPosition": null, "update:rightPosition": null, + "update:stickPosition": null, "update:unfix": null, }, props: { fix: String, leftPosition: String, rightPosition: String, + stickPosition: String, unfix: String } }; @@ -1887,6 +1892,31 @@ const DxHide = defineComponent(DxHideConfig); to: { isCollectionItem: false, optionName: "to" } }; +const DxIconsConfig = { + emits: { + "update:isActive": null, + "update:hoveredElement": null, + "update:fix": null, + "update:leftPosition": null, + "update:rightPosition": null, + "update:stickyPosition": null, + "update:unfix": null, + }, + props: { + fix: String, + leftPosition: String, + rightPosition: String, + stickyPosition: String, + unfix: String + } +}; + +prepareConfigurationComponentConfig(DxIconsConfig); + +const DxIcons = defineComponent(DxIconsConfig); + +(DxIcons as any).$_optionName = "icons"; + const DxItemConfig = { emits: { "update:isActive": null, @@ -2757,6 +2787,7 @@ const DxTextsConfig = { "update:rightPosition": null, "update:saveAllChanges": null, "update:saveRowChanges": null, + "update:stickPosition": null, "update:undeleteRow": null, "update:unfix": null, "update:validationCancelChanges": null, @@ -2781,6 +2812,7 @@ const DxTextsConfig = { rightPosition: String, saveAllChanges: String, saveRowChanges: String, + stickPosition: String, undeleteRow: String, unfix: String, validationCancelChanges: String @@ -3069,6 +3101,7 @@ export { DxGroupOperationDescriptions, DxHeaderFilter, DxHide, + DxIcons, DxItem, DxKeyboardNavigation, DxLabel, diff --git a/packages/devextreme/js/__internal/grids/grid_core/column_fixing/m_column_fixing.ts b/packages/devextreme/js/__internal/grids/grid_core/column_fixing/m_column_fixing.ts index da3fb9e95f0c..a3a406aa95ef 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/column_fixing/m_column_fixing.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/column_fixing/m_column_fixing.ts @@ -41,6 +41,11 @@ const POINTER_EVENTS_NONE_CLASS = 'dx-pointer-events-none'; const COMMAND_TRANSPARENT = 'transparent'; const GROUP_ROW_CLASS = 'dx-group-row'; const DETAIL_ROW_CLASS = 'dx-master-detail-row'; +const FIXED_COLUMN_ICON_CLASS = 'fix-column'; +const FIXED_COLUMN_LEFT_ICON_CLASS = 'fix-column-left'; +const FIXED_COLUMN_RIGHT_ICON_CLASS = 'fix-column-right'; +const STICKY_COLUMN_ICON_CLASS = 'stick-column'; +const UNFIXED_COLUMN_ICON_CLASS = 'unfix-column'; const getTransparentColumnIndex = function (fixedColumns: any[]) { let transparentColumnIndex = -1; @@ -1166,6 +1171,13 @@ export const columnFixingModule = { rightPosition: messageLocalization.format('dxDataGrid-columnFixingRightPosition'), stickyPosition: messageLocalization.format('dxDataGrid-columnFixingStickyPosition'), }, + icons: { + fix: FIXED_COLUMN_ICON_CLASS, + unfix: UNFIXED_COLUMN_ICON_CLASS, + leftPosition: FIXED_COLUMN_LEFT_ICON_CLASS, + rightPosition: FIXED_COLUMN_RIGHT_ICON_CLASS, + stickyPosition: STICKY_COLUMN_ICON_CLASS, + }, }, }; }, diff --git a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts index 39dfdc6e6eb2..0c53504e8401 100644 --- a/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts +++ b/packages/devextreme/js/__internal/grids/grid_core/sticky_columns/m_sticky_columns.ts @@ -249,16 +249,28 @@ const columnHeadersView = ( }; const fixedPositionItems = [ { - text: columnFixingOptions.texts.leftPosition, value: 'left', disabled: column.fixed && (!column.fixedPosition || column.fixedPosition === 'left'), onItemClick, + text: columnFixingOptions.texts.leftPosition, + icon: columnFixingOptions.icons.leftPosition, + value: 'left', + disabled: column.fixed && (!column.fixedPosition || column.fixedPosition === 'left'), + onItemClick, }, { - text: columnFixingOptions.texts.rightPosition, value: 'right', disabled: column.fixed && column.fixedPosition === 'right', onItemClick, + text: columnFixingOptions.texts.rightPosition, + icon: columnFixingOptions.icons.rightPosition, + value: 'right', + disabled: column.fixed && column.fixedPosition === 'right', + onItemClick, }, ]; if (this.option('columnFixing.legacyMode') !== true) { fixedPositionItems.push({ - text: columnFixingOptions.texts.stickyPosition, value: 'sticky', disabled: column.fixed && getColumnFixedPosition(column) === StickyPosition.Sticky, onItemClick, + text: columnFixingOptions.texts.stickyPosition, + icon: columnFixingOptions.icons.stickyPosition, + value: 'sticky', + disabled: column.fixed && getColumnFixedPosition(column) === StickyPosition.Sticky, + onItemClick, }); } @@ -267,11 +279,16 @@ const columnHeadersView = ( items.push( { text: columnFixingOptions.texts.fix, + icon: columnFixingOptions.icons.fix, beginGroup: true, items: fixedPositionItems, }, { - text: columnFixingOptions.texts.unfix, value: 'none', disabled: !column.fixed, onItemClick, + text: columnFixingOptions.texts.unfix, + icon: columnFixingOptions.icons.unfix, + value: 'none', + disabled: !column.fixed, + onItemClick, }, ); } diff --git a/packages/devextreme/js/common/grids.d.ts b/packages/devextreme/js/common/grids.d.ts index ce777d524038..2a63166e670a 100644 --- a/packages/devextreme/js/common/grids.d.ts +++ b/packages/devextreme/js/common/grids.d.ts @@ -624,6 +624,11 @@ export type ColumnFixing = { * @type object */ texts?: ColumnFixingTexts; + /** + * @docid GridBaseOptions.columnFixing.icons + * @type object + */ + icons?: ColumnFixingIcons; }; /** @@ -652,6 +657,44 @@ export type ColumnFixingTexts = { * @default "Unfix" */ unfix?: string; + /** + * @docid GridBaseOptions.columnFixing.texts.stickPosition + * @default "Stick in place" + */ + stickyPosition?: string; +}; + +/** + * @docid + * @public + * @namespace DevExpress.common.grids + */ +export type ColumnFixingIcons = { + /** + * @docid GridBaseOptions.columnFixing.icons.fix + * @default "fix-column" + */ + fix?: string; + /** + * @docid GridBaseOptions.columnFixing.icons.leftPosition + * @default "fix-column-left" + */ + leftPosition?: string; + /** + * @docid GridBaseOptions.columnFixing.icons.rightPosition + * @default "fix-column-right" + */ + rightPosition?: string; + /** + * @docid GridBaseOptions.columnFixing.icons.unfix + * @default "unfix-column" + */ + unfix?: string; + /** + * @docid GridBaseOptions.columnFixing.icons.stickyPosition + * @default "stick-column" + */ + stickyPosition?: string; }; /** diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 227449e408cb..9b693403c184 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -2974,6 +2974,35 @@ declare module DevExpress.common.grids { * [descr:GridBaseOptions.columnFixing.texts] */ texts?: ColumnFixingTexts; + /** + * [descr:GridBaseOptions.columnFixing.icons] + */ + icons?: ColumnFixingIcons; + }; + /** + * [descr:ColumnFixingIcons] + */ + export type ColumnFixingIcons = { + /** + * [descr:GridBaseOptions.columnFixing.icons.fix] + */ + fix?: string; + /** + * [descr:GridBaseOptions.columnFixing.icons.leftPosition] + */ + leftPosition?: string; + /** + * [descr:GridBaseOptions.columnFixing.icons.rightPosition] + */ + rightPosition?: string; + /** + * [descr:GridBaseOptions.columnFixing.icons.unfix] + */ + unfix?: string; + /** + * [descr:GridBaseOptions.columnFixing.icons.stickyPosition] + */ + stickyPosition?: string; }; /** * [descr:ColumnFixingTexts] @@ -2995,6 +3024,10 @@ declare module DevExpress.common.grids { * [descr:GridBaseOptions.columnFixing.texts.unfix] */ unfix?: string; + /** + * [descr:GridBaseOptions.columnFixing.texts.stickPosition] + */ + stickyPosition?: string; }; export type ColumnHeaderFilter = { /** diff --git a/packages/testcafe-models/contextMenu/index.ts b/packages/testcafe-models/contextMenu/index.ts index 4217ee40623f..8a98af2541e3 100644 --- a/packages/testcafe-models/contextMenu/index.ts +++ b/packages/testcafe-models/contextMenu/index.ts @@ -6,6 +6,7 @@ import type { WidgetName } from '../types'; const CLASS = { contextMenu: 'dx-context-menu', item: 'dx-menu-item', + itemList: 'dx-menu-items-container', overlay: 'dx-overlay', itemText: 'dx-menu-item-text', }; @@ -17,10 +18,13 @@ export default class ContextMenu extends Widget { isOpened: Promise; + contextMenu: Selector; + constructor(id: string | Selector) { super(id); this.items = Selector(`.${CLASS.contextMenu}`).find(`.${CLASS.item}`); + this.contextMenu = Selector(`.${CLASS.contextMenu}`); this.overlay = new Overlay(`.${CLASS.overlay}`); this.isOpened = this.overlay.isVisible(); } @@ -45,6 +49,10 @@ export default class ContextMenu extends Widget { return this.items.count; } + getItemByOrder(order: number): Selector { + return this.contextMenu.find(`.${CLASS.itemList}`).child(order); + } + show(): Promise { const { getInstance } = this;