@volverjs/ui-vue 0.0.10-beta.36 → 0.0.10-beta.38
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/components/VvAlertGroup/VvAlertGroup.es.js +7 -6
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.es.js +28 -13
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +9 -0
- package/dist/components/VvDialog/index.d.ts +4 -0
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +6 -6
- package/dist/components/index.es.js +26 -19
- package/dist/components/index.umd.js +1 -1
- package/dist/icons.es.js +3 -3
- package/dist/icons.umd.js +1 -1
- package/dist/stories/Dialog/DialogModifiers.stories.d.ts +8 -0
- package/package.json +1 -1
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAlertGroup/VvAlertGroup.vue +1 -0
- package/src/components/VvAlertGroup/index.ts +6 -6
- package/src/components/VvDialog/VvDialog.vue +17 -8
- package/src/components/VvDialog/index.ts +8 -7
- package/src/stories/Dialog/Dialog.settings.ts +9 -1
- package/src/stories/Dialog/DialogModifiers.stories.ts +42 -0
|
@@ -40,14 +40,14 @@ export const VvAlertGroupProps = {
|
|
|
40
40
|
|
|
41
41
|
export const VvAlertGroupEvents = [
|
|
42
42
|
'close',
|
|
43
|
-
'
|
|
44
|
-
'
|
|
43
|
+
'beforeEnter',
|
|
44
|
+
'afterLeave',
|
|
45
45
|
'enter',
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
46
|
+
'afterEnter',
|
|
47
|
+
'enterCancelled',
|
|
48
|
+
'beforeLeave',
|
|
49
49
|
'leave',
|
|
50
|
-
'
|
|
50
|
+
'leaveCancelled',
|
|
51
51
|
]
|
|
52
52
|
|
|
53
53
|
export function useVvAlertGroup(props: Readonly<ExtractPropTypes<typeof VvAlertGroupProps>>, emit: (event: string, ...args: unknown[]) => void) {
|
|
@@ -27,19 +27,28 @@ const isOpened = computed({
|
|
|
27
27
|
// template ref
|
|
28
28
|
const modalWrapper = ref(null)
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* @description Define component classes with BEM style.
|
|
32
|
+
* @returns {Array} The component classes.
|
|
33
|
+
*/
|
|
34
|
+
const { modifiers } = toRefs(props)
|
|
35
|
+
const bemCssClasses = useModifiers(
|
|
36
|
+
'vv-dialog',
|
|
37
|
+
modifiers,
|
|
38
|
+
computed(() => {
|
|
39
|
+
if (props.size) {
|
|
40
|
+
return { [props.size]: !!props.size }
|
|
41
|
+
}
|
|
42
|
+
return {}
|
|
43
|
+
}),
|
|
44
|
+
)
|
|
45
|
+
|
|
31
46
|
const dialogAttrs = computed(() => {
|
|
32
47
|
const { id } = props
|
|
33
48
|
return {
|
|
34
49
|
id,
|
|
35
50
|
} as DialogHTMLAttributes
|
|
36
51
|
})
|
|
37
|
-
const dialogClass = computed(() => {
|
|
38
|
-
if (!props.size) {
|
|
39
|
-
return 'vv-dialog'
|
|
40
|
-
}
|
|
41
|
-
return ['vv-dialog', `vv-dialog--${props.size}`]
|
|
42
|
-
})
|
|
43
52
|
|
|
44
53
|
// transitions
|
|
45
54
|
const transitioName = computed(() => `vv-dialog--${props.transition}`)
|
|
@@ -114,7 +123,7 @@ export default {
|
|
|
114
123
|
v-show="isOpened"
|
|
115
124
|
v-bind="dialogAttrs"
|
|
116
125
|
ref="dialogEl"
|
|
117
|
-
:class="
|
|
126
|
+
:class="bemCssClasses"
|
|
118
127
|
@cancel.stop.prevent="onCancel"
|
|
119
128
|
>
|
|
120
129
|
<article ref="modalWrapper" class="vv-dialog__wrapper">
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { IdProps } from '
|
|
1
|
+
import { IdProps, ModifiersProps } from '@/props'
|
|
2
2
|
|
|
3
3
|
export const VvDialogEvents = [
|
|
4
4
|
'open',
|
|
5
5
|
'close',
|
|
6
6
|
'update:modelValue',
|
|
7
|
-
'
|
|
8
|
-
'
|
|
7
|
+
'beforeEnter',
|
|
8
|
+
'afterLeave',
|
|
9
9
|
'enter',
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
10
|
+
'afterEnter',
|
|
11
|
+
'enterCancelled',
|
|
12
|
+
'beforeLeave',
|
|
13
13
|
'leave',
|
|
14
|
-
'
|
|
14
|
+
'leaveCancelled',
|
|
15
15
|
]
|
|
16
16
|
|
|
17
17
|
export const VvDialogProps = {
|
|
18
|
+
...ModifiersProps,
|
|
18
19
|
...IdProps,
|
|
19
20
|
/**
|
|
20
21
|
* Dialog title
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArgTypes } from '@storybook/vue3'
|
|
2
|
-
import { DefaultSlotArgTypes } from '@/stories/argTypes'
|
|
2
|
+
import { DefaultSlotArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
|
|
3
3
|
|
|
4
4
|
export const defaultArgs = {
|
|
5
5
|
id: 'dialog',
|
|
@@ -16,6 +16,14 @@ export const argTypes: ArgTypes = {
|
|
|
16
16
|
control: 'radio',
|
|
17
17
|
options: ['fade-block', 'fade-inline', 'scale'],
|
|
18
18
|
},
|
|
19
|
+
modifiers: {
|
|
20
|
+
...ModifiersArgTypes.modifiers,
|
|
21
|
+
options: [
|
|
22
|
+
'standard',
|
|
23
|
+
'small',
|
|
24
|
+
'fullscreen',
|
|
25
|
+
],
|
|
26
|
+
},
|
|
19
27
|
size: {
|
|
20
28
|
control: 'radio',
|
|
21
29
|
options: ['standard', 'small', 'fullscreen'],
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import { Default } from './Dialog.stories'
|
|
3
|
+
import { argTypes, defaultArgs } from './Dialog.settings'
|
|
4
|
+
import VvDialog from '@/components/VvDialog/VvDialog.vue'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof VvDialog> = {
|
|
7
|
+
title: 'Components/Dialog/Modifiers',
|
|
8
|
+
component: VvDialog,
|
|
9
|
+
args: defaultArgs,
|
|
10
|
+
argTypes,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof VvDialog>
|
|
16
|
+
|
|
17
|
+
export const Standard: Story = {
|
|
18
|
+
...Default,
|
|
19
|
+
args: {
|
|
20
|
+
...Default.args,
|
|
21
|
+
title: 'Standard',
|
|
22
|
+
modifiers: 'standard',
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const Small: Story = {
|
|
27
|
+
...Default,
|
|
28
|
+
args: {
|
|
29
|
+
...Default.args,
|
|
30
|
+
title: 'Small',
|
|
31
|
+
modifiers: 'small',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const Fullscreen: Story = {
|
|
36
|
+
...Default,
|
|
37
|
+
args: {
|
|
38
|
+
...Default.args,
|
|
39
|
+
title: 'Fullscreen',
|
|
40
|
+
modifiers: 'fullscreen',
|
|
41
|
+
},
|
|
42
|
+
}
|