@xleddyl/443-components-vue 0.5.0 → 0.6.2
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 +25 -6
- package/dist/chart/BarChart.vue +11 -4
- package/dist/chart/BarChart.vue.d.ts +2 -0
- package/dist/chart/ChartLegend.vue +43 -4
- package/dist/chart/ChartLegend.vue.d.ts +4 -2
- package/dist/chart/ChartPanel.vue +10 -10
- package/dist/chart/ChartPanel.vue.d.ts +11 -8
- package/dist/chart/ChartSummary.vue +8 -3
- package/dist/chart/ChartSummary.vue.d.ts +3 -1
- package/dist/chart/DoughnutChart.vue +11 -4
- package/dist/chart/LineChart.vue +8 -2
- package/dist/chart/LineChart.vue.d.ts +2 -0
- package/dist/chart/chart.css +19 -0
- package/dist/chart/patterns.d.ts +6 -0
- package/dist/chart/patterns.mjs +79 -0
- package/dist/chart/types.d.ts +5 -0
- package/dist/chart/useChartColors.mjs +1 -1
- package/dist/components/core/Button.vue +11 -1
- package/dist/components/core/Button.vue.d.ts +1 -1
- package/dist/components/core/FieldMessage.vue +6 -0
- package/dist/components/core/FieldMessage.vue.d.ts +1 -1
- package/dist/components/core/Form.vue +18 -1
- package/dist/components/core/FormAlerts.vue +41 -3
- package/dist/components/core/FormField.vue +43 -24
- package/dist/components/core/Input.vue.d.ts +6 -6
- package/dist/components/core/Root.vue +6 -1
- package/dist/components/core/Root.vue.d.ts +2 -2
- package/dist/components/core/Spinner.vue +6 -11
- package/dist/components/core/Spinner.vue.d.ts +2 -2
- package/dist/components/core/Textarea.vue.d.ts +2 -2
- package/dist/components/core/VisuallyHidden.vue.d.ts +2 -2
- package/dist/components/data/Avatar.vue +8 -5
- package/dist/components/data/AvatarGroup.vue +6 -3
- package/dist/components/data/Badge.vue.d.ts +1 -1
- package/dist/components/data/FilterPills.vue +18 -2
- package/dist/components/data/Pagination.vue +24 -18
- package/dist/components/data/Pagination.vue.d.ts +2 -2
- package/dist/components/data/SelectionBar.vue +32 -3
- package/dist/components/data/Stat.vue +7 -1
- package/dist/components/data/Stat.vue.d.ts +2 -2
- package/dist/components/data/Table.vue +62 -14
- package/dist/components/data/Tag.vue +24 -4
- package/dist/components/data/Tag.vue.d.ts +3 -3
- package/dist/components/data/Timeline.vue +12 -1
- package/dist/components/data/Tree.vue +137 -36
- package/dist/components/data/Tree.vue.d.ts +13 -14
- package/dist/components/data/types.d.ts +2 -1
- package/dist/components/feedback/Alert.vue +18 -9
- package/dist/components/feedback/Alert.vue.d.ts +2 -2
- package/dist/components/feedback/LoadingOverlay.vue +35 -3
- package/dist/components/feedback/Meter.vue +28 -3
- package/dist/components/feedback/Progress.vue +2 -7
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/ProgressRing.vue +2 -6
- package/dist/components/feedback/ProgressRing.vue.d.ts +1 -1
- package/dist/components/forms/Calendar.vue +49 -26
- package/dist/components/forms/Calendar.vue.d.ts +9 -5
- package/dist/components/forms/CheckboxGroup.vue +14 -4
- package/dist/components/forms/CheckboxGroup.vue.d.ts +1 -0
- package/dist/components/forms/ColorInput.vue +68 -15
- package/dist/components/forms/ColorInput.vue.d.ts +16 -13
- package/dist/components/forms/Combobox.vue +18 -4
- package/dist/components/forms/DateInput.vue.d.ts +6 -6
- package/dist/components/forms/DatePicker.vue +23 -7
- package/dist/components/forms/DatePicker.vue.d.ts +4 -2
- package/dist/components/forms/FileInput.vue +31 -13
- package/dist/components/forms/FileInput.vue.d.ts +2 -2
- package/dist/components/forms/InputAddon.vue +18 -2
- package/dist/components/forms/InputGroup.vue +27 -0
- package/dist/components/forms/InputGroup.vue.d.ts +2 -0
- package/dist/components/forms/NumberInput.vue +6 -7
- package/dist/components/forms/NumberInput.vue.d.ts +6 -6
- package/dist/components/forms/PasswordInput.vue +12 -6
- package/dist/components/forms/PasswordInput.vue.d.ts +6 -7
- package/dist/components/forms/PinInput.vue +11 -1
- package/dist/components/forms/PinInput.vue.d.ts +8 -6
- package/dist/components/forms/RadioGroup.vue +15 -5
- package/dist/components/forms/RadioGroup.vue.d.ts +1 -0
- package/dist/components/forms/SegmentedControl.vue +15 -10
- package/dist/components/forms/SegmentedControl.vue.d.ts +1 -0
- package/dist/components/forms/Slider.vue +9 -0
- package/dist/components/forms/Slider.vue.d.ts +8 -6
- package/dist/components/forms/Switch.vue +7 -0
- package/dist/components/forms/Switch.vue.d.ts +2 -2
- package/dist/components/forms/TimeInput.vue.d.ts +6 -6
- package/dist/components/forms/types.d.ts +4 -0
- package/dist/components/layout/Accordion.vue.d.ts +2 -2
- package/dist/components/layout/AppShell.vue +40 -18
- package/dist/components/layout/AppShell.vue.d.ts +11 -9
- package/dist/components/layout/Card.vue +50 -16
- package/dist/components/layout/Card.vue.d.ts +13 -11
- package/dist/components/layout/CopyButton.vue +13 -5
- package/dist/components/layout/CopyButton.vue.d.ts +3 -3
- package/dist/components/layout/NavLink.vue +10 -1
- package/dist/components/layout/NavLink.vue.d.ts +2 -2
- package/dist/components/layout/PageHeader.vue +2 -2
- package/dist/components/layout/Separator.vue +6 -3
- package/dist/components/layout/Sidebar.vue +14 -7
- package/dist/components/layout/Sidebar.vue.d.ts +0 -2
- package/dist/components/layout/SidebarNav.vue +16 -44
- package/dist/components/layout/Stack.vue.d.ts +2 -2
- package/dist/components/layout/Tabs.vue +10 -18
- package/dist/components/layout/Tabs.vue.d.ts +2 -2
- package/dist/components/layout/Toolbar.vue +10 -4
- package/dist/components/layout/Toolbar.vue.d.ts +1 -0
- package/dist/components/layout/types.d.ts +1 -0
- package/dist/components/overlays/CommandPalette.vue +8 -4
- package/dist/components/overlays/CommandPalette.vue.d.ts +3 -8
- package/dist/components/overlays/ConfirmDialog.vue +7 -5
- package/dist/components/overlays/ConfirmDialog.vue.d.ts +12 -8
- package/dist/components/overlays/ConfirmHost.vue +22 -19
- package/dist/components/overlays/ConfirmHost.vue.d.ts +8 -6
- package/dist/components/overlays/ContextMenu.vue +9 -11
- package/dist/components/overlays/ContextMenu.vue.d.ts +2 -2
- package/dist/components/overlays/Drawer.vue +2 -0
- package/dist/components/overlays/Drawer.vue.d.ts +4 -2
- package/dist/components/overlays/DropdownMenu.vue +13 -21
- package/dist/components/overlays/DropdownMenu.vue.d.ts +2 -2
- package/dist/components/overlays/HoverCard.vue +8 -2
- package/dist/components/overlays/HoverCard.vue.d.ts +2 -2
- package/dist/components/overlays/Modal.vue +2 -0
- package/dist/components/overlays/Modal.vue.d.ts +4 -2
- package/dist/components/overlays/Popover.vue +19 -4
- package/dist/components/overlays/Popover.vue.d.ts +2 -2
- package/dist/components/overlays/Toaster.vue +39 -7
- package/dist/components/overlays/Tooltip.vue +39 -14
- package/dist/components/overlays/types.d.ts +6 -0
- package/dist/components/templates/AccountMenu.vue.d.ts +2 -2
- package/dist/components/templates/AppearanceSettings.vue +83 -77
- package/dist/components/templates/AppearanceSettings.vue.d.ts +2 -2
- package/dist/components/templates/AuthLayout.vue +2 -2
- package/dist/components/templates/Brand.vue.d.ts +2 -2
- package/dist/components/templates/DashboardLayout.vue +3 -7
- package/dist/components/templates/DashboardLayout.vue.d.ts +8 -18
- package/dist/components/templates/DetailPage.vue +3 -1
- package/dist/components/templates/DetailPage.vue.d.ts +2 -2
- package/dist/components/templates/ErrorPage.vue +11 -5
- package/dist/components/templates/ErrorPage.vue.d.ts +10 -6
- package/dist/components/templates/FormPage.vue +16 -3
- package/dist/components/templates/ListPage.vue +19 -6
- package/dist/components/templates/ListPage.vue.d.ts +1 -0
- package/dist/components/templates/NotFoundPage.vue +2 -0
- package/dist/components/templates/NotFoundPage.vue.d.ts +4 -0
- package/dist/components/templates/SaveBar.vue +18 -3
- package/dist/components/templates/SaveBar.vue.d.ts +5 -5
- package/dist/components/templates/SettingsGroup.vue +1 -1
- package/dist/components/templates/SettingsGroup.vue.d.ts +3 -1
- package/dist/components/templates/SettingsModal.vue +73 -46
- package/dist/components/templates/SettingsModal.vue.d.ts +9 -11
- package/dist/components/templates/SettingsPage.vue.d.ts +2 -2
- package/dist/components/templates/SettingsSection.vue.d.ts +4 -2
- package/dist/components/templates/types.d.ts +4 -0
- package/dist/composables/useAlert.mjs +5 -10
- package/dist/composables/useConfirm.mjs +5 -5
- package/dist/composables/useField.d.ts +4 -0
- package/dist/composables/useField.mjs +16 -5
- package/dist/composables/useFileDrop.mjs +2 -1
- package/dist/composables/useOverlay.mjs +2 -1
- package/dist/composables/usePreset.mjs +4 -10
- package/dist/composables/usePrompt.mjs +6 -13
- package/dist/composables/useScrollLock.mjs +4 -3
- package/dist/composables/useTheme.mjs +3 -11
- package/dist/composables/useToast.mjs +2 -1
- package/dist/editor/RichTextEditor.vue +31 -6
- package/dist/editor/RichTextEditor.vue.d.ts +2 -2
- package/dist/editor/rich-text-editor.css +9 -4
- package/dist/grid/DataGrid.vue +72 -12
- package/dist/grid/GridToolbar.vue +1 -1
- package/dist/grid/GridToolbar.vue.d.ts +2 -2
- package/dist/grid/cells/BadgeCell.vue +3 -1
- package/dist/grid/cells/BadgeCell.vue.d.ts +17 -3
- package/dist/grid/cells/DateCell.vue +3 -1
- package/dist/grid/cells/DateCell.vue.d.ts +17 -3
- package/dist/grid/cells/EmptyCell.vue +15 -0
- package/dist/grid/cells/EmptyCell.vue.d.ts +392 -0
- package/dist/grid/cells/LinkCell.vue +9 -2
- package/dist/grid/cells/LinkCell.vue.d.ts +17 -3
- package/dist/grid/data-grid.css +5 -5
- package/dist/grid/types.d.ts +2 -0
- package/dist/internal/core/ButtonContent.vue +3 -0
- package/dist/internal/core/LiveRegion.vue +26 -0
- package/dist/internal/core/LiveRegion.vue.d.ts +393 -0
- package/dist/internal/core/copy.d.ts +6 -0
- package/dist/internal/core/copy.mjs +14 -0
- package/dist/internal/core/focus.d.ts +6 -0
- package/dist/internal/core/focus.mjs +46 -0
- package/dist/internal/core/intl.d.ts +4 -2
- package/dist/internal/core/intl.mjs +23 -22
- package/dist/internal/core/live.d.ts +6 -0
- package/dist/internal/core/live.mjs +22 -0
- package/dist/internal/core/preset.d.ts +0 -1
- package/dist/internal/core/preset.mjs +4 -14
- package/dist/internal/core/resize.d.ts +1 -0
- package/dist/internal/core/resize.mjs +11 -0
- package/dist/internal/core/roving.d.ts +7 -0
- package/dist/internal/core/roving.mjs +19 -1
- package/dist/internal/core/scroll-edges.d.ts +5 -0
- package/dist/internal/core/scroll-edges.mjs +63 -0
- package/dist/internal/core/storage.d.ts +2 -0
- package/dist/internal/core/storage.mjs +8 -0
- package/dist/internal/core/theme.d.ts +0 -1
- package/dist/internal/core/theme.mjs +4 -13
- package/dist/internal/core/tone.d.ts +1 -0
- package/dist/internal/core/tone.mjs +4 -0
- package/dist/internal/core/transition.d.ts +1 -0
- package/dist/internal/core/transition.mjs +20 -0
- package/dist/internal/data/rows.mjs +6 -5
- package/dist/internal/data/tree.d.ts +2 -3
- package/dist/internal/feedback/LoadingHost.vue +16 -6
- package/dist/internal/feedback/loading.mjs +2 -1
- package/dist/internal/feedback/progress.d.ts +12 -0
- package/dist/internal/feedback/progress.mjs +13 -0
- package/dist/internal/floating/layer.d.ts +1 -1
- package/dist/internal/floating/layer.mjs +17 -10
- package/dist/internal/forms/keys.d.ts +4 -0
- package/dist/internal/forms/keys.mjs +1 -0
- package/dist/internal/forms/name.d.ts +2 -0
- package/dist/internal/forms/name.mjs +12 -0
- package/dist/internal/forms/standard-schema.d.ts +0 -2
- package/dist/internal/forms/standard-schema.mjs +0 -18
- package/dist/internal/layout/NavGroup.vue +104 -0
- package/dist/internal/layout/NavGroup.vue.d.ts +412 -0
- package/dist/internal/overlays/DialogFrame.vue +53 -6
- package/dist/internal/overlays/DialogFrame.vue.d.ts +5 -2
- package/dist/internal/overlays/MenuList.vue +4 -11
- package/dist/internal/overlays/MenuList.vue.d.ts +6 -6
- package/dist/internal/overlays/OverlayView.vue +2 -0
- package/dist/internal/overlays/OverlayView.vue.d.ts +8 -6
- package/dist/internal/overlays/confirm.d.ts +6 -1
- package/dist/internal/overlays/confirm.mjs +5 -2
- package/dist/internal/overlays/dialog.d.ts +1 -0
- package/dist/internal/overlays/dialog.mjs +9 -9
- package/dist/internal/overlays/hover.d.ts +1 -0
- package/dist/internal/overlays/hover.mjs +20 -3
- package/dist/internal/overlays/menu.d.ts +9 -0
- package/dist/internal/overlays/menu.mjs +15 -0
- package/dist/internal/overlays/stack.d.ts +1 -0
- package/dist/locale/en.mjs +70 -18
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.mjs +5 -11
- package/dist/locale/it.mjs +70 -18
- package/dist/locale/types.d.ts +54 -2
- package/dist/nuxt/runtime/RouteAnnouncer.vue +21 -0
- package/dist/nuxt/runtime/RouteAnnouncer.vue.d.ts +3 -0
- package/dist/nuxt/runtime/layout-head.d.ts +2 -0
- package/dist/nuxt/runtime/layout-head.mjs +13 -0
- package/dist/nuxt/runtime/layouts/auth.vue +4 -0
- package/dist/nuxt/runtime/layouts/auth.vue.d.ts +2 -2
- package/dist/nuxt/runtime/layouts/dashboard.vue +4 -0
- package/dist/nuxt/runtime/layouts/dashboard.vue.d.ts +2 -2
- package/dist/nuxt/runtime/locale.mjs +9 -1
- package/dist/nuxt/runtime/theme.mjs +17 -12
- package/dist/styles/base.css +0 -13
- package/dist/styles/core/button.css +8 -8
- package/dist/styles/core/field-message.css +2 -2
- package/dist/styles/core/form-field.css +11 -2
- package/dist/styles/core/input.css +4 -7
- package/dist/styles/core/kbd.css +0 -1
- package/dist/styles/data/badge.css +8 -4
- package/dist/styles/data/description-list.css +2 -2
- package/dist/styles/data/filter-pills.css +5 -8
- package/dist/styles/data/pagination.css +2 -2
- package/dist/styles/data/stat.css +3 -3
- package/dist/styles/data/table.css +2 -2
- package/dist/styles/data/tag.css +1 -2
- package/dist/styles/data/timeline.css +1 -1
- package/dist/styles/data/tree.css +31 -10
- package/dist/styles/feedback/alert.css +0 -3
- package/dist/styles/feedback/loading-host.css +4 -0
- package/dist/styles/feedback/loading-overlay.css +4 -0
- package/dist/styles/forced-colors.css +215 -0
- package/dist/styles/forms/calendar.css +2 -2
- package/dist/styles/forms/choice.css +2 -2
- package/dist/styles/forms/color-input.css +1 -1
- package/dist/styles/forms/combobox.css +2 -24
- package/dist/styles/forms/date-input.css +2 -2
- package/dist/styles/forms/date-picker.css +3 -7
- package/dist/styles/forms/file-input.css +4 -3
- package/dist/styles/forms/input-group.css +6 -0
- package/dist/styles/forms/number-input.css +2 -2
- package/dist/styles/forms/password-input.css +5 -2
- package/dist/styles/forms/pin-input.css +4 -2
- package/dist/styles/forms/segmented.css +2 -2
- package/dist/styles/forms/select.css +6 -6
- package/dist/styles/forms/slider.css +5 -4
- package/dist/styles/forms/switch.css +5 -1
- package/dist/styles/index.css +1 -0
- package/dist/styles/layout/app-shell.css +15 -3
- package/dist/styles/layout/copy-button.css +1 -1
- package/dist/styles/layout/nav-link.css +1 -33
- package/dist/styles/layout/separator.css +1 -1
- package/dist/styles/layout/sidebar-nav.css +15 -4
- package/dist/styles/layout/sidebar.css +20 -6
- package/dist/styles/layout/tabs.css +9 -4
- package/dist/styles/layout/theme-switch.css +0 -6
- package/dist/styles/overlays/command.css +9 -15
- package/dist/styles/overlays/confirm.css +1 -1
- package/dist/styles/overlays/drawer.css +0 -1
- package/dist/styles/overlays/menu.css +2 -17
- package/dist/styles/overlays/modal.css +29 -6
- package/dist/styles/overlays/toast.css +1 -2
- package/dist/styles/presets.css +4 -4
- package/dist/styles/shared.css +96 -3
- package/dist/styles/templates/account-menu.css +3 -3
- package/dist/styles/templates/auth-layout.css +1 -1
- package/dist/styles/templates/brand.css +3 -3
- package/dist/styles/templates/empty-page.css +1 -1
- package/dist/styles/templates/form-page.css +10 -0
- package/dist/styles/templates/save-bar.css +10 -0
- package/dist/styles/templates/settings-modal.css +42 -44
- package/dist/styles/templates/settings-page.css +3 -3
- package/dist/styles/tokens.css +12 -2
- package/package.json +1 -1
- package/dist/internal/overlays/focus.d.ts +0 -1
- package/dist/internal/overlays/focus.mjs +0 -24
|
@@ -11,9 +11,31 @@
|
|
|
11
11
|
}"
|
|
12
12
|
@keydown.esc="onEscape"
|
|
13
13
|
>
|
|
14
|
-
<a
|
|
14
|
+
<a
|
|
15
|
+
class="k-shell-skip k-visually-hidden-focusable"
|
|
16
|
+
:href="`#${mainId}`"
|
|
17
|
+
:inert="drawer ? true : void 0"
|
|
18
|
+
>{{ skipText }}</a
|
|
19
|
+
>
|
|
15
20
|
<div class="k-shell-scrim" aria-hidden="true" @click="closeNav({ restoreFocus: true })" />
|
|
16
|
-
<
|
|
21
|
+
<div
|
|
22
|
+
:id="sidebarId"
|
|
23
|
+
ref="sidebar"
|
|
24
|
+
class="k-shell-sidebar"
|
|
25
|
+
:role="drawer ? 'dialog' : void 0"
|
|
26
|
+
:aria-modal="drawer ? 'true' : void 0"
|
|
27
|
+
:aria-label="drawer ? sidebarText : void 0"
|
|
28
|
+
>
|
|
29
|
+
<Button
|
|
30
|
+
v-if="drawer"
|
|
31
|
+
class="k-shell-close k-shell-mobile-only"
|
|
32
|
+
variant="ghost"
|
|
33
|
+
tone="neutral"
|
|
34
|
+
size="sm"
|
|
35
|
+
icon="x-mark"
|
|
36
|
+
:aria-label="closeText"
|
|
37
|
+
@click="closeNav({ restoreFocus: true })"
|
|
38
|
+
/>
|
|
17
39
|
<slot
|
|
18
40
|
name="sidebar"
|
|
19
41
|
:collapsed="collapsed"
|
|
@@ -21,8 +43,8 @@
|
|
|
21
43
|
:toggle-collapsed="toggleCollapsed"
|
|
22
44
|
:close-nav="closeNav"
|
|
23
45
|
/>
|
|
24
|
-
</
|
|
25
|
-
<div class="k-shell-body" :inert="
|
|
46
|
+
</div>
|
|
47
|
+
<div class="k-shell-body" :inert="drawer ? true : void 0">
|
|
26
48
|
<header class="k-shell-topbar" :class="{ 'is-mobile-only': !showTopbar }">
|
|
27
49
|
<Button
|
|
28
50
|
ref="menuButton"
|
|
@@ -49,10 +71,10 @@
|
|
|
49
71
|
</template>
|
|
50
72
|
|
|
51
73
|
<script setup>
|
|
74
|
+
import { useResizeObserver } from "../../internal/core/resize";
|
|
52
75
|
import {
|
|
53
76
|
computed,
|
|
54
77
|
nextTick,
|
|
55
|
-
onBeforeUnmount,
|
|
56
78
|
onMounted,
|
|
57
79
|
provide,
|
|
58
80
|
ref,
|
|
@@ -66,11 +88,12 @@ import { useLocale } from "../../composables/useLocale";
|
|
|
66
88
|
import { SHELL_KEY } from "../../internal/layout/keys";
|
|
67
89
|
import { usePersistedBoolean } from "../../internal/layout/persist";
|
|
68
90
|
import Button from "../core/Button.vue";
|
|
69
|
-
import { focusFirst } from "../../internal/
|
|
91
|
+
import { focusFirst } from "../../internal/core/focus";
|
|
70
92
|
const props = defineProps({
|
|
71
93
|
variant: { type: String, required: false, default: "inset" },
|
|
72
94
|
sidebarLabel: { type: String, required: false },
|
|
73
95
|
menuLabel: { type: String, required: false },
|
|
96
|
+
closeLabel: { type: String, required: false },
|
|
74
97
|
skipLabel: { type: String, required: false },
|
|
75
98
|
fluid: { type: Boolean, required: false },
|
|
76
99
|
topbar: { type: Boolean, required: false, default: void 0 },
|
|
@@ -79,7 +102,8 @@ const props = defineProps({
|
|
|
79
102
|
viewTransition: { type: Boolean, required: false }
|
|
80
103
|
});
|
|
81
104
|
const { t } = useLocale();
|
|
82
|
-
const sidebarText = computed(() => props.sidebarLabel ?? t("shell.
|
|
105
|
+
const sidebarText = computed(() => props.sidebarLabel ?? t("shell.navigation"));
|
|
106
|
+
const closeText = computed(() => props.closeLabel ?? t("shell.closeNavigation"));
|
|
83
107
|
const menuText = computed(() => props.menuLabel ?? t("shell.openNavigation"));
|
|
84
108
|
const skipText = computed(() => props.skipLabel ?? t("shell.skipToContent"));
|
|
85
109
|
const collapsedModel = defineModel("collapsed", { type: Boolean, ...{ default: false } });
|
|
@@ -88,6 +112,7 @@ const MOBILE_BREAKPOINT = 768;
|
|
|
88
112
|
const slots = useSlots();
|
|
89
113
|
const collapsed = usePersistedBoolean(collapsedModel.value, props.storageKey);
|
|
90
114
|
const mobile = ref(false);
|
|
115
|
+
const drawer = computed(() => open.value && mobile.value);
|
|
91
116
|
watch(collapsedModel, (value) => collapsed.value = value);
|
|
92
117
|
watch(
|
|
93
118
|
collapsed,
|
|
@@ -133,28 +158,25 @@ useHotkey(() => props.shortcut ? [props.shortcut] : [], toggle, {
|
|
|
133
158
|
enabled: () => Boolean(props.shortcut),
|
|
134
159
|
allowInInputs: false
|
|
135
160
|
});
|
|
136
|
-
let observer;
|
|
137
161
|
function measure(width) {
|
|
138
162
|
mobile.value = width > 0 && width < MOBILE_BREAKPOINT;
|
|
139
163
|
if (!mobile.value && open.value) open.value = false;
|
|
140
164
|
}
|
|
141
165
|
onMounted(() => {
|
|
142
|
-
|
|
143
|
-
if (!element) return;
|
|
144
|
-
measure(element.clientWidth);
|
|
145
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
146
|
-
observer = new ResizeObserver((entries) => {
|
|
147
|
-
const entry = entries[0];
|
|
148
|
-
if (entry) measure(entry.contentRect.width);
|
|
149
|
-
});
|
|
150
|
-
observer.observe(element);
|
|
166
|
+
if (shell.value) measure(shell.value.clientWidth);
|
|
151
167
|
});
|
|
152
|
-
|
|
168
|
+
useResizeObserver(
|
|
169
|
+
() => [shell.value],
|
|
170
|
+
([entry]) => {
|
|
171
|
+
if (entry) measure(entry.contentRect.width);
|
|
172
|
+
}
|
|
173
|
+
);
|
|
153
174
|
watch(open, (value) => {
|
|
154
175
|
if (!value) return;
|
|
155
176
|
nextTick(() => focusFirst(sidebar.value));
|
|
156
177
|
});
|
|
157
178
|
provide(SHELL_KEY, {
|
|
179
|
+
sidebarId,
|
|
158
180
|
collapsed,
|
|
159
181
|
open,
|
|
160
182
|
mobile,
|
|
@@ -6,29 +6,30 @@ declare function closeNav(options?: {
|
|
|
6
6
|
focusMain?: boolean;
|
|
7
7
|
}): void;
|
|
8
8
|
declare function toggle(): void;
|
|
9
|
-
declare var
|
|
9
|
+
declare var __VLS_8: {
|
|
10
10
|
collapsed: boolean;
|
|
11
11
|
mobile: boolean;
|
|
12
12
|
toggleCollapsed: typeof toggleCollapsed;
|
|
13
13
|
closeNav: typeof closeNav;
|
|
14
|
-
},
|
|
14
|
+
}, __VLS_17: {
|
|
15
15
|
openNav: typeof openNav;
|
|
16
16
|
mobile: boolean;
|
|
17
17
|
collapsed: boolean;
|
|
18
|
-
},
|
|
18
|
+
}, __VLS_19: {}, __VLS_21: {};
|
|
19
19
|
type __VLS_Slots = {} & {
|
|
20
|
-
sidebar?: (props: typeof
|
|
20
|
+
sidebar?: (props: typeof __VLS_8) => any;
|
|
21
21
|
} & {
|
|
22
|
-
topbar?: (props: typeof
|
|
22
|
+
topbar?: (props: typeof __VLS_17) => any;
|
|
23
23
|
} & {
|
|
24
|
-
default?: (props: typeof
|
|
24
|
+
default?: (props: typeof __VLS_19) => any;
|
|
25
25
|
} & {
|
|
26
|
-
overlays?: (props: typeof
|
|
26
|
+
overlays?: (props: typeof __VLS_21) => any;
|
|
27
27
|
};
|
|
28
28
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
29
29
|
variant?: AppShellVariant;
|
|
30
30
|
sidebarLabel?: string;
|
|
31
31
|
menuLabel?: string;
|
|
32
|
+
closeLabel?: string;
|
|
32
33
|
skipLabel?: string;
|
|
33
34
|
fluid?: boolean;
|
|
34
35
|
topbar?: boolean;
|
|
@@ -43,6 +44,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
43
44
|
style?: import("vue").StyleValue;
|
|
44
45
|
results?: (string | number) | undefined;
|
|
45
46
|
placeholder?: string | undefined | undefined;
|
|
47
|
+
dir?: string | undefined | undefined;
|
|
46
48
|
class?: import("vue").ClassValue;
|
|
47
49
|
role?: string | undefined | undefined;
|
|
48
50
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -198,7 +200,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
198
200
|
accesskey?: string | undefined | undefined;
|
|
199
201
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
200
202
|
contextmenu?: string | undefined | undefined;
|
|
201
|
-
dir?: string | undefined | undefined;
|
|
202
203
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
203
204
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
204
205
|
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
@@ -241,6 +242,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
241
242
|
variant?: AppShellVariant;
|
|
242
243
|
sidebarLabel?: string;
|
|
243
244
|
menuLabel?: string;
|
|
245
|
+
closeLabel?: string;
|
|
244
246
|
skipLabel?: string;
|
|
245
247
|
fluid?: boolean;
|
|
246
248
|
topbar?: boolean;
|
|
@@ -255,6 +257,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
255
257
|
style?: import("vue").StyleValue;
|
|
256
258
|
results?: (string | number) | undefined;
|
|
257
259
|
placeholder?: string | undefined | undefined;
|
|
260
|
+
dir?: string | undefined | undefined;
|
|
258
261
|
class?: import("vue").ClassValue;
|
|
259
262
|
role?: string | undefined | undefined;
|
|
260
263
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -410,7 +413,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
410
413
|
accesskey?: string | undefined | undefined;
|
|
411
414
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
412
415
|
contextmenu?: string | undefined | undefined;
|
|
413
|
-
dir?: string | undefined | undefined;
|
|
414
416
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
415
417
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
416
418
|
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<Polymorphic
|
|
3
3
|
:as="as"
|
|
4
4
|
v-bind="$attrs"
|
|
5
|
-
:bind="
|
|
5
|
+
:bind="rootAttrs"
|
|
6
6
|
class="k-card"
|
|
7
7
|
:class="[
|
|
8
8
|
`k-card-${variant}`,
|
|
@@ -15,40 +15,62 @@
|
|
|
15
15
|
}
|
|
16
16
|
]"
|
|
17
17
|
>
|
|
18
|
-
<
|
|
18
|
+
<component :is="plain ? 'span' : 'div'" v-if="hasHeader" :id="headerId" class="k-card-header">
|
|
19
19
|
<slot name="header">
|
|
20
20
|
<span v-if="icon || $slots.icon" class="k-card-icon" aria-hidden="true">
|
|
21
21
|
<slot name="icon"><Icon v-if="icon" :name="icon" /></slot>
|
|
22
22
|
</span>
|
|
23
|
-
<div class="k-card-heading">
|
|
24
|
-
<component
|
|
23
|
+
<component :is="plain ? 'span' : 'div'" class="k-card-heading">
|
|
24
|
+
<component
|
|
25
|
+
:is="plain ? 'span' : `h${level}`"
|
|
26
|
+
v-if="title || $slots.title"
|
|
27
|
+
class="k-card-title"
|
|
28
|
+
>
|
|
25
29
|
<component :is="link.is" v-if="link" v-bind="link.attrs" class="k-card-link">
|
|
26
30
|
<slot name="title">{{ title }}</slot>
|
|
27
31
|
</component>
|
|
28
32
|
<slot v-else name="title">{{ title }}</slot>
|
|
29
33
|
</component>
|
|
30
|
-
<
|
|
34
|
+
<component
|
|
35
|
+
:is="plain ? 'span' : 'p'"
|
|
36
|
+
v-if="description || $slots.description"
|
|
37
|
+
class="k-card-description"
|
|
38
|
+
>
|
|
31
39
|
<slot name="description">{{ description }}</slot>
|
|
32
|
-
</
|
|
33
|
-
</
|
|
40
|
+
</component>
|
|
41
|
+
</component>
|
|
34
42
|
</slot>
|
|
35
|
-
<div v-if="$slots.actions" class="k-card-actions">
|
|
43
|
+
<component :is="plain ? 'span' : 'div'" v-if="$slots.actions" class="k-card-actions">
|
|
36
44
|
<slot name="actions" />
|
|
37
|
-
</
|
|
38
|
-
</
|
|
39
|
-
<
|
|
45
|
+
</component>
|
|
46
|
+
</component>
|
|
47
|
+
<component
|
|
48
|
+
:is="plain ? 'span' : 'div'"
|
|
49
|
+
v-if="$slots.default"
|
|
50
|
+
:id="bodyId"
|
|
51
|
+
class="k-card-body"
|
|
52
|
+
>
|
|
40
53
|
<slot />
|
|
41
|
-
</
|
|
42
|
-
<
|
|
54
|
+
</component>
|
|
55
|
+
<component :is="plain ? 'span' : 'div'" v-if="$slots.footer" class="k-card-footer">
|
|
43
56
|
<slot name="footer" />
|
|
44
|
-
</
|
|
57
|
+
</component>
|
|
58
|
+
<component
|
|
59
|
+
:is="link.is"
|
|
60
|
+
v-if="link && !hasTitle"
|
|
61
|
+
v-bind="link.attrs"
|
|
62
|
+
class="k-card-link k-card-link-overlay"
|
|
63
|
+
:aria-label="label"
|
|
64
|
+
:aria-labelledby="label ? void 0 : overlayLabelledBy"
|
|
65
|
+
/>
|
|
45
66
|
</Polymorphic>
|
|
46
67
|
</template>
|
|
47
68
|
|
|
48
69
|
<script setup>
|
|
49
70
|
import { useLinkResolver } from "../../internal/core/link";
|
|
50
71
|
import { Polymorphic } from "../../internal/core/Polymorphic";
|
|
51
|
-
import { computed, useAttrs, useSlots } from "vue";
|
|
72
|
+
import { computed, useAttrs, useId, useSlots } from "vue";
|
|
73
|
+
import { joinIds } from "../../internal/forms/control";
|
|
52
74
|
import Icon from "../core/Icon.vue";
|
|
53
75
|
defineOptions({ inheritAttrs: false });
|
|
54
76
|
const props = defineProps({
|
|
@@ -64,7 +86,8 @@ const props = defineProps({
|
|
|
64
86
|
target: { type: String, required: false },
|
|
65
87
|
disabled: { type: Boolean, required: false },
|
|
66
88
|
selected: { type: Boolean, required: false, default: void 0 },
|
|
67
|
-
animated: { type: Boolean, required: false, default: true }
|
|
89
|
+
animated: { type: Boolean, required: false, default: true },
|
|
90
|
+
label: { type: String, required: false }
|
|
68
91
|
});
|
|
69
92
|
const SELECTABLE_ROLES = /* @__PURE__ */ new Set(["option", "tab", "gridcell", "row", "treeitem"]);
|
|
70
93
|
const slots = useSlots();
|
|
@@ -78,6 +101,17 @@ const { resolveLink } = useLinkResolver();
|
|
|
78
101
|
const link = computed(() => props.disabled ? null : resolveLink(props));
|
|
79
102
|
const isLink = computed(() => link.value !== null);
|
|
80
103
|
const isInteractive = computed(() => isLink.value || props.as === "button");
|
|
104
|
+
const plain = computed(() => props.as === "button" || attrs.role === "button");
|
|
105
|
+
const hasTitle = computed(() => Boolean(props.title || slots.title));
|
|
106
|
+
const headerId = useId();
|
|
107
|
+
const bodyId = useId();
|
|
108
|
+
const overlayLabelledBy = computed(
|
|
109
|
+
() => joinIds(hasHeader.value && headerId, slots.default && bodyId)
|
|
110
|
+
);
|
|
111
|
+
const rootAttrs = computed(() => ({
|
|
112
|
+
...selectionAttrs.value,
|
|
113
|
+
...props.as === "button" ? { type: "button", disabled: props.disabled || void 0 } : {}
|
|
114
|
+
}));
|
|
81
115
|
const selectionAttrs = computed(() => {
|
|
82
116
|
if (props.selected === void 0) return void 0;
|
|
83
117
|
const state = props.selected ? "true" : "false";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import type { IconName } from '../../composables/useIcons';
|
|
2
2
|
import type { CardPadding, CardVariant, HeadingLevel } from './types';
|
|
3
3
|
import type { LinkTarget } from '../core/types';
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_13: {}, __VLS_15: {}, __VLS_40: {}, __VLS_42: {}, __VLS_50: {}, __VLS_58: {}, __VLS_66: {}, __VLS_74: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
header?: (props: typeof
|
|
6
|
+
header?: (props: typeof __VLS_13) => any;
|
|
7
7
|
} & {
|
|
8
|
-
icon?: (props: typeof
|
|
8
|
+
icon?: (props: typeof __VLS_15) => any;
|
|
9
9
|
} & {
|
|
10
|
-
title?: (props: typeof
|
|
10
|
+
title?: (props: typeof __VLS_40) => any;
|
|
11
11
|
} & {
|
|
12
|
-
title?: (props: typeof
|
|
12
|
+
title?: (props: typeof __VLS_42) => any;
|
|
13
13
|
} & {
|
|
14
|
-
description?: (props: typeof
|
|
14
|
+
description?: (props: typeof __VLS_50) => any;
|
|
15
15
|
} & {
|
|
16
|
-
actions?: (props: typeof
|
|
16
|
+
actions?: (props: typeof __VLS_58) => any;
|
|
17
17
|
} & {
|
|
18
|
-
default?: (props: typeof
|
|
18
|
+
default?: (props: typeof __VLS_66) => any;
|
|
19
19
|
} & {
|
|
20
|
-
footer?: (props: typeof
|
|
20
|
+
footer?: (props: typeof __VLS_74) => any;
|
|
21
21
|
};
|
|
22
22
|
declare const __VLS_base: import("vue").DefineComponent<{
|
|
23
23
|
title?: string | undefined;
|
|
@@ -33,6 +33,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
selected?: boolean;
|
|
35
35
|
animated?: boolean;
|
|
36
|
+
label?: string;
|
|
36
37
|
inlist?: any;
|
|
37
38
|
download?: any;
|
|
38
39
|
key?: PropertyKey | undefined;
|
|
@@ -41,6 +42,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
41
42
|
results?: (string | number) | undefined;
|
|
42
43
|
placeholder?: string | undefined;
|
|
43
44
|
bind?: Record<string, unknown>;
|
|
45
|
+
dir?: string | undefined;
|
|
44
46
|
class?: import("vue").ClassValue;
|
|
45
47
|
role?: string | undefined;
|
|
46
48
|
'aria-label'?: string | undefined;
|
|
@@ -198,7 +200,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
198
200
|
accesskey?: string | undefined;
|
|
199
201
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
200
202
|
contextmenu?: string | undefined;
|
|
201
|
-
dir?: string | undefined;
|
|
202
203
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
203
204
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
204
205
|
enterKeyHint?: import("vue").HTMLAttributes["enterkeyhint"];
|
|
@@ -252,6 +253,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
252
253
|
disabled?: boolean;
|
|
253
254
|
selected?: boolean;
|
|
254
255
|
animated?: boolean;
|
|
256
|
+
label?: string;
|
|
255
257
|
inlist?: any;
|
|
256
258
|
download?: any;
|
|
257
259
|
key?: PropertyKey | undefined;
|
|
@@ -260,6 +262,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
260
262
|
results?: (string | number) | undefined;
|
|
261
263
|
placeholder?: string | undefined;
|
|
262
264
|
bind?: Record<string, unknown>;
|
|
265
|
+
dir?: string | undefined;
|
|
263
266
|
class?: import("vue").ClassValue;
|
|
264
267
|
role?: string | undefined;
|
|
265
268
|
'aria-label'?: string | undefined;
|
|
@@ -417,7 +420,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
417
420
|
accesskey?: string | undefined;
|
|
418
421
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
419
422
|
contextmenu?: string | undefined;
|
|
420
|
-
dir?: string | undefined;
|
|
421
423
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
422
424
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
423
425
|
enterKeyHint?: import("vue").HTMLAttributes["enterkeyhint"];
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
:square="!showLabel"
|
|
9
9
|
:disabled="disabled"
|
|
10
10
|
:class="{ 'is-copied': copied }"
|
|
11
|
-
:aria-label="showLabel ? void 0 :
|
|
11
|
+
:aria-label="showLabel ? void 0 : copyText"
|
|
12
12
|
:title="showLabel ? void 0 : copyText"
|
|
13
13
|
@click="onCopy"
|
|
14
14
|
>
|
|
@@ -16,18 +16,24 @@
|
|
|
16
16
|
<Icon name="clipboard" class="k-copy-icon is-idle" />
|
|
17
17
|
<Icon name="check" class="k-copy-icon is-done" />
|
|
18
18
|
</span>
|
|
19
|
-
<
|
|
19
|
+
<template v-if="showLabel">
|
|
20
|
+
<span class="k-copy-label" aria-hidden="true">{{
|
|
21
|
+
copied ? copiedText : copyText
|
|
22
|
+
}}</span>
|
|
23
|
+
<span class="k-visually-hidden">{{ copyText }}</span>
|
|
24
|
+
</template>
|
|
20
25
|
</Button>
|
|
21
|
-
<
|
|
26
|
+
<LiveRegion :message="message" />
|
|
22
27
|
</span>
|
|
23
28
|
</template>
|
|
24
29
|
|
|
25
30
|
<script setup>
|
|
26
31
|
import { computed } from "vue";
|
|
27
|
-
import {
|
|
32
|
+
import { useAnnouncedCopy } from "../../internal/core/copy";
|
|
28
33
|
import { useLocale } from "../../composables/useLocale";
|
|
29
34
|
import Button from "../core/Button.vue";
|
|
30
35
|
import Icon from "../core/Icon.vue";
|
|
36
|
+
import LiveRegion from "../../internal/core/LiveRegion.vue";
|
|
31
37
|
const props = defineProps({
|
|
32
38
|
value: { type: String, required: true },
|
|
33
39
|
label: { type: String, required: false },
|
|
@@ -43,7 +49,9 @@ const emit = defineEmits(["copy"]);
|
|
|
43
49
|
const { t } = useLocale();
|
|
44
50
|
const copyText = computed(() => props.label ?? t("common.copy"));
|
|
45
51
|
const copiedText = computed(() => props.copiedLabel ?? t("common.copied"));
|
|
46
|
-
const { copied, copy } =
|
|
52
|
+
const { copied, copy, message } = useAnnouncedCopy(() => copiedText.value, {
|
|
53
|
+
resetAfter: props.resetAfter
|
|
54
|
+
});
|
|
47
55
|
async function onCopy() {
|
|
48
56
|
emit("copy", await copy(props.value));
|
|
49
57
|
}
|
|
@@ -15,6 +15,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
15
15
|
style?: import("vue").StyleValue;
|
|
16
16
|
results?: (string | number) | undefined;
|
|
17
17
|
placeholder?: string | undefined | undefined;
|
|
18
|
+
dir?: string | undefined | undefined;
|
|
18
19
|
class?: import("vue").ClassValue;
|
|
19
20
|
role?: string | undefined | undefined;
|
|
20
21
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -169,7 +170,6 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
169
170
|
accesskey?: string | undefined | undefined;
|
|
170
171
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
171
172
|
contextmenu?: string | undefined | undefined;
|
|
172
|
-
dir?: string | undefined | undefined;
|
|
173
173
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
174
174
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
175
175
|
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
@@ -218,6 +218,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
218
218
|
style?: import("vue").StyleValue;
|
|
219
219
|
results?: (string | number) | undefined;
|
|
220
220
|
placeholder?: string | undefined | undefined;
|
|
221
|
+
dir?: string | undefined | undefined;
|
|
221
222
|
class?: import("vue").ClassValue;
|
|
222
223
|
role?: string | undefined | undefined;
|
|
223
224
|
'aria-label'?: string | undefined | undefined;
|
|
@@ -372,7 +373,6 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
372
373
|
accesskey?: string | undefined | undefined;
|
|
373
374
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
374
375
|
contextmenu?: string | undefined | undefined;
|
|
375
|
-
dir?: string | undefined | undefined;
|
|
376
376
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
377
377
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
378
378
|
enterKeyHint?: "search" | "done" | "previous" | "next" | "enter" | "go" | "send" | undefined;
|
|
@@ -406,8 +406,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
406
406
|
}> & Readonly<{
|
|
407
407
|
onCopy?: ((success: boolean) => any) | undefined;
|
|
408
408
|
}>, {
|
|
409
|
-
size: ButtonSize;
|
|
410
409
|
tone: Tone;
|
|
410
|
+
size: ButtonSize;
|
|
411
411
|
variant: ButtonVariant;
|
|
412
412
|
resetAfter: number;
|
|
413
413
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
:bind="linkAttrs"
|
|
6
6
|
class="k-navlink"
|
|
7
7
|
:class="{ 'is-active': active, 'is-disabled': disabled }"
|
|
8
|
-
:title="
|
|
8
|
+
:title="rail ? label : void 0"
|
|
9
|
+
:aria-label="railLabel"
|
|
9
10
|
@click="onClick"
|
|
10
11
|
>
|
|
11
12
|
<span v-if="icon || $slots.icon" class="k-navlink-icon" aria-hidden="true">
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
>
|
|
17
18
|
<span v-if="badge !== void 0 && badge !== ''" class="k-navlink-badge">{{ badge }}</span>
|
|
18
19
|
<Icon v-if="external" name="arrow-right" class="k-navlink-external" />
|
|
20
|
+
<span v-if="external" class="k-visually-hidden">{{ t("common.opensInNewTab") }}</span>
|
|
19
21
|
</Polymorphic>
|
|
20
22
|
</template>
|
|
21
23
|
|
|
@@ -25,6 +27,7 @@ import { Polymorphic } from "../../internal/core/Polymorphic";
|
|
|
25
27
|
import { computed } from "vue";
|
|
26
28
|
import { useAppShell } from "../../composables/useAppShell";
|
|
27
29
|
import { useLinkComponent } from "../../composables/useLink";
|
|
30
|
+
import { useLocale } from "../../composables/useLocale";
|
|
28
31
|
import Icon from "../core/Icon.vue";
|
|
29
32
|
defineOptions({ inheritAttrs: false });
|
|
30
33
|
const props = defineProps({
|
|
@@ -40,6 +43,12 @@ const props = defineProps({
|
|
|
40
43
|
});
|
|
41
44
|
const linkComponent = useLinkComponent();
|
|
42
45
|
const shell = useAppShell();
|
|
46
|
+
const { t } = useLocale();
|
|
47
|
+
const rail = computed(() => Boolean(shell?.collapsed.value && !shell.mobile.value));
|
|
48
|
+
const railLabel = computed(() => {
|
|
49
|
+
if (!rail.value || !props.label) return void 0;
|
|
50
|
+
return props.external ? `${props.label} ${t("common.opensInNewTab")}` : props.label;
|
|
51
|
+
});
|
|
43
52
|
const tag = computed(() => {
|
|
44
53
|
if (props.disabled) return "a";
|
|
45
54
|
if (props.to !== void 0 && linkComponent) return linkComponent;
|
|
@@ -25,6 +25,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
25
25
|
results?: (string | number) | undefined;
|
|
26
26
|
placeholder?: string | undefined;
|
|
27
27
|
bind?: Record<string, unknown>;
|
|
28
|
+
dir?: string | undefined;
|
|
28
29
|
class?: import("vue").ClassValue;
|
|
29
30
|
role?: string | undefined;
|
|
30
31
|
'aria-label'?: string | undefined;
|
|
@@ -183,7 +184,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
183
184
|
accesskey?: string | undefined;
|
|
184
185
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
185
186
|
contextmenu?: string | undefined;
|
|
186
|
-
dir?: string | undefined;
|
|
187
187
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
188
188
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
189
189
|
enterKeyHint?: import("vue").HTMLAttributes["enterkeyhint"];
|
|
@@ -243,6 +243,7 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
243
243
|
results?: (string | number) | undefined;
|
|
244
244
|
placeholder?: string | undefined;
|
|
245
245
|
bind?: Record<string, unknown>;
|
|
246
|
+
dir?: string | undefined;
|
|
246
247
|
class?: import("vue").ClassValue;
|
|
247
248
|
role?: string | undefined;
|
|
248
249
|
'aria-label'?: string | undefined;
|
|
@@ -401,7 +402,6 @@ declare const __VLS_base: import("vue").DefineComponent<{
|
|
|
401
402
|
accesskey?: string | undefined;
|
|
402
403
|
contenteditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
403
404
|
contextmenu?: string | undefined;
|
|
404
|
-
dir?: string | undefined;
|
|
405
405
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
406
406
|
enterkeyhint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
407
407
|
enterKeyHint?: import("vue").HTMLAttributes["enterkeyhint"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<div class="k-page-header" :class="{ 'is-bordered': bordered }">
|
|
3
3
|
<div class="k-page-header-heading">
|
|
4
4
|
<slot name="breadcrumbs">
|
|
5
5
|
<Breadcrumbs
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<div v-if="$slots.default" class="k-page-header-extra">
|
|
36
36
|
<slot />
|
|
37
37
|
</div>
|
|
38
|
-
</
|
|
38
|
+
</div>
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script setup>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="k-separator"
|
|
4
4
|
:class="[`k-separator-${orientation}`, { 'has-label': Boolean(label || $slots.default) }]"
|
|
5
|
-
:role="
|
|
6
|
-
:aria-orientation="!
|
|
5
|
+
:role="plain ? 'none' : 'separator'"
|
|
6
|
+
:aria-orientation="!plain && orientation === 'vertical' ? 'vertical' : void 0"
|
|
7
7
|
>
|
|
8
8
|
<span v-if="label || $slots.default" class="k-separator-label">
|
|
9
9
|
<slot>{{ label }}</slot>
|
|
@@ -12,9 +12,12 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
|
|
14
14
|
<script setup>
|
|
15
|
-
|
|
15
|
+
import { computed, useSlots } from "vue";
|
|
16
|
+
const props = defineProps({
|
|
16
17
|
orientation: { type: String, required: false, default: "horizontal" },
|
|
17
18
|
label: { type: String, required: false },
|
|
18
19
|
decorative: { type: Boolean, required: false }
|
|
19
20
|
});
|
|
21
|
+
const slots = useSlots();
|
|
22
|
+
const plain = computed(() => props.decorative || Boolean(props.label || slots.default));
|
|
20
23
|
</script>
|
|
@@ -11,15 +11,21 @@
|
|
|
11
11
|
tone="neutral"
|
|
12
12
|
size="xs"
|
|
13
13
|
icon="chevron-left"
|
|
14
|
-
:aria-label="
|
|
14
|
+
:aria-label="collapseText"
|
|
15
15
|
:aria-expanded="isCollapsed ? 'false' : 'true'"
|
|
16
|
+
:aria-controls="shell.sidebarId"
|
|
16
17
|
@click="shell?.toggleCollapsed()"
|
|
17
18
|
/>
|
|
18
19
|
</div>
|
|
19
20
|
<div v-if="$slots.top" class="k-sidebar-top">
|
|
20
21
|
<slot name="top" :collapsed="isCollapsed" />
|
|
21
22
|
</div>
|
|
22
|
-
<nav
|
|
23
|
+
<nav
|
|
24
|
+
ref="nav"
|
|
25
|
+
class="k-sidebar-nav"
|
|
26
|
+
:class="{ 'is-overflow-top': overflowTop, 'is-overflow-bottom': overflowBottom }"
|
|
27
|
+
:aria-label="navText"
|
|
28
|
+
>
|
|
23
29
|
<slot :collapsed="isCollapsed" />
|
|
24
30
|
</nav>
|
|
25
31
|
<div v-if="$slots.footer" class="k-sidebar-footer">
|
|
@@ -29,20 +35,21 @@
|
|
|
29
35
|
</template>
|
|
30
36
|
|
|
31
37
|
<script setup>
|
|
32
|
-
import { computed } from "vue";
|
|
38
|
+
import { computed, useTemplateRef } from "vue";
|
|
33
39
|
import { useAppShell } from "../../composables/useAppShell";
|
|
34
40
|
import { useLocale } from "../../composables/useLocale";
|
|
41
|
+
import { useScrollEdges } from "../../internal/core/scroll-edges";
|
|
35
42
|
import Button from "../core/Button.vue";
|
|
36
43
|
const props = defineProps({
|
|
37
44
|
label: { type: String, required: false },
|
|
38
45
|
collapsible: { type: Boolean, required: false },
|
|
39
|
-
collapseLabel: { type: String, required: false }
|
|
40
|
-
expandLabel: { type: String, required: false }
|
|
46
|
+
collapseLabel: { type: String, required: false }
|
|
41
47
|
});
|
|
42
48
|
const { t } = useLocale();
|
|
43
49
|
const navText = computed(() => props.label ?? t("shell.main"));
|
|
44
|
-
const collapseText = computed(() => props.collapseLabel ?? t("shell.
|
|
45
|
-
const expandText = computed(() => props.expandLabel ?? t("shell.expand"));
|
|
50
|
+
const collapseText = computed(() => props.collapseLabel ?? t("shell.sidebar"));
|
|
46
51
|
const shell = useAppShell();
|
|
47
52
|
const isCollapsed = computed(() => Boolean(shell?.collapsed.value));
|
|
53
|
+
const nav = useTemplateRef("nav");
|
|
54
|
+
const { overflowTop, overflowBottom } = useScrollEdges(() => nav.value);
|
|
48
55
|
</script>
|