@caipira/tamandua 0.0.99 → 0.0.100

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.
@@ -0,0 +1,98 @@
1
+ import './Popover.css';
2
+ import { defineComponent as x, mergeModels as B, useModel as E, ref as c, computed as u, onBeforeMount as S, onBeforeUnmount as b, openBlock as p, createElementBlock as g, renderSlot as T, normalizeProps as I, guardReactiveProps as O, createBlock as k, Teleport as A, normalizeStyle as N, unref as w, normalizeClass as M, createCommentVNode as R } from "vue";
3
+ import { d as z, a } from "./ui-5PiaVzMN.js";
4
+ import { o as L, s as V, a as $, u as W, b as U } from "./floating-ui.vue-B5QcGNjh.js";
5
+ import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
+ let F = 0;
7
+ const G = /* @__PURE__ */ x({
8
+ name: "TPopover",
9
+ __name: "Popover",
10
+ props: /* @__PURE__ */ B({
11
+ trigger: { default: z.CLICK },
12
+ disabled: { type: Boolean, default: !1 },
13
+ placement: { default: a.BOTTOM },
14
+ width: { default: "auto" },
15
+ slotWrapperClass: { default: "input-roundness" }
16
+ }, {
17
+ open: { type: Boolean, default: !1 },
18
+ openModifiers: {}
19
+ }),
20
+ emits: ["update:open"],
21
+ setup(d, { expose: C }) {
22
+ const o = E(d, "open"), n = d, f = `popover_${++F}`, i = c(), m = u(() => n.placement), r = c(), l = c(), y = u(() => {
23
+ if (n.placement === a.ACTIVATION_POSITION && l.value) {
24
+ const { x: t, y: e } = l.value;
25
+ return {
26
+ getBoundingClientRect: () => ({
27
+ x: t,
28
+ y: e,
29
+ left: t,
30
+ top: e,
31
+ right: t + 1,
32
+ bottom: e + 1,
33
+ width: 1,
34
+ height: 1,
35
+ toJSON: () => {
36
+ }
37
+ }),
38
+ contextElement: r.value?.firstChild?.nextElementSibling
39
+ };
40
+ }
41
+ return r.value?.firstChild?.nextElementSibling;
42
+ }), _ = u(() => {
43
+ const t = n.placement === a.ACTIVATION_POSITION && l.value;
44
+ return [
45
+ L(t ? 0 : 5),
46
+ V({
47
+ apply({ elements: e }) {
48
+ if (n.width === "static")
49
+ return;
50
+ const P = e.reference.getBoundingClientRect();
51
+ Object.assign(e.floating.style, {
52
+ minWidth: `${P.width}px`
53
+ });
54
+ }
55
+ }),
56
+ $({ crossAxis: !0 })
57
+ ];
58
+ }), { floatingStyles: h } = W(y, i, {
59
+ open: o,
60
+ placement: m.value === a.ACTIVATION_POSITION ? a.BOTTOM_START : m.value,
61
+ middleware: _,
62
+ whileElementsMounted: U
63
+ }), v = (t, e) => {
64
+ o.value = typeof t == "boolean" ? t : !o.value, o.value ? e && n.placement === a.ACTIVATION_POSITION && (l.value = { x: e.clientX, y: e.clientY }) : l.value = void 0;
65
+ }, s = (t) => {
66
+ const e = t.target;
67
+ return o.value && !r.value?.contains(e) && !i.value?.contains(e) ? (o.value = !1, !1) : !0;
68
+ };
69
+ return S(() => {
70
+ document.addEventListener("click", s), document.addEventListener("contextmenu", s);
71
+ }), b(() => {
72
+ document.removeEventListener("click", s), document.removeEventListener("contextmenu", s);
73
+ }), C({ name: f }), (t, e) => (p(), g("div", {
74
+ ref_key: "wrapperRef",
75
+ ref: r
76
+ }, [
77
+ T(t.$slots, "default", I(O({ onTogglePopover: v })), void 0, !0),
78
+ (p(), k(A, { to: "body" }, [
79
+ o.value ? (p(), g("div", {
80
+ key: 0,
81
+ ref_key: "floating",
82
+ ref: i,
83
+ role: "tooltip",
84
+ id: f,
85
+ style: N(w(h)),
86
+ class: M(["popover-floatable bg-caipira-primary z-10", {
87
+ [n.slotWrapperClass]: !0
88
+ }])
89
+ }, [
90
+ T(t.$slots, "content", I(O({ onTogglePopover: v })), void 0, !0)
91
+ ], 6)) : R("", !0)
92
+ ]))
93
+ ], 512));
94
+ }
95
+ }), q = /* @__PURE__ */ j(G, [["__scopeId", "data-v-6af31a87"]]);
96
+ export {
97
+ q as P
98
+ };
package/dist/Popover.css CHANGED
@@ -1 +1 @@
1
- .popover-floatable[data-v-936d97f9]{scrollbar-gutter:stable}
1
+ .popover-floatable[data-v-6af31a87]{scrollbar-gutter:stable}
package/dist/Popover.js CHANGED
@@ -1,5 +1,5 @@
1
- import { P as p } from "./Popover-P-D1olPy.js";
2
- import { p as P } from "./plugin-C3ZZPmkg.js";
1
+ import { P as p } from "./Popover-Bhp8FUMn.js";
2
+ import { p as P } from "./plugin-D9O3FCPm.js";
3
3
  export {
4
4
  p as Popover,
5
5
  P as PopoverPlugin
@@ -34,7 +34,7 @@ import { _ as nr } from "./Modal.vue_vue_type_script_setup_true_lang-60BGY-iH.js
34
34
  import { _ as ur } from "./ModalForm.vue_vue_type_script_setup_true_lang-C1Xl4TmQ.js";
35
35
  import { _ as lr } from "./Pagination.vue_vue_type_script_setup_true_lang-BCQUrEVO.js";
36
36
  import { _ as cr } from "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
37
- import { P as Tr } from "./Popover-P-D1olPy.js";
37
+ import { P as Tr } from "./Popover-Bhp8FUMn.js";
38
38
  import { P as Cr } from "./ProgressCircle-C5CnEEoe.js";
39
39
  import { P as br } from "./ProgressLine-WECUkWks.js";
40
40
  import { _ as Gr } from "./SensitiveInfo.vue_vue_type_script_setup_true_lang-D288W5VF.js";
@@ -1,32 +1,47 @@
1
- import { ref as r, getCurrentInstance as a } from "vue";
2
- import { u as h } from "./useClipboard-BHFD0Jvv.js";
3
- import { u as R } from "./useDomHelpers-CGVrQd35.js";
4
- const d = 640, c = 768, l = 1024, n = r(window.innerWidth), s = r(!1), o = r(!1), i = r(!1), u = (e) => {
5
- n.value = e ? e.target.innerWidth : window.innerWidth, s.value = n.value >= d, o.value = n.value >= c, i.value = n.value >= l;
1
+ import { ref as s, getCurrentInstance as l } from "vue";
2
+ import { u as O } from "./useClipboard-BHFD0Jvv.js";
3
+ const d = 640, f = 768, c = 1024, r = s(window.innerWidth), o = s(!1), i = s(!1), a = s(!1), u = (e) => {
4
+ r.value = e ? e.target.innerWidth : window.innerWidth, o.value = r.value >= d, i.value = r.value >= f, a.value = r.value >= c;
6
5
  };
7
6
  window.addEventListener("resize", u);
8
- function m() {
7
+ function w() {
9
8
  return u(), {
10
- sm: s,
11
- md: o,
12
- lg: i
9
+ sm: o,
10
+ md: i,
11
+ lg: a
13
12
  };
14
13
  }
15
- function p(e) {
16
- const t = a();
14
+ const p = (e, n) => {
15
+ let t = e.target;
17
16
  if (!t)
17
+ return !1;
18
+ do {
19
+ if (t === n)
20
+ return e.stopPropagation(), !1;
21
+ t = t?.parentNode;
22
+ } while (t);
23
+ return !0;
24
+ };
25
+ function g() {
26
+ return {
27
+ wasClickOutsideOfContainer: p
28
+ };
29
+ }
30
+ function v(e) {
31
+ const n = l();
32
+ if (!n)
18
33
  throw new Error(
19
34
  "[useRender] must be called from inside a setup function"
20
35
  );
21
- Object.defineProperty(t, "render", {
36
+ Object.defineProperty(n, "render", {
22
37
  get: () => e,
23
38
  set: () => {
24
39
  }
25
40
  });
26
41
  }
27
42
  export {
28
- m as useBreakpoints,
29
- h as useClipboard,
30
- R as useDomHelpers,
31
- p as useRender
43
+ w as useBreakpoints,
44
+ O as useClipboard,
45
+ g as useDomHelpers,
46
+ v as useRender
32
47
  };
@@ -1,5 +1,5 @@
1
1
  import { r } from "./register-component-B-fdqewb.js";
2
- import { P as p } from "./Popover-P-D1olPy.js";
2
+ import { P as p } from "./Popover-Bhp8FUMn.js";
3
3
  const e = {
4
4
  install(o) {
5
5
  r(o, p);
@@ -50,8 +50,8 @@ import { p as L } from "./plugin-uxc8N8iO.js";
50
50
  import { p as M } from "./plugin-jyvJNavM.js";
51
51
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
52
52
  import { p as _ } from "./plugin-Bhokj2iJ.js";
53
- import "./Popover-P-D1olPy.js";
54
- import { p as j } from "./plugin-C3ZZPmkg.js";
53
+ import "./Popover-Bhp8FUMn.js";
54
+ import { p as j } from "./plugin-D9O3FCPm.js";
55
55
  import "./ProgressCircle-C5CnEEoe.js";
56
56
  import { p as A } from "./plugin-CV6IjnsL.js";
57
57
  import "./ProgressLine-WECUkWks.js";
package/dist/plugins.js CHANGED
@@ -50,8 +50,8 @@ import { p as Br } from "./plugin-uxc8N8iO.js";
50
50
  import { p as Rr } from "./plugin-jyvJNavM.js";
51
51
  import "./Popconfirm.vue_vue_type_script_setup_true_lang-CR0OJ8Ao.js";
52
52
  import { p as qr } from "./plugin-Bhokj2iJ.js";
53
- import "./Popover-P-D1olPy.js";
54
- import { p as Hr } from "./plugin-C3ZZPmkg.js";
53
+ import "./Popover-Bhp8FUMn.js";
54
+ import { p as Hr } from "./plugin-D9O3FCPm.js";
55
55
  import "./ProgressCircle-C5CnEEoe.js";
56
56
  import { p as Kr } from "./plugin-CV6IjnsL.js";
57
57
  import "./ProgressLine-WECUkWks.js";
package/dist/tamandua.js CHANGED
@@ -1,4 +1,4 @@
1
- import { p as n } from "./plugins-D57bfrRk.js";
1
+ import { p as n } from "./plugins-CyxTeM7y.js";
2
2
  const o = {
3
3
  install(s) {
4
4
  for (const i in n)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caipira/tamandua",
3
- "version": "0.0.99",
3
+ "version": "0.0.100",
4
4
  "private": false,
5
5
  "description": "UI library for the Caipira ecosystem",
6
6
  "license": "GPL-3.0-only",
@@ -1,96 +0,0 @@
1
- import './Popover.css';
2
- import { defineComponent as x, mergeModels as B, useModel as E, ref as i, computed as c, onBeforeMount as S, onBeforeUnmount as b, openBlock as u, createElementBlock as g, renderSlot as T, normalizeProps as O, guardReactiveProps as C, createBlock as A, Teleport as N, normalizeStyle as w, unref as M, normalizeClass as R, createCommentVNode as z } from "vue";
3
- import { u as L } from "./useDomHelpers-CGVrQd35.js";
4
- import { d as V, a as l } from "./ui-5PiaVzMN.js";
5
- import { o as $, s as W, a as U, u as j, b as D } from "./floating-ui.vue-B5QcGNjh.js";
6
- import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- let G = 0;
8
- const H = /* @__PURE__ */ x({
9
- name: "TPopover",
10
- __name: "Popover",
11
- props: /* @__PURE__ */ B({
12
- trigger: { default: V.CLICK },
13
- disabled: { type: Boolean, default: !1 },
14
- placement: { default: l.BOTTOM },
15
- width: { default: "auto" },
16
- slotWrapperClass: { default: "input-roundness" }
17
- }, {
18
- open: { type: Boolean, default: !1 },
19
- openModifiers: {}
20
- }),
21
- emits: ["update:open"],
22
- setup(p, { expose: I }) {
23
- const o = E(p, "open"), n = p, d = `popover_${++G}`, f = i(), m = c(() => n.placement), r = i(), a = i(), { wasClickOutsideOfContainer: y } = L(), _ = c(() => {
24
- if (n.placement === l.ACTIVATION_POSITION && a.value) {
25
- const { x: e, y: t } = a.value;
26
- return {
27
- getBoundingClientRect: () => ({
28
- x: e,
29
- y: t,
30
- left: e,
31
- top: t,
32
- right: e + 1,
33
- bottom: t + 1,
34
- width: 1,
35
- height: 1,
36
- toJSON: () => {
37
- }
38
- }),
39
- contextElement: r.value?.firstChild?.nextElementSibling
40
- };
41
- }
42
- return r.value?.firstChild?.nextElementSibling;
43
- }), h = c(() => {
44
- const e = n.placement === l.ACTIVATION_POSITION && a.value;
45
- return [
46
- $(e ? 0 : 5),
47
- W({
48
- apply({ elements: t }) {
49
- if (n.width === "static")
50
- return;
51
- const k = t.reference.getBoundingClientRect();
52
- Object.assign(t.floating.style, {
53
- minWidth: `${k.width}px`
54
- });
55
- }
56
- }),
57
- U({ crossAxis: !0 })
58
- ];
59
- }), { floatingStyles: P } = j(_, f, {
60
- open: o,
61
- placement: m.value === l.ACTIVATION_POSITION ? l.BOTTOM_START : m.value,
62
- middleware: h,
63
- whileElementsMounted: D
64
- }), v = (e, t) => {
65
- o.value = typeof e == "boolean" ? e : !o.value, o.value ? t && n.placement === l.ACTIVATION_POSITION && (a.value = { x: t.clientX, y: t.clientY }) : a.value = void 0;
66
- }, s = (e) => o.value && r.value && y(e, r.value) ? (o.value = !1, !1) : !0;
67
- return S(() => {
68
- document.addEventListener("click", s), document.addEventListener("contextmenu", s);
69
- }), b(() => {
70
- document.removeEventListener("click", s), document.removeEventListener("contextmenu", s);
71
- }), I({ name: d }), (e, t) => (u(), g("div", {
72
- ref_key: "wrapperRef",
73
- ref: r
74
- }, [
75
- T(e.$slots, "default", O(C({ onTogglePopover: v })), void 0, !0),
76
- (u(), A(N, { to: "body" }, [
77
- o.value ? (u(), g("div", {
78
- key: 0,
79
- ref_key: "floating",
80
- ref: f,
81
- role: "tooltip",
82
- id: d,
83
- style: w(M(P)),
84
- class: R(["popover-floatable bg-caipira-primary z-10", {
85
- [n.slotWrapperClass]: !0
86
- }])
87
- }, [
88
- T(e.$slots, "content", O(C({ onTogglePopover: v })), void 0, !0)
89
- ], 6)) : z("", !0)
90
- ]))
91
- ], 512));
92
- }
93
- }), Q = /* @__PURE__ */ F(H, [["__scopeId", "data-v-936d97f9"]]);
94
- export {
95
- Q as P
96
- };
@@ -1,19 +0,0 @@
1
- const n = (t, r) => {
2
- let e = t.target;
3
- if (!e)
4
- return !1;
5
- do {
6
- if (e === r)
7
- return t.stopPropagation(), !1;
8
- e = e?.parentNode;
9
- } while (e);
10
- return !0;
11
- };
12
- function a() {
13
- return {
14
- wasClickOutsideOfContainer: n
15
- };
16
- }
17
- export {
18
- a as u
19
- };