Skip to content

Commit

Permalink
dxScheduler - remove workaround for preact (#16665)
Browse files Browse the repository at this point in the history
  • Loading branch information
AryamnovEugeniy authored Mar 15, 2021
1 parent 1e4dde3 commit 2091596
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 84 deletions.
35 changes: 3 additions & 32 deletions js/renovation/ui/scheduler/workspaces/base/row.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
Component, ComponentBindings, JSXComponent, Slot, OneWay, Fragment, CSSAttributes,
Component, ComponentBindings, JSXComponent, Slot, OneWay, CSSAttributes,
} from 'devextreme-generator/component_declaration/common';
import { VirtualCell } from './virtual-cell';

Expand All @@ -18,44 +18,15 @@ export const viewFunction = ({
className={className}
style={styles}
>
{/*
This is a workaround for https://github.com/preactjs/preact/issues/2987
TODO: remove once we start using inferno
*/}
{hasLeftVirtualCell && hasRightVirtualCell && (
<Fragment>
<VirtualCell width={leftVirtualCellWidth} />
{children}
<VirtualCell width={rightVirtualCellWidth} />
</Fragment>
)}
{hasLeftVirtualCell && !hasRightVirtualCell && (
<Fragment>
<VirtualCell width={leftVirtualCellWidth} />
{children}
</Fragment>
)}
{!hasLeftVirtualCell && hasRightVirtualCell && (
<Fragment>
{children}
<VirtualCell width={rightVirtualCellWidth} />
</Fragment>
)}
{!hasLeftVirtualCell && !hasRightVirtualCell && (
<Fragment>
{children}
</Fragment>
)}

{/* {hasLeftVirtualCell && (
{hasLeftVirtualCell && (
<VirtualCell width={leftVirtualCellWidth} />
)}

{children}

{hasRightVirtualCell && (
<VirtualCell width={rightVirtualCellWidth} />
)} */}
)}
</tr>
);

Expand Down
55 changes: 3 additions & 52 deletions js/renovation/ui/scheduler/workspaces/base/table.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
Component, ComponentBindings, CSSAttributes, Fragment, JSXComponent, OneWay, Slot,
Component, ComponentBindings, CSSAttributes, JSXComponent, OneWay, Slot,
} from 'devextreme-generator/component_declaration/common';
import { addHeightToStyle } from '../utils';
import { VirtualRow } from './virtual-row';
Expand All @@ -26,56 +26,7 @@ export const viewFunction = ({
style={style}
>
<tbody>
{/*
This is a workaround for https://github.com/preactjs/preact/issues/2987
TODO: remove once we start using inferno
*/}
{hasTopVirtualRow && hasBottomVirtualRow && (
<Fragment>
<VirtualRow
height={topVirtualRowHeight}
cellsCount={virtualCellsCount}
leftVirtualCellWidth={leftVirtualCellWidth}
rightVirtualCellWidth={rightVirtualCellWidth}
/>
{children}
<VirtualRow
height={bottomVirtualRowHeight}
cellsCount={virtualCellsCount}
leftVirtualCellWidth={leftVirtualCellWidth}
rightVirtualCellWidth={rightVirtualCellWidth}
/>
</Fragment>
)}
{hasTopVirtualRow && !hasBottomVirtualRow && (
<Fragment>
<VirtualRow
height={topVirtualRowHeight}
cellsCount={virtualCellsCount}
leftVirtualCellWidth={leftVirtualCellWidth}
rightVirtualCellWidth={rightVirtualCellWidth}
/>
{children}
</Fragment>
)}
{!hasTopVirtualRow && hasBottomVirtualRow && (
<Fragment>
{children}
<VirtualRow
height={bottomVirtualRowHeight}
cellsCount={virtualCellsCount}
leftVirtualCellWidth={leftVirtualCellWidth}
rightVirtualCellWidth={rightVirtualCellWidth}
/>
</Fragment>
)}
{!hasTopVirtualRow && !hasBottomVirtualRow && (
<Fragment>
{children}
</Fragment>
)}

{/* {hasTopVirtualRow && (
{hasTopVirtualRow && (
<VirtualRow
height={topVirtualRowHeight}
cellsCount={virtualCellsCount}
Expand All @@ -91,7 +42,7 @@ export const viewFunction = ({
leftVirtualCellWidth={leftVirtualCellWidth}
rightVirtualCellWidth={rightVirtualCellWidth}
/>
)} */}
)}
</tbody>
</table>
);
Expand Down

0 comments on commit 2091596

Please sign in to comment.