@fluid-topics/ft-table 1.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/build/ft-table.light.js +1860 -0
- package/build/ft-table.min.js +2059 -0
- package/build/ftds-table.d.ts +44 -0
- package/build/ftds-table.js +257 -0
- package/build/ftds-table.properties.d.ts +33 -0
- package/build/ftds-table.properties.js +10 -0
- package/build/ftds-table.styles.d.ts +2 -0
- package/build/ftds-table.styles.js +121 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +6 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
A filterable table component.
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
npm install @fluid-topics/ft-table
|
|
7
|
+
yarn add @fluid-topics/ft-table
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
### Lit
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { html } from "lit"
|
|
16
|
+
import "@fluid-topics/ft-table"
|
|
17
|
+
import {
|
|
18
|
+
ColumnConfiguration,
|
|
19
|
+
RowClickEvent
|
|
20
|
+
} from "@fluid-topics/ft-table"
|
|
21
|
+
|
|
22
|
+
interface Model {
|
|
23
|
+
...
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function render() {
|
|
27
|
+
const data: Array<Model> = [ ... ]
|
|
28
|
+
const columns: Array<ColumnConfiguration<Model>> = [ ... ]
|
|
29
|
+
const sort: Sort = {
|
|
30
|
+
column: 0,
|
|
31
|
+
order: "asc"
|
|
32
|
+
}
|
|
33
|
+
return html`
|
|
34
|
+
<ftds-table
|
|
35
|
+
.data=${ data }
|
|
36
|
+
.columns=${ columns }
|
|
37
|
+
.sort=${ sort }
|
|
38
|
+
@row-click=${ (e: RowClickEvent<Model>) => console.log("Clicked on row: " + e.detail.title) }
|
|
39
|
+
/>
|
|
40
|
+
`
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Vanilla JS
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<!DOCTYPE html>
|
|
48
|
+
<html>
|
|
49
|
+
<head>
|
|
50
|
+
<title>Ftds Table Demo</title>
|
|
51
|
+
<script src="./build/ft-table.min.js"></script>
|
|
52
|
+
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet">
|
|
53
|
+
</head>
|
|
54
|
+
<body>
|
|
55
|
+
<ft-table id="table"></ft-table>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
|
58
|
+
|
|
59
|
+
```
|