@flyto/farco 1.5.2 → 1.6.0

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,169 +0,0 @@
1
- import { defineComponent as P, mergeModels as D, inject as H, ref as y, computed as k, onMounted as M, useModel as j, watch as B, openBlock as l, createBlock as _, unref as r, withCtx as x, createElementVNode as E, mergeProps as F, createCommentVNode as g, normalizeClass as R, normalizeStyle as I, createVNode as b, resolveDynamicComponent as S, createElementBlock as c, toDisplayString as T, renderSlot as z } from "vue";
2
- import { TypographyText as A, Tooltip as L } from "@arco-design/web-vue";
3
- import { s as N } from "./chunk-0ec0668f.js";
4
- import { a as U } from "./chunk-c9e8fc0f.js";
5
- import { _ as V } from "./chunk-451afd44.js";
6
- const W = "\u6682\u65E0", $ = {
7
- ignoreEllips: {
8
- type: Boolean,
9
- default: !1
10
- },
11
- ellipsType: {
12
- type: String,
13
- default: "normal"
14
- },
15
- ellipsConfig: {
16
- type: Object,
17
- default: () => ({})
18
- },
19
- placeholder: {
20
- type: String,
21
- default: W
22
- },
23
- preIcon: {
24
- type: String,
25
- default: ""
26
- },
27
- preIconProps: {
28
- type: Object,
29
- default: () => ({})
30
- },
31
- render: {
32
- type: Function,
33
- default: null
34
- }
35
- }, K = {
36
- class: "f-text",
37
- style: { display: "flex", "align-items": "center" }
38
- }, Y = { key: 1 }, q = { key: 1 }, G = { key: 0 }, J = { key: 1 }, Q = /* @__PURE__ */ P({
39
- __name: "ftext",
40
- props: /* @__PURE__ */ D($, {
41
- modelValue: {},
42
- modelModifiers: {}
43
- }),
44
- emits: ["update:modelValue"],
45
- setup(i) {
46
- const p = H(U, null), t = i, a = y(), s = {
47
- rows: 1,
48
- type: "normal",
49
- moreText: "\u66F4\u591A",
50
- lessText: "\u6536\u8D77",
51
- moreIcon: "IconSearch"
52
- }, n = k(() => {
53
- const e = {
54
- rows: t.ellipsConfig.rows || s.rows,
55
- type: t.ellipsConfig.type || s.type
56
- };
57
- return e.type === "drawer" && t.ellipsConfig.type === "drawer" && (e.moreText = t.ellipsConfig.moreText || s.moreText, e.lessText = t.ellipsConfig.lessText || s.lessText), e.type === "popup" && t.ellipsConfig.type === "popup" && (e.moreIcon = t.ellipsConfig.moreIcon || s.moreIcon), e;
58
- }), C = y(!1), d = y(!0);
59
- function O() {
60
- const e = n.value.type;
61
- e === "drawer" ? d.value = !d.value : e === "popup" && N({
62
- content: String(f.value) || "",
63
- hideTitle: !0,
64
- width: "50%",
65
- closable: !0,
66
- footer: !1
67
- });
68
- }
69
- const u = y(!1);
70
- function h() {
71
- const e = a.value;
72
- !e || (u.value = e.clientHeight < e.scrollHeight || e.clientWidth < e.scrollWidth);
73
- }
74
- M(() => {
75
- if (!t.ignoreEllips) {
76
- const e = new ResizeObserver(h);
77
- a.value && e.observe(a.value);
78
- }
79
- });
80
- const f = j(i, "modelValue");
81
- B(f, () => {
82
- h();
83
- });
84
- const m = k({
85
- get: () => String(f.value || ""),
86
- set(e) {
87
- f.value = e;
88
- }
89
- });
90
- return (e, v) => (l(), _(r(A), {
91
- "edit-text": m.value,
92
- "onUpdate:editText": v[1] || (v[1] = (o) => m.value = o)
93
- }, {
94
- default: x(() => [
95
- E("div", K, [
96
- e.preIcon ? (l(), _(r(V), F({
97
- key: 0,
98
- class: "f-text__pre-icon",
99
- name: e.preIcon
100
- }, e.preIconProps), null, 16, ["name"])) : g("", !0),
101
- E("div", {
102
- ref_key: "contentRef",
103
- ref: a,
104
- class: R(["f-text__content", !e.ignoreEllips && d.value && "ellips"]),
105
- style: I({
106
- "-webkit-line-clamp": n.value.rows
107
- })
108
- }, [
109
- b(r(L), {
110
- "popup-visible": C.value,
111
- "onUpdate:popupVisible": v[0] || (v[0] = (o) => C.value = u.value && o)
112
- }, {
113
- content: x(() => {
114
- var o;
115
- return [
116
- t.render ? (l(), _(S(t.render), {
117
- key: 0,
118
- data: ((o = r(p)) == null ? void 0 : o.data) || {}
119
- }, null, 8, ["data"])) : (l(), c("div", Y, T(m.value), 1))
120
- ];
121
- }),
122
- default: x(() => {
123
- var o;
124
- return [
125
- z(e.$slots, "default", {
126
- data: (o = r(p)) == null ? void 0 : o.data
127
- }, () => {
128
- var w;
129
- return [
130
- t.render ? (l(), _(S(t.render), {
131
- key: 0,
132
- data: ((w = r(p)) == null ? void 0 : w.data) || {}
133
- }, null, 8, ["data"])) : (l(), c("div", q, T(m.value || e.placeholder), 1))
134
- ];
135
- }, !0)
136
- ];
137
- }),
138
- _: 3
139
- }, 8, ["popup-visible"]),
140
- ["drawer", "popup"].includes(n.value.type) && (u.value || !d.value) ? (l(), c("div", {
141
- key: 0,
142
- class: "content-more",
143
- style: I({ bottom: u.value ? "0" : "-20px" }),
144
- onClick: O
145
- }, [
146
- n.value.type === "drawer" ? (l(), c("div", G, T(u.value ? n.value.moreText : n.value.lessText), 1)) : g("", !0),
147
- n.value.type === "popup" ? (l(), c("div", J, [
148
- b(r(V), {
149
- name: n.value.moreIcon
150
- }, null, 8, ["name"])
151
- ])) : g("", !0)
152
- ], 4)) : g("", !0)
153
- ], 6)
154
- ])
155
- ]),
156
- _: 3
157
- }, 8, ["edit-text"]));
158
- }
159
- });
160
- const X = (i, p) => {
161
- const t = i.__vccOpts || i;
162
- for (const [a, s] of p)
163
- t[a] = s;
164
- return t;
165
- }, ne = /* @__PURE__ */ X(Q, [["__scopeId", "data-v-cc19d558"]]);
166
- export {
167
- ne as F,
168
- $ as f
169
- };