@itguy614/clean-ui 1.3.0 → 1.3.1
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/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/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 +2 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { resolveColor as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as b, useSlots as p, useId as S, computed as n, withDirectives as c, openBlock as a, createElementBlock as r, normalizeStyle as i, createCommentVNode as m, createElementVNode as x, renderSlot as k, createTextVNode as w, toDisplayString as z, vShow as d } from "vue";
|
|
2
|
+
import { resolveColor as h } from "../utils/color.js";
|
|
3
|
+
const T = ["aria-orientation"], D = /* @__PURE__ */ b({
|
|
4
4
|
__name: "CuiDivider",
|
|
5
5
|
props: {
|
|
6
6
|
orientation: { default: "horizontal" },
|
|
@@ -12,10 +12,10 @@ const B = /* @__PURE__ */ p({
|
|
|
12
12
|
hidden: { type: Boolean, default: !1 }
|
|
13
13
|
},
|
|
14
14
|
setup(e) {
|
|
15
|
-
const t = e,
|
|
16
|
-
const
|
|
17
|
-
return `1px ${t.variant} ${
|
|
18
|
-
}),
|
|
15
|
+
const t = e, v = p(), g = () => !!t.label || !!v.default, s = `cui-divider-label-${S()}`, l = n(() => {
|
|
16
|
+
const o = t.color ? h(t.color) : "var(--cui-border)";
|
|
17
|
+
return `1px ${t.variant} ${o}`;
|
|
18
|
+
}), f = n(() => t.orientation === "vertical" ? {
|
|
19
19
|
display: "inline-flex",
|
|
20
20
|
flexDirection: "column",
|
|
21
21
|
alignItems: "center",
|
|
@@ -28,101 +28,85 @@ const B = /* @__PURE__ */ p({
|
|
|
28
28
|
width: "100%",
|
|
29
29
|
marginTop: t.spacing,
|
|
30
30
|
marginBottom: t.spacing
|
|
31
|
-
}),
|
|
31
|
+
}), u = n(() => t.orientation === "vertical" ? {
|
|
32
32
|
flex: "1",
|
|
33
33
|
width: "0",
|
|
34
|
-
borderLeft:
|
|
34
|
+
borderLeft: l.value,
|
|
35
35
|
minHeight: "1rem"
|
|
36
36
|
} : {
|
|
37
37
|
flex: "1",
|
|
38
38
|
height: "0",
|
|
39
|
-
borderTop:
|
|
39
|
+
borderTop: l.value
|
|
40
40
|
}), y = n(() => ({
|
|
41
41
|
fontSize: "0.75rem",
|
|
42
42
|
fontWeight: "500",
|
|
43
|
-
color: t.color ?
|
|
43
|
+
color: t.color ? h(t.color) : "var(--cui-text-tertiary)",
|
|
44
44
|
padding: t.orientation === "horizontal" ? "0 calc(0.75rem * var(--cui-density-scale, 1))" : "calc(0.5rem * var(--cui-density-scale, 1)) 0",
|
|
45
45
|
whiteSpace: "nowrap",
|
|
46
46
|
textTransform: "uppercase",
|
|
47
47
|
letterSpacing: "0.04em"
|
|
48
48
|
}));
|
|
49
|
-
return (
|
|
49
|
+
return (o, B) => g() ? c((a(), r("div", {
|
|
50
50
|
key: 0,
|
|
51
51
|
class: "cui-divider",
|
|
52
|
-
style:
|
|
53
|
-
role: "separator"
|
|
52
|
+
style: i(f.value),
|
|
53
|
+
role: "separator",
|
|
54
|
+
"aria-orientation": e.orientation === "vertical" ? "vertical" : "horizontal",
|
|
55
|
+
"aria-labelledby": s
|
|
54
56
|
}, [
|
|
55
|
-
e.labelPosition !== "start" ? (
|
|
57
|
+
e.labelPosition !== "start" ? (a(), r("div", {
|
|
56
58
|
key: 0,
|
|
57
|
-
style:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
style: i(u.value),
|
|
60
|
+
"aria-hidden": "true"
|
|
61
|
+
}, null, 4)) : m("", !0),
|
|
62
|
+
x("span", {
|
|
63
|
+
id: s,
|
|
64
|
+
style: i(y.value)
|
|
61
65
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
k(o.$slots, "default", {}, () => [
|
|
67
|
+
w(z(e.label), 1)
|
|
64
68
|
])
|
|
65
69
|
], 4),
|
|
66
|
-
e.labelPosition !== "end" ? (
|
|
70
|
+
e.labelPosition !== "end" ? (a(), r("div", {
|
|
67
71
|
key: 1,
|
|
68
|
-
style:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
style: i(u.value),
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
}, null, 4)) : m("", !0)
|
|
75
|
+
], 12, T)), [
|
|
76
|
+
[d, !e.hidden]
|
|
77
|
+
]) : e.orientation === "horizontal" ? c((a(), r("hr", {
|
|
73
78
|
key: 1,
|
|
74
79
|
class: "cui-divider",
|
|
75
|
-
style:
|
|
80
|
+
style: i({
|
|
76
81
|
border: "none",
|
|
77
|
-
borderTop:
|
|
82
|
+
borderTop: l.value,
|
|
78
83
|
width: "100%",
|
|
79
84
|
marginTop: e.spacing,
|
|
80
85
|
marginBottom: e.spacing
|
|
81
86
|
}),
|
|
82
|
-
role: "separator"
|
|
87
|
+
role: "separator",
|
|
88
|
+
"aria-orientation": "horizontal"
|
|
83
89
|
}, null, 4)), [
|
|
84
|
-
[
|
|
85
|
-
]) :
|
|
90
|
+
[d, !e.hidden]
|
|
91
|
+
]) : c((a(), r("div", {
|
|
86
92
|
key: 2,
|
|
87
93
|
class: "cui-divider",
|
|
88
|
-
style:
|
|
89
|
-
role: "separator"
|
|
90
|
-
}, [
|
|
91
|
-
e.labelPosition !== "start" ? (i(), a("div", {
|
|
92
|
-
key: 0,
|
|
93
|
-
style: l(o.value)
|
|
94
|
-
}, null, 4)) : d("", !0),
|
|
95
|
-
f("span", {
|
|
96
|
-
style: l(y.value)
|
|
97
|
-
}, [
|
|
98
|
-
g(c.$slots, "default", {}, () => [
|
|
99
|
-
h(b(e.label), 1)
|
|
100
|
-
])
|
|
101
|
-
], 4),
|
|
102
|
-
e.labelPosition !== "end" ? (i(), a("div", {
|
|
103
|
-
key: 1,
|
|
104
|
-
style: l(o.value)
|
|
105
|
-
}, null, 4)) : d("", !0)
|
|
106
|
-
], 4)), [
|
|
107
|
-
[u, !e.hidden]
|
|
108
|
-
]) : s((i(), a("div", {
|
|
109
|
-
key: 3,
|
|
110
|
-
class: "cui-divider",
|
|
111
|
-
style: l({
|
|
94
|
+
style: i({
|
|
112
95
|
display: "inline-block",
|
|
113
96
|
width: "0",
|
|
114
97
|
alignSelf: "stretch",
|
|
115
|
-
borderLeft:
|
|
98
|
+
borderLeft: l.value,
|
|
116
99
|
marginLeft: e.spacing,
|
|
117
100
|
marginRight: e.spacing,
|
|
118
101
|
minHeight: "1rem"
|
|
119
102
|
}),
|
|
120
|
-
role: "separator"
|
|
103
|
+
role: "separator",
|
|
104
|
+
"aria-orientation": "vertical"
|
|
121
105
|
}, null, 4)), [
|
|
122
|
-
[
|
|
106
|
+
[d, !e.hidden]
|
|
123
107
|
]);
|
|
124
108
|
}
|
|
125
109
|
});
|
|
126
110
|
export {
|
|
127
|
-
|
|
111
|
+
D as default
|
|
128
112
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiPagination.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPagination.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiPagination.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPagination.vue"],"names":[],"mappings":"AA+VA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIvG,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,kBAAmB,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa;IACtF,oCAAoC;IACpC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iCAAiC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;;;;;;;;oBAPkB,MAAM,EAAE;iBAEX,OAAO;cAEV,OAAO;gBAEL,MAAM;;AAmUrB,wBAQG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CuiPagination.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-fd425fec"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as F, computed as
|
|
1
|
+
import { defineComponent as F, computed as i, withDirectives as L, openBlock as r, createElementBlock as u, normalizeClass as g, toDisplayString as x, unref as T, createCommentVNode as $, createElementVNode as v, createVNode as k, Fragment as B, renderList as U, normalizeStyle as R, vShow as W } from "vue";
|
|
2
2
|
import N from "./CuiIcon.vue.js";
|
|
3
3
|
import Z from "./CuiSelect.vue.js";
|
|
4
4
|
import { clampSize as j } from "../utils/sizing.js";
|
|
@@ -33,46 +33,46 @@ const G = {
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["update:currentPage", "update:perPage"],
|
|
35
35
|
setup(s, { emit: I }) {
|
|
36
|
-
const a = s, f = I, M = ["sm", "md"], m =
|
|
36
|
+
const a = s, f = I, M = ["sm", "md"], m = i(() => j(a.size, M)), n = i(() => {
|
|
37
37
|
var e;
|
|
38
38
|
return a.currentPage ?? ((e = a.meta) == null ? void 0 : e.current_page) ?? 1;
|
|
39
|
-
}), _ =
|
|
39
|
+
}), _ = i(() => {
|
|
40
40
|
var e;
|
|
41
41
|
return a.totalPages ?? ((e = a.meta) == null ? void 0 : e.last_page) ?? 1;
|
|
42
|
-
}), b =
|
|
42
|
+
}), b = i(() => {
|
|
43
43
|
var e;
|
|
44
44
|
return a.perPage ?? ((e = a.meta) == null ? void 0 : e.per_page) ?? 15;
|
|
45
|
-
}), d =
|
|
45
|
+
}), d = i(() => {
|
|
46
46
|
var e;
|
|
47
47
|
return a.total ?? ((e = a.meta) == null ? void 0 : e.total) ?? 0;
|
|
48
|
-
}), E =
|
|
48
|
+
}), E = i(() => {
|
|
49
49
|
var e;
|
|
50
|
-
return ((e = a.meta) == null ? void 0 : e.from) != null ? a.meta.from : d.value === 0 ? 0 : (
|
|
51
|
-
}), O =
|
|
50
|
+
return ((e = a.meta) == null ? void 0 : e.from) != null ? a.meta.from : d.value === 0 ? 0 : (n.value - 1) * b.value + 1;
|
|
51
|
+
}), O = i(() => {
|
|
52
52
|
var e;
|
|
53
|
-
return ((e = a.meta) == null ? void 0 : e.to) != null ? a.meta.to : Math.min(
|
|
54
|
-
}), z =
|
|
55
|
-
const e = _.value, o =
|
|
53
|
+
return ((e = a.meta) == null ? void 0 : e.to) != null ? a.meta.to : Math.min(n.value * b.value, d.value);
|
|
54
|
+
}), z = i(() => n.value <= 1), C = i(() => n.value >= _.value), V = i(() => {
|
|
55
|
+
const e = _.value, o = n.value, t = a.maxButtons;
|
|
56
56
|
if (e <= t + 2)
|
|
57
|
-
return Array.from({ length: e }, (
|
|
57
|
+
return Array.from({ length: e }, (p, w) => w + 1);
|
|
58
58
|
const l = [], c = Math.floor(t / 2);
|
|
59
59
|
let h = Math.max(2, o - c), y = Math.min(e - 1, o + c);
|
|
60
60
|
o <= c + 1 && (y = t), o >= e - c && (h = e - t + 1), l.push(1), h > 2 && l.push("ellipsis");
|
|
61
|
-
for (let
|
|
62
|
-
l.push(
|
|
61
|
+
for (let p = h; p <= y; p++)
|
|
62
|
+
l.push(p);
|
|
63
63
|
return y < e - 1 && l.push("ellipsis"), e > 1 && l.push(e), l;
|
|
64
64
|
});
|
|
65
65
|
function P(e) {
|
|
66
|
-
e < 1 || e > _.value || e ===
|
|
66
|
+
e < 1 || e > _.value || e === n.value || f("update:currentPage", e);
|
|
67
67
|
}
|
|
68
68
|
function A(e) {
|
|
69
69
|
e != null && !Array.isArray(e) && (f("update:perPage", Number(e)), f("update:currentPage", 1));
|
|
70
70
|
}
|
|
71
|
-
const S = q(), D =
|
|
71
|
+
const S = q(), D = i(
|
|
72
72
|
() => a.perPageOptions.map((e) => ({ value: e, label: S.value.pagination.perPage(e) }))
|
|
73
73
|
);
|
|
74
74
|
return (e, o) => L((r(), u("div", {
|
|
75
|
-
class:
|
|
75
|
+
class: g(["cui-pagination", `cui-pagination--${m.value}`])
|
|
76
76
|
}, [
|
|
77
77
|
!s.hideInfo && d.value > 0 ? (r(), u("div", G, x(T(S).pagination.summary({ from: E.value, to: O.value, total: d.value })), 1)) : $("", !0),
|
|
78
78
|
v("div", H, [
|
|
@@ -86,10 +86,11 @@ const G = {
|
|
|
86
86
|
])),
|
|
87
87
|
v("nav", K, [
|
|
88
88
|
v("button", {
|
|
89
|
-
|
|
89
|
+
type: "button",
|
|
90
|
+
class: g(["cui-pagination__btn cui-pagination__btn--nav", { "cui-pagination__btn--disabled": z.value }]),
|
|
90
91
|
disabled: z.value,
|
|
91
92
|
"aria-label": "Previous page",
|
|
92
|
-
onClick: o[0] || (o[0] = (t) => P(
|
|
93
|
+
onClick: o[0] || (o[0] = (t) => P(n.value - 1))
|
|
93
94
|
}, [
|
|
94
95
|
k(N, {
|
|
95
96
|
name: "caret-left",
|
|
@@ -99,25 +100,27 @@ const G = {
|
|
|
99
100
|
(r(!0), u(B, null, U(V.value, (t, l) => (r(), u(B, { key: l }, [
|
|
100
101
|
t === "ellipsis" ? (r(), u("span", X, "...")) : (r(), u("button", {
|
|
101
102
|
key: 1,
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
type: "button",
|
|
104
|
+
class: g(["cui-pagination__btn", {
|
|
105
|
+
"cui-pagination__btn--active": t === n.value
|
|
104
106
|
}]),
|
|
105
|
-
style: R(t ===
|
|
107
|
+
style: R(t === n.value ? {
|
|
106
108
|
background: `var(--cui-${s.color}-bg)`,
|
|
107
109
|
color: `var(--cui-${s.color})`,
|
|
108
110
|
borderColor: `var(--cui-${s.color}-border)`,
|
|
109
111
|
fontWeight: "600"
|
|
110
112
|
} : {}),
|
|
111
113
|
"aria-label": `Page ${t}`,
|
|
112
|
-
"aria-current": t ===
|
|
114
|
+
"aria-current": t === n.value ? "page" : void 0,
|
|
113
115
|
onClick: (c) => P(t)
|
|
114
116
|
}, x(t), 15, Y))
|
|
115
117
|
], 64))), 128)),
|
|
116
118
|
v("button", {
|
|
117
|
-
|
|
119
|
+
type: "button",
|
|
120
|
+
class: g(["cui-pagination__btn cui-pagination__btn--nav", { "cui-pagination__btn--disabled": C.value }]),
|
|
118
121
|
disabled: C.value,
|
|
119
122
|
"aria-label": "Next page",
|
|
120
|
-
onClick: o[1] || (o[1] = (t) => P(
|
|
123
|
+
onClick: o[1] || (o[1] = (t) => P(n.value + 1))
|
|
121
124
|
}, [
|
|
122
125
|
k(N, {
|
|
123
126
|
name: "caret-right",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiPopover.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPopover.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiPopover.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiPopover.vue"],"names":[],"mappings":"AA4TA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG9E,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGnF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,CAAC;AAEzE,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,gBAAgB;IACtE,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AA+TD,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,QAAQ,IAAW,EAAE,QAAQ,IAAY,CAAE;AACrF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC7C;IAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAiD/C,QAAA,MAAM,eAAe;;;;;;aAtXT,UAAU;;eAlBR,gBAAgB;aAElB,cAAc;eAEZ,MAAM;eAEN,MAAM;aAER,OAAO;cAQN,OAAO;6EAgYlB,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,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as q, useSlots as G, ref as S, watch as E, computed as
|
|
2
|
-
import { usePopover as
|
|
3
|
-
import { useClickOutside as
|
|
1
|
+
import { defineComponent as q, useSlots as G, ref as S, watch as E, computed as c, onUnmounted as J, useId as Q, withDirectives as X, openBlock as n, createElementBlock as l, createElementVNode as f, renderSlot as v, createBlock as Y, Teleport as Z, normalizeStyle as g, unref as h, toDisplayString as ee, withModifiers as te, createVNode as oe, createCommentVNode as u, vShow as ie } from "vue";
|
|
2
|
+
import { usePopover as re } from "../composables/usePopover.js";
|
|
3
|
+
import { useClickOutside as ne } from "../composables/useClickOutside.js";
|
|
4
4
|
import ae from "./CuiIcon.vue.js";
|
|
5
|
-
import { useMessages as
|
|
6
|
-
const
|
|
5
|
+
import { useMessages as le } from "../composables/useMessages.js";
|
|
6
|
+
const se = ["aria-labelledby"], ce = {
|
|
7
7
|
key: 0,
|
|
8
8
|
style: {
|
|
9
9
|
display: "flex",
|
|
@@ -12,12 +12,12 @@ const le = ["aria-labelledby"], se = {
|
|
|
12
12
|
gap: "calc(0.5rem * var(--cui-density-scale, 1))",
|
|
13
13
|
padding: "calc(0.75rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1)) calc(0.25rem * var(--cui-density-scale, 1))"
|
|
14
14
|
}
|
|
15
|
-
},
|
|
15
|
+
}, ue = { style: { fontSize: "0.875rem", fontWeight: "600", color: "var(--cui-text-body)" } }, de = ["aria-label"], fe = {
|
|
16
16
|
key: 1,
|
|
17
17
|
style: {
|
|
18
18
|
padding: "0 calc(0.875rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, be = /* @__PURE__ */ q({
|
|
21
21
|
__name: "CuiPopover",
|
|
22
22
|
props: {
|
|
23
23
|
title: {},
|
|
@@ -35,75 +35,76 @@ const le = ["aria-labelledby"], se = {
|
|
|
35
35
|
disabled: { type: Boolean, default: !1 }
|
|
36
36
|
},
|
|
37
37
|
emits: ["update:visible"],
|
|
38
|
-
setup(
|
|
39
|
-
const e =
|
|
38
|
+
setup(s, { emit: M }) {
|
|
39
|
+
const e = s, R = {
|
|
40
40
|
none: "0",
|
|
41
41
|
sm: "var(--cui-radius-sm, 0.25rem)",
|
|
42
42
|
md: "var(--cui-button-radius, var(--cui-radius-md, 0.375rem))",
|
|
43
43
|
lg: "var(--cui-radius-lg, 0.5rem)",
|
|
44
44
|
full: "9999px"
|
|
45
|
-
}, d = M,
|
|
46
|
-
let
|
|
45
|
+
}, d = M, b = G(), o = S(!1);
|
|
46
|
+
let a = null, i = null;
|
|
47
47
|
E(
|
|
48
48
|
() => e.visible,
|
|
49
49
|
(t) => {
|
|
50
50
|
t !== void 0 && (o.value = t);
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
|
+
{ immediate: !0 }
|
|
52
53
|
);
|
|
53
|
-
const { referenceRef: T, floatingRef:
|
|
54
|
-
placement:
|
|
55
|
-
offsetDistance:
|
|
54
|
+
const { referenceRef: T, floatingRef: w, arrowRef: C, floatingStyles: _, arrowStyle: D, currentSide: B, isPositioned: P } = re({
|
|
55
|
+
placement: c(() => e.placement),
|
|
56
|
+
offsetDistance: c(() => e.offset ?? 10),
|
|
56
57
|
arrow: !e.noArrow
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
() => [
|
|
58
|
+
}), k = S(null);
|
|
59
|
+
ne(
|
|
60
|
+
() => [k.value, w.value],
|
|
60
61
|
() => {
|
|
61
|
-
o.value && e.trigger === "click" &&
|
|
62
|
+
o.value && e.trigger === "click" && r();
|
|
62
63
|
}
|
|
63
64
|
), E(o, (t) => {
|
|
64
|
-
typeof document > "u" || (t ? document.addEventListener("keydown",
|
|
65
|
-
});
|
|
66
|
-
function
|
|
67
|
-
e.disabled || (i && (clearTimeout(i), i = null), e.showDelay > 0 ?
|
|
65
|
+
typeof document > "u" || (t ? document.addEventListener("keydown", p) : document.removeEventListener("keydown", p));
|
|
66
|
+
}, { immediate: !0 });
|
|
67
|
+
function m() {
|
|
68
|
+
e.disabled || (i && (clearTimeout(i), i = null), e.showDelay > 0 ? a = setTimeout(() => {
|
|
68
69
|
o.value = !0, d("update:visible", !0);
|
|
69
70
|
}, e.showDelay) : (o.value = !0, d("update:visible", !0)));
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
72
|
+
function r() {
|
|
73
|
+
a && (clearTimeout(a), a = null), e.hideDelay > 0 ? i = setTimeout(() => {
|
|
73
74
|
o.value = !1, d("update:visible", !1);
|
|
74
75
|
}, e.hideDelay) : (o.value = !1, d("update:visible", !1));
|
|
75
76
|
}
|
|
76
77
|
function I() {
|
|
77
|
-
o.value ?
|
|
78
|
+
o.value ? r() : m();
|
|
78
79
|
}
|
|
79
80
|
function z() {
|
|
80
|
-
(e.trigger === "hover" || e.trigger === "hover-focus") &&
|
|
81
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && m();
|
|
81
82
|
}
|
|
82
83
|
function F() {
|
|
83
|
-
(e.trigger === "hover" || e.trigger === "hover-focus") &&
|
|
84
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && r();
|
|
84
85
|
}
|
|
85
86
|
function L() {
|
|
86
|
-
(e.trigger === "focus" || e.trigger === "hover-focus") &&
|
|
87
|
-
}
|
|
88
|
-
function V() {
|
|
89
|
-
(e.trigger === "focus" || e.trigger === "hover-focus") && a();
|
|
87
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && m();
|
|
90
88
|
}
|
|
91
89
|
function $() {
|
|
90
|
+
(e.trigger === "focus" || e.trigger === "hover-focus") && r();
|
|
91
|
+
}
|
|
92
|
+
function V() {
|
|
92
93
|
e.trigger === "click" && I();
|
|
93
94
|
}
|
|
94
|
-
function
|
|
95
|
-
t.key === "Escape" && o.value &&
|
|
95
|
+
function p(t) {
|
|
96
|
+
t.key === "Escape" && o.value && r();
|
|
96
97
|
}
|
|
97
98
|
function A() {
|
|
98
99
|
(e.trigger === "hover" || e.trigger === "hover-focus") && i && (clearTimeout(i), i = null);
|
|
99
100
|
}
|
|
100
101
|
function H() {
|
|
101
|
-
(e.trigger === "hover" || e.trigger === "hover-focus") &&
|
|
102
|
+
(e.trigger === "hover" || e.trigger === "hover-focus") && r();
|
|
102
103
|
}
|
|
103
104
|
J(() => {
|
|
104
|
-
|
|
105
|
+
a && clearTimeout(a), i && clearTimeout(i), typeof document < "u" && document.removeEventListener("keydown", p);
|
|
105
106
|
});
|
|
106
|
-
const
|
|
107
|
+
const y = () => !!(e.title || b.header), N = () => !!b.footer, x = `cui-popover-title-${Q()}`, W = c(() => {
|
|
107
108
|
const t = {
|
|
108
109
|
zIndex: "9998",
|
|
109
110
|
background: "var(--cui-surface-base)",
|
|
@@ -117,10 +118,10 @@ const le = ["aria-labelledby"], se = {
|
|
|
117
118
|
overflow: "hidden"
|
|
118
119
|
};
|
|
119
120
|
return e.width && (t.width = e.width), t;
|
|
120
|
-
}), j =
|
|
121
|
+
}), j = c(() => {
|
|
121
122
|
const t = {};
|
|
122
123
|
return P.value || (t.opacity = "0", t.pointerEvents = "none", t.animation = "none"), t;
|
|
123
|
-
}), O =
|
|
124
|
+
}), O = c(() => ({
|
|
124
125
|
width: "8px",
|
|
125
126
|
height: "8px",
|
|
126
127
|
background: "var(--cui-surface-base)",
|
|
@@ -133,45 +134,47 @@ const le = ["aria-labelledby"], se = {
|
|
|
133
134
|
bottom: "polygon(0% 0%, 0% 100%, 100% 100%)",
|
|
134
135
|
left: "polygon(0% 0%, 100% 0%, 100% 100%)",
|
|
135
136
|
right: "polygon(0% 0%, 0% 100%, 100% 100%)"
|
|
136
|
-
}, K =
|
|
137
|
-
return (t,
|
|
137
|
+
}, K = le();
|
|
138
|
+
return (t, ve) => X((n(), l("div", {
|
|
138
139
|
class: "cui-popover",
|
|
139
140
|
ref_key: "wrapperRef",
|
|
140
|
-
ref:
|
|
141
|
+
ref: k,
|
|
141
142
|
style: { display: "inline-flex" },
|
|
142
143
|
onMouseenter: z,
|
|
143
144
|
onMouseleave: F,
|
|
144
145
|
onFocusin: L,
|
|
145
|
-
onFocusout:
|
|
146
|
-
onClick:
|
|
146
|
+
onFocusout: $,
|
|
147
|
+
onClick: V
|
|
147
148
|
}, [
|
|
148
|
-
|
|
149
|
+
f("div", {
|
|
149
150
|
ref_key: "referenceRef",
|
|
150
151
|
ref: T,
|
|
151
152
|
style: { display: "inline-flex" }
|
|
152
153
|
}, [
|
|
153
|
-
|
|
154
|
+
v(t.$slots, "default")
|
|
154
155
|
], 512),
|
|
155
|
-
(n(),
|
|
156
|
-
o.value ? (n(),
|
|
156
|
+
(n(), Y(Z, { to: "body" }, [
|
|
157
|
+
o.value ? (n(), l("div", {
|
|
157
158
|
key: 0,
|
|
158
159
|
ref_key: "floatingRef",
|
|
159
|
-
ref:
|
|
160
|
+
ref: w,
|
|
160
161
|
class: "cui-popover__panel",
|
|
161
|
-
style:
|
|
162
|
+
style: g({ ...h(_), ...W.value, ...j.value }),
|
|
162
163
|
role: "dialog",
|
|
163
|
-
"aria-labelledby": x
|
|
164
|
+
"aria-labelledby": y() ? x : void 0,
|
|
164
165
|
onMouseenter: A,
|
|
165
166
|
onMouseleave: H
|
|
166
167
|
}, [
|
|
167
|
-
|
|
168
|
-
f(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
},
|
|
168
|
+
y() ? (n(), l("div", ce, [
|
|
169
|
+
f("div", {
|
|
170
|
+
id: x,
|
|
171
|
+
style: { display: "contents" }
|
|
172
|
+
}, [
|
|
173
|
+
v(t.$slots, "header", {}, () => [
|
|
174
|
+
f("span", ue, ee(s.title), 1)
|
|
175
|
+
])
|
|
173
176
|
]),
|
|
174
|
-
|
|
177
|
+
s.closable ? (n(), l("button", {
|
|
175
178
|
key: 0,
|
|
176
179
|
type: "button",
|
|
177
180
|
style: {
|
|
@@ -189,44 +192,44 @@ const le = ["aria-labelledby"], se = {
|
|
|
189
192
|
marginTop: "calc(-0.0625rem * var(--cui-density-scale, 1))",
|
|
190
193
|
marginRight: "calc(-0.125rem * var(--cui-density-scale, 1))"
|
|
191
194
|
},
|
|
192
|
-
"aria-label":
|
|
193
|
-
onClick:
|
|
195
|
+
"aria-label": h(K).close,
|
|
196
|
+
onClick: te(r, ["stop"])
|
|
194
197
|
}, [
|
|
195
|
-
|
|
198
|
+
oe(ae, {
|
|
196
199
|
name: "x",
|
|
197
200
|
size: "0.8125rem"
|
|
198
201
|
})
|
|
199
|
-
], 8,
|
|
202
|
+
], 8, de)) : u("", !0)
|
|
200
203
|
])) : u("", !0),
|
|
201
|
-
|
|
202
|
-
style:
|
|
203
|
-
padding:
|
|
204
|
+
f("div", {
|
|
205
|
+
style: g({
|
|
206
|
+
padding: y() ? "calc(0.25rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1)) calc(0.75rem * var(--cui-density-scale, 1))" : "calc(0.75rem * var(--cui-density-scale, 1)) calc(0.875rem * var(--cui-density-scale, 1))",
|
|
204
207
|
fontSize: "0.875rem",
|
|
205
208
|
lineHeight: "1.55",
|
|
206
209
|
color: "var(--cui-text-secondary)"
|
|
207
210
|
})
|
|
208
211
|
}, [
|
|
209
|
-
|
|
212
|
+
v(t.$slots, "content")
|
|
210
213
|
], 4),
|
|
211
|
-
N
|
|
212
|
-
|
|
214
|
+
N() ? (n(), l("div", fe, [
|
|
215
|
+
v(t.$slots, "footer")
|
|
213
216
|
])) : u("", !0),
|
|
214
|
-
|
|
217
|
+
s.noArrow ? u("", !0) : (n(), l("div", {
|
|
215
218
|
key: 2,
|
|
216
219
|
ref_key: "arrowRef",
|
|
217
220
|
ref: C,
|
|
218
|
-
style:
|
|
221
|
+
style: g({
|
|
219
222
|
...O.value,
|
|
220
|
-
clipPath: U[
|
|
223
|
+
clipPath: U[h(B)] || void 0
|
|
221
224
|
})
|
|
222
225
|
}, null, 4))
|
|
223
|
-
], 44,
|
|
226
|
+
], 44, se)) : u("", !0)
|
|
224
227
|
]))
|
|
225
228
|
], 544)), [
|
|
226
|
-
[
|
|
229
|
+
[ie, !s.hidden]
|
|
227
230
|
]);
|
|
228
231
|
}
|
|
229
232
|
});
|
|
230
233
|
export {
|
|
231
|
-
|
|
234
|
+
be as default
|
|
232
235
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiSlider.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiSlider.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiSlider.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiSlider.vue"],"names":[],"mappings":"AA0NA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAI7I,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IACxH,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuDD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;AA0KD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA+B7C,QAAA,MAAM,eAAe;;;;;;;;;;;;;gBAzRN,MAAM;SAIb,MAAM;UAEL,MAAM;SAJP,MAAM;eAQA,OAAO;eAIP,OAAO;6EAoRnB,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"}
|