@itguy614/clean-ui 1.3.0 → 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/CuiCombobox.vue.d.ts.map +1 -1
- package/dist/components/CuiCombobox.vue.js +2 -2
- package/dist/components/CuiCombobox.vue2.js +96 -97
- package/dist/components/CuiDataGrid.vue.js +1 -1
- package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridTable.vue.js +212 -190
- package/dist/components/CuiDataGridViewManager.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridViewManager.vue.js +5 -4
- package/dist/components/CuiDivider.vue.d.ts +1 -3
- package/dist/components/CuiDivider.vue.d.ts.map +1 -1
- package/dist/components/CuiDivider.vue.js +44 -60
- package/dist/components/CuiPagination.vue.d.ts.map +1 -1
- package/dist/components/CuiPagination.vue.js +2 -2
- package/dist/components/CuiPagination.vue2.js +28 -25
- package/dist/components/CuiPopover.vue.d.ts.map +1 -1
- package/dist/components/CuiPopover.vue.js +77 -74
- package/dist/components/CuiSlider.vue.d.ts.map +1 -1
- package/dist/components/CuiSlider.vue.js +5 -167
- package/dist/components/CuiSlider.vue2.js +171 -2
- package/dist/components/CuiTabs.vue.d.ts.map +1 -1
- package/dist/components/CuiTabs.vue.js +2 -2
- package/dist/components/CuiTabs.vue2.js +80 -76
- package/dist/components/CuiTagInput.vue.d.ts.map +1 -1
- package/dist/components/CuiTagInput.vue.js +1 -1
- package/dist/components/CuiTagInput.vue2.js +98 -99
- package/dist/components/CuiTooltip.vue.d.ts.map +1 -1
- package/dist/components/CuiTooltip.vue.js +2 -2
- package/dist/components/CuiTooltip.vue2.js +80 -66
- 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,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { INPUT_SIZE_SCALE as
|
|
3
|
-
import { useFieldDescribedBy as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as de, ref as c, computed as p, onMounted as ce, onUnmounted as ve, watch as fe, nextTick as B, withDirectives as me, openBlock as r, createElementBlock as v, normalizeStyle as M, toDisplayString as b, createCommentVNode as h, createElementVNode as $, normalizeClass as E, Fragment as U, renderList as K, createBlock as W, withCtx as ge, createTextVNode as pe, unref as Y, Teleport as be, createVNode as Z, withModifiers as j, renderSlot as he, vShow as ye } from "vue";
|
|
2
|
+
import { INPUT_SIZE_SCALE as we, nestedSize as xe, scaleDensity as ke } from "../utils/sizing.js";
|
|
3
|
+
import { useFieldDescribedBy as Ce } from "../composables/useFieldDescribedBy.js";
|
|
4
|
+
import Se from "./CuiIcon.vue.js";
|
|
5
|
+
import Te from "./CuiBadge.vue.js";
|
|
6
|
+
import Ve from "./CuiSpinner.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
const
|
|
8
|
+
const ze = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "cui-tag-input__label"
|
|
11
|
-
},
|
|
11
|
+
}, Le = ["id", "name", "autocomplete", "aria-describedby", "aria-required", "aria-labelledby", "value", "placeholder", "disabled"], Re = ["id"], Be = {
|
|
12
12
|
key: 0,
|
|
13
13
|
style: { padding: "calc(0.75rem * var(--cui-density-scale, 1))", textAlign: "center" }
|
|
14
|
-
}, Me = ["data-index", "onClick", "onMouseenter"],
|
|
14
|
+
}, Me = ["data-index", "onClick", "onMouseenter"], Ne = /* @__PURE__ */ de({
|
|
15
15
|
__name: "CuiTagInput",
|
|
16
16
|
props: {
|
|
17
17
|
modelValue: { default: () => [] },
|
|
@@ -40,80 +40,80 @@ const Ve = {
|
|
|
40
40
|
disabled: { type: Boolean, default: !1 }
|
|
41
41
|
},
|
|
42
42
|
emits: ["update:modelValue"],
|
|
43
|
-
setup(u, { expose:
|
|
44
|
-
const l = u, { errorId:
|
|
43
|
+
setup(u, { expose: G, emit: J }) {
|
|
44
|
+
const l = u, { errorId: Q, describedBy: X } = Ce(l), ee = {
|
|
45
45
|
none: "0",
|
|
46
46
|
sm: "var(--cui-radius-sm, 0.25rem)",
|
|
47
47
|
md: "var(--cui-button-radius, var(--cui-radius-md, 0.375rem))",
|
|
48
48
|
lg: "var(--cui-radius-lg, 0.5rem)",
|
|
49
49
|
full: "9999px"
|
|
50
|
-
}, D =
|
|
51
|
-
let
|
|
52
|
-
const k =
|
|
53
|
-
function
|
|
50
|
+
}, D = J, o = c(""), s = c(!1), i = c(-1), z = c(!1), m = c([]), f = c(null), _ = c(null), y = c(null), I = c(null), q = c({});
|
|
51
|
+
let w = null;
|
|
52
|
+
const k = p(() => new Set(l.modelValue)), C = p(() => l.maxTags > 0 && l.modelValue.length >= l.maxTags);
|
|
53
|
+
function te(e) {
|
|
54
54
|
const t = [...l.suggestions, ...m.value].find((a) => a.value === e);
|
|
55
55
|
return (t == null ? void 0 : t.label) ?? e;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function ae(e) {
|
|
58
58
|
const t = [...l.suggestions, ...m.value].find((a) => a.value === e);
|
|
59
59
|
return (t == null ? void 0 : t.color) ?? l.color;
|
|
60
60
|
}
|
|
61
|
-
const d =
|
|
61
|
+
const d = p(() => {
|
|
62
62
|
const t = (l.fetchSuggestions ? m.value : l.suggestions).filter((n) => !k.value.has(n.value));
|
|
63
63
|
if (!o.value || l.fetchSuggestions) return t;
|
|
64
64
|
const a = o.value.toLowerCase();
|
|
65
65
|
return t.filter(
|
|
66
66
|
(n) => n.value.toLowerCase().includes(a) || n.label && n.label.toLowerCase().includes(a)
|
|
67
67
|
);
|
|
68
|
-
}), g =
|
|
68
|
+
}), g = p(() => {
|
|
69
69
|
if (!l.allowCreate || !o.value.trim() || C.value) return !1;
|
|
70
70
|
const e = o.value.trim().toLowerCase();
|
|
71
71
|
return k.value.has(e) || k.value.has(o.value.trim()) ? !1 : ![...l.suggestions, ...m.value].map((a) => a.value.toLowerCase()).includes(e);
|
|
72
|
-
}),
|
|
73
|
-
const e =
|
|
72
|
+
}), A = p(() => z.value), le = ke("0.25rem"), L = p(() => {
|
|
73
|
+
const e = we[l.size];
|
|
74
74
|
return {
|
|
75
|
-
tagSize:
|
|
75
|
+
tagSize: xe(l.size),
|
|
76
76
|
style: {
|
|
77
77
|
"--_tag-input-font-size": e.fontSize,
|
|
78
|
-
"--_tag-input-padding": `${
|
|
78
|
+
"--_tag-input-padding": `${le} ${e.px}`,
|
|
79
79
|
"--_tag-input-min-height": e.height
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
|
-
function
|
|
84
|
-
const e =
|
|
83
|
+
function x() {
|
|
84
|
+
const e = I.value ?? y.value;
|
|
85
85
|
if (!e) return;
|
|
86
|
-
const t = e.getBoundingClientRect(), a = window.innerHeight, n = a - t.bottom,
|
|
86
|
+
const t = e.getBoundingClientRect(), a = window.innerHeight, n = a - t.bottom, V = t.top, F = n < 200 && V > n, se = Math.max(0, Math.min(240, (F ? V : n) - 16)), R = {
|
|
87
87
|
// The panel is teleported to <body>, so it inherits nothing from the component — it
|
|
88
88
|
// has to carry the size-derived properties itself (#123).
|
|
89
|
-
...
|
|
89
|
+
...L.value.style,
|
|
90
90
|
position: "fixed",
|
|
91
91
|
zIndex: "9990",
|
|
92
92
|
left: `${t.left}px`,
|
|
93
93
|
width: `${t.width}px`,
|
|
94
|
-
maxHeight: `${
|
|
94
|
+
maxHeight: `${se}px`
|
|
95
95
|
// Only the geometry the positioner computes stays inline; the panel's paint lives in
|
|
96
96
|
// the stylesheet so it can be themed (#123).
|
|
97
97
|
};
|
|
98
|
-
F ?
|
|
98
|
+
F ? R.bottom = `${a - t.top + 4}px` : R.top = `${t.bottom + 4}px`, q.value = R;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
if (o.value = e.target.value, i.value = -1, s.value || (s.value = !0,
|
|
100
|
+
function ue(e) {
|
|
101
|
+
if (o.value = e.target.value, i.value = -1, s.value || (s.value = !0, x()), l.fetchSuggestions) {
|
|
102
102
|
if (o.value.length < l.minChars) {
|
|
103
103
|
m.value = [];
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
w && clearTimeout(w), w = setTimeout(async () => {
|
|
107
|
+
z.value = !0;
|
|
108
108
|
try {
|
|
109
109
|
m.value = await l.fetchSuggestions(o.value);
|
|
110
110
|
} finally {
|
|
111
|
-
|
|
111
|
+
z.value = !1;
|
|
112
112
|
}
|
|
113
113
|
}, l.debounce);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function N(e) {
|
|
117
117
|
if (l.disabled || C.value) return;
|
|
118
118
|
const t = e.trim();
|
|
119
119
|
!t || k.value.has(t) || (D("update:modelValue", [...l.modelValue, t]), o.value = "", i.value = -1, B(() => {
|
|
@@ -121,68 +121,67 @@ const Ve = {
|
|
|
121
121
|
return (a = f.value) == null ? void 0 : a.focus();
|
|
122
122
|
}));
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
124
|
+
function H(e) {
|
|
125
|
+
N(e.value);
|
|
126
126
|
}
|
|
127
127
|
function S() {
|
|
128
|
-
g.value &&
|
|
128
|
+
g.value && N(o.value.trim());
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function O(e) {
|
|
131
131
|
l.disabled || (D("update:modelValue", l.modelValue.filter((t) => t !== e)), B(() => {
|
|
132
132
|
var t;
|
|
133
133
|
return (t = f.value) == null ? void 0 : t.focus();
|
|
134
134
|
}));
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function ne(e) {
|
|
137
137
|
const t = d.value.length + (g.value ? 1 : 0);
|
|
138
138
|
if (e.key === "ArrowDown") {
|
|
139
139
|
if (e.preventDefault(), !s.value) {
|
|
140
|
-
s.value = !0,
|
|
140
|
+
s.value = !0, x();
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
i.value = Math.min(i.value + 1, t - 1);
|
|
144
|
-
} else e.key === "ArrowUp" ? (e.preventDefault(), i.value = Math.max(i.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), i.value >= 0 && i.value < d.value.length ?
|
|
144
|
+
} else e.key === "ArrowUp" ? (e.preventDefault(), i.value = Math.max(i.value - 1, 0)) : e.key === "Enter" ? (e.preventDefault(), i.value >= 0 && i.value < d.value.length ? H(d.value[i.value]) : (g.value && (i.value === d.value.length || i.value === -1) || g.value && o.value.trim()) && S()) : e.key === "," || e.key === "Tab" ? o.value.trim() && l.allowCreate && (e.preventDefault(), S()) : e.key === "Escape" ? s.value = !1 : e.key === "Backspace" && !o.value && l.modelValue.length > 0 && O(l.modelValue[l.modelValue.length - 1]);
|
|
145
145
|
}
|
|
146
146
|
function P(e) {
|
|
147
147
|
var a, n;
|
|
148
148
|
const t = e.target;
|
|
149
|
-
(a =
|
|
149
|
+
(a = y.value) != null && a.contains(t) || (n = _.value) != null && n.contains(t) || (s.value = !1);
|
|
150
|
+
}
|
|
151
|
+
function oe() {
|
|
152
|
+
!l.disabled && !C.value && (s.value = !0, x());
|
|
150
153
|
}
|
|
151
|
-
function
|
|
152
|
-
|
|
154
|
+
function T() {
|
|
155
|
+
s.value && x();
|
|
153
156
|
}
|
|
154
|
-
|
|
155
|
-
document.addEventListener("mousedown", P), window.addEventListener("scroll",
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}), ce(() => {
|
|
161
|
-
document.removeEventListener("mousedown", P), x && clearTimeout(x);
|
|
162
|
-
}), ve(s, (e) => {
|
|
163
|
-
e || (o.value = ""), e && B(p);
|
|
157
|
+
ce(() => {
|
|
158
|
+
document.addEventListener("mousedown", P), window.addEventListener("scroll", T, !0), window.addEventListener("resize", T);
|
|
159
|
+
}), ve(() => {
|
|
160
|
+
document.removeEventListener("mousedown", P), window.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T), w && clearTimeout(w);
|
|
161
|
+
}), fe(s, (e) => {
|
|
162
|
+
e || (o.value = ""), e && B(x);
|
|
164
163
|
});
|
|
165
|
-
function
|
|
164
|
+
function ie(e) {
|
|
166
165
|
var t;
|
|
167
|
-
f.value ? f.value.focus(e) : (t =
|
|
166
|
+
f.value ? f.value.focus(e) : (t = y.value) == null || t.focus(e);
|
|
168
167
|
}
|
|
169
|
-
function
|
|
168
|
+
function re() {
|
|
170
169
|
var e;
|
|
171
170
|
(e = f.value) == null || e.blur();
|
|
172
171
|
}
|
|
173
|
-
return
|
|
172
|
+
return G({ el: y, focus: ie, blur: re }), (e, t) => me((r(), v("div", {
|
|
174
173
|
class: "cui-tag-input",
|
|
175
174
|
ref_key: "wrapperRef",
|
|
176
|
-
ref:
|
|
177
|
-
style: M(
|
|
175
|
+
ref: y,
|
|
176
|
+
style: M(L.value.style)
|
|
178
177
|
}, [
|
|
179
|
-
u.label ? (r(), v("label",
|
|
180
|
-
|
|
178
|
+
u.label ? (r(), v("label", ze, b(u.label), 1)) : h("", !0),
|
|
179
|
+
$("div", {
|
|
181
180
|
ref_key: "controlRef",
|
|
182
|
-
ref:
|
|
183
|
-
class:
|
|
181
|
+
ref: I,
|
|
182
|
+
class: E(["cui-tag-input__control", { "cui-tag-input__control--disabled": u.disabled }]),
|
|
184
183
|
style: M({
|
|
185
|
-
"--_tag-input-radius":
|
|
184
|
+
"--_tag-input-radius": ee[u.rounded],
|
|
186
185
|
"--_tag-input-border": u.error ? "var(--cui-error)" : "var(--cui-border-strong, var(--cui-border))"
|
|
187
186
|
}),
|
|
188
187
|
onClick: t[0] || (t[0] = (a) => {
|
|
@@ -190,24 +189,24 @@ const Ve = {
|
|
|
190
189
|
return (n = f.value) == null ? void 0 : n.focus();
|
|
191
190
|
})
|
|
192
191
|
}, [
|
|
193
|
-
(r(!0), v(
|
|
192
|
+
(r(!0), v(U, null, K(u.modelValue, (a) => (r(), W(Te, {
|
|
194
193
|
key: a,
|
|
195
|
-
color:
|
|
196
|
-
size:
|
|
194
|
+
color: ae(a),
|
|
195
|
+
size: L.value.tagSize,
|
|
197
196
|
removable: "",
|
|
198
|
-
onRemove: (n) =>
|
|
197
|
+
onRemove: (n) => O(a)
|
|
199
198
|
}, {
|
|
200
|
-
default:
|
|
201
|
-
|
|
199
|
+
default: ge(() => [
|
|
200
|
+
pe(b(te(a)), 1)
|
|
202
201
|
]),
|
|
203
202
|
_: 2
|
|
204
203
|
}, 1032, ["color", "size", "onRemove"]))), 128)),
|
|
205
|
-
C.value ?
|
|
204
|
+
C.value ? h("", !0) : (r(), v("input", {
|
|
206
205
|
key: 0,
|
|
207
206
|
id: u.id,
|
|
208
207
|
name: u.name,
|
|
209
208
|
autocomplete: u.autocomplete,
|
|
210
|
-
"aria-describedby":
|
|
209
|
+
"aria-describedby": Y(X),
|
|
211
210
|
"aria-required": u.ariaRequired || void 0,
|
|
212
211
|
"aria-labelledby": u.ariaLabelledby,
|
|
213
212
|
ref_key: "inputRef",
|
|
@@ -216,64 +215,64 @@ const Ve = {
|
|
|
216
215
|
placeholder: u.modelValue.length > 0 ? "" : u.placeholder,
|
|
217
216
|
disabled: u.disabled,
|
|
218
217
|
class: "cui-tag-input__input",
|
|
219
|
-
onInput:
|
|
220
|
-
onFocus:
|
|
221
|
-
onKeydown:
|
|
222
|
-
}, null, 40,
|
|
218
|
+
onInput: ue,
|
|
219
|
+
onFocus: oe,
|
|
220
|
+
onKeydown: ne
|
|
221
|
+
}, null, 40, Le))
|
|
223
222
|
], 6),
|
|
224
223
|
u.error && u.errorMessage ? (r(), v("div", {
|
|
225
224
|
key: 1,
|
|
226
|
-
id:
|
|
225
|
+
id: Y(Q),
|
|
227
226
|
class: "cui-tag-input__error"
|
|
228
|
-
},
|
|
229
|
-
(r(),
|
|
230
|
-
s.value && (d.value.length > 0 || g.value ||
|
|
227
|
+
}, b(u.errorMessage), 9, Re)) : h("", !0),
|
|
228
|
+
(r(), W(be, { to: "body" }, [
|
|
229
|
+
s.value && (d.value.length > 0 || g.value || A.value) ? (r(), v("div", {
|
|
231
230
|
key: 0,
|
|
232
231
|
ref_key: "dropdownRef",
|
|
233
232
|
ref: _,
|
|
234
233
|
class: "cui-tag-input__dropdown",
|
|
235
|
-
style: M(
|
|
234
|
+
style: M(q.value)
|
|
236
235
|
}, [
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
A.value && d.value.length === 0 ? (r(), v("div", Be, [
|
|
237
|
+
Z(Ve, {
|
|
239
238
|
size: "xs",
|
|
240
239
|
"show-label": "",
|
|
241
240
|
label: "Searching..."
|
|
242
241
|
})
|
|
243
|
-
])) :
|
|
244
|
-
(r(!0), v(
|
|
242
|
+
])) : h("", !0),
|
|
243
|
+
(r(!0), v(U, null, K(d.value, (a, n) => (r(), v("div", {
|
|
245
244
|
key: a.value,
|
|
246
245
|
"data-index": n,
|
|
247
|
-
class:
|
|
248
|
-
onClick:
|
|
249
|
-
onMouseenter: (
|
|
246
|
+
class: E(["cui-tag-input__suggestion", { "cui-tag-input__suggestion--focused": i.value === n }]),
|
|
247
|
+
onClick: j((V) => H(a), ["stop"]),
|
|
248
|
+
onMouseenter: (V) => i.value = n
|
|
250
249
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
250
|
+
he(e.$slots, "suggestion", { suggestion: a }, () => [
|
|
251
|
+
$("span", null, b(a.label || a.value), 1)
|
|
253
252
|
], !0)
|
|
254
253
|
], 42, Me))), 128)),
|
|
255
254
|
g.value ? (r(), v("div", {
|
|
256
255
|
key: 1,
|
|
257
|
-
class:
|
|
256
|
+
class: E(["cui-tag-input__create", {
|
|
258
257
|
"cui-tag-input__suggestion--focused": i.value === d.value.length,
|
|
259
258
|
"cui-tag-input__create--divided": d.value.length > 0
|
|
260
259
|
}]),
|
|
261
|
-
onClick:
|
|
260
|
+
onClick: j(S, ["stop"]),
|
|
262
261
|
onMouseenter: t[1] || (t[1] = (a) => i.value = d.value.length)
|
|
263
262
|
}, [
|
|
264
|
-
|
|
263
|
+
Z(Se, {
|
|
265
264
|
name: "plus",
|
|
266
265
|
size: "0.75rem"
|
|
267
266
|
}),
|
|
268
|
-
|
|
269
|
-
], 34)) :
|
|
270
|
-
], 4)) :
|
|
267
|
+
$("span", null, b(u.createText) + " “" + b(o.value.trim()) + "”", 1)
|
|
268
|
+
], 34)) : h("", !0)
|
|
269
|
+
], 4)) : h("", !0)
|
|
271
270
|
]))
|
|
272
271
|
], 4)), [
|
|
273
|
-
[
|
|
272
|
+
[ye, !u.hidden]
|
|
274
273
|
]);
|
|
275
274
|
}
|
|
276
275
|
});
|
|
277
276
|
export {
|
|
278
|
-
|
|
277
|
+
Ne as default
|
|
279
278
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTooltip.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTooltip.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTooltip.vue"],"names":[],"mappings":"AAwUA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,cAAc,EAAE,gBAAgB;IACtF,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,mCAAmC;IACnC,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAwRD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC3C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAwC/C,QAAA,MAAM,eAAe;;;;;;;eA9UP,gBAAgB;aAElB,cAAc;eAEZ,MAAM;eAEN,MAAM;aAER,OAAO;6EA8UjB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAa1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CuiTooltip.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-25260ac8"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
@@ -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,117 +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
|
+
{ immediate: !0 }
|
|
26
27
|
);
|
|
27
|
-
const { referenceRef:
|
|
28
|
-
placement:
|
|
28
|
+
const { referenceRef: E, floatingRef: D, arrowRef: M, floatingStyles: S, arrowStyle: B, currentSide: R, isPositioned: x } = Y({
|
|
29
|
+
placement: O(e, "placement"),
|
|
29
30
|
offsetDistance: 8,
|
|
30
31
|
arrow: !e.noArrow
|
|
31
32
|
});
|
|
32
|
-
function
|
|
33
|
-
e.disabled || (t && (clearTimeout(t), t = null),
|
|
34
|
-
i.value = !0,
|
|
33
|
+
function s() {
|
|
34
|
+
e.disabled || (t && (clearTimeout(t), t = null), l = setTimeout(() => {
|
|
35
|
+
i.value = !0, p("update:visible", !0);
|
|
35
36
|
}, e.showDelay));
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
i.value = !1, d("update:visible", !1);
|
|
40
|
-
}, e.hideDelay);
|
|
38
|
+
function a() {
|
|
39
|
+
l && clearTimeout(l), t && clearTimeout(t), l = t = null;
|
|
41
40
|
}
|
|
42
|
-
function
|
|
43
|
-
i.value
|
|
41
|
+
function g() {
|
|
42
|
+
a(), i.value = !1, p("update:visible", !1);
|
|
44
43
|
}
|
|
45
|
-
function
|
|
46
|
-
(
|
|
44
|
+
function u() {
|
|
45
|
+
a(), t = setTimeout(g, e.hideDelay);
|
|
47
46
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
47
|
+
function C() {
|
|
48
|
+
i.value ? u() : s();
|
|
50
49
|
}
|
|
51
|
-
function
|
|
52
|
-
(e.trigger === "
|
|
50
|
+
function $() {
|
|
51
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && s();
|
|
53
52
|
}
|
|
54
|
-
function
|
|
55
|
-
(e.trigger === "
|
|
53
|
+
function L() {
|
|
54
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && u();
|
|
56
55
|
}
|
|
57
|
-
function
|
|
58
|
-
e.trigger === "
|
|
56
|
+
function F() {
|
|
57
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && s();
|
|
59
58
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
59
|
+
function N() {
|
|
60
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && u();
|
|
62
61
|
}
|
|
63
|
-
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() {
|
|
64
79
|
(e.trigger === "hover" || e.trigger === "hover-focus") && t && (clearTimeout(t), t = null);
|
|
65
80
|
}
|
|
66
|
-
function
|
|
67
|
-
(e.trigger === "hover" || e.trigger === "hover-focus") &&
|
|
81
|
+
function A() {
|
|
82
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && u();
|
|
68
83
|
}
|
|
69
|
-
|
|
70
|
-
|
|
84
|
+
j(() => {
|
|
85
|
+
a(), document.removeEventListener("keydown", f, !0);
|
|
71
86
|
});
|
|
72
|
-
const
|
|
87
|
+
const z = d(() => {
|
|
73
88
|
const o = {};
|
|
74
|
-
return
|
|
75
|
-
}),
|
|
89
|
+
return x.value || (o.opacity = "0", o.pointerEvents = "none", o.animation = "none"), o;
|
|
90
|
+
}), U = d(() => e.color ? {
|
|
76
91
|
background: `var(--cui-${e.color})`,
|
|
77
92
|
color: `var(--cui-${e.color}-text)`,
|
|
78
93
|
"--_arrow-bg": `var(--cui-${e.color})`
|
|
79
94
|
} : {});
|
|
80
|
-
return
|
|
95
|
+
return d(() => e.text || !0), (o, r) => q((c(), v("div", {
|
|
81
96
|
class: "cui-tooltip-wrapper",
|
|
82
|
-
onMouseenter:
|
|
83
|
-
onMouseleave:
|
|
84
|
-
onFocusin:
|
|
85
|
-
onFocusout:
|
|
86
|
-
onClick:
|
|
87
|
-
onKeydown: x
|
|
97
|
+
onMouseenter: $,
|
|
98
|
+
onMouseleave: L,
|
|
99
|
+
onFocusin: F,
|
|
100
|
+
onFocusout: N,
|
|
101
|
+
onClick: P
|
|
88
102
|
}, [
|
|
89
|
-
|
|
103
|
+
w("div", {
|
|
90
104
|
ref_key: "referenceRef",
|
|
91
|
-
ref:
|
|
105
|
+
ref: E,
|
|
92
106
|
class: "cui-tooltip__trigger"
|
|
93
107
|
}, [
|
|
94
|
-
|
|
108
|
+
k(o.$slots, "default", {}, void 0, !0)
|
|
95
109
|
], 512),
|
|
96
|
-
(
|
|
97
|
-
i.value ? (
|
|
110
|
+
(c(), G(H, { to: "body" }, [
|
|
111
|
+
i.value ? (c(), v("div", {
|
|
98
112
|
key: 0,
|
|
99
113
|
ref_key: "floatingRef",
|
|
100
|
-
ref:
|
|
101
|
-
class:
|
|
114
|
+
ref: D,
|
|
115
|
+
class: J(["cui-tooltip", [
|
|
102
116
|
e.color ? "cui-tooltip--colored" : "cui-tooltip--default",
|
|
103
|
-
`cui-tooltip--${
|
|
117
|
+
`cui-tooltip--${m(R)}`
|
|
104
118
|
]]),
|
|
105
|
-
style:
|
|
119
|
+
style: T({ ...m(S), ...U.value, ...z.value }),
|
|
106
120
|
role: "tooltip",
|
|
107
|
-
onMouseenter:
|
|
108
|
-
onMouseleave:
|
|
121
|
+
onMouseenter: V,
|
|
122
|
+
onMouseleave: A
|
|
109
123
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
w("div", Z, [
|
|
125
|
+
k(o.$slots, "content", {}, () => [
|
|
126
|
+
Q(W(n.text), 1)
|
|
113
127
|
], !0)
|
|
114
128
|
]),
|
|
115
|
-
n.noArrow ?
|
|
129
|
+
n.noArrow ? b("", !0) : (c(), v("div", {
|
|
116
130
|
key: 0,
|
|
117
131
|
ref_key: "arrowRef",
|
|
118
|
-
ref:
|
|
132
|
+
ref: M,
|
|
119
133
|
class: "cui-tooltip__arrow",
|
|
120
|
-
style:
|
|
134
|
+
style: T(m(B))
|
|
121
135
|
}, null, 4))
|
|
122
|
-
], 38)) :
|
|
136
|
+
], 38)) : b("", !0)
|
|
123
137
|
]))
|
|
124
138
|
], 544)), [
|
|
125
|
-
[
|
|
139
|
+
[X, !n.hidden]
|
|
126
140
|
]);
|
|
127
141
|
}
|
|
128
142
|
});
|
|
129
143
|
export {
|
|
130
|
-
|
|
144
|
+
te as default
|
|
131
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"}
|