@xleddyl/443-components-vue 0.16.108 → 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 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 | 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`). 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` |
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
 
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). A path of a built-in icon is a stroked string, or `{ d, fill: true }` for a filled part (the small panel of `sidebar-collapse`, `sidebar-expand` and `dock-attach`).
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:
@@ -779,6 +779,7 @@ const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?'
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
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.
@@ -905,7 +906,7 @@ Ready defaults to start a dashboard project: an app frame, an auth frame and pag
905
906
  | `variant` | `'inset'` | `inset` (canvas sidebar, inset content panel), `sidebar` (bordered sidebar, full bleed content), `floating` (raised sidebar card on the canvas). |
906
907
  | `navigation` | | `NavItem[]` or `NavSection[]` (`{ label?, items }`). Items: `label`, `to`/`href`, `icon`, `badge`, `exact`, `active`, `external`, `disabled`, `children`. |
907
908
  | `currentPath` | router path | Active state is computed from the router (`$route`) with prefix matching (`/` and `exact` items match exactly). |
908
- | `brandName`, `brandSubtitle`, `brandIcon`, `brandLogo`, `brandShowName`, `brandTo` | `brandTo: '/'` | `brandLogo` takes an image URL, inline SVG markup or a component; the name is hidden next to a logo unless `brandShowName`. Or the `#brand` slot. `brandAlign` (`'start'` or `'center'`) centers the brand in the expanded sidebar, with the collapse button on the right. The collapse button uses the icons `sidebar-collapse` and `sidebar-expand` (a frame with a small filled panel on the left by default), so `k.icons.aliases: { 'sidebar-collapse': 'lucide:panel-left-close', 'sidebar-expand': 'lucide:panel-left-open' }` changes only that button. |
909
+ | `brandName`, `brandSubtitle`, `brandIcon`, `brandLogo`, `brandShowName`, `brandTo` | `brandTo: '/'` | `brandLogo` takes an image URL, inline SVG markup or a component; the name is hidden next to a logo unless `brandShowName`. Or the `#brand` slot. `brandAlign` (`'start'` or `'center'`) centers the brand in the expanded sidebar, with the collapse button on the right. The collapse button uses the icons `sidebar-collapse` and `sidebar-expand` (chevrons by default), so `k.icons.aliases: { 'sidebar-collapse': 'lucide:panel-left-close', 'sidebar-expand': 'lucide:panel-left-open' }` changes only that button. |
909
910
  | `account` | | `{ name, email?, avatar?, role?, menu? }`. Shown as a row (avatar, name, email, chevron) at the bottom of the sidebar. |
910
911
  | `accountAction` | `'settings'` | `settings`: the row opens a `SettingsModal` (`settingsSections`, `settingsPresets`, `v-model:settings-open`, `v-model:settings-section`, `@sign-out`). `menu`: a DropdownMenu with `account.menu`, selections emit `account-select`. Or replace it with the `#account` slot. |
911
912
  | `settingsRoute`, `settingsResolvePage` | `false` | Sync the settings modal with the URL (`?settings=users/usr_123`): `true` uses the key `settings`, a string sets the key. `settingsRouteLocation: 'hash'` gives `#settings/users/usr_123`. `settingsAccountSection` renames the built-in account section. `settingsResolvePage(section, id, parents)` gives the label of a subpage restored from the URL. See SettingsModal. |
@@ -15,8 +15,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
15
15
  class?: unknown;
16
16
  style?: unknown;
17
17
  modelValue?: ColorValue | "custom" | null | undefined;
18
- search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
19
18
  key?: PropertyKey | undefined;
19
+ search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
20
20
  loading?: boolean | undefined;
21
21
  prefix?: string | undefined | undefined;
22
22
  icon?: import("../../index.ts").IconName | undefined;
@@ -285,8 +285,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
285
285
  class?: unknown;
286
286
  style?: unknown;
287
287
  modelValue?: ColorValue | "custom" | null | undefined;
288
- search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
289
288
  key?: PropertyKey | undefined;
289
+ search?: import("./types").ComboboxSearch<PaletteOptionValue> | undefined;
290
290
  loading?: boolean | undefined;
291
291
  prefix?: string | undefined | undefined;
292
292
  icon?: import("../../index.ts").IconName | undefined;
@@ -18,8 +18,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
18
18
  hideCancel?: boolean;
19
19
  onConfirm?: () => unknown;
20
20
  open?: boolean | undefined;
21
- fill?: boolean;
22
21
  key?: PropertyKey | undefined;
22
+ fill?: boolean;
23
23
  loading?: boolean;
24
24
  prefix?: "k-modal" | "k-drawer" | undefined;
25
25
  size?: import("./types.ts").ModalSize;
@@ -262,8 +262,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
262
262
  hideCancel?: boolean;
263
263
  onConfirm?: () => unknown;
264
264
  open?: boolean | undefined;
265
- fill?: boolean;
266
265
  key?: PropertyKey | undefined;
266
+ fill?: boolean;
267
267
  loading?: boolean;
268
268
  prefix?: "k-modal" | "k-drawer" | undefined;
269
269
  size?: import("./types.ts").ModalSize;
@@ -8,8 +8,8 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
8
8
  readonly hideCancel?: boolean | undefined;
9
9
  readonly onConfirm?: (() => unknown) | undefined;
10
10
  readonly open?: boolean | undefined;
11
- readonly fill?: boolean | undefined;
12
11
  readonly key?: PropertyKey | undefined;
12
+ readonly fill?: boolean | undefined;
13
13
  readonly loading?: boolean | undefined;
14
14
  readonly prefix?: "k-modal" | "k-drawer" | undefined;
15
15
  readonly size?: import("./types.ts").ModalSize | undefined;
@@ -248,8 +248,8 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
248
248
  readonly hideCancel?: boolean | undefined;
249
249
  readonly onConfirm?: (() => unknown) | undefined;
250
250
  readonly open?: boolean | undefined;
251
- readonly fill?: boolean | undefined;
252
251
  readonly key?: PropertyKey | undefined;
252
+ readonly fill?: boolean | undefined;
253
253
  readonly loading?: boolean | undefined;
254
254
  readonly prefix?: "k-modal" | "k-drawer" | undefined;
255
255
  readonly size?: import("./types.ts").ModalSize | undefined;
@@ -10,8 +10,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
10
10
  label?: string;
11
11
  disabled?: boolean;
12
12
  open?: boolean;
13
- anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
14
13
  key?: PropertyKey | undefined;
14
+ anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
15
15
  prefix?: string | undefined;
16
16
  title?: string | undefined;
17
17
  style?: import("vue").StyleValue;
@@ -226,8 +226,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
226
226
  label?: string;
227
227
  disabled?: boolean;
228
228
  open?: boolean;
229
- anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
230
229
  key?: PropertyKey | undefined;
230
+ anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
231
231
  prefix?: string | undefined;
232
232
  title?: string | undefined;
233
233
  style?: import("vue").StyleValue;
@@ -13,8 +13,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
13
13
  matchTriggerWidth?: boolean;
14
14
  minWidth?: string;
15
15
  open?: boolean;
16
- anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
17
16
  key?: PropertyKey | undefined;
17
+ anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
18
18
  prefix?: string | undefined;
19
19
  title?: string | undefined;
20
20
  style?: import("vue").StyleValue;
@@ -230,8 +230,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
230
230
  matchTriggerWidth?: boolean;
231
231
  minWidth?: string;
232
232
  open?: boolean;
233
- anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
234
233
  key?: PropertyKey | undefined;
234
+ anchor?: (() => import("./types").OverlayAnchorTarget | null | undefined) | undefined;
235
235
  prefix?: string | undefined;
236
236
  title?: string | undefined;
237
237
  style?: import("vue").StyleValue;
@@ -52,8 +52,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
52
52
  open?: boolean | undefined;
53
53
  section?: string;
54
54
  pages?: SettingsModalPage[];
55
- fill?: boolean;
56
55
  key?: PropertyKey | undefined;
56
+ fill?: boolean;
57
57
  loading?: boolean;
58
58
  prefix?: "k-modal" | "k-drawer" | undefined;
59
59
  size?: import("../overlays/types").ModalSize;
@@ -311,8 +311,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
311
311
  open?: boolean | undefined;
312
312
  section?: string;
313
313
  pages?: SettingsModalPage[];
314
- fill?: boolean;
315
314
  key?: PropertyKey | undefined;
315
+ fill?: boolean;
316
316
  loading?: boolean;
317
317
  prefix?: "k-modal" | "k-drawer" | undefined;
318
318
  size?: import("../overlays/types").ModalSize;
@@ -21,8 +21,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
21
21
  saveLabel?: string;
22
22
  form?: string;
23
23
  level?: HeadingLevel;
24
- fill?: boolean;
25
24
  key?: PropertyKey | undefined;
25
+ fill?: boolean;
26
26
  prefix?: string | undefined;
27
27
  selected?: boolean;
28
28
  label?: string;
@@ -251,8 +251,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
251
251
  saveLabel?: string;
252
252
  form?: string;
253
253
  level?: HeadingLevel;
254
- fill?: boolean;
255
254
  key?: PropertyKey | undefined;
255
+ fill?: boolean;
256
256
  prefix?: string | undefined;
257
257
  selected?: boolean;
258
258
  label?: string;
@@ -11,14 +11,8 @@ export declare const builtinIcons: {
11
11
  readonly 'chevron-up': readonly ["m4.5 15.75 7.5-7.5 7.5 7.5"];
12
12
  readonly 'chevron-left': readonly ["M15.75 19.5 8.25 12l7.5-7.5"];
13
13
  readonly 'chevron-right': readonly ["m8.25 4.5 7.5 7.5-7.5 7.5"];
14
- readonly 'sidebar-collapse': 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", {
15
- readonly d: "M5.25 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z";
16
- readonly fill: true;
17
- }];
18
- readonly 'sidebar-expand': 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", {
19
- readonly d: "M5.25 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z";
20
- readonly fill: true;
21
- }];
14
+ readonly 'sidebar-collapse': readonly ["M15.75 19.5 8.25 12l7.5-7.5"];
15
+ readonly 'sidebar-expand': readonly ["m8.25 4.5 7.5 7.5-7.5 7.5"];
22
16
  readonly 'chevron-up-down': readonly ["M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"];
23
17
  readonly 'chevron-double-left': readonly ["m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"];
24
18
  readonly 'chevron-double-right': readonly ["m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"];
@@ -7,20 +7,8 @@ export const builtinIcons = {
7
7
  "chevron-up": ["m4.5 15.75 7.5-7.5 7.5 7.5"],
8
8
  "chevron-left": ["M15.75 19.5 8.25 12l7.5-7.5"],
9
9
  "chevron-right": ["m8.25 4.5 7.5 7.5-7.5 7.5"],
10
- "sidebar-collapse": [
11
- "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",
12
- {
13
- d: "M5.25 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z",
14
- fill: true
15
- }
16
- ],
17
- "sidebar-expand": [
18
- "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",
19
- {
20
- d: "M5.25 7.5h2.25a.75.75 0 0 1 .75.75v7.5a.75.75 0 0 1-.75.75H5.25a.75.75 0 0 1-.75-.75v-7.5a.75.75 0 0 1 .75-.75Z",
21
- fill: true
22
- }
23
- ],
10
+ "sidebar-collapse": ["M15.75 19.5 8.25 12l7.5-7.5"],
11
+ "sidebar-expand": ["m8.25 4.5 7.5 7.5-7.5 7.5"],
24
12
  "chevron-up-down": ["M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"],
25
13
  "chevron-double-left": ["m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"],
26
14
  "chevron-double-right": ["m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"],
@@ -65,7 +65,31 @@
65
65
  >
66
66
  {{ backText }}
67
67
  </Button>
68
- <slot name="actions" :close="close" />
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
95
  :icon="docked ? 'dock-detach' : 'dock-attach'"
@@ -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;
@@ -1,8 +1,8 @@
1
1
  import type { OverlayEntry } from './stack';
2
2
  declare const __VLS_export: import("vue").DefineComponent<{
3
3
  entry: OverlayEntry;
4
- fill?: boolean;
5
4
  key?: PropertyKey | undefined;
5
+ fill?: boolean;
6
6
  loading?: boolean;
7
7
  prefix?: "k-modal" | "k-drawer" | undefined;
8
8
  size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
@@ -239,8 +239,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
239
239
  afterLeave: () => any;
240
240
  }, string, import("vue").PublicProps, Readonly<{
241
241
  entry: OverlayEntry;
242
- fill?: boolean;
243
242
  key?: PropertyKey | undefined;
243
+ fill?: boolean;
244
244
  loading?: boolean;
245
245
  prefix?: "k-modal" | "k-drawer" | undefined;
246
246
  size?: "sm" | "md" | "lg" | "xl" | "full" | undefined;
@@ -262,6 +262,7 @@ export const de = {
262
262
  cancel: "Weiter bearbeiten"
263
263
  },
264
264
  dock: {
265
+ actions: "Aktionen",
265
266
  label: "Details",
266
267
  emptyTitle: "Nichts ausgew\xE4hlt",
267
268
  emptyDescription: "W\xE4hlen Sie ein Element der Liste, um hier seine Details zu sehen.",
@@ -262,6 +262,7 @@ export const en = {
262
262
  cancel: "Keep editing"
263
263
  },
264
264
  dock: {
265
+ actions: "Actions",
265
266
  label: "Details",
266
267
  emptyTitle: "Nothing selected",
267
268
  emptyDescription: "Select an item in the list to see its details here.",
@@ -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.",
@@ -249,6 +249,7 @@ export interface KMessages {
249
249
  cancel: string;
250
250
  };
251
251
  dock: {
252
+ actions: string;
252
253
  label: string;
253
254
  emptyTitle: string;
254
255
  emptyDescription: string;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/443-components-vue",
3
- "version": "0.16.108",
3
+ "version": "0.16.109",
4
4
  "description": "Compact, scoped dashboard components for Vue and Nuxt",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",