@opentiny/tiny-robot 0.4.2-alpha.9 → 0.5.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.
- package/dist/index.d.ts +370 -92
- package/dist/index2.js +12 -12
- package/dist/index7.js +21 -24
- package/dist/layout/index.js +495 -504
- package/dist/sender/index.js +1031 -1053
- package/dist/sender-compat/index.js +38 -38
- package/dist/style.css +1 -1
- package/dist/suggestion-popover/index.js +2 -4
- package/package.json +3 -3
package/dist/index2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { inject as R, isVNode as V, h as F, defineComponent as y, computed as l, openBlock as i, createBlock as f, unref as o, withCtx as S, createElementVNode as k, normalizeStyle as I, normalizeClass as v, renderSlot as B, resolveDynamicComponent as P, createElementBlock as b, createVNode as x, toDisplayString as T, createCommentVNode as h, useSlots as W, Transition as $ } from "vue";
|
|
2
2
|
import { _ as w } from "./_plugin-vue_export-helper.js";
|
|
3
|
-
import { IconSend as
|
|
4
|
-
import { TinyTooltip as
|
|
3
|
+
import { IconSend as E, IconStop as j, IconClose as U } from "@opentiny/tiny-robot-svgs";
|
|
4
|
+
import { TinyTooltip as z } from "@opentiny/vue";
|
|
5
5
|
import { t as G } from "./utils.js";
|
|
6
6
|
const K = Symbol("sender-context");
|
|
7
7
|
function C() {
|
|
@@ -11,16 +11,16 @@ function C() {
|
|
|
11
11
|
return t;
|
|
12
12
|
}
|
|
13
13
|
const A = "tr-sender-tooltip-inner";
|
|
14
|
-
function
|
|
15
|
-
return t ? typeof t == "string" ? t.split(/\s+/).includes(A) : Array.isArray(t) ? t.some(
|
|
14
|
+
function D(t) {
|
|
15
|
+
return t ? typeof t == "string" ? t.split(/\s+/).includes(A) : Array.isArray(t) ? t.some(D) : typeof t == "object" ? !!t[A] : !1 : !1;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function N(t) {
|
|
18
18
|
var e;
|
|
19
|
-
return V(t) &&
|
|
19
|
+
return V(t) && D((e = t.props) == null ? void 0 : e.class) ? t : F("div", { class: A }, t);
|
|
20
20
|
}
|
|
21
21
|
function O(t) {
|
|
22
22
|
if (t)
|
|
23
|
-
return typeof t == "string" ? () =>
|
|
23
|
+
return typeof t == "string" ? () => N(t) : () => N(t());
|
|
24
24
|
}
|
|
25
25
|
const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
26
26
|
__name: "index",
|
|
@@ -43,7 +43,7 @@ const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
|
43
43
|
} : {
|
|
44
44
|
"--tr-action-button-size": G(s)
|
|
45
45
|
}, c = l(() => e.size ? d(e.size) : {});
|
|
46
|
-
return (s, u) => e.tooltip ? (i(), f(o(
|
|
46
|
+
return (s, u) => e.tooltip ? (i(), f(o(z), {
|
|
47
47
|
key: 0,
|
|
48
48
|
"render-content": a.value,
|
|
49
49
|
placement: e.tooltipPlacement,
|
|
@@ -93,7 +93,7 @@ const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
|
93
93
|
}), g = () => {
|
|
94
94
|
u.value || (n.value ? c() : d());
|
|
95
95
|
};
|
|
96
|
-
return (_, m) => r.value && !o(n) ? (i(), f(o(
|
|
96
|
+
return (_, m) => r.value && !o(n) ? (i(), f(o(z), {
|
|
97
97
|
key: 0,
|
|
98
98
|
"render-content": r.value,
|
|
99
99
|
placement: p.value,
|
|
@@ -112,7 +112,7 @@ const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
|
112
112
|
]),
|
|
113
113
|
onClick: g
|
|
114
114
|
}, [
|
|
115
|
-
x(o(
|
|
115
|
+
x(o(E), { class: "tr-sender-submit-button__icon" })
|
|
116
116
|
], 2)
|
|
117
117
|
]),
|
|
118
118
|
_: 1
|
|
@@ -133,14 +133,14 @@ const M = ["disabled"], X = ["disabled"], Y = /* @__PURE__ */ y({
|
|
|
133
133
|
}, [
|
|
134
134
|
x(o(j), { class: "tr-sender-submit-button__cancel-icon" }),
|
|
135
135
|
o(s) ? (i(), b("span", q, T(o(s)), 1)) : h("", !0)
|
|
136
|
-
], 2)) : (i(), f(o(
|
|
136
|
+
], 2)) : (i(), f(o(E), {
|
|
137
137
|
key: 0,
|
|
138
138
|
class: "tr-sender-submit-button__icon"
|
|
139
139
|
}))
|
|
140
140
|
], 2));
|
|
141
141
|
}
|
|
142
142
|
}), J = /* @__PURE__ */ w(H, [["__scopeId", "data-v-a58e69fe"]]), L = () => {
|
|
143
|
-
const {
|
|
143
|
+
const { hasEditorContent: t, clearable: e, loading: n, defaultActions: a } = C(), d = l(() => {
|
|
144
144
|
var r, p;
|
|
145
145
|
return ((p = (r = a.value) == null ? void 0 : r.clear) == null ? void 0 : p.disabled) !== void 0 ? a.value.clear.disabled : !1;
|
|
146
146
|
}), c = l(() => {
|
package/dist/index7.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { onMounted as ne, onBeforeUnmount as oe, ref as
|
|
1
|
+
import { onMounted as ne, onBeforeUnmount as oe, ref as y, defineComponent as P, openBlock as l, createElementBlock as u, createElementVNode as w, createVNode as T, unref as n, toDisplayString as B, useModel as W, computed as I, normalizeStyle as ie, Fragment as S, renderList as V, createBlock as H, resolveDynamicComponent as Y, mergeModels as j, nextTick as se, normalizeClass as U, createCommentVNode as G, renderSlot as q, withDirectives as A, withKeys as F, isRef as re, withModifiers as J, vModelText as le, vShow as ue } from "vue";
|
|
2
2
|
import { IconEmptySearch as ae, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMore as pe } from "@opentiny/tiny-robot-svgs";
|
|
3
3
|
import { _ as z } from "./_plugin-vue_export-helper.js";
|
|
4
|
-
import { o as Z, d as ve, c as ge, b as
|
|
4
|
+
import { o as Z, d as ve, c as ge, b as _e } from "./index4.js";
|
|
5
5
|
import { t as O } from "./utils.js";
|
|
6
|
-
const D =
|
|
6
|
+
const D = y(!1);
|
|
7
7
|
let b = 0, $;
|
|
8
|
-
function
|
|
8
|
+
function ye() {
|
|
9
9
|
const s = window.matchMedia("(hover: none) and (pointer: coarse)"), m = () => {
|
|
10
10
|
D.value = s.matches;
|
|
11
11
|
};
|
|
@@ -24,7 +24,7 @@ function Ce() {
|
|
|
24
24
|
return typeof window > "u" ? {
|
|
25
25
|
isTouchDevice: D
|
|
26
26
|
} : (ne(() => {
|
|
27
|
-
b++, b === 1 && ($ =
|
|
27
|
+
b++, b === 1 && ($ = ye());
|
|
28
28
|
}), oe(() => {
|
|
29
29
|
b = Math.max(0, b - 1), b === 0 && he();
|
|
30
30
|
}), {
|
|
@@ -58,7 +58,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
58
58
|
}),
|
|
59
59
|
emits: /* @__PURE__ */ j(["item-click"], ["update:trigger", "update:data"]),
|
|
60
60
|
setup(s, { emit: m }) {
|
|
61
|
-
const t = W(s, "trigger"), c = W(s, "data"), h = s, C = m, E =
|
|
61
|
+
const t = W(s, "trigger"), c = W(s, "data"), h = s, C = m, E = y(null);
|
|
62
62
|
Z(
|
|
63
63
|
E,
|
|
64
64
|
() => {
|
|
@@ -68,9 +68,9 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
68
68
|
ignore: [t]
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
const { top: p, bottom: x, left:
|
|
71
|
+
const { top: p, bottom: x, left: _ } = ve(t), { width: M, height: k } = ge(E, void 0, { box: "border-box" }), { height: R } = _e(), o = I(() => {
|
|
72
72
|
const L = {
|
|
73
|
-
left: `min(${O(
|
|
73
|
+
left: `min(${O(_.value)}, calc(100% - ${O(M.value + Q)}))`
|
|
74
74
|
}, g = x.value + h.menuListGap;
|
|
75
75
|
return g + k.value + Q > R.value ? L.bottom = `calc(100% - ${O(p.value - h.menuListGap)})` : L.top = O(g), L;
|
|
76
76
|
}), v = (L) => {
|
|
@@ -96,24 +96,24 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
96
96
|
renameControlOnClickOutside: s,
|
|
97
97
|
onItemTitleChange: m
|
|
98
98
|
}) => {
|
|
99
|
-
const t =
|
|
99
|
+
const t = y(void 0), c = y(null), h = I(() => {
|
|
100
100
|
var o;
|
|
101
101
|
return (o = c.value) == null ? void 0 : o.at(0);
|
|
102
|
-
}), C =
|
|
102
|
+
}), C = y(null), E = I(() => {
|
|
103
103
|
var o;
|
|
104
104
|
return (o = C.value) == null ? void 0 : o.at(0);
|
|
105
|
-
}), p =
|
|
105
|
+
}), p = y(null), x = I(() => {
|
|
106
106
|
var o;
|
|
107
107
|
return (o = p.value) == null ? void 0 : o.at(0);
|
|
108
|
-
}),
|
|
109
|
-
t.value = o,
|
|
108
|
+
}), _ = y(""), M = (o) => {
|
|
109
|
+
t.value = o, _.value = o.title, se(() => {
|
|
110
110
|
const v = h.value;
|
|
111
111
|
v && (v.focus(), v.select());
|
|
112
112
|
});
|
|
113
113
|
}, k = () => {
|
|
114
|
-
t.value = void 0,
|
|
114
|
+
t.value = void 0, _.value = "";
|
|
115
115
|
}, R = () => {
|
|
116
|
-
t.value && m(
|
|
116
|
+
t.value && m(_.value, t.value), t.value = void 0, _.value = "";
|
|
117
117
|
};
|
|
118
118
|
return (s === "confirm" || s === "cancel") && Z(
|
|
119
119
|
h,
|
|
@@ -126,7 +126,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
126
126
|
editorRefList: c,
|
|
127
127
|
editorConfirmRefList: C,
|
|
128
128
|
editorCancelRefList: p,
|
|
129
|
-
editorValue:
|
|
129
|
+
editorValue: _,
|
|
130
130
|
handleEdit: M,
|
|
131
131
|
handleEditCancel: k,
|
|
132
132
|
handleEditConfirm: R
|
|
@@ -159,7 +159,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
159
159
|
}), E = I(() => C.value.length === 0 || C.value.every((i) => i.items.length === 0)), {
|
|
160
160
|
editingItem: p,
|
|
161
161
|
editorRefList: x,
|
|
162
|
-
editorConfirmRefList:
|
|
162
|
+
editorConfirmRefList: _,
|
|
163
163
|
editorCancelRefList: M,
|
|
164
164
|
editorValue: k,
|
|
165
165
|
handleEdit: R,
|
|
@@ -170,7 +170,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
170
170
|
onItemTitleChange: (i, e) => {
|
|
171
171
|
c("item-title-change", i, e);
|
|
172
172
|
}
|
|
173
|
-
}), { isTouchDevice: L } = Ce(), g =
|
|
173
|
+
}), { isTouchDevice: L } = Ce(), g = y(null), a = y(null), K = (i, e) => {
|
|
174
174
|
if (i.currentTarget instanceof HTMLButtonElement) {
|
|
175
175
|
if (a.value === e) {
|
|
176
176
|
g.value = null, a.value = null;
|
|
@@ -228,15 +228,12 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
228
228
|
]
|
|
229
229
|
}, null, 544)), [
|
|
230
230
|
[le, n(k)]
|
|
231
|
-
]) : q(i.$slots, "item-title", {
|
|
232
|
-
key: 2,
|
|
233
|
-
item: r
|
|
234
|
-
}, () => [
|
|
231
|
+
]) : q(i.$slots, "item-title", { item: r }, () => [
|
|
235
232
|
w("span", {
|
|
236
233
|
class: "text",
|
|
237
234
|
title: r.title
|
|
238
235
|
}, B(r.title), 9, Oe)
|
|
239
|
-
], !0),
|
|
236
|
+
], !0, 2),
|
|
240
237
|
w("span", {
|
|
241
238
|
class: "tr-history__item-actions",
|
|
242
239
|
onClick: e[6] || (e[6] = J(() => {
|
|
@@ -247,7 +244,7 @@ const ke = { class: "tr-history__empty" }, Le = { class: "tr-history__empty-icon
|
|
|
247
244
|
class: "editor-confirm",
|
|
248
245
|
ref_for: !0,
|
|
249
246
|
ref_key: "editorConfirmRefList",
|
|
250
|
-
ref:
|
|
247
|
+
ref: _,
|
|
251
248
|
onClick: e[4] || (e[4] = //@ts-ignore
|
|
252
249
|
(...d) => n(v) && n(v)(...d))
|
|
253
250
|
}, [
|