@guiexpert/preact-table 10.0.6 → 10.0.8

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/package.json CHANGED
@@ -1,22 +1,25 @@
1
1
  {
2
2
  "name": "@guiexpert/preact-table",
3
- "version": "10.0.6",
3
+ "version": "10.0.8",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
7
7
  "lib": {
8
8
  "entryFile": "src/index.ts"
9
9
  },
10
+ "publishConfig": {
11
+ "directory": "dist"
12
+ },
10
13
  "exports": {
11
14
  ".": {
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs"
15
+ "import": "./index.js",
16
+ "require": "./index.cjs"
14
17
  }
15
18
  },
16
19
  "dependencies": {
17
20
  "tslib": "^2.3.0",
18
21
  "preact": "^10.19.4",
19
- "@guiexpert/table": "^1.1.23"
22
+ "@guiexpert/table": "^1.1.25"
20
23
  },
21
24
  "devDependencies": {
22
25
  "react-scripts-ts": "^3.1.0",
@@ -39,6 +42,6 @@
39
42
  "i": "pnpm i",
40
43
  "patch-version": "node patch.js",
41
44
  "build": "vite build",
42
- "npm-pub": "pnpm publish --access public"
45
+ "npm-pub": "pnpm publish --no-git-checks --access public"
43
46
  }
44
47
  }
package/.eslintrc.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- parser: "@typescript-eslint/parser",
3
- plugins: ["preact", "@typescript-eslint"],
4
- extends: ["../../.eslintrc.json"],
5
- ignorePatterns: ["!**/*"],
6
- overrides: [
7
- {
8
- files: ["*.ts", "*.js", "*.tsx"],
9
- parserOptions: {
10
- project: ["libs/preact-table/tsconfig.*?.json"]
11
- },
12
- rules: {}
13
- },
14
- {
15
- files: ["*.ts", "*.tsx"],
16
- rules: {}
17
- },
18
- {
19
- files: ["*.js", "*.jsx"],
20
- rules: {}
21
- }
22
- ]
23
- };
package/dist/README.md DELETED
@@ -1,102 +0,0 @@
1
-
2
- # PreactTable (GuiExpert Table)
3
-
4
- This is the preact component of the GuiExpert Table Project.
5
-
6
- ## Become a master at creating web applications with large tables
7
-
8
- This is the UI-agnostic table component for your next web app. 😊
9
-
10
- <img src="https://raw.githubusercontent.com/guiexperttable/ge-table/main/apps/table-website/src/assets/screens/heatmap.png" width="50%">
11
-
12
- ### Features
13
- - Handle large datasets easily
14
- - Excellent performance for large tables by vertical and horizontal virtual scrolling
15
- - Fully-featured (advanced sorting and filtering)
16
- - Highly customizable orderData grid
17
- - Outstanding performance
18
- - No third-party dependencies
19
- - UI-agnostic
20
- - Column Interactions (resize, reorder)
21
- - Sorting Rows
22
- - Row, Column, and Range Selection
23
- - Single and Multi Selection
24
- - UI-agnostic
25
- - Row and Column Spanning
26
- - Fixed Columns (Left and Right)
27
- - Tree table (Hierarchical View)
28
- - Accessibility support: Keyboard Shortcuts
29
- - Custom Filtering
30
- - In-place Cell Editing
31
- - Userdefined Key and Mouse Events
32
- - Customizable Look & Feel (via CSS variables)
33
- - Row sorting
34
- - Column Reordering (Drag and Drop)
35
- - State Persistence (Row Sorting, Column Order, Selection)
36
- - Customizable Cell Contents via Renderer for Header, Body and Footer
37
- - Full control over the HTML structure and style
38
-
39
-
40
- ## Links
41
-
42
- - [Demos](https://gui.expert/demos)
43
- - [Documentation](https://gui.expert/doc)
44
- - [API](https://gui.expert/api)
45
-
46
- ## Get Started
47
-
48
- Add the following two NPM packages to your existing preact project (run this in your project root directory):
49
-
50
- ```
51
- npm install --save @guiexpert/table @guiexpert/preact-table
52
- ```
53
-
54
- Add GuiexpertTable component to a template:
55
-
56
- ```
57
- return (
58
- <GuiexpertTable
59
- tableOptions={tableOptions}
60
- tableModel={tableModel}
61
- mouseClicked={console.info}
62
- tableReady={tableReady}
63
- />
64
- );
65
- ```
66
-
67
- Import the following classes in your component:
68
- ```
69
- import { GuiexpertTable } from "@guiexpert/preact-table";
70
- import {
71
- GeMouseEvent,
72
- TableApi
73
- TableFactory,
74
- TableModelIf,
75
- TableOptions,
76
- TableOptionsIf
77
- } from "@guiexpert/table";
78
- ```
79
-
80
-
81
- Add a tableModel property and a onTableReady method to the component:
82
-
83
- ```
84
- const tableModel: TableModelIf = TableFactory.createTableModel({
85
- headerData: [
86
- ['Header 1', 'Header 2']
87
- ],
88
- bodyData: [
89
- ['Text 1a', 'Text 2a'],
90
- ['Text 1b', 'Text 2b'],
91
- ]
92
- });
93
- const tableOptions = new TableOptions();
94
-
95
- function onTableReady(api: TableApi) {
96
- console.info("onTableReady API:", api);
97
- }
98
- ```
99
-
100
- There are numerous possibilities to create table models.
101
- Please refer to the [Documentation](https://gui.expert/doc) for further information or the [Demo](https://gui.expert/demos) section for examples.
102
-
package/dist/package.json DELETED
@@ -1,44 +0,0 @@
1
- {
2
- "name": "@guiexpert/preact-table",
3
- "version": "10.0.6",
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
- "patch-version": "node patch.js",
13
- "build": "vite build",
14
- "npm-pub": "pnpm publish --access public"
15
- },
16
- "exports": {
17
- ".": {
18
- "import": "./dist/index.js",
19
- "require": "./dist/index.cjs"
20
- }
21
- },
22
- "dependencies": {
23
- "tslib": "^2.3.0",
24
- "@guiexpert/table": "workspace:^",
25
- "preact": "^10.19.4"
26
- },
27
- "devDependencies": {
28
- "react-scripts-ts": "^3.1.0",
29
- "@preact/preset-vite": "^2.6.0",
30
- "@types/react": "^18.2.37",
31
- "@types/react-dom": "^18.2.15",
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
- "@vitejs/plugin-react": "^4.1.1",
40
- "ts-node": "10.9.1",
41
- "tsconfig": "^7.0.0",
42
- "typescript": "5.2.2"
43
- }
44
- }
package/jest.config.ts DELETED
@@ -1,10 +0,0 @@
1
- /* eslint-disable */
2
- export default {
3
- displayName: "preact-table",
4
- preset: "../../jest.preset.js",
5
- transform: {
6
- "^.+\\.[tj]s$": ["ts-jest", { tsconfig: "<rootDir>/tsconfig.spec.json" }]
7
- },
8
- moduleFileExtensions: ["ts", "js", "html"],
9
- coverageDirectory: "../../coverage/libs/preact-table"
10
- };
package/patch.js DELETED
@@ -1,16 +0,0 @@
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
- }
@@ -1,60 +0,0 @@
1
- import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from "@guiexpert/table";
2
- import {createRoot} from "react-dom/client";
3
-
4
-
5
-
6
- export class ComponentRendererWrapper implements CellRendererIf {
7
-
8
- constructor(
9
- private readonly Component: any
10
- ) {
11
- console.info(Component);
12
- }
13
-
14
- render(
15
- cellDiv: HTMLDivElement,
16
- rowIndex: number,
17
- columnIndex: number,
18
- areaIdent: AreaIdent,
19
- areaModel: AreaModelIf,
20
- cellValue: any,
21
- domService: DomServiceIf): RendererCleanupFnType | undefined {
22
-
23
- const props = {
24
- cellDiv,
25
- rowIndex,
26
- columnIndex,
27
- areaIdent,
28
- areaModel,
29
- cellValue
30
- };
31
- const root = createRoot(cellDiv, {});
32
- root.render(this.Component(props));
33
-
34
- return () => {
35
- root.unmount();
36
- };
37
- }
38
-
39
-
40
- // private mount(
41
- // component: any,
42
- // props: (Data & VNodeProps) | null,
43
- // appContext: AppContext | null,
44
- // cellDiv: HTMLDivElement
45
- // ) {
46
- // let vNode: VNode = createVNode(component, props);
47
- //
48
- // vNode.appContext = appContext;
49
- // render(vNode, cellDiv);
50
- //
51
- // const cleanupFn = () => {
52
- // if (cellDiv) {
53
- // render(null, cellDiv);
54
- // }
55
- // };
56
- //
57
- // return cleanupFn;
58
- // }
59
-
60
- }
@@ -1,138 +0,0 @@
1
- import { Component, createRef } from "preact";
2
- import {
3
- EventListenerIf, FocusModelIf,
4
- GeModelChangeEvent,
5
- GeMouseEvent, LicenseManager, SelectionModelIf,
6
- SimpleDomService, TableApi,
7
- TableModelIf,
8
- TableOptions,
9
- TableScope
10
- } from '@guiexpert/table';
11
-
12
- export type GeMouseEventFn = (evt: GeMouseEvent) => {};
13
- export type GeCheckboxEventFn = (evt: any[]) => {};
14
- export type GeTableReadyEventFn = (evt: TableApi) => {};
15
- export type GeModelChangeEventFn = (evt: GeModelChangeEvent) => {};
16
- export type GeSelectionChangeEventFn = (evt: SelectionModelIf) => {};
17
- export type GeFocusChangeEventFn = (evt: FocusModelIf) => {};
18
-
19
-
20
- export interface GuiexpertTableProps {
21
- tableModel: TableModelIf,
22
- tableOptions?: TableOptions,
23
- mouseMoved?: GeMouseEventFn,
24
- contextmenu?: GeMouseEventFn,
25
- mouseClicked?: GeMouseEventFn,
26
- mouseDragging?: GeMouseEventFn,
27
- mouseDraggingEnd?: GeMouseEventFn,
28
- checkboxChanged?: GeCheckboxEventFn,
29
- modelChanged?: GeModelChangeEventFn,
30
- tableReady?: GeTableReadyEventFn,
31
- licenseKey?: string,
32
- selectionChanged?: GeSelectionChangeEventFn;
33
- focusChanged?: GeFocusChangeEventFn;
34
- }
35
-
36
-
37
- /**
38
- * GuiexpertTable is a React component that wraps the ExpertTable library.
39
- * It displays a table with various event listeners and callback functions.
40
- */
41
- export class GuiexpertTable extends Component<GuiexpertTableProps> {
42
-
43
- ref = createRef();
44
-
45
- constructor(props: GuiexpertTableProps) {
46
- super(props);
47
- }
48
-
49
- componentDidMount() {
50
- const myContainer: HTMLDivElement = this.ref.current;
51
- this.initTable(myContainer, this.props as GuiexpertTableProps);
52
- }
53
-
54
- componentWillUnmount() {
55
- }
56
-
57
- initTable(ele: HTMLDivElement, props: GuiexpertTableProps) {
58
- const listener: EventListenerIf = {
59
-
60
- onSelectionChanged(model: SelectionModelIf): void {
61
- if (props.selectionChanged) {
62
- props.selectionChanged(model);
63
- }
64
- },
65
-
66
- onFocusChanged(model: FocusModelIf): void{
67
- if (props.focusChanged) {
68
- props.focusChanged(model);
69
- }
70
- },
71
-
72
-
73
- onCheckboxChanged: (evt: any[]) => {
74
- if (props.checkboxChanged) {
75
- props.checkboxChanged(evt);
76
- }
77
- },
78
-
79
- onContextmenu: (evt: GeMouseEvent) => {
80
- if (props.contextmenu) {
81
- props.contextmenu(evt);
82
- }
83
- },
84
-
85
- onModelChanged: (evt: GeModelChangeEvent) => {
86
- if (props.modelChanged) {
87
- props.modelChanged(evt);
88
- }
89
- },
90
-
91
- onMouseClicked: (evt: GeMouseEvent) => {
92
- if (props.mouseClicked) {
93
- props.mouseClicked(evt);
94
- }
95
- },
96
-
97
- onMouseDragging: (evt: GeMouseEvent) => {
98
- if (props.mouseDragging) {
99
- props.mouseDragging(evt);
100
- }
101
- },
102
-
103
- onMouseDraggingEnd: (evt: GeMouseEvent) => {
104
- if (props.mouseDraggingEnd) {
105
- props.mouseDraggingEnd(evt);
106
- }
107
- },
108
-
109
- onMouseMoved: (evt: GeMouseEvent) => {
110
- // ignored
111
- }
112
- };
113
-
114
- const tableScope = new TableScope(
115
- ele, props.tableModel, new SimpleDomService(), props.tableOptions ?? new TableOptions(), listener
116
- );
117
- tableScope.firstInit();
118
- if (props.tableReady) {
119
- props.tableReady(tableScope.getApi());
120
- }
121
- if (props.licenseKey) LicenseManager.getInstance().setLicenseKey(props.licenseKey);
122
- };
123
-
124
- render() {
125
- return <div
126
- ref={this.ref}
127
- className="container-div"
128
- style={{
129
- width: "100%",
130
- height: "100%",
131
- backgroundColor: "transparent",
132
- padding: "0",
133
- margin: "0"
134
- }} />;
135
- }
136
- }
137
-
138
- export default GuiexpertTable;
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./GuiexpertTable";
2
- export * from "./ComponentRendererWrapper";
package/tsconfig.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "strict": true,
5
- "target": "ESNext",
6
- "module": "ESNext",
7
- "moduleResolution": "node",
8
- "allowSyntheticDefaultImports": true,
9
- "esModuleInterop": true,
10
- "jsx": "preserve",
11
- "jsxFactory": "h",
12
- "jsxFragmentFactory": "Fragment",
13
- "jsxImportSource": "preact",
14
- "types": [
15
- "vite/client"
16
- ]
17
- },
18
- "files": [],
19
- "include": [],
20
- "references": [
21
- {
22
- "path": "./tsconfig.lib.json"
23
- },
24
- {
25
- "path": "./tsconfig.spec.json"
26
- }
27
- ]
28
- }
package/tsconfig.lib.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc"
5
- },
6
- "include": [
7
- "src/**/*"
8
- ],
9
- "exclude": [
10
- "**/*.spec.ts",
11
- "**/*_spec.ts",
12
- "**/*.spec.tsx",
13
- "**/*_spec.tsx",
14
- "public/*"
15
- ]
16
- }
@@ -1,17 +0,0 @@
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/**/*.d.ts"
16
- ]
17
- }
package/vite.config.ts DELETED
@@ -1,73 +0,0 @@
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
- import { preact } from '@preact/preset-vite';
9
-
10
- export default defineConfig({
11
-
12
- cacheDir: "../../node_modules/.vite/preact-table",
13
-
14
- plugins: [
15
- dts({
16
- entryRoot: "src",
17
- tsconfigPath: join(__dirname, "tsconfig.lib.json")
18
- }),
19
- // react(),
20
- preact({include: ['**/*[jt]sx']}), // <-- add {include:...}
21
- // viteTsConfigPaths({
22
- // root: "./"
23
- // }),
24
- viteStaticCopy({
25
- targets: [
26
- {
27
- src: 'README.md',
28
- dest: './'
29
- },
30
- {
31
- src: 'package.json',
32
- dest: './'
33
- }
34
- ]
35
- })
36
- ],
37
-
38
- // Uncomment this if you are using workers.
39
- // worker: {
40
- // plugins: [
41
- // viteTsConfigPaths({
42
- // root: '../../',
43
- // }),
44
- // ],
45
- // },
46
-
47
- // Configuration for building your library.
48
- // See: https://vitejs.dev/guide/build.html#library-mode
49
- build: {
50
- lib: {
51
- // Could also be a dictionary or array of multiple entry points.
52
- entry: "src/index.ts",
53
- name: "preact-table",
54
- fileName: "index",
55
- // Change this to the formats you want to support.
56
- // Don't forgot to update your package.json as well.
57
- formats: ["es", "cjs"]
58
- },
59
- rollupOptions: {
60
- // External packages that should not be bundled into your library.
61
- external: ["preact", "preact-dom", "preact/jsx-runtime"]
62
- }
63
- },
64
- resolve: {
65
- alias: [
66
- {
67
- find: /@guiexpert\/table/,
68
- replacement: join(__dirname, '..', 'table', 'src'),
69
- },
70
- ],
71
- }
72
- });
73
-
File without changes
File without changes
File without changes