@xleddyl/443-components-vue 0.16.91 → 0.16.93

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
@@ -7,7 +7,7 @@ This file is a map, not the full reference. For all props, tokens, theming and a
7
7
  ## How to use the names
8
8
 
9
9
  - In Nuxt, every component has the prefix `K` (set by `k.prefix`). `Button.vue` is `<KButton>`. This catalog uses the short name (`Button`).
10
- - Every `use*` composable, `toast` and `withLoading` are auto-imported in Nuxt. Without Nuxt, import them from `@xleddyl/443-components-vue`.
10
+ - Every `use*` composable, `toast` and `withLoading` are auto-imported in Nuxt. Without Nuxt, or in a Nuxt module or layer (it cannot rely on the auto-imports of the host), import them from `@xleddyl/443-components-vue`, and the Nuxt only `useDashboard` and `useNavigationPending` from `@xleddyl/443-components-vue/nuxt/composables`.
11
11
  - Mount `<KOverlayHost />` once (the ready Nuxt layouts do it). It is needed for `toast`, `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer` and `useLoading`.
12
12
  - Wrap the app in `<KRoot>` (it holds the theme, preset and scoping). The ready layouts do it.
13
13
  - Icons are passed as names (`icon="plus"`). The type is `IconName`.
@@ -108,11 +108,12 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
108
108
  | Collapsible sections, FAQ | `Accordion` |
109
109
  | Container with title and actions | `Card` |
110
110
  | Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
111
+ | Breadcrumb trail as the page title (a record, a nested page) | `trail` on `PageHeader` |
111
112
  | Breadcrumbs only | `Breadcrumbs` |
112
113
  | Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
113
114
  | Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
114
115
  | Tabs in a settings section header, like a drawer | `#tabs-<id>` on `SettingsModal`, `#settings-tabs-<id>` on `DashboardLayout`: put a `Tabs` `variant="underline"` `size="sm"` in it |
115
- | Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })` |
116
+ | Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })`, with `DataGrid fill` or `ListPage fill` |
116
117
  | Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
117
118
  | Login, sign up, reset password page | `AuthLogin` + `AuthLogout` (two step flow); `AuthLayout` (or `k-auth`) for other pages |
118
119
  | Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
@@ -217,7 +218,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
217
218
  | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
218
219
  | `Table` | Small to medium table with sort, selection, links and loading rows. For thousands of rows or editing use `DataGrid`. | Models: `v-model:sort` (`{ key, direction }`), `v-model:selected` (row keys). Props: `rows`, `columns` (`key`, `label`, `align`, `width`, `numeric`, `sortable`, `value`, `format`), `rowKey`, `selectable`, `rowTo`, `loading`, `emptyText`, `density`, `stickyHeader`, `maxHeight`, `bordered`, `caption`. Slots: `cell-<key>`, `header-<key>`, `empty`. Event: `rowClick`. | `data/table.vue` |
219
220
  | `Pagination` | Page buttons, page size select and summary. Client or server paging. | Models: `v-model:page`, `v-model:pageSize`. Props: `total`, `pageSizes` (numbers, `'all'` for every row), `allLabel`, `showEdges`, `showJump`, `compact`, `loading`, `showSummary`. Slot: `summary`. | `data/pagination.vue` |
220
- | `SelectionBar` | Shows the selected count and bulk actions for a list or table. | Props: `count`, `total`, `placement` (inline, sticky, floating), `onSelectAll`, `onClear`. Slots: `actions`, `count`. With `count` 0 it renders nothing visible. | `data/selection-bar.vue` |
221
+ | `SelectionBar` | Shows the selected count and bulk actions for a list or table. | Props: `count`, `total`, `placement` (inline, sticky, floating), `onSelectAll` (may return a promise: spinner), `onClear`. With everything selected, select all becomes "Clear selection". Slots: `actions`, `count`. With `count` 0 it renders nothing visible. | `data/selection-bar.vue` |
221
222
  | `FilterPills` | Quick filters as pills: single, multiple, menu or panel pills, removable active filters. | Model: value, array (`multiple`) or null. Props: `options` (`value`, `label`, `valueLabel`, `count`, `icon`, `color`, `menu`, `panel`, `removable`), `multiple`, `required`, `clearable`, `size`. Slots: `pill`, `panel-<value>`. Events: `select`, `remove`. | `data/filter-pills.vue` |
222
223
  | `FilterPill` | One pill button. Use it alone for a custom filter trigger. `FilterPills` uses it. | Props: `label`, `valueLabel`, `icon`, `count`, `active`, `pressed`, `caret`, `size`, `disabled`. Slot: default. | `data/filter-pills.vue` |
223
224
  | `Tag` | Chip or label, optionally removable. Use `Badge` for a status. | Props: `label`, `tone`, `color` (palette name or hex), `size`, `icon`, `removable`, `removeLabel`, `removeTabindex`, `disabled`. Slot: default. Event: `remove`. | `data/tag.vue` |
@@ -236,8 +237,8 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
236
237
  | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
237
238
  | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
238
239
  | `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), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
239
- | `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs`, `level`, `bordered`, `align`, `truncate`. Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
240
- | `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`md`, `lg` for a title sized trail). Slot: `item`. | `layout/breadcrumbs.vue` |
240
+ | `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`. Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
241
+ | `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`md`, `lg` for a title sized trail), `heading` (the current item is a heading of that level). Slot: `item`. | `layout/breadcrumbs.vue` |
241
242
  | `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` |
242
243
  | `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` |
243
244
  | `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`. Slots: default, `title`. | `layout/accordion.vue` |
@@ -277,7 +278,7 @@ Templates combine core parts into whole pages and layouts. Start from them for n
277
278
  | `AuthLayout` | Frame of sign in, sign up and reset password pages: left column with brand, title (or a large breadcrumb), form and footer; aside panel on the right from 960px. | Props: `title`, `description`, `breadcrumbs`, `footer`, `brandName`, `brandIcon`, `brandLogo`, `aside`, `asideTitle`, `asideDescription`, `themeSwitch`. Slots: default, `links`, `footer`, `brand`, `aside`, `corner`. | `templates/auth-layout.vue` |
278
279
  | `AuthLogin` | Complete sign in page in two steps (email, then password with a breadcrumb back). Offers to sign in again after `AuthLogout`. | Props: `submit` (`{ email, password }`), `submitError`, `title`, `description`, `emailLabel`, `emailPlaceholder`, `passwordLabel`, `submitLabel`, `stepKey`, `reasonKey`, frame props of `AuthLayout`. Slots: `links` (`{ email, step }`), `footer`, `brand`, `aside`, `corner`. | `templates/auth-login.vue` |
279
280
  | `AuthLogout` | Sign out page: runs `logout()`, remembers the account, reloads the sign in page. Retry on error. | Props: `logout`, `account` (`{ email, name }`), `loginTo`, `reasonKey`, frame props of `AuthLayout`. Slots: `footer`, `brand`, `aside`, `corner`. Helpers: `rememberSignedOutAccount`, `takeSignedOutAccount`, `SIGNED_OUT_REASON`. | `templates/auth-login.vue` |
280
- | `ListPage` | Whole list page: header, search, filters, table, pagination, bulk actions, loading, empty, no results and error states. Client or server mode (`total`). | Models: `page`, `pageSize`, `search`, `filter`, `sort`, `selected`. Props: `title`, `rows`, `columns`, `rowKey`, `rowTo`, `selectable`, `loading`, `error`, `total`, `paginate`, `searchable`, `searchKeys`, `filters`, `filterKey`, `filterMultiple`, `emptyTitle`. Slots: `actions`, `toolbar`, `toolbar-end`, `bulk`, `empty`, `empty-actions`, `no-results`, `error`, `cell-<key>`, `table`. Events: `retry`, `clear`, `rowClick`. | `templates/list-page.vue` |
281
+ | `ListPage` | Whole list page: header, search, filters, table, pagination, bulk actions, loading, empty, no results and error states. Client or server mode (`total`). | Models: `page`, `pageSize`, `search`, `filter`, `sort`, `selected`. Props: `title`, `rows`, `columns`, `rowKey`, `rowTo`, `selectable`, `loading`, `error`, `total`, `paginate`, `searchable`, `searchKeys`, `filters`, `filterKey`, `filterMultiple`, `filtered` (filters of your own in `#toolbar` are active: no rows show no results with the toolbar and a clear button that emits `clear`, not the first run empty state), `fill` (the card fills the page height, for `content: 'fill'` pages: rows scroll under a sticky header, footer pinned, states centered), `count` (a badge next to the title: `true` for `total` or the row count, or a number), `allIds` (server mode "Select all N" in the selection bar; client mode selects every filtered row without it), `selectedText`, `emptyTitle`. Slots: `actions`, `badge`, `toolbar`, `toolbar-end`, `bulk`, `empty`, `empty-actions`, `no-results`, `error`, `cell-<key>`, `table`. Events: `retry`, `clear`, `rowClick`. | `templates/list-page.vue` |
281
282
  | `DetailPage` | Record page: back link, title, status, actions, tabs, main column and aside with description lists. | Model: `v-model:tab`. Props: `title`, `backTo`, `backLabel`, `status` (`label`, `tone`, `dot`), `tabs`, `sections` (`title`, `items`), `loading`, `error`. Slots: default, `actions`, `badge`, `meta`, `aside`, `aside-before`, `panel-<value>`. | `templates/detail-page.vue` |
282
283
  | `FormDrawer` | Drawer with a form: `Form` around the body, footer with delete (left), cancel and submit, a discard confirmation on close when the form is dirty, `SkeletonForm` while `loading`. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side`, `size`, `fill` (full height body), `tabs` (`FormDrawerTab`: `fields` gives the error dot and opens the tab on a failed submit, `fill: true` makes the drawer `fill` while the tab is active), `tabRoute` (keeps the tab in the hash under this key), `trail`, `backLabel`, `form`, `loading`, `readonly` (also disables every field of the body, your own `Form` in the slot too), `creating` (submit says Create, no dirty needed), `requireDirty`, `deletable`, `deleteDisabled`, `deleteHint`, `submitLabel`, `cancelLabel`, `deleteLabel`, `submitIcon` (icon of the submit button), `deleteIcon` (default `trash`), `guard`, `guardTitle`, `guardMessage` (the leave guard of the drawer: close, cancel, trail navigation), `beforeClose`, `onCancel`. `deleteHint` is a tooltip of the delete button, and the reason when `deleteDisabled`. Slots: default (`{ tab }`), `actions`, `title-trailing`, `skeleton`, `footer`. Events: `delete`, `submitted`, `navigate`, `afterLeave`. Exposes `confirmDiscard()`, `close()`. | `templates/form-drawer.vue` |
283
284
  | `FormModal` | Modal with a form, like `FormDrawer`: `Form` around the body, footer with delete (left), cancel and submit, the leave guard on close, `SkeletonForm` while `loading`, `readonly`. | Model: `v-model:open`. Props: `title`, `description`, `label`, `size`, `sheet`, `width`, `fill`, `dismissible`, `form`, `nested` (the form is a `div`: a modal opened from a field of another form), `loading`, `readonly`, `creating`, `requireDirty`, `deletable`, `deleteDisabled`, `deleteHint`, `submitLabel`, `cancelLabel`, `deleteLabel`, `submitIcon` (icon of the submit button), `deleteIcon` (default `trash`), `guard`, `guardTitle`, `guardMessage`, `beforeClose`, `onCancel`. Slots: default, `actions`, `title-trailing`, `skeleton`, `footer` (`{ submit, cancel }`). Events: `delete`, `submitted`, `open`, `close`, `afterLeave`. Exposes `submit()`, `confirmDiscard()`, `close()`. | `templates/form-modal.vue` |
@@ -295,7 +296,7 @@ Templates combine core parts into whole pages and layouts. Start from them for n
295
296
  | `Brand` | Logo and name block (image URL, inline SVG or component). | Props: `name`, `subtitle`, `icon`, `logo`, `to`, `size`, `accent`, `hideText`, `showName`. Slots: default, `logo`, `mark`, `subtitle`. | `templates/dashboard-layout.vue` |
296
297
  | `AccountMenu` | Account button with avatar, name and a dropdown menu. Used by `DashboardLayout`. | Props: `name`, `email`, `avatar`, `menu` (menu items), `placement`, `icon`. Event: `select`. | `templates/dashboard-layout.vue` |
297
298
 
298
- Nuxt ready layouts: with `k: { layouts: true }` the module registers the layouts `k-dashboard` and `k-auth`. They read brand, navigation, account and settings from `app.config.ts` (`k` key). `useDashboard()` gives the runtime account, breadcrumbs and badges for `k-dashboard`. `useNavigationPending()` is `true` from the start of a navigation to another path until the new page has rendered; the module waits two frames at the start so the skeleton paints first, and `k-dashboard` binds it to `loading`. See README, section "Nuxt: ready layouts".
299
+ Nuxt ready layouts: with `k: { layouts: true }` the module registers the layouts `k-dashboard` and `k-auth`. They read brand, navigation, account and settings from `app.config.ts` (`k` key). `useDashboard()` gives the runtime account, breadcrumbs and badges for `k-dashboard`. `useNavigationPending()` is `true` from the moment the guards accept a navigation to another path (after the discard question of a leave guard) until the new page has rendered; the module waits two frames at the start so the skeleton paints first, and `k-dashboard` binds it to `loading`. See README, section "Nuxt: ready layouts".
299
300
 
300
301
  ## Grid (group `grid`)
301
302
 
@@ -340,7 +341,7 @@ A color value (`ColorValue`) is a palette name or a custom hex color `#rrggbb` (
340
341
 
341
342
  ## Composables
342
343
 
343
- All are exported from `@xleddyl/443-components-vue` and auto-imported in Nuxt.
344
+ All are exported from `@xleddyl/443-components-vue` (the Nuxt only ones from `@xleddyl/443-components-vue/nuxt/composables`) and auto-imported in Nuxt.
344
345
 
345
346
  | Composable | Purpose and when to use it | Signature and notes | Playground |
346
347
  | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
@@ -373,8 +374,8 @@ All are exported from `@xleddyl/443-components-vue` and auto-imported in Nuxt.
373
374
  | `useLocale` | Translate component texts and read the active locale (en, it, de). | `const { locale, t } = useLocale()`. `provideLocale` and `createLocale` set it. Nuxt follows `k.locale`. | `languages.vue` (pages root) |
374
375
  | `useIcons` helpers, `createIcons`, `provideIcons` | Register your own icons by name. | Nuxt: option `k.icons: { dir: '~/assets/icons' }`. | `components/core/icon.vue` |
375
376
  | `useLinkComponent`, `createLinkComponent` | Use the router link (for example `NuxtLink`) for every `to` prop. | The Nuxt module does it for you. | - |
376
- | `useDashboard` (Nuxt only) | Runtime account, breadcrumbs and badges for the `k-dashboard` layout. | Auto-imported by the module. | `layouts/` of the playground |
377
- | `useNavigationPending` (Nuxt only) | `true` while a navigation to another path renders the new page. Bind it to `loading` of `DashboardLayout` or `AppShell`. | Auto-imported by the module. | `layouts/` of the playground |
377
+ | `useDashboard` (Nuxt only) | Runtime account, breadcrumbs and badges for the `k-dashboard` layout. | Auto-imported by the module, or `import { useDashboard } from '@xleddyl/443-components-vue/nuxt/composables'` (a Nuxt module or layer). | `layouts/` of the playground |
378
+ | `useNavigationPending` (Nuxt only) | `true` while a navigation to another path renders the new page. Bind it to `loading` of `DashboardLayout` or `AppShell`. | Auto-imported by the module, or `import { useNavigationPending } from '@xleddyl/443-components-vue/nuxt/composables'` (a Nuxt module or layer). | `layouts/` of the playground |
378
379
 
379
380
  ## Before you build your own
380
381
 
package/README.md CHANGED
@@ -42,6 +42,13 @@ export default defineNuxtConfig({
42
42
 
43
43
  Every component is registered with the prefix (`Button.vue` becomes `<KButton>`) and every `use*` composable plus `toast` and `withLoading` is auto-imported.
44
44
 
45
+ A Nuxt module or layer that uses the library cannot rely on the auto-imports of the host (the host may set `composables: false`). Import explicitly: every composable from `@xleddyl/443-components-vue` (`useRouteState`, `useRouteRecord`, `useLeaveGuard`, `useDirtyGuard`, `useConfirm` and the others), and the two that need Nuxt, `useDashboard` and `useNavigationPending`, from `@xleddyl/443-components-vue/nuxt/composables`:
46
+
47
+ ```ts
48
+ import { useLeaveGuard, useRouteState } from '@xleddyl/443-components-vue'
49
+ import { useNavigationPending } from '@xleddyl/443-components-vue/nuxt/composables'
50
+ ```
51
+
45
52
  | Option | Default | Effect |
46
53
  | ------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
47
54
  | `prefix` | `'K'` | Component name prefix. |
@@ -474,7 +481,7 @@ async function switchView() {
474
481
  | editor | RichTextEditor, TemplateEditor, TemplateText |
475
482
  | chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
476
483
 
477
- Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`, `useToast` (and `toast`), `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer`, `useOverlay`, `useModalContext`, `useLoading` (and `withLoading`), `useLoadingState`, `useHotkey`, `useCopy`, `useFileDrop` (with `readDroppedFiles`), `useSortable`, `usePasswordStrength`, `useTableSort`, `useAppShell`, `useRouteState`, `useRouteRecord`, `usePageCommands`, `usePreference` (with `usePreferences`, `createPreferences`, `providePreferences`), `useScrollLock`, `useLeaveGuard` (with `useLeaveScope`, `provideLeaveScope`), `useDirtyGuard`, `useIcons` helpers and `useLinkComponent`, `provideFieldBoundary`, `provideAuxiliaryControls`, `provideForm`, `provideGridConfig` (with `createGridConfig`, `useGridConfig`), `useLocale`. With the Nuxt module also `useDashboard()` (runtime account, breadcrumbs and badges for the `k-dashboard` layout) and `useNavigationPending()` (`true` while a navigation to another path renders the new page).
484
+ Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`, `useToast` (and `toast`), `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer`, `useOverlay`, `useModalContext`, `useLoading` (and `withLoading`), `useLoadingState`, `useHotkey`, `useCopy`, `useFileDrop` (with `readDroppedFiles`), `useSortable`, `usePasswordStrength`, `useTableSort`, `useAppShell`, `useRouteState`, `useRouteRecord`, `usePageCommands`, `usePreference` (with `usePreferences`, `createPreferences`, `providePreferences`), `useScrollLock`, `useLeaveGuard` (with `useLeaveScope`, `provideLeaveScope`), `useDirtyGuard`, `useIcons` helpers and `useLinkComponent`, `provideFieldBoundary`, `provideAuxiliaryControls`, `provideForm`, `provideGridConfig` (with `createGridConfig`, `useGridConfig`), `useLocale`. With the Nuxt module also `useDashboard()` (runtime account, breadcrumbs and badges for the `k-dashboard` layout) and `useNavigationPending()` (`true` while a navigation to another path renders the new page), auto-imported or imported from `@xleddyl/443-components-vue/nuxt/composables`.
478
485
 
479
486
  ### Buttons and tooltips
480
487
 
@@ -530,11 +537,11 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
530
537
 
531
538
  - `Tabs` items take `dot: true` for a small indicator without a number (`dotTone`, default `danger`; `dotLabel` is the hidden text, default "Needs attention"). `color` (a palette name or a hex, `ColorValue`) draws a small color dot before the label, separate from the status dot. `title` shows a tooltip on hover and keyboard focus (the native `title` only until mount) and becomes the tab description; a disabled tab keeps it (it uses `aria-disabled`, cannot be selected and is skipped by Tab and the arrow keys), so it can say why it is disabled. The same items work in the `tabs` of `Modal`, `Drawer`, `FormDrawer` and `DetailPage`.
532
539
  - `DropdownMenu` takes `matchTriggerWidth` (the menu is at least as wide as its trigger) and `minWidth` (a CSS length).
533
- - `PageHeader` takes `align` (`'end'` by default, `'start'` or `'center'`) for the title block and the actions, and `truncate` to keep the title on one line with an ellipsis (the full title is in its `title` attribute).
540
+ - `PageHeader` takes `align` (`'end'` by default, `'start'` or `'center'`) for the title block and the actions, and `truncate` to keep the title on one line with an ellipsis (the full title is in its `title` attribute). `trail` (`BreadcrumbItem[]`, the earlier levels as links) turns the title into a breadcrumb trail that ends with `title`, at the page title size: a `nav` (named by `trailLabel`, default "Breadcrumb") around an ordered list whose last item is the heading (`h<level>`, `aria-current="page"`, only the title, `#title` fills it). With `truncate` the trail stays on one line and the title gets the ellipsis. Use it for a record or a nested page instead of `Breadcrumbs` in `#title` (a `nav` inside a heading). `breadcrumbs` stays the small trail above the title.
534
541
  - `RichTextEditor` accepts `'underline'` in `toolbar` (not in the default toolbar).
535
542
  - `RichTextEditor` takes `linkTypes` (`EditorLinkType[]`, `'url' | 'email' | 'phone'`, default `['url']`). With more than one type the link form shows a type select; email links get `mailto:` and phone links `tel:` (spaces and separators removed). When no text is selected the form asks for the link text too (`editor.linkText`) and inserts it as a link, falling back to the address.
536
543
  - `BarChart` takes `colorByPoint` (every bar of a series takes the next palette color, or one from `colors: string[]`; the legend lists and toggles the categories). The palette comes from `--k-chart-1` to `--k-chart-8`.
537
- - `SelectionBar` shows a plural aware selected count (announced in a live region), select all (`total` plus `@select-all`) and clear (`@clear`) actions, an `#actions` slot and `placement` `inline`, `sticky` or `floating`. With `count` 0 it renders no box (only its live region), so it can sit in a flex toolbar without adding a gap; the first count after mount is announced too. `ListPage` renders it for `#bulk`.
544
+ - `SelectionBar` shows a plural aware selected count (announced in a live region), select all (`total` plus `@select-all`; a listener that returns a promise shows a spinner until it settles) and clear (`@clear`) actions (with `@select-all` and `count` at `total`, the select all action becomes a "Clear selection" button in place of the clear icon), an `#actions` slot and `placement` `inline`, `sticky` or `floating`. With `count` 0 it renders no box (only its live region), so it can sit in a flex toolbar without adding a gap; the first count after mount is announced too. `ListPage` renders it in its toolbar when `selectable`.
538
545
  - `FilterPills` is generic: the value type comes from the options, `multiple` makes the model an array and `required` drops `null` from it (like `SegmentedControl`). Options take `menu` items (a dropdown trigger showing `valueLabel`) or `panel: true`, which opens a popover with the `#panel-<value>` slot (`{ option, active, toggle, close }`, `panelLabel` names it). The `#pill` slot renders any trigger and its scope has `defaultPill`, a component that renders the built-in pill for that option, so one custom pill does not mean rewriting the others: `<component :is="defaultPill" v-else />`. `FilterPill` is exported so custom triggers match the other pills.
539
546
  - `SegmentedControl` with `required` narrows `v-model` to a non null value. Options take `title` (tooltip and description) and `muted`, and the `#option` slot replaces the content of each option.
540
547
  - `FileInput` takes `directory` (folder picker; dropped folders are walked, every file keeps its relative path) or `directory="drop"` (the click opens a file picker, dropped folders are still walked), `directoryAction` (an "Upload a folder" button under the dropzone, `directoryActionLabel` renames it) or the `#actions` slot (`{ browse, browseDirectory, disabled }`), `skipHidden` (ignores dot files and dot folders), `list: false` (no file list: picks and drops only emit `add`), `fill` (the dropzone fills the height of its flex column parent, with the icon and the text centered: an import screen), `loading` and the `#hint` slot. `add` receives `(files, { entries: [{ file, path }], directories, source, event, dataTransfer })`; `directories` lists every folder path of a folder pick or drop, empty folders included, and `add` also fires for a drop of empty folders. `invalid` fires per file and `reject` once with every rejected file (`(events, detail)`). `acceptMode="hint"` only passes `accept` to the picker and leaves filtering to the host. The component exposes `browse()`, `browseDirectory()`, `addFiles()` and `focus()`.
@@ -556,7 +563,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
556
563
  - `useSortable(container, options)` is the reorder logic of `TagList` for any list. Options: `items` (a ref or getter), `onMove(items, move)` (`SortableMove`: `{ item, from, to, items, source }`, write `items` back to your state), `orientation` (`'vertical'` by default, `'horizontal'` for wrapping rows), `disabled`, `handle` (a selector: only a pointer down on it starts a drag; without it any pointer down outside buttons, links and inputs does), `canMove(item, index)`, `label(item)` and `movedText(move)` for the announcement. Bind `itemProps(index)` on each item element (the attribute marks it, plus pointer and Alt with arrow key handlers) and render `announcement` in a polite live region. `move(from, to, { announce })` moves from your own buttons, `dragging` is the index being dragged (for a lifted style), `canMove(index)` reports locked items. Pointer drags reorder live and follow the pointer, Escape or a cancelled pointer puts the item back, and the click after a drag is swallowed.
557
564
 
558
565
  - `useFileDrop` returns `{ over, reset }` and takes `ignore(event)`. A drop handled by a nested drop zone is skipped by the outer ones, and the state resets after any drop, even when a child stops propagation. `readDroppedFiles(dataTransfer)` walks dropped folders (call it synchronously in the drop handler) and resolves to `[{ file, path }]`; `readDroppedFiles(dataTransfer, { directories: true })` resolves to `{ files, directories }` with every folder path, empty ones included, and `skipHidden: true` leaves out dot entries.
559
- - `Tabs` items take `badgeTone` and `badgeLabel` (the accessible name of the badge); the `#panel="{ item }"` slot renders a single panel for the active tab. `stretch` makes the tabs fill the remaining height of a flex column and the active panel grow with it (`flex: 1; min-height: 0`), and `inset` spaces the tab list from the container edges with the panel flush below it, for inspectors and side panes. `Breadcrumbs` items take `attrs` and `onClick` (an item without a link renders a button, handy for drop targets), `#item` customizes the content, and `ancestors` links every item and ends with a separator (`breadcrumbsAncestors` on `PageHeader`). `Accordion` takes `variant` `card` (default), `outline` (the same card without a shadow), `separated` or `plain`; items take `description`, and `contentVariant="neutral"` drops the content padding and text styling.
566
+ - `Tabs` items take `badgeTone` and `badgeLabel` (the accessible name of the badge); the `#panel="{ item }"` slot renders a single panel for the active tab. `stretch` makes the tabs fill the remaining height of a flex column and the active panel grow with it (`flex: 1; min-height: 0`), and `inset` spaces the tab list from the container edges with the panel flush below it, for inspectors and side panes. `Breadcrumbs` items take `attrs` and `onClick` (an item without a link renders a button, handy for drop targets), `#item` customizes the content, and `ancestors` links every item and ends with a separator (`breadcrumbsAncestors` on `PageHeader`). `heading` (a heading level) renders the current item as that heading, for a trail that is the title of the page. `Accordion` takes `variant` `card` (default), `outline` (the same card without a shadow), `separated` or `plain`; items take `description`, and `contentVariant="neutral"` drops the content padding and text styling.
560
567
  - `RichTextEditor` labels heading buttons by their real level (`headingLabel="relative"` numbers them from 1) and `toolbar` picks and orders the buttons: `['headings', '|', 'bold', 'italic', 'link']`.
561
568
 
562
569
  ### Grid defaults
@@ -693,7 +700,7 @@ const familyId = useRouteState('family')
693
700
  ```
694
701
 
695
702
  - Reading: the initial value comes from the URL (on the server too, so SSR renders the same state), and the ref follows every later route change (back, forward, links).
696
- - Writing: setting the ref navigates with `router.push` (default) or `router.replace` (`history: 'replace'`, for filters or tabs that should not add history entries). The path and the other query parameters stay. `undefined`, `null` and `''` remove the parameter. Several refs changed in the same tick make one navigation. A push that returns to the previous history entry goes back instead (`router.back()`), so opening then closing a drawer leaves the history as it was, and the browser back button and the in-app close button agree.
703
+ - Writing: setting the ref navigates with `router.push` (default) or `router.replace` (`history: 'replace'`, for filters or tabs that should not add history entries). The path and the other query parameters stay. `undefined`, `null` and `''` remove the parameter. Several refs changed in the same tick make one navigation. A push that returns to the previous history entry goes back instead (`router.back()`), so opening then closing a drawer leaves the history as it was, and the browser back button and the in-app close button agree. An entry the router did not create (a hash edited by hand in the address bar, a plain `#` link) has no reliable previous entry, so writes from it always push.
697
704
  - Types: `parse(value)` and `serialize(value)` convert the string (`parse` returning `undefined` means no value). `default` gives the value when the parameter is missing, and setting the default removes the parameter:
698
705
 
699
706
  ```ts
@@ -853,17 +860,17 @@ Both take the `AuthLayout` frame props and the `brand`, `corner`, `footer` and `
853
860
 
854
861
  ### Page templates
855
862
 
856
- | Component | What it gives you |
857
- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
858
- | `DashboardPage` | PageHeader (`title`, `eyebrow`, `description`, `#actions`), a Stat grid from `stats` (or `#stats`), a content grid (`columns`, default 1 then 3 columns). |
859
- | `ListPage` | Header, toolbar (search with `searchable`, FilterPills from `filters`, `#toolbar`, `#bulk` when rows are selected), Table from `columns`/`rows`, Pagination. Client mode filters (`searchKeys`, `filterKey`), sorts and paginates; pass `total` for server mode. States: `loading` skeleton rows, first run `#empty`, no results with a clear button, `error` with retry. `cell-*` and `header-*` slots go to the Table. |
860
- | `DetailPage` | Back link (`backTo`), title, `status` badge, `#actions`, optional `tabs` (`#panel-<value>`), main column plus an aside with DescriptionList cards from `sections` (or `#aside`). `loading` and `error` states. |
861
- | `FormDrawer` | A `Drawer` with a `Form` (`form` from `useForm`) around the body and a footer: delete on the left (`deletable`, `@delete`, `deleteDisabled`, `deleteHint`), cancel and submit on the right. `creating` changes the submit text to Create and enables it without changes; otherwise it needs a dirty form (`requireDirty`). `readonly` keeps only a Close button and disables every field of the body (see [Forms](#forms)). Every close asks before discarding a dirty form (`guard`, the leave guard of its `Drawer`), then runs `beforeClose`. `deleteHint` is the tooltip of the delete button, and its reason when `deleteDisabled`. `submitIcon` adds an icon to the submit button (`check`, `plus`, `printer`), `deleteIcon` changes the delete icon (default `trash`). `onCancel` replaces the close of the cancel button (back to a parent view), after the same question. `loading` shows a `SkeletonForm` (or `#skeleton`) and keeps the header, the tabs and the footer in place. Pass another `form` to switch the body to a subpage (with `trail`). A tab with `fill: true` (`FormDrawerTab`) makes the drawer `fill` while it is active (a tab with a long table). |
862
- | `FormModal` | The modal version of `FormDrawer`: a `Modal` with a `Form` around the body, footer with delete (`deletable`, `deleteDisabled`, `deleteHint`, `deleteIcon`), cancel (ghost) and submit (`creating`, `requireDirty`, `submitting` state, `submitIcon`), the leave guard on close and cancel, `loading` skeleton, `readonly`. `nested` renders the form as a `div`, for a modal opened from a field of another form (its footer submit then calls `submit()`). `@submitted` fires after a successful submit. |
863
- | `FormPage` | Header, your cards inside `Form` (`form` from `useForm`, or a plain `form` emitting `submit`), sticky footer with cancel and submit, unsaved state, dirty guard (`guard`, on by default) through `useDirtyGuard`. |
864
- | `SettingsPage`, `SettingsSection`, `SaveBar` | Section nav (sticky on the left, a scrolling row on narrow screens; items with `to` become route links), `#section-<value>` panels, section cards with a save footer, and a floating save bar while `dirty`. |
865
- | `ErrorPage`, `NotFoundPage` | Status code, title, message (defaults per status code, reads a Nuxt `error`), home, retry (`@retry`) and back actions. `@home` replaces the home link, handy for `clearError`. |
866
- | `EmptyPage` | First run screen: illustration, title, description, primary and secondary actions, onboarding `steps`. |
863
+ | Component | What it gives you |
864
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
865
+ | `DashboardPage` | PageHeader (`title`, `eyebrow`, `description`, `#actions`), a Stat grid from `stats` (or `#stats`), a content grid (`columns`, default 1 then 3 columns). |
866
+ | `ListPage` | Header, toolbar (search with `searchable`, FilterPills from `filters`, `#toolbar`, `#bulk` when rows are selected), Table from `columns`/`rows`, Pagination. Client mode filters (`searchKeys`, `filterKey`), sorts and paginates; pass `total` for server mode. States: `loading` skeleton rows, first run `#empty`, no results with a clear button, `error` with retry. Filters of your own in `#toolbar` (a Select, a date range) set `filtered` while they are active: no rows then show the no results state with the toolbar still visible instead of the first run `#empty`, and the clear button (or `clear` of `#no-results`) emits `clear`, where you reset them. `cell-*` and `header-*` slots go to the Table. `fill` makes the card take the rest of the height of its parent (a page with `content: 'fill'`, or any flex parent with a height): the rows scroll inside the card under the sticky header row, the footer (summary and pagination) stays at the bottom even with few rows, the first run, error and no results states are centered in the same height, and a custom `#table` scrolls in the same area. It stays on at every width (like `content="fill"` and `DataGrid` `fill`); the card keeps a 20rem minimum height, so on a short screen the panel scrolls instead of squeezing the rows. An `EmptyPage` in `#empty` fills by itself. `count` shows the number of rows in a `Badge` next to the title (`true`: `total` in server mode, `rows.length` in client mode, hidden while the first load, the first run empty state or an error shows; a number: that number); `#badge` (scope `{ total }`, the result count) replaces it. With `selectable` the selection bar counts against the result total (`3 of 42 selected`) and, like the `DataGrid` footer link, offers "Select all N" once every row of the page is selected and more rows match: in client mode it selects every filtered row (across pages), in server mode it needs `allIds` (`() => Promise<readonly RowKey[]> | readonly RowKey[]`), awaits it with a spinner and sets `v-model:selected` to the returned ids (a rejected promise keeps the selection and logs an error). With every row selected the action becomes "Clear selection". |
867
+ | `DetailPage` | Back link (`backTo`), title, `status` badge, `#actions`, optional `tabs` (`#panel-<value>`), main column plus an aside with DescriptionList cards from `sections` (or `#aside`). `loading` and `error` states. |
868
+ | `FormDrawer` | A `Drawer` with a `Form` (`form` from `useForm`) around the body and a footer: delete on the left (`deletable`, `@delete`, `deleteDisabled`, `deleteHint`), cancel and submit on the right. `creating` changes the submit text to Create and enables it without changes; otherwise it needs a dirty form (`requireDirty`). `readonly` keeps only a Close button and disables every field of the body (see [Forms](#forms)). Every close asks before discarding a dirty form (`guard`, the leave guard of its `Drawer`), then runs `beforeClose`. `deleteHint` is the tooltip of the delete button, and its reason when `deleteDisabled`. `submitIcon` adds an icon to the submit button (`check`, `plus`, `printer`), `deleteIcon` changes the delete icon (default `trash`). `onCancel` replaces the close of the cancel button (back to a parent view), after the same question. `loading` shows a `SkeletonForm` (or `#skeleton`) and keeps the header, the tabs and the footer in place. Pass another `form` to switch the body to a subpage (with `trail`). A tab with `fill: true` (`FormDrawerTab`) makes the drawer `fill` while it is active (a tab with a long table). |
869
+ | `FormModal` | The modal version of `FormDrawer`: a `Modal` with a `Form` around the body, footer with delete (`deletable`, `deleteDisabled`, `deleteHint`, `deleteIcon`), cancel (ghost) and submit (`creating`, `requireDirty`, `submitting` state, `submitIcon`), the leave guard on close and cancel, `loading` skeleton, `readonly`. `nested` renders the form as a `div`, for a modal opened from a field of another form (its footer submit then calls `submit()`). `@submitted` fires after a successful submit. |
870
+ | `FormPage` | Header, your cards inside `Form` (`form` from `useForm`, or a plain `form` emitting `submit`), sticky footer with cancel and submit, unsaved state, dirty guard (`guard`, on by default) through `useDirtyGuard`. |
871
+ | `SettingsPage`, `SettingsSection`, `SaveBar` | Section nav (sticky on the left, a scrolling row on narrow screens; items with `to` become route links), `#section-<value>` panels, section cards with a save footer, and a floating save bar while `dirty`. |
872
+ | `ErrorPage`, `NotFoundPage` | Status code, title, message (defaults per status code, reads a Nuxt `error`), home, retry (`@retry`) and back actions. `@home` replaces the home link, handy for `clearError`. |
873
+ | `EmptyPage` | First run screen: illustration, title, description, primary and secondary actions, onboarding `steps`. |
867
874
 
868
875
  `useDirtyGuard(dirty, options?)` asks before leaving (router navigation through `ConfirmHost`, or the native confirm) and on tab close. Returns `confirmLeave()` and `allowNext()`. It is built on the leave guard, see [Unsaved changes](#unsaved-changes).
869
876
 
@@ -949,7 +956,7 @@ The account row opens the SettingsModal (`account.action: 'menu'` with `account.
949
956
 
950
957
  Pages pick them with `definePageMeta({ layout: 'k-dashboard', title: 'Items' })` or `layout: 'k-auth'` (the auth frame shows `title` and `description` from the page meta). Both layouts set the document title from `meta.title` and the brand name (`Items · Acme`; a page's own `useHead({ title })` wins) and announce route changes through a polite live region, unless the app already renders `<NuxtRouteAnnouncer />`. Breadcrumbs come from `meta.breadcrumbs`, otherwise from the matching navigation item (plus `meta.title` on deeper pages). At runtime `useDashboard().value = { account, breadcrumbs, badges: { '/items': 12 } }` overrides the account, the breadcrumbs and the badges. Set it in route middleware (`definePageMeta({ middleware })`) or a plugin, not in the page `setup`: the layout renders the sidebar and breadcrumbs before the page, so a value set during the page render would differ between the server HTML and hydration.
951
958
 
952
- When a link goes to another path, the old page stays on screen until the new page has rendered (Vue renders it in one synchronous pass, or waits for its async setup). The module plugin `k:navigation` sets `useNavigationPending()` at the start of the navigation and waits two animation frames, so `k-dashboard` hides the old page and paints a page skeleton (the `loading` prop of `DashboardLayout`) before the new page renders. It ends when the new page has rendered, or at `page:finish` for a page that suspends. Hash and query changes on the same path keep the page. In your own layout, bind it yourself: `<KDashboardLayout :loading="useNavigationPending().value">`, and replace the skeleton with the `loading` slot.
959
+ When a link goes to another path, the old page stays on screen until the new page has rendered (Vue renders it in one synchronous pass, or waits for its async setup). The module plugin `k:navigation` sets `useNavigationPending()` once the navigation guards have let the navigation go on (in `beforeResolve`, so the discard question of a leave guard shows over the current page, and a cancelled navigation never shows the skeleton) and waits two animation frames, so `k-dashboard` hides the old page and paints a page skeleton (the `loading` prop of `DashboardLayout`) before the new page renders. It ends when the new page has rendered, or at `page:finish` for a page that suspends. Hash and query changes on the same path keep the page. In your own layout, bind it yourself: `<KDashboardLayout :loading="useNavigationPending().value">`, and replace the skeleton with the `loading` slot.
953
960
 
954
961
  ### Starter
955
962
 
@@ -19,19 +19,20 @@
19
19
  <slot name="count" :count="count" :total="total">{{ countText }}</slot>
20
20
  </span>
21
21
  <Button
22
- v-if="onSelectAll && total !== void 0 && count < total"
22
+ v-if="allAction"
23
23
  class="k-selection-bar-all"
24
24
  variant="ghost"
25
25
  tone="neutral"
26
26
  size="xs"
27
- :label="selectAllText"
28
- @click="onSelectAll"
27
+ :label="allAction === 'clear' ? clearText : selectAllText"
28
+ :loading="selectingAll"
29
+ @click="runAllAction"
29
30
  />
30
31
  <div v-if="$slots.actions" class="k-selection-bar-actions">
31
32
  <slot name="actions" :count="count" />
32
33
  </div>
33
34
  <Button
34
- v-if="onClear"
35
+ v-if="onClear && allAction !== 'clear'"
35
36
  class="k-selection-bar-clear"
36
37
  variant="ghost"
37
38
  tone="neutral"
@@ -76,6 +77,25 @@ const countText = computed(() => {
76
77
  return t("selectionBar.selectedOf", { count: props.count, total: props.total });
77
78
  return t("common.selected", { count: props.count });
78
79
  });
80
+ const allAction = computed(() => {
81
+ if (!props.onSelectAll || props.total === void 0) return void 0;
82
+ if (props.count < props.total) return "select";
83
+ return props.onClear ? "clear" : void 0;
84
+ });
85
+ const selectingAll = ref(false);
86
+ async function runAllAction() {
87
+ if (allAction.value === "clear") {
88
+ props.onClear?.();
89
+ return;
90
+ }
91
+ if (selectingAll.value) return;
92
+ selectingAll.value = true;
93
+ try {
94
+ await props.onSelectAll?.();
95
+ } finally {
96
+ selectingAll.value = false;
97
+ }
98
+ }
79
99
  const announcement = ref("");
80
100
  const mounted = ref(false);
81
101
  watch(
@@ -17,7 +17,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
17
17
  selectAllLabel?: string;
18
18
  clearLabel?: string;
19
19
  clearedText?: string;
20
- onSelectAll?: () => void;
20
+ onSelectAll?: () => unknown;
21
21
  onClear?: () => void;
22
22
  innerHTML?: string | undefined | undefined;
23
23
  class?: import("vue").ClassValue;
@@ -220,7 +220,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
220
220
  selectAllLabel?: string;
221
221
  clearLabel?: string;
222
222
  clearedText?: string;
223
- onSelectAll?: () => void;
223
+ onSelectAll?: () => unknown;
224
224
  onClear?: () => void;
225
225
  innerHTML?: string | undefined | undefined;
226
226
  class?: import("vue").ClassValue;
@@ -37,7 +37,8 @@ const props = defineProps({
37
37
  separator: { type: null, required: false, default: "chevron-right" },
38
38
  linkLast: { type: Boolean, required: false },
39
39
  ancestors: { type: Boolean, required: false },
40
- size: { type: String, required: false, default: "md" }
40
+ size: { type: String, required: false, default: "md" },
41
+ heading: { type: Number, required: false }
41
42
  });
42
43
  defineSlots();
43
44
  const { t } = useLocale();
@@ -48,7 +49,10 @@ const parts = computed(
48
49
  const last = index === props.items.length - 1;
49
50
  const current = last && !props.linkLast && !props.ancestors;
50
51
  const extra = { ...item.attrs, ...item.onClick ? { onClick: item.onClick } : {} };
51
- if (current) return { item, is: "span", attrs: { ...extra, "aria-current": "page" }, current };
52
+ if (current) {
53
+ const is = props.heading ? `h${props.heading}` : "span";
54
+ return { item, is, attrs: { ...extra, "aria-current": "page" }, current };
55
+ }
52
56
  const pageAttrs = last && !props.ancestors ? { "aria-current": "page" } : {};
53
57
  const link = resolveLink(item);
54
58
  if (link)
@@ -1,5 +1,5 @@
1
1
  import type { IconName } from '../../composables/useIcons';
2
- import type { BreadcrumbItem, BreadcrumbsSize } from './types';
2
+ import type { BreadcrumbItem, BreadcrumbsSize, HeadingLevel } from './types';
3
3
  type __VLS_Slots = {
4
4
  item?: (props: {
5
5
  item: BreadcrumbItem;
@@ -14,6 +14,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
14
14
  linkLast?: boolean;
15
15
  ancestors?: boolean;
16
16
  size?: BreadcrumbsSize;
17
+ heading?: HeadingLevel;
17
18
  innerHTML?: string | undefined | undefined;
18
19
  class?: import("vue").ClassValue;
19
20
  style?: import("vue").StyleValue;
@@ -213,6 +214,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
213
214
  linkLast?: boolean;
214
215
  ancestors?: boolean;
215
216
  size?: BreadcrumbsSize;
217
+ heading?: HeadingLevel;
216
218
  innerHTML?: string | undefined | undefined;
217
219
  class?: import("vue").ClassValue;
218
220
  style?: import("vue").StyleValue;
@@ -24,8 +24,25 @@
24
24
  </span>
25
25
  <div class="k-page-header-text">
26
26
  <div class="k-page-header-title-line">
27
+ <Breadcrumbs
28
+ v-if="trail?.length"
29
+ class="k-page-header-trail"
30
+ :items="trailItems"
31
+ :label="trailLabel"
32
+ :heading="level"
33
+ size="lg"
34
+ >
35
+ <template #item="{ item, current }">
36
+ <slot v-if="current" name="title">{{ item.label }}</slot>
37
+ <template v-else>
38
+ <Icon v-if="item.icon" :name="item.icon" />
39
+ {{ item.label }}
40
+ </template>
41
+ </template>
42
+ </Breadcrumbs>
27
43
  <component
28
44
  :is="`h${level}`"
45
+ v-else
29
46
  class="k-page-header-title"
30
47
  :title="truncate ? title : void 0"
31
48
  >
@@ -49,17 +66,27 @@
49
66
  </template>
50
67
 
51
68
  <script setup>
69
+ import { computed } from "vue";
52
70
  import Icon from "../core/Icon.vue";
53
71
  import Breadcrumbs from "./Breadcrumbs.vue";
54
- defineProps({
72
+ const props = defineProps({
55
73
  title: { type: String, required: false },
56
74
  description: { type: String, required: false },
57
75
  icon: { type: null, required: false },
58
76
  breadcrumbs: { type: Array, required: false },
59
77
  breadcrumbsAncestors: { type: Boolean, required: false },
78
+ trail: { type: Array, required: false },
79
+ trailLabel: { type: String, required: false },
60
80
  level: { type: Number, required: false, default: 1 },
61
81
  bordered: { type: Boolean, required: false },
62
82
  align: { type: String, required: false, default: "end" },
63
83
  truncate: { type: Boolean, required: false }
64
84
  });
85
+ const trailItems = computed(() => [
86
+ ...props.trail ?? [],
87
+ {
88
+ label: props.title ?? "",
89
+ attrs: props.truncate && props.title ? { title: props.title } : void 0
90
+ }
91
+ ]);
65
92
  </script>
@@ -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_25: {}, __VLS_27: {}, __VLS_29: {}, __VLS_31: {}, __VLS_33: {};
7
+ }, __VLS_12: {}, __VLS_26: {}, __VLS_39: {}, __VLS_41: {}, __VLS_43: {}, __VLS_45: {}, __VLS_47: {};
8
8
  type __VLS_Slots = {} & {
9
9
  breadcrumbs?: (props: typeof __VLS_1) => any;
10
10
  } & {
@@ -12,15 +12,17 @@ type __VLS_Slots = {} & {
12
12
  } & {
13
13
  icon?: (props: typeof __VLS_12) => any;
14
14
  } & {
15
- title?: (props: typeof __VLS_25) => any;
15
+ title?: (props: typeof __VLS_26) => any;
16
16
  } & {
17
- badge?: (props: typeof __VLS_27) => any;
17
+ title?: (props: typeof __VLS_39) => any;
18
18
  } & {
19
- description?: (props: typeof __VLS_29) => any;
19
+ badge?: (props: typeof __VLS_41) => any;
20
20
  } & {
21
- actions?: (props: typeof __VLS_31) => any;
21
+ description?: (props: typeof __VLS_43) => any;
22
22
  } & {
23
- default?: (props: typeof __VLS_33) => any;
23
+ actions?: (props: typeof __VLS_45) => any;
24
+ } & {
25
+ default?: (props: typeof __VLS_47) => any;
24
26
  };
25
27
  declare const __VLS_base: import("vue").DefineComponent<{
26
28
  title?: string | undefined;
@@ -28,6 +30,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
28
30
  icon?: IconName;
29
31
  breadcrumbs?: BreadcrumbItem[];
30
32
  breadcrumbsAncestors?: boolean;
33
+ trail?: BreadcrumbItem[];
34
+ trailLabel?: string;
31
35
  level?: HeadingLevel;
32
36
  bordered?: boolean;
33
37
  align?: "start" | "center" | "end";
@@ -229,6 +233,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
229
233
  icon?: IconName;
230
234
  breadcrumbs?: BreadcrumbItem[];
231
235
  breadcrumbsAncestors?: boolean;
236
+ trail?: BreadcrumbItem[];
237
+ trailLabel?: string;
232
238
  level?: HeadingLevel;
233
239
  bordered?: boolean;
234
240
  align?: "start" | "center" | "end";
@@ -231,8 +231,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
231
231
  onOpen?: (() => any) | undefined;
232
232
  backLabel?: string;
233
233
  closeLabel?: string;
234
- onNavigate?: ((index: number) => any) | undefined;
235
234
  trail?: string[];
235
+ onNavigate?: ((index: number) => any) | undefined;
236
236
  rootClass?: unknown;
237
237
  hideClose?: boolean;
238
238
  beforeClose?: import("./types.ts").DialogBeforeClose;
@@ -472,8 +472,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
472
472
  onOpen?: (() => any) | undefined;
473
473
  backLabel?: string;
474
474
  closeLabel?: string;
475
- onNavigate?: ((index: number) => any) | undefined;
476
475
  trail?: string[];
476
+ onNavigate?: ((index: number) => any) | undefined;
477
477
  rootClass?: unknown;
478
478
  hideClose?: boolean;
479
479
  beforeClose?: import("./types.ts").DialogBeforeClose;
@@ -221,8 +221,8 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
221
221
  readonly onOpen?: (() => any) | undefined;
222
222
  readonly backLabel?: string | undefined;
223
223
  readonly closeLabel?: string | undefined;
224
- readonly onNavigate?: ((index: number) => any) | undefined;
225
224
  readonly trail?: string[] | undefined;
225
+ readonly onNavigate?: ((index: number) => any) | undefined;
226
226
  readonly rootClass?: unknown;
227
227
  readonly hideClose?: boolean | undefined;
228
228
  readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
@@ -458,8 +458,8 @@ declare const __VLS_export: import("vue").DefineComponent<Partial<NonNullable<{
458
458
  readonly onOpen?: (() => any) | undefined;
459
459
  readonly backLabel?: string | undefined;
460
460
  readonly closeLabel?: string | undefined;
461
- readonly onNavigate?: ((index: number) => any) | undefined;
462
461
  readonly trail?: string[] | undefined;
462
+ readonly onNavigate?: ((index: number) => any) | undefined;
463
463
  readonly rootClass?: unknown;
464
464
  readonly hideClose?: boolean | undefined;
465
465
  readonly beforeClose?: import("./types.ts").DialogBeforeClose | undefined;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="k-page k-list-page">
2
+ <div class="k-page k-list-page" :class="{ 'is-fill': fill }">
3
3
  <PageHeader
4
4
  :title="title"
5
5
  :description="description"
@@ -7,6 +7,11 @@
7
7
  :breadcrumbs="breadcrumbs"
8
8
  :level="level"
9
9
  >
10
+ <template v-if="$slots.badge || countValue !== void 0" #badge>
11
+ <slot name="badge" :total="resultTotal">
12
+ <Badge v-if="countValue !== void 0">{{ countText }}</Badge>
13
+ </slot>
14
+ </template>
10
15
  <template v-if="$slots.actions" #actions><slot name="actions" /></template>
11
16
  </PageHeader>
12
17
 
@@ -20,6 +25,7 @@
20
25
  :title="errorText"
21
26
  :description="typeof error === 'string' ? error : void 0"
22
27
  :level="childLevel"
28
+ :fill="fill"
23
29
  >
24
30
  <template #actions>
25
31
  <Button
@@ -42,6 +48,7 @@
42
48
  :title="emptyTitleText"
43
49
  :description="emptyDescription"
44
50
  :level="childLevel"
51
+ :fill="fill"
45
52
  >
46
53
  <template v-if="$slots['empty-actions']" #actions>
47
54
  <slot name="empty-actions" />
@@ -80,7 +87,9 @@
80
87
  v-if="selectable"
81
88
  class="k-list-selection"
82
89
  :count="selected.length"
83
- :selected-text="selectedLabel"
90
+ :total="resultTotal"
91
+ :selected-text="selectedText"
92
+ :on-select-all="canSelectAll ? selectAll : void 0"
84
93
  :on-clear="clearSelection"
85
94
  >
86
95
  <template v-if="$slots.bulk" #actions>
@@ -91,7 +100,10 @@
91
100
  </div>
92
101
  </div>
93
102
 
94
- <slot name="table" :rows="visibleRows" :loading="loading">
103
+ <div v-if="fill && $slots.table" class="k-list-scroll">
104
+ <slot name="table" :rows="visibleRows" :loading="loading" />
105
+ </div>
106
+ <slot v-else name="table" :rows="visibleRows" :loading="loading">
95
107
  <Table
96
108
  v-model:sort="sort"
97
109
  v-model:selected="selected"
@@ -165,7 +177,9 @@ import { useLocale } from "../../composables/useLocale";
165
177
  import Button from "../core/Button.vue";
166
178
  import { createCollator, readCell, sortRows } from "../../internal/data/rows";
167
179
  import { normalizeSearch } from "../../internal/core/text";
180
+ import { numberFormat } from "../../internal/core/intl";
168
181
  import Input from "../core/Input.vue";
182
+ import Badge from "../data/Badge.vue";
169
183
  import FilterPills from "../data/FilterPills.vue";
170
184
  import Pagination from "../data/Pagination.vue";
171
185
  import SelectionBar from "../data/SelectionBar.vue";
@@ -180,6 +194,7 @@ const props = defineProps({
180
194
  icon: { type: null, required: false },
181
195
  breadcrumbs: { type: Array, required: false },
182
196
  level: { type: Number, required: false, default: 1 },
197
+ count: { type: [Number, Boolean], required: false },
183
198
  rows: { type: Array, required: false, default: () => [] },
184
199
  columns: { type: Array, required: false },
185
200
  rowKey: { type: [String, Function], required: false, default: "id" },
@@ -189,6 +204,7 @@ const props = defineProps({
189
204
  selectable: { type: Boolean, required: false },
190
205
  density: { type: String, required: false, default: "normal" },
191
206
  stickyHeader: { type: Boolean, required: false, default: true },
207
+ fill: { type: Boolean, required: false },
192
208
  loading: { type: Boolean, required: false },
193
209
  error: { type: [String, Boolean], required: false },
194
210
  total: { type: Number, required: false },
@@ -202,6 +218,7 @@ const props = defineProps({
202
218
  filterKey: { type: String, required: false },
203
219
  filterMultiple: { type: Boolean, required: false, default: true },
204
220
  filterLabel: { type: String, required: false },
221
+ filtered: { type: Boolean, required: false },
205
222
  toolbarLabel: { type: String, required: false },
206
223
  emptyTitle: { type: String, required: false },
207
224
  emptyDescription: { type: String, required: false },
@@ -211,6 +228,7 @@ const props = defineProps({
211
228
  clearLabel: { type: String, required: false },
212
229
  errorTitle: { type: String, required: false },
213
230
  retryLabel: { type: String, required: false },
231
+ allIds: { type: Function, required: false },
214
232
  selectedText: { type: Function, required: false },
215
233
  resultsText: { type: Function, required: false }
216
234
  });
@@ -227,9 +245,6 @@ const clearText = computed(() => props.clearLabel ?? t("listPage.clearFilters"))
227
245
  const errorText = computed(() => props.errorTitle ?? t("common.somethingWentWrong"));
228
246
  const retryText = computed(() => props.retryLabel ?? t("common.retry"));
229
247
  const childLevel = computed(() => Math.min(props.level + 1, 6));
230
- function selectedLabel(count) {
231
- return props.selectedText ? props.selectedText(count) : t("common.selected", { count });
232
- }
233
248
  const emit = defineEmits(["retry", "clear", "rowClick"]);
234
249
  defineSlots();
235
250
  const page = defineModel("page", { type: Number, ...{ default: 1 } });
@@ -251,7 +266,9 @@ const filterValues = computed(() => {
251
266
  if (value === null || value === void 0) return [];
252
267
  return Array.isArray(value) ? value : [value];
253
268
  });
254
- const isFiltered = computed(() => search.value.trim() !== "" || filterValues.value.length > 0);
269
+ const isFiltered = computed(
270
+ () => props.filtered || search.value.trim() !== "" || filterValues.value.length > 0
271
+ );
255
272
  function clearSelection() {
256
273
  selected.value = [];
257
274
  }
@@ -266,7 +283,7 @@ function read(row, key) {
266
283
  const searchFields = computed(
267
284
  () => props.searchKeys ?? props.columns?.map((column) => column.key) ?? []
268
285
  );
269
- const filtered = computed(() => {
286
+ const matchingRows = computed(() => {
270
287
  if (serverMode.value) return props.rows;
271
288
  const query = normalizeSearch(search.value.trim());
272
289
  const values = filterValues.value;
@@ -283,7 +300,7 @@ const filtered = computed(() => {
283
300
  });
284
301
  const collator = computed(() => createCollator(locale.value.code));
285
302
  const sorted = computed(
286
- () => serverMode.value ? filtered.value : sortRows(filtered.value, sort.value, props.columns, collator.value)
303
+ () => serverMode.value ? matchingRows.value : sortRows(matchingRows.value, sort.value, props.columns, collator.value)
287
304
  );
288
305
  const rowsPerPage = computed(
289
306
  () => pageSize.value === "all" ? Math.max(1, resultTotal.value) : pageSize.value
@@ -295,6 +312,31 @@ const visibleRows = computed(() => {
295
312
  const start = (page.value - 1) * pageSize.value;
296
313
  return sorted.value.slice(start, start + pageSize.value);
297
314
  });
315
+ function keyOf(row, index) {
316
+ if (typeof props.rowKey === "function") return props.rowKey(row, index);
317
+ const value = row[props.rowKey];
318
+ return typeof value === "string" || typeof value === "number" ? value : index;
319
+ }
320
+ const pageFullySelected = computed(() => {
321
+ if (!visibleRows.value.length) return false;
322
+ const keys = new Set(selected.value);
323
+ return visibleRows.value.every((row, index) => keys.has(keyOf(row, index)));
324
+ });
325
+ const canSelectAll = computed(
326
+ () => !props.loading && (!serverMode.value || Boolean(props.allIds)) && resultTotal.value > visibleRows.value.length && pageFullySelected.value
327
+ );
328
+ async function selectAll() {
329
+ if (!serverMode.value) {
330
+ selected.value = sorted.value.map((row, index) => keyOf(row, index));
331
+ return;
332
+ }
333
+ if (!props.allIds) return;
334
+ try {
335
+ selected.value = [...await props.allIds()];
336
+ } catch (reason) {
337
+ console.error("[@xleddyl/443-components-vue] ListPage allIds failed", reason);
338
+ }
339
+ }
298
340
  const isFirstRun = computed(
299
341
  () => !props.loading && !isFiltered.value && props.rows.length === 0 && (!serverMode.value || props.total === 0)
300
342
  );
@@ -303,8 +345,17 @@ function clearFilters() {
303
345
  filter.value = Array.isArray(filter.value) ? [] : null;
304
346
  emit("clear");
305
347
  }
348
+ const countValue = computed(() => {
349
+ if (typeof props.count === "number") return props.count;
350
+ if (!props.count || props.error || isFirstRun.value) return void 0;
351
+ if (props.loading && !props.rows.length) return void 0;
352
+ return serverMode.value ? props.total ?? 0 : props.rows.length;
353
+ });
354
+ const countText = computed(
355
+ () => countValue.value === void 0 ? "" : numberFormat(locale.value.code).format(countValue.value)
356
+ );
306
357
  const interacted = ref(false);
307
- watch([search, filterValues], () => {
358
+ watch([search, filterValues, () => props.filtered], () => {
308
359
  interacted.value = true;
309
360
  if (page.value !== 1) page.value = 1;
310
361
  });
@@ -9,6 +9,7 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
9
9
  icon?: IconName;
10
10
  breadcrumbs?: BreadcrumbItem[];
11
11
  level?: HeadingLevel;
12
+ count?: number | boolean;
12
13
  rows?: T[];
13
14
  columns?: TableColumn<T>[];
14
15
  rowKey?: string | ((row: T, index: number) => RowKey);
@@ -18,6 +19,7 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
18
19
  selectable?: boolean;
19
20
  density?: TableDensity;
20
21
  stickyHeader?: boolean;
22
+ fill?: boolean;
21
23
  loading?: boolean;
22
24
  error?: string | boolean;
23
25
  total?: number;
@@ -31,6 +33,7 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
31
33
  filterKey?: string;
32
34
  filterMultiple?: boolean;
33
35
  filterLabel?: string;
36
+ filtered?: boolean;
34
37
  toolbarLabel?: string;
35
38
  emptyTitle?: string;
36
39
  emptyDescription?: string;
@@ -40,7 +43,8 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
40
43
  clearLabel?: string;
41
44
  errorTitle?: string;
42
45
  retryLabel?: string;
43
- selectedText?: (count: number) => string;
46
+ allIds?: () => Promise<readonly RowKey[]> | readonly RowKey[];
47
+ selectedText?: (count: number, total?: number) => string;
44
48
  resultsText?: (count: number) => string;
45
49
  } & {
46
50
  page?: number;
@@ -78,6 +82,9 @@ declare const __VLS_export: <T extends object>(__VLS_props: NonNullable<Awaited<
78
82
  } & {
79
83
  default?: () => unknown;
80
84
  actions?: () => unknown;
85
+ badge?: (props: {
86
+ total: number;
87
+ }) => unknown;
81
88
  before?: () => unknown;
82
89
  toolbar?: () => unknown;
83
90
  'toolbar-end'?: () => unknown;
@@ -262,8 +262,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
262
262
  sheet?: boolean;
263
263
  tab?: import("../layout/types.ts").TabItem["value"];
264
264
  onCancel?: ((payload: Event) => void) | undefined;
265
- onNavigate?: ((index: number) => any) | undefined;
266
265
  trail?: string[];
266
+ onNavigate?: ((index: number) => any) | undefined;
267
267
  rootClass?: unknown;
268
268
  hideClose?: boolean;
269
269
  "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
@@ -518,8 +518,8 @@ declare const __VLS_base: import("vue").DefineComponent<{
518
518
  sheet?: boolean;
519
519
  tab?: import("../layout/types.ts").TabItem["value"];
520
520
  onCancel?: ((payload: Event) => void) | undefined;
521
- onNavigate?: ((index: number) => any) | undefined;
522
521
  trail?: string[];
522
+ onNavigate?: ((index: number) => any) | undefined;
523
523
  rootClass?: unknown;
524
524
  hideClose?: boolean;
525
525
  "onUpdate:tab"?: ((value: string | number | undefined) => any) | undefined;
@@ -14,6 +14,7 @@ export declare function routeParam(route: {
14
14
  } | undefined, key: string, location: RouteLocation): string | undefined;
15
15
  export declare function useDefaultRouteLocation(): RouteLocation;
16
16
  export declare function useRouteValue(router: RouterLike | undefined, key: MaybeRefOrGetter<string | undefined>, location?: MaybeRefOrGetter<RouteLocation>): import("vue").ComputedRef<string | undefined>;
17
+ export declare function trackUntrackedEntries(): void;
17
18
  export declare function routeHash(hash: string | undefined, changes: Record<string, string | undefined>): string;
18
19
  export declare function writeRouteValue(router: RouterLike, key: string, value: string | undefined, history: RouteHistory, location?: RouteLocation): Promise<boolean>;
19
20
  export {};
@@ -50,6 +50,7 @@ function useHashReady() {
50
50
  }
51
51
  export function useRouteValue(router, key, location = "query") {
52
52
  const hashReady = useHashReady();
53
+ if (router) trackUntrackedEntries();
53
54
  return computed(() => {
54
55
  const name = toValue(key);
55
56
  if (!router || !name) return void 0;
@@ -59,11 +60,23 @@ export function useRouteValue(router, key, location = "query") {
59
60
  return firstQueryValue(route?.query?.[name]);
60
61
  });
61
62
  }
63
+ const UNTRACKED_ENTRY = "kUntracked";
64
+ let untrackedListening = false;
65
+ function markUntrackedEntry(event) {
66
+ if (event.state !== null) return;
67
+ const state = window.history.state;
68
+ window.history.replaceState({ ...state, [UNTRACKED_ENTRY]: true }, "");
69
+ }
70
+ export function trackUntrackedEntries() {
71
+ if (untrackedListening || !isClient()) return;
72
+ untrackedListening = true;
73
+ window.addEventListener("popstate", markUntrackedEntry);
74
+ }
62
75
  function isPreviousEntry(router, location) {
63
76
  if (!router.back || !router.resolve) return false;
64
- const back = window.history.state?.back;
65
- if (typeof back !== "string") return false;
66
- return router.resolve(location).fullPath === back;
77
+ const state = window.history.state;
78
+ if (state?.[UNTRACKED_ENTRY] || typeof state?.back !== "string") return false;
79
+ return router.resolve(location).fullPath === state.back;
67
80
  }
68
81
  function applyQuery(current, changes) {
69
82
  const query = { ...current };
@@ -219,8 +219,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
219
219
  onOpen?: ((() => any) & (() => any)) | undefined;
220
220
  backLabel?: string;
221
221
  closeLabel?: string;
222
- onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
223
222
  trail?: string[];
223
+ onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
224
224
  rootClass?: unknown;
225
225
  hideClose?: boolean;
226
226
  beforeClose?: import("../../index.ts").DialogBeforeClose;
@@ -453,8 +453,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
453
453
  onOpen?: ((() => any) & (() => any)) | undefined;
454
454
  backLabel?: string;
455
455
  closeLabel?: string;
456
- onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
457
456
  trail?: string[];
457
+ onNavigate?: (((index: number) => any) & ((index: number) => any)) | undefined;
458
458
  rootClass?: unknown;
459
459
  hideClose?: boolean;
460
460
  beforeClose?: import("../../index.ts").DialogBeforeClose;
@@ -0,0 +1 @@
1
+ export { useDashboard, useNavigationPending } from './runtime/dashboard';
@@ -0,0 +1 @@
1
+ export { useDashboard, useNavigationPending } from "./runtime/dashboard.mjs";
@@ -132,8 +132,8 @@ export default defineNuxtModule({
132
132
  if (typeof options.grid === "object") addPlugin(resolver.resolve("./runtime/grid"));
133
133
  if (options.composables) {
134
134
  addImports([
135
- { name: "useDashboard", from: resolver.resolve("./runtime/dashboard") },
136
- { name: "useNavigationPending", from: resolver.resolve("./runtime/dashboard") }
135
+ { name: "useDashboard", from: resolver.resolve("./composables") },
136
+ { name: "useNavigationPending", from: resolver.resolve("./composables") }
137
137
  ]);
138
138
  }
139
139
  const layouts = resolveLayouts(options.layouts);
@@ -19,7 +19,7 @@ export default defineNuxtPlugin({
19
19
  if (pending.value) suspended = true;
20
20
  });
21
21
  nuxtApp.hook("page:finish", done);
22
- router.beforeEach(async (to, from) => {
22
+ router.beforeResolve(async (to, from) => {
23
23
  if (nuxtApp.isHydrating || pending.value || to.path === from.path) return;
24
24
  pending.value = true;
25
25
  await nextFrame();
@@ -1,12 +1,14 @@
1
1
  import { defineNuxtPlugin, useRouter, useRuntimeConfig } from "nuxt/app";
2
2
  import { withRouteStateScroll } from "../../composables/useRouteState.mjs";
3
3
  import { ROUTE_LOCATION_KEY } from "../../internal/keys.mjs";
4
+ import { trackUntrackedEntries } from "../../internal/layout/query.mjs";
4
5
  export default defineNuxtPlugin({
5
6
  name: "k:route-state",
6
7
  setup(nuxtApp) {
7
8
  const config = useRuntimeConfig().public.k ?? {};
8
9
  nuxtApp.vueApp.provide(ROUTE_LOCATION_KEY, config.routeLocation === "hash" ? "hash" : "query");
9
10
  if (import.meta.server) return;
11
+ trackUntrackedEntries();
10
12
  const options = useRouter().options;
11
13
  const wrap = (behavior) => behavior ? withRouteStateScroll(behavior) : void 0;
12
14
  let scrollBehavior = wrap(options.scrollBehavior);
@@ -45,7 +45,9 @@
45
45
  }
46
46
 
47
47
  .k-breadcrumbs-current {
48
+ font-family: inherit;
48
49
  font-weight: var(--k-font-weight-medium, 500);
50
+ letter-spacing: inherit;
49
51
  color: var(--k-text);
50
52
  }
51
53
 
@@ -101,3 +101,26 @@
101
101
  text-overflow: ellipsis;
102
102
  white-space: nowrap;
103
103
  }
104
+
105
+ .k-page-header-trail {
106
+ min-width: 0;
107
+ }
108
+
109
+ .k-breadcrumbs.k-page-header-trail .k-breadcrumbs-list {
110
+ font-size: 1.375rem;
111
+ }
112
+
113
+ .k-page-header.is-truncated .k-page-header-trail .k-breadcrumbs-list {
114
+ flex-wrap: nowrap;
115
+ }
116
+
117
+ .k-page-header.is-truncated .k-page-header-trail .k-breadcrumbs-item:not(:last-child) {
118
+ flex: none;
119
+ }
120
+
121
+ .k-page-header.is-truncated .k-page-header-trail .k-breadcrumbs-current {
122
+ display: block;
123
+ overflow: hidden;
124
+ text-overflow: ellipsis;
125
+ white-space: nowrap;
126
+ }
@@ -45,3 +45,41 @@
45
45
  .k-list-empty {
46
46
  padding-block: 3.5rem;
47
47
  }
48
+
49
+ .k-page.k-list-page.is-fill {
50
+ flex: 1 0 auto;
51
+ }
52
+
53
+ .k-list-page.is-fill > :is(.k-list-card, .k-list-state) {
54
+ flex: 1 1 0;
55
+ min-height: 20rem;
56
+ }
57
+
58
+ .k-list-page.is-fill > :is(.k-list-card, .k-list-state) > .k-card-body {
59
+ display: flex;
60
+ flex-direction: column;
61
+ min-height: 0;
62
+ }
63
+
64
+ .k-list-page.is-fill > .k-list-card > .k-card-body > :is(.k-table, .k-list-scroll) {
65
+ flex: 1 1 0;
66
+ min-height: 0;
67
+ }
68
+
69
+ .k-list-scroll {
70
+ overflow: auto;
71
+ overscroll-behavior: contain;
72
+ }
73
+
74
+ .k-list-page.is-fill .k-table-scroll {
75
+ display: flex;
76
+ flex-direction: column;
77
+ }
78
+
79
+ .k-list-page.is-fill .k-table-el {
80
+ flex: none;
81
+ }
82
+
83
+ .k-list-page.is-fill .k-table-el:has(> .k-table-body > .k-table-empty-row) {
84
+ flex: 1 0 auto;
85
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/443-components-vue",
3
- "version": "0.16.91",
3
+ "version": "0.16.93",
4
4
  "description": "Compact, scoped dashboard components for Vue and Nuxt",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",
@@ -28,6 +28,11 @@
28
28
  "import": "./dist/nuxt/module.mjs",
29
29
  "default": "./dist/nuxt/module.mjs"
30
30
  },
31
+ "./nuxt/composables": {
32
+ "types": "./dist/nuxt/composables.d.ts",
33
+ "import": "./dist/nuxt/composables.mjs",
34
+ "default": "./dist/nuxt/composables.mjs"
35
+ },
31
36
  "./style.css": "./dist/styles/index.css",
32
37
  "./grid": {
33
38
  "types": "./dist/grid/index.d.ts",