@bitrix24/b24ui-nuxt 0.7.2 → 1.0.1
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/.nuxt/b24ui/accordion.ts +3 -3
- package/.nuxt/b24ui/advice.ts +6 -5
- package/.nuxt/b24ui/alert.ts +102 -49
- package/.nuxt/b24ui/avatar-group.ts +10 -10
- package/.nuxt/b24ui/avatar.ts +18 -18
- package/.nuxt/b24ui/badge.ts +167 -176
- package/.nuxt/b24ui/button-group.ts +3 -1
- package/.nuxt/b24ui/button.ts +179 -170
- package/.nuxt/b24ui/calendar.ts +48 -28
- package/.nuxt/b24ui/checkbox.ts +82 -85
- package/.nuxt/b24ui/chip.ts +121 -32
- package/.nuxt/b24ui/container.ts +1 -1
- package/.nuxt/b24ui/content/table-wrapper.ts +11 -11
- package/.nuxt/b24ui/countdown.ts +11 -11
- package/.nuxt/b24ui/description-list.ts +6 -6
- package/.nuxt/b24ui/dropdown-menu.ts +111 -183
- package/.nuxt/b24ui/form-field.ts +19 -19
- package/.nuxt/b24ui/index.ts +0 -1
- package/.nuxt/b24ui/input-menu.ts +294 -357
- package/.nuxt/b24ui/input-number.ts +111 -259
- package/.nuxt/b24ui/input.ts +136 -259
- package/.nuxt/b24ui/kbd.ts +15 -13
- package/.nuxt/b24ui/link.ts +5 -5
- package/.nuxt/b24ui/modal.ts +14 -12
- package/.nuxt/b24ui/navbar-divider.ts +1 -1
- package/.nuxt/b24ui/navbar-section.ts +1 -1
- package/.nuxt/b24ui/navbar.ts +1 -1
- package/.nuxt/b24ui/navigation-menu.ts +70 -754
- package/.nuxt/b24ui/popover.ts +2 -2
- package/.nuxt/b24ui/progress.ts +58 -68
- package/.nuxt/b24ui/prose/a.ts +1 -1
- package/.nuxt/b24ui/prose/blockquote.ts +1 -1
- package/.nuxt/b24ui/prose/code.ts +45 -9
- package/.nuxt/b24ui/prose/h1.ts +21 -2
- package/.nuxt/b24ui/prose/h2.ts +21 -12
- package/.nuxt/b24ui/prose/h3.ts +21 -12
- package/.nuxt/b24ui/prose/h4.ts +21 -12
- package/.nuxt/b24ui/prose/h5.ts +21 -12
- package/.nuxt/b24ui/prose/h6.ts +21 -12
- package/.nuxt/b24ui/prose/hr.ts +1 -1
- package/.nuxt/b24ui/prose/ol.ts +1 -1
- package/.nuxt/b24ui/prose/p.ts +26 -1
- package/.nuxt/b24ui/prose/thead.ts +1 -1
- package/.nuxt/b24ui/prose/ul.ts +1 -1
- package/.nuxt/b24ui/radio-group.ts +115 -155
- package/.nuxt/b24ui/range.ts +38 -26
- package/.nuxt/b24ui/select-menu.ts +251 -306
- package/.nuxt/b24ui/select.ts +246 -301
- package/.nuxt/b24ui/separator.ts +40 -85
- package/.nuxt/b24ui/sidebar-header.ts +1 -1
- package/.nuxt/b24ui/sidebar-heading.ts +1 -1
- package/.nuxt/b24ui/sidebar-layout.ts +130 -19
- package/.nuxt/b24ui/sidebar-section.ts +1 -1
- package/.nuxt/b24ui/skeleton.ts +19 -1
- package/.nuxt/b24ui/slideover.ts +35 -34
- package/.nuxt/b24ui/switch.ts +59 -48
- package/.nuxt/b24ui/tabs.ts +26 -239
- package/.nuxt/b24ui/textarea.ts +50 -236
- package/.nuxt/b24ui/toast.ts +38 -30
- package/.nuxt/b24ui/toaster.ts +1 -1
- package/.nuxt/b24ui/tooltip.ts +5 -5
- package/cli/templates.mjs +2 -1
- package/dist/meta.d.mts +18759 -5002
- package/dist/meta.mjs +18759 -5002
- package/dist/module.d.mts +1 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +3 -5
- package/dist/runtime/air-design-tokens/001_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/002_b24_context_utility.css +0 -0
- package/dist/runtime/air-design-tokens/003_b24_context_light.css +1 -0
- package/dist/runtime/air-design-tokens/004_b24_context_dark.css +1 -0
- package/dist/runtime/air-design-tokens/005_b24_context_edge-light.css +1 -0
- package/dist/runtime/air-design-tokens/006_b24_context_edge-dark.css +1 -0
- package/dist/runtime/air-design-tokens/007_b24_global.css +1 -0
- package/dist/runtime/air-design-tokens/008_ui_global.css +1 -0
- package/dist/runtime/air-design-tokens/009_b24_tools.css +1 -0
- package/dist/runtime/air-design-tokens/components/badge-counter.css +1 -0
- package/dist/runtime/air-design-tokens/components/button.css +1 -0
- package/dist/runtime/air-design-tokens/components/navigation-menu.css +1 -0
- package/dist/runtime/air-design-tokens/components/popup.css +1 -0
- package/dist/runtime/air-design-tokens/components/scrollbar.css +2 -0
- package/dist/runtime/air-design-tokens/index.css +1 -0
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Advice.vue +1 -13
- package/dist/runtime/components/Advice.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue +6 -4
- package/dist/runtime/components/Alert.vue.d.ts +11 -4
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue.d.ts +1 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue +7 -11
- package/dist/runtime/components/Badge.vue.d.ts +6 -8
- package/dist/runtime/components/Button.vue +18 -15
- package/dist/runtime/components/Button.vue.d.ts +5 -7
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +8 -8
- package/dist/runtime/components/Calendar.vue.d.ts +14 -8
- package/dist/runtime/components/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/Chip.vue +28 -7
- package/dist/runtime/components/Chip.vue.d.ts +22 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/Countdown.vue.d.ts +5 -3
- package/dist/runtime/components/DescriptionList.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenu.vue +20 -9
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -5
- package/dist/runtime/components/DropdownMenuContent.vue +29 -7
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +14 -6
- package/dist/runtime/components/Form.vue +3 -3
- package/dist/runtime/components/Form.vue.d.ts +6 -5
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Input.vue +8 -4
- package/dist/runtime/components/Input.vue.d.ts +9 -8
- package/dist/runtime/components/InputMenu.vue +44 -18
- package/dist/runtime/components/InputMenu.vue.d.ts +17 -223
- package/dist/runtime/components/InputNumber.vue +14 -11
- package/dist/runtime/components/InputNumber.vue.d.ts +13 -87
- package/dist/runtime/components/Kbd.vue +6 -3
- package/dist/runtime/components/Kbd.vue.d.ts +7 -3
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue +37 -33
- package/dist/runtime/components/Modal.vue.d.ts +2 -2
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +1 -1
- package/dist/runtime/components/Navbar.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarDivider.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSection.vue.d.ts +1 -1
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +1 -1
- package/dist/runtime/components/NavigationMenu.vue +95 -84
- package/dist/runtime/components/NavigationMenu.vue.d.ts +31 -33
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Popover.vue +8 -2
- package/dist/runtime/components/Popover.vue.d.ts +9 -3
- package/dist/runtime/components/Progress.vue.d.ts +3 -3
- package/dist/runtime/components/RadioGroup.vue +1 -1
- package/dist/runtime/components/RadioGroup.vue.d.ts +6 -5
- package/dist/runtime/components/Range.vue.d.ts +6 -6
- package/dist/runtime/components/Select.vue +25 -11
- package/dist/runtime/components/Select.vue.d.ts +7 -7
- package/dist/runtime/components/SelectMenu.vue +38 -19
- package/dist/runtime/components/SelectMenu.vue.d.ts +11 -10
- package/dist/runtime/components/Separator.vue +4 -4
- package/dist/runtime/components/Separator.vue.d.ts +6 -3
- package/dist/runtime/components/Sidebar.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarBody.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarFooter.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeader.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarHeading.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarLayout.vue +148 -63
- package/dist/runtime/components/SidebarLayout.vue.d.ts +61 -8
- package/dist/runtime/components/SidebarSection.vue.d.ts +4 -1
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +4 -1
- package/dist/runtime/components/Skeleton.vue +7 -3
- package/dist/runtime/components/Skeleton.vue.d.ts +12 -1
- package/dist/runtime/components/Slideover.vue +120 -43
- package/dist/runtime/components/Slideover.vue.d.ts +22 -9
- package/dist/runtime/components/Switch.vue.d.ts +2 -2
- package/dist/runtime/components/Tabs.vue +11 -3
- package/dist/runtime/components/Tabs.vue.d.ts +8 -7
- package/dist/runtime/components/Textarea.vue +8 -4
- package/dist/runtime/components/Textarea.vue.d.ts +8 -7
- package/dist/runtime/components/Toast.vue +16 -8
- package/dist/runtime/components/Toast.vue.d.ts +16 -15
- package/dist/runtime/components/Toaster.vue.d.ts +2 -2
- package/dist/runtime/components/Tooltip.vue +9 -5
- package/dist/runtime/components/Tooltip.vue.d.ts +7 -1
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +5 -3
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +4 -7
- package/dist/runtime/composables/useFormField.js +6 -3
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +29 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useSidebarLayout.d.ts +20 -0
- package/dist/runtime/composables/useSidebarLayout.js +16 -0
- package/dist/runtime/dictionary/icons.js +7 -7
- package/dist/runtime/index.css +1 -1
- package/dist/runtime/inertia/components/Link.vue +3 -0
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +6 -0
- package/dist/runtime/locale/br.js +6 -0
- package/dist/runtime/locale/de.js +6 -0
- package/dist/runtime/locale/en.js +6 -0
- package/dist/runtime/locale/fr.js +6 -0
- package/dist/runtime/locale/id.js +6 -0
- package/dist/runtime/locale/it.js +6 -0
- package/dist/runtime/locale/ja.js +6 -0
- package/dist/runtime/locale/kz.js +6 -0
- package/dist/runtime/locale/la.js +6 -0
- package/dist/runtime/locale/ms.js +6 -0
- package/dist/runtime/locale/pl.js +6 -0
- package/dist/runtime/locale/ru.js +6 -0
- package/dist/runtime/locale/sc.js +6 -0
- package/dist/runtime/locale/tc.js +6 -0
- package/dist/runtime/locale/th.js +6 -0
- package/dist/runtime/locale/tr.js +6 -0
- package/dist/runtime/locale/ua.js +6 -0
- package/dist/runtime/locale/vn.js +6 -0
- package/dist/runtime/plugins/ui-version.d.ts +5 -0
- package/dist/runtime/plugins/ui-version.js +8 -0
- package/dist/runtime/prose/A.vue.d.ts +4 -1
- package/dist/runtime/prose/Blockquote.vue.d.ts +4 -1
- package/dist/runtime/prose/Code.vue.d.ts +4 -1
- package/dist/runtime/prose/Em.vue.d.ts +4 -1
- package/dist/runtime/prose/H1.vue +4 -1
- package/dist/runtime/prose/H1.vue.d.ts +7 -1
- package/dist/runtime/prose/H2.vue +4 -1
- package/dist/runtime/prose/H2.vue.d.ts +7 -1
- package/dist/runtime/prose/H3.vue +4 -1
- package/dist/runtime/prose/H3.vue.d.ts +7 -1
- package/dist/runtime/prose/H4.vue +4 -1
- package/dist/runtime/prose/H4.vue.d.ts +7 -1
- package/dist/runtime/prose/H5.vue +4 -1
- package/dist/runtime/prose/H5.vue.d.ts +7 -1
- package/dist/runtime/prose/H6.vue +4 -1
- package/dist/runtime/prose/H6.vue.d.ts +7 -1
- package/dist/runtime/prose/Hr.vue.d.ts +1 -1
- package/dist/runtime/prose/Img.vue.d.ts +1 -1
- package/dist/runtime/prose/Li.vue.d.ts +4 -1
- package/dist/runtime/prose/Ol.vue.d.ts +4 -1
- package/dist/runtime/prose/P.vue +6 -1
- package/dist/runtime/prose/P.vue.d.ts +12 -1
- package/dist/runtime/prose/Pre.vue.d.ts +4 -1
- package/dist/runtime/prose/Strong.vue.d.ts +4 -1
- package/dist/runtime/prose/Table.vue.d.ts +5 -2
- package/dist/runtime/prose/Tbody.vue.d.ts +4 -1
- package/dist/runtime/prose/Td.vue.d.ts +4 -1
- package/dist/runtime/prose/Th.vue.d.ts +4 -1
- package/dist/runtime/prose/Thead.vue.d.ts +4 -1
- package/dist/runtime/prose/Tr.vue.d.ts +4 -1
- package/dist/runtime/prose/Ul.vue.d.ts +4 -1
- package/dist/runtime/types/index.d.ts +0 -1
- package/dist/runtime/types/index.js +0 -1
- package/dist/runtime/types/locale.d.ts +6 -0
- package/dist/runtime/utils/index.d.ts +6 -0
- package/dist/runtime/utils/index.js +27 -0
- package/dist/runtime/utils/tv.js +66 -1
- package/dist/runtime/vue/components/Link.vue +3 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/b24ui-nuxt.dLc5H7ID.mjs +6100 -0
- package/dist/unplugin.mjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +40 -28
- package/.nuxt/b24ui/stacked-layout.ts +0 -34
- package/dist/runtime/air-design-tokens.css +0 -1
- package/dist/runtime/components/StackedLayout.vue +0 -117
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -44
- package/dist/shared/b24ui-nuxt.CxsFEY3M.mjs +0 -7895
|
@@ -3,31 +3,42 @@ import theme from "#build/b24ui/sidebar-layout";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { ref, computed, watch, onUnmounted } from "vue";
|
|
6
|
+
import { ref, computed, watch, onUnmounted, readonly, provide, inject } from "vue";
|
|
7
7
|
import { useRoute } from "vue-router";
|
|
8
8
|
import { Primitive } from "reka-ui";
|
|
9
9
|
import { useAppConfig } from "#imports";
|
|
10
|
+
import { useLocale } from "../composables/useLocale";
|
|
11
|
+
import { sidebarLayoutInjectionKey } from "../composables/useSidebarLayout";
|
|
10
12
|
import { tv } from "../utils/tv";
|
|
11
13
|
import B24Slideover from "./Slideover.vue";
|
|
12
14
|
import B24Sidebar from "./Sidebar.vue";
|
|
13
15
|
import B24ModalDialogClose from "./ModalDialogClose.vue";
|
|
14
16
|
import B24Navbar from "./Navbar.vue";
|
|
15
|
-
import
|
|
17
|
+
import HamburgerMenuIcon from "@bitrix24/b24icons-vue/outline/HamburgerMenuIcon";
|
|
16
18
|
import Cross50Icon from "@bitrix24/b24icons-vue/actions/Cross50Icon";
|
|
19
|
+
import BtnSpinnerIcon from "@bitrix24/b24icons-vue/button-specialized/BtnSpinnerIcon";
|
|
17
20
|
const props = defineProps({
|
|
18
21
|
as: { type: null, required: false, default: "div" },
|
|
19
22
|
useLightContent: { type: Boolean, required: false, default: true },
|
|
23
|
+
isInner: { type: Boolean, required: false, default: false },
|
|
24
|
+
offContentScrollbar: { type: Boolean, required: false, default: false },
|
|
20
25
|
class: { type: null, required: false },
|
|
21
|
-
b24ui: { type:
|
|
26
|
+
b24ui: { type: Object, required: false }
|
|
22
27
|
});
|
|
23
28
|
const slots = defineSlots();
|
|
29
|
+
const { t } = useLocale();
|
|
24
30
|
const appConfig = useAppConfig();
|
|
25
31
|
const route = useRoute();
|
|
26
32
|
const isUseSideBar = computed(() => !!slots.sidebar);
|
|
33
|
+
const isUseNavbar = computed(() => !!slots.navbar);
|
|
27
34
|
const openSidebarSlideover = ref(false);
|
|
28
35
|
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.sidebarLayout || {} })({
|
|
29
36
|
useSidebar: isUseSideBar.value,
|
|
30
|
-
|
|
37
|
+
useNavbar: isUseNavbar.value,
|
|
38
|
+
useLightContent: Boolean(props.useLightContent),
|
|
39
|
+
loading: Boolean(isLoading.value),
|
|
40
|
+
inner: Boolean(props.isInner),
|
|
41
|
+
offContentScrollbar: Boolean(props.offContentScrollbar)
|
|
31
42
|
}));
|
|
32
43
|
const closeModal = () => {
|
|
33
44
|
if (openSidebarSlideover.value) {
|
|
@@ -35,7 +46,7 @@ const closeModal = () => {
|
|
|
35
46
|
}
|
|
36
47
|
};
|
|
37
48
|
const stopWatcher = watch(
|
|
38
|
-
() => route
|
|
49
|
+
() => route?.path,
|
|
39
50
|
() => closeModal(),
|
|
40
51
|
{ immediate: true }
|
|
41
52
|
);
|
|
@@ -45,81 +56,155 @@ onUnmounted(() => {
|
|
|
45
56
|
const handleNavigationClick = () => {
|
|
46
57
|
closeModal();
|
|
47
58
|
};
|
|
59
|
+
const parentApi = inject(sidebarLayoutInjectionKey, null);
|
|
60
|
+
const rootRef = parentApi ? parentApi.rootRef : ref(false);
|
|
61
|
+
const isLoading = ref(false);
|
|
62
|
+
const isParentLoading = computed(
|
|
63
|
+
() => parentApi?.isLoading.value ?? false
|
|
64
|
+
);
|
|
65
|
+
const isRootLoading = computed(
|
|
66
|
+
() => rootRef.value
|
|
67
|
+
);
|
|
68
|
+
const api = {
|
|
69
|
+
isLoading: readonly(isLoading),
|
|
70
|
+
isParentLoading: readonly(isParentLoading),
|
|
71
|
+
isRootLoading: readonly(isRootLoading),
|
|
72
|
+
setLoading: (value) => {
|
|
73
|
+
isLoading.value = value;
|
|
74
|
+
},
|
|
75
|
+
setParentLoading: (value) => {
|
|
76
|
+
if (parentApi) {
|
|
77
|
+
parentApi.setLoading(value);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
setRootLoading: (value) => {
|
|
81
|
+
rootRef.value = value;
|
|
82
|
+
},
|
|
83
|
+
rootRef
|
|
84
|
+
};
|
|
85
|
+
provide(sidebarLayoutInjectionKey, api);
|
|
86
|
+
defineExpose({
|
|
87
|
+
api,
|
|
88
|
+
isLoading,
|
|
89
|
+
setLoading: api.setLoading,
|
|
90
|
+
setRootLoading: api.setRootLoading
|
|
91
|
+
});
|
|
48
92
|
</script>
|
|
49
93
|
|
|
50
94
|
<template>
|
|
51
|
-
<Primitive
|
|
95
|
+
<Primitive
|
|
96
|
+
:data-state="isLoading ? 'loading' : 'show'"
|
|
97
|
+
:as="as"
|
|
98
|
+
:class="b24ui.root({ class: [props.b24ui?.root, props.class] })"
|
|
99
|
+
>
|
|
100
|
+
<!-- isLoading -->
|
|
101
|
+
<slot name="loading" :is-loading="isLoading">
|
|
102
|
+
<div
|
|
103
|
+
v-if="isLoading"
|
|
104
|
+
:class="b24ui.loadingWrapper({ class: props.b24ui?.loadingWrapper })"
|
|
105
|
+
>
|
|
106
|
+
<BtnSpinnerIcon
|
|
107
|
+
:class="b24ui.loadingIcon({ class: props.b24ui?.loadingIcon })"
|
|
108
|
+
aria-hidden="true"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</slot>
|
|
52
112
|
<template v-if="isUseSideBar">
|
|
53
113
|
<div :class="b24ui.sidebar({ class: props.b24ui?.sidebar })">
|
|
54
114
|
<B24Sidebar>
|
|
55
|
-
<slot name="sidebar" :handle-click="handleNavigationClick" />
|
|
115
|
+
<slot name="sidebar" :handle-click="handleNavigationClick" :is-loading="isLoading" />
|
|
56
116
|
</B24Sidebar>
|
|
57
117
|
</div>
|
|
58
118
|
</template>
|
|
59
119
|
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
v-if="
|
|
63
|
-
:class="b24ui.
|
|
120
|
+
<div :class="b24ui.contentWrapper({ class: props.b24ui?.contentWrapper })">
|
|
121
|
+
<header
|
|
122
|
+
v-if="isUseNavbar"
|
|
123
|
+
:class="b24ui.header({ class: props.b24ui?.header })"
|
|
64
124
|
>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
title="Navigation"
|
|
69
|
-
description="Content navigation"
|
|
70
|
-
side="left"
|
|
71
|
-
:b24ui="{ content: b24ui.sidebarSlideoverContainer({ class: props.b24ui?.sidebarSlideoverContainer }) }"
|
|
125
|
+
<div
|
|
126
|
+
v-if="isUseSideBar"
|
|
127
|
+
:class="b24ui.headerMenuIcon({ class: props.b24ui?.headerMenuIcon })"
|
|
72
128
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
:
|
|
79
|
-
|
|
80
|
-
|
|
129
|
+
<B24Slideover
|
|
130
|
+
v-model:open="openSidebarSlideover"
|
|
131
|
+
:title="t('sidebarLayout.slideoverTitle')"
|
|
132
|
+
:description="t('sidebarLayout.slideoverDescription')"
|
|
133
|
+
side="left"
|
|
134
|
+
:b24ui="{
|
|
135
|
+
content: b24ui.sidebarSlideoverContainer({ class: props.b24ui?.sidebarSlideoverContainer })
|
|
136
|
+
}"
|
|
137
|
+
>
|
|
138
|
+
<B24Button
|
|
139
|
+
color="air-tertiary"
|
|
140
|
+
size="md"
|
|
141
|
+
:icon="HamburgerMenuIcon"
|
|
142
|
+
:aria-label="t('sidebarLayout.open')"
|
|
143
|
+
/>
|
|
144
|
+
|
|
145
|
+
<template #content>
|
|
146
|
+
<div :class="b24ui.sidebarSlideover({ class: props.b24ui?.sidebarSlideover })">
|
|
147
|
+
<B24Sidebar>
|
|
148
|
+
<div :class="b24ui.sidebarSlideoverBtnClose({ class: props.b24ui?.sidebarSlideoverBtnClose })">
|
|
149
|
+
<B24ModalDialogClose>
|
|
150
|
+
<B24Button
|
|
151
|
+
color="air-tertiary"
|
|
152
|
+
size="lg"
|
|
153
|
+
:icon="Cross50Icon"
|
|
154
|
+
:aria-label="t('sidebarLayout.close')"
|
|
155
|
+
/>
|
|
156
|
+
</B24ModalDialogClose>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<slot name="sidebar" :handle-click="handleNavigationClick" :is-loading="isLoading" />
|
|
160
|
+
</B24Sidebar>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
</B24Slideover>
|
|
164
|
+
</div>
|
|
165
|
+
<div :class="b24ui.headerWrapper({ class: props.b24ui?.headerWrapper })">
|
|
166
|
+
<B24Navbar>
|
|
167
|
+
<slot name="navbar" :is-loading="isLoading" />
|
|
168
|
+
</B24Navbar>
|
|
169
|
+
</div>
|
|
170
|
+
</header>
|
|
81
171
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
size="lg"
|
|
91
|
-
:icon="Cross50Icon"
|
|
92
|
-
aria-label="Close navigation"
|
|
93
|
-
/>
|
|
94
|
-
</B24ModalDialogClose>
|
|
95
|
-
</div>
|
|
172
|
+
<template v-if="!!slots['content-top'] || !!slots['content-actions'] || !!slots['default']">
|
|
173
|
+
<main :class="b24ui.container({ class: props.b24ui?.container })">
|
|
174
|
+
<template v-if="!!slots['content-top']">
|
|
175
|
+
<!-- Page Top -->
|
|
176
|
+
<div :class="b24ui.pageTopWrapper({ class: props.b24ui?.pageTopWrapper })">
|
|
177
|
+
<slot name="content-top" :is-loading="isLoading" />
|
|
178
|
+
</div>
|
|
179
|
+
</template>
|
|
96
180
|
|
|
97
|
-
|
|
98
|
-
|
|
181
|
+
<template v-if="!!slots['content-actions']">
|
|
182
|
+
<!-- Page Actions -->
|
|
183
|
+
<div :class="b24ui.pageActionsWrapper({ class: props.b24ui?.pageActionsWrapper })">
|
|
184
|
+
<slot name="content-actions" :is-loading="isLoading" />
|
|
99
185
|
</div>
|
|
100
186
|
</template>
|
|
101
|
-
</B24Slideover>
|
|
102
|
-
</div>
|
|
103
|
-
<div :class="b24ui.headerWrapper({ class: props.b24ui?.headerWrapper })">
|
|
104
|
-
<B24Navbar :class="b24ui.headerPaddings({ class: props.b24ui?.headerPaddings })">
|
|
105
|
-
<slot name="navbar" />
|
|
106
|
-
</B24Navbar>
|
|
107
|
-
</div>
|
|
108
|
-
</header>
|
|
109
187
|
|
|
110
|
-
|
|
111
|
-
|
|
188
|
+
<template v-if="!!slots['default']">
|
|
189
|
+
<!-- Page Content -->
|
|
190
|
+
<div
|
|
191
|
+
:data-content="props.useLightContent ? 'use-light' : 'not-set'"
|
|
192
|
+
:class="b24ui.containerWrapper({ class: props.b24ui?.containerWrapper })"
|
|
193
|
+
>
|
|
194
|
+
<div :class="b24ui.containerWrapperInner({ class: props.b24ui?.containerWrapperInner })">
|
|
195
|
+
<slot :is-loading="isLoading" />
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</template>
|
|
199
|
+
</main>
|
|
200
|
+
</template>
|
|
112
201
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<div :class="b24ui.
|
|
116
|
-
<
|
|
117
|
-
<slot />
|
|
118
|
-
</div>
|
|
202
|
+
<template v-if="!!slots['content-bottom']">
|
|
203
|
+
<!-- Page Bottom -->
|
|
204
|
+
<div :class="b24ui.pageBottomWrapper({ class: props.b24ui?.pageBottomWrapper })">
|
|
205
|
+
<slot name="content-bottom" :is-loading="isLoading" />
|
|
119
206
|
</div>
|
|
120
|
-
</
|
|
121
|
-
</
|
|
122
|
-
|
|
123
|
-
<slot name="content-bottom" />
|
|
124
|
-
</Primitive>
|
|
207
|
+
</template>
|
|
208
|
+
</div>
|
|
209
|
+
</primitive>
|
|
125
210
|
</template>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AppConfig } from '@nuxt/schema';
|
|
2
2
|
import theme from '#build/b24ui/sidebar-layout';
|
|
3
3
|
import type { ComponentConfig } from '../types/utils';
|
|
4
|
+
import type { Ref } from 'vue';
|
|
5
|
+
import type { SidebarLayoutApi } from '../composables/useSidebarLayout';
|
|
4
6
|
type SidebarLayout = ComponentConfig<typeof theme, AppConfig, 'sidebarLayout'>;
|
|
5
7
|
export interface SidebarLayoutProps {
|
|
6
8
|
/**
|
|
@@ -8,33 +10,84 @@ export interface SidebarLayoutProps {
|
|
|
8
10
|
* @defaultValue 'div'
|
|
9
11
|
*/
|
|
10
12
|
as?: any;
|
|
13
|
+
/**
|
|
14
|
+
* The content is placed on a light background.
|
|
15
|
+
* @defaultValue 'true'
|
|
16
|
+
*/
|
|
11
17
|
useLightContent?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Set inner mode. Use in slider, modal and etc
|
|
20
|
+
* @defaultValue 'false'
|
|
21
|
+
*/
|
|
22
|
+
isInner?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Off scrollbar control of the content area in inner mode.
|
|
25
|
+
* @defaultValue 'false'
|
|
26
|
+
*/
|
|
27
|
+
offContentScrollbar?: boolean;
|
|
12
28
|
class?: any;
|
|
13
|
-
b24ui?: SidebarLayout['slots']
|
|
29
|
+
b24ui?: Pick<SidebarLayout['slots'], 'root' | 'sidebar' | 'sidebarSlideoverContainer' | 'sidebarSlideover' | 'sidebarSlideoverBtnClose' | 'contentWrapper' | 'header' | 'headerMenuIcon' | 'headerWrapper' | 'container' | 'containerWrapper' | 'pageTopWrapper' | 'pageActionsWrapper' | 'containerWrapperInner' | 'pageBottomWrapper' | 'loadingWrapper' | 'loadingIcon'>;
|
|
14
30
|
}
|
|
15
31
|
export interface SidebarLayoutSlots {
|
|
16
32
|
/**
|
|
17
|
-
*
|
|
33
|
+
* Left menu.
|
|
18
34
|
* @param props
|
|
19
35
|
* @param props.handleClick - Handler for navigation click events
|
|
36
|
+
* @param props.isLoading - loading state
|
|
20
37
|
*/
|
|
21
38
|
'sidebar'(props: {
|
|
22
39
|
handleClick: () => void;
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
}): any;
|
|
42
|
+
/**
|
|
43
|
+
* Top menu.
|
|
44
|
+
*/
|
|
45
|
+
'navbar'(props?: {
|
|
46
|
+
handleClick: () => void;
|
|
47
|
+
isLoading: boolean;
|
|
23
48
|
}): any;
|
|
24
49
|
/**
|
|
25
|
-
*
|
|
50
|
+
* Content above the page. Used for title, filter, etc.
|
|
51
|
+
*/
|
|
52
|
+
'content-top': (props?: {
|
|
53
|
+
isLoading: boolean;
|
|
54
|
+
}) => any;
|
|
55
|
+
/**
|
|
56
|
+
* Content above the page. Use for show actions.
|
|
26
57
|
*/
|
|
27
|
-
'
|
|
58
|
+
'content-actions': (props?: {
|
|
59
|
+
isLoading: boolean;
|
|
60
|
+
}) => any;
|
|
28
61
|
/**
|
|
29
62
|
* The page content.
|
|
30
63
|
*/
|
|
31
|
-
'default'(props?: {
|
|
32
|
-
|
|
33
|
-
|
|
64
|
+
'default'(props?: {
|
|
65
|
+
isLoading: boolean;
|
|
66
|
+
}): any;
|
|
67
|
+
/**
|
|
68
|
+
* Content below the page.
|
|
69
|
+
*/
|
|
70
|
+
'content-bottom': (props?: {
|
|
71
|
+
isLoading: boolean;
|
|
72
|
+
}) => any;
|
|
73
|
+
/**
|
|
74
|
+
* Loading state. You need to use `useSidebarLayout` to control it.
|
|
75
|
+
*/
|
|
76
|
+
'loading': (props?: {
|
|
77
|
+
isLoading: boolean;
|
|
78
|
+
}) => any;
|
|
79
|
+
}
|
|
80
|
+
export interface SidebarLayoutInstance {
|
|
81
|
+
api: SidebarLayoutApi;
|
|
82
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
83
|
+
setLoading: (value: boolean) => void;
|
|
84
|
+
setRootLoading: (value: boolean) => void;
|
|
34
85
|
}
|
|
35
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarLayoutProps,
|
|
86
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarLayoutProps, SidebarLayoutInstance, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarLayoutProps> & Readonly<{}>, {
|
|
36
87
|
as: any;
|
|
88
|
+
offContentScrollbar: boolean;
|
|
37
89
|
useLightContent: boolean;
|
|
90
|
+
isInner: boolean;
|
|
38
91
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarLayoutSlots>;
|
|
39
92
|
export default _default;
|
|
40
93
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -11,10 +11,13 @@ export interface SidebarSectionProps {
|
|
|
11
11
|
class?: any;
|
|
12
12
|
b24ui?: SidebarSection['slots'];
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @todo add Pick<Xxxx
|
|
16
|
+
*/
|
|
14
17
|
export interface SidebarSectionSlots {
|
|
15
18
|
default(props?: {}): any;
|
|
16
19
|
}
|
|
17
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarSectionProps,
|
|
20
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarSectionProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarSectionProps> & Readonly<{}>, {
|
|
18
21
|
as: any;
|
|
19
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarSectionSlots>;
|
|
20
23
|
export default _default;
|
|
@@ -11,10 +11,13 @@ export interface SidebarSpacerProps {
|
|
|
11
11
|
class?: any;
|
|
12
12
|
b24ui?: SidebarSpacer['slots'];
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* @todo add Pick<Xxxx
|
|
16
|
+
*/
|
|
14
17
|
export interface SidebarSpacerSlots {
|
|
15
18
|
default(props?: {}): any;
|
|
16
19
|
}
|
|
17
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarSpacerProps,
|
|
20
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SidebarSpacerProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SidebarSpacerProps> & Readonly<{}>, {
|
|
18
21
|
as: any;
|
|
19
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SidebarSpacerSlots>;
|
|
20
23
|
export default _default;
|
|
@@ -8,11 +8,15 @@ import { Primitive } from "reka-ui";
|
|
|
8
8
|
import { useAppConfig } from "#imports";
|
|
9
9
|
import { tv } from "../utils/tv";
|
|
10
10
|
const props = defineProps({
|
|
11
|
+
accent: { type: null, required: false, default: "default" },
|
|
11
12
|
as: { type: null, required: false },
|
|
12
|
-
class: { type: null, required: false }
|
|
13
|
+
class: { type: null, required: false },
|
|
14
|
+
b24ui: { type: null, required: false }
|
|
13
15
|
});
|
|
14
16
|
const appConfig = useAppConfig();
|
|
15
|
-
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.skeleton || {} })
|
|
17
|
+
const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.skeleton || {} })({
|
|
18
|
+
accent: props.accent
|
|
19
|
+
}));
|
|
16
20
|
</script>
|
|
17
21
|
|
|
18
22
|
<template>
|
|
@@ -22,7 +26,7 @@ const b24ui = computed(() => tv({ extend: tv(theme), ...appConfig.b24ui?.skeleto
|
|
|
22
26
|
aria-label="loading"
|
|
23
27
|
aria-live="polite"
|
|
24
28
|
role="alert"
|
|
25
|
-
:class="b24ui({ class: props.class })"
|
|
29
|
+
:class="b24ui.base({ class: [props.b24ui?.base, props.class] })"
|
|
26
30
|
>
|
|
27
31
|
<slot />
|
|
28
32
|
</Primitive>
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import type { AppConfig } from '@nuxt/schema';
|
|
2
|
+
import theme from '#build/b24ui/skeleton';
|
|
3
|
+
import type { ComponentConfig } from '../types/utils';
|
|
4
|
+
type Skeleton = ComponentConfig<typeof theme, AppConfig, 'skeleton'>;
|
|
1
5
|
export interface SkeletonProps {
|
|
6
|
+
/**
|
|
7
|
+
* @defaultValue 'default'
|
|
8
|
+
*/
|
|
9
|
+
accent?: Skeleton['variants']['accent'];
|
|
2
10
|
/**
|
|
3
11
|
* The element or component this component should render as.
|
|
4
12
|
* @defaultValue 'div'
|
|
5
13
|
*/
|
|
6
14
|
as?: any;
|
|
7
15
|
class?: any;
|
|
16
|
+
b24ui?: Skeleton['slots'];
|
|
8
17
|
}
|
|
9
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps,
|
|
18
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {
|
|
19
|
+
accent: Skeleton["variants"]["accent"];
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
21
|
default?: (props: {}) => any;
|
|
11
22
|
}>;
|
|
12
23
|
export default _default;
|