@opentiny/tiny-robot 0.3.0-alpha.7 → 0.3.0-alpha.8

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/index2.js CHANGED
@@ -1,621 +1,638 @@
1
- import { onMounted as oe, nextTick as fe, watch as L, getCurrentScope as ve, onScopeDispose as me, isRef as he, getCurrentInstance as B, toValue as g, hasInjectionContext as ie, inject as pe, shallowRef as y, computed as _, reactive as Z, unref as we, watchEffect as se } from "vue";
2
- function V(e) {
3
- return ve() ? (me(e), !0) : !1;
4
- }
5
- const N = /* @__PURE__ */ new WeakMap(), be = (...e) => {
6
- var t;
7
- const o = e[0], n = (t = B()) == null ? void 0 : t.proxy;
8
- if (n == null && !ie())
9
- throw new Error("injectLocal must be called in setup");
10
- return n && N.has(n) && o in N.get(n) ? N.get(n)[o] : pe(...e);
11
- }, re = typeof window < "u" && typeof document < "u";
12
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
13
- const ge = (e) => e != null, ye = Object.prototype.toString, Se = (e) => ye.call(e) === "[object Object]", O = () => {
14
- }, Ee = /* @__PURE__ */ Te();
15
- function Te() {
16
- var e, t;
17
- return re && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
18
- }
19
- function $(e, t) {
20
- function o(...n) {
21
- return new Promise((f, a) => {
22
- Promise.resolve(e(() => t.apply(this, n), { fn: t, thisArg: this, args: n })).then(f).catch(a);
23
- });
24
- }
25
- return o;
26
- }
27
- const Oe = (e) => e();
28
- function le(e, t = {}) {
29
- let o, n, f = O;
30
- const a = (s) => {
31
- clearTimeout(s), f(), f = O;
32
- };
33
- let l;
34
- return (s) => {
35
- const u = g(e), r = g(t.maxWait);
36
- return o && a(o), u <= 0 || r !== void 0 && r <= 0 ? (n && (a(n), n = void 0), Promise.resolve(s())) : new Promise((c, v) => {
37
- f = t.rejectOnCancel ? v : c, l = s, r && !n && (n = setTimeout(() => {
38
- o && a(o), n = void 0, c(l());
39
- }, r)), o = setTimeout(() => {
40
- n && a(n), n = void 0, c(s());
41
- }, u);
42
- });
43
- };
44
- }
45
- function ue(...e) {
46
- let t = 0, o, n = !0, f = O, a, l, i, s, u;
47
- !he(e[0]) && typeof e[0] == "object" ? { delay: l, trailing: i = !0, leading: s = !0, rejectOnCancel: u = !1 } = e[0] : [l, i = !0, s = !0, u = !1] = e;
48
- const r = () => {
49
- o && (clearTimeout(o), o = void 0, f(), f = O);
50
- };
51
- return (v) => {
52
- const m = g(l), h = Date.now() - t, S = () => a = v();
53
- return r(), m <= 0 ? (t = Date.now(), S()) : (h > m && (s || !n) ? (t = Date.now(), S()) : i && (a = new Promise((d, p) => {
54
- f = u ? p : d, o = setTimeout(() => {
55
- t = Date.now(), n = !0, d(S()), r();
56
- }, Math.max(0, m - h));
57
- })), !s && !o && (o = setTimeout(() => n = !0, m)), n = !1, a);
58
- };
59
- }
60
- function ee(e) {
61
- return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
62
- }
63
- function k(e) {
64
- return Array.isArray(e) ? e : [e];
65
- }
66
- function We(e) {
67
- return B();
68
- }
69
- function xe(e, t = 200, o = {}) {
70
- return $(
71
- le(t, o),
72
- e
73
- );
74
- }
75
- function Me(e, t = 200, o = !1, n = !0, f = !1) {
76
- return $(
77
- ue(t, o, n, f),
78
- e
79
- );
80
- }
81
- function ce(e, t, o = {}) {
82
- const {
83
- eventFilter: n = Oe,
84
- ...f
85
- } = o;
86
- return L(
87
- e,
88
- $(
89
- n,
90
- t
91
- ),
92
- f
93
- );
94
- }
95
- function z(e, t = !0, o) {
96
- We() ? oe(e, o) : t ? e() : fe(e);
97
- }
98
- function Ce(e, t, o = {}) {
1
+ import { n as w, x as I, aB as H, S as z, ac as R, Z as _, G as W, b as U, c as G, P as L, d as F, O as Z, j as $, aC as Q, aD as Y, f as q, g as j, aE as K, aF as X, h as J, $ as ee } from "./index7.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) => {
99
19
  const {
100
- debounce: n = 0,
101
- maxWait: f = void 0,
102
- ...a
103
- } = o;
104
- return ce(
105
- e,
106
- t,
107
- {
108
- ...a,
109
- eventFilter: le(n, { maxWait: f })
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());
65
+ };
66
+ return y(
67
+ () => a.showPopper,
68
+ (l) => {
69
+ o.disabled || (l && r(S), o.trigger === "manual" && n("update:modelValue", l));
110
70
  }
111
- );
112
- }
113
- function Re(e, t, o) {
114
- return L(
115
- e,
116
- t,
117
- {
118
- ...o,
119
- immediate: !0
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));
120
76
  }
121
- );
122
- }
123
- function He(e, t, o = {}) {
124
- const {
125
- throttle: n = 0,
126
- trailing: f = !0,
127
- leading: a = !0,
128
- ...l
129
- } = o;
130
- return ce(
131
- e,
132
- t,
133
- {
134
- ...l,
135
- eventFilter: ue(n, f, a)
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;
90
+ }
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") : G(e.referenceElm, "focusing");
122
+ }, he = ({ slots: e, api: t }) => () => {
123
+ if (!e.default || !e.default().length) {
124
+ t.handleFocus();
125
+ return;
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: L("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);
136
219
  }
137
- );
138
- }
139
- const I = re ? window : void 0;
140
- function E(e) {
141
- var t;
142
- const o = g(e);
143
- return (t = o == null ? void 0 : o.$el) != null ? t : o;
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);
144
232
  }
145
- function M(...e) {
146
- const t = [], o = () => {
147
- t.forEach((i) => i()), t.length = 0;
148
- }, n = (i, s, u, r) => (i.addEventListener(s, u, r), () => i.removeEventListener(s, u, r)), f = _(() => {
149
- const i = k(g(e[0])).filter((s) => s != null);
150
- return i.every((s) => typeof s != "string") ? i : void 0;
151
- }), a = Re(
152
- () => {
153
- var i, s;
154
- return [
155
- (s = (i = f.value) == null ? void 0 : i.map((u) => E(u))) != null ? s : [I].filter((u) => u != null),
156
- k(g(f.value ? e[1] : e[0])),
157
- k(we(f.value ? e[2] : e[1])),
158
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
159
- g(f.value ? e[3] : e[2])
160
- ];
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
+ }
161
245
  },
162
- ([i, s, u, r]) => {
163
- if (o(), !(i != null && i.length) || !(s != null && s.length) || !(u != null && u.length))
164
- return;
165
- const c = Se(r) ? { ...r } : r;
166
- t.push(
167
- ...i.flatMap(
168
- (v) => s.flatMap(
169
- (m) => u.map((h) => n(v, m, h, c))
170
- )
171
- )
172
- );
246
+ adjustArrow: {
247
+ type: Boolean,
248
+ default: function() {
249
+ return !1;
250
+ }
173
251
  },
174
- { flush: "post" }
175
- ), l = () => {
176
- a(), o();
177
- };
178
- return V(o), l;
179
- }
180
- let te = !1;
181
- function ke(e, t, o = {}) {
182
- const { window: n = I, ignore: f = [], capture: a = !0, detectIframe: l = !1, controls: i = !1 } = o;
183
- if (!n)
184
- return i ? { stop: O, cancel: O, trigger: O } : O;
185
- if (Ee && !te) {
186
- te = !0;
187
- const d = { passive: !0 };
188
- Array.from(n.document.body.children).forEach((p) => p.addEventListener("click", O, d)), n.document.documentElement.addEventListener("click", O, d);
189
- }
190
- let s = !0;
191
- const u = (d) => g(f).some((p) => {
192
- if (typeof p == "string")
193
- return Array.from(n.document.querySelectorAll(p)).some((b) => b === d.target || d.composedPath().includes(b));
194
- {
195
- const b = E(p);
196
- return b && (d.target === b || d.composedPath().includes(b));
197
- }
198
- });
199
- function r(d) {
200
- const p = g(d);
201
- return p && p.$.subTree.shapeFlag === 16;
202
- }
203
- function c(d, p) {
204
- const b = g(d), T = b.$.subTree && b.$.subTree.children;
205
- return T == null || !Array.isArray(T) ? !1 : T.some((W) => W.el === p.target || p.composedPath().includes(W.el));
206
- }
207
- const v = (d) => {
208
- const p = E(e);
209
- if (d.target != null && !(!(p instanceof Element) && r(e) && c(e, d)) && !(!p || p === d.target || d.composedPath().includes(p))) {
210
- if ("detail" in d && d.detail === 0 && (s = !u(d)), !s) {
211
- s = !0;
212
- return;
252
+ appendToBody: {
253
+ type: Boolean,
254
+ default: function() {
255
+ return !0;
213
256
  }
214
- t(d);
215
- }
216
- };
217
- let m = !1;
218
- const h = [
219
- M(n, "click", (d) => {
220
- m || (m = !0, setTimeout(() => {
221
- m = !1;
222
- }, 0), v(d));
223
- }, { passive: !0, capture: a }),
224
- M(n, "pointerdown", (d) => {
225
- const p = E(e);
226
- s = !u(d) && !!(p && !d.composedPath().includes(p));
227
- }, { passive: !0 }),
228
- l && M(n, "blur", (d) => {
229
- setTimeout(() => {
230
- var p;
231
- const b = E(e);
232
- ((p = n.document.activeElement) == null ? void 0 : p.tagName) === "IFRAME" && !(b != null && b.contains(n.document.activeElement)) && t(d);
233
- }, 0);
234
- }, { passive: !0 })
235
- ].filter(Boolean), S = () => h.forEach((d) => d());
236
- return i ? {
237
- stop: S,
238
- cancel: () => {
239
- s = !1;
240
257
  },
241
- trigger: (d) => {
242
- s = !0, v(d), s = !1;
243
- }
244
- } : S;
245
- }
246
- function Ie() {
247
- const e = y(!1), t = B();
248
- return t && oe(() => {
249
- e.value = !0;
250
- }, t), e;
251
- }
252
- function G(e) {
253
- const t = Ie();
254
- return _(() => (t.value, !!e()));
255
- }
256
- function Y(e, t, o = {}) {
257
- const { window: n = I, ...f } = o;
258
- let a;
259
- const l = G(() => n && "MutationObserver" in n), i = () => {
260
- a && (a.disconnect(), a = void 0);
261
- }, s = _(() => {
262
- const v = g(e), m = k(v).map(E).filter(ge);
263
- return new Set(m);
264
- }), u = L(
265
- () => s.value,
266
- (v) => {
267
- i(), l.value && v.size && (a = new MutationObserver(t), v.forEach((m) => a.observe(m, f)));
258
+ arrowOffset: {
259
+ type: Number,
260
+ default: function() {
261
+ return 0;
262
+ }
268
263
  },
269
- { immediate: !0, flush: "post" }
270
- ), r = () => a == null ? void 0 : a.takeRecords(), c = () => {
271
- u(), i();
272
- };
273
- return V(c), {
274
- isSupported: l,
275
- stop: c,
276
- takeRecords: r
277
- };
278
- }
279
- function _e(e, t, o = {}) {
280
- const {
281
- window: n = I,
282
- document: f = n == null ? void 0 : n.document,
283
- flush: a = "sync"
284
- } = o;
285
- if (!n || !f)
286
- return O;
287
- let l;
288
- const i = (r) => {
289
- l == null || l(), l = r;
290
- }, s = se(() => {
291
- const r = E(e);
292
- if (r) {
293
- const { stop: c } = Y(
294
- f,
295
- (v) => {
296
- v.map((h) => [...h.removedNodes]).flat().some((h) => h === r || h.contains(r)) && t(v);
297
- },
298
- {
299
- window: n,
300
- childList: !0,
301
- subtree: !0
302
- }
303
- );
304
- i(c);
305
- }
306
- }, { flush: a }), u = () => {
307
- s(), i();
308
- };
309
- return V(u), u;
310
- }
311
- const Ae = Symbol("vueuse-ssr-width");
312
- function Pe() {
313
- const e = ie() ? be(Ae, null) : null;
314
- return typeof e == "number" ? e : void 0;
315
- }
316
- function Fe(e, t = {}) {
317
- const { window: o = I, ssrWidth: n = Pe() } = t, f = G(() => o && "matchMedia" in o && typeof o.matchMedia == "function"), a = y(typeof n == "number"), l = y(), i = y(!1), s = (u) => {
318
- i.value = u.matches;
319
- };
320
- return se(() => {
321
- if (a.value) {
322
- a.value = !f.value;
323
- const u = g(e).split(",");
324
- i.value = u.some((r) => {
325
- const c = r.includes("not all"), v = r.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), m = r.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
326
- let h = !!(v || m);
327
- return v && h && (h = n >= ee(v[1])), m && h && (h = n <= ee(m[1])), c ? !h : h;
328
- });
329
- return;
330
- }
331
- f.value && (l.value = o.matchMedia(g(e)), i.value = l.value.matches);
332
- }), M(l, "change", s, { passive: !0 }), _(() => i.value);
333
- }
334
- function ae(e, t, o = {}) {
335
- const { window: n = I, ...f } = o;
336
- let a;
337
- const l = G(() => n && "ResizeObserver" in n), i = () => {
338
- a && (a.disconnect(), a = void 0);
339
- }, s = _(() => {
340
- const c = g(e);
341
- return Array.isArray(c) ? c.map((v) => E(v)) : [E(c)];
342
- }), u = L(
343
- s,
344
- (c) => {
345
- if (i(), l.value && n) {
346
- a = new ResizeObserver(t);
347
- for (const v of c)
348
- v && a.observe(v, f);
264
+ boundariesPadding: {
265
+ type: Number,
266
+ default: function() {
267
+ return 5;
349
268
  }
350
269
  },
351
- { immediate: !0, flush: "post" }
352
- ), r = () => {
353
- i(), u();
354
- };
355
- return V(r), {
356
- isSupported: l,
357
- stop: r
358
- };
359
- }
360
- function De(e, t = {}) {
361
- const {
362
- reset: o = !0,
363
- windowResize: n = !0,
364
- windowScroll: f = !0,
365
- immediate: a = !0,
366
- updateTiming: l = "sync"
367
- } = t, i = y(0), s = y(0), u = y(0), r = y(0), c = y(0), v = y(0), m = y(0), h = y(0);
368
- function S() {
369
- const p = E(e);
370
- if (!p) {
371
- o && (i.value = 0, s.value = 0, u.value = 0, r.value = 0, c.value = 0, v.value = 0, m.value = 0, h.value = 0);
372
- return;
373
- }
374
- const b = p.getBoundingClientRect();
375
- i.value = b.height, s.value = b.bottom, u.value = b.left, r.value = b.right, c.value = b.top, v.value = b.width, m.value = b.x, h.value = b.y;
376
- }
377
- function d() {
378
- l === "sync" ? S() : l === "next-frame" && requestAnimationFrame(() => S());
379
- }
380
- return ae(e, d), L(() => E(e), (p) => !p && d()), Y(e, d, {
381
- attributeFilter: ["style", "class"]
382
- }), f && M("scroll", d, { capture: !0, passive: !0 }), n && M("resize", d, { passive: !0 }), z(() => {
383
- a && d();
384
- }), {
385
- height: i,
386
- bottom: s,
387
- left: u,
388
- right: r,
389
- top: c,
390
- width: v,
391
- x: m,
392
- y: h,
393
- update: d
394
- };
395
- }
396
- function je(e, t = {}) {
397
- const {
398
- delayEnter: o = 0,
399
- delayLeave: n = 0,
400
- triggerOnRemoval: f = !1,
401
- window: a = I
402
- } = t, l = y(!1);
403
- let i;
404
- const s = (u) => {
405
- const r = u ? o : n;
406
- i && (clearTimeout(i), i = void 0), r ? i = setTimeout(() => l.value = u, r) : l.value = u;
407
- };
408
- return a && (M(e, "mouseenter", () => s(!0), { passive: !0 }), M(e, "mouseleave", () => s(!1), { passive: !0 }), f && _e(
409
- _(() => E(e)),
410
- () => s(!1)
411
- )), l;
412
- }
413
- function Ve(e, t = { width: 0, height: 0 }, o = {}) {
414
- const { window: n = I, box: f = "content-box" } = o, a = _(() => {
415
- var c, v;
416
- return (v = (c = E(e)) == null ? void 0 : c.namespaceURI) == null ? void 0 : v.includes("svg");
417
- }), l = y(t.width), i = y(t.height), { stop: s } = ae(
418
- e,
419
- ([c]) => {
420
- const v = f === "border-box" ? c.borderBoxSize : f === "content-box" ? c.contentBoxSize : c.devicePixelContentBoxSize;
421
- if (n && a.value) {
422
- const m = E(e);
423
- if (m) {
424
- const h = m.getBoundingClientRect();
425
- l.value = h.width, i.value = h.height;
426
- }
427
- } else if (v) {
428
- const m = k(v);
429
- l.value = m.reduce((h, { inlineSize: S }) => h + S, 0), i.value = m.reduce((h, { blockSize: S }) => h + S, 0);
430
- } else
431
- l.value = c.contentRect.width, i.value = c.contentRect.height;
270
+ closeDelay: {
271
+ type: Number,
272
+ default: function() {
273
+ return 300;
274
+ }
432
275
  },
433
- o
434
- );
435
- z(() => {
436
- const c = E(e);
437
- c && (l.value = "offsetWidth" in c ? c.offsetWidth : t.width, i.value = "offsetHeight" in c ? c.offsetHeight : t.height);
438
- });
439
- const u = L(
440
- () => E(e),
441
- (c) => {
442
- l.value = c ? t.width : 0, i.value = c ? t.height : 0;
443
- }
444
- );
445
- function r() {
446
- s(), u();
447
- }
448
- return {
449
- width: l,
450
- height: i,
451
- stop: r
452
- };
453
- }
454
- const ne = 1;
455
- function ze(e, t = {}) {
456
- const {
457
- throttle: o = 0,
458
- idle: n = 200,
459
- onStop: f = O,
460
- onScroll: a = O,
461
- offset: l = {
462
- left: 0,
463
- right: 0,
464
- top: 0,
465
- bottom: 0
276
+ content: {
277
+ type: [String, Object]
466
278
  },
467
- observe: i = {
468
- mutation: !1
279
+ disabled: {
280
+ type: Boolean
469
281
  },
470
- eventListenerOptions: s = {
471
- capture: !1,
472
- passive: !0
282
+ effect: {
283
+ type: String,
284
+ default: function() {
285
+ return "dark";
286
+ }
473
287
  },
474
- behavior: u = "auto",
475
- window: r = I,
476
- onError: c = (w) => {
477
- console.error(w);
478
- }
479
- } = t, v = typeof i == "boolean" ? {
480
- mutation: i
481
- } : i, m = y(0), h = y(0), S = _({
482
- get() {
483
- return m.value;
288
+ enterable: {
289
+ type: Boolean,
290
+ default: function() {
291
+ return !0;
292
+ }
484
293
  },
485
- set(w) {
486
- p(w, void 0);
487
- }
488
- }), d = _({
489
- get() {
490
- return h.value;
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
+ }
491
371
  },
492
- set(w) {
493
- p(void 0, w);
372
+ contentMaxHeight: {
373
+ type: String
494
374
  }
495
- });
496
- function p(w, P) {
497
- var x, C, H, j;
498
- if (!r)
499
- return;
500
- const R = g(e);
501
- if (!R)
502
- return;
503
- (H = R instanceof Document ? r.document.body : R) == null || H.scrollTo({
504
- top: (x = g(P)) != null ? x : d.value,
505
- left: (C = g(w)) != null ? C : S.value,
506
- behavior: g(u)
375
+ }),
376
+ setup: function(t, n) {
377
+ return q({
378
+ props: t,
379
+ context: n,
380
+ renderless: Se,
381
+ api: _e
507
382
  });
508
- const A = ((j = R == null ? void 0 : R.document) == null ? void 0 : j.documentElement) || (R == null ? void 0 : R.documentElement) || R;
509
- S != null && (m.value = A.scrollLeft), d != null && (h.value = A.scrollTop);
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 " + Y(o.class)), c;
510
462
  }
511
- const b = y(!1), T = Z({
512
- left: !0,
513
- right: !1,
514
- top: !0,
515
- bottom: !1
516
- }), W = Z({
517
- left: !1,
518
- right: !1,
519
- top: !1,
520
- bottom: !1
521
- }), Q = (w) => {
522
- b.value && (b.value = !1, W.left = !1, W.right = !1, W.top = !1, W.bottom = !1, f(w));
523
- }, de = xe(Q, o + n), D = (w) => {
524
- var P;
525
- if (!r)
526
- return;
527
- const x = ((P = w == null ? void 0 : w.document) == null ? void 0 : P.documentElement) || (w == null ? void 0 : w.documentElement) || E(w), { display: C, flexDirection: H, direction: j } = getComputedStyle(x), R = j === "rtl" ? -1 : 1, A = x.scrollLeft;
528
- W.left = A < m.value, W.right = A > m.value;
529
- const X = Math.abs(A * R) <= (l.left || 0), q = Math.abs(A * R) + x.clientWidth >= x.scrollWidth - (l.right || 0) - ne;
530
- C === "flex" && H === "row-reverse" ? (T.left = q, T.right = X) : (T.left = X, T.right = q), m.value = A;
531
- let F = x.scrollTop;
532
- w === r.document && !F && (F = r.document.body.scrollTop), W.top = F < h.value, W.bottom = F > h.value;
533
- const J = Math.abs(F) <= (l.top || 0), K = Math.abs(F) + x.clientHeight >= x.scrollHeight - (l.bottom || 0) - ne;
534
- C === "flex" && H === "column-reverse" ? (T.top = K, T.bottom = J) : (T.top = J, T.bottom = K), h.value = F;
535
- }, U = (w) => {
536
- var P;
537
- if (!r)
538
- return;
539
- const x = (P = w.target.documentElement) != null ? P : w.target;
540
- D(x), b.value = !0, de(w), a(w);
541
- };
542
- return M(
543
- e,
544
- "scroll",
545
- o ? Me(U, o, !0, !1) : U,
546
- s
547
- ), z(() => {
548
- try {
549
- const w = g(e);
550
- if (!w)
551
- return;
552
- D(w);
553
- } catch (w) {
554
- c(w);
463
+ });
464
+ function D() {
465
+ return D = Object.assign ? Object.assign.bind() : function(e) {
466
+ for (var t = 1; t < arguments.length; t++) {
467
+ var n = arguments[t];
468
+ for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
555
469
  }
556
- }), v != null && v.mutation && e != null && e !== r && e !== document && Y(
557
- e,
558
- () => {
559
- const w = g(e);
560
- w && D(w);
470
+ return e;
471
+ }, D.apply(null, arguments);
472
+ }
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: {
478
+ type: String,
479
+ default: function() {
480
+ return "always";
561
481
  },
562
- {
563
- attributes: !0,
564
- childList: !0,
565
- subtree: !0
482
+ validator: function(t) {
483
+ return ["always", "auto"].includes(t);
566
484
  }
567
- ), M(
568
- e,
569
- "scrollend",
570
- Q,
571
- s
572
- ), {
573
- x: S,
574
- y: d,
575
- isScrolling: b,
576
- arrivedState: T,
577
- directions: W,
578
- measure() {
579
- const w = g(e);
580
- r && w && D(w);
485
+ },
486
+ adjustArrow: {
487
+ type: Boolean,
488
+ default: function() {
489
+ return !1;
490
+ }
491
+ },
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
+ }
532
+ },
533
+ effect: {
534
+ type: String,
535
+ default: function() {
536
+ return "";
537
+ }
538
+ },
539
+ openDelay: {
540
+ type: Number,
541
+ default: function() {
542
+ return 0;
543
+ }
544
+ },
545
+ closeDelay: {
546
+ type: Number,
547
+ default: function() {
548
+ return 100;
549
+ }
550
+ },
551
+ placement: {
552
+ type: String,
553
+ default: function() {
554
+ return "bottom";
555
+ }
556
+ },
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: {
580
+ type: String,
581
+ default: function() {
582
+ return "tiny-fade-in-linear";
583
+ }
584
+ },
585
+ type: {
586
+ type: String,
587
+ validator: function(t) {
588
+ return !!~["normal", "warning", "error", "info", "success"].indexOf(t);
589
+ }
590
+ },
591
+ visibleArrow: {
592
+ type: Boolean,
593
+ default: function() {
594
+ return !0;
595
+ }
596
+ },
597
+ genArrowByHtml: {
598
+ type: Boolean,
599
+ default: function() {
600
+ return !0;
601
+ }
602
+ },
603
+ zIndex: {
604
+ type: String,
605
+ default: function() {
606
+ return "next";
607
+ }
608
+ },
609
+ contentMaxHeight: {
610
+ type: String,
611
+ default: function() {
612
+ return "80vh";
581
613
  }
582
- };
583
- }
584
- function Ne(e = {}) {
585
- const {
586
- window: t = I,
587
- initialWidth: o = Number.POSITIVE_INFINITY,
588
- initialHeight: n = Number.POSITIVE_INFINITY,
589
- listenOrientation: f = !0,
590
- includeScrollbar: a = !0,
591
- type: l = "inner"
592
- } = e, i = y(o), s = y(n), u = () => {
593
- if (t)
594
- if (l === "outer")
595
- i.value = t.outerWidth, s.value = t.outerHeight;
596
- else if (l === "visual" && t.visualViewport) {
597
- const { width: c, height: v, scale: m } = t.visualViewport;
598
- i.value = Math.round(c * m), s.value = Math.round(v * m);
599
- } else a ? (i.value = t.innerWidth, s.value = t.innerHeight) : (i.value = t.document.documentElement.clientWidth, s.value = t.document.documentElement.clientHeight);
600
- };
601
- u(), z(u);
602
- const r = { passive: !0 };
603
- if (M("resize", u, r), t && l === "visual" && t.visualViewport && M(t.visualViewport, "resize", u, r), f) {
604
- const c = Fe("(orientation: portrait)");
605
- L(c, () => u());
606
614
  }
607
- return { width: i, height: s };
608
- }
615
+ }), C = F({
616
+ name: j + "Tooltip",
617
+ componentName: "Tooltip",
618
+ props: xe,
619
+ setup: function(t, n) {
620
+ return ee({
621
+ props: t,
622
+ context: n,
623
+ template: Ee
624
+ });
625
+ }
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);
633
+ };
634
+ C.version = Ce;
609
635
  export {
610
- je as a,
611
- Ne as b,
612
- Ve as c,
613
- E as d,
614
- M as e,
615
- De as f,
616
- Fe as g,
617
- He as h,
618
- ke as o,
619
- ze as u,
620
- Ce as w
636
+ C as T,
637
+ oe as k
621
638
  };