@itguy614/clean-ui 1.0.1 → 1.2.0
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/CuiBanner.vue.d.ts.map +1 -1
- package/dist/components/CuiBanner.vue.js +9 -8
- package/dist/components/CuiButton.vue.d.ts.map +1 -1
- package/dist/components/CuiButton.vue.js +1 -1
- package/dist/components/CuiButton.vue2.js +37 -36
- package/dist/components/CuiContainer.vue.d.ts +1 -1
- package/dist/components/CuiContainer.vue.d.ts.map +1 -1
- package/dist/components/CuiDataGridTable.vue.d.ts.map +1 -1
- package/dist/components/CuiFlex.vue.d.ts +1 -1
- package/dist/components/CuiFlex.vue.d.ts.map +1 -1
- package/dist/components/CuiIcon.vue.d.ts +14 -2
- package/dist/components/CuiIcon.vue.d.ts.map +1 -1
- package/dist/components/CuiIcon.vue.js +1 -1
- package/dist/components/CuiIcon.vue2.js +51 -30
- package/dist/components/CuiInputStepper.vue.d.ts +1 -1
- package/dist/components/CuiInputStepper.vue.d.ts.map +1 -1
- package/dist/components/CuiMaskedInput.vue.d.ts.map +1 -1
- package/dist/components/CuiModal.vue2.js +1 -1
- package/dist/components/CuiRadioGroup.vue2.js +1 -1
- package/dist/components/CuiRating.vue.d.ts +1 -1
- package/dist/components/CuiRating.vue.d.ts.map +1 -1
- package/dist/components/CuiSlideover.vue.js +1 -1
- package/dist/components/CuiTab.vue.d.ts.map +1 -1
- package/dist/components/CuiTab.vue.js +1 -1
- package/dist/components/CuiTab.vue2.js +41 -36
- package/dist/components/CuiTable.vue.d.ts +3 -3
- package/dist/components/CuiTable.vue.d.ts.map +1 -1
- package/dist/components/CuiTable.vue.js +58 -53
- package/dist/components/CuiTableCell.vue.d.ts +2 -1
- package/dist/components/CuiTableCell.vue.d.ts.map +1 -1
- package/dist/components/CuiTableCell.vue.js +4 -4
- package/dist/components/CuiTabs.vue.d.ts +2 -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 +127 -89
- package/dist/components/CuiTreeNode.vue.d.ts +1 -0
- package/dist/components/CuiTreeNode.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeNode.vue.js +28 -27
- package/dist/components/CuiTreeView.vue.d.ts.map +1 -1
- package/dist/components/CuiTreeView.vue.js +22 -22
- package/dist/components/tabs-context.d.ts +7 -1
- package/dist/components/tabs-context.d.ts.map +1 -1
- package/dist/composables/useColorScheme.d.ts +19 -0
- package/dist/composables/useColorScheme.d.ts.map +1 -0
- package/dist/composables/useColorScheme.js +38 -0
- package/dist/composables/useDataGridViews.d.ts.map +1 -1
- package/dist/composables/useDataGridViews.js +37 -35
- package/dist/composables/useDensity.d.ts.map +1 -1
- package/dist/composables/useDensity.js +19 -19
- package/dist/composables/useOverlay.d.ts.map +1 -1
- package/dist/composables/useOverlay.js +44 -36
- package/dist/composables/useTheme.d.ts.map +1 -1
- package/dist/composables/useTheme.js +17 -25
- package/dist/duplicate-guard.d.ts +17 -0
- package/dist/duplicate-guard.d.ts.map +1 -0
- package/dist/duplicate-guard.js +16 -0
- package/dist/icons/builtin.d.ts +67 -0
- package/dist/icons/builtin.d.ts.map +1 -0
- package/dist/icons/builtin.js +67 -0
- package/dist/icons/lazy.d.ts +8 -0
- package/dist/icons/lazy.d.ts.map +1 -0
- package/dist/icons/lazy.js +21 -0
- package/dist/icons/registry.d.ts +29 -0
- package/dist/icons/registry.d.ts.map +1 -0
- package/dist/icons/registry.js +30 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +161 -149
- package/dist/messages.d.ts +21 -1
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +10 -9
- package/dist/utils/devWarn.d.ts +1 -0
- package/dist/utils/devWarn.d.ts.map +1 -1
- package/dist/utils/devWarn.js +1 -0
- package/dist/utils/scrollLock.d.ts +22 -0
- package/dist/utils/scrollLock.d.ts.map +1 -0
- package/dist/utils/scrollLock.js +42 -0
- package/dist/utils/storage.d.ts +18 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/storage.js +27 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +4 -0
- package/package.json +21 -6
- package/dist/test-setup.d.ts +0 -2
- package/dist/test-setup.d.ts.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TableContextKey as
|
|
3
|
-
import { clampSize as
|
|
4
|
-
import { useScrollShadows as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}, V = ["aria-rowcount"], I = ["aria-rowcount"], Z = /* @__PURE__ */ z({
|
|
1
|
+
import { defineComponent as _, computed as i, provide as E, ref as m, onMounted as T, onBeforeUnmount as L, watch as O, withDirectives as D, openBlock as v, createElementBlock as h, createElementVNode as y, unref as l, normalizeStyle as u, normalizeClass as M, renderSlot as q, createCommentVNode as w, vShow as N } from "vue";
|
|
2
|
+
import { TableContextKey as P } from "./table-context.js";
|
|
3
|
+
import { clampSize as U } from "../utils/sizing.js";
|
|
4
|
+
import { useScrollShadows as V, scrollShadowRightStyle as X, scrollShadowBottomStyle as $ } from "../composables/useScrollShadows.js";
|
|
5
|
+
import { useMessages as A } from "../composables/useMessages.js";
|
|
6
|
+
import { warnOnce as F } from "../utils/devWarn.js";
|
|
7
|
+
const I = { style: { position: "relative" } }, K = ["role", "tabindex", "aria-label"], Z = ["aria-rowcount"], te = /* @__PURE__ */ _({
|
|
9
8
|
__name: "CuiTable",
|
|
10
9
|
props: {
|
|
11
10
|
striped: { type: Boolean, default: !1 },
|
|
@@ -19,15 +18,15 @@ const P = {
|
|
|
19
18
|
hidden: { type: Boolean, default: !1 },
|
|
20
19
|
size: { default: "md" }
|
|
21
20
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const e =
|
|
24
|
-
|
|
25
|
-
size:
|
|
26
|
-
stickyHeader:
|
|
21
|
+
setup(f, { expose: S }) {
|
|
22
|
+
const e = f, g = ["sm", "md", "lg"], p = i(() => U(e.size, g));
|
|
23
|
+
E(P, {
|
|
24
|
+
size: p,
|
|
25
|
+
stickyHeader: i(() => e.stickyHeader)
|
|
27
26
|
});
|
|
28
|
-
const
|
|
27
|
+
const x = i(() => [
|
|
29
28
|
"cui-table",
|
|
30
|
-
`cui-table--${
|
|
29
|
+
`cui-table--${p.value}`,
|
|
31
30
|
{
|
|
32
31
|
"cui-table--striped": e.striped,
|
|
33
32
|
"cui-table--hoverable": e.hoverable,
|
|
@@ -35,56 +34,62 @@ const P = {
|
|
|
35
34
|
"cui-table--sticky-header": e.stickyHeader,
|
|
36
35
|
"cui-table--fixed": e.fixedLayout
|
|
37
36
|
}
|
|
38
|
-
]),
|
|
39
|
-
if (!e.maxHeight && !e.minWidth) return;
|
|
40
|
-
const t = { overflow: "auto", position: "relative" };
|
|
41
|
-
return e.maxHeight && (t.maxHeight = e.maxHeight), t;
|
|
42
|
-
}), k = l(() => ({
|
|
37
|
+
]), k = i(() => ({
|
|
43
38
|
borderCollapse: "separate",
|
|
44
39
|
borderSpacing: "0",
|
|
45
40
|
minWidth: e.minWidth || void 0
|
|
46
|
-
})), { canScrollRight:
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
})), { canScrollRight: H, canScrollDown: B, onScroll: b, update: z } = V(), r = m(null), n = m(null), c = m(!1), s = i(() => !!e.maxHeight || c.value), W = i(() => {
|
|
42
|
+
const t = { position: "relative" };
|
|
43
|
+
return e.maxHeight ? (t.overflow = "auto", t.maxHeight = e.maxHeight) : c.value && (t.overflowX = "auto"), t;
|
|
44
|
+
});
|
|
45
|
+
function d() {
|
|
46
|
+
const t = r.value, a = n.value;
|
|
47
|
+
!t || !a || (c.value = Math.max(a.scrollWidth, a.offsetWidth) - t.clientWidth > 1, z(t), c.value && e.stickyHeader && !e.maxHeight && F(
|
|
48
|
+
"[clean-ui] CuiTable: stickyHeader with a horizontally overflowing table needs maxHeight. The scroll container required to contain the overflow also becomes the sticky header's scrollport, so the header can't stick to the viewport."
|
|
49
|
+
));
|
|
49
50
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
let o;
|
|
52
|
+
T(() => {
|
|
53
|
+
requestAnimationFrame(d), typeof ResizeObserver < "u" && (o = new ResizeObserver(d), r.value && o.observe(r.value), n.value && o.observe(n.value));
|
|
54
|
+
}), L(() => {
|
|
55
|
+
o == null || o.disconnect(), o = void 0;
|
|
56
|
+
}), O(() => [e.minWidth, e.maxHeight, e.fixedLayout], d, { flush: "post" });
|
|
57
|
+
const C = A();
|
|
58
|
+
return S({ scrollWrapper: r, measure: d }), (t, a) => D((v(), h("div", I, [
|
|
59
|
+
y("div", {
|
|
60
|
+
ref_key: "scrollWrapper",
|
|
61
|
+
ref: r,
|
|
53
62
|
class: "cui-table-wrapper",
|
|
54
|
-
style:
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
style: u(W.value),
|
|
64
|
+
role: s.value ? "region" : void 0,
|
|
65
|
+
tabindex: s.value ? 0 : void 0,
|
|
66
|
+
"aria-label": s.value ? l(C).table.scrollRegionLabel : void 0,
|
|
67
|
+
onScroll: a[0] || (a[0] = //@ts-ignore
|
|
68
|
+
(...R) => l(b) && l(b)(...R))
|
|
57
69
|
}, [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
y("table", {
|
|
71
|
+
ref_key: "tableEl",
|
|
72
|
+
ref: n,
|
|
73
|
+
class: M(x.value),
|
|
74
|
+
style: u(k.value),
|
|
75
|
+
"aria-rowcount": f.ariaRowcount
|
|
62
76
|
}, [
|
|
63
|
-
|
|
64
|
-
], 14,
|
|
65
|
-
],
|
|
66
|
-
|
|
77
|
+
q(t.$slots, "default")
|
|
78
|
+
], 14, Z)
|
|
79
|
+
], 44, K),
|
|
80
|
+
s.value && l(H) ? (v(), h("div", {
|
|
67
81
|
key: 0,
|
|
68
|
-
style:
|
|
69
|
-
}, null, 4)) :
|
|
70
|
-
|
|
82
|
+
style: u(l(X))
|
|
83
|
+
}, null, 4)) : w("", !0),
|
|
84
|
+
s.value && l(B) ? (v(), h("div", {
|
|
71
85
|
key: 1,
|
|
72
|
-
style:
|
|
73
|
-
}, null, 4)) :
|
|
86
|
+
style: u(l($))
|
|
87
|
+
}, null, 4)) : w("", !0)
|
|
74
88
|
], 512)), [
|
|
75
|
-
[
|
|
76
|
-
]) : f((r(), i("table", {
|
|
77
|
-
key: 1,
|
|
78
|
-
class: y(d.value),
|
|
79
|
-
style: { "border-collapse": "separate", "border-spacing": "0" },
|
|
80
|
-
"aria-rowcount": o.ariaRowcount
|
|
81
|
-
}, [
|
|
82
|
-
h(t.$slots, "default")
|
|
83
|
-
], 10, I)), [
|
|
84
|
-
[v, !o.hidden]
|
|
89
|
+
[N, !f.hidden]
|
|
85
90
|
]);
|
|
86
91
|
}
|
|
87
92
|
});
|
|
88
93
|
export {
|
|
89
|
-
|
|
94
|
+
te as default
|
|
90
95
|
};
|
|
@@ -19,8 +19,9 @@ type __VLS_Slots = {} & {
|
|
|
19
19
|
default?: (props: typeof __VLS_6) => any;
|
|
20
20
|
};
|
|
21
21
|
declare const __VLS_component: import("vue").DefineComponent<CuiTableCellProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CuiTableCellProps> & Readonly<{}>, {
|
|
22
|
-
|
|
22
|
+
header: boolean;
|
|
23
23
|
hidden: boolean;
|
|
24
|
+
nowrap: boolean;
|
|
24
25
|
align: TableCellAlign;
|
|
25
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
27
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTableCell.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableCell.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTableCell.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTableCell.vue"],"names":[],"mappings":"AAkEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB;IACrB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAoED,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAuB/C,QAAA,MAAM,eAAe;YAxGV,OAAO;;YAUP,OAAO;WARR,cAAc;6EA6GtB,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 s, inject as
|
|
1
|
+
import { defineComponent as s, inject as d, computed as n, withDirectives as c, openBlock as p, createBlock as f, resolveDynamicComponent as u, normalizeStyle as h, withCtx as w, renderSlot as m, vShow as v } from "vue";
|
|
2
2
|
import { TableSectionContextKey as y } from "./table-context.js";
|
|
3
3
|
const B = /* @__PURE__ */ s({
|
|
4
4
|
__name: "CuiTableCell",
|
|
5
5
|
props: {
|
|
6
|
-
header: { type: Boolean },
|
|
6
|
+
header: { type: Boolean, default: void 0 },
|
|
7
7
|
align: { default: "left" },
|
|
8
8
|
width: {},
|
|
9
9
|
colspan: {},
|
|
@@ -12,11 +12,11 @@ const B = /* @__PURE__ */ s({
|
|
|
12
12
|
hidden: { type: Boolean, default: !1 }
|
|
13
13
|
},
|
|
14
14
|
setup(o) {
|
|
15
|
-
const e = o, a =
|
|
15
|
+
const e = o, a = d(y, void 0), l = n(() => e.header !== void 0 ? e.header : (a == null ? void 0 : a.isHead) ?? !1), i = n(() => l.value ? "th" : "td"), r = n(() => {
|
|
16
16
|
const t = {};
|
|
17
17
|
return e.align !== "left" && (t.textAlign = e.align), e.width && (t.width = e.width), e.nowrap && (t.whiteSpace = "nowrap"), t;
|
|
18
18
|
});
|
|
19
|
-
return (t, C) =>
|
|
19
|
+
return (t, C) => c((p(), f(u(i.value), {
|
|
20
20
|
style: h(r.value),
|
|
21
21
|
colspan: o.colspan,
|
|
22
22
|
rowspan: o.rowspan,
|
|
@@ -12,9 +12,9 @@ export interface CuiTabsProps extends HideableProps, ColorableProps {
|
|
|
12
12
|
/** Panel transition animation */
|
|
13
13
|
transition?: TabTransition;
|
|
14
14
|
}
|
|
15
|
-
declare var
|
|
15
|
+
declare var __VLS_8: {};
|
|
16
16
|
type __VLS_Slots = {} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_8) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<CuiTabsProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
20
|
"update:modelValue": (value: string) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTabs.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTabs.vue"],"names":[],"mappings":"AA2fA,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGrE,MAAM,WAAW,YAAa,SAAQ,aAAa,EAAE,cAAc;IACjE,uBAAuB;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iCAAiC;IACjC,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B;AA2WD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAgC/C,QAAA,MAAM,eAAe;;;;;;;;;aApZT,UAAU;iBAEN,cAAc;gBAIf,aAAa;eAFd,OAAO;6EAwZnB,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 "./CuiTabs.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ed16f53a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { TabsContextKey as
|
|
4
|
-
import { useMessages as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as b, watch as _, provide as K, toRef as m, onMounted as M, nextTick as S, onBeforeUnmount as N, computed as L, withDirectives as O, openBlock as v, createElementBlock as h, normalizeClass as T, createElementVNode as k, Fragment as $, renderList as U, normalizeStyle as W, createBlock as q, resolveDynamicComponent as F, createTextVNode as j, toDisplayString as G, withModifiers as J, unref as P, createVNode as Q, createCommentVNode as X, renderSlot as Y, vShow as Z } from "vue";
|
|
2
|
+
import ee from "./CuiIcon.vue.js";
|
|
3
|
+
import { TabsContextKey as te } from "./tabs-context.js";
|
|
4
|
+
import { useMessages as ae } from "../composables/useMessages.js";
|
|
5
|
+
const oe = { class: "cui-tabs__bar-outer" }, le = ["aria-orientation", "data-overflow"], ne = ["data-cui-tab-value", "aria-selected", "aria-disabled", "tabindex", "onClick"], ie = { class: "cui-tabs__tab-content" }, re = ["aria-label", "onClick"], ue = { class: "cui-tabs__panels" }, fe = /* @__PURE__ */ H({
|
|
6
6
|
__name: "CuiTabs",
|
|
7
7
|
props: {
|
|
8
8
|
modelValue: {},
|
|
@@ -14,111 +14,149 @@ const J = ["aria-orientation"], O = ["data-cui-tab-value", "aria-selected", "ari
|
|
|
14
14
|
color: { default: "primary" }
|
|
15
15
|
},
|
|
16
16
|
emits: ["update:modelValue", "close"],
|
|
17
|
-
setup(
|
|
18
|
-
const n =
|
|
19
|
-
|
|
17
|
+
setup(r, { emit: A }) {
|
|
18
|
+
const n = r, x = A, o = b(n.modelValue ?? ""), p = b(""), l = b([]), f = b(null);
|
|
19
|
+
_(
|
|
20
20
|
() => n.modelValue,
|
|
21
21
|
(e) => {
|
|
22
|
-
e !== void 0 && e !==
|
|
22
|
+
e !== void 0 && e !== o.value && (p.value = o.value, o.value = e);
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
function
|
|
26
|
-
|
|
25
|
+
function D(e) {
|
|
26
|
+
const a = l.value.findIndex((t) => t.value === e.value);
|
|
27
|
+
a >= 0 ? l.value[a] = e : l.value.push(e), !o.value && !e.disabled && (o.value = e.value, x("update:modelValue", e.value));
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
29
|
+
function B(e) {
|
|
30
|
+
l.value = l.value.filter((a) => a.value !== e);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
const a =
|
|
33
|
-
a != null && a.disabled || (
|
|
32
|
+
function w(e) {
|
|
33
|
+
const a = l.value.find((t) => t.value === e);
|
|
34
|
+
a != null && a.disabled || (p.value = o.value, o.value = e, x("update:modelValue", e));
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
36
|
+
function V(e) {
|
|
37
|
+
x("close", e);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
activeTab:
|
|
40
|
-
variant:
|
|
41
|
-
orientation:
|
|
42
|
-
color:
|
|
43
|
-
keepAlive:
|
|
44
|
-
transition:
|
|
45
|
-
previousTab:
|
|
46
|
-
register:
|
|
47
|
-
unregister:
|
|
48
|
-
activate:
|
|
49
|
-
close:
|
|
39
|
+
K(te, {
|
|
40
|
+
activeTab: o,
|
|
41
|
+
variant: m(n, "variant"),
|
|
42
|
+
orientation: m(n, "orientation"),
|
|
43
|
+
color: m(n, "color"),
|
|
44
|
+
keepAlive: m(n, "keepAlive"),
|
|
45
|
+
transition: m(n, "transition"),
|
|
46
|
+
previousTab: p,
|
|
47
|
+
register: D,
|
|
48
|
+
unregister: B,
|
|
49
|
+
activate: w,
|
|
50
|
+
close: V
|
|
50
51
|
});
|
|
51
|
-
function
|
|
52
|
-
const a =
|
|
52
|
+
function E(e) {
|
|
53
|
+
const a = l.value.filter((d) => !d.disabled), t = a.findIndex((d) => d.value === o.value);
|
|
53
54
|
if (t < 0) return;
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
e.key ===
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
);
|
|
60
|
-
r == null || r.focus();
|
|
55
|
+
const u = n.orientation === "horizontal", y = u ? "ArrowRight" : "ArrowDown", I = u ? "ArrowLeft" : "ArrowUp";
|
|
56
|
+
let i = -1;
|
|
57
|
+
e.key === y ? (e.preventDefault(), i = t < a.length - 1 ? t + 1 : 0) : e.key === I ? (e.preventDefault(), i = t > 0 ? t - 1 : a.length - 1) : e.key === "Home" ? (e.preventDefault(), i = 0) : e.key === "End" && (e.preventDefault(), i = a.length - 1), i >= 0 && (w(a[i].value), S(() => {
|
|
58
|
+
var d;
|
|
59
|
+
(d = C(a[i].value)) == null || d.focus();
|
|
61
60
|
}));
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return
|
|
62
|
+
function C(e) {
|
|
63
|
+
var a;
|
|
64
|
+
return ((a = f.value) == null ? void 0 : a.querySelector(`[data-cui-tab-value="${e}"]`)) ?? null;
|
|
65
|
+
}
|
|
66
|
+
const g = b("none");
|
|
67
|
+
function s() {
|
|
68
|
+
const e = f.value;
|
|
69
|
+
if (!e) return;
|
|
70
|
+
const a = n.orientation === "horizontal", t = a ? e.clientWidth : e.clientHeight, u = a ? e.scrollWidth : e.scrollHeight, y = Math.abs(a ? e.scrollLeft : e.scrollTop);
|
|
71
|
+
if (u - t <= 1) {
|
|
72
|
+
g.value = "none";
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const I = y <= 1, i = y >= u - t - 1;
|
|
76
|
+
g.value = I ? "end" : i ? "start" : "both";
|
|
77
|
+
}
|
|
78
|
+
function z() {
|
|
79
|
+
var e, a;
|
|
80
|
+
(a = (e = C(o.value)) == null ? void 0 : e.scrollIntoView) == null || a.call(e, { inline: "nearest", block: "nearest" });
|
|
81
|
+
}
|
|
82
|
+
let c;
|
|
83
|
+
M(() => {
|
|
84
|
+
S(() => {
|
|
85
|
+
z(), s();
|
|
86
|
+
}), typeof ResizeObserver < "u" && f.value && (c = new ResizeObserver(s), c.observe(f.value));
|
|
87
|
+
}), N(() => {
|
|
88
|
+
c == null || c.disconnect(), c = void 0;
|
|
89
|
+
}), _(o, () => {
|
|
90
|
+
z(), s();
|
|
91
|
+
}, { flush: "post" }), _(() => l.value.length, s, { flush: "post" }), _(() => n.orientation, s, { flush: "post" }), L(() => {
|
|
92
|
+
const e = l.value.findIndex((t) => t.value === p.value);
|
|
93
|
+
return l.value.findIndex((t) => t.value === o.value) >= e ? "left" : "right";
|
|
66
94
|
});
|
|
67
|
-
const
|
|
68
|
-
return (e, a) =>
|
|
69
|
-
class:
|
|
70
|
-
`cui-tabs--${
|
|
71
|
-
`cui-tabs--${
|
|
95
|
+
const R = ae();
|
|
96
|
+
return (e, a) => O((v(), h("div", {
|
|
97
|
+
class: T(["cui-tabs", [
|
|
98
|
+
`cui-tabs--${r.variant}`,
|
|
99
|
+
`cui-tabs--${r.orientation}`
|
|
72
100
|
]])
|
|
73
101
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"cui-tabs__tab--active": l.value === t.value,
|
|
85
|
-
"cui-tabs__tab--disabled": t.disabled
|
|
86
|
-
}]),
|
|
87
|
-
style: K({
|
|
88
|
-
"--_tab-color": `var(--cui-${o.color})`,
|
|
89
|
-
"--_tab-hover": `var(--cui-${o.color}-hover)`,
|
|
90
|
-
"--_tab-bg": `var(--cui-${o.color}-bg)`
|
|
91
|
-
}),
|
|
92
|
-
role: "tab",
|
|
93
|
-
"aria-selected": l.value === t.value,
|
|
94
|
-
"aria-disabled": t.disabled || void 0,
|
|
95
|
-
tabindex: l.value === t.value ? 0 : -1,
|
|
96
|
-
onClick: (d) => m(t.value)
|
|
102
|
+
k("div", oe, [
|
|
103
|
+
k("div", {
|
|
104
|
+
ref_key: "barRef",
|
|
105
|
+
ref: f,
|
|
106
|
+
class: "cui-tabs__bar",
|
|
107
|
+
role: "tablist",
|
|
108
|
+
"aria-orientation": r.orientation,
|
|
109
|
+
"data-overflow": g.value,
|
|
110
|
+
onKeydown: E,
|
|
111
|
+
onScroll: s
|
|
97
112
|
}, [
|
|
98
|
-
h(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
113
|
+
(v(!0), h($, null, U(l.value, (t) => (v(), h("button", {
|
|
114
|
+
key: t.value,
|
|
115
|
+
"data-cui-tab-value": t.value,
|
|
116
|
+
class: T(["cui-tabs__tab", {
|
|
117
|
+
"cui-tabs__tab--active": o.value === t.value,
|
|
118
|
+
"cui-tabs__tab--disabled": t.disabled
|
|
119
|
+
}]),
|
|
120
|
+
style: W({
|
|
121
|
+
"--_tab-color": `var(--cui-${r.color})`,
|
|
122
|
+
"--_tab-hover": `var(--cui-${r.color}-hover)`,
|
|
123
|
+
"--_tab-bg": `var(--cui-${r.color}-bg)`
|
|
124
|
+
}),
|
|
125
|
+
role: "tab",
|
|
126
|
+
"aria-selected": o.value === t.value,
|
|
127
|
+
"aria-disabled": t.disabled || void 0,
|
|
128
|
+
tabindex: o.value === t.value ? 0 : -1,
|
|
129
|
+
onClick: (u) => w(t.value)
|
|
106
130
|
}, [
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
131
|
+
k("span", ie, [
|
|
132
|
+
t.labelSlot ? (v(), q(F(t.labelSlot), { key: 0 })) : (v(), h($, { key: 1 }, [
|
|
133
|
+
j(G(t.label), 1)
|
|
134
|
+
], 64))
|
|
135
|
+
]),
|
|
136
|
+
t.closeable ? (v(), h("button", {
|
|
137
|
+
key: 0,
|
|
138
|
+
type: "button",
|
|
139
|
+
class: "cui-tabs__tab-close",
|
|
140
|
+
"aria-label": P(R).tabs.closeTab,
|
|
141
|
+
tabindex: "-1",
|
|
142
|
+
onClick: J((u) => V(t.value), ["stop"])
|
|
143
|
+
}, [
|
|
144
|
+
Q(ee, {
|
|
145
|
+
name: "x",
|
|
146
|
+
size: "0.75rem"
|
|
147
|
+
})
|
|
148
|
+
], 8, re)) : X("", !0)
|
|
149
|
+
], 14, ne))), 128))
|
|
150
|
+
], 40, le)
|
|
151
|
+
]),
|
|
152
|
+
k("div", ue, [
|
|
153
|
+
Y(e.$slots, "default", {}, void 0, !0)
|
|
116
154
|
])
|
|
117
155
|
], 2)), [
|
|
118
|
-
[
|
|
156
|
+
[Z, !r.hidden]
|
|
119
157
|
]);
|
|
120
158
|
}
|
|
121
159
|
});
|
|
122
160
|
export {
|
|
123
|
-
|
|
161
|
+
fe as default
|
|
124
162
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTreeNode.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTreeNode.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTreeNode.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTreeNode.vue"],"names":[],"mappings":"AAiOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1G,CAAC;AAiQF,QAAA,IAAI,OAAO;;;;;CAAU,EAAE,QAAQ,KAAY,CAAE;AAC7C,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GACzC;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAiC7C,QAAA,MAAM,eAAe;;;;;;kFAOnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as I, computed as y, ref as b, watch as E, nextTick as H, resolveComponent as R, openBlock as n, createElementBlock as o, normalizeStyle as l, createCommentVNode as c, createElementVNode as
|
|
2
|
-
import
|
|
3
|
-
const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } },
|
|
1
|
+
import { defineComponent as I, computed as y, ref as b, watch as E, nextTick as H, resolveComponent as R, openBlock as n, createElementBlock as o, normalizeStyle as l, createCommentVNode as c, createElementVNode as $, createBlock as k, renderSlot as w, createTextVNode as Y, toDisplayString as V, Fragment as F, renderList as P, withCtx as W, mergeProps as X } from "vue";
|
|
2
|
+
import z from "./CuiIcon.vue.js";
|
|
3
|
+
const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } }, S = "var(--cui-border-strong, var(--cui-border))", O = /* @__PURE__ */ I({
|
|
4
4
|
__name: "CuiTreeNode",
|
|
5
5
|
props: {
|
|
6
6
|
node: {},
|
|
@@ -14,14 +14,14 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
14
14
|
cfg: {}
|
|
15
15
|
},
|
|
16
16
|
emits: ["toggle-expand", "select-node"],
|
|
17
|
-
setup(e, { emit:
|
|
18
|
-
const t = e, r =
|
|
19
|
-
E(u, (
|
|
17
|
+
setup(e, { emit: C }) {
|
|
18
|
+
const t = e, r = C, s = y(() => t.node.children && t.node.children.length > 0), u = y(() => t.expanded.has(t.node.id)), v = y(() => t.selectedSet.has(t.node.id)), f = b(null), i = b(void 0), h = b(u.value);
|
|
19
|
+
E(u, (a) => {
|
|
20
20
|
if (!t.animated) {
|
|
21
|
-
h.value =
|
|
21
|
+
h.value = a;
|
|
22
22
|
return;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
a ? (h.value = !0, i.value = "0px", H(() => {
|
|
25
25
|
f.value && (i.value = f.value.scrollHeight + "px", setTimeout(() => {
|
|
26
26
|
i.value = void 0;
|
|
27
27
|
}, 250));
|
|
@@ -31,14 +31,14 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
31
31
|
}, 250);
|
|
32
32
|
}));
|
|
33
33
|
});
|
|
34
|
-
function L(
|
|
35
|
-
|
|
34
|
+
function L(a) {
|
|
35
|
+
a.stopPropagation(), r("toggle-expand", t.node);
|
|
36
36
|
}
|
|
37
37
|
function T() {
|
|
38
38
|
s.value && !t.selectable ? r("toggle-expand", t.node) : r("select-node", t.node);
|
|
39
39
|
}
|
|
40
40
|
const m = y(() => t.cfg.padX);
|
|
41
|
-
return (
|
|
41
|
+
return (a, d) => {
|
|
42
42
|
const B = R("CuiTreeNode", !0);
|
|
43
43
|
return n(), o("div", {
|
|
44
44
|
role: "treeitem",
|
|
@@ -53,7 +53,7 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
53
53
|
top: "0",
|
|
54
54
|
bottom: "0",
|
|
55
55
|
width: "0",
|
|
56
|
-
borderLeft: `1px solid ${
|
|
56
|
+
borderLeft: `1px solid ${S}`,
|
|
57
57
|
zIndex: "0"
|
|
58
58
|
})
|
|
59
59
|
}, null, 4)) : c("", !0),
|
|
@@ -65,7 +65,7 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
65
65
|
top: "0",
|
|
66
66
|
height: `calc(${e.cfg.padY} + 0.625em)`,
|
|
67
67
|
width: "0",
|
|
68
|
-
borderLeft: `1px solid ${
|
|
68
|
+
borderLeft: `1px solid ${S}`,
|
|
69
69
|
zIndex: "0"
|
|
70
70
|
})
|
|
71
71
|
}, null, 4)) : c("", !0),
|
|
@@ -77,11 +77,11 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
77
77
|
top: `calc(${e.cfg.padY} + 0.625em)`,
|
|
78
78
|
width: `calc(${e.cfg.indent} * 0.5)`,
|
|
79
79
|
height: "0",
|
|
80
|
-
borderTop: `1px solid ${
|
|
80
|
+
borderTop: `1px solid ${S}`,
|
|
81
81
|
zIndex: "0"
|
|
82
82
|
})
|
|
83
83
|
}, null, 4)) : c("", !0),
|
|
84
|
-
|
|
84
|
+
$("div", {
|
|
85
85
|
style: l({
|
|
86
86
|
display: "flex",
|
|
87
87
|
alignItems: "center",
|
|
@@ -103,10 +103,11 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
103
103
|
}),
|
|
104
104
|
onClick: T
|
|
105
105
|
}, [
|
|
106
|
-
|
|
106
|
+
$("div", {
|
|
107
107
|
style: l({
|
|
108
|
-
width: e.cfg.
|
|
109
|
-
height: e.cfg.
|
|
108
|
+
width: e.cfg.hitSize,
|
|
109
|
+
height: e.cfg.hitSize,
|
|
110
|
+
marginLeft: `calc((${e.cfg.iconSize} - ${e.cfg.hitSize}) / 2)`,
|
|
110
111
|
display: "flex",
|
|
111
112
|
alignItems: "center",
|
|
112
113
|
justifyContent: "center",
|
|
@@ -114,23 +115,23 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
114
115
|
transition: "transform 0.15s ease",
|
|
115
116
|
transform: u.value ? "rotate(90deg)" : "rotate(0deg)"
|
|
116
117
|
}),
|
|
117
|
-
onClick:
|
|
118
|
+
onClick: d[0] || (d[0] = (x) => s.value && L(x))
|
|
118
119
|
}, [
|
|
119
|
-
s.value ? (n(),
|
|
120
|
+
s.value ? (n(), k(z, {
|
|
120
121
|
key: 0,
|
|
121
122
|
name: "caret-right",
|
|
122
123
|
size: e.cfg.iconSize,
|
|
123
124
|
style: { color: "var(--cui-text-tertiary)" }
|
|
124
125
|
}, null, 8, ["size"])) : c("", !0)
|
|
125
126
|
], 4),
|
|
126
|
-
e.node.icon ? (n(),
|
|
127
|
+
e.node.icon ? (n(), k(z, {
|
|
127
128
|
key: 0,
|
|
128
129
|
name: e.node.icon,
|
|
129
130
|
size: e.cfg.iconSize,
|
|
130
131
|
style: l({ flexShrink: "0", color: v.value ? "var(--cui-primary)" : "var(--cui-text-secondary)" })
|
|
131
132
|
}, null, 8, ["name", "size", "style"])) : c("", !0),
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
$("div", q, [
|
|
134
|
+
w(a.$slots, "node", {
|
|
134
135
|
node: e.node,
|
|
135
136
|
selected: v.value,
|
|
136
137
|
expanded: u.value,
|
|
@@ -151,7 +152,7 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
151
152
|
transition: e.animated ? "max-height 0.25s ease" : void 0
|
|
152
153
|
})
|
|
153
154
|
}, [
|
|
154
|
-
(n(!0), o(F, null, P(e.node.children, (x, N) => (n(),
|
|
155
|
+
(n(!0), o(F, null, P(e.node.children, (x, N) => (n(), k(B, {
|
|
155
156
|
key: String(x.id),
|
|
156
157
|
node: x,
|
|
157
158
|
depth: e.depth + 1,
|
|
@@ -162,11 +163,11 @@ const j = ["aria-expanded"], q = { style: { flex: "1", minWidth: "0", overflow:
|
|
|
162
163
|
"show-lines": e.showLines,
|
|
163
164
|
animated: e.animated,
|
|
164
165
|
cfg: e.cfg,
|
|
165
|
-
onToggleExpand:
|
|
166
|
-
onSelectNode:
|
|
166
|
+
onToggleExpand: d[1] || (d[1] = (g) => r("toggle-expand", g)),
|
|
167
|
+
onSelectNode: d[2] || (d[2] = (g) => r("select-node", g))
|
|
167
168
|
}, {
|
|
168
169
|
node: W((g) => [
|
|
169
|
-
|
|
170
|
+
w(a.$slots, "node", X({ ref_for: !0 }, g))
|
|
170
171
|
]),
|
|
171
172
|
_: 3
|
|
172
173
|
}, 8, ["node", "depth", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg"]))), 128))
|