@lingshugroup/web-plus 1.7.2 → 1.7.4
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/index.cjs +1 -1
- package/lib/index/index.js +20 -18
- package/lib/index/index.js.br +0 -0
- package/lib/index/index.js.gz +0 -0
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/_utils/utils/index.cjs +1 -1
- package/lib/packages/ls-components/components/_utils/utils/index.js +120 -100
- package/lib/packages/ls-components/components/_utils/utils/index.js.br +0 -0
- package/lib/packages/ls-components/components/_utils/utils/index.js.gz +0 -0
- package/lib/packages/ls-components/components/editor/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/editor/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/editor/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js +97 -71
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/editor/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/editor/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/editor/types/index.js +7 -2
- package/lib/packages/ls-components/components/editor/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/editor/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/index/index.cjs +1 -1
- package/lib/packages/ls-components/components/index/index.js +21 -19
- package/lib/packages/ls-components/components/index/index.js.br +0 -0
- package/lib/packages/ls-components/components/index/index.js.gz +0 -0
- package/lib/packages/ls-components/components/layout/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/layout/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index.js +2 -2
- package/lib/packages/ls-components/components/menu/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js +49 -48
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/menu/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js +65 -47
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/menu/MenuItem.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/menu/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/menu/types/index.js +12 -4
- package/lib/packages/ls-components/components/menu/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/menu/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js +51 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/tooltip/Index.vue/index2.js.gz +0 -0
- package/lib/tooltip/index.cjs +1 -0
- package/lib/tooltip/index.js +12 -0
- package/lib/types/components/_utils/utils.d.ts +1 -0
- package/lib/types/components/editor/Index.vue.d.ts +3 -0
- package/lib/types/components/editor/index.d.ts +6 -0
- package/lib/types/components/editor/types.d.ts +1 -0
- package/lib/types/components/menu/Index.vue.d.ts +3 -0
- package/lib/types/components/menu/MenuItem.vue.d.ts +3 -0
- package/lib/types/components/menu/index.d.ts +6 -0
- package/lib/types/components/menu/types.d.ts +2 -0
- package/lib/types/components/tooltip/Index.vue.d.ts +21 -0
- package/lib/types/components/tooltip/index.d.ts +6 -0
- package/lib/types/components/tooltip/types.d.ts +1 -0
- package/package.json +5 -1
package/lib/index.css.br
CHANGED
|
Binary file
|
package/lib/index.css.gz
CHANGED
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var E=Object.defineProperty;var c=(t,e)=>E(t,"name",{value:e,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function a(t){if(t===null)return!0;const e=typeof t;return!!(e==="undefined"||e==="string"&&(t=t.replace(/^\s*|\s*$/g,""),t==="")||e==="number"&&Number.isNaN(t)||e==="object"&&Object.keys(t).length===0)}c(a,"isEmpty");function f(t,e){try{const n=new Blob([t]),i=URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download=e,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(i)}catch{}}c(f,"exportFile");function d(t){if(a(t))return"";const e=t.lastIndexOf(".");return e>=0?t.substring(e):""}c(d,"getExtension");const h=c((t=[])=>{const e=[];return t.forEach(n=>{e.push(new Promise((i,r)=>{const o=document.createElement("script");o.id=n.id,o.src=n.src,document.body.appendChild(o),o.onload=function(){i({})},o.onerror=function(){o.remove(),r({})}}))}),Promise.all(e)},"loadJs"),g=c((t=[])=>{t.forEach(e=>{const n=document.getElementById(e.id);n&&n.remove()})},"removeJs"),m=c((t=[])=>{const e=[];return t.forEach(n=>{e.push(new Promise((i,r)=>{const o=document.createElement("link");o.id=n.id,o.rel="stylesheet",o.href=n.src,document.body.appendChild(o),o.onload=function(){i({})},o.onerror=function(){o.remove(),r({})}}))}),Promise.all(e)},"loadCss"),p=c((t=[])=>{t.forEach(e=>{const n=document.getElementById(e.id);n&&n.remove()})},"removeCss");function b(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}c(b,"getRandomHexColor");function u(t,e){return Number((Math.ceil(t*100)/100).toFixed(e||1))}c(u,"numberFixed");function O(t,e,n){const i=t,r=e;n=n||0,t=u(t,n),e=u(e,n);let o=u((t-e)/2,n);o=o==0?.1:o;let s=Math.ceil((t-e)/o);s=s==0?1:s,e<o&&(e=0);let l=u(o*s+e,n);return l<=i&&(l=u(l+o,n)),{aMax:l,aMin:e==0||e<r?e:u(e-o,n),aInterval:o}}c(O,"formatChartAxis");function y(t){try{return t=JSON.parse(t),t!==null&&typeof t=="object"?t.constructor===Object:!1}catch{return!1}}c(y,"isValidJSON");function w(t){const e=t.reduce((o,s)=>o+s.byteLength,0),n=new ArrayBuffer(e),i=new Uint8Array(n);let r=0;return t.forEach(o=>{i.set(new Uint8Array(o.file),r),r+=o.byteLength}),i}c(w,"mergeBuffer");function B(t){const e=window.atob(t),n=e.length,i=new Uint8Array(n);for(let r=0;r<n;r++)i[r]=e.charCodeAt(r);return new Uint8Array(i).buffer}c(B,"fileToBuffer");function F(t){if(!t)return{width:0,height:0};const e=t.getBoundingClientRect(),n=window.getComputedStyle(t),i=parseFloat(n.marginLeft),r=parseFloat(n.marginRight),o=parseFloat(n.marginTop),s=parseFloat(n.marginBottom),l=e.width+i+r,C=e.height+o+s;return{width:l,height:C}}c(F,"getElementFullSize");function M(t,e){const n=t.getBoundingClientRect(),i=window.innerWidth,{width:r}=F(e),{left:o,right:s}=n||{};let l="";return o<i-r&&s<(r||i)?l="left":s>i&&(l="right"),l}c(M,"elementOutOfBounds");const R={isEmpty:a,exportFile:f,getExtension:d,loadJs:h,removeJs:g,loadCss:m,removeCss:p,getRandomHexColor:b,numberFixed:u,isValidJSON:y,mergeBuffer:w,fileToBuffer:B};exports.default=R;exports.elementOutOfBounds=M;exports.exportFile=f;exports.fileToBuffer=B;exports.formatChartAxis=O;exports.getExtension=d;exports.getRandomHexColor=b;exports.isEmpty=a;exports.isValidJSON=y;exports.loadCss=m;exports.loadJs=h;exports.mergeBuffer=w;exports.numberFixed=u;exports.removeCss=p;exports.removeJs=g;
|
|
@@ -1,137 +1,157 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
return !!(
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var i = (t, e) => d(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
function a(t) {
|
|
4
|
+
if (t === null) return !0;
|
|
5
|
+
const e = typeof t;
|
|
6
|
+
return !!(e === "undefined" || e === "string" && (t = t.replace(/^\s*|\s*$/g, ""), t === "") || e === "number" && Number.isNaN(t) || e === "object" && Object.keys(t).length === 0);
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
function
|
|
8
|
+
i(a, "isEmpty");
|
|
9
|
+
function h(t, e) {
|
|
10
10
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const n = new Blob([t]), c = URL.createObjectURL(n), r = document.createElement("a");
|
|
12
|
+
r.style.display = "none", r.href = c, r.download = e, document.body.appendChild(r), r.click(), r.remove(), URL.revokeObjectURL(c);
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
return
|
|
16
|
+
i(h, "exportFile");
|
|
17
|
+
function g(t) {
|
|
18
|
+
if (a(t)) return "";
|
|
19
|
+
const e = t.lastIndexOf(".");
|
|
20
|
+
return e >= 0 ? t.substring(e) : "";
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
new Promise((c,
|
|
28
|
-
const
|
|
29
|
-
|
|
22
|
+
i(g, "getExtension");
|
|
23
|
+
const p = /* @__PURE__ */ i((t = []) => {
|
|
24
|
+
const e = [];
|
|
25
|
+
return t.forEach((n) => {
|
|
26
|
+
e.push(
|
|
27
|
+
new Promise((c, r) => {
|
|
28
|
+
const o = document.createElement("script");
|
|
29
|
+
o.id = n.id, o.src = n.src, document.body.appendChild(o), o.onload = function() {
|
|
30
30
|
c({});
|
|
31
|
-
},
|
|
32
|
-
|
|
31
|
+
}, o.onerror = function() {
|
|
32
|
+
o.remove(), r({});
|
|
33
33
|
};
|
|
34
34
|
})
|
|
35
35
|
);
|
|
36
|
-
}), Promise.all(
|
|
37
|
-
}, "loadJs"),
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
36
|
+
}), Promise.all(e);
|
|
37
|
+
}, "loadJs"), m = /* @__PURE__ */ i((t = []) => {
|
|
38
|
+
t.forEach((e) => {
|
|
39
|
+
const n = document.getElementById(e.id);
|
|
40
|
+
n && n.remove();
|
|
41
41
|
});
|
|
42
|
-
}, "removeJs"),
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
new Promise((c,
|
|
47
|
-
const
|
|
48
|
-
|
|
42
|
+
}, "removeJs"), b = /* @__PURE__ */ i((t = []) => {
|
|
43
|
+
const e = [];
|
|
44
|
+
return t.forEach((n) => {
|
|
45
|
+
e.push(
|
|
46
|
+
new Promise((c, r) => {
|
|
47
|
+
const o = document.createElement("link");
|
|
48
|
+
o.id = n.id, o.rel = "stylesheet", o.href = n.src, document.body.appendChild(o), o.onload = function() {
|
|
49
49
|
c({});
|
|
50
|
-
},
|
|
51
|
-
|
|
50
|
+
}, o.onerror = function() {
|
|
51
|
+
o.remove(), r({});
|
|
52
52
|
};
|
|
53
53
|
})
|
|
54
54
|
);
|
|
55
|
-
}), Promise.all(
|
|
56
|
-
}, "loadCss"),
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
55
|
+
}), Promise.all(e);
|
|
56
|
+
}, "loadCss"), y = /* @__PURE__ */ i((t = []) => {
|
|
57
|
+
t.forEach((e) => {
|
|
58
|
+
const n = document.getElementById(e.id);
|
|
59
|
+
n && n.remove();
|
|
60
60
|
});
|
|
61
61
|
}, "removeCss");
|
|
62
|
-
function
|
|
62
|
+
function w() {
|
|
63
63
|
return `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
function u(
|
|
67
|
-
return Number((Math.ceil(
|
|
65
|
+
i(w, "getRandomHexColor");
|
|
66
|
+
function u(t, e) {
|
|
67
|
+
return Number((Math.ceil(t * 100) / 100).toFixed(e || 1));
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
function
|
|
71
|
-
const c =
|
|
72
|
-
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
let l = u(
|
|
78
|
-
return l <= c && (l = u(l +
|
|
69
|
+
i(u, "numberFixed");
|
|
70
|
+
function R(t, e, n) {
|
|
71
|
+
const c = t, r = e;
|
|
72
|
+
n = n || 0, t = u(t, n), e = u(e, n);
|
|
73
|
+
let o = u((t - e) / 2, n);
|
|
74
|
+
o = o == 0 ? 0.1 : o;
|
|
75
|
+
let s = Math.ceil((t - e) / o);
|
|
76
|
+
s = s == 0 ? 1 : s, e < o && (e = 0);
|
|
77
|
+
let l = u(o * s + e, n);
|
|
78
|
+
return l <= c && (l = u(l + o, n)), {
|
|
79
79
|
aMax: l,
|
|
80
|
-
aMin:
|
|
81
|
-
aInterval:
|
|
80
|
+
aMin: e == 0 || e < r ? e : u(e - o, n),
|
|
81
|
+
aInterval: o
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
function
|
|
84
|
+
i(R, "formatChartAxis");
|
|
85
|
+
function E(t) {
|
|
86
86
|
try {
|
|
87
|
-
return
|
|
87
|
+
return t = JSON.parse(t), t !== null && typeof t == "object" ? t.constructor === Object : !1;
|
|
88
88
|
} catch {
|
|
89
89
|
return !1;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
let
|
|
96
|
-
return
|
|
97
|
-
c.set(new Uint8Array(
|
|
92
|
+
i(E, "isValidJSON");
|
|
93
|
+
function B(t) {
|
|
94
|
+
const e = t.reduce((o, s) => o + s.byteLength, 0), n = new ArrayBuffer(e), c = new Uint8Array(n);
|
|
95
|
+
let r = 0;
|
|
96
|
+
return t.forEach((o) => {
|
|
97
|
+
c.set(new Uint8Array(o.file), r), r += o.byteLength;
|
|
98
98
|
}), c;
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
function
|
|
102
|
-
const
|
|
103
|
-
for (let
|
|
104
|
-
c[
|
|
100
|
+
i(B, "mergeBuffer");
|
|
101
|
+
function C(t) {
|
|
102
|
+
const e = window.atob(t), n = e.length, c = new Uint8Array(n);
|
|
103
|
+
for (let r = 0; r < n; r++)
|
|
104
|
+
c[r] = e.charCodeAt(r);
|
|
105
105
|
return new Uint8Array(c).buffer;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
107
|
+
i(C, "fileToBuffer");
|
|
108
|
+
function L(t) {
|
|
109
|
+
if (!t)
|
|
110
|
+
return {
|
|
111
|
+
width: 0,
|
|
112
|
+
height: 0
|
|
113
|
+
};
|
|
114
|
+
const e = t.getBoundingClientRect(), n = window.getComputedStyle(t), c = parseFloat(n.marginLeft), r = parseFloat(n.marginRight), o = parseFloat(n.marginTop), s = parseFloat(n.marginBottom), l = e.width + c + r, f = e.height + o + s;
|
|
115
|
+
return {
|
|
116
|
+
width: l,
|
|
117
|
+
height: f
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
i(L, "getElementFullSize");
|
|
121
|
+
function U(t, e) {
|
|
122
|
+
const n = t.getBoundingClientRect(), c = window.innerWidth, { width: r } = L(e), { left: o, right: s } = n || {};
|
|
123
|
+
let l = "";
|
|
124
|
+
return o < c - r && s < (r || c) ? l = "left" : s > c && (l = "right"), l;
|
|
125
|
+
}
|
|
126
|
+
i(U, "elementOutOfBounds");
|
|
127
|
+
const A = {
|
|
128
|
+
isEmpty: a,
|
|
129
|
+
exportFile: h,
|
|
130
|
+
getExtension: g,
|
|
131
|
+
loadJs: p,
|
|
132
|
+
removeJs: m,
|
|
133
|
+
loadCss: b,
|
|
134
|
+
removeCss: y,
|
|
135
|
+
getRandomHexColor: w,
|
|
117
136
|
numberFixed: u,
|
|
118
|
-
isValidJSON:
|
|
119
|
-
mergeBuffer:
|
|
120
|
-
fileToBuffer:
|
|
137
|
+
isValidJSON: E,
|
|
138
|
+
mergeBuffer: B,
|
|
139
|
+
fileToBuffer: C
|
|
121
140
|
};
|
|
122
141
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
C as
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
b as
|
|
133
|
-
|
|
142
|
+
A as default,
|
|
143
|
+
U as elementOutOfBounds,
|
|
144
|
+
h as exportFile,
|
|
145
|
+
C as fileToBuffer,
|
|
146
|
+
R as formatChartAxis,
|
|
147
|
+
g as getExtension,
|
|
148
|
+
w as getRandomHexColor,
|
|
149
|
+
a as isEmpty,
|
|
150
|
+
E as isValidJSON,
|
|
151
|
+
b as loadCss,
|
|
152
|
+
p as loadJs,
|
|
153
|
+
B as mergeBuffer,
|
|
134
154
|
u as numberFixed,
|
|
135
|
-
|
|
136
|
-
|
|
155
|
+
y as removeCss,
|
|
156
|
+
m as removeJs
|
|
137
157
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */;/* empty css */const t=,/* empty css */r=t.default(e.default,[["__scopeId","data-v-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */;/* empty css */const t=,/* empty css */r=t.default(e.default,[["__scopeId","data-v-2f60537b"]]);exports.default=r;
|
|
@@ -2,7 +2,7 @@ import o from "./index2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import t from "../../../../../_virtual/_plugin-vue_export-helper/index.js";
|
|
5
|
-
const
|
|
5
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2f60537b"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
f as default
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var V=Object.defineProperty;var s=(i,c)=>V(i,"name",{value:c,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),f=require("@wangeditor/editor-for-vue"),_=require("../../_hooks/useNamespace/index.cjs"),p=require("../types/index.cjs"),A=require("../../_utils/utils/index.cjs"),h=require("../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs"),M=t.defineComponent({name:"LSEditor"}),P=t.defineComponent({...M,props:p.lsEditorProps,emits:p.lsEditorEmits,setup(i,{expose:c,emit:g}){const v=_.useNamespace("editor").b(),r=i,a=g,l=t.shallowRef(),m=t.ref();function y(e,n){let o=(e||2)*1024*1024;if(!e)return o;switch(n){case"GB":o=e*1024*1024;break;case"KB":o=e*1024;break}return o}s(y,"getMaxFileSize");const C={excludeKeys:["group-video"]},E={placeholder:"请输入内容...",maxLength:2e4,MENU_CONF:{uploadImage:{server:r.uploadServer,fieldName:r.uploadFieldName,maxFileSize:y(r.uploadImgSize,r.uploadImgSizeUnit),headers:r.uploadHeaders?r.uploadHeaders:{token:r.uploadToken},customInsert(e,n){const{data:o="",alt:F="",href:L=""}=e||{};n(o,F,L)}}}},b=t.computed(()=>({height:(r==null?void 0:r.height)||"300px"})),u=t.ref("");t.watch(()=>r.valueHtml,e=>{u.value=e},{immediate:!0,deep:!0}),t.onBeforeUnmount(()=>{const e=l.value;e!=null&&e.destroy()});const S=s(e=>{l.value=e,w(),a("handleCreated",e)},"handleCreated"),k=s(e=>{a("handleChange",e)},"handleChange"),q=s(e=>{a("handleDestroyed",e)},"handleDestroyed"),B=s(e=>{a("handleFocus",e)},"handleFocus"),D=s(e=>{a("handleBlur",e)},"handleBlur"),N=s((e,n)=>{a("customAlert",e,n)},"customAlert"),O=s((e,n,o)=>{a("customPaste",e,n,o)},"customPaste");async function w(){await t.nextTick(),(m.value.querySelectorAll('button[data-menu-key="group-image"]')||[]).forEach(o=>{o.removeEventListener("mouseenter",d),o.addEventListener("mouseenter",()=>{d(o)})}),(m.value.querySelectorAll('button[data-menu-key="group-video"]')||[]).forEach(o=>{o.removeEventListener("mouseenter",d),o.addEventListener("mouseenter",()=>{d(o)})})}s(w,"listenerDoms");function d(e){const n=e.parentNode.querySelector(".w-e-bar-item-menus-container");switch(A.elementOutOfBounds(n,r.containerDom)){case"left":n.style.left=0,n.style.right="inherit";break;case"right":n.style.left="inherit",n.style.right=0;break}}return s(d,"updateStyle"),c({editorRef:l}),(e,n)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"lsEditorRef",ref:m,class:t.normalizeClass(t.unref(v))},[t.createVNode(t.unref(f.Toolbar),{class:"tool-bar-wrap",editor:t.unref(l),"default-config":t.unref(h.default)(C,e.toolbarConfig),mode:e.mode},null,8,["editor","default-config","mode"]),t.createVNode(t.unref(f.Editor),{class:"editor-wrap",modelValue:t.unref(u),"onUpdate:modelValue":n[0]||(n[0]=o=>t.isRef(u)?u.value=o:null),"default-config":t.unref(h.default)(E,e.editorConfig),style:t.normalizeStyle(t.unref(b)),mode:e.mode,onOnCreated:S,onOnChange:k,onOnDestroyed:q,onOnFocus:B,onOnBlur:D,onCustomAlert:N,onCustomPaste:O},null,8,["modelValue","default-config","style","mode"])],2))}});exports.default=P;
|
|
@@ -1,112 +1,138 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { defineComponent as
|
|
4
|
-
import { Toolbar as
|
|
5
|
-
import { useNamespace as
|
|
6
|
-
import { lsEditorProps as
|
|
7
|
-
import
|
|
8
|
-
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var r = (u, m) => R(u, "name", { value: m, configurable: !0 });
|
|
3
|
+
import { defineComponent as g, shallowRef as I, ref as f, computed as P, watch as T, onBeforeUnmount as U, openBlock as V, createElementBlock as _, normalizeClass as q, unref as a, createVNode as p, isRef as z, normalizeStyle as H, nextTick as M } from "vue";
|
|
4
|
+
import { Toolbar as K, Editor as G } from "@wangeditor/editor-for-vue";
|
|
5
|
+
import { useNamespace as j } from "../../_hooks/useNamespace/index.js";
|
|
6
|
+
import { lsEditorProps as J, lsEditorEmits as Q } from "../types/index.js";
|
|
7
|
+
import { elementOutOfBounds as W } from "../../_utils/utils/index.js";
|
|
8
|
+
import h from "../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
9
|
+
const X = g({
|
|
9
10
|
name: "LSEditor"
|
|
10
|
-
}),
|
|
11
|
-
...
|
|
12
|
-
props:
|
|
13
|
-
emits:
|
|
14
|
-
setup(u, { expose: m, emit:
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
let
|
|
11
|
+
}), ae = /* @__PURE__ */ g({
|
|
12
|
+
...X,
|
|
13
|
+
props: J,
|
|
14
|
+
emits: Q,
|
|
15
|
+
setup(u, { expose: m, emit: v }) {
|
|
16
|
+
const y = j("editor").b(), n = u, s = v, l = I(), c = f();
|
|
17
|
+
function C(e, t) {
|
|
18
|
+
let o = (e || 2) * 1024 * 1024;
|
|
18
19
|
if (!e)
|
|
19
|
-
return
|
|
20
|
+
return o;
|
|
20
21
|
switch (t) {
|
|
21
22
|
case "GB":
|
|
22
|
-
|
|
23
|
+
o = e * 1024 * 1024;
|
|
23
24
|
break;
|
|
24
25
|
case "KB":
|
|
25
|
-
|
|
26
|
+
o = e * 1024;
|
|
26
27
|
break;
|
|
27
28
|
}
|
|
28
|
-
return
|
|
29
|
+
return o;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
const
|
|
31
|
+
r(C, "getMaxFileSize");
|
|
32
|
+
const E = {
|
|
32
33
|
excludeKeys: ["group-video"]
|
|
33
|
-
},
|
|
34
|
+
}, b = {
|
|
34
35
|
placeholder: "请输入内容...",
|
|
35
36
|
maxLength: 2e4,
|
|
36
37
|
MENU_CONF: {
|
|
37
38
|
uploadImage: {
|
|
38
|
-
server:
|
|
39
|
-
fieldName:
|
|
40
|
-
maxFileSize:
|
|
41
|
-
headers:
|
|
42
|
-
token:
|
|
39
|
+
server: n.uploadServer,
|
|
40
|
+
fieldName: n.uploadFieldName,
|
|
41
|
+
maxFileSize: C(n.uploadImgSize, n.uploadImgSizeUnit),
|
|
42
|
+
headers: n.uploadHeaders ? n.uploadHeaders : {
|
|
43
|
+
token: n.uploadToken
|
|
43
44
|
},
|
|
44
45
|
customInsert(e, t) {
|
|
45
|
-
const { data:
|
|
46
|
-
t(
|
|
46
|
+
const { data: o = "", alt: x = "", href: A = "" } = e || {};
|
|
47
|
+
t(o, x, A);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
},
|
|
51
|
-
height: (
|
|
52
|
-
})),
|
|
53
|
-
|
|
54
|
-
() =>
|
|
51
|
+
}, k = P(() => ({
|
|
52
|
+
height: (n == null ? void 0 : n.height) || "300px"
|
|
53
|
+
})), d = f("");
|
|
54
|
+
T(
|
|
55
|
+
() => n.valueHtml,
|
|
55
56
|
(e) => {
|
|
56
|
-
|
|
57
|
+
d.value = e;
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
immediate: !0,
|
|
60
61
|
deep: !0
|
|
61
62
|
}
|
|
62
|
-
),
|
|
63
|
-
const e =
|
|
63
|
+
), U(() => {
|
|
64
|
+
const e = l.value;
|
|
64
65
|
e != null && e.destroy();
|
|
65
66
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
}, "handleCreated"),
|
|
69
|
-
|
|
70
|
-
}, "handleChange"),
|
|
71
|
-
|
|
72
|
-
}, "handleDestroyed"),
|
|
73
|
-
|
|
74
|
-
}, "handleFocus"),
|
|
75
|
-
|
|
76
|
-
}, "handleBlur"),
|
|
77
|
-
|
|
78
|
-
}, "customAlert"), N = /* @__PURE__ */
|
|
79
|
-
|
|
67
|
+
const S = /* @__PURE__ */ r((e) => {
|
|
68
|
+
l.value = e, L(), s("handleCreated", e);
|
|
69
|
+
}, "handleCreated"), B = /* @__PURE__ */ r((e) => {
|
|
70
|
+
s("handleChange", e);
|
|
71
|
+
}, "handleChange"), D = /* @__PURE__ */ r((e) => {
|
|
72
|
+
s("handleDestroyed", e);
|
|
73
|
+
}, "handleDestroyed"), w = /* @__PURE__ */ r((e) => {
|
|
74
|
+
s("handleFocus", e);
|
|
75
|
+
}, "handleFocus"), O = /* @__PURE__ */ r((e) => {
|
|
76
|
+
s("handleBlur", e);
|
|
77
|
+
}, "handleBlur"), F = /* @__PURE__ */ r((e, t) => {
|
|
78
|
+
s("customAlert", e, t);
|
|
79
|
+
}, "customAlert"), N = /* @__PURE__ */ r((e, t, o) => {
|
|
80
|
+
s("customPaste", e, t, o);
|
|
80
81
|
}, "customPaste");
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
async function L() {
|
|
83
|
+
await M(), (c.value.querySelectorAll('button[data-menu-key="group-image"]') || []).forEach((o) => {
|
|
84
|
+
o.removeEventListener("mouseenter", i), o.addEventListener("mouseenter", () => {
|
|
85
|
+
i(o);
|
|
86
|
+
});
|
|
87
|
+
}), (c.value.querySelectorAll('button[data-menu-key="group-video"]') || []).forEach((o) => {
|
|
88
|
+
o.removeEventListener("mouseenter", i), o.addEventListener("mouseenter", () => {
|
|
89
|
+
i(o);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
r(L, "listenerDoms");
|
|
94
|
+
function i(e) {
|
|
95
|
+
const t = e.parentNode.querySelector(".w-e-bar-item-menus-container");
|
|
96
|
+
switch (W(t, n.containerDom)) {
|
|
97
|
+
case "left":
|
|
98
|
+
t.style.left = 0, t.style.right = "inherit";
|
|
99
|
+
break;
|
|
100
|
+
case "right":
|
|
101
|
+
t.style.left = "inherit", t.style.right = 0;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return r(i, "updateStyle"), m({
|
|
106
|
+
editorRef: l
|
|
107
|
+
}), (e, t) => (V(), _("div", {
|
|
108
|
+
ref_key: "lsEditorRef",
|
|
109
|
+
ref: c,
|
|
110
|
+
class: q(a(y))
|
|
85
111
|
}, [
|
|
86
|
-
|
|
112
|
+
p(a(K), {
|
|
87
113
|
class: "tool-bar-wrap",
|
|
88
|
-
editor: a(
|
|
89
|
-
"default-config": a(
|
|
114
|
+
editor: a(l),
|
|
115
|
+
"default-config": a(h)(E, e.toolbarConfig),
|
|
90
116
|
mode: e.mode
|
|
91
117
|
}, null, 8, ["editor", "default-config", "mode"]),
|
|
92
|
-
|
|
118
|
+
p(a(G), {
|
|
93
119
|
class: "editor-wrap",
|
|
94
|
-
modelValue: a(
|
|
95
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
96
|
-
"default-config": a(
|
|
97
|
-
style:
|
|
120
|
+
modelValue: a(d),
|
|
121
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => z(d) ? d.value = o : null),
|
|
122
|
+
"default-config": a(h)(b, e.editorConfig),
|
|
123
|
+
style: H(a(k)),
|
|
98
124
|
mode: e.mode,
|
|
99
|
-
onOnCreated:
|
|
100
|
-
onOnChange:
|
|
101
|
-
onOnDestroyed:
|
|
102
|
-
onOnFocus:
|
|
103
|
-
onOnBlur:
|
|
104
|
-
onCustomAlert:
|
|
125
|
+
onOnCreated: S,
|
|
126
|
+
onOnChange: B,
|
|
127
|
+
onOnDestroyed: D,
|
|
128
|
+
onOnFocus: w,
|
|
129
|
+
onOnBlur: O,
|
|
130
|
+
onCustomAlert: F,
|
|
105
131
|
onCustomPaste: N
|
|
106
132
|
}, null, 8, ["modelValue", "default-config", "style", "mode"])
|
|
107
133
|
], 2));
|
|
108
134
|
}
|
|
109
135
|
});
|
|
110
136
|
export {
|
|
111
|
-
|
|
137
|
+
ae as default
|
|
112
138
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var e=(t,l)=>d(t,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../_utils/runtime/index.cjs"),o=a.buildProps({valueHtml:{type:String,default:""},height:{type:String,default:"300px"},mode:{type:String,default:"default"},toolbarConfig:{type:Object,default:e(()=>({}),"default")},editorConfig:{type:Object,default:e(()=>({}),"default")},uploadServer:{type:String,default:""},uploadFieldName:{type:String,default:"file"},uploadToken:{type:String,default:""},uploadHeaders:{type:Object,default:e(()=>null,"default")},uploadImgSize:{type:Number,default:2},uploadImgSizeUnit:{type:String,default:"MB"}}),
|
|
1
|
+
"use strict";var d=Object.defineProperty;var e=(t,l)=>d(t,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../_utils/runtime/index.cjs"),o=a.buildProps({valueHtml:{type:String,default:""},height:{type:String,default:"300px"},mode:{type:String,default:"default"},toolbarConfig:{type:Object,default:e(()=>({}),"default")},editorConfig:{type:Object,default:e(()=>({}),"default")},uploadServer:{type:String,default:""},uploadFieldName:{type:String,default:"file"},uploadToken:{type:String,default:""},uploadHeaders:{type:Object,default:e(()=>null,"default")},uploadImgSize:{type:Number,default:2},uploadImgSizeUnit:{type:String,default:"MB"},containerDom:{type:Object,default:null}}),u=["handleCreated","handleChange","handleDestroyed","handleFocus","handleBlur","customAlert","customPaste"];exports.lsEditorEmits=u;exports.lsEditorProps=o;
|
|
@@ -49,8 +49,13 @@ const r = a({
|
|
|
49
49
|
uploadImgSizeUnit: {
|
|
50
50
|
type: String,
|
|
51
51
|
default: "MB"
|
|
52
|
+
},
|
|
53
|
+
// 可视区域dom
|
|
54
|
+
containerDom: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: null
|
|
52
57
|
}
|
|
53
|
-
}),
|
|
58
|
+
}), n = [
|
|
54
59
|
"handleCreated",
|
|
55
60
|
"handleChange",
|
|
56
61
|
"handleDestroyed",
|
|
@@ -60,6 +65,6 @@ const r = a({
|
|
|
60
65
|
"customPaste"
|
|
61
66
|
];
|
|
62
67
|
export {
|
|
63
|
-
|
|
68
|
+
n as lsEditorEmits,
|
|
64
69
|
r as lsEditorProps
|
|
65
70
|
};
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@element-plus/icons-vue"),i=require("../../../../button/index.cjs"),a=require("../../../../descriptions/index.cjs"),c=require("../../../../form/index.cjs"),d=require("../../../../table/index.cjs"),f=require("../../../../upload/index.cjs"),S=require("../../../../preview/index.cjs"),L=require("../../../../menu/index.cjs"),q=require("../../../../icon/index.cjs"),m=require("../../../../confirm/index.cjs"),p=require("../../../../chart/index.cjs"),b=require("../../../../breadcrumb/index.cjs"),v=require("../../../../bellMessage/index.cjs"),g=require("../../../../live/index.cjs"),w=require("../../../../tree/index.cjs"),P=require("../../../../print/index.cjs"),y=require("../../../../containerBox/index.cjs"),B=require("../../../../backTop/index.cjs"),_=require("../../../../map/index.cjs"),O=require("../../../../editor/index.cjs"),j=require("../../../../dialog/index.cjs"),x=require("../../../../layout/index.cjs"),M=require("../../../../list/index.cjs"),
|
|
1
|
+
"use strict";var l=Object.defineProperty;var o=(t,r)=>l(t,"name",{value:r,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@element-plus/icons-vue"),i=require("../../../../button/index.cjs"),a=require("../../../../descriptions/index.cjs"),c=require("../../../../form/index.cjs"),d=require("../../../../table/index.cjs"),f=require("../../../../upload/index.cjs"),S=require("../../../../preview/index.cjs"),L=require("../../../../menu/index.cjs"),q=require("../../../../icon/index.cjs"),m=require("../../../../confirm/index.cjs"),p=require("../../../../chart/index.cjs"),b=require("../../../../breadcrumb/index.cjs"),v=require("../../../../bellMessage/index.cjs"),g=require("../../../../live/index.cjs"),w=require("../../../../tree/index.cjs"),P=require("../../../../print/index.cjs"),y=require("../../../../containerBox/index.cjs"),B=require("../../../../backTop/index.cjs"),_=require("../../../../map/index.cjs"),O=require("../../../../editor/index.cjs"),j=require("../../../../dialog/index.cjs"),x=require("../../../../layout/index.cjs"),M=require("../../../../list/index.cjs"),T=require("../../../../preview_image/index.cjs"),k=require("../../../../preview_docx/index.cjs"),D=require("../../../../preview_pdf/index.cjs"),F=require("../../../../preview_xlsx/index.cjs"),I=require("../../../../downloadFile/index.cjs"),C=require("../../../../tooltip/index.cjs");function E(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:o(()=>t[e],"get")})}}return r.default=t,Object.freeze(r)}o(E,"_interopNamespaceDefault");const h=E(s),u={LSButtonGroup:i.LSButtonGroup,LSButton:i.LSButton,LSDescriptions:a.default,LSUpload:f.default,LSPreview:S.default,LSForm:c.LSForm,LSFormItem:c.LSFormItem,LSTable:d.default,LSMenu:L.default,LSIcon:q.default,LSConfirm:m.default,LSChart:p.default,LSBreadcrumb:b.default,LSBellMessage:v.default,LSLive:g.default,LSTree:w.default,LSPrint:P.default,LSContainerBox:y.default,LSBackTop:B.default,LSMap:_.default,LSEditor:O.default,LSDialog:j.default,LSLayout:x.default,LSList:M.default,LSPreviewImage:T.default,LSPreviewDocx:k.default,LSPreviewPdf:D.default,LSPreviewXlsx:F.default,LSDownloadFile:I.default,LSTooltip:C.default},G=o(t=>{for(const[r,e]of Object.entries(h))t.component(r,e);for(const r of Object.keys(u)){const e=u[r];t.component(e==null?void 0:e.name,e)}},"install"),V={...u,install:G};exports.default=V;
|