@opentiny/tiny-robot 0.3.0-alpha.10 → 0.3.0-alpha.12
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/index.d.ts +1 -1
- package/dist/index4.js +95 -85
- package/dist/style.css +1 -1
- package/dist/suggestion-popover/index.js +62 -62
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -194,6 +194,7 @@ activateTemplateFirstField: () => void;
|
|
|
194
194
|
}>, {
|
|
195
195
|
disabled: boolean;
|
|
196
196
|
modelValue: string;
|
|
197
|
+
placeholder: string;
|
|
197
198
|
loading: boolean;
|
|
198
199
|
mode: InputMode_2;
|
|
199
200
|
autofocus: boolean;
|
|
@@ -206,7 +207,6 @@ stopText: string;
|
|
|
206
207
|
suggestions: string[];
|
|
207
208
|
autoSize: AutoSize_2;
|
|
208
209
|
maxLength: number;
|
|
209
|
-
placeholder: string;
|
|
210
210
|
suggestionPopupWidth: string | number;
|
|
211
211
|
theme: ThemeType_2;
|
|
212
212
|
templateData: UserItem[];
|
package/dist/index4.js
CHANGED
|
@@ -1,54 +1,64 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
import { f as
|
|
3
|
-
import { t as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { u as
|
|
6
|
-
const ce =
|
|
7
|
-
setup: (
|
|
8
|
-
props: ["
|
|
1
|
+
import { onMounted as W, nextTick as B, h as $, defineComponent as _, render as R, onBeforeUnmount as j, Teleport as q, computed as h, ref as C, createBlock as E, openBlock as x, Transition as L, normalizeProps as Z, guardReactiveProps as G, withCtx as J, createElementBlock as K, createCommentVNode as Q, renderSlot as X, useSlots as Y, watch as ee, useAttrs as te, resolveDynamicComponent as oe, unref as S, mergeProps as k, createVNode as ne } from "vue";
|
|
2
|
+
import { f as re, a as se, e as pe } from "./index3.js";
|
|
3
|
+
import { t as l } from "./utils.js";
|
|
4
|
+
import { _ as F } from "./_plugin-vue_export-helper.js";
|
|
5
|
+
import { u as ae } from "./useSlotRefs.js";
|
|
6
|
+
const ce = _({
|
|
7
|
+
setup: (n) => () => $(q, n.propsFactory(), n.vnodeFactory()),
|
|
8
|
+
props: ["propsFactory", "vnodeFactory"]
|
|
9
9
|
});
|
|
10
|
-
function ie(
|
|
11
|
-
let e = null,
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function ie(n, r) {
|
|
11
|
+
let e = null, t = null, s = !1;
|
|
12
|
+
W(() => {
|
|
13
|
+
B(() => {
|
|
14
|
+
s || (t = document.createElement("div"), e = $(ce, { propsFactory: n, vnodeFactory: r }), R(e, t));
|
|
15
|
+
});
|
|
14
16
|
}), j(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
s = !0, B(() => {
|
|
18
|
+
t && (R(null, t), t.remove(), e = null, t = null);
|
|
17
19
|
});
|
|
18
20
|
});
|
|
19
21
|
}
|
|
20
|
-
function
|
|
21
|
-
return
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
function le(n, r) {
|
|
23
|
+
return h(() => {
|
|
24
|
+
var m;
|
|
25
|
+
if (r instanceof HTMLElement)
|
|
26
|
+
return r;
|
|
27
|
+
const e = r, t = re(n), s = (m = t == null ? void 0 : t.getRootNode) == null ? void 0 : m.call(t), c = s instanceof ShadowRoot, d = c ? s : document.body;
|
|
28
|
+
if (e) {
|
|
29
|
+
if (!c && e === "body")
|
|
30
|
+
return document.body;
|
|
31
|
+
const u = d.querySelector(e);
|
|
32
|
+
if (u instanceof Node) return u;
|
|
33
|
+
}
|
|
34
|
+
return d;
|
|
25
35
|
});
|
|
26
36
|
}
|
|
27
|
-
const
|
|
37
|
+
const ue = /* @__PURE__ */ _({
|
|
28
38
|
__name: "Popper",
|
|
29
39
|
props: {
|
|
30
40
|
show: { type: Boolean },
|
|
31
41
|
transitionProps: {}
|
|
32
42
|
},
|
|
33
|
-
setup(
|
|
34
|
-
const e =
|
|
35
|
-
return
|
|
43
|
+
setup(n, { expose: r }) {
|
|
44
|
+
const e = C(null);
|
|
45
|
+
return r({
|
|
36
46
|
popperRef: e
|
|
37
|
-
}), (
|
|
38
|
-
default:
|
|
39
|
-
|
|
47
|
+
}), (t, s) => (x(), E(L, Z(G(t.transitionProps)), {
|
|
48
|
+
default: J(() => [
|
|
49
|
+
t.show ? (x(), K("div", {
|
|
40
50
|
key: 0,
|
|
41
51
|
class: "tr-base-popper",
|
|
42
52
|
ref_key: "popperRef",
|
|
43
53
|
ref: e
|
|
44
54
|
}, [
|
|
45
|
-
X(
|
|
55
|
+
X(t.$slots, "default", {}, void 0, !0)
|
|
46
56
|
], 512)) : Q("", !0)
|
|
47
57
|
]),
|
|
48
58
|
_: 3
|
|
49
59
|
}, 16));
|
|
50
60
|
}
|
|
51
|
-
}),
|
|
61
|
+
}), fe = /* @__PURE__ */ F(ue, [["__scopeId", "data-v-25c13ab7"]]), de = /* @__PURE__ */ _({
|
|
52
62
|
inheritAttrs: !1,
|
|
53
63
|
__name: "index",
|
|
54
64
|
props: {
|
|
@@ -66,86 +76,86 @@ const fe = /* @__PURE__ */ g({
|
|
|
66
76
|
transitionProps: {},
|
|
67
77
|
triggerEvents: {}
|
|
68
78
|
},
|
|
69
|
-
setup(
|
|
70
|
-
expose:
|
|
79
|
+
setup(n, {
|
|
80
|
+
expose: r
|
|
71
81
|
}) {
|
|
72
|
-
const e =
|
|
73
|
-
vnodes:
|
|
74
|
-
ref:
|
|
75
|
-
setRef:
|
|
76
|
-
} =
|
|
77
|
-
const
|
|
78
|
-
for (const [
|
|
79
|
-
/^on[A-Z]/.test(
|
|
80
|
-
return
|
|
81
|
-
},
|
|
82
|
-
var
|
|
83
|
-
return ((
|
|
84
|
-
}),
|
|
85
|
-
var
|
|
82
|
+
const e = n, t = Y(), {
|
|
83
|
+
vnodes: s,
|
|
84
|
+
ref: c,
|
|
85
|
+
setRef: d
|
|
86
|
+
} = ae(t.trigger), m = (o = {}) => {
|
|
87
|
+
const p = {};
|
|
88
|
+
for (const [i, a] of Object.entries(o))
|
|
89
|
+
/^on[A-Z]/.test(i) && typeof a == "function" && (p[i] = a);
|
|
90
|
+
return p;
|
|
91
|
+
}, u = C(null), g = h(() => {
|
|
92
|
+
var o;
|
|
93
|
+
return ((o = u.value) == null ? void 0 : o.popperRef) || null;
|
|
94
|
+
}), f = h(() => {
|
|
95
|
+
var o, p;
|
|
86
96
|
return typeof e.offset == "number" ? {
|
|
87
97
|
mainAxis: e.offset,
|
|
88
98
|
crossAxis: 0
|
|
89
99
|
} : {
|
|
90
|
-
mainAxis: ((
|
|
91
|
-
crossAxis: ((
|
|
100
|
+
mainAxis: ((o = e.offset) == null ? void 0 : o.mainAxis) ?? 0,
|
|
101
|
+
crossAxis: ((p = e.offset) == null ? void 0 : p.crossAxis) ?? 0
|
|
92
102
|
};
|
|
93
103
|
}), {
|
|
94
104
|
top: N,
|
|
95
|
-
bottom:
|
|
105
|
+
bottom: O,
|
|
96
106
|
left: w,
|
|
97
|
-
right:
|
|
98
|
-
width:
|
|
99
|
-
update:
|
|
100
|
-
} =
|
|
101
|
-
width:
|
|
102
|
-
height:
|
|
103
|
-
} =
|
|
107
|
+
right: V,
|
|
108
|
+
width: z,
|
|
109
|
+
update: b
|
|
110
|
+
} = se(c), {
|
|
111
|
+
width: A,
|
|
112
|
+
height: y
|
|
113
|
+
} = pe(g, void 0, {
|
|
104
114
|
box: "border-box"
|
|
105
|
-
}),
|
|
115
|
+
}), H = h(() => {
|
|
106
116
|
const {
|
|
107
|
-
placement:
|
|
108
|
-
preventOverflow:
|
|
109
|
-
} = e,
|
|
110
|
-
if (!
|
|
111
|
-
|
|
117
|
+
placement: o,
|
|
118
|
+
preventOverflow: p
|
|
119
|
+
} = e, i = {}, a = (v, P) => {
|
|
120
|
+
if (!p) {
|
|
121
|
+
i[v] = P;
|
|
112
122
|
return;
|
|
113
123
|
}
|
|
114
|
-
const
|
|
115
|
-
|
|
124
|
+
const T = v === "top" || v === "bottom", U = "100%", D = l(T ? y.value : A.value);
|
|
125
|
+
i[v] = `clamp(0px, ${P}, calc(${U} - ${D}))`;
|
|
116
126
|
};
|
|
117
|
-
return
|
|
127
|
+
return o.includes("top") && a("top", l(N.value - y.value - f.value.mainAxis)), o.includes("bottom") && a("bottom", `calc(100% - ${l(O.value + y.value + f.value.mainAxis)})`), o.includes("left") && a("left", l(w.value + f.value.crossAxis)), o.includes("right") && a("right", `calc(100% - ${l(V.value + f.value.crossAxis)})`), o.includes("center") && a("left", l(w.value + z.value / 2 - A.value / 2 + f.value.crossAxis)), i;
|
|
118
128
|
});
|
|
119
|
-
ee(() => e.show, (
|
|
120
|
-
|
|
129
|
+
ee(() => e.show, (o) => {
|
|
130
|
+
o && b();
|
|
121
131
|
}, {
|
|
122
132
|
flush: "post"
|
|
123
133
|
});
|
|
124
|
-
const I =
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
ref:
|
|
134
|
+
const I = le(c, e.appendTo), M = te();
|
|
135
|
+
return ie(() => ({
|
|
136
|
+
to: I.value
|
|
137
|
+
}), () => ne(fe, k({
|
|
138
|
+
ref: u,
|
|
129
139
|
show: e.show,
|
|
130
140
|
transitionProps: e.transitionProps,
|
|
131
|
-
style:
|
|
132
|
-
},
|
|
141
|
+
style: H.value
|
|
142
|
+
}, M), {
|
|
133
143
|
default: () => {
|
|
134
|
-
var
|
|
135
|
-
return [(
|
|
144
|
+
var o;
|
|
145
|
+
return [(o = t.content) == null ? void 0 : o.call(t)];
|
|
136
146
|
}
|
|
137
|
-
})),
|
|
138
|
-
triggerRef:
|
|
139
|
-
popperRef:
|
|
140
|
-
update:
|
|
141
|
-
}), (
|
|
142
|
-
ref:
|
|
143
|
-
},
|
|
147
|
+
})), r({
|
|
148
|
+
triggerRef: c,
|
|
149
|
+
popperRef: g,
|
|
150
|
+
update: b
|
|
151
|
+
}), (o, p) => (x(), E(oe(S(s)[0]), k({
|
|
152
|
+
ref: S(d)
|
|
153
|
+
}, m(e.triggerEvents)), null, 16));
|
|
144
154
|
}
|
|
145
|
-
}),
|
|
146
|
-
|
|
155
|
+
}), me = /* @__PURE__ */ F(de, [["__scopeId", "data-v-18a42940"]]);
|
|
156
|
+
me.name = "TrBasePopper";
|
|
147
157
|
export {
|
|
148
|
-
|
|
158
|
+
me as B,
|
|
149
159
|
ie as c,
|
|
150
|
-
|
|
160
|
+
le as u
|
|
151
161
|
};
|