Skip to content

Commit

Permalink
Merge branch '24_1' of https://github.com/DevExpress/DevExtreme into …
Browse files Browse the repository at this point in the history
…24_1-List-fix-alignment-in-demos
  • Loading branch information
nikkithelegendarypokemonster committed Jun 11, 2024
2 parents 1537f2e + 4d54da5 commit 018d9c5
Show file tree
Hide file tree
Showing 93 changed files with 9,469 additions and 9,020 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/packages_publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ env:
MOVE_STABLE_TAG: ${{ inputs.tag == 'stable' }}

jobs:

build:
name: Build packages
runs-on: ubuntu-latest
runs-on: windows-latest
outputs:
packages: ${{ steps.filter.outputs.packages }}
steps:
Expand All @@ -50,6 +49,19 @@ jobs:
BUILD_INTERNAL_PACKAGE: true
run: npm run all:build

- name: Clone deps scanner
uses: actions/checkout@v4
with:
repository: DevExpress/npmdeps-scanner
token: ${{ secrets.NPM_DEPS_SCANNER_PAT }}
path: deps-scanner

- name: Run deps scanner
run: |
./deps-scanner/exe/npmDepsScanner.exe scan_cache ${{ github.workspace }} reportGithub.json
mkdir -p ./artifacts/deps-scanner
cp reportGithub.json ./artifacts/deps-scanner/
- name: Build artifacts package
run: npx ts-node tools/scripts/make-artifacts-package

Expand All @@ -62,9 +74,9 @@ jobs:
- name: Filter packages
id: filter
working-directory: artifacts/npm
shell: bash
run: ls *.tgz | grep -E -i "$FILTER" | sed -r 's/^(.*).tgz$/"\1"/g' | paste -sd "," - | sed -r 's/(.*)/packages=[\1]/' >> "$GITHUB_OUTPUT"


publish:
name: Publish package
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions apps/demos/testing/known-warnings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
[
"The specified credentials are invalid. You can sign up for a free developer account at http://www.bingmapsportal.com",
"[Vue warn]: Do not use built-in or reserved HTML elements as component id: title",
"[Vue warn]: Property \"",
"[Vue warn]: Failed to resolve component: ",
"Warning: forwardRef render functions accept exactly two parameters: props and ref.",
"Warning: %s: `ref` is not a prop.",
"W0001 -",
"W0019 -",
"W0022 -",
"W1011 -",
"W2108 -"
]
24 changes: 24 additions & 0 deletions e2e/testcafe-devextreme/tests/dataGrid/editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,30 @@ test('Popup EditForm screenshot', async (t) => {
},
}));

// T1218553
test('Popup EditForm screenshot when editRowKey is initially specified', async (t) => {
const { takeScreenshot, compareResults } = createScreenshotsComparer(t);
const dataGrid = new DataGrid('#container');

await t
.expect(await takeScreenshot('popup-edit-form-with-initial-editrowkey.png', dataGrid.element))
.ok()
.expect(dataGrid.getPopupEditForm().element.exists)
.ok()
.expect(compareResults.isValid())
.ok(compareResults.errorMessages());
}).before(async () => createWidget('dxDataGrid', {
dataSource: getData(20, 2).map((item, index) => ({ ...item, id: index })),
keyExpr: 'id',
height: 400,
showBorders: true,
editing: {
mode: 'popup',
allowUpdating: true,
editRowKey: 0,
},
}));

// T1165529
[
true,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import {
EDIT_FORM_CLASS,
EDIT_ICON_CLASS,
EDIT_LINK_CLASS,
EDIT_MODE_POPUP,
EDIT_MODE_ROW,
EDIT_MODES,
EDITING_CHANGES_OPTION_NAME,
Expand Down Expand Up @@ -352,6 +353,11 @@ class EditingControllerImpl extends modules.ViewController {
return result;
}

protected isPopupEditMode() {
const editMode = this.option('editing.mode');
return editMode === EDIT_MODE_POPUP;
}

private _isButtonVisible(button, options) {
const { visible } = button;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
DATA_EDIT_DATA_INSERT_TYPE,
EDIT_FORM_ITEM_CLASS,
EDIT_MODE_FORM,
EDIT_MODE_POPUP,
EDIT_POPUP_CLASS,
EDIT_POPUP_FORM_CLASS,
EDITING_EDITROWKEY_OPTION_NAME,
Expand Down Expand Up @@ -59,13 +58,12 @@ const editingControllerExtender = (Base: ModuleType<EditingController>) => class
super.init();
}

private isFormOrPopupEditMode() {
return this.isPopupEditMode() || this.isFormEditMode();
public isEditRow(rowIndex) {
return !this.isPopupEditMode() && super.isEditRow(rowIndex);
}

private isPopupEditMode() {
const editMode = this.option('editing.mode');
return editMode === EDIT_MODE_POPUP;
private isFormOrPopupEditMode() {
return this.isPopupEditMode() || this.isFormEditMode();
}

private isFormEditMode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const editingControllerExtender = (Base: ModuleType<EditingController>) => class

protected _isDefaultButtonVisible(button, options) {
const isRowMode = this.isRowBasedEditMode();
const isEditRow = options.row && equalByValue(options.row.key, this.option(EDITING_EDITROWKEY_OPTION_NAME));
const isPopupEditMode = this.isPopupEditMode();
const isEditRow = !isPopupEditMode && options.row && equalByValue(options.row.key, this.option(EDITING_EDITROWKEY_OPTION_NAME));

if (isRowMode) {
switch (button.name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { dxElementWrapper } from '@js/core/renderer';
import $ from '@js/core/renderer';
import browser from '@js/core/utils/browser';
import { deferRender, deferUpdate } from '@js/core/utils/common';
import type { DeferredObj } from '@js/core/utils/deferred';
import { Deferred, when } from '@js/core/utils/deferred';
import { each } from '@js/core/utils/iterator';
import { getBoundingRect } from '@js/core/utils/position';
Expand Down Expand Up @@ -646,9 +647,10 @@ export class ResizingController extends modules.ViewController {
/**
* @extended: virtual_scrolling
*/
public resize() {
public resize(): DeferredObj<unknown> {
if (this.component._requireResize) {
return;
// @ts-expect-error
return new Deferred().resolve();
}

// @ts-expect-error
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable max-classes-per-file */
import $ from '@js/core/renderer';
import browser from '@js/core/utils/browser';
import type { DeferredObj } from '@js/core/utils/deferred';
import { Deferred, when } from '@js/core/utils/deferred';
import { isElementInDom } from '@js/core/utils/dom';
import { each } from '@js/core/utils/iterator';
Expand Down Expand Up @@ -1319,7 +1320,7 @@ export const resizing = (Base: ModuleType<ResizingController>) => class VirtualS
return !!this._resizeTimeout;
}

public resize() {
public resize(): DeferredObj<unknown> {
let result;

if (isVirtualMode(this) || gridCoreUtils.isVirtualRowRendering(this)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const rowsView = (Base: ModuleType<RowsView>) => class TreeListEditingRowsViewEx
const isEditRow = options.row && editingController.isEditRow(options.row.rowIndex);
const isEditing = options.isEditing || isEditRow;

if (!isEditing) {
if (!options.isOnForm && !isEditing) {
// @ts-expect-error
return super._renderCellCommandContent.apply(this, arguments);
}
Expand Down
29 changes: 27 additions & 2 deletions packages/devextreme/js/__internal/ui/collection/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,18 @@ declare class Base<
> extends Widget<TProperties> {
getDataSource(): DataSource<TItem, TKey>;

_renderItems(items: unknown): void;
_renderItems(items: TItem[]): void;
_renderItem(
index: number,
itemData: TItem,
$container: dxElementWrapper,
$itemToReplace: dxElementWrapper,
$itemToReplace?: dxElementWrapper,
): dxElementWrapper;
_renderItemFrame(
index: number,
itemData: TItem,
$container: dxElementWrapper,
$itemToReplace?: dxElementWrapper,
): dxElementWrapper;
_renderItemContent(args: {
index: number;
Expand All @@ -51,12 +57,31 @@ declare class Base<
args: { itemData: unknown }): void;

_getItemData(item: Element | HTMLElement | dxElementWrapper): TItem;
_getItemContent($item: dxElementWrapper): dxElementWrapper;
_getIndexByItem(item: TItem): number;
_getIndexByItemData(item: TItem): number;
_getAvailableItems($items?: dxElementWrapper): dxElementWrapper;
_getSummaryItemsSize(dimension: string, items: TItem[], includeMargin: boolean): number;
_getActiveItem(last?: boolean): dxElementWrapper;
_findItemElementByItem(item: TItem): dxElementWrapper;

_itemOptionChanged(item: TItem, property: string, value: unknown, prevValue: unknown): void;
_itemEventHandler($item: dxElementWrapper, eventName: string, eventData: unknown): void;
_itemIndexKey(): number;

_prevItem($items: dxElementWrapper): dxElementWrapper;
_nextItem($items: dxElementWrapper): dxElementWrapper;

_attachContextMenuEvent(): void;
_itemContextMenuHandler(event: unknown): void;
_itemPointerDownHandler(event: unknown): void;
_itemDXEventHandler(event: unknown, eventHandlerName: string, args: unknown, actionConfig: {
beforeExecute: (args?: unknown) => void;
afterExecute: () => void;
}): void;

_refreshActiveDescendant($target: dxElementWrapper): void;
_moveFocus(location: string, event?: unknown): void;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
2 changes: 2 additions & 0 deletions packages/devextreme/js/__internal/ui/collection/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ declare class Edit<
TKey = any,
> extends CollectionWidgetBase<TProperties> {
_processSelectableItem($itemElement: dxElementWrapper, isSelected: boolean): void;
_setAriaSelectionAttribute($itemElement: dxElementWrapper, isSelected: string): void;
_clearSelectedItems(): void;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
49 changes: 49 additions & 0 deletions packages/devextreme/js/__internal/ui/collection/hierarchical.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import type { dxElementWrapper } from '@js/core/renderer';
import type { ItemLike } from '@js/ui/collection/ui.collection_widget.base';
import type { HierarchicalCollectionWidgetOptions } from '@js/ui/hierarchical_collection/ui.hierarchical_collection_widget';
import HierarchicalCollectionWidget from '@js/ui/hierarchical_collection/ui.hierarchical_collection_widget';

import CollectionWidgetEdit from './edit';

export interface TypedCollectionWidgetOptions<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TComponent extends HierarchicalCollectionWidget<any, TItem, TKey>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TItem extends ItemLike = any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TKey = any,
> extends HierarchicalCollectionWidgetOptions<TComponent, TItem, TKey> {
}

declare class Hierarchical<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TProperties extends TypedCollectionWidgetOptions<any, TItem, TKey>,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TItem extends ItemLike = any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
TKey = any,
> extends CollectionWidgetEdit<TProperties> {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
_dataAdapter?: any;

_initDataAdapter(): void;

_getIconContainer(itemData: TItem): dxElementWrapper;
_getTextContainer(itemData: TItem): dxElementWrapper;
_getLinkContainer(
iconContainer: dxElementWrapper,
textContainer: dxElementWrapper,
itemData: TItem,
): dxElementWrapper;
_addContent($container: dxElementWrapper, itemData: TItem): void;

_addWidgetClass(): void;

_getChildNodes(node: TItem): TItem[];
_hasChildren(node: TItem): number | undefined;
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const TypedCollectionWidget: typeof Hierarchical = HierarchicalCollectionWidget as any;

export default TypedCollectionWidget;
Loading

0 comments on commit 018d9c5

Please sign in to comment.