@xleddyl/443-components-vue 0.16.94 → 0.16.95
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 +173 -168
- package/README.md +46 -2
- package/dist/components/data/SortableList.vue +120 -0
- package/dist/components/data/SortableList.vue.d.ts +48 -0
- package/dist/components/data/Table.vue +43 -3
- package/dist/components/data/Table.vue.d.ts +8 -2
- package/dist/components/data/TileGrid.vue +274 -0
- package/dist/components/data/TileGrid.vue.d.ts +51 -0
- package/dist/components/data/index.d.ts +2 -0
- package/dist/components/data/index.mjs +2 -0
- package/dist/components/data/types.d.ts +30 -0
- package/dist/composables/useSortable.d.ts +1 -0
- package/dist/composables/useSortable.mjs +40 -11
- package/dist/icons/builtin.d.ts +1 -0
- package/dist/icons/builtin.mjs +1 -0
- package/dist/internal/data/sortable.d.ts +4 -1
- package/dist/internal/data/sortable.mjs +49 -0
- package/dist/locale/de.mjs +12 -0
- package/dist/locale/en.mjs +12 -0
- package/dist/locale/it.mjs +12 -0
- package/dist/locale/types.d.ts +12 -0
- package/dist/styles/data/sortable-list.css +185 -0
- package/dist/styles/data/table.css +12 -0
- package/dist/styles/data/tile-grid.css +144 -0
- package/dist/styles/data.css +2 -0
- package/dist/styles/forced-colors.css +30 -0
- package/dist/styles/shared.css +2 -1
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -28,123 +28,126 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
28
28
|
|
|
29
29
|
## Which component for which task
|
|
30
30
|
|
|
31
|
-
| Task
|
|
32
|
-
|
|
|
33
|
-
| Form with validation, dirty state and server errors
|
|
34
|
-
| One labelled field with error, hint and required marker
|
|
35
|
-
| Map a server error (409, 422) to fields
|
|
36
|
-
| Form as a full page with sticky save footer
|
|
37
|
-
| Create or edit form in a side panel (cancel, save, delete, guard)
|
|
38
|
-
| Warn before the user leaves with unsaved changes
|
|
39
|
-
| Form in a modal (title, fields, cancel, delete, submit)
|
|
40
|
-
| Floating "unsaved changes" bar
|
|
41
|
-
| Single line text
|
|
42
|
-
| Multi line text
|
|
43
|
-
| Rich text (bold, lists, links)
|
|
44
|
-
| Template with placeholders ({name} {size})
|
|
45
|
-
| Password with strength meter and generator
|
|
46
|
-
| Number with stepper, locale format
|
|
47
|
-
| Money or unit prefix and suffix around an input
|
|
48
|
-
| One choice from a short list (5 or fewer)
|
|
49
|
-
| One choice from a longer list, no search
|
|
50
|
-
| One choice from a short fixed list with a color dot or an icon, no search
|
|
51
|
-
| Searchable select, async search, multi select, create option
|
|
52
|
-
| Pick one node of a hierarchy (category, folder)
|
|
53
|
-
| Create new values with a format or rule (tags, codes)
|
|
54
|
-
| Several create actions for the typed text (create here, create in a form)
|
|
55
|
-
| Several choices as checkboxes
|
|
56
|
-
| One yes or no
|
|
57
|
-
| Date, date and time, month
|
|
58
|
-
| Inline calendar
|
|
59
|
-
| Time of day
|
|
60
|
-
| Color
|
|
61
|
-
| Number in a range
|
|
62
|
-
| One time code, OTP
|
|
63
|
-
| File or folder upload with drop zone
|
|
64
|
-
| Focal point of an image (the part kept in view when cropped)
|
|
65
|
-
| Drop files on any element
|
|
66
|
-
| Confirm a destructive action
|
|
67
|
-
| Show a message the user must acknowledge
|
|
68
|
-
| Ask for one text value
|
|
69
|
-
| Short message after an action
|
|
70
|
-
| Toast for a promise (loading, success, error)
|
|
71
|
-
| Toast after saving in an open Drawer
|
|
72
|
-
| Detail or edit panel from the side
|
|
73
|
-
| Dialog with a form or content
|
|
74
|
-
| Tabs or subpages (breadcrumb and back) in a Modal or Drawer
|
|
75
|
-
| Buttons in a Modal or Drawer header
|
|
76
|
-
| Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`)
|
|
77
|
-
| One record in the URL (`#family/fam_1`, `#family/new`), with linked entries
|
|
78
|
-
| Commands of the open page in the command search
|
|
79
|
-
| A button made from a command (same label, icon and action as the palette)
|
|
80
|
-
| Short list of records with title, badge, action, skeleton and empty state
|
|
81
|
-
| Menu opened by a button
|
|
82
|
-
| Right click menu
|
|
83
|
-
| Small floating panel with content or a form
|
|
84
|
-
| Preview on hover (user card)
|
|
85
|
-
| Short label on hover or focus
|
|
86
|
-
| Global search, command menu (Cmd+K)
|
|
87
|
-
| Small table, simple sort
|
|
88
|
-
| Big table, many rows, editing, Excel-like
|
|
89
|
-
| Filters for a grid (selects, dates in a modal from the toolbar)
|
|
90
|
-
| Several tags or statuses in one grid cell
|
|
91
|
-
| Whole list page: search, filters, table, pagination
|
|
92
|
-
| Page numbers and page size
|
|
93
|
-
| Bulk actions bar for selected rows
|
|
94
|
-
| Filter chips, active filters
|
|
95
|
-
| Tags, chips, removable labels
|
|
96
|
-
| Color per group or category (tags, labels, series)
|
|
97
|
-
| Choose a palette color (a group, a division)
|
|
98
|
-
| Reorder chips by drag and keyboard, drop items from another panel
|
|
99
|
-
| Reorder
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
|
128
|
-
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
31
|
+
| Task | Use |
|
|
32
|
+
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| Form with validation, dirty state and server errors | `useForm` + `Form` + `FormField` + field components |
|
|
34
|
+
| One labelled field with error, hint and required marker | `FormField` |
|
|
35
|
+
| Map a server error (409, 422) to fields | `useForm` option `submitError`, `form.setErrors`, `form.setIssues` |
|
|
36
|
+
| Form as a full page with sticky save footer | `FormPage` |
|
|
37
|
+
| Create or edit form in a side panel (cancel, save, delete, guard) | `FormDrawer` (`form`, `creating`, `readonly`, `deletable`, `loading`) |
|
|
38
|
+
| Warn before the user leaves with unsaved changes | Nothing for a `Form`: it registers itself in the leave guard (modal, drawer, settings modal, page). `useLeaveGuard(dirty)` for other state, `guard: false` to opt out |
|
|
39
|
+
| Form in a modal (title, fields, cancel, delete, submit) | `FormModal` |
|
|
40
|
+
| Floating "unsaved changes" bar | `SaveBar` |
|
|
41
|
+
| Single line text | `Input` |
|
|
42
|
+
| Multi line text | `Textarea` |
|
|
43
|
+
| Rich text (bold, lists, links) | `RichTextEditor` (group `editor`) |
|
|
44
|
+
| Template with placeholders ({name} {size}) | `TemplateEditor`, `TemplateText` (group `editor`) |
|
|
45
|
+
| Password with strength meter and generator | `PasswordInput` |
|
|
46
|
+
| Number with stepper, locale format | `NumberInput` |
|
|
47
|
+
| Money or unit prefix and suffix around an input | `InputGroup` + `InputAddon` |
|
|
48
|
+
| One choice from a short list (5 or fewer) | `RadioGroup` or `SegmentedControl` |
|
|
49
|
+
| One choice from a longer list, no search | `Select` |
|
|
50
|
+
| One choice from a short fixed list with a color dot or an icon, no search | `Combobox` with `:searchable="false"` (a button trigger with typeahead, also `multiple`) |
|
|
51
|
+
| Searchable select, async search, multi select, create option | `Combobox` |
|
|
52
|
+
| Pick one node of a hierarchy (category, folder) | `TreeSelect` (`leavesOnly` to allow only leaves) |
|
|
53
|
+
| Create new values with a format or rule (tags, codes) | `Combobox` with `creatable`, `createTransform`, `createValidate` |
|
|
54
|
+
| Several create actions for the typed text (create here, create in a form) | `Combobox` with `createActions` |
|
|
55
|
+
| Several choices as checkboxes | `CheckboxGroup` |
|
|
56
|
+
| One yes or no | `Switch` (instant setting) or `Checkbox` (part of a form) |
|
|
57
|
+
| Date, date and time, month | `DateInput` (native) or `DatePicker` (popover calendar, ranges) |
|
|
58
|
+
| Inline calendar | `Calendar` |
|
|
59
|
+
| Time of day | `TimeInput` |
|
|
60
|
+
| Color | `ColorInput` |
|
|
61
|
+
| Number in a range | `Slider` |
|
|
62
|
+
| One time code, OTP | `PinInput` |
|
|
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`) |
|
|
65
|
+
| Drop files on any element | `useFileDrop` |
|
|
66
|
+
| Confirm a destructive action | `useConfirm` |
|
|
67
|
+
| Show a message the user must acknowledge | `useAlert` |
|
|
68
|
+
| Ask for one text value | `usePrompt` |
|
|
69
|
+
| Short message after an action | `toast` |
|
|
70
|
+
| Toast for a promise (loading, success, error) | `toast.promise` |
|
|
71
|
+
| Toast after saving in an open Drawer | `toast` (the stack moves beside the drawer or above its footer) |
|
|
72
|
+
| Detail or edit panel from the side | `Drawer` (or `useDrawer().open`). At 640px or less, a left or right drawer is a full-width sheet from the bottom. |
|
|
73
|
+
| Dialog with a form or content | `Modal` (or `useModal().open` to get the result as a promise) |
|
|
74
|
+
| Tabs or subpages (breadcrumb and back) in a Modal or Drawer | `tabs` + `v-model:tab`; `trail` + `@navigate` on `Modal` / `Drawer` |
|
|
75
|
+
| Buttons in a Modal or Drawer header | `#actions` slot of `Modal` / `Drawer` (right side, before the close button) |
|
|
76
|
+
| Deep link to a drawer or modal (`?family=fam_1`, `#family/fam_1`) | `useRouteState('family')` + `:open="!!familyId"`, `location: 'hash'`; settings: `route`, `settingsRoute` |
|
|
77
|
+
| One record in the URL (`#family/fam_1`, `#family/new`), with linked entries | `useRouteRecord(key, { find, loaded, canCreate, linkedKeys, beforeLeave })`: `open`, `current`, `loading`, `openRecord`, `close`, `replaceId`. `beforeLeave` (returns `false` or a promise of it) cancels a navigation that would close or change the open record (back button, links); the composable's own `close`, `openRecord`, `replaceId` skip it |
|
|
78
|
+
| Commands of the open page in the command search | `usePageCommands(() => CommandItem[])` (DashboardLayout adds the group "This page") |
|
|
79
|
+
| A button made from a command (same label, icon and action as the palette) | `CommandButton` (`command`) |
|
|
80
|
+
| Short list of records with title, badge, action, skeleton and empty state | `RecordList` |
|
|
81
|
+
| Menu opened by a button | `DropdownMenu` |
|
|
82
|
+
| Right click menu | `ContextMenu` |
|
|
83
|
+
| Small floating panel with content or a form | `Popover` |
|
|
84
|
+
| Preview on hover (user card) | `HoverCard` |
|
|
85
|
+
| Short label on hover or focus | `Tooltip` |
|
|
86
|
+
| Global search, command menu (Cmd+K) | `CommandPalette` (the `DashboardLayout` has it with `search`), `CommandList` for the same list inline or in a `Popover` |
|
|
87
|
+
| Small table, simple sort | `Table` (+ `useTableSort` for client sort) |
|
|
88
|
+
| Big table, many rows, editing, Excel-like | `DataGrid` (+ `spreadsheet` prop for Excel-like editing) |
|
|
89
|
+
| Filters for a grid (selects, dates in a modal from the toolbar) | `DataGrid` `#filters` slot with `activeFilters` (or `filterCount`), `@filter-remove` and `@filters-reset` |
|
|
90
|
+
| Several tags or statuses in one grid cell | `BadgeCell` with an array value (`max` adds a `+N` badge) |
|
|
91
|
+
| Whole list page: search, filters, table, pagination | `ListPage` |
|
|
92
|
+
| Page numbers and page size | `Pagination` |
|
|
93
|
+
| Bulk actions bar for selected rows | `SelectionBar` |
|
|
94
|
+
| Filter chips, active filters | `FilterPills` |
|
|
95
|
+
| Tags, chips, removable labels | `Tag` |
|
|
96
|
+
| Color per group or category (tags, labels, series) | `color` (palette name or hex) on `Tag`, `Badge`, `FilterPill`, `Combobox` options, `BadgeCell` `colors`; `paletteColor(key)` |
|
|
97
|
+
| Choose a palette color (a group, a division) | `PaletteSelect` (`v-model` color or null, `clearable` for "Automatic", `custom` for any hex color) |
|
|
98
|
+
| Reorder chips by drag and keyboard, drop items from another panel | `TagList` (`sortable`, `removable`, `accept` + `@item-drop`) |
|
|
99
|
+
| Reorder rows with a handle and switches (columns, steps) | `SortableList` (`v-model`, `#trailing`) |
|
|
100
|
+
| Reorder any list by drag and keyboard | `useSortable` |
|
|
101
|
+
| Status label, counter, dot | `Badge` |
|
|
102
|
+
| User picture or initials; stack of users | `Avatar`; `AvatarGroup` |
|
|
103
|
+
| Preview of an image, video or file (media grid, upload tile, table cell) | `Thumbnail` |
|
|
104
|
+
| Grid of tiles: media library with selection and drag to folders, reorderable blocks with an add tile | `TileGrid` (`selectable`, `sortable`, `dragData`, `#add`) |
|
|
105
|
+
| Drag table rows onto folders or other drop targets | `Table` (`rowDraggable` + `dragData`, or `rowAttrs`) |
|
|
106
|
+
| Key figure with delta and trend (KPI) | `Stat` |
|
|
107
|
+
| Label and value pairs (details) | `DescriptionList` |
|
|
108
|
+
| Event history, activity feed | `Timeline` |
|
|
109
|
+
| Hierarchy, folders, drag to reorder | `Tree` |
|
|
110
|
+
| Charts (line, bar, doughnut) | `ChartPanel` + `LineChart` / `BarChart` / `DoughnutChart` (group `chart`) |
|
|
111
|
+
| Tabs | `Tabs` |
|
|
112
|
+
| Wizard steps, step indicator (Step 2 of 4) | `Stepper` |
|
|
113
|
+
| Collapsible sections, FAQ | `Accordion` |
|
|
114
|
+
| Container with title and actions | `Card` |
|
|
115
|
+
| "Add" tile next to a grid of items, empty drop area | `Card` `variant="dashed"` (`as="button"`, `icon`, `title`) |
|
|
116
|
+
| Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
|
|
117
|
+
| Breadcrumb trail as the page title (a record, a nested page) | `trail` on `PageHeader` |
|
|
118
|
+
| Breadcrumbs only | `Breadcrumbs` |
|
|
119
|
+
| Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
|
|
120
|
+
| Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
|
|
121
|
+
| 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 |
|
|
122
|
+
| 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` |
|
|
123
|
+
| Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
|
|
124
|
+
| Login, sign up, reset password page | `AuthLogin` + `AuthLogout` (two step flow); `AuthLayout` (or `k-auth`) for other pages |
|
|
125
|
+
| Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
|
|
126
|
+
| Settings as a page with sections | `SettingsPage` + `SettingsSection` + `SettingsGroup` |
|
|
127
|
+
| Theme and preset choice | `AppearanceSettings`, `ThemeSwitch`, `useTheme`, `usePreset` |
|
|
128
|
+
| Remember UI choices per user (theme, sidebar, grid columns, page size) | `createPreferences` with your store (`createRemotePreferenceStore` for an API), `usePreference` for your own keys |
|
|
129
|
+
| Detail page of one record with tabs and aside | `DetailPage` |
|
|
130
|
+
| Overview page with stats | `DashboardPage` |
|
|
131
|
+
| First run screen with steps | `EmptyPage` |
|
|
132
|
+
| Error page, 404 page | `ErrorPage`, `NotFoundPage` |
|
|
133
|
+
| Empty state inside a card or list | `EmptyState` |
|
|
134
|
+
| Loading placeholder for content | `Skeleton` |
|
|
135
|
+
| Loading placeholder for a form or a list (rough, not 1:1 with the UI) | `SkeletonForm` (`fields`, `columns`), `SkeletonList` (`rows`, `lines`, `avatar`, `action`) |
|
|
136
|
+
| Spinner; spinner that fills its container | `Spinner`; `Spinner block` |
|
|
137
|
+
| Cover an area while it loads | `LoadingOverlay` |
|
|
138
|
+
| Global loading bar or blocking screen | `useLoading` / `withLoading` (needs `OverlayHost`) |
|
|
139
|
+
| Loading flag for one button or form | `useLoadingState`, or `loading` prop of `Button` |
|
|
140
|
+
| Progress of a task | `Progress` (bar) or `ProgressRing` |
|
|
141
|
+
| Value in a known range (quota, score) | `Meter` |
|
|
142
|
+
| Inline message (info, warning, error) | `Alert` |
|
|
143
|
+
| Copy text to the clipboard | `CopyButton` or `useCopy` |
|
|
144
|
+
| Keyboard shortcut handler; show a shortcut | `useHotkey`; `Kbd` |
|
|
145
|
+
| Row or column layout with gap; responsive grid | `Stack`; `Grid` |
|
|
146
|
+
| Line or labelled divider; section heading with actions | `Separator` |
|
|
147
|
+
| Group of buttons or tools with arrow key navigation | `Toolbar` |
|
|
148
|
+
| Text for screen readers only | `VisuallyHidden` |
|
|
149
|
+
| Translations of the component texts | `useLocale` (languages: en, it, de) |
|
|
150
|
+
| Custom icons | `createIcons`, `provideIcons`, Nuxt option `k.icons` |
|
|
148
151
|
|
|
149
152
|
## Core
|
|
150
153
|
|
|
@@ -218,24 +221,26 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
218
221
|
|
|
219
222
|
## Data
|
|
220
223
|
|
|
221
|
-
| Component | Purpose and when to use it
|
|
222
|
-
| ----------------- |
|
|
223
|
-
| `Table` | Small to medium table with sort, selection, links and loading rows. For thousands of rows or editing use `DataGrid`.
|
|
224
|
-
| `Pagination` | Page buttons, page size select and summary. Client or server paging.
|
|
225
|
-
| `SelectionBar` | Shows the selected count and bulk actions for a list or table.
|
|
226
|
-
| `FilterPills` | Quick filters as pills: single, multiple, menu or panel pills, removable active filters.
|
|
227
|
-
| `FilterPill` | One pill button. Use it alone for a custom filter trigger. `FilterPills` uses it.
|
|
228
|
-
| `Tag` | Chip or label, optionally removable. Use `Badge` for a status.
|
|
229
|
-
| `TagList` | A list of `Tag` chips, reorderable by drag, by keyboard (Alt with an arrow key) or move buttons, removable, and a drop target for items dragged from another panel (columns of an export).
|
|
230
|
-
| `
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
224
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
225
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
|
|
226
|
+
| `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`, `rowAttrs(row, index)` (attributes and listeners on each row), `rowDraggable` with `dragData(row, rows)` and `dragEffect` (rows dragged onto external drop targets). Slots: `cell-<key>`, `header-<key>`, `empty`. Events: `rowClick`, `rowDragStart`, `rowDragEnd`. | `data/table.vue` |
|
|
227
|
+
| `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` |
|
|
228
|
+
| `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` |
|
|
229
|
+
| `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` |
|
|
230
|
+
| `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` |
|
|
231
|
+
| `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` |
|
|
232
|
+
| `TagList` | A list of `Tag` chips, reorderable by drag, by keyboard (Alt with an arrow key) or move buttons, removable, and a drop target for items dragged from another panel (columns of an export). | Model: `v-model` (`TagListItem[]`: `value`, `label`, `tone`, `icon`, `removable`, `disabled`). Props: `label`, `sortable`, `removable`, `moveButtons`, `accept` (MIME types or a function), `dropEffect`, `tone`, `size`, `disabled`, `emptyText`, `removeLabel`. Slots: `item`, `empty`. Events: `remove`, `move`, `itemDrop` (`{ index, dataTransfer, event }`). | `data/tag-list.vue` |
|
|
233
|
+
| `SortableList` | A vertical list of rows reorderable by drag (handle or label) and by keyboard (arrow keys on the handle, Alt with an arrow key in the row), each with an icon, a label, a description and a trailing slot (switches, actions). | Model: `v-model` (`SortableListItem[]`: `value`, `label`, `description`, `icon`, `disabled`). Props: `label`, `size` (sm, md), `disabled`, `emptyText`, `handleLabel`. Slots: `item`, `trailing`, `empty`. Event: `move`. | `data/sortable-list.vue` |
|
|
234
|
+
| `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` |
|
|
235
|
+
| `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` |
|
|
236
|
+
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
|
|
237
|
+
| `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` |
|
|
238
|
+
| `TileGrid` | Responsive grid of tiles (cards, thumbnails) with roving arrow key focus across rows, an optional multi selection (check overlay, Shift ranges, Space, Ctrl or Cmd with A), reorder by drag or Alt with the arrow keys, native drag to external drop targets and a trailing add tile. | Models: `v-model:items` (order), `v-model:selected` (keys). Props: `itemKey`, `itemLabel`, `label`, `minItemWidth`, `columns`, `gap`, `selectable`, `sortable`, `handle`, `dragData(item, items)`, `dragEffect`, `disabled`. Slots: `tile` (`{ item, index, selected, dragging }`), `add`. Events: `activate`, `move`, `itemDragStart`, `itemDragEnd`. | `data/tile-grid.vue` |
|
|
239
|
+
| `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` |
|
|
240
|
+
| `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` |
|
|
241
|
+
| `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` |
|
|
242
|
+
| `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
|
|
243
|
+
| `Tree` | Expandable hierarchy with selection, drag to reorder and nesting. | Models: `v-model:expanded`, `v-model:selected`. Props: `nodes` (`id`, `label`, `description`, `meta`, `icon`, `children`, `disabled`, `invalid`), `selectable`, `highlighted` (id or ids tinted like hover), `invalidText`, `reorderable`, `nestable`, `moveButtons` (default `true`; `false` hides the row arrows, drag and Alt+arrow keys still work), `canDrop`, `size`, `checkmark`, `emptyText`, `emptyDescription`, `emptyIcon`, `emptyVariant` (card, the default, or plain). Slots: `label` (`node`, `level`, `invalid`; an invalid row tints a custom label), `meta`, `actions` (row end, on hover, focus and the selected row, and while a popup opened from them is open; always visible without hover; `node`, `level`, `selected`, `expanded`, `highlighted`, `hovered`), `empty`, `empty-actions` (buttons in the default empty state). Events: `select`, `move`, `hover` (node or `null`). | `data/tree.vue` |
|
|
239
244
|
|
|
240
245
|
## Layout
|
|
241
246
|
|
|
@@ -348,39 +353,39 @@ A color value (`ColorValue`) is a palette name or a custom hex color `#rrggbb` (
|
|
|
348
353
|
|
|
349
354
|
All are exported from `@xleddyl/443-components-vue` (the Nuxt only ones from `@xleddyl/443-components-vue/nuxt/composables`) and auto-imported in Nuxt.
|
|
350
355
|
|
|
351
|
-
| Composable | Purpose and when to use it
|
|
352
|
-
| ---------------------------------------------------------------------------- |
|
|
353
|
-
| `useForm` | State of a form: values, errors, warnings, touched, dirty, submit, server errors. Use it for every form with more than one field.
|
|
354
|
-
| `useField`, `useFieldControl` | Build your own field control that reads the surrounding `FormField` (id, invalid, described by).
|
|
355
|
-
| `provideFieldBoundary`, `provideAuxiliaryControls` | In your own overlay component, stop controls from inheriting the field context of the trigger.
|
|
356
|
-
| `toast` / `useToast` | Toasts.
|
|
357
|
-
| `useConfirm` | Ask yes or no. Returns a promise of `true` or `false`.
|
|
358
|
-
| `useAlert` | Show a message and wait until the user closes it.
|
|
359
|
-
| `usePrompt` | Ask for one text value. Returns the string or `null`.
|
|
360
|
-
| `useModal`, `useDrawer`, `useOverlay` | Open a component as a modal or drawer and await its result. Use it when the content is a component with its own logic.
|
|
361
|
-
| `useModalContext` | Inside a component opened by `useModal` or `useDrawer`: close with a result and set the loading state.
|
|
362
|
-
| `useLoading`, `withLoading` | Global loading: top bar after a delay, or a blocking screen. Ref counted.
|
|
363
|
-
| `useLoadingState` | Local loading and error flag for a button or form.
|
|
364
|
-
| `useLeaveGuard`, `useLeaveScope`, `provideLeaveScope` | Unsaved changes guard for state that is not a `Form` (an editable grid, a canvas), or a custom leave scope.
|
|
365
|
-
| `useDirtyGuard` | Ask before leaving a page or closing the tab with unsaved changes.
|
|
366
|
-
| `useFileDrop` | Make any element a drop zone. Use `FileInput` when you need the full control.
|
|
367
|
-
| `useSortable` | Reorder any small list by pointer drag (live, Escape cancels) and Alt with the arrow keys, with an announcement. `TagList` uses it.
|
|
368
|
-
| `useHotkey` | Keyboard shortcut for a page or component.
|
|
369
|
-
| `useCopy` | Copy text with a `copied` flag.
|
|
370
|
-
| `useTableSort` | Client side sort for `Table`.
|
|
371
|
-
| `usePasswordStrength` | Score a password. Also `scorePassword` and `generatePassword`.
|
|
372
|
-
| `useTheme` | Read or set the theme preference (system, light, dark).
|
|
373
|
-
| `usePreset` | Read or set the visual preset.
|
|
374
|
-
| `usePreference`, `usePreferences`, `createPreferences`, `providePreferences` | Remember UI choices per user (theme, preset, sidebar collapsed, DataGrid columns and page size, your own keys) in one pluggable store.
|
|
375
|
-
| `useAppShell` | Read the `AppShell` state (collapsed, open) from a child component.
|
|
376
|
-
| `useRouteState` | Bind a ref to a URL query parameter or hash entry: deep links to drawers and modals, back button closes them, filters in the URL.
|
|
377
|
-
| `provideGridConfig`, `createGridConfig`, `useGridConfig` | Defaults of every `DataGrid` in the app or a subtree: `density`, `columnMenu`, `exportable`, `pageSizes`.
|
|
378
|
-
| `useScrollLock` | Lock the page scroll while something is open.
|
|
379
|
-
| `useLocale` | Translate component texts and read the active locale (en, it, de).
|
|
380
|
-
| `useIcons` helpers, `createIcons`, `provideIcons` | Register your own icons by name.
|
|
381
|
-
| `useLinkComponent`, `createLinkComponent` | Use the router link (for example `NuxtLink`) for every `to` prop.
|
|
382
|
-
| `useDashboard` (Nuxt only) | Runtime account, breadcrumbs and badges for the `k-dashboard` layout.
|
|
383
|
-
| `useNavigationPending` (Nuxt only) | `true` while a navigation to another path renders the new page. Bind it to `loading` of `DashboardLayout` or `AppShell`.
|
|
356
|
+
| Composable | Purpose and when to use it | Signature and notes | Playground |
|
|
357
|
+
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
358
|
+
| `useForm` | State of a form: values, errors, warnings, touched, dirty, submit, server errors. Use it for every form with more than one field. | `useForm({ schema, values, validator, warnings, validateOn, onSubmit, onInvalid, submitError, messages, translateMessage, guard })` (`guard: false` keeps the form out of the leave guard; `createFormConfig({ guard: false })` for every form). Schema fields: `initial`, `required`, `min`, `max`, `minLength`, `maxLength`, `pattern`, `validate`. `validator` takes any Standard Schema (Zod 4, Valibot, ArkType). Returns `values`, `errors`, `dirty`, `dirtyFields`, `valid`, `submitting`, `validate`, `validateSync`, `setError`, `setErrors`, `setIssues`, `reset(next?)`, `markClean()` (the current values become the saved state), `submit` (a successful `onSubmit` marks the form clean; throw to keep it dirty), `touch`, `isRequired`. Pass it to `Form`. | `core/form.vue` |
|
|
359
|
+
| `useField`, `useFieldControl` | Build your own field control that reads the surrounding `FormField` (id, invalid, described by). | `useFieldControl({ role: 'auxiliary' })` for a secondary control. `control.setControlError(message)` reports a control level error. | `core/form-field.vue` |
|
|
360
|
+
| `provideFieldBoundary`, `provideAuxiliaryControls` | In your own overlay component, stop controls from inheriting the field context of the trigger. | Call in `setup`. | - |
|
|
361
|
+
| `toast` / `useToast` | Toasts. | `toast(title, opts)`, `toast.success`, `.error`, `.warning`, `.info`, `.loading`, `.promise(promise, { loading, success, error })`, `.update(id, opts)`, `.dismiss(id)`. Options: `description` (string or list), `action` (`label`, `onClick`), `duration`, `dismissible`. | `overlays/toast.vue` |
|
|
362
|
+
| `useConfirm` | Ask yes or no. Returns a promise of `true` or `false`. | `await useConfirm()({ title, description, tone, confirmLabel, cancelLabel, body })`. Presets: `confirm.delete(title, options?)` (danger, Delete) and `confirm.discard(options?)` (unsaved changes; one dialog at a time, and once per route navigation however many guards ask). | `overlays/hooks.vue` |
|
|
363
|
+
| `useAlert` | Show a message and wait until the user closes it. | `await useAlert()({ title, description, tone })`. | `overlays/hooks.vue` |
|
|
364
|
+
| `usePrompt` | Ask for one text value. Returns the string or `null`. | `await usePrompt()({ title, label, value, placeholder, type, required, maxLength, validate(value), onConfirm(value) })`. | `overlays/hooks.vue` |
|
|
365
|
+
| `useModal`, `useDrawer`, `useOverlay` | Open a component as a modal or drawer and await its result. Use it when the content is a component with its own logic. | `const result = await useModal().open(Component, props, { title, size, beforeClose })`. The handle has `id`, `close(result)`, `update(props)`. `useModal().close(id?)`, `closeAll()`. `useOverlay` is the base (option `as`). | `overlays/hooks.vue` |
|
|
366
|
+
| `useModalContext` | Inside a component opened by `useModal` or `useDrawer`: close with a result and set the loading state. | `const { close, setLoading } = useModalContext<R>()`. | `overlays/hooks.vue` |
|
|
367
|
+
| `useLoading`, `withLoading` | Global loading: top bar after a delay, or a blocking screen. Ref counted. | `useLoading().wrap(promise, { blocking, label })`, `start()` returns a stop function. `withLoading(fn)` wraps a function. Needs `OverlayHost`. | `overlays/hooks.vue` |
|
|
368
|
+
| `useLoadingState` | Local loading and error flag for a button or form. | `const { loading, error, run } = useLoadingState()`; `await run(() => api.save())`. | `overlays/hooks.vue` |
|
|
369
|
+
| `useLeaveGuard`, `useLeaveScope`, `provideLeaveScope` | Unsaved changes guard for state that is not a `Form` (an editable grid, a canvas), or a custom leave scope. | `useLeaveGuard(dirty?, { enabled, title, description })` registers `dirty` in the nearest scope (an open `Modal`, `Drawer`, `SettingsModal`, else the page: route path change and tab close) and returns `dirty` (of the scope), `confirmLeave()`, `allowNext()`, `scope`. `provideLeaveScope(options?)` makes a component a scope (call `scope.confirmLeave()` before you replace its content). | `templates/form-modal.vue` |
|
|
370
|
+
| `useDirtyGuard` | Ask before leaving a page or closing the tab with unsaved changes. | `useDirtyGuard(dirty, options?)`, now built on `useLeaveGuard`. Returns `confirmLeave()` and `allowNext()`. `FormPage` already uses it. | `templates/form-page.vue` |
|
|
371
|
+
| `useFileDrop` | Make any element a drop zone. Use `FileInput` when you need the full control. | `useFileDrop(targetRef, { onDrop(files, event), disabled, ignore })` returns `{ over, reset }`. `readDroppedFiles(dataTransfer)` walks dropped folders. | `forms/file-input.vue` |
|
|
372
|
+
| `useSortable` | Reorder any small list or grid of cells by pointer drag (live, Escape cancels) and Alt with the arrow keys, with an announcement. `TagList` uses it. | `useSortable(containerRef, { items, onMove(items, move), orientation (vertical, horizontal, grid), disabled, handle, preview, canMove, label, movedText })` returns `{ itemProps(index), move(from, to), canMove, dragging, announcement }`. Bind `itemProps(index)` on each item and render `announcement` in a live region. | `data/tag-list.vue` |
|
|
373
|
+
| `useHotkey` | Keyboard shortcut for a page or component. | `useHotkey('mod+k', handler, { enabled, preventDefault, allowInInputs, target })`. `formatHotkey` and `ariaKeyShortcuts` are exported. | `overlays/command-palette.vue` |
|
|
374
|
+
| `useCopy` | Copy text with a `copied` flag. | `const { copy, copied, error } = useCopy({ resetAfter })`. | `layout/copy-button.vue` |
|
|
375
|
+
| `useTableSort` | Client side sort for `Table`. | `const { sort, sorted } = useTableSort(rows, { columns, initial, locale })`. Bind `sort` to `v-model:sort` and render `sorted`. | `data/table.vue` |
|
|
376
|
+
| `usePasswordStrength` | Score a password. Also `scorePassword` and `generatePassword`. | Returns the level 0 to 4. `PasswordInput` already uses it. | `forms/password-input.vue` |
|
|
377
|
+
| `useTheme` | Read or set the theme preference (system, light, dark). | `const { preference, resolved, set } = useTheme()`. Nuxt module stores it in a cookie. | `layout/theme-switch.vue` |
|
|
378
|
+
| `usePreset` | Read or set the visual preset. | `presetOptions` lists the presets. | `presets.vue` (pages root) |
|
|
379
|
+
| `usePreference`, `usePreferences`, `createPreferences`, `providePreferences` | Remember UI choices per user (theme, preset, sidebar collapsed, DataGrid columns and page size, your own keys) in one pluggable store. | `app.use(createPreferences(store))`; a store is `{ get, set, subscribe?, clientOnly? }`. `createRemotePreferenceStore({ initial, save, debounce })` for an API, `createLocalPreferenceStore()` is the default. `usePreference(key, fallback, { validate })` is a writable computed. Keys: `theme`, `preset`, `shell:<storageKey>`, `grid:<storageKey>` (`PREFERENCE_KEYS`). | `core/preferences.vue` |
|
|
380
|
+
| `useAppShell` | Read the `AppShell` state (collapsed, open) from a child component. | Returns the shell context or `null` outside a shell. | `layout/app-shell.vue` |
|
|
381
|
+
| `useRouteState` | Bind a ref to a URL query parameter or hash entry: deep links to drawers and modals, back button closes them, filters in the URL. | `useRouteState(key, { parse, serialize, default, history: 'push' \| 'replace', location: 'query' \| 'hash' })`. Returns a ref; `undefined` or `''` removes the parameter. Hash entries are `key/value` joined with `&` (`#family/fam_1&variant/var_2`), read after mount. `routeHash(hash, { key: value })` builds a link hash, `routeHashValue(hash, key)` reads one entry. `withRouteStateScroll(scrollBehavior)` for plain vue-router. No-op without a router. | `overlays/drawer.vue` |
|
|
382
|
+
| `provideGridConfig`, `createGridConfig`, `useGridConfig` | Defaults of every `DataGrid` in the app or a subtree: `density`, `columnMenu`, `exportable`, `pageSizes`. | `app.use(createGridConfig({ density: 'compact', columnMenu: false }))` or `provideGridConfig(config)` in a component (`GridConfig`). Nuxt: option `k.grid: { ... }`. A prop on the grid wins. | `grid/data-grid.vue` |
|
|
383
|
+
| `useScrollLock` | Lock the page scroll while something is open. | `useScrollLock(activeRef)`. | - |
|
|
384
|
+
| `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) |
|
|
385
|
+
| `useIcons` helpers, `createIcons`, `provideIcons` | Register your own icons by name. | Nuxt: option `k.icons: { dir: '~/assets/icons' }`. | `components/core/icon.vue` |
|
|
386
|
+
| `useLinkComponent`, `createLinkComponent` | Use the router link (for example `NuxtLink`) for every `to` prop. | The Nuxt module does it for you. | - |
|
|
387
|
+
| `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 |
|
|
388
|
+
| `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 |
|
|
384
389
|
|
|
385
390
|
## Before you build your own
|
|
386
391
|
|