@lingshugroup/web-plus 1.7.9 → 1.7.11

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.
Files changed (43) hide show
  1. package/lib/index.css +1 -1
  2. package/lib/index.css.br +0 -0
  3. package/lib/index.css.gz +0 -0
  4. package/lib/packages/ls-components/components/chart/config/template/bar/index.cjs +1 -1
  5. package/lib/packages/ls-components/components/chart/config/template/bar/index.js +89 -65
  6. package/lib/packages/ls-components/components/chart/config/template/bar/index.js.br +0 -0
  7. package/lib/packages/ls-components/components/chart/config/template/bar/index.js.gz +0 -0
  8. package/lib/packages/ls-components/components/chart/config/template/line/index.cjs +1 -1
  9. package/lib/packages/ls-components/components/chart/config/template/line/index.js +102 -85
  10. package/lib/packages/ls-components/components/chart/config/template/line/index.js.br +0 -0
  11. package/lib/packages/ls-components/components/chart/config/template/line/index.js.gz +0 -0
  12. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.cjs +1 -1
  13. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.js +2 -2
  14. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.cjs +1 -1
  15. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js +64 -63
  16. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.br +0 -0
  17. package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.gz +0 -0
  18. package/lib/packages/ls-components/components/preview_pdf/composable/index.cjs +1 -1
  19. package/lib/packages/ls-components/components/preview_pdf/composable/index.js +68 -66
  20. package/lib/packages/ls-components/components/preview_pdf/composable/index.js.br +0 -0
  21. package/lib/packages/ls-components/components/preview_pdf/composable/index.js.gz +0 -0
  22. package/lib/packages/ls-components/components/tooltip/Index.vue/index.cjs +1 -1
  23. package/lib/packages/ls-components/components/tooltip/Index.vue/index.js +2 -2
  24. package/lib/packages/ls-components/components/tooltip/Index.vue/index2.cjs +1 -1
  25. package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js +25 -25
  26. package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.br +0 -0
  27. package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.gz +0 -0
  28. package/lib/packages/ls-components/components/tree/Index.vue/index.cjs +1 -1
  29. package/lib/packages/ls-components/components/tree/Index.vue/index.js +2 -2
  30. package/lib/packages/ls-components/components/tree/Index.vue/index2.cjs +1 -1
  31. package/lib/packages/ls-components/components/tree/Index.vue/index2.js +35 -31
  32. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.br +0 -0
  33. package/lib/packages/ls-components/components/tree/Index.vue/index2.js.gz +0 -0
  34. package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
  35. package/lib/packages/ls-components/components/upload/Index.vue/index.js +2 -2
  36. package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
  37. package/lib/packages/ls-components/components/upload/Index.vue/index2.js +2 -2
  38. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
  39. package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
  40. package/lib/types/components/chart/types.d.ts +2 -0
  41. package/lib/types/components/preview_pdf/Pdf.vue.d.ts +1 -0
  42. package/lib/types/components/preview_pdf/composable.d.ts +1 -1
  43. package/package.json +1 -1
@@ -1,36 +1,44 @@
1
- var $ = Object.defineProperty;
2
- var p = (o, e) => $(o, "name", { value: e, configurable: !0 });
3
- import { numberFixed as C, formatChartAxis as I } from "../../../../_utils/utils/index.js";
4
- import { BG_COLOR_MAP as k, DEF_THEME as l, BAR_COLOR_MAP as _, TOOLTIP_COLOR_MAP as S, FONT_COLOR_MAP as v, BG_BAR_COLOR_MAP as L, SPLIT_LINE_COLOR as w } from "../../base/index.js";
5
- const D = /* @__PURE__ */ p((o, e, t, n, a) => {
6
- const { name: s, seriesName: i, value: r, color: u } = o, d = n == 0 ? `<div class="name">${s}</div>` : "", y = e && r !== "-" && i !== "temp" ? `<span class="serise-name">${e ? i : ""}</span>` : "", c = r !== "-" && i !== "temp" ? `<span class="value">${r || r == 0 ? r : "-"}</span>` : "", m = r !== "-" && i !== "temp" ? `<div class="content-badge ${t}" style="background-color: ${typeof u == "string" ? u : a};"></div>` : "";
7
- return ` ${d} <div class="content"> <div class="serise-wrap"> ${m} ${y} </div> ${c} </div> `;
8
- }, "setTooltipFormat"), R = /* @__PURE__ */ p((o) => {
9
- let { legend: e, legendIcon: t, tooltip: n = "shadow", theme: a, tooltipFormatter: s, barColorList: i } = o;
10
- const r = i || _[a || l][0];
11
- return s = s || function(u) {
12
- let d = `<div class="ls-bar-tooltip-wrap ${a}">`;
13
- return u.forEach((y, c) => {
14
- d += D(y, !!e, t, c, r);
15
- }), d + "</div>";
1
+ var M = Object.defineProperty;
2
+ var f = (o, e) => M(o, "name", { value: e, configurable: !0 });
3
+ import { numberFixed as A, formatChartAxis as $ } from "../../../../_utils/utils/index.js";
4
+ import { BG_COLOR_MAP as k, DEF_THEME as l, BAR_COLOR_MAP as I, TOOLTIP_COLOR_MAP as O, FONT_COLOR_MAP as w, BG_BAR_COLOR_MAP as _, SPLIT_LINE_COLOR as C } from "../../base/index.js";
5
+ const D = /* @__PURE__ */ f((o, e, t, n, r, a, m) => {
6
+ const { name: c, seriesName: u, value: s, color: p } = o, i = n == 0 ? `<div class="name">${c}</div>` : "", d = e && s !== "-" && u !== "temp" ? `<span class="serise-name">${e ? u : ""}</span>` : "", h = s !== "-" && u !== "temp" ? `<span class="value">${a ? a(s, m) : s || s == 0 ? s : "-"}</span>` : "", x = s !== "-" && u !== "temp" ? `<div class="content-badge ${t}" style="background-color: ${typeof p == "string" ? p : r};"></div>` : "";
7
+ return ` ${i} <div class="content"> <div class="serise-wrap"> ${x} ${d} </div> ${h} </div> `;
8
+ }, "setTooltipFormat"), R = /* @__PURE__ */ f((o) => {
9
+ let { legend: e, legendIcon: t, tooltip: n = "shadow", theme: r, tooltipFormatter: a, barColorList: m, tooltipValueFormatter: c } = o;
10
+ const u = m || I[r || l][0];
11
+ return a = a || function(s) {
12
+ let p = `<div class="ls-bar-tooltip-wrap ${r}">`;
13
+ return s.forEach((i, d) => {
14
+ p += D(
15
+ i,
16
+ !!e,
17
+ t,
18
+ d,
19
+ u,
20
+ c,
21
+ i.dataIndex
22
+ );
23
+ }), p + "</div>";
16
24
  }, n ? {
17
25
  trigger: "axis",
18
26
  axisPointer: {
19
27
  type: n,
20
28
  z: 1,
21
29
  label: {
22
- color: S[a || l].color
30
+ color: O[r || l].color
23
31
  }
24
32
  },
25
33
  textStyle: {
26
- color: v[a || l]
34
+ color: w[r || l]
27
35
  },
28
36
  padding: 12,
29
- backgroundColor: S[a || l].bgColor,
30
- extraCssText: `box-shadow: ${S[a || l].shadowColor};`,
31
- formatter: s
37
+ backgroundColor: O[r || l].bgColor,
38
+ extraCssText: `box-shadow: ${O[r || l].shadowColor};`,
39
+ formatter: a
32
40
  } : null;
33
- }, "setTooltip"), H = /* @__PURE__ */ p((o) => {
41
+ }, "setTooltip"), F = /* @__PURE__ */ f((o) => {
34
42
  const { legend: e, legendIcon: t = "rect", theme: n } = o;
35
43
  return {
36
44
  type: "scroll",
@@ -39,7 +47,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
39
47
  itemWidth: 12,
40
48
  itemHeight: 10,
41
49
  textStyle: {
42
- color: v[n || l],
50
+ color: w[n || l],
43
51
  fontSize: 12,
44
52
  height: 10,
45
53
  rich: {
@@ -49,7 +57,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
49
57
  }
50
58
  }
51
59
  };
52
- }, "setLegend"), F = /* @__PURE__ */ p((o) => {
60
+ }, "setLegend"), H = /* @__PURE__ */ f((o) => {
53
61
  const { dataZoom: e } = o, t = {
54
62
  left: "3%",
55
63
  right: "3%",
@@ -58,19 +66,19 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
58
66
  containLabel: !0
59
67
  };
60
68
  return e === "vertical" && delete t.right, e === "horizontal" && delete t.bottom, t;
61
- }, "setGrid"), A = /* @__PURE__ */ p((o, e, t) => {
62
- const { axisData: n, seriesData: a } = o, { axis: s = "x", theme: i, lineBar: r, dynamicAxis: u, type: d } = e;
63
- let y = [
69
+ }, "setGrid"), B = /* @__PURE__ */ f((o, e, t) => {
70
+ const { axisData: n, seriesData: r } = o, { axis: a = "x", theme: m, lineBar: c, dynamicAxis: u, type: s } = e;
71
+ let p = [
64
72
  {
65
- type: s == t ? "category" : "value",
73
+ type: a == t ? "category" : "value",
66
74
  axisTick: {
67
75
  show: !1
68
76
  },
69
77
  axisLine: {
70
- show: s == t,
78
+ show: a == t,
71
79
  lineStyle: {
72
80
  width: 1,
73
- color: v[i || l]
81
+ color: w[m || l]
74
82
  }
75
83
  },
76
84
  axisLabel: {
@@ -79,19 +87,19 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
79
87
  splitLine: {
80
88
  lineStyle: {
81
89
  type: "dashed",
82
- color: w[i || l]
90
+ color: C[m || l]
83
91
  }
84
92
  },
85
- data: s == t ? n : []
93
+ data: a == t ? n : []
86
94
  }
87
95
  ];
88
- if (s !== t && (r && (y = s == "x" ? [
96
+ if (a !== t && (c && (p = a == "x" ? [
89
97
  {
90
98
  type: "value",
91
99
  splitLine: {
92
100
  show: !1,
93
101
  lineStyle: {
94
- color: w[i || l]
102
+ color: C[m || l]
95
103
  }
96
104
  }
97
105
  },
@@ -99,7 +107,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
99
107
  type: "value",
100
108
  splitLine: {
101
109
  lineStyle: {
102
- color: w[i || l],
110
+ color: C[m || l],
103
111
  type: "dashed",
104
112
  width: 2,
105
113
  dashOffset: 2
@@ -111,17 +119,17 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
111
119
  type: "value"
112
120
  }
113
121
  ]), u)) {
114
- let c = [];
115
- d === "multiple" && (!r || s == "y" && r) && (c = (a || []).reduce((m, f) => m.concat(f.data), [])), y.map((m, f) => {
116
- var O;
117
- d === "multiple" ? r && s == "x" && (c = (((O = (a || [])[f]) == null ? void 0 : O.data) || []).map((g) => C(g))) : c = (a || []).map((g) => C(g)), c = c.filter((g) => g > 0);
118
- const h = Math.max(...c), b = Math.min(...c), { aInterval: x, aMax: B, aMin: M } = I(h, b);
119
- return m.min = M, m.max = B, m.interval = x, m;
122
+ let i = [];
123
+ s === "multiple" && (!c || a == "y" && c) && (i = (r || []).reduce((d, h) => d.concat(h.data), [])), p.map((d, h) => {
124
+ var b;
125
+ s === "multiple" ? c && a == "x" && (i = (((b = (r || [])[h]) == null ? void 0 : b.data) || []).map((S) => A(S))) : i = (r || []).map((S) => A(S)), i = i.filter((S) => S > 0);
126
+ const x = Math.max(...i), y = Math.min(...i), { aInterval: g, aMax: v, aMin: L } = $(x, y);
127
+ return d.min = L, d.max = v, d.interval = g, d;
120
128
  });
121
129
  }
122
- return y;
123
- }, "setAxis"), T = /* @__PURE__ */ p((o) => {
124
- const { dataZoom: e, dataZoomColorOut: t, dataZoomColorIn: n, theme: a } = o;
130
+ return p;
131
+ }, "setAxis"), T = /* @__PURE__ */ f((o) => {
132
+ const { dataZoom: e, dataZoomColorOut: t, dataZoomColorIn: n, theme: r } = o;
125
133
  return e ? [
126
134
  {
127
135
  show: !0,
@@ -143,7 +151,7 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
143
151
  // },
144
152
  // borderColor: null,
145
153
  textStyle: {
146
- color: v[a || l]
154
+ color: w[r || l]
147
155
  }
148
156
  },
149
157
  {
@@ -159,79 +167,88 @@ const D = /* @__PURE__ */ p((o, e, t, n, a) => {
159
167
  showDataShadow: !0
160
168
  }
161
169
  ] : null;
162
- }, "setDataZoom"), Z = /* @__PURE__ */ p((o, e) => {
170
+ }, "setDataZoom"), Z = /* @__PURE__ */ f((o, e) => {
163
171
  const { seriesData: t } = o, {
164
172
  type: n = "simple",
165
- showBarFont: a = !0,
166
- labelPosition: s = "inside",
167
- smooth: i = !0,
168
- areaStyle: r = void 0,
173
+ showBarFont: r = !0,
174
+ labelPosition: a = "inside",
175
+ smooth: m = !0,
176
+ areaStyle: c = void 0,
169
177
  showBackground: u,
170
- theme: d,
171
- name: y,
172
- lineBar: c,
173
- axis: m,
174
- symbol: f = "circle"
178
+ theme: s,
179
+ name: p,
180
+ lineBar: i,
181
+ axis: d,
182
+ symbol: h = "circle",
183
+ seriesLabelFormatter: x
175
184
  } = e;
176
- return n === "multiple" ? (t || []).map((h, b) => {
177
- const x = {
178
- name: h.name,
179
- type: h.type,
180
- symbol: f,
181
- emphasis: h.emphasis || {
185
+ return n === "multiple" ? (t || []).map((y, g) => {
186
+ const v = {
187
+ name: y.name,
188
+ type: y.type,
189
+ symbol: h,
190
+ emphasis: y.emphasis || {
182
191
  focus: "series"
183
192
  },
184
- smooth: i,
185
- areaStyle: r || null,
193
+ smooth: m,
194
+ areaStyle: c || null,
186
195
  label: {
187
- show: a,
188
- position: s
196
+ show: r,
197
+ position: a,
198
+ formatter: x || function(L) {
199
+ const b = L.value;
200
+ return b !== 0 ? b : "";
201
+ }
189
202
  },
190
203
  showBackground: u,
191
204
  backgroundStyle: {
192
- color: L[d || l]
205
+ color: _[s || l]
193
206
  },
194
- itemStyle: h.itemStyle || {},
195
- data: h.data || []
207
+ itemStyle: y.itemStyle || {},
208
+ data: y.data || []
196
209
  };
197
- return c && (m !== "y" && b === 1 ? x.yAxisIndex = b : x.yAxisIndex && delete x.yAxisIndex), x;
210
+ return i && (d !== "y" && g === 1 ? v.yAxisIndex = g : v.yAxisIndex && delete v.yAxisIndex), v;
198
211
  }) : [
199
212
  {
200
- name: y,
213
+ name: p,
201
214
  label: {
202
- show: a,
203
- position: s
215
+ show: r,
216
+ position: a,
217
+ formatter: x || function(y) {
218
+ const g = y.value;
219
+ return g !== 0 ? g : "";
220
+ }
204
221
  },
205
222
  showBackground: u,
206
223
  backgroundStyle: {
207
- color: L[d || l]
224
+ color: _[s || l]
208
225
  },
209
226
  data: t || [],
210
- smooth: i,
211
- symbol: f,
227
+ smooth: m,
228
+ symbol: h,
212
229
  // 设置填充透明度
213
- areaStyle: r || null,
230
+ areaStyle: c || null,
214
231
  type: "line"
215
232
  }
216
233
  ];
217
- }, "setSeries"), E = /* @__PURE__ */ p((o, e) => {
218
- const { theme: t, barColorList: n } = e, a = {
234
+ }, "setSeries"), E = /* @__PURE__ */ f((o, e) => {
235
+ const { theme: t, barColorList: n } = e, r = {
219
236
  textStyle: {},
220
237
  backgroundColor: k[t || l],
221
- color: n || _[t || l],
222
- legend: H(e),
223
- grid: F(e),
224
- xAxis: A(o, e, "x"),
225
- yAxis: A(o, e, "y"),
238
+ color: n || I[t || l],
239
+ legend: F(e),
240
+ grid: H(e),
241
+ xAxis: B(o, e, "x"),
242
+ yAxis: B(o, e, "y"),
226
243
  series: Z(o, e),
227
244
  dataZoom: T(e)
228
- }, s = R(e);
229
- return s && (a.tooltip = s), a;
245
+ }, a = R(e);
246
+ return a && (r.tooltip = a), r;
230
247
  }, "setOption");
231
248
  function P(o = {}, e = {}) {
232
249
  return E(o, e);
233
250
  }
234
- p(P, "dealOption");
251
+ f(P, "dealOption");
235
252
  export {
236
253
  P as dealOption
237
254
  };
@@ -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-4bd2bd33"]]);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-083051d7"]]);exports.default=u;
@@ -1,7 +1,7 @@
1
1
  import o from "./index2.js";
2
2
  /* empty css */
3
3
  import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4bd2bd33"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-083051d7"]]);
5
5
  export {
6
- m as default
6
+ p as default
7
7
  };
@@ -1 +1 @@
1
- "use strict";var D=Object.defineProperty;var n=(p,m)=>D(p,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),T=,/* empty css */$=,/* empty css */E=,/* empty css */I=,/* empty css */M=,/* empty css */F={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},A={key:1,class:"size-wrap"},G={class:"num-wrap"},H={class:"pdf-content"},J={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},K=["infinite-scroll-disabled"],Q=e.defineComponent({name:"LSPdf"}),R=e.defineComponent({...Q,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=T.useNamespace("pdf"),B=v.b(),_=e.ref(void 0),l=e.ref(1),a=e.ref(0),t=e.ref(1),i=e.ref(!0),C=e.ref(!1),c=p,k=m;e.watch(()=>c.source,()=>{b()},{immediate:!0,deep:!0});const V=e.computed(()=>i.value?"取消分页":"分页展示");async function b(){if(c.source)try{const{pdf:r,processLoadingTask:o,pages:s}=$.usePDF(c.source,{onError:d});await o(c.source),_.value=r.value,a.value=s.value,g()}catch{d()}finally{C.value=!0}}n(b,"initPdf");const h=n(()=>{C.value=!1,c.onClose&&c.onClose(),k("update:source")},"closeFunc");function w(){l.value>1&&l.value--}n(w,"prevPdf");function P(){l.value<a.value&&l.value++}n(P,"nextPdf");function N(r){r===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}n(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),S=n(()=>{if(u.value>=a.value){y.value=!0;return}u.value++},"load");function L(){i.value=!i.value,i.value||(y.value=!1,u.value=a.value>10?10:a.value)}n(L,"changePagition");function g(){k("loadComplete")}n(g,"loadComplete");function d(){k("loadError")}return n(d,"loadError"),(r,o)=>{const s=e.resolveComponent("LSButton"),x=e.resolveComponent("LSIcon"),z=I.ElScrollbar,q=M.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(B))},[e.createElementVNode("div",F,[e.unref(i)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(s,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:w},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("上一页")])),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(a)),1),e.createVNode(s,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(a),onClick:P},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("下一页")])),_:1},8,["disabled"])])):e.createCommentVNode("",!0),r.showSize?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(s,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:o[0]||(o[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",G,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(s,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:o[1]||(o[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(s,{type:"primary",size:"small",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:h},[e.createVNode(x,{name:"Close",size:26})],2)]),e.createElementVNode("div",H,[e.unref(i)?(e.openBlock(),e.createBlock(E.default,e.mergeProps({key:0},r.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(z,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(y),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"infinite-list-item"},[e.createVNode(E.default,e.mergeProps({ref_for:!0},r.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,K)),[[q,S]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=R;
1
+ "use strict";var D=Object.defineProperty;var n=(p,m)=>D(p,"name",{value:m,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});;/* empty css */;/* empty css */;/* empty css */const e=require("vue"),M=,/* empty css */T=,/* empty css */h=,/* empty css */$=,/* empty css */I=,/* empty css */F={class:"opt-wrap"},j={key:0,class:"page-wrap"},O={class:"num-wrap"},U={key:1,class:"size-wrap"},A={class:"num-wrap"},G={class:"pdf-content"},H={key:1,class:"infinite-list-wrapper",style:{overflow:"auto"}},J=["infinite-scroll-disabled"],K=e.defineComponent({name:"LSPdf"}),Q=e.defineComponent({...K,props:{source:{},onClose:{},showSize:{type:Boolean,default:!0},cMapUrlPath:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(p,{emit:m}){const v=M.useNamespace("pdf"),E=v.b(),_=e.ref(void 0),l=e.ref(1),a=e.ref(0),t=e.ref(1),c=e.ref(!0),C=e.ref(!1),r=p,k=m;e.watch(()=>r.source,()=>{V()},{immediate:!0,deep:!0});const B=e.computed(()=>c.value?"取消分页":"分页展示");async function V(){if(r.source)try{const{pdf:s,processLoadingTask:o,pages:i}=T.usePDF(r.source,r.cMapUrlPath,{onError:d});await o(r.source),_.value=s.value,a.value=i.value,g()}catch{d()}finally{C.value=!0}}n(V,"initPdf");const b=n(()=>{C.value=!1,r.onClose&&r.onClose(),k("update:source")},"closeFunc");function P(){l.value>1&&l.value--}n(P,"prevPdf");function w(){l.value<a.value&&l.value++}n(w,"nextPdf");function N(s){s===0?t.value=t.value>.25?t.value-.25:t.value:t.value=t.value<2?t.value+.25:t.value}n(N,"scalePdf");const y=e.ref(!1),u=e.ref(0),S=n(()=>{if(u.value>=a.value){y.value=!0;return}u.value++},"load");function L(){c.value=!c.value,c.value||(y.value=!1,u.value=a.value>10?10:a.value)}n(L,"changePagition");function g(){k("loadComplete")}n(g,"loadComplete");function d(){k("loadError")}return n(d,"loadError"),(s,o)=>{const i=e.resolveComponent("LSButton"),x=e.resolveComponent("LSIcon"),z=$.ElScrollbar,q=I.ElInfiniteScroll;return e.unref(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(E))},[e.createElementVNode("div",F,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==1,onClick:P},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("上一页")])),_:1},8,["disabled"]),e.createElementVNode("span",O,e.toDisplayString(e.unref(l))+" / "+e.toDisplayString(e.unref(a)),1),e.createVNode(i,{type:"primary",size:"small",disabled:e.unref(l)==e.unref(a),onClick:w},{default:e.withCtx(()=>o[3]||(o[3]=[e.createTextVNode("下一页")])),_:1},8,["disabled"])])):e.createCommentVNode("",!0),s.showSize?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(i,{type:"primary",icon:"Minus",size:"small",disabled:e.unref(t)==.25,onClick:o[0]||(o[0]=f=>N(0))},null,8,["disabled"]),e.createElementVNode("span",A,e.toDisplayString(e.unref(t)*100)+"%",1),e.createVNode(i,{type:"primary",icon:"Plus",size:"small",disabled:e.unref(t)==2,onClick:o[1]||(o[1]=f=>N(1))},null,8,["disabled"])])):e.createCommentVNode("",!0),e.createVNode(i,{type:"primary",size:"small",onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)),1)]),_:1}),e.createElementVNode("span",{class:e.normalizeClass([e.unref(v).e("btn"),e.unref(v).e("close")]),onClick:b},[e.createVNode(x,{name:"Close",size:26})],2)]),e.createElementVNode("div",G,[e.unref(c)?(e.openBlock(),e.createBlock(h.default,e.mergeProps({key:0},s.$attrs,{pdf:e.unref(_),page:e.unref(l),scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])):(e.openBlock(),e.createElementBlock("div",H,[e.createVNode(z,{height:"calc(100vh - 48px)"},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createElementBlock("ul",{"infinite-scroll-disabled":e.unref(y),class:"infinite-list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),f=>(e.openBlock(),e.createElementBlock("li",{key:f,class:"infinite-list-item"},[e.createVNode(h.default,e.mergeProps({ref_for:!0},s.$attrs,{pdf:e.unref(_),page:f,scale:e.unref(t),onLoadComplete:g,onLoadError:d}),null,16,["pdf","page","scale"])]))),128))],8,J)),[[q,S]])]),_:1})]))])],2)):e.createCommentVNode("",!0)}}});exports.default=Q;
@@ -1,15 +1,15 @@
1
- var Q = Object.defineProperty;
2
- var l = (k, b) => Q(k, "name", { value: b, configurable: !0 });
1
+ var K = Object.defineProperty;
2
+ var l = (h, k) => K(h, "name", { value: k, configurable: !0 });
3
3
  /* empty css */
4
4
  /* empty css */
5
5
  /* empty css */
6
- import { defineComponent as F, ref as a, watch as R, computed as U, resolveComponent as N, unref as e, openBlock as n, createElementBlock as d, normalizeClass as $, createElementVNode as m, createVNode as i, withCtx as C, createTextVNode as S, toDisplayString as g, createCommentVNode as x, createBlock as W, mergeProps as V, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
6
+ import { defineComponent as D, ref as s, watch as Q, computed as R, resolveComponent as N, unref as e, openBlock as n, createElementBlock as p, normalizeClass as $, createElementVNode as m, createVNode as i, withCtx as C, createTextVNode as S, toDisplayString as g, createCommentVNode as x, createBlock as W, mergeProps as M, withDirectives as X, Fragment as Y, renderList as Z } from "vue";
7
7
  import { useNamespace as ee } from "../../_hooks/useNamespace/index.js";
8
8
  import { usePDF as oe } from "../composable/index.js";
9
- import D from "../pdfs/PdfItem.vue/index.js";
9
+ import V from "../pdfs/PdfItem.vue/index.js";
10
10
  import { ElScrollbar as te } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/scrollbar/index/index.js";
11
11
  import { ElInfiniteScroll as le } from "../../../../../node_modules/.pnpm/element-plus@2.8.1_vue@3.5.13_typescript@5.5.4_/node_modules/element-plus/es/components/infinite-scroll/index/index.js";
12
- const se = { class: "opt-wrap" }, ae = {
12
+ const ae = { class: "opt-wrap" }, se = {
13
13
  key: 0,
14
14
  class: "page-wrap"
15
15
  }, ne = { class: "num-wrap" }, ie = {
@@ -19,69 +19,70 @@ const se = { class: "opt-wrap" }, ae = {
19
19
  key: 1,
20
20
  class: "infinite-list-wrapper",
21
21
  style: { overflow: "auto" }
22
- }, de = ["infinite-scroll-disabled"], pe = F({
22
+ }, de = ["infinite-scroll-disabled"], pe = D({
23
23
  name: "LSPdf"
24
- }), we = /* @__PURE__ */ F({
24
+ }), we = /* @__PURE__ */ D({
25
25
  ...pe,
26
26
  props: {
27
27
  source: {},
28
28
  onClose: {},
29
- showSize: { type: Boolean, default: !0 }
29
+ showSize: { type: Boolean, default: !0 },
30
+ cMapUrlPath: {}
30
31
  },
31
32
  emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
32
- setup(k, { emit: b }) {
33
- const h = ee("pdf"), I = h.b(), w = a(void 0), s = a(1), r = a(0), o = a(1), p = a(!0), L = a(!1), f = k, P = b;
34
- R(
35
- () => f.source,
33
+ setup(h, { emit: k }) {
34
+ const b = ee("pdf"), F = b.b(), w = s(void 0), a = s(1), r = s(0), o = s(1), f = s(!0), L = s(!1), c = h, P = k;
35
+ Q(
36
+ () => c.source,
36
37
  () => {
37
- M();
38
+ T();
38
39
  },
39
40
  {
40
41
  immediate: !0,
41
42
  deep: !0
42
43
  }
43
44
  );
44
- const T = U(() => p.value ? "取消分页" : "分页展示");
45
- async function M() {
46
- if (f.source)
45
+ const I = R(() => f.value ? "取消分页" : "分页展示");
46
+ async function T() {
47
+ if (c.source)
47
48
  try {
48
- const { pdf: c, processLoadingTask: t, pages: u } = oe(f.source, {
49
+ const { pdf: u, processLoadingTask: t, pages: d } = oe(c.source, c.cMapUrlPath, {
49
50
  onError: _
50
51
  });
51
- await t(f.source), w.value = c.value, r.value = u.value, E();
52
+ await t(c.source), w.value = u.value, r.value = d.value, E();
52
53
  } catch {
53
54
  _();
54
55
  } finally {
55
56
  L.value = !0;
56
57
  }
57
58
  }
58
- l(M, "initPdf");
59
- const j = /* @__PURE__ */ l(() => {
60
- L.value = !1, f.onClose && f.onClose(), P("update:source");
59
+ l(T, "initPdf");
60
+ const U = /* @__PURE__ */ l(() => {
61
+ L.value = !1, c.onClose && c.onClose(), P("update:source");
61
62
  }, "closeFunc");
62
- function O() {
63
- s.value > 1 && s.value--;
63
+ function j() {
64
+ a.value > 1 && a.value--;
64
65
  }
65
- l(O, "prevPdf");
66
- function q() {
67
- s.value < r.value && s.value++;
66
+ l(j, "prevPdf");
67
+ function O() {
68
+ a.value < r.value && a.value++;
68
69
  }
69
- l(q, "nextPdf");
70
- function B(c) {
71
- c === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
70
+ l(O, "nextPdf");
71
+ function B(u) {
72
+ u === 0 ? o.value = o.value > 0.25 ? o.value - 0.25 : o.value : o.value = o.value < 2 ? o.value + 0.25 : o.value;
72
73
  }
73
74
  l(B, "scalePdf");
74
- const z = a(!1), v = a(0), A = /* @__PURE__ */ l(() => {
75
+ const z = s(!1), v = s(0), q = /* @__PURE__ */ l(() => {
75
76
  if (v.value >= r.value) {
76
77
  z.value = !0;
77
78
  return;
78
79
  }
79
80
  v.value++;
80
81
  }, "load");
81
- function G() {
82
- p.value = !p.value, p.value || (z.value = !1, v.value = r.value > 10 ? 10 : r.value);
82
+ function A() {
83
+ f.value = !f.value, f.value || (z.value = !1, v.value = r.value > 10 ? 10 : r.value);
83
84
  }
84
- l(G, "changePagition");
85
+ l(A, "changePagition");
85
86
  function E() {
86
87
  P("loadComplete");
87
88
  }
@@ -89,31 +90,31 @@ const se = { class: "opt-wrap" }, ae = {
89
90
  function _() {
90
91
  P("loadError");
91
92
  }
92
- return l(_, "loadError"), (c, t) => {
93
- const u = N("LSButton"), H = N("LSIcon"), J = te, K = le;
94
- return e(L) ? (n(), d("div", {
93
+ return l(_, "loadError"), (u, t) => {
94
+ const d = N("LSButton"), G = N("LSIcon"), H = te, J = le;
95
+ return e(L) ? (n(), p("div", {
95
96
  key: 0,
96
- class: $(e(I))
97
+ class: $(e(F))
97
98
  }, [
98
- m("div", se, [
99
- e(p) ? (n(), d("div", ae, [
100
- i(u, {
99
+ m("div", ae, [
100
+ e(f) ? (n(), p("div", se, [
101
+ i(d, {
101
102
  type: "primary",
102
103
  size: "small",
103
- disabled: e(s) == 1,
104
- onClick: O
104
+ disabled: e(a) == 1,
105
+ onClick: j
105
106
  }, {
106
107
  default: C(() => t[2] || (t[2] = [
107
108
  S("上一页")
108
109
  ])),
109
110
  _: 1
110
111
  }, 8, ["disabled"]),
111
- m("span", ne, g(e(s)) + " / " + g(e(r)), 1),
112
- i(u, {
112
+ m("span", ne, g(e(a)) + " / " + g(e(r)), 1),
113
+ i(d, {
113
114
  type: "primary",
114
115
  size: "small",
115
- disabled: e(s) == e(r),
116
- onClick: q
116
+ disabled: e(a) == e(r),
117
+ onClick: O
117
118
  }, {
118
119
  default: C(() => t[3] || (t[3] = [
119
120
  S("下一页")
@@ -121,8 +122,8 @@ const se = { class: "opt-wrap" }, ae = {
121
122
  _: 1
122
123
  }, 8, ["disabled"])
123
124
  ])) : x("", !0),
124
- c.showSize ? (n(), d("div", ie, [
125
- i(u, {
125
+ u.showSize ? (n(), p("div", ie, [
126
+ i(d, {
126
127
  type: "primary",
127
128
  icon: "Minus",
128
129
  size: "small",
@@ -130,7 +131,7 @@ const se = { class: "opt-wrap" }, ae = {
130
131
  onClick: t[0] || (t[0] = (y) => B(0))
131
132
  }, null, 8, ["disabled"]),
132
133
  m("span", re, g(e(o) * 100) + "%", 1),
133
- i(u, {
134
+ i(d, {
134
135
  type: "primary",
135
136
  icon: "Plus",
136
137
  size: "small",
@@ -138,45 +139,45 @@ const se = { class: "opt-wrap" }, ae = {
138
139
  onClick: t[1] || (t[1] = (y) => B(1))
139
140
  }, null, 8, ["disabled"])
140
141
  ])) : x("", !0),
141
- i(u, {
142
+ i(d, {
142
143
  type: "primary",
143
144
  size: "small",
144
- onClick: G
145
+ onClick: A
145
146
  }, {
146
147
  default: C(() => [
147
- S(g(e(T)), 1)
148
+ S(g(e(I)), 1)
148
149
  ]),
149
150
  _: 1
150
151
  }),
151
152
  m("span", {
152
- class: $([e(h).e("btn"), e(h).e("close")]),
153
- onClick: j
153
+ class: $([e(b).e("btn"), e(b).e("close")]),
154
+ onClick: U
154
155
  }, [
155
- i(H, {
156
+ i(G, {
156
157
  name: "Close",
157
158
  size: 26
158
159
  })
159
160
  ], 2)
160
161
  ]),
161
162
  m("div", ce, [
162
- e(p) ? (n(), W(D, V({ key: 0 }, c.$attrs, {
163
+ e(f) ? (n(), W(V, M({ key: 0 }, u.$attrs, {
163
164
  pdf: e(w),
164
- page: e(s),
165
+ page: e(a),
165
166
  scale: e(o),
166
167
  onLoadComplete: E,
167
168
  onLoadError: _
168
- }), null, 16, ["pdf", "page", "scale"])) : (n(), d("div", ue, [
169
- i(J, { height: "calc(100vh - 48px)" }, {
169
+ }), null, 16, ["pdf", "page", "scale"])) : (n(), p("div", ue, [
170
+ i(H, { height: "calc(100vh - 48px)" }, {
170
171
  default: C(() => [
171
- X((n(), d("ul", {
172
+ X((n(), p("ul", {
172
173
  "infinite-scroll-disabled": e(z),
173
174
  class: "infinite-list"
174
175
  }, [
175
- (n(!0), d(Y, null, Z(e(v), (y) => (n(), d("li", {
176
+ (n(!0), p(Y, null, Z(e(v), (y) => (n(), p("li", {
176
177
  key: y,
177
178
  class: "infinite-list-item"
178
179
  }, [
179
- i(D, V({ ref_for: !0 }, c.$attrs, {
180
+ i(V, M({ ref_for: !0 }, u.$attrs, {
180
181
  pdf: e(w),
181
182
  page: y,
182
183
  scale: e(o),
@@ -185,7 +186,7 @@ const se = { class: "opt-wrap" }, ae = {
185
186
  }), null, 16, ["pdf", "page", "scale"])
186
187
  ]))), 128))
187
188
  ], 8, de)), [
188
- [K, A]
189
+ [J, q]
189
190
  ])
190
191
  ]),
191
192
  _: 1
@@ -1 +1 @@
1
- "use strict";var F=Object.defineProperty;var c=(s,r)=>F(s,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("pdfjs-dist"),N=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),h=require("../pdfs/destination/index.cjs"),L=require("../pdfs/miscellaneous/index.cjs");function O(s){P.GlobalWorkerOptions.workerSrc=s}c(O,"configWorker");function q(s,r={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var R;(R=P.GlobalWorkerOptions)!=null&&R.workerSrc||O(N.default);const b=f.shallowRef(),l=f.shallowRef(),D=f.shallowRef(0),k=f.shallowRef({});function g(u){l.value&&l.value.destroy();const o=P.getDocument({url:u,cMapUrl:"/cmaps/",cMapPacked:!0});if(r.onProgress&&(o.onProgress=r.onProgress),r.onPassword)o.onPassword=r.onPassword;else if(r.password){const e=c(i=>{i(r.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{l.value=e,b.value=e.loadingTask,D.value=e.numPages;const i=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();k.value={metadata:i,attachments:a,javascript:n,outline:d}},e=>{typeof r.onError=="function"&&r.onError(e)})}c(g,"processLoadingTask");async function I(u){var t;const o=await((t=b.value)==null?void 0:t.promise);if(!o)return null;const e=await h.getDestinationArray(o,u),i=await h.getDestinationRef(o,e);if(!i||!e)return null;const a=await o.getPageIndex(i),n=e[1].name,d=e.slice(2),v=h.isSpecLike(d)?h.getLocation(n,d):null;return{pageIndex:a,location:v??{type:"Fit",spec:[]}}}c(I,"getPDFDestination");async function U(u="filename"){var n;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=l.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),i=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=i,a.download=u,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(i),document.body.removeChild(a)},10)}c(U,"download");async function x(u=150,o="filename"){var S,C;if(!l.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((S=l.value)==null?void 0:S.saveDocument()),a=await P.getDocument(e.buffer).promise,n=u/72,d=96/72,v=await L.createIframe(),t=v.contentWindow;t.document.title=o;const E=[...Array(a.numPages).keys()].map(p=>p+1);for(const p of E){const y=await a.getPage(p),m=y.getViewport({scale:1});p===1&&L.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const T=w.cloneNode();t==null||t.document.body.appendChild(T),await(y==null?void 0:y.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(C=T.getContext("2d"))==null||C.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(v)}return c(x,"print"),f.isRef(s)?(s.value&&g(s.value),f.watch(s,()=>{s.value&&g(s.value)})):s&&g(s),{pdf:b,pages:D,info:k,print:x,download:U,getPDFDestination:I,processLoadingTask:g}}c(q,"usePDF");exports.usePDF=q;
1
+ "use strict";var N=Object.defineProperty;var l=(s,g)=>N(s,"name",{value:g,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("pdfjs-dist"),O=require("../../../../../node_modules/.pnpm/pdfjs-dist@4.8.69/node_modules/pdfjs-dist/build/pdf.worker.min/index.cjs"),f=require("vue"),P=require("../pdfs/destination/index.cjs"),I=require("../pdfs/miscellaneous/index.cjs");function q(s){b.GlobalWorkerOptions.workerSrc=s}l(q,"configWorker");function A(s,g,i={onProgress:void 0,onPassword:void 0,onError:void 0,password:""}){var S;(S=b.GlobalWorkerOptions)!=null&&S.workerSrc||q(O.default);const D=f.shallowRef(),u=f.shallowRef(),k=f.shallowRef(0),R=f.shallowRef({});function v(c){u.value&&u.value.destroy();const o=b.getDocument(g?{url:c,cMapUrl:g,cMapPacked:!0}:c);if(i.onProgress&&(o.onProgress=i.onProgress),i.onPassword)o.onPassword=i.onPassword;else if(i.password){const e=l(r=>{r(i.password??"")},"onPassword");o.onPassword=e}return o.promise.then(async e=>{u.value=e,D.value=e.loadingTask,k.value=e.numPages;const r=await e.getMetadata(),a=await e.getAttachments(),n=await e.getJSActions(),d=await e.getOutline();R.value={metadata:r,attachments:a,javascript:n,outline:d}},e=>{typeof i.onError=="function"&&i.onError(e)})}l(v,"processLoadingTask");async function x(c){var t;const o=await((t=D.value)==null?void 0:t.promise);if(!o)return null;const e=await P.getDestinationArray(o,c),r=await P.getDestinationRef(o,e);if(!r||!e)return null;const a=await o.getPageIndex(r),n=e[1].name,d=e.slice(2),p=P.isSpecLike(d)?P.getLocation(n,d):null;return{pageIndex:a,location:p??{type:"Fit",spec:[]}}}l(x,"getPDFDestination");async function E(c="filename"){var n;if(!u.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const o=await((n=u.value)==null?void 0:n.saveDocument()),e=new Blob([o],{type:"application/pdf"}),r=URL.createObjectURL(e),a=document.createElement("a");document.body.appendChild(a),a.href=r,a.download=c,a.style.display="none",a.click(),setTimeout(()=>{URL.revokeObjectURL(r),document.body.removeChild(a)},10)}l(E,"download");async function F(c=150,o="filename"){var C,T;if(!u.value)throw new Error("Current PDFDocumentProxy have not loaded yet");const e=await((C=u.value)==null?void 0:C.saveDocument()),a=await b.getDocument(e.buffer).promise,n=c/72,d=96/72,p=await I.createIframe(),t=p.contentWindow;t.document.title=o;const U=[...Array(a.numPages).keys()].map(y=>y+1);for(const y of U){const h=await a.getPage(y),m=h.getViewport({scale:1});y===1&&I.addStylesToIframe(t,m.width*n/d,m.height*n/d);const w=document.createElement("canvas");w.width=m.width*n,w.height=m.height*n;const L=w.cloneNode();t==null||t.document.body.appendChild(L),await(h==null?void 0:h.render({canvasContext:w.getContext("2d"),intent:"print",transform:[n,0,0,n,0,0],viewport:m}).promise),(T=L.getContext("2d"))==null||T.drawImage(w,0,0)}t==null||t.focus(),t==null||t.print(),document.body.removeChild(p)}return l(F,"print"),f.isRef(s)?(s.value&&v(s.value),f.watch(s,()=>{s.value&&v(s.value)})):s&&v(s),{pdf:D,pages:k,info:R,print:F,download:E,getPDFDestination:x,processLoadingTask:v}}l(A,"usePDF");exports.usePDF=A;