@opentiny/tiny-robot 0.3.0-alpha.3 → 0.3.0-alpha.5

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,10 +1,10 @@
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 H, withModifiers as S, vModelText as re } from "vue";
2
- import { w as oe, b as se, p as ae, A as ne, f as ie } from "../tiny-robot-svgs.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 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";
3
3
  import { I as le } from "../index5.js";
4
- import { T as U } from "../index4.js";
4
+ import { T as S } from "../index4.js";
5
5
  import B from "../icon-button/index.js";
6
6
  import { o as ce } from "../index2.js";
7
- import { _ as A } from "../_plugin-vue_export-helper.js";
7
+ import { _ as M } from "../_plugin-vue_export-helper.js";
8
8
  const ue = /* @__PURE__ */ V({
9
9
  __name: "item-tag",
10
10
  props: {
@@ -21,7 +21,7 @@ const ue = /* @__PURE__ */ V({
21
21
  p("span", null, k(t.text), 1)
22
22
  ], 6));
23
23
  }
24
- }), de = /* @__PURE__ */ A(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__ */ 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({
25
25
  __name: "search-empty",
26
26
  props: {
27
27
  text: { default: "暂无内容" }
@@ -35,7 +35,7 @@ const ue = /* @__PURE__ */ V({
35
35
  p("span", he, k(t.text), 1)
36
36
  ]));
37
37
  }
38
- }), fe = /* @__PURE__ */ A(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
38
+ }), fe = /* @__PURE__ */ M(me, [["__scopeId", "data-v-b21f5bc0"]]), ve = (i) => {
39
39
  const t = G(), a = (l) => {
40
40
  t.value = {
41
41
  id: l.id,
@@ -106,20 +106,20 @@ const ue = /* @__PURE__ */ V({
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"), M = h(() => {
109
+ }, I = h(() => Array.isArray(a.data) ? a.data || [] : a.data[g.value] || []), w = Symbol("NO_GROUP"), O = h(() => {
110
110
  const c = I.value;
111
111
  return l(c) ? c : [{ group: w, items: c }];
112
- }), x = h(() => a.searchBar ? M.value.map((o) => ({
112
+ }), x = h(() => a.searchBar ? O.value.map((o) => ({
113
113
  ...o,
114
114
  items: o.items.filter((s) => a.searchFn(f.value || "", s))
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) => {
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) => {
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
120
  }, F = (c) => {
121
121
  r("item-delete", c);
122
- }, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: O } = ve(r);
122
+ }, { editingItem: C, handleEdit: j, handleEditorInputRef: J, handleKeyDown: Q } = ve(r);
123
123
  return (c, o) => (n(), u("div", ye, [
124
124
  p("div", ke, [
125
125
  (n(!0), u(T, null, $(v.value, (s) => (n(), u("div", {
@@ -138,7 +138,7 @@ const ue = /* @__PURE__ */ V({
138
138
  }, null, 8, ["modelValue", "placeholder", "prefix-icon"])
139
139
  ])) : E("", !0),
140
140
  p("div", xe, [
141
- L.value ? (n(!0), u(T, { key: 0 }, $(x.value, (s) => (n(), u("div", {
141
+ K.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,43 +146,43 @@ 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 Q;
149
+ var A;
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) => z(d)
153
+ onClick: (y) => L(d)
154
154
  }, [
155
- ((Q = e(C)) == null ? void 0 : Q.id) !== d.id ? (n(), u(T, { key: 0 }, [
155
+ ((A = e(C)) == null ? void 0 : A.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,
159
159
  class: "tr-history__item-tag"
160
160
  }, { ref_for: !0 }, d.tag), null, 16)) : E("", !0),
161
161
  p("div", we, [
162
- m(e(U), {
162
+ m(e(S), {
163
163
  content: "编辑",
164
164
  effect: "dark",
165
165
  placement: "top",
166
166
  "open-delay": 500
167
167
  }, {
168
- default: H(() => [
168
+ default: z(() => [
169
169
  m(e(B), {
170
170
  icon: e(ae),
171
- onClick: S((y) => e(j)(d), ["stop"])
171
+ onClick: H((y) => e(j)(d), ["stop"])
172
172
  }, null, 8, ["icon", "onClick"])
173
173
  ]),
174
174
  _: 2
175
175
  }, 1024),
176
- m(e(U), {
176
+ m(e(S), {
177
177
  content: "删除",
178
178
  effect: "dark",
179
179
  placement: "top",
180
180
  "open-delay": 500
181
181
  }, {
182
- default: H(() => [
182
+ default: z(() => [
183
183
  m(e(B), {
184
184
  icon: e(ne),
185
- onClick: S((y) => F(d), ["stop"])
185
+ onClick: H((y) => F(d), ["stop"])
186
186
  }, null, 8, ["icon", "onClick"])
187
187
  ]),
188
188
  _: 2
@@ -195,7 +195,7 @@ const ue = /* @__PURE__ */ V({
195
195
  ref_for: !0,
196
196
  ref: e(J),
197
197
  onKeydown: o[2] || (o[2] = //@ts-ignore
198
- (...y) => e(O) && e(O)(...y))
198
+ (...y) => e(Q) && e(Q)(...y))
199
199
  }, null, 544)), [
200
200
  [re, e(C).title]
201
201
  ])
@@ -215,10 +215,10 @@ const ue = /* @__PURE__ */ V({
215
215
  ])
216
216
  ]));
217
217
  }
218
- }), K = /* @__PURE__ */ A($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
219
- i.component("TrHistory", K);
218
+ }), U = /* @__PURE__ */ M($e, [["__scopeId", "data-v-8aa5fd59"]]), Be = function(i) {
219
+ i.component("TrHistory", U);
220
220
  }, Ne = {
221
- ...K,
221
+ ...U,
222
222
  install: Be,
223
223
  name: "TrHistory"
224
224
  };
@@ -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
  };