@opentiny/tiny-robot 0.3.0-alpha.4 → 0.3.0-alpha.5
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/dist/action-group/index.js +5 -5
- package/dist/base-popper/index.js +121 -2
- package/dist/close.js +1 -1
- package/dist/dropdown-menu/index.js +43 -43
- package/dist/feedback/index.js +1 -1
- package/dist/flow-layout-buttons/index.js +8 -8
- package/dist/history/index.js +2 -2
- package/dist/index.d.ts +103 -49
- package/dist/index2.js +6 -7
- package/dist/index3.js +306 -137
- package/dist/index4.js +591 -269
- package/dist/index5.js +2047 -528
- package/dist/index6.js +4665 -2072
- package/dist/question/index.js +1 -1
- package/dist/sender/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/index.js +186 -103
- package/dist/suggestion-popover/index.js +192 -216
- package/package.json +3 -3
- package/dist/index7.js +0 -4749
- package/dist/useSlotRefs.js +0 -36
package/dist/index4.js
CHANGED
|
@@ -1,315 +1,637 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { n as w, $ as I, y as H, S as z, Q as R, Z as _, h as W, e as U, t as L, P as Q, d as F, i as Z, j as $, k as q, l as G, a as Y, c as j, o as K, q as X, f as J, b as ee } from "./index6.js";
|
|
2
|
+
import * as N from "vue";
|
|
3
|
+
import { withDirectives as te, createVNode as M, vShow as ne } from "vue";
|
|
4
|
+
const k = (e) => e.stopPropagation(), V = ({ state: e, props: t, vm: n, slots: r }) => {
|
|
5
|
+
let p = e.referenceElm || t.reference || n.$refs.reference && n.$refs.reference.$el || n.$refs.reference;
|
|
6
|
+
return !p && r.reference && r.reference()[0] && (e.referenceElm = r.reference()[0].elm || r.reference()[0].el, p = e.referenceElm), p;
|
|
7
|
+
}, re = (e) => {
|
|
8
|
+
if (!e || !e.nodeType) return;
|
|
9
|
+
let t = (p) => parseInt(window.getComputedStyle(p).zIndex, 10) || 0, n = t(e), r;
|
|
10
|
+
do {
|
|
11
|
+
if (e = e.parentNode, e && e instanceof ShadowRoot && e.host && (e = e.host), e)
|
|
12
|
+
r = t(e);
|
|
13
|
+
else
|
|
14
|
+
break;
|
|
15
|
+
n = r > n ? r : n;
|
|
16
|
+
} while (e !== document.body);
|
|
17
|
+
return n + 1 + "";
|
|
18
|
+
}, oe = (e) => {
|
|
19
|
+
const {
|
|
20
|
+
parent: t,
|
|
21
|
+
emit: n,
|
|
22
|
+
nextTick: r,
|
|
23
|
+
onBeforeUnmount: p,
|
|
24
|
+
onDeactivated: c,
|
|
25
|
+
props: o,
|
|
26
|
+
watch: y,
|
|
27
|
+
reactive: f,
|
|
28
|
+
vm: i,
|
|
29
|
+
slots: m,
|
|
30
|
+
toRefs: h,
|
|
31
|
+
popperVmRef: g
|
|
32
|
+
} = e, a = f({
|
|
33
|
+
popperJS: null,
|
|
34
|
+
appended: !1,
|
|
35
|
+
// arrow 是否添加
|
|
36
|
+
popperElm: null,
|
|
37
|
+
showPopper: o.manual ? !!o.modelValue : !1,
|
|
38
|
+
referenceElm: null,
|
|
39
|
+
currentPlacement: ""
|
|
40
|
+
}), s = (l) => {
|
|
41
|
+
if (a.appended)
|
|
42
|
+
return;
|
|
43
|
+
a.appended = !0;
|
|
44
|
+
const u = document.createElement("div");
|
|
45
|
+
u.setAttribute("x-arrow", ""), u.className = "popper__arrow", l.appendChild(u);
|
|
46
|
+
}, b = (l) => {
|
|
47
|
+
const { followReferenceHide: u = !0 } = (o == null ? void 0 : o.popperOptions) || {}, { _popper: v, _reference: d } = l;
|
|
48
|
+
u && H(d) && (v.style.display = "none");
|
|
49
|
+
}, P = (l) => o.zIndex === "relative" ? re(l) : I.nextZIndex(), B = (l) => {
|
|
50
|
+
if (z || (a.currentPlacement = a.currentPlacement || o.placement, !/^(top|bottom|left|right)(-start|-end)?$/g.test(a.currentPlacement)))
|
|
51
|
+
return;
|
|
52
|
+
const u = o.popperOptions || { gpuAcceleration: !1 };
|
|
53
|
+
a.popperElm = a.popperElm || o.popper || i.$refs.popper || g.popper || l;
|
|
54
|
+
const v = a.popperElm;
|
|
55
|
+
let d = V({ state: a, props: o, vm: i, slots: m });
|
|
56
|
+
!v || !d || d.nodeType !== Node.ELEMENT_NODE || (o.visibleArrow && s(v), o.appendToBody || o.popperAppendToBody ? document.body.appendChild(a.popperElm) : (t && t.$el && t.$el.appendChild(a.popperElm), u.forceAbsolute = !0), u.placement = a.currentPlacement, u.offset = o.offset || 0, u.arrowOffset = o.arrowOffset || 0, u.adjustArrow = o.adjustArrow || !1, u.appendToBody = o.appendToBody || o.popperAppendToBody, a.popperJS = new R(d, v, u), n("created", a), typeof u.onUpdate == "function" && a.popperJS.onUpdate(u.onUpdate), a.popperJS._popper.style.zIndex = P(a.popperJS._reference), b(a.popperJS), _(a.popperElm, "click", k));
|
|
57
|
+
}, S = (l) => {
|
|
58
|
+
l && l !== !0 && (a.popperElm = l);
|
|
59
|
+
const u = a.popperJS;
|
|
60
|
+
u ? (u._reference = V({ state: a, props: o, vm: i, slots: m }), u.update(), u._popper && l !== !0 && (u._popper.style.zIndex = P(u._reference), b(a.popperJS))) : B(l && l !== !0 ? l : void 0);
|
|
61
|
+
}, E = (l) => {
|
|
62
|
+
!a.popperJS || a.showPopper && !l || (a.popperJS.destroy(), a.popperJS = null);
|
|
63
|
+
}, x = (l) => {
|
|
64
|
+
l && a.popperElm && a.popperElm.parentNode === document.body && (w(a.popperElm, "click", k), a.popperElm.remove());
|
|
36
65
|
};
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"stop-color": "#191919"
|
|
62
|
-
})])],
|
|
63
|
-
-1
|
|
64
|
-
/* HOISTED */
|
|
65
|
-
), P = /* @__PURE__ */ r(
|
|
66
|
-
"mask",
|
|
67
|
-
{
|
|
68
|
-
fill: "none",
|
|
69
|
-
id: "loading-shadow_svg__b",
|
|
70
|
-
"mask-type": "alpha",
|
|
71
|
-
maskUnits: "userSpaceOnUse",
|
|
72
|
-
x: "0",
|
|
73
|
-
y: "0"
|
|
74
|
-
},
|
|
75
|
-
[/* @__PURE__ */ r("path", {
|
|
76
|
-
fill: "url(#loading-shadow_svg__a)",
|
|
77
|
-
d: "M16 1.2c1 0 1.8.8 1.8 1.8S17 4.8 16 4.8C9.8 4.8 4.8 9.8 4.8 16s5 11.2 11.2 11.2 11.2-5 11.2-11.2c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8c0 8.2-6.6 14.8-14.8 14.8S1.2 24.2 1.2 16 7.8 1.2 16 1.2Z"
|
|
78
|
-
}, [/* @__PURE__ */ r("animateTransform", {
|
|
79
|
-
attributeName: "transform",
|
|
80
|
-
attributeType: "XML",
|
|
81
|
-
type: "rotate",
|
|
82
|
-
from: "0 16 16",
|
|
83
|
-
to: "360 16 16",
|
|
84
|
-
dur: "1s",
|
|
85
|
-
repeatCount: "indefinite"
|
|
86
|
-
})])],
|
|
87
|
-
-1
|
|
88
|
-
/* HOISTED */
|
|
89
|
-
), Z = /* @__PURE__ */ r(
|
|
90
|
-
"g",
|
|
91
|
-
{
|
|
92
|
-
mask: "url(#loading-shadow_svg__b)"
|
|
93
|
-
},
|
|
94
|
-
[/* @__PURE__ */ r("path", {
|
|
95
|
-
d: "M-.1 32H32V-.11H-.1V32Z",
|
|
96
|
-
"fill-rule": "evenodd"
|
|
97
|
-
})],
|
|
98
|
-
-1
|
|
99
|
-
/* HOISTED */
|
|
100
|
-
), R = [V, P, Z];
|
|
101
|
-
function X(e, t) {
|
|
102
|
-
return f(), w("svg", H, [].concat(R));
|
|
103
|
-
}
|
|
104
|
-
var Y = {
|
|
105
|
-
render: X
|
|
106
|
-
}, q = function() {
|
|
107
|
-
return C({
|
|
108
|
-
name: "IconLoadingShadow",
|
|
109
|
-
component: Y
|
|
110
|
-
})();
|
|
111
|
-
};
|
|
112
|
-
function J(e, t) {
|
|
113
|
-
var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
114
|
-
if (n) return (n = n.call(e)).next.bind(n);
|
|
115
|
-
if (Array.isArray(e) || (n = K(e)) || t) {
|
|
116
|
-
n && (e = n);
|
|
117
|
-
var o = 0;
|
|
118
|
-
return function() {
|
|
119
|
-
return o >= e.length ? { done: !0 } : { done: !1, value: e[o++] };
|
|
120
|
-
};
|
|
66
|
+
return y(
|
|
67
|
+
() => a.showPopper,
|
|
68
|
+
(l) => {
|
|
69
|
+
o.disabled || (l && r(S), o.trigger === "manual" && n("update:modelValue", l));
|
|
70
|
+
}
|
|
71
|
+
), y(
|
|
72
|
+
() => o.placement,
|
|
73
|
+
(l) => {
|
|
74
|
+
var u;
|
|
75
|
+
a.currentPlacement = l, (u = a.popperJS) == null || u.setOptions({ placement: l }), !o.disabled && (l && r(S), o.trigger === "manual" && n("update:modelValue", l));
|
|
76
|
+
}
|
|
77
|
+
), p(() => {
|
|
78
|
+
r(() => {
|
|
79
|
+
E(!0), (o.appendToBody || o.popperAppendToBody) && x("remove");
|
|
80
|
+
});
|
|
81
|
+
}), c(() => {
|
|
82
|
+
E(!0), (o.appendToBody || o.popperAppendToBody) && x("remove");
|
|
83
|
+
}), { updatePopper: S, destroyPopper: x, doDestroy: E, ...h(a) };
|
|
84
|
+
}, ae = ({ api: e, state: t, props: n }) => (r) => {
|
|
85
|
+
const c = r && r.type === "mouseenter" ? 200 : 0;
|
|
86
|
+
if (n.visible === "auto") {
|
|
87
|
+
const { clientWidth: o, scrollWidth: y } = t.referenceElm;
|
|
88
|
+
if (y <= o)
|
|
89
|
+
return;
|
|
121
90
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
91
|
+
e.setExpectedState(!0), e.handleShowPopper(c);
|
|
92
|
+
}, pe = (e) => () => {
|
|
93
|
+
e.setExpectedState(!1), e.debounceClose();
|
|
94
|
+
}, le = ({ api: e, state: t }) => () => {
|
|
95
|
+
t.focusing = !0, e.show();
|
|
96
|
+
}, ue = ({ api: e, state: t }) => () => {
|
|
97
|
+
t.focusing = !1, e.hide();
|
|
98
|
+
}, se = ({ api: e, state: t }) => () => {
|
|
99
|
+
t.focusing = !1, e.show();
|
|
100
|
+
}, ie = ({ props: e, state: t }) => (n) => {
|
|
101
|
+
!t.expectedState || e.manual || (clearTimeout(t.timeout), t.timeout = window.setTimeout(() => {
|
|
102
|
+
t.showPopper = !0;
|
|
103
|
+
}, e.openDelay || n), e.hideAfter > 0 && (t.timeoutPending = window.setTimeout(() => {
|
|
104
|
+
t.showPopper = !1;
|
|
105
|
+
}, e.hideAfter)));
|
|
106
|
+
}, de = ({ api: e, props: t, state: n }) => () => {
|
|
107
|
+
t.enterable && n.expectedState || t.manual || (clearTimeout(n.timeout), n.timeoutPending && clearTimeout(n.timeoutPending), n.showPopper = !1, t.disabled && e.doDestroy());
|
|
108
|
+
}, fe = ({ props: e, api: t, state: n, popperVmRef: r }) => (p) => {
|
|
109
|
+
if (e.manual)
|
|
110
|
+
return;
|
|
111
|
+
const c = n.referenceElm, o = r.popper;
|
|
112
|
+
!o || !c || o.contains(p.target) || c.contains(p.target) || n.showPopper && (t.setExpectedState(!1), t.debounceClose());
|
|
113
|
+
}, ce = ({ state: e }) => (t) => {
|
|
114
|
+
e.expectedState === !1 && clearTimeout(e.timeoutPending), e.expectedState = t;
|
|
115
|
+
}, me = ({ state: e, api: t, vm: n }) => () => {
|
|
116
|
+
const r = e.referenceElm;
|
|
117
|
+
e.showPopper = !1, r && r.nodeType === 1 && (w(document, "click", t.handleDocumentClick), w(r, "mouseenter", t.show), w(r, "mouseleave", t.hide), w(r, "focus", t.focusHandler), w(r, "blur", t.handleBlur), w(r, "click", t.removeFocusing)), n.popperVM && (typeof n.popperVM.$destroy == "function" && n.popperVM.$destroy(), n.popperVM = null);
|
|
118
|
+
}, ye = ({ api: e, props: t }) => W(t.closeDelay, () => {
|
|
119
|
+
e.handleClosePopper();
|
|
120
|
+
}), be = (e) => (t) => {
|
|
121
|
+
t ? U(e.referenceElm, "focusing") : L(e.referenceElm, "focusing");
|
|
122
|
+
}, he = ({ slots: e, api: t }) => () => {
|
|
123
|
+
if (!e.default || !e.default().length) {
|
|
124
|
+
t.handleFocus();
|
|
125
|
+
return;
|
|
130
126
|
}
|
|
127
|
+
let n = e.default()[0];
|
|
128
|
+
n = n.elm || n.el, n && n.focus ? n.focus() : t.handleFocus();
|
|
129
|
+
}, ge = ({ api: e, state: t, vm: n }) => (r) => {
|
|
130
|
+
let p = null;
|
|
131
|
+
n.$el.nodeType === 8 ? p = r : n.$el.nodeType === 1 && (p = n.$el), !(!p || p.nodeType === 8 || t.referenceElm) && (t.referenceElm = p, p.setAttribute("aria-describedby", t.tooltipId), p.setAttribute("tabindex", t.tabindex.toString()), _(document, "click", e.handleDocumentClick), _(p, "mouseenter", e.show), _(p, "mouseleave", e.hide), _(p, "focus", e.focusHandler), _(p, "blur", e.handleBlur), _(p, "click", e.removeFocusing));
|
|
132
|
+
}, ve = ({ state: e, popperVmRef: t }) => (n) => {
|
|
133
|
+
for (let r of n)
|
|
134
|
+
r.type === "attributes" && r.attributeName === "x-placement" && (e.xPlacement = t.popper.getAttribute("x-placement") || "bottom");
|
|
135
|
+
}, we = ({ vm: e, nextTick: t, popperVmRef: n }) => (r) => {
|
|
136
|
+
t(() => e.bindEvent(r));
|
|
137
|
+
let p = e.popperVM;
|
|
138
|
+
e.$refs.popper ? n.popper = e.$refs.popper : n.popper = p.$el, t(() => {
|
|
139
|
+
e.modelValue && e.updatePopper();
|
|
140
|
+
});
|
|
141
|
+
}, _e = [
|
|
142
|
+
"state",
|
|
143
|
+
"bindEvent",
|
|
144
|
+
"hide",
|
|
145
|
+
"show",
|
|
146
|
+
"doDestroy",
|
|
147
|
+
"handleFocus",
|
|
148
|
+
"debounceClose",
|
|
149
|
+
"handleShowPopper",
|
|
150
|
+
"handleClosePopper",
|
|
151
|
+
"setExpectedState",
|
|
152
|
+
"updatePopper",
|
|
153
|
+
"focusHandler"
|
|
154
|
+
], Pe = ({ reactive: e, showPopper: t, popperElm: n, referenceElm: r, props: p, inject: c, popperJS: o, currentPlacement: y }) => e({
|
|
155
|
+
popperJS: o,
|
|
156
|
+
showPopper: t,
|
|
157
|
+
popperElm: n,
|
|
158
|
+
referenceElm: r,
|
|
159
|
+
currentPlacement: y,
|
|
160
|
+
timeout: null,
|
|
161
|
+
focusing: !1,
|
|
162
|
+
expectedState: void 0,
|
|
163
|
+
tooltipId: Q("tiny-tooltip-", 4),
|
|
164
|
+
tabindex: p.tabindex,
|
|
165
|
+
xPlacement: "bottom",
|
|
166
|
+
showContent: c("showContent", null),
|
|
167
|
+
tipsMaxWidth: c("tips-max-width", null)
|
|
168
|
+
}), Se = (e, {
|
|
169
|
+
watch: t,
|
|
170
|
+
toRefs: n,
|
|
171
|
+
reactive: r,
|
|
172
|
+
onBeforeUnmount: p,
|
|
173
|
+
onDeactivated: c,
|
|
174
|
+
onMounted: o,
|
|
175
|
+
onUnmounted: y,
|
|
176
|
+
inject: f
|
|
177
|
+
}, { vm: i, emit: m, slots: h, nextTick: g, parent: a }) => {
|
|
178
|
+
const s = {}, b = {}, P = { emit: m, props: e, nextTick: g, toRefs: n, reactive: r, parent: a.$parent, vm: i, popperVmRef: b };
|
|
179
|
+
Object.assign(P, { slots: h, onBeforeUnmount: p, onDeactivated: c, watch: t });
|
|
180
|
+
const { showPopper: B, updatePopper: S, popperElm: E, referenceElm: x, doDestroy: l, popperJS: u, currentPlacement: v } = oe(
|
|
181
|
+
P
|
|
182
|
+
), d = Pe({
|
|
183
|
+
reactive: r,
|
|
184
|
+
showPopper: B,
|
|
185
|
+
popperElm: E,
|
|
186
|
+
referenceElm: x,
|
|
187
|
+
props: e,
|
|
188
|
+
inject: f,
|
|
189
|
+
popperJS: u,
|
|
190
|
+
currentPlacement: v
|
|
191
|
+
});
|
|
192
|
+
return Object.assign(s, {
|
|
193
|
+
state: d,
|
|
194
|
+
doDestroy: l,
|
|
195
|
+
updatePopper: S,
|
|
196
|
+
show: ae({ api: s, state: d, props: e }),
|
|
197
|
+
hide: pe(s),
|
|
198
|
+
destroyed: me({ state: d, api: s, vm: i }),
|
|
199
|
+
bindPopper: we({ vm: i, nextTick: g, popperVmRef: b }),
|
|
200
|
+
watchFocusing: be(d),
|
|
201
|
+
removeFocusing: se({ api: s, state: d }),
|
|
202
|
+
handleBlur: ue({ api: s, state: d }),
|
|
203
|
+
handleFocus: le({ api: s, state: d }),
|
|
204
|
+
debounceClose: ye({ api: s, props: e }),
|
|
205
|
+
setExpectedState: ce({ state: d }),
|
|
206
|
+
handleShowPopper: ie({ props: e, state: d }),
|
|
207
|
+
handleClosePopper: de({ api: s, props: e, state: d }),
|
|
208
|
+
bindEvent: ge({ api: s, state: d, vm: i }),
|
|
209
|
+
focusHandler: he({ slots: h, api: s }),
|
|
210
|
+
handleDocumentClick: fe({ props: e, api: s, state: d, popperVmRef: b }),
|
|
211
|
+
observeCallback: ve({ state: d, popperVmRef: b })
|
|
212
|
+
}), t(() => d.focusing, s.watchFocusing), t(
|
|
213
|
+
() => e.modelValue,
|
|
214
|
+
(T) => g(() => e.manual && (d.showPopper = T))
|
|
215
|
+
), o(() => {
|
|
216
|
+
if (s.bindPopper(), e.genArrowByHtml) {
|
|
217
|
+
const T = { attributes: !0, childList: !1, subtree: !1 };
|
|
218
|
+
s.observer = new MutationObserver(s.observeCallback), s.observer.observe(b.popper, T);
|
|
219
|
+
}
|
|
220
|
+
}), i.$on("tooltip-update", s.bindPopper), y(() => {
|
|
221
|
+
s.destroyed(), s.observer && s.observer.disconnect(), i.$off("tooltip-update");
|
|
222
|
+
}), s;
|
|
223
|
+
};
|
|
224
|
+
function O() {
|
|
225
|
+
return O = Object.assign ? Object.assign.bind() : function(e) {
|
|
226
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
227
|
+
var n = arguments[t];
|
|
228
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
229
|
+
}
|
|
230
|
+
return e;
|
|
231
|
+
}, O.apply(null, arguments);
|
|
131
232
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
233
|
+
var A = /* @__PURE__ */ F({
|
|
234
|
+
name: j + "Tooltip",
|
|
235
|
+
componentName: "Tooltip",
|
|
236
|
+
props: O({}, J, {
|
|
237
|
+
visible: {
|
|
238
|
+
type: String,
|
|
239
|
+
default: function() {
|
|
240
|
+
return "always";
|
|
241
|
+
},
|
|
242
|
+
validator: function(t) {
|
|
243
|
+
return ["always", "auto"].includes(t);
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
adjustArrow: {
|
|
247
|
+
type: Boolean,
|
|
248
|
+
default: function() {
|
|
249
|
+
return !1;
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
appendToBody: {
|
|
253
|
+
type: Boolean,
|
|
254
|
+
default: function() {
|
|
255
|
+
return !0;
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
arrowOffset: {
|
|
259
|
+
type: Number,
|
|
260
|
+
default: function() {
|
|
261
|
+
return 0;
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
boundariesPadding: {
|
|
265
|
+
type: Number,
|
|
266
|
+
default: function() {
|
|
267
|
+
return 5;
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
closeDelay: {
|
|
271
|
+
type: Number,
|
|
272
|
+
default: function() {
|
|
273
|
+
return 300;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
content: {
|
|
277
|
+
type: [String, Object]
|
|
278
|
+
},
|
|
279
|
+
disabled: {
|
|
280
|
+
type: Boolean
|
|
281
|
+
},
|
|
282
|
+
effect: {
|
|
283
|
+
type: String,
|
|
284
|
+
default: function() {
|
|
285
|
+
return "dark";
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
enterable: {
|
|
289
|
+
type: Boolean,
|
|
290
|
+
default: function() {
|
|
291
|
+
return !0;
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
hideAfter: {
|
|
295
|
+
type: Number,
|
|
296
|
+
default: function() {
|
|
297
|
+
return 0;
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
manual: {
|
|
301
|
+
type: Boolean
|
|
302
|
+
},
|
|
303
|
+
modelValue: {
|
|
304
|
+
type: Boolean
|
|
305
|
+
},
|
|
306
|
+
offset: {
|
|
307
|
+
default: function() {
|
|
308
|
+
return 0;
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
openDelay: {
|
|
312
|
+
type: Number,
|
|
313
|
+
default: function() {
|
|
314
|
+
return 0;
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
placement: {
|
|
318
|
+
type: String,
|
|
319
|
+
default: function() {
|
|
320
|
+
return "bottom";
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
popper: {},
|
|
324
|
+
popperClass: {
|
|
325
|
+
type: String
|
|
326
|
+
},
|
|
327
|
+
popperOptions: {
|
|
328
|
+
default: function() {
|
|
329
|
+
return {
|
|
330
|
+
gpuAcceleration: !1,
|
|
331
|
+
boundariesPadding: 10
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
pre: {
|
|
336
|
+
type: Boolean
|
|
337
|
+
},
|
|
338
|
+
reference: {},
|
|
339
|
+
renderContent: {
|
|
340
|
+
type: Function
|
|
341
|
+
},
|
|
342
|
+
tabindex: {
|
|
343
|
+
type: Number,
|
|
344
|
+
default: function() {
|
|
345
|
+
return 0;
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
transition: {
|
|
349
|
+
type: String,
|
|
350
|
+
default: function() {
|
|
351
|
+
return "tiny-fade-in-linear";
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
type: {
|
|
355
|
+
type: String,
|
|
356
|
+
validator: function(t) {
|
|
357
|
+
return !!~["normal", "warning", "error", "info", "success"].indexOf(t);
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
visibleArrow: {
|
|
361
|
+
type: Boolean,
|
|
362
|
+
default: function() {
|
|
363
|
+
return !0;
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
zIndex: {
|
|
367
|
+
type: String,
|
|
368
|
+
default: function() {
|
|
369
|
+
return "next";
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
contentMaxHeight: {
|
|
373
|
+
type: String
|
|
374
|
+
}
|
|
375
|
+
}),
|
|
149
376
|
setup: function(t, n) {
|
|
150
|
-
return
|
|
377
|
+
return Y({
|
|
151
378
|
props: t,
|
|
152
379
|
context: n,
|
|
153
|
-
renderless:
|
|
154
|
-
api:
|
|
380
|
+
renderless: Se,
|
|
381
|
+
api: _e
|
|
155
382
|
});
|
|
383
|
+
},
|
|
384
|
+
render: function() {
|
|
385
|
+
var t = this, n = function(f) {
|
|
386
|
+
var i = f.slots.content && f.slots.content();
|
|
387
|
+
if (i && (!N.Comment || i[0].type !== N.Comment))
|
|
388
|
+
return i;
|
|
389
|
+
var m;
|
|
390
|
+
return f.renderContent ? m = f.renderContent($, f.content) : f.pre ? m = f.content ? $("pre", f.content) : null : m = f.content, m;
|
|
391
|
+
};
|
|
392
|
+
if (!Object.prototype.hasOwnProperty.call(this, "popperVM")) {
|
|
393
|
+
var r = {
|
|
394
|
+
value: null
|
|
395
|
+
};
|
|
396
|
+
this.d({
|
|
397
|
+
popperVM: {
|
|
398
|
+
get: function() {
|
|
399
|
+
return r.value || (r.value = Z({
|
|
400
|
+
el: document.createElement("div"),
|
|
401
|
+
propsData: null,
|
|
402
|
+
component: {
|
|
403
|
+
render: function() {
|
|
404
|
+
var i = n(t), m = typeof i == "string", h = {
|
|
405
|
+
attrs: {
|
|
406
|
+
name: t.transition
|
|
407
|
+
},
|
|
408
|
+
on: {
|
|
409
|
+
"after-leave": t.doDestroy
|
|
410
|
+
}
|
|
411
|
+
}, g = "is-" + (t.type || t.effect || "dark"), a = function() {
|
|
412
|
+
return t.setExpectedState(!0);
|
|
413
|
+
}, s = function() {
|
|
414
|
+
t.setExpectedState(!1), t.debounceClose();
|
|
415
|
+
};
|
|
416
|
+
return t.$nextTick(function() {
|
|
417
|
+
!t.disabled && t.state.showPopper && i && t.updatePopper();
|
|
418
|
+
}), $("transition", h, [te(M("div", {
|
|
419
|
+
ref: "popper",
|
|
420
|
+
id: t.state.tooltipId,
|
|
421
|
+
class: ["tiny-tooltip", "tiny-tooltip__popper", g, t.popperClass, {
|
|
422
|
+
"tiny-tooltip__show-tips": t.state.showContent
|
|
423
|
+
}],
|
|
424
|
+
style: "max-width:" + t.state.tipsMaxWidth + "px",
|
|
425
|
+
role: "tooltip",
|
|
426
|
+
"aria-hidden": t.disabled || !t.state.showPopper ? "true" : "false",
|
|
427
|
+
onMouseenter: function() {
|
|
428
|
+
return a();
|
|
429
|
+
},
|
|
430
|
+
onMouseleave: function() {
|
|
431
|
+
return s();
|
|
432
|
+
}
|
|
433
|
+
}, [m ? M("div", {
|
|
434
|
+
class: "tiny-tooltip__content-wrapper",
|
|
435
|
+
style: "max-height:" + t.contentMaxHeight + ";"
|
|
436
|
+
}, [i]) : i]), [[ne, !t.disabled && t.state.showPopper && i]])]);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
})), r.value;
|
|
440
|
+
},
|
|
441
|
+
set: function(f) {
|
|
442
|
+
return r.value = f;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
var p = function() {
|
|
448
|
+
var f = t.slots.default && t.slots.default();
|
|
449
|
+
if (!Array.isArray(f)) return null;
|
|
450
|
+
for (var i = null, m = 0; m < f.length; m++) {
|
|
451
|
+
var h = K(f[m]);
|
|
452
|
+
if (!X(h)) {
|
|
453
|
+
i = h;
|
|
454
|
+
break;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
return i;
|
|
458
|
+
}, c = p();
|
|
459
|
+
if (!c) return null;
|
|
460
|
+
var o = c.data || c.props || (c.props = {});
|
|
461
|
+
return o.class = q("tiny-tooltip " + G(o.class)), c;
|
|
156
462
|
}
|
|
157
|
-
})
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
return f(), w("button", I({
|
|
161
|
-
class: ["tiny-button", [e.type ? "tiny-button--" + e.type : "", e.size ? "tiny-button--" + e.size : "", {
|
|
162
|
-
"is-disabled": e.state.buttonDisabled,
|
|
163
|
-
"is-loading": e.loading,
|
|
164
|
-
"is-plain": e.state.plain,
|
|
165
|
-
"is-ghost": e.ghost,
|
|
166
|
-
"is-round": e.state.round,
|
|
167
|
-
"is-circle": e.circle,
|
|
168
|
-
"is-icon": e.icon && !e.loading && (e.text || e.slots.default),
|
|
169
|
-
"is-only-icon": e.icon && !e.loading && !(e.text || e.slots.default)
|
|
170
|
-
}]],
|
|
171
|
-
onClick: t[0] || (t[0] = function() {
|
|
172
|
-
return e.handleClick && e.handleClick.apply(e, arguments);
|
|
173
|
-
}),
|
|
174
|
-
disabled: e.state.buttonDisabled || e.loading,
|
|
175
|
-
autofocus: e.autofocus,
|
|
176
|
-
type: e.nativeType,
|
|
177
|
-
style: e.customStyle,
|
|
178
|
-
tabindex: e.tabindex
|
|
179
|
-
}, e.a(e.$attrs, ["class", "style", "title", "id"], !0)), [e.loading ? (f(), h(l, {
|
|
180
|
-
key: 0,
|
|
181
|
-
class: "tiny-icon-loading tiny-svg-size"
|
|
182
|
-
})) : T("v-if", !0), e.icon && !e.loading ? (f(), h(L(e.icon), {
|
|
183
|
-
key: 1,
|
|
184
|
-
class: M({
|
|
185
|
-
"is-text": e.text || e.slots.default
|
|
186
|
-
})
|
|
187
|
-
}, null, 8, ["class"])) : T("v-if", !0), E(e.$slots, "default", {}, function() {
|
|
188
|
-
return [r(
|
|
189
|
-
"span",
|
|
190
|
-
null,
|
|
191
|
-
U(e.text),
|
|
192
|
-
1
|
|
193
|
-
/* TEXT */
|
|
194
|
-
)];
|
|
195
|
-
})], 16, x);
|
|
196
|
-
}
|
|
197
|
-
var m = /* @__PURE__ */ Q(W, [["render", ee]]);
|
|
198
|
-
function y() {
|
|
199
|
-
return y = Object.assign ? Object.assign.bind() : function(e) {
|
|
463
|
+
});
|
|
464
|
+
function D() {
|
|
465
|
+
return D = Object.assign ? Object.assign.bind() : function(e) {
|
|
200
466
|
for (var t = 1; t < arguments.length; t++) {
|
|
201
467
|
var n = arguments[t];
|
|
202
|
-
for (var
|
|
468
|
+
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
203
469
|
}
|
|
204
470
|
return e;
|
|
205
|
-
},
|
|
471
|
+
}, D.apply(null, arguments);
|
|
206
472
|
}
|
|
207
|
-
var
|
|
208
|
-
var n,
|
|
209
|
-
return
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
type: {
|
|
473
|
+
var Ee = function(t) {
|
|
474
|
+
var n, r = typeof process == "object" ? (n = process.env) == null ? void 0 : n.TINY_MODE : null;
|
|
475
|
+
return A;
|
|
476
|
+
}, xe = D({}, J, {
|
|
477
|
+
visible: {
|
|
213
478
|
type: String,
|
|
214
|
-
default:
|
|
479
|
+
default: function() {
|
|
480
|
+
return "always";
|
|
481
|
+
},
|
|
482
|
+
validator: function(t) {
|
|
483
|
+
return ["always", "auto"].includes(t);
|
|
484
|
+
}
|
|
215
485
|
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
486
|
+
adjustArrow: {
|
|
487
|
+
type: Boolean,
|
|
488
|
+
default: function() {
|
|
489
|
+
return !1;
|
|
490
|
+
}
|
|
220
491
|
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
492
|
+
appendToBody: {
|
|
493
|
+
type: Boolean,
|
|
494
|
+
default: function() {
|
|
495
|
+
return !0;
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
arrowOffset: {
|
|
499
|
+
type: Number,
|
|
500
|
+
default: function() {
|
|
501
|
+
return 0;
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
content: {
|
|
505
|
+
type: [String, Object]
|
|
506
|
+
},
|
|
507
|
+
disabled: {
|
|
508
|
+
type: Boolean
|
|
509
|
+
},
|
|
510
|
+
enterable: {
|
|
511
|
+
type: Boolean,
|
|
512
|
+
default: function() {
|
|
513
|
+
return !0;
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
hideAfter: {
|
|
517
|
+
type: Number,
|
|
518
|
+
default: function() {
|
|
519
|
+
return 0;
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
manual: {
|
|
523
|
+
type: Boolean
|
|
524
|
+
},
|
|
525
|
+
modelValue: {
|
|
526
|
+
type: Boolean
|
|
527
|
+
},
|
|
528
|
+
offset: {
|
|
529
|
+
default: function() {
|
|
530
|
+
return 0;
|
|
531
|
+
}
|
|
225
532
|
},
|
|
226
|
-
|
|
227
|
-
text: {
|
|
533
|
+
effect: {
|
|
228
534
|
type: String,
|
|
229
|
-
default:
|
|
535
|
+
default: function() {
|
|
536
|
+
return "";
|
|
537
|
+
}
|
|
230
538
|
},
|
|
231
|
-
|
|
232
|
-
resetTime: {
|
|
539
|
+
openDelay: {
|
|
233
540
|
type: Number,
|
|
234
|
-
default:
|
|
541
|
+
default: function() {
|
|
542
|
+
return 0;
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
closeDelay: {
|
|
546
|
+
type: Number,
|
|
547
|
+
default: function() {
|
|
548
|
+
return 100;
|
|
549
|
+
}
|
|
235
550
|
},
|
|
236
|
-
|
|
237
|
-
nativeType: {
|
|
551
|
+
placement: {
|
|
238
552
|
type: String,
|
|
239
|
-
default:
|
|
553
|
+
default: function() {
|
|
554
|
+
return "bottom";
|
|
555
|
+
}
|
|
240
556
|
},
|
|
241
|
-
|
|
242
|
-
|
|
557
|
+
popper: {},
|
|
558
|
+
popperClass: {
|
|
559
|
+
type: String
|
|
560
|
+
},
|
|
561
|
+
popperOptions: {
|
|
562
|
+
default: function() {
|
|
563
|
+
return {};
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
pre: {
|
|
567
|
+
type: Boolean
|
|
568
|
+
},
|
|
569
|
+
reference: {},
|
|
570
|
+
renderContent: {
|
|
571
|
+
type: Function
|
|
572
|
+
},
|
|
573
|
+
tabindex: {
|
|
574
|
+
type: Number,
|
|
575
|
+
default: function() {
|
|
576
|
+
return 0;
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
transition: {
|
|
243
580
|
type: String,
|
|
244
|
-
default:
|
|
581
|
+
default: function() {
|
|
582
|
+
return "tiny-fade-in-linear";
|
|
583
|
+
}
|
|
245
584
|
},
|
|
246
|
-
|
|
247
|
-
size: {
|
|
585
|
+
type: {
|
|
248
586
|
type: String,
|
|
249
|
-
default: "",
|
|
250
587
|
validator: function(t) {
|
|
251
|
-
return ["
|
|
588
|
+
return !!~["normal", "warning", "error", "info", "success"].indexOf(t);
|
|
252
589
|
}
|
|
253
590
|
},
|
|
254
|
-
|
|
255
|
-
round: {
|
|
591
|
+
visibleArrow: {
|
|
256
592
|
type: Boolean,
|
|
257
|
-
default:
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
plain: Boolean,
|
|
261
|
-
/** 是否圆形按钮 */
|
|
262
|
-
circle: Boolean,
|
|
263
|
-
/** 是否加载中状态 */
|
|
264
|
-
loading: Boolean,
|
|
265
|
-
/** 是否被禁用按钮 */
|
|
266
|
-
disabled: Boolean,
|
|
267
|
-
/** 是否默认聚焦 */
|
|
268
|
-
autofocus: Boolean,
|
|
269
|
-
/** 自定义类名, 仅 mobile-first 模板时有效 */
|
|
270
|
-
customClass: {
|
|
271
|
-
type: String,
|
|
272
|
-
default: ""
|
|
593
|
+
default: function() {
|
|
594
|
+
return !0;
|
|
595
|
+
}
|
|
273
596
|
},
|
|
274
|
-
|
|
275
|
-
banner: {
|
|
597
|
+
genArrowByHtml: {
|
|
276
598
|
type: Boolean,
|
|
277
|
-
default: !1
|
|
278
|
-
},
|
|
279
|
-
/** 自定义样式 */
|
|
280
|
-
customStyle: {
|
|
281
|
-
type: Object,
|
|
282
599
|
default: function() {
|
|
283
|
-
return
|
|
600
|
+
return !0;
|
|
284
601
|
}
|
|
285
602
|
},
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
type: Function
|
|
291
|
-
}
|
|
292
|
-
}), p = k({
|
|
293
|
-
name: A + "Button",
|
|
294
|
-
inject: {
|
|
295
|
-
buttonGroup: {
|
|
296
|
-
default: ""
|
|
603
|
+
zIndex: {
|
|
604
|
+
type: String,
|
|
605
|
+
default: function() {
|
|
606
|
+
return "next";
|
|
297
607
|
}
|
|
298
608
|
},
|
|
299
|
-
|
|
300
|
-
|
|
609
|
+
contentMaxHeight: {
|
|
610
|
+
type: String,
|
|
611
|
+
default: function() {
|
|
612
|
+
return "80vh";
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}), C = F({
|
|
616
|
+
name: j + "Tooltip",
|
|
617
|
+
componentName: "Tooltip",
|
|
618
|
+
props: xe,
|
|
301
619
|
setup: function(t, n) {
|
|
302
|
-
return
|
|
620
|
+
return ee({
|
|
303
621
|
props: t,
|
|
304
622
|
context: n,
|
|
305
|
-
template:
|
|
623
|
+
template: Ee
|
|
306
624
|
});
|
|
307
625
|
}
|
|
308
|
-
}),
|
|
309
|
-
|
|
310
|
-
|
|
626
|
+
}), Ce = "3.undefined";
|
|
627
|
+
C.model = {
|
|
628
|
+
prop: "modelValue",
|
|
629
|
+
event: "update:modelValue"
|
|
630
|
+
};
|
|
631
|
+
C.install = function(e) {
|
|
632
|
+
e.component(C.name, C);
|
|
311
633
|
};
|
|
312
|
-
|
|
634
|
+
C.version = Ce;
|
|
313
635
|
export {
|
|
314
|
-
|
|
636
|
+
C as T
|
|
315
637
|
};
|