@guiexpert/vue3-table 3.0.7 → 3.0.9
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/README.md +1 -1
- package/{dist/lib → lib}/GuiexpertTable.vue.d.ts +4 -3
- package/package.json +5 -2
- package/.babelrc +0 -7
- package/.eslintrc.js +0 -79
- package/components.d.ts +0 -16
- package/cypress/fixtures/example.json +0 -3
- package/cypress/plugins/index.ts +0 -10
- package/cypress/support/index.ts +0 -1
- package/dist/README.md +0 -104
- package/dist/package.json +0 -50
- package/jest.config.ts +0 -19
- package/patch.js +0 -17
- package/postcss.config.js +0 -3
- package/src/index.ts +0 -3
- package/src/lib/ComponentRendererWrapper.ts +0 -61
- package/src/lib/GuiexpertTable.spec.ts +0 -9
- package/src/lib/GuiexpertTable.vue +0 -124
- package/src/lib/GuiexpertTablePlugin.ts +0 -10
- package/src/shims-vue.d.ts +0 -15
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -25
- package/tsconfig.spec.json +0 -20
- package/vite.config.ts +0 -62
- /package/{dist/index.cjs → index.cjs} +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/lib → lib}/ComponentRendererWrapper.d.ts +0 -0
- /package/{dist/lib → lib}/GuiexpertTablePlugin.d.ts +0 -0
- /package/{dist/style.css → style.css} +0 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ This is the vue component of the GuiExpert Table Project.
|
|
|
7
7
|
|
|
8
8
|
This is the UI-agnostic table component for your next web app. 😊
|
|
9
9
|
|
|
10
|
-
<img src="https://raw.githubusercontent.com/guiexperttable/ge-table/main/apps/
|
|
10
|
+
<img src="https://raw.githubusercontent.com/guiexperttable/ge-table/main/apps/webpage-guiexpert/src/assets/screens/heatmap.png" width="50%">
|
|
11
11
|
|
|
12
12
|
### Features
|
|
13
13
|
- Handle large datasets easily
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { TableOptions } from '../../../table/src';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
tableModel: {
|
|
3
4
|
required: true;
|
|
4
5
|
};
|
|
5
6
|
tableOptions: {
|
|
6
7
|
required: false;
|
|
7
|
-
default:
|
|
8
|
+
default: TableOptions;
|
|
8
9
|
};
|
|
9
10
|
debounceMouseClickDelay: {
|
|
10
11
|
required: false;
|
|
@@ -22,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
22
23
|
};
|
|
23
24
|
tableOptions: {
|
|
24
25
|
required: false;
|
|
25
|
-
default:
|
|
26
|
+
default: TableOptions;
|
|
26
27
|
};
|
|
27
28
|
debounceMouseClickDelay: {
|
|
28
29
|
required: false;
|
|
@@ -44,7 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
44
45
|
onMouseDraggingEnd?: ((...args: any[]) => any) | undefined;
|
|
45
46
|
onMouseMoved?: ((...args: any[]) => any) | undefined;
|
|
46
47
|
}, {
|
|
47
|
-
tableOptions:
|
|
48
|
+
tableOptions: TableOptions;
|
|
48
49
|
debounceMouseClickDelay: number;
|
|
49
50
|
licenseKey: string;
|
|
50
51
|
}, {}>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/vue3-table",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.9",
|
|
4
4
|
"type": "commonjs",
|
|
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
15
|
"import": "./index.js",
|
|
@@ -18,7 +21,7 @@
|
|
|
18
21
|
"vue": "^3.2.47",
|
|
19
22
|
"vue-i18n": "^9.2.2",
|
|
20
23
|
"vue-router": "^4.1.6",
|
|
21
|
-
"@guiexpert/table": "^1.1.
|
|
24
|
+
"@guiexpert/table": "^1.1.26"
|
|
22
25
|
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@cypress/vue": "^5.0.4",
|
package/.babelrc
DELETED
package/.eslintrc.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
node: true
|
|
5
|
-
},
|
|
6
|
-
extends: [
|
|
7
|
-
"plugin:vue/vue3-recommended",
|
|
8
|
-
"plugin:@intlify/vue-i18n/recommended",
|
|
9
|
-
"@vue/typescript/recommended",
|
|
10
|
-
"prettier"
|
|
11
|
-
],
|
|
12
|
-
plugins: ["import"],
|
|
13
|
-
parser: "vue-eslint-parser",
|
|
14
|
-
parserOptions: { ecmaVersion: 2020 },
|
|
15
|
-
ignorePatterns: ["node_modules/"],
|
|
16
|
-
rules: {
|
|
17
|
-
"no-console": "off",
|
|
18
|
-
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
|
|
19
|
-
"space-before-function-paren": [
|
|
20
|
-
"error",
|
|
21
|
-
{ anonymous: "never", named: "never", asyncArrow: "always" }
|
|
22
|
-
],
|
|
23
|
-
"padded-blocks": "off",
|
|
24
|
-
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
|
|
25
|
-
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
|
|
26
|
-
"no-multiple-empty-lines": ["error", { max: 1 }],
|
|
27
|
-
"keyword-spacing": ["error", { after: true }],
|
|
28
|
-
"max-len": ["error", { code: 100, ignorePattern: "^\\s*<path" }],
|
|
29
|
-
"no-param-reassign": [2, { props: false }],
|
|
30
|
-
"object-curly-newline": [
|
|
31
|
-
"error",
|
|
32
|
-
{
|
|
33
|
-
consistent: true,
|
|
34
|
-
multiline: true
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"no-extra-boolean-cast": "error",
|
|
38
|
-
"import/extensions": [
|
|
39
|
-
"error",
|
|
40
|
-
{
|
|
41
|
-
ts: "never",
|
|
42
|
-
js: "never",
|
|
43
|
-
vue: "always",
|
|
44
|
-
json: "always",
|
|
45
|
-
png: "always",
|
|
46
|
-
jpg: "always",
|
|
47
|
-
mp3: "always",
|
|
48
|
-
mp4: "always"
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
indent: ["error", 2, { SwitchCase: 0 }],
|
|
52
|
-
"vue/attribute-hyphenation": ["error", "never"],
|
|
53
|
-
// TODO -- figure out how to get this to work with prettier
|
|
54
|
-
// 'vue/html-indent': ['error', 2, { baseIndent: 0 }],
|
|
55
|
-
"vue/singleline-html-element-content-newline": [
|
|
56
|
-
"error",
|
|
57
|
-
{
|
|
58
|
-
ignoreWhenNoAttributes: true,
|
|
59
|
-
ignoreWhenEmpty: true
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
"vue/max-attributes-per-line": [
|
|
63
|
-
"error",
|
|
64
|
-
{
|
|
65
|
-
singleline: 3
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"vue/no-v-html": "off",
|
|
69
|
-
"@intlify/vue-i18n/no-v-html": "off",
|
|
70
|
-
"@intlify/vue-i18n/no-unused-keys": [
|
|
71
|
-
"error",
|
|
72
|
-
{
|
|
73
|
-
src: "./src",
|
|
74
|
-
extensions: [".js", ".vue"]
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
"@intlify/vue-i18n/no-raw-text": "error"
|
|
78
|
-
}
|
|
79
|
-
};
|
package/components.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
// Generated by unplugin-vue-components
|
|
5
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
|
6
|
-
import '@vue/runtime-core'
|
|
7
|
-
|
|
8
|
-
export {}
|
|
9
|
-
|
|
10
|
-
declare module '@vue/runtime-core' {
|
|
11
|
-
export interface GlobalComponents {
|
|
12
|
-
GuiexpertTable: typeof import('./src/lib/GuiexpertTable.vue')['default']
|
|
13
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
|
14
|
-
RouterView: typeof import('vue-router')['RouterView']
|
|
15
|
-
}
|
|
16
|
-
}
|
package/cypress/plugins/index.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { devServer } from "@cypress/vite-dev-server";
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
module.exports = (on: any, config: any) => {
|
|
5
|
-
on("dev-server:start", (options: Cypress.DevServerConfig) =>
|
|
6
|
-
devServer(options)
|
|
7
|
-
);
|
|
8
|
-
|
|
9
|
-
return config;
|
|
10
|
-
};
|
package/cypress/support/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@cypress/code-coverage/support";
|
package/dist/README.md
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# guiexpert-table (Vue)
|
|
3
|
-
|
|
4
|
-
This is the vue 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 react project (run this in your project root directory):
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
npm install --save @guiexpert/table @guiexpert/vue3-table
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Add guiexpert-table component to a template:
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
<guiexpert-table
|
|
58
|
-
:tableModel="tableModel"
|
|
59
|
-
@tableReady="onTableReady($event)"
|
|
60
|
-
></guiexpert-table>
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Import the following classes in your component:
|
|
64
|
-
```
|
|
65
|
-
<script lang="ts" setup>
|
|
66
|
-
|
|
67
|
-
import { GuiexpertTable } from "@guiexpert/vue3-table";
|
|
68
|
-
import {
|
|
69
|
-
GeMouseEvent,
|
|
70
|
-
TableApi
|
|
71
|
-
TableFactory,
|
|
72
|
-
TableModelIf,
|
|
73
|
-
TableOptions,
|
|
74
|
-
TableOptionsIf
|
|
75
|
-
} from "@guiexpert/table";
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
Add a tableModel property and a onTableReady method to the component:
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
const headerData = [['Column 1', 'Column 2', 'Column 3']] // array of array!
|
|
83
|
-
|
|
84
|
-
const bodyData = []
|
|
85
|
-
for (let i = 0; i < 100; i++) {
|
|
86
|
-
bodyData.push(['This is a very', 'simple', 'demo.'])
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const tableModel: TableModelIf = TableFactory.createTableModel({
|
|
90
|
-
headerData,
|
|
91
|
-
bodyData,
|
|
92
|
-
overridingColumnWidth: 110,
|
|
93
|
-
});
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
package/dist/package.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@guiexpert/vue3-table",
|
|
3
|
-
"version": "3.0.7",
|
|
4
|
-
"type": "commonjs",
|
|
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 --no-git-checks --access public"
|
|
15
|
-
},
|
|
16
|
-
"exports": {
|
|
17
|
-
".": {
|
|
18
|
-
"import": "./index.js",
|
|
19
|
-
"require": "./index.cjs"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"tslib": "^2.3.0",
|
|
24
|
-
"@guiexpert/table": "workspace:^",
|
|
25
|
-
"vue": "^3.2.47",
|
|
26
|
-
"vue-i18n": "^9.2.2",
|
|
27
|
-
"vue-router": "^4.1.6"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@cypress/vue": "^5.0.4",
|
|
31
|
-
"@intlify/eslint-plugin-vue-i18n": "^2.0.0",
|
|
32
|
-
"@vitejs/plugin-vue": "^4.4.1",
|
|
33
|
-
"@vue/eslint-config-typescript": "^12.0.0",
|
|
34
|
-
"@vue/test-utils": "^2.4.1",
|
|
35
|
-
"eslint-plugin-vue": "^9.18.1",
|
|
36
|
-
"unplugin-vue-components": "^0.24.0",
|
|
37
|
-
"vue-eslint-parser": "^9.1.0",
|
|
38
|
-
"@types/node": "^20.11.17",
|
|
39
|
-
"vite": "^5.1.1",
|
|
40
|
-
"vite-plugin-dts": "^3.7.2",
|
|
41
|
-
"vite-plugin-eslint": "^1.8.1",
|
|
42
|
-
"vite-plugin-static-copy": "^0.17.0",
|
|
43
|
-
"vite-tsconfig-paths": "^4.2.1",
|
|
44
|
-
"vite-plugin-babel": "^1.2.0",
|
|
45
|
-
"@vitejs/plugin-react": "^4.1.1",
|
|
46
|
-
"ts-node": "10.9.1",
|
|
47
|
-
"tsconfig": "^7.0.0",
|
|
48
|
-
"typescript": "5.2.2"
|
|
49
|
-
}
|
|
50
|
-
}
|
package/jest.config.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
displayName: "vue3-table",
|
|
3
|
-
globals: {
|
|
4
|
-
"vue-jest": {
|
|
5
|
-
tsConfig: "./libs/vue3-table/tsconfig.spec.json"
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
transform: {
|
|
9
|
-
"^.+\\.vue$": "@vue/vue3-jest",
|
|
10
|
-
"^.+\\.jsx$": "babel-jest",
|
|
11
|
-
"^.+\\.tsx?$": "ts-jest"
|
|
12
|
-
},
|
|
13
|
-
testEnvironmentOptions: {
|
|
14
|
-
customExportConditions: ["node", "node-addons"]
|
|
15
|
-
},
|
|
16
|
-
testEnvironment: "jsdom",
|
|
17
|
-
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "vue"],
|
|
18
|
-
testTimeout: 10000
|
|
19
|
-
};
|
package/patch.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// import fs from 'fs';
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
|
|
4
|
-
const packageJsonPath = 'package.json';
|
|
5
|
-
|
|
6
|
-
try {
|
|
7
|
-
const pack = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
8
|
-
const currentVersion = pack.version;
|
|
9
|
-
const [major, minor, patch] = currentVersion.split('.').map(Number);
|
|
10
|
-
const newPatchVersion = `${major}.${minor}.${patch + 1}`;
|
|
11
|
-
pack.version = newPatchVersion;
|
|
12
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(pack, null, 2));
|
|
13
|
-
console.log(`${pack.name} -> version patched to ${newPatchVersion}.`);
|
|
14
|
-
|
|
15
|
-
} catch (error) {
|
|
16
|
-
console.error('Error:', error);
|
|
17
|
-
}
|
package/postcss.config.js
DELETED
package/src/index.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { AreaIdent, AreaModelIf, CellRendererIf, DomServiceIf, RendererCleanupFnType } from "@guiexpert/table";
|
|
2
|
-
import { createVNode, render } from "vue";
|
|
3
|
-
import { AppContext, VNode, VNodeProps } from "@vue/runtime-core";
|
|
4
|
-
|
|
5
|
-
declare type Data = Record<string, unknown>;
|
|
6
|
-
|
|
7
|
-
export class ComponentRendererWrapper implements CellRendererIf {
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
10
|
-
private readonly component: any,
|
|
11
|
-
private readonly appContext: AppContext | null
|
|
12
|
-
) {
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
render(
|
|
16
|
-
cellDiv: HTMLDivElement,
|
|
17
|
-
rowIndex: number,
|
|
18
|
-
columnIndex: number,
|
|
19
|
-
areaIdent: AreaIdent,
|
|
20
|
-
areaModel: AreaModelIf,
|
|
21
|
-
cellValue: any,
|
|
22
|
-
_domService: DomServiceIf): RendererCleanupFnType | undefined {
|
|
23
|
-
|
|
24
|
-
const cleanupFn = this.mount(
|
|
25
|
-
this.component,
|
|
26
|
-
{
|
|
27
|
-
cellDiv,
|
|
28
|
-
rowIndex,
|
|
29
|
-
columnIndex,
|
|
30
|
-
areaIdent,
|
|
31
|
-
areaModel,
|
|
32
|
-
cellValue
|
|
33
|
-
},
|
|
34
|
-
this.appContext,
|
|
35
|
-
cellDiv
|
|
36
|
-
);
|
|
37
|
-
return cleanupFn;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
private mount(
|
|
42
|
-
component: any,
|
|
43
|
-
props: (Data & VNodeProps) | null,
|
|
44
|
-
appContext: AppContext | null,
|
|
45
|
-
cellDiv: HTMLDivElement
|
|
46
|
-
) {
|
|
47
|
-
let vNode: VNode = createVNode(component, props);
|
|
48
|
-
|
|
49
|
-
vNode.appContext = appContext;
|
|
50
|
-
render(vNode, cellDiv);
|
|
51
|
-
|
|
52
|
-
const cleanupFn = () => {
|
|
53
|
-
if (cellDiv) {
|
|
54
|
-
render(null, cellDiv);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
return cleanupFn;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { mount } from "@vue/test-utils";
|
|
2
|
-
import { expect, test } from "vitest";
|
|
3
|
-
import GuiexpertTable from "./GuiexpertTable.vue";
|
|
4
|
-
|
|
5
|
-
test("shows text", () => {
|
|
6
|
-
expect(GuiexpertTable).toBeTruthy();
|
|
7
|
-
const wrapper = mount(GuiexpertTable);
|
|
8
|
-
expect(wrapper.text()).toContain("GuiexpertTable");
|
|
9
|
-
});
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
class="container-div"
|
|
5
|
-
style="width: 100%; height: 100%; background-color: transparent; padding: 0; margin: 0">
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script lang="ts">
|
|
10
|
-
import {
|
|
11
|
-
FocusModelIf,
|
|
12
|
-
GeModelChangeEvent,
|
|
13
|
-
GeMouseEvent,
|
|
14
|
-
LicenseManager, SelectionModelIf,
|
|
15
|
-
SimpleDomService,
|
|
16
|
-
TableOptions,
|
|
17
|
-
TableScope
|
|
18
|
-
} from '@guiexpert/table';
|
|
19
|
-
import { defineComponent, onMounted, ref } from "vue";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export default defineComponent({
|
|
23
|
-
inheritAttrs: false,
|
|
24
|
-
props: {
|
|
25
|
-
tableModel: {
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
tableOptions: {
|
|
29
|
-
required: false,
|
|
30
|
-
default: new TableOptions()
|
|
31
|
-
},
|
|
32
|
-
debounceMouseClickDelay: {
|
|
33
|
-
required: false,
|
|
34
|
-
default: 150
|
|
35
|
-
},
|
|
36
|
-
licenseKey: {
|
|
37
|
-
default: '',
|
|
38
|
-
required: false
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
emits: [
|
|
42
|
-
"tableReady",
|
|
43
|
-
"mouseClicked",
|
|
44
|
-
"mouseDragging",
|
|
45
|
-
"checkboxChanged",
|
|
46
|
-
"contextmenu",
|
|
47
|
-
"modelChanged",
|
|
48
|
-
"focusChanged",
|
|
49
|
-
"selectionChanged",
|
|
50
|
-
"mouseDraggingEnd",
|
|
51
|
-
"mouseMoved"
|
|
52
|
-
],
|
|
53
|
-
|
|
54
|
-
setup(props, { emit }) {
|
|
55
|
-
const root = ref(null);
|
|
56
|
-
|
|
57
|
-
const initTable = (ele: HTMLDivElement) => {
|
|
58
|
-
|
|
59
|
-
const listener = {
|
|
60
|
-
|
|
61
|
-
onSelectionChanged: (evt: SelectionModelIf) => {
|
|
62
|
-
emit("selectionChanged", evt);
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
onFocusChanged: (evt: FocusModelIf) => {
|
|
66
|
-
emit("focusChanged", evt);
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
onCheckboxChanged: (evt: any[]) => {
|
|
70
|
-
emit("checkboxChanged", evt);
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
onContextmenu: (evt: GeMouseEvent) => {
|
|
74
|
-
emit("contextmenu", evt);
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
onModelChanged: (evt: GeModelChangeEvent) => {
|
|
78
|
-
emit("modelChanged", evt);
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
onMouseClicked: (evt: GeMouseEvent) => {
|
|
82
|
-
emit("mouseClicked", evt);
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
onMouseDragging: (evt: GeMouseEvent) => {
|
|
86
|
-
emit("mouseDragging", evt);
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
onMouseDraggingEnd: (evt: GeMouseEvent) => {
|
|
90
|
-
emit("mouseDraggingEnd", evt);
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
onMouseMoved: (evt: GeMouseEvent) => {
|
|
94
|
-
emit("mouseMoved", evt);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const tableScope = new TableScope(
|
|
99
|
-
ele, props.tableModel, new SimpleDomService(), props.tableOptions, listener
|
|
100
|
-
);
|
|
101
|
-
tableScope.firstInit();
|
|
102
|
-
emit("tableReady", tableScope.getApi());
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
onMounted(() => {
|
|
107
|
-
if (root.value) {
|
|
108
|
-
initTable(root.value as HTMLDivElement);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
if (props.licenseKey) LicenseManager.getInstance().setLicenseKey(props.licenseKey);
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
root
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
</script>
|
|
121
|
-
|
|
122
|
-
<style >
|
|
123
|
-
@import "../../../table/css/main.css";
|
|
124
|
-
</style>
|
package/src/shims-vue.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare module "*.vue" {
|
|
2
|
-
import type { DefineComponent } from "vue";
|
|
3
|
-
import { TableModelIf } from "../../table/src";
|
|
4
|
-
|
|
5
|
-
import { TableModelIf, TableOptions } from "@guiexpert/table";
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line
|
|
8
|
-
const component: DefineComponent<{
|
|
9
|
-
props: {
|
|
10
|
-
tableModel: TableModelIf,
|
|
11
|
-
tableOptions: TableOptions
|
|
12
|
-
},
|
|
13
|
-
}, {}, any>;
|
|
14
|
-
export default component;
|
|
15
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// Enables stricter inference for data properties on `this`
|
|
5
|
-
"strict": true,
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"jsx": "preserve",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"allowSyntheticDefaultImports": true,
|
|
10
|
-
"target": "ESNext",
|
|
11
|
-
"paths": {
|
|
12
|
-
"@assets/*": [
|
|
13
|
-
"./src/assets/*"
|
|
14
|
-
],
|
|
15
|
-
"@lib/*": [
|
|
16
|
-
"./src/lib/*",
|
|
17
|
-
"../../table/src/*"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"references": [
|
|
22
|
-
{
|
|
23
|
-
"path": "./tsconfig.lib.json"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"path": "./tsconfig.spec.json"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
package/tsconfig.lib.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"types": [
|
|
6
|
-
"vue-i18n",
|
|
7
|
-
"node"
|
|
8
|
-
],
|
|
9
|
-
"composite": true
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"**/*.spec.js",
|
|
13
|
-
"**/*.spec.jsx",
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.spec.tsx"
|
|
16
|
-
],
|
|
17
|
-
"include": [
|
|
18
|
-
"**/*.js",
|
|
19
|
-
"**/*.jsx",
|
|
20
|
-
"**/*.ts",
|
|
21
|
-
"**/*.tsx",
|
|
22
|
-
"**/*.vue",
|
|
23
|
-
"**/*.json"
|
|
24
|
-
]
|
|
25
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"types": [
|
|
7
|
-
"vue-i18n",
|
|
8
|
-
"jest",
|
|
9
|
-
"node"
|
|
10
|
-
],
|
|
11
|
-
"composite": true
|
|
12
|
-
},
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.spec.tsx",
|
|
16
|
-
"**/*.vue",
|
|
17
|
-
"**/*.d.ts",
|
|
18
|
-
"**/*.ts"
|
|
19
|
-
]
|
|
20
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { join } from "path";
|
|
2
|
-
import { defineConfig } from "vite";
|
|
3
|
-
import Vue from "@vitejs/plugin-vue";
|
|
4
|
-
import Components from "unplugin-vue-components/vite";
|
|
5
|
-
import {viteStaticCopy} from "vite-plugin-static-copy";
|
|
6
|
-
import dts from "vite-plugin-dts";
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
assetsInclude: /\.(pdf|jpg|png|svg)$/,
|
|
10
|
-
|
|
11
|
-
resolve: {
|
|
12
|
-
alias: [
|
|
13
|
-
{
|
|
14
|
-
find: /@guiexpert\/table/,
|
|
15
|
-
replacement: join(__dirname, '..', 'table', 'src'),
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
plugins: [
|
|
21
|
-
dts({
|
|
22
|
-
entryRoot: "src",
|
|
23
|
-
tsconfigPath: join(__dirname, "tsconfig.lib.json"),
|
|
24
|
-
}),
|
|
25
|
-
Vue(),
|
|
26
|
-
Components({
|
|
27
|
-
dirs: ["src/lib"]
|
|
28
|
-
}),
|
|
29
|
-
viteStaticCopy({
|
|
30
|
-
targets: [
|
|
31
|
-
{
|
|
32
|
-
src: 'README.md',
|
|
33
|
-
dest: './'
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
src: 'package.json',
|
|
37
|
-
dest: './'
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
})
|
|
41
|
-
],
|
|
42
|
-
build: {
|
|
43
|
-
lib: {
|
|
44
|
-
entry: join(__dirname, "./src/index.ts"),
|
|
45
|
-
name: "vue3-table",
|
|
46
|
-
fileName: (format) => (format === "es" ? "index.js" : "index.cjs"),
|
|
47
|
-
// Change this to the formats you want to support.
|
|
48
|
-
// Don't forget to update your package.json as well.
|
|
49
|
-
formats: ['es', 'cjs'],
|
|
50
|
-
},
|
|
51
|
-
rollupOptions: {
|
|
52
|
-
// externalize deps that shouldn't be bundled
|
|
53
|
-
external: ["vue"],
|
|
54
|
-
output: {
|
|
55
|
-
// globals to use in the UMD build for externalized deps
|
|
56
|
-
globals: {
|
|
57
|
-
vue: "Vue"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|