@shwfed/config 2.12.5 → 2.12.6
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/module.json +1 -1
- package/dist/module.mjs +5 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +68 -68
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +34 -34
- package/dist/runtime/components/config/index.vue +23 -3
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +16 -16
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +10 -10
- package/dist/runtime/components/sidebar/index.d.vue.ts +22 -3
- package/dist/runtime/components/sidebar/index.vue +66 -5
- package/dist/runtime/components/sidebar/index.vue.d.ts +22 -3
- package/dist/runtime/components/sidebar/node.d.vue.ts +1 -1
- package/dist/runtime/components/sidebar/node.vue +33 -13
- package/dist/runtime/components/sidebar/node.vue.d.ts +1 -1
- package/dist/runtime/components/sidebar/tree.vue +113 -83
- package/dist/runtime/components/sidebar/types.d.ts +8 -0
- package/dist/runtime/components/sidebar/types.js +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +12 -12
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +12 -12
- package/dist/runtime/components/table/schema.d.ts +68 -68
- package/dist/runtime/components/table/utils/row-reorder.d.ts +3 -2
- package/dist/runtime/components/table/utils/row-reorder.js +1 -12
- package/dist/runtime/components/tabs/index.d.vue.ts +9 -0
- package/dist/runtime/components/tabs/index.vue +92 -0
- package/dist/runtime/components/tabs/index.vue.d.ts +9 -0
- package/dist/runtime/components/tabs/tab.d.vue.ts +22 -0
- package/dist/runtime/components/tabs/tab.vue +85 -0
- package/dist/runtime/components/tabs/tab.vue.d.ts +22 -0
- package/dist/runtime/components/tabs/types.d.ts +19 -0
- package/dist/runtime/components/tabs/types.js +0 -0
- package/dist/runtime/components/tabs/use-reorder.d.ts +10 -0
- package/dist/runtime/components/tabs/use-reorder.js +90 -0
- package/dist/runtime/components/tabs/use-tabs.d.ts +46 -0
- package/dist/runtime/components/tabs/use-tabs.js +101 -0
- package/dist/runtime/components/ui/sidebar/SidebarMenuAction.vue +1 -1
- package/dist/runtime/components/ui/sidebar/index.js +2 -2
- package/dist/runtime/share/reorder.d.ts +2 -0
- package/dist/runtime/share/reorder.js +12 -0
- package/dist/runtime/utils/nav-registry.d.ts +19 -0
- package/dist/runtime/utils/nav-registry.js +14 -0
- package/dist/runtime/utils/page-title-registry.d.ts +3 -0
- package/dist/runtime/utils/page-title-registry.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { effectScope, ref } from "vue";
|
|
2
|
+
import { useSessionStorage } from "@vueuse/core";
|
|
3
|
+
import { getLocalizedText } from "../../share/locale.js";
|
|
4
|
+
import { readNavLabel } from "../../utils/nav-registry.js";
|
|
5
|
+
import { readPageTitle } from "../../utils/page-title-registry.js";
|
|
6
|
+
import { applyReorder } from "../../share/reorder.js";
|
|
7
|
+
export function createTabStore(storageKey) {
|
|
8
|
+
const tabs = useSessionStorage(storageKey, []);
|
|
9
|
+
const activePath = ref(null);
|
|
10
|
+
function indexOf(path) {
|
|
11
|
+
return tabs.value.findIndex((t) => t.path === path);
|
|
12
|
+
}
|
|
13
|
+
function openOrFocus(path, fullPath) {
|
|
14
|
+
const existing = tabs.value.find((t) => t.path === path);
|
|
15
|
+
if (existing) {
|
|
16
|
+
if (existing.fullPath !== fullPath) {
|
|
17
|
+
tabs.value = tabs.value.map((t) => t.path === path ? { ...t, fullPath } : t);
|
|
18
|
+
}
|
|
19
|
+
} else {
|
|
20
|
+
tabs.value = [...tabs.value, { path, fullPath }];
|
|
21
|
+
}
|
|
22
|
+
activePath.value = path;
|
|
23
|
+
}
|
|
24
|
+
function close(path, home) {
|
|
25
|
+
const idx = indexOf(path);
|
|
26
|
+
if (idx < 0) return null;
|
|
27
|
+
const target = tabs.value[idx];
|
|
28
|
+
if (!target || target.pinned) return null;
|
|
29
|
+
const wasActive = activePath.value === path;
|
|
30
|
+
const next = tabs.value.slice(0, idx).concat(tabs.value.slice(idx + 1));
|
|
31
|
+
tabs.value = next;
|
|
32
|
+
if (!wasActive) return null;
|
|
33
|
+
const neighbor = next[idx] ?? next[idx - 1] ?? null;
|
|
34
|
+
if (neighbor) {
|
|
35
|
+
activePath.value = neighbor.path;
|
|
36
|
+
return neighbor.fullPath;
|
|
37
|
+
}
|
|
38
|
+
activePath.value = null;
|
|
39
|
+
return home ?? null;
|
|
40
|
+
}
|
|
41
|
+
function closeOthers(path) {
|
|
42
|
+
tabs.value = tabs.value.filter((t) => t.pinned || t.path === path);
|
|
43
|
+
if (activePath.value === path) return null;
|
|
44
|
+
const target = tabs.value.find((t) => t.path === path);
|
|
45
|
+
if (target) {
|
|
46
|
+
activePath.value = path;
|
|
47
|
+
return target.fullPath;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
function closeToRight(path) {
|
|
52
|
+
const idx = indexOf(path);
|
|
53
|
+
if (idx < 0) return null;
|
|
54
|
+
const removed = new Set(
|
|
55
|
+
tabs.value.slice(idx + 1).filter((t) => !t.pinned).map((t) => t.path)
|
|
56
|
+
);
|
|
57
|
+
if (removed.size === 0) return null;
|
|
58
|
+
tabs.value = tabs.value.filter((t) => !removed.has(t.path));
|
|
59
|
+
if (activePath.value && removed.has(activePath.value)) {
|
|
60
|
+
activePath.value = path;
|
|
61
|
+
return tabs.value.find((t) => t.path === path)?.fullPath ?? null;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
function reorder(sourcePath, targetPath, instruction) {
|
|
66
|
+
const src = indexOf(sourcePath);
|
|
67
|
+
const tgt = indexOf(targetPath);
|
|
68
|
+
if (src < 0 || tgt < 0) return;
|
|
69
|
+
const next = applyReorder(tabs.value, src, tgt, instruction);
|
|
70
|
+
if (next !== tabs.value) tabs.value = next;
|
|
71
|
+
}
|
|
72
|
+
function resolveTitle(tab, locale) {
|
|
73
|
+
const fromPage = getLocalizedText(readPageTitle(tab.path), locale);
|
|
74
|
+
if (fromPage) return fromPage;
|
|
75
|
+
const fromNav = readNavLabel(tab.fullPath, tab.path)?.label;
|
|
76
|
+
if (fromNav) return fromNav;
|
|
77
|
+
return tab.path;
|
|
78
|
+
}
|
|
79
|
+
function hasTab(path) {
|
|
80
|
+
return indexOf(path) >= 0;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
tabs,
|
|
84
|
+
activePath,
|
|
85
|
+
openOrFocus,
|
|
86
|
+
close,
|
|
87
|
+
closeOthers,
|
|
88
|
+
closeToRight,
|
|
89
|
+
reorder,
|
|
90
|
+
resolveTitle,
|
|
91
|
+
hasTab
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
let singleton = null;
|
|
95
|
+
export function useTabStore(storageKey = "shwfed:tabs") {
|
|
96
|
+
if (!singleton) {
|
|
97
|
+
const scope = effectScope(true);
|
|
98
|
+
singleton = scope.run(() => createTabStore(storageKey));
|
|
99
|
+
}
|
|
100
|
+
return singleton;
|
|
101
|
+
}
|
|
@@ -14,7 +14,7 @@ const props = defineProps({
|
|
|
14
14
|
data-slot="sidebar-menu-action"
|
|
15
15
|
data-sidebar="menu-action"
|
|
16
16
|
:class="cn(
|
|
17
|
-
'text-zinc-500 absolute top-1/2 right-0.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform [&>svg]:size-4 [&>svg]:shrink-0 cursor-
|
|
17
|
+
'text-zinc-500 absolute top-1/2 right-0.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform [&>svg]:size-4 [&>svg]:shrink-0 cursor-default',
|
|
18
18
|
'after:absolute after:-inset-2 md:after:hidden',
|
|
19
19
|
'peer-data-[size=sm]/menu-button:top-1',
|
|
20
20
|
'peer-data-[size=default]/menu-button:top-1.5',
|
|
@@ -24,11 +24,11 @@ export { default as SidebarSeparator } from "./SidebarSeparator.vue";
|
|
|
24
24
|
export { default as SidebarTrigger } from "./SidebarTrigger.vue";
|
|
25
25
|
export { useSidebar } from "./utils.js";
|
|
26
26
|
export const sidebarMenuButtonVariants = cva(
|
|
27
|
-
"peer/menu-button cursor-
|
|
27
|
+
"peer/menu-button cursor-default flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding,color] duration-180 hover:bg-zinc-100 hover:text-zinc-900 active:bg-zinc-100 active:text-zinc-900 disabled:pointer-events-none disabled:opacity-50 group-has-[>[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-[color-mix(in_srgb,var(--primary)_10%,white)] data-[active=true]:text-(--primary) data-[active=true]:font-mediumdata-[state=open]:hover:bg-zinc-100 data-[state=open]:hover:text-zinc-900 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
28
28
|
{
|
|
29
29
|
variants: {
|
|
30
30
|
variant: {
|
|
31
|
-
default: "
|
|
31
|
+
default: "text-zinc-800",
|
|
32
32
|
outline: "bg-white shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-zinc-100 hover:text-zinc-900 hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
33
33
|
},
|
|
34
34
|
size: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function applyReorder(items, sourceIndex, targetIndex, position) {
|
|
2
|
+
if (sourceIndex === targetIndex) return items;
|
|
3
|
+
if (sourceIndex < 0 || sourceIndex >= items.length) return items;
|
|
4
|
+
if (targetIndex < 0 || targetIndex >= items.length) return items;
|
|
5
|
+
let insertIdx = targetIndex + (position === "reorder-below" ? 1 : 0);
|
|
6
|
+
if (sourceIndex < targetIndex) insertIdx -= 1;
|
|
7
|
+
if (insertIdx === sourceIndex) return items;
|
|
8
|
+
const next = items.slice();
|
|
9
|
+
const [moved] = next.splice(sourceIndex, 1);
|
|
10
|
+
next.splice(insertIdx, 0, moved);
|
|
11
|
+
return next;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route → nav-label index, published by the sidebar and read by the tab strip.
|
|
3
|
+
* A client singleton (not a Nuxt injection). This is title source #2 in the
|
|
4
|
+
* tab-title precedence chain (page title → nav label → raw path).
|
|
5
|
+
*
|
|
6
|
+
* Two indexes so a tab title can be QUERY-AWARE while tab identity stays
|
|
7
|
+
* path-only: `fullMap` keys by the node's exact route (path + query, hash
|
|
8
|
+
* stripped) so `/orders?status=open` and `/orders?status=closed` resolve to
|
|
9
|
+
* their own labels; `pathMap` keys by path (first-wins) as the fallback for a
|
|
10
|
+
* location that matches no exact node route. The sidebar owns the whole map
|
|
11
|
+
* (one nav per app), so publishing wholesale-replaces both.
|
|
12
|
+
*/
|
|
13
|
+
export interface NavLabel {
|
|
14
|
+
label: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function publishNavLabels(full: Map<string, NavLabel>, path: Map<string, NavLabel>): void;
|
|
18
|
+
export declare function clearNavLabels(): void;
|
|
19
|
+
export declare function readNavLabel(fullPath: string, path: string): NavLabel | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
const fullMap = ref(/* @__PURE__ */ new Map());
|
|
3
|
+
const pathMap = ref(/* @__PURE__ */ new Map());
|
|
4
|
+
export function publishNavLabels(full, path) {
|
|
5
|
+
fullMap.value = new Map(full);
|
|
6
|
+
pathMap.value = new Map(path);
|
|
7
|
+
}
|
|
8
|
+
export function clearNavLabels() {
|
|
9
|
+
if (fullMap.value.size > 0) fullMap.value = /* @__PURE__ */ new Map();
|
|
10
|
+
if (pathMap.value.size > 0) pathMap.value = /* @__PURE__ */ new Map();
|
|
11
|
+
}
|
|
12
|
+
export function readNavLabel(fullPath, path) {
|
|
13
|
+
return fullMap.value.get(fullPath.split("#")[0] ?? fullPath) ?? pathMap.value.get(path);
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
const registry = ref(/* @__PURE__ */ new Map());
|
|
3
|
+
export function publishPageTitle(path, title) {
|
|
4
|
+
const next = new Map(registry.value);
|
|
5
|
+
if (title && title.length > 0) next.set(path, title);
|
|
6
|
+
else next.delete(path);
|
|
7
|
+
registry.value = next;
|
|
8
|
+
}
|
|
9
|
+
export function readPageTitle(path) {
|
|
10
|
+
return registry.value.get(path);
|
|
11
|
+
}
|