-
Notifications
You must be signed in to change notification settings - Fork 71
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
6 changed files
with
167 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './propertygrid.spec'; | ||
export * from './templates/propertygrid-normal'; | ||
export * from './templates/propertygrid-with-preview'; |
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,33 @@ | ||
import { classNames } from '../misc'; | ||
import { KendoGridProps } from '../grid'; | ||
import { TreeList } from '../treelist'; | ||
|
||
const PROPERTYGRID_CLASSNAME = 'k-property-grid'; | ||
|
||
const states = []; | ||
|
||
const options = {}; | ||
|
||
const defaultOptions = {}; | ||
|
||
export const PropertyGrid = ( | ||
props: KendoGridProps & | ||
React.HTMLAttributes<HTMLDivElement> | ||
) => ( | ||
<TreeList | ||
{...props} | ||
className={classNames( | ||
PROPERTYGRID_CLASSNAME, | ||
props.className | ||
)} | ||
> | ||
{props.children} | ||
</TreeList> | ||
); | ||
|
||
PropertyGrid.states = states; | ||
PropertyGrid.options = options; | ||
PropertyGrid.className = PROPERTYGRID_CLASSNAME; | ||
PropertyGrid.defaultOptions = defaultOptions; | ||
|
||
export default PropertyGrid; |
98 changes: 98 additions & 0 deletions
98
packages/html/src/propertygrid/templates/propertygrid-normal.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,98 @@ | ||
import { PropertyGrid } from ".."; | ||
import { Button } from "../../button"; | ||
import { DropdownList } from "../../dropdownlist"; | ||
import { GridToolbar, GridContainer, GridContent, GridTable } from "../../grid"; | ||
import { Icon } from "../../icon"; | ||
import { TableTbody, TableRow, TableTd } from "../../table"; | ||
import { Textbox } from "../../textbox"; | ||
|
||
export const PropertyGridNormal = ({ content, ...other }: any) => ( | ||
<PropertyGrid | ||
style={{ height: "450px" }} | ||
toolbar={( | ||
<GridToolbar resizable> | ||
<Textbox prefix={<Icon icon="search" />} placeholder="Search..." /> | ||
<DropdownList value="Default Sort" /> | ||
<Button icon="categorize" /> | ||
<Button icon="info-circle" /> | ||
</GridToolbar> | ||
)} | ||
{...other} | ||
> | ||
<GridContainer> | ||
{content || | ||
<GridContent className="k-auto-scrollable"> | ||
<GridTable> | ||
<colgroup> | ||
<col style={{ width: "200px" }} /> | ||
<col style={{ width: "250px" }} /> | ||
</colgroup> | ||
<TableTbody> | ||
<TableRow> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
size | ||
</TableTd> | ||
<TableTd><b>medium</b></TableTd> | ||
</TableRow> | ||
<TableRow className="k-alt" alt> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
themeColor | ||
</TableTd> | ||
<TableTd><b>base</b></TableTd> | ||
</TableRow> | ||
<TableRow> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
fillMode | ||
</TableTd> | ||
<TableTd><b>solid</b></TableTd> | ||
</TableRow> | ||
<TableRow className="k-alt" alt> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
rounded | ||
</TableTd> | ||
<TableTd><b>medium</b></TableTd> | ||
</TableRow> | ||
<TableRow> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
icon | ||
</TableTd> | ||
<TableTd><Icon icon="star" /></TableTd> | ||
</TableRow> | ||
<TableRow className="k-alt" alt> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="caret-alt-down"></Icon> | ||
font | ||
</TableTd> | ||
<TableTd>Roboto 400</TableTd> | ||
</TableRow> | ||
<TableRow> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
font-weight | ||
</TableTd> | ||
<TableTd><b>400</b></TableTd> | ||
</TableRow> | ||
<TableRow className="k-alt" alt> | ||
<TableTd> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
<Icon className="k-treelist-toggle" icon="none"></Icon> | ||
font-family | ||
</TableTd> | ||
<TableTd><b>Roboto</b></TableTd> | ||
</TableRow> | ||
<TableRow className="k-hidden k-bottom k-sticky k-footer-template"> | ||
<TableTd colspan="2"><span> </span></TableTd> | ||
</TableRow> | ||
</TableTbody> | ||
</GridTable> | ||
</GridContent> | ||
} | ||
</GridContainer> | ||
</PropertyGrid> | ||
); |
14 changes: 14 additions & 0 deletions
14
packages/html/src/propertygrid/templates/propertygrid-with-preview.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,14 @@ | ||
import { PropertyGridNormal } from ".."; | ||
import { Button } from "../../button"; | ||
import { Splitter, SplitterPane } from "../../splitter"; | ||
|
||
export const PropertyGridWithPreview = ({ content, ...other }: any) => ( | ||
<Splitter> | ||
<SplitterPane scrollable flexBasis="215px"> | ||
<Button icon="star">Button</Button> | ||
</SplitterPane> | ||
<SplitterPane scrollable> | ||
<PropertyGridNormal {...other} content={content} /> | ||
</SplitterPane> | ||
</Splitter> | ||
); |
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,18 @@ | ||
import { PropertyGridWithPreview } from ".."; | ||
|
||
const styles = ` | ||
.k-pane:nth-child(1) { | ||
text-align: center; | ||
margin-top: 10%; | ||
} | ||
`; | ||
|
||
|
||
export default () => ( | ||
<> | ||
<style>{styles}</style> | ||
<div id="test-area" className="k-d-grid"> | ||
<PropertyGridWithPreview /> | ||
</div> | ||
</> | ||
); |