@opentiny/tiny-robot 0.4.2-alpha.8 → 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/index7.js CHANGED
@@ -1,11 +1,11 @@
1
- import { onMounted as ne, onBeforeUnmount as oe, ref as _, 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";
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 ye } from "./index4.js";
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 = _(!1);
6
+ const D = y(!1);
7
7
  let b = 0, $;
8
- function _e() {
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 && ($ = _e());
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 = _(null);
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: y } = ve(t), { width: M, height: k } = ge(E, void 0, { box: "border-box" }), { height: R } = ye(), o = I(() => {
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(y.value)}, calc(100% - ${O(M.value + Q)}))`
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 = _(void 0), c = _(null), h = I(() => {
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 = _(null), E = I(() => {
102
+ }), C = y(null), E = I(() => {
103
103
  var o;
104
104
  return (o = C.value) == null ? void 0 : o.at(0);
105
- }), p = _(null), x = I(() => {
105
+ }), p = y(null), x = I(() => {
106
106
  var o;
107
107
  return (o = p.value) == null ? void 0 : o.at(0);
108
- }), y = _(""), M = (o) => {
109
- t.value = o, y.value = o.title, se(() => {
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, y.value = "";
114
+ t.value = void 0, _.value = "";
115
115
  }, R = () => {
116
- t.value && m(y.value, t.value), t.value = void 0, y.value = "";
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: y,
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: y,
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 = _(null), a = _(null), K = (i, e) => {
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: y,
247
+ ref: _,
251
248
  onClick: e[4] || (e[4] = //@ts-ignore
252
249
  (...d) => n(v) && n(v)(...d))
253
250
  }, [