@opentiny/tiny-robot 0.4.2-alpha.3 → 0.4.2-alpha.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.
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as I, nextTick as W, openBlock as o, createElementBlock as _, Fragment as N, renderList as R, createBlock as v, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as G, renderSlot as L, createVNode as x, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, createCommentVNode as E, toDisplayString as Q, vShow as U } from "vue";
2
- import { IconMenu as Y } from "@opentiny/tiny-robot-svgs";
2
+ import { IconMoreCircle as Y } from "@opentiny/tiny-robot-svgs";
3
3
  import { TinyTooltip as M } from "@opentiny/vue";
4
- import { o as Z, b as ee } from "../index4.js";
4
+ import { o as Z, l as ee } from "../index4.js";
5
5
  import te from "../icon-button/index.js";
6
6
  import { _ as oe } from "../_plugin-vue_export-helper.js";
7
7
  const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
@@ -120,7 +120,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
120
120
  }, 8, ["disabled"])) : E("", !0)
121
121
  ]));
122
122
  }
123
- }), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-7ea2f915"]]), u = /* @__PURE__ */ $({
123
+ }), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-5a06be84"]]), u = /* @__PURE__ */ $({
124
124
  __name: "ActionGroupItem",
125
125
  props: {
126
126
  name: {},
@@ -1,6 +1,6 @@
1
- import { defineComponent as G, ref as _, computed as g, watch as F, openBlock as M, createElementBlock as R, normalizeClass as pe, createElementVNode as D, renderSlot as L, Fragment as W, renderList as ye, toDisplayString as te, createTextVNode as Te, createCommentVNode as re, createBlock as xe, createSlots as ne, withCtx as P, mergeProps as ae, useSlots as Ae, normalizeStyle as be, onBeforeUnmount as oe, nextTick as ke, useAttrs as Ce, toRefs as Me, unref as E, createVNode as se, normalizeProps as ue, guardReactiveProps as de } from "vue";
2
- import { h as Ee, i as _e, g as V, j as he } from "../index4.js";
3
- import { _ as Y } from "../_plugin-vue_export-helper.js";
1
+ import { defineComponent as G, ref as _, computed as g, watch as F, openBlock as M, createElementBlock as R, normalizeClass as pe, createElementVNode as D, renderSlot as L, Fragment as W, renderList as ye, toDisplayString as te, createTextVNode as Te, createCommentVNode as re, createBlock as xe, createSlots as ne, withCtx as P, mergeProps as ae, useSlots as Ae, normalizeStyle as ke, onBeforeUnmount as oe, nextTick as be, useAttrs as Ce, toRefs as Me, unref as E, createVNode as se, normalizeProps as ue, guardReactiveProps as de } from "vue";
2
+ import { k as Ee, h as _e, d as V, i as he } from "../index4.js";
3
+ import { _ as j } from "../_plugin-vue_export-helper.js";
4
4
  const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"], we = { class: "tr-anchor__marker-slot" }, Re = { class: "tr-anchor__item-content" }, Le = {
5
5
  key: 0,
6
6
  class: "tr-anchor__highlight"
@@ -38,24 +38,24 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
38
38
  function y(p) {
39
39
  return !!(p && p.scrollWidth > p.clientWidth);
40
40
  }
41
- function b() {
41
+ function k() {
42
42
  var p;
43
43
  return ((p = h.value) == null ? void 0 : p.querySelector(".tr-anchor__item-label")) ?? null;
44
44
  }
45
45
  function S() {
46
- n.value = l.expanded && r.value && y(b());
46
+ n.value = l.expanded && r.value && y(k());
47
47
  }
48
48
  function I() {
49
49
  s(), n.value = !1, !(!l.expanded || !r.value) && c();
50
50
  }
51
- function k() {
51
+ function b() {
52
52
  s(), n.value = !1;
53
53
  }
54
54
  function $() {
55
55
  r.value = !0, I();
56
56
  }
57
57
  function H() {
58
- r.value = !1, k();
58
+ r.value = !1, b();
59
59
  }
60
60
  function A(p) {
61
61
  p.propertyName === "max-width" && r.value && S();
@@ -64,7 +64,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
64
64
  () => l.expanded,
65
65
  (p) => {
66
66
  if (!p) {
67
- k();
67
+ b();
68
68
  return;
69
69
  }
70
70
  r.value && I();
@@ -118,7 +118,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
118
118
  ], 40, He)
119
119
  ], 10, Oe));
120
120
  }
121
- }), Be = /* @__PURE__ */ Y($e, [["__scopeId", "data-v-f39ebac0"]]), Ne = {
121
+ }), Be = /* @__PURE__ */ j($e, [["__scopeId", "data-v-f39ebac0"]]), Ne = {
122
122
  class: "tr-anchor__list",
123
123
  role: "list"
124
124
  }, De = {
@@ -173,7 +173,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
173
173
  ]), 1032, ["entry", "active-id", "expanded", "highlighted", "placement", "tooltip-delay"]))), 128))
174
174
  ]));
175
175
  }
176
- }), Qe = /* @__PURE__ */ Y(Fe, [["__scopeId", "data-v-ff2e0912"]]), Pe = {
176
+ }), Qe = /* @__PURE__ */ j(Fe, [["__scopeId", "data-v-ff2e0912"]]), Pe = {
177
177
  key: 0,
178
178
  class: "tr-anchor__search-cap"
179
179
  }, Ue = { class: "tr-anchor__surface" }, Ke = /* @__PURE__ */ G({
@@ -203,7 +203,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
203
203
  ref_key: "hostEl",
204
204
  ref: i,
205
205
  class: pe(c.value),
206
- style: be(s.value)
206
+ style: ke(s.value)
207
207
  }, [
208
208
  D("div", {
209
209
  ref_key: "overlayEl",
@@ -227,7 +227,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
227
227
  ], 512)
228
228
  ], 6));
229
229
  }
230
- }), qe = /* @__PURE__ */ Y(Ke, [["__scopeId", "data-v-276fbba1"]]), ze = ["value", "placeholder", "aria-label"], Ve = /* @__PURE__ */ G({
230
+ }), qe = /* @__PURE__ */ j(Ke, [["__scopeId", "data-v-276fbba1"]]), ze = ["value", "placeholder", "aria-label"], Ve = /* @__PURE__ */ G({
231
231
  name: "AnchorSearch",
232
232
  __name: "AnchorSearch",
233
233
  props: {
@@ -250,7 +250,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
250
250
  }, null, 40, ze);
251
251
  };
252
252
  }
253
- }), Ge = /* @__PURE__ */ Y(Ve, [["__scopeId", "data-v-89c7e60e"]]), We = (e, a) => {
253
+ }), Ge = /* @__PURE__ */ j(Ve, [["__scopeId", "data-v-89c7e60e"]]), We = (e, a) => {
254
254
  const l = a.trim().toLowerCase(), i = (e.searchText || e.label).trim();
255
255
  if (!l)
256
256
  return [{ text: e.label, highlighted: !1 }];
@@ -261,7 +261,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
261
261
  { text: e.label.slice(r + l.length), highlighted: !1 }
262
262
  ].filter((n) => n.text.length > 0) : i.toLowerCase().includes(l) ? [{ text: e.label, highlighted: !1 }] : !1;
263
263
  };
264
- function je(e) {
264
+ function Ye(e) {
265
265
  var c, s;
266
266
  const { viewport: a, anchors: l } = e;
267
267
  if (!l.length)
@@ -278,7 +278,7 @@ function je(e) {
278
278
  break;
279
279
  return n;
280
280
  }
281
- function Ye(e, a) {
281
+ function je(e, a) {
282
282
  return !a || a.length === 0 ? [{ text: e.label, highlighted: !1 }] : a;
283
283
  }
284
284
  function Ze(e) {
@@ -299,7 +299,7 @@ function Ze(e) {
299
299
  const v = d.value(u, t), T = Array.isArray(v) && v.length > 0;
300
300
  return t && !T ? null : {
301
301
  item: u,
302
- segments: Ye(u, v)
302
+ segments: je(u, v)
303
303
  };
304
304
  }).filter((u) => u !== null);
305
305
  }), y = g(
@@ -307,16 +307,16 @@ function Ze(e) {
307
307
  var t;
308
308
  return (t = f.value.find((u) => u.item.id === e.activeId.value)) == null ? void 0 : t.item.id;
309
309
  }
310
- ), b = g(() => {
310
+ ), k = g(() => {
311
311
  var t;
312
312
  return h.value && i.value && f.value.some((u) => u.item.id === i.value) ? i.value : y.value ?? ((t = f.value[0]) == null ? void 0 : t.item.id);
313
313
  }), S = g(() => {
314
314
  if (!f.value.length)
315
315
  return 0;
316
- const t = f.value.findIndex((u) => u.item.id === b.value);
316
+ const t = f.value.findIndex((u) => u.item.id === k.value);
317
317
  return t === -1 ? 0 : t;
318
- }), I = g(() => b.value);
319
- function k() {
318
+ }), I = g(() => k.value);
319
+ function b() {
320
320
  h.value = !1, i.value = void 0;
321
321
  }
322
322
  function $(t) {
@@ -330,7 +330,7 @@ function Ze(e) {
330
330
  function A(t) {
331
331
  var v;
332
332
  if (!f.value.length) {
333
- k();
333
+ b();
334
334
  return;
335
335
  }
336
336
  const u = Math.max(0, Math.min(t, f.value.length - 1));
@@ -347,20 +347,20 @@ function Ze(e) {
347
347
  f,
348
348
  (t) => {
349
349
  if (!t.length) {
350
- k();
350
+ b();
351
351
  return;
352
352
  }
353
353
  if (y.value) {
354
- k();
354
+ b();
355
355
  return;
356
356
  }
357
- h.value && i.value && t.some((u) => u.item.id === i.value) || k();
357
+ h.value && i.value && t.some((u) => u.item.id === i.value) || b();
358
358
  },
359
359
  { immediate: !0, flush: "sync" }
360
360
  ), F(
361
361
  () => e.activeId.value,
362
362
  (t) => {
363
- t && k();
363
+ t && b();
364
364
  },
365
365
  { immediate: !0, flush: "sync" }
366
366
  ), {
@@ -433,7 +433,7 @@ function Xe(e) {
433
433
  function y() {
434
434
  d(), f();
435
435
  }
436
- function b(o) {
436
+ function k(o) {
437
437
  return o instanceof HTMLElement ? o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement || o.isContentEditable : !1;
438
438
  }
439
439
  function S(o) {
@@ -448,7 +448,7 @@ function Xe(e) {
448
448
  const t = Number.parseFloat(window.getComputedStyle(o).scrollMarginTop || "0");
449
449
  return Number.isFinite(t) ? t : 0;
450
450
  }
451
- function k() {
451
+ function b() {
452
452
  var Q, K;
453
453
  const o = le(e.container.value);
454
454
  if (!o)
@@ -476,7 +476,7 @@ function Xe(e) {
476
476
  const w = e.resolveTarget(C.id);
477
477
  return w ? [{ id: C.id, el: w }] : [];
478
478
  })
479
- ), U = je({
479
+ ), U = Ye({
480
480
  viewport: {
481
481
  top: u,
482
482
  scrollTop: t,
@@ -506,7 +506,7 @@ function Xe(e) {
506
506
  if (o.defaultPrevented || o.altKey || o.ctrlKey || o.metaKey)
507
507
  return;
508
508
  const t = (u = e.host) == null ? void 0 : u.value;
509
- t && o.target instanceof Node && t.contains(o.target) || b(o.target) || ["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "].includes(o.key) && y();
509
+ t && o.target instanceof Node && t.contains(o.target) || k(o.target) || ["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "].includes(o.key) && y();
510
510
  }
511
511
  return F(
512
512
  () => {
@@ -521,7 +521,7 @@ function Xe(e) {
521
521
  }), {
522
522
  activeId: n,
523
523
  scrollTo: $,
524
- sync: k,
524
+ sync: b,
525
525
  clearPendingScroll: d,
526
526
  releaseSelectionLock: y,
527
527
  handleUserScrollIntent: H,
@@ -555,12 +555,12 @@ function et(e) {
555
555
  a.value = 0;
556
556
  return;
557
557
  }
558
- const f = d.getBoundingClientRect(), y = s.getBoundingClientRect(), b = c.getBoundingClientRect().height || 0;
559
- if (!y.height || !b) {
558
+ const f = d.getBoundingClientRect(), y = s.getBoundingClientRect(), k = c.getBoundingClientRect().height || 0;
559
+ if (!y.height || !k) {
560
560
  a.value = 0;
561
561
  return;
562
562
  }
563
- const S = y.top - f.top, I = y.bottom - f.top, $ = S + y.height / 2 - b / 2, H = S + 24, A = Math.max(H, I - b - 24);
563
+ const S = y.top - f.top, I = y.bottom - f.top, $ = S + y.height / 2 - k / 2, H = S + 24, A = Math.max(H, I - k - 24);
564
564
  a.value = Math.max(H, Math.min($, A));
565
565
  }
566
566
  return {
@@ -584,7 +584,7 @@ function ot(e) {
584
584
  return n instanceof HTMLElement ? n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n.isContentEditable : !1;
585
585
  }
586
586
  function l() {
587
- ke(() => {
587
+ be(() => {
588
588
  var s, d;
589
589
  const n = e.highlightedId.value, c = (s = e.overlay.value) == null ? void 0 : s.navEl;
590
590
  !n || !c || (d = rt(c, n)) == null || d.focus();
@@ -660,7 +660,7 @@ function ct(e) {
660
660
  clear: n
661
661
  };
662
662
  }
663
- const j = /* @__PURE__ */ G({
663
+ const Y = /* @__PURE__ */ G({
664
664
  name: "TrAnchor",
665
665
  inheritAttrs: !1,
666
666
  __name: "index",
@@ -689,16 +689,16 @@ const j = /* @__PURE__ */ G({
689
689
  expanded: d,
690
690
  items: f,
691
691
  placement: y,
692
- searchOptions: b,
692
+ searchOptions: k,
693
693
  searchQuery: S,
694
694
  scrollContainer: I,
695
- targetFeedbackClass: k,
695
+ targetFeedbackClass: b,
696
696
  targetFeedbackDuration: $,
697
697
  tooltipDelay: H
698
698
  } = Me(l), A = _(null), p = g(() => {
699
699
  var m;
700
700
  return ((m = A.value) == null ? void 0 : m.hostEl) ?? null;
701
- }), o = g(() => b.value), t = g(() => o.value ?? {});
701
+ }), o = g(() => k.value), t = g(() => o.value ?? {});
702
702
  function u(m) {
703
703
  const O = I.value;
704
704
  return O ? ge(O, m) ?? null : ge(document, m) ?? null;
@@ -717,7 +717,7 @@ const j = /* @__PURE__ */ G({
717
717
  expanded: d,
718
718
  expandTrigger: s,
719
719
  searchQuery: S,
720
- searchOptions: b,
720
+ searchOptions: k,
721
721
  onUpdateExpanded: (m) => i("update:expanded", m),
722
722
  onUpdateSearchQuery: (m) => i("update:searchQuery", m)
723
723
  }), U = g(() => v.value.length > 0), Q = g(() => !!o.value && x.expanded.value), K = g(() => s.value === "hover"), C = g(() => le(I.value)), w = et({
@@ -725,7 +725,7 @@ const j = /* @__PURE__ */ G({
725
725
  host: p
726
726
  }), J = ct({
727
727
  resolveTarget: u,
728
- feedbackClass: k,
728
+ feedbackClass: b,
729
729
  feedbackDuration: $
730
730
  });
731
731
  function z(m) {
@@ -846,11 +846,11 @@ const j = /* @__PURE__ */ G({
846
846
  ]), 1040, ["expanded", "placement", "floating-offset", "onMouseleave", "onFocusout", "onKeydown"])) : re("", !0);
847
847
  }
848
848
  });
849
- j.name = "TrAnchor";
849
+ Y.name = "TrAnchor";
850
850
  const st = function(e) {
851
- e.component(j.name, j);
851
+ e.component(Y.name, Y);
852
852
  };
853
- j.install = st;
853
+ Y.install = st;
854
854
  export {
855
- j as default
855
+ Y as default
856
856
  };