@opentiny/tiny-robot 0.3.3 → 0.3.4

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/index3.js CHANGED
@@ -1,11 +1,11 @@
1
- import { onMounted as ne, onBeforeUnmount as oe, ref as _, defineComponent as P, openBlock as r, createElementBlock as a, createElementVNode as w, createVNode as $, 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 le, withModifiers as J, vModelText as re, vShow as ae } from "vue";
1
+ import { onMounted as ne, onBeforeUnmount as oe, ref as y, defineComponent as P, openBlock as r, createElementBlock as a, createElementVNode as w, createVNode as $, 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 le, withModifiers as J, vModelText as re, vShow as ae } from "vue";
2
2
  import { IconEmptySearch as ue, IconEditPen as ce, IconDelete as de, IconCheck as me, IconClose as fe, IconMenu2 as pe } from "@opentiny/tiny-robot-svgs";
3
3
  import { _ as z } from "./_plugin-vue_export-helper.js";
4
- import { o as Z, c as ve, e as ge, d as ye } from "./index4.js";
4
+ import { o as Z, c as ve, e as ge, d 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 T = 0, b;
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
- T++, T === 1 && (b = _e());
27
+ T++, T === 1 && (b = ye());
28
28
  }), oe(() => {
29
29
  T = Math.max(0, T - 1), T === 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), u = _(null), K = (i, e) => {
173
+ }), { isTouchDevice: L } = Ce(), g = y(null), u = y(null), K = (i, e) => {
174
174
  if (i.currentTarget instanceof HTMLButtonElement) {
175
175
  if (u.value === e) {
176
176
  g.value = null, u.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
  [re, n(k)]
231
- ]) : q(i.$slots, "item-title", {
232
- key: 2,
233
- item: l
234
- }, () => [
231
+ ]) : q(i.$slots, "item-title", { item: l }, () => [
235
232
  w("span", {
236
233
  class: "text",
237
234
  title: l.title
238
235
  }, B(l.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
  }, [
package/dist/index4.js CHANGED
@@ -1,4 +1,4 @@
1
- import { onMounted as re, nextTick as he, watch as k, isRef as ie, getCurrentScope as me, onScopeDispose as ge, getCurrentInstance as j, toValue as w, toRefs as we, customRef as be, hasInjectionContext as le, inject as ye, shallowRef as y, computed as P, reactive as Z, unref as Oe, watchEffect as se, ref as Se, readonly as Te } from "vue";
1
+ import { onMounted as re, nextTick as he, watch as k, getCurrentScope as me, onScopeDispose as ge, getCurrentInstance as j, hasInjectionContext as ie, inject as we, isRef as le, toValue as w, toRefs as be, customRef as ye, shallowRef as y, computed as P, watchEffect as se, unref as Oe, reactive as Z, ref as Se, readonly as Te } from "vue";
2
2
  function z(e) {
3
3
  return me() ? (ge(e), !0) : !1;
4
4
  }
@@ -25,9 +25,9 @@ function ee() {
25
25
  const B = /* @__PURE__ */ new WeakMap(), Ee = /* @__NO_SIDE_EFFECTS__ */ (...e) => {
26
26
  var t;
27
27
  const o = e[0], n = (t = j()) == null ? void 0 : t.proxy;
28
- if (n == null && !le())
28
+ if (n == null && !ie())
29
29
  throw new Error("injectLocal must be called in setup");
30
- return n && B.has(n) && o in B.get(n) ? B.get(n)[o] : ye(...e);
30
+ return n && B.has(n) && o in B.get(n) ? B.get(n)[o] : we(...e);
31
31
  }, $ = typeof window < "u" && typeof document < "u";
32
32
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
33
33
  const xe = (e) => e != null, We = Object.prototype.toString, Me = (e) => We.call(e) === "[object Object]", W = () => {
@@ -64,7 +64,7 @@ function ue(e, t = {}) {
64
64
  }
65
65
  function ce(...e) {
66
66
  let t = 0, o, n = !0, u = W, i, a, r, s, d;
67
- !ie(e[0]) && typeof e[0] == "object" ? { delay: a, trailing: r = !0, leading: s = !0, rejectOnCancel: d = !1 } = e[0] : [a, r = !0, s = !0, d = !1] = e;
67
+ !le(e[0]) && typeof e[0] == "object" ? { delay: a, trailing: r = !0, leading: s = !0, rejectOnCancel: d = !1 } = e[0] : [a, r = !0, s = !0, d = !1] = e;
68
68
  const v = () => {
69
69
  o && (clearTimeout(o), o = void 0, u(), u = W);
70
70
  };
@@ -118,11 +118,11 @@ function ae(e, t, o = {}) {
118
118
  );
119
119
  }
120
120
  function Re(e, t = {}) {
121
- if (!ie(e))
122
- return we(e);
121
+ if (!le(e))
122
+ return be(e);
123
123
  const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
124
124
  for (const n in e.value)
125
- o[n] = be(() => ({
125
+ o[n] = ye(() => ({
126
126
  get() {
127
127
  return e.value[n];
128
128
  },
@@ -331,7 +331,7 @@ function fe(e, t, o = {}) {
331
331
  const ze = Symbol("vueuse-ssr-width");
332
332
  // @__NO_SIDE_EFFECTS__
333
333
  function Ne() {
334
- const e = le() ? /* @__PURE__ */ Ee(ze, null) : null;
334
+ const e = ie() ? /* @__PURE__ */ Ee(ze, null) : null;
335
335
  return typeof e == "number" ? e : void 0;
336
336
  }
337
337
  function Be(e, t = {}) {
@@ -701,9 +701,10 @@ export {
701
701
  tt as d,
702
702
  Je as e,
703
703
  Ke as f,
704
- Xe as g,
705
- Be as h,
706
- et as i,
704
+ de as g,
705
+ Xe as h,
706
+ Be as i,
707
+ et as j,
707
708
  Ue as o,
708
709
  Ze as u,
709
710
  Qe as w