@xleddyl/443-components-vue 0.16.106 → 0.16.107
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/CATALOG.md +2 -2
- package/README.md +1 -1
- package/dist/components/layout/AppShell.vue +18 -1
- package/dist/components/layout/NavLink.vue +18 -2
- package/dist/components/layout/NavLink.vue.d.ts +3 -3
- package/dist/components/layout/PageHeader.vue +30 -3
- package/dist/components/layout/PageHeader.vue.d.ts +9 -2
- package/dist/icons/builtin.d.ts +3 -0
- package/dist/icons/builtin.mjs +9 -0
- package/dist/internal/layout/NavGroup.vue +13 -2
- package/dist/internal/layout/NavGroup.vue.d.ts +2 -2
- package/dist/internal/overlays/DialogFrame.vue +9 -2
- package/dist/internal/overlays/dock.d.ts +2 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -253,7 +253,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
253
253
|
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
254
254
|
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
|
255
255
|
| `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle, dashed: a centered add or empty tile), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `disabledReason` (with `disabled` on a button or link card: it stays focusable with `aria-disabled`, ignores clicks and shows the reason in a tooltip and as its description), `animated`, `fill` (takes the rest of the parent height, the body is a scrolling flex column, the footer pinned at the bottom). Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
|
|
256
|
-
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs` (small trail above the title), `trail` (the earlier levels as links: the title becomes a breadcrumb trail whose last item is the heading), `trailLabel`, `level`, `bordered`, `align`, `truncate` (one line; with a `trail` the title keeps a minimum width and the earlier crumbs truncate), `size` (`md`, `sm` for a panel or inspector header). Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`.
|
|
256
|
+
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs` (small trail above the title), `trail` (the earlier levels as links: the title becomes a breadcrumb trail whose last item is the heading), `trailLabel`, `level`, `bordered`, `align`, `truncate` (one line; with a `trail` the title keeps a minimum width and the earlier crumbs truncate), `size` (`md`, `sm` for a panel or inspector header), `dockToggle` (default `true`: on a page with a docked drawer in a wide shell, a button at the end of the actions detaches or docks the dock, `detachLabel`, `attachLabel`). Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
|
|
257
257
|
| `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`sm` for panel headers, `md`, `lg` for a title sized trail), `heading` (the current item is a heading of that level). Slot: `item`. | `layout/breadcrumbs.vue` |
|
|
258
258
|
| `Stepper` | Step indicator for wizards and multi step flows (import, checkout). Horizontal or vertical, compact on narrow widths. | Model: `v-model` (current step value). Props: `steps` (`value`, `label`, `description`, `icon`, `disabled`, `state`: `complete` or `error`), `label`, `orientation`, `size`, `linear` (only completed and current steps clickable), `readonly`, `compact` (`'auto'` by default, `true`, `false`), `summary` (false hides the compact "Step 2 of 4" line), `positionLabel`, `completeLabel`, `errorLabel`. Event: `select`. | `layout/stepper.vue` |
|
|
259
259
|
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `color` (a palette name or hex, a dot before the label), `badge`, `badgeTone`, `dot`, `title` (a tooltip on hover and focus, also on a disabled tab; native `title` until mount), `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`. | `layout/tabs.vue` |
|
|
@@ -265,7 +265,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
265
265
|
| `Toolbar` | Group of controls with arrow key navigation (ARIA toolbar). | Props: `label`, `orientation`, `roving`, `bordered`. | `layout/toolbar.vue` |
|
|
266
266
|
| `CopyButton` | Button that copies a value and shows "copied". | Props: `value`, `label`, `copiedLabel`, `showLabel`, `size`, `variant`, `tone`, `resetAfter`. Event: `copy(success)`. | `layout/copy-button.vue` |
|
|
267
267
|
| `ThemeSwitch` | Light, dark and system switch. | Props: `variant` (segmented, icon), `size`, `showLabels`. | `layout/theme-switch.vue` |
|
|
268
|
-
| `NavLink` | One navigation link with icon, badge and active state. | Props: `label`, `to`, `href`, `icon`, `badge`, `active`, `match` (exact, prefix), `external`, `disabled`. Slots: default, `icon`.
|
|
268
|
+
| `NavLink` | One navigation link with icon, badge and active state. | Props: `label`, `to`, `href`, `icon`, `badge`, `active`, `match` (exact, prefix), `external`, `disabled`. In the collapsed rail the label shows as a tooltip on hover and focus (also for a group). Slots: default, `icon`. | `layout/nav-link.vue` |
|
|
269
269
|
| `AppShell` | App frame: sidebar, topbar, mobile menu, collapse, skip link. Use it for a custom frame. Use `DashboardLayout` for the ready one. | Models: `v-model:collapsed`, `v-model:open`. Props: `variant` (inset, sidebar, floating), `content` (`page`, `fill`, `centered`, `bleed`), `fluid`, `fill`, `topbar`, `storageKey` (collapsed state in the preferences store), `dockStorageKey`, `dockLabel`, `dockEmptyTitle`, `dockEmptyDescription`, `dockResizeLabel` (the dock of docked drawers on the right: shown while a page has a mounted `docked` drawer, empty state, resize handle, width in the preferences store under `dock:<key>`), `shortcut`, `loading` (hides the page content and shows a page skeleton, `aria-busy` on `main`), `loadingLabel`. Slots: default, `sidebar`, `topbar`, `overlays`, `loading` (replaces the default page skeleton). | `layout/app-shell.vue` |
|
|
270
270
|
| `Sidebar` | Sidebar content with header, collapse button and footer. Goes in the `sidebar` slot of `AppShell`. | Props: `label`, `collapsible`, `collapseLabel`, `brandAlign` (`start`, `center`). Icons `sidebar-collapse` and `sidebar-expand` for the collapse button. Slots: default, `header`, `top`, `footer`. | `layout/app-shell.vue` |
|
|
271
271
|
| `SidebarNav` | Navigation list from data, with groups and children. | Props: `items` (`NavItem[]` or `NavSection[]`: `label`, `to`, `icon`, `badge`, `children`), `currentPath`. | `layout/app-shell.vue` |
|
package/README.md
CHANGED
|
@@ -778,7 +778,7 @@ const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?'
|
|
|
778
778
|
- It needs a `DashboardLayout` or an `AppShell` around the page, and a shell width of at least 1280px. Otherwise (and on a phone) it is the normal overlay drawer, and it changes mode while it is open when the window is resized.
|
|
779
779
|
- The shell shows a dock on the right of the page as long as a docked drawer is mounted, also while it is closed: a page with a docked drawer shows the empty state of the dock ("Nothing selected", `dockEmptyTitle` and `dockEmptyDescription` of the layout), and a page without one shows no dock. The open drawer fills the dock.
|
|
780
780
|
- The dock has a resize handle on its left edge (min 22rem, max 48rem and at most 45% of the shell, double click resets to 30rem). The width goes to the preferences store under `dock:<dockStorageKey>` (default `k-dock`, `false` keeps it only in memory).
|
|
781
|
-
- `size` gives the width of the overlay mode only.
|
|
781
|
+
- `size` gives the width of the overlay mode only. The dock can be detached: every docked drawer of the app then opens as a normal overlay and no page shows the dock. Two buttons change it: one in the header of a docked drawer (icon `dock-window` while docked, `dock-attach` in the overlay) and one at the end of the actions of `PageHeader` (`dock-detach` or `dock-attach`, `dockToggle: false` hides it), shown on every page with a docked drawer in a wide shell, also while the drawer is closed. Labels `detachLabel` and `attachLabel`. Alias the icons like the sidebar ones (`k.icons.aliases: { 'dock-attach': 'lucide:panel-right-open', 'dock-detach': 'lucide:panel-right-close', 'dock-window': 'lucide:app-window' }`). The choice is saved with the width (`dock:<dockStorageKey>`, `{ width, detached }`).
|
|
782
782
|
- A docked drawer is not modal: no backdrop, no scroll lock, focus stays where it was when it opens, and Escape closes it only when the focus is inside it (and no menu or nested dialog is open). The leave guard is the same: closing it, its trail and a navigation ask before they drop a dirty form.
|
|
783
783
|
- `useRouteRecord().openRecord(id)` asks the discard question when it replaces another open record (the user clicked another row with a dirty form). The default `beforeLeave` reads the topmost modal dialog, else the docked drawer. A discard accepted by a scope also answers the next question of the same scope in the same task, so a drawer that asks and then calls `openRecord()` asks once.
|
|
784
784
|
- Toasts move to the left of the dock.
|
|
@@ -277,6 +277,17 @@ const storedDock = computed(
|
|
|
277
277
|
const dockWidth = ref(storedDock.value.width ?? DOCK_WIDTH.initial);
|
|
278
278
|
const dockDetached = ref(storedDock.value.detached ?? false);
|
|
279
279
|
const dockResizing = ref(false);
|
|
280
|
+
const dockables = ref(0);
|
|
281
|
+
const dockAvailable = computed(() => dockables.value > 0 && dockWide.value);
|
|
282
|
+
function registerDockable() {
|
|
283
|
+
dockables.value += 1;
|
|
284
|
+
let registered = true;
|
|
285
|
+
return () => {
|
|
286
|
+
if (!registered) return;
|
|
287
|
+
registered = false;
|
|
288
|
+
dockables.value -= 1;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
280
291
|
const dockMax = computed(
|
|
281
292
|
() => Math.max(
|
|
282
293
|
DOCK_WIDTH.min,
|
|
@@ -316,7 +327,13 @@ useResizeObserver(
|
|
|
316
327
|
onBeforeUnmount(() => {
|
|
317
328
|
if (dockFrame.value && dockFrame.value === dockFrameRef.value) dockFrame.value = null;
|
|
318
329
|
});
|
|
319
|
-
provide(DOCK_KEY, {
|
|
330
|
+
provide(DOCK_KEY, {
|
|
331
|
+
target: dockSlot,
|
|
332
|
+
wide: dockWide,
|
|
333
|
+
detached: dockDetached,
|
|
334
|
+
available: dockAvailable,
|
|
335
|
+
register: registerDockable
|
|
336
|
+
});
|
|
320
337
|
provide(SHELL_KEY, {
|
|
321
338
|
sidebarId,
|
|
322
339
|
collapsed,
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
:bind="linkAttrs"
|
|
6
6
|
class="k-navlink"
|
|
7
7
|
:class="{ 'is-active': active, 'is-disabled': disabled }"
|
|
8
|
-
:title="rail ? label : void 0"
|
|
8
|
+
:title="rail && !mounted ? label : void 0"
|
|
9
9
|
:aria-label="railLabel"
|
|
10
10
|
@click="onClick"
|
|
11
|
+
@pointerenter="armHint"
|
|
12
|
+
@focusin="armHint"
|
|
11
13
|
>
|
|
12
14
|
<span v-if="icon || $slots.icon" class="k-navlink-icon" aria-hidden="true">
|
|
13
15
|
<slot name="icon"><Icon v-if="icon" :name="icon" /></slot>
|
|
@@ -18,13 +20,15 @@
|
|
|
18
20
|
<span v-if="badge !== void 0 && badge !== ''" class="k-navlink-badge">{{ badge }}</span>
|
|
19
21
|
<Icon v-if="external" name="arrow-right" class="k-navlink-external" />
|
|
20
22
|
<span v-if="external" class="k-visually-hidden">{{ t("common.opensInNewTab") }}</span>
|
|
23
|
+
<HintTooltip v-if="showHint" :text="label" placement="right" />
|
|
21
24
|
</Polymorphic>
|
|
22
25
|
</template>
|
|
23
26
|
|
|
24
27
|
<script setup>
|
|
25
28
|
import { linkHref } from "../../internal/core/link";
|
|
26
29
|
import { Polymorphic } from "../../internal/core/Polymorphic";
|
|
27
|
-
import { computed } from "vue";
|
|
30
|
+
import { computed, onMounted, ref, watch } from "vue";
|
|
31
|
+
import HintTooltip from "../../internal/overlays/HintTooltip.vue";
|
|
28
32
|
import { useAppShell } from "../../composables/useAppShell";
|
|
29
33
|
import { useLinkComponent } from "../../composables/useLink";
|
|
30
34
|
import { useLocale } from "../../composables/useLocale";
|
|
@@ -49,6 +53,18 @@ const railLabel = computed(() => {
|
|
|
49
53
|
if (!rail.value || !props.label) return void 0;
|
|
50
54
|
return props.external ? `${props.label} ${t("common.opensInNewTab")}` : props.label;
|
|
51
55
|
});
|
|
56
|
+
const mounted = ref(false);
|
|
57
|
+
const hintArmed = ref(false);
|
|
58
|
+
const showHint = computed(
|
|
59
|
+
() => rail.value && Boolean(props.label) && mounted.value && hintArmed.value
|
|
60
|
+
);
|
|
61
|
+
function armHint() {
|
|
62
|
+
if (rail.value && props.label) hintArmed.value = true;
|
|
63
|
+
}
|
|
64
|
+
watch(rail, (value) => {
|
|
65
|
+
if (!value) hintArmed.value = false;
|
|
66
|
+
});
|
|
67
|
+
onMounted(() => mounted.value = true);
|
|
52
68
|
const tag = computed(() => {
|
|
53
69
|
if (props.disabled) return "a";
|
|
54
70
|
if (props.to !== void 0 && linkComponent) return linkComponent;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IconName } from '../../composables/useIcons';
|
|
2
2
|
import type { LinkTarget } from '../core/types';
|
|
3
|
-
declare var
|
|
3
|
+
declare var __VLS_11: {}, __VLS_18: {};
|
|
4
4
|
type __VLS_Slots = {} & {
|
|
5
|
-
icon?: (props: typeof
|
|
5
|
+
icon?: (props: typeof __VLS_11) => any;
|
|
6
6
|
} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_18) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
10
10
|
label?: string;
|
|
@@ -59,8 +59,20 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
</div>
|
|
62
|
-
<div v-if="$slots.actions" class="k-page-header-actions">
|
|
62
|
+
<div v-if="$slots.actions || showDockToggle" class="k-page-header-actions">
|
|
63
63
|
<slot name="actions" />
|
|
64
|
+
<Button
|
|
65
|
+
v-if="showDockToggle"
|
|
66
|
+
variant="ghost"
|
|
67
|
+
tone="neutral"
|
|
68
|
+
size="sm"
|
|
69
|
+
square
|
|
70
|
+
class="k-page-header-dock"
|
|
71
|
+
:icon="dockDetached ? 'dock-attach' : 'dock-detach'"
|
|
72
|
+
:aria-label="dockDetached ? attachText : detachText"
|
|
73
|
+
:aria-pressed="dockDetached ? 'false' : 'true'"
|
|
74
|
+
@click="toggleDock"
|
|
75
|
+
/>
|
|
64
76
|
</div>
|
|
65
77
|
<div v-if="$slots.default" class="k-page-header-extra">
|
|
66
78
|
<slot />
|
|
@@ -69,7 +81,10 @@
|
|
|
69
81
|
</template>
|
|
70
82
|
|
|
71
83
|
<script setup>
|
|
72
|
-
import { computed } from "vue";
|
|
84
|
+
import { computed, inject } from "vue";
|
|
85
|
+
import { useLocale } from "../../composables/useLocale";
|
|
86
|
+
import { DOCK_KEY } from "../../internal/overlays/dock";
|
|
87
|
+
import Button from "../core/Button.vue";
|
|
73
88
|
import Icon from "../core/Icon.vue";
|
|
74
89
|
import Breadcrumbs from "./Breadcrumbs.vue";
|
|
75
90
|
const props = defineProps({
|
|
@@ -84,8 +99,20 @@ const props = defineProps({
|
|
|
84
99
|
bordered: { type: Boolean, required: false },
|
|
85
100
|
align: { type: String, required: false, default: "end" },
|
|
86
101
|
truncate: { type: Boolean, required: false },
|
|
87
|
-
size: { type: String, required: false, default: "md" }
|
|
102
|
+
size: { type: String, required: false, default: "md" },
|
|
103
|
+
dockToggle: { type: Boolean, required: false, default: true },
|
|
104
|
+
detachLabel: { type: String, required: false },
|
|
105
|
+
attachLabel: { type: String, required: false }
|
|
88
106
|
});
|
|
107
|
+
const { t } = useLocale();
|
|
108
|
+
const dockHost = inject(DOCK_KEY, null);
|
|
109
|
+
const showDockToggle = computed(() => Boolean(props.dockToggle && dockHost?.available.value));
|
|
110
|
+
const dockDetached = computed(() => Boolean(dockHost?.detached.value));
|
|
111
|
+
const detachText = computed(() => props.detachLabel ?? t("dock.detach"));
|
|
112
|
+
const attachText = computed(() => props.attachLabel ?? t("dock.attach"));
|
|
113
|
+
function toggleDock() {
|
|
114
|
+
if (dockHost) dockHost.detached.value = !dockHost.detached.value;
|
|
115
|
+
}
|
|
89
116
|
const trailItems = computed(() => [
|
|
90
117
|
...(props.trail ?? []).map(
|
|
91
118
|
(item) => props.truncate ? { ...item, attrs: { title: item.label, ...item.attrs } } : item
|
|
@@ -4,7 +4,7 @@ declare var __VLS_1: {}, __VLS_10: {
|
|
|
4
4
|
item: BreadcrumbItem;
|
|
5
5
|
index: number;
|
|
6
6
|
current: boolean;
|
|
7
|
-
}, __VLS_12: {}, __VLS_26: {}, __VLS_39: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {},
|
|
7
|
+
}, __VLS_12: {}, __VLS_26: {}, __VLS_39: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {}, __VLS_54: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
breadcrumbs?: (props: typeof __VLS_1) => any;
|
|
10
10
|
} & {
|
|
@@ -22,7 +22,7 @@ type __VLS_Slots = {} & {
|
|
|
22
22
|
} & {
|
|
23
23
|
actions?: (props: typeof __VLS_45) => any;
|
|
24
24
|
} & {
|
|
25
|
-
default?: (props: typeof
|
|
25
|
+
default?: (props: typeof __VLS_54) => any;
|
|
26
26
|
};
|
|
27
27
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
28
28
|
title?: string | undefined;
|
|
@@ -37,6 +37,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
37
37
|
align?: "start" | "center" | "end";
|
|
38
38
|
truncate?: boolean;
|
|
39
39
|
size?: PageHeaderSize;
|
|
40
|
+
dockToggle?: boolean;
|
|
41
|
+
detachLabel?: string;
|
|
42
|
+
attachLabel?: string;
|
|
40
43
|
innerHTML?: string | undefined | undefined;
|
|
41
44
|
class?: import("vue").ClassValue;
|
|
42
45
|
style?: import("vue").StyleValue;
|
|
@@ -241,6 +244,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
241
244
|
align?: "start" | "center" | "end";
|
|
242
245
|
truncate?: boolean;
|
|
243
246
|
size?: PageHeaderSize;
|
|
247
|
+
dockToggle?: boolean;
|
|
248
|
+
detachLabel?: string;
|
|
249
|
+
attachLabel?: string;
|
|
244
250
|
innerHTML?: string | undefined | undefined;
|
|
245
251
|
class?: import("vue").ClassValue;
|
|
246
252
|
style?: import("vue").StyleValue;
|
|
@@ -436,6 +442,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
436
442
|
size: PageHeaderSize;
|
|
437
443
|
align: "start" | "center" | "end";
|
|
438
444
|
level: HeadingLevel;
|
|
445
|
+
dockToggle: boolean;
|
|
439
446
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
440
447
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
441
448
|
declare const _default: typeof __VLS_export;
|
package/dist/icons/builtin.d.ts
CHANGED
|
@@ -74,6 +74,9 @@ export declare const builtinIcons: {
|
|
|
74
74
|
readonly cube: readonly ["m21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"];
|
|
75
75
|
readonly bolt: readonly ["m3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75L12 13.5z"];
|
|
76
76
|
readonly 'adjustments-horizontal': readonly ["M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"];
|
|
77
|
+
readonly 'dock-attach': readonly ["M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM15 5.25v13.5M10.5 9.75 8.25 12l2.25 2.25"];
|
|
78
|
+
readonly 'dock-detach': readonly ["M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM15 5.25v13.5M8.25 9.75 10.5 12l-2.25 2.25"];
|
|
79
|
+
readonly 'dock-window': readonly ["M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM2.25 9h19.5"];
|
|
77
80
|
readonly 'arrows-pointing-out': readonly ["M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"];
|
|
78
81
|
readonly 'arrows-pointing-in': readonly ["M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"];
|
|
79
82
|
readonly 'cursor-arrow-rays': readonly ["M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"];
|
package/dist/icons/builtin.mjs
CHANGED
|
@@ -176,6 +176,15 @@ export const builtinIcons = {
|
|
|
176
176
|
"adjustments-horizontal": [
|
|
177
177
|
"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"
|
|
178
178
|
],
|
|
179
|
+
"dock-attach": [
|
|
180
|
+
"M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM15 5.25v13.5M10.5 9.75 8.25 12l2.25 2.25"
|
|
181
|
+
],
|
|
182
|
+
"dock-detach": [
|
|
183
|
+
"M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM15 5.25v13.5M8.25 9.75 10.5 12l-2.25 2.25"
|
|
184
|
+
],
|
|
185
|
+
"dock-window": [
|
|
186
|
+
"M3.75 5.25h16.5a1.5 1.5 0 0 1 1.5 1.5v10.5a1.5 1.5 0 0 1-1.5 1.5H3.75a1.5 1.5 0 0 1-1.5-1.5V6.75a1.5 1.5 0 0 1 1.5-1.5ZM2.25 9h19.5"
|
|
187
|
+
],
|
|
179
188
|
"arrows-pointing-out": [
|
|
180
189
|
"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"
|
|
181
190
|
],
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
:aria-haspopup="rail ? 'menu' : void 0"
|
|
14
14
|
:aria-expanded="(rail ? menuOpen : open) ? 'true' : 'false'"
|
|
15
15
|
:aria-controls="rail ? menuId : panelId"
|
|
16
|
-
:title="rail ? item.label : void 0"
|
|
16
|
+
:title="rail && !mounted ? item.label : void 0"
|
|
17
17
|
@click="onClick"
|
|
18
18
|
@keydown="onKeydown"
|
|
19
19
|
@pointerdown="onPointerDown"
|
|
20
|
+
@pointerenter="armHint"
|
|
21
|
+
@focusin="armHint"
|
|
20
22
|
>
|
|
21
23
|
<span v-if="item.icon" class="k-navlink-icon" aria-hidden="true">
|
|
22
24
|
<Icon :name="item.icon" />
|
|
@@ -26,6 +28,7 @@
|
|
|
26
28
|
{{ item.badge }}
|
|
27
29
|
</span>
|
|
28
30
|
<Icon name="chevron-right" class="k-navgroup-chevron" />
|
|
31
|
+
<HintTooltip v-if="showHint" :text="item.label" placement="right" />
|
|
29
32
|
</button>
|
|
30
33
|
<div :id="panelId" class="k-navgroup-panel" :inert="open && !rail ? void 0 : true">
|
|
31
34
|
<div class="k-navgroup-list">
|
|
@@ -47,8 +50,9 @@
|
|
|
47
50
|
</template>
|
|
48
51
|
|
|
49
52
|
<script setup>
|
|
50
|
-
import { computed, ref, useTemplateRef, watch } from "vue";
|
|
53
|
+
import { computed, onMounted, ref, useTemplateRef, watch } from "vue";
|
|
51
54
|
import Icon from "../../components/core/Icon.vue";
|
|
55
|
+
import HintTooltip from "../overlays/HintTooltip.vue";
|
|
52
56
|
import { useInvoker } from "../floating/trigger";
|
|
53
57
|
import MenuList from "../overlays/MenuList.vue";
|
|
54
58
|
import { menuTriggerHandlers } from "../overlays/menu";
|
|
@@ -64,6 +68,13 @@ const menuId = computed(() => `${props.panelId}-menu`);
|
|
|
64
68
|
const triggerRef = useTemplateRef("triggerRef");
|
|
65
69
|
const menuRef = useTemplateRef("menuRef");
|
|
66
70
|
const menuOpen = ref(false);
|
|
71
|
+
const mounted = ref(false);
|
|
72
|
+
const hintArmed = ref(false);
|
|
73
|
+
const showHint = computed(() => props.rail && !menuOpen.value && mounted.value && hintArmed.value);
|
|
74
|
+
function armHint() {
|
|
75
|
+
if (props.rail) hintArmed.value = true;
|
|
76
|
+
}
|
|
77
|
+
onMounted(() => mounted.value = true);
|
|
67
78
|
const railTrigger = computed(() => props.rail ? triggerRef.value : null);
|
|
68
79
|
const menuElement = computed(() => menuRef.value?.el ?? null);
|
|
69
80
|
function toMenuItem(item) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NavItem } from '../../components/layout/types';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_16: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_16) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
7
7
|
item: NavItem;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport :to="dockTarget" :disabled="!docked">
|
|
2
|
+
<Teleport :to="dockTarget ?? 'body'" :disabled="!docked">
|
|
3
3
|
<dialog
|
|
4
4
|
ref="dialogRef"
|
|
5
5
|
v-bind="$attrs"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<slot name="actions" :close="close" />
|
|
69
69
|
<Button
|
|
70
70
|
v-if="showDockToggle"
|
|
71
|
-
:icon="docked ? '
|
|
71
|
+
:icon="docked ? 'dock-window' : 'dock-attach'"
|
|
72
72
|
variant="ghost"
|
|
73
73
|
tone="neutral"
|
|
74
74
|
size="sm"
|
|
@@ -277,6 +277,13 @@ async function navigate(index) {
|
|
|
277
277
|
}
|
|
278
278
|
onMounted(() => {
|
|
279
279
|
mounted.value = true;
|
|
280
|
+
watch(
|
|
281
|
+
dockable,
|
|
282
|
+
(value, _previous, onCleanup) => {
|
|
283
|
+
if (value && dockHost) onCleanup(dockHost.register());
|
|
284
|
+
},
|
|
285
|
+
{ immediate: true }
|
|
286
|
+
);
|
|
280
287
|
if (dialogRef.value) setDialogScope(dialogRef.value, leave);
|
|
281
288
|
});
|
|
282
289
|
onBeforeUnmount(() => {
|
|
@@ -10,6 +10,8 @@ export interface DockHost {
|
|
|
10
10
|
target: Readonly<Ref<HTMLElement | null>>;
|
|
11
11
|
wide: Readonly<Ref<boolean>>;
|
|
12
12
|
detached: Ref<boolean>;
|
|
13
|
+
available: Readonly<Ref<boolean>>;
|
|
14
|
+
register: () => () => void;
|
|
13
15
|
}
|
|
14
16
|
export interface DockPreference {
|
|
15
17
|
width?: number;
|
package/package.json
CHANGED