@opentiny/tiny-robot 0.2.0 → 0.3.0-alpha.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,8 +1,8 @@
1
- import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as $, openBlock as w, createElementVNode as n, renderSlot as r, createVNode as c, unref as a } from "vue";
2
- import { $ as g, i as h, t as C } from "../tiny-robot-svgs.js";
1
+ import { defineComponent as m, useCssVars as v, useModel as d, computed as _, createElementBlock as w, openBlock as g, createElementVNode as n, renderSlot as r, createVNode as c, unref as a } from "vue";
2
+ import { N as h, K as $, T as C } from "../tiny-robot-svgs.js";
3
3
  import u from "../icon-button/index.js";
4
4
  import { _ as b } from "../_plugin-vue_export-helper.js";
5
- const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k = { class: "tr-container__header-operations" }, y = { class: "tr-container__footer" }, E = /* @__PURE__ */ m({
5
+ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, N = { class: "tr-container__header-operations" }, T = { class: "tr-container__footer" }, k = /* @__PURE__ */ m({
6
6
  __name: "index",
7
7
  props: {
8
8
  show: { type: Boolean, required: !0 },
@@ -18,8 +18,8 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
18
18
  "234493b2": l.value ? "var(--tr-z-index-fixed)" : "-1",
19
19
  "0c2ba509": l.value ? "1" : "0"
20
20
  }));
21
- const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ? g : h);
22
- return (t, e) => (w(), $("div", z, [
21
+ const l = d(o, "show"), s = d(o, "fullscreen"), f = _(() => s.value ? h : $);
22
+ return (t, e) => (g(), w("div", z, [
23
23
  e[3] || (e[3] = n("div", { class: "tr-container__dragging-bar-wrapper" }, [
24
24
  n("div", { class: "tr-container__dragging-bar" })
25
25
  ], -1)),
@@ -27,7 +27,7 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
27
27
  r(t.$slots, "title", {}, () => [
28
28
  e[2] || (e[2] = n("h3", { class: "tr-container__title" }, "OpenTiny NEXT", -1))
29
29
  ]),
30
- n("div", k, [
30
+ n("div", N, [
31
31
  r(t.$slots, "operations"),
32
32
  c(a(u), {
33
33
  size: "28",
@@ -44,17 +44,17 @@ const z = { class: "tr-container" }, B = { class: "tr-container__header" }, k =
44
44
  ])
45
45
  ]),
46
46
  r(t.$slots, "default"),
47
- n("div", y, [
47
+ n("div", T, [
48
48
  r(t.$slots, "footer")
49
49
  ])
50
50
  ]));
51
51
  }
52
- }), i = /* @__PURE__ */ b(E, [["__scopeId", "data-v-6a9b9126"]]);
52
+ }), i = /* @__PURE__ */ b(k, [["__scopeId", "data-v-6a9b9126"]]);
53
53
  i.name = "TrContainer";
54
- const I = function(o) {
54
+ const y = function(o) {
55
55
  o.component(i.name, i);
56
56
  };
57
- i.install = I;
57
+ i.install = y;
58
58
  export {
59
59
  i as default
60
60
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as S, useCssVars as T, unref as M, ref as m, computed as R, watch as V, createElementBlock as o, openBlock as r, Fragment as p, createElementVNode as f, createVNode as B, renderSlot as E, Transition as N, withCtx as O, createCommentVNode as W, normalizeStyle as I, renderList as b, toDisplayString as z } from "vue";
2
- import { c as _, o as F } from "../index2.js";
2
+ import { d as _, o as F } from "../index2.js";
3
3
  import { t as n } from "../utils.js";
4
4
  import { _ as H } from "../_plugin-vue_export-helper.js";
5
5
  const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__ */ S({
@@ -19,8 +19,8 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
19
19
  top: `max(${n(g.value)} - ${n(C.value)} + ${n(a.topOffset)} - 8px, 0px)`
20
20
  }));
21
21
  F(d, (e) => {
22
- var c;
23
- (c = i.value) != null && c.contains(e.target) && e.stopPropagation(), t.value = !1;
22
+ var u;
23
+ (u = i.value) != null && u.contains(e.target) && e.stopPropagation(), t.value = !1;
24
24
  }), V(t, (e) => {
25
25
  e && k();
26
26
  });
@@ -29,7 +29,7 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
29
29
  }, D = (e) => {
30
30
  t.value = !1, h("item-click", e);
31
31
  };
32
- return (e, c) => (r(), o(p, null, [
32
+ return (e, u) => (r(), o(p, null, [
33
33
  f("div", {
34
34
  class: "tr-dropdown-menu__wrapper",
35
35
  ref_key: "dropDownTriggerRef",
@@ -48,11 +48,11 @@ const L = { class: "tr-dropdown-menu__list" }, P = ["onClick"], U = /* @__PURE__
48
48
  ref: d
49
49
  }, [
50
50
  f("ul", L, [
51
- (r(!0), o(p, null, b(a.items, (u) => (r(), o("li", {
51
+ (r(!0), o(p, null, b(a.items, (c) => (r(), o("li", {
52
52
  class: "tr-dropdown-menu__list-item",
53
- key: u.id,
54
- onClick: (q) => D(u)
55
- }, z(u.text), 9, P))), 128))
53
+ key: c.id,
54
+ onClick: (q) => D(c)
55
+ }, z(c.text), 9, P))), 128))
56
56
  ])
57
57
  ], 4)) : W("", !0)
58
58
  ]),
@@ -1,8 +1,8 @@
1
- import { defineComponent as X, ref as E, computed as z, onMounted as D, watch as K, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as h, unref as l, nextTick as O, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as U, resolveDynamicComponent as C } from "vue";
2
- import { K as T, U as N, d as q, s as j, p as H, e as J } from "../tiny-robot-svgs.js";
3
- import { B as R } from "../index3.js";
4
- import $, { ActionGroupItem as V } from "../action-group/index.js";
5
- import Q from "../icon-button/index.js";
1
+ import { defineComponent as X, ref as E, computed as j, onMounted as z, watch as D, createElementBlock as a, openBlock as t, createCommentVNode as k, Fragment as I, renderList as S, toDisplayString as y, createVNode as h, unref as l, nextTick as H, createElementVNode as d, createBlock as _, withCtx as f, createTextVNode as O, resolveDynamicComponent as C } from "vue";
2
+ import { H as T, B as N, E as q, $ as J, i as K, j as Q } from "../tiny-robot-svgs.js";
3
+ import { B as G } from "../index3.js";
4
+ import R, { ActionGroupItem as V } from "../action-group/index.js";
5
+ import U from "../icon-button/index.js";
6
6
  import { _ as P } from "../_plugin-vue_export-helper.js";
7
7
  const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__ */ X({
8
8
  __name: "SourceList",
@@ -12,7 +12,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
12
12
  },
13
13
  setup(b) {
14
14
  const m = b, e = E(!1), g = E([]), c = E(null), L = () => {
15
- O(() => {
15
+ H(() => {
16
16
  const u = g.value.slice(0, m.sources.length).map((o) => (o == null ? void 0 : o.offsetTop) || 0), n = Array.from(new Set(u));
17
17
  if (n.length > m.linesLimit) {
18
18
  const o = n[m.linesLimit - 1], s = u.lastIndexOf(o);
@@ -20,8 +20,8 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
20
20
  } else
21
21
  c.value = null;
22
22
  });
23
- }, A = z(() => m.sources.length - (c.value || 0));
24
- D(L), K(() => m.sources, L);
23
+ }, A = j(() => m.sources.length - (c.value || 0));
24
+ z(L), D(() => m.sources, L);
25
25
  const p = (u, n) => {
26
26
  u && (g.value[n] = u);
27
27
  };
@@ -66,9 +66,9 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
66
66
  emits: ["operation", "action"],
67
67
  setup(b, { emit: m }) {
68
68
  const e = b, g = {
69
- copy: J,
70
- refresh: H,
71
- like: j,
69
+ copy: Q,
70
+ refresh: K,
71
+ like: J,
72
72
  dislike: q
73
73
  }, c = m, L = (n) => {
74
74
  var o, s, r;
@@ -80,11 +80,11 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
80
80
  p.value = !p.value;
81
81
  };
82
82
  return (n, o) => {
83
- var s, r, v, w, B, F, M, G;
83
+ var s, r, v, B, w, F, M, $;
84
84
  return t(), a("div", te, [
85
85
  d("div", se, [
86
86
  d("div", oe, [
87
- (s = e.operations) != null && s.length ? (t(), _(l($), {
87
+ (s = e.operations) != null && s.length ? (t(), _(l(R), {
88
88
  key: 0,
89
89
  "max-num": e.operationsLimit,
90
90
  "drop-down-show-label-only": !0,
@@ -92,7 +92,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
92
92
  class: "tr-feedback__operations-left-action-group"
93
93
  }, {
94
94
  moreBtn: f(() => [
95
- h(l(R), {
95
+ h(l(G), {
96
96
  round: "",
97
97
  size: "mini",
98
98
  "reset-time": 0,
@@ -112,13 +112,13 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
112
112
  label: i.label
113
113
  }, {
114
114
  default: f(() => [
115
- h(l(R), {
115
+ h(l(G), {
116
116
  round: "",
117
117
  "reset-time": 0,
118
118
  size: "mini"
119
119
  }, {
120
120
  default: f(() => [
121
- U(y(i.label), 1)
121
+ O(y(i.label), 1)
122
122
  ]),
123
123
  _: 2
124
124
  }, 1024)
@@ -138,7 +138,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
138
138
  ])) : k("", !0)
139
139
  ]),
140
140
  d("div", le, [
141
- h(l($), {
141
+ h(l(R), {
142
142
  "max-num": e.actionsLimit,
143
143
  "show-tooltip": !0,
144
144
  onItemClick: A
@@ -150,7 +150,7 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
150
150
  label: i.label
151
151
  }, {
152
152
  default: f(() => [
153
- typeof i.icon == "string" ? (t(), _(l(Q), {
153
+ typeof i.icon == "string" ? (t(), _(l(U), {
154
154
  key: 0,
155
155
  icon: g[i.icon]
156
156
  }, null, 8, ["icon"])) : (t(), _(C(i.icon), { key: 1 }))
@@ -162,13 +162,13 @@ const W = { class: "tr-feedback__source-list" }, Y = ["href"], Z = /* @__PURE__
162
162
  }, 8, ["max-num"])
163
163
  ])
164
164
  ]),
165
- (w = e.operations) != null && w.length && ((B = e.sources) != null && B.length) || p.value && e.sources ? (t(), a("div", ae, [
165
+ (B = e.operations) != null && B.length && ((w = e.sources) != null && w.length) || p.value && e.sources ? (t(), a("div", ae, [
166
166
  (F = e.operations) != null && F.length && ((M = e.sources) != null && M.length) ? (t(), a("div", re, [
167
167
  d("span", {
168
168
  class: "tr-feedback__source",
169
169
  onClick: u
170
170
  }, [
171
- d("span", null, y((G = e.sources) == null ? void 0 : G.length) + "条来源", 1),
171
+ d("span", null, y(($ = e.sources) == null ? void 0 : $.length) + "条来源", 1),
172
172
  (t(), _(C(p.value ? l(T) : l(N))))
173
173
  ])
174
174
  ])) : k("", !0),
@@ -1,17 +1,17 @@
1
- import { defineComponent as V, mergeModels as E, useModel as q, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as C, Fragment as I, renderList as S, createCommentVNode as _, normalizeClass as b, createBlock as x, resolveDynamicComponent as B, toDisplayString as D, nextTick as G } from "vue";
2
- import { U as H } from "../tiny-robot-svgs.js";
3
- import { b as X, o as j } from "../index2.js";
4
- import { _ as J } from "../_plugin-vue_export-helper.js";
5
- const K = ["onClick"], P = {
1
+ import { defineComponent as q, mergeModels as E, useModel as G, watch as g, ref as i, computed as $, createElementBlock as a, openBlock as l, createElementVNode as B, Fragment as C, renderList as S, createCommentVNode as _, normalizeClass as I, createBlock as x, resolveDynamicComponent as b, toDisplayString as D, nextTick as H } from "vue";
2
+ import { B as X } from "../tiny-robot-svgs.js";
3
+ import { c as j, o as J } from "../index2.js";
4
+ import { _ as K } from "../_plugin-vue_export-helper.js";
5
+ const P = ["onClick"], Q = {
6
6
  key: 0,
7
7
  class: "tr-flow-layout__item-label"
8
- }, Q = { class: "tr-flow-layout__dropdown-wrapper" }, Y = ["onClick"], Z = { class: "tr-flow-layout__item-label" }, ee = /* @__PURE__ */ V({
8
+ }, U = { class: "tr-flow-layout__dropdown-wrapper" }, Y = ["onClick"], Z = { class: "tr-flow-layout__item-label" }, ee = /* @__PURE__ */ q({
9
9
  __name: "index",
10
10
  props: /* @__PURE__ */ E({
11
11
  items: {},
12
12
  selected: {},
13
13
  linesLimit: { default: Number.MAX_SAFE_INTEGER },
14
- moreIcon: { default: H },
14
+ moreIcon: { default: X },
15
15
  showMoreTrigger: { default: "click" }
16
16
  }, {
17
17
  selected: {},
@@ -19,7 +19,7 @@ const K = ["onClick"], P = {
19
19
  }),
20
20
  emits: /* @__PURE__ */ E(["item-click"], ["update:selected"]),
21
21
  setup(d, { emit: F }) {
22
- const n = d, u = q(d, "selected");
22
+ const n = d, u = G(d, "selected");
23
23
  g(
24
24
  () => n.items,
25
25
  (t) => {
@@ -30,7 +30,7 @@ const K = ["onClick"], P = {
30
30
  const N = F, y = i(null), w = i(null), k = i(null), M = i([]), s = i(null), m = i(!1), c = i(!1), A = (t, o) => {
31
31
  t && (M.value[o] = t);
32
32
  }, L = () => {
33
- s.value = null, m.value = !1, G(() => {
33
+ s.value = null, m.value = !1, H(() => {
34
34
  const t = y.value, o = w.value;
35
35
  if (!t || !o)
36
36
  return;
@@ -43,18 +43,18 @@ const K = ["onClick"], P = {
43
43
  });
44
44
  };
45
45
  g(() => n.items, L);
46
- const { width: W } = X(y);
46
+ const { width: W } = j(y);
47
47
  g(W, (t) => {
48
48
  t > 0 && L();
49
49
  });
50
50
  const z = $(() => s.value !== null ? n.items.slice(s.value) : []), O = $(() => s.value === null ? !1 : n.items.findIndex((o) => o.id === u.value) >= s.value), R = (t) => {
51
51
  u.value = t, c.value = !1, N("item-click", t);
52
- }, U = () => {
52
+ }, V = () => {
53
53
  n.showMoreTrigger === "click" && (c.value = !c.value);
54
54
  }, v = (t) => {
55
55
  n.showMoreTrigger === "hover" && (c.value = t);
56
56
  };
57
- return j(k, (t) => {
57
+ return J(k, (t) => {
58
58
  var o, e;
59
59
  (o = k.value) != null && o.contains(t.target) || (e = w.value) != null && e.contains(t.target) || (c.value = !1);
60
60
  }), (t, o) => (l(), a("div", {
@@ -62,33 +62,33 @@ const K = ["onClick"], P = {
62
62
  ref_key: "containerRef",
63
63
  ref: y
64
64
  }, [
65
- (l(!0), a(I, null, S(n.items, (e, f) => (l(), a(I, {
65
+ (l(!0), a(C, null, S(n.items, (e, f) => (l(), a(C, {
66
66
  key: e.id
67
67
  }, [
68
68
  s.value === null || f < s.value ? (l(), a("button", {
69
69
  key: 0,
70
- class: b(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
70
+ class: I(["tr-flow-layout__item", { "icon-only": !e.label }, { selected: e.id === u.value }]),
71
71
  ref_for: !0,
72
72
  ref: (r) => A(r, f),
73
73
  onClick: (r) => R(e.id)
74
74
  }, [
75
- (l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
76
- e.label ? (l(), a("span", P, D(e.label), 1)) : _("", !0)
77
- ], 10, K)) : _("", !0)
75
+ (l(), x(b(e.icon), { class: "tr-flow-layout__item-icon" })),
76
+ e.label ? (l(), a("span", Q, D(e.label), 1)) : _("", !0)
77
+ ], 10, P)) : _("", !0)
78
78
  ], 64))), 128)),
79
- C("div", Q, [
79
+ B("div", U, [
80
80
  m.value ? _("", !0) : (l(), a("button", {
81
81
  key: 0,
82
- class: b(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
82
+ class: I(["tr-flow-layout__item", "icon-only", { selected: O.value }]),
83
83
  ref_key: "moreButtonRef",
84
84
  ref: w,
85
- onClick: U,
85
+ onClick: V,
86
86
  onMouseenter: o[0] || (o[0] = (e) => v(!0)),
87
87
  onMouseleave: o[1] || (o[1] = (e) => v(!1))
88
88
  }, [
89
- (l(), x(B(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
89
+ (l(), x(b(n.moreIcon), { class: "tr-flow-layout__item-icon" }))
90
90
  ], 34)),
91
- C("div", {
91
+ B("div", {
92
92
  class: "tr-flow-layout__dropdown-container",
93
93
  onMouseenter: o[2] || (o[2] = (e) => v(!0)),
94
94
  onMouseleave: o[3] || (o[3] = (e) => v(!1))
@@ -99,20 +99,20 @@ const K = ["onClick"], P = {
99
99
  ref_key: "dropDownRef",
100
100
  ref: k
101
101
  }, [
102
- (l(!0), a(I, null, S(z.value, (e) => (l(), a("button", {
103
- class: b(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
102
+ (l(!0), a(C, null, S(z.value, (e) => (l(), a("button", {
103
+ class: I(["tr-flow-layout__dropdown_item", { selected: e.id === u.value }]),
104
104
  key: e.id,
105
105
  onClick: (f) => R(e.id)
106
106
  }, [
107
- (l(), x(B(e.icon), { class: "tr-flow-layout__item-icon" })),
108
- C("span", Z, D(e.label), 1)
107
+ (l(), x(b(e.icon), { class: "tr-flow-layout__item-icon" })),
108
+ B("span", Z, D(e.label), 1)
109
109
  ], 10, Y))), 128))
110
110
  ], 512)) : _("", !0)
111
111
  ], 32)
112
112
  ])
113
113
  ], 512));
114
114
  }
115
- }), p = /* @__PURE__ */ J(ee, [["__scopeId", "data-v-5c283520"]]);
115
+ }), p = /* @__PURE__ */ K(ee, [["__scopeId", "data-v-5c283520"]]);
116
116
  p.name = "TrFlowLayout";
117
117
  const te = function(d) {
118
118
  d.component(p.name, p);
@@ -1,11 +1,11 @@
1
- import { defineComponent as V, createElementBlock as u, openBlock as n, normalizeStyle as X, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as G, watchEffect as Y, nextTick as Z, mergeModels as N, useCssVars as q, computed as h, useModel as P, createCommentVNode as E, Fragment as T, renderList as $, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as z, withModifiers as H, vModelText as re } from "vue";
2
- import { f as oe, z as se, r as ae, n as ne, t as ie } from "../tiny-robot-svgs.js";
1
+ import { defineComponent as M, createElementBlock as u, openBlock as n, normalizeStyle as J, normalizeClass as D, createElementVNode as p, toDisplayString as k, createVNode as m, unref as e, ref as A, watchEffect as X, nextTick as Z, mergeModels as N, useCssVars as q, computed as h, useModel as P, createCommentVNode as E, Fragment as T, renderList as $, createBlock as R, withDirectives as ee, mergeProps as te, withCtx as H, withModifiers as S, vModelText as re } from "vue";
2
+ import { G as oe, l as se, Y as ae, M as ne, T as ie } from "../tiny-robot-svgs.js";
3
3
  import { I as le } from "../index5.js";
4
- import { T as S } from "../index4.js";
4
+ import { T as U } from "../index4.js";
5
5
  import B from "../icon-button/index.js";
6
6
  import { o as ce } from "../index2.js";
7
- import { _ as M } from "../_plugin-vue_export-helper.js";
8
- const ue = /* @__PURE__ */ V({
7
+ import { _ as V } from "../_plugin-vue_export-helper.js";
8
+ const ue = /* @__PURE__ */ M({
9
9
  __name: "item-tag",
10
10
  props: {
11
11
  text: {},
@@ -16,12 +16,12 @@ const ue = /* @__PURE__ */ V({
16
16
  const t = i;
17
17
  return (a, _) => (n(), u("div", {
18
18
  class: D(["tr-history__item-tag", t.type]),
19
- style: X(t.style)
19
+ style: J(t.style)
20
20
  }, [
21
21
  p("span", null, k(t.text), 1)
22
22
  ], 6));
23
23
  }
24
- }), de = /* @__PURE__ */ M(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ V({
24
+ }), de = /* @__PURE__ */ V(ue, [["__scopeId", "data-v-346767bb"]]), _e = { class: "tr-history__empty" }, pe = { class: "tr-history__empty-icon" }, he = { class: "tr-history__empty-text" }, me = /* @__PURE__ */ M({
25
25
  __name: "search-empty",
26
26
  props: {
27
27
  text: { default: "暂无内容" }
@@ -35,20 +35,20 @@ const ue = /* @__PURE__ */ V({
35
35
  p("span", he, k(t.text), 1)
36
36
  ]));
37
37
  }
38
- }), fe = /* @__PURE__ */ M(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
39
- const t = G(), a = (l) => {
38
+ }), ve = /* @__PURE__ */ V(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
39
+ const t = A(), a = (l) => {
40
40
  t.value = {
41
41
  id: l.id,
42
42
  title: l.title,
43
43
  rawData: l
44
44
  };
45
- }, _ = G(null), f = (l) => {
45
+ }, _ = A(null), v = (l) => {
46
46
  l && Z(() => {
47
47
  _.value = l, _.value.focus();
48
48
  });
49
49
  };
50
50
  let r;
51
- const v = () => {
51
+ const y = () => {
52
52
  if (t.value) {
53
53
  if (t.value.title !== t.value.rawData.title) {
54
54
  const { title: l, rawData: I } = t.value;
@@ -60,25 +60,25 @@ const ue = /* @__PURE__ */ V({
60
60
  }, g = () => {
61
61
  t.value = void 0, r == null || r(), r = void 0;
62
62
  }, b = (l) => {
63
- l.key === "Enter" ? v() : l.key === "Escape" && g();
63
+ l.key === "Enter" ? y() : l.key === "Escape" && g();
64
64
  };
65
- return Y(() => {
65
+ return X(() => {
66
66
  _.value && (r == null || r(), r = ce(_, () => {
67
- v();
67
+ y();
68
68
  }));
69
69
  }), {
70
70
  editingItem: t,
71
71
  handleEdit: a,
72
- handleEditorInputRef: f,
72
+ handleEditorInputRef: v,
73
73
  handleKeyDown: b
74
74
  };
75
- }, ye = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
75
+ }, fe = { class: "tr-history" }, ke = { class: "tr-history__tabs" }, ge = ["onClick"], be = {
76
76
  key: 0,
77
77
  class: "tr-history__search"
78
78
  }, xe = { class: "tr-history__content" }, Ce = {
79
79
  key: 0,
80
80
  class: "tr-history__group-title"
81
- }, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */ V({
81
+ }, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */ M({
82
82
  __name: "index",
83
83
  props: /* @__PURE__ */ N({
84
84
  tabTitle: {},
@@ -102,27 +102,27 @@ const ue = /* @__PURE__ */ V({
102
102
  d4b77bae: b.value ? "1px solid rgb(240, 240, 240)" : "none",
103
103
  "659130e6": b.value ? "2px solid rgb(25, 25, 25)" : "none"
104
104
  }));
105
- const a = i, _ = P(i, "activeTab"), f = P(i, "searchQuery"), r = t, v = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || v.value[0].id), b = h(() => v.value.length > 1), l = (c) => {
105
+ const a = i, _ = P(i, "activeTab"), v = P(i, "searchQuery"), r = t, y = h(() => Array.isArray(a.tabs) ? a.tabs : [{ title: a.tabTitle, id: "0" }]), g = h(() => _.value || y.value[0].id), b = h(() => y.value.length > 1), l = (c) => {
106
106
  var s;
107
107
  const o = typeof ((s = c[0]) == null ? void 0 : s.group);
108
108
  return o === "string" || o === "symbol";
109
- }, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), O = h(() => {
109
+ }, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), G = h(() => {
110
110
  const c = I.value;
111
111
  return l(c) ? c : [{ group: w, items: c }];
112
- }), x = h(() => a.searchBar ? O.value.map((o) => ({
112
+ }), x = h(() => a.searchBar ? G.value.map((o) => ({
113
113
  ...o,
114
- items: o.items.filter((s) => a.searchFn(f.value || "", s))
115
- })).filter((o) => o.items.length > 0) : O.value), K = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), L = (c) => {
114
+ items: o.items.filter((s) => a.searchFn(v.value || "", s))
115
+ })).filter((o) => o.items.length > 0) : G.value), L = h(() => x.value.length === 0 ? !1 : x.value[0].group === w ? x.value[0].items.length > 0 : !0), z = (c) => {
116
116
  var o;
117
117
  c.id !== ((o = C.value) == null ? void 0 : o.id) && r("item-click", c);
118
118
  }, W = () => {
119
119
  r("close");
120
- }, F = (c) => {
120
+ }, Y = (c) => {
121
121
  r("item-delete", c);
122
- }, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: Q } = ve(r);
123
- return (c, o) => (n(), u("div", ye, [
122
+ }, { editingItem: C, handleEdit: F, handleEditorInputRef: j, handleKeyDown: O } = ye(r);
123
+ return (c, o) => (n(), u("div", fe, [
124
124
  p("div", ke, [
125
- (n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
125
+ (n(!0), u(T, null, $(y.value, (s) => (n(), u("div", {
126
126
  key: s.id,
127
127
  class: D(["tr-history__tab", { active: g.value === s.id }]),
128
128
  onClick: (d) => _.value = s.id
@@ -130,15 +130,15 @@ const ue = /* @__PURE__ */ V({
130
130
  ]),
131
131
  a.searchBar ? (n(), u("div", be, [
132
132
  m(e(le), {
133
- modelValue: f.value,
134
- "onUpdate:modelValue": o[0] || (o[0] = (s) => f.value = s),
133
+ modelValue: v.value,
134
+ "onUpdate:modelValue": o[0] || (o[0] = (s) => v.value = s),
135
135
  placeholder: a.searchPlaceholder || "搜索对话名称",
136
136
  "prefix-icon": e(se),
137
137
  clearable: ""
138
138
  }, null, 8, ["modelValue", "placeholder", "prefix-icon"])
139
139
  ])) : E("", !0),
140
140
  p("div", xe, [
141
- K.value ? (n(!0), u(T, { key: 0 }, $(x.value, (s) => (n(), u("div", {
141
+ L.value ? (n(!0), u(T, { key: 0 }, $(x.value, (s) => (n(), u("div", {
142
142
  key: s.group,
143
143
  class: "tr-history__group"
144
144
  }, [
@@ -146,13 +146,13 @@ const ue = /* @__PURE__ */ V({
146
146
  p("span", null, k(s.group), 1)
147
147
  ])) : E("", !0),
148
148
  (n(!0), u(T, null, $(s.items, (d) => {
149
- var A;
149
+ var Q;
150
150
  return n(), u("div", {
151
151
  key: `${d.id}-${d.title}`,
152
152
  class: D(["tr-history__item", { selected: a.selected === d.id }]),
153
- onClick: (y) => L(d)
153
+ onClick: (f) => z(d)
154
154
  }, [
155
- ((A = e(C)) == null ? void 0 : A.id) !== d.id ? (n(), u(T, { key: 0 }, [
155
+ ((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
156
156
  p("span", Ie, k(d.title), 1),
157
157
  d.tag ? (n(), R(e(de), te({
158
158
  key: 0,
@@ -160,30 +160,30 @@ const ue = /* @__PURE__ */ V({
160
160
  ref_for: !0
161
161
  }, d.tag), null, 16)) : E("", !0),
162
162
  p("div", we, [
163
- m(e(S), {
163
+ m(e(U), {
164
164
  content: "编辑",
165
165
  effect: "dark",
166
166
  placement: "top",
167
167
  "open-delay": 500
168
168
  }, {
169
- default: z(() => [
169
+ default: H(() => [
170
170
  m(e(B), {
171
171
  icon: e(ae),
172
- onClick: H((y) => e(j)(d), ["stop"])
172
+ onClick: S((f) => e(F)(d), ["stop"])
173
173
  }, null, 8, ["icon", "onClick"])
174
174
  ]),
175
175
  _: 2
176
176
  }, 1024),
177
- m(e(S), {
177
+ m(e(U), {
178
178
  content: "删除",
179
179
  effect: "dark",
180
180
  placement: "top",
181
181
  "open-delay": 500
182
182
  }, {
183
- default: z(() => [
183
+ default: H(() => [
184
184
  m(e(B), {
185
185
  icon: e(ne),
186
- onClick: H((y) => F(d), ["stop"])
186
+ onClick: S((f) => Y(d), ["stop"])
187
187
  }, null, 8, ["icon", "onClick"])
188
188
  ]),
189
189
  _: 2
@@ -191,20 +191,20 @@ const ue = /* @__PURE__ */ V({
191
191
  ])
192
192
  ], 64)) : ee((n(), u("input", {
193
193
  key: 1,
194
- "onUpdate:modelValue": o[1] || (o[1] = (y) => e(C).title = y),
194
+ "onUpdate:modelValue": o[1] || (o[1] = (f) => e(C).title = f),
195
195
  class: "tr-history__item-edit",
196
196
  ref_for: !0,
197
- ref: e(J),
197
+ ref: e(j),
198
198
  onKeydown: o[2] || (o[2] = //@ts-ignore
199
- (...y) => e(Q) && e(Q)(...y))
199
+ (...f) => e(O) && e(O)(...f))
200
200
  }, null, 544)), [
201
201
  [re, e(C).title]
202
202
  ])
203
203
  ], 10, Te);
204
204
  }), 128))
205
- ]))), 128)) : (n(), R(e(fe), {
205
+ ]))), 128)) : (n(), R(e(ve), {
206
206
  key: 1,
207
- text: f.value ? "暂无搜索结果" : "暂无内容"
207
+ text: v.value ? "暂无搜索结果" : "暂无内容"
208
208
  }, null, 8, ["text"]))
209
209
  ]),
210
210
  p("div", Ee, [
@@ -216,10 +216,10 @@ const ue = /* @__PURE__ */ V({
216
216
  ])
217
217
  ]));
218
218
  }
219
- }), U = /* @__PURE__ */ M($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
220
- i.component("TrHistory", U);
219
+ }), K = /* @__PURE__ */ V($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
220
+ i.component("TrHistory", K);
221
221
  }, Ne = {
222
- ...U,
222
+ ...K,
223
223
  install: Be,
224
224
  name: "TrHistory"
225
225
  };