@septkit/ui 0.0.85 → 0.0.87
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/explorer/explorer-search.js +43 -0
- package/dist/explorer/explorer.js +3 -3
- package/dist/explorer/explorer.vue_vue_type_script_setup_true_lang.js +142 -85
- package/dist/explorer/index.js +2 -3
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-down-up.js +11 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-up-down.js +11 -0
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/search.js +13 -0
- package/dist/index.d.ts +153 -69
- package/dist/index.js +35 -33
- package/dist/library-browser/library-browser.js +1 -1
- package/dist/library-browser/library-browser.vue_vue_type_script_setup_true_lang.js +79 -55
- package/dist/{explorer → tree}/collect-expandable-node-ids.js +1 -1
- package/dist/tree/index.js +3 -0
- package/dist/tree/tree.js +7 -0
- package/dist/tree/tree.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/ui.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region lib/explorer/explorer-search.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e.trim().toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
function t(t, r) {
|
|
6
|
+
let i = e(r);
|
|
7
|
+
return i ? n(t, i) : t;
|
|
8
|
+
}
|
|
9
|
+
function n(e, t) {
|
|
10
|
+
return e.flatMap((e) => {
|
|
11
|
+
let r = e.children ? n(e.children, t) : [];
|
|
12
|
+
return r.length ? [{
|
|
13
|
+
...e,
|
|
14
|
+
children: r
|
|
15
|
+
}] : e.name.toLowerCase().includes(t) ? [{
|
|
16
|
+
...e,
|
|
17
|
+
children: void 0
|
|
18
|
+
}] : [];
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function r(e, t) {
|
|
22
|
+
for (let n of e) {
|
|
23
|
+
if (n.id === t) return [];
|
|
24
|
+
let e = n.children ? r(n.children, t) : void 0;
|
|
25
|
+
if (e) return [n.id, ...e];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function i(t, n) {
|
|
29
|
+
let r = e(n), i = t.toLowerCase(), a = [], o = 0, s = r ? i.indexOf(r) : -1;
|
|
30
|
+
for (; s !== -1;) s > o && a.push({
|
|
31
|
+
text: t.slice(o, s),
|
|
32
|
+
match: !1
|
|
33
|
+
}), o = s + r.length, a.push({
|
|
34
|
+
text: t.slice(s, o),
|
|
35
|
+
match: !0
|
|
36
|
+
}), s = i.indexOf(r, o);
|
|
37
|
+
return o < t.length && a.push({
|
|
38
|
+
text: t.slice(o),
|
|
39
|
+
match: !1
|
|
40
|
+
}), a;
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { t as filterExplorerTree, r as findAncestorIds, i as splitByMatch };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./explorer.vue_vue_type_script_setup_true_lang.js";
|
|
2
3
|
/* empty css */
|
|
3
|
-
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
//#region lib/explorer/explorer.vue
|
|
5
|
-
var n = /*#__PURE__*/ t
|
|
5
|
+
var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-ab2f0eec"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import n from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/
|
|
4
|
-
import r from "../icons/
|
|
5
|
-
import "../icons/
|
|
6
|
-
import { collectExpandableNodeIds as
|
|
7
|
-
import
|
|
1
|
+
import e from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevron-right.js";
|
|
2
|
+
import t from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-down-up.js";
|
|
3
|
+
import n from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-up-down.js";
|
|
4
|
+
import r from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/search.js";
|
|
5
|
+
import i from "../external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/x.js";
|
|
6
|
+
import { collectExpandableNodeIds as a } from "../tree/collect-expandable-node-ids.js";
|
|
7
|
+
import o from "../tree/tree.js";
|
|
8
|
+
import "../tree/index.js";
|
|
9
|
+
import { filterExplorerTree as s, findAncestorIds as c, splitByMatch as l } from "./explorer-search.js";
|
|
10
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createTextVNode as _, createVNode as v, defineComponent as y, normalizeClass as b, openBlock as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, unref as E, vModelText as D, watch as O, withCtx as k, withDirectives as A, withKeys as j, withModifiers as M } from "vue";
|
|
8
11
|
//#region lib/explorer/explorer.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
12
|
+
var ee = { class: "explorer flex flex-col gap-2" }, N = { class: "flex items-center gap-1 bg-base-100" }, P = { class: "input input-sm flex-1" }, F = ["disabled", "aria-label"], I = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "label",
|
|
15
|
+
role: "status"
|
|
16
|
+
}, L = { class: "pl-2 truncate" }, R = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "rounded-sm bg-warning/40 text-inherit"
|
|
19
|
+
}, z = /*@__PURE__*/ y({
|
|
10
20
|
__name: "explorer",
|
|
11
21
|
props: {
|
|
12
22
|
items: {},
|
|
@@ -23,87 +33,134 @@ var S = ["onClick", "onContextmenu"], C = { class: "flex flex-1 items-center min
|
|
|
23
33
|
"contextmenu",
|
|
24
34
|
"update:expanded"
|
|
25
35
|
],
|
|
26
|
-
setup(
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
setup(y, { emit: z }) {
|
|
37
|
+
let B = y, V = z, H = S(""), U = S(), W = d(() => H.value.trim().length > 0), G = d(() => s(B.items, H.value)), K = d(() => W.value ? {
|
|
38
|
+
scoped: [],
|
|
39
|
+
all: !0
|
|
40
|
+
} : B.expanded), q = d(() => a(B.items)), J = d(() => B.expanded.all ? q.value : B.expanded.scoped), Y = d(() => {
|
|
41
|
+
if (B.expanded.all) return q.value.length > 0;
|
|
42
|
+
if (!q.value.length) return !1;
|
|
43
|
+
let e = new Set(B.expanded.scoped);
|
|
44
|
+
return q.value.every((t) => e.has(t));
|
|
45
|
+
});
|
|
46
|
+
O(() => B.selected, (e) => {
|
|
47
|
+
e === void 0 || !W.value || c(B.items, e) !== void 0 && c(G.value, e) === void 0 && (H.value = "");
|
|
48
|
+
}), O(H, (e, t) => {
|
|
49
|
+
if (!t.trim() || e.trim()) return;
|
|
50
|
+
let n = B.selected ?? U.value;
|
|
51
|
+
if (n === void 0 || B.expanded.all) return;
|
|
52
|
+
let r = c(B.items, n);
|
|
53
|
+
r !== void 0 && V("update:expanded", {
|
|
54
|
+
scoped: [.../* @__PURE__ */ new Set([...B.expanded.scoped, ...r])],
|
|
55
|
+
all: !1
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
function X() {
|
|
59
|
+
V("update:expanded", {
|
|
60
|
+
scoped: [],
|
|
61
|
+
all: !Y.value
|
|
62
|
+
});
|
|
34
63
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
expanded: k.value,
|
|
40
|
-
"model-value": A.value,
|
|
41
|
-
"aria-label": D.ariaLabel,
|
|
42
|
-
"onUpdate:expanded": o[1] ||= (e) => O("update:expanded", {
|
|
43
|
-
scoped: e,
|
|
64
|
+
function Z(e) {
|
|
65
|
+
let t = J.value.includes(e) ? J.value.filter((t) => t !== e) : [...J.value, e];
|
|
66
|
+
V("update:expanded", {
|
|
67
|
+
scoped: t,
|
|
44
68
|
all: !1
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function Q(e) {
|
|
72
|
+
e.selectable === !1 && e.children?.length && Z(e.id);
|
|
73
|
+
}
|
|
74
|
+
function te(e) {
|
|
75
|
+
U.value = e.id, V("select", e);
|
|
76
|
+
}
|
|
77
|
+
function ne(e) {
|
|
78
|
+
W.value || V("update:expanded", e);
|
|
79
|
+
}
|
|
80
|
+
function $() {
|
|
81
|
+
H.value = "";
|
|
82
|
+
}
|
|
83
|
+
return (a, s) => (x(), m("div", ee, [h("div", N, [h("label", P, [
|
|
84
|
+
v(E(r), {
|
|
85
|
+
"aria-hidden": "true",
|
|
86
|
+
size: 14,
|
|
87
|
+
class: "opacity-50"
|
|
88
|
+
}),
|
|
89
|
+
A(h("input", {
|
|
90
|
+
"onUpdate:modelValue": s[0] ||= (e) => H.value = e,
|
|
91
|
+
type: "text",
|
|
92
|
+
class: "grow",
|
|
93
|
+
placeholder: "Search by name",
|
|
94
|
+
"aria-label": "Search by name",
|
|
95
|
+
"data-testid": "explorer-search",
|
|
96
|
+
onKeydown: j($, ["esc"])
|
|
97
|
+
}, null, 544), [[D, H.value]]),
|
|
98
|
+
H.value ? (x(), m("button", {
|
|
99
|
+
key: 0,
|
|
100
|
+
type: "button",
|
|
101
|
+
class: "btn btn-ghost btn-circle btn-xs",
|
|
102
|
+
"aria-label": "Clear search",
|
|
103
|
+
onClick: $
|
|
104
|
+
}, [v(E(i), {
|
|
105
|
+
"aria-hidden": "true",
|
|
106
|
+
size: 14
|
|
107
|
+
})])) : p("", !0)
|
|
108
|
+
]), h("button", {
|
|
109
|
+
type: "button",
|
|
110
|
+
class: "btn btn-ghost btn-square btn-sm",
|
|
111
|
+
disabled: W.value || !q.value.length,
|
|
112
|
+
"aria-label": Y.value ? "Collapse all" : "Expand all",
|
|
113
|
+
onClick: X
|
|
114
|
+
}, [Y.value ? (x(), f(E(n), {
|
|
115
|
+
key: 0,
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
size: 16
|
|
118
|
+
})) : (x(), f(E(t), {
|
|
119
|
+
key: 1,
|
|
120
|
+
"aria-hidden": "true",
|
|
121
|
+
size: 16
|
|
122
|
+
}))], 8, F)]), W.value && !G.value.length ? (x(), m("p", I, "No results")) : (x(), f(E(o), {
|
|
123
|
+
key: 1,
|
|
124
|
+
items: G.value,
|
|
125
|
+
expanded: K.value,
|
|
126
|
+
selected: B.selected ?? U.value,
|
|
127
|
+
"aria-label": B.ariaLabel,
|
|
128
|
+
"row-label": B.rowLabel,
|
|
129
|
+
onSelect: te,
|
|
130
|
+
onRowClick: Q,
|
|
131
|
+
onContextmenu: s[1] ||= (e) => V("contextmenu", e),
|
|
132
|
+
"onUpdate:expanded": ne
|
|
133
|
+
}, g({
|
|
134
|
+
"node-toggle": k(({ node: t, hasChildren: n, expanded: r }) => [v(E(e), {
|
|
135
|
+
"aria-hidden": "true",
|
|
136
|
+
size: 16,
|
|
137
|
+
class: b(["explorer__chevron shrink-0", {
|
|
138
|
+
invisible: !n || W.value,
|
|
139
|
+
"explorer__chevron--open": r
|
|
140
|
+
}]),
|
|
141
|
+
onClick: M((e) => Z(t.id), ["stop"])
|
|
142
|
+
}, null, 8, ["class", "onClick"])]),
|
|
143
|
+
"node-label": k(({ node: e }) => [w(a.$slots, "node-label", {
|
|
144
|
+
node: e,
|
|
145
|
+
term: H.value
|
|
146
|
+
}, () => [h("span", L, [(x(!0), m(u, null, C(E(l)(e.name, H.value), (e, t) => (x(), m(u, { key: t }, [e.match ? (x(), m("mark", R, T(e.text), 1)) : (x(), m(u, { key: 1 }, [_(T(e.text), 1)], 64))], 64))), 128))])], !0)]),
|
|
147
|
+
_: 2
|
|
148
|
+
}, [a.$slots["node-prefix"] ? {
|
|
149
|
+
name: "node-prefix",
|
|
150
|
+
fn: k(({ node: e }) => [w(a.$slots, "node-prefix", { node: e }, void 0, !0)]),
|
|
151
|
+
key: "0"
|
|
152
|
+
} : void 0, a.$slots["node-suffix"] ? {
|
|
153
|
+
name: "node-suffix",
|
|
154
|
+
fn: k(({ node: e }) => [w(a.$slots, "node-suffix", { node: e }, void 0, !0)]),
|
|
155
|
+
key: "1"
|
|
156
|
+
} : void 0]), 1032, [
|
|
100
157
|
"items",
|
|
101
|
-
"get-key",
|
|
102
158
|
"expanded",
|
|
103
|
-
"
|
|
104
|
-
"aria-label"
|
|
105
|
-
|
|
159
|
+
"selected",
|
|
160
|
+
"aria-label",
|
|
161
|
+
"row-label"
|
|
162
|
+
]))]));
|
|
106
163
|
}
|
|
107
164
|
});
|
|
108
165
|
//#endregion
|
|
109
|
-
export {
|
|
166
|
+
export { z as default };
|
package/dist/explorer/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export { t as SclExplorer, e as collectExpandableNodeIds };
|
|
1
|
+
import e from "./explorer.js";
|
|
2
|
+
export { e as SclExplorer };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/.pnpm/@lucide+vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-down-up.mjs
|
|
3
|
+
var t = [["path", {
|
|
4
|
+
d: "m7 20 5-5 5 5",
|
|
5
|
+
key: "13a0gw"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "m7 4 5 5 5-5",
|
|
8
|
+
key: "1kwcof"
|
|
9
|
+
}]], n = e("chevrons-down-up", t);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __iconNode, n as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/.pnpm/@lucide+vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/chevrons-up-down.mjs
|
|
3
|
+
var t = [["path", {
|
|
4
|
+
d: "m7 15 5 5 5-5",
|
|
5
|
+
key: "1hf1tw"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "m7 9 5-5 5 5",
|
|
8
|
+
key: "sgt6xg"
|
|
9
|
+
}]], n = e("chevrons-up-down", t);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as __iconNode, n as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import e from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/.pnpm/@lucide+vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/search.mjs
|
|
3
|
+
var t = [["path", {
|
|
4
|
+
d: "m21 21-4.34-4.34",
|
|
5
|
+
key: "14j7rj"
|
|
6
|
+
}], ["circle", {
|
|
7
|
+
cx: "11",
|
|
8
|
+
cy: "11",
|
|
9
|
+
r: "8",
|
|
10
|
+
key: "4ej97u"
|
|
11
|
+
}]], n = e("search", t);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as __iconNode, n as default };
|