@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.
- package/dist/clean-ui.css +1 -1
- package/dist/components/CuiColorPicker.vue.d.ts.map +1 -1
- package/dist/components/CuiColorPicker.vue.js +187 -194
- package/dist/components/CuiDataGrid.vue.js +1 -1
- package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
- package/dist/components/CuiTooltip.vue.js +2 -2
- package/dist/components/CuiTooltip.vue2.js +78 -65
- package/dist/composables/useDataGrid.d.ts +3 -2
- package/dist/composables/useDataGrid.d.ts.map +1 -1
- package/dist/composables/useDataGrid.js +222 -190
- package/dist/composables/useFieldDescribedBy.d.ts +1 -2
- package/dist/composables/useFieldDescribedBy.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -26
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { usePopover as
|
|
3
|
-
const
|
|
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:
|
|
19
|
-
const e = n,
|
|
20
|
-
let
|
|
21
|
-
|
|
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:
|
|
29
|
-
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
|
|
34
|
-
e.disabled || (t && (clearTimeout(t), t = null),
|
|
35
|
-
i.value = !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
|
|
39
|
-
|
|
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
|
|
44
|
-
i.value
|
|
41
|
+
function g() {
|
|
42
|
+
a(), i.value = !1, p("update:visible", !1);
|
|
45
43
|
}
|
|
46
|
-
function
|
|
47
|
-
(
|
|
44
|
+
function u() {
|
|
45
|
+
a(), t = setTimeout(g, e.hideDelay);
|
|
48
46
|
}
|
|
49
|
-
function
|
|
50
|
-
|
|
47
|
+
function C() {
|
|
48
|
+
i.value ? u() : s();
|
|
51
49
|
}
|
|
52
|
-
function
|
|
53
|
-
(e.trigger === "
|
|
50
|
+
function $() {
|
|
51
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && s();
|
|
54
52
|
}
|
|
55
|
-
function
|
|
56
|
-
(e.trigger === "
|
|
53
|
+
function L() {
|
|
54
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && u();
|
|
57
55
|
}
|
|
58
|
-
function
|
|
59
|
-
e.trigger === "
|
|
56
|
+
function F() {
|
|
57
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && s();
|
|
60
58
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
59
|
+
function N() {
|
|
60
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && u();
|
|
63
61
|
}
|
|
64
|
-
function
|
|
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
|
|
68
|
-
(e.trigger === "hover" || e.trigger === "hover-focus") &&
|
|
81
|
+
function A() {
|
|
82
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && u();
|
|
69
83
|
}
|
|
70
|
-
|
|
71
|
-
|
|
84
|
+
j(() => {
|
|
85
|
+
a(), document.removeEventListener("keydown", f, !0);
|
|
72
86
|
});
|
|
73
|
-
const
|
|
87
|
+
const z = d(() => {
|
|
74
88
|
const o = {};
|
|
75
|
-
return
|
|
76
|
-
}),
|
|
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
|
|
95
|
+
return d(() => e.text || !0), (o, r) => q((c(), v("div", {
|
|
82
96
|
class: "cui-tooltip-wrapper",
|
|
83
|
-
onMouseenter:
|
|
84
|
-
onMouseleave:
|
|
85
|
-
onFocusin:
|
|
86
|
-
onFocusout:
|
|
87
|
-
onClick:
|
|
88
|
-
onKeydown: x
|
|
97
|
+
onMouseenter: $,
|
|
98
|
+
onMouseleave: L,
|
|
99
|
+
onFocusin: F,
|
|
100
|
+
onFocusout: N,
|
|
101
|
+
onClick: P
|
|
89
102
|
}, [
|
|
90
|
-
|
|
103
|
+
w("div", {
|
|
91
104
|
ref_key: "referenceRef",
|
|
92
|
-
ref:
|
|
105
|
+
ref: E,
|
|
93
106
|
class: "cui-tooltip__trigger"
|
|
94
107
|
}, [
|
|
95
|
-
|
|
108
|
+
k(o.$slots, "default", {}, void 0, !0)
|
|
96
109
|
], 512),
|
|
97
|
-
(
|
|
98
|
-
i.value ? (
|
|
110
|
+
(c(), G(H, { to: "body" }, [
|
|
111
|
+
i.value ? (c(), v("div", {
|
|
99
112
|
key: 0,
|
|
100
113
|
ref_key: "floatingRef",
|
|
101
|
-
ref:
|
|
102
|
-
class:
|
|
114
|
+
ref: D,
|
|
115
|
+
class: J(["cui-tooltip", [
|
|
103
116
|
e.color ? "cui-tooltip--colored" : "cui-tooltip--default",
|
|
104
|
-
`cui-tooltip--${
|
|
117
|
+
`cui-tooltip--${m(R)}`
|
|
105
118
|
]]),
|
|
106
|
-
style:
|
|
119
|
+
style: T({ ...m(S), ...U.value, ...z.value }),
|
|
107
120
|
role: "tooltip",
|
|
108
|
-
onMouseenter:
|
|
109
|
-
onMouseleave:
|
|
121
|
+
onMouseenter: V,
|
|
122
|
+
onMouseleave: A
|
|
110
123
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
w("div", Z, [
|
|
125
|
+
k(o.$slots, "content", {}, () => [
|
|
126
|
+
Q(W(n.text), 1)
|
|
114
127
|
], !0)
|
|
115
128
|
]),
|
|
116
|
-
n.noArrow ?
|
|
129
|
+
n.noArrow ? b("", !0) : (c(), v("div", {
|
|
117
130
|
key: 0,
|
|
118
131
|
ref_key: "arrowRef",
|
|
119
|
-
ref:
|
|
132
|
+
ref: M,
|
|
120
133
|
class: "cui-tooltip__arrow",
|
|
121
|
-
style:
|
|
134
|
+
style: T(m(B))
|
|
122
135
|
}, null, 4))
|
|
123
|
-
], 38)) :
|
|
136
|
+
], 38)) : b("", !0)
|
|
124
137
|
]))
|
|
125
138
|
], 544)), [
|
|
126
|
-
[
|
|
139
|
+
[X, !n.hidden]
|
|
127
140
|
]);
|
|
128
141
|
}
|
|
129
142
|
});
|
|
130
143
|
export {
|
|
131
|
-
|
|
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
|
-
|
|
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,
|
|
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"}
|