@opentiny/tiny-robot 0.2.13 → 0.2.15

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,4 +1,4 @@
1
- import { defineComponent as H, useSlots as Z, computed as w, createElementBlock as k, openBlock as a, normalizeClass as P, renderSlot as b, createBlock as h, resolveDynamicComponent as j, createCommentVNode as R, toDisplayString as x, unref as _, mergeProps as E, createSlots as ee, withCtx as A, createVNode as W, renderList as $, normalizeStyle as te, mergeModels as F, useModel as oe, ref as S, watch as G, nextTick as V, createElementVNode as z, Fragment as N, Transition as ne } from "vue";
1
+ import { defineComponent as H, useSlots as Z, computed as w, createElementBlock as k, openBlock as u, normalizeClass as P, renderSlot as b, createBlock as h, resolveDynamicComponent as j, createCommentVNode as R, toDisplayString as x, unref as _, mergeProps as E, createSlots as ee, withCtx as A, createVNode as W, renderList as $, normalizeStyle as te, mergeModels as F, useModel as oe, ref as S, watch as G, nextTick as V, createElementVNode as z, Fragment as N, Transition as ne } from "vue";
2
2
  import { K as le } from "../tiny-robot-svgs.js";
3
3
  import { b as se, w as ie, o as re } from "../index2.js";
4
4
  import ae from "../dropdown-menu/index.js";
@@ -17,24 +17,24 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
17
17
  var o;
18
18
  return !!(n.default || (o = y.item) != null && o.text);
19
19
  }), v = w(() => t.value && !l.value);
20
- return (o, C) => (a(), k("button", {
20
+ return (o, C) => (u(), k("button", {
21
21
  class: P(["tr-suggestion-pills__item", { "only-icon": v.value }])
22
22
  }, [
23
23
  b(o.$slots, "icon", {}, () => {
24
24
  var c;
25
25
  return [
26
- (a(), h(j((c = o.item) == null ? void 0 : c.icon), { class: "tr-suggestion-pills__item_icon" }))
26
+ (u(), h(j((c = o.item) == null ? void 0 : c.icon), { class: "tr-suggestion-pills__item_icon" }))
27
27
  ];
28
28
  }, !0),
29
29
  b(o.$slots, "default", {}, () => {
30
30
  var c;
31
31
  return [
32
- (c = o.item) != null && c.text ? (a(), k("span", ce, x(o.item.text), 1)) : R("", !0)
32
+ (c = o.item) != null && c.text ? (u(), k("span", ce, x(o.item.text), 1)) : R("", !0)
33
33
  ];
34
34
  }, !0)
35
35
  ], 2));
36
36
  }
37
- }), f = /* @__PURE__ */ q(me, [["__scopeId", "data-v-5c113fe1"]]), K = /* @__PURE__ */ H({
37
+ }), f = /* @__PURE__ */ q(me, [["__scopeId", "data-v-5c433c31"]]), K = /* @__PURE__ */ H({
38
38
  __name: "PillButtonWrapper",
39
39
  props: {
40
40
  item: {},
@@ -45,7 +45,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
45
45
  const n = y;
46
46
  return (t, l) => {
47
47
  var v, o, C, c, B, g, d, M, I;
48
- return ((v = t.item.action) == null ? void 0 : v.type) === "popover" ? (a(), h(_(ue), E({
48
+ return ((v = t.item.action) == null ? void 0 : v.type) === "popover" ? (u(), h(_(ue), E({
49
49
  key: 0,
50
50
  style: t.style
51
51
  }, t.item.action.props, {
@@ -67,10 +67,10 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
67
67
  $(t.item.action.slots, (r, O) => ({
68
68
  name: O,
69
69
  fn: A(() => [
70
- (a(), h(j(r)))
70
+ (u(), h(j(r)))
71
71
  ])
72
72
  }))
73
- ]), 1040, ["style", "onItemClick", "onGroupClick", "onOpen", "onClose", "onClickOutside"])) : ((d = t.item.action) == null ? void 0 : d.type) === "menu" ? (a(), h(_(ae), E({
73
+ ]), 1040, ["style", "onItemClick", "onGroupClick", "onOpen", "onClose", "onClickOutside"])) : ((d = t.item.action) == null ? void 0 : d.type) === "menu" ? (u(), h(_(ae), E({
74
74
  key: 1,
75
75
  style: t.style
76
76
  }, t.item.action.props, {
@@ -85,7 +85,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
85
85
  }, null, 8, ["item"])
86
86
  ]),
87
87
  _: 1
88
- }, 16, ["style", "onItemClick", "onClickOutside"])) : (a(), h(f, {
88
+ }, 16, ["style", "onItemClick", "onClickOutside"])) : (u(), h(f, {
89
89
  key: 2,
90
90
  item: t.item,
91
91
  style: te(t.style),
@@ -124,12 +124,12 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
124
124
  return;
125
125
  const s = r(), i = parseFloat(getComputedStyle(e).rowGap) || 0;
126
126
  let m = 0;
127
- for (let u = 0; u < s.length; u++) {
128
- if (m += s[u].offsetWidth, u > 0 && (m += i), m > e.clientWidth) {
129
- d.value = u;
127
+ for (let a = 0; a < s.length; a++) {
128
+ if (m += s[a].offsetWidth, a > 0 && (m += i), m > e.clientWidth) {
129
+ d.value = a;
130
130
  break;
131
131
  }
132
- u === s.length - 1 && (d.value = -1);
132
+ a === s.length - 1 && (d.value = -1);
133
133
  }
134
134
  });
135
135
  };
@@ -143,7 +143,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
143
143
  if (!o.value)
144
144
  return;
145
145
  const e = r(), s = parseFloat(getComputedStyle(o.value).rowGap) || 0;
146
- B.value = e.map((i) => i.offsetWidth).reduce((i, m) => i + m + s);
146
+ B.value = e.reduce((i, m, a) => i + m.offsetWidth + (a > 0 ? s : 0), 0);
147
147
  });
148
148
  },
149
149
  { immediate: !0 }
@@ -173,7 +173,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
173
173
  const s = o.value;
174
174
  if (!s)
175
175
  return;
176
- const i = e.offsetLeft, m = i + e.offsetWidth, u = s.scrollLeft, D = s.clientWidth, X = i < u, Y = m > u + D;
176
+ const i = e.offsetLeft, m = i + e.offsetWidth, a = s.scrollLeft, D = s.clientWidth, X = i < a, Y = m > a + D;
177
177
  X ? s.scrollTo({
178
178
  left: i,
179
179
  behavior: "smooth"
@@ -184,7 +184,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
184
184
  }, U = (e) => {
185
185
  n.autoScrollOnHover && e.currentTarget && Q(e.currentTarget);
186
186
  };
187
- return (e, s) => (a(), k("div", {
187
+ return (e, s) => (u(), k("div", {
188
188
  class: "tr-suggestion-pills__wrapper",
189
189
  ref_key: "containerWrapperRef",
190
190
  ref: v
@@ -195,24 +195,24 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
195
195
  ref: o
196
196
  }, [
197
197
  b(e.$slots, "default", {}, () => [
198
- (a(!0), k(N, null, $(M.value, (i, m) => (a(), h(_(K), {
198
+ (u(!0), k(N, null, $(M.value, (i, m) => (u(), h(_(K), {
199
199
  key: i.id,
200
200
  item: i,
201
- onClick: (u) => J(u, i, m),
202
- onMouseenter: s[0] || (s[0] = (u) => U(u))
201
+ onClick: (a) => J(a, i, m),
202
+ onMouseenter: s[0] || (s[0] = (a) => U(a))
203
203
  }, null, 8, ["item", "onClick"]))), 128))
204
204
  ], !0)
205
205
  ], 2),
206
206
  z("div", pe, [
207
207
  W(ne, { name: "tr-suggestion-pills__more" }, {
208
208
  default: A(() => [
209
- I.value.length ? (a(), k("div", {
209
+ I.value.length ? (u(), k("div", {
210
210
  key: 0,
211
211
  class: "tr-suggestion-pills__more",
212
212
  ref_key: "floatingItemsRef",
213
213
  ref: C
214
214
  }, [
215
- (a(!0), k(N, null, $(I.value, (i) => (a(), h(_(K), {
215
+ (u(!0), k(N, null, $(I.value, (i) => (u(), h(_(K), {
216
216
  key: i.id,
217
217
  item: i,
218
218
  onClick: (m) => t("item-click", i)
@@ -222,7 +222,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
222
222
  _: 1
223
223
  })
224
224
  ]),
225
- g.value ? (a(), k("button", {
225
+ g.value ? (u(), k("button", {
226
226
  key: 0,
227
227
  class: P(["tr-suggestion-pills__expand", { "show-on-hover": n.showAllButtonOn === "hover" }]),
228
228
  onClick: L
@@ -233,7 +233,7 @@ const ce = { key: 0 }, me = /* @__PURE__ */ H({
233
233
  ], 2)) : R("", !0)
234
234
  ], 512));
235
235
  }
236
- }), T = /* @__PURE__ */ q(de, [["__scopeId", "data-v-68ee26f5"]]);
236
+ }), T = /* @__PURE__ */ q(de, [["__scopeId", "data-v-5137af87"]]);
237
237
  T.name = "TrSuggestionPills";
238
238
  const fe = function(p) {
239
239
  p.component(T.name, T);