@septkit/ui 0.0.94 → 0.0.96
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/README.md +68 -0
- package/dist/bulk-edit/bulk-edit-field.js +5 -0
- package/dist/bulk-edit/bulk-edit-field.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/bulk-edit/bulk-edit-panel.js +5 -0
- package/dist/bulk-edit/bulk-edit-panel.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/bulk-edit/index.js +5 -0
- package/dist/bulk-edit/summarize-values.js +15 -0
- package/dist/bulk-edit/use-bulk-edit-form.js +41 -0
- package/dist/index.d.ts +254 -68
- package/dist/index.js +26 -18
- package/dist/table/filterable-column-header.js +1 -1
- package/dist/table/filterable-column-header.vue_vue_type_script_setup_true_lang.js +17 -4
- package/dist/table/index.js +6 -2
- package/dist/table/selection/index.js +4 -0
- package/dist/table/selection/selection-checkbox.js +5 -0
- package/dist/table/selection/selection-checkbox.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/table/selection/selection-toolbar.js +5 -0
- package/dist/table/selection/selection-toolbar.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/table/selection/use-row-selection.js +48 -0
- package/dist/ui.css +1 -1
- package/package.json +2 -2
|
@@ -8,16 +8,26 @@ import { useOptionalRowSortContext as o } from "./row-sort-context.js";
|
|
|
8
8
|
import s from "./filters/filter-popover.js";
|
|
9
9
|
import { Fragment as c, Teleport as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createVNode as h, defineComponent as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as ee, openBlock as b, ref as x, toDisplayString as te, unref as S, watch as C } from "vue";
|
|
10
10
|
//#region lib/table/filterable-column-header.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var ne = { class: "filterable-column-header" }, w = ["title"], T = [
|
|
11
|
+
var ne = { class: "filterable-column-header" }, w = ["title"], T = [
|
|
12
|
+
"aria-label",
|
|
13
|
+
"title",
|
|
14
|
+
"disabled"
|
|
15
|
+
], E = [
|
|
12
16
|
"aria-label",
|
|
13
17
|
"aria-pressed",
|
|
14
18
|
"aria-expanded",
|
|
15
|
-
"data-active"
|
|
16
|
-
|
|
19
|
+
"data-active",
|
|
20
|
+
"disabled"
|
|
21
|
+
], D = [
|
|
22
|
+
"aria-label",
|
|
23
|
+
"title",
|
|
24
|
+
"disabled"
|
|
25
|
+
], O = ["aria-label"], k = 14, A = 9, j = 8, M = /*@__PURE__*/ g({
|
|
17
26
|
__name: "filterable-column-header",
|
|
18
27
|
props: {
|
|
19
28
|
columnId: {},
|
|
20
|
-
title: {}
|
|
29
|
+
title: {},
|
|
30
|
+
disabled: { type: Boolean }
|
|
21
31
|
},
|
|
22
32
|
setup(g) {
|
|
23
33
|
let M = g, N = a(), P = o(), F = u(() => N.getVariant(M.columnId)), I = u(() => N.isColumnActive(M.columnId)), L = x(/* @__PURE__ */ new Set()), R = u(() => F.value === "tree" ? N.getTreeOptions(M.columnId) : []), z = u(() => F.value === "tree" ? [] : N.getFlatOptions(M.columnId)), B = u(() => N.getLanguageOptions(M.columnId)), V = u(() => N.getLanguage(M.columnId)), re = u(() => P?.isSortable(M.columnId) ?? !1), H = u(() => P?.getDirection(M.columnId) ?? null);
|
|
@@ -85,6 +95,7 @@ var ne = { class: "filterable-column-header" }, w = ["title"], T = ["aria-label"
|
|
|
85
95
|
class: v(["filterable-column-header__sort", { "filterable-column-header__sort--active": H.value }]),
|
|
86
96
|
"aria-label": $(),
|
|
87
97
|
title: $(),
|
|
98
|
+
disabled: g.disabled,
|
|
88
99
|
"data-testid": "column-sort-trigger",
|
|
89
100
|
onClick: o[0] ||= (e) => S(P)?.toggle(g.columnId)
|
|
90
101
|
}, [H.value === "asc" ? (b(), d(S(n), {
|
|
@@ -110,6 +121,7 @@ var ne = { class: "filterable-column-header" }, w = ["title"], T = ["aria-label"
|
|
|
110
121
|
"aria-haspopup": "dialog",
|
|
111
122
|
"aria-expanded": U.value,
|
|
112
123
|
"data-active": I.value,
|
|
124
|
+
disabled: g.disabled,
|
|
113
125
|
"data-testid": "column-filter-trigger",
|
|
114
126
|
onClick: ae
|
|
115
127
|
}, [h(S(r), {
|
|
@@ -122,6 +134,7 @@ var ne = { class: "filterable-column-header" }, w = ["title"], T = ["aria-label"
|
|
|
122
134
|
class: "filterable-column-header__reset",
|
|
123
135
|
"aria-label": `Reset ${g.title} filter`,
|
|
124
136
|
title: `Reset ${g.title} filter`,
|
|
137
|
+
disabled: g.disabled,
|
|
125
138
|
"data-testid": "column-filter-reset",
|
|
126
139
|
onClick: ce
|
|
127
140
|
}, [h(S(i), {
|
package/dist/table/index.js
CHANGED
|
@@ -3,5 +3,9 @@ import { useColumnFilters as c } from "./filters/use-column-filters.js";
|
|
|
3
3
|
import { useRowSort as l } from "./filters/use-row-sort.js";
|
|
4
4
|
import { provideColumnFilterHeader as u, useColumnFilterHeaderContext as d } from "./column-filter-context.js";
|
|
5
5
|
import { provideRowSortHeader as f, useOptionalRowSortContext as p } from "./row-sort-context.js";
|
|
6
|
-
import m from "./
|
|
7
|
-
|
|
6
|
+
import { useRowSelection as m } from "./selection/use-row-selection.js";
|
|
7
|
+
import h from "./selection/selection-checkbox.js";
|
|
8
|
+
import g from "./selection/selection-toolbar.js";
|
|
9
|
+
import "./selection/index.js";
|
|
10
|
+
import _ from "./filterable-column-header.js";
|
|
11
|
+
export { _ as FilterableColumnHeader, e as KEY_SEPARATOR, t as NO_VALUE_KEY, h as SelectionCheckbox, g as SelectionToolbar, n as buildFlatOptions, r as buildMultiValueOptions, i as buildTreeOptions, a as collectLeafKeys, o as collectParentKeys, s as filterTree, u as provideColumnFilterHeader, f as provideRowSortHeader, d as useColumnFilterHeaderContext, c as useColumnFilters, p as useOptionalRowSortContext, m as useRowSelection, l as useRowSort };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, openBlock as n, ref as r, watchEffect as i } from "vue";
|
|
2
|
+
//#region lib/table/selection/selection-checkbox.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var a = [
|
|
4
|
+
"checked",
|
|
5
|
+
"disabled",
|
|
6
|
+
"aria-label"
|
|
7
|
+
], o = /*@__PURE__*/ t({
|
|
8
|
+
__name: "selection-checkbox",
|
|
9
|
+
props: {
|
|
10
|
+
checked: { type: Boolean },
|
|
11
|
+
indeterminate: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
label: {}
|
|
20
|
+
},
|
|
21
|
+
emits: ["toggle"],
|
|
22
|
+
setup(t, { emit: o }) {
|
|
23
|
+
let s = t, c = o, l = r(null);
|
|
24
|
+
return i(() => {
|
|
25
|
+
l.value && (l.value.indeterminate = s.indeterminate);
|
|
26
|
+
}, { flush: "post" }), (r, i) => (n(), e("input", {
|
|
27
|
+
ref_key: "inputRef",
|
|
28
|
+
ref: l,
|
|
29
|
+
type: "checkbox",
|
|
30
|
+
class: "checkbox checkbox-sm checkbox-primary",
|
|
31
|
+
checked: t.checked,
|
|
32
|
+
disabled: t.disabled,
|
|
33
|
+
"aria-label": t.label,
|
|
34
|
+
"data-testid": "selection-checkbox",
|
|
35
|
+
onChange: i[0] ||= (e) => c("toggle")
|
|
36
|
+
}, null, 40, a));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
//#endregion
|
|
40
|
+
export { o as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
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/pencil.js";
|
|
2
|
+
import { Fragment as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d } from "vue";
|
|
3
|
+
//#region lib/table/selection/selection-toolbar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var f = {
|
|
5
|
+
class: "flex min-h-10 items-center gap-3 px-3 py-1.5 text-xs",
|
|
6
|
+
role: "toolbar",
|
|
7
|
+
"data-testid": "selection-toolbar"
|
|
8
|
+
}, p = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-base-content/60",
|
|
11
|
+
"data-testid": "selection-toolbar-hint"
|
|
12
|
+
}, m = { "data-testid": "selection-toolbar-count" }, h = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "text-base-content/60",
|
|
15
|
+
"data-testid": "selection-toolbar-locked"
|
|
16
|
+
}, g = ["disabled"], _ = /*@__PURE__*/ s({
|
|
17
|
+
__name: "selection-toolbar",
|
|
18
|
+
props: {
|
|
19
|
+
count: {},
|
|
20
|
+
totalCount: {},
|
|
21
|
+
visibleCount: {},
|
|
22
|
+
itemLabel: {},
|
|
23
|
+
locked: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
emits: [
|
|
29
|
+
"selectAllVisible",
|
|
30
|
+
"clear",
|
|
31
|
+
"bulkEdit"
|
|
32
|
+
],
|
|
33
|
+
setup(s, { emit: _ }) {
|
|
34
|
+
let v = _;
|
|
35
|
+
return (_, y) => (c(), r("div", f, [s.count === 0 ? (c(), r("span", p, " Select rows to edit several " + u(s.itemLabel) + " at once ", 1)) : (c(), r(t, { key: 1 }, [
|
|
36
|
+
i("span", m, [i("strong", null, u(s.count) + " selected", 1), s.locked ? n("", !0) : (c(), r(t, { key: 0 }, [a(" of " + u(s.totalCount) + " " + u(s.itemLabel), 1)], 64))]),
|
|
37
|
+
s.locked ? (c(), r("span", h, " Only the selected " + u(s.itemLabel) + " are shown. The table is locked until you apply or cancel. ", 1)) : (c(), r(t, { key: 1 }, [i("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
class: "link link-primary",
|
|
40
|
+
"data-testid": "selection-select-all",
|
|
41
|
+
onClick: y[0] ||= (e) => v("selectAllVisible")
|
|
42
|
+
}, " Select all " + u(s.visibleCount) + " visible ", 1), i("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
class: "link link-primary",
|
|
45
|
+
"data-testid": "selection-clear",
|
|
46
|
+
onClick: y[1] ||= (e) => v("clear")
|
|
47
|
+
}, " Clear selection ")], 64)),
|
|
48
|
+
l(_.$slots, "notice")
|
|
49
|
+
], 64)), i("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
class: "btn btn-sm btn-primary ml-auto",
|
|
52
|
+
disabled: s.count === 0 || s.locked,
|
|
53
|
+
"data-testid": "selection-bulk-edit",
|
|
54
|
+
onClick: y[2] ||= (e) => v("bulkEdit")
|
|
55
|
+
}, [o(d(e), { class: "size-3.5" }), y[3] ||= a(" Bulk edit ", -1)], 8, g)]));
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//#endregion
|
|
59
|
+
export { _ as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { computed as e, shallowRef as t, watch as n } from "vue";
|
|
2
|
+
//#region lib/table/selection/use-row-selection.ts
|
|
3
|
+
function r(r) {
|
|
4
|
+
let { allKeys: i, visibleKeys: a } = r, o = t(/* @__PURE__ */ new Set());
|
|
5
|
+
n(() => i(), (e) => {
|
|
6
|
+
let t = new Set(e), n = [...o.value].filter((e) => t.has(e));
|
|
7
|
+
n.length !== o.value.size && (o.value = new Set(n));
|
|
8
|
+
}, { flush: "sync" });
|
|
9
|
+
let s = e(() => o.value.size), c = e(() => i().length), l = e(() => a().length), u = e(() => i().filter((e) => o.value.has(e))), d = e(() => {
|
|
10
|
+
let e = a(), t = e.filter((e) => o.value.has(e)).length;
|
|
11
|
+
return t === 0 ? "none" : t === e.length ? "all" : "some";
|
|
12
|
+
});
|
|
13
|
+
function f(e) {
|
|
14
|
+
return o.value.has(e);
|
|
15
|
+
}
|
|
16
|
+
function p(e) {
|
|
17
|
+
let t = new Set(o.value);
|
|
18
|
+
t.delete(e) || t.add(e), o.value = t;
|
|
19
|
+
}
|
|
20
|
+
function m() {
|
|
21
|
+
o.value = /* @__PURE__ */ new Set([...o.value, ...a()]);
|
|
22
|
+
}
|
|
23
|
+
function h() {
|
|
24
|
+
if (d.value !== "all") {
|
|
25
|
+
m();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let e = new Set(a());
|
|
29
|
+
o.value = new Set([...o.value].filter((t) => !e.has(t)));
|
|
30
|
+
}
|
|
31
|
+
function g() {
|
|
32
|
+
o.value = /* @__PURE__ */ new Set();
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
count: s,
|
|
36
|
+
totalCount: c,
|
|
37
|
+
visibleCount: l,
|
|
38
|
+
selectedKeys: u,
|
|
39
|
+
headerState: d,
|
|
40
|
+
isSelected: f,
|
|
41
|
+
toggle: p,
|
|
42
|
+
selectAllVisible: m,
|
|
43
|
+
toggleAllVisible: h,
|
|
44
|
+
clear: g
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { r as useRowSelection };
|