@guiexpert/vue3-table 3.0.2 → 3.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/.babelrc +7 -0
- package/.eslintrc.js +79 -0
- package/components.d.ts +16 -0
- package/cypress/fixtures/example.json +3 -0
- package/cypress/plugins/index.ts +10 -0
- package/cypress/support/index.ts +1 -0
- package/dist/README.md +104 -0
- package/dist/index.cjs +254 -0
- package/{index.js → dist/index.js} +143 -123
- package/{lib → dist/lib}/ComponentRendererWrapper.d.ts +1 -1
- package/{lib → dist/lib}/GuiexpertTable.vue.d.ts +1 -1
- package/dist/package.json +49 -0
- package/jest.config.ts +19 -0
- package/package.json +34 -3
- package/patch.js +17 -0
- package/postcss.config.js +3 -0
- package/src/index.ts +3 -0
- package/src/lib/ComponentRendererWrapper.ts +61 -0
- package/src/lib/GuiexpertTable.spec.ts +9 -0
- package/src/lib/GuiexpertTable.vue +124 -0
- package/src/lib/GuiexpertTablePlugin.ts +10 -0
- package/src/shims-vue.d.ts +15 -0
- package/tsconfig.json +29 -0
- package/tsconfig.lib.json +25 -0
- package/tsconfig.spec.json +20 -0
- package/vite.config.ts +62 -0
- package/index.cjs +0 -254
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{lib → dist/lib}/GuiexpertTablePlugin.d.ts +0 -0
- /package/{style.css → dist/style.css} +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
|
import { AppContext } from "@vue/runtime-core";
|
|
3
3
|
export declare class ComponentRendererWrapper implements CellRendererIf {
|
|
4
4
|
private readonly component;
|
|
@@ -16,7 +16,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
};
|
|
17
17
|
}, {
|
|
18
18
|
root: import("vue").Ref<null>;
|
|
19
|
-
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved")[], "tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved", import("vue").
|
|
19
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved")[], "tableReady" | "mouseClicked" | "mouseDragging" | "checkboxChanged" | "contextmenu" | "modelChanged" | "focusChanged" | "selectionChanged" | "mouseDraggingEnd" | "mouseMoved", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
20
|
tableModel: {
|
|
21
21
|
required: true;
|
|
22
22
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guiexpert/vue3-table",
|
|
3
|
+
"version": "3.0.2",
|
|
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
|
+
"build": "vite build",
|
|
13
|
+
"npm-pub:vue3-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
|
+
"vue": "^3.2.47",
|
|
25
|
+
"vue-i18n": "^9.2.2",
|
|
26
|
+
"vue-router": "^4.1.6"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@cypress/vue": "^5.0.4",
|
|
30
|
+
"@intlify/eslint-plugin-vue-i18n": "^2.0.0",
|
|
31
|
+
"@vitejs/plugin-vue": "^4.4.1",
|
|
32
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
33
|
+
"@vue/test-utils": "^2.4.1",
|
|
34
|
+
"eslint-plugin-vue": "^9.18.1",
|
|
35
|
+
"unplugin-vue-components": "^0.24.0",
|
|
36
|
+
"vue-eslint-parser": "^9.1.0",
|
|
37
|
+
"@types/node": "^20.11.17",
|
|
38
|
+
"vite": "^5.1.1",
|
|
39
|
+
"vite-plugin-dts": "^3.7.2",
|
|
40
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
41
|
+
"vite-plugin-static-copy": "^0.17.0",
|
|
42
|
+
"vite-tsconfig-paths": "^4.2.1",
|
|
43
|
+
"vite-plugin-babel": "^1.2.0",
|
|
44
|
+
"@vitejs/plugin-react": "^4.1.1",
|
|
45
|
+
"ts-node": "10.9.1",
|
|
46
|
+
"tsconfig": "^7.0.0",
|
|
47
|
+
"typescript": "5.2.2"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guiexpert/vue3-table",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -8,12 +8,43 @@
|
|
|
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
|
+
"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"
|
|
18
49
|
}
|
|
19
|
-
}
|
|
50
|
+
}
|
package/patch.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
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/src/index.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
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>
|
|
@@ -0,0 +1,15 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
});
|