@vunk/plus 1.16.2 → 1.16.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),k=require("@vunk/core/components/wrapper"),n=require("element-plus"),v=require("@vunk/core/shared/utils-vue"),C=v.bindPropsFactory(n.textProps),_=v.bindPropsFactory(n.useTooltipProps),b={...n.textProps,...n.useTooltipProps},c=e.defineComponent({name:"ElText",inheritAttrs:!1,__name:"index",props:b,setup(u){const o=u,T=C(o),x=_(o,["content"]),f=t=>t===void 0,s=e.ref(),P=n.useFormSize(),r=n.useNamespace("text"),d=e.ref(!1),p=e.ref(""),y=e.computed(()=>[r.b(),r.m(o.type),r.m(P.value),r.is("truncated",o.truncated),r.is("line-clamp",!f(o.lineClamp))]);function m(){p.value=s.value?.textContent??""}function g(){if(e.useAttrs().title)return;let a=!1;if(o.truncated){const l=s.value?.offsetWidth,i=s.value?.scrollWidth;l&&i&&i>l&&(a=!0)}else if(!f(o.lineClamp)){const l=s.value?.offsetHeight,i=s.value?.scrollHeight;l&&i&&i>l&&(a=!0)}d.value=a}function h(){m(),g()}return e.onMounted(h),e.onUpdated(h),(t,a)=>(e.openBlock(),e.createBlock(e.unref(k.VkWrapper),e.mergeProps({is:e.unref(n.ElTooltip),show:d.value,content:p.value},e.unref(x),{onBeforeShow:m}),e.createSlots({default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps({ref_key:"textRef",ref:s,class:y.value,style:{"-webkit-line-clamp":t.lineClamp}},{...e.unref(T),...t.$attrs}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},16,["class","style"]))]),_:2},[t.$slots.content?{name:"content",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"content",{content:p.value})]),key:"0"}:void 0]),1040,["is","show","content"]))}}),S=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));c.install=u=>{u.component(c.name||"VkText",c)};exports.VkText=c;exports.__VkText=S;exports.default=c;
|
|
@@ -1,53 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VkWrapper as
|
|
3
|
-
import { textProps as
|
|
4
|
-
import { bindPropsFactory as
|
|
5
|
-
const
|
|
6
|
-
...
|
|
7
|
-
...
|
|
8
|
-
},
|
|
1
|
+
import { defineComponent as V, ref as p, computed as W, onMounted as $, onUpdated as z, openBlock as T, createBlock as x, unref as i, mergeProps as y, createSlots as A, withCtx as u, resolveDynamicComponent as H, renderSlot as k, useAttrs as j } from "vue";
|
|
2
|
+
import { VkWrapper as E } from "@vunk/core/components/wrapper";
|
|
3
|
+
import { textProps as C, useTooltipProps as P, useFormSize as F, useNamespace as M, ElTooltip as O } from "element-plus";
|
|
4
|
+
import { bindPropsFactory as _ } from "@vunk/core/shared/utils-vue";
|
|
5
|
+
const R = _(C), U = _(P), D = {
|
|
6
|
+
...C,
|
|
7
|
+
...P
|
|
8
|
+
}, f = /* @__PURE__ */ V({
|
|
9
9
|
name: "ElText",
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "index",
|
|
12
|
-
props:
|
|
12
|
+
props: D,
|
|
13
13
|
setup(a) {
|
|
14
|
-
const e = a,
|
|
14
|
+
const e = a, g = R(e), b = U(e, ["content"]), d = (t) => t === void 0, o = p(), S = F(), n = M("text"), m = p(!1), c = p(""), w = W(() => [
|
|
15
15
|
n.b(),
|
|
16
16
|
n.m(e.type),
|
|
17
|
-
n.m(
|
|
17
|
+
n.m(S.value),
|
|
18
18
|
n.is("truncated", e.truncated),
|
|
19
|
-
n.is("line-clamp", !
|
|
19
|
+
n.is("line-clamp", !d(e.lineClamp))
|
|
20
20
|
]);
|
|
21
|
-
function
|
|
22
|
-
|
|
21
|
+
function h() {
|
|
22
|
+
c.value = o.value?.textContent ?? "";
|
|
23
|
+
}
|
|
24
|
+
function B() {
|
|
25
|
+
if (j().title)
|
|
23
26
|
return;
|
|
24
|
-
let
|
|
27
|
+
let r = !1;
|
|
25
28
|
if (e.truncated) {
|
|
26
29
|
const s = o.value?.offsetWidth, l = o.value?.scrollWidth;
|
|
27
|
-
s && l && l > s && (
|
|
28
|
-
} else if (!
|
|
30
|
+
s && l && l > s && (r = !0);
|
|
31
|
+
} else if (!d(e.lineClamp)) {
|
|
29
32
|
const s = o.value?.offsetHeight, l = o.value?.scrollHeight;
|
|
30
|
-
s && l && l > s && (
|
|
33
|
+
s && l && l > s && (r = !0);
|
|
31
34
|
}
|
|
32
|
-
|
|
35
|
+
m.value = r;
|
|
36
|
+
}
|
|
37
|
+
function v() {
|
|
38
|
+
h(), B();
|
|
33
39
|
}
|
|
34
|
-
return
|
|
35
|
-
is:
|
|
36
|
-
show:
|
|
37
|
-
content:
|
|
38
|
-
},
|
|
39
|
-
default:
|
|
40
|
-
(
|
|
40
|
+
return $(v), z(v), (t, r) => (T(), x(i(E), y({
|
|
41
|
+
is: i(O),
|
|
42
|
+
show: m.value,
|
|
43
|
+
content: c.value
|
|
44
|
+
}, i(b), { onBeforeShow: h }), A({
|
|
45
|
+
default: u(() => [
|
|
46
|
+
(T(), x(H(t.tag), y({
|
|
41
47
|
ref_key: "textRef",
|
|
42
48
|
ref: o,
|
|
43
|
-
class:
|
|
49
|
+
class: w.value,
|
|
44
50
|
style: { "-webkit-line-clamp": t.lineClamp }
|
|
45
51
|
}, {
|
|
46
|
-
...
|
|
52
|
+
...i(g),
|
|
47
53
|
...t.$attrs
|
|
48
54
|
}), {
|
|
49
|
-
default:
|
|
50
|
-
|
|
55
|
+
default: u(() => [
|
|
56
|
+
k(t.$slots, "default")
|
|
51
57
|
]),
|
|
52
58
|
_: 3
|
|
53
59
|
}, 16, ["class", "style"]))
|
|
@@ -56,23 +62,21 @@ const F = P(y), M = P(k), O = {
|
|
|
56
62
|
}, [
|
|
57
63
|
t.$slots.content ? {
|
|
58
64
|
name: "content",
|
|
59
|
-
fn:
|
|
60
|
-
|
|
61
|
-
content: o.value?.textContent
|
|
62
|
-
})
|
|
65
|
+
fn: u(() => [
|
|
66
|
+
k(t.$slots, "content", { content: c.value })
|
|
63
67
|
]),
|
|
64
68
|
key: "0"
|
|
65
69
|
} : void 0
|
|
66
70
|
]), 1040, ["is", "show", "content"]));
|
|
67
71
|
}
|
|
68
|
-
}),
|
|
72
|
+
}), I = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
69
73
|
__proto__: null
|
|
70
74
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
71
|
-
|
|
72
|
-
a.component(
|
|
75
|
+
f.install = (a) => {
|
|
76
|
+
a.component(f.name || "VkText", f);
|
|
73
77
|
};
|
|
74
78
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
f as VkText,
|
|
80
|
+
I as __VkText,
|
|
81
|
+
f as default
|
|
78
82
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_18: {}, __VLS_21: {
|
|
2
2
|
content: string;
|
|
3
3
|
};
|
|
4
4
|
type __VLS_Slots = {} & {
|
|
5
|
-
default?: (props: typeof
|
|
5
|
+
default?: (props: typeof __VLS_18) => any;
|
|
6
6
|
} & {
|
|
7
|
-
content?: (props: typeof
|
|
7
|
+
content?: (props: typeof __VLS_21) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
10
|
showArrow: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|