@freegridjs/react 0.0.0-stage → 0.7.0
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 +79 -0
- package/README.md +33 -2
- package/dist/index.d.ts +40 -0
- package/dist/index.js +80 -0
- package/package.json +50 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
FreeGrid License
|
|
2
|
+
Version 1.0, 2026-10-15
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 2nd Korea (세컨드코리아). All rights reserved.
|
|
5
|
+
Contact: help@2nd-korea.com · https://freegrid.app/pricing/
|
|
6
|
+
|
|
7
|
+
This license covers the FreeGrid software, including the packages @freegridjs/core,
|
|
8
|
+
@freegridjs/react and @freegridjs/vue, their source code and the files built from them
|
|
9
|
+
(the "Software").
|
|
10
|
+
|
|
11
|
+
1. Personal use is free
|
|
12
|
+
|
|
13
|
+
An individual may use, copy and modify the Software free of charge for personal,
|
|
14
|
+
educational, research or other non-commercial purposes, including personal websites,
|
|
15
|
+
open-source projects that are not run by a company, and learning or evaluation.
|
|
16
|
+
|
|
17
|
+
2. Company use needs a domain license
|
|
18
|
+
|
|
19
|
+
Any use by or for a company, organization, public body or other business ("Company"),
|
|
20
|
+
whether the product is sold, used internally or offered to customers, requires a paid
|
|
21
|
+
Company License. A Company may evaluate the Software for up to 30 days without a license.
|
|
22
|
+
|
|
23
|
+
- A Company License is issued for one domain (for example example.com) and covers that
|
|
24
|
+
domain and its subdomains. Applications without a domain (desktop apps, intranets
|
|
25
|
+
reached by address) count as one domain per installation site.
|
|
26
|
+
- The fee is KRW 200,000 per domain per year. The license is valid for one year from the
|
|
27
|
+
date it is issued and may be renewed.
|
|
28
|
+
- A license key is provided with each Company License. Setting the key removes the
|
|
29
|
+
console notice described in section 5.
|
|
30
|
+
|
|
31
|
+
3. Conditions for all users
|
|
32
|
+
|
|
33
|
+
- Keep this license and the copyright notice in copies of the Software.
|
|
34
|
+
- Do not sell, rent or sublicense the Software itself, or offer it as a standalone grid
|
|
35
|
+
component or library, with or without changes.
|
|
36
|
+
- Do not remove or work around the license check, or share license keys outside the
|
|
37
|
+
licensed domain.
|
|
38
|
+
|
|
39
|
+
4. No warranty
|
|
40
|
+
|
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
42
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
43
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
44
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE SOFTWARE OR ITS USE.
|
|
45
|
+
|
|
46
|
+
5. Usage report
|
|
47
|
+
|
|
48
|
+
When the Software runs on a public domain (not localhost or a private network address),
|
|
49
|
+
it sends the domain name, the page address without query string, the Software version
|
|
50
|
+
and whether a license key is set to freegrid.app once a day. No data shown in the grid
|
|
51
|
+
and no information about end users is sent. Without a license key on such a domain it
|
|
52
|
+
also prints a notice in the browser developer console.
|
|
53
|
+
|
|
54
|
+
6. Earlier versions
|
|
55
|
+
|
|
56
|
+
Version 0.1.0 of the packages was published under the MIT License and remains available
|
|
57
|
+
under that license. This license applies to version 0.7.0 and later.
|
|
58
|
+
|
|
59
|
+
---------------------------------------------------------------------------------------
|
|
60
|
+
|
|
61
|
+
FreeGrid 라이선스 (요약, 한국어)
|
|
62
|
+
|
|
63
|
+
- 개인: 개인적·교육·연구 등 비상업적 용도로 무료로 사용, 복제, 수정할 수 있습니다.
|
|
64
|
+
- 회사: 회사, 단체, 공공기관 등 업무용으로 쓰려면 판매용·내부용·고객 제공용 모두 유료
|
|
65
|
+
회사 라이선스가 필요합니다. 30일 동안은 평가 목적으로 라이선스 없이 써 볼 수 있습니다.
|
|
66
|
+
- 도메인 1개(하위 도메인 포함) 기준 연 200,000원이며, 발급일로부터 1년간 유효하고
|
|
67
|
+
갱신할 수 있습니다.
|
|
68
|
+
- 라이선스마다 키를 발급하며, 키를 설정하면 콘솔 안내가 사라집니다.
|
|
69
|
+
- 모든 사용자: 저작권과 이 라이선스 문구를 유지해야 하며, 소프트웨어 자체를 판매하거나
|
|
70
|
+
별도 그리드 라이브러리로 재배포할 수 없고, 라이선스 확인을 제거하거나 키를 다른
|
|
71
|
+
도메인에 공유할 수 없습니다.
|
|
72
|
+
- 보증 없음: 소프트웨어는 있는 그대로 제공됩니다.
|
|
73
|
+
- 사용 보고: 공개 도메인에서 실행되면 하루 한 번 도메인 이름, 쿼리 문자열을 뺀 페이지
|
|
74
|
+
주소, 버전, 라이선스 키 설정 여부를 freegrid.app으로 보냅니다. 그리드의 데이터나 최종
|
|
75
|
+
사용자 정보는 보내지 않습니다.
|
|
76
|
+
- 0.1.0 버전은 MIT 라이선스로 배포되었으며 그 버전에는 MIT가 계속 적용됩니다. 이 라이선스는
|
|
77
|
+
0.7.0 버전부터 적용됩니다.
|
|
78
|
+
|
|
79
|
+
문의: help@2nd-korea.com · 대표번호 070-7768-1326
|
package/README.md
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @freegridjs/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React component for [FreeGrid](https://freegrid.app).
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i @freegridjs/core @freegridjs/react
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { FreeGrid } from '@freegridjs/react';
|
|
11
|
+
import '@freegridjs/core/styles.css';
|
|
12
|
+
|
|
13
|
+
<FreeGrid
|
|
14
|
+
columns={columns}
|
|
15
|
+
data={rows}
|
|
16
|
+
rowSelection="multiple"
|
|
17
|
+
onCellClick={e => console.log(e.row)}
|
|
18
|
+
style={{ height: 480 }}
|
|
19
|
+
/>;
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Every grid option is a prop, every event an `on…` prop, and the ref is the grid API. Docs: https://freegrid.app/docs/#react
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
Free for personal use. Company use needs a domain license: KRW 200,000 per domain per year
|
|
27
|
+
(subdomains included). See https://freegrid.app/pricing/ and the LICENSE file.
|
|
28
|
+
|
|
29
|
+
개인은 무료, 회사는 도메인당 연 20만 원입니다. 자세한 내용은 https://freegrid.app/pricing/
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { setLicenseKey } from '@freegridjs/core';
|
|
33
|
+
setLicenseKey('FG1....'); // or createGrid(el, { licenseKey: 'FG1....', ... })
|
|
34
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { GridOptions, ColumnDef, Row, GridEvents, GridApi } from '@freegridjs/core';
|
|
4
|
+
|
|
5
|
+
type Handler<K extends keyof GridEvents> = (payload: GridEvents[K]) => void;
|
|
6
|
+
interface FreeGridProps extends Omit<GridOptions, 'columns' | 'data'> {
|
|
7
|
+
columns: ColumnDef[];
|
|
8
|
+
data: Row[];
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The host needs a height; defaults to 400px. */
|
|
11
|
+
style?: CSSProperties;
|
|
12
|
+
onCellClick?: Handler<'cellClick'>;
|
|
13
|
+
onCellDoubleClick?: Handler<'cellDoubleClick'>;
|
|
14
|
+
onSelectionChange?: Handler<'selectionChange'>;
|
|
15
|
+
onSortChange?: Handler<'sortChange'>;
|
|
16
|
+
onFilterChange?: Handler<'filterChange'>;
|
|
17
|
+
onColumnResize?: Handler<'columnResize'>;
|
|
18
|
+
onColumnMove?: Handler<'columnMove'>;
|
|
19
|
+
onFocusChange?: Handler<'focusChange'>;
|
|
20
|
+
onColumnVisible?: Handler<'columnVisible'>;
|
|
21
|
+
onRangeChange?: Handler<'rangeChange'>;
|
|
22
|
+
onCellValueChanged?: Handler<'cellValueChanged'>;
|
|
23
|
+
onPaste?: Handler<'paste'>;
|
|
24
|
+
onEditStart?: Handler<'editStart'>;
|
|
25
|
+
onEditStop?: Handler<'editStop'>;
|
|
26
|
+
onValidationFailed?: Handler<'validationFailed'>;
|
|
27
|
+
onRowsAdded?: Handler<'rowsAdded'>;
|
|
28
|
+
onRowsRemoved?: Handler<'rowsRemoved'>;
|
|
29
|
+
onGroupChange?: Handler<'groupChange'>;
|
|
30
|
+
onGroupToggle?: Handler<'groupToggle'>;
|
|
31
|
+
onDetailToggle?: Handler<'detailToggle'>;
|
|
32
|
+
onRowDragEnd?: Handler<'rowDragEnd'>;
|
|
33
|
+
onPageChange?: Handler<'pageChange'>;
|
|
34
|
+
onRowsLoaded?: Handler<'rowsLoaded'>;
|
|
35
|
+
onRowsLoadFailed?: Handler<'rowsLoadFailed'>;
|
|
36
|
+
onPivotChange?: Handler<'pivotChange'>;
|
|
37
|
+
}
|
|
38
|
+
declare const FreeGrid: react.ForwardRefExoticComponent<FreeGridProps & react.RefAttributes<GridApi | null>>;
|
|
39
|
+
|
|
40
|
+
export { FreeGrid, type FreeGridProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// src/index.tsx
|
|
2
|
+
import { createGrid } from "@freegridjs/core";
|
|
3
|
+
import { forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var EVENT_PROPS = {
|
|
6
|
+
cellClick: "onCellClick",
|
|
7
|
+
cellDoubleClick: "onCellDoubleClick",
|
|
8
|
+
selectionChange: "onSelectionChange",
|
|
9
|
+
sortChange: "onSortChange",
|
|
10
|
+
filterChange: "onFilterChange",
|
|
11
|
+
columnResize: "onColumnResize",
|
|
12
|
+
columnMove: "onColumnMove",
|
|
13
|
+
focusChange: "onFocusChange",
|
|
14
|
+
columnVisible: "onColumnVisible",
|
|
15
|
+
rangeChange: "onRangeChange",
|
|
16
|
+
cellValueChanged: "onCellValueChanged",
|
|
17
|
+
paste: "onPaste",
|
|
18
|
+
editStart: "onEditStart",
|
|
19
|
+
editStop: "onEditStop",
|
|
20
|
+
validationFailed: "onValidationFailed",
|
|
21
|
+
rowsAdded: "onRowsAdded",
|
|
22
|
+
rowsRemoved: "onRowsRemoved",
|
|
23
|
+
groupChange: "onGroupChange",
|
|
24
|
+
groupToggle: "onGroupToggle",
|
|
25
|
+
detailToggle: "onDetailToggle",
|
|
26
|
+
rowDragEnd: "onRowDragEnd",
|
|
27
|
+
pageChange: "onPageChange",
|
|
28
|
+
rowsLoaded: "onRowsLoaded",
|
|
29
|
+
rowsLoadFailed: "onRowsLoadFailed",
|
|
30
|
+
pivotChange: "onPivotChange"
|
|
31
|
+
};
|
|
32
|
+
var FreeGrid = forwardRef(function FreeGrid2(props, ref) {
|
|
33
|
+
const host = useRef(null);
|
|
34
|
+
const api = useRef(null);
|
|
35
|
+
const latest = useRef(props);
|
|
36
|
+
latest.current = props;
|
|
37
|
+
const applied = useRef({});
|
|
38
|
+
useLayoutEffect(() => {
|
|
39
|
+
const p = latest.current;
|
|
40
|
+
const options = Object.fromEntries(
|
|
41
|
+
Object.entries(p).filter(([k]) => k !== "className" && k !== "style" && !/^on[A-Z]/.test(k))
|
|
42
|
+
);
|
|
43
|
+
const grid = createGrid(host.current, options);
|
|
44
|
+
api.current = grid;
|
|
45
|
+
applied.current = { data: p.data, columns: p.columns, locale: p.locale, theme: p.theme, fontSize: p.fontSize, fontFamily: p.fontFamily, summary: p.summary, groupBy: p.groupBy, pivot: p.pivot };
|
|
46
|
+
const offs = Object.keys(EVENT_PROPS).map(
|
|
47
|
+
(type) => grid.on(type, (payload) => {
|
|
48
|
+
const handler = latest.current[EVENT_PROPS[type]];
|
|
49
|
+
handler?.(payload);
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
return () => {
|
|
53
|
+
offs.forEach((off) => off());
|
|
54
|
+
grid.destroy();
|
|
55
|
+
api.current = null;
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
useImperativeHandle(ref, () => api.current, []);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const grid = api.current;
|
|
61
|
+
const a = applied.current;
|
|
62
|
+
if (!grid) return;
|
|
63
|
+
if (props.columns !== a.columns) grid.setColumns(a.columns = props.columns);
|
|
64
|
+
if (props.data !== a.data) grid.setData(a.data = props.data);
|
|
65
|
+
if (props.locale !== void 0 && props.locale !== a.locale) grid.setLocale(a.locale = props.locale);
|
|
66
|
+
if (props.theme !== void 0 && props.theme !== a.theme) grid.setTheme(a.theme = props.theme);
|
|
67
|
+
if (props.summary !== a.summary) grid.setSummary((a.summary = props.summary) ?? null);
|
|
68
|
+
if (props.groupBy !== a.groupBy) grid.setGroupBy((a.groupBy = props.groupBy) ?? []);
|
|
69
|
+
if (props.pivot !== a.pivot) grid.setPivot((a.pivot = props.pivot) ?? null);
|
|
70
|
+
if (props.fontSize !== a.fontSize || props.fontFamily !== a.fontFamily) {
|
|
71
|
+
a.fontSize = props.fontSize;
|
|
72
|
+
a.fontFamily = props.fontFamily;
|
|
73
|
+
grid.setFont({ size: props.fontSize, family: props.fontFamily ?? null });
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
return /* @__PURE__ */ jsx("div", { ref: host, className: props.className, style: { height: 400, ...props.style } });
|
|
77
|
+
});
|
|
78
|
+
export {
|
|
79
|
+
FreeGrid
|
|
80
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@freegridjs/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "React component for FreeGrid, the fast data grid (free for personal use).",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@freegridjs/core": "^0.7.0",
|
|
22
|
+
"react": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@freegridjs/core": "^0.7.0",
|
|
26
|
+
"@testing-library/react": "^16.3.3",
|
|
27
|
+
"@types/react": "^19.3.0",
|
|
28
|
+
"@types/react-dom": "^19.3.0",
|
|
29
|
+
"jsdom": "^30.1.2",
|
|
30
|
+
"react": ">=18",
|
|
31
|
+
"react-dom": "^19.3.0",
|
|
32
|
+
"tsup": "^8.5.1",
|
|
33
|
+
"typescript": "~5.9.3",
|
|
34
|
+
"vitest": "^5.0.4"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"data-grid",
|
|
38
|
+
"react",
|
|
39
|
+
"grid",
|
|
40
|
+
"table",
|
|
41
|
+
"@freegridjs/core"
|
|
42
|
+
],
|
|
43
|
+
"homepage": "https://freegrid.app",
|
|
44
|
+
"author": "secondkorea",
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup",
|
|
50
|
+
"test": "vitest run",
|
|
51
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
52
|
+
}
|
|
6
53
|
}
|