@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuiTreeView.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTreeView.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CuiTreeView.vue.d.ts","sourceRoot":"","sources":["../../src/components/CuiTreeView.vue"],"names":[],"mappings":"AA6IA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,QAAQ;IACvB,wBAAwB;IACxB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,oBAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,gBAAgB;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC;IAC1D,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,eAAe,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACtC,kCAAkC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW;IACX,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAiJD,QAAA,IAAI,OAAO,KAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA2B5C,QAAA,MAAM,eAAe;;;;;;;;;;UA/KZ,IAAI,GAAG,IAAI,GAAG,IAAI;cAZd,OAAO;gBAQL,OAAO;eAFR,OAAO;cAIR,OAAO;eANN,OAAO;6EA+LnB,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
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { scaleDensity as d } from "../utils/sizing.js";
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as z, ref as v, computed as u, withDirectives as y, openBlock as s, createElementBlock as m, Fragment as B, renderList as V, createBlock as b, withCtx as k, renderSlot as E, mergeProps as C, vShow as A } from "vue";
|
|
2
|
+
import L from "./CuiTreeNode.vue.js";
|
|
3
|
+
import { scaleDensity as d, scaleControlHeight as c } from "../utils/sizing.js";
|
|
4
|
+
const X = { role: "tree" }, T = /* @__PURE__ */ z({
|
|
5
5
|
__name: "CuiTreeView",
|
|
6
6
|
props: {
|
|
7
7
|
nodes: {},
|
|
@@ -16,8 +16,8 @@ const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
|
16
16
|
hidden: { type: Boolean, default: !1 }
|
|
17
17
|
},
|
|
18
18
|
emits: ["update:modelValue", "node-click", "node-expand"],
|
|
19
|
-
setup(a, { emit:
|
|
20
|
-
const l = a, i =
|
|
19
|
+
setup(a, { emit: f }) {
|
|
20
|
+
const l = a, i = f, o = v(new Set(l.defaultExpanded ?? []));
|
|
21
21
|
if (l.expandAll) {
|
|
22
22
|
let e = function(t) {
|
|
23
23
|
for (const n of t)
|
|
@@ -25,12 +25,12 @@ const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
|
25
25
|
};
|
|
26
26
|
e(l.nodes);
|
|
27
27
|
}
|
|
28
|
-
const r =
|
|
29
|
-
function
|
|
28
|
+
const r = u(() => l.modelValue == null ? /* @__PURE__ */ new Set() : Array.isArray(l.modelValue) ? new Set(l.modelValue) : /* @__PURE__ */ new Set([l.modelValue]));
|
|
29
|
+
function p(e) {
|
|
30
30
|
const t = new Set(o.value), n = t.has(e.id);
|
|
31
31
|
n ? t.delete(e.id) : t.add(e.id), o.value = t, i("node-expand", e, !n);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function h(e) {
|
|
34
34
|
if (!(!l.selectable || e.disabled))
|
|
35
35
|
if (i("node-click", e), l.multiple) {
|
|
36
36
|
const t = new Set(r.value);
|
|
@@ -38,13 +38,13 @@ const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
|
38
38
|
} else
|
|
39
39
|
i("update:modelValue", r.value.has(e.id) ? null : e.id);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
sm: { fontSize: "0.8125rem", iconSize: "0.75rem", indent: d("1rem"), padY: d("0.1875rem"), padX: d("0.375rem") },
|
|
43
|
-
md: { fontSize: "0.875rem", iconSize: "0.875rem", indent: d("1.25rem"), padY: d("0.25rem"), padX: d("0.5rem") },
|
|
44
|
-
lg: { fontSize: "0.9375rem", iconSize: "1rem", indent: d("1.5rem"), padY: d("0.375rem"), padX: d("0.625rem") }
|
|
45
|
-
},
|
|
46
|
-
return (e, t) => y((s(),
|
|
47
|
-
(s(!0),
|
|
41
|
+
const S = {
|
|
42
|
+
sm: { fontSize: "0.8125rem", iconSize: "0.75rem", hitSize: c("0.75rem"), indent: d("1rem"), padY: d("0.1875rem"), padX: d("0.375rem") },
|
|
43
|
+
md: { fontSize: "0.875rem", iconSize: "0.875rem", hitSize: c("0.875rem"), indent: d("1.25rem"), padY: d("0.25rem"), padX: d("0.5rem") },
|
|
44
|
+
lg: { fontSize: "0.9375rem", iconSize: "1rem", hitSize: c("1rem"), indent: d("1.5rem"), padY: d("0.375rem"), padX: d("0.625rem") }
|
|
45
|
+
}, g = u(() => S[l.size]);
|
|
46
|
+
return (e, t) => y((s(), m("div", X, [
|
|
47
|
+
(s(!0), m(B, null, V(a.nodes, (n, x) => (s(), b(L, {
|
|
48
48
|
key: String(n.id),
|
|
49
49
|
node: n,
|
|
50
50
|
depth: 0,
|
|
@@ -54,12 +54,12 @@ const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
|
54
54
|
selectable: a.selectable,
|
|
55
55
|
"show-lines": a.showLines,
|
|
56
56
|
animated: a.animated,
|
|
57
|
-
cfg:
|
|
58
|
-
onToggleExpand:
|
|
59
|
-
onSelectNode:
|
|
57
|
+
cfg: g.value,
|
|
58
|
+
onToggleExpand: p,
|
|
59
|
+
onSelectNode: h
|
|
60
60
|
}, {
|
|
61
|
-
node:
|
|
62
|
-
|
|
61
|
+
node: k((w) => [
|
|
62
|
+
E(e.$slots, "node", C({ ref_for: !0 }, w))
|
|
63
63
|
]),
|
|
64
64
|
_: 3
|
|
65
65
|
}, 8, ["node", "is-last", "expanded", "selected-set", "selectable", "show-lines", "animated", "cfg"]))), 128))
|
|
@@ -69,5 +69,5 @@ const L = { role: "tree" }, N = /* @__PURE__ */ w({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
T as default
|
|
73
73
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InjectionKey, Ref } from "vue";
|
|
1
|
+
import type { InjectionKey, Ref, VNodeChild } from "vue";
|
|
2
2
|
import type { CuiColor } from "../types/common";
|
|
3
3
|
export type TabVariant = "underline" | "segmented";
|
|
4
4
|
export type TabOrientation = "horizontal" | "vertical";
|
|
@@ -8,6 +8,12 @@ export interface TabDefinition {
|
|
|
8
8
|
label: string;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
closeable?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* CuiTab's `#label` slot, forwarded so CuiTabs can render it inside the tab
|
|
13
|
+
* button (the button lives in the bar, which the parent owns). Absent when the
|
|
14
|
+
* tab has no `#label` slot, in which case the parent renders `label` as text.
|
|
15
|
+
*/
|
|
16
|
+
labelSlot?: () => VNodeChild;
|
|
11
17
|
}
|
|
12
18
|
export interface TabsContext {
|
|
13
19
|
activeTab: Ref<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-context.d.ts","sourceRoot":"","sources":["../../src/components/tabs-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tabs-context.d.ts","sourceRoot":"","sources":["../../src/components/tabs-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,UAAU,CAAC;AACvD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,UAAU,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IACjC,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAA0B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Reactive dark-mode signal for one component's own ancestor chain.
|
|
4
|
+
*
|
|
5
|
+
* clean-ui's dark mode is a `.dark` class that can sit on any ancestor and can
|
|
6
|
+
* be scoped to a subtree, so a single global boolean would be wrong — two
|
|
7
|
+
* components in differently-themed subtrees can legitimately disagree. This
|
|
8
|
+
* resolves per call site instead: pass the calling component's root template
|
|
9
|
+
* ref and it walks upward from there.
|
|
10
|
+
*
|
|
11
|
+
* Consumers that need dark mode as a JS value rather than a CSS selector
|
|
12
|
+
* (e.g. a syntax highlighter whose own theme is fixed at configuration time,
|
|
13
|
+
* not read from the cascade) use this instead of hand-rolling a `.dark`
|
|
14
|
+
* observer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useColorScheme(target: Ref<HTMLElement | null | undefined>): {
|
|
17
|
+
isDark: Ref<boolean, boolean>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useColorScheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useColorScheme.d.ts","sourceRoot":"","sources":["../../src/composables/useColorScheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AA6C5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;;EAoBzE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ref as o, onMounted as u, onUnmounted as i } from "vue";
|
|
2
|
+
const l = "dark";
|
|
3
|
+
function c(n) {
|
|
4
|
+
let e = n;
|
|
5
|
+
for (; e; ) {
|
|
6
|
+
if (e.classList.contains(l)) return !0;
|
|
7
|
+
e = e.parentElement;
|
|
8
|
+
}
|
|
9
|
+
return !1;
|
|
10
|
+
}
|
|
11
|
+
const r = /* @__PURE__ */ new Set();
|
|
12
|
+
let t = null;
|
|
13
|
+
function a() {
|
|
14
|
+
t || typeof MutationObserver > "u" || (t = new MutationObserver(() => {
|
|
15
|
+
for (const n of r) n();
|
|
16
|
+
}), t.observe(document.documentElement, {
|
|
17
|
+
attributes: !0,
|
|
18
|
+
attributeFilter: ["class"],
|
|
19
|
+
subtree: !0
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
function f() {
|
|
23
|
+
r.size === 0 && t && (t.disconnect(), t = null);
|
|
24
|
+
}
|
|
25
|
+
function b(n) {
|
|
26
|
+
const e = o(!1);
|
|
27
|
+
function s() {
|
|
28
|
+
e.value = c(n.value ?? null);
|
|
29
|
+
}
|
|
30
|
+
return u(() => {
|
|
31
|
+
s(), a(), r.add(s);
|
|
32
|
+
}), i(() => {
|
|
33
|
+
r.delete(s), f();
|
|
34
|
+
}), { isDark: e };
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
b as useColorScheme
|
|
38
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDataGridViews.d.ts","sourceRoot":"","sources":["../../src/composables/useDataGridViews.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDataGridViews.d.ts","sourceRoot":"","sources":["../../src/composables/useDataGridViews.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAGjF,oCAAoC;AACpC,wBAAgB,uBAAuB,CAAC,MAAM,SAAiB,GAAG,mBAAmB,CAkCpF;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAejC,MAAM,UAAU,iBAAiB,CAAC,QAAQ,CAAC;qBAY3C,MAAM,UAAU,iBAAiB,CAAC,QAAQ,CAAC;qBAO3C,MAAM;qBAMZ,MAAM;EAc/B"}
|
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ref as f } from "vue";
|
|
2
|
+
import { safeSetItem as l, safeGetItem as g } from "../utils/storage.js";
|
|
3
|
+
function V(s = "cui-datagrid") {
|
|
4
|
+
function r(e) {
|
|
5
|
+
return `${s}-views-${e}`;
|
|
5
6
|
}
|
|
6
7
|
return {
|
|
7
|
-
async load(
|
|
8
|
+
async load(e) {
|
|
9
|
+
const a = g(r(e));
|
|
10
|
+
if (!a) return [];
|
|
8
11
|
try {
|
|
9
|
-
|
|
10
|
-
return e ? JSON.parse(e) : [];
|
|
12
|
+
return JSON.parse(a);
|
|
11
13
|
} catch {
|
|
12
14
|
return [];
|
|
13
15
|
}
|
|
14
16
|
},
|
|
15
|
-
async save(
|
|
16
|
-
const t = await this.load(
|
|
17
|
-
i >= 0 ? t[i] =
|
|
17
|
+
async save(e, a) {
|
|
18
|
+
const t = await this.load(e), i = t.findIndex((u) => u.id === a.id);
|
|
19
|
+
i >= 0 ? t[i] = a : t.push(a), l(r(e), JSON.stringify(t));
|
|
18
20
|
},
|
|
19
|
-
async remove(
|
|
20
|
-
const i = (await this.load(
|
|
21
|
-
|
|
21
|
+
async remove(e, a) {
|
|
22
|
+
const i = (await this.load(e)).filter((u) => u.id !== a);
|
|
23
|
+
l(r(e), JSON.stringify(i));
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
|
-
function
|
|
26
|
-
const r = s.adapter ??
|
|
27
|
+
function h(s) {
|
|
28
|
+
const r = s.adapter ?? V(), e = f([]), a = f(null), t = f(!1);
|
|
27
29
|
async function i() {
|
|
28
30
|
t.value = !0;
|
|
29
31
|
try {
|
|
30
|
-
|
|
32
|
+
e.value = await r.load(s.gridId);
|
|
31
33
|
} finally {
|
|
32
34
|
t.value = !1;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
async function
|
|
36
|
-
const c =
|
|
37
|
+
async function u(n, o) {
|
|
38
|
+
const c = e.value.find((m) => m.name === n), d = {
|
|
37
39
|
id: (c == null ? void 0 : c.id) ?? crypto.randomUUID(),
|
|
38
40
|
name: n,
|
|
39
|
-
config:
|
|
41
|
+
config: o
|
|
40
42
|
};
|
|
41
|
-
await r.save(s.gridId,
|
|
43
|
+
await r.save(s.gridId, d), await i(), a.value = d.id;
|
|
42
44
|
}
|
|
43
|
-
async function
|
|
44
|
-
const c =
|
|
45
|
-
c && (await r.save(s.gridId, { ...c, config:
|
|
45
|
+
async function w(n, o) {
|
|
46
|
+
const c = e.value.find((d) => d.id === n);
|
|
47
|
+
c && (await r.save(s.gridId, { ...c, config: o }), await i());
|
|
46
48
|
}
|
|
47
|
-
async function
|
|
48
|
-
await r.remove(s.gridId, n),
|
|
49
|
+
async function v(n) {
|
|
50
|
+
await r.remove(s.gridId, n), a.value === n && (a.value = null), await i();
|
|
49
51
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
+
function y(n) {
|
|
53
|
+
a.value = n;
|
|
52
54
|
}
|
|
53
55
|
return {
|
|
54
|
-
views:
|
|
55
|
-
activeViewId:
|
|
56
|
+
views: e,
|
|
57
|
+
activeViewId: a,
|
|
56
58
|
loading: t,
|
|
57
59
|
fetchViews: i,
|
|
58
|
-
saveView:
|
|
59
|
-
updateView:
|
|
60
|
-
removeView:
|
|
61
|
-
selectView:
|
|
60
|
+
saveView: u,
|
|
61
|
+
updateView: w,
|
|
62
|
+
removeView: v,
|
|
63
|
+
selectView: y
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
V as localStorageViewAdapter,
|
|
68
|
+
h as useDataGridViews
|
|
67
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDensity.d.ts","sourceRoot":"","sources":["../../src/composables/useDensity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDensity.d.ts","sourceRoot":"","sources":["../../src/composables/useDensity.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,SAAS,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,EAI1C,CAAC;AAkCF;;;;GAIG;AACH,wBAAgB,UAAU;IAUtB,oCAAoC;;IAEpC,gCAAgC;;IAEhC,6BAA6B;qBAbP,SAAS;IAe/B,iCAAiC;sBAXZ,SAAS;EAcjC"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
1
|
+
import { ref as r, watch as f } from "vue";
|
|
2
|
+
import { safeGetItem as l, safeSetItem as u } from "../utils/storage.js";
|
|
3
|
+
const i = [
|
|
3
4
|
{ id: "compact", label: "Compact", description: "Tighter spacing — more on screen" },
|
|
4
5
|
{ id: "default", label: "Default", description: "Balanced default spacing" },
|
|
5
6
|
{ id: "comfortable", label: "Comfortable", description: "Roomier spacing" }
|
|
6
|
-
],
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return t && d.has(t) ? t : i;
|
|
7
|
+
], c = "cui-density", o = "cui-density-", d = "default", m = new Set(i.map((t) => t.id)), n = r(p());
|
|
8
|
+
function p() {
|
|
9
|
+
const t = l(c);
|
|
10
|
+
return t && m.has(t) ? t : d;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function a(t) {
|
|
13
13
|
if (typeof document > "u") return;
|
|
14
14
|
const e = document.documentElement;
|
|
15
|
-
for (const
|
|
16
|
-
|
|
17
|
-
t !== "default" && e.classList.add(`${
|
|
15
|
+
for (const s of Array.from(e.classList))
|
|
16
|
+
s.startsWith(o) && e.classList.remove(s);
|
|
17
|
+
t !== "default" && e.classList.add(`${o}${t}`), u(c, t);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function
|
|
22
|
-
function t(
|
|
23
|
-
n.value =
|
|
19
|
+
a(n.value);
|
|
20
|
+
f(n, a);
|
|
21
|
+
function S() {
|
|
22
|
+
function t(s) {
|
|
23
|
+
n.value = s;
|
|
24
24
|
}
|
|
25
25
|
function e() {
|
|
26
26
|
return n.value;
|
|
@@ -29,7 +29,7 @@ function p() {
|
|
|
29
29
|
/** Current density id (reactive) */
|
|
30
30
|
density: n,
|
|
31
31
|
/** Available density presets */
|
|
32
|
-
presets:
|
|
32
|
+
presets: i,
|
|
33
33
|
/** Set the active density */
|
|
34
34
|
setDensity: t,
|
|
35
35
|
/** Get the current density id */
|
|
@@ -37,6 +37,6 @@ function p() {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
i as DENSITY_PRESETS,
|
|
41
|
+
S as useDensity
|
|
42
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/composables/useOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"useOverlay.d.ts","sourceRoot":"","sources":["../../src/composables/useOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgD,KAAK,GAAG,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAM9F,MAAM,WAAW,iBAAiB;IAChC,2CAA2C;IAC3C,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,qDAAqD;IACrD,SAAS,EAAE,GAAG,CAAC,WAAW,GAAG,SAAS,CAAC,GAAG,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC,CAAC;IACpH,qDAAqD;IACrD,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB;;;;;;;mBAqF7B,aAAa;EAuDpC"}
|
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
import { ref as d, watch as
|
|
1
|
+
import { ref as d, watch as q, onMounted as E, onUnmounted as B, nextTick as C } from "vue";
|
|
2
|
+
import { lockBodyScroll as D, unlockBodyScroll as L } from "../utils/scrollLock.js";
|
|
2
3
|
const t = /* @__PURE__ */ new Set();
|
|
3
|
-
function
|
|
4
|
+
function K(k) {
|
|
4
5
|
const {
|
|
5
|
-
open:
|
|
6
|
-
dialogRef:
|
|
7
|
-
persistent:
|
|
8
|
-
allowNested:
|
|
9
|
-
animationDuration:
|
|
10
|
-
onUpdateOpen:
|
|
11
|
-
onClose:
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
open: m,
|
|
7
|
+
dialogRef: a,
|
|
8
|
+
persistent: b,
|
|
9
|
+
allowNested: g,
|
|
10
|
+
animationDuration: S = 200,
|
|
11
|
+
onUpdateOpen: O,
|
|
12
|
+
onClose: h
|
|
13
|
+
} = k, c = Symbol("overlay"), i = d(!1), u = d(!1), p = d(null);
|
|
14
|
+
let o = !1;
|
|
15
|
+
function w() {
|
|
16
|
+
o || (o = !0, D());
|
|
17
|
+
}
|
|
18
|
+
function y() {
|
|
19
|
+
o && (o = !1, L());
|
|
20
|
+
}
|
|
21
|
+
function s() {
|
|
22
|
+
!g() && t.size > 0 && t.clear(), t.add(c), p.value = document.activeElement, i.value = !0, w(), C(() => {
|
|
15
23
|
requestAnimationFrame(() => {
|
|
16
24
|
var e;
|
|
17
|
-
|
|
25
|
+
u.value = !0, (e = a.value) == null || e.focus();
|
|
18
26
|
});
|
|
19
27
|
});
|
|
20
28
|
}
|
|
21
|
-
function
|
|
22
|
-
|
|
29
|
+
function r() {
|
|
30
|
+
u.value = !1, t.delete(c), setTimeout(() => {
|
|
23
31
|
var e;
|
|
24
|
-
|
|
25
|
-
},
|
|
32
|
+
i.value = !1, O(!1), h(), y(), (e = p.value) == null || e.focus();
|
|
33
|
+
}, S);
|
|
26
34
|
}
|
|
27
35
|
function f() {
|
|
28
|
-
|
|
36
|
+
b() || r();
|
|
29
37
|
}
|
|
30
|
-
function
|
|
38
|
+
function x() {
|
|
31
39
|
f();
|
|
32
40
|
}
|
|
33
|
-
function
|
|
34
|
-
if (e.key === "Escape" && (e.stopPropagation(), f()), e.key === "Tab" &&
|
|
35
|
-
const
|
|
41
|
+
function A(e) {
|
|
42
|
+
if (e.key === "Escape" && (e.stopPropagation(), f()), e.key === "Tab" && a.value) {
|
|
43
|
+
const v = a.value.querySelectorAll(
|
|
36
44
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
37
|
-
),
|
|
38
|
-
e.shiftKey ? document.activeElement ===
|
|
45
|
+
), n = v[0], l = v[v.length - 1];
|
|
46
|
+
e.shiftKey ? document.activeElement === n && (e.preventDefault(), l == null || l.focus()) : document.activeElement === l && (e.preventDefault(), n == null || n.focus());
|
|
39
47
|
}
|
|
40
48
|
}
|
|
41
|
-
return
|
|
42
|
-
e ?
|
|
43
|
-
}), A(() => {
|
|
44
|
-
v() && u();
|
|
49
|
+
return q(m, (e) => {
|
|
50
|
+
e ? s() : r();
|
|
45
51
|
}), E(() => {
|
|
46
|
-
|
|
52
|
+
m() && s();
|
|
53
|
+
}), B(() => {
|
|
54
|
+
t.delete(c), y();
|
|
47
55
|
}), {
|
|
48
|
-
isVisible:
|
|
49
|
-
isAnimating:
|
|
50
|
-
openOverlay:
|
|
51
|
-
closeOverlay:
|
|
56
|
+
isVisible: i,
|
|
57
|
+
isAnimating: u,
|
|
58
|
+
openOverlay: s,
|
|
59
|
+
closeOverlay: r,
|
|
52
60
|
requestClose: f,
|
|
53
|
-
onBackdropClick:
|
|
54
|
-
onKeydown:
|
|
61
|
+
onBackdropClick: x,
|
|
62
|
+
onKeydown: A
|
|
55
63
|
};
|
|
56
64
|
}
|
|
57
65
|
export {
|
|
58
|
-
|
|
66
|
+
K as useOverlay
|
|
59
67
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/composables/useTheme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../src/composables/useTheme.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,EAStC,CAAC;AAmCF;;;GAGG;AACH,wBAAgB,QAAQ;IAUpB,kCAAkC;;IAElC,sCAAsC;;IAEtC,iCAAiC;wBAbR,MAAM;IAe/B,+BAA+B;oBAXZ,MAAM;EAc5B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
1
|
+
import { ref as n, watch as s } from "vue";
|
|
2
|
+
import { safeGetItem as c, safeSetItem as u } from "../utils/storage.js";
|
|
3
|
+
const d = [
|
|
3
4
|
{ id: "mono", label: "Mono", description: "Monochrome — default theme" },
|
|
4
5
|
{ id: "default", label: "Navy", description: "Navy blue" },
|
|
5
6
|
{ id: "forest", label: "Forest", description: "Natural green" },
|
|
@@ -8,34 +9,25 @@ const u = [
|
|
|
8
9
|
{ id: "teal", label: "Teal", description: "Cool teal" },
|
|
9
10
|
{ id: "violet", label: "Violet", description: "Rich purple" },
|
|
10
11
|
{ id: "ruby", label: "Ruby", description: "Bold red" }
|
|
11
|
-
],
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
return localStorage.getItem(n) ?? "mono";
|
|
16
|
-
} catch {
|
|
17
|
-
return "mono";
|
|
18
|
-
}
|
|
12
|
+
], a = "cui-theme", r = "cui-theme-";
|
|
13
|
+
function m() {
|
|
14
|
+
return c(a) ?? "mono";
|
|
19
15
|
}
|
|
20
|
-
const o =
|
|
16
|
+
const o = n(m());
|
|
21
17
|
function l(e) {
|
|
22
18
|
if (typeof document > "u") return;
|
|
23
19
|
const t = document.documentElement;
|
|
24
|
-
for (const
|
|
25
|
-
|
|
26
|
-
e !== "default" && t.classList.add(`${
|
|
20
|
+
for (const i of Array.from(t.classList))
|
|
21
|
+
i.startsWith(r) && t.classList.remove(i);
|
|
22
|
+
e !== "default" && t.classList.add(`${r}${e}`);
|
|
27
23
|
}
|
|
28
24
|
l(o.value);
|
|
29
25
|
s(o, (e) => {
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
localStorage.setItem(n, e);
|
|
33
|
-
} catch {
|
|
34
|
-
}
|
|
26
|
+
l(e), u(a, e);
|
|
35
27
|
});
|
|
36
|
-
function
|
|
37
|
-
function e(
|
|
38
|
-
o.value =
|
|
28
|
+
function b() {
|
|
29
|
+
function e(i) {
|
|
30
|
+
o.value = i;
|
|
39
31
|
}
|
|
40
32
|
function t() {
|
|
41
33
|
return o.value;
|
|
@@ -44,7 +36,7 @@ function f() {
|
|
|
44
36
|
/** Current theme ID (reactive) */
|
|
45
37
|
theme: o,
|
|
46
38
|
/** List of available theme presets */
|
|
47
|
-
presets:
|
|
39
|
+
presets: d,
|
|
48
40
|
/** Set the active theme by ID */
|
|
49
41
|
setTheme: e,
|
|
50
42
|
/** Get the current theme ID */
|
|
@@ -52,6 +44,6 @@ function f() {
|
|
|
52
44
|
};
|
|
53
45
|
}
|
|
54
46
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
d as THEME_PRESETS,
|
|
48
|
+
b as useTheme
|
|
57
49
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface CleanUIGlobal {
|
|
2
|
+
__CUI_INSTANCE__?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Every seam a satellite package relies on — form binding context, the icon
|
|
6
|
+
* registry, theme/density state — is a module-scope singleton. Two copies of
|
|
7
|
+
* clean-ui in one consumer tree (a version mismatch that defeats deduping)
|
|
8
|
+
* make those fail *silently*: no error, just a missing label or a "?" icon
|
|
9
|
+
* glyph. Stamp this copy's version on a shared global the first time any
|
|
10
|
+
* copy loads, and warn once if a second, different version shows up.
|
|
11
|
+
*
|
|
12
|
+
* Exported (not re-exported from the barrel) so it can be exercised directly
|
|
13
|
+
* from a test without relying on module-cache tricks to simulate two copies.
|
|
14
|
+
*/
|
|
15
|
+
export declare function registerInstance(current: string, g?: CleanUIGlobal): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=duplicate-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplicate-guard.d.ts","sourceRoot":"","sources":["../src/duplicate-guard.ts"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,CAAC,GAAE,aAA2C,GAC7C,IAAI,CAeN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { version as t } from "./version.js";
|
|
2
|
+
import { warnOnce as i } from "./utils/devWarn.js";
|
|
3
|
+
function s(e, n = globalThis) {
|
|
4
|
+
const o = n.__CUI_INSTANCE__;
|
|
5
|
+
if (o === void 0) {
|
|
6
|
+
n.__CUI_INSTANCE__ = e;
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
o !== e && i(
|
|
10
|
+
`[clean-ui] Detected two copies of @itguy614/clean-ui: v${o} and v${e}. Components share module-scope singletons (form context, the icon registry, theme/density state), so a duplicated instance can fail silently instead of erroring. Fix: dedupe @itguy614/clean-ui to one copy (check your lockfile / bundler resolution), or widen the consuming package's peer dependency range so both resolve to the same install.`
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
s(t);
|
|
14
|
+
export {
|
|
15
|
+
s as registerInstance
|
|
16
|
+
};
|