@xleddyl/443-components-vue 0.16.61 → 0.16.62
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 +35 -35
- package/README.md +6 -4
- package/dist/components/data/RecordList.vue +1 -1
- package/dist/components/data/Tree.vue +26 -4
- package/dist/components/data/Tree.vue.d.ts +11 -1
- package/dist/components/forms/Combobox.vue +5 -1
- package/dist/components/forms/NumberInput.vue +2 -2
- package/dist/components/layout/Tabs.vue +12 -2
- package/dist/components/layout/types.d.ts +3 -1
- package/dist/grid/cells/ButtonCell.vue +18 -1
- package/dist/grid/cells/ButtonCell.vue.d.ts +62 -24
- package/dist/grid/data-grid.css +4 -0
- package/dist/grid/types.d.ts +5 -1
- package/dist/styles/core/input.css +2 -2
- package/dist/styles/data/tree.css +11 -7
- package/dist/styles/forms/combobox.css +1 -0
- package/dist/styles/forms/number-input.css +4 -0
- package/dist/styles/layout/tabs.css +11 -3
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -141,21 +141,21 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
141
141
|
|
|
142
142
|
## Core
|
|
143
143
|
|
|
144
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
145
|
-
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
-
| `Root` | App root. Scopes all styles under `.k-root` and sets theme, preset and tokens. Mount once. Add `is-canvas` for the page background. | Props: `theme` (system, light, dark), `preset`, `accent`, `accentContrast`, `fontSans`, `fontMono`, `fontDisplay`, `radiusScale`, `as`. Slot: default.
|
|
147
|
-
| `Button` | Every button and button-like link. Use `CopyButton` to copy text, `DropdownMenu` for a menu. | Props: `label`, `variant` (solid, soft, subtle, outline, ghost, link), `tone`, `size`, `icon`, `trailingIcon`, `to`, `href`, `target`, `external`, `type`, `disabled`, `loading`, `block`, `square` (icon only). Slot: default. A `to` or `href` makes it a link.
|
|
148
|
-
| `Icon` | Show an icon by name. | Props: `name` (required), `label` (makes it non decorative), `size`.
|
|
149
|
-
| `Spinner` | Loading indicator. Use `block` for a centered loading state that fills its container. | Props: `size` (xs to lg), `label`, `decorative`, `block`.
|
|
150
|
-
| `Input` | Single line text field. Use `NumberInput` for numbers, `PasswordInput` for passwords. | Model: `v-model` (string, number or null; modifiers `.number`, `.trim`). Props: `type`, `size`, `icon`, `clearable`, `counter` (needs `maxlength`), `transform`, `numeric
|
|
151
|
-
| `Textarea` | Multi line text field. | Model: `v-model`. Props: `rows`, `maxRows`, `autoresize`, `counter`, `size`, `invalid`, `disabled`, `readonly`, `required`. Slot: `trailing`.
|
|
152
|
-
| `FormField` | Label, description, hint, error and required marker around one control. It links ids and ARIA for the control inside. | Props: `label`, `name` (reads error and warning from the surrounding `Form`), `description`, `hint`, `error`, `warning`, `required`, `optional`, `disabled`, `icon`. Slots: default, `label`, `label-actions`, `description`, `hint`.
|
|
153
|
-
| `FieldMessage` | One error, warning or hint line outside a `FormField`. | Props: `message`, `tone` (danger, warning, neutral), `icon`. Slot: default.
|
|
154
|
-
| `FieldBoundary` | Cut the field context for controls inside a `FormField` that are not the main control (a search box above a `Tree`). | Prop: `auxiliary` (keeps own id, follows only `disabled`). Without it the context is fully cut.
|
|
155
|
-
| `Form` | Connects a `useForm` result to a `<form>`. Provides errors to `FormField`, handles submit, reset, focus on first error. | Props: `form` (required), `as` (form or div; use `div` for a form nested in a modal), `focusOnError`, `alerts` (start, end, false). Slot: default, `alerts`. Events: `submitted`, `invalid`, `reset`.
|
|
156
|
-
| `FormAlerts` | Render root errors and warnings as alerts. `Form` already does it. Use it only for a custom placement. | Props: `errors`, `warnings`.
|
|
157
|
-
| `Kbd` | Show a keyboard key or shortcut. | Props: `value` (for example `mod+k`, shown per platform), `size`. Slot: default.
|
|
158
|
-
| `VisuallyHidden` | Text for screen readers only. | Props: `as`, `focusable`.
|
|
144
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
145
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
|
146
|
+
| `Root` | App root. Scopes all styles under `.k-root` and sets theme, preset and tokens. Mount once. Add `is-canvas` for the page background. | Props: `theme` (system, light, dark), `preset`, `accent`, `accentContrast`, `fontSans`, `fontMono`, `fontDisplay`, `radiusScale`, `as`. Slot: default. | `core/root.vue` |
|
|
147
|
+
| `Button` | Every button and button-like link. Use `CopyButton` to copy text, `DropdownMenu` for a menu. | Props: `label`, `variant` (solid, soft, subtle, outline, ghost, link), `tone`, `size`, `icon`, `trailingIcon`, `to`, `href`, `target`, `external`, `type`, `disabled`, `loading`, `block`, `square` (icon only). Slot: default. A `to` or `href` makes it a link. | `core/button.vue` |
|
|
148
|
+
| `Icon` | Show an icon by name. | Props: `name` (required), `label` (makes it non decorative), `size`. | `core/icon.vue` |
|
|
149
|
+
| `Spinner` | Loading indicator. Use `block` for a centered loading state that fills its container. | Props: `size` (xs to lg), `label`, `decorative`, `block`. | `core/spinner.vue` |
|
|
150
|
+
| `Input` | Single line text field. Use `NumberInput` for numbers, `PasswordInput` for passwords. | Model: `v-model` (string, number or null; modifiers `.number`, `.trim`). Props: `type`, `size`, `icon`, `clearable`, `counter` (needs `maxlength`), `transform`, `numeric` (decimal keyboard, number model, tabular digits, left aligned), `invalid`, `disabled`, `readonly`, `required`, `noAutofill`. Slots: `leading`, `trailing`. Event: `clear`. | `core/input.vue` |
|
|
151
|
+
| `Textarea` | Multi line text field. | Model: `v-model`. Props: `rows`, `maxRows`, `autoresize`, `counter`, `size`, `invalid`, `disabled`, `readonly`, `required`. Slot: `trailing`. | `core/textarea.vue` |
|
|
152
|
+
| `FormField` | Label, description, hint, error and required marker around one control. It links ids and ARIA for the control inside. | Props: `label`, `name` (reads error and warning from the surrounding `Form`), `description`, `hint`, `error`, `warning`, `required`, `optional`, `disabled`, `icon`. Slots: default, `label`, `label-actions`, `description`, `hint`. | `core/form-field.vue` |
|
|
153
|
+
| `FieldMessage` | One error, warning or hint line outside a `FormField`. | Props: `message`, `tone` (danger, warning, neutral), `icon`. Slot: default. | `core/field-message.vue` |
|
|
154
|
+
| `FieldBoundary` | Cut the field context for controls inside a `FormField` that are not the main control (a search box above a `Tree`). | Prop: `auxiliary` (keeps own id, follows only `disabled`). Without it the context is fully cut. | `core/form-field.vue` |
|
|
155
|
+
| `Form` | Connects a `useForm` result to a `<form>`. Provides errors to `FormField`, handles submit, reset, focus on first error. | Props: `form` (required), `as` (form or div; use `div` for a form nested in a modal), `focusOnError`, `alerts` (start, end, false). Slot: default, `alerts`. Events: `submitted`, `invalid`, `reset`. | `core/form.vue` |
|
|
156
|
+
| `FormAlerts` | Render root errors and warnings as alerts. `Form` already does it. Use it only for a custom placement. | Props: `errors`, `warnings`. | `core/form.vue` |
|
|
157
|
+
| `Kbd` | Show a keyboard key or shortcut. | Props: `value` (for example `mod+k`, shown per platform), `size`. Slot: default. | `core/kbd.vue` |
|
|
158
|
+
| `VisuallyHidden` | Text for screen readers only. | Props: `as`, `focusable`. | `core/visually-hidden.vue` |
|
|
159
159
|
|
|
160
160
|
## Forms
|
|
161
161
|
|
|
@@ -172,7 +172,7 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
|
|
|
172
172
|
| `Combobox` | Searchable select. Local filter, async `search`, `multiple` with tags, `creatable`. | Models: `v-model`, `v-model:query`. Props: `options` (`label`, `value`, `description`, `icon`, `color` (dot and tag color), `group` (divider with the group name, also the tooltip of a selected tag), `keywords`), `search(query, signal)`, `filter`, `multiple`, `hideTags`, `creatable`, `createActions`, `createTransform`, `createValidate` (a returned string is the inline error), `debounce`, `minQueryLength`, `maxSelected`, `clearable`, `loading`, `placeholder`, `emptyText`. Slots: `option`, `empty`, `header` (top of the panel, for example quick filter pills). Events: `create`, `open`, `close`. | `forms/combobox.vue` |
|
|
173
173
|
| `TreeSelect` | Pick one node of a hierarchy (category, folder) with a drill-down panel, one level at a time. | Model: `TreeNodeId or null`. Props: `nodes` (`TreeNode`: `id`, `label`, `description`, `icon`, `disabled`, `children`), `leavesOnly` (parents only navigate), `separator` (path in the control and in search results, default `' / '`), `clearable`, `placeholder`, `searchPlaceholder`, `emptyText`, `icon`. Search lists every match with its path. Slots: `node` (`node`, `selected`, `path`), `empty`. Events: `open`, `close`. | `forms/tree-select.vue` |
|
|
174
174
|
| `Switch` | On or off setting that applies at once. | Model: boolean. Props: `label`, `description`, `labelPosition`, `checkedIcon`, `uncheckedIcon`, `name`. Slots: default, `description`. | `forms/switch.vue` |
|
|
175
|
-
| `NumberInput` | Locale aware number with stepper, min, max, step. | Model: number or null. Props: `min`, `max`, `step`, `largeStep`, `locale`, `formatOptions` (currency, percent), `decimalSeparator` (`'.'` or `','`, default from the locale), `stepper`, `wheel`, `align`, `icon`, `placeholder`. Typing keeps only digits, one decimal separator (a typed `.` or `,` becomes the separator) and a leading `-` when `min` allows negatives.
|
|
175
|
+
| `NumberInput` | Locale aware number with stepper, min, max, step. | Model: number or null. Props: `min`, `max`, `step`, `largeStep`, `locale`, `formatOptions` (currency, percent), `decimalSeparator` (`'.'` or `','`, default from the locale), `stepper`, `wheel`, `align` (`start`, the default, or `end`), `icon`, `placeholder`. Numbers are left aligned like every other field. Typing keeps only digits, one decimal separator (a typed `.` or `,` becomes the separator) and a leading `-` when `min` allows negatives. | `forms/number-input.vue` |
|
|
176
176
|
| `PasswordInput` | Password with show or hide, optional generator, copy and strength meter. | Model: string. Props: `generate` (true or a function), `copy`, `strength`, `minLength`, `autocomplete`. Event: `generate`. | `forms/password-input.vue` |
|
|
177
177
|
| `PinInput` | One time code or PIN in separate cells. | Model: string. Props: `length`, `mode` (numeric, alphanumeric, alphabetic), `mask`, `uppercase`, `separatorAfter`, `autocomplete`. Event: `complete(value)`. | `forms/pin-input.vue` |
|
|
178
178
|
| `InputGroup` | Join an input with addons or buttons on its sides. | Props: `label`, `size`, `block`. Slot: default (inputs, `InputAddon`, `Button`). | `forms/input-group.vue` |
|
|
@@ -208,23 +208,23 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
208
208
|
|
|
209
209
|
## Data
|
|
210
210
|
|
|
211
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
212
|
-
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
213
|
-
| `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`.
|
|
214
|
-
| `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`.
|
|
215
|
-
| `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.
|
|
216
|
-
| `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`.
|
|
217
|
-
| `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.
|
|
218
|
-
| `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`.
|
|
219
|
-
| `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 }`).
|
|
220
|
-
| `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.
|
|
221
|
-
| `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`.
|
|
222
|
-
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`.
|
|
223
|
-
| `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`.
|
|
224
|
-
| `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
|
|
225
|
-
| `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>`.
|
|
226
|
-
| `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`.
|
|
227
|
-
| `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
|
|
211
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
212
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
|
|
213
|
+
| `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` |
|
|
214
|
+
| `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` |
|
|
215
|
+
| `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` |
|
|
216
|
+
| `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` |
|
|
217
|
+
| `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` |
|
|
218
|
+
| `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` |
|
|
219
|
+
| `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` |
|
|
220
|
+
| `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` |
|
|
221
|
+
| `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` |
|
|
222
|
+
| `AvatarGroup` | Overlapping stack of avatars with "+N". | Props: `items` (`src`, `name`, `alt`), `max`, `size`, `shape`, `moreLabel`. | `data/avatar.vue` |
|
|
223
|
+
| `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` |
|
|
224
|
+
| `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). Slots: `leading`, `action` (`{ item }`), `empty`, `empty-actions` (buttons in the default empty state). | `data/record-list.vue` |
|
|
225
|
+
| `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` |
|
|
226
|
+
| `Timeline` | Vertical list of events or activity. | Props: `items` (`title`, `description`, `time`, `datetime`, `icon`, `tone`), `compact`. Slot: `item`. | `data/timeline.vue` |
|
|
227
|
+
| `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` |
|
|
228
228
|
|
|
229
229
|
## Layout
|
|
230
230
|
|
|
@@ -234,7 +234,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
234
234
|
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs`, `level`, `bordered`, `align`, `truncate`. Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
|
|
235
235
|
| `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`md`, `lg` for a title sized trail). Slot: `item`. | `layout/breadcrumbs.vue` |
|
|
236
236
|
| `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` |
|
|
237
|
-
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `badge`, `badgeTone`, `dot`, `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`.
|
|
237
|
+
| `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` (native tooltip, also on a disabled tab), `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` |
|
|
238
238
|
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`. Slots: default, `title`. | `layout/accordion.vue` |
|
|
239
239
|
| `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` |
|
|
240
240
|
| `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
|
|
@@ -300,7 +300,7 @@ Import from `@xleddyl/443-components-vue/grid`. It wraps AG Grid Community.
|
|
|
300
300
|
| `DataGrid` | Big table: virtual scroll, column menu, search, CSV export, selection, server sort and paging, inline editing. For small tables use `Table`. | Models: `v-model:query`, `v-model:page`, `v-model:pageSize`, `v-model:sort` (`{ column, direction }`). Props: `rows`, `columns` (AG Grid `ColDef`), `rowIdKey` or `getRowId`, `storageKey` (columns and page size in the preferences store; without `columnMenu` the column visibility always comes from `columns`), `density`, `selectable`, `loading`, `height`, `fill`, `autoHeight`, `toolbar`, `searchable`, `columnMenu`, `exportable`, `serverSort`, `pagination`, `serverPagination`, `total`, `filterable`, `editable`, `spreadsheet`, `gridOptions`, `messages`, `filterCount`, `activeFilters` (`{ id, label, value }[]`, removable pills next to the filter button; a click opens the filters). Slots: `actions`, `actions-end` (after the column menu and export buttons), `filters` (`{ close, count }`, hosted in a modal opened by a funnel button next to the search). Events: `filtersReset`, `filterRemove` (id), `rowClick`, `selectionChange`, `sortChange`, `filterChange`, `cellsChange`, `cellsInvalid`, `dirtyChange`, `rangeChange`, `copy`. | `grid/data-grid.vue` |
|
|
301
301
|
| `DataGrid` with `spreadsheet` | Excel-like editing: cell range selection, copy and paste (TSV), fill down and right, clear, undo and redo, dirty cell tracking. Set `rowIdKey` or `getRowId`. | Template ref methods (`GridSpreadsheetMethods`): `getRange`, `getSelectedCells`, `selectRange`, `selectAll`, `setRangeValue`, `copyRange`, `paste`, `fillDown`, `fillRight`, `clearCells`, `clearRange`, `undo`, `redo`, `clearHistory`, `getDirtyCells`, `clearDirty`. The `actions` slot gets the same methods plus `range`, `selectedCellCount`, `dirtyCount`, `canUndo`, `canRedo`. Use `cellsChange` to save edits, `cellsInvalid` for rejected input. | `grid/spreadsheet.vue` |
|
|
302
302
|
| `GridToolbar` | Toolbar of `DataGrid` (search, column menu, export). `DataGrid` already renders it. Use it alone only for a custom grid setup. | Props: `api`, `searchable`, `columnMenu`, `exportable`, `exportFileName`, `debounce`, `filterCount`, `activeFilters`. Model: `v-model` (query). Slots: default (actions), `end`, `filters`. Events: `resetColumns`, `filtersReset`, `filterRemove`. | - |
|
|
303
|
-
| Cell renderers | Use as `cellRenderer` in a column definition, with `cellRendererParams`. | `BadgeCell` (`tones`, `colors`, `labels`, `titles` (a record or a function of the value), `defaultTone`, `variant`; array values render one badge each, `max` adds a `+N` badge, `wrap`), `BooleanCell` (`trueLabel`, `falseLabel`), `DateCell` (`locale`, `options`, `relative`), `EmptyCell` (placeholder for empty values), `ImageCell` (`alt`, `rounded`, `fit`: `cover`, `contain` or `natural` (original aspect, height `size`), `size`), `LinkCell` (`href`, `label`, `target`), `ButtonCell` (`onClick`, `label`, `ariaLabel`, `emptyLabel
|
|
303
|
+
| Cell renderers | Use as `cellRenderer` in a column definition, with `cellRendererParams`. | `BadgeCell` (`tones`, `colors`, `labels`, `titles` (a record or a function of the value), `defaultTone`, `variant`; array values render one badge each, `max` adds a `+N` badge, `wrap`), `BooleanCell` (`trueLabel`, `falseLabel`), `DateCell` (`locale`, `options`, `relative`), `EmptyCell` (placeholder for empty values), `ImageCell` (`alt`, `rounded`, `fit`: `cover`, `contain` or `natural` (original aspect, height `size`), `size`), `LinkCell` (`href`, `label`, `target`), `ButtonCell` (`onClick`, `label`, `ariaLabel`, `emptyLabel`, `tone`, `variant`, `icon` (as `Button`, an `xs` button; without them an inline link style button); does not trigger the row click). | `grid/data-grid.vue` |
|
|
304
304
|
|
|
305
305
|
Grid helpers: `registerGridModules`, `registerGridEditorModules`, `registerGridFilterModules`, `registerGridSpreadsheetModules` (register AG Grid modules by hand), `createGridTheme`, `parseTsv`, `formatTsv`.
|
|
306
306
|
|
package/README.md
CHANGED
|
@@ -452,15 +452,17 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
452
452
|
|
|
453
453
|
### Lists, trees and uploads
|
|
454
454
|
|
|
455
|
-
- `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` (or `#empty`) 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.
|
|
455
|
+
- `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.
|
|
456
456
|
- `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`.
|
|
457
457
|
- `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.
|
|
458
|
+
- 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`).
|
|
458
459
|
- `Input` takes `transform: (value: string) => string`, applied to the typed text before it reaches the model (the caret keeps its place; IME composition is transformed when it ends). `:transform="(value) => value.toUpperCase()"` enforces uppercase codes. Values set from outside are not transformed.
|
|
459
460
|
- `FormField` takes `optional`, a muted localized "Optional" marker in the label row (`form.optional`, `optionalText` overrides it), the counterpart of the required asterisk. It is hidden when the field is required.
|
|
460
461
|
- `CheckboxGroup` takes `columns` (a number): the options are laid out in a grid with that many equal columns. Unset keeps the `orientation` layout. `variant="filled"` (`CheckboxGroupVariant`, `'default' | 'filled'`, default `'default'`) puts the options in a subtle filled panel, styled by `--k-checkbox-group-background` (`--k-subtle`), `--k-checkbox-group-padding` (0.75rem), `--k-checkbox-group-radius` (`--k-radius-md`) and `--k-checkbox-group-border` (none).
|
|
461
462
|
- `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'" />`.
|
|
462
463
|
- `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 }]" />`.
|
|
463
|
-
- `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.
|
|
464
|
+
- `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.
|
|
465
|
+
- `RecordList` keeps each title on one line with an ellipsis; the full title is in its `title` attribute.
|
|
464
466
|
- `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.
|
|
465
467
|
- 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.
|
|
466
468
|
- `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.
|
|
@@ -473,7 +475,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
473
475
|
<KStepper v-model="step" :steps="steps" linear label="Import" />
|
|
474
476
|
```
|
|
475
477
|
|
|
476
|
-
- `Tabs` items take `dot: true` for a small indicator without a number (`dotTone`, default `danger`; `dotLabel` is the hidden text, default "Needs attention").
|
|
478
|
+
- `Tabs` items take `dot: true` for a small indicator without a number (`dotTone`, default `danger`; `dotLabel` is the hidden text, default "Needs attention"). `color` (a palette name or a hex, `ColorValue`) draws a small color dot before the label, separate from the status dot. `title` is the native tooltip of the tab; a disabled tab keeps it (it uses `aria-disabled`, cannot be selected and is skipped by Tab and the arrow keys), so it can say why it is disabled. The same items work in the `tabs` of `Modal`, `Drawer`, `FormDrawer` and `DetailPage`.
|
|
477
479
|
- `DropdownMenu` takes `matchTriggerWidth` (the menu is at least as wide as its trigger) and `minWidth` (a CSS length).
|
|
478
480
|
- `PageHeader` takes `align` (`'end'` by default, `'start'` or `'center'`) for the title block and the actions, and `truncate` to keep the title on one line with an ellipsis (the full title is in its `title` attribute).
|
|
479
481
|
- `RichTextEditor` accepts `'underline'` in `toolbar` (not in the default toolbar).
|
|
@@ -939,7 +941,7 @@ Accessibility related props and defaults:
|
|
|
939
941
|
|
|
940
942
|
- Rendering stays virtual: the range, active cell and dirty marks are `cellClassRules` (merged with your own) and only the rendered cells of the affected rows refresh. The range tint is `--k-grid-range-background`, its border and the fill handle `--k-grid-range-border`, dirty cells `--k-grid-dirty-background` and `--k-grid-dirty-marker`. `parseTsv` and `formatTsv` are exported from `/grid`.
|
|
941
943
|
- `DataGrid` row classes: `gridOptions.rowClass`, `gridOptions.rowClassRules` (`{ 'is-archived': (params) => params.data?.archived }`) and `gridOptions.getRowClass` reach AG Grid unchanged. Style the classes in host CSS under `.k-data-grid .ag-row.<class>`.
|
|
942
|
-
- `ButtonCell` renders the value as an inline button that calls `onClick(value, data, event)` without selecting or clicking the row (for example to open a modal with details of that cell). `label` and `ariaLabel` customize the text and the accessible name, `emptyLabel` shows a button for empty values; without a label and with no value it renders the empty placeholder. It uses the column `valueFormatter` output when present.
|
|
944
|
+
- `ButtonCell` renders the value as an inline button that calls `onClick(value, data, event)` without selecting or clicking the row (for example to open a modal with details of that cell). `label` and `ariaLabel` customize the text and the accessible name, `emptyLabel` shows a button for empty values; without a label and with no value it renders the empty placeholder. `tone`, `variant` and `icon` (the `Button` values) render an `xs` `Button` instead of the inline link style, for a row action: `{ label: () => 'Delete', tone: 'danger', variant: 'soft', icon: 'trash' }`. Unset, the variant is `link` and the tone `accent`. It uses the column `valueFormatter` output when present.
|
|
943
945
|
- `LinkCell` renders internal hrefs (starting with `/`) with the configured link component (`NuxtLink` in Nuxt, `createLinkComponent(RouterLink)` in plain Vue), so they navigate without a reload; other hrefs stay a plain `<a>`.
|
|
944
946
|
- `DataGrid` translates the AG Grid ARIA strings through the catalog (`grid.*`; your own `localeText` still wins) and announces row count changes.
|
|
945
947
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<slot name="leading" :item="item" />
|
|
7
7
|
<div class="k-record-list-text">
|
|
8
8
|
<span class="k-record-list-title-row">
|
|
9
|
-
<span class="k-record-list-title">{{ item.title }}</span>
|
|
9
|
+
<span class="k-record-list-title" :title="item.title">{{ item.title }}</span>
|
|
10
10
|
<Badge
|
|
11
11
|
v-if="item.badge"
|
|
12
12
|
:label="item.badge.label"
|
|
@@ -112,10 +112,28 @@
|
|
|
112
112
|
</span>
|
|
113
113
|
</li>
|
|
114
114
|
</ul>
|
|
115
|
-
<div
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
<div
|
|
116
|
+
v-else
|
|
117
|
+
:id="control.id.value"
|
|
118
|
+
v-bind="$attrs"
|
|
119
|
+
class="k-tree-empty"
|
|
120
|
+
:class="{ 'is-invalid': control.invalid.value, 'is-disabled': control.disabled.value }"
|
|
121
|
+
data-k-shake
|
|
122
|
+
>
|
|
123
|
+
<slot name="empty">
|
|
124
|
+
<EmptyState
|
|
125
|
+
:icon="emptyIcon"
|
|
126
|
+
:title="emptyLabel"
|
|
127
|
+
:description="emptyDescription"
|
|
128
|
+
:size="emptyVariant === 'plain' ? 'sm' : 'md'"
|
|
129
|
+
:variant="emptyVariant"
|
|
130
|
+
:level="3"
|
|
131
|
+
>
|
|
132
|
+
<template v-if="$slots['empty-actions']" #actions
|
|
133
|
+
><slot name="empty-actions"
|
|
134
|
+
/></template>
|
|
135
|
+
</EmptyState>
|
|
136
|
+
</slot>
|
|
119
137
|
</div>
|
|
120
138
|
<template v-if="canReorder">
|
|
121
139
|
<span :id="hintId" class="k-visually-hidden">{{ hintText }}</span>
|
|
@@ -133,6 +151,7 @@ import { useTypeahead } from "../../internal/core/roving";
|
|
|
133
151
|
import { joinIds } from "../../internal/forms/control";
|
|
134
152
|
import Button from "../core/Button.vue";
|
|
135
153
|
import Icon from "../core/Icon.vue";
|
|
154
|
+
import EmptyState from "../feedback/EmptyState.vue";
|
|
136
155
|
import { rowDelay } from "../../internal/data/stagger";
|
|
137
156
|
defineOptions({ inheritAttrs: false });
|
|
138
157
|
const props = defineProps({
|
|
@@ -143,6 +162,9 @@ const props = defineProps({
|
|
|
143
162
|
size: { type: String, required: false, default: "md" },
|
|
144
163
|
checkmark: { type: Boolean, required: false },
|
|
145
164
|
emptyText: { type: String, required: false },
|
|
165
|
+
emptyDescription: { type: String, required: false },
|
|
166
|
+
emptyIcon: { type: null, required: false },
|
|
167
|
+
emptyVariant: { type: String, required: false, default: "card" },
|
|
146
168
|
descriptionVariant: { type: String, required: false, default: "mono" },
|
|
147
169
|
reorderable: { type: Boolean, required: false },
|
|
148
170
|
nestable: { type: Boolean, required: false },
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import type { IconName } from '../../composables/useIcons';
|
|
1
2
|
import type { TreeDescriptionVariant, TreeMove, TreeNode, TreeNodeId, TreeSize } from './types';
|
|
2
3
|
declare var __VLS_12: {
|
|
3
4
|
node: TreeNode;
|
|
4
5
|
level: number;
|
|
5
6
|
}, __VLS_14: {
|
|
6
7
|
node: TreeNode;
|
|
7
|
-
}, __VLS_29: {};
|
|
8
|
+
}, __VLS_29: {}, __VLS_38: {};
|
|
8
9
|
type __VLS_Slots = {} & {
|
|
9
10
|
label?: (props: typeof __VLS_12) => any;
|
|
10
11
|
} & {
|
|
11
12
|
meta?: (props: typeof __VLS_14) => any;
|
|
12
13
|
} & {
|
|
13
14
|
empty?: (props: typeof __VLS_29) => any;
|
|
15
|
+
} & {
|
|
16
|
+
'empty-actions'?: (props: typeof __VLS_38) => any;
|
|
14
17
|
};
|
|
15
18
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
16
19
|
nodes: TreeNode[];
|
|
@@ -20,6 +23,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
20
23
|
size?: TreeSize;
|
|
21
24
|
checkmark?: boolean;
|
|
22
25
|
emptyText?: string;
|
|
26
|
+
emptyDescription?: string;
|
|
27
|
+
emptyIcon?: IconName;
|
|
28
|
+
emptyVariant?: "card" | "plain";
|
|
23
29
|
descriptionVariant?: TreeDescriptionVariant;
|
|
24
30
|
reorderable?: boolean;
|
|
25
31
|
nestable?: boolean;
|
|
@@ -235,6 +241,9 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
235
241
|
size?: TreeSize;
|
|
236
242
|
checkmark?: boolean;
|
|
237
243
|
emptyText?: string;
|
|
244
|
+
emptyDescription?: string;
|
|
245
|
+
emptyIcon?: IconName;
|
|
246
|
+
emptyVariant?: "card" | "plain";
|
|
238
247
|
descriptionVariant?: TreeDescriptionVariant;
|
|
239
248
|
reorderable?: boolean;
|
|
240
249
|
nestable?: boolean;
|
|
@@ -448,6 +457,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
448
457
|
selectable: boolean;
|
|
449
458
|
bordered: boolean;
|
|
450
459
|
moveButtons: boolean;
|
|
460
|
+
emptyVariant: "plain" | "card";
|
|
451
461
|
descriptionVariant: TreeDescriptionVariant;
|
|
452
462
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
453
463
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
class="k-combobox-tag"
|
|
43
43
|
:class="tagClass(value)"
|
|
44
44
|
:style="colorStyle(optionFor(value)?.color)"
|
|
45
|
-
:title="
|
|
45
|
+
:title="tagTitle(value)"
|
|
46
46
|
>
|
|
47
47
|
<span class="k-combobox-tag-label">{{ labelFor(value) }}</span>
|
|
48
48
|
<button
|
|
@@ -468,6 +468,10 @@ function optionFor(value) {
|
|
|
468
468
|
function labelFor(value) {
|
|
469
469
|
return optionFor(value)?.label ?? keyOf(value);
|
|
470
470
|
}
|
|
471
|
+
function tagTitle(value) {
|
|
472
|
+
const option = optionFor(value);
|
|
473
|
+
return [labelFor(value), option?.group ?? option?.description].filter(Boolean).join("\n");
|
|
474
|
+
}
|
|
471
475
|
function tagClass(value) {
|
|
472
476
|
const color = optionFor(value)?.color;
|
|
473
477
|
return color ? ["is-colored", paletteClass(color)] : void 0;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
'k-field',
|
|
32
32
|
`k-field-${size}`,
|
|
33
33
|
'k-number-input-field',
|
|
34
|
-
{ 'is-invalid': control.invalid.value, 'is-
|
|
34
|
+
{ 'is-invalid': control.invalid.value, 'is-align-end': align === 'end' }
|
|
35
35
|
]"
|
|
36
36
|
:value="focused ? draft : display"
|
|
37
37
|
:readonly="readonly"
|
|
@@ -94,7 +94,7 @@ const props = defineProps({
|
|
|
94
94
|
formatOptions: { type: null, required: false },
|
|
95
95
|
wheel: { type: Boolean, required: false },
|
|
96
96
|
stepper: { type: Boolean, required: false, default: true },
|
|
97
|
-
align: { type: String, required: false, default: "
|
|
97
|
+
align: { type: String, required: false, default: "start" },
|
|
98
98
|
icon: { type: null, required: false },
|
|
99
99
|
size: { type: String, required: false, default: "md" },
|
|
100
100
|
placeholder: { type: String, required: false },
|
|
@@ -24,13 +24,22 @@
|
|
|
24
24
|
class="k-tab"
|
|
25
25
|
:aria-selected="isSelected(item) ? 'true' : 'false'"
|
|
26
26
|
:aria-controls="controlsId(item, index)"
|
|
27
|
-
:tabindex="index === focusIndex ? 0 : -1"
|
|
28
|
-
:disabled="item.disabled"
|
|
27
|
+
:tabindex="index === focusIndex && !item.disabled ? 0 : -1"
|
|
28
|
+
:aria-disabled="item.disabled ? 'true' : void 0"
|
|
29
|
+
:title="item.title"
|
|
30
|
+
@mousedown="item.disabled && $event.preventDefault()"
|
|
29
31
|
@click="select(item)"
|
|
30
32
|
@focus="focusIndex = index"
|
|
31
33
|
@keydown="onKeydown($event, index)"
|
|
32
34
|
>
|
|
33
35
|
<Icon v-if="item.icon" :name="item.icon" class="k-tab-icon" />
|
|
36
|
+
<span
|
|
37
|
+
v-if="item.color"
|
|
38
|
+
class="k-tab-color"
|
|
39
|
+
:class="paletteClass(item.color)"
|
|
40
|
+
:style="colorStyle(item.color)"
|
|
41
|
+
aria-hidden="true"
|
|
42
|
+
/>
|
|
34
43
|
<span class="k-tab-label">{{ item.label }}</span>
|
|
35
44
|
<template v-if="item.badge !== void 0 && item.badge !== ''">
|
|
36
45
|
<span
|
|
@@ -84,6 +93,7 @@
|
|
|
84
93
|
import { computed, nextTick, onMounted, ref, useId, useTemplateRef, warn, watch } from "vue";
|
|
85
94
|
import { useResizeObserver } from "../../internal/core/resize";
|
|
86
95
|
import Icon from "../core/Icon.vue";
|
|
96
|
+
import { colorStyle, paletteClass } from "../core/palette";
|
|
87
97
|
import { useLocale } from "../../composables/useLocale";
|
|
88
98
|
import { rovingIndex } from "../../internal/core/roving";
|
|
89
99
|
const props = defineProps({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IconName } from '../../composables/useIcons';
|
|
2
|
-
import type { LinkTarget, Tone } from '../core/types';
|
|
2
|
+
import type { ColorValue, LinkTarget, Tone } from '../core/types';
|
|
3
3
|
export type LayoutGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
4
|
export type LayoutAlign = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
5
5
|
export type LayoutJustify = 'start' | 'center' | 'end' | 'between' | 'around';
|
|
@@ -32,6 +32,8 @@ export interface TabItem {
|
|
|
32
32
|
dot?: boolean;
|
|
33
33
|
dotTone?: Tone;
|
|
34
34
|
dotLabel?: string;
|
|
35
|
+
color?: ColorValue;
|
|
36
|
+
title?: string;
|
|
35
37
|
disabled?: boolean;
|
|
36
38
|
}
|
|
37
39
|
export type StepperState = 'complete' | 'error';
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<Button
|
|
3
|
+
v-if="text && styled"
|
|
4
|
+
size="xs"
|
|
5
|
+
class="k-data-grid-action"
|
|
6
|
+
:tone="params.tone ?? 'accent'"
|
|
7
|
+
:variant="params.variant ?? 'link'"
|
|
8
|
+
:icon="params.icon"
|
|
9
|
+
:aria-label="ariaLabel"
|
|
10
|
+
@click.stop="onClick"
|
|
11
|
+
@mousedown.stop
|
|
12
|
+
>
|
|
13
|
+
{{ text }}
|
|
14
|
+
</Button>
|
|
2
15
|
<button
|
|
3
|
-
v-if="text"
|
|
16
|
+
v-else-if="text"
|
|
4
17
|
type="button"
|
|
5
18
|
class="k-data-grid-button"
|
|
6
19
|
:aria-label="ariaLabel"
|
|
@@ -14,6 +27,7 @@
|
|
|
14
27
|
|
|
15
28
|
<script setup>
|
|
16
29
|
import { computed } from "vue";
|
|
30
|
+
import Button from "../../components/core/Button.vue";
|
|
17
31
|
import EmptyCell from "./EmptyCell.vue";
|
|
18
32
|
const props = defineProps({
|
|
19
33
|
params: { type: Object, required: true }
|
|
@@ -27,6 +41,9 @@ const text = computed(() => {
|
|
|
27
41
|
}
|
|
28
42
|
return props.params.valueFormatted ?? String(raw.value);
|
|
29
43
|
});
|
|
44
|
+
const styled = computed(
|
|
45
|
+
() => Boolean(props.params.tone || props.params.variant || props.params.icon)
|
|
46
|
+
);
|
|
30
47
|
const ariaLabel = computed(() => props.params.ariaLabel?.(raw.value, props.params.data));
|
|
31
48
|
function onClick(event) {
|
|
32
49
|
props.params.onClick?.(raw.value, props.params.data, event);
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import type { ButtonCellParams, GridCellContext } from '../types';
|
|
2
2
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
3
3
|
params: import("ag-grid-community").ICellRendererParams<any, any, any> & ButtonCellParams<unknown>;
|
|
4
|
-
|
|
4
|
+
label?: string;
|
|
5
|
+
type?: "submit" | "button" | "reset" | undefined;
|
|
6
|
+
size?: import("../../index.ts").ButtonSize;
|
|
7
|
+
tone?: import("../../index.ts").Tone;
|
|
8
|
+
variant?: import("../../index.ts").ButtonVariant;
|
|
9
|
+
icon?: import("../../index.ts").IconName;
|
|
10
|
+
trailingIcon?: import("../../index.ts").IconName;
|
|
11
|
+
to?: import("../../index.ts").LinkTarget;
|
|
12
|
+
href?: string | undefined;
|
|
13
|
+
target?: string | undefined;
|
|
14
|
+
external?: boolean;
|
|
5
15
|
disabled?: (boolean | "true" | "false") | undefined;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
popovertarget?: string | undefined;
|
|
16
|
-
popovertargetaction?: import("../../index.ts").PopoverTargetAction | undefined;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
block?: boolean;
|
|
18
|
+
square?: boolean;
|
|
19
|
+
download?: any;
|
|
20
|
+
hreflang?: string | undefined;
|
|
21
|
+
media?: string | undefined;
|
|
22
|
+
ping?: string | undefined;
|
|
23
|
+
rel?: string | undefined;
|
|
24
|
+
referrerpolicy?: ("" | "origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url") | undefined;
|
|
17
25
|
innerHTML?: string | undefined | undefined;
|
|
18
26
|
class?: import("vue").ClassValue;
|
|
19
27
|
style?: import("vue").StyleValue;
|
|
@@ -206,17 +214,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
206
214
|
ref?: import("vue").VNodeRef | undefined;
|
|
207
215
|
ref_for?: boolean | undefined | undefined;
|
|
208
216
|
ref_key?: string | undefined | undefined;
|
|
209
|
-
context?: GridCellContext;
|
|
210
|
-
onVnodeBeforeMount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
211
|
-
onVnodeMounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
212
|
-
onVnodeBeforeUpdate?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
213
|
-
onVnodeUpdated?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
214
|
-
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
215
|
-
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
216
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
217
|
-
params: import("ag-grid-community").ICellRendererParams<any, any, any> & ButtonCellParams<unknown>;
|
|
218
217
|
autofocus?: (boolean | "true" | "false") | undefined;
|
|
219
|
-
disabled?: (boolean | "true" | "false") | undefined;
|
|
220
218
|
form?: string | undefined | undefined;
|
|
221
219
|
formaction?: string | undefined | undefined;
|
|
222
220
|
formenctype?: string | undefined | undefined;
|
|
@@ -224,10 +222,39 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
224
222
|
formnovalidate?: (boolean | "true" | "false") | undefined;
|
|
225
223
|
formtarget?: string | undefined | undefined;
|
|
226
224
|
name?: string | undefined | undefined;
|
|
227
|
-
type?: "submit" | "reset" | "button" | undefined | undefined;
|
|
228
225
|
value?: string | number | readonly string[] | undefined;
|
|
229
226
|
popovertarget?: string | undefined;
|
|
230
227
|
popovertargetaction?: import("../../index.ts").PopoverTargetAction | undefined;
|
|
228
|
+
onVnodeBeforeMount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
229
|
+
onVnodeMounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
230
|
+
onVnodeBeforeUpdate?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
231
|
+
onVnodeUpdated?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
232
|
+
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
233
|
+
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
234
|
+
context?: GridCellContext;
|
|
235
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
236
|
+
params: import("ag-grid-community").ICellRendererParams<any, any, any> & ButtonCellParams<unknown>;
|
|
237
|
+
label?: string;
|
|
238
|
+
type?: "submit" | "button" | "reset" | undefined;
|
|
239
|
+
size?: import("../../index.ts").ButtonSize;
|
|
240
|
+
tone?: import("../../index.ts").Tone;
|
|
241
|
+
variant?: import("../../index.ts").ButtonVariant;
|
|
242
|
+
icon?: import("../../index.ts").IconName;
|
|
243
|
+
trailingIcon?: import("../../index.ts").IconName;
|
|
244
|
+
to?: import("../../index.ts").LinkTarget;
|
|
245
|
+
href?: string | undefined;
|
|
246
|
+
target?: string | undefined;
|
|
247
|
+
external?: boolean;
|
|
248
|
+
disabled?: (boolean | "true" | "false") | undefined;
|
|
249
|
+
loading?: boolean;
|
|
250
|
+
block?: boolean;
|
|
251
|
+
square?: boolean;
|
|
252
|
+
download?: any;
|
|
253
|
+
hreflang?: string | undefined;
|
|
254
|
+
media?: string | undefined;
|
|
255
|
+
ping?: string | undefined;
|
|
256
|
+
rel?: string | undefined;
|
|
257
|
+
referrerpolicy?: ("" | "origin" | "no-referrer" | "no-referrer-when-downgrade" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url") | undefined;
|
|
231
258
|
innerHTML?: string | undefined | undefined;
|
|
232
259
|
class?: import("vue").ClassValue;
|
|
233
260
|
style?: import("vue").StyleValue;
|
|
@@ -420,13 +447,24 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
420
447
|
ref?: import("vue").VNodeRef | undefined;
|
|
421
448
|
ref_for?: boolean | undefined | undefined;
|
|
422
449
|
ref_key?: string | undefined | undefined;
|
|
423
|
-
|
|
450
|
+
autofocus?: (boolean | "true" | "false") | undefined;
|
|
451
|
+
form?: string | undefined | undefined;
|
|
452
|
+
formaction?: string | undefined | undefined;
|
|
453
|
+
formenctype?: string | undefined | undefined;
|
|
454
|
+
formmethod?: string | undefined | undefined;
|
|
455
|
+
formnovalidate?: (boolean | "true" | "false") | undefined;
|
|
456
|
+
formtarget?: string | undefined | undefined;
|
|
457
|
+
name?: string | undefined | undefined;
|
|
458
|
+
value?: string | number | readonly string[] | undefined;
|
|
459
|
+
popovertarget?: string | undefined;
|
|
460
|
+
popovertargetaction?: import("../../index.ts").PopoverTargetAction | undefined;
|
|
424
461
|
onVnodeBeforeMount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
425
462
|
onVnodeMounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
426
463
|
onVnodeBeforeUpdate?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
427
464
|
onVnodeUpdated?: (((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void) | ((vnode: import("vue").VNode, oldVNode: import("vue").VNode) => void)[]) | undefined;
|
|
428
465
|
onVnodeBeforeUnmount?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
429
466
|
onVnodeUnmounted?: (((vnode: import("vue").VNode) => void) | ((vnode: import("vue").VNode) => void)[]) | undefined;
|
|
467
|
+
context?: GridCellContext;
|
|
430
468
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
431
469
|
declare const _default: typeof __VLS_export;
|
|
432
470
|
export default _default;
|
package/dist/grid/data-grid.css
CHANGED
package/dist/grid/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ColDef, GridApi, ICellRendererParams } from 'ag-grid-community';
|
|
2
|
-
import type { ColorValue, Tone } from '../components/core/types';
|
|
2
|
+
import type { ButtonVariant, ColorValue, Tone } from '../components/core/types';
|
|
3
|
+
import type { IconName } from '../composables/useIcons';
|
|
3
4
|
import type { BadgeSize, BadgeVariant, PageSize } from '../components/data/types';
|
|
4
5
|
import type { KMessages } from '../locale/types';
|
|
5
6
|
export type GridDensity = 'compact' | 'normal' | 'comfortable';
|
|
@@ -83,6 +84,9 @@ export interface ButtonCellParams<T = unknown> {
|
|
|
83
84
|
label?: (value: unknown, data: T | undefined) => string | undefined;
|
|
84
85
|
ariaLabel?: (value: unknown, data: T | undefined) => string | undefined;
|
|
85
86
|
emptyLabel?: string;
|
|
87
|
+
tone?: Tone;
|
|
88
|
+
variant?: ButtonVariant;
|
|
89
|
+
icon?: IconName;
|
|
86
90
|
}
|
|
87
91
|
export type CellProps<P> = {
|
|
88
92
|
params: ICellRendererParams & P;
|
|
@@ -141,9 +141,17 @@
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
.k-tree-empty {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
min-width: 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.k-tree-empty.is-invalid .k-empty-card {
|
|
150
|
+
border-color: var(--k-danger);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.k-tree-empty.is-disabled {
|
|
154
|
+
opacity: 0.6;
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
.k-tree-handle {
|
|
@@ -265,10 +273,6 @@
|
|
|
265
273
|
color: var(--k-accent-text);
|
|
266
274
|
}
|
|
267
275
|
|
|
268
|
-
.k-tree-sm .k-tree-empty {
|
|
269
|
-
padding: 0.375rem 0.5rem;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
276
|
.k-tree-sm .k-tree-row[data-drop='inside'] {
|
|
273
277
|
background: var(--k-accent-soft);
|
|
274
278
|
}
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
outline-offset: -2px;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.k-tab:hover:not(
|
|
72
|
+
.k-tab:hover:not([aria-disabled='true']) {
|
|
73
73
|
color: var(--k-text);
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
color: var(--k-text);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.k-tab
|
|
80
|
+
.k-tab[aria-disabled='true'] {
|
|
81
81
|
opacity: 0.45;
|
|
82
82
|
cursor: not-allowed;
|
|
83
83
|
}
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
transition: background-color var(--k-duration) var(--k-ease);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
.k-tabs-underline .k-tab:hover:not(
|
|
174
|
+
.k-tabs-underline .k-tab:hover:not([aria-disabled='true'])::before {
|
|
175
175
|
background: var(--k-hover);
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -248,6 +248,14 @@
|
|
|
248
248
|
--k-tab-badge-text: var(--k-danger-text);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
.k-tab-color {
|
|
252
|
+
width: 0.5rem;
|
|
253
|
+
height: 0.5rem;
|
|
254
|
+
flex: none;
|
|
255
|
+
border-radius: var(--k-radius-full);
|
|
256
|
+
background: var(--k-palette);
|
|
257
|
+
}
|
|
258
|
+
|
|
251
259
|
.k-tab-dot {
|
|
252
260
|
--k-tab-dot-tone: var(--k-danger);
|
|
253
261
|
width: 0.4375rem;
|
package/package.json
CHANGED