@ecan-bi/sheet 0.0.6 → 0.0.7
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 +7 -8
- 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 +1 -1
- package/types/Sheet.d.ts +0 -22
- package/types/constant.d.ts +0 -1
- package/types/index.d.ts +0 -2
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as c, computed as
|
|
2
|
-
const e = "Luckysheet",
|
|
1
|
+
import { defineComponent as c, computed as o, isVue2 as p, getCurrentInstance as r, h } from "vue-demi";
|
|
2
|
+
const e = "Luckysheet", l = c({
|
|
3
3
|
inheritAttrs: !1,
|
|
4
4
|
props: {
|
|
5
5
|
option: {
|
|
@@ -9,17 +9,16 @@ const e = "Luckysheet", a = c({
|
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
11
|
setup(t, { attrs: n }) {
|
|
12
|
-
const s =
|
|
13
|
-
var o;
|
|
12
|
+
const s = o(() => {
|
|
14
13
|
if (p) {
|
|
15
|
-
const u = (
|
|
14
|
+
const u = r() ? r().proxy.$listeners : {};
|
|
16
15
|
return {
|
|
17
16
|
attrs: { ...n, id: e },
|
|
18
17
|
on: u
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
return n;
|
|
22
|
-
}), i =
|
|
21
|
+
}), i = o(() => ({
|
|
23
22
|
lang: "zh",
|
|
24
23
|
...t.option,
|
|
25
24
|
container: e
|
|
@@ -49,10 +48,10 @@ const e = "Luckysheet", a = c({
|
|
|
49
48
|
...this.myAttrs,
|
|
50
49
|
id: e
|
|
51
50
|
};
|
|
52
|
-
return
|
|
51
|
+
return h("div", t);
|
|
53
52
|
}
|
|
54
53
|
});
|
|
55
54
|
export {
|
|
56
|
-
|
|
55
|
+
l as default
|
|
57
56
|
};
|
|
58
57
|
//# 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 option: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs }) {\n const myAttrs = computed(() => {\n if (isVue2) {\n // @ts-expect-error\n const on = getCurrentInstance()
|
|
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 option: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs }) {\n const myAttrs = computed(() => {\n if (isVue2) {\n // @ts-expect-error\n const on = getCurrentInstance() ? getCurrentInstance().proxy.$listeners : {}\n return {\n attrs: { ...attrs, id: LUCKYSHEET_ID },\n on\n }\n }\n return attrs\n })\n const myOption = computed(() => ({\n lang: 'zh',\n ...props.option,\n container: LUCKYSHEET_ID\n }))\n return {\n myAttrs,\n myOption\n }\n },\n mounted () {\n // @ts-ignore\n const luckysheet = window.luckysheet\n if (luckysheet == null) {\n throw new Error('未引入 luckysheet 插件')\n }\n luckysheet.create(this.myOption)\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","myAttrs","computed","isVue2","on","getCurrentInstance","myOption","luckysheet"],"mappings":";AAAO,MAAMA,IAAgB,cCE7BC,IAAeC,EAAgB;AAAA,EAC7B,cAAc;AAAA,EACd,OAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,MAAM;AAAA,MAAC;AAAA,IAClB;AAAA,EACF;AAAA,EACA,MAAOC,GAAO,EAAE,OAAAC,KAAS;AACjB,UAAAC,IAAUC,EAAS,MAAM;AAC7B,UAAIC,GAAQ;AAEV,cAAMC,IAAKC,MAAuBA,EAAqB,EAAA,MAAM,aAAa;AACnE,eAAA;AAAA,UACL,OAAO,EAAE,GAAGL,GAAO,IAAIJ,EAAc;AAAA,UACrC,IAAAQ;AAAA,QAAA;AAAA,MAEJ;AACO,aAAAJ;AAAA,IAAA,CACR,GACKM,IAAWJ,EAAS,OAAO;AAAA,MAC/B,MAAM;AAAA,MACN,GAAGH,EAAM;AAAA,MACT,WAAWH;AAAA,IACX,EAAA;AACK,WAAA;AAAA,MACL,SAAAK;AAAA,MACA,UAAAK;AAAA,IAAA;AAAA,EAEJ;AAAA,EACA,UAAW;AAET,UAAMC,IAAa,OAAO;AAC1B,QAAIA,KAAc;AACV,YAAA,IAAI,MAAM,4CAAmB;AAE1B,IAAAA,EAAA,OAAO,KAAK,QAAQ;AAAA,EACjC;AAAA,EACA,SAAU;AACR,UAAMP,IAA+B;AAAA,MACnC,OAAO;AAAA,QACL,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,UAAU;AAAA,QACV,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,KAAK;AAAA,MACP;AAAA,MACA,GAAG,KAAK;AAAA,MACR,IAAIJ;AAAA,IAAA;AAEC,WAAA,EAAE,OAAOI,CAAK;AAAA,EACvB;AACF,CAAC;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["@ecan/bi-sheet"]={},t["vue-demi"]))})(this,function(t,e){"use strict";const o="Luckysheet",
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue-demi")):typeof define=="function"&&define.amd?define(["exports","vue-demi"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["@ecan/bi-sheet"]={},t["vue-demi"]))})(this,function(t,e){"use strict";const o="Luckysheet",i=e.defineComponent({inheritAttrs:!1,props:{option:{type:Object,default:()=>{}}},setup(n,{attrs:s}){const r=e.computed(()=>{if(e.isVue2){const d=e.getCurrentInstance()?e.getCurrentInstance().proxy.$listeners:{};return{attrs:{...s,id:o},on:d}}return s}),u=e.computed(()=>({lang:"zh",...n.option,container:o}));return{myAttrs:r,myOption:u}},mounted(){const n=window.luckysheet;if(n==null)throw new Error("\u672A\u5F15\u5165 luckysheet \u63D2\u4EF6");n.create(this.myOption)},render(){const n={style:{margin:"0",padding:"0",position:"absolute",width:"100%",height:"100%",left:"0",top:"0"},...this.myAttrs,id:o};return e.h("div",n)}});t.default=i,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 option: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs }) {\n const myAttrs = computed(() => {\n if (isVue2) {\n // @ts-expect-error\n const on = getCurrentInstance()
|
|
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 option: {\n type: Object,\n default: () => {}\n }\n },\n setup (props, { attrs }) {\n const myAttrs = computed(() => {\n if (isVue2) {\n // @ts-expect-error\n const on = getCurrentInstance() ? getCurrentInstance().proxy.$listeners : {}\n return {\n attrs: { ...attrs, id: LUCKYSHEET_ID },\n on\n }\n }\n return attrs\n })\n const myOption = computed(() => ({\n lang: 'zh',\n ...props.option,\n container: LUCKYSHEET_ID\n }))\n return {\n myAttrs,\n myOption\n }\n },\n mounted () {\n // @ts-ignore\n const luckysheet = window.luckysheet\n if (luckysheet == null) {\n throw new Error('未引入 luckysheet 插件')\n }\n luckysheet.create(this.myOption)\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","myAttrs","computed","isVue2","on","getCurrentInstance","myOption","luckysheet","h"],"mappings":"wRAAO,MAAMA,EAAgB,aCE7BC,EAAeC,kBAAgB,CAC7B,aAAc,GACd,MAAO,CACL,OAAQ,CACN,KAAM,OACN,QAAS,IAAM,CAAC,CAClB,CACF,EACA,MAAOC,EAAO,CAAE,MAAAC,GAAS,CACjB,MAAAC,EAAUC,EAAAA,SAAS,IAAM,CAC7B,GAAIC,SAAQ,CAEV,MAAMC,EAAKC,EAAAA,qBAAuBA,EAAAA,mBAAqB,EAAA,MAAM,WAAa,GACnE,MAAA,CACL,MAAO,CAAE,GAAGL,EAAO,GAAIJ,CAAc,EACrC,GAAAQ,CAAA,CAEJ,CACO,OAAAJ,CAAA,CACR,EACKM,EAAWJ,EAAAA,SAAS,KAAO,CAC/B,KAAM,KACN,GAAGH,EAAM,OACT,UAAWH,CACX,EAAA,EACK,MAAA,CACL,QAAAK,EACA,SAAAK,CAAA,CAEJ,EACA,SAAW,CAET,MAAMC,EAAa,OAAO,WAC1B,GAAIA,GAAc,KACV,MAAA,IAAI,MAAM,4CAAmB,EAE1BA,EAAA,OAAO,KAAK,QAAQ,CACjC,EACA,QAAU,CACR,MAAMP,EAA+B,CACnC,MAAO,CACL,OAAQ,IACR,QAAS,IACT,SAAU,WACV,MAAO,OACP,OAAQ,OACR,KAAM,IACN,IAAK,GACP,EACA,GAAG,KAAK,QACR,GAAIJ,CAAA,EAEC,OAAAY,EAAA,EAAE,MAAOR,CAAK,CACvB,CACF,CAAC"}
|
package/package.json
CHANGED
package/types/Sheet.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue-demi").DefineComponent<{
|
|
2
|
-
option: {
|
|
3
|
-
type: ObjectConstructor;
|
|
4
|
-
default: () => void;
|
|
5
|
-
};
|
|
6
|
-
}, {
|
|
7
|
-
myAttrs: import("vue-demi").ComputedRef<{
|
|
8
|
-
[x: string]: unknown;
|
|
9
|
-
}>;
|
|
10
|
-
myOption: import("vue-demi").ComputedRef<{
|
|
11
|
-
container: string;
|
|
12
|
-
lang: string;
|
|
13
|
-
}>;
|
|
14
|
-
}, 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
|
-
option: {
|
|
16
|
-
type: ObjectConstructor;
|
|
17
|
-
default: () => void;
|
|
18
|
-
};
|
|
19
|
-
}>>, {
|
|
20
|
-
option: Record<string, any>;
|
|
21
|
-
}>;
|
|
22
|
-
export default _default;
|
package/types/constant.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const LUCKYSHEET_ID = "Luckysheet";
|
package/types/index.d.ts
DELETED