@itguy614/clean-ui 1.0.1 → 1.1.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/CuiDataGridTable.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/CuiRating.vue.d.ts +1 -1
- package/dist/components/CuiRating.vue.d.ts.map +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 +1 -0
- 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/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/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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +124 -117
- package/dist/messages.d.ts +4 -0
- 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/package.json +7 -2
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { type Component } from "vue";
|
|
1
2
|
import type { CuiSize, CuiColorOrCss, HideableProps } from "../types/common";
|
|
2
3
|
export type IconWeight = "thin" | "light" | "regular" | "bold" | "fill" | "duotone";
|
|
3
4
|
export type IconSize = CuiSize | (string & {});
|
|
4
5
|
export interface CuiIconProps extends HideableProps {
|
|
5
|
-
/**
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Phosphor icon name in kebab-case (e.g. "check", "warning-circle").
|
|
8
|
+
* Resolved from the built-in set and anything passed to `registerIcons()`.
|
|
9
|
+
* An unregistered name still renders, via a lazy import of the whole Phosphor
|
|
10
|
+
* package — which is not tree-shakeable, so it warns in the console.
|
|
11
|
+
*/
|
|
12
|
+
name?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A Phosphor component passed directly, e.g. `:icon="PhRocket"`. The simplest
|
|
15
|
+
* tree-shakeable path — the consumer's own static import. Takes precedence
|
|
16
|
+
* over `name`.
|
|
17
|
+
*/
|
|
18
|
+
icon?: Component;
|
|
7
19
|
/** Icon weight/style */
|
|
8
20
|
weight?: IconWeight;
|
|
9
21
|
/** Icon size — named scale (xs–xl) or custom CSS value */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiIcon.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiIcon.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiIcon.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiIcon.vue"],"names":[],"mappings":"AAoNA,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAU7E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AACpF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAE/C,MAAM,WAAW,YAAa,SAAQ,aAAa;IACjD;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,uEAAuE;IACvE,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;;;YATU,UAAU;UAEZ,QAAQ;WAEP,aAAa;oBAIJ,MAAM;;AAuMzB,wBAOG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./CuiIcon.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b9c50b01"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { resolveColor as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as I, computed as r, shallowRef as k, toRaw as z, watchEffect as p, withDirectives as $, openBlock as u, createElementBlock as h, normalizeStyle as v, normalizeClass as R, createBlock as B, resolveDynamicComponent as O, unref as S, vShow as x } from "vue";
|
|
2
|
+
import { resolveColor as F } from "../utils/color.js";
|
|
3
|
+
import { resolveRegisteredIcon as b, getIconFallbackResolver as A } from "../icons/registry.js";
|
|
4
|
+
import { FALLBACK_ICON as s } from "../icons/builtin.js";
|
|
5
|
+
import { warnOnce as l } from "../utils/devWarn.js";
|
|
6
|
+
const U = /* @__PURE__ */ I({
|
|
4
7
|
__name: "CuiIcon",
|
|
5
8
|
props: {
|
|
6
9
|
name: {},
|
|
10
|
+
icon: {},
|
|
7
11
|
weight: { default: "regular" },
|
|
8
12
|
size: { default: "md" },
|
|
9
13
|
color: { default: "currentColor" },
|
|
@@ -12,7 +16,7 @@ const D = /* @__PURE__ */ w({
|
|
|
12
16
|
hidden: { type: Boolean, default: !1 }
|
|
13
17
|
},
|
|
14
18
|
setup(n) {
|
|
15
|
-
const o = n,
|
|
19
|
+
const o = n, w = {
|
|
16
20
|
xs: "0.875rem",
|
|
17
21
|
// 14px
|
|
18
22
|
sm: "1rem",
|
|
@@ -23,50 +27,67 @@ const D = /* @__PURE__ */ w({
|
|
|
23
27
|
// 24px
|
|
24
28
|
xl: "2rem"
|
|
25
29
|
// 32px
|
|
26
|
-
},
|
|
27
|
-
function
|
|
28
|
-
return "Ph" + e.split("-").map((
|
|
30
|
+
}, c = r(() => w[o.size] ?? o.size);
|
|
31
|
+
function a(e) {
|
|
32
|
+
return "Ph" + e.split("-").map((i) => i.charAt(0).toUpperCase() + i.slice(1)).join("");
|
|
29
33
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const t = k(null), d = r(() => o.icon ? z(o.icon) : o.name ? b(o.name) ?? null : null), m = r(() => d.value ?? t.value);
|
|
35
|
+
function y(e) {
|
|
36
|
+
l(
|
|
37
|
+
`[CuiIcon] unknown icon "${e}". Register it so it ships with your bundle:
|
|
38
|
+
import { registerIcons } from "@itguy614/clean-ui";
|
|
39
|
+
import { ${a(e)} } from "@phosphor-icons/vue";
|
|
40
|
+
registerIcons({ "${e}": ${a(e)} });
|
|
41
|
+
Or, to resolve any name at runtime (pulls in the whole icon package):
|
|
42
|
+
import "@itguy614/clean-ui/icons/lazy";`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
async function g(e, i) {
|
|
37
46
|
try {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
c || (console.warn(`[CuiIcon] Icon "${e}" (${t}) not found in @phosphor-icons/vue`), c = u.PhQuestion), i.set(t, c), o.name === e && (l.value = c);
|
|
47
|
+
const f = await i(e);
|
|
48
|
+
f || l(`[CuiIcon] Icon "${e}" (${a(e)}) not found in @phosphor-icons/vue`), o.name === e && (t.value = f ?? s);
|
|
41
49
|
} catch {
|
|
42
|
-
|
|
50
|
+
l(`[CuiIcon] Failed to load icon "${e}"`), o.name === e && (t.value = s);
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
p(() => {
|
|
54
|
+
if (d.value || !o.name) {
|
|
55
|
+
t.value = null;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const e = A();
|
|
59
|
+
if (!e) {
|
|
60
|
+
y(o.name), t.value = s;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
typeof window > "u" || g(o.name, e);
|
|
64
|
+
}), p(() => {
|
|
65
|
+
!o.name && !o.icon && l("[CuiIcon] requires either a `name` or an `icon` prop.");
|
|
66
|
+
});
|
|
67
|
+
const C = r(() => {
|
|
47
68
|
const e = {};
|
|
48
69
|
return o.weight === "duotone" && (o.duotoneColor && (e["--_duotone-color"] = o.duotoneColor), e["--_duotone-opacity"] = String(o.duotoneOpacity)), e;
|
|
49
70
|
});
|
|
50
|
-
return (e,
|
|
51
|
-
class:
|
|
52
|
-
style:
|
|
71
|
+
return (e, i) => $((u(), h("span", {
|
|
72
|
+
class: R(["cui-icon", { "cui-icon--duotone": n.weight === "duotone" }]),
|
|
73
|
+
style: v(C.value)
|
|
53
74
|
}, [
|
|
54
|
-
|
|
75
|
+
m.value ? (u(), B(O(m.value), {
|
|
55
76
|
key: 0,
|
|
56
77
|
weight: n.weight,
|
|
57
|
-
size:
|
|
58
|
-
color:
|
|
59
|
-
}, null, 8, ["weight", "size", "color"])) : (
|
|
78
|
+
size: c.value,
|
|
79
|
+
color: S(F)(n.color)
|
|
80
|
+
}, null, 8, ["weight", "size", "color"])) : (u(), h("span", {
|
|
60
81
|
key: 1,
|
|
61
82
|
class: "cui-icon__placeholder",
|
|
62
|
-
style:
|
|
83
|
+
style: v({ width: c.value, height: c.value }),
|
|
63
84
|
"aria-hidden": "true"
|
|
64
85
|
}, null, 4))
|
|
65
86
|
], 6)), [
|
|
66
|
-
[
|
|
87
|
+
[x, !n.hidden]
|
|
67
88
|
]);
|
|
68
89
|
}
|
|
69
90
|
});
|
|
70
91
|
export {
|
|
71
|
-
|
|
92
|
+
U as default
|
|
72
93
|
};
|
|
@@ -34,10 +34,10 @@ declare const _default: import("vue").DefineComponent<CuiRatingProps, {
|
|
|
34
34
|
hidden: boolean;
|
|
35
35
|
size: CuiSize;
|
|
36
36
|
color: CuiColor;
|
|
37
|
+
icon: string;
|
|
37
38
|
disabled: boolean;
|
|
38
39
|
modelValue: number;
|
|
39
40
|
clearable: boolean;
|
|
40
|
-
icon: string;
|
|
41
41
|
max: number;
|
|
42
42
|
showValue: boolean;
|
|
43
43
|
half: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiRating.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiRating.vue"],"names":[],"mappings":"AAoMA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIzH,MAAM,WAAW,cAAe,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IACpG,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AA4GD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;cAzHY,OAAO
|
|
1
|
+
{"version":3,"file":"CuiRating.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiRating.vue"],"names":[],"mappings":"AAoMA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAIzH,MAAM,WAAW,cAAe,SAAQ,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB;IACpG,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AA4GD,iBAAS,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,QAEjC;AAED,iBAAS,IAAI,SAEZ;;;;;;;;;;cAzHY,OAAO;;;;UAJX,MAAM;;gBANA,MAAM;eAgBP,OAAO;SAdb,MAAM;eAUA,OAAO;UARZ,OAAO;cAIH,MAAM;;AAuPnB,wBASG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTab.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTab.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTab.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTab.vue"],"names":[],"mappings":"AA8JA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEvE,MAAM,WAAW,WAAY,SAAQ,aAAa,EAAE,gBAAgB;IAClE,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkHD,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;AAsB/C,QAAA,MAAM,eAAe;;;eA5IP,OAAO;6EAmJnB,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 "./CuiTab.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-57a89561"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { TabsContextKey as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as h, inject as y, computed as s, useSlots as x, onMounted as C, watch as T, onUnmounted as k, unref as w, withDirectives as c, openBlock as b, createElementBlock as v, normalizeClass as f, renderSlot as m, vShow as p, createCommentVNode as B } from "vue";
|
|
2
|
+
import { TabsContextKey as S } from "./tabs-context.js";
|
|
3
|
+
const g = ["aria-labelledby"], E = ["aria-labelledby"], $ = /* @__PURE__ */ h({
|
|
4
4
|
__name: "CuiTab",
|
|
5
5
|
props: {
|
|
6
6
|
value: {},
|
|
@@ -10,64 +10,69 @@ const k = ["aria-labelledby"], w = ["aria-labelledby"], I = /* @__PURE__ */ m({
|
|
|
10
10
|
disabled: { type: Boolean, default: !1 }
|
|
11
11
|
},
|
|
12
12
|
setup(n) {
|
|
13
|
-
const e = n, a =
|
|
13
|
+
const e = n, a = y(S);
|
|
14
14
|
if (!a)
|
|
15
15
|
throw new Error("[CuiTab] must be used inside a <CuiTabs> component.");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const o = s(() => a.activeTab.value === e.value), i = x();
|
|
17
|
+
function r() {
|
|
18
|
+
return {
|
|
19
19
|
value: e.value,
|
|
20
20
|
label: e.label,
|
|
21
21
|
disabled: e.disabled,
|
|
22
|
-
closeable: e.closeable
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
closeable: e.closeable,
|
|
23
|
+
// Call through `slots` rather than capturing the slot function, so the
|
|
24
|
+
// parent's render always invokes the current one — a badge count in the
|
|
25
|
+
// slot updates without re-registering the tab.
|
|
26
|
+
labelSlot: i.label ? () => {
|
|
27
|
+
var l;
|
|
28
|
+
return (l = i.label) == null ? void 0 : l.call(i);
|
|
29
|
+
} : void 0
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
C(() => {
|
|
33
|
+
a.register(r());
|
|
34
|
+
}), T(
|
|
35
|
+
() => [e.label, e.disabled, e.closeable, !!i.label],
|
|
26
36
|
() => {
|
|
27
|
-
a.
|
|
28
|
-
value: e.value,
|
|
29
|
-
label: e.label,
|
|
30
|
-
disabled: e.disabled,
|
|
31
|
-
closeable: e.closeable
|
|
32
|
-
});
|
|
37
|
+
a.register(r());
|
|
33
38
|
}
|
|
34
|
-
),
|
|
39
|
+
), k(() => {
|
|
35
40
|
a.unregister(e.value);
|
|
36
41
|
});
|
|
37
|
-
const
|
|
42
|
+
const u = s(() => {
|
|
38
43
|
if (a.transition.value !== "none") {
|
|
39
44
|
if (a.transition.value === "slide") {
|
|
40
|
-
const
|
|
41
|
-
return
|
|
45
|
+
const l = d(a.previousTab.value);
|
|
46
|
+
return d(e.value) >= l ? "cui-tab-slide-left" : "cui-tab-slide-right";
|
|
42
47
|
}
|
|
43
48
|
return "cui-tab-fade";
|
|
44
49
|
}
|
|
45
50
|
});
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
51
|
+
function d(l) {
|
|
52
|
+
const t = document.querySelector(`[data-cui-tab-value="${l}"]`);
|
|
53
|
+
return t != null && t.parentElement ? Array.from(t.parentElement.children).indexOf(t) : 0;
|
|
49
54
|
}
|
|
50
|
-
return (
|
|
55
|
+
return (l, t) => w(a).keepAlive.value ? c((b(), v("div", {
|
|
51
56
|
key: 0,
|
|
52
|
-
class:
|
|
57
|
+
class: f(["cui-tab-panel", [o.value ? u.value : ""]]),
|
|
53
58
|
role: "tabpanel",
|
|
54
59
|
"aria-labelledby": n.value
|
|
55
60
|
}, [
|
|
56
|
-
|
|
57
|
-
], 10,
|
|
58
|
-
[
|
|
59
|
-
]) :
|
|
61
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
62
|
+
], 10, g)), [
|
|
63
|
+
[p, o.value && !n.hidden]
|
|
64
|
+
]) : o.value ? c((b(), v("div", {
|
|
60
65
|
key: 1,
|
|
61
|
-
class:
|
|
66
|
+
class: f(["cui-tab-panel", u.value]),
|
|
62
67
|
role: "tabpanel",
|
|
63
68
|
"aria-labelledby": n.value
|
|
64
69
|
}, [
|
|
65
|
-
|
|
66
|
-
], 10,
|
|
67
|
-
[
|
|
68
|
-
]) :
|
|
70
|
+
m(l.$slots, "default", {}, void 0, !0)
|
|
71
|
+
], 10, E)), [
|
|
72
|
+
[p, !n.hidden]
|
|
73
|
+
]) : B("", !0);
|
|
69
74
|
}
|
|
70
75
|
});
|
|
71
76
|
export {
|
|
72
|
-
|
|
77
|
+
$ as default
|
|
73
78
|
};
|
|
@@ -21,14 +21,14 @@ export interface CuiTableProps extends HideableProps, SizeableProps {
|
|
|
21
21
|
*/
|
|
22
22
|
ariaRowcount?: number;
|
|
23
23
|
}
|
|
24
|
-
declare
|
|
24
|
+
declare function measure(): void;
|
|
25
|
+
declare var __VLS_1: {};
|
|
25
26
|
type __VLS_Slots = {} & {
|
|
26
27
|
default?: (props: typeof __VLS_1) => any;
|
|
27
|
-
} & {
|
|
28
|
-
default?: (props: typeof __VLS_3) => any;
|
|
29
28
|
};
|
|
30
29
|
declare const __VLS_component: import("vue").DefineComponent<CuiTableProps, {
|
|
31
30
|
scrollWrapper: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
31
|
+
measure: typeof measure;
|
|
32
32
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CuiTableProps> & Readonly<{}>, {
|
|
33
33
|
hidden: boolean;
|
|
34
34
|
size: import("..").CuiSize;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTable.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTable.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTable.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTable.vue"],"names":[],"mappings":"AAmTA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMpE,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,aAAa;IACjE,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uDAAuD;IACvD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAiED,iBAAS,OAAO,SAiBf;AAiFD,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;AAiC/C,QAAA,MAAM,eAAe;;;;;;aAzNT,OAAO;eAEL,OAAO;cAER,OAAO;kBAEH,OAAO;iBAER,OAAO;6EAyNrB,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,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
|
};
|
|
@@ -20,6 +20,7 @@ type __VLS_Slots = {} & {
|
|
|
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
|
nowrap: boolean;
|
|
23
|
+
header: boolean;
|
|
23
24
|
hidden: boolean;
|
|
24
25
|
align: TableCellAlign;
|
|
25
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -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;YA9FV,OAAO;YAVP,OAAO;;WAER,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
|
};
|