@xleddyl/443-components-vue 0.16.95 → 0.16.96
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 +23 -23
- package/README.md +6 -6
- package/dist/components/data/RecordList.vue +44 -6
- package/dist/components/data/RecordList.vue.d.ts +4 -1
- package/dist/components/data/Tree.vue +84 -24
- package/dist/components/data/Tree.vue.d.ts +9 -9
- package/dist/components/data/types.d.ts +10 -1
- package/dist/components/layout/Accordion.vue +6 -2
- package/dist/components/layout/Accordion.vue.d.ts +3 -0
- package/dist/components/overlays/Popover.vue +4 -2
- package/dist/components/overlays/Popover.vue.d.ts +2 -0
- package/dist/composables/useSortable.mjs +13 -0
- package/dist/internal/data/sortable.d.ts +2 -0
- package/dist/internal/data/sortable.mjs +2 -0
- package/dist/styles/data/record-list.css +54 -0
- package/dist/styles/data/tree.css +57 -4
- package/dist/styles/forced-colors.css +4 -0
- package/dist/styles/layout/accordion.css +4 -5
- package/dist/styles/layout/card.css +2 -0
- package/dist/styles/overlays/popover.css +6 -0
- package/dist/styles/shared.css +9 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -212,7 +212,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
212
212
|
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
|
|
213
213
|
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
|
|
214
214
|
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
|
|
215
|
-
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`.
|
|
215
|
+
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `width` (any CSS length, capped at the viewport), `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`. | `overlays/popover.vue` |
|
|
216
216
|
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
|
|
217
217
|
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
|
|
218
218
|
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `disabled`, `disabledReason` (with `disabled`: reachable with the arrow keys but not selectable, a tooltip on hover and keyboard focus, linked with `aria-describedby`), `onSelect`), `search(query, signal)`, `pinned` (items or `(query) => items` shown first, never filtered or saved as recent), `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
|
|
@@ -221,26 +221,26 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
221
221
|
|
|
222
222
|
## Data
|
|
223
223
|
|
|
224
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
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`.
|
|
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`.
|
|
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.
|
|
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`.
|
|
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.
|
|
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`.
|
|
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 }`).
|
|
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`.
|
|
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.
|
|
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`.
|
|
236
|
-
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`.
|
|
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`.
|
|
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`.
|
|
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`.
|
|
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
|
|
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>`.
|
|
242
|
-
| `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`.
|
|
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`).
|
|
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 }`, `icon`, `meta` (trailing text), `to`, `href`, `target` (a link row: the title link covers the row, Cmd click and middle click open a new tab)), `loading`, `avatar`, `action`, `label`, `skeletonRows`, `emptyText`, `emptyDescription`, `emptyIcon`, `emptyVariant` (card, the default, plain, or hint: the empty text as one muted line). 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` (default: the `icon`), `meta`, `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`, `muted` (dimmed), `to`, `href`, `target` (a link row: Cmd click, middle click and Cmd Enter open a new tab)), `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` |
|
|
244
244
|
|
|
245
245
|
## Layout
|
|
246
246
|
|
|
@@ -251,7 +251,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
251
251
|
| `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` |
|
|
252
252
|
| `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` |
|
|
253
253
|
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `color` (a palette name or hex, a dot before the label), `badge`, `badgeTone`, `dot`, `title` (a tooltip on hover and focus, also on a disabled tab; native `title` until mount), `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`. | `layout/tabs.vue` |
|
|
254
|
-
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant
|
|
254
|
+
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`, `contentVariant` (text, or neutral: inherited font and color for forms, same padding), `padded` (default `true`; `false` for flush content). Slots: default, `title`. | `layout/accordion.vue` |
|
|
255
255
|
| `Separator` | Divider, labelled divider, or section heading with description and actions. | Props: `orientation`, `variant` (label, heading), `label`, `description`, `align`, `level`, `lines` (default `true`; `false` hides the lines of either variant). Slots: default, `description`, `actions`. | `layout/separator.vue` |
|
|
256
256
|
| `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
|
|
257
257
|
| `Grid` | Responsive CSS grid. | Props: `columns` (number or breakpoints), `minItemWidth` (auto fit), `gap`, `as`. | `layout/grid.vue` |
|
|
@@ -369,7 +369,7 @@ All are exported from `@xleddyl/443-components-vue` (the Nuxt only ones from `@x
|
|
|
369
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
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
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.
|
|
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. The dragged item stacks above the next ones, with the raised shadow in vertical lists. | `data/tag-list.vue` |
|
|
373
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
374
|
| `useCopy` | Copy text with a `copied` flag. | `const { copy, copied, error } = useCopy({ resetAfter })`. | `layout/copy-button.vue` |
|
|
375
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` |
|
package/README.md
CHANGED
|
@@ -510,7 +510,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
510
510
|
|
|
511
511
|
### Lists, trees and uploads
|
|
512
512
|
|
|
513
|
-
- `Tree` takes `size="sm"` for dense rows, `checkmark`, `descriptionVariant` (`mono`, the default for paths and slugs, or `text`; a node can override it with its own `descriptionVariant`), `emptyText`, `emptyDescription`, `emptyIcon` and `emptyVariant` (`card`, the default, or `plain`) for the `EmptyState` shown without nodes (`#empty` replaces it, `#empty-actions` adds buttons inside it, like `RecordList`) and works inside a `FormField` (labelled and described by the field). With `reorderable` rows get a drag handle and Alt with the up and down arrows moves them; `nestable` also lets rows change level (drop in the middle of a row, Alt with left and right). Each row also shows move buttons; `moveButtons: false` hides them and keeps drag and the keyboard. The `move` event carries `{ node, target, position, from: { parent, index }, to: { parent, index } }`, `to.index` being the final index, and `applyTreeMove(nodes, move)` returns the updated tree. `canDrop(move)` vetoes a move. Moves are announced to screen readers. The `#actions` slot (`node`, `level`, `selected`, `expanded`, `highlighted`, `hovered`) renders row actions at the end of the row, over the label, on the hovered, focused and selected rows only; Tab from the focused row reaches them, and focus returns to a row when the focused one is removed. Actions stay visible and clickable while a menu, popover or select opened from them is open (any trigger inside with `aria-expanded="true"`), so the pointer can cross other rows to reach the menu items. On devices without hover (`hover: none`, touch) the slot actions are always visible and sit in the row after the label instead of over it, and the move buttons show on the focused (tapped) and selected rows. `highlighted` (an id or an array of ids) tints rows like hover, for a link with something outside the tree (a block hovered in a preview). The `hover` event carries the node under the pointer, then `null` when the pointer leaves the tree. A node with `invalid: true` shows a danger dot before the label (never covered by the actions) and a tinted label, and its row is described by a hidden "Contains errors" (`invalidText` overrides it). The `#label` slot receives `invalid` (with `node` and `level`), and a custom label inherits the danger text color unless it sets its own.
|
|
513
|
+
- `Tree` takes `size="sm"` for dense rows, `checkmark`, `descriptionVariant` (`mono`, the default for paths and slugs, or `text`; a node can override it with its own `descriptionVariant`), `emptyText`, `emptyDescription`, `emptyIcon` and `emptyVariant` (`card`, the default, or `plain`) for the `EmptyState` shown without nodes (`#empty` replaces it, `#empty-actions` adds buttons inside it, like `RecordList`) and works inside a `FormField` (labelled and described by the field). With `reorderable` rows get a drag handle and Alt with the up and down arrows moves them; `nestable` also lets rows change level (drop in the middle of a row, Alt with left and right). Each row also shows move buttons; `moveButtons: false` hides them and keeps drag and the keyboard. The `move` event carries `{ node, target, position, from: { parent, index }, to: { parent, index } }`, `to.index` being the final index, and `applyTreeMove(nodes, move)` returns the updated tree. `canDrop(move)` vetoes a move. Moves are announced to screen readers. The `#actions` slot (`node`, `level`, `selected`, `expanded`, `highlighted`, `hovered`) renders row actions at the end of the row, over the label, on the hovered, focused and selected rows only; Tab from the focused row reaches them, and focus returns to a row when the focused one is removed. Actions stay visible and clickable while a menu, popover or select opened from them is open (any trigger inside with `aria-expanded="true"`), so the pointer can cross other rows to reach the menu items. On devices without hover (`hover: none`, touch) the slot actions are always visible and sit in the row after the label instead of over it, and the move buttons show on the focused (tapped) and selected rows. `highlighted` (an id or an array of ids) tints rows like hover, for a link with something outside the tree (a block hovered in a preview). The `hover` event carries the node under the pointer, then `null` when the pointer leaves the tree. A node with `invalid: true` shows a danger dot before the label (never covered by the actions) and a tinted label, and its row is described by a hidden "Contains errors" (`invalidText` overrides it). The `#label` slot receives `invalid` (with `node` and `level`), and a custom label inherits the danger text color unless it sets its own. A node with `to` or `href` (and `target`) is a link row: its text (label and description, or the `#label` slot) is a real link stretched over the row, kept out of the Tab order so the tree keeps one tab stop. A click navigates and selects, Cmd, Ctrl or Shift click and the middle button open the link in a new tab or window without selecting, Enter follows the link (Cmd or Ctrl with Enter in a new tab) instead of expanding, Space selects, and the arrow keys, typeahead and reordering work as on any row; the handle, the toggle and the actions stay above the link. `muted: true` dims the label, the description and the icon of a node (a hidden block, a draft page), and a custom label inherits the muted color; the node stays interactive. Say why in `meta` or a hidden text, the color alone does not. In a narrow container the label keeps a minimum width (8rem, 6rem with `size="sm"`) and the `meta` wraps below it instead of squeezing it; `mono` descriptions stay on one line with an ellipsis and the full text in their `title`, `text` descriptions wrap between words, and labels carry their full text in `title` too.
|
|
514
514
|
- `Select` takes string, number or boolean option values (`{ value: true, label: 'Yes' }`); the model gets the option value back with its type and is typed `T | null | undefined`, so `v-model` works on a narrow ref (`Ref<'a' | 'b' | null>`). An option whose value is `''` is a real option: it is selected and shown with its own label, distinct from the placeholder, which still maps to `null`.
|
|
515
515
|
- `Input` and `Textarea` take `counter`: with a `maxlength` attribute they show `length / maxlength` inside the field, describe the control with "12 of 40 characters" (`form.characterCount`) and announce "Character limit reached" when it is hit.
|
|
516
516
|
- Numbers are left aligned in every field. `Input` `numeric` sets the decimal keyboard, the number model and tabular digits; `NumberInput` takes `align="end"` to right align its value when a layout needs it (default `start`).
|
|
@@ -521,7 +521,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
521
521
|
- `Combobox` takes `createActions` (`ComboboxCreateActions`, `(query) => ComboboxCreateAction[]`) to show several create items instead of the single "Create" item. Each action has `id` (the item key is `__create:<id>`), `label`, `icon` (default `plus`) and `run(query)`. The actions show at the end of the list under the same conditions as the create item: a non-empty query after `createTransform`, with no option whose label or value matches it exactly. The function gets that text, and an empty array shows no action. `createValidate` runs before `run`. When `run` returns an option, the combobox remembers it, emits `create` and selects it. When it returns nothing (for example it opens a form for the full record), nothing is selected: the query clears and the list closes (with `multiple`, only the query clears). Errors from `run` are logged. `createActions` replaces `creatable`: `<KCombobox v-model="category" :options="categories" :create-actions="(query) => [{ id: 'quick', label: 'Create here', run: createCategory }, { id: 'form', label: 'Create with details', icon: 'pencil-square', run: openForm }]" />`.
|
|
522
522
|
- `Combobox` with `:searchable="false"` is a plain select that keeps the option dots, icons, descriptions and groups: the control is a `<button>` with `role="combobox"` and `aria-haspopup="listbox"` that shows the selected label (with the color dot or the `icon`), or the placeholder when empty. There is no text to type and no filter. Click, Enter, Space, ArrowDown or ArrowUp open the list, the arrows, Home and End move, Enter or Space select (with `multiple` the list stays open), Escape and Tab close, and typing letters moves to the next option whose label starts with them (typeahead, like a native select). `clearable`, `disabled`, `readonly`, `invalid`, `size`, `icon`, `multiple` and `hideTags` work as usual; `creatable`, `createActions` and the async `search` are ignored. Use it for a short fixed list that needs a color dot or an icon (`PaletteSelect` uses it): `<KCombobox v-model="status" :options="statuses" :searchable="false" />`. The exposed `el` is the input, or the trigger button when not searchable.
|
|
523
523
|
- `Combobox` with `multiple` takes `hideTags`: the selected values are not rendered as tags inside the control (the host shows them elsewhere), the placeholder stays visible and Backspace no longer removes the last value. Selection is still announced through the options. A long tag label is truncated with an ellipsis and the full label (with the option group or description) is in the tag tooltip.
|
|
524
|
-
- `RecordList` keeps each title on one line with an ellipsis; the full title is in its `title` attribute. With a `row-click` listener each row is a navigation item (padding, the hover and press background of a ghost button, no separators, the list bleeds into the inline padding so the text stays aligned). The title of a clickable row is a button: Tab reaches every row, Enter or Space emits `row-click`, the focus ring is drawn around the row and the description is the button description. A click anywhere else in the row emits it too, except on a button, link, input, menu item or tab inside the row and inside an open menu, popover or dialog that the row contains; pressing those does not tint the row. Keep the actions of a row as buttons in `#action`, never as a second clickable area. `rowClickable(item)` returns `false` for the rows that open nothing: they keep the same padding, without the button, hover and pointer.
|
|
524
|
+
- `RecordList` keeps each title on one line with an ellipsis; the full title is in its `title` attribute. With a `row-click` listener each row is a navigation item (padding, the hover and press background of a ghost button, no separators, the list bleeds into the inline padding so the text stays aligned). The title of a clickable row is a button: Tab reaches every row, Enter or Space emits `row-click`, the focus ring is drawn around the row and the description is the button description. A click anywhere else in the row emits it too, except on a button, link, input, menu item or tab inside the row and inside an open menu, popover or dialog that the row contains; pressing those does not tint the row. Keep the actions of a row as buttons in `#action`, never as a second clickable area. `rowClickable(item)` returns `false` for the rows that open nothing: they keep the same padding, without the button, hover and pointer. An item with `to` or `href` (and `target`) is a link row: its title is a real link (the provided link component for `to`, `<a>` otherwise) stretched over the row, so a click anywhere opens it, Cmd or Ctrl click and the middle button open a new tab, Tab focuses it and the row gets the same hover, press and focus ring; buttons, links and inputs of the row stay above it, and `row-click` still fires on a plain click (to close the dialog around the list). `icon` adds a leading icon box (the fallback of `#leading`) and `meta` a short trailing text on one line (`#meta` slot with `{ item }`), both described on the title. Without items, `emptyVariant` picks the empty state: `card` (default), `plain` (a smaller centered title without the card) or `hint` (the `emptyText` as one muted line, for a small list in a form or a dialog, like "No active links").
|
|
525
525
|
- `Fieldset` is a native `fieldset`: `disabled` disables every control inside (also the buttons, not the links) and every `FormField` through the form disabled state. `:disabled="false"` enables a group inside a disabled `Form`. When it becomes disabled while a control inside has focus, the focus moves to the fieldset, never to the page. The legend comes from `legend` or the `#legend` slot.
|
|
526
526
|
- `Pagination` takes `showEdges` (first and last page buttons, `firstLabel`, `lastLabel`) and `showJump` (a typed page number, `jumpLabel`). Both are off by default. `page` is clamped to the page count only when `total` is known: while `total` is `0` or `loading` is set (it also sets `aria-busy`), the page is kept, so a server reload does not reset it.
|
|
527
527
|
- Page sizes are `PageSize` values (`number | 'all'`): `pageSizes: [25, 50, 100, 'all']` adds an "All" option (`pagination.all`, override with `allLabel`). With `'all'` the page size model is `'all'`, there is one page and the summary reads `1-<total> of <total>`. `Pagination`, `ListPage` and `DataGrid` take it; with `serverPagination` the grid emits `'all'` through `v-model:page-size` and your API returns every row.
|
|
@@ -580,7 +580,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
580
580
|
</KSortableList>
|
|
581
581
|
```
|
|
582
582
|
|
|
583
|
-
- `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, `'grid'` for a CSS grid of cells: the item lands in the cell nearest to the pointer across wrapped rows, Alt with Left and Right moves it by one and Alt with Up and Down to the nearest cell of the row above or below), `disabled`, `handle` (a selector: only a pointer down on it starts a drag; without it any pointer down outside buttons, links and inputs does), `preview` (a selector inside the item: only that part follows the pointer and the item stays in its slot, so style the dragged item as the drop indicator, a dashed placeholder), `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
|
|
583
|
+
- `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, `'grid'` for a CSS grid of cells: the item lands in the cell nearest to the pointer across wrapped rows, Alt with Left and Right moves it by one and Alt with Up and Down to the nearest cell of the row above or below), `disabled`, `handle` (a selector: only a pointer down on it starts a drag; without it any pointer down outside buttons, links and inputs does), `preview` (a selector inside the item: only that part follows the pointer and the item stays in its slot, so style the dragged item as the drop indicator, a dashed placeholder), `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 your own dragging 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. The dragged item is lifted by default: while a drag runs it carries `data-k-sortable-dragging` (`position: relative` and `z-index: 1`, so it stacks above the next items) and the part that follows the pointer (the item, or `preview`) carries `data-k-sortable-lifted` with the orientation; in a vertical list it gets `--k-shadow-raised` with `--k-shadow-sm`. Both rules have zero specificity, so any style of yours wins; `SortableList` uses the same lift.
|
|
584
584
|
|
|
585
585
|
- `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.
|
|
586
586
|
|
|
@@ -627,7 +627,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
627
627
|
```
|
|
628
628
|
|
|
629
629
|
- `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.
|
|
630
|
-
- `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
|
|
630
|
+
- `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 text styling of the content (it inherits font size and color, for forms) and keeps the padding of the item, aligned with the trigger. `:padded="false"` drops the content padding for content that brings its own spacing or reaches the edges (a list, a table, a tree), with either content variant.
|
|
631
631
|
- `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']`.
|
|
632
632
|
|
|
633
633
|
### Grid defaults
|
|
@@ -784,7 +784,7 @@ const archived = useRouteState('archived', {
|
|
|
784
784
|
- Pages that set `definePageMeta({ key: (route) => route.fullPath })` remount on every query change; keep the default page key for pages with deep links.
|
|
785
785
|
- To leave the page from inside an overlay, navigate (a link or `router.push`): the new route has no parameter, so the overlay closes. Do not set the ref to `undefined` and navigate in the same tick: the later navigation cancels the earlier one.
|
|
786
786
|
|
|
787
|
-
`Popover`: `anchor` places the panel against any element or a virtual reference (`OverlayVirtualAnchor`, an object with `getBoundingClientRect()`, for a pointer position or a text selection) instead of its trigger, and the trigger slot becomes optional: open it with `v-model:open` or the exposed `show()`. An element inside a same origin iframe works too: the panel is placed in the page against it, and a click or Escape inside the iframe closes it. The position follows scroll and resize. Focus moves into the panel on open and returns to the anchor when it can take focus, otherwise to the element focused before; a click outside and Escape close it. Without a trigger, name the panel with `label`.
|
|
787
|
+
`Popover`: `width` sets the width of the panel (any CSS length, like `18rem`) instead of the default range (12rem to 24rem), capped at the viewport width. `anchor` places the panel against any element or a virtual reference (`OverlayVirtualAnchor`, an object with `getBoundingClientRect()`, for a pointer position or a text selection) instead of its trigger, and the trigger slot becomes optional: open it with `v-model:open` or the exposed `show()`. An element inside a same origin iframe works too: the panel is placed in the page against it, and a click or Escape inside the iframe closes it. The position follows scroll and resize. Focus moves into the panel on open and returns to the anchor when it can take focus, otherwise to the element focused before; a click outside and Escape close it. Without a trigger, name the panel with `label`.
|
|
788
788
|
|
|
789
789
|
```vue
|
|
790
790
|
<script setup lang="ts">
|
|
@@ -816,7 +816,7 @@ function openAt(event: MouseEvent) {
|
|
|
816
816
|
```
|
|
817
817
|
|
|
818
818
|
- `Brand`: `logo` takes an image URL, trusted inline SVG markup (`'<svg ...>'`) or a component; the `#logo` slot replaces the boxed mark; `show-name` keeps the name visible next to a logo.
|
|
819
|
-
- `Card`: `selected` gives a pressed look (`aria-pressed` on `as="button"`, `aria-selected` with `role="option"` and similar roles); `:animated="false"` turns off the entrance animation.
|
|
819
|
+
- `Card`: `selected` gives a pressed look (`aria-pressed` on `as="button"`, `aria-selected` with `role="option"` and similar roles); `:animated="false"` turns off the entrance animation. The `icon` stays beside the heading at any width (the title and the description wrap next to it), and the header actions move to their own line when they do not fit.
|
|
820
820
|
- `Spinner`: `block` renders a centered loading state that fills its container, with `label` shown under the spinner: `<KSpinner block size="lg" label="Loading entries" />`.
|
|
821
821
|
|
|
822
822
|
## Layouts and page templates
|
|
@@ -4,25 +4,40 @@
|
|
|
4
4
|
<ul
|
|
5
5
|
v-else-if="items.length"
|
|
6
6
|
class="k-record-list"
|
|
7
|
-
:class="{ 'is-interactive': hasRowClick }"
|
|
7
|
+
:class="{ 'is-interactive': hasRowClick || hasLinks }"
|
|
8
8
|
:aria-label="label"
|
|
9
9
|
>
|
|
10
10
|
<li
|
|
11
11
|
v-for="(item, index) in items"
|
|
12
12
|
:key="item.id"
|
|
13
13
|
class="k-record-list-item"
|
|
14
|
-
:class="{ 'is-interactive': clickable(item) }"
|
|
14
|
+
:class="{ 'is-interactive': clickable(item) || links[index], 'is-link': links[index] }"
|
|
15
15
|
@click="onRowClick(item, $event)"
|
|
16
16
|
>
|
|
17
|
-
<slot name="leading" :item="item"
|
|
17
|
+
<slot name="leading" :item="item">
|
|
18
|
+
<span v-if="item.icon" class="k-record-list-icon" aria-hidden="true">
|
|
19
|
+
<Icon :name="item.icon" />
|
|
20
|
+
</span>
|
|
21
|
+
</slot>
|
|
18
22
|
<div class="k-record-list-text">
|
|
19
23
|
<span class="k-record-list-title-row">
|
|
24
|
+
<component
|
|
25
|
+
:is="links[index].is"
|
|
26
|
+
v-if="links[index]"
|
|
27
|
+
v-bind="links[index].attrs"
|
|
28
|
+
class="k-record-list-title k-record-list-trigger k-record-list-link"
|
|
29
|
+
:title="item.title"
|
|
30
|
+
:aria-describedby="describedBy(item, index)"
|
|
31
|
+
@click="emit('rowClick', item, $event)"
|
|
32
|
+
>
|
|
33
|
+
{{ item.title }}
|
|
34
|
+
</component>
|
|
20
35
|
<button
|
|
21
|
-
v-if="clickable(item)"
|
|
36
|
+
v-else-if="clickable(item)"
|
|
22
37
|
type="button"
|
|
23
38
|
class="k-record-list-title k-record-list-trigger"
|
|
24
39
|
:title="item.title"
|
|
25
|
-
:aria-describedby="item
|
|
40
|
+
:aria-describedby="describedBy(item, index)"
|
|
26
41
|
@click="emit('rowClick', item, $event)"
|
|
27
42
|
>
|
|
28
43
|
{{ item.title }}
|
|
@@ -43,12 +58,19 @@
|
|
|
43
58
|
{{ item.description }}
|
|
44
59
|
</span>
|
|
45
60
|
</div>
|
|
61
|
+
<span v-if="item.meta || $slots.meta" :id="metaId(index)" class="k-record-list-meta">
|
|
62
|
+
<slot name="meta" :item="item">{{ item.meta }}</slot>
|
|
63
|
+
</span>
|
|
46
64
|
<slot name="action" :item="item" />
|
|
47
65
|
</li>
|
|
48
66
|
</ul>
|
|
49
67
|
|
|
50
68
|
<slot v-else name="empty">
|
|
69
|
+
<p v-if="emptyVariant === 'hint'" class="k-record-list-hint">
|
|
70
|
+
{{ emptyText ?? t("common.empty") }}
|
|
71
|
+
</p>
|
|
51
72
|
<EmptyState
|
|
73
|
+
v-else
|
|
52
74
|
:icon="emptyIcon"
|
|
53
75
|
:title="emptyText ?? t('common.empty')"
|
|
54
76
|
:description="emptyDescription"
|
|
@@ -62,8 +84,11 @@
|
|
|
62
84
|
</template>
|
|
63
85
|
|
|
64
86
|
<script setup>
|
|
65
|
-
import { computed, getCurrentInstance, useId } from "vue";
|
|
87
|
+
import { computed, getCurrentInstance, useId, useSlots } from "vue";
|
|
66
88
|
import { useLocale } from "../../composables/useLocale";
|
|
89
|
+
import { useLinkResolver } from "../../internal/core/link";
|
|
90
|
+
import { joinIds } from "../../internal/forms/control";
|
|
91
|
+
import Icon from "../core/Icon.vue";
|
|
67
92
|
import EmptyState from "../feedback/EmptyState.vue";
|
|
68
93
|
import SkeletonList from "../feedback/SkeletonList.vue";
|
|
69
94
|
import Badge from "./Badge.vue";
|
|
@@ -84,10 +109,23 @@ defineSlots();
|
|
|
84
109
|
const emit = defineEmits(["rowClick"]);
|
|
85
110
|
const { t } = useLocale();
|
|
86
111
|
const instance = getCurrentInstance();
|
|
112
|
+
const slots = useSlots();
|
|
87
113
|
const baseId = useId();
|
|
114
|
+
const { resolveLink } = useLinkResolver();
|
|
115
|
+
const links = computed(() => props.items.map((item) => resolveLink(item)));
|
|
116
|
+
const hasLinks = computed(() => links.value.some(Boolean));
|
|
88
117
|
function descriptionId(index) {
|
|
89
118
|
return `${baseId}-description-${index}`;
|
|
90
119
|
}
|
|
120
|
+
function metaId(index) {
|
|
121
|
+
return `${baseId}-meta-${index}`;
|
|
122
|
+
}
|
|
123
|
+
function describedBy(item, index) {
|
|
124
|
+
return joinIds(
|
|
125
|
+
item.description ? descriptionId(index) : void 0,
|
|
126
|
+
item.meta || slots.meta ? metaId(index) : void 0
|
|
127
|
+
);
|
|
128
|
+
}
|
|
91
129
|
const interactiveSelector = 'a, button, input, select, textarea, label, summary, [contenteditable="true"], [role="button"], [role="menuitem"], [role="option"], [role="checkbox"], [role="switch"], [role="tab"]';
|
|
92
130
|
const layerSelector = "dialog, [popover], .k-floating";
|
|
93
131
|
const hasRowClick = computed(
|
|
@@ -11,7 +11,7 @@ declare const __VLS_export: <Item extends RecordListItem>(__VLS_props: NonNullab
|
|
|
11
11
|
emptyText?: string;
|
|
12
12
|
emptyDescription?: string;
|
|
13
13
|
emptyIcon?: IconName;
|
|
14
|
-
emptyVariant?: "card" | "plain";
|
|
14
|
+
emptyVariant?: "card" | "plain" | "hint";
|
|
15
15
|
rowClickable?: (item: Item) => boolean;
|
|
16
16
|
} & {
|
|
17
17
|
onRowClick?: ((item: Item, event: MouseEvent) => any) | undefined;
|
|
@@ -223,6 +223,9 @@ declare const __VLS_export: <Item extends RecordListItem>(__VLS_props: NonNullab
|
|
|
223
223
|
leading?(props: {
|
|
224
224
|
item: Item;
|
|
225
225
|
}): unknown;
|
|
226
|
+
meta?(props: {
|
|
227
|
+
item: Item;
|
|
228
|
+
}): unknown;
|
|
226
229
|
action?(props: {
|
|
227
230
|
item: Item;
|
|
228
231
|
}): unknown;
|
|
@@ -35,14 +35,16 @@
|
|
|
35
35
|
:class="{
|
|
36
36
|
'is-moving': dragId === entry.node.id,
|
|
37
37
|
'is-highlighted': highlightedSet.has(entry.node.id),
|
|
38
|
-
'is-invalid': entry.node.invalid
|
|
38
|
+
'is-invalid': entry.node.invalid,
|
|
39
|
+
'is-muted': entry.node.muted,
|
|
40
|
+
'is-link': links.has(entry.node.id)
|
|
39
41
|
}"
|
|
40
42
|
:data-drop="dropState?.id === entry.node.id ? dropState.position : void 0"
|
|
41
43
|
:style="{
|
|
42
44
|
'--k-tree-level': entry.level - 1,
|
|
43
45
|
'--k-row-delay': rowDelay(index - revealAnchor - 1)
|
|
44
46
|
}"
|
|
45
|
-
@click="
|
|
47
|
+
@click="onRowClick($event, entry)"
|
|
46
48
|
@keydown="onKeydown($event, entry, index)"
|
|
47
49
|
@focus="focusId = entry.node.id"
|
|
48
50
|
@pointerenter="onRowEnter(entry)"
|
|
@@ -76,29 +78,47 @@
|
|
|
76
78
|
<Icon :name="entry.node.icon" />
|
|
77
79
|
</span>
|
|
78
80
|
<span v-if="entry.node.invalid" class="k-tree-invalid" aria-hidden="true" />
|
|
79
|
-
<span
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
:
|
|
84
|
-
|
|
81
|
+
<span class="k-tree-body">
|
|
82
|
+
<component
|
|
83
|
+
:is="links.get(entry.node.id)?.is ?? 'span'"
|
|
84
|
+
v-bind="links.get(entry.node.id)?.attrs"
|
|
85
|
+
:id="textId(entry.node.id)"
|
|
86
|
+
class="k-tree-text"
|
|
87
|
+
:class="{ 'k-tree-link': links.has(entry.node.id) }"
|
|
88
|
+
:tabindex="links.has(entry.node.id) ? -1 : void 0"
|
|
89
|
+
@focus="links.has(entry.node.id) && focusNode(entry.node.id)"
|
|
85
90
|
>
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
:
|
|
90
|
-
|
|
91
|
-
:class="`k-tree-description-${entry.node.descriptionVariant ?? descriptionVariant}`"
|
|
92
|
-
>{{ entry.node.description }}</span
|
|
91
|
+
<slot
|
|
92
|
+
name="label"
|
|
93
|
+
:node="entry.node"
|
|
94
|
+
:level="entry.level"
|
|
95
|
+
:invalid="Boolean(entry.node.invalid)"
|
|
93
96
|
>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
<span
|
|
98
|
+
:id="labelId(entry.node.id)"
|
|
99
|
+
class="k-tree-label"
|
|
100
|
+
:title="entry.node.label"
|
|
101
|
+
>{{ entry.node.label }}</span
|
|
102
|
+
>
|
|
103
|
+
<span
|
|
104
|
+
v-if="entry.node.description"
|
|
105
|
+
:id="descriptionId(entry.node.id)"
|
|
106
|
+
class="k-tree-description"
|
|
107
|
+
:class="`k-tree-description-${descriptionVariantOf(entry.node)}`"
|
|
108
|
+
:title="
|
|
109
|
+
descriptionVariantOf(entry.node) === 'mono' ? entry.node.description : void 0
|
|
110
|
+
"
|
|
111
|
+
>{{ entry.node.description }}</span
|
|
112
|
+
>
|
|
113
|
+
</slot>
|
|
114
|
+
</component>
|
|
115
|
+
<span
|
|
116
|
+
v-if="entry.node.meta || $slots.meta"
|
|
117
|
+
:id="metaId(entry.node.id)"
|
|
118
|
+
class="k-tree-meta"
|
|
119
|
+
>
|
|
120
|
+
<slot name="meta" :node="entry.node">{{ entry.node.meta }}</slot>
|
|
121
|
+
</span>
|
|
102
122
|
</span>
|
|
103
123
|
<span v-if="checkmark && selectable" class="k-tree-check" aria-hidden="true">
|
|
104
124
|
<Icon v-if="selected === entry.node.id" name="check" />
|
|
@@ -175,6 +195,7 @@ import LiveRegion from "../../internal/core/LiveRegion.vue";
|
|
|
175
195
|
import { useLiveMessage } from "../../internal/core/live";
|
|
176
196
|
import { hasFocusWithin, isFocusLost } from "../../internal/core/focus";
|
|
177
197
|
import { useTypeahead } from "../../internal/core/roving";
|
|
198
|
+
import { useLinkResolver } from "../../internal/core/link";
|
|
178
199
|
import { joinIds } from "../../internal/forms/control";
|
|
179
200
|
import Button from "../core/Button.vue";
|
|
180
201
|
import Icon from "../core/Icon.vue";
|
|
@@ -279,6 +300,9 @@ function describedBy(entry) {
|
|
|
279
300
|
canReorder.value && !entry.node.disabled ? hintId : void 0
|
|
280
301
|
);
|
|
281
302
|
}
|
|
303
|
+
function descriptionVariantOf(node) {
|
|
304
|
+
return node.descriptionVariant ?? props.descriptionVariant;
|
|
305
|
+
}
|
|
282
306
|
function isExpanded(id) {
|
|
283
307
|
return expandedSet.value.has(id);
|
|
284
308
|
}
|
|
@@ -317,6 +341,17 @@ const rovingId = computed(() => {
|
|
|
317
341
|
if (list.some((entry) => entry.node.id === focusId.value)) return focusId.value;
|
|
318
342
|
return list.find((entry) => entry.node.id === selected.value)?.node.id ?? list[0]?.node.id;
|
|
319
343
|
});
|
|
344
|
+
const { resolveLink } = useLinkResolver();
|
|
345
|
+
const links = computed(() => {
|
|
346
|
+
const map = /* @__PURE__ */ new Map();
|
|
347
|
+
if (control.disabled.value) return map;
|
|
348
|
+
for (const entry of visible.value) {
|
|
349
|
+
if (entry.node.disabled) continue;
|
|
350
|
+
const link = resolveLink(entry.node);
|
|
351
|
+
if (link) map.set(entry.node.id, link);
|
|
352
|
+
}
|
|
353
|
+
return map;
|
|
354
|
+
});
|
|
320
355
|
const hasInvalid = computed(() => visible.value.some((entry) => entry.node.invalid));
|
|
321
356
|
function hasMoveButtons(entry) {
|
|
322
357
|
return canReorder.value && props.moveButtons && !entry.node.disabled;
|
|
@@ -357,6 +392,28 @@ function activate(entry) {
|
|
|
357
392
|
if (props.selectable) selected.value = entry.node.id;
|
|
358
393
|
emit("select", entry.node);
|
|
359
394
|
}
|
|
395
|
+
function onRowClick(event, entry) {
|
|
396
|
+
const modified = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;
|
|
397
|
+
if (modified && links.value.has(entry.node.id)) return;
|
|
398
|
+
activate(entry);
|
|
399
|
+
}
|
|
400
|
+
function openLink(event, entry) {
|
|
401
|
+
if (!links.value.has(entry.node.id)) return false;
|
|
402
|
+
const element = tree.value?.querySelector(`#${CSS.escape(textId(entry.node.id))}`);
|
|
403
|
+
if (!element) return false;
|
|
404
|
+
element.dispatchEvent(
|
|
405
|
+
new MouseEvent("click", {
|
|
406
|
+
bubbles: true,
|
|
407
|
+
cancelable: true,
|
|
408
|
+
view: window,
|
|
409
|
+
ctrlKey: event.ctrlKey,
|
|
410
|
+
metaKey: event.metaKey,
|
|
411
|
+
shiftKey: event.shiftKey,
|
|
412
|
+
altKey: event.altKey
|
|
413
|
+
})
|
|
414
|
+
);
|
|
415
|
+
return true;
|
|
416
|
+
}
|
|
360
417
|
function focusNode(id) {
|
|
361
418
|
if (id === void 0 || id === null) return;
|
|
362
419
|
focusId.value = id;
|
|
@@ -508,9 +565,12 @@ function onKeydown(event, entry, position) {
|
|
|
508
565
|
else focusNode(entry.parentId);
|
|
509
566
|
break;
|
|
510
567
|
case "Enter":
|
|
568
|
+
if (openLink(event, entry)) break;
|
|
569
|
+
activate(entry);
|
|
570
|
+
toggle(entry, position);
|
|
571
|
+
break;
|
|
511
572
|
case " ":
|
|
512
573
|
activate(entry);
|
|
513
|
-
if (event.key === "Enter") toggle(entry, position);
|
|
514
574
|
break;
|
|
515
575
|
default:
|
|
516
576
|
return;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import type { IconName } from '../../composables/useIcons';
|
|
2
2
|
import type { TreeDescriptionVariant, TreeMove, TreeNode, TreeNodeId, TreeSize } from './types';
|
|
3
|
-
declare var
|
|
3
|
+
declare var __VLS_20: {
|
|
4
4
|
node: TreeNode;
|
|
5
5
|
level: number;
|
|
6
6
|
invalid: boolean;
|
|
7
|
-
},
|
|
7
|
+
}, __VLS_22: {
|
|
8
8
|
node: TreeNode;
|
|
9
|
-
},
|
|
9
|
+
}, __VLS_37: {
|
|
10
10
|
node: TreeNode;
|
|
11
11
|
level: number;
|
|
12
12
|
selected: boolean;
|
|
13
13
|
expanded: boolean;
|
|
14
14
|
highlighted: boolean;
|
|
15
15
|
hovered: boolean;
|
|
16
|
-
},
|
|
16
|
+
}, __VLS_39: {}, __VLS_48: {};
|
|
17
17
|
type __VLS_Slots = {} & {
|
|
18
|
-
label?: (props: typeof
|
|
18
|
+
label?: (props: typeof __VLS_20) => any;
|
|
19
19
|
} & {
|
|
20
|
-
meta?: (props: typeof
|
|
20
|
+
meta?: (props: typeof __VLS_22) => any;
|
|
21
21
|
} & {
|
|
22
|
-
actions?: (props: typeof
|
|
22
|
+
actions?: (props: typeof __VLS_37) => any;
|
|
23
23
|
} & {
|
|
24
|
-
empty?: (props: typeof
|
|
24
|
+
empty?: (props: typeof __VLS_39) => any;
|
|
25
25
|
} & {
|
|
26
|
-
'empty-actions'?: (props: typeof
|
|
26
|
+
'empty-actions'?: (props: typeof __VLS_48) => any;
|
|
27
27
|
};
|
|
28
28
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
29
29
|
nodes: TreeNode[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'vue';
|
|
2
|
-
import type { ColorValue, Tone } from '../core/types';
|
|
2
|
+
import type { ColorValue, LinkTarget, Tone } from '../core/types';
|
|
3
3
|
import type { IconName } from '../../composables/useIcons';
|
|
4
4
|
import type { MenuItems } from '../overlays/types';
|
|
5
5
|
export type BadgeVariant = 'soft' | 'solid' | 'outline';
|
|
@@ -84,6 +84,10 @@ export interface TreeNode {
|
|
|
84
84
|
icon?: string;
|
|
85
85
|
disabled?: boolean;
|
|
86
86
|
invalid?: boolean;
|
|
87
|
+
muted?: boolean;
|
|
88
|
+
to?: LinkTarget;
|
|
89
|
+
href?: string;
|
|
90
|
+
target?: string;
|
|
87
91
|
children?: TreeNode[];
|
|
88
92
|
}
|
|
89
93
|
export type TreeDescriptionVariant = 'text' | 'mono';
|
|
@@ -159,4 +163,9 @@ export interface RecordListItem {
|
|
|
159
163
|
label: string;
|
|
160
164
|
tone?: Tone;
|
|
161
165
|
};
|
|
166
|
+
icon?: IconName;
|
|
167
|
+
meta?: string;
|
|
168
|
+
to?: LinkTarget;
|
|
169
|
+
href?: string;
|
|
170
|
+
target?: string;
|
|
162
171
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
class="k-accordion"
|
|
4
|
-
:class="[
|
|
4
|
+
:class="[
|
|
5
|
+
`k-accordion-${variant}`,
|
|
6
|
+
{ 'is-neutral': contentVariant === 'neutral', 'is-flush': !padded }
|
|
7
|
+
]"
|
|
5
8
|
>
|
|
6
9
|
<div
|
|
7
10
|
v-for="(item, index) in items"
|
|
@@ -66,7 +69,8 @@ const props = defineProps({
|
|
|
66
69
|
collapsible: { type: Boolean, required: false, default: true },
|
|
67
70
|
level: { type: Number, required: false, default: 3 },
|
|
68
71
|
variant: { type: String, required: false, default: "card" },
|
|
69
|
-
contentVariant: { type: String, required: false, default: "text" }
|
|
72
|
+
contentVariant: { type: String, required: false, default: "text" },
|
|
73
|
+
padded: { type: Boolean, required: false, default: true }
|
|
70
74
|
});
|
|
71
75
|
const model = defineModel({ type: [String, Number, Array, null], ...{ default: null } });
|
|
72
76
|
const baseId = useId();
|
|
@@ -20,6 +20,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
20
20
|
level?: HeadingLevel;
|
|
21
21
|
variant?: AccordionVariant;
|
|
22
22
|
contentVariant?: AccordionContentVariant;
|
|
23
|
+
padded?: boolean;
|
|
23
24
|
modelValue?: Value | Value[] | null;
|
|
24
25
|
key?: PropertyKey | undefined;
|
|
25
26
|
prefix?: string | undefined | undefined;
|
|
@@ -222,6 +223,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
222
223
|
level?: HeadingLevel;
|
|
223
224
|
variant?: AccordionVariant;
|
|
224
225
|
contentVariant?: AccordionContentVariant;
|
|
226
|
+
padded?: boolean;
|
|
225
227
|
modelValue?: Value | Value[] | null;
|
|
226
228
|
key?: PropertyKey | undefined;
|
|
227
229
|
prefix?: string | undefined | undefined;
|
|
@@ -422,6 +424,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
422
424
|
level: HeadingLevel;
|
|
423
425
|
collapsible: boolean;
|
|
424
426
|
contentVariant: AccordionContentVariant;
|
|
427
|
+
padded: boolean;
|
|
425
428
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
426
429
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
427
430
|
declare const _default: typeof __VLS_export;
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
:popover="layer.popoverMode.value"
|
|
10
10
|
:data-side="layer.side.value"
|
|
11
11
|
class="k-floating k-popover"
|
|
12
|
-
:class="{ 'has-arrow': arrow }"
|
|
12
|
+
:class="{ 'has-arrow': arrow, 'has-width': width }"
|
|
13
|
+
:style="width ? { '--k-popover-custom-width': width } : void 0"
|
|
13
14
|
:role="role"
|
|
14
15
|
:aria-label="label"
|
|
15
16
|
:aria-labelledby="fallbackLabelledBy"
|
|
@@ -36,7 +37,8 @@ const props = defineProps({
|
|
|
36
37
|
label: { type: String, required: false },
|
|
37
38
|
initialFocus: { type: Boolean, required: false, default: true },
|
|
38
39
|
haspopup: { type: String, required: false, default: "dialog" },
|
|
39
|
-
anchor: { type: null, required: false, default: null }
|
|
40
|
+
anchor: { type: null, required: false, default: null },
|
|
41
|
+
width: { type: String, required: false }
|
|
40
42
|
});
|
|
41
43
|
const open = defineModel("open", { type: Boolean, ...{ default: false } });
|
|
42
44
|
const contentId = `${useId()}-popover`;
|
|
@@ -19,6 +19,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
19
19
|
initialFocus?: boolean;
|
|
20
20
|
haspopup?: string;
|
|
21
21
|
anchor?: OverlayAnchorTarget | null;
|
|
22
|
+
width?: string;
|
|
22
23
|
open?: boolean;
|
|
23
24
|
key?: PropertyKey | undefined;
|
|
24
25
|
prefix?: string | undefined | undefined;
|
|
@@ -226,6 +227,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
226
227
|
initialFocus?: boolean;
|
|
227
228
|
haspopup?: string;
|
|
228
229
|
anchor?: OverlayAnchorTarget | null;
|
|
230
|
+
width?: string;
|
|
229
231
|
open?: boolean;
|
|
230
232
|
key?: PropertyKey | undefined;
|
|
231
233
|
prefix?: string | undefined | undefined;
|
|
@@ -4,6 +4,8 @@ import { useLiveMessage } from "../internal/core/live.mjs";
|
|
|
4
4
|
import { isClient } from "../internal/core/env.mjs";
|
|
5
5
|
import {
|
|
6
6
|
SORTABLE_ATTR,
|
|
7
|
+
SORTABLE_DRAGGING_ATTR,
|
|
8
|
+
SORTABLE_LIFTED_ATTR,
|
|
7
9
|
gridNeighbor,
|
|
8
10
|
gridSlot,
|
|
9
11
|
insertionIndex,
|
|
@@ -164,6 +166,7 @@ export function useSortable(container, options) {
|
|
|
164
166
|
return;
|
|
165
167
|
drag.active = true;
|
|
166
168
|
dragging.value = drag.index;
|
|
169
|
+
lift(drag, true);
|
|
167
170
|
window.getSelection()?.removeAllRanges();
|
|
168
171
|
}
|
|
169
172
|
event.preventDefault();
|
|
@@ -185,12 +188,22 @@ export function useSortable(container, options) {
|
|
|
185
188
|
const others = elements.filter((element) => element !== drag.element);
|
|
186
189
|
return insertionIndex(others, event.clientX, event.clientY, axis(), isRtl(root));
|
|
187
190
|
}
|
|
191
|
+
function lift(state, lifted) {
|
|
192
|
+
if (lifted) {
|
|
193
|
+
state.element.setAttribute(SORTABLE_DRAGGING_ATTR, "");
|
|
194
|
+
state.preview.setAttribute(SORTABLE_LIFTED_ATTR, axis());
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
state.element.removeAttribute(SORTABLE_DRAGGING_ATTR);
|
|
198
|
+
state.preview.removeAttribute(SORTABLE_LIFTED_ATTR);
|
|
199
|
+
}
|
|
188
200
|
function finish(cancelled) {
|
|
189
201
|
const state = drag;
|
|
190
202
|
drag = null;
|
|
191
203
|
listen(false);
|
|
192
204
|
if (!state) return;
|
|
193
205
|
state.preview.style.translate = "";
|
|
206
|
+
lift(state, false);
|
|
194
207
|
dragging.value = null;
|
|
195
208
|
if (!state.active) return;
|
|
196
209
|
window.addEventListener("click", suppressClick, { capture: true, once: true });
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type SortableAxis = 'horizontal' | 'vertical' | 'grid';
|
|
2
2
|
export declare const SORTABLE_ATTR = "data-k-sortable";
|
|
3
|
+
export declare const SORTABLE_DRAGGING_ATTR = "data-k-sortable-dragging";
|
|
4
|
+
export declare const SORTABLE_LIFTED_ATTR = "data-k-sortable-lifted";
|
|
3
5
|
export declare function sortableElements(container: HTMLElement | null | undefined): HTMLElement[];
|
|
4
6
|
export declare function isRtl(element: Element | null | undefined): boolean;
|
|
5
7
|
export declare function insertionIndex(elements: HTMLElement[], x: number, y: number, axis: SortableAxis, rtl: boolean): number;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export const SORTABLE_ATTR = "data-k-sortable";
|
|
2
|
+
export const SORTABLE_DRAGGING_ATTR = "data-k-sortable-dragging";
|
|
3
|
+
export const SORTABLE_LIFTED_ATTR = "data-k-sortable-lifted";
|
|
2
4
|
export function sortableElements(container) {
|
|
3
5
|
if (!container) return [];
|
|
4
6
|
return Array.from(container.querySelectorAll(`[${SORTABLE_ATTR}]`)).sort(
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.k-record-list-item {
|
|
10
|
+
position: relative;
|
|
10
11
|
display: flex;
|
|
11
12
|
align-items: center;
|
|
12
13
|
gap: 0.75rem;
|
|
@@ -48,6 +49,34 @@
|
|
|
48
49
|
white-space: nowrap;
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
.k-record-list-icon {
|
|
53
|
+
--k-icon-size: 1rem;
|
|
54
|
+
display: grid;
|
|
55
|
+
place-items: center;
|
|
56
|
+
width: 2rem;
|
|
57
|
+
height: 2rem;
|
|
58
|
+
flex: none;
|
|
59
|
+
border-radius: var(--k-radius-md);
|
|
60
|
+
background: var(--k-subtle);
|
|
61
|
+
box-shadow: inset 0 0 0 1px var(--k-line);
|
|
62
|
+
color: var(--k-text-muted);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.k-record-list-meta {
|
|
66
|
+
flex: 0 1 auto;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
max-width: 40%;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
font-size: 0.75rem;
|
|
71
|
+
color: var(--k-text-muted);
|
|
72
|
+
text-overflow: ellipsis;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.k-record-list-meta:empty {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
51
80
|
.k-record-list-description {
|
|
52
81
|
font-size: 0.8125rem;
|
|
53
82
|
color: var(--k-text-muted);
|
|
@@ -99,6 +128,24 @@
|
|
|
99
128
|
border: 0;
|
|
100
129
|
}
|
|
101
130
|
|
|
131
|
+
.k-record-list-link {
|
|
132
|
+
text-decoration: none;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.k-record-list-link::after {
|
|
136
|
+
content: '';
|
|
137
|
+
position: absolute;
|
|
138
|
+
inset: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.k-record-list-item.is-link
|
|
142
|
+
:is(a[href], button, input, select, textarea, label, summary, [tabindex]):not(
|
|
143
|
+
.k-record-list-link
|
|
144
|
+
) {
|
|
145
|
+
position: relative;
|
|
146
|
+
z-index: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
102
149
|
.k-record-list-trigger:focus-visible {
|
|
103
150
|
outline: 2px solid transparent;
|
|
104
151
|
}
|
|
@@ -107,3 +154,10 @@
|
|
|
107
154
|
outline: 2px solid var(--k-ring);
|
|
108
155
|
outline-offset: -2px;
|
|
109
156
|
}
|
|
157
|
+
|
|
158
|
+
.k-record-list-hint {
|
|
159
|
+
margin: 0;
|
|
160
|
+
font-size: 0.8125rem;
|
|
161
|
+
line-height: 1.4;
|
|
162
|
+
color: var(--k-text-muted);
|
|
163
|
+
}
|
|
@@ -84,9 +84,18 @@
|
|
|
84
84
|
color: var(--k-accent-text);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
.k-tree-
|
|
87
|
+
.k-tree-body {
|
|
88
88
|
display: flex;
|
|
89
89
|
flex: 1;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 0.125rem 0.625rem;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.k-tree-text {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex: 1 1 8rem;
|
|
90
99
|
flex-direction: column;
|
|
91
100
|
min-width: 0;
|
|
92
101
|
}
|
|
@@ -101,19 +110,51 @@
|
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
.k-tree-description {
|
|
104
|
-
overflow-wrap:
|
|
113
|
+
overflow-wrap: break-word;
|
|
105
114
|
font-size: 0.75rem;
|
|
106
115
|
color: var(--k-text-muted);
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
.k-tree-description-mono {
|
|
119
|
+
overflow-x: clip;
|
|
110
120
|
font-family: var(--k-font-mono);
|
|
121
|
+
text-overflow: ellipsis;
|
|
122
|
+
white-space: nowrap;
|
|
111
123
|
}
|
|
112
124
|
|
|
113
125
|
.k-tree-description-text {
|
|
114
126
|
color: var(--k-text-muted);
|
|
115
127
|
}
|
|
116
128
|
|
|
129
|
+
.k-tree-link {
|
|
130
|
+
color: inherit;
|
|
131
|
+
text-decoration: none;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.k-tree-link::after {
|
|
135
|
+
content: '';
|
|
136
|
+
position: absolute;
|
|
137
|
+
inset: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.k-tree-row.is-link {
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.k-tree-row.is-link > :is(.k-tree-handle, .k-tree-toggle:not(:empty)) {
|
|
145
|
+
position: relative;
|
|
146
|
+
z-index: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.k-tree-row.is-muted:where(:not([aria-selected='true'])) .k-tree-text,
|
|
150
|
+
.k-tree-row.is-muted:where(:not([aria-selected='true'])) :is(.k-tree-label, .k-tree-description) {
|
|
151
|
+
color: var(--k-text-muted);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.k-tree-row.is-muted:where(:not([aria-selected='true'])) .k-tree-icon {
|
|
155
|
+
color: var(--k-text-dimmed);
|
|
156
|
+
}
|
|
157
|
+
|
|
117
158
|
.k-tree-invalid {
|
|
118
159
|
width: 0.4375rem;
|
|
119
160
|
height: 0.4375rem;
|
|
@@ -122,13 +163,16 @@
|
|
|
122
163
|
background: var(--k-danger);
|
|
123
164
|
}
|
|
124
165
|
|
|
125
|
-
.k-tree .k-tree-row.is-invalid
|
|
166
|
+
.k-tree .k-tree-row.is-invalid .k-tree-text,
|
|
126
167
|
.k-tree .k-tree-row.is-invalid .k-tree-label {
|
|
127
168
|
color: var(--k-danger-text);
|
|
128
169
|
}
|
|
129
170
|
|
|
130
171
|
.k-tree-meta {
|
|
131
|
-
flex
|
|
172
|
+
flex: 0 1 auto;
|
|
173
|
+
min-width: 0;
|
|
174
|
+
max-width: 100%;
|
|
175
|
+
overflow-wrap: break-word;
|
|
132
176
|
font-size: 0.75rem;
|
|
133
177
|
color: var(--k-text-muted);
|
|
134
178
|
}
|
|
@@ -265,6 +309,14 @@
|
|
|
265
309
|
opacity: 0.4;
|
|
266
310
|
}
|
|
267
311
|
|
|
312
|
+
.k-tree-sm .k-tree-body {
|
|
313
|
+
column-gap: 0.375rem;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.k-tree-sm .k-tree-text {
|
|
317
|
+
flex-basis: 6rem;
|
|
318
|
+
}
|
|
319
|
+
|
|
268
320
|
.k-tree-sm .k-tree-toggle {
|
|
269
321
|
width: 1rem;
|
|
270
322
|
height: 1rem;
|
|
@@ -294,6 +346,7 @@
|
|
|
294
346
|
|
|
295
347
|
.k-tree-actions {
|
|
296
348
|
position: absolute;
|
|
349
|
+
z-index: 1;
|
|
297
350
|
top: 50%;
|
|
298
351
|
right: 0.375rem;
|
|
299
352
|
display: flex;
|
|
@@ -156,16 +156,15 @@
|
|
|
156
156
|
padding-inline: 0.25rem;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
.k-accordion.is-neutral .k-accordion-panel {
|
|
160
|
-
margin-inline: -0.25rem;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
159
|
.k-accordion.is-neutral .k-accordion-content {
|
|
164
|
-
padding: 0 0.25rem 0.25rem;
|
|
165
160
|
font-size: inherit;
|
|
166
161
|
color: inherit;
|
|
167
162
|
}
|
|
168
163
|
|
|
164
|
+
.k-accordion.is-flush .k-accordion-content {
|
|
165
|
+
padding: 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
169
168
|
.k-accordion-item.is-open .k-accordion-content {
|
|
170
169
|
opacity: 1;
|
|
171
170
|
transform: none;
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
.k-card-dashed .k-card-icon + .k-card-heading {
|
|
52
|
+
flex-basis: auto;
|
|
52
53
|
min-height: 0;
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -121,6 +122,7 @@
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
.k-card-icon + .k-card-heading {
|
|
125
|
+
flex-basis: min(8rem, 100% - 2.75rem);
|
|
124
126
|
justify-content: center;
|
|
125
127
|
min-height: 2rem;
|
|
126
128
|
}
|
package/dist/styles/shared.css
CHANGED
|
@@ -165,3 +165,12 @@
|
|
|
165
165
|
height: max(100%, 1.5rem);
|
|
166
166
|
translate: -50% -50%;
|
|
167
167
|
}
|
|
168
|
+
|
|
169
|
+
:where(.k-root [data-k-sortable-dragging]) {
|
|
170
|
+
position: relative;
|
|
171
|
+
z-index: 1;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:where(.k-root [data-k-sortable-lifted='vertical']) {
|
|
175
|
+
box-shadow: var(--k-shadow-raised), var(--k-shadow-sm);
|
|
176
|
+
}
|
package/package.json
CHANGED