@ecan-bi/sheet 0.0.8 → 0.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/dist/index.es.js +57 -37
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -3
- package/types/Sheet.d.ts +3 -7
package/dist/index.es.js
CHANGED
|
@@ -1,54 +1,74 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var m = Object.defineProperty, k = Object.defineProperties;
|
|
2
|
+
var w = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
|
+
var E = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var a = (t, e, n) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, c = (t, e) => {
|
|
6
6
|
for (var n in e || (e = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
7
|
+
E.call(e, n) && a(t, n, e[n]);
|
|
8
|
+
if (d)
|
|
9
|
+
for (var n of d(e))
|
|
10
|
+
g.call(e, n) && a(t, n, e[n]);
|
|
11
11
|
return t;
|
|
12
|
-
},
|
|
13
|
-
import { defineComponent as
|
|
14
|
-
const
|
|
12
|
+
}, u = (t, e) => k(t, w(e));
|
|
13
|
+
import { defineComponent as b, computed as A, getCurrentInstance as f, ref as j, watch as v, unref as x, isVue2 as C, onMounted as O, h as z } from "vue-demi";
|
|
14
|
+
const p = "Luckysheet", I = b({
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
props: {
|
|
17
|
-
|
|
17
|
+
options: {
|
|
18
18
|
type: Object,
|
|
19
19
|
default: () => {
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
setup(t, { attrs: e }) {
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
const
|
|
23
|
+
setup(t, { attrs: e, expose: n }) {
|
|
24
|
+
const y = A(() => {
|
|
25
|
+
var r;
|
|
26
|
+
{
|
|
27
|
+
const s = (r = f()) == null ? void 0 : r.proxy.$listeners;
|
|
28
28
|
return {
|
|
29
|
-
attrs:
|
|
30
|
-
|
|
29
|
+
attrs: u(c({}, e), {
|
|
30
|
+
id: p
|
|
31
|
+
}),
|
|
32
|
+
on: s
|
|
31
33
|
};
|
|
32
34
|
}
|
|
33
|
-
|
|
34
|
-
}), h = p(() => r(o({
|
|
35
|
+
}), h = j(u(c({
|
|
35
36
|
lang: "zh"
|
|
36
|
-
}, t.
|
|
37
|
-
container:
|
|
37
|
+
}, t.options), {
|
|
38
|
+
container: p
|
|
38
39
|
}));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
v(h, () => {
|
|
41
|
+
l();
|
|
42
|
+
}, {
|
|
43
|
+
deep: !0
|
|
44
|
+
});
|
|
45
|
+
const o = window.luckysheet, l = () => {
|
|
46
|
+
var r;
|
|
47
|
+
if (o == null)
|
|
48
|
+
throw new Error("\u672A\u5F15\u5165 luckysheet \u63D2\u4EF6");
|
|
49
|
+
if (o.destroy(), o.create(x(h)), C) {
|
|
50
|
+
const s = (r = f()) == null ? void 0 : r.proxy.$listeners;
|
|
51
|
+
s && Object.keys(s).forEach((i) => {
|
|
52
|
+
o[i] = s[i];
|
|
53
|
+
});
|
|
54
|
+
} else
|
|
55
|
+
Object.keys(e).forEach((s) => {
|
|
56
|
+
if (/^on[^a-z]/.test(s)) {
|
|
57
|
+
const i = s.slice(2);
|
|
58
|
+
o[i] = e[s];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
return n({
|
|
63
|
+
instance: o
|
|
64
|
+
}), O(() => {
|
|
65
|
+
l();
|
|
66
|
+
}), {
|
|
67
|
+
myAttrs: y
|
|
42
68
|
};
|
|
43
|
-
},
|
|
44
|
-
mounted() {
|
|
45
|
-
const t = window.luckysheet;
|
|
46
|
-
if (t == null)
|
|
47
|
-
throw new Error("\u672A\u5F15\u5165 luckysheet \u63D2\u4EF6");
|
|
48
|
-
t.create(this.myOption);
|
|
49
69
|
},
|
|
50
70
|
render() {
|
|
51
|
-
const t =
|
|
71
|
+
const t = u(c({
|
|
52
72
|
style: {
|
|
53
73
|
margin: "0",
|
|
54
74
|
padding: "0",
|
|
@@ -59,12 +79,12 @@ const s = "Luckysheet", O = g({
|
|
|
59
79
|
top: "0"
|
|
60
80
|
}
|
|
61
81
|
}, this.myAttrs), {
|
|
62
|
-
id:
|
|
82
|
+
id: p
|
|
63
83
|
});
|
|
64
|
-
return
|
|
84
|
+
return z("div", t);
|
|
65
85
|
}
|
|
66
86
|
});
|
|
67
87
|
export {
|
|
68
|
-
|
|
88
|
+
I as default
|
|
69
89
|
};
|
|
70
90
|
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/constant.ts","../src/Sheet.ts"],"sourcesContent":["export const LUCKYSHEET_ID = 'Luckysheet'\n","import { defineComponent, h, computed, getCurrentInstance, isVue2 } from 'vue-demi'\nimport { LUCKYSHEET_ID } from './constant'\nexport default defineComponent({\n inheritAttrs: false,\n props: {\n
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../src/constant.ts","../src/Sheet.ts"],"sourcesContent":["export const LUCKYSHEET_ID = 'Luckysheet'\n","import { defineComponent, h, computed, getCurrentInstance, onMounted, unref, ref, watch, isVue2 } from 'vue-demi'\nimport { LUCKYSHEET_ID } from './constant'\nexport default defineComponent({\n inheritAttrs: false,\n props: {\n options: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs, expose }) {\n const myAttrs = computed(() => {\n const isVue2 = true\n if (isVue2) {\n // @ts-ignore\n const events = getCurrentInstance()?.proxy.$listeners\n return {\n attrs: {\n ...attrs,\n id: LUCKYSHEET_ID\n },\n on: events\n }\n }\n return attrs\n })\n const option = ref({\n lang: 'zh',\n ...props.options,\n container: LUCKYSHEET_ID\n })\n watch(option, () => {\n init()\n }, {\n deep: true\n })\n // @ts-ignore\n const luckysheet = window.luckysheet\n const init = () => {\n if (luckysheet == null) {\n throw new Error('未引入 luckysheet 插件')\n }\n luckysheet.destroy()\n luckysheet.create(unref(option))\n if (isVue2) {\n // @ts-ignore\n const events = getCurrentInstance()?.proxy.$listeners\n if (events) {\n Object.keys(events).forEach(key => {\n luckysheet[key] = events[key]\n })\n }\n } else {\n Object.keys(attrs).forEach((attr) => {\n if ((/^on[^a-z]/).test(attr)) {\n const key = attr.slice(2)\n luckysheet[key] = attrs[attr]\n }\n })\n }\n }\n expose({\n instance: luckysheet\n })\n onMounted(() => {\n init()\n })\n return {\n myAttrs\n }\n },\n render () {\n const attrs: { [key:string]: any } = {\n style: {\n margin: '0',\n padding: '0',\n position: 'absolute',\n width: '100%',\n height: '100%',\n left: '0',\n top: '0'\n },\n ...this.myAttrs,\n id: LUCKYSHEET_ID\n }\n return h('div', attrs)\n }\n})\n"],"names":["LUCKYSHEET_ID","Sheet","defineComponent","props","attrs","expose","myAttrs","computed","events","_a","getCurrentInstance","__spreadProps","__spreadValues","option","ref","watch","init","luckysheet","unref","isVue2","key","attr","onMounted","h"],"mappings":";;;;;;;;;;;;;AAAO,MAAMA,IAAgB,cCE7BC,IAAeC,EAAgB;AAAA,EAC7B,cAAc;AAAA,EACd,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS,MAAM;AAAA,MAAC;AAAA,IAClB;AAAA,EACF;AAAA,EACA,MAAOC,GAAO,EAAE,OAAAC,GAAO,QAAAC,KAAU;AACzB,UAAAC,IAAUC,EAAS,MAAM;;AAEjB;AAEJ,cAAAC,KAASC,IAAAC,QAAA,gBAAAD,EAAsB,MAAM;AACpC,eAAA;AAAA,UACL,OA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,MACP;AAAA,OACG,KAAK,UAV2B;AAAA,MAWnC,IAAIZ;AAAA,IAAA;AAEC,WAAAuB,EAAE,OAAOnB,CAAK;AAAA,EACvB;AACF,CAAC;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@ecan/bi-sheet"]={},t["vue-demi"]))})(this,function(t,e){"use strict";var
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@ecan/bi-sheet"]={},t["vue-demi"]))})(this,function(t,e){"use strict";var k=Object.defineProperty,w=Object.defineProperties;var E=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var a=(t,e,n)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,c=(t,e)=>{for(var n in e||(e={}))j.call(e,n)&&a(t,n,e[n]);if(h)for(var n of h(e))x.call(e,n)&&a(t,n,e[n]);return t},u=(t,e)=>w(t,E(e));const n="Luckysheet",y=e.defineComponent({inheritAttrs:!1,props:{options:{type:Object,default:()=>{}}},setup(d,{attrs:f,expose:b}){const g=e.computed(()=>{var i;{const s=(i=e.getCurrentInstance())==null?void 0:i.proxy.$listeners;return{attrs:u(c({},f),{id:n}),on:s}}}),p=e.ref(u(c({lang:"zh"},d.options),{container:n}));e.watch(p,()=>{l()},{deep:!0});const o=window.luckysheet,l=()=>{var i;if(o==null)throw new Error("\u672A\u5F15\u5165 luckysheet \u63D2\u4EF6");if(o.destroy(),o.create(e.unref(p)),e.isVue2){const s=(i=e.getCurrentInstance())==null?void 0:i.proxy.$listeners;s&&Object.keys(s).forEach(r=>{o[r]=s[r]})}else Object.keys(f).forEach(s=>{if(/^on[^a-z]/.test(s)){const r=s.slice(2);o[r]=f[s]}})};return b({instance:o}),e.onMounted(()=>{l()}),{myAttrs:g}},render(){const d=u(c({style:{margin:"0",padding:"0",position:"absolute",width:"100%",height:"100%",left:"0",top:"0"}},this.myAttrs),{id:n});return e.h("div",d)}});t.default=y,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/constant.ts","../src/Sheet.ts"],"sourcesContent":["export const LUCKYSHEET_ID = 'Luckysheet'\n","import { defineComponent, h, computed, getCurrentInstance, isVue2 } from 'vue-demi'\nimport { LUCKYSHEET_ID } from './constant'\nexport default defineComponent({\n inheritAttrs: false,\n props: {\n
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/constant.ts","../src/Sheet.ts"],"sourcesContent":["export const LUCKYSHEET_ID = 'Luckysheet'\n","import { defineComponent, h, computed, getCurrentInstance, onMounted, unref, ref, watch, isVue2 } from 'vue-demi'\nimport { LUCKYSHEET_ID } from './constant'\nexport default defineComponent({\n inheritAttrs: false,\n props: {\n options: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs, expose }) {\n const myAttrs = computed(() => {\n const isVue2 = true\n if (isVue2) {\n // @ts-ignore\n const events = getCurrentInstance()?.proxy.$listeners\n return {\n attrs: {\n ...attrs,\n id: LUCKYSHEET_ID\n },\n on: events\n }\n }\n return attrs\n })\n const option = ref({\n lang: 'zh',\n ...props.options,\n container: LUCKYSHEET_ID\n })\n watch(option, () => {\n init()\n }, {\n deep: true\n })\n // @ts-ignore\n const luckysheet = window.luckysheet\n const init = () => {\n if (luckysheet == null) {\n throw new Error('未引入 luckysheet 插件')\n }\n luckysheet.destroy()\n luckysheet.create(unref(option))\n if (isVue2) {\n // @ts-ignore\n const events = getCurrentInstance()?.proxy.$listeners\n if (events) {\n Object.keys(events).forEach(key => {\n luckysheet[key] = events[key]\n })\n }\n } else {\n Object.keys(attrs).forEach((attr) => {\n if ((/^on[^a-z]/).test(attr)) {\n const key = attr.slice(2)\n luckysheet[key] = attrs[attr]\n }\n })\n }\n }\n expose({\n instance: luckysheet\n })\n onMounted(() => {\n init()\n })\n return {\n myAttrs\n }\n },\n render () {\n const attrs: { [key:string]: any } = {\n style: {\n margin: '0',\n padding: '0',\n position: 'absolute',\n width: '100%',\n height: '100%',\n left: '0',\n top: '0'\n },\n ...this.myAttrs,\n id: LUCKYSHEET_ID\n }\n return h('div', attrs)\n }\n})\n"],"names":["LUCKYSHEET_ID","Sheet","defineComponent","props","attrs","expose","myAttrs","computed","events","getCurrentInstance","__spreadProps","__spreadValues","option","ref","watch","init","luckysheet","unref","isVue2","key","attr","onMounted","h"],"mappings":"utBAAO,MAAMA,EAAgB,aCE7BC,EAAeC,kBAAgB,CAC7B,aAAc,GACd,MAAO,CACL,QAAS,CACP,KAAM,OACN,QAAS,IAAM,CAAC,CAClB,CACF,EACA,MAAOC,EAAO,CAAE,MAAAC,EAAO,OAAAC,GAAU,CACzB,MAAAC,EAAUC,EAAAA,SAAS,IAAM,OAEjB,CAEJ,MAAAC,GAASC,EAAAA,EAAAA,uBAAAA,YAAAA,EAAsB,MAAM,WACpC,MAAA,CACL,MAAOC,EAAAC,EAAA,GACFP,GADE,CAEL,GAAIJ,CACN,GACA,GAAIQ,CAAA,CAER,CACO,CACR,EACKI,EAASC,EAAAA,IAAIH,EAAAC,EAAA,CACjB,KAAM,MACHR,EAAM,SAFQ,CAGjB,UAAWH,CAAA,EACZ,EACDc,EAAA,MAAMF,EAAQ,IAAM,CACbG,GAAA,EACJ,CACD,KAAM,EAAA,CACP,EAED,MAAMC,EAAa,OAAO,WACpBD,EAAO,IAAM,OACjB,GAAIC,GAAc,KACV,MAAA,IAAI,MAAM,4CAAmB,EAIrC,GAFAA,EAAW,QAAQ,EACRA,EAAA,OAAOC,QAAML,CAAM,CAAC,EAC3BM,SAAQ,CAEJ,MAAAV,GAASC,EAAAA,EAAAA,uBAAAA,YAAAA,EAAsB,MAAM,WACvCD,GACF,OAAO,KAAKA,CAAM,EAAE,QAAeW,GAAA,CACjCH,EAAWG,GAAOX,EAAOW,EAAA,CAC1B,CACH,MAEA,OAAO,KAAKf,CAAK,EAAE,QAASgB,GAAS,CAC9B,GAAA,YAAa,KAAKA,CAAI,EAAG,CACtB,MAAAD,EAAMC,EAAK,MAAM,CAAC,EACxBJ,EAAWG,GAAOf,EAAMgB,EAC1B,CAAA,CACD,CACH,EAEK,OAAAf,EAAA,CACL,SAAUW,CAAA,CACX,EACDK,EAAAA,UAAU,IAAM,CACTN,GAAA,CACN,EACM,CACL,QAAAT,CAAA,CAEJ,EACA,QAAU,CACR,MAAMF,EAA+BM,EAAAC,EAAA,CACnC,MAAO,CACL,OAAQ,IACR,QAAS,IACT,SAAU,WACV,MAAO,OACP,OAAQ,OACR,KAAM,IACN,IAAK,GACP,GACG,KAAK,SAV2B,CAWnC,GAAIX,CAAA,GAEC,OAAAsB,EAAA,EAAE,MAAOlB,CAAK,CACvB,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecan-bi/sheet",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
|
-
"types"
|
|
21
|
+
"types",
|
|
22
|
+
"plugins"
|
|
22
23
|
],
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"vue-demi": "latest"
|
|
@@ -41,7 +42,8 @@
|
|
|
41
42
|
"vite-babel-plugin": "^0.0.2",
|
|
42
43
|
"vite-plugin-dts": "^1.4.1",
|
|
43
44
|
"vite-plugin-eslint": "^1.6.1",
|
|
44
|
-
"vue": "3.2.27"
|
|
45
|
+
"vue": "3.2.27",
|
|
46
|
+
"vue2": "npm:vue@2"
|
|
45
47
|
},
|
|
46
48
|
"peerDependencies": {
|
|
47
49
|
"@vue/composition-api": "^1.0.0-rc.1",
|
package/types/Sheet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
2
|
-
|
|
2
|
+
options: {
|
|
3
3
|
type: ObjectConstructor;
|
|
4
4
|
default: () => void;
|
|
5
5
|
};
|
|
@@ -7,16 +7,12 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
7
7
|
myAttrs: import("vue-demi").ComputedRef<{
|
|
8
8
|
[x: string]: unknown;
|
|
9
9
|
}>;
|
|
10
|
-
myOption: import("vue-demi").ComputedRef<{
|
|
11
|
-
container: string;
|
|
12
|
-
lang: string;
|
|
13
|
-
}>;
|
|
14
10
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, Record<string, any>, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
15
|
-
|
|
11
|
+
options: {
|
|
16
12
|
type: ObjectConstructor;
|
|
17
13
|
default: () => void;
|
|
18
14
|
};
|
|
19
15
|
}>>, {
|
|
20
|
-
|
|
16
|
+
options: Record<string, any>;
|
|
21
17
|
}>;
|
|
22
18
|
export default _default;
|