@guiexpert/react-table 18.0.2 → 18.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/.eslintrc.json +34 -0
- package/dist/README.md +102 -0
- package/dist/index.cjs +254 -0
- package/{index.js → dist/index.js} +157 -137
- package/{lib → dist/lib}/component-renderer-wrapper.d.ts +1 -1
- package/{lib → dist/lib}/guiexpert-table.d.ts +1 -1
- package/dist/package.json +44 -0
- package/jest.config.ts +11 -0
- package/package.json +29 -3
- package/patch.js +16 -0
- package/src/index.ts +2 -0
- package/src/lib/component-renderer-wrapper.ts +39 -0
- package/src/lib/guiexpert-table.tsx +168 -0
- package/src/lib/react-table.module.css +8 -0
- package/src/lib/react-table.spec.tsx +6 -0
- package/tsconfig.json +23 -0
- package/tsconfig.lib.json +30 -0
- package/tsconfig.spec.json +23 -0
- package/vite.config.ts +69 -0
- package/index.cjs +0 -254
- /package/{index.d.ts → dist/index.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from '../../../table/src
|
|
1
|
+
import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from '../../../table/src';
|
|
2
2
|
export declare class ComponentRendererWrapper implements CellRendererIf {
|
|
3
3
|
private readonly Component;
|
|
4
4
|
constructor(Component: any);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FocusModelIf, GeModelChangeEvent, GeMouseEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '../../../table/src
|
|
1
|
+
import { FocusModelIf, GeModelChangeEvent, GeMouseEvent, SelectionModelIf, TableApi, TableModelIf, TableOptions } from '../../../table/src';
|
|
2
2
|
export type GeMouseEventFn = (evt: GeMouseEvent) => {};
|
|
3
3
|
export type GeCheckboxEventFn = (evt: any[]) => {};
|
|
4
4
|
export type GeTableReadyEventFn = (evt: TableApi) => {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guiexpert/react-table",
|
|
3
|
+
"version": "18.0.2",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"lib": {
|
|
8
|
+
"entryFile": "src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"i": "pnpm i",
|
|
12
|
+
"build": "vite build",
|
|
13
|
+
"npm-pub:react-table": "npm publish --access public"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": "./index.js",
|
|
18
|
+
"require": "./index.cjs"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"tslib": "^2.3.0",
|
|
23
|
+
"@guiexpert/table": "workspace:^",
|
|
24
|
+
"react": "18.2.0",
|
|
25
|
+
"react-dom": "18.2.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@vitejs/plugin-react": "^4.1.1",
|
|
29
|
+
"@types/react": "^18.2.37",
|
|
30
|
+
"@types/react-dom": "^18.2.15",
|
|
31
|
+
"@testing-library/react": "^14.1.0",
|
|
32
|
+
"@types/node": "^20.11.17",
|
|
33
|
+
"vite": "^5.1.1",
|
|
34
|
+
"vite-plugin-dts": "^3.7.2",
|
|
35
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
36
|
+
"vite-plugin-static-copy": "^0.17.0",
|
|
37
|
+
"vite-tsconfig-paths": "^4.2.1",
|
|
38
|
+
"vite-plugin-babel": "^1.2.0",
|
|
39
|
+
"react-test-renderer": "^18.2.0",
|
|
40
|
+
"ts-node": "10.9.1",
|
|
41
|
+
"tsconfig": "^7.0.0",
|
|
42
|
+
"typescript": "5.2.2"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export default {
|
|
3
|
+
displayName: "react-table",
|
|
4
|
+
preset: "../../jest.preset.js",
|
|
5
|
+
transform: {
|
|
6
|
+
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
|
|
7
|
+
"^.+\\.[tj]sx?$": ["babel-jest", { presets: ["@nrwl/react/babel"] }]
|
|
8
|
+
},
|
|
9
|
+
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
|
|
10
|
+
coverageDirectory: "../../coverage/libs/react-table"
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/react-table",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -8,12 +8,38 @@
|
|
|
8
8
|
"entryFile": "src/index.ts"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"
|
|
11
|
+
"i": "pnpm i",
|
|
12
|
+
"patch-version": "node patch.js",
|
|
13
|
+
"build": "vite build",
|
|
14
|
+
"npm-pub": "npm publish --access public"
|
|
12
15
|
},
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
15
18
|
"import": "./index.js",
|
|
16
19
|
"require": "./index.cjs"
|
|
17
20
|
}
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.3.0",
|
|
24
|
+
"@guiexpert/table": "workspace:^",
|
|
25
|
+
"react": "18.2.0",
|
|
26
|
+
"react-dom": "18.2.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@vitejs/plugin-react": "^4.1.1",
|
|
30
|
+
"@types/react": "^18.2.37",
|
|
31
|
+
"@types/react-dom": "^18.2.15",
|
|
32
|
+
"@testing-library/react": "^14.1.0",
|
|
33
|
+
"@types/node": "^20.11.17",
|
|
34
|
+
"vite": "^5.1.1",
|
|
35
|
+
"vite-plugin-dts": "^3.7.2",
|
|
36
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
37
|
+
"vite-plugin-static-copy": "^0.17.0",
|
|
38
|
+
"vite-tsconfig-paths": "^4.2.1",
|
|
39
|
+
"vite-plugin-babel": "^1.2.0",
|
|
40
|
+
"react-test-renderer": "^18.2.0",
|
|
41
|
+
"ts-node": "10.9.1",
|
|
42
|
+
"tsconfig": "^7.0.0",
|
|
43
|
+
"typescript": "5.2.2"
|
|
18
44
|
}
|
|
19
|
-
}
|
|
45
|
+
}
|
package/patch.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
const packageJsonPath = 'package.json';
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
const pack = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
7
|
+
const currentVersion = pack.version;
|
|
8
|
+
const [major, minor, patch] = currentVersion.split('.').map(Number);
|
|
9
|
+
const newPatchVersion = `${major}.${minor}.${patch + 1}`;
|
|
10
|
+
pack.version = newPatchVersion;
|
|
11
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(pack, null, 2));
|
|
12
|
+
console.log(`${pack.name} -> version patched to ${newPatchVersion}.`);
|
|
13
|
+
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.error('Error:', error);
|
|
16
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from "@guiexpert/table";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class ComponentRendererWrapper implements CellRendererIf {
|
|
6
|
+
|
|
7
|
+
constructor(
|
|
8
|
+
private readonly Component: any
|
|
9
|
+
) {
|
|
10
|
+
console.info(Component);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
render(
|
|
14
|
+
cellDiv: HTMLDivElement,
|
|
15
|
+
rowIndex: number,
|
|
16
|
+
columnIndex: number,
|
|
17
|
+
areaIdent: AreaIdent,
|
|
18
|
+
areaModel: AreaModelIf,
|
|
19
|
+
cellValue: any,
|
|
20
|
+
domService: DomServiceIf): RendererCleanupFnType | undefined {
|
|
21
|
+
|
|
22
|
+
const props = {
|
|
23
|
+
cellDiv,
|
|
24
|
+
rowIndex,
|
|
25
|
+
columnIndex,
|
|
26
|
+
areaIdent,
|
|
27
|
+
areaModel,
|
|
28
|
+
cellValue
|
|
29
|
+
};
|
|
30
|
+
const root = createRoot(cellDiv, {});
|
|
31
|
+
root.render(this.Component(props));
|
|
32
|
+
|
|
33
|
+
return () => {
|
|
34
|
+
root.unmount();
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EventListenerIf,
|
|
3
|
+
FocusModelIf,
|
|
4
|
+
GeModelChangeEvent,
|
|
5
|
+
GeMouseEvent, LicenseManager, SelectionModelIf,
|
|
6
|
+
SimpleDomService,
|
|
7
|
+
TableApi,
|
|
8
|
+
TableModelIf,
|
|
9
|
+
TableOptions,
|
|
10
|
+
TableScope
|
|
11
|
+
} from '@guiexpert/table';
|
|
12
|
+
import { useEffect, useRef } from "react";
|
|
13
|
+
|
|
14
|
+
export type GeMouseEventFn = (evt: GeMouseEvent) => {};
|
|
15
|
+
export type GeCheckboxEventFn = (evt: any[]) => {};
|
|
16
|
+
export type GeTableReadyEventFn = (evt: TableApi) => {};
|
|
17
|
+
export type GeModelChangeEventFn = (evt: GeModelChangeEvent) => {};
|
|
18
|
+
export type GeSelectionChangeEventFn = (evt: SelectionModelIf) => {};
|
|
19
|
+
export type GeFocusChangeEventFn = (evt: FocusModelIf) => {};
|
|
20
|
+
|
|
21
|
+
export interface GuiexpertTableProps {
|
|
22
|
+
tableModel: TableModelIf,
|
|
23
|
+
tableOptions?: TableOptions,
|
|
24
|
+
mouseMoved?: GeMouseEventFn,
|
|
25
|
+
contextmenu?: GeMouseEventFn,
|
|
26
|
+
mouseClicked?: GeMouseEventFn,
|
|
27
|
+
mouseDragging?: GeMouseEventFn,
|
|
28
|
+
mouseDraggingEnd?: GeMouseEventFn,
|
|
29
|
+
checkboxChanged?: GeCheckboxEventFn,
|
|
30
|
+
modelChanged?: GeModelChangeEventFn,
|
|
31
|
+
selectionChanged?: GeSelectionChangeEventFn;
|
|
32
|
+
focusChanged?: GeFocusChangeEventFn;
|
|
33
|
+
tableReady?: GeTableReadyEventFn,
|
|
34
|
+
licenseKey?: string,
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Initialize and render the GuiexpertTable component.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object} props - The properties of the GuiexpertTable component.
|
|
41
|
+
* @param {TableModel} props.tableModel - The model for the table.
|
|
42
|
+
* @param {TableOptions} [props.tableOptions=new TableOptions()] - The options for the table.
|
|
43
|
+
* @param {Function} [props.mouseMoved] - The callback for mouse movement events.
|
|
44
|
+
* @param {Function} [props.checkboxChanged] - The callback for checkbox change events.
|
|
45
|
+
* @param {Function} [props.contextmenu] - The callback for context menu events.
|
|
46
|
+
* @param {Function} [props.modelChanged] - The callback for model change events.
|
|
47
|
+
* @param {Function} [props.mouseClicked] - The callback for mouse click events.
|
|
48
|
+
* @param {Function} [props.mouseDragging] - The callback for mouse dragging events.
|
|
49
|
+
* @param {Function} [props.mouseDraggingEnd] - The callback for mouse dragging end events.
|
|
50
|
+
* @param {Function} [props.tableReady] - The callback for when the table is ready.
|
|
51
|
+
* @param {string} [props.licenseKey] - The license key for the GuiexpertTable component.
|
|
52
|
+
*
|
|
53
|
+
* @returns {JSX.Element} - The rendered GuiexpertTable component.
|
|
54
|
+
*/
|
|
55
|
+
export function GuiexpertTable(
|
|
56
|
+
{
|
|
57
|
+
tableModel,
|
|
58
|
+
tableOptions = new TableOptions(),
|
|
59
|
+
mouseMoved,
|
|
60
|
+
checkboxChanged,
|
|
61
|
+
contextmenu,
|
|
62
|
+
modelChanged,
|
|
63
|
+
mouseClicked,
|
|
64
|
+
mouseDragging,
|
|
65
|
+
mouseDraggingEnd,
|
|
66
|
+
selectionChanged,
|
|
67
|
+
focusChanged,
|
|
68
|
+
tableReady,
|
|
69
|
+
licenseKey
|
|
70
|
+
}: GuiexpertTableProps) {
|
|
71
|
+
|
|
72
|
+
const myContainer = useRef(null);
|
|
73
|
+
let initialized = false;
|
|
74
|
+
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (myContainer.current && !initialized) {
|
|
77
|
+
initTable(myContainer.current);
|
|
78
|
+
initialized = true;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
let root: HTMLDivElement | null;
|
|
83
|
+
|
|
84
|
+
const initTable = (ele: HTMLDivElement) => {
|
|
85
|
+
const listener: EventListenerIf = {
|
|
86
|
+
|
|
87
|
+
onSelectionChanged(model: SelectionModelIf): void {
|
|
88
|
+
if (selectionChanged) {
|
|
89
|
+
selectionChanged(model);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
onFocusChanged(model: FocusModelIf): void{
|
|
94
|
+
if (focusChanged) {
|
|
95
|
+
focusChanged(model);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
onCheckboxChanged: (evt: any[]) => {
|
|
100
|
+
if (checkboxChanged) {
|
|
101
|
+
checkboxChanged(evt);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
onContextmenu: (evt: GeMouseEvent) => {
|
|
106
|
+
if (contextmenu) {
|
|
107
|
+
contextmenu(evt);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
onModelChanged: (evt: GeModelChangeEvent) => {
|
|
112
|
+
if (modelChanged) {
|
|
113
|
+
modelChanged(evt);
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
onMouseClicked: (evt: GeMouseEvent) => {
|
|
118
|
+
if (mouseClicked) {
|
|
119
|
+
mouseClicked(evt);
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
onMouseDragging: (evt: GeMouseEvent) => {
|
|
124
|
+
if (mouseDragging) {
|
|
125
|
+
mouseDragging(evt);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
onMouseDraggingEnd: (evt: GeMouseEvent) => {
|
|
130
|
+
if (mouseDraggingEnd) {
|
|
131
|
+
mouseDraggingEnd(evt);
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
onMouseMoved: (evt: GeMouseEvent) => {
|
|
136
|
+
if (mouseMoved) {
|
|
137
|
+
mouseMoved(evt);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const tableScope = new TableScope(
|
|
143
|
+
ele, tableModel, new SimpleDomService(), tableOptions, listener
|
|
144
|
+
);
|
|
145
|
+
tableScope.firstInit();
|
|
146
|
+
if (tableReady) {
|
|
147
|
+
tableReady(tableScope.getApi());
|
|
148
|
+
}
|
|
149
|
+
if (licenseKey) LicenseManager.getInstance().setLicenseKey(licenseKey);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div
|
|
154
|
+
ref={myContainer}
|
|
155
|
+
className="container-div"
|
|
156
|
+
style={{
|
|
157
|
+
width: "100%",
|
|
158
|
+
height: "100%",
|
|
159
|
+
background: "transparent",
|
|
160
|
+
padding: "0",
|
|
161
|
+
margin: "0"
|
|
162
|
+
}}></div>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export default GuiexpertTable;
|
|
167
|
+
|
|
168
|
+
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"jsx": "react-jsx",
|
|
4
|
+
"allowJs": false,
|
|
5
|
+
"esModuleInterop": false,
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"types": [
|
|
9
|
+
"vite/client"
|
|
10
|
+
]
|
|
11
|
+
},
|
|
12
|
+
"files": [],
|
|
13
|
+
"include": [],
|
|
14
|
+
"references": [
|
|
15
|
+
{
|
|
16
|
+
"path": "./tsconfig.lib.json"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "./tsconfig.spec.json"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"extends": "../../tsconfig.base.json"
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"types": [
|
|
6
|
+
"node",
|
|
7
|
+
"vite/client"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
|
|
12
|
+
"../../node_modules/@nrwl/react/typings/image.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"exclude": [
|
|
15
|
+
"**/*.spec.ts",
|
|
16
|
+
"**/*.test.ts",
|
|
17
|
+
"**/*.spec.tsx",
|
|
18
|
+
"**/*.test.tsx",
|
|
19
|
+
"**/*.spec.js",
|
|
20
|
+
"**/*.test.js",
|
|
21
|
+
"**/*.spec.jsx",
|
|
22
|
+
"**/*.test.jsx"
|
|
23
|
+
],
|
|
24
|
+
"include": [
|
|
25
|
+
"**/*.js",
|
|
26
|
+
"**/*.jsx",
|
|
27
|
+
"**/*.ts",
|
|
28
|
+
"**/*.tsx"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/out-tsc",
|
|
5
|
+
"module": "commonjs",
|
|
6
|
+
"types": [
|
|
7
|
+
"jest",
|
|
8
|
+
"node"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"jest.config.ts",
|
|
13
|
+
"src/**/*.test.ts",
|
|
14
|
+
"src/**/*.spec.ts",
|
|
15
|
+
"src/**/*.test.tsx",
|
|
16
|
+
"src/**/*.spec.tsx",
|
|
17
|
+
"src/**/*.test.js",
|
|
18
|
+
"src/**/*.spec.js",
|
|
19
|
+
"src/**/*.test.jsx",
|
|
20
|
+
"src/**/*.spec.jsx",
|
|
21
|
+
"src/**/*.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
import react from "@vitejs/plugin-react";
|
|
4
|
+
import viteTsConfigPaths from "vite-tsconfig-paths";
|
|
5
|
+
import dts from "vite-plugin-dts";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import {viteStaticCopy} from "vite-plugin-static-copy";
|
|
8
|
+
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
cacheDir: "../../node_modules/.vite/react-table",
|
|
11
|
+
|
|
12
|
+
plugins: [
|
|
13
|
+
dts({
|
|
14
|
+
entryRoot: "src",
|
|
15
|
+
tsconfigPath: join(__dirname, "tsconfig.lib.json"),
|
|
16
|
+
|
|
17
|
+
}),
|
|
18
|
+
react(),
|
|
19
|
+
|
|
20
|
+
viteStaticCopy({
|
|
21
|
+
targets: [
|
|
22
|
+
{
|
|
23
|
+
src: 'README.md',
|
|
24
|
+
dest: './'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
src: 'package.json',
|
|
28
|
+
dest: './'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
],
|
|
33
|
+
|
|
34
|
+
// Uncomment this if you are using workers.
|
|
35
|
+
// worker: {
|
|
36
|
+
// plugins: [
|
|
37
|
+
// viteTsConfigPaths({
|
|
38
|
+
// root: '../../',
|
|
39
|
+
// }),
|
|
40
|
+
// ],
|
|
41
|
+
// },
|
|
42
|
+
|
|
43
|
+
// Configuration for building your library.
|
|
44
|
+
// See: https://vitejs.dev/guide/build.html#library-mode
|
|
45
|
+
build: {
|
|
46
|
+
lib: {
|
|
47
|
+
// Could also be a dictionary or array of multiple entry points.
|
|
48
|
+
entry: "src/index.ts",
|
|
49
|
+
name: "react-table",
|
|
50
|
+
fileName: "index",
|
|
51
|
+
// Change this to the formats you want to support.
|
|
52
|
+
// Don't forgot to update your package.json as well.
|
|
53
|
+
formats: ["es", "cjs"]
|
|
54
|
+
},
|
|
55
|
+
rollupOptions: {
|
|
56
|
+
// External packages that should not be bundled into your library.
|
|
57
|
+
external: ["react", "react-dom", "react/jsx-runtime"]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
resolve: {
|
|
61
|
+
alias: [
|
|
62
|
+
{
|
|
63
|
+
find: /@guiexpert\/table/,
|
|
64
|
+
replacement: join(__dirname, '..', 'table', 'src'),
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
});
|