@lingshugroup/web-plus 1.0.28 → 1.0.29

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/lib/index.css.br CHANGED
Binary file
package/lib/index.css.gz CHANGED
Binary file
@@ -1 +1 @@
1
- "use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,h)=>{const q=D.ElScrollbar,C=e.resolveComponent("LSButton"),w=x.ElDialog,V=M.vLoading;return e.openBlock(),e.createBlock(w,e.mergeProps({ref_key:"lsDialogRef",ref:d,class:e.unref(y),modelValue:t.value,"onUpdate:modelValue":h[0]||(h[0]=b=>t.value=b)},e.unref(s.default)(e.unref(u),o.$attrs),{"show-close":!o.loading,onClose:g}),e.createSlots({header:e.withCtx(()=>[e.renderSlot(o.$slots,"header")]),default:e.withCtx(()=>[o.openScroll?e.withDirectives((e.openBlock(),e.createBlock(q,e.mergeProps({key:0},e.unref(s.default)(e.unref(u),o.$attrs),{"max-height":e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["max-height"])),[[V,o.contentLoading]]):(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default")]))]),_:2},[o.hasFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",$,[e.unref(v).footer?e.renderSlot(o.$slots,"footer",{key:0}):e.createCommentVNode("",!0),o.hasCancelBtn?(e.openBlock(),e.createBlock(C,e.mergeProps({key:1},e.unref(f),{disabled:o.loading,onClick:g}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f).txt),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.createVNode(C,e.mergeProps(e.unref(m),{loading:o.loading,disabled:o.loading,onClick:B}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m).txt),1)]),_:1},16,["loading","disabled"])])]),key:"0"}:void 0]),1040,["class","modelValue","show-close"])}}});exports.default=E;
1
+ "use strict";var N=Object.defineProperty;var l=(n,a)=>N(n,"name",{value:a,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),_=,/* empty css */k=,/* empty css */s=,/* empty css */D=,/* empty css */x=,/* empty css */M=,/* empty css */P={key:1,class:"content-wrap"},$={class:"dialog-footer"},E=e.defineComponent({name:"LSDialog",inheritAttrs:!1,__name:"Index",props:e.mergeModels(k.lsDialogProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(k.lsEmitNames,["update:modelValue"]),setup(n,{expose:a,emit:S}){const r=n,i=S,v=e.useSlots(),t=e.useModel(n,"modelValue"),y=_.useNamespace("dialog").b(),d=e.ref(),u=e.ref({width:"50%",closeOnClickModal:!1,closeOnPressEscape:!1,zIndex:2e3,alignCenter:!0}),c=e.ref(0);e.watch(()=>t==null?void 0:t.value,o=>{o&&r.openScroll&&p()},{immediate:!0,deep:!0});const f=e.computed(()=>s.default({txt:"取消"},r.btnCancelConfig)),m=e.computed(()=>s.default({type:"primary",txt:"确认"},r.btnConfirmConfig));function g(){t.value=!1,i("onCancel")}l(g,"handleClose");function B(){i("onConfirm")}l(B,"handleConfirm");async function p(){await e.nextTick();const o=r.hasFooter?108:60;c.value=parseInt(getComputedStyle(d.value.querySelector(".el-dialog")).height)-o}return l(p,"updateHeight"),a({updateHeight:p}),(o,C)=>{const q=D.ElScrollbar,h=e.resolveComponent("LSButton"),w=x.ElDialog,V=M.vLoading;return e.openBlock(),e.createBlock(w,e.mergeProps({ref_key:"lsDialogRef",ref:d,class:e.unref(y),modelValue:t.value,"onUpdate:modelValue":C[0]||(C[0]=b=>t.value=b)},e.unref(s.default)(e.unref(u),o.$attrs),{"show-close":!o.loading,onClose:g}),e.createSlots({header:e.withCtx(()=>[e.renderSlot(o.$slots,"header")]),default:e.withCtx(()=>[o.openScroll?e.withDirectives((e.openBlock(),e.createBlock(q,e.mergeProps({key:0},e.unref(s.default)(e.unref(u),o.$attrs),{"max-height":e.unref(c)}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16,["max-height"])),[[V,o.contentLoading]]):(e.openBlock(),e.createElementBlock("div",P,[e.renderSlot(o.$slots,"default")]))]),_:2},[o.hasFooter?{name:"footer",fn:e.withCtx(()=>[e.createElementVNode("div",$,[e.unref(v).footer?e.renderSlot(o.$slots,"footer",{key:0}):e.createCommentVNode("",!0),o.hasCancelBtn?(e.openBlock(),e.createBlock(h,e.mergeProps({key:1},e.unref(f),{disabled:o.loading,onClick:g}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(f).txt),1)]),_:1},16,["disabled"])):e.createCommentVNode("",!0),e.createVNode(h,e.mergeProps(e.unref(m),{loading:o.loading,disabled:o.loading,onClick:B}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(m).txt),1)]),_:1},16,["loading","disabled"])])]),key:"0"}:void 0]),1040,["class","modelValue","show-close"])}}});exports.default=E;
@@ -31,7 +31,8 @@ const oe = {
31
31
  width: "50%",
32
32
  closeOnClickModal: !1,
33
33
  closeOnPressEscape: !1,
34
- zIndex: 2e3
34
+ zIndex: 2e3,
35
+ alignCenter: !0
35
36
  }), C = f(0);
36
37
  q(
37
38
  () => t == null ? void 0 : t.value,
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-fb93ca95"]]);exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */const t=,/* empty css */u=t.default(e.default,[["__scopeId","data-v-a1aa0014"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
- import r from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-fb93ca95"]]);
3
+ import a from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
+ const e = /* @__PURE__ */ a(o, [["__scopeId", "data-v-a1aa0014"]]);
5
5
  export {
6
6
  e as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var x=Object.defineProperty;var l=(a,u)=>x(a,"name",{value:u,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),P=require("../../_hooks/useNamespace/index.cjs"),q=require("../types/index.cjs"),y=require("element-plus"),M=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),L=e.defineComponent({name:"LSPreview",inheritAttrs:!1,__name:"Index",props:e.mergeModels(q.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(a,{emit:u}){const m=u,o=a,{type:r,zoomSize:g}=e.toRefs(o),n=e.useModel(a,"modelValue"),p=e.reactive({zoomSize:g,source:""}),C=P.useNamespace("preview").b(),t=e.shallowRef({image:null,docx:null,xlsx:null,pdf:null}),c=e.ref(),v=e.computed(()=>(r==null?void 0:r.value)&&t.value[r==null?void 0:r.value]),i=e.ref();e.watch(()=>n==null?void 0:n.value,s=>{s&&f()},{immediate:!0,deep:!0}),e.watch(()=>o.source,s=>{p.source=s},{immediate:!0,deep:!0});function f(){switch(i.value="",o.needLoading&&(c.value=y.ElLoading.service(o.loadingOption)),o.type){case"image":t.value.image=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Image.vue/index.cjs")));break;case"docx":t.value.docx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Docx.vue/index.cjs")));break;case"xlsx":t.value.xlsx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Xlsx.vue/index.cjs")));break;case"pdf":t.value.pdf=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Pdf.vue/index.cjs")));break}}l(f,"openLoading");const d=l(()=>{o.needLoading&&c.value&&c.value.close()},"closeLoading"),h=l(()=>{d(),m("loadComplete")},"loadComplete"),k=l(()=>{d(),i.value="文件加载失败,请检查文件是否已损坏!",console.error(i.value),m("loadError")},"loadError");return e.onBeforeMount(()=>{n.value&&o.type&&f()}),e.onBeforeUnmount(()=>{d()}),(s,b)=>n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(C))},[e.unref(v)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(v)),e.mergeProps({key:0},e.unref(M.default)(e.unref(p),s.$attrs),{onLoadComplete:h,onLoadError:k}),null,16)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});exports.default=L;
1
+ "use strict";var k=Object.defineProperty;var l=(a,i)=>k(a,"name",{value:i,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=,/* empty css */P=,/* empty css */y=require("element-plus");;/* empty css */;/* empty css */;/* empty css */const L=,/* empty css */B=,/* empty css */E=e.defineComponent({name:"LSPreview",inheritAttrs:!1,__name:"Index",props:e.mergeModels(P.lsPreviewProp,{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["loadComplete","loadError"],["update:modelValue"]),setup(a,{emit:i}){const d=i,o=a,{type:r,zoomSize:g}=e.toRefs(o),n=e.useModel(a,"modelValue"),p=e.reactive({zoomSize:g,source:""}),C=M.useNamespace("preview").b(),t=e.shallowRef({image:null,docx:null,xlsx:null,pdf:null}),m=e.ref(),f=e.computed(()=>(r==null?void 0:r.value)&&t.value[r==null?void 0:r.value]),q=e.ref("文件加载失败,请检查文件是否已损坏!");let u=null;e.watch(()=>n==null?void 0:n.value,s=>{s&&v()},{immediate:!0,deep:!0}),e.watch(()=>o.source,s=>{p.source=s},{immediate:!0,deep:!0});function v(){switch(o.needLoading&&(m.value=y.ElLoading.service(o.loadingOption)),o.type){case"image":t.value.image=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Image.vue/index.cjs")));break;case"docx":t.value.docx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Docx.vue/index.cjs")));break;case"xlsx":t.value.xlsx=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Xlsx.vue/index.cjs")));break;case"pdf":t.value.pdf=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("../components/Pdf.vue/index.cjs")));break}u=setTimeout(()=>{o.source||(L.ElMessage.error("文件加载超时,请检查文件是否存在!"),c(),n.value=!1),clearTimeout(u)},6e3)}l(v,"openLoading");const c=l(()=>{u&&clearTimeout(u),o.needLoading&&m.value&&m.value.close()},"closeLoading"),x=l(()=>{c(),d("loadComplete")},"loadComplete"),h=l(()=>{c(),console.error(q.value),d("loadError")},"loadError");return e.onBeforeMount(()=>{n.value&&o.type&&v()}),e.onBeforeUnmount(()=>{c()}),(s,w)=>n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(C))},[e.unref(f)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(f)),e.mergeProps({key:0},e.unref(B.default)(e.unref(p),s.$attrs),{onLoadComplete:x,onLoadError:h}),null,16)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)}});exports.default=E;
@@ -1,11 +1,15 @@
1
- var b = Object.defineProperty;
2
- var l = (s, m) => b(s, "name", { value: m, configurable: !0 });
3
- import { defineComponent as y, mergeModels as x, toRefs as P, useModel as z, reactive as A, shallowRef as V, ref as C, computed as _, watch as k, defineAsyncComponent as c, onBeforeMount as I, onBeforeUnmount as N, openBlock as L, createElementBlock as R, normalizeClass as S, unref as n, createBlock as D, resolveDynamicComponent as O, mergeProps as U, createCommentVNode as B } from "vue";
1
+ var y = Object.defineProperty;
2
+ var l = (s, u) => y(s, "name", { value: u, configurable: !0 });
3
+ import { defineComponent as P, mergeModels as x, toRefs as z, useModel as A, reactive as T, shallowRef as V, ref as C, computed as _, watch as k, defineAsyncComponent as i, onBeforeMount as I, onBeforeUnmount as N, openBlock as L, createElementBlock as R, normalizeClass as S, unref as n, createBlock as D, resolveDynamicComponent as O, mergeProps as U, createCommentVNode as E } from "vue";
4
4
  import { useNamespace as $ } from "../../_hooks/useNamespace/index.js";
5
5
  import { lsPreviewProp as j } from "../types/index.js";
6
6
  import { ElLoading as q } from "element-plus";
7
- import F from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
8
- const Y = /* @__PURE__ */ y({
7
+ /* empty css */
8
+ /* empty css */
9
+ /* empty css */
10
+ import { ElMessage as F } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.4.38_typescript@5.5.4_/node_modules/element-plus/es/components/message/index/index.js";
11
+ import G from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
12
+ const ae = /* @__PURE__ */ P({
9
13
  name: "LSPreview",
10
14
  // components: {
11
15
  // LSImage,
@@ -22,20 +26,21 @@ const Y = /* @__PURE__ */ y({
22
26
  modelModifiers: {}
23
27
  }),
24
28
  emits: /* @__PURE__ */ x(["loadComplete", "loadError"], ["update:modelValue"]),
25
- setup(s, { emit: m }) {
26
- const p = m, e = s, { type: o, zoomSize: E } = P(e), r = z(s, "modelValue"), f = A({
27
- zoomSize: E,
29
+ setup(s, { emit: u }) {
30
+ const p = u, e = s, { type: o, zoomSize: M } = z(e), r = A(s, "modelValue"), f = T({
31
+ zoomSize: M,
28
32
  source: ""
29
- }), M = $("preview").b(), a = V({
33
+ }), B = $("preview").b(), t = V({
30
34
  image: null,
31
35
  docx: null,
32
36
  xlsx: null,
33
37
  pdf: null
34
- }), u = C(), v = _(() => (o == null ? void 0 : o.value) && a.value[o == null ? void 0 : o.value]), d = C();
38
+ }), d = C(), v = _(() => (o == null ? void 0 : o.value) && t.value[o == null ? void 0 : o.value]), h = C("文件加载失败,请检查文件是否已损坏!");
39
+ let m = null;
35
40
  k(
36
41
  () => r == null ? void 0 : r.value,
37
- (t) => {
38
- t && g();
42
+ (a) => {
43
+ a && g();
39
44
  },
40
45
  {
41
46
  immediate: !0,
@@ -43,8 +48,8 @@ const Y = /* @__PURE__ */ y({
43
48
  }
44
49
  ), k(
45
50
  () => e.source,
46
- (t) => {
47
- f.source = t;
51
+ (a) => {
52
+ f.source = a;
48
53
  },
49
54
  {
50
55
  immediate: !0,
@@ -52,44 +57,47 @@ const Y = /* @__PURE__ */ y({
52
57
  }
53
58
  );
54
59
  function g() {
55
- switch (d.value = "", e.needLoading && (u.value = q.service(e.loadingOption)), e.type) {
60
+ switch (e.needLoading && (d.value = q.service(e.loadingOption)), e.type) {
56
61
  case "image":
57
- a.value.image = c(() => import("../components/Image.vue/index.js"));
62
+ t.value.image = i(() => import("../components/Image.vue/index.js"));
58
63
  break;
59
64
  case "docx":
60
- a.value.docx = c(() => import("../components/Docx.vue/index.js"));
65
+ t.value.docx = i(() => import("../components/Docx.vue/index.js"));
61
66
  break;
62
67
  case "xlsx":
63
- a.value.xlsx = c(() => import("../components/Xlsx.vue/index.js"));
68
+ t.value.xlsx = i(() => import("../components/Xlsx.vue/index.js"));
64
69
  break;
65
70
  case "pdf":
66
- a.value.pdf = c(() => import("../components/Pdf.vue/index.js"));
71
+ t.value.pdf = i(() => import("../components/Pdf.vue/index.js"));
67
72
  break;
68
73
  }
74
+ m = setTimeout(() => {
75
+ e.source || (F.error("文件加载超时,请检查文件是否存在!"), c(), r.value = !1), clearTimeout(m);
76
+ }, 6e3);
69
77
  }
70
78
  l(g, "openLoading");
71
- const i = /* @__PURE__ */ l(() => {
72
- e.needLoading && u.value && u.value.close();
73
- }, "closeLoading"), h = /* @__PURE__ */ l(() => {
74
- i(), p("loadComplete");
75
- }, "loadComplete"), w = /* @__PURE__ */ l(() => {
76
- i(), d.value = "文件加载失败,请检查文件是否已损坏!", console.error(d.value), p("loadError");
79
+ const c = /* @__PURE__ */ l(() => {
80
+ m && clearTimeout(m), e.needLoading && d.value && d.value.close();
81
+ }, "closeLoading"), w = /* @__PURE__ */ l(() => {
82
+ c(), p("loadComplete");
83
+ }, "loadComplete"), b = /* @__PURE__ */ l(() => {
84
+ c(), console.error(h.value), p("loadError");
77
85
  }, "loadError");
78
86
  return I(() => {
79
87
  r.value && e.type && g();
80
88
  }), N(() => {
81
- i();
82
- }), (t, H) => r.value ? (L(), R("div", {
89
+ c();
90
+ }), (a, J) => r.value ? (L(), R("div", {
83
91
  key: 0,
84
- class: S(n(M))
92
+ class: S(n(B))
85
93
  }, [
86
- n(v) ? (L(), D(O(n(v)), U({ key: 0 }, n(F)(n(f), t.$attrs), {
87
- onLoadComplete: h,
88
- onLoadError: w
89
- }), null, 16)) : B("", !0)
90
- ], 2)) : B("", !0);
94
+ n(v) ? (L(), D(O(n(v)), U({ key: 0 }, n(G)(n(f), a.$attrs), {
95
+ onLoadComplete: w,
96
+ onLoadError: b
97
+ }), null, 16)) : E("", !0)
98
+ ], 2)) : E("", !0);
91
99
  }
92
100
  });
93
101
  export {
94
- Y as default
102
+ ae as default
95
103
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingshugroup/web-plus",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "零数科技前端UI组件库(Vue3)",
5
5
  "type": "module",
6
6
  "main": "./lib/index/index.cjs",