comins-table 0.1.1
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +219 -0
- package/dist/clipboard.d.ts +3 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +2 -0
- package/dist/component-renderer.d.ts +5 -0
- package/dist/component-renderer.d.ts.map +1 -0
- package/dist/core.d.ts +680 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +691 -0
- package/dist/core.js.map +1 -0
- package/dist/index.d.ts +125 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1959 -0
- package/dist/index.js.map +1 -0
- package/dist/selection.d.ts +3 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +2 -0
- package/dist/summary.d.ts +14 -0
- package/dist/summary.d.ts.map +1 -0
- package/dist/tree.d.ts +20 -0
- package/dist/tree.d.ts.map +1 -0
- package/package.json +75 -0
- package/styles.css +1059 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Comins Table
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- Prepared a privacy-safe metadata release candidate pending npm account email verification.
|
|
6
|
+
- Hardened GitHub verification and staged-publishing workflows and added Dependabot update checks.
|
|
7
|
+
- No runtime or public API changes.
|
|
8
|
+
|
|
9
|
+
## 0.1.0
|
|
10
|
+
|
|
11
|
+
- Initial public release of Comins Table.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MS
|
|
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
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Comins Table
|
|
2
|
+
|
|
3
|
+
Comins Table is a controlled React data table for data-heavy application screens. It provides a reusable table component, framework-independent core helpers, virtualized rendering, selection, clipboard helpers, pagination, sorting, two-level headers, summary rows, controlled Tree Grid rendering, lazy loading, infinite scrolling, loading states, and CSS-variable based theming.
|
|
4
|
+
|
|
5
|
+
Comins Table is built as a standalone open-source package. It does not wrap AG Grid, MUI X, TanStack Table, or another table/grid implementation.
|
|
6
|
+
|
|
7
|
+
## Repository Scope
|
|
8
|
+
|
|
9
|
+
Comins Table is maintained as an independent repository. This repository is the source of truth for the library, Playground, public documentation, tests, and releases.
|
|
10
|
+
|
|
11
|
+
Run development and verification commands from this repository root. Comins Table is not managed as a workspace package, so commands do not require an `npm --workspace` prefix. Future feature work and releases belong in this repository.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install comins-table react react-dom
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { CominsTable, type CominsTableColumn } from "comins-table";
|
|
21
|
+
import "comins-table/styles.css";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
React and React DOM are peer dependencies:
|
|
25
|
+
|
|
26
|
+
| Package | Version |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| `react` | `>=18.0.0 <20.0.0` |
|
|
29
|
+
| `react-dom` | `>=18.0.0 <20.0.0` |
|
|
30
|
+
|
|
31
|
+
## Runtime Boundary
|
|
32
|
+
|
|
33
|
+
Comins Table is browser UI. Its package source does not make network requests, load remote assets, collect telemetry, or send error reports. Server rendering is not yet a supported integration contract; use an application client boundary where SSR is present.
|
|
34
|
+
|
|
35
|
+
## Supported Platforms
|
|
36
|
+
|
|
37
|
+
| Surface | Support |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| React | `>=18.0.0 <20.0.0` |
|
|
40
|
+
| React DOM | `>=18.0.0 <20.0.0` |
|
|
41
|
+
| Chrome and Edge | Current stable Chromium-based releases |
|
|
42
|
+
| Automated browser gate | Playwright-bundled Chromium |
|
|
43
|
+
| Firefox and Safari | Not in the supported contract until Firefox and WebKit projects are added |
|
|
44
|
+
| SSR | Client boundary required; server rendering is not currently supported |
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { useState } from "react";
|
|
50
|
+
import { CominsTable, type CominsTableColumn } from "comins-table";
|
|
51
|
+
import "comins-table/styles.css";
|
|
52
|
+
|
|
53
|
+
type UserRow = {
|
|
54
|
+
active: boolean;
|
|
55
|
+
age: number;
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
role: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const columns: Array<CominsTableColumn<UserRow>> = [
|
|
62
|
+
{ field: "name", label: "Name", sort: true },
|
|
63
|
+
{ field: "age", label: "Age", sort: true },
|
|
64
|
+
{ field: "role", label: "Role" },
|
|
65
|
+
{
|
|
66
|
+
field: "active",
|
|
67
|
+
label: "Active",
|
|
68
|
+
cell: {
|
|
69
|
+
format: ({ value }) => (value ? "Active" : "Inactive"),
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
export function UsersTable() {
|
|
75
|
+
const [data, setData] = useState<UserRow[]>([
|
|
76
|
+
{ active: true, age: 31, id: "u-1", name: "Kim", role: "Admin" },
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<CominsTable<UserRow>
|
|
81
|
+
columns={columns}
|
|
82
|
+
data={data}
|
|
83
|
+
getRowId={(row) => row.id}
|
|
84
|
+
onChangeData={setData}
|
|
85
|
+
pagination={{ pageIndex: 0, pageSize: 30 }}
|
|
86
|
+
theme={{ density: "compact" }}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Core Model
|
|
93
|
+
|
|
94
|
+
Comins Table is a CSR-focused controlled component. The application owns the `data` array. Table operations such as row movement, paste, and selection emit callbacks like `onChangeData`, `onChangeSelection`, `onChangeColumnLayout`, and `onChangeSort`; the application then writes the next state back into the component.
|
|
95
|
+
|
|
96
|
+
The root export includes `CominsTable`, public types, and core helpers. Narrower helper sets are also available from stable subpaths.
|
|
97
|
+
|
|
98
|
+
| Import | Purpose |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| `comins-table` | React component, public types, and root helper exports |
|
|
101
|
+
| `comins-table/core` | State, row, column, pagination, sorting, layout, selection, clipboard, export, and virtualization helpers |
|
|
102
|
+
| `comins-table/clipboard` | Clipboard helper subset |
|
|
103
|
+
| `comins-table/selection` | Selection helper subset |
|
|
104
|
+
| `comins-table/styles.css` | Optional table shell, theme, and built-in component skin |
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import {
|
|
108
|
+
addCominsRows,
|
|
109
|
+
applyCominsColumnLayout,
|
|
110
|
+
copyCominsCellRange,
|
|
111
|
+
createCominsTableState,
|
|
112
|
+
deleteCominsRows,
|
|
113
|
+
exportCominsRowsToCsv,
|
|
114
|
+
exportCominsRowsToJson,
|
|
115
|
+
fillCominsCellRange,
|
|
116
|
+
pasteCominsCellRange,
|
|
117
|
+
queryCominsRows,
|
|
118
|
+
selectCell,
|
|
119
|
+
selectCellRange,
|
|
120
|
+
selectRow,
|
|
121
|
+
serializeCominsColumnLayout,
|
|
122
|
+
setCominsPagination,
|
|
123
|
+
setCominsSortState,
|
|
124
|
+
updateCominsRows,
|
|
125
|
+
} from "comins-table/core";
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Features
|
|
129
|
+
|
|
130
|
+
- Controlled `data` and `onChangeData` flow for application-owned state.
|
|
131
|
+
- Column definitions with `field`, `id`, `label`, `sort`, width constraints, row/cell `props`, header configuration, and cell configuration.
|
|
132
|
+
- Header visibility, keyboard sorting, `aria-sort`, resize, long-press column reorder, and layout persistence.
|
|
133
|
+
- Two-level headers through `columnGroups`.
|
|
134
|
+
- Row click, double click, keyboard callbacks, context menu callbacks, row selection, row drag reorder, row copy, and row paste.
|
|
135
|
+
- Cell formatting, custom renderer, cell events, single-cell selection, range selection, and drag range selection.
|
|
136
|
+
- Clipboard helpers with `props.copyable`, `props.pasteable`, and disabled guard support.
|
|
137
|
+
- Pagination, loading and empty states, virtualized rendering, infinite scroll, and append-mode lazy loading.
|
|
138
|
+
- Configurable Summary Row aggregation, including leaf-only totals in Tree Grid.
|
|
139
|
+
- Controlled Tree Grid data with `{ item, expand, children }`, existing item-based columns, recursive sibling sorting, and accessible expanders.
|
|
140
|
+
- CSS-variable based themes, including `comins-table-theme--basic`, `--dark`, `--skyblue`, `--mint`, `--gray`, and `--orange`.
|
|
141
|
+
- Built-in header and cell controls: `button`, `input`, `checkbox`, `radio`, `select`, `toggle`, `progress`, header `menu`, and cell `virtual-list`.
|
|
142
|
+
- CSV and JSON export helpers.
|
|
143
|
+
|
|
144
|
+
## Props And Events
|
|
145
|
+
|
|
146
|
+
| Prop | Purpose |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `data` | Controlled row array. Replace it with a new array when the source data changes. |
|
|
149
|
+
| `columns` | Leaf column definitions. `field` supports nested paths. |
|
|
150
|
+
| `columnGroups` | Optional two-level parent header definitions. |
|
|
151
|
+
| `getRowId` | Stable row id resolver used by selection, movement, and callbacks. |
|
|
152
|
+
| `onChangeData` | Receives data changes from paste and row movement. |
|
|
153
|
+
| `onChangeSelection` | Receives row, cell, and range selection changes. |
|
|
154
|
+
| `onChangeColumnLayout` | Receives column width, order, and visibility changes. |
|
|
155
|
+
| `onChangeSort` | Receives sort state changes. |
|
|
156
|
+
| `onClickCell` / `onClickRow` | Receives click payloads for cell and row interactions. |
|
|
157
|
+
| `pagination` | Controls `pageIndex` and `pageSize`. |
|
|
158
|
+
| `loading`, `emptyComponent`, `skeletonRowCount` | Control skeleton rows, refetch overlay, and empty state content. |
|
|
159
|
+
| `virtualized`, `"buffer-size"`, `rowHeight` | Enable and tune virtualized row rendering. |
|
|
160
|
+
| `infiniteScroll`, `infiniteScrollThreshold`, `hasMoreRows`, `loadingMore`, `onLoadMore` | Control append loading when the body viewport nears the bottom. |
|
|
161
|
+
| `lazyLoad`, `lazyLoadBatchSize`, `lazyLoadMode`, `lazyLoadThreshold`, `onLazyLoad` | Control async append-mode data loading with `AbortSignal`. |
|
|
162
|
+
| `summary` | Configures fixed footer aggregates by column. Tree Grid aggregates leaf items only. |
|
|
163
|
+
| `tree` | Opts into controlled `{ item, expand, children }` data. Tree Grid does not support pagination, lazy loading, infinite scrolling, row drag, or row-level copy/paste in V1. |
|
|
164
|
+
| `theme` | Supplies optional `className`, inline `style`, and density settings. |
|
|
165
|
+
| `rowProps` | Supplies row class, style, disabled, and `rowProps.draggable` behavior. |
|
|
166
|
+
|
|
167
|
+
## Ref API
|
|
168
|
+
|
|
169
|
+
```tsx
|
|
170
|
+
const tableRef = useRef<CominsTableRef<UserRow>>(null);
|
|
171
|
+
|
|
172
|
+
tableRef.current?.getColumnLayout();
|
|
173
|
+
tableRef.current?.setColumnLayout(savedLayout);
|
|
174
|
+
tableRef.current?.getSortState();
|
|
175
|
+
tableRef.current?.setSortState({ columnId: "age", direction: "desc" });
|
|
176
|
+
tableRef.current?.clearSort();
|
|
177
|
+
tableRef.current?.setSelectedRow(0);
|
|
178
|
+
tableRef.current?.setSelectedRows([0, 1]);
|
|
179
|
+
tableRef.current?.setMoveTargetRow(3, 1);
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
`setSelectedRow`, `setSelectedRows`, and `setMoveTargetRow` use the visible row index after current sorting and pagination are applied.
|
|
183
|
+
|
|
184
|
+
## Documentation
|
|
185
|
+
|
|
186
|
+
English user documentation starts at `docs/user/01-quick-start.md`.
|
|
187
|
+
|
|
188
|
+
The previous Korean documentation is preserved under `docs/ko/` as secondary documentation while the public package moves to English-first docs.
|
|
189
|
+
|
|
190
|
+
## Playground
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm run dev
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The playground starts at `/docs/getting-started` and includes examples for CRUD, sizing, theme, loading and empty states, headers, column groups, pagination, infinite scroll, lazy load, virtualization, cells, rows, Tree Grid, built-in components, selection, clipboard, context menu, and export helpers.
|
|
197
|
+
|
|
198
|
+
## Development
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npm run lint
|
|
202
|
+
npm run test:run
|
|
203
|
+
npm run build
|
|
204
|
+
npm run test:e2e
|
|
205
|
+
npm run test:perf -- --workers=1
|
|
206
|
+
npm pack --dry-run --json
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Release Bootstrap
|
|
210
|
+
|
|
211
|
+
`comins-table` does not yet exist on the npm registry. npm cannot register trusted or staged publishing for a brand-new package, so the first public version must be published interactively by the maintainer with npm 2FA and without an automation token.
|
|
212
|
+
|
|
213
|
+
After that bootstrap publication, register `kim1124/comins-table`, `publish.yml`, and the `npm` environment as the trusted publisher. Allow only `npm stage publish`, disallow token publishing, and require maintainer 2FA approval for every staged version. The repository workflow is intentionally manual and refuses non-`main` refs, mismatched versions, and missing bootstrap packages.
|
|
214
|
+
|
|
215
|
+
## Current Scope
|
|
216
|
+
|
|
217
|
+
Comins Table currently ships CSR table rendering, controlled data updates, row/cell selection, clipboard helpers, pagination, sorting, layout helpers, two-level headers, built-in controls, virtualized rendering, Summary Row aggregation, controlled Tree Grid rendering, loading and empty states, CSV/JSON export helpers, controlled infinite scrolling, and append-mode lazy loading.
|
|
218
|
+
|
|
219
|
+
It does not currently ship server-side row models, row grouping, pivoting, flat Row Expand detail areas, master/detail, charts integration, an AI assistant, or a drag-handle UI for Excel-like visual fill. Tree Grid V1 deliberately excludes remote tree loading, hierarchy pagination, row drag, and row-level copy/paste. The `fillCominsCellRange` core helper exists, but the drag UX remains outside the first public release.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { copyCominsCell, copyCominsCellRange, copyCominsRow, fillCominsCellRange, pasteCominsCell, pasteCominsCellRange, pasteCominsRow, } from "./core";
|
|
2
|
+
export type { CominsClipboardGuard, CominsCopiedCell, CominsCopiedCellRange, CominsCopiedCellRangeCell, CominsCopiedRow, CominsFillCellRangeOptions, CominsPasteRowOptions, } from "./core";
|
|
3
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../src/clipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,cAAc,GACf,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { copyCominsCell as e, copyCominsCellRange as t, copyCominsRow as n, fillCominsCellRange as r, pasteCominsCell as i, pasteCominsCellRange as a, pasteCominsRow as o } from "./core.js";
|
|
2
|
+
export { e as copyCominsCell, t as copyCominsCellRange, n as copyCominsRow, r as fillCominsCellRange, i as pasteCominsCell, a as pasteCominsCellRange, o as pasteCominsRow };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { CominsCellComponentConfig, CominsCellComponentPayload, CominsHeaderComponentConfig, CominsHeaderComponentPayload } from "./core";
|
|
3
|
+
export declare function renderCominsBuiltInComponent<TData, TValue>(component: CominsCellComponentConfig<TData, TValue>, payload: CominsCellComponentPayload<TData, TValue>): React.ReactNode;
|
|
4
|
+
export declare function renderCominsBuiltInComponent<TData, TValue>(component: CominsHeaderComponentConfig<TData, TValue>, payload: CominsHeaderComponentPayload<TData, TValue>): React.ReactNode;
|
|
5
|
+
//# sourceMappingURL=component-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-renderer.d.ts","sourceRoot":"","sources":["../src/component-renderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAG1B,2BAA2B,EAC3B,4BAA4B,EAE7B,MAAM,QAAQ,CAAC;AAivBhB,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EACxD,SAAS,EAAE,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,EACnD,OAAO,EAAE,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,GACjD,KAAK,CAAC,SAAS,CAAC;AACnB,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,EACxD,SAAS,EAAE,2BAA2B,CAAC,KAAK,EAAE,MAAM,CAAC,EACrD,OAAO,EAAE,4BAA4B,CAAC,KAAK,EAAE,MAAM,CAAC,GACnD,KAAK,CAAC,SAAS,CAAC"}
|