-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
143 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletion
7
packages/devextreme-scss/scss/widgets/base/cardView/_colors.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
$cardview-header-item-background-color: null !default; | ||
$cardview-header-item-background-color: null !default; | ||
$cardview-header-item-border-width: null !default; | ||
$cardview-header-item-border-radius: null !default; | ||
$cardview-header-item-border-color: null !default; | ||
$cardview-header-item-padding-horizontal: 12px !default; | ||
$cardview-header-item-padding-vertical: 6px !default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,4 @@ | |
@use "./sortable"; | ||
@use "./deferRendering"; | ||
@use "./map"; | ||
@use "./cardView"; |
8 changes: 7 additions & 1 deletion
8
packages/devextreme-scss/scss/widgets/fluent/cardView/_colors.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
@use '../../base/cardView/colors' as *; | ||
@use '../colors' as *; | ||
|
||
// getFigmaVariable('Header item/neutrals/background/1/rest', 'Components', 'Fluent') | ||
$cardview-header-item-background-color: $colors-grey-10 !default; | ||
$cardview-header-item-background-color: $colors-grey-10 !default; | ||
$cardview-header-item-border-width: 1px !default; | ||
// getFigmaVariable('Header item/сorner-radius/Bubble M (true)', 'Components', 'Fluent') | ||
$cardview-header-item-border-radius: 6 !default; | ||
// getFigmaVariable('Header item/neutrals/strokes/1/rest', 'Components', 'Fluent') | ||
$cardview-header-item-border-color: #E0E0E0 !default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,6 @@ | |
@use "./sortable"; | ||
@use "./deferRendering"; | ||
@use "./map"; | ||
@use "./cardView"; | ||
|
||
|
8 changes: 7 additions & 1 deletion
8
packages/devextreme-scss/scss/widgets/generic/cardView/_colors.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
@use '../../base/cardView/colors' as *; | ||
@use '../colors' as *; | ||
|
||
// getFigmaVariable('Header item/neutrals/background/1/rest', 'Components', 'Generic') | ||
$cardview-header-item-background-color: $colors-neutral-grey-0 !default; | ||
$cardview-header-item-background-color: $colors-neutral-grey-0 !default; | ||
$cardview-header-item-border-width: 1px !default; | ||
// getFigmaVariable('Header item/сorner-radius/Bubble M (true)', 'Components', 'Generic') | ||
$cardview-header-item-border-radius: 4 !default; | ||
// getFigmaVariable('Header item/neutrals/strokes/1/rest', 'Components', 'Generic') | ||
$cardview-header-item-border-color: #DDDDDD !default; |
8 changes: 7 additions & 1 deletion
8
packages/devextreme-scss/scss/widgets/material/cardView/_colors.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
@use '../../base/cardView/colors' as *; | ||
@use '../colors' as *; | ||
|
||
// getFigmaVariable('Header item/neutrals/background/1/rest', 'Components', 'Material') | ||
$cardview-header-item-background-color: $colors-neutral-300 !default; | ||
$cardview-header-item-background-color: $colors-neutral-300 !default; | ||
$cardview-header-item-border-width: 1px !default; | ||
// getFigmaVariable('Header item/сorner-radius/Bubble M (true)', 'Components', 'Material') | ||
$cardview-header-item-border-radius: 99 !default; | ||
// getFigmaVariable('Header item/neutrals/strokes/1/rest', 'Components', 'Material') | ||
$cardview-header-item-border-color: $colors-neutral-300 !default; |
20 changes: 20 additions & 0 deletions
20
packages/devextreme/js/__internal/grids/new/grid_core/headers/header_item.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { ComponentType } from 'inferno'; | ||
|
||
import type { Column } from '../columns_controller/types'; | ||
|
||
export const CLASSES = { | ||
headerItem: 'dx-gridcore-header-item', | ||
}; | ||
|
||
export interface HeaderItemProps { | ||
column: Column; | ||
buttons?: ComponentType; | ||
} | ||
|
||
export function HeaderItem(props: HeaderItemProps): JSX.Element { | ||
return ( | ||
<div className={CLASSES.headerItem}> | ||
{props.column.name} | ||
</div> | ||
); | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/devextreme/js/__internal/grids/new/grid_core/headers/headers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type { Column } from '../columns_controller/types'; | ||
import { HeaderItem } from './header_item'; | ||
|
||
export const CLASSES = { | ||
headers: 'dx-gridcore-headers', | ||
}; | ||
|
||
export interface HeadersProps { | ||
columns: Column[]; | ||
} | ||
|
||
export function Headers(props: HeadersProps): JSX.Element { | ||
return ( | ||
<div className={CLASSES.headers}> | ||
{props.columns.map((column) => ( | ||
<HeaderItem | ||
column={column} | ||
/> | ||
))} | ||
</div> | ||
); | ||
} |
57 changes: 4 additions & 53 deletions
57
packages/devextreme/js/__internal/grids/new/grid_core/headers/view.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,20 @@ | ||
import { computed, Subscribable } from '@ts/core/reactive'; | ||
import type { RefObject } from 'inferno'; | ||
import { createRef, InfernoNode } from 'inferno'; | ||
import { computed } from '@ts/core/reactive'; | ||
|
||
import { ColumnsController } from '../columns_controller/columns_controller'; | ||
import { ColumnsDraggingController } from '../columns_dragging/columns_dragging'; | ||
import { View } from '../core/view'; | ||
import { Headers } from './headers'; | ||
|
||
export class HeadersView extends View { | ||
private readonly draggingAreaRef = createRef<HTMLDivElement>(); | ||
|
||
private draggingAreaElements: RefObject<HTMLDivElement>[] = []; | ||
|
||
public vdom = computed( | ||
(columns) => { | ||
this.draggingAreaElements = columns.map(() => createRef()); | ||
return <div ref={this.draggingAreaRef}> | ||
{columns.map((c, index) => ( | ||
<div ref={this.draggingAreaElements[index]}>{c.name}</div> | ||
))} | ||
</div>; | ||
}, | ||
(columns) => <Headers columns={columns} />, | ||
[this.columnsController.columns], | ||
); | ||
|
||
public static dependencies = [ColumnsController, ColumnsDraggingController] as const; | ||
public static dependencies = [ColumnsController] as const; | ||
|
||
constructor( | ||
private readonly columnsController: ColumnsController, | ||
private readonly columnsDragging: ColumnsDraggingController, | ||
) { | ||
super(); | ||
// TODO: move to onMounted | ||
// setTimeout(() => { | ||
// this.registerDragging(); | ||
// }, 1000); | ||
} | ||
|
||
private registerDragging(): void { | ||
this.columnsDragging.registerDraggingArea({ | ||
draggingArea: this.draggingAreaRef.current!, | ||
draggingElements: this.draggingAreaElements.map((r, i) => ({ | ||
element: r.current!, | ||
index: i, | ||
column: undefined as any, | ||
})), | ||
draggedInto: this.draggedInto.bind(this), | ||
draggedOut: this.draggedOut.bind(this), | ||
draggingStart: this.draggingStart.bind(this), | ||
draggingCancel: this.draggingCancel.bind(this), | ||
draggingHover: this.draggingHover.bind(this), | ||
getHoverIndex: this.getHoverIndex.bind(this), | ||
}); | ||
} | ||
|
||
private draggedInto() { } | ||
|
||
private draggedOut() { } | ||
|
||
private draggingStart() { } | ||
|
||
private draggingCancel() { } | ||
|
||
private draggingHover() { } | ||
|
||
private getHoverIndex(): number { | ||
throw new Error('not implemented'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ | |
"./__internal/*" | ||
], | ||
}, | ||
"types": [] | ||
"types": ["jest"] | ||
}, | ||
"tsc-alias": { | ||
"verbose": false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters