Form interface and Loading menu
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Divider, Group, Stack, TagsInput, TextInput } from '@mantine/core';
|
||||
import { Checkbox, Divider, Group, Stack, TagsInput, TextInput } from '@mantine/core';
|
||||
import { useLocalStorage } from '@mantine/hooks';
|
||||
import { useState } from 'react';
|
||||
|
||||
@@ -15,6 +15,7 @@ export const GridlerGoAPIExampleEventlog = () => {
|
||||
const [apiKey, setApiKey] = useLocalStorage({ defaultValue: '', key: 'apikey' });
|
||||
const [selectRow, setSelectRow] = useState<string | undefined>('');
|
||||
const [values, setValues] = useState<Array<Record<string, any>>>([]);
|
||||
const [sections, setSections] = useState<Record<string, unknown> | undefined>(undefined);
|
||||
const columns: GridlerColumns = [
|
||||
{
|
||||
id: 'id_process',
|
||||
@@ -49,6 +50,21 @@ export const GridlerGoAPIExampleEventlog = () => {
|
||||
<TextInput label="API Url" onChange={(e) => setApiUrl(e.target.value)} value={apiUrl} />
|
||||
<TextInput label="API Key" onChange={(e) => setApiKey(e.target.value)} value={apiKey} />
|
||||
<Divider />
|
||||
<Checkbox
|
||||
label="Show Side Sections"
|
||||
checked={!!sections}
|
||||
onChange={(e) => {
|
||||
e.target.checked
|
||||
? setSections({
|
||||
bottom: <div style={{ backgroundColor: 'teal', height: '25px' }}>bottom</div>,
|
||||
left: <div style={{ backgroundColor: 'orange', width: '20px' }}>L</div>,
|
||||
right: <div style={{ backgroundColor: 'green', width: '20px' }}>R</div>,
|
||||
top: <div style={{ backgroundColor: 'purple', height: '20px' }}>top</div>,
|
||||
})
|
||||
: setSections(undefined);
|
||||
}}
|
||||
/>
|
||||
<Divider />
|
||||
<Gridler
|
||||
height="100%"
|
||||
columns={columns}
|
||||
@@ -69,12 +85,7 @@ export const GridlerGoAPIExampleEventlog = () => {
|
||||
//console.log('GridlerGoAPIExampleEventlog onChange', v);
|
||||
setValues(v);
|
||||
}}
|
||||
sections={{
|
||||
bottom: <div style={{ backgroundColor: 'teal', height: '25px' }}>bottom</div>,
|
||||
left: <div style={{ backgroundColor: 'orange', width: '20px' }}>L</div>,
|
||||
right: <div style={{ backgroundColor: 'green', width: '20px' }}>R</div>,
|
||||
top: <div style={{ backgroundColor: 'purple', height: '20px' }}>top</div>,
|
||||
}}
|
||||
sections={sections}
|
||||
selectedRow={selectRow ? parseInt(selectRow, 10) : undefined}
|
||||
selectMode="row"
|
||||
uniqueid="gridtest"
|
||||
|
||||
Reference in New Issue
Block a user