@xleddyl/443-components-vue 0.16.107 → 0.16.109
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 +17 -17
- package/README.md +3 -2
- package/dist/components/core/Icon.vue +9 -7
- package/dist/components/forms/PaletteSelect.vue.d.ts +2 -2
- package/dist/components/layout/PageHeader.vue +8 -10
- package/dist/components/layout/PageHeader.vue.d.ts +0 -2
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +2 -2
- package/dist/components/overlays/ConfirmHost.vue.d.ts +2 -2
- package/dist/components/overlays/ContextMenu.vue.d.ts +2 -2
- package/dist/components/overlays/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/templates/EmptyPage.vue.d.ts +1 -1
- package/dist/components/templates/SettingsModal.vue.d.ts +2 -2
- package/dist/components/templates/SettingsSection.vue.d.ts +2 -2
- package/dist/composables/useIcons.d.ts +2 -2
- package/dist/icons/builtin.d.ts +9 -5
- package/dist/icons/builtin.mjs +6 -11
- package/dist/internal/overlays/DialogFrame.vue +34 -3
- package/dist/internal/overlays/OverlayView.vue.d.ts +2 -2
- package/dist/locale/de.mjs +1 -0
- package/dist/locale/en.mjs +1 -0
- package/dist/locale/it.mjs +1 -0
- package/dist/locale/types.d.ts +1 -0
- package/dist/styles/overlays/drawer.css +42 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -208,22 +208,22 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
|
|
|
208
208
|
|
|
209
209
|
Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
|
|
210
210
|
|
|
211
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
212
|
-
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
213
|
-
| `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `toolbar` (a full width row of controls under the title and the description, such as filters), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`.
|
|
214
|
-
| `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`), `docked` (a right drawer stays in the dock of `AppShell` beside the page, not modal, from 1280px of shell width; the dock shows an empty state while it is closed; a header button detaches or docks the whole dock, saved in the preferences, `detachLabel`, `attachLabel`). The body is a size container (`k-drawer`): use container queries inside. Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`.
|
|
215
|
-
| `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`.
|
|
216
|
-
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None.
|
|
217
|
-
| `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`).
|
|
218
|
-
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`.
|
|
219
|
-
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`.
|
|
220
|
-
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`.
|
|
221
|
-
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `width` (any CSS length, capped at the viewport), `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). `sheet` (a bottom sheet `Modal` with the same content when the viewport is 640px wide or less). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`.
|
|
222
|
-
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`.
|
|
223
|
-
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`.
|
|
224
|
-
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `meta` (inline secondary label), `highlight` (`{ label, description }` ranges `[start, end]` marked with `k-mark`), `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `disabled`, `disabledReason` (with `disabled`: reachable with the arrow keys but not selectable, a tooltip on hover and keyboard focus, linked with `aria-describedby`), `onSelect`), `search(query, signal)`, `pinned` (items or `(query) => items` shown first, never filtered or saved as recent), `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`.
|
|
225
|
-
| `CommandList` | The search field and grouped list of `CommandPalette` without the dialog: place it inline in a panel or in a `Popover` (with `anchor` for a picker opened next to any element). Arrow keys, Enter and the same matching. | Model: `v-model:query`. Props: the `CommandPalette` list props (`groups`, `search`, `pinned`, `filter`, `loading`, `placeholder`, `label`, `recentKey`, `emptyText`, `notice` and the copy props), `autofocus` (default `true`), `footer` (the key hints, default `false`). Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `close` (Escape). Exposed: `focus`, `refresh`.
|
|
226
|
-
| `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone).
|
|
211
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
212
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
213
|
+
| `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `toolbar` (a full width row of controls under the title and the description, such as filters), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/modal.vue` |
|
|
214
|
+
| `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`), `docked` (a right drawer stays in the dock of `AppShell` beside the page, not modal, from 1280px of shell width; the dock shows an empty state while it is closed; a header button detaches or docks the whole dock, saved in the preferences, `detachLabel`, `attachLabel`; in the dock the `#actions` slot is an "Actions" menu and there is no close button; the overlay is at most 48rem wide). The body is a size container (`k-drawer`): use container queries inside. Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/drawer.vue` |
|
|
215
|
+
| `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`. | `overlays/confirm-dialog.vue` |
|
|
216
|
+
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
|
|
217
|
+
| `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`). | `overlays/hooks.vue` |
|
|
218
|
+
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
|
|
219
|
+
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
|
|
220
|
+
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
|
|
221
|
+
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `width` (any CSS length, capped at the viewport), `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). `sheet` (a bottom sheet `Modal` with the same content when the viewport is 640px wide or less). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`. | `overlays/popover.vue` |
|
|
222
|
+
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
|
|
223
|
+
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
|
|
224
|
+
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `meta` (inline secondary label), `highlight` (`{ label, description }` ranges `[start, end]` marked with `k-mark`), `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `disabled`, `disabledReason` (with `disabled`: reachable with the arrow keys but not selectable, a tooltip on hover and keyboard focus, linked with `aria-describedby`), `onSelect`), `search(query, signal)`, `pinned` (items or `(query) => items` shown first, never filtered or saved as recent), `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
|
|
225
|
+
| `CommandList` | The search field and grouped list of `CommandPalette` without the dialog: place it inline in a panel or in a `Popover` (with `anchor` for a picker opened next to any element). Arrow keys, Enter and the same matching. | Model: `v-model:query`. Props: the `CommandPalette` list props (`groups`, `search`, `pinned`, `filter`, `loading`, `placeholder`, `label`, `recentKey`, `emptyText`, `notice` and the copy props), `autofocus` (default `true`), `footer` (the key hints, default `false`). Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `close` (Escape). Exposed: `focus`, `refresh`. | `overlays/command-palette.vue` |
|
|
226
|
+
| `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone). | `overlays/command-palette.vue` |
|
|
227
227
|
|
|
228
228
|
## Data
|
|
229
229
|
|
|
@@ -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), `dockToggle` (default `true`: on a page with a docked drawer in a wide shell, a button at the end of the actions
|
|
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`: while the dock is detached, on a page with a docked drawer in a wide shell, a button at the end of the actions docks it again, `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` |
|
package/README.md
CHANGED
|
@@ -321,7 +321,7 @@ The Nuxt module still writes the theme (`k-theme`), the preset (`k-preset`) and
|
|
|
321
321
|
`<KIcon name="..." />` resolves a name in this order:
|
|
322
322
|
|
|
323
323
|
1. Icons registered with `createIcons()`, `provideIcons()`, `k.icons.dir` or `k.icons.aliases`. A registered name replaces a built-in one, so `k.icons.aliases: { 'x-mark': 'lucide:x' }` changes the close icon of every component.
|
|
324
|
-
2. The built-in Heroicons outline set (`builtinIcons`, the icons the components use).
|
|
324
|
+
2. The built-in Heroicons outline set (`builtinIcons`, the icons the components use). A path of a built-in icon is a stroked string, or `{ d, fill: true }` for a filled part (the small panel of `dock-attach`).
|
|
325
325
|
3. Iconify collections, written `prefix:name` (`heroicons:newspaper`, `lucide:file-text`). Names without a prefix also try `k.icons.defaultCollection`.
|
|
326
326
|
|
|
327
327
|
Collections come from the `@iconify-json/*` packages (or `@iconify/json`), installed in the host:
|
|
@@ -778,7 +778,8 @@ 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. The dock can be detached: every docked drawer of the app then opens as a normal overlay and no page shows the dock.
|
|
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. The header of a docked drawer has the detach button (icon `dock-detach`, a pop out); the header of the overlay and the end of the actions of `PageHeader` (only while detached, on a page with a docked drawer in a wide shell, `dockToggle: false` hides it) have the dock button (icon `dock-attach`, a frame with a small filled panel on the right). Labels `detachLabel` and `attachLabel`. The choice is saved with the width (`dock:<dockStorageKey>`, `{ width, detached }`).
|
|
782
|
+
- In the dock the header has no close button (Escape, the cancel button of the footer or a click on another row change it), and the `#actions` slot moves into an "Actions" menu (a soft button with a popover; the buttons of the slot show as menu rows, and a click on one closes the menu unless it opens a menu of its own). The overlay of a docked drawer is at most 48rem wide (the maximum width of the dock), also with `size="xl"` or `"full"`.
|
|
782
783
|
- 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
784
|
- `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
785
|
- Toasts move to the left of the dock.
|
|
@@ -15,13 +15,15 @@
|
|
|
15
15
|
stroke-width="1.5"
|
|
16
16
|
>
|
|
17
17
|
<title v-if="label">{{ label }}</title>
|
|
18
|
-
<path
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<template v-for="path in resolved.paths" :key="typeof path === 'string' ? path : path.d">
|
|
19
|
+
<path
|
|
20
|
+
v-if="typeof path === 'string'"
|
|
21
|
+
:d="path"
|
|
22
|
+
stroke-linecap="round"
|
|
23
|
+
stroke-linejoin="round"
|
|
24
|
+
/>
|
|
25
|
+
<path v-else :d="path.d" fill="currentColor" stroke="none" />
|
|
26
|
+
</template>
|
|
25
27
|
</svg>
|
|
26
28
|
<svg
|
|
27
29
|
v-else-if="resolved?.kind === 'svg'"
|
|
@@ -16,13 +16,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
16
16
|
style?: unknown;
|
|
17
17
|
modelValue?: ColorValue | "custom" | null | undefined;
|
|
18
18
|
key?: PropertyKey | undefined;
|
|
19
|
+
search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
|
|
19
20
|
loading?: boolean | undefined;
|
|
20
21
|
prefix?: string | undefined | undefined;
|
|
21
22
|
icon?: import("../../index.ts").IconName | undefined;
|
|
22
23
|
value?: any;
|
|
23
24
|
filter?: ((option: ComboboxOption<PaletteOptionValue>, query: string) => boolean) | undefined;
|
|
24
25
|
form?: string | undefined | undefined;
|
|
25
|
-
search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
|
|
26
26
|
required?: boolean | undefined;
|
|
27
27
|
min?: (string | number) | undefined;
|
|
28
28
|
max?: (string | number) | undefined;
|
|
@@ -286,13 +286,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
286
286
|
style?: unknown;
|
|
287
287
|
modelValue?: ColorValue | "custom" | null | undefined;
|
|
288
288
|
key?: PropertyKey | undefined;
|
|
289
|
+
search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
|
|
289
290
|
loading?: boolean | undefined;
|
|
290
291
|
prefix?: string | undefined | undefined;
|
|
291
292
|
icon?: import("../../index.ts").IconName | undefined;
|
|
292
293
|
value?: any;
|
|
293
294
|
filter?: ((option: ComboboxOption<PaletteOptionValue>, query: string) => boolean) | undefined;
|
|
294
295
|
form?: string | undefined | undefined;
|
|
295
|
-
search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
|
|
296
296
|
required?: boolean | undefined;
|
|
297
297
|
min?: (string | number) | undefined;
|
|
298
298
|
max?: (string | number) | undefined;
|
|
@@ -68,10 +68,9 @@
|
|
|
68
68
|
size="sm"
|
|
69
69
|
square
|
|
70
70
|
class="k-page-header-dock"
|
|
71
|
-
|
|
72
|
-
:aria-label="
|
|
73
|
-
|
|
74
|
-
@click="toggleDock"
|
|
71
|
+
icon="dock-attach"
|
|
72
|
+
:aria-label="attachText"
|
|
73
|
+
@click="attachDock"
|
|
75
74
|
/>
|
|
76
75
|
</div>
|
|
77
76
|
<div v-if="$slots.default" class="k-page-header-extra">
|
|
@@ -101,17 +100,16 @@ const props = defineProps({
|
|
|
101
100
|
truncate: { type: Boolean, required: false },
|
|
102
101
|
size: { type: String, required: false, default: "md" },
|
|
103
102
|
dockToggle: { type: Boolean, required: false, default: true },
|
|
104
|
-
detachLabel: { type: String, required: false },
|
|
105
103
|
attachLabel: { type: String, required: false }
|
|
106
104
|
});
|
|
107
105
|
const { t } = useLocale();
|
|
108
106
|
const dockHost = inject(DOCK_KEY, null);
|
|
109
|
-
const showDockToggle = computed(
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
const showDockToggle = computed(
|
|
108
|
+
() => Boolean(props.dockToggle && dockHost?.available.value && dockHost.detached.value)
|
|
109
|
+
);
|
|
112
110
|
const attachText = computed(() => props.attachLabel ?? t("dock.attach"));
|
|
113
|
-
function
|
|
114
|
-
if (dockHost) dockHost.detached.value =
|
|
111
|
+
function attachDock() {
|
|
112
|
+
if (dockHost) dockHost.detached.value = false;
|
|
115
113
|
}
|
|
116
114
|
const trailItems = computed(() => [
|
|
117
115
|
...(props.trail ?? []).map(
|
|
@@ -38,7 +38,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
38
38
|
truncate?: boolean;
|
|
39
39
|
size?: PageHeaderSize;
|
|
40
40
|
dockToggle?: boolean;
|
|
41
|
-
detachLabel?: string;
|
|
42
41
|
attachLabel?: string;
|
|
43
42
|
innerHTML?: string | undefined | undefined;
|
|
44
43
|
class?: import("vue").ClassValue;
|
|
@@ -245,7 +244,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
245
244
|
truncate?: boolean;
|
|
246
245
|
size?: PageHeaderSize;
|
|
247
246
|
dockToggle?: boolean;
|
|
248
|
-
detachLabel?: string;
|
|
249
247
|
attachLabel?: string;
|
|
250
248
|
innerHTML?: string | undefined | undefined;
|
|
251
249
|
class?: import("vue").ClassValue;
|
|
@@ -19,9 +19,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
19
19
|
onConfirm?: () => unknown;
|
|
20
20
|
open?: boolean | undefined;
|
|
21
21
|
key?: PropertyKey | undefined;
|
|
22
|
+
fill?: boolean;
|
|
22
23
|
loading?: boolean;
|
|
23
24
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
24
|
-
fill?: boolean;
|
|
25
25
|
size?: import("./types.ts").ModalSize;
|
|
26
26
|
dock?: boolean;
|
|
27
27
|
tabs?: import("../layout/types.ts").TabItem[];
|
|
@@ -263,9 +263,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
263
263
|
onConfirm?: () => unknown;
|
|
264
264
|
open?: boolean | undefined;
|
|
265
265
|
key?: PropertyKey | undefined;
|
|
266
|
+
fill?: boolean;
|
|
266
267
|
loading?: boolean;
|
|
267
268
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
268
|
-
fill?: boolean;
|
|
269
269
|
size?: import("./types.ts").ModalSize;
|
|
270
270
|
dock?: boolean;
|
|
271
271
|
tabs?: import("../layout/types.ts").TabItem[];
|
|
@@ -9,9 +9,9 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
9
9
|
readonly onConfirm?: (() => unknown) | undefined;
|
|
10
10
|
readonly open?: boolean | undefined;
|
|
11
11
|
readonly key?: PropertyKey | undefined;
|
|
12
|
+
readonly fill?: boolean | undefined;
|
|
12
13
|
readonly loading?: boolean | undefined;
|
|
13
14
|
readonly prefix?: "k-modal" | "k-drawer" | undefined;
|
|
14
|
-
readonly fill?: boolean | undefined;
|
|
15
15
|
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
16
16
|
readonly dock?: boolean | undefined;
|
|
17
17
|
readonly tabs?: import("../layout/types.ts").TabItem[] | undefined;
|
|
@@ -249,9 +249,9 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
|
|
|
249
249
|
readonly onConfirm?: (() => unknown) | undefined;
|
|
250
250
|
readonly open?: boolean | undefined;
|
|
251
251
|
readonly key?: PropertyKey | undefined;
|
|
252
|
+
readonly fill?: boolean | undefined;
|
|
252
253
|
readonly loading?: boolean | undefined;
|
|
253
254
|
readonly prefix?: "k-modal" | "k-drawer" | undefined;
|
|
254
|
-
readonly fill?: boolean | undefined;
|
|
255
255
|
readonly size?: import("./types.ts").ModalSize | undefined;
|
|
256
256
|
readonly dock?: boolean | undefined;
|
|
257
257
|
readonly tabs?: import("../layout/types.ts").TabItem[] | undefined;
|
|
@@ -11,8 +11,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
open?: boolean;
|
|
13
13
|
key?: PropertyKey | undefined;
|
|
14
|
-
prefix?: string | undefined;
|
|
15
14
|
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
15
|
+
prefix?: string | undefined;
|
|
16
16
|
title?: string | undefined;
|
|
17
17
|
style?: import("vue").StyleValue;
|
|
18
18
|
results?: (string | number) | undefined;
|
|
@@ -227,8 +227,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
227
227
|
disabled?: boolean;
|
|
228
228
|
open?: boolean;
|
|
229
229
|
key?: PropertyKey | undefined;
|
|
230
|
-
prefix?: string | undefined;
|
|
231
230
|
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
231
|
+
prefix?: string | undefined;
|
|
232
232
|
title?: string | undefined;
|
|
233
233
|
style?: import("vue").StyleValue;
|
|
234
234
|
results?: (string | number) | undefined;
|
|
@@ -14,8 +14,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
14
14
|
minWidth?: string;
|
|
15
15
|
open?: boolean;
|
|
16
16
|
key?: PropertyKey | undefined;
|
|
17
|
-
prefix?: string | undefined;
|
|
18
17
|
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
18
|
+
prefix?: string | undefined;
|
|
19
19
|
title?: string | undefined;
|
|
20
20
|
style?: import("vue").StyleValue;
|
|
21
21
|
results?: (string | number) | undefined;
|
|
@@ -231,8 +231,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
231
231
|
minWidth?: string;
|
|
232
232
|
open?: boolean;
|
|
233
233
|
key?: PropertyKey | undefined;
|
|
234
|
-
prefix?: string | undefined;
|
|
235
234
|
anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
|
|
235
|
+
prefix?: string | undefined;
|
|
236
236
|
title?: string | undefined;
|
|
237
237
|
style?: import("vue").StyleValue;
|
|
238
238
|
results?: (string | number) | undefined;
|
|
@@ -433,8 +433,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
433
433
|
ref_for?: boolean | undefined | undefined;
|
|
434
434
|
ref_key?: string | undefined | undefined;
|
|
435
435
|
}> & Readonly<{}>, {
|
|
436
|
-
icon: IconName;
|
|
437
436
|
fill: boolean;
|
|
437
|
+
icon: IconName;
|
|
438
438
|
level: HeadingLevel;
|
|
439
439
|
actionIcon: IconName;
|
|
440
440
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -53,9 +53,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
53
53
|
section?: string;
|
|
54
54
|
pages?: SettingsModalPage[];
|
|
55
55
|
key?: PropertyKey | undefined;
|
|
56
|
+
fill?: boolean;
|
|
56
57
|
loading?: boolean;
|
|
57
58
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
58
|
-
fill?: boolean;
|
|
59
59
|
size?: import("../overlays/types").ModalSize;
|
|
60
60
|
dock?: boolean;
|
|
61
61
|
tabs?: import("../layout/types.ts").TabItem[];
|
|
@@ -312,9 +312,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
312
312
|
section?: string;
|
|
313
313
|
pages?: SettingsModalPage[];
|
|
314
314
|
key?: PropertyKey | undefined;
|
|
315
|
+
fill?: boolean;
|
|
315
316
|
loading?: boolean;
|
|
316
317
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
317
|
-
fill?: boolean;
|
|
318
318
|
size?: import("../overlays/types").ModalSize;
|
|
319
319
|
dock?: boolean;
|
|
320
320
|
tabs?: import("../layout/types.ts").TabItem[];
|
|
@@ -22,8 +22,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
22
22
|
form?: string;
|
|
23
23
|
level?: HeadingLevel;
|
|
24
24
|
key?: PropertyKey | undefined;
|
|
25
|
-
prefix?: string | undefined;
|
|
26
25
|
fill?: boolean;
|
|
26
|
+
prefix?: string | undefined;
|
|
27
27
|
selected?: boolean;
|
|
28
28
|
label?: string;
|
|
29
29
|
style?: import("vue").StyleValue;
|
|
@@ -252,8 +252,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
252
252
|
form?: string;
|
|
253
253
|
level?: HeadingLevel;
|
|
254
254
|
key?: PropertyKey | undefined;
|
|
255
|
-
prefix?: string | undefined;
|
|
256
255
|
fill?: boolean;
|
|
256
|
+
prefix?: string | undefined;
|
|
257
257
|
selected?: boolean;
|
|
258
258
|
label?: string;
|
|
259
259
|
style?: import("vue").StyleValue;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { App, Component } from 'vue';
|
|
2
|
-
import type { BuiltinIconName } from '../icons/builtin';
|
|
2
|
+
import type { BuiltinIconName, BuiltinIconPath } from '../icons/builtin';
|
|
3
3
|
export { hasIconCollection, loadIconCollection, registerIconCollection, setDefaultIconCollection, } from '../icons/collections';
|
|
4
4
|
export type { IconCollectionSource, IconifyCollection, IconifyIcon } from '../icons/collections';
|
|
5
5
|
export type IconSource = Component | string;
|
|
@@ -11,7 +11,7 @@ export interface ParsedSvg {
|
|
|
11
11
|
}
|
|
12
12
|
export type ResolvedIcon = {
|
|
13
13
|
kind: 'builtin';
|
|
14
|
-
paths: readonly
|
|
14
|
+
paths: readonly BuiltinIconPath[];
|
|
15
15
|
} | {
|
|
16
16
|
kind: 'component';
|
|
17
17
|
component: Component;
|
package/dist/icons/builtin.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export type BuiltinIconPath = string | {
|
|
2
|
+
readonly d: string;
|
|
3
|
+
readonly fill: true;
|
|
4
|
+
};
|
|
1
5
|
export declare const builtinIcons: {
|
|
2
6
|
readonly 'x-mark': readonly ["M6 18 18 6M6 6l12 12"];
|
|
3
7
|
readonly check: readonly ["m4.5 12.75 6 6 9-13.5"];
|
|
@@ -74,11 +78,11 @@ export declare const builtinIcons: {
|
|
|
74
78
|
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
79
|
readonly bolt: readonly ["m3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75L12 13.5z"];
|
|
76
80
|
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.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
readonly '
|
|
81
|
+
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.5Z", {
|
|
82
|
+
readonly d: "M16.5 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H16.5a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z";
|
|
83
|
+
readonly fill: true;
|
|
84
|
+
}];
|
|
85
|
+
readonly 'dock-detach': readonly ["M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"];
|
|
82
86
|
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"];
|
|
83
87
|
readonly 'rectangle-stack': readonly ["M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0q.354-.126.75-.128h10.5q.396.002.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.3 2.3 0 0 0-.75-.128H5.25q-.396.002-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"];
|
|
84
88
|
readonly sparkles: readonly ["M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09m8.445-7.188L18 9.75l-.259-1.035a3.38 3.38 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.38 3.38 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.38 3.38 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.38 3.38 0 0 0-2.456 2.456m-1.365 11.852L16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183l.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394l-1.183.394a2.25 2.25 0 0 0-1.423 1.423"];
|
package/dist/icons/builtin.mjs
CHANGED
|
@@ -177,19 +177,14 @@ export const builtinIcons = {
|
|
|
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
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.
|
|
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.5Z",
|
|
181
|
+
{
|
|
182
|
+
d: "M16.5 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H16.5a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z",
|
|
183
|
+
fill: true
|
|
184
|
+
}
|
|
181
185
|
],
|
|
182
186
|
"dock-detach": [
|
|
183
|
-
"
|
|
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
|
-
],
|
|
188
|
-
"arrows-pointing-out": [
|
|
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"
|
|
190
|
-
],
|
|
191
|
-
"arrows-pointing-in": [
|
|
192
|
-
"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"
|
|
187
|
+
"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
|
|
193
188
|
],
|
|
194
189
|
"cursor-arrow-rays": [
|
|
195
190
|
"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"
|
|
@@ -65,10 +65,34 @@
|
|
|
65
65
|
>
|
|
66
66
|
{{ backText }}
|
|
67
67
|
</Button>
|
|
68
|
-
<
|
|
68
|
+
<Popover
|
|
69
|
+
v-if="docked && slots.actions"
|
|
70
|
+
placement="bottom-end"
|
|
71
|
+
:label="actionsText"
|
|
72
|
+
class="k-dialog-actions-menu"
|
|
73
|
+
>
|
|
74
|
+
<Button
|
|
75
|
+
variant="soft"
|
|
76
|
+
tone="neutral"
|
|
77
|
+
size="sm"
|
|
78
|
+
trailing-icon="chevron-down"
|
|
79
|
+
:disabled="loading"
|
|
80
|
+
>
|
|
81
|
+
{{ actionsText }}
|
|
82
|
+
</Button>
|
|
83
|
+
<template #content="{ close: closeActions }">
|
|
84
|
+
<div
|
|
85
|
+
class="k-dialog-actions-list"
|
|
86
|
+
@click="onActionsClick($event, closeActions)"
|
|
87
|
+
>
|
|
88
|
+
<slot name="actions" :close="close" />
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
</Popover>
|
|
92
|
+
<slot v-else name="actions" :close="close" />
|
|
69
93
|
<Button
|
|
70
94
|
v-if="showDockToggle"
|
|
71
|
-
:icon="docked ? 'dock-
|
|
95
|
+
:icon="docked ? 'dock-detach' : 'dock-attach'"
|
|
72
96
|
variant="ghost"
|
|
73
97
|
tone="neutral"
|
|
74
98
|
size="sm"
|
|
@@ -143,6 +167,7 @@ import {
|
|
|
143
167
|
} from "vue";
|
|
144
168
|
import Button from "../../components/core/Button.vue";
|
|
145
169
|
import Tabs from "../../components/layout/Tabs.vue";
|
|
170
|
+
import Popover from "../../components/overlays/Popover.vue";
|
|
146
171
|
import DialogTrail from "./DialogTrail.vue";
|
|
147
172
|
import { useConfirm } from "../../composables/useConfirm";
|
|
148
173
|
import { useLeaveScope } from "../../composables/useLeaveGuard";
|
|
@@ -197,6 +222,7 @@ const closeText = computed(() => props.closeLabel ?? t("common.close"));
|
|
|
197
222
|
const backText = computed(() => props.backLabel ?? t("common.back"));
|
|
198
223
|
const detachText = computed(() => props.detachLabel ?? t("dock.detach"));
|
|
199
224
|
const attachText = computed(() => props.attachLabel ?? t("dock.attach"));
|
|
225
|
+
const actionsText = computed(() => t("dock.actions"));
|
|
200
226
|
const dockHost = inject(DOCK_KEY, null);
|
|
201
227
|
const mounted = ref(false);
|
|
202
228
|
const dockable = computed(() => Boolean(props.dock && dockHost));
|
|
@@ -245,7 +271,7 @@ watch(open, (value) => {
|
|
|
245
271
|
`[@xleddyl/443-components-vue] ${props.prefix === "k-modal" ? "Modal" : "Drawer"} needs a title, a #header slot or a label to name the dialog.`
|
|
246
272
|
);
|
|
247
273
|
});
|
|
248
|
-
const showClose = computed(() => props.dismissible && !props.hideClose);
|
|
274
|
+
const showClose = computed(() => props.dismissible && !props.hideClose && !docked.value);
|
|
249
275
|
const hasHeader = computed(
|
|
250
276
|
() => Boolean(
|
|
251
277
|
hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || slots.toolbar || showClose.value || hasTrail.value || hasTabs.value
|
|
@@ -262,6 +288,11 @@ const { present, requestClose, onCancel, onClose, onPointerDown, onClick } = use
|
|
|
262
288
|
onClose: () => emit("close"),
|
|
263
289
|
onAfterLeave: () => emit("afterLeave")
|
|
264
290
|
});
|
|
291
|
+
function onActionsClick(event, closeActions) {
|
|
292
|
+
const target = event.target instanceof Element ? event.target.closest("button, a") : null;
|
|
293
|
+
if (!target || target.matches('[aria-haspopup]:not([aria-haspopup="false"])')) return;
|
|
294
|
+
closeActions();
|
|
295
|
+
}
|
|
265
296
|
function onDockedEscape(event) {
|
|
266
297
|
const dialog = dialogRef.value;
|
|
267
298
|
if (!docked.value || !dialog || event.defaultPrevented) return;
|
|
@@ -2,9 +2,9 @@ import type { OverlayEntry } from './stack';
|
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
3
3
|
entry: OverlayEntry;
|
|
4
4
|
key?: PropertyKey | undefined;
|
|
5
|
+
fill?: boolean;
|
|
5
6
|
loading?: boolean;
|
|
6
7
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
7
|
-
fill?: boolean;
|
|
8
8
|
size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
|
|
9
9
|
dock?: boolean;
|
|
10
10
|
tabs?: import("../../index.ts").TabItem[];
|
|
@@ -240,9 +240,9 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
240
240
|
}, string, import("vue").PublicProps, Readonly<{
|
|
241
241
|
entry: OverlayEntry;
|
|
242
242
|
key?: PropertyKey | undefined;
|
|
243
|
+
fill?: boolean;
|
|
243
244
|
loading?: boolean;
|
|
244
245
|
prefix?: "k-modal" | "k-drawer" | undefined;
|
|
245
|
-
fill?: boolean;
|
|
246
246
|
size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
|
|
247
247
|
dock?: boolean;
|
|
248
248
|
tabs?: import("../../index.ts").TabItem[];
|
package/dist/locale/de.mjs
CHANGED
package/dist/locale/en.mjs
CHANGED
package/dist/locale/it.mjs
CHANGED
|
@@ -262,6 +262,7 @@ export const it = {
|
|
|
262
262
|
cancel: "Continua a modificare"
|
|
263
263
|
},
|
|
264
264
|
dock: {
|
|
265
|
+
actions: "Azioni",
|
|
265
266
|
label: "Dettagli",
|
|
266
267
|
emptyTitle: "Nessun elemento selezionato",
|
|
267
268
|
emptyDescription: "Seleziona un elemento della lista per vederne qui i dettagli.",
|
package/dist/locale/types.d.ts
CHANGED
|
@@ -157,6 +157,48 @@
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
.k-drawer.is-dockable:is(.k-drawer-xl, .k-drawer-full) > .k-drawer-panel {
|
|
161
|
+
--k-drawer-size: 48rem;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.k-popover.k-dialog-actions-menu {
|
|
165
|
+
padding: 0.25rem;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.k-dialog-actions-list {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 0.125rem;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.k-dialog-actions-list :where(.k-overlay-trigger) {
|
|
175
|
+
display: flex;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.k-dialog-actions-list.k-dialog-actions-list .k-btn.k-btn {
|
|
179
|
+
width: 100%;
|
|
180
|
+
justify-content: flex-start;
|
|
181
|
+
color: var(--k-text);
|
|
182
|
+
background: transparent;
|
|
183
|
+
border-color: transparent;
|
|
184
|
+
box-shadow: none;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.k-dialog-actions-list.k-dialog-actions-list .k-btn.k-btn-danger {
|
|
188
|
+
color: var(--k-danger-text);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.k-dialog-actions-list.k-dialog-actions-list
|
|
192
|
+
.k-btn.k-btn:hover:not(:disabled, [aria-disabled='true']) {
|
|
193
|
+
background: var(--k-hover);
|
|
194
|
+
box-shadow: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.k-dialog-actions-list.k-dialog-actions-list
|
|
198
|
+
.k-btn.k-btn:active:not(:disabled, [aria-disabled='true']) {
|
|
199
|
+
background: var(--k-press);
|
|
200
|
+
}
|
|
201
|
+
|
|
160
202
|
.k-drawer.is-docked {
|
|
161
203
|
position: static;
|
|
162
204
|
inset: auto;
|
package/package.json
CHANGED