@handsontable/vue 0.0.0-next-9ec04ce-20221121

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/helpers.d.ts ADDED
@@ -0,0 +1,65 @@
1
+ import Vue, { VNode } from 'vue';
2
+ import Handsontable from 'handsontable/base';
3
+ import { HotTableProps, VueProps, EditorComponent } from './types';
4
+ /**
5
+ * Message for the warning thrown if the Handsontable instance has been destroyed.
6
+ */
7
+ export declare const HOT_DESTROYED_WARNING: string;
8
+ /**
9
+ * Rewrite the settings object passed to the watchers to be a clean array/object prepared to use within Handsontable config.
10
+ *
11
+ * @param {*} observerSettings Watcher object containing the changed data.
12
+ * @returns {Object|Array}
13
+ */
14
+ export declare function rewriteSettings(observerSettings: any): any[] | object;
15
+ /**
16
+ * Private method to ensure the table is not calling `updateSettings` after editing cells.
17
+ * @private
18
+ */
19
+ export declare function preventInternalEditWatch(component: any): void;
20
+ /**
21
+ * Generate an object containing all the available Handsontable properties and plugin hooks.
22
+ *
23
+ * @param {String} source Source for the factory (either 'HotTable' or 'HotColumn').
24
+ * @returns {Object}
25
+ */
26
+ export declare function propFactory(source: any): VueProps<HotTableProps>;
27
+ /**
28
+ * Filter out all of the unassigned props, and return only the one passed to the component.
29
+ *
30
+ * @param {Object} props Object containing all the possible props.
31
+ * @returns {Object} Object containing only used props.
32
+ */
33
+ export declare function filterPassedProps(props: any): VueProps<HotTableProps>;
34
+ /**
35
+ * Prepare the settings object to be used as the settings for Handsontable, based on the props provided to the component.
36
+ *
37
+ * @param {HotTableProps} props The props passed to the component.
38
+ * @param {Handsontable.GridSettings} currentSettings The current Handsontable settings.
39
+ * @returns {Handsontable.GridSettings} An object containing the properties, ready to be used within Handsontable.
40
+ */
41
+ export declare function prepareSettings(props: HotTableProps, currentSettings?: Handsontable.GridSettings): Handsontable.GridSettings;
42
+ /**
43
+ * Get the VNode element with the provided type attribute from the component slots.
44
+ *
45
+ * @param {Array} componentSlots Array of slots from a component.
46
+ * @param {String} type Type of the child component. Either `hot-renderer` or `hot-editor`.
47
+ * @returns {Object|null} The VNode of the child component (or `null` when nothing's found).
48
+ */
49
+ export declare function findVNodeByType(componentSlots: VNode[], type: string): VNode;
50
+ /**
51
+ * Get all `hot-column` component instances from the provided children array.
52
+ *
53
+ * @param {Array} children Array of children from a component.
54
+ * @returns {Array} Array of `hot-column` instances.
55
+ */
56
+ export declare function getHotColumnComponents(children: any): any;
57
+ /**
58
+ * Create an instance of the Vue Component based on the provided VNode.
59
+ *
60
+ * @param {Object} vNode VNode element to be turned into a component instance.
61
+ * @param {Object} parent Instance of the component to be marked as a parent of the newly created instance.
62
+ * @param {Object} props Props to be passed to the new instance.
63
+ * @param {Object} data Data to be passed to the new instance.
64
+ */
65
+ export declare function createVueComponent(vNode: VNode, parent: Vue, props: object, data: object): EditorComponent;
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import HotTable from './HotTable.vue';
2
+ import HotColumn from './HotColumn.vue';
3
+ import BaseEditorComponent from './BaseEditorComponent.vue';
4
+ export { HotTable as default, HotTable, HotColumn, BaseEditorComponent };
package/package.json ADDED
@@ -0,0 +1,133 @@
1
+ {
2
+ "name": "@handsontable/vue",
3
+ "version": "0.0.0-next-9ec04ce-20221121",
4
+ "description": "Best Data Grid for Vue with Spreadsheet Look and Feel.",
5
+ "author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
6
+ "homepage": "https://handsontable.com",
7
+ "license": "SEE LICENSE IN LICENSE.txt",
8
+ "main": "./commonjs/vue-handsontable.js",
9
+ "module": "./es/vue-handsontable.js",
10
+ "jsdelivr": "./dist/vue-handsontable.min.js",
11
+ "unpkg": "./dist/vue-handsontable.min.js",
12
+ "types": "./index.d.ts",
13
+ "exports": {
14
+ "./dist/vue-handsontable.js": "./dist/vue-handsontable.js",
15
+ "./dist/vue-handsontable.min.js": "./dist/vue-handsontable.min.js",
16
+ ".": {
17
+ "import": "./es/vue-handsontable.mjs",
18
+ "require": "./commonjs/vue-handsontable.js"
19
+ }
20
+ },
21
+ "keywords": [
22
+ "handsontable",
23
+ "component",
24
+ "data",
25
+ "table",
26
+ "grid",
27
+ "data table",
28
+ "data grid",
29
+ "spreadsheet",
30
+ "sheet",
31
+ "excel",
32
+ "vue",
33
+ "vue.js",
34
+ "vuejs",
35
+ "vue2",
36
+ "vue component",
37
+ "vue grid",
38
+ "wrapper",
39
+ "enterprise",
40
+ "sort",
41
+ "formulas",
42
+ "filter",
43
+ "search",
44
+ "conditional formatting",
45
+ "csv"
46
+ ],
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/handsontable/handsontable.git"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/handsontable/handsontable/issues"
53
+ },
54
+ "peerDependencies": {
55
+ "handsontable": "0.0.0-next-9ec04ce-20221121",
56
+ "vue": "^2.5.0"
57
+ },
58
+ "devDependencies": {
59
+ "@babel/cli": "^7.4.4",
60
+ "@babel/core": "^7.4.5",
61
+ "@babel/plugin-transform-runtime": "^7.4.4",
62
+ "@babel/polyfill": "^7.4.4",
63
+ "@babel/preset-env": "^7.4.5",
64
+ "@babel/preset-typescript": "^7.3.3",
65
+ "@babel/runtime": "^7.4.5",
66
+ "@vue/test-utils": "^1.0.3",
67
+ "babel-core": "^7.0.0-bridge.0",
68
+ "cpy-cli": "^3.1.1",
69
+ "cross-env": "^5.2.0",
70
+ "css-loader": "^3.0.0",
71
+ "del-cli": "^3.0.1",
72
+ "handsontable": "0.0.0-next-9ec04ce-20221121",
73
+ "jest": "^26.6.3",
74
+ "resize-observer-polyfill": "^1.5.1",
75
+ "rollup": "^2.0.0",
76
+ "rollup-plugin-babel": "^4.3.2",
77
+ "rollup-plugin-cleanup": "^3.1.1",
78
+ "rollup-plugin-commonjs": "^10.0.0",
79
+ "rollup-plugin-json": "^4.0.0",
80
+ "rollup-plugin-node-resolve": "^5.0.2",
81
+ "rollup-plugin-replace": "^2.2.0",
82
+ "rollup-plugin-terser": "^7.0.2",
83
+ "rollup-plugin-typescript": "^1.0.1",
84
+ "rollup-plugin-typescript2": "^0.21.1",
85
+ "rollup-plugin-vue": "^5.0.0",
86
+ "typescript": "3.8.2",
87
+ "vue": "~2.6.10",
88
+ "vue-class-component": "^7.1.0",
89
+ "vue-jest": "^3.0.4",
90
+ "vue-router": "^3.0.6",
91
+ "vue-template-compiler": "~2.6.10",
92
+ "vuex": "^3.1.1"
93
+ },
94
+ "scripts": {
95
+ "build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:min",
96
+ "build:commonjs": "cross-env NODE_ENV=cjs rollup -c",
97
+ "build:umd": "cross-env NODE_ENV=umd rollup -c",
98
+ "build:es": "cross-env NODE_ENV=es rollup -c",
99
+ "build:min": "cross-env NODE_ENV=min rollup -c",
100
+ "build:esDts": "cross-env NODE_ENV=esDts rollup -c && del-cli ./buildTemp/",
101
+ "watch:commonjs": "cross-env NODE_ENV=cjs rollup -c --watch",
102
+ "watch:es": "cross-env NODE_ENV=es rollup -c --watch",
103
+ "watch:umd": "cross-env NODE_ENV=umd rollup -c --watch",
104
+ "clean": "del-cli ./es/ && del-cli ./commonjs/ && del-cli ./dist/ && del-cli ./*.d.ts",
105
+ "publish-package": "npm publish",
106
+ "test": "jest"
107
+ },
108
+ "jest": {
109
+ "testURL": "http://localhost/",
110
+ "transform": {
111
+ "^.+\\.ts?$": "babel-jest",
112
+ "^.+\\.js$": "babel-jest",
113
+ ".*\\.vue$": "vue-jest"
114
+ },
115
+ "testRegex": "(/test/(.*).(test|spec)).(js?|ts?)$",
116
+ "moduleFileExtensions": [
117
+ "ts",
118
+ "js",
119
+ "json",
120
+ "vue",
121
+ "node"
122
+ ],
123
+ "setupFilesAfterEnv": [
124
+ "<rootDir>/test/bootstrap.js"
125
+ ],
126
+ "globals": {
127
+ "ts-jest": {
128
+ "tsConfig": "test-tsconfig.json",
129
+ "babelConfig": true
130
+ }
131
+ }
132
+ }
133
+ }
package/types.d.ts ADDED
@@ -0,0 +1,60 @@
1
+ import Handsontable from 'handsontable/base';
2
+ import Vue, { VNode } from 'vue';
3
+ import { ThisTypedComponentOptionsWithRecordProps } from 'vue/types/options';
4
+ export interface HotTableData {
5
+ __internalEdit: boolean;
6
+ __hotInstance: Handsontable | null;
7
+ miscCache?: {
8
+ currentSourceColumns?: number;
9
+ };
10
+ hotInstance?: Handsontable | null;
11
+ columnSettings: HotTableProps[];
12
+ rendererCache: any;
13
+ editorCache: Map<string, EditorComponent>;
14
+ }
15
+ export interface HotTableMethods {
16
+ hotInit: () => void;
17
+ getColumnSettings: () => HotTableProps[] | void;
18
+ getGlobalRendererVNode: () => VNode | void;
19
+ getGlobalEditorVNode: () => VNode | void;
20
+ getRendererWrapper: (vNode: VNode, containerComponent: Vue) => (...args: any[]) => HTMLElement;
21
+ getEditorClass: (vNode: VNode, containerComponent: Vue) => typeof Handsontable.editors.BaseEditor;
22
+ matchHotMappersSize: () => void;
23
+ }
24
+ export interface HotTableProps extends Handsontable.GridSettings {
25
+ id?: string;
26
+ settings?: Handsontable.GridSettings;
27
+ wrapperRendererCacheSize?: number;
28
+ }
29
+ export interface HotTableComponent<V extends Vue, D, M, C, P> extends ThisTypedComponentOptionsWithRecordProps<V, D, M, C, P> {
30
+ version: string;
31
+ }
32
+ export interface HotColumnMethods {
33
+ createColumnSettings: () => void;
34
+ }
35
+ export interface EditorComponent extends Vue {
36
+ focus(): void;
37
+ open(event?: Event): void;
38
+ close(): void;
39
+ getValue(): any;
40
+ setValue(newValue?: any): void;
41
+ [additional: string]: any;
42
+ }
43
+ export declare type VueProps<T> = {
44
+ [P in keyof T]: any;
45
+ };
46
+ declare type ClassMethodKey<T> = ({
47
+ [P in keyof T]: T[P] extends Function ? P : never;
48
+ })[keyof T];
49
+ declare type NonConstructorClassMethodKey<T> = Exclude<ClassMethodKey<T>, 'constructor'>;
50
+ declare type NotOriginalValueProp<T> = Exclude<NonConstructorClassMethodKey<T>, 'originalValue'>;
51
+ declare type ClassFieldKey<T> = ({
52
+ [P in keyof T]: T[P] extends Function ? never : P;
53
+ })[keyof T];
54
+ declare type ClassMethods<T> = Pick<T, NotOriginalValueProp<T>>;
55
+ declare type ClassFields<T> = Pick<T, ClassFieldKey<T>>;
56
+ export interface BaseVueEditorMethods extends ClassMethods<Handsontable._editors.Base> {
57
+ }
58
+ export interface BaseVueEditorFields extends ClassFields<Handsontable._editors.Base> {
59
+ }
60
+ export {};