@ninebone/datagrid 0.0.0-stage → 0.0.3
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/LICENSE +21 -0
- package/README.md +108 -2
- package/dist/css/nine-table.css +1713 -0
- package/dist/nine-table.js +4234 -0
- package/dist/nine-table.js.map +1 -0
- package/dist/nine-table.umd.js +223 -0
- package/dist/nine-table.umd.js.map +1 -0
- package/package.json +49 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ninebone
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ninelab HTML Table (`@ninebone/datagrid`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Blazing-fast performance powered by native HTML tags** — A next-generation table extension supporting 1,000,000+ rows virtual rendering and seamless inline editing out of the box.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://www.npmjs.com/)
|
|
7
|
+
|
|
8
|
+
Tired of heavy, overly complex JavaScript data grids? **Ninelab HTML Table** preserves the familiar structure of native HTML tags while leveraging advanced DOM virtualization to handle massive datasets effortlessly and provide a frictionless inline editing experience.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Key Features
|
|
13
|
+
|
|
14
|
+
- **1M+ DOM Virtualized Rendering:** Scroll and render over a million rows in a fraction of a second without dropping frames.
|
|
15
|
+
- **Seamless Inline Editing & Form Binding:** Native support for Text, Number, Date, Color, Checkbox, Radio, and Combo (Autocomplete) input types.
|
|
16
|
+
- **HTML Tag-Based (Zero Learning Curve):** No complicated JS configuration objects required—build tables using familiar tag structures.
|
|
17
|
+
- **Shadow DOM & CSS Variables:** Perfect style encapsulation with zero CSS pollution, easily customizable via CSS variables.
|
|
18
|
+
- **Framework Agnostic:** Drops seamlessly into React, Vue, Svelte, or Vanilla JS.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Live Demo & Previews
|
|
23
|
+
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
- [Live Demo](https://ninebone.github.io/datagrid/)
|
|
27
|
+
|
|
28
|
+
### Framework Examples & Input Demos
|
|
29
|
+
- [Vanilla JS Examples](#)
|
|
30
|
+
- [React Examples](#)
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
### 1. Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install @ninebone/datagrid
|
|
40
|
+
|
|
41
|
+
<!-- HTML example -->
|
|
42
|
+
|
|
43
|
+
<html>
|
|
44
|
+
<head>
|
|
45
|
+
<script type="text/javascript" src="[https://cdn.jsdelivr.net/npm/@ninebone/datagrid@latest/dist/nine-table.umd.js](https://cdn.jsdelivr.net/npm/@ninebone/table@latest/dist/nine-table.umd.js)"></script>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
|
|
49
|
+
<div style="height: 600px;">
|
|
50
|
+
<ninelab-table show-footer="true">
|
|
51
|
+
<table row-indicator="true">
|
|
52
|
+
<colgroup>
|
|
53
|
+
<col width="50" fixed="left"/>
|
|
54
|
+
<col width="130"/>
|
|
55
|
+
<col width="100"/>
|
|
56
|
+
<col width="110"/>
|
|
57
|
+
</colgroup>
|
|
58
|
+
<thead>
|
|
59
|
+
<tr>
|
|
60
|
+
<th cell-type="checkbox"></th>
|
|
61
|
+
<th>Avatar & Name</th>
|
|
62
|
+
<th>Status Badge</th>
|
|
63
|
+
<th>Input Editor</th>
|
|
64
|
+
</tr>
|
|
65
|
+
</thead>
|
|
66
|
+
<tbody>
|
|
67
|
+
<tr>
|
|
68
|
+
<!-- Checkbox Cell -->
|
|
69
|
+
<td data-bind="sel" cell-type="checkbox"></td>
|
|
70
|
+
|
|
71
|
+
<!-- Custom Image Renderer -->
|
|
72
|
+
<td data-bind="NAME" data-expr="host.renderImage(data.PIC)" html="true"></td>
|
|
73
|
+
|
|
74
|
+
<!-- Custom Badge / Chart Renderer -->
|
|
75
|
+
<td data-expr="host.renderBadge(data.REC1, data.REC2)" html="true"></td>
|
|
76
|
+
|
|
77
|
+
<!-- Inline Input Binding -->
|
|
78
|
+
<td data-bind="NAME" cell-type="input" enable="data.REC1 > 30"></td>
|
|
79
|
+
</tr>
|
|
80
|
+
</tbody>
|
|
81
|
+
</table>
|
|
82
|
+
</ninelab-table>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<script>
|
|
86
|
+
const grd = document.querySelector("nine-table");
|
|
87
|
+
|
|
88
|
+
grd.addEventListener("load", () => {
|
|
89
|
+
// Define custom host helper functions used in data-expr
|
|
90
|
+
grd.renderImage = (v) => `<img src="${v}" width="40" height="40" style="border-radius:50%;" />`;
|
|
91
|
+
|
|
92
|
+
grd.renderBadge = (v1, v2) => `<span>Score: ${Number(v1) + Number(v2)}</span>`;
|
|
93
|
+
|
|
94
|
+
// Binding Data
|
|
95
|
+
grd.data.set([{
|
|
96
|
+
A: "a",
|
|
97
|
+
...
|
|
98
|
+
},
|
|
99
|
+
...
|
|
100
|
+
]);
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
</body>
|
|
104
|
+
</html>
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## LICENSE
|
|
109
|
+
MIT © 2026 ninebone
|