@xleddyl/443-components-vue 0.2.3 → 0.4.0
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/README.md +106 -19
- package/dist/chart/BarChart.vue.d.ts +2 -2
- package/dist/chart/ChartLegend.vue.d.ts +4 -4
- package/dist/chart/ChartPanel.vue.d.ts +2 -2
- package/dist/chart/ChartSummary.vue.d.ts +2 -2
- package/dist/chart/DoughnutChart.vue.d.ts +2 -2
- package/dist/chart/LineChart.vue.d.ts +2 -2
- package/dist/components/core/Button.vue.d.ts +2 -2
- package/dist/components/core/FieldBoundary.vue +14 -0
- package/dist/components/core/FieldBoundary.vue.d.ts +15 -0
- package/dist/components/core/FieldMessage.vue +28 -0
- package/dist/components/core/FieldMessage.vue.d.ts +409 -0
- package/dist/components/core/Form.vue +109 -11
- package/dist/components/core/Form.vue.d.ts +45 -6
- package/dist/components/core/FormAlerts.vue +30 -0
- package/dist/components/core/FormAlerts.vue.d.ts +393 -0
- package/dist/components/core/FormField.vue +54 -17
- package/dist/components/core/FormField.vue.d.ts +5 -4
- package/dist/components/core/Icon.vue.d.ts +2 -2
- package/dist/components/core/Input.vue.d.ts +4 -4
- package/dist/components/core/Kbd.vue.d.ts +2 -2
- package/dist/components/core/Root.vue.d.ts +6 -6
- package/dist/components/core/Spinner.vue +13 -1
- package/dist/components/core/Spinner.vue.d.ts +4 -2
- package/dist/components/core/Textarea.vue.d.ts +4 -4
- package/dist/components/core/VisuallyHidden.vue.d.ts +6 -6
- package/dist/components/core/index.d.ts +3 -0
- package/dist/components/core/index.mjs +3 -0
- package/dist/components/data/Avatar.vue.d.ts +2 -2
- package/dist/components/data/AvatarGroup.vue.d.ts +2 -2
- package/dist/components/data/Badge.vue.d.ts +2 -2
- package/dist/components/data/DescriptionList.vue.d.ts +2 -2
- package/dist/components/data/FilterPill.vue +35 -0
- package/dist/components/data/FilterPill.vue.d.ts +445 -0
- package/dist/components/data/FilterPills.vue +100 -27
- package/dist/components/data/FilterPills.vue.d.ts +47 -411
- package/dist/components/data/Pagination.vue.d.ts +4 -4
- package/dist/components/data/SelectionBar.vue +81 -0
- package/dist/components/data/SelectionBar.vue.d.ts +427 -0
- package/dist/components/data/Stat.vue.d.ts +8 -8
- package/dist/components/data/Tag.vue.d.ts +4 -4
- package/dist/components/data/Timeline.vue.d.ts +2 -2
- package/dist/components/data/Tree.vue +245 -21
- package/dist/components/data/Tree.vue.d.ts +40 -10
- package/dist/components/data/index.d.ts +3 -0
- package/dist/components/data/index.mjs +3 -0
- package/dist/components/data/types.d.ts +26 -2
- package/dist/components/feedback/Alert.vue.d.ts +18 -18
- package/dist/components/feedback/EmptyState.vue.d.ts +2 -2
- package/dist/components/feedback/LoadingOverlay.vue.d.ts +2 -2
- package/dist/components/feedback/Meter.vue.d.ts +2 -2
- package/dist/components/feedback/Progress.vue.d.ts +2 -2
- package/dist/components/feedback/ProgressRing.vue.d.ts +2 -2
- package/dist/components/feedback/Skeleton.vue.d.ts +3 -3
- package/dist/components/forms/Calendar.vue.d.ts +4 -4
- package/dist/components/forms/CheckboxGroup.vue +2 -1
- package/dist/components/forms/ColorInput.vue.d.ts +6 -6
- package/dist/components/forms/DateInput.vue.d.ts +14 -14
- package/dist/components/forms/DatePicker.vue.d.ts +6 -6
- package/dist/components/forms/FileInput.vue +160 -34
- package/dist/components/forms/FileInput.vue.d.ts +43 -15
- package/dist/components/forms/InputAddon.vue.d.ts +2 -2
- package/dist/components/forms/InputGroup.vue.d.ts +2 -2
- package/dist/components/forms/NumberInput.vue.d.ts +6 -6
- package/dist/components/forms/PasswordInput.vue.d.ts +16 -16
- package/dist/components/forms/PinInput.vue.d.ts +6 -6
- package/dist/components/forms/Radio.vue.d.ts +2 -2
- package/dist/components/forms/RadioGroup.vue +2 -1
- package/dist/components/forms/SegmentedControl.vue +33 -8
- package/dist/components/forms/SegmentedControl.vue.d.ts +15 -7
- package/dist/components/forms/Slider.vue.d.ts +6 -6
- package/dist/components/forms/Switch.vue.d.ts +6 -6
- package/dist/components/forms/TimeInput.vue.d.ts +16 -16
- package/dist/components/forms/types.d.ts +17 -0
- package/dist/components/layout/Accordion.vue +25 -5
- package/dist/components/layout/Accordion.vue.d.ts +11 -8
- package/dist/components/layout/AppShell.vue +1 -1
- package/dist/components/layout/AppShell.vue.d.ts +7 -7
- package/dist/components/layout/Breadcrumbs.vue +28 -20
- package/dist/components/layout/Breadcrumbs.vue.d.ts +18 -3
- package/dist/components/layout/Card.vue +22 -3
- package/dist/components/layout/Card.vue.d.ts +10 -4
- package/dist/components/layout/CopyButton.vue.d.ts +4 -4
- package/dist/components/layout/Grid.vue.d.ts +2 -2
- package/dist/components/layout/NavLink.vue.d.ts +8 -8
- package/dist/components/layout/PageHeader.vue +10 -1
- package/dist/components/layout/PageHeader.vue.d.ts +17 -9
- package/dist/components/layout/Separator.vue.d.ts +2 -2
- package/dist/components/layout/Sidebar.vue.d.ts +2 -2
- package/dist/components/layout/SidebarSection.vue.d.ts +2 -2
- package/dist/components/layout/Stack.vue.d.ts +6 -6
- package/dist/components/layout/Tabs.vue +37 -7
- package/dist/components/layout/Tabs.vue.d.ts +11 -4
- package/dist/components/layout/ThemeSwitch.vue.d.ts +2 -2
- package/dist/components/layout/Toolbar.vue.d.ts +2 -2
- package/dist/components/layout/types.d.ts +8 -1
- package/dist/components/overlays/CommandPalette.vue +35 -8
- package/dist/components/overlays/CommandPalette.vue.d.ts +273 -497
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +8 -6
- package/dist/components/overlays/ConfirmHost.vue +5 -1
- package/dist/components/overlays/ConfirmHost.vue.d.ts +10 -8
- package/dist/components/overlays/ContextMenu.vue.d.ts +4 -4
- package/dist/components/overlays/Drawer.vue +4 -2
- package/dist/components/overlays/Drawer.vue.d.ts +8 -6
- package/dist/components/overlays/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/overlays/HoverCard.vue +2 -1
- package/dist/components/overlays/HoverCard.vue.d.ts +8 -8
- package/dist/components/overlays/Modal.vue +5 -3
- package/dist/components/overlays/Modal.vue.d.ts +8 -6
- package/dist/components/overlays/Popover.vue +2 -1
- package/dist/components/overlays/Popover.vue.d.ts +8 -8
- package/dist/components/overlays/Toaster.vue.d.ts +4 -4
- package/dist/components/overlays/Tooltip.vue.d.ts +2 -2
- package/dist/components/overlays/types.d.ts +11 -5
- package/dist/components/templates/AccountMenu.vue.d.ts +6 -6
- package/dist/components/templates/AppearanceSettings.vue.d.ts +2 -2
- package/dist/components/templates/AuthLayout.vue.d.ts +2 -2
- package/dist/components/templates/Brand.vue +34 -5
- package/dist/components/templates/Brand.vue.d.ts +20 -15
- package/dist/components/templates/DashboardLayout.vue +49 -10
- package/dist/components/templates/DashboardLayout.vue.d.ts +332 -553
- package/dist/components/templates/DashboardPage.vue.d.ts +2 -2
- package/dist/components/templates/DetailPage.vue.d.ts +4 -4
- package/dist/components/templates/EmptyPage.vue.d.ts +2 -2
- package/dist/components/templates/ErrorPage.vue.d.ts +2 -2
- package/dist/components/templates/ListPage.vue +17 -11
- package/dist/components/templates/ListPage.vue.d.ts +3 -3
- package/dist/components/templates/NotFoundPage.vue.d.ts +1 -1
- package/dist/components/templates/SaveBar.vue.d.ts +4 -4
- package/dist/components/templates/SettingsGroup.vue.d.ts +2 -2
- package/dist/components/templates/SettingsModal.vue +5 -2
- package/dist/components/templates/SettingsModal.vue.d.ts +13 -8
- package/dist/components/templates/SettingsPage.vue.d.ts +4 -4
- package/dist/components/templates/SettingsSection.vue.d.ts +12 -8
- package/dist/components/templates/types.d.ts +25 -2
- package/dist/composables/core.d.ts +1 -0
- package/dist/composables/core.mjs +1 -0
- package/dist/composables/useField.d.ts +8 -1
- package/dist/composables/useField.mjs +41 -10
- package/dist/composables/useFieldBoundary.d.ts +2 -0
- package/dist/composables/useFieldBoundary.mjs +9 -0
- package/dist/composables/useFileDrop.d.ts +20 -0
- package/dist/composables/useFileDrop.mjs +115 -7
- package/dist/composables/useForm.d.ts +36 -19
- package/dist/composables/useForm.mjs +258 -51
- package/dist/editor/RichTextEditor.vue +32 -4
- package/dist/editor/RichTextEditor.vue.d.ts +11 -6
- package/dist/editor/rich-text-editor.css +1 -1
- package/dist/editor/types.d.ts +3 -0
- package/dist/grid/GridToolbar.vue.d.ts +4 -4
- package/dist/grid/cells/BadgeCell.vue.d.ts +2 -2
- package/dist/grid/cells/BooleanCell.vue.d.ts +2 -2
- package/dist/grid/cells/DateCell.vue.d.ts +2 -2
- package/dist/grid/cells/ImageCell.vue.d.ts +2 -2
- package/dist/grid/cells/LinkCell.vue.d.ts +2 -2
- package/dist/internal/core/ButtonElement.d.ts +2 -0
- package/dist/internal/core/ButtonElement.mjs +8 -0
- package/dist/internal/data/tree.d.ts +8 -0
- package/dist/internal/data/tree.mjs +41 -0
- package/dist/internal/forms/files.d.ts +9 -0
- package/dist/internal/forms/files.mjs +32 -1
- package/dist/internal/forms/standard-schema.d.ts +17 -0
- package/dist/internal/forms/standard-schema.mjs +40 -0
- package/dist/internal/keys.d.ts +2 -1
- package/dist/internal/keys.mjs +1 -0
- package/dist/internal/overlays/DialogFrame.vue +17 -7
- package/dist/internal/overlays/DialogFrame.vue.d.ts +9 -5
- package/dist/internal/overlays/MenuList.vue +2 -0
- package/dist/internal/overlays/MenuList.vue.d.ts +5 -5
- package/dist/internal/overlays/OverlayView.vue +2 -0
- package/dist/internal/overlays/OverlayView.vue.d.ts +14 -12
- package/dist/internal/overlays/dialog.d.ts +4 -1
- package/dist/internal/overlays/dialog.mjs +39 -5
- package/dist/internal/overlays/stack.d.ts +2 -1
- package/dist/locale/en.mjs +19 -2
- package/dist/locale/it.mjs +19 -2
- package/dist/locale/types.d.ts +17 -0
- package/dist/nuxt/module.d.ts +1 -0
- package/dist/nuxt/module.mjs +6 -3
- package/dist/nuxt/runtime/layouts/auth.vue.d.ts +8 -8
- package/dist/nuxt/runtime/layouts/dashboard.vue.d.ts +8 -8
- package/dist/styles/base.css +2 -0
- package/dist/styles/core/button.css +1 -13
- package/dist/styles/core/field-message.css +34 -0
- package/dist/styles/core/form-field.css +0 -23
- package/dist/styles/core/form.css +11 -0
- package/dist/styles/core/kbd.css +2 -2
- package/dist/styles/core/spinner.css +19 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/data/avatar.css +1 -1
- package/dist/styles/data/badge.css +1 -1
- package/dist/styles/data/filter-pills.css +40 -4
- package/dist/styles/data/pagination.css +0 -1
- package/dist/styles/data/selection-bar.css +89 -0
- package/dist/styles/data/stat.css +1 -6
- package/dist/styles/data/table.css +1 -3
- package/dist/styles/data/tag.css +1 -4
- package/dist/styles/data/tree.css +163 -2
- package/dist/styles/data.css +1 -0
- package/dist/styles/feedback/alert.css +0 -1
- package/dist/styles/feedback/empty-state.css +0 -1
- package/dist/styles/forms/calendar.css +1 -1
- package/dist/styles/forms/color-input.css +1 -1
- package/dist/styles/forms/combobox.css +0 -1
- package/dist/styles/forms/date-picker.css +1 -1
- package/dist/styles/forms/file-input.css +17 -1
- package/dist/styles/forms/number-input.css +1 -1
- package/dist/styles/forms/password-input.css +1 -5
- package/dist/styles/forms/segmented.css +8 -0
- package/dist/styles/forms/select.css +1 -1
- package/dist/styles/forms/slider.css +2 -2
- package/dist/styles/forms/switch.css +0 -1
- package/dist/styles/layout/accordion.css +22 -1
- package/dist/styles/layout/app-shell.css +4 -0
- package/dist/styles/layout/breadcrumbs.css +16 -1
- package/dist/styles/layout/card.css +20 -6
- package/dist/styles/layout/copy-button.css +2 -2
- package/dist/styles/layout/nav-link.css +2 -3
- package/dist/styles/layout/sidebar-nav.css +1 -1
- package/dist/styles/layout/sidebar.css +2 -2
- package/dist/styles/layout/tabs.css +65 -3
- package/dist/styles/layout/theme-switch.css +1 -3
- package/dist/styles/overlays/command.css +21 -3
- package/dist/styles/overlays/confirm.css +0 -1
- package/dist/styles/overlays/menu.css +3 -5
- package/dist/styles/overlays/modal.css +38 -0
- package/dist/styles/overlays/toast.css +0 -1
- package/dist/styles/templates/auth-layout.css +0 -1
- package/dist/styles/templates/brand.css +15 -0
- package/dist/styles/templates/empty-page.css +4 -4
- package/dist/styles/templates/form-page.css +1 -1
- package/dist/styles/templates/list-page.css +2 -6
- package/dist/styles/templates/page.css +1 -1
- package/dist/styles/templates/settings-modal.css +2 -3
- package/dist/styles/tokens.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -194,6 +194,8 @@ k: {
|
|
|
194
194
|
}
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
+
A collection can also come from any Iconify JSON file: `{ prefix: 'brand', from: '~/assets/brand-icons.json' }` (a module that ships its own collection passes an absolute path). When two entries use the same prefix, the first one wins, so the host app overrides a collection added by another module.
|
|
198
|
+
|
|
197
199
|
Each collection is a separate chunk loaded the first time one of its icons renders. The server loads every collection, records which ones a page used and the client loads those before hydration, so server rendered icons never flash. `include` and `exclude` take `*` wildcards and keep a collection small.
|
|
198
200
|
|
|
199
201
|
## Languages
|
|
@@ -221,16 +223,62 @@ const form = useForm({
|
|
|
221
223
|
})
|
|
222
224
|
```
|
|
223
225
|
|
|
226
|
+
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.
|
|
227
|
+
|
|
224
228
|
Built-in messages follow the active language. `messages` overrides them for one form.
|
|
225
229
|
|
|
230
|
+
Forms can also drive values they do not own. Pass `values` (a reactive object, ref or getter) and the form reads, validates, tracks dirty state and submits it. The schema becomes optional and only adds rules, labels and `required`; its `initial` values are not used. `reset()` restores the clean snapshot, `reset(next)` replaces the values and makes them the new clean state (`form.reset(record.value)` after a save). `validator` accepts a ref or getter, so it can change with the record type:
|
|
231
|
+
|
|
232
|
+
```ts
|
|
233
|
+
const record = ref({ title: '', slug: '', blocks: [{ title: '' }] })
|
|
234
|
+
|
|
235
|
+
const form = useForm({
|
|
236
|
+
values: record,
|
|
237
|
+
validator: computed(() => schemaFor(record.value)),
|
|
238
|
+
warnings: (values) => ({ slug: values.slug.length < 4 ? 'Short slug' : undefined }),
|
|
239
|
+
onSubmit: (values) => save(values),
|
|
240
|
+
})
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`warnings` takes a Standard Schema or a function returning `{ [path]: message }` (or issues). Warnings are live, never block submit, are exposed as `form.warnings` (keyed like errors) and `form.rootWarnings`, and `FormField` reads them by `name`. Errors still appear only after the first submit or as `validateOn` says.
|
|
244
|
+
|
|
245
|
+
A control can report its own error (a JSON field that fails to parse) through the surrounding `FormField`: `const control = useFieldControl()` then `control.setControlError(message | undefined)`. The form error wins over it, and it clears when the control unmounts. `FieldMessage` renders the same inline error, warning or hint line outside a `FormField` (`tone="danger" | "warning" | "neutral"`, `icon`, `id` for `aria-describedby`).
|
|
246
|
+
|
|
247
|
+
`validate()` is async. When every rule, `validate` function and Standard Schema is synchronous, `validateSync()` answers immediately and fills `form.errors` in the same tick, so a caller can reveal the first error without parsing again (it throws when it meets a Promise):
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
if (!form.validateSync()) revealField(Object.keys(form.errors).find((key) => form.errors[key]))
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Nested forms. Overlays stay in the DOM, so a `Form` inside a Modal opened from another `Form` would nest `<form>` elements. Render the inner one with `as="div"`: it submits on Enter in its inputs and through its own submit and reset buttons, and keeps those events from reaching the outer form. An outer `Form` also ignores submit events whose target is not its own form element. A component that renders fields without `Form` gives them the form with `provideForm(form)` and shows the root alerts with `<KFormAlerts />` (it reads `rootErrors` and `rootWarnings` from the provided form, or takes `errors` and `warnings` props). `Form` exposes `submit()`, `reset()` and `el`.
|
|
254
|
+
|
|
255
|
+
```vue
|
|
256
|
+
<KForm :form="entry">
|
|
257
|
+
<KModal v-model:open="open" title="New tag">
|
|
258
|
+
<KForm as="div" :form="tag">...</KForm>
|
|
259
|
+
</KModal>
|
|
260
|
+
</KForm>
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Several controls in one `FormField`. Only the primary control takes the field id, name, description and invalid state. Wrap secondary controls (a search input above a Tree) in `<KFieldBoundary auxiliary>`, or call `useFieldControl({ role: 'auxiliary' })` in your own control: they keep their own id and only follow `disabled`. `<KFieldBoundary>` without `auxiliary` cuts the field context completely, like the overlays do. A primary control that is not labelable (a tree, a group, a contenteditable editor) passes `useFieldControl({ labelable: false })`; `FormField` then drops `for` from its label and the control uses `aria-labelledby` with `field.labelId` instead. `Tree`, `CheckboxGroup`, `RadioGroup`, `SegmentedControl` and `RichTextEditor` already do.
|
|
264
|
+
|
|
265
|
+
```vue
|
|
266
|
+
<KFormField label="Folder">
|
|
267
|
+
<KFieldBoundary auxiliary>
|
|
268
|
+
<KInput v-model="query" aria-label="Find a folder" />
|
|
269
|
+
</KFieldBoundary>
|
|
270
|
+
<KTree v-model:selected="folder" :nodes="nodes" />
|
|
271
|
+
</KFormField>
|
|
272
|
+
```
|
|
273
|
+
|
|
226
274
|
## Components
|
|
227
275
|
|
|
228
276
|
| Group | Components |
|
|
229
277
|
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
230
|
-
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, Form, Kbd, VisuallyHidden
|
|
278
|
+
| core | Root, Icon, Button, Spinner, Input, Textarea, FormField, FieldMessage, FieldBoundary, Form, FormAlerts, Kbd, VisuallyHidden |
|
|
231
279
|
| forms | Calendar, Checkbox, CheckboxGroup, ColorInput, Combobox, DateInput, DatePicker, FileInput, InputAddon, InputGroup, NumberInput, PasswordInput, PinInput, Radio, RadioGroup, SegmentedControl, Select, Slider, Switch, TimeInput |
|
|
232
280
|
| overlays | CommandPalette, ConfirmDialog, ConfirmHost, ContextMenu, Drawer, DropdownMenu, HoverCard, Modal, OverlayHost, Popover, Toaster, Tooltip |
|
|
233
|
-
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPills, Pagination, Stat, Table, Tag, Timeline, Tree
|
|
281
|
+
| data | Avatar, AvatarGroup, Badge, DescriptionList, FilterPill, FilterPills, Pagination, SelectionBar, Stat, Table, Tag, Timeline, Tree |
|
|
234
282
|
| layout | Accordion, AppShell, Breadcrumbs, Card, CopyButton, Grid, NavLink, PageHeader, Separator, Sidebar, SidebarNav, SidebarSection, Stack, Tabs, ThemeSwitch, Toolbar |
|
|
235
283
|
| templates | DashboardLayout, AuthLayout, DashboardPage, ListPage, DetailPage, FormPage, SettingsPage, SettingsSection, SettingsModal, SettingsGroup, AppearanceSettings, SaveBar, ErrorPage, NotFoundPage, EmptyPage, Brand, AccountMenu |
|
|
236
284
|
| feedback | Alert, EmptyState, LoadingOverlay, Meter, Progress, ProgressRing, Skeleton |
|
|
@@ -238,7 +286,18 @@ Built-in messages follow the active language. `messages` overrides them for one
|
|
|
238
286
|
| editor | RichTextEditor |
|
|
239
287
|
| chart | ChartPanel, ChartLegend, LineChart, BarChart, DoughnutChart |
|
|
240
288
|
|
|
241
|
-
Composables: `useTheme`, `usePreset`, `useForm`, `useField`, `useFieldControl`, `useToast` (and `toast`), `useConfirm`, `useAlert`, `usePrompt`, `useModal`, `useDrawer`, `useOverlay`, `useModalContext`, `useLoading` (and `withLoading`), `useLoadingState`, `useHotkey`, `useCopy`, `useFileDrop
|
|
289
|
+
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`), `usePasswordStrength`, `useTableSort`, `useAppShell`, `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).
|
|
290
|
+
|
|
291
|
+
### Lists, trees and uploads
|
|
292
|
+
|
|
293
|
+
- `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). 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.
|
|
294
|
+
- `SelectionBar` shows a plural aware selected count (announced in a live region), select all (`total` plus `@select-all`) and clear (`@clear`) actions, an `#actions` slot and `placement` `inline`, `sticky` or `floating`. With `count` 0 it renders no box (only its live region), so it can sit in a flex toolbar without adding a gap; the first count after mount is announced too. `ListPage` renders it for `#bulk`.
|
|
295
|
+
- `FilterPills` is generic: the value type comes from the options, `multiple` makes the model an array and `required` drops `null` from it (like `SegmentedControl`). Options take `menu` items (a dropdown trigger showing `valueLabel`) or `panel: true`, which opens a popover with the `#panel-<value>` slot (`{ option, active, toggle, close }`, `panelLabel` names it). The `#pill` slot renders any trigger and its scope has `defaultPill`, a component that renders the built-in pill for that option, so one custom pill does not mean rewriting the others: `<component :is="defaultPill" v-else />`. `FilterPill` is exported so custom triggers match the other pills.
|
|
296
|
+
- `SegmentedControl` with `required` narrows `v-model` to a non null value. Options take `title` (tooltip and description) and `muted`, and the `#option` slot replaces the content of each option.
|
|
297
|
+
- `FileInput` takes `directory` (folder picker; dropped folders are walked, every file keeps its relative path) or `directory="drop"` (the click opens a file picker, dropped folders are still walked), `directoryAction` (an "Upload a folder" button under the dropzone, `directoryActionLabel` renames it) or the `#actions` slot (`{ browse, browseDirectory, disabled }`), `skipHidden` (ignores dot files and dot folders), `list: false` (no file list: picks and drops only emit `add`), `loading` and the `#hint` slot. `add` receives `(files, { entries: [{ file, path }], directories, source, event, dataTransfer })`; `directories` lists every folder path of a folder pick or drop, empty folders included, and `add` also fires for a drop of empty folders. `invalid` fires per file and `reject` once with every rejected file (`(events, detail)`). `acceptMode="hint"` only passes `accept` to the picker and leaves filtering to the host. The component exposes `browse()`, `browseDirectory()`, `addFiles()` and `focus()`.
|
|
298
|
+
- `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.
|
|
299
|
+
- `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`). `Accordion` takes `variant` `card` (default), `outline` (the same card without a shadow), `separated` or `plain`; items take `description`, and `contentVariant="neutral"` drops the content padding and text styling.
|
|
300
|
+
- `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']`.
|
|
242
301
|
|
|
243
302
|
## Imperative hooks
|
|
244
303
|
|
|
@@ -281,10 +340,36 @@ await run(() => api.save(form))
|
|
|
281
340
|
```
|
|
282
341
|
|
|
283
342
|
- Toasts stack behind the newest one (up to `max`, default 4) and expand on hover or focus, which also pauses their timers. Each tone has its own icon; `description` takes a string or a list of lines. `dismissible: false` hides the close button, `duration: Infinity` keeps a toast open, `progress` on the toaster shows a timer bar.
|
|
284
|
-
- `useConfirm()` resolves `true` or `false`, `useAlert()` resolves when closed, `usePrompt()` resolves the string or `null`. `useConfirm()` and `useAlert()` also take `body`, a component rendered under the description (for example a list of the pages that use a file). Prompt options: `label`, `placeholder`, `value`, `type`, `required`, `requiredText`, `validate(value)` (return an error message to keep the dialog open), `onConfirm(value)`. Without a host they fall back to the native browser dialogs.
|
|
343
|
+
- `useConfirm()` resolves `true` or `false`, `useAlert()` resolves when closed, `usePrompt()` resolves the string or `null`. `useConfirm()` and `useAlert()` also take `body`, a component rendered under the description (for example a list of the pages that use a file). The body can emit `close` to dismiss the dialog as cancelled, for example when one of its links is clicked. Prompt options: `label`, `placeholder`, `value`, `type`, `required`, `requiredText`, `validate(value)` (return an error message to keep the dialog open), `onConfirm(value)`. Without a host they fall back to the native browser dialogs.
|
|
285
344
|
- `modal.open(Component, props, options)` returns a promise for the result plus `id`, `close(result)` and `update(props)`. Options: `title`, `description`, `size`, `side` (drawers), `sheet`, `flush`, `dismissible`, `hideClose`, `closeLabel`, `as: 'modal' | 'drawer'`. Inside the component, `useModalContext<R>()` gives `close(result?)` and `setLoading(boolean)`. A component can open another modal on top; Escape and the backdrop resolve `undefined`. `modal.close(id?, result?)` and `modal.closeAll()` close from outside.
|
|
286
345
|
- `useLoading()` is ref counted: `start()` returns a stop function, `wrap(promise | fn, options?)` and `withLoading(fn)` stop when settled, `active`, `count` and `blocking` are refs. The host shows a top progress bar after `delay`, and a blocking screen (a modal dialog, so the page is inert) for tasks started with `blocking: true`. `useLoadingState({ global? })` returns a scoped `{ loading, error, run }` for buttons and forms.
|
|
287
346
|
|
|
347
|
+
### Dialogs
|
|
348
|
+
|
|
349
|
+
`Modal` and `Drawer` take `beforeClose(reason)` (`'escape' | 'backdrop' | 'close-button' | 'action'`). It runs for every user close: Escape, a backdrop click, the close button and the `close` function of the slots. Return `false` (or a promise of `false`) to keep the dialog open, for example to ask before discarding changes. Setting `v-model:open` to `false` from the parent always closes. `useModal().open()` and `useDrawer().open()` take `beforeClose` too.
|
|
350
|
+
|
|
351
|
+
```vue
|
|
352
|
+
<KDrawer v-model:open="open" title="Spring campaign" :before-close="confirmDiscard">
|
|
353
|
+
<template #title-trailing><KBadge dot tone="success" label="Published" /></template>
|
|
354
|
+
...
|
|
355
|
+
</KDrawer>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
```ts
|
|
359
|
+
const confirm = useConfirm()
|
|
360
|
+
const confirmDiscard = () => !dirty.value || confirm({ title: 'Discard changes?', tone: 'danger' })
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
- `#title-trailing` puts badges or a status next to the title without replacing `#header`.
|
|
364
|
+
- `size="fullscreen"` on a Modal fills the viewport edge to edge (no radius, no outer padding, safe area insets inside the panel) and never turns into a bottom sheet.
|
|
365
|
+
- Overlays reset the field context: controls inside a Modal, Drawer, CommandPalette, menu, Popover or HoverCard panel do not inherit the id, description or invalid state of a `FormField` that contains the trigger. Call `provideFieldBoundary()` in your own overlay components to do the same.
|
|
366
|
+
|
|
367
|
+
`CommandPalette`: items take typed `data` (`CommandItem<T>`, `CommandGroup<T>`), which reaches the `#item` slot and the `select` event typed; `emptyText` also takes `(query) => string`. Groups take a `description` (shown after the label), the `#group-label` slot (`{ group, label, description, recent }`) replaces the label, and `notice` or the `#after-results` slot (`{ query, count }`) adds a line under the results, for example "Showing the first results".
|
|
368
|
+
|
|
369
|
+
- `Brand`: `logo` takes an image URL, trusted inline SVG markup (`'<svg ...>'`) or a component; the `#logo` slot replaces the boxed mark; `show-name` keeps the name visible next to a logo.
|
|
370
|
+
- `Card`: `selected` gives a pressed look (`aria-pressed` on `as="button"`, `aria-selected` with `role="option"` and similar roles); `:animated="false"` turns off the entrance animation.
|
|
371
|
+
- `Spinner`: `block` renders a centered loading state that fills its container, with `label` shown under the spinner: `<KSpinner block size="lg" label="Loading entries" />`.
|
|
372
|
+
|
|
288
373
|
## Layouts and page templates
|
|
289
374
|
|
|
290
375
|
Ready defaults to start a dashboard project: an app frame, an auth frame and page templates with loading, empty and error states. The default look is the nuxt-cms one: the sidebar sits on the canvas and the content is an inset raised panel.
|
|
@@ -306,21 +391,22 @@ Ready defaults to start a dashboard project: an app frame, an auth frame and pag
|
|
|
306
391
|
</KDashboardLayout>
|
|
307
392
|
```
|
|
308
393
|
|
|
309
|
-
| Prop
|
|
310
|
-
|
|
|
311
|
-
| `variant`
|
|
312
|
-
| `navigation`
|
|
313
|
-
| `currentPath`
|
|
314
|
-
| `brandName`, `brandSubtitle`, `brandIcon`, `brandLogo`, `brandTo` | `brandTo: '/'` | Or the `#brand` slot.
|
|
315
|
-
| `account`
|
|
316
|
-
| `accountAction`
|
|
317
|
-
| `breadcrumbs`
|
|
318
|
-
| `search`
|
|
319
|
-
| `
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
| `
|
|
394
|
+
| Prop | Default | Notes |
|
|
395
|
+
| ---------------------------------------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
396
|
+
| `variant` | `'inset'` | `inset` (canvas sidebar, inset content panel), `sidebar` (bordered sidebar, full bleed content), `floating` (raised sidebar card on the canvas). |
|
|
397
|
+
| `navigation` | | `NavItem[]` or `NavSection[]` (`{ label?, items }`). Items: `label`, `to`/`href`, `icon`, `badge`, `exact`, `active`, `external`, `disabled`, `children`. |
|
|
398
|
+
| `currentPath` | router path | Active state is computed from the router (`$route`) with prefix matching (`/` and `exact` items match exactly). |
|
|
399
|
+
| `brandName`, `brandSubtitle`, `brandIcon`, `brandLogo`, `brandShowName`, `brandTo` | `brandTo: '/'` | `brandLogo` takes an image URL, inline SVG markup or a component; the name is hidden next to a logo unless `brandShowName`. Or the `#brand` slot. |
|
|
400
|
+
| `account` | | `{ name, email?, avatar?, role?, menu? }`. Shown as a row (avatar, name, email, chevron) at the bottom of the sidebar. |
|
|
401
|
+
| `accountAction` | `'settings'` | `settings`: the row opens a `SettingsModal` (`settingsSections`, `settingsPresets`, `v-model:settings-open`, `v-model:settings-section`, `@sign-out`). `menu`: a DropdownMenu with `account.menu`, selections emit `account-select`. Or replace it with the `#account` slot. |
|
|
402
|
+
| `breadcrumbs` | | Rendered in the desktop topbar. `#topbar` replaces them, `#actions` adds buttons on the right. |
|
|
403
|
+
| `search` | `false` | `true` adds a CommandPalette with every navigation item, an array adds your own command groups, an async function `(query, signal) => CommandGroup<T>[]` searches on your server (item `data` reaches `#search-item` typed) (matching navigation items come first unless `searchNavigation` is `false`). `#search` replaces it. |
|
|
404
|
+
| `searchProps` | | Options for the built-in CommandPalette: `minQueryLength`, `debounce`, `placeholder`, `label`, `emptyText` (a string or `(query) => string`), `minQueryText`, `errorText`, `loadingText`, `resultsText`, `notice`, `recentKey`, footer labels. Slots `#search-item`, `#search-empty`, `#search-group-label` and `#search-after-results` reach the palette. |
|
|
405
|
+
| `themeSwitch` | `'sidebar'` | `'sidebar'`, `'topbar'` or `false`. |
|
|
406
|
+
| `collapsible`, `v-model:collapsed`, `storageKey` | `true`, `'k-sidebar-collapsed'` | Icon rail on desktop. Persisted in a cookie under Nuxt (rendered on the server, no flash) or `localStorage` elsewhere. `false` disables persistence. |
|
|
407
|
+
| `shortcut` | `'mod+b'` | Toggles the rail on desktop and the drawer on mobile. `searchShortcut` defaults to `mod+k`. |
|
|
408
|
+
| `v-model:open` | `false` | Mobile drawer (below 768px of shell width): scrim, focus moves into the drawer, the content is `inert`, Escape and the scrim close it and focus returns to the burger. |
|
|
409
|
+
| `fluid`, `viewTransition` | `false`, `true` | Full width content; `view-transition-name` on sidebar and panel so page transitions keep the frame still. |
|
|
324
410
|
|
|
325
411
|
Slots: `brand`, `search`, `sidebar` (replaces the navigation), `sidebar-footer`, `account`, `topbar-brand`, `topbar`, `actions`, default, plus `settings-section-<id>`, `settings-actions-<id>` 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`.
|
|
326
412
|
|
|
@@ -357,6 +443,7 @@ A large dialog (60rem) with a section nav on the left and the content on the rig
|
|
|
357
443
|
- Built-in sections, used when no `#section-<id>` slot fills them: `account` (profile card, your `#account-fields`, a sign out button) and `appearance` (`AppearanceSettings`: theme cards light, dark, system and preset cards; `presets` limits or hides them).
|
|
358
444
|
- `@sign-out` adds a Sign out item at the bottom of the nav and in the account section.
|
|
359
445
|
- Labels: `title` (accessible name of the dialog, default `Settings`), `closeLabel`, `navLabel`, `signOutLabel`, `accountLabel`, `accountText`, `appearanceLabel`, `appearanceText`, `sessionLabel`, `sessionText`, `themeLabel`, `themeText`, `presetLabel`, `presetText`.
|
|
446
|
+
- `hide-session` hides the Session group (sign out) in the account section; the Sign out item in the nav stays. `beforeClose` works as on Modal.
|
|
360
447
|
- Accessibility: native modal `<dialog>` (focus trap, Escape, focus returns to the trigger), the nav is a labelled `nav` of buttons with `aria-current` and `aria-controls`, the content is a `section` labelled by its heading.
|
|
361
448
|
|
|
362
449
|
`SettingsGroup` (`label`, `description`, `row`, `#actions`) lays out a block inside a section; `AppearanceSettings` works on its own too, for example inside a `SettingsPage`.
|
|
@@ -66,7 +66,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
66
66
|
'aria-colindex'?: (string | number) | undefined;
|
|
67
67
|
'aria-colspan'?: (string | number) | undefined;
|
|
68
68
|
'aria-controls'?: string | undefined | undefined;
|
|
69
|
-
'aria-current'?: "page" | "
|
|
69
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
70
70
|
'aria-describedby'?: string | undefined | undefined;
|
|
71
71
|
'aria-details'?: string | undefined | undefined;
|
|
72
72
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -269,7 +269,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
269
269
|
'aria-colindex'?: (string | number) | undefined;
|
|
270
270
|
'aria-colspan'?: (string | number) | undefined;
|
|
271
271
|
'aria-controls'?: string | undefined | undefined;
|
|
272
|
-
'aria-current'?: "page" | "
|
|
272
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
273
273
|
'aria-describedby'?: string | undefined | undefined;
|
|
274
274
|
'aria-details'?: string | undefined | undefined;
|
|
275
275
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -8,7 +8,6 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
8
8
|
style?: import("vue").StyleValue;
|
|
9
9
|
results?: (string | number) | undefined;
|
|
10
10
|
placeholder?: string | undefined | undefined;
|
|
11
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
12
11
|
class?: import("vue").ClassValue;
|
|
13
12
|
role?: string | undefined | undefined;
|
|
14
13
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -120,7 +119,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
120
119
|
'aria-colindex'?: (string | number) | undefined;
|
|
121
120
|
'aria-colspan'?: (string | number) | undefined;
|
|
122
121
|
'aria-controls'?: string | undefined | undefined;
|
|
123
|
-
'aria-current'?: "page" | "
|
|
122
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
124
123
|
'aria-describedby'?: string | undefined | undefined;
|
|
125
124
|
'aria-details'?: string | undefined | undefined;
|
|
126
125
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -157,6 +156,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
157
156
|
'aria-valuemin'?: (string | number) | undefined;
|
|
158
157
|
'aria-valuenow'?: (string | number) | undefined;
|
|
159
158
|
'aria-valuetext'?: string | undefined | undefined;
|
|
159
|
+
ref?: import("vue").VNodeRef | undefined;
|
|
160
160
|
ref_for?: boolean | undefined | undefined;
|
|
161
161
|
ref_key?: string | undefined | undefined;
|
|
162
162
|
accesskey?: string | undefined | undefined;
|
|
@@ -204,7 +204,6 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
204
204
|
style?: import("vue").StyleValue;
|
|
205
205
|
results?: (string | number) | undefined;
|
|
206
206
|
placeholder?: string | undefined | undefined;
|
|
207
|
-
ref?: import("vue").VNodeRef | undefined;
|
|
208
207
|
class?: import("vue").ClassValue;
|
|
209
208
|
role?: string | undefined | undefined;
|
|
210
209
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -316,7 +315,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
316
315
|
'aria-colindex'?: (string | number) | undefined;
|
|
317
316
|
'aria-colspan'?: (string | number) | undefined;
|
|
318
317
|
'aria-controls'?: string | undefined | undefined;
|
|
319
|
-
'aria-current'?: "page" | "
|
|
318
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
320
319
|
'aria-describedby'?: string | undefined | undefined;
|
|
321
320
|
'aria-details'?: string | undefined | undefined;
|
|
322
321
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -353,6 +352,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
353
352
|
'aria-valuemin'?: (string | number) | undefined;
|
|
354
353
|
'aria-valuenow'?: (string | number) | undefined;
|
|
355
354
|
'aria-valuetext'?: string | undefined | undefined;
|
|
355
|
+
ref?: import("vue").VNodeRef | undefined;
|
|
356
356
|
ref_for?: boolean | undefined | undefined;
|
|
357
357
|
ref_key?: string | undefined | undefined;
|
|
358
358
|
accesskey?: string | undefined | undefined;
|
|
@@ -72,7 +72,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
72
72
|
'aria-colindex'?: (string | number) | undefined;
|
|
73
73
|
'aria-colspan'?: (string | number) | undefined;
|
|
74
74
|
'aria-controls'?: string | undefined | undefined;
|
|
75
|
-
'aria-current'?: "page" | "
|
|
75
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
76
76
|
'aria-describedby'?: string | undefined | undefined;
|
|
77
77
|
'aria-details'?: string | undefined | undefined;
|
|
78
78
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -271,7 +271,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
271
271
|
'aria-colindex'?: (string | number) | undefined;
|
|
272
272
|
'aria-colspan'?: (string | number) | undefined;
|
|
273
273
|
'aria-controls'?: string | undefined | undefined;
|
|
274
|
-
'aria-current'?: "page" | "
|
|
274
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
275
275
|
'aria-describedby'?: string | undefined | undefined;
|
|
276
276
|
'aria-details'?: string | undefined | undefined;
|
|
277
277
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -62,7 +62,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
62
62
|
'aria-colindex'?: (string | number) | undefined;
|
|
63
63
|
'aria-colspan'?: (string | number) | undefined;
|
|
64
64
|
'aria-controls'?: string | undefined | undefined;
|
|
65
|
-
'aria-current'?: "page" | "
|
|
65
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
66
66
|
'aria-describedby'?: string | undefined | undefined;
|
|
67
67
|
'aria-details'?: string | undefined | undefined;
|
|
68
68
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -262,7 +262,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
262
262
|
'aria-colindex'?: (string | number) | undefined;
|
|
263
263
|
'aria-colspan'?: (string | number) | undefined;
|
|
264
264
|
'aria-controls'?: string | undefined | undefined;
|
|
265
|
-
'aria-current'?: "page" | "
|
|
265
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
266
266
|
'aria-describedby'?: string | undefined | undefined;
|
|
267
267
|
'aria-details'?: string | undefined | undefined;
|
|
268
268
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -70,7 +70,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
70
70
|
'aria-colindex'?: (string | number) | undefined;
|
|
71
71
|
'aria-colspan'?: (string | number) | undefined;
|
|
72
72
|
'aria-controls'?: string | undefined | undefined;
|
|
73
|
-
'aria-current'?: "page" | "
|
|
73
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
74
74
|
'aria-describedby'?: string | undefined | undefined;
|
|
75
75
|
'aria-details'?: string | undefined | undefined;
|
|
76
76
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -273,7 +273,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
273
273
|
'aria-colindex'?: (string | number) | undefined;
|
|
274
274
|
'aria-colspan'?: (string | number) | undefined;
|
|
275
275
|
'aria-controls'?: string | undefined | undefined;
|
|
276
|
-
'aria-current'?: "page" | "
|
|
276
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
277
277
|
'aria-describedby'?: string | undefined | undefined;
|
|
278
278
|
'aria-details'?: string | undefined | undefined;
|
|
279
279
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -68,7 +68,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
68
68
|
'aria-colindex'?: (string | number) | undefined;
|
|
69
69
|
'aria-colspan'?: (string | number) | undefined;
|
|
70
70
|
'aria-controls'?: string | undefined | undefined;
|
|
71
|
-
'aria-current'?: "page" | "
|
|
71
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
72
72
|
'aria-describedby'?: string | undefined | undefined;
|
|
73
73
|
'aria-details'?: string | undefined | undefined;
|
|
74
74
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -273,7 +273,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
273
273
|
'aria-colindex'?: (string | number) | undefined;
|
|
274
274
|
'aria-colspan'?: (string | number) | undefined;
|
|
275
275
|
'aria-controls'?: string | undefined | undefined;
|
|
276
|
-
'aria-current'?: "page" | "
|
|
276
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
277
277
|
'aria-describedby'?: string | undefined | undefined;
|
|
278
278
|
'aria-details'?: string | undefined | undefined;
|
|
279
279
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -85,7 +85,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
85
85
|
'aria-colindex'?: (string | number) | undefined;
|
|
86
86
|
'aria-colspan'?: (string | number) | undefined;
|
|
87
87
|
'aria-controls'?: string | undefined | undefined;
|
|
88
|
-
'aria-current'?: "page" | "
|
|
88
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
89
89
|
'aria-describedby'?: string | undefined | undefined;
|
|
90
90
|
'aria-details'?: string | undefined | undefined;
|
|
91
91
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -310,7 +310,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
310
310
|
'aria-colindex'?: (string | number) | undefined;
|
|
311
311
|
'aria-colspan'?: (string | number) | undefined;
|
|
312
312
|
'aria-controls'?: string | undefined | undefined;
|
|
313
|
-
'aria-current'?: "page" | "
|
|
313
|
+
'aria-current'?: "page" | "time" | (boolean | "true" | "false") | "step" | "location" | "date" | undefined;
|
|
314
314
|
'aria-describedby'?: string | undefined | undefined;
|
|
315
315
|
'aria-details'?: string | undefined | undefined;
|
|
316
316
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import { provideAuxiliaryControls, provideFieldBoundary } from "../../composables/useFieldBoundary";
|
|
7
|
+
defineOptions({ inheritAttrs: false });
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
auxiliary: { type: Boolean, required: false }
|
|
10
|
+
});
|
|
11
|
+
if (props.auxiliary) provideAuxiliaryControls();
|
|
12
|
+
else provideFieldBoundary();
|
|
13
|
+
defineSlots();
|
|
14
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
auxiliary?: boolean;
|
|
3
|
+
};
|
|
4
|
+
type __VLS_Slots = {
|
|
5
|
+
default?: () => unknown;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<p
|
|
3
|
+
v-if="message || $slots.default"
|
|
4
|
+
:id="id"
|
|
5
|
+
class="k-field-message"
|
|
6
|
+
:class="`k-field-message-${tone}`"
|
|
7
|
+
>
|
|
8
|
+
<Icon v-if="resolvedIcon" :name="resolvedIcon" class="k-field-message-icon" />
|
|
9
|
+
<span class="k-field-message-text"
|
|
10
|
+
><slot>{{ message }}</slot></span
|
|
11
|
+
>
|
|
12
|
+
</p>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script setup>
|
|
16
|
+
import { computed } from "vue";
|
|
17
|
+
import { toneIcons } from "../../internal/core/tone";
|
|
18
|
+
import Icon from "./Icon.vue";
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
message: { type: String, required: false },
|
|
21
|
+
tone: { type: String, required: false, default: "danger" },
|
|
22
|
+
icon: { type: [String, Object, Boolean], required: false, skipCheck: true, default: void 0 },
|
|
23
|
+
id: { type: String, required: false }
|
|
24
|
+
});
|
|
25
|
+
const resolvedIcon = computed(
|
|
26
|
+
() => props.icon === false ? void 0 : props.icon ?? toneIcons[props.tone]
|
|
27
|
+
);
|
|
28
|
+
</script>
|