@xleddyl/443-components-vue 0.16.92 → 0.16.94
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 +10 -5
- package/README.md +45 -25
- package/dist/components/core/Button.vue.d.ts +3 -3
- package/dist/components/data/SelectionBar.vue +24 -4
- package/dist/components/data/SelectionBar.vue.d.ts +2 -2
- package/dist/components/data/Thumbnail.vue +157 -0
- package/dist/components/data/Thumbnail.vue.d.ts +439 -0
- package/dist/components/data/index.d.ts +1 -0
- package/dist/components/data/index.mjs +1 -0
- package/dist/components/data/types.d.ts +9 -0
- package/dist/components/forms/FocalPointInput.vue +251 -0
- package/dist/components/forms/FocalPointInput.vue.d.ts +426 -0
- package/dist/components/forms/PaletteSelect.vue.d.ts +2 -2
- package/dist/components/forms/index.d.ts +1 -0
- package/dist/components/forms/index.mjs +1 -0
- package/dist/components/layout/ThemeSwitch.vue.d.ts +2 -2
- package/dist/components/layout/types.d.ts +1 -1
- package/dist/components/templates/FormPage.vue.d.ts +2 -2
- package/dist/components/templates/ListPage.vue +54 -6
- package/dist/components/templates/ListPage.vue.d.ts +7 -1
- package/dist/grid/cells/ButtonCell.vue.d.ts +2 -2
- package/dist/icons/builtin.d.ts +2 -0
- package/dist/icons/builtin.mjs +6 -0
- package/dist/locale/de.mjs +11 -0
- package/dist/locale/en.mjs +11 -0
- package/dist/locale/it.mjs +11 -0
- package/dist/locale/types.d.ts +11 -0
- package/dist/styles/data/thumbnail.css +209 -0
- package/dist/styles/data.css +1 -0
- package/dist/styles/forced-colors.css +12 -0
- package/dist/styles/forms/focal-point-input.css +154 -0
- package/dist/styles/forms.css +1 -0
- package/dist/styles/layout/card.css +84 -0
- package/dist/styles/tailwind.css +2 -0
- package/dist/styles/templates/list-page.css +38 -0
- package/dist/styles/tokens.css +2 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -61,6 +61,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
61
61
|
| Number in a range | `Slider` |
|
|
62
62
|
| One time code, OTP | `PinInput` |
|
|
63
63
|
| File or folder upload with drop zone | `FileInput` |
|
|
64
|
+
| Focal point of an image (the part kept in view when cropped) | `FocalPointInput` (preview the crops with `Thumbnail` `focal`) |
|
|
64
65
|
| Drop files on any element | `useFileDrop` |
|
|
65
66
|
| Confirm a destructive action | `useConfirm` |
|
|
66
67
|
| Show a message the user must acknowledge | `useAlert` |
|
|
@@ -98,6 +99,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
98
99
|
| Reorder any list by drag and keyboard | `useSortable` |
|
|
99
100
|
| Status label, counter, dot | `Badge` |
|
|
100
101
|
| User picture or initials; stack of users | `Avatar`; `AvatarGroup` |
|
|
102
|
+
| Preview of an image, video or file (media grid, upload tile, table cell) | `Thumbnail` |
|
|
101
103
|
| Key figure with delta and trend (KPI) | `Stat` |
|
|
102
104
|
| Label and value pairs (details) | `DescriptionList` |
|
|
103
105
|
| Event history, activity feed | `Timeline` |
|
|
@@ -107,13 +109,14 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
107
109
|
| Wizard steps, step indicator (Step 2 of 4) | `Stepper` |
|
|
108
110
|
| Collapsible sections, FAQ | `Accordion` |
|
|
109
111
|
| Container with title and actions | `Card` |
|
|
112
|
+
| "Add" tile next to a grid of items, empty drop area | `Card` `variant="dashed"` (`as="button"`, `icon`, `title`) |
|
|
110
113
|
| Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
|
|
111
114
|
| Breadcrumb trail as the page title (a record, a nested page) | `trail` on `PageHeader` |
|
|
112
115
|
| Breadcrumbs only | `Breadcrumbs` |
|
|
113
116
|
| Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
|
|
114
117
|
| Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
|
|
115
118
|
| 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 |
|
|
116
|
-
| Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })`
|
|
119
|
+
| 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` |
|
|
117
120
|
| Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
|
|
118
121
|
| Login, sign up, reset password page | `AuthLogin` + `AuthLogout` (two step flow); `AuthLayout` (or `k-auth`) for other pages |
|
|
119
122
|
| Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
|
|
@@ -163,7 +166,7 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
163
166
|
|
|
164
167
|
## Forms
|
|
165
168
|
|
|
166
|
-
All field components work inside `FormField` and take `invalid`, `disabled`, `readonly`, `required` and `size`, except: `Select` has no `readonly`, `Slider` and `PaletteSelect` have no `required`, `Calendar` takes only `disabled` and `readonly`. They use `v-model`.
|
|
169
|
+
All field components work inside `FormField` and take `invalid`, `disabled`, `readonly`, `required` and `size`, except: `Select` has no `readonly`, `Slider` and `PaletteSelect` have no `required`, `Calendar` takes only `disabled` and `readonly`, `FocalPointInput` has no `required` and no `size`. They use `v-model`.
|
|
167
170
|
|
|
168
171
|
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
169
172
|
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
@@ -190,6 +193,7 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
|
|
|
190
193
|
| `PaletteSelect` | Select of a palette color, with the dot and the localized color name. | Model: `ColorValue` (palette name or `#rrggbb`) or null. A non-searchable `Combobox` (pass `:searchable="true"` to type a filter). Props: `colors` (subset of `PALETTE_COLORS`), `clearable` (placeholder "Automatic"), `custom` (adds "Custom": choosing it shows a `ColorInput` under the select and the model becomes the hex), `customLabel` (name of the color input), `placeholder`, `size`, `disabled`, `readonly`, `invalid`. | `forms/palette-select.vue` |
|
|
191
194
|
| `Slider` | Number in a range with drag handle. | Model: number. Props: `min`, `max`, `step`, `bubble` (true, always), `marks`, `format(value)`, `label`. Event: `change` (on release). | `forms/slider.vue` |
|
|
192
195
|
| `FileInput` | Drop zone and file picker. Validates type, size and count. Supports folders and previews. | Model: `File`, `File[]` or null. Props: `accept`, `acceptMode`, `maxSize`, `maxFiles`, `multiple`, `directory`, `directoryAction`, `previews`, `list`, `fill` (fills the height of its parent, centered), `loading`, `capture`, `title`, `dropText`, `hint`. Slots: `title`, `hint`, `actions`. Events: `add`, `remove`, `invalid`, `reject`. | `forms/file-input.vue` |
|
|
196
|
+
| `FocalPointInput` | Point on an image that must stay visible when it is cropped: click or drag on the image, or the arrow keys. | Model: `FocalPoint` (`{ x, y }` from 0 to 1) or null. Props: `src`, `alt`, `label`, `clearable` (a Reset button, Delete and Backspace clear), `clearLabel`, `horizontalLabel`, `verticalLabel`, `emptyText`, `step` (0.01, Shift times 10), `invalid`, `disabled`, `readonly`. | `forms/focal-point-input.vue` |
|
|
193
197
|
|
|
194
198
|
## Overlays
|
|
195
199
|
|
|
@@ -218,7 +222,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
218
222
|
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
|
|
219
223
|
| `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` |
|
|
220
224
|
| `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` |
|
|
221
|
-
| `SelectionBar` | Shows the selected count and bulk actions for a list or table. | Props: `count`, `total`, `placement` (inline, sticky, floating), `onSelectAll
|
|
225
|
+
| `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` |
|
|
222
226
|
| `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` |
|
|
223
227
|
| `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` |
|
|
224
228
|
| `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` |
|
|
@@ -226,6 +230,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
226
230
|
| `Badge` | Status label, counter or dot. Not interactive. | Props: `label` (string or number), `tone`, `color` (palette name or hex), `variant` (soft, solid, outline), `size`, `dot`, `pulse`, `icon`. Slot: default. | `data/badge.vue` |
|
|
227
231
|
| `Avatar` | User picture with initials fallback and status dot. | Props: `src`, `name`, `alt`, `size` (xs to xl), `shape` (circle, square), `status` (online, away, busy, offline), `decorative`. Slot: `fallback`. | `data/avatar.vue` |
|
|
228
232
|
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
|
|
233
|
+
| `Thumbnail` | Preview box for an image, the first frame of a video or a file icon, with loading and missing states. Fixed sizes for inline use or fluid with an aspect ratio. | Props: `src`, `alt`, `kind` (image, video, file, icon), `icon` (fallback icon), `fit` (cover, contain), `aspect` (`'4/3'`, `'16/9'` or a number, default 1), `size` (xs to lg, fluid when unset), `rounded` (none, sm, md, lg, full), `missing`, `missingText`, `focal` (`{ x, y }` from 0 to 1), `objectPosition`, `caption`, `reveal` (overlays shown only on hover and focus, default `['caption']`), `lazy`. Slots: default (replaces the media), `top-start`, `top-end`, `caption`. | `data/thumbnail.vue` |
|
|
229
234
|
| `Stat` | Key figure (KPI) with unit, delta, trend, hint and optional sparkline. Can be a link. | Props: `label`, `value`, `unit`, `delta`, `trend` (up, down, flat), `invert` (down is good), `hint`, `icon`, `loading`, `to`, `href`, `plain`. Slots: `label`, `value`, `icon`, `sparkline`, `footer`. | `data/stat.vue` |
|
|
230
235
|
| `RecordList` | Short list of records (settings, users, tokens): title, badge, description, leading and action slots, `SkeletonList` while `loading`, empty state. | Props: `items` (`RecordListItem`: `id`, `title` (truncated, full text on hover), `description`, `badge` `{ label, tone }`), `loading`, `avatar`, `action`, `label`, `skeletonRows`, `emptyText`, `emptyDescription`, `emptyIcon`, `emptyVariant` (card, the default, or plain). Event: `row-click` (`item`, `event`): each row becomes a navigation item (padding, hover and press background like a ghost button, no separators) and its title a button, so Tab reaches every row and Enter or Space opens it (focus ring on the row, the description is the button description). Clicks on buttons, links, inputs, menu items and inside an open menu, popover or dialog of the row are ignored, and pressing them does not tint the row; `rowClickable(item)` keeps some rows static in the same list (no button, no hover). Slots: `leading`, `action` (`{ item }`), `empty`, `empty-actions` (buttons in the default empty state). | `data/record-list.vue` |
|
|
231
236
|
| `DescriptionList` | Label and value pairs for a record. Use it on detail views. | Props: `items` (`key`, `label`, `value`, `hint`), `layout` (stacked, inline, grid), `columns`, `divided`, `emptyText`. Slots: `term`, `value`, `value-<key>`. | `data/description-list.vue` |
|
|
@@ -236,7 +241,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
236
241
|
|
|
237
242
|
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
238
243
|
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
|
|
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`.
|
|
244
|
+
| `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle, dashed: a centered add or empty tile), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
|
|
240
245
|
| `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
246
|
| `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` |
|
|
242
247
|
| `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` |
|
|
@@ -278,7 +283,7 @@ Templates combine core parts into whole pages and layouts. Start from them for n
|
|
|
278
283
|
| `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` |
|
|
279
284
|
| `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` |
|
|
280
285
|
| `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` |
|
|
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), `emptyTitle`. Slots: `actions`, `toolbar`, `toolbar-end`, `bulk`, `empty`, `empty-actions`, `no-results`, `error`, `cell-<key>`, `table`. Events: `retry`, `clear`, `rowClick`.
|
|
286
|
+
| `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` |
|
|
282
287
|
| `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` |
|
|
283
288
|
| `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` |
|
|
284
289
|
| `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` |
|
package/README.md
CHANGED
|
@@ -468,18 +468,18 @@ async function switchView() {
|
|
|
468
468
|
|
|
469
469
|
## Components
|
|
470
470
|
|
|
471
|
-
| Group | Components
|
|
472
|
-
| --------- |
|
|
473
|
-
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden
|
|
474
|
-
| forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput, TreeSelect
|
|
475
|
-
| overlays | CommandButton, CommandList, CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip
|
|
476
|
-
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, RecordList, SelectionBar, Stat, Table, Tag, TagList, Timeline, Tree
|
|
477
|
-
| layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar
|
|
478
|
-
| templates | DashboardLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu, FormDrawer
|
|
479
|
-
| feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton, SkeletonForm, SkeletonList
|
|
480
|
-
| grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell)
|
|
481
|
-
| editor | RichTextEditor, TemplateEditor, TemplateText
|
|
482
|
-
| chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart
|
|
471
|
+
| Group | Components |
|
|
472
|
+
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
473
|
+
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden |
|
|
474
|
+
| forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, FocalPointInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput, TreeSelect |
|
|
475
|
+
| overlays | CommandButton, CommandList, CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip |
|
|
476
|
+
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, RecordList, SelectionBar, Stat, Table, Tag, TagList, Thumbnail, Timeline, Tree |
|
|
477
|
+
| layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar |
|
|
478
|
+
| templates | DashboardLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu, FormDrawer |
|
|
479
|
+
| feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton, SkeletonForm, SkeletonList |
|
|
480
|
+
| grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell) |
|
|
481
|
+
| editor | RichTextEditor, TemplateEditor, TemplateText |
|
|
482
|
+
| chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
|
|
483
483
|
|
|
484
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`.
|
|
485
485
|
|
|
@@ -536,15 +536,25 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
536
536
|
```
|
|
537
537
|
|
|
538
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`.
|
|
539
|
+
- `Card` takes `variant="dashed"` (`CardVariant`) for a placeholder tile: a dashed `--k-line-strong` border on `--k-subtle`, with the icon, title and description centered in a column (the icon in a raised box, the title at 0.8125rem). As a button (`as="button"`) or a link (`to`, `href`) it gets the hover and focus of the `FileInput` dropzone (`--k-fill` and a `--k-text-dimmed` border on hover, a solid `--k-ring` border and the focus ring on focus); `disabled` dims it, and `selected` tints it with the accent, for a drop target while something is dragged over it. Use it for an "Add" tile at the end of a grid of items and for an empty area: `<KCard variant="dashed" as="button" icon="plus" title="Add block" @click="add" />`.
|
|
539
540
|
- `DropdownMenu` takes `matchTriggerWidth` (the menu is at least as wide as its trigger) and `minWidth` (a CSS length).
|
|
540
541
|
- `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.
|
|
541
542
|
- `RichTextEditor` accepts `'underline'` in `toolbar` (not in the default toolbar).
|
|
542
543
|
- `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.
|
|
543
544
|
- `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`.
|
|
544
|
-
- `SelectionBar` shows a plural aware selected count (announced in a live region), select all (`total` plus `@select-all
|
|
545
|
+
- `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`.
|
|
545
546
|
- `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.
|
|
546
547
|
- `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.
|
|
547
548
|
- `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()`.
|
|
549
|
+
- `FocalPointInput` edits the point of an image that must stay visible when it is cropped: `v-model` is a `FocalPoint` (`{ x, y }`, each from 0 to 1, rounded to 0.001) or `null` (not set). Click or drag on the `src` image to place the crosshair; the arrow keys move it by `step` (default 0.01, ten times with Shift; from the center when it is not set), Home, End, Page Up and Page Down move along one axis. It is a group (named by `label` or the FormField label, with a development warning when unnamed) of two visually hidden range inputs, "Horizontal position" and "Vertical position" (`horizontalLabel`, `verticalLabel`), with one tab stop: their value text is the percentage, or "Not set" (`emptyText`), and a hidden hint describes the pointer and keys. The current value shows under the image ("X 30%, Y 40%"). `clearable` adds a Reset button (`clearLabel`, focus moves to the point before it disappears) and lets Delete and Backspace clear the value. `disabled` follows `Form`, `Fieldset` and `FormField` (an explicit `:disabled="false"` opts out), `readonly` keeps the point visible and focusable without changes, `invalid` comes from the field. `--k-focal-point-input-height` (20rem) caps the image height. Pass the value to `Thumbnail` `focal` to preview the crops.
|
|
550
|
+
|
|
551
|
+
```vue
|
|
552
|
+
<KFormField label="Focal point">
|
|
553
|
+
<KFocalPointInput v-model="focal" :src="url" :alt="alt" clearable />
|
|
554
|
+
</KFormField>
|
|
555
|
+
<KThumbnail :src="url" aspect="16/9" :focal="focal" />
|
|
556
|
+
```
|
|
557
|
+
|
|
548
558
|
- `TagList` renders `v-model` (`TagListItem[]`: `value`, `label`, `tone`, `icon`, `removable`, `disabled`) as `Tag` chips in a labelled list (`label`, default "Items"). `removable` (or `removable` per item) adds the remove button; the chip is dropped from the model, `remove(item, index)` fires, focus moves to the neighbor and "Label removed" is announced. `sortable` reorders by pointer drag (the list updates live while dragging, Escape cancels), and the chips become one tab stop: the arrow keys, Home and End move between chips, Alt with an arrow key (or Alt with Home and End) moves the focused chip, Delete removes it, and every move is announced ("Name moved to position 2 of 4", `sortable.moved`). `moveButtons` adds "Move earlier" and "Move later" buttons to every chip, a single pointer alternative to dragging. A disabled item cannot move or be removed. `move({ item, from, to })` fires after each move. `accept` (a MIME type, a list of them, or `(event) => boolean`) makes the list a drop target for native drags from outside: an insertion marker follows the pointer and `itemDrop({ index, dataTransfer, event })` (`@item-drop`, named apart from the native `drop` event) gives the insertion index, so the host inserts the item (`dropEffect`, default `copy`, must match the `effectAllowed` of the source). The `#item` slot (`{ item, index }`) replaces the chip label.
|
|
549
559
|
|
|
550
560
|
```vue
|
|
@@ -562,6 +572,16 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
562
572
|
|
|
563
573
|
- `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.
|
|
564
574
|
|
|
575
|
+
- `Thumbnail` previews an image, a video or a file: `kind` (`ThumbnailKind`, `'image' | 'video' | 'file' | 'icon'`, default `'image'`), `src`, `alt` and `icon` (the fallback icon, by default `photo`, `video-camera` or `document`). A video shows its first frame (`preload="metadata"`, muted, no controls) under a play glyph. Without `size` it is fluid (the width of its parent, the height from `aspect`, a ratio string like `'4/3'` or a number, default 1); `size` (`ThumbnailSize`, `'xs' | 'sm' | 'md' | 'lg'`) gives a fixed inline box for tables and lists. `fit` is `'cover'` (default) or `'contain'`, `rounded` (`ThumbnailRounded`, `'none' | 'sm' | 'md' | 'lg' | 'full'`) overrides the radius of the size, and `focal` (`FocalPoint`, `{ x, y }` from 0 to 1, what `FocalPointInput` edits) or `objectPosition` (any CSS value, it wins) choose the part of the image that stays in view. While the media loads the box pulses; `missing`, or an image or video that fails to load, shows a hatched box with the icon and a hidden "File not available" (`thumbnail.missing`, `missingText` overrides it). The `top-start` and `top-end` slots put badges and actions in the corners, `caption` (or the `#caption` slot) sits at the bottom on a readable scrim, and `reveal` (`ThumbnailOverlay[]`, default `['caption']`) lists the overlays that only show on hover and focus, also when a link or button around the thumbnail is hovered or focused (always on touch screens). The default slot replaces the media with your own content (a text preview). Text and icons over media use the `--k-media-scrim` and `--k-media-text` tokens, the same in both themes; use them for your own overlays too.
|
|
576
|
+
|
|
577
|
+
```vue
|
|
578
|
+
<KThumbnail :src="url" kind="video" aspect="4/3" :caption="name" :reveal="['caption', 'top-end']">
|
|
579
|
+
<template #top-end>
|
|
580
|
+
<KButton icon="trash" size="xs" variant="solid" tone="neutral" square aria-label="Remove" />
|
|
581
|
+
</template>
|
|
582
|
+
</KThumbnail>
|
|
583
|
+
```
|
|
584
|
+
|
|
565
585
|
- `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.
|
|
566
586
|
- `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.
|
|
567
587
|
- `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']`.
|
|
@@ -860,17 +880,17 @@ Both take the `AuthLayout` frame props and the `brand`, `corner`, `footer` and `
|
|
|
860
880
|
|
|
861
881
|
### Page templates
|
|
862
882
|
|
|
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.
|
|
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`.
|
|
883
|
+
| Component | What it gives you |
|
|
884
|
+
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
885
|
+
| `DashboardPage` | PageHeader (`title`, `eyebrow`, `description`, `#actions`), a Stat grid from `stats` (or `#stats`), a content grid (`columns`, default 1 then 3 columns). |
|
|
886
|
+
| `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". |
|
|
887
|
+
| `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. |
|
|
888
|
+
| `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). |
|
|
889
|
+
| `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. |
|
|
890
|
+
| `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`. |
|
|
891
|
+
| `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`. |
|
|
892
|
+
| `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`. |
|
|
893
|
+
| `EmptyPage` | First run screen: illustration, title, description, primary and secondary actions, onboarding `steps`. |
|
|
874
894
|
|
|
875
895
|
`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).
|
|
876
896
|
|
|
@@ -991,7 +1011,7 @@ The components target WCAG 2.2 AA in every preset and both themes.
|
|
|
991
1011
|
|
|
992
1012
|
Accessibility related props and defaults:
|
|
993
1013
|
|
|
994
|
-
- Accessible names: `label` on `RadioGroup` and `CheckboxGroup` (alias of `legend`), `SegmentedControl`, `Slider`, `PinInput`, `InputGroup`, `Tabs`, `Toolbar`, `Modal`, `Drawer` and `useModal`/`useDrawer` options (when there is no `title`), `Card` (stretched link without a title), `ChartLegend`. `AppShell` takes `closeLabel` for the close button of the mobile navigation, which opens as a named modal dialog. `Sidebar`'s collapse button keeps one label (`collapseLabel`) and exposes the state with `aria-expanded`.
|
|
1014
|
+
- Accessible names: `label` on `RadioGroup` and `CheckboxGroup` (alias of `legend`), `SegmentedControl`, `Slider`, `FocalPointInput`, `PinInput`, `InputGroup`, `Tabs`, `Toolbar`, `Modal`, `Drawer` and `useModal`/`useDrawer` options (when there is no `title`), `Card` (stretched link without a title), `ChartLegend`. `AppShell` takes `closeLabel` for the close button of the mobile navigation, which opens as a named modal dialog. `Sidebar`'s collapse button keeps one label (`collapseLabel`) and exposes the state with `aria-expanded`.
|
|
995
1015
|
- Heading levels: `level` on `Calendar`, `DatePicker`, `ChartPanel`, `ErrorPage` and `NotFoundPage`; page templates pass `level + 1` to their sections and empty states.
|
|
996
1016
|
- Live roles are opt in on `Alert`: pass `role="alert"` or `role="status"` for messages that appear at runtime; static banners get none. Without a title the tone is spoken from a hidden prefix.
|
|
997
1017
|
- `Toolbar` uses roving focus by default (`:roving="false"` renders a plain named group).
|
|
@@ -10,7 +10,7 @@ type __VLS_Slots = {} & {
|
|
|
10
10
|
};
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
12
12
|
label?: string;
|
|
13
|
-
type?: "
|
|
13
|
+
type?: "reset" | "submit" | "button" | undefined;
|
|
14
14
|
size?: ButtonSize;
|
|
15
15
|
tone?: Tone;
|
|
16
16
|
variant?: ButtonVariant;
|
|
@@ -237,7 +237,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
237
237
|
popovertargetaction?: import("../../index.ts").PopoverTargetAction | undefined;
|
|
238
238
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
239
239
|
label?: string;
|
|
240
|
-
type?: "
|
|
240
|
+
type?: "reset" | "submit" | "button" | undefined;
|
|
241
241
|
size?: ButtonSize;
|
|
242
242
|
tone?: Tone;
|
|
243
243
|
variant?: ButtonVariant;
|
|
@@ -466,7 +466,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
466
466
|
size: ButtonSize;
|
|
467
467
|
tone: Tone;
|
|
468
468
|
tooltip: string | false;
|
|
469
|
-
type: "
|
|
469
|
+
type: "reset" | "submit" | "button";
|
|
470
470
|
variant: ButtonVariant;
|
|
471
471
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
472
472
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -19,19 +19,20 @@
|
|
|
19
19
|
<slot name="count" :count="count" :total="total">{{ countText }}</slot>
|
|
20
20
|
</span>
|
|
21
21
|
<Button
|
|
22
|
-
v-if="
|
|
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
|
-
|
|
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?: () =>
|
|
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?: () =>
|
|
223
|
+
onSelectAll?: () => unknown;
|
|
224
224
|
onClear?: () => void;
|
|
225
225
|
innerHTML?: string | undefined | undefined;
|
|
226
226
|
class?: import("vue").ClassValue;
|