@xleddyl/443-components-vue 0.16.60 → 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.
Files changed (56) hide show
  1. package/CATALOG.md +151 -151
  2. package/README.md +21 -19
  3. package/dist/chart/chart.css +6 -0
  4. package/dist/components/data/RecordList.vue +1 -1
  5. package/dist/components/data/Tree.vue +26 -4
  6. package/dist/components/data/Tree.vue.d.ts +11 -1
  7. package/dist/components/forms/Combobox.vue +5 -1
  8. package/dist/components/forms/NumberInput.vue +2 -2
  9. package/dist/components/forms/PasswordInput.vue +2 -2
  10. package/dist/components/forms/Select.vue +4 -1
  11. package/dist/components/layout/Tabs.vue +31 -3
  12. package/dist/components/layout/types.d.ts +3 -1
  13. package/dist/components/overlays/ContextMenu.vue +2 -1
  14. package/dist/grid/DataGrid.vue +1 -0
  15. package/dist/grid/cells/ButtonCell.vue +18 -1
  16. package/dist/grid/cells/ButtonCell.vue.d.ts +62 -24
  17. package/dist/grid/data-grid.css +21 -6
  18. package/dist/grid/types.d.ts +5 -1
  19. package/dist/styles/core/form-field.css +2 -0
  20. package/dist/styles/core/form.css +1 -1
  21. package/dist/styles/core/input.css +2 -2
  22. package/dist/styles/core/textarea.css +5 -2
  23. package/dist/styles/data/filter-pills.css +15 -0
  24. package/dist/styles/data/stat.css +2 -1
  25. package/dist/styles/data/tag-list.css +4 -0
  26. package/dist/styles/data/timeline.css +1 -0
  27. package/dist/styles/data/tree.css +11 -7
  28. package/dist/styles/feedback/alert.css +1 -0
  29. package/dist/styles/feedback/loading-overlay.css +1 -0
  30. package/dist/styles/feedback/progress.css +1 -2
  31. package/dist/styles/forms/choice.css +2 -1
  32. package/dist/styles/forms/color-input.css +6 -0
  33. package/dist/styles/forms/combobox.css +1 -0
  34. package/dist/styles/forms/number-input.css +4 -0
  35. package/dist/styles/forms/password-input.css +7 -0
  36. package/dist/styles/forms/pin-input.css +3 -1
  37. package/dist/styles/forms/popover.css +1 -0
  38. package/dist/styles/forms/segmented.css +2 -0
  39. package/dist/styles/forms/select.css +1 -0
  40. package/dist/styles/forms/slider.css +4 -4
  41. package/dist/styles/forms/tree-select.css +1 -0
  42. package/dist/styles/layout/accordion.css +5 -1
  43. package/dist/styles/layout/card.css +3 -1
  44. package/dist/styles/layout/stepper.css +1 -6
  45. package/dist/styles/layout/tabs.css +11 -3
  46. package/dist/styles/overlays/command.css +5 -0
  47. package/dist/styles/overlays/confirm.css +5 -0
  48. package/dist/styles/overlays/menu.css +1 -0
  49. package/dist/styles/overlays/modal.css +3 -0
  50. package/dist/styles/shared.css +7 -7
  51. package/dist/styles/templates/auth-layout.css +1 -1
  52. package/dist/styles/templates/error-page.css +5 -0
  53. package/dist/styles/templates/save-bar.css +3 -1
  54. package/dist/styles/templates/settings-modal.css +5 -0
  55. package/dist/styles/templates/settings-page.css +1 -1
  56. package/package.json +1 -1
package/README.md CHANGED
@@ -342,7 +342,7 @@ const form = useForm({
342
342
  })
343
343
  ```
344
344
 
345
- Issues are keyed by their first path segment and by their full dotted path (`blocks.0.title`), so a nested `FormField name="blocks.0.title"` shows its own error. Pass `issueKey: (path) => string | string[]` to choose the keys yourself. Issues with an empty path become `rootErrors`, which `Form` renders as alerts above the content (`alerts="end"` moves them below, `alerts="false"` hides them, the `#alerts` slot replaces them). `setError('', message)` adds a root error, for example from the server.
345
+ Issues are keyed by their first path segment and by their full dotted path (`blocks.0.title`), so a nested `FormField name="blocks.0.title"` shows its own error. Pass `issueKey: (path) => string | string[]` to choose the keys yourself. Issues with an empty path become `rootErrors`, which `Form` renders as alerts above the content (`alerts="end"` moves them below, `:alerts="false"` hides them, the `#alerts` slot replaces them). `setError('', message)` adds a root error, for example from the server.
346
346
 
347
347
  Server errors. `form.setIssues(issues)` takes Standard Schema shaped issues (`FormIssueInput`, `{ message, path? }`), keys them like validator issues (first segment and dotted path) and shows them on their fields; an empty path becomes a root error. Messages go through `translateMessage` (`kind: 'error'`). When `onSubmit` throws, a `submitError` resolver (`FormSubmitErrorResolver`, `(error) => FormSubmitError | null | undefined`, with `FormSubmitError` `{ message?, issues? }`) turns the error into issues: `submit()` then resolves `false` instead of throwing, `Form` focuses the first invalid field (or the alerts), `form.submitError` holds the mapped result, and `message` becomes a root error when no issue landed on a field. Set the resolver once in `createFormConfig` / `provideFormConfig`, or per form in `useForm({ submitError })`, which wins. Without a resolver, or when it returns nothing (or neither a message nor issues), the error is thrown as before. Server errors are stale once the user edits: changing a field drops the server errors of that field and its nested paths, and the next submit drops the rest. `setError` keeps its behavior: its errors stay until the field validates again (after the first submit every edit validates the field, so they clear on edit too; before it they stay).
348
348
 
@@ -424,20 +424,20 @@ Several controls in one `FormField`. Only the primary control takes the field id
424
424
 
425
425
  ## Components
426
426
 
427
- | Group | Components |
428
- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
429
- | core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden |
430
- | forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput |
431
- | overlays | CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip |
432
- | data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, SelectionBar, Stat, Table, Tag, TagList, Timeline, Tree |
433
- | layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar |
434
- | templates | DashboardLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu |
435
- | feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton |
436
- | grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell) |
437
- | editor | RichTextEditor |
438
- | chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
439
-
440
- Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`, `useToast` (and `toast`), `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer`, `useOverlay`, `useModalContext`, `useLoading` (and `withLoading`), `useLoadingState`, `useHotkey`, `useCopy`, `useFileDrop` (with `readDroppedFiles`), `useSortable`, `usePasswordStrength`, `useTableSort`, `useAppShell`, `useRouteState`, `useScrollLock`, `useDirtyGuard`, `useIcons` helpers and `useLinkComponent`, `provideFieldBoundary`, `provideAuxiliaryControls`, `provideForm`, `useLocale`. With the Nuxt module also `useDashboard()` (runtime account, breadcrumbs and badges for the `k-dashboard` layout).
427
+ | Group | Components |
428
+ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
429
+ | core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden |
430
+ | forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput, TreeSelect |
431
+ | overlays | CommandButton, CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip |
432
+ | data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, RecordList, SelectionBar, Stat, Table, Tag, TagList, Timeline, Tree |
433
+ | layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar |
434
+ | templates | DashboardLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu, FormDrawer |
435
+ | feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton, SkeletonForm, SkeletonList |
436
+ | grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell) |
437
+ | editor | RichTextEditor |
438
+ | chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
439
+
440
+ Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`, `useToast` (and `toast`), `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer`, `useOverlay`, `useModalContext`, `useLoading` (and `withLoading`), `useLoadingState`, `useHotkey`, `useCopy`, `useFileDrop` (with `readDroppedFiles`), `useSortable`, `usePasswordStrength`, `useTableSort`, `useAppShell`, `useRouteState`, `useRouteRecord`, `usePageCommands`, `usePreference` (with `usePreferences`, `createPreferences`, `providePreferences`), `useScrollLock`, `useDirtyGuard`, `useIcons` helpers and `useLinkComponent`, `provideFieldBoundary`, `provideAuxiliaryControls`, `provideForm`, `useLocale`. With the Nuxt module also `useDashboard()` (runtime account, breadcrumbs and badges for the `k-dashboard` layout).
441
441
 
442
442
  ### Colors
443
443
 
@@ -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
 
@@ -66,7 +66,9 @@
66
66
 
67
67
  .k-chart.k-chart-legend-right {
68
68
  flex-direction: row;
69
+ flex-wrap: wrap;
69
70
  align-items: center;
71
+ justify-content: center;
70
72
  gap: 1.25rem;
71
73
  }
72
74
 
@@ -121,6 +123,10 @@
121
123
  list-style: none;
122
124
  }
123
125
 
126
+ .k-chart-legend > li {
127
+ min-width: 0;
128
+ }
129
+
124
130
  .k-chart-legend.is-bottom {
125
131
  justify-content: center;
126
132
  }
@@ -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 v-else :id="control.id.value" v-bind="$attrs" class="k-tree" :class="rootClass">
116
- <p class="k-tree-empty">
117
- <slot name="empty">{{ emptyLabel }}</slot>
118
- </p>
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="optionFor(value)?.group ?? optionFor(value)?.description"
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-numeric': align === 'end' }
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: "end" },
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 },
@@ -45,7 +45,7 @@
45
45
  :class="{ 'is-done': copied }"
46
46
  :aria-label="copyText"
47
47
  :title="copied ? copiedText : copyText"
48
- :disabled="!value || disabled || void 0"
48
+ :disabled="!value || control.disabled.value || void 0"
49
49
  @click="copyValue"
50
50
  >
51
51
  <Icon :name="copied ? 'clipboard-document-check' : 'clipboard-document'" />
@@ -55,7 +55,7 @@
55
55
  class="k-password-input-action"
56
56
  :aria-label="visible ? hideText : showText"
57
57
  :title="visible ? hideText : showText"
58
- :disabled="disabled || void 0"
58
+ :disabled="control.disabled.value || void 0"
59
59
  @click="visible = !visible"
60
60
  >
61
61
  <Icon :name="visible ? 'eye-slash' : 'eye'" />
@@ -35,7 +35,10 @@
35
35
  >
36
36
  {{ placeholder }}
37
37
  </option>
38
- <template v-for="entry in options" :key="entry.label">
38
+ <template
39
+ v-for="entry in options"
40
+ :key="isGroup(entry) ? `group:${entry.label}` : keyOf(entry.value)"
41
+ >
39
42
  <optgroup v-if="isGroup(entry)" :label="entry.label" :disabled="entry.disabled">
40
43
  <option
41
44
  v-for="option in entry.options"
@@ -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({
@@ -131,7 +141,10 @@ watch(
131
141
  (value) => {
132
142
  if (value !== void 0) visited.value.add(value);
133
143
  focusIndex.value = selectedIndex.value;
134
- nextTick(measure);
144
+ nextTick(() => {
145
+ measure();
146
+ revealSelected();
147
+ });
135
148
  },
136
149
  { immediate: true }
137
150
  );
@@ -176,6 +189,21 @@ function measure() {
176
189
  if (!tab || !list.value) return;
177
190
  indicator.value = { x: tab.offsetLeft, width: tab.offsetWidth };
178
191
  }
192
+ function revealSelected() {
193
+ const tab = tabElement(selectedIndex.value);
194
+ const scroller = list.value;
195
+ if (!tab || !scroller || scroller.scrollWidth <= scroller.clientWidth) return;
196
+ const start = tab.offsetLeft;
197
+ const end = start + tab.offsetWidth;
198
+ if (start < scroller.scrollLeft) scroller.scrollLeft = start;
199
+ else if (end > scroller.scrollLeft + scroller.clientWidth)
200
+ scroller.scrollLeft = end - scroller.clientWidth;
201
+ }
202
+ watch(
203
+ () => props.items,
204
+ () => nextTick(measure),
205
+ { deep: true }
206
+ );
179
207
  onMounted(() => {
180
208
  if (!props.label && !list.value?.hasAttribute("aria-labelledby"))
181
209
  warn("[@xleddyl/443-components-vue] Tabs needs a label to name the tab list.");
@@ -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';
@@ -77,7 +77,8 @@ function onContextMenu(event) {
77
77
  });
78
78
  }
79
79
  function openFromElement(element) {
80
- const source = element instanceof Element ? element : targetRef.value;
80
+ const target = targetRef.value;
81
+ const source = element instanceof Element && element !== target ? element : target?.firstElementChild;
81
82
  if (!source) return;
82
83
  const rect = source.getBoundingClientRect();
83
84
  openAt(
@@ -230,6 +230,7 @@ const gridLocaleText = computed(() => ({
230
230
  nextPage: text.value.nextPage,
231
231
  previousPage: text.value.previousPage,
232
232
  noRowsToShow: text.value.noRows,
233
+ noMatchingRows: t("common.noResults"),
233
234
  loadingOoo: text.value.loading,
234
235
  ...props.gridOptions?.localeText,
235
236
  ...props.localeText
@@ -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
- autofocus?: (boolean | "true" | "false") | undefined;
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
- form?: string | undefined | undefined;
7
- formaction?: string | undefined | undefined;
8
- formenctype?: string | undefined | undefined;
9
- formmethod?: string | undefined | undefined;
10
- formnovalidate?: (boolean | "true" | "false") | undefined;
11
- formtarget?: string | undefined | undefined;
12
- name?: string | undefined | undefined;
13
- type?: "submit" | "reset" | "button" | undefined | undefined;
14
- value?: string | number | readonly string[] | undefined;
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
- context?: GridCellContext;
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;