Skip to content

Commit c408320

Browse files
committed
remove table from css, added manual size calc. added Not blank filter, general imporvemtns
1 parent 26f2deb commit c408320

File tree

13 files changed

+292
-337
lines changed

13 files changed

+292
-337
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@jjmyers/datatable",
3-
"version": "0.5.5",
3+
"version": "0.5.6",
44
"private": false,
55
"main": "build/index.js",
66
"module": "build/index.esm.js",

src/index.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import React, { useEffect, useState } from "react";
22
import { createRoot } from 'react-dom/client';
33
import { data } from "./data";
44

@@ -16,21 +16,21 @@ function App() {
1616
data: data,
1717
count: data.length,
1818
serverSide: false,
19+
onFilter: console.log,
1920
columns: [
20-
{ field: "emp_id", datatype: "number", sortable: false },
21-
{ field: "name", width: 200, datatype: "string", multiFilter: true },
22-
{ field: "email", width: 200, datatype: "email", },
21+
{ field: "emp_id", width: 100, datatype: "number", sortable: false },
22+
{ field: "name", width: 100, datatype: "string", multiFilter: true },
23+
{ field: "email", datatype: "email", },
2324
{ field: "dob", datatype: "date" },
2425
{ field: "image", datatype: "image" },
25-
{ field: "phone", width: 200, columnName: "Phone And a really long header", datatype: "phone" },
26+
{ field: "phone", columnName: "Phone And a really long header", datatype: "phone" },
2627
{ field: "is_active", datatype: "boolean" },
27-
{ field: "bio", datatype: "paragraph" },
28+
{ field: "bio", width: 500, datatype: "paragraph" },
2829
],
2930
})
3031

3132
const AppsPanel = ({ OmitColumns }: Datatable.AppsPanelProps) => (
3233
<>
33-
<button onClick={() => controller.toggleAutoWidth()} style={{ padding: 8 }}>Auto Width</button>
3434
<button onClick={() => controller.selectable.selectAll(true)} style={{ padding: 8 }}>Check All</button>
3535
<button onClick={() => controller.selectable.selectAll(false)} style={{ padding: 8 }}>Uncheck All</button>
3636
<button onClick={() => controller.updateFilter(prev => ({ ...prev, ["custom"]: "Hello!" }))} style={{ padding: 8 }}>Custom filter option</button>
@@ -47,7 +47,6 @@ function App() {
4747
<div onClick={() => setIsFetching(p => !p)} style={{ padding: 8 }}>Row Option 4</div>
4848
</>);
4949

50-
5150
return (
5251
<Datatable
5352
isFetching={isFetching}

0 commit comments

Comments
 (0)