@bitrix24/b24ui-nuxt 0.5.10 → 0.5.11
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/dist/meta.cjs +72112 -0
- package/dist/meta.d.cts +72110 -0
- package/dist/meta.d.mts +5060 -5060
- package/dist/meta.d.ts +72110 -0
- package/dist/meta.mjs +5060 -5060
- package/dist/module.cjs +63 -0
- package/dist/module.d.cts +15 -0
- package/dist/module.d.ts +15 -0
- package/dist/module.json +3 -3
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Advice.vue +54 -47
- package/dist/runtime/components/Alert.vue +96 -71
- package/dist/runtime/components/App.vue +34 -37
- package/dist/runtime/components/Avatar.vue +81 -69
- package/dist/runtime/components/AvatarGroup.vue +76 -53
- package/dist/runtime/components/Badge.vue +83 -83
- package/dist/runtime/components/Button.vue +157 -220
- package/dist/runtime/components/ButtonGroup.vue +51 -35
- package/dist/runtime/components/Calendar.vue +152 -186
- package/dist/runtime/components/Checkbox.vue +73 -84
- package/dist/runtime/components/Chip.vue +74 -59
- package/dist/runtime/components/Collapsible.vue +41 -44
- package/dist/runtime/components/Container.vue +27 -18
- package/dist/runtime/components/Countdown.vue +378 -198
- package/dist/runtime/components/DescriptionList.vue +149 -102
- package/dist/runtime/components/DropdownMenu.vue +139 -83
- package/dist/runtime/components/DropdownMenuContent.vue +84 -137
- package/dist/runtime/components/Form.vue +216 -162
- package/dist/runtime/components/FormField.vue +80 -76
- package/dist/runtime/components/Input.vue +179 -160
- package/dist/runtime/components/InputMenu.vue +380 -300
- package/dist/runtime/components/InputNumber.vue +175 -178
- package/dist/runtime/components/Kbd.vue +45 -33
- package/dist/runtime/components/Link.vue +173 -179
- package/dist/runtime/components/LinkBase.vue +42 -64
- package/dist/runtime/components/Modal.vue +127 -105
- package/dist/runtime/components/ModalDialogClose.vue +8 -4
- package/dist/runtime/components/Navbar.vue +33 -24
- package/dist/runtime/components/NavbarDivider.vue +33 -24
- package/dist/runtime/components/NavbarSection.vue +33 -24
- package/dist/runtime/components/NavbarSpacer.vue +33 -24
- package/dist/runtime/components/NavigationMenu.vue +210 -144
- package/dist/runtime/components/OverlayProvider.vue +17 -13
- package/dist/runtime/components/Popover.vue +81 -81
- package/dist/runtime/components/Progress.vue +136 -109
- package/dist/runtime/components/RadioGroup.vue +134 -120
- package/dist/runtime/components/Range.vue +85 -94
- package/dist/runtime/components/Select.vue +260 -212
- package/dist/runtime/components/SelectMenu.vue +365 -272
- package/dist/runtime/components/Separator.vue +71 -61
- package/dist/runtime/components/Sidebar.vue +33 -24
- package/dist/runtime/components/SidebarBody.vue +38 -30
- package/dist/runtime/components/SidebarFooter.vue +33 -24
- package/dist/runtime/components/SidebarHeader.vue +33 -24
- package/dist/runtime/components/SidebarHeading.vue +33 -24
- package/dist/runtime/components/SidebarLayout.vue +70 -40
- package/dist/runtime/components/SidebarSection.vue +33 -24
- package/dist/runtime/components/SidebarSpacer.vue +33 -24
- package/dist/runtime/components/Skeleton.vue +22 -17
- package/dist/runtime/components/Slideover.vue +131 -108
- package/dist/runtime/components/StackedLayout.vue +73 -40
- package/dist/runtime/components/Switch.vue +95 -100
- package/dist/runtime/components/Tabs.vue +107 -81
- package/dist/runtime/components/Textarea.vue +201 -177
- package/dist/runtime/components/Toast.vue +105 -94
- package/dist/runtime/components/Toaster.vue +116 -94
- package/dist/runtime/components/Tooltip.vue +64 -78
- package/dist/runtime/components/content/TableWrapper.vue +70 -58
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/prose/A.vue +23 -18
- package/dist/runtime/prose/Blockquote.vue +23 -18
- package/dist/runtime/prose/Code.vue +31 -23
- package/dist/runtime/prose/Em.vue +23 -18
- package/dist/runtime/prose/H1.vue +23 -18
- package/dist/runtime/prose/H2.vue +23 -18
- package/dist/runtime/prose/H3.vue +23 -18
- package/dist/runtime/prose/H4.vue +23 -18
- package/dist/runtime/prose/H5.vue +23 -18
- package/dist/runtime/prose/H6.vue +23 -18
- package/dist/runtime/prose/Hr.vue +19 -18
- package/dist/runtime/prose/Img.vue +23 -18
- package/dist/runtime/prose/Li.vue +23 -18
- package/dist/runtime/prose/Ol.vue +23 -18
- package/dist/runtime/prose/P.vue +23 -18
- package/dist/runtime/prose/Pre.vue +33 -28
- package/dist/runtime/prose/Strong.vue +23 -18
- package/dist/runtime/prose/Table.vue +54 -44
- package/dist/runtime/prose/Tbody.vue +23 -18
- package/dist/runtime/prose/Td.vue +23 -18
- package/dist/runtime/prose/Th.vue +23 -18
- package/dist/runtime/prose/Thead.vue +23 -18
- package/dist/runtime/prose/Tr.vue +23 -18
- package/dist/runtime/prose/Ul.vue +23 -18
- package/dist/runtime/vue/components/Link.vue +202 -201
- package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +7721 -0
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +7 -0
- package/dist/unplugin.cjs +236 -0
- package/dist/unplugin.d.cts +33 -0
- package/dist/unplugin.d.ts +33 -0
- package/dist/vite.cjs +21 -0
- package/dist/vite.d.cts +14 -0
- package/dist/vite.d.ts +14 -0
- package/package.json +25 -13
- package/dist/runtime/components/Advice.vue.d.ts +0 -170
- package/dist/runtime/components/Alert.vue.d.ts +0 -464
- package/dist/runtime/components/App.vue.d.ts +0 -23
- package/dist/runtime/components/Avatar.vue.d.ts +0 -281
- package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -204
- package/dist/runtime/components/Badge.vue.d.ts +0 -517
- package/dist/runtime/components/Button.vue.d.ts +0 -640
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -116
- package/dist/runtime/components/Calendar.vue.d.ts +0 -437
- package/dist/runtime/components/Checkbox.vue.d.ts +0 -354
- package/dist/runtime/components/Chip.vue.d.ts +0 -271
- package/dist/runtime/components/Collapsible.vue.d.ts +0 -118
- package/dist/runtime/components/Container.vue.d.ts +0 -27
- package/dist/runtime/components/Countdown.vue.d.ts +0 -356
- package/dist/runtime/components/DescriptionList.vue.d.ts +0 -379
- package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -533
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -228
- package/dist/runtime/components/Form.vue.d.ts +0 -55
- package/dist/runtime/components/FormField.vue.d.ts +0 -282
- package/dist/runtime/components/Input.vue.d.ts +0 -755
- package/dist/runtime/components/InputMenu.vue.d.ts +0 -1504
- package/dist/runtime/components/InputNumber.vue.d.ts +0 -658
- package/dist/runtime/components/Kbd.vue.d.ts +0 -109
- package/dist/runtime/components/Link.vue.d.ts +0 -129
- package/dist/runtime/components/LinkBase.vue.d.ts +0 -48
- package/dist/runtime/components/Modal.vue.d.ts +0 -327
- package/dist/runtime/components/ModalDialogClose.vue.d.ts +0 -10
- package/dist/runtime/components/Navbar.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarDivider.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSection.vue.d.ts +0 -101
- package/dist/runtime/components/NavbarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -824
- package/dist/runtime/components/OverlayProvider.vue.d.ts +0 -2
- package/dist/runtime/components/Popover.vue.d.ts +0 -147
- package/dist/runtime/components/Progress.vue.d.ts +0 -592
- package/dist/runtime/components/RadioGroup.vue.d.ts +0 -723
- package/dist/runtime/components/Range.vue.d.ts +0 -417
- package/dist/runtime/components/Select.vue.d.ts +0 -1200
- package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1298
- package/dist/runtime/components/Separator.vue.d.ts +0 -400
- package/dist/runtime/components/Sidebar.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarBody.vue.d.ts +0 -90
- package/dist/runtime/components/SidebarFooter.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeader.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarHeading.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarLayout.vue.d.ts +0 -222
- package/dist/runtime/components/SidebarSection.vue.d.ts +0 -101
- package/dist/runtime/components/SidebarSpacer.vue.d.ts +0 -101
- package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
- package/dist/runtime/components/Slideover.vue.d.ts +0 -360
- package/dist/runtime/components/StackedLayout.vue.d.ts +0 -192
- package/dist/runtime/components/Switch.vue.d.ts +0 -587
- package/dist/runtime/components/Tabs.vue.d.ts +0 -453
- package/dist/runtime/components/Textarea.vue.d.ts +0 -601
- package/dist/runtime/components/Toast.vue.d.ts +0 -438
- package/dist/runtime/components/Toaster.vue.d.ts +0 -219
- package/dist/runtime/components/Tooltip.vue.d.ts +0 -186
- package/dist/runtime/components/content/TableWrapper.vue.d.ts +0 -237
- package/dist/runtime/prose/A.vue.d.ts +0 -84
- package/dist/runtime/prose/Blockquote.vue.d.ts +0 -84
- package/dist/runtime/prose/Code.vue.d.ts +0 -97
- package/dist/runtime/prose/Em.vue.d.ts +0 -84
- package/dist/runtime/prose/H1.vue.d.ts +0 -97
- package/dist/runtime/prose/H2.vue.d.ts +0 -123
- package/dist/runtime/prose/H3.vue.d.ts +0 -123
- package/dist/runtime/prose/H4.vue.d.ts +0 -123
- package/dist/runtime/prose/H5.vue.d.ts +0 -123
- package/dist/runtime/prose/H6.vue.d.ts +0 -123
- package/dist/runtime/prose/Hr.vue.d.ts +0 -74
- package/dist/runtime/prose/Img.vue.d.ts +0 -77
- package/dist/runtime/prose/Li.vue.d.ts +0 -84
- package/dist/runtime/prose/Ol.vue.d.ts +0 -84
- package/dist/runtime/prose/P.vue.d.ts +0 -84
- package/dist/runtime/prose/Pre.vue.d.ts +0 -117
- package/dist/runtime/prose/Strong.vue.d.ts +0 -84
- package/dist/runtime/prose/Table.vue.d.ts +0 -144
- package/dist/runtime/prose/Tbody.vue.d.ts +0 -84
- package/dist/runtime/prose/Td.vue.d.ts +0 -84
- package/dist/runtime/prose/Th.vue.d.ts +0 -84
- package/dist/runtime/prose/Thead.vue.d.ts +0 -84
- package/dist/runtime/prose/Tr.vue.d.ts +0 -84
- package/dist/runtime/prose/Ul.vue.d.ts +0 -84
- package/dist/runtime/vue/components/Link.vue.d.ts +0 -129
|
@@ -1,29 +1,38 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
3
|
+
import _appConfig from '#build/app.config'
|
|
4
|
+
import theme from '#build/b24ui/sidebar-spacer'
|
|
5
|
+
import { tv } from '../utils/tv'
|
|
6
|
+
|
|
7
|
+
const appConfigSidebarSpacer = _appConfig as AppConfig & { b24ui: { sidebarSpacer: Partial<typeof theme> } }
|
|
8
|
+
|
|
9
|
+
const sidebarSpacer = tv({ extend: tv(theme), ...(appConfigSidebarSpacer.b24ui?.sidebarSpacer || {}) })
|
|
10
|
+
|
|
11
|
+
export interface SidebarSpacerProps {
|
|
12
|
+
/**
|
|
13
|
+
* The element or component this component should render as.
|
|
14
|
+
* @defaultValue 'div'
|
|
15
|
+
*/
|
|
16
|
+
as?: any
|
|
17
|
+
class?: any
|
|
18
|
+
b24ui?: Partial<typeof sidebarSpacer.slots>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SidebarSpacerSlots {
|
|
22
|
+
default(props?: {}): any
|
|
23
|
+
}
|
|
7
24
|
</script>
|
|
8
25
|
|
|
9
|
-
<script setup>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
b24ui: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: false
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
defineSlots();
|
|
26
|
-
const b24ui = sidebarSpacer();
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import { Primitive } from 'reka-ui'
|
|
28
|
+
|
|
29
|
+
const props = withDefaults(defineProps<SidebarSpacerProps>(), {
|
|
30
|
+
as: 'div'
|
|
31
|
+
})
|
|
32
|
+
defineSlots<SidebarSpacerSlots>()
|
|
33
|
+
|
|
34
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
35
|
+
const b24ui = sidebarSpacer()
|
|
27
36
|
</script>
|
|
28
37
|
|
|
29
38
|
<template>
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
3
|
+
import _appConfig from '#build/app.config'
|
|
4
|
+
import theme from '#build/b24ui/skeleton'
|
|
5
|
+
import { tv } from '../utils/tv'
|
|
6
|
+
|
|
7
|
+
const appConfigSkeleton = _appConfig as AppConfig & { b24ui: { skeleton: Partial<typeof theme> } }
|
|
8
|
+
|
|
9
|
+
const skeleton = tv({ extend: tv(theme), ...(appConfigSkeleton.b24ui?.skeleton || {}) })
|
|
10
|
+
|
|
11
|
+
export interface SkeletonProps {
|
|
12
|
+
/**
|
|
13
|
+
* The element or component this component should render as.
|
|
14
|
+
* @defaultValue 'div'
|
|
15
|
+
*/
|
|
16
|
+
as?: any
|
|
17
|
+
class?: any
|
|
18
|
+
}
|
|
7
19
|
</script>
|
|
8
20
|
|
|
9
|
-
<script setup>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
required: false
|
|
14
|
-
},
|
|
15
|
-
class: {
|
|
16
|
-
type: null,
|
|
17
|
-
required: false
|
|
18
|
-
}
|
|
19
|
-
});
|
|
21
|
+
<script setup lang="ts">
|
|
22
|
+
import { Primitive } from 'reka-ui'
|
|
23
|
+
|
|
24
|
+
const props = defineProps<SkeletonProps>()
|
|
20
25
|
</script>
|
|
21
26
|
|
|
22
27
|
<template>
|
|
@@ -1,119 +1,142 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/b24ui/slideover'
|
|
7
|
+
import { tv } from '../utils/tv'
|
|
8
|
+
import type { ButtonProps, IconComponent } from '../types'
|
|
9
|
+
import type { EmitsToProps } from '../types/utils'
|
|
10
|
+
|
|
11
|
+
const appConfigSlideover = _appConfig as AppConfig & { b24ui: { slideover: Partial<typeof theme> } }
|
|
12
|
+
|
|
13
|
+
const slideover = tv({ extend: tv(theme), ...(appConfigSlideover.b24ui?.slideover || {}) })
|
|
14
|
+
|
|
15
|
+
type SlideoverVariants = VariantProps<typeof slideover>
|
|
16
|
+
|
|
17
|
+
export interface SlideoverProps extends DialogRootProps {
|
|
18
|
+
title?: string
|
|
19
|
+
description?: string
|
|
20
|
+
/**
|
|
21
|
+
* The content of the slideover
|
|
22
|
+
*/
|
|
23
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>
|
|
24
|
+
/**
|
|
25
|
+
* Render an overlay behind the slideover.
|
|
26
|
+
* @defaultValue true
|
|
27
|
+
*/
|
|
28
|
+
overlay?: boolean
|
|
29
|
+
/**
|
|
30
|
+
* Render an overlay blur behind the slideover.
|
|
31
|
+
* `auto` use `motion-safe`.
|
|
32
|
+
* @defaultValue 'auto'
|
|
33
|
+
*/
|
|
34
|
+
overlayBlur?: SlideoverVariants['overlayBlur']
|
|
35
|
+
/**
|
|
36
|
+
* Animate the slideover when opening or closing.
|
|
37
|
+
* @defaultValue true
|
|
38
|
+
*/
|
|
39
|
+
transition?: boolean
|
|
40
|
+
/**
|
|
41
|
+
* The side of the slideover.
|
|
42
|
+
* @defaultValue 'right'
|
|
43
|
+
*/
|
|
44
|
+
side?: SlideoverVariants['side']
|
|
45
|
+
/**
|
|
46
|
+
* Render the slideover in a portal.
|
|
47
|
+
* @defaultValue true
|
|
48
|
+
*/
|
|
49
|
+
portal?: boolean
|
|
50
|
+
/**
|
|
51
|
+
* Display a close button to dismiss the slideover.
|
|
52
|
+
* `{ color: 'primary' }`{lang="ts"} for `left`, `right`
|
|
53
|
+
* `{ color: 'link' }`{lang="ts"} for `top`, `bottom`
|
|
54
|
+
* @defaultValue true
|
|
55
|
+
*/
|
|
56
|
+
close?: boolean | Partial<ButtonProps>
|
|
57
|
+
/**
|
|
58
|
+
* The icon displayed in the close button.
|
|
59
|
+
* @defaultValue icons.close
|
|
60
|
+
* @IconifyIcon
|
|
61
|
+
*/
|
|
62
|
+
closeIcon?: IconComponent
|
|
63
|
+
/**
|
|
64
|
+
* When `false`, the slideover will not close when clicking outside or pressing escape.
|
|
65
|
+
* @defaultValue false
|
|
66
|
+
*/
|
|
67
|
+
dismissible?: boolean
|
|
68
|
+
/**
|
|
69
|
+
* @defaultValue true
|
|
70
|
+
*/
|
|
71
|
+
scrollbarThin?: boolean
|
|
72
|
+
class?: any
|
|
73
|
+
b24ui?: Partial<typeof slideover.slots>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface SlideoverEmits extends DialogRootEmits {
|
|
77
|
+
'after:leave': []
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface SlideoverSlots {
|
|
81
|
+
default(props: { open: boolean }): any
|
|
82
|
+
content(props?: {}): any
|
|
83
|
+
header(props?: {}): any
|
|
84
|
+
title(props?: {}): any
|
|
85
|
+
description(props?: {}): any
|
|
86
|
+
close(props: { b24ui: ReturnType<typeof slideover> }): any
|
|
87
|
+
body(props?: {}): any
|
|
88
|
+
footer(props?: {}): any
|
|
89
|
+
}
|
|
7
90
|
</script>
|
|
8
91
|
|
|
9
|
-
<script setup>
|
|
10
|
-
import { computed, toRef } from
|
|
11
|
-
import { useForwardPropsEmits } from
|
|
12
|
-
import { reactivePick } from
|
|
13
|
-
import { useLocale } from
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
default: "auto"
|
|
36
|
-
},
|
|
37
|
-
transition: {
|
|
38
|
-
type: Boolean,
|
|
39
|
-
required: false,
|
|
40
|
-
default: true
|
|
41
|
-
},
|
|
42
|
-
side: {
|
|
43
|
-
type: null,
|
|
44
|
-
required: false,
|
|
45
|
-
default: "right"
|
|
46
|
-
},
|
|
47
|
-
portal: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
required: false,
|
|
50
|
-
default: true
|
|
51
|
-
},
|
|
52
|
-
close: {
|
|
53
|
-
type: [Boolean, Object],
|
|
54
|
-
required: false,
|
|
55
|
-
default: true
|
|
56
|
-
},
|
|
57
|
-
closeIcon: {
|
|
58
|
-
type: [Function, Object],
|
|
59
|
-
required: false
|
|
60
|
-
},
|
|
61
|
-
dismissible: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
required: false,
|
|
64
|
-
default: true
|
|
65
|
-
},
|
|
66
|
-
scrollbarThin: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
required: false,
|
|
69
|
-
default: true
|
|
70
|
-
},
|
|
71
|
-
class: {
|
|
72
|
-
type: null,
|
|
73
|
-
required: false
|
|
74
|
-
},
|
|
75
|
-
b24ui: {
|
|
76
|
-
type: Object,
|
|
77
|
-
required: false
|
|
78
|
-
},
|
|
79
|
-
open: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
required: false
|
|
82
|
-
},
|
|
83
|
-
defaultOpen: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: false
|
|
86
|
-
},
|
|
87
|
-
modal: {
|
|
88
|
-
type: Boolean,
|
|
89
|
-
required: false,
|
|
90
|
-
default: true
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
const emits = defineEmits(["after:leave", "update:open"]);
|
|
94
|
-
const slots = defineSlots();
|
|
95
|
-
const { t } = useLocale();
|
|
96
|
-
const rootProps = useForwardPropsEmits(reactivePick(props, "open", "defaultOpen", "modal"), emits);
|
|
97
|
-
const contentProps = toRef(() => props.content);
|
|
92
|
+
<script setup lang="ts">
|
|
93
|
+
import { computed, toRef } from 'vue'
|
|
94
|
+
import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from 'reka-ui'
|
|
95
|
+
import { reactivePick } from '@vueuse/core'
|
|
96
|
+
import { useLocale } from '../composables/useLocale'
|
|
97
|
+
import icons from '../dictionary/icons'
|
|
98
|
+
import B24Button from './Button.vue'
|
|
99
|
+
|
|
100
|
+
const props = withDefaults(defineProps<SlideoverProps>(), {
|
|
101
|
+
close: true,
|
|
102
|
+
portal: true,
|
|
103
|
+
overlay: true,
|
|
104
|
+
transition: true,
|
|
105
|
+
modal: true,
|
|
106
|
+
dismissible: true,
|
|
107
|
+
side: 'right',
|
|
108
|
+
scrollbarThin: true,
|
|
109
|
+
overlayBlur: 'auto'
|
|
110
|
+
})
|
|
111
|
+
const emits = defineEmits<SlideoverEmits>()
|
|
112
|
+
const slots = defineSlots<SlideoverSlots>()
|
|
113
|
+
|
|
114
|
+
const { t } = useLocale()
|
|
115
|
+
|
|
116
|
+
const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
|
|
117
|
+
const contentProps = toRef(() => props.content)
|
|
98
118
|
const contentEvents = computed(() => {
|
|
99
119
|
const events = {
|
|
100
|
-
closeAutoFocus: (e) => e.preventDefault()
|
|
101
|
-
}
|
|
120
|
+
closeAutoFocus: (e: Event) => e.preventDefault()
|
|
121
|
+
}
|
|
122
|
+
|
|
102
123
|
if (!props.dismissible) {
|
|
103
124
|
return {
|
|
104
|
-
pointerDownOutside: (e) => e.preventDefault(),
|
|
105
|
-
interactOutside: (e) => e.preventDefault(),
|
|
106
|
-
escapeKeyDown: (e) => e.preventDefault(),
|
|
125
|
+
pointerDownOutside: (e: Event) => e.preventDefault(),
|
|
126
|
+
interactOutside: (e: Event) => e.preventDefault(),
|
|
127
|
+
escapeKeyDown: (e: Event) => e.preventDefault(),
|
|
107
128
|
...events
|
|
108
|
-
}
|
|
129
|
+
}
|
|
109
130
|
}
|
|
110
|
-
|
|
111
|
-
|
|
131
|
+
|
|
132
|
+
return events
|
|
133
|
+
})
|
|
134
|
+
|
|
112
135
|
const b24ui = computed(() => slideover({
|
|
113
136
|
transition: props.transition,
|
|
114
137
|
side: props.side,
|
|
115
138
|
overlayBlur: props.overlayBlur
|
|
116
|
-
}))
|
|
139
|
+
}))
|
|
117
140
|
</script>
|
|
118
141
|
|
|
119
142
|
<template>
|
|
@@ -126,7 +149,7 @@ const b24ui = computed(() => slideover({
|
|
|
126
149
|
<DialogOverlay v-if="overlay" :class="b24ui.overlay({ class: props.b24ui?.overlay })" />
|
|
127
150
|
|
|
128
151
|
<DialogContent :data-side="side" :class="b24ui.content({ class: [!slots.default && props.class, props.b24ui?.content] })" v-bind="contentProps" @after-leave="emits('after:leave')" v-on="contentEvents">
|
|
129
|
-
<VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
|
|
152
|
+
<VisuallyHidden v-if="!!slots.content && ((title || !!slots.title) || (description || !!slots.description))">
|
|
130
153
|
<DialogTitle v-if="title || !!slots.title">
|
|
131
154
|
<slot name="title">
|
|
132
155
|
{{ title }}
|
|
@@ -167,9 +190,9 @@ const b24ui = computed(() => slideover({
|
|
|
167
190
|
:color="['left', 'right'].includes(props?.side) ? 'primary' : 'link'"
|
|
168
191
|
:aria-label="t('slideover.close')"
|
|
169
192
|
:b24ui="{
|
|
170
|
-
|
|
171
|
-
}"
|
|
172
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
193
|
+
leadingIcon: ['left', 'right'].includes(props?.side) ? 'group-hover:rounded-full group-hover:border-1 group-hover:border-current' : ''
|
|
194
|
+
}"
|
|
195
|
+
v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
|
|
173
196
|
:class="b24ui.close({ class: props.b24ui?.close })"
|
|
174
197
|
/>
|
|
175
198
|
</slot>
|
|
@@ -1,57 +1,90 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// import type { VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/b24ui/stacked-layout'
|
|
6
|
+
import { tv } from '../utils/tv'
|
|
7
|
+
import { useRoute } from 'vue-router'
|
|
8
|
+
|
|
9
|
+
const appConfigStackedLayout = _appConfig as AppConfig & { b24ui: { stackedLayout: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const stackedLayout = tv({ extend: tv(theme), ...(appConfigStackedLayout.b24ui?.stackedLayout || {}) })
|
|
12
|
+
|
|
13
|
+
// type StackedLayoutVariants = VariantProps<typeof stackedLayout>
|
|
14
|
+
|
|
15
|
+
export interface StackedLayoutProps {
|
|
16
|
+
/**
|
|
17
|
+
* The element or component this component should render as.
|
|
18
|
+
* @defaultValue 'div'
|
|
19
|
+
*/
|
|
20
|
+
as?: any
|
|
21
|
+
useLightContent?: boolean
|
|
22
|
+
class?: any
|
|
23
|
+
b24ui?: Partial<typeof stackedLayout.slots>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface StackedLayoutSlots {
|
|
27
|
+
/**
|
|
28
|
+
* Menu for mobile screen sizes.
|
|
29
|
+
* @param props
|
|
30
|
+
* @param props.handleClick - Handler for navigation click events
|
|
31
|
+
*/
|
|
32
|
+
sidebar(props: { handleClick: () => void }): any
|
|
33
|
+
/**
|
|
34
|
+
* Menu for desktop screen sizes.
|
|
35
|
+
*/
|
|
36
|
+
navbar(props?: {}): any
|
|
37
|
+
/**
|
|
38
|
+
* The page content.
|
|
39
|
+
*/
|
|
40
|
+
default(props?: {}): any
|
|
41
|
+
}
|
|
7
42
|
</script>
|
|
8
43
|
|
|
9
|
-
<script setup>
|
|
10
|
-
import { ref, computed, watch, onUnmounted } from
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const slots = defineSlots();
|
|
32
|
-
const route = useRoute();
|
|
33
|
-
const isUseSideBar = computed(() => !!slots.sidebar);
|
|
34
|
-
const openSidebarSlideover = ref(false);
|
|
44
|
+
<script setup lang="ts">
|
|
45
|
+
import { ref, computed, watch, onUnmounted } from 'vue'
|
|
46
|
+
import { Primitive } from 'reka-ui'
|
|
47
|
+
import B24Slideover from './Slideover.vue'
|
|
48
|
+
import B24Sidebar from './Sidebar.vue'
|
|
49
|
+
import B24ModalDialogClose from './ModalDialogClose.vue'
|
|
50
|
+
import B24Navbar from './Navbar.vue'
|
|
51
|
+
import MenuIcon from '@bitrix24/b24icons-vue/main/MenuIcon'
|
|
52
|
+
import Cross50Icon from '@bitrix24/b24icons-vue/actions/Cross50Icon'
|
|
53
|
+
|
|
54
|
+
const props = withDefaults(defineProps<StackedLayoutProps>(), {
|
|
55
|
+
as: 'div',
|
|
56
|
+
useLightContent: true
|
|
57
|
+
})
|
|
58
|
+
const slots = defineSlots<StackedLayoutSlots>()
|
|
59
|
+
|
|
60
|
+
const route = useRoute()
|
|
61
|
+
const isUseSideBar = computed(() => !!slots.sidebar)
|
|
62
|
+
const openSidebarSlideover = ref(false)
|
|
63
|
+
|
|
35
64
|
const b24ui = computed(() => stackedLayout({
|
|
36
65
|
useSidebar: isUseSideBar.value,
|
|
37
66
|
useLightContent: Boolean(props.useLightContent)
|
|
38
|
-
}))
|
|
67
|
+
}))
|
|
68
|
+
|
|
39
69
|
const closeModal = () => {
|
|
40
70
|
if (openSidebarSlideover.value) {
|
|
41
|
-
openSidebarSlideover.value = false
|
|
71
|
+
openSidebarSlideover.value = false
|
|
42
72
|
}
|
|
43
|
-
}
|
|
73
|
+
}
|
|
74
|
+
|
|
44
75
|
const stopWatcher = watch(
|
|
45
76
|
() => route.path,
|
|
46
77
|
() => closeModal(),
|
|
47
78
|
{ immediate: true }
|
|
48
|
-
)
|
|
79
|
+
)
|
|
80
|
+
|
|
49
81
|
onUnmounted(() => {
|
|
50
|
-
stopWatcher()
|
|
51
|
-
})
|
|
82
|
+
stopWatcher()
|
|
83
|
+
})
|
|
84
|
+
|
|
52
85
|
const handleNavigationClick = () => {
|
|
53
|
-
closeModal()
|
|
54
|
-
}
|
|
86
|
+
closeModal()
|
|
87
|
+
}
|
|
55
88
|
</script>
|
|
56
89
|
|
|
57
90
|
<template>
|