@xleddyl/443-components-vue 0.16.68 → 0.16.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CATALOG.md CHANGED
@@ -209,23 +209,23 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
209
209
 
210
210
  ## Data
211
211
 
212
- | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
213
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
214
- | `Table` | Small to medium table with sort, selection, links and loading rows. For thousands of rows or editing use `DataGrid`. | Models: `v-model:sort` (`{ key, direction }`), `v-model:selected` (row keys). Props: `rows`, `columns` (`key`, `label`, `align`, `width`, `numeric`, `sortable`, `value`, `format`), `rowKey`, `selectable`, `rowTo`, `loading`, `emptyText`, `density`, `stickyHeader`, `maxHeight`, `bordered`, `caption`. Slots: `cell-<key>`, `header-<key>`, `empty`. Event: `rowClick`. | `data/table.vue` |
215
- | `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` |
216
- | `SelectionBar` | Shows the selected count and bulk actions for a list or table. | Props: `count`, `total`, `placement` (inline, sticky, floating), `onSelectAll`, `onClear`. Slots: `actions`, `count`. With `count` 0 it renders nothing visible. | `data/selection-bar.vue` |
217
- | `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` |
218
- | `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` |
219
- | `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` |
220
- | `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` |
221
- | `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` |
222
- | `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` |
223
- | `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
224
- | `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` |
225
- | `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), clicks on buttons, links and inputs inside the row are ignored. Slots: `leading`, `action` (`{ item }`), `empty`, `empty-actions` (buttons in the default empty state). | `data/record-list.vue` |
226
- | `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` |
227
- | `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
228
- | `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`), `selectable`, `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`, `meta`, `empty`, `empty-actions` (buttons in the default empty state). Events: `select`, `move`. | `data/tree.vue` |
212
+ | Component | Purpose and when to use it | Main props, models, slots, events | Playground |
213
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
214
+ | `Table` | Small to medium table with sort, selection, links and loading rows. For thousands of rows or editing use `DataGrid`. | Models: `v-model:sort` (`{ key, direction }`), `v-model:selected` (row keys). Props: `rows`, `columns` (`key`, `label`, `align`, `width`, `numeric`, `sortable`, `value`, `format`), `rowKey`, `selectable`, `rowTo`, `loading`, `emptyText`, `density`, `stickyHeader`, `maxHeight`, `bordered`, `caption`. Slots: `cell-<key>`, `header-<key>`, `empty`. Event: `rowClick`. | `data/table.vue` |
215
+ | `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` |
216
+ | `SelectionBar` | Shows the selected count and bulk actions for a list or table. | Props: `count`, `total`, `placement` (inline, sticky, floating), `onSelectAll`, `onClear`. Slots: `actions`, `count`. With `count` 0 it renders nothing visible. | `data/selection-bar.vue` |
217
+ | `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` |
218
+ | `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` |
219
+ | `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` |
220
+ | `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` |
221
+ | `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` |
222
+ | `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` |
223
+ | `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
224
+ | `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` |
225
+ | `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), clicks on buttons, links and inputs inside the row are ignored; `rowClickable(item)` keeps some rows static in the same list. Slots: `leading`, `action` (`{ item }`), `empty`, `empty-actions` (buttons in the default empty state). | `data/record-list.vue` |
226
+ | `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` |
227
+ | `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
228
+ | `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`), `selectable`, `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`, `meta`, `empty`, `empty-actions` (buttons in the default empty state). Events: `select`, `move`. | `data/tree.vue` |
229
229
 
230
230
  ## Layout
231
231
 
package/README.md CHANGED
@@ -470,7 +470,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
470
470
  - `Combobox` with `creatable` takes `createTransform` (`ComboboxCreateTransform`, `(input) => string | null | undefined`) and `createValidate` (`ComboboxCreateValidate`, `(input) => string | true | undefined`). The transform runs on the typed text first: the "Create" option shows its result, and an empty result (or `null`) shows no create option. The validator gets the transformed text when the user picks the create option: a returned string is the error, shown inline through the surrounding `FormField` (`useFieldControl().setControlError`, or a `FieldMessage` under the control and an announcement without a field) with `aria-invalid` on the input, and nothing is created; `true` or nothing accepts it. The error clears when the query changes. Both work with `multiple`, where created values become tags: `<KCombobox v-model="tags" multiple creatable :create-transform="(input) => input.toLowerCase()" :create-validate="(input) => input.length >= 3 || 'Too short'" />`.
471
471
  - `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 }]" />`.
472
472
  - `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.
473
- - `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); a click on a button, link or input inside the row does not emit it, so keep a button in `#action` for the keyboard.
473
+ - `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); a click on a button, link or input inside the row does not emit it, so keep a button in `#action` for the keyboard. `rowClickable(item)` returns `false` for the rows that open nothing: they keep the same padding, without hover and pointer.
474
474
  - `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.
475
475
  - 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.
476
476
  - `FilterPills` can list active filters: options with `removable: true` render as active pills with a remove button (`removeLabel`, a `'Remove {label}'` template). Clicking the pill emits `select(value)`, the button emits `remove(value)` (and drops the value from the model when it is selected); focus moves to the next pill when the removed one disappears.
@@ -11,6 +11,7 @@
11
11
  v-for="item in items"
12
12
  :key="item.id"
13
13
  class="k-record-list-item"
14
+ :class="{ 'is-interactive': clickable(item) }"
14
15
  @click="onRowClick(item, $event)"
15
16
  >
16
17
  <slot name="leading" :item="item" />
@@ -52,7 +53,7 @@ import { useLocale } from "../../composables/useLocale";
52
53
  import EmptyState from "../feedback/EmptyState.vue";
53
54
  import SkeletonList from "../feedback/SkeletonList.vue";
54
55
  import Badge from "./Badge.vue";
55
- defineProps({
56
+ const props = defineProps({
56
57
  items: { type: Array, required: true },
57
58
  loading: { type: Boolean, required: false },
58
59
  avatar: { type: Boolean, required: false },
@@ -62,7 +63,8 @@ defineProps({
62
63
  emptyText: { type: String, required: false },
63
64
  emptyDescription: { type: String, required: false },
64
65
  emptyIcon: { type: null, required: false },
65
- emptyVariant: { type: String, required: false, default: "card" }
66
+ emptyVariant: { type: String, required: false, default: "card" },
67
+ rowClickable: { type: Function, required: false }
66
68
  });
67
69
  defineSlots();
68
70
  const emit = defineEmits(["rowClick"]);
@@ -72,8 +74,11 @@ const interactiveSelector = 'a, button, input, select, textarea, label, summary,
72
74
  const hasRowClick = computed(
73
75
  () => Boolean(instance?.vnode.props?.onRowClick || instance?.vnode.props?.["onRow-click"])
74
76
  );
77
+ function clickable(item) {
78
+ return hasRowClick.value && (props.rowClickable?.(item) ?? true);
79
+ }
75
80
  function onRowClick(item, event) {
76
- if (!hasRowClick.value) return;
81
+ if (!clickable(item)) return;
77
82
  const row = event.currentTarget;
78
83
  const origin = event.target?.closest(interactiveSelector);
79
84
  if (origin && row.contains(origin)) return;
@@ -12,6 +12,7 @@ declare const __VLS_export: <Item extends RecordListItem>(__VLS_props: NonNullab
12
12
  emptyDescription?: string;
13
13
  emptyIcon?: IconName;
14
14
  emptyVariant?: "card" | "plain";
15
+ rowClickable?: (item: Item) => boolean;
15
16
  } & {
16
17
  onRowClick?: ((item: Item, event: MouseEvent) => any) | undefined;
17
18
  } & Partial<{
@@ -131,7 +131,7 @@
131
131
  </div>
132
132
  <template v-for="tabs in [tabsContent(active, close)]" :key="active.id">
133
133
  <div v-if="tabs.length" class="k-settings-modal-tabs">
134
- <component :is="() => tabs" />
134
+ <RenderNodes :nodes="tabs" />
135
135
  </div>
136
136
  </template>
137
137
  </header>
@@ -332,6 +332,7 @@ function hasContent(node) {
332
332
  }
333
333
  return true;
334
334
  }
335
+ const RenderNodes = (props2) => props2.nodes;
335
336
  function tabsContent(item, close) {
336
337
  const nodes = slots[`tabs-${item.id}`]?.(slotProps(item, close));
337
338
  return (nodes ?? []).some(hasContent) ? nodes : [];
@@ -63,14 +63,17 @@
63
63
  padding: 0.75rem;
64
64
  border-top: 0;
65
65
  border-radius: var(--k-radius-md);
66
+ }
67
+
68
+ .k-record-list-item.is-interactive {
66
69
  cursor: pointer;
67
70
  transition: background-color var(--k-duration) var(--k-ease);
68
71
  }
69
72
 
70
- .k-record-list.is-interactive .k-record-list-item:hover {
73
+ .k-record-list-item.is-interactive:hover {
71
74
  background: var(--k-hover);
72
75
  }
73
76
 
74
- .k-record-list.is-interactive .k-record-list-item:active {
77
+ .k-record-list-item.is-interactive:active {
75
78
  background: var(--k-press);
76
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xleddyl/443-components-vue",
3
- "version": "0.16.68",
3
+ "version": "0.16.70",
4
4
  "description": "Compact, scoped dashboard components for Vue and Nuxt",
5
5
  "license": "MIT",
6
6
  "author": "Edoardo Alberti (https://github.com/xleddyl)",