@jspreadsheet/vue 11.5.1 → 11.5.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/dist/index.d.ts +27 -27
- package/dist/index.js +80 -80
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Official Type definitions for Jspreadsheet React
|
|
3
|
-
* https://jspreadsheet.com/v10/docs/react
|
|
4
|
-
* Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
interface Spreadsheet {
|
|
8
|
-
(): any
|
|
9
|
-
[key: string]: any
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface Worksheet {
|
|
13
|
-
(): any
|
|
14
|
-
[key: string]: any
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface Picker {
|
|
18
|
-
(): any
|
|
19
|
-
[key: string]: any
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
declare function Spreadsheet<Spreadsheet>(props: Spreadsheet): any;
|
|
23
|
-
declare function Worksheet<Worksheet>(props: Worksheet): any;
|
|
24
|
-
declare function Picker <Picker>(props: Picker): any;
|
|
25
|
-
|
|
26
|
-
import jspreadsheet from "jspreadsheet";
|
|
27
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Official Type definitions for Jspreadsheet React
|
|
3
|
+
* https://jspreadsheet.com/v10/docs/react
|
|
4
|
+
* Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface Spreadsheet {
|
|
8
|
+
(): any
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Worksheet {
|
|
13
|
+
(): any
|
|
14
|
+
[key: string]: any
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface Picker {
|
|
18
|
+
(): any
|
|
19
|
+
[key: string]: any
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare function Spreadsheet<Spreadsheet>(props: Spreadsheet): any;
|
|
23
|
+
declare function Worksheet<Worksheet>(props: Worksheet): any;
|
|
24
|
+
declare function Picker <Picker>(props: Picker): any;
|
|
25
|
+
|
|
26
|
+
import jspreadsheet from "jspreadsheet";
|
|
27
|
+
|
|
28
28
|
export { Spreadsheet, Worksheet, Picker, jspreadsheet };
|
package/dist/index.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { h, getCurrentInstance } from 'vue';
|
|
2
|
-
import jss from "jspreadsheet";
|
|
3
|
-
|
|
4
|
-
export const Worksheet = {
|
|
5
|
-
name: 'Worksheet',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export const Spreadsheet = {
|
|
9
|
-
inheritAttrs: false,
|
|
10
|
-
mounted() {
|
|
11
|
-
const { attrs, slots } = getCurrentInstance();
|
|
12
|
-
|
|
13
|
-
let options = {
|
|
14
|
-
...attrs
|
|
15
|
-
};
|
|
16
|
-
if (slots && typeof(slots.default) === 'function') {
|
|
17
|
-
options.worksheets = slots.default().reduce((acc, vnode) => {
|
|
18
|
-
if (vnode.type.name === "Worksheet") {
|
|
19
|
-
acc.push({
|
|
20
|
-
minDimensions: [4, 4],
|
|
21
|
-
...vnode.props
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return acc;
|
|
25
|
-
}, []);
|
|
26
|
-
} else {
|
|
27
|
-
if (attrs.worksheets) {
|
|
28
|
-
options.worksheets = attrs.worksheets;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (attrs.license) {
|
|
33
|
-
jss.setLicense(attrs.license);
|
|
34
|
-
}
|
|
35
|
-
if (attrs.extensions) {
|
|
36
|
-
jss.setExtensions(attrs.extensions);
|
|
37
|
-
}
|
|
38
|
-
if (attrs.id) {
|
|
39
|
-
this.$refs.container.id = attrs.id;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
this.el = this.$refs.container;
|
|
43
|
-
|
|
44
|
-
this.current = jss(this.$refs.container, options);
|
|
45
|
-
},
|
|
46
|
-
setup() {
|
|
47
|
-
let containerProps = {
|
|
48
|
-
ref: 'container'
|
|
49
|
-
};
|
|
50
|
-
return () => h('div', containerProps);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export let jspreadsheet = jss;
|
|
55
|
-
|
|
56
|
-
export const Picker = {
|
|
57
|
-
inheritAttrs: false,
|
|
58
|
-
mounted() {
|
|
59
|
-
const { attrs } = getCurrentInstance();
|
|
60
|
-
|
|
61
|
-
let options = {
|
|
62
|
-
...attrs
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
if (typeof(options.id) !== 'undefined') {
|
|
66
|
-
attrs.id = options.id;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
this.el = this.$refs.container;
|
|
70
|
-
|
|
71
|
-
this.current = jss.picker(this.$refs.container, options);
|
|
72
|
-
},
|
|
73
|
-
setup() {
|
|
74
|
-
let containerProps = {
|
|
75
|
-
ref: 'container'
|
|
76
|
-
};
|
|
77
|
-
return () => h('div', containerProps);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
1
|
+
import { h, getCurrentInstance } from 'vue';
|
|
2
|
+
import jss from "jspreadsheet";
|
|
3
|
+
|
|
4
|
+
export const Worksheet = {
|
|
5
|
+
name: 'Worksheet',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const Spreadsheet = {
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
mounted() {
|
|
11
|
+
const { attrs, slots } = getCurrentInstance();
|
|
12
|
+
|
|
13
|
+
let options = {
|
|
14
|
+
...attrs
|
|
15
|
+
};
|
|
16
|
+
if (slots && typeof(slots.default) === 'function') {
|
|
17
|
+
options.worksheets = slots.default().reduce((acc, vnode) => {
|
|
18
|
+
if (vnode.type.name === "Worksheet") {
|
|
19
|
+
acc.push({
|
|
20
|
+
minDimensions: [4, 4],
|
|
21
|
+
...vnode.props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return acc;
|
|
25
|
+
}, []);
|
|
26
|
+
} else {
|
|
27
|
+
if (attrs.worksheets) {
|
|
28
|
+
options.worksheets = attrs.worksheets;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (attrs.license) {
|
|
33
|
+
jss.setLicense(attrs.license);
|
|
34
|
+
}
|
|
35
|
+
if (attrs.extensions) {
|
|
36
|
+
jss.setExtensions(attrs.extensions);
|
|
37
|
+
}
|
|
38
|
+
if (attrs.id) {
|
|
39
|
+
this.$refs.container.id = attrs.id;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.el = this.$refs.container;
|
|
43
|
+
|
|
44
|
+
this.current = jss(this.$refs.container, options);
|
|
45
|
+
},
|
|
46
|
+
setup() {
|
|
47
|
+
let containerProps = {
|
|
48
|
+
ref: 'container'
|
|
49
|
+
};
|
|
50
|
+
return () => h('div', containerProps);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export let jspreadsheet = jss;
|
|
55
|
+
|
|
56
|
+
export const Picker = {
|
|
57
|
+
inheritAttrs: false,
|
|
58
|
+
mounted() {
|
|
59
|
+
const { attrs } = getCurrentInstance();
|
|
60
|
+
|
|
61
|
+
let options = {
|
|
62
|
+
...attrs
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
if (typeof(options.id) !== 'undefined') {
|
|
66
|
+
attrs.id = options.id;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
this.el = this.$refs.container;
|
|
70
|
+
|
|
71
|
+
this.current = jss.picker(this.$refs.container, options);
|
|
72
|
+
},
|
|
73
|
+
setup() {
|
|
74
|
+
let containerProps = {
|
|
75
|
+
ref: 'container'
|
|
76
|
+
};
|
|
77
|
+
return () => h('div', containerProps);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
81
|
export default { Worksheet, Spreadsheet, jspreadsheet };
|