@itguy614/clean-ui 1.3.1 → 1.3.2

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,6 +1,6 @@
1
- import { defineComponent as N, ref as P, watch as z, toRef as L, onUnmounted as U, computed as a, withDirectives as I, openBlock as u, createElementBlock as s, createElementVNode as v, renderSlot as g, createBlock as K, Teleport as O, normalizeStyle as p, unref as f, normalizeClass as j, createTextVNode as q, toDisplayString as G, createCommentVNode as m, vShow as H } from "vue";
2
- import { usePopover as J } from "../composables/usePopover.js";
3
- const Q = { class: "cui-tooltip__content" }, Z = /* @__PURE__ */ N({
1
+ import { defineComponent as I, ref as K, watch as h, toRef as O, onUnmounted as j, computed as d, withDirectives as q, openBlock as c, createElementBlock as v, createElementVNode as w, renderSlot as k, createBlock as G, Teleport as H, normalizeStyle as T, unref as m, normalizeClass as J, createTextVNode as Q, toDisplayString as W, createCommentVNode as b, vShow as X } from "vue";
2
+ import { usePopover as Y } from "../composables/usePopover.js";
3
+ const Z = { class: "cui-tooltip__content" }, te = /* @__PURE__ */ I({
4
4
  __name: "CuiTooltip",
5
5
  props: {
6
6
  text: {},
@@ -15,118 +15,131 @@ const Q = { class: "cui-tooltip__content" }, Z = /* @__PURE__ */ N({
15
15
  disabled: { type: Boolean, default: !1 }
16
16
  },
17
17
  emits: ["update:visible"],
18
- setup(n, { emit: h }) {
19
- const e = n, d = h, i = P(!1);
20
- let r = null, t = null;
21
- z(
18
+ setup(n, { emit: _ }) {
19
+ const e = n, p = _, i = K(!1);
20
+ let l = null, t = null;
21
+ h(
22
22
  () => e.visible,
23
23
  (o) => {
24
24
  o !== void 0 && (i.value = o);
25
25
  },
26
26
  { immediate: !0 }
27
27
  );
28
- const { referenceRef: y, floatingRef: w, arrowRef: T, floatingStyles: k, arrowStyle: b, currentSide: _, isPositioned: M } = J({
29
- placement: L(e, "placement"),
28
+ const { referenceRef: E, floatingRef: D, arrowRef: M, floatingStyles: S, arrowStyle: B, currentSide: R, isPositioned: x } = Y({
29
+ placement: O(e, "placement"),
30
30
  offsetDistance: 8,
31
31
  arrow: !e.noArrow
32
32
  });
33
- function c() {
34
- e.disabled || (t && (clearTimeout(t), t = null), r = setTimeout(() => {
35
- i.value = !0, d("update:visible", !0);
33
+ function s() {
34
+ e.disabled || (t && (clearTimeout(t), t = null), l = setTimeout(() => {
35
+ i.value = !0, p("update:visible", !0);
36
36
  }, e.showDelay));
37
37
  }
38
- function l() {
39
- r && (clearTimeout(r), r = null), t = setTimeout(() => {
40
- i.value = !1, d("update:visible", !1);
41
- }, e.hideDelay);
38
+ function a() {
39
+ l && clearTimeout(l), t && clearTimeout(t), l = t = null;
42
40
  }
43
- function S() {
44
- i.value ? l() : c();
41
+ function g() {
42
+ a(), i.value = !1, p("update:visible", !1);
45
43
  }
46
- function B() {
47
- (e.trigger === "hover" || e.trigger === "hover-focus") && c();
44
+ function u() {
45
+ a(), t = setTimeout(g, e.hideDelay);
48
46
  }
49
- function D() {
50
- (e.trigger === "hover" || e.trigger === "hover-focus") && l();
47
+ function C() {
48
+ i.value ? u() : s();
51
49
  }
52
- function R() {
53
- (e.trigger === "focus" || e.trigger === "hover-focus") && c();
50
+ function $() {
51
+ (e.trigger === "hover" || e.trigger === "hover-focus") && s();
54
52
  }
55
- function E() {
56
- (e.trigger === "focus" || e.trigger === "hover-focus") && l();
53
+ function L() {
54
+ (e.trigger === "hover" || e.trigger === "hover-focus") && u();
57
55
  }
58
- function $() {
59
- e.trigger === "click" && S();
56
+ function F() {
57
+ (e.trigger === "focus" || e.trigger === "hover-focus") && s();
60
58
  }
61
- function x(o) {
62
- o.key === "Escape" && i.value && l();
59
+ function N() {
60
+ (e.trigger === "focus" || e.trigger === "hover-focus") && u();
63
61
  }
64
- function C() {
62
+ function P() {
63
+ e.trigger === "click" && C();
64
+ }
65
+ function f(o) {
66
+ var y;
67
+ if (o.key !== "Escape" || o.isComposing) return;
68
+ const r = o.target;
69
+ (y = r == null ? void 0 : r.closest) != null && y.call(r, '[aria-expanded="true"]') || o.stopPropagation(), g();
70
+ }
71
+ h(
72
+ i,
73
+ (o) => {
74
+ typeof document > "u" || (o ? document.addEventListener("keydown", f, !0) : document.removeEventListener("keydown", f, !0));
75
+ },
76
+ { immediate: !0 }
77
+ );
78
+ function V() {
65
79
  (e.trigger === "hover" || e.trigger === "hover-focus") && t && (clearTimeout(t), t = null);
66
80
  }
67
- function F() {
68
- (e.trigger === "hover" || e.trigger === "hover-focus") && l();
81
+ function A() {
82
+ (e.trigger === "hover" || e.trigger === "hover-focus") && u();
69
83
  }
70
- U(() => {
71
- r && clearTimeout(r), t && clearTimeout(t);
84
+ j(() => {
85
+ a(), document.removeEventListener("keydown", f, !0);
72
86
  });
73
- const V = a(() => {
87
+ const z = d(() => {
74
88
  const o = {};
75
- return M.value || (o.opacity = "0", o.pointerEvents = "none", o.animation = "none"), o;
76
- }), A = a(() => e.color ? {
89
+ return x.value || (o.opacity = "0", o.pointerEvents = "none", o.animation = "none"), o;
90
+ }), U = d(() => e.color ? {
77
91
  background: `var(--cui-${e.color})`,
78
92
  color: `var(--cui-${e.color}-text)`,
79
93
  "--_arrow-bg": `var(--cui-${e.color})`
80
94
  } : {});
81
- return a(() => e.text || !0), (o, W) => I((u(), s("div", {
95
+ return d(() => e.text || !0), (o, r) => q((c(), v("div", {
82
96
  class: "cui-tooltip-wrapper",
83
- onMouseenter: B,
84
- onMouseleave: D,
85
- onFocusin: R,
86
- onFocusout: E,
87
- onClick: $,
88
- onKeydown: x
97
+ onMouseenter: $,
98
+ onMouseleave: L,
99
+ onFocusin: F,
100
+ onFocusout: N,
101
+ onClick: P
89
102
  }, [
90
- v("div", {
103
+ w("div", {
91
104
  ref_key: "referenceRef",
92
- ref: y,
105
+ ref: E,
93
106
  class: "cui-tooltip__trigger"
94
107
  }, [
95
- g(o.$slots, "default", {}, void 0, !0)
108
+ k(o.$slots, "default", {}, void 0, !0)
96
109
  ], 512),
97
- (u(), K(O, { to: "body" }, [
98
- i.value ? (u(), s("div", {
110
+ (c(), G(H, { to: "body" }, [
111
+ i.value ? (c(), v("div", {
99
112
  key: 0,
100
113
  ref_key: "floatingRef",
101
- ref: w,
102
- class: j(["cui-tooltip", [
114
+ ref: D,
115
+ class: J(["cui-tooltip", [
103
116
  e.color ? "cui-tooltip--colored" : "cui-tooltip--default",
104
- `cui-tooltip--${f(_)}`
117
+ `cui-tooltip--${m(R)}`
105
118
  ]]),
106
- style: p({ ...f(k), ...A.value, ...V.value }),
119
+ style: T({ ...m(S), ...U.value, ...z.value }),
107
120
  role: "tooltip",
108
- onMouseenter: C,
109
- onMouseleave: F
121
+ onMouseenter: V,
122
+ onMouseleave: A
110
123
  }, [
111
- v("div", Q, [
112
- g(o.$slots, "content", {}, () => [
113
- q(G(n.text), 1)
124
+ w("div", Z, [
125
+ k(o.$slots, "content", {}, () => [
126
+ Q(W(n.text), 1)
114
127
  ], !0)
115
128
  ]),
116
- n.noArrow ? m("", !0) : (u(), s("div", {
129
+ n.noArrow ? b("", !0) : (c(), v("div", {
117
130
  key: 0,
118
131
  ref_key: "arrowRef",
119
- ref: T,
132
+ ref: M,
120
133
  class: "cui-tooltip__arrow",
121
- style: p(f(b))
134
+ style: T(m(B))
122
135
  }, null, 4))
123
- ], 38)) : m("", !0)
136
+ ], 38)) : b("", !0)
124
137
  ]))
125
138
  ], 544)), [
126
- [H, !n.hidden]
139
+ [X, !n.hidden]
127
140
  ]);
128
141
  }
129
142
  });
130
143
  export {
131
- Z as default
144
+ te as default
132
145
  };
@@ -1,8 +1,9 @@
1
- import { type Ref } from "vue";
1
+ import { type MaybeRefOrGetter, type Ref } from "vue";
2
2
  import type { DataGridColumn, DataGridRow, DataGridViewConfig, PaginatedData } from "../types/data-grid";
3
3
  import { type DataGridContext } from "../components/data-grid-context";
4
4
  export interface UseDataGridOptions {
5
- columns: DataGridColumn[];
5
+ /** A plain array is read once; pass a ref or getter to follow later changes. */
6
+ columns: MaybeRefOrGetter<DataGridColumn[]>;
6
7
  data: Ref<DataGridRow[] | PaginatedData>;
7
8
  serverSide?: boolean;
8
9
  rowKey?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useDataGrid.d.ts","sourceRoot":"","sources":["../../src/composables/useDataGrid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/D,OAAO,KAAK,EACV,cAAc,EAKd,WAAW,EACX,kBAAkB,EAElB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE3F,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,aAAa,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,mBAibtD;AAED,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,QAEvD;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI,eAAe,CAIlD"}
1
+ {"version":3,"file":"useDataGrid.d.ts","sourceRoot":"","sources":["../../src/composables/useDataGrid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmE,KAAK,gBAAgB,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AACvH,OAAO,KAAK,EACV,cAAc,EAKd,WAAW,EACX,kBAAkB,EAElB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAE3F,MAAM,WAAW,kBAAkB;IACjC,gFAAgF;IAChF,OAAO,EAAE,gBAAgB,CAAC,cAAc,EAAE,CAAC,CAAC;IAC5C,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,aAAa,CAAC,CAAC;IACzC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,mBA8ftD;AAED,sDAAsD;AACtD,wBAAgB,eAAe,CAAC,OAAO,EAAE,eAAe,QAEvD;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI,eAAe,CAIlD"}