@opentiny/tiny-robot 0.3.0-alpha.0 → 0.3.0-alpha.10

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,11 +1,11 @@
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
- import { I as le } from "../index5.js";
4
- import { T as U } from "../index4.js";
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 U, watchEffect as Y, nextTick as Z, mergeModels as A, useCssVars as q, computed as h, useModel as G, createCommentVNode as E, Fragment as T, renderList as $, createBlock as N, withDirectives as ee, mergeProps as te, withCtx as R, withModifiers as H, vModelText as re } from "vue";
2
+ import { n as oe, P as se, t as ae, _ as ne, U as ie } from "../tiny-robot-svgs.js";
3
+ import { I as le } from "../index6.js";
4
+ import { T as S } from "../index2.js";
5
5
  import B from "../icon-button/index.js";
6
- import { o as ce } from "../index2.js";
7
- import { _ as V } from "../_plugin-vue_export-helper.js";
8
- const ue = /* @__PURE__ */ M({
6
+ import { o as ce } from "../index3.js";
7
+ import { _ as P } from "../_plugin-vue_export-helper.js";
8
+ const ue = /* @__PURE__ */ V({
9
9
  __name: "item-tag",
10
10
  props: {
11
11
  text: {},
@@ -16,12 +16,12 @@ const ue = /* @__PURE__ */ M({
16
16
  const t = i;
17
17
  return (a, _) => (n(), u("div", {
18
18
  class: D(["tr-history__item-tag", t.type]),
19
- style: J(t.style)
19
+ style: X(t.style)
20
20
  }, [
21
21
  p("span", null, k(t.text), 1)
22
22
  ], 6));
23
23
  }
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({
24
+ }), de = /* @__PURE__ */ P(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({
25
25
  __name: "search-empty",
26
26
  props: {
27
27
  text: { default: "暂无内容" }
@@ -35,14 +35,14 @@ const ue = /* @__PURE__ */ M({
35
35
  p("span", he, k(t.text), 1)
36
36
  ]));
37
37
  }
38
- }), ve = /* @__PURE__ */ V(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
39
- const t = A(), a = (l) => {
38
+ }), ve = /* @__PURE__ */ P(me, [["__scopeId", "data-v-b21f5bc0"]]), ye = (i) => {
39
+ const t = U(), a = (l) => {
40
40
  t.value = {
41
41
  id: l.id,
42
42
  title: l.title,
43
43
  rawData: l
44
44
  };
45
- }, _ = A(null), v = (l) => {
45
+ }, _ = U(null), v = (l) => {
46
46
  l && Z(() => {
47
47
  _.value = l, _.value.focus();
48
48
  });
@@ -62,7 +62,7 @@ const ue = /* @__PURE__ */ M({
62
62
  }, b = (l) => {
63
63
  l.key === "Enter" ? y() : l.key === "Escape" && g();
64
64
  };
65
- return X(() => {
65
+ return Y(() => {
66
66
  _.value && (r == null || r(), r = ce(_, () => {
67
67
  y();
68
68
  }));
@@ -78,9 +78,9 @@ const ue = /* @__PURE__ */ M({
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__ */ M({
81
+ }, Te = ["onClick"], Ie = { class: "tr-history__item-title" }, we = { class: "tr-history__item-actions" }, Ee = { class: "tr-history__close" }, $e = /* @__PURE__ */ V({
82
82
  __name: "index",
83
- props: /* @__PURE__ */ N({
83
+ props: /* @__PURE__ */ A({
84
84
  tabTitle: {},
85
85
  data: {},
86
86
  activeTab: {},
@@ -96,30 +96,30 @@ const ue = /* @__PURE__ */ M({
96
96
  searchQuery: {},
97
97
  searchQueryModifiers: {}
98
98
  }),
99
- emits: /* @__PURE__ */ N(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
99
+ emits: /* @__PURE__ */ A(["close", "item-click", "item-title-change", "item-delete"], ["update:activeTab", "update:searchQuery"]),
100
100
  setup(i, { emit: t }) {
101
101
  q((c) => ({
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"), 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) => {
105
+ const a = i, _ = G(i, "activeTab"), v = G(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"), G = h(() => {
109
+ }, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), M = h(() => {
110
110
  const c = I.value;
111
111
  return l(c) ? c : [{ group: w, items: c }];
112
- }), x = h(() => a.searchBar ? G.value.map((o) => ({
112
+ }), x = h(() => a.searchBar ? M.value.map((o) => ({
113
113
  ...o,
114
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) => {
115
+ })).filter((o) => o.items.length > 0) : M.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
- }, Y = (c) => {
120
+ }, F = (c) => {
121
121
  r("item-delete", c);
122
- }, { editingItem: C, handleEdit: F, handleEditorInputRef: j, handleKeyDown: O } = ye(r);
122
+ }, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ye(r);
123
123
  return (c, o) => (n(), u("div", fe, [
124
124
  p("div", ke, [
125
125
  (n(!0), u(T, null, $(y.value, (s) => (n(), u("div", {
@@ -154,36 +154,35 @@ const ue = /* @__PURE__ */ M({
154
154
  }, [
155
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
- d.tag ? (n(), R(e(de), te({
157
+ d.tag ? (n(), N(e(de), te({
158
158
  key: 0,
159
- class: "tr-history__item-tag",
160
- ref_for: !0
161
- }, d.tag), null, 16)) : E("", !0),
159
+ class: "tr-history__item-tag"
160
+ }, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
162
161
  p("div", we, [
163
- m(e(U), {
162
+ m(e(S), {
164
163
  content: "编辑",
165
164
  effect: "dark",
166
165
  placement: "top",
167
166
  "open-delay": 500
168
167
  }, {
169
- default: H(() => [
168
+ default: R(() => [
170
169
  m(e(B), {
171
170
  icon: e(ae),
172
- onClick: S((f) => e(F)(d), ["stop"])
171
+ onClick: H((f) => e(j)(d), ["stop"])
173
172
  }, null, 8, ["icon", "onClick"])
174
173
  ]),
175
174
  _: 2
176
175
  }, 1024),
177
- m(e(U), {
176
+ m(e(S), {
178
177
  content: "删除",
179
178
  effect: "dark",
180
179
  placement: "top",
181
180
  "open-delay": 500
182
181
  }, {
183
- default: H(() => [
182
+ default: R(() => [
184
183
  m(e(B), {
185
184
  icon: e(ne),
186
- onClick: S((f) => Y(d), ["stop"])
185
+ onClick: H((f) => F(d), ["stop"])
187
186
  }, null, 8, ["icon", "onClick"])
188
187
  ]),
189
188
  _: 2
@@ -194,7 +193,7 @@ const ue = /* @__PURE__ */ M({
194
193
  "onUpdate:modelValue": o[1] || (o[1] = (f) => e(C).title = f),
195
194
  class: "tr-history__item-edit",
196
195
  ref_for: !0,
197
- ref: e(j),
196
+ ref: e(J),
198
197
  onKeydown: o[2] || (o[2] = //@ts-ignore
199
198
  (...f) => e(O) && e(O)(...f))
200
199
  }, null, 544)), [
@@ -202,7 +201,7 @@ const ue = /* @__PURE__ */ M({
202
201
  ])
203
202
  ], 10, Te);
204
203
  }), 128))
205
- ]))), 128)) : (n(), R(e(ve), {
204
+ ]))), 128)) : (n(), N(e(ve), {
206
205
  key: 1,
207
206
  text: v.value ? "暂无搜索结果" : "暂无内容"
208
207
  }, null, 8, ["text"]))
@@ -216,13 +215,13 @@ const ue = /* @__PURE__ */ M({
216
215
  ])
217
216
  ]));
218
217
  }
219
- }), K = /* @__PURE__ */ V($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
218
+ }), K = /* @__PURE__ */ P($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
220
219
  i.component("TrHistory", K);
221
- }, Ne = {
220
+ }, Ae = {
222
221
  ...K,
223
222
  install: Be,
224
223
  name: "TrHistory"
225
224
  };
226
225
  export {
227
- Ne as default
226
+ Ae as default
228
227
  };
@@ -1,7 +1,7 @@
1
- import { defineComponent as p, useCssVars as l, computed as n, createElementBlock as u, openBlock as s, normalizeClass as m, createBlock as d, resolveDynamicComponent as _ } from "vue";
2
- import { t as c } from "../utils.js";
1
+ import { defineComponent as r, computed as a, createElementBlock as u, openBlock as l, normalizeStyle as c, normalizeClass as p, createBlock as m, resolveDynamicComponent as d } from "vue";
2
+ import { t as i } from "../utils.js";
3
3
  import { _ as f } from "../_plugin-vue_export-helper.js";
4
- const v = /* @__PURE__ */ p({
4
+ const _ = /* @__PURE__ */ r({
5
5
  __name: "index",
6
6
  props: {
7
7
  icon: {},
@@ -9,24 +9,23 @@ const v = /* @__PURE__ */ p({
9
9
  svgSize: { default: "16px" },
10
10
  rounded: { type: Boolean }
11
11
  },
12
- setup(t) {
13
- l((i) => ({
14
- "72b46ad2": a.value,
15
- 66777814: r.value
16
- }));
17
- const o = t, a = n(() => c(o.size)), r = n(() => c(o.svgSize));
18
- return (i, z) => (s(), u("button", {
19
- class: m(["tr-icon-button", { rounded: o.rounded }])
12
+ setup(o) {
13
+ const e = o, s = a(() => i(e.size)), n = a(() => i(e.svgSize));
14
+ return (z, h) => (l(), u("button", {
15
+ class: p(["tr-icon-button", { rounded: e.rounded }]),
16
+ style: c({ width: s.value, height: s.value })
20
17
  }, [
21
- (s(), d(_(o.icon)))
22
- ], 2));
18
+ (l(), m(d(e.icon), {
19
+ style: c({ width: n.value, height: n.value, fontSize: n.value })
20
+ }, null, 8, ["style"]))
21
+ ], 6));
23
22
  }
24
- }), e = /* @__PURE__ */ f(v, [["__scopeId", "data-v-fe8553bc"]]);
25
- e.name = "TrIconButton";
26
- const x = function(t) {
27
- t.component(e.name, e);
23
+ }), t = /* @__PURE__ */ f(_, [["__scopeId", "data-v-159698f7"]]);
24
+ t.name = "TrIconButton";
25
+ const v = function(o) {
26
+ o.component(t.name, t);
28
27
  };
29
- e.install = x;
28
+ t.install = v;
30
29
  export {
31
- e as default
30
+ t as default
32
31
  };