@xleddyl/443-components-vue 0.16.96 → 0.16.97
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 +25 -20
- package/README.md +73 -21
- package/dist/components/forms/PaletteSelect.vue.d.ts +2 -2
- package/dist/components/layout/PageHeader.vue +5 -2
- package/dist/components/layout/PageHeader.vue.d.ts +4 -1
- package/dist/components/layout/ResizeHandle.vue +94 -0
- package/dist/components/layout/ResizeHandle.vue.d.ts +418 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/index.mjs +1 -0
- package/dist/components/layout/types.d.ts +4 -1
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +8 -8
- package/dist/components/overlays/ConfirmHost.vue.d.ts +8 -8
- package/dist/components/overlays/Popover.vue +64 -24
- package/dist/components/overlays/Popover.vue.d.ts +13 -4
- package/dist/components/templates/SettingsModal.vue.d.ts +2 -2
- package/dist/components/templates/WorkspaceLayout.vue +296 -0
- package/dist/components/templates/WorkspaceLayout.vue.d.ts +455 -0
- package/dist/components/templates/index.d.ts +1 -0
- package/dist/components/templates/index.mjs +1 -0
- package/dist/components/templates/types.d.ts +32 -0
- package/dist/composables/usePreferences.d.ts +1 -0
- package/dist/composables/usePreferences.mjs +2 -1
- package/dist/internal/core/env.d.ts +2 -0
- package/dist/internal/core/env.mjs +20 -1
- package/dist/internal/overlays/OverlayView.vue.d.ts +8 -8
- package/dist/locale/de.mjs +7 -0
- package/dist/locale/en.mjs +7 -0
- package/dist/locale/it.mjs +7 -0
- package/dist/locale/types.d.ts +7 -0
- package/dist/styles/forced-colors.css +10 -0
- package/dist/styles/layout/breadcrumbs.css +23 -0
- package/dist/styles/layout/page-header.css +58 -0
- package/dist/styles/layout/resize-handle.css +52 -0
- package/dist/styles/layout.css +1 -0
- package/dist/styles/templates/workspace-layout.css +143 -0
- package/dist/styles/templates.css +1 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -113,13 +113,16 @@ Playground paths in this file are relative to `playground/nuxt/app/pages/compone
|
|
|
113
113
|
| Collapsible sections, FAQ | `Accordion` |
|
|
114
114
|
| Container with title and actions | `Card` |
|
|
115
115
|
| "Add" tile next to a grid of items, empty drop area | `Card` `variant="dashed"` (`as="button"`, `icon`, `title`) |
|
|
116
|
+
| Resizable panel next to content (a split view, a side pane you drag or resize with the keyboard) | `ResizeHandle` (`WorkspaceLayout` for a whole editor frame) |
|
|
116
117
|
| Page title, description, breadcrumbs, actions | `PageHeader` (or a page template) |
|
|
117
118
|
| Breadcrumb trail as the page title (a record, a nested page) | `trail` on `PageHeader` |
|
|
119
|
+
| Compact header of a side panel or an inspector (title, icon, parents, actions) | `PageHeader size="sm"` |
|
|
118
120
|
| Breadcrumbs only | `Breadcrumbs` |
|
|
119
121
|
| Dashboard layout with sidebar, search, account and settings | `DashboardLayout` (or the Nuxt layout `k-dashboard`) |
|
|
120
122
|
| Actions in a settings section header ("Add user") | `#actions-<id>` on `SettingsModal`, `#settings-actions-<id>` on `DashboardLayout` (gets `page`, `openPage`, `back`) |
|
|
121
123
|
| Tabs in a settings section header, like a drawer | `#tabs-<id>` on `SettingsModal`, `#settings-tabs-<id>` on `DashboardLayout`: put a `Tabs` `variant="underline"` `size="sm"` in it |
|
|
122
124
|
| Page that fills the panel height (a full height grid) | `content="fill"` or `"centered"` on `DashboardLayout` / `AppShell`, `definePageMeta({ content: 'fill' })`, with `DataGrid fill` or `ListPage fill` |
|
|
125
|
+
| Editor with a tree, a canvas and an inspector (resizable side panes, tabs on narrow screens) | `WorkspaceLayout` with `PageHeader size="sm"` pane headers |
|
|
123
126
|
| Custom app frame with your own sidebar | `AppShell` + `Sidebar` + `SidebarNav` |
|
|
124
127
|
| Login, sign up, reset password page | `AuthLogin` + `AuthLogout` (two step flow); `AuthLayout` (or `k-auth`) for other pages |
|
|
125
128
|
| Settings in a modal (account, appearance, your sections) | `SettingsModal` (the `DashboardLayout` embeds it) |
|
|
@@ -212,7 +215,7 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
212
215
|
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
|
|
213
216
|
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
|
|
214
217
|
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
|
|
215
|
-
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `width` (any CSS length, capped at the viewport), `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`.
|
|
218
|
+
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger, or next to any element or point with `anchor`. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`, `width` (any CSS length, capped at the viewport), `anchor` (an element, also inside a same origin iframe, or a virtual `{ getBoundingClientRect() }`; positions against it instead of the trigger, the trigger slot becomes optional). `sheet` (a bottom sheet `Modal` with the same content when the viewport is 640px wide or less). Slots: default (the trigger), `content`. Exposed: `show`, `hide`, `toggle`. | `overlays/popover.vue` |
|
|
216
219
|
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
|
|
217
220
|
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
|
|
218
221
|
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `disabled`, `disabledReason` (with `disabled`: reachable with the arrow keys but not selectable, a tooltip on hover and keyboard focus, linked with `aria-describedby`), `onSelect`), `search(query, signal)`, `pinned` (items or `(query) => items` shown first, never filtered or saved as recent), `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
|
|
@@ -244,25 +247,26 @@ Mount `OverlayHost` once for the imperative hooks (see [Composables](#composable
|
|
|
244
247
|
|
|
245
248
|
## Layout
|
|
246
249
|
|
|
247
|
-
| Component | Purpose and when to use it | Main props, models, slots, events | Playground
|
|
248
|
-
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
249
|
-
| `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle, dashed: a centered add or empty tile), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue`
|
|
250
|
-
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs` (small trail above the title), `trail` (the earlier levels as links: the title becomes a breadcrumb trail whose last item is the heading), `trailLabel`, `level`, `bordered`, `align`, `truncate
|
|
251
|
-
| `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`md`, `lg` for a title sized trail), `heading` (the current item is a heading of that level). Slot: `item`.
|
|
252
|
-
| `Stepper` | Step indicator for wizards and multi step flows (import, checkout). Horizontal or vertical, compact on narrow widths. | Model: `v-model` (current step value). Props: `steps` (`value`, `label`, `description`, `icon`, `disabled`, `state`: `complete` or `error`), `label`, `orientation`, `size`, `linear` (only completed and current steps clickable), `readonly`, `compact` (`'auto'` by default, `true`, `false`), `summary` (false hides the compact "Step 2 of 4" line), `positionLabel`, `completeLabel`, `errorLabel`. Event: `select`. | `layout/stepper.vue`
|
|
253
|
-
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `color` (a palette name or hex, a dot before the label), `badge`, `badgeTone`, `dot`, `title` (a tooltip on hover and focus, also on a disabled tab; native `title` until mount), `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`. | `layout/tabs.vue`
|
|
254
|
-
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`, `contentVariant` (text, or neutral: inherited font and color for forms, same padding), `padded` (default `true`; `false` for flush content). Slots: default, `title`. | `layout/accordion.vue`
|
|
255
|
-
| `
|
|
256
|
-
| `
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
260
|
-
| `
|
|
261
|
-
| `
|
|
262
|
-
| `
|
|
263
|
-
| `
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
250
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
251
|
+
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
|
|
252
|
+
| `Card` | Container with optional title, description, icon, actions and footer. Can be a link or a selectable button. | Props: `title`, `description`, `icon`, `variant` (raised, outline, subtle, dashed: a centered add or empty tile), `padding`, `as`, `to`, `href`, `selected`, `disabled`, `animated`. Slots: default, `header`, `title`, `description`, `icon`, `actions`, `footer`. | `layout/card.vue` |
|
|
253
|
+
| `PageHeader` | Page title with description, breadcrumbs, badge and actions. The page templates include it. | Props: `title`, `description`, `icon`, `breadcrumbs` (small trail above the title), `trail` (the earlier levels as links: the title becomes a breadcrumb trail whose last item is the heading), `trailLabel`, `level`, `bordered`, `align`, `truncate`, `size` (`md`, `sm` for a panel or inspector header). Slots: `actions`, `badge`, `description`, `title`, `icon`, `breadcrumbs`. | `layout/page-header.vue` |
|
|
254
|
+
| `Breadcrumbs` | Path navigation. | Props: `items` (`label`, `to`, `href`, `icon`), `separator`, `linkLast`, `ancestors`, `size` (`sm` for panel headers, `md`, `lg` for a title sized trail), `heading` (the current item is a heading of that level). Slot: `item`. | `layout/breadcrumbs.vue` |
|
|
255
|
+
| `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` |
|
|
256
|
+
| `Tabs` | Tabs with panels, badges and dots. Segmented or underline. | Model: `v-model` (active value). Props: `items` (`value`, `label`, `icon`, `color` (a palette name or hex, a dot before the label), `badge`, `badgeTone`, `dot`, `title` (a tooltip on hover and focus, also on a disabled tab; native `title` until mount), `disabled`), `variant`, `size`, `lazy`, `fill`, `stretch`, `inset`, `controls` (id of a panel outside the component: only the tab list renders). Slots: `panel-<value>`, `panel`. | `layout/tabs.vue` |
|
|
257
|
+
| `Accordion` | Collapsible sections. | Model: `v-model` (open value or values). Props: `items` (`value`, `title`, `description`, `content`, `icon`), `multiple`, `collapsible`, `variant`, `contentVariant` (text, or neutral: inherited font and color for forms, same padding), `padded` (default `true`; `false` for flush content). Slots: default, `title`. | `layout/accordion.vue` |
|
|
258
|
+
| `ResizeHandle` | Draggable and keyboard resizable separator between a panel and the rest (a side pane, a split editor). | Model: `v-model` (size in px). Props: `orientation` (`vertical`, `horizontal`), `target` (`before`, `after`: where the resized panel is), `min`, `max`, `step` (arrow keys, default 16), `label`, `onReset` (double click). Events: `resizeStart`, `resizeEnd`. | `layout/resize-handle.vue` |
|
|
259
|
+
| `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` |
|
|
260
|
+
| `Stack` | Flex row or column with gap. | Props: `direction`, `gap` (none to xl), `align`, `justify`, `wrap`, `responsive`, `as`. | `layout/stack.vue` |
|
|
261
|
+
| `Grid` | Responsive CSS grid. | Props: `columns` (number or breakpoints), `minItemWidth` (auto fit), `gap`, `as`. | `layout/grid.vue` |
|
|
262
|
+
| `Toolbar` | Group of controls with arrow key navigation (ARIA toolbar). | Props: `label`, `orientation`, `roving`, `bordered`. | `layout/toolbar.vue` |
|
|
263
|
+
| `CopyButton` | Button that copies a value and shows "copied". | Props: `value`, `label`, `copiedLabel`, `showLabel`, `size`, `variant`, `tone`, `resetAfter`. Event: `copy(success)`. | `layout/copy-button.vue` |
|
|
264
|
+
| `ThemeSwitch` | Light, dark and system switch. | Props: `variant` (segmented, icon), `size`, `showLabels`. | `layout/theme-switch.vue` |
|
|
265
|
+
| `NavLink` | One navigation link with icon, badge and active state. | Props: `label`, `to`, `href`, `icon`, `badge`, `active`, `match` (exact, prefix), `external`, `disabled`. Slots: default, `icon`. | `layout/nav-link.vue` |
|
|
266
|
+
| `AppShell` | App frame: sidebar, topbar, mobile menu, collapse, skip link. Use it for a custom frame. Use `DashboardLayout` for the ready one. | Models: `v-model:collapsed`, `v-model:open`. Props: `variant` (inset, sidebar, floating), `content` (`page`, `fill`, `centered`, `bleed`), `fluid`, `fill`, `topbar`, `storageKey` (collapsed state in the preferences store), `shortcut`, `loading` (hides the page content and shows a page skeleton, `aria-busy` on `main`), `loadingLabel`. Slots: default, `sidebar`, `topbar`, `overlays`, `loading` (replaces the default page skeleton). | `layout/app-shell.vue` |
|
|
267
|
+
| `Sidebar` | Sidebar content with header, collapse button and footer. Goes in the `sidebar` slot of `AppShell`. | Props: `label`, `collapsible`, `collapseLabel`, `brandAlign` (`start`, `center`). Icons `sidebar-collapse` and `sidebar-expand` for the collapse button. Slots: default, `header`, `top`, `footer`. | `layout/app-shell.vue` |
|
|
268
|
+
| `SidebarNav` | Navigation list from data, with groups and children. | Props: `items` (`NavItem[]` or `NavSection[]`: `label`, `to`, `icon`, `badge`, `children`), `currentPath`. | `layout/app-shell.vue` |
|
|
269
|
+
| `SidebarSection` | Labelled block inside a sidebar for hand written links. | Prop: `label`. Slot: default. | `layout/app-shell.vue` |
|
|
266
270
|
|
|
267
271
|
## Feedback
|
|
268
272
|
|
|
@@ -285,6 +289,7 @@ Templates combine core parts into whole pages and layouts. Start from them for n
|
|
|
285
289
|
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
286
290
|
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
|
|
287
291
|
| `DashboardLayout` | Ready app frame: brand, navigation, command search, account menu, settings modal, breadcrumbs, theme switch. Put it in `layouts/default.vue`. | Models: `v-model:collapsed`, `v-model:open`, `v-model:settingsOpen`, `v-model:settingsSection`. Props: `navigation` (`NavItem[]` or `NavSection[]`), `account` (`name`, `email`, `avatar`, `role`, `menu`), `brandName`, `brandIcon`, `brandLogo`, `breadcrumbs`, `search` (true, groups or function), `settingsSections`, `settingsRoute`, `settingsRouteLocation`, `settingsAccountSection`, `settingsResolvePage`, `settingsHideSession`, `variant`, `content` (`page`, `fill`, `centered`, `bleed`; per page with `definePageMeta({ content })` in `k-dashboard`), `fluid`, `fill`, `loading` (page skeleton while a navigation is pending: bind `useNavigationPending()` in Nuxt), `loadingLabel`, `onSignOut`. Slots: default, `loading`, `actions`, `brand`, `sidebar-top`, `sidebar`, `sidebar-footer`, `account`, `topbar`, `search-item`, `settings-account-start`, `settings-account-fields`, `settings-section-<id>`, `settings-actions-<id>`, `settings-tabs-<id>`, `settings-nav-footer`. Event: `accountSelect`. | `templates/dashboard-layout.vue` |
|
|
292
|
+
| `WorkspaceLayout` | Full height editor workspace: top bar (`start`, `center`, `end`) and up to three panes, the side panes resizable, collapsible and persisted, tabs under a container breakpoint. | Models: `v-model:pane` (active tab in compact mode), `v-model:left-collapsed`, `v-model:right-collapsed`, `v-model:left-width`, `v-model:right-width`. Props: `left`, `right` (`label`, `min`, `max`, `initial`, tab `badge`, `badgeTone`, `badgeLabel`, `dot`, `icon`), `main` (`label`, badge), `storageKey`, `breakpoint` (1024), `step`, `panesLabel`, `resizeLabel`. Slots: `start`, `center`, `end`, `left`, `left-header`, `main`, `main-header`, `right`, `right-header` (scope `{ compact, pane, collapsed, toggle, reveal }`). Exposed: `toggle`, `reveal`, `compact`. | `templates/workspace-layout.vue` |
|
|
288
293
|
| `AuthLayout` | Frame of sign in, sign up and reset password pages: left column with brand, title (or a large breadcrumb), form and footer; aside panel on the right from 960px. | Props: `title`, `description`, `breadcrumbs`, `footer`, `brandName`, `brandIcon`, `brandLogo`, `aside`, `asideTitle`, `asideDescription`, `themeSwitch`. Slots: default, `links`, `footer`, `brand`, `aside`, `corner`. | `templates/auth-layout.vue` |
|
|
289
294
|
| `AuthLogin` | Complete sign in page in two steps (email, then password with a breadcrumb back). Offers to sign in again after `AuthLogout`. | Props: `submit` (`{ email, password }`), `submitError`, `title`, `description`, `emailLabel`, `emailPlaceholder`, `passwordLabel`, `submitLabel`, `stepKey`, `reasonKey`, frame props of `AuthLayout`. Slots: `links` (`{ email, step }`), `footer`, `brand`, `aside`, `corner`. | `templates/auth-login.vue` |
|
|
290
295
|
| `AuthLogout` | Sign out page: runs `logout()`, remembers the account, reloads the sign in page. Retry on error. | Props: `logout`, `account` (`{ email, name }`), `loginTo`, `reasonKey`, frame props of `AuthLayout`. Slots: `footer`, `brand`, `aside`, `corner`. Helpers: `rememberSignedOutAccount`, `takeSignedOutAccount`, `SIGNED_OUT_REASON`. | `templates/auth-login.vue` |
|
package/README.md
CHANGED
|
@@ -214,14 +214,15 @@ Buttons show `icon` before the label and `trailingIcon` after it. Put action ico
|
|
|
214
214
|
|
|
215
215
|
## Preferences
|
|
216
216
|
|
|
217
|
-
UI choices are kept in one preferences store: the theme, the preset, the collapsed sidebar
|
|
217
|
+
UI choices are kept in one preferences store: the theme, the preset, the collapsed sidebar, the DataGrid columns and page size, and the WorkspaceLayout panes. By default the store is `localStorage` (keys `k-pref:<key>`, JSON, SSR safe, never throws, synced across tabs). Give the app your own store to keep the choices per user in a database, so they follow the user across devices.
|
|
218
218
|
|
|
219
|
-
| Key
|
|
220
|
-
|
|
|
221
|
-
| `theme`
|
|
222
|
-
| `preset`
|
|
223
|
-
| `shell:<storageKey>`
|
|
224
|
-
| `grid:<storageKey>`
|
|
219
|
+
| Key | Value | Written by |
|
|
220
|
+
| ------------------------ | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
221
|
+
| `theme` | `'system' \| 'light' \| 'dark'` | `useTheme().set`, `ThemeSwitch`, `AppearanceSettings` |
|
|
222
|
+
| `preset` | `ThemePreset` | `usePreset().set`, `AppearanceSettings` |
|
|
223
|
+
| `shell:<storageKey>` | `boolean` (collapsed) | `AppShell` and `DashboardLayout` (`shell:k-sidebar-collapsed`) |
|
|
224
|
+
| `grid:<storageKey>` | `GridPreference` (`{ columns?: GridColumnState[], pageSize }`) | `DataGrid` with `storageKey`: visibility, order, width, pinned, page size |
|
|
225
|
+
| `workspace:<storageKey>` | `WorkspacePreference` (`{ left?: { width, collapsed }, right?: { width, collapsed } }`) | `WorkspaceLayout` with `storageKey`: side pane widths and collapsed state |
|
|
225
226
|
|
|
226
227
|
`PREFERENCE_KEYS` builds them (`PREFERENCE_KEYS.grid('orders')`). Your own keys work too: use a namespace of your app (`app:<name>`).
|
|
227
228
|
|
|
@@ -468,18 +469,18 @@ async function switchView() {
|
|
|
468
469
|
|
|
469
470
|
## Components
|
|
470
471
|
|
|
471
|
-
| Group | Components
|
|
472
|
-
| --------- |
|
|
473
|
-
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden
|
|
474
|
-
| forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, FocalPointInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput, TreeSelect
|
|
475
|
-
| overlays | CommandButton, CommandList, CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip
|
|
476
|
-
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, RecordList, SelectionBar, SortableList, Stat, Table, Tag, TagList, Thumbnail, TileGrid, Timeline, Tree
|
|
477
|
-
| layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar
|
|
478
|
-
| templates | DashboardLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu, FormDrawer
|
|
479
|
-
| feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton, SkeletonForm, SkeletonList
|
|
480
|
-
| grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell)
|
|
481
|
-
| editor | RichTextEditor, TemplateEditor, TemplateText
|
|
482
|
-
| chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart
|
|
472
|
+
| Group | Components |
|
|
473
|
+
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
474
|
+
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden |
|
|
475
|
+
| forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, FocalPointInput, InputAddon, InputGroup, NumberInput, PaletteSelect, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput, TreeSelect |
|
|
476
|
+
| overlays | CommandButton, CommandList, CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip |
|
|
477
|
+
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, RecordList, SelectionBar, SortableList, Stat, Table, Tag, TagList, Thumbnail, TileGrid, Timeline, Tree |
|
|
478
|
+
| layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, ResizeHandle, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Stepper, Tabs, ThemeSwitch, Toolbar |
|
|
479
|
+
| templates | DashboardLayout, WorkspaceLayout, AuthLayout, AuthLogin, AuthLogout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu, FormDrawer |
|
|
480
|
+
| feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton, SkeletonForm, SkeletonList |
|
|
481
|
+
| grid | DataGrid, GridToolbar, cell renderers (BadgeCell, BooleanCell, ButtonCell, DateCell, EmptyCell, ImageCell, LinkCell) |
|
|
482
|
+
| editor | RichTextEditor, TemplateEditor, TemplateText |
|
|
483
|
+
| chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
|
|
483
484
|
|
|
484
485
|
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`, `useLeaveGuard` (with `useLeaveScope`, `provideLeaveScope`), `useDirtyGuard`, `useIcons` helpers and `useLinkComponent`, `provideFieldBoundary`, `provideAuxiliaryControls`, `provideForm`, `provideGridConfig` (with `createGridConfig`, `useGridConfig`), `useLocale`. With the Nuxt module also `useDashboard()` (runtime account, breadcrumbs and badges for the `k-dashboard` layout) and `useNavigationPending()` (`true` while a navigation to another path renders the new page), auto-imported or imported from `@xleddyl/443-components-vue/nuxt/composables`.
|
|
485
486
|
|
|
@@ -538,7 +539,8 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
538
539
|
- `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` shows a tooltip on hover and keyboard focus (the native `title` only until mount) and becomes the tab description; 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`.
|
|
539
540
|
- `Card` takes `variant="dashed"` (`CardVariant`) for a placeholder tile: a dashed `--k-line-strong` border on `--k-subtle`, with the icon, title and description centered in a column (the icon in a raised box, the title at 0.8125rem). As a button (`as="button"`) or a link (`to`, `href`) it gets the hover and focus of the `FileInput` dropzone (`--k-fill` and a `--k-text-dimmed` border on hover, a solid `--k-ring` border and the focus ring on focus); `disabled` dims it, and `selected` tints it with the accent, for a drop target while something is dragged over it. Use it for an "Add" tile at the end of a grid of items and for an empty area: `<KCard variant="dashed" as="button" icon="plus" title="Add block" @click="add" />`.
|
|
540
541
|
- `DropdownMenu` takes `matchTriggerWidth` (the menu is at least as wide as its trigger) and `minWidth` (a CSS length).
|
|
541
|
-
- `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). `trail` (`BreadcrumbItem[]`, the earlier levels as links) turns the title into a breadcrumb trail that ends with `title`, at the page title size: a `nav` (named by `trailLabel`, default "Breadcrumb") around an ordered list whose last item is the heading (`h<level>`, `aria-current="page"`, only the title, `#title` fills it). With `truncate` the trail stays on one line and the title gets the ellipsis. Use it for a record or a nested page instead of `Breadcrumbs` in `#title` (a `nav` inside a heading). `breadcrumbs` stays the small trail above the title.
|
|
542
|
+
- `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). `trail` (`BreadcrumbItem[]`, the earlier levels as links) turns the title into a breadcrumb trail that ends with `title`, at the page title size: a `nav` (named by `trailLabel`, default "Breadcrumb") around an ordered list whose last item is the heading (`h<level>`, `aria-current="page"`, only the title, `#title` fills it). With `truncate` the trail stays on one line and the title gets the ellipsis. Use it for a record or a nested page instead of `Breadcrumbs` in `#title` (a `nav` inside a heading). `breadcrumbs` stays the small trail above the title. `size="sm"` (`PageHeaderSize`, default `md`) is the compact header of a panel or an inspector: the title at the card title size (0.9375rem, 600), a 1.75rem icon box, tighter gaps, a 0.75rem description, `breadcrumbs` at `Breadcrumbs` size `sm` and the `trail` at the title size.
|
|
543
|
+
- `ResizeHandle` is a focusable `separator` that resizes the panel next to it: `v-model` is the size in pixels (`aria-valuenow`), `min` (default 0) and `max` clamp it (`aria-valuemin`, `aria-valuemax`), `orientation` is `vertical` (default, a vertical line that resizes a width, Left and Right arrows) or `horizontal` (a height, Up and Down arrows), and `target` says where the panel is: `before` (default, left or above, dragging right or down grows it) or `after` (an inspector on the right). The arrow keys move it by `step` (default 16), Home and End jump to `min` and `max`, a double click calls `onReset`. Dragging captures the pointer (it keeps working over iframes) and emits `resizeStart` and `resizeEnd(size)`. Name it with `label` and point `aria-controls` at the panel. The 1px line has a 11px hit area and turns `--k-ring` on hover, while dragging and on focus (with the `--k-ring-soft` halo).
|
|
542
544
|
- `RichTextEditor` accepts `'underline'` in `toolbar` (not in the default toolbar).
|
|
543
545
|
- `RichTextEditor` takes `linkTypes` (`EditorLinkType[]`, `'url' | 'email' | 'phone'`, default `['url']`). With more than one type the link form shows a type select; email links get `mailto:` and phone links `tel:` (spaces and separators removed). When no text is selected the form asks for the link text too (`editor.linkText`) and inserts it as a link, falling back to the address.
|
|
544
546
|
- `BarChart` takes `colorByPoint` (every bar of a series takes the next palette color, or one from `colors: string[]`; the legend lists and toggles the categories). The palette comes from `--k-chart-1` to `--k-chart-8`.
|
|
@@ -627,7 +629,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
627
629
|
```
|
|
628
630
|
|
|
629
631
|
- `useFileDrop` returns `{ over, reset }` and takes `ignore(event)`. A drop handled by a nested drop zone is skipped by the outer ones, and the state resets after any drop, even when a child stops propagation. `readDroppedFiles(dataTransfer)` walks dropped folders (call it synchronously in the drop handler) and resolves to `[{ file, path }]`; `readDroppedFiles(dataTransfer, { directories: true })` resolves to `{ files, directories }` with every folder path, empty ones included, and `skipHidden: true` leaves out dot entries.
|
|
630
|
-
- `Tabs` items take `badgeTone` and `badgeLabel` (the accessible name of the badge); the `#panel="{ item }"` slot renders a single panel for the active tab. `stretch` makes the tabs fill the remaining height of a flex column and the active panel grow with it (`flex: 1; min-height: 0`), and `inset` spaces the tab list from the container edges with the panel flush below it, for inspectors and side panes. `Breadcrumbs` items take `attrs` and `onClick` (an item without a link renders a button, handy for drop targets), `#item` customizes the content, and `ancestors` links every item and ends with a separator (`breadcrumbsAncestors` on `PageHeader`). `heading` (a heading level) renders the current item as that heading, for a trail that is the title of the page. `Accordion` takes `variant` `card` (default), `outline` (the same card without a shadow), `separated` or `plain`; items take `description`, and `contentVariant="neutral"` drops the text styling of the content (it inherits font size and color, for forms) and keeps the padding of the item, aligned with the trigger. `:padded="false"` drops the content padding for content that brings its own spacing or reaches the edges (a list, a table, a tree), with either content variant.
|
|
632
|
+
- `Tabs` items take `badgeTone` and `badgeLabel` (the accessible name of the badge); the `#panel="{ item }"` slot renders a single panel for the active tab. `stretch` makes the tabs fill the remaining height of a flex column and the active panel grow with it (`flex: 1; min-height: 0`), and `inset` spaces the tab list from the container edges with the panel flush below it, for inspectors and side panes. `Breadcrumbs` items take `attrs` and `onClick` (an item without a link renders a button, handy for drop targets), `#item` customizes the content, and `ancestors` links every item and ends with a separator (`breadcrumbsAncestors` on `PageHeader`). `heading` (a heading level) renders the current item as that heading, for a trail that is the title of the page. `size` is `sm` (0.75rem with tighter gaps, for panel headers and inspectors), `md` (default) or `lg` (a title sized trail). `Accordion` takes `variant` `card` (default), `outline` (the same card without a shadow), `separated` or `plain`; items take `description`, and `contentVariant="neutral"` drops the text styling of the content (it inherits font size and color, for forms) and keeps the padding of the item, aligned with the trigger. `:padded="false"` drops the content padding for content that brings its own spacing or reaches the edges (a list, a table, a tree), with either content variant.
|
|
631
633
|
- `RichTextEditor` labels heading buttons by their real level (`headingLabel="relative"` numbers them from 1) and `toolbar` picks and orders the buttons: `['headings', '|', 'bold', 'italic', 'link']`.
|
|
632
634
|
|
|
633
635
|
### Grid defaults
|
|
@@ -786,6 +788,8 @@ const archived = useRouteState('archived', {
|
|
|
786
788
|
|
|
787
789
|
`Popover`: `width` sets the width of the panel (any CSS length, like `18rem`) instead of the default range (12rem to 24rem), capped at the viewport width. `anchor` places the panel against any element or a virtual reference (`OverlayVirtualAnchor`, an object with `getBoundingClientRect()`, for a pointer position or a text selection) instead of its trigger, and the trigger slot becomes optional: open it with `v-model:open` or the exposed `show()`. An element inside a same origin iframe works too: the panel is placed in the page against it, and a click or Escape inside the iframe closes it. The position follows scroll and resize. Focus moves into the panel on open and returns to the anchor when it can take focus, otherwise to the element focused before; a click outside and Escape close it. Without a trigger, name the panel with `label`.
|
|
788
790
|
|
|
791
|
+
`sheet` renders the panel as a bottom sheet on phones: when the viewport is 640px wide or less (the breakpoint of the `Modal` sheet), the same `#content` opens in a `Modal` with its sheet look, `label` as the title (the trigger text names it without a `label`), the same first focus (`initialFocus`) and focus return, and `close` in the slot scope still closes it. `v-model:open`, `anchor` and the exposed `show`, `hide` and `toggle` work in both modes; crossing the breakpoint closes the open panel. Use it for pickers that need room on a phone (a block picker, a long `CommandList`).
|
|
792
|
+
|
|
789
793
|
```vue
|
|
790
794
|
<script setup lang="ts">
|
|
791
795
|
const open = ref(false)
|
|
@@ -863,6 +867,54 @@ Ready defaults to start a dashboard project: an app frame, an auth frame and pag
|
|
|
863
867
|
|
|
864
868
|
Slots: `brand`, `search`, `sidebar-top` (under the search, for example a workspace select), `sidebar` (replaces the navigation), `sidebar-footer`, `account`, `topbar-brand`, `topbar`, `actions`, default, plus `settings-section-<id>`, `settings-actions-<id>`, `settings-tabs-<id>`, `settings-nav-footer`, `settings-account-start` and `settings-account-fields`, forwarded to the SettingsModal. The exposed `openSettings(id?)` opens it on a section. Landmarks: skip link, `aside` and `nav` with labels, `main` with an id, `aria-current="page"` on the active link. `SidebarNav` (layout group) renders the same navigation data inside your own `Sidebar`.
|
|
865
869
|
|
|
870
|
+
### WorkspaceLayout
|
|
871
|
+
|
|
872
|
+
A full height app workspace for editors (a visual page editor, a mail client, a file manager): a top bar and up to three panes, the side ones resizable, collapsible and remembered.
|
|
873
|
+
|
|
874
|
+
```vue
|
|
875
|
+
<KWorkspaceLayout
|
|
876
|
+
v-model:pane="pane"
|
|
877
|
+
storage-key="editor"
|
|
878
|
+
:left="{ label: 'Blocks', min: 220, max: 420, initial: 280, badge: blocks.length }"
|
|
879
|
+
:main="{ label: 'Preview' }"
|
|
880
|
+
:right="{
|
|
881
|
+
label: 'Fields',
|
|
882
|
+
min: 280,
|
|
883
|
+
max: 520,
|
|
884
|
+
initial: 340,
|
|
885
|
+
badge: errors,
|
|
886
|
+
badgeTone: 'danger',
|
|
887
|
+
}"
|
|
888
|
+
>
|
|
889
|
+
<template #start><KButton icon="arrow-left" aria-label="Back" to="/pages" /> About us</template>
|
|
890
|
+
<template #center><KSegmentedControl v-model="device" :options="devices" label="Preview width" /></template>
|
|
891
|
+
<template #end="{ compact, collapsed, toggle }">
|
|
892
|
+
<KButton
|
|
893
|
+
v-if="!compact"
|
|
894
|
+
icon="list-bullet"
|
|
895
|
+
aria-label="Blocks panel"
|
|
896
|
+
:aria-pressed="!collapsed.left"
|
|
897
|
+
@click="toggle('left')"
|
|
898
|
+
/>
|
|
899
|
+
<KButton label="Publish" />
|
|
900
|
+
</template>
|
|
901
|
+
<template #left-header><KPageHeader size="sm" title="Blocks" :level="2" /></template>
|
|
902
|
+
<template #left="{ reveal }"><KTree :nodes="nodes" @update:selected="reveal('right')" /></template>
|
|
903
|
+
<template #main><iframe src="/preview" title="Live preview" /></template>
|
|
904
|
+
<template #right-header><KPageHeader size="sm" :title="block.label" :level="2" /></template>
|
|
905
|
+
<template #right>...</template>
|
|
906
|
+
</KWorkspaceLayout>
|
|
907
|
+
```
|
|
908
|
+
|
|
909
|
+
- Top bar: a `header` with the slots `start`, `center` (centered, on its own row under 40rem of workspace width) and `end`, rendered only when one of them is set.
|
|
910
|
+
- Panes: `left` and `right` are `aside` landmarks and `main` is `main` (a `section`, named by its label, inside an `AppShell` or `DashboardLayout`, which already have the main landmark). A side pane renders when its slot is set. `left-header`, `main-header` and `right-header` add a header strip above the scrolling pane body (a `PageHeader size="sm"` fits there). The pane bodies are flex columns that scroll.
|
|
911
|
+
- Side panes: `left` and `right` take `label` (the landmark and tab name, default "Left panel" and "Right panel"), `min`, `max` and `initial` widths in pixels (default 200, 480, 280). A `ResizeHandle` sits on the inner edge: drag it, or focus it and use the arrow keys (`step`, default 16), Home and End; a double click goes back to `initial`. While dragging, the workspace gets `is-resizing` (column cursor, iframes ignore the pointer). `v-model:left-width` and `v-model:right-width` bind the widths, `v-model:left-collapsed` and `v-model:right-collapsed` hide a pane (it stays mounted, so its state survives).
|
|
912
|
+
- Persistence: with `storageKey` the widths and the collapsed state go to the preferences store under `workspace:<storageKey>` (`PREFERENCE_KEYS.workspace(key)`), restored after mount with a `localStorage` store or on the first render with a server snapshot.
|
|
913
|
+
- Compact mode: under `breakpoint` (default 1024, the width of the workspace itself, not the viewport; 0 turns it off) the panes become `Tabs` under the top bar, one panel at a time, with the active pane in `v-model:pane` (`'left' | 'main' | 'right'`, default `main`). The tab labels come from the pane `label`s, and `badge`, `badgeTone`, `badgeLabel`, `dot`, `dotTone`, `dotLabel` and `icon` on `left`, `main` and `right` show on the tabs (an error count on the fields pane). `panesLabel` names the tab list.
|
|
914
|
+
- Slot scope: every slot gets `{ compact, pane, collapsed: { left, right }, toggle(side), reveal(pane) }`. `reveal` selects the tab in compact mode and expands a collapsed pane otherwise (selecting a block reveals its fields). `toggle`, `reveal` and `compact` are also exposed on the component.
|
|
915
|
+
- Height: `100dvh` by default (`--k-workspace-height` changes it, `100%` inside a modal). Inside `DashboardLayout` or `AppShell` with `content="fill"` it fills the content panel with a border, without it with `content="bleed"`.
|
|
916
|
+
- Copy: `resizeLabel` (`'Resize {pane}'`) names the handles, `panesLabel` the tabs.
|
|
917
|
+
|
|
866
918
|
### SettingsModal
|
|
867
919
|
|
|
868
920
|
A large dialog (60rem) with a section nav on the left and the content on the right, the nuxt-cms settings look. Below 640px the nav turns into a scrolling row above the content.
|
|
@@ -251,10 +251,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
251
251
|
onCancel?: ((payload: Event) => void) | undefined;
|
|
252
252
|
onClose?: (() => any) | undefined;
|
|
253
253
|
emptyText?: string | undefined;
|
|
254
|
+
onOpen?: (() => any) | undefined;
|
|
254
255
|
removeLabel?: string | undefined;
|
|
255
256
|
loadingText?: string | undefined;
|
|
256
257
|
onCreate?: ((option: ComboboxOption<PaletteOptionValue>) => any) | undefined;
|
|
257
|
-
onOpen?: (() => any) | undefined;
|
|
258
258
|
"onUpdate:query"?: ((value: string) => any) | undefined;
|
|
259
259
|
searchable?: boolean | undefined;
|
|
260
260
|
hideTags?: boolean | undefined;
|
|
@@ -521,10 +521,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
521
521
|
onCancel?: ((payload: Event) => void) | undefined;
|
|
522
522
|
onClose?: (() => any) | undefined;
|
|
523
523
|
emptyText?: string | undefined;
|
|
524
|
+
onOpen?: (() => any) | undefined;
|
|
524
525
|
removeLabel?: string | undefined;
|
|
525
526
|
loadingText?: string | undefined;
|
|
526
527
|
onCreate?: ((option: ComboboxOption<PaletteOptionValue>) => any) | undefined;
|
|
527
|
-
onOpen?: (() => any) | undefined;
|
|
528
528
|
"onUpdate:query"?: ((value: string) => any) | undefined;
|
|
529
529
|
searchable?: boolean | undefined;
|
|
530
530
|
hideTags?: boolean | undefined;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="k-page-header"
|
|
4
4
|
:class="[
|
|
5
|
+
`k-page-header-${size}`,
|
|
5
6
|
`k-page-header-align-${align}`,
|
|
6
7
|
{ 'is-bordered': bordered, 'is-truncated': truncate }
|
|
7
8
|
]"
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
v-if="breadcrumbs?.length"
|
|
13
14
|
:items="breadcrumbs"
|
|
14
15
|
:ancestors="breadcrumbsAncestors"
|
|
16
|
+
:size="size === 'sm' ? 'sm' : 'md'"
|
|
15
17
|
>
|
|
16
18
|
<template v-if="$slots['breadcrumb-item']" #item="scope">
|
|
17
19
|
<slot name="breadcrumb-item" v-bind="scope" />
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
:items="trailItems"
|
|
31
33
|
:label="trailLabel"
|
|
32
34
|
:heading="level"
|
|
33
|
-
size="lg"
|
|
35
|
+
:size="size === 'sm' ? 'md' : 'lg'"
|
|
34
36
|
>
|
|
35
37
|
<template #item="{ item, current }">
|
|
36
38
|
<slot v-if="current" name="title">{{ item.label }}</slot>
|
|
@@ -80,7 +82,8 @@ const props = defineProps({
|
|
|
80
82
|
level: { type: Number, required: false, default: 1 },
|
|
81
83
|
bordered: { type: Boolean, required: false },
|
|
82
84
|
align: { type: String, required: false, default: "end" },
|
|
83
|
-
truncate: { type: Boolean, required: false }
|
|
85
|
+
truncate: { type: Boolean, required: false },
|
|
86
|
+
size: { type: String, required: false, default: "md" }
|
|
84
87
|
});
|
|
85
88
|
const trailItems = computed(() => [
|
|
86
89
|
...props.trail ?? [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IconName } from '../../composables/useIcons';
|
|
2
|
-
import type { BreadcrumbItem, HeadingLevel } from './types';
|
|
2
|
+
import type { BreadcrumbItem, HeadingLevel, PageHeaderSize } from './types';
|
|
3
3
|
declare var __VLS_1: {}, __VLS_10: {
|
|
4
4
|
item: BreadcrumbItem;
|
|
5
5
|
index: number;
|
|
@@ -36,6 +36,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
36
36
|
bordered?: boolean;
|
|
37
37
|
align?: "start" | "center" | "end";
|
|
38
38
|
truncate?: boolean;
|
|
39
|
+
size?: PageHeaderSize;
|
|
39
40
|
innerHTML?: string | undefined | undefined;
|
|
40
41
|
class?: import("vue").ClassValue;
|
|
41
42
|
style?: import("vue").StyleValue;
|
|
@@ -239,6 +240,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
239
240
|
bordered?: boolean;
|
|
240
241
|
align?: "start" | "center" | "end";
|
|
241
242
|
truncate?: boolean;
|
|
243
|
+
size?: PageHeaderSize;
|
|
242
244
|
innerHTML?: string | undefined | undefined;
|
|
243
245
|
class?: import("vue").ClassValue;
|
|
244
246
|
style?: import("vue").StyleValue;
|
|
@@ -431,6 +433,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
431
433
|
ref_for?: boolean | undefined | undefined;
|
|
432
434
|
ref_key?: string | undefined | undefined;
|
|
433
435
|
}> & Readonly<{}>, {
|
|
436
|
+
size: PageHeaderSize;
|
|
434
437
|
align: "start" | "center" | "end";
|
|
435
438
|
level: HeadingLevel;
|
|
436
439
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="handle"
|
|
4
|
+
class="k-resize-handle"
|
|
5
|
+
:class="[`k-resize-handle-${orientation}`, { 'is-dragging': dragging }]"
|
|
6
|
+
role="separator"
|
|
7
|
+
tabindex="0"
|
|
8
|
+
:aria-orientation="orientation"
|
|
9
|
+
:aria-label="label"
|
|
10
|
+
:aria-valuenow="Math.round(model)"
|
|
11
|
+
:aria-valuemin="min"
|
|
12
|
+
:aria-valuemax="max"
|
|
13
|
+
@pointerdown="onPointerDown"
|
|
14
|
+
@pointermove="onPointerMove"
|
|
15
|
+
@pointerup="stop"
|
|
16
|
+
@pointercancel="stop"
|
|
17
|
+
@lostpointercapture="stop"
|
|
18
|
+
@keydown="onKeydown"
|
|
19
|
+
@dblclick="onReset?.()"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup>
|
|
24
|
+
import { onBeforeUnmount, ref, useAttrs, useTemplateRef } from "vue";
|
|
25
|
+
import { hasNameAttrs, warnUnnamed } from "../../internal/forms/name";
|
|
26
|
+
const props = defineProps({
|
|
27
|
+
orientation: { type: String, required: false, default: "vertical" },
|
|
28
|
+
target: { type: String, required: false, default: "before" },
|
|
29
|
+
min: { type: Number, required: false, default: 0 },
|
|
30
|
+
max: { type: Number, required: false, default: void 0 },
|
|
31
|
+
step: { type: Number, required: false, default: 16 },
|
|
32
|
+
label: { type: String, required: false },
|
|
33
|
+
onReset: { type: Function, required: false }
|
|
34
|
+
});
|
|
35
|
+
const emit = defineEmits(["resizeStart", "resizeEnd"]);
|
|
36
|
+
const model = defineModel({ type: Number, ...{ required: true } });
|
|
37
|
+
const attrs = useAttrs();
|
|
38
|
+
const handle = useTemplateRef("handle");
|
|
39
|
+
const dragging = ref(false);
|
|
40
|
+
let origin = { position: 0, size: 0, pointer: -1 };
|
|
41
|
+
warnUnnamed("ResizeHandle", () => Boolean(props.label) || hasNameAttrs(attrs));
|
|
42
|
+
function clamp(size) {
|
|
43
|
+
const upper = props.max ?? Number.POSITIVE_INFINITY;
|
|
44
|
+
return Math.round(Math.min(Math.max(size, props.min), upper));
|
|
45
|
+
}
|
|
46
|
+
function set(size) {
|
|
47
|
+
const next = clamp(size);
|
|
48
|
+
if (next !== model.value) model.value = next;
|
|
49
|
+
}
|
|
50
|
+
function isReversed() {
|
|
51
|
+
const rtl = props.orientation === "vertical" && handle.value !== null && getComputedStyle(handle.value).direction === "rtl";
|
|
52
|
+
return props.target === "after" !== rtl;
|
|
53
|
+
}
|
|
54
|
+
function pointerPosition(event) {
|
|
55
|
+
return props.orientation === "vertical" ? event.clientX : event.clientY;
|
|
56
|
+
}
|
|
57
|
+
function onPointerDown(event) {
|
|
58
|
+
if (event.button !== 0) return;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
handle.value?.focus({ preventScroll: true });
|
|
61
|
+
handle.value?.setPointerCapture(event.pointerId);
|
|
62
|
+
origin = { position: pointerPosition(event), size: model.value, pointer: event.pointerId };
|
|
63
|
+
dragging.value = true;
|
|
64
|
+
emit("resizeStart");
|
|
65
|
+
}
|
|
66
|
+
function onPointerMove(event) {
|
|
67
|
+
if (!dragging.value || event.pointerId !== origin.pointer) return;
|
|
68
|
+
const delta = pointerPosition(event) - origin.position;
|
|
69
|
+
set(origin.size + (isReversed() ? -delta : delta));
|
|
70
|
+
}
|
|
71
|
+
function stop() {
|
|
72
|
+
if (!dragging.value) return;
|
|
73
|
+
dragging.value = false;
|
|
74
|
+
if (handle.value?.hasPointerCapture(origin.pointer))
|
|
75
|
+
handle.value.releasePointerCapture(origin.pointer);
|
|
76
|
+
emit("resizeEnd", model.value);
|
|
77
|
+
}
|
|
78
|
+
function onKeydown(event) {
|
|
79
|
+
const vertical = props.orientation === "vertical";
|
|
80
|
+
const forward = vertical ? "ArrowRight" : "ArrowDown";
|
|
81
|
+
const backward = vertical ? "ArrowLeft" : "ArrowUp";
|
|
82
|
+
let next = null;
|
|
83
|
+
if (event.key === "Home") next = props.min;
|
|
84
|
+
else if (event.key === "End" && props.max !== void 0) next = props.max;
|
|
85
|
+
else if (event.key === forward || event.key === backward) {
|
|
86
|
+
const grows = event.key === forward !== isReversed();
|
|
87
|
+
next = model.value + (grows ? props.step : -props.step);
|
|
88
|
+
}
|
|
89
|
+
if (next === null) return;
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
set(next);
|
|
92
|
+
}
|
|
93
|
+
onBeforeUnmount(stop);
|
|
94
|
+
</script>
|