Compare commits
2 Commits
649d56f992
...
4985c46814
| Author | SHA1 | Date |
|---|---|---|
|
|
4985c46814 | |
|
|
60b916c4d8 |
|
|
@ -14,8 +14,9 @@ describe('DATABASE', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('create csv', () => {
|
it('create csv', () => {
|
||||||
let res = create_csv_database('csv_db/x.csv', { "a_key": [], "a_value": [] })
|
let res = create_csv_database('csv_db/x.csv', { "a_key": ['initial'], "a_value": [''] })
|
||||||
print_head(res)
|
print_head(res)
|
||||||
|
delete_row_by_key(res, "initial", "a_key")
|
||||||
|
|
||||||
add_row(res, { "a_key": ["x"], "a_value": ["y"] })
|
add_row(res, { "a_key": ["x"], "a_value": ["y"] })
|
||||||
print_head(res)
|
print_head(res)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ export function save_db(db: CSVDatabase) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function add_row(db: CSVDatabase, row: any) {
|
export function add_row(db: CSVDatabase, row: any) {
|
||||||
let d = DataFrame([row])
|
let d = DataFrame(row)
|
||||||
db.df = db.df.vstack(d)
|
db.df = db.df.vstack(d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
import { Container } from '@mantine/core'
|
||||||
|
import { Flex, Button } from '@mantine/core'
|
||||||
|
import React from "react"
|
||||||
|
|
||||||
|
const NavLink = (props: any) =>
|
||||||
|
<li className="nav-item">
|
||||||
|
<a className="nav-link" href={props.href}>
|
||||||
|
{props.children}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
const Text = (props: any) =>
|
||||||
|
<p>{props.children}</p>
|
||||||
|
|
||||||
|
export default function InventoryPage() {
|
||||||
|
const demoProps = {
|
||||||
|
bg: 'var(--mantine-color-blue-light)',
|
||||||
|
h: 50,
|
||||||
|
mt: 'md',
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Container {...demoProps}>Default Container</Container>
|
||||||
|
|
||||||
|
<Container size="xs" {...demoProps}>
|
||||||
|
xs Container
|
||||||
|
</Container>
|
||||||
|
|
||||||
|
<Container px={0} size="30rem" {...demoProps}>
|
||||||
|
30rem Container without padding
|
||||||
|
</Container>
|
||||||
|
|
||||||
|
<Flex
|
||||||
|
mih={50}
|
||||||
|
bg="rgba(0, 0, 0, .3)"
|
||||||
|
gap="md"
|
||||||
|
justify="flex-start"
|
||||||
|
align="flex-start"
|
||||||
|
direction="row"
|
||||||
|
wrap="wrap"
|
||||||
|
>
|
||||||
|
<Button>Button 1</Button>
|
||||||
|
<Button>Button 2</Button>
|
||||||
|
<Button>Button 3</Button>
|
||||||
|
</Flex>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -42,7 +42,6 @@ export function create_inventory_dataframe(inventories: Inventory[]): CSVDatabas
|
||||||
return create_csv_database(filepath, inventories)
|
return create_csv_database(filepath, inventories)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function create_models() {
|
function create_models() {
|
||||||
const items: Item[] = [
|
const items: Item[] = [
|
||||||
{ id: '1', name: 'Item 1', price: 100 },
|
{ id: '1', name: 'Item 1', price: 100 },
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
['@babel/preset-env', { targets: { node: 'current' } }],
|
|
||||||
'@babel/preset-typescript',
|
|
||||||
],
|
|
||||||
}
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
a_key,a_value
|
a_key,a_value
|
||||||
|
x,y
|
||||||
|
|
|
||||||
|
Loading…
Reference in New Issue